GSI Forum - RDF feed
type: channel
description: GSI Helmholtzzentrum für Schwerionenforschung
items: MC Truth propagation with FairLinks in timebased sim
items: Re: MC Truth propagation with FairLinks in timebased sim

MC Truth propagation with FairLinks in timebased sim
type: item
description: Dear all, I'm experiencing trouble with the MC propagation in the timebased simulation. Already at the digitisation stage, the link propagation appears to be broken. The digitisation macro returns "-E- FairMultiLinkedData_Interface::AddInterfaceData EntryNr == (-1/-1/-1/-1/1)" for each hit. SetUseFairLinks is set to true in all macros. As fas as I can grasp together from the code, this is the way the links are propagated: PndEmcHitProducer: MCTrack->EmcHit: PndEmcPoint* point = (PndEmcPoint*) fPointArray->At(iPoint); DetId = point->GetDetectorID(); if (point->GetEntering()){ fTrackEntering[DetId].AddLinks(point->GetLinksWithType(FairRootManager::Instance()->GetBranchId("MCTrack"))); } if (point->GetExiting()){ fTrackExiting[DetId].AddLinks(point->GetLinksWithType(FairRootManager::Instance()->GetBranchId("MCTrack"))); PndEmcFWEndcapTimebasedWaveforms: EmcHit->EmcWaveform: FairLink linkToHit(-1, ioman->GetEntryNr(), "EmcHit", iHit, 1.0); wfData.AddHit(linkToHit, ioman->GetEventTime() + theHit->GetTime()*1.0e9, theHit->GetEnergy()); PndEmcFWEndcapDigi: EmcWaveform->EmcDigi: myDigi->AddLink(FairLink("EmcWaveform", iWaveform)); PndEmcMakeClusterOnline: EmcDigi->EmcCluster: cluster->addDigi(fDigiArray,myDigi); cluster->AddLink(FairLink("EmcDigi", myDigi)); Can anyone see where it goes wrong, and maybe even if there is a simple fix for this? It would be preferable to have the ability to use the MC information.
creator: Marcel Tiemens
date: 2016-02-05T16:59:39-00:00

Re: MC Truth propagation with FairLinks in timebased sim
type: item
description: Which FairSoft/FairRoot/PandaRoot versions are you using?
creator: StefanoSpataro
date: 2016-02-06T01:41:20-00:00

Re: MC Truth propagation with FairLinks in timebased sim
type: item
description: For FairSoft and FairRoot I have the versions from the mar15 release. PandaRoot is at revision 28807
creator: Marcel Tiemens
date: 2016-02-08T09:23:19-00:00

Re: MC Truth propagation with FairLinks in timebased sim
type: item
description: Hi, for FairRoot you should use v15.11, where several fixes n FairLink were included. Can you please try and let us know?
creator: StefanoSpataro
date: 2016-02-08T10:21:22-00:00

Re: MC Truth propagation with FairLinks in timebased sim
type: item
description: Okay... How do you update FairROOT? I can't seem to find instructions for that anywhere. Only on how to install it. Is there a GIT equivalent of "svn update"?
creator: Marcel Tiemens
date: 2016-02-08T12:57:50-00:00

Re: MC Truth propagation with FairLinks in timebased sim
type: item
description: I think it is better to have a separate installation in different folders.
creator: StefanoSpataro
date: 2016-02-08T14:18:31-00:00

Re: MC Truth propagation with FairLinks in timebased sim
type: item
description: All right, after some wrestling, I installed the new FairRoot release, this time with ROOT 5, as ROOT 6 wasn't really working out for me. However, I still get the same warning from the timebased digitisation macro: -E- FairMultiLinkedData_Interface::AddInterfaceData EntryNr == (-1/-1/-1/-1/1) I first reran the simulation macro as well to be sure everything was done using the new FairRoot.
creator: Marcel Tiemens
date: 2016-02-11T13:21:24-00:00

Re: MC Truth propagation with FairLinks in timebased sim
type: item
description: In theory with FairSoft mar15 there is no root6. Are you sure you are using the correct stuff?
creator: StefanoSpataro
date: 2016-02-11T15:08:18-00:00

Re: MC Truth propagation with FairLinks in timebased sim
type: item
description: I'm pretty sure I have the new FairRoot, as some functions have be changed (SetInputFile has moved to FairFileSource, SetEventMeanTime to FairSource [I think]). I now see why I was offered the choice for ROOT 6 (which also started my other thread on the compilation errors); I was using the instructions from the Step-by-step installation on https://github.com/FairRootGroup/FairRoot, which tells you to use git clone -b dev https://github.com/FairRootGroup/FairSoft.git, which I guess downloads a development version of FairSoft. But in my recent install, I followed the instructions on the Wiki.
creator: Marcel Tiemens
date: 2016-02-11T15:29:23-00:00

Re: MC Truth propagation with FairLinks in timebased sim
type: item
description: Please use the pandaroot wiki installation, I am not able to follow random versions. In particular of the FairSoft dev. https://panda-wiki.gsi.de/foswiki/bin/view/Computing/PandaRootInstallGit How to reproduce your problem? Please send the macro.
creator: StefanoSpataro
date: 2016-02-11T15:33:32-00:00

Re: MC Truth propagation with FairLinks in timebased sim
type: item
description: I'm using the attached macros for the simulation and digitisation, which are based on sim_complete.C and digi_complete.C in /macro/run/ Maybe you also need the par file.
creator: Marcel Tiemens
date: 2016-02-11T15:45:32-00:00

Re: MC Truth propagation with FairLinks in timebased sim
type: item
description: This is what I get with 1000 events: Toggle Spoiler INFO ] Branch: EmcMultiWaveform not found in Tree. fEmcDigiPositionDepthPWO: 6.2 fEmcDigiPositionDepthShashlyk: 20.9 -I- PndEmcFWEndcapDigi: Intialization successfull [INFO ] FairRunAna::Run() After checking, the run will run from event 0 to 1000. -E- Timestamp -20 below lower bound 0 EntryNr of Data: (0/121/7/0/1) TimeStamp: -20 +/- -1 (0/121/7/0/1) -> [(-1/2/2/44/2) ]-E- Timestamp -157.5 below lower bound 0 EntryNr of Data: (0/121/7/4/1) TimeStamp: -157.5 +/- -1 (0/121/7/4/1) -> [(-1/4/2/3/2) ]-E- Timestamp -32.5 below lower bound 0 EntryNr of Data: (0/121/7/7/1) TimeStamp: -32.5 +/- -1 (0/121/7/7/1) -> [(-1/5/2/52/2) ]-E- Timestamp -32.5 below lower bound 0 EntryNr of Data: (0/121/7/9/1) TimeStamp: -32.5 +/- -1 (0/121/7/9/1) -> [(-1/7/2/18/2) ]-E- Timestamp -157.5 below lower bound 0 EntryNr of Data: (0/121/7/10/1) TimeStamp: -157.5 +/- -1 (0/121/7/10/1) -> [(-1/7/2/31/2) ]-E- Timestamp -45 below lower bound 0 EntryNr of Data: (0/122/7/0/1) TimeStamp: -45 +/- -1 (0/122/7/0/1) -> [(-1/0/2/25/2) ]-E- Timestamp -107.5 below lower bound 0 EntryNr of Data: (0/122/7/2/1) TimeStamp: -107.5 +/- -1 (0/122/7/2/1) -> [(-1/2/2/19/2) ]-E- Timestamp -7.5 below lower bound 0 EntryNr of Data: (0/122/7/3/1) TimeStamp: -7.5 +/- -1 (0/122/7/3/1) -> [(-1/6/2/30/2) ]-E- Timestamp -82.5 below lower bound 0 EntryNr of Data: (0/125/7/4/1) TimeStamp: -82.5 +/- -1 (0/125/7/4/1) -> [(-1/3/2/60/2) ]-E- Timestamp -182.5 below lower bound 0 EntryNr of Data: (0/125/7/5/1) TimeStamp: -182.5 +/- -1 (0/125/7/5/1) -> [(-1/5/2/62/2) ]-E- Timestamp -32.5 below lower bound 0 EntryNr of Data: (0/125/7/10/1) TimeStamp: -32.5 +/- -1 (0/125/7/10/1) -> [(-1/10/2/60/2) ]-E- Timestamp -7.5 below lower bound 0 EntryNr of Data: (0/127/7/6/1) TimeStamp: -7.5 +/- -1 (0/127/7/6/1) -> [(-1/4/2/45/2) ]-E- Timestamp -145 below lower bound 0 EntryNr of Data: (0/127/7/7/1) TimeStamp: -145 +/- -1 (0/127/7/7/1) -> [(-1/5/2/51/2) ]-E- Timestamp -132.5 below lower bound…
creator: StefanoSpataro
date: 2016-02-11T17:04:28-00:00

Re: MC Truth propagation with FairLinks in timebased sim
type: item
description: I found why it wasn't fixed. I made some changes to some of the base classes (EmcDigi and EmcCluster), and then got too enthousiastic with copying stuff from my previous pandaroot install. I needed the new versions of PndEmcWaveformBuffer.cxx, PndEmcFWEndcapTimebasedWaveforms.cxx, PndEmcFWEndcapDigi.cxx, and PndEmcFullStackedWaveformSimulator.cxx But for some reason, root creates unreadable root files now. When I click a leaf in the digi file root tree, nothing happens, though tree->GetEntries() tells me there are 100 entries (I ran with 100 events just to test)... Does anyone know what could cause this to happen?
creator: Marcel Tiemens
date: 2016-02-12T16:26:26-00:00

Re: MC Truth propagation with FairLinks in timebased sim
type: item
description: Maybe there is some condition which is skipping the add of the new elements into the TClonesArray. Do you have only emc TCAs empty, or even for the other detectors? Is the EventHeader empty? In any case, I would suggest to put some cout and check all the conditions.
creator: StefanoSpataro
date: 2016-02-13T22:34:43-00:00

Re: MC Truth propagation with FairLinks in timebased sim
type: item
description: I tried tracing the problem, but I still don't understand what's causing it. As far as I can see, this is where it goes wrong: PndEmcFWEndcapTimebasedWaveforms puts EmcWaveforms somewhere using FairWriteoutBuffer, but for some reason the next step, PndEmcFWEndcapDigi, has zero entries in its input waveform array. Hits are converted to waveforms using (Init) ... // Create and activiate output Buffer....choose between PndEmcWaveform and PndEmcMultiWaveform #ifndef MULTI fWaveformBuffer = new PndEmcWaveformBuffer("EmcWaveform", "PndEmcWaveform", "Emc", fStoreWaves); #else fWaveformBuffer = new PndEmcWaveformBuffer("EmcWaveform", "PndEmcMultiWaveform", "Emc", fStoreWaves); #endif fWaveformBuffer = (PndEmcWaveformBuffer*) ioman ->RegisterWriteoutBuffer("EmcTimebasedWaveform", fWaveformBuffer); ...etc (Exec) ... // construct corresponding waveform data Object PndEmcWaveformData wfData(theHit->GetDetectorID(), wfSimulator); //register hit...timebased framework uses ns, whereas emc deals with seconds as time unit FairLink linkToHit(-1, ioman->GetEntryNr(), "EmcHit", iHit, 1.0); wfData.AddHit(linkToHit, ioman->GetEventTime() + theHit->GetTime()*1.0e9, theHit->GetEnergy()); fWaveformBuffer->FillNewData(&wfData); ...etc , and it looks like the buffer is written out only at the end. The next task tries to make digis out of them using (Init) ... // Get input array fWaveformArray = (TClonesArray*) ioman->GetObject("EmcMultiWaveform"); if (!fWaveformArray) { //check if EmcWaveform contains MultiWaveforms fWaveformArray = (TClonesArray*) ioman->GetObject("EmcWaveform"); if((!fWaveformArray) || (!fWaveformArray->GetClass()->InheritsFrom("PndEmcMultiWaveform"))){ cout << "-W- PndEmcFWEndcapDigi::Init: " << "No PndEmcWaveform array containing multi waveforms!" << endl; return kERROR; } } // Create and register output array fDigiArray = ioman->Register("EmcDigi","PndEmcDigi", "Emc", fStoreDigis); ...etc , but then fWaveformArray->GetEntriesFast() yields zero in the Exec part. Also, the…
creator: Marcel Tiemens
date: 2016-02-26T12:53:37-00:00

Re: MC Truth propagation with FairLinks in timebased sim
type: item
description: About macros, if you update the folder you will have the correct macros. There was a wrong commit few weeks ago.
creator: StefanoSpataro
date: 2016-02-26T17:31:49-00:00

Re: MC Truth propagation with FairLinks in timebased sim
type: item
description: Yes, the default macros are working now. In another attempt to fix my problems, which you apperantly don't have, I performed svn update and tried to recompile pandaroot completely. It finishes with the following: [100%] Generating ../lib/libCATracking.rootmap cannot open linkdef file CATrackingLinkDef.h [100%] Built target libCATracking.rootmap Then, when I try to run the root macros, root gives the following error: dlopen error: /home/marcel/jan16/pandaroot/buildPanda/lib/libEmc.so: undefined symbol: _ZN20PndEmcCRRCPulseshape11ShowMembersER16TMemberInspector Load Error: Failed to load Dynamic link library /home/marcel/jan16/pandaroot/buildPanda/lib/libEmc.so So, some automatically generated symbol is not defined, apparently in an inherited function in PndEmcCRRCPulseshape. I think I've seen this error before, but don't know how to fix it. Any suggestions?
creator: Marcel Tiemens
date: 2016-03-08T11:04:38-00:00

Re: MC Truth propagation with FairLinks in timebased sim
type: item
description: EMC package has been updated. Are you sure you are using the most recent version? Because the problem you are describing was already fixed few versions ago, check the following link: https://subversion.gsi.de/trac/fairroot/changeset?reponame=&new=2893 4%40pandaroot%2Ftrunk%2Femc&old=28851%40pandaroot%2Ftrunk%2Femc
creator: StefanoSpataro
date: 2016-03-08T11:10:35-00:00

Re: MC Truth propagation with FairLinks in timebased sim
type: item
description: Ah yes, the EmcLinkDef was not updated; I used my own version because I'm adding a few new classes. Now that I added that one to it as well, it works. I feel a bit emberassed that it was again due to something silly that I did myself... Oh well.
creator: Marcel Tiemens
date: 2016-03-08T12:00:33-00:00

Re: MC Truth propagation with FairLinks in timebased sim
type: item
description: But, what I want to test still doesn't work. If I compare with what's done in the default macros, which use PndEmcHitsToWaveform and PndEmcWaveformToDigi, these are the main differences: 1) PndEmcHitsToWaveform uses PndEmcWaveformWriteoutBuffer, and PndEmcFWEndcapTimebasedWaveforms uses PndEmcWaveformBuffer. 2) PndEmcWaveformToDigi uses a functor to get waveforms from a given timeslot in this way: fDigiArray->Delete(); Double_t fevtTime = FairRootManager::Instance()->GetEventTime(); if(fTimeOrderedDigi){ if(FairRunAna::Instance()->IsTimeStamp()){ fWaveformArray->Delete(); Double_t time_length = 40.;//99.98% if(fVerbose >0) cout<<"--I-- time-based simulation, read data to later #"<<time_length<<" ns"<<endl; fWaveformArray = FairRootManager::Instance()->GetData("EmcSortedWaveform" , fFunctor , fevtTime + time_length); } if(fVerbose>0) std::cout<<"fDigiArrayTBD size #"<<PndEmcDigi::fDigiArrayTBD->GetEntriesFast()<<std::endl; } Int_t nWaveforms = fWaveformArray->GetEntriesFast(); ... while PndEmcFWEndcapDigi just asks for the length of the waveform array right away: fDigiArray->Delete(); Int_t nWaveforms = fWaveformArray->GetEntriesFast(); ... That could be why it's not working. But the point is, it did work before! But with the new FairRoot and PandaRoot version not anymore...
creator: Marcel Tiemens
date: 2016-03-08T16:22:31-00:00