FairRoot/PandaRoot
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
PndEmcMakeCluster Class Reference

Task to cluster PndEmcDigis. More...

#include <PndEmcMakeCluster.h>

Inheritance diagram for PndEmcMakeCluster:
PndPersistencyTask

Public Member Functions

 PndEmcMakeCluster (Int_t verbose=0, Bool_t storeclusters=kTRUE)
 
virtual ~PndEmcMakeCluster ()
 
virtual InitStatus Init ()
 Init Task. More...
 
virtual void Exec (Option_t *opt)
 Runs the task. More...
 
virtual void ExecuteTasks (Option_t *option)
 Finish clusters after subtasks have been executed. More...
 
void SetStorageOfData (Bool_t val)
 Method to specify whether clusters are stored or not. More...
 
void StoreClusterBaseDigis (Bool_t val=kTRUE)
 Method to specify whether underlying digis are stored or not. More...
 
void SetClusterActiveTime (Double_t time)
 Override EmcRecoPar cluster active time parameter ..to be set in ns!!! More...
 
void SetPersistency (Bool_t val=kTRUE)
 
Bool_t GetPersistency ()
 

Protected Member Functions

virtual void SetParContainers ()
 
virtual void FinishClusters ()
 Calls FinishCluster() for each cluster. More...
 

Private Member Functions

void FinishCluster (PndEmcCluster *tmpcluster)
 Assign final parameters to cluster. More...
 
bool HasExpired (PndEmcDigi *latestDigi, PndEmcCluster *theCluster, Int_t clusterIdx)
 Finishes clusters in timebased analysis. More...
 
void cleansortmclist (std::vector< Int_t > &newlist, TClonesArray *mcTrackArray)
 Helper function, does not depend on class, identical to the one in PndEmcHitProducer. More...
 
 PndEmcMakeCluster (const PndEmcMakeCluster &)
 
PndEmcMakeClusteroperator= (const PndEmcMakeCluster &)
 

Private Attributes

TClonesArray * fDigiArray
 
TClonesArray * fHitArray
 
TClonesArray * fMCTrackArray
 
TClonesArray * fClusterArray
 active clusters More...
 
TClonesArray * fWriteOutArray
 expired clusters More...
 
BinaryFunctor * fDigiFunctor
 
std::vector< PndEmcCluster * > fClusterList
 
Double_t fDigiEnergyTresholdBarrel
 
Double_t fDigiEnergyTresholdFWD
 
Double_t fDigiEnergyTresholdBWD
 
Double_t fDigiEnergyTresholdShashlyk
 
Double_t fClusterActiveTime
 Defines how long clusters are kept open in timebased reconstruction. More...
 
std::vector< Double_tfClusterPosParam
 
Int_t fMapVersion
 
PndEmcGeoParfGeoPar
 
PndEmcDigiParfDigiPar
 
PndEmcRecoParfRecoPar
 
Int_t fVerbose
 
Bool_t fStoreClusters
 
Bool_t fStoreClusterBase
 
TStopwatch fTimer
 

Static Private Attributes

static Int_t fEventCounter =0
 

Detailed Description

Task to cluster PndEmcDigis.

Task to cluster PndEmcDigis. In the eventbased version clusters are built within one event, all adjacent digis go in one cluster. The timebased version assigns an active time to every cluster. Once expired, no digis can be added any more to cluster. The spatial cluster condition remains the same as in the eventbased reconstruction

Definition at line 36 of file PndEmcMakeCluster.h.

Constructor & Destructor Documentation

PndEmcMakeCluster::PndEmcMakeCluster ( Int_t  verbose = 0,
Bool_t  storeclusters = kTRUE 
)

Definition at line 49 of file PndEmcMakeCluster.cxx.

References fClusterList, fClusterPosParam, and PndPersistencyTask::SetPersistency().

49  :
50 PndPersistencyTask("EmcClusteringTask", verbose),
52 {
53  fClusterList.clear();
54  fClusterPosParam.clear();
55  SetPersistency(storeclusters);
56 }
PndEmcDigiPar * fDigiPar
Double_t fDigiEnergyTresholdBWD
Double_t fDigiEnergyTresholdShashlyk
TClonesArray * fClusterArray
active clusters
#define verbose
void SetPersistency(Bool_t val=kTRUE)
TClonesArray * fHitArray
PndEmcRecoPar * fRecoPar
TClonesArray * fDigiArray
Double_t fDigiEnergyTresholdFWD
parameter set of Emc digitisation
Definition: PndEmcDigiPar.h:12
std::vector< PndEmcCluster * > fClusterList
std::vector< Double_t > fClusterPosParam
Double_t fDigiEnergyTresholdBarrel
BinaryFunctor * fDigiFunctor
PndEmcGeoPar * fGeoPar
TClonesArray * fMCTrackArray
TClonesArray * fWriteOutArray
expired clusters
Parameter set for Emc Reco.
Definition: PndEmcRecoPar.h:12
PndEmcMakeCluster::~PndEmcMakeCluster ( )
virtual

Definition at line 61 of file PndEmcMakeCluster.cxx.

62 {
63 }
PndEmcMakeCluster::PndEmcMakeCluster ( const PndEmcMakeCluster )
private

Member Function Documentation

void PndEmcMakeCluster::cleansortmclist ( std::vector< Int_t > &  newlist,
TClonesArray *  mcTrackArray 
)
private

Helper function, does not depend on class, identical to the one in PndEmcHitProducer.

Currently not used.

Parameters
newlist...
mcTrackArray...
Returns
void

Definition at line 432 of file PndEmcMakeCluster.cxx.

References PndMCTrack::GetMotherID(), and pt().

433 {
434  std::vector <Int_t> tmplist;
435  // Sort list...
436  std::sort( newlist.begin(), newlist.end());
437  // and copy every id only once (even though it might be in the list several times)
438  std::unique_copy( newlist.begin(), newlist.end(), std::back_inserter( tmplist ) );
439 
440  // Now check if mother or (grand)^x-mother are already in the list
441  // (which means i am a secondary)... if so, remove myself
442  for(Int_t j=tmplist.size()-1; j>=0; j--){
443  bool flag;
444  PndMCTrack *pt;
445  pt=((PndMCTrack*)mcTrackArray->At(tmplist[j]));
446  if(pt->GetMotherID()<0) continue;
447  flag=false;
448  while(!flag){
449  Int_t id;
450  id=pt->GetMotherID();
451  if(id<0) break;
452  pt=(PndMCTrack*)mcTrackArray->At(id);
453 
454  for(Int_t k=j-1; k>=0; k--){
455  if(tmplist[k]==id){
456  tmplist.erase(tmplist.begin()+j);
457  flag=true;
458  break;
459  }
460  }
461  }
462  }
463  newlist=tmplist;
464 }
TString pt(TString pts, TString exts="px py pz")
Definition: invexp.C:133
Int_t GetMotherID() const
Definition: PndMCTrack.h:74
void PndEmcMakeCluster::Exec ( Option_t *  opt)
virtual

Runs the task.

The task loops over the digis and adds neighboring digis (PndEmcTwoCoordIndex::IsNeighbour()) to clusters.

Parameters
optunused
Returns
void

Definition at line 161 of file PndEmcMakeCluster.cxx.

References PndEmcCluster::addCluster(), PndEmcCluster::addDigi(), PndEmcCluster::AddTracksEnteringExiting(), fClusterActiveTime, fClusterArray, fDigiArray, fDigiEnergyTresholdBarrel, fDigiEnergyTresholdBWD, fDigiEnergyTresholdFWD, fDigiEnergyTresholdShashlyk, fDigiFunctor, fTimer, fVerbose, fWriteOutArray, PndEmcDigi::GetEnergy(), PndEmcDigi::GetModule(), PndEmcHit::GetTrackEntering(), PndEmcHit::GetTrackExiting(), HasExpired(), hit(), i, PndEmcCluster::isInCluster(), PndEmcCluster::SetTrackEntering(), and PndEmcCluster::SetTrackExiting().

162 {
163 
164  if (fVerbose>2){
165  fTimer.Start();
166  }
167  // Reset output array
168  if ( ! fClusterArray ) Fatal("Exec", "No Cluster Array");
169 
170  fWriteOutArray->Delete();
171 
172 // std::cout << "------ Event " << FairRootManager::Instance()->GetEntryNr() << " ------" << std::endl;
173 
174  if(FairRunAna::Instance()->IsTimeStamp()) {
175  fDigiArray->Delete();
176  fDigiArray->AbsorbObjects(FairRootManager::Instance()->GetData("EmcDigiSorted", fDigiFunctor, fClusterActiveTime));
177  }
178 
179 
180  Int_t nDigis = fDigiArray->GetEntriesFast();
181  if (fVerbose>2){
182  cout<<"DigiList length "<<nDigis<<endl;
183  }
184 
185  //loop to build Cluster
186  for (Int_t iDigi=0; iDigi<nDigis; iDigi++)
187  {
188  PndEmcDigi* theDigi = (PndEmcDigi*) fDigiArray->At(iDigi);
189 // std::cout << std::endl << "DigiArray: " << iDigi << std::endl;
190 // theDigi->Print();
191 // std::cout << *theDigi->GetPointerToLinks() << std::endl;
192 // std::cout << std::endl;
193  Int_t module=theDigi->GetModule();
194 
195  // In the following lines there is separate threshold for forward endcap
196  // and the same for barrel and backward and shashlyk EMC, but for last 2 threshold probably should be different
197  if ((module==1||module==2)&&(theDigi->GetEnergy()< fDigiEnergyTresholdBarrel)) continue;
198  if ((module==3)&&(theDigi->GetEnergy()< fDigiEnergyTresholdFWD)) continue;
199  if ((module==4)&&(theDigi->GetEnergy()< fDigiEnergyTresholdBWD)) continue;
200  if ((module==5)&&(theDigi->GetEnergy()< fDigiEnergyTresholdShashlyk)) continue;
201 
202  bool isAdded = false;
203  Int_t clustmarker=0;
204  Int_t clustLength=fClusterArray->GetEntriesFast();
205 
206  for(Int_t i=0;i<clustLength;i++)
207  {
208  PndEmcCluster* cluster= (PndEmcCluster*) fClusterArray->At(i);
209  if(HasExpired(theDigi, cluster, i)) {
210  clustLength--;
211  i--;
212  continue;
213  } else {
214 // std::cout << "Clusterarray: " << i << std::endl;
215  }
216 
217  if(cluster->isInCluster(theDigi, fDigiArray))
218  {
219  if(!isAdded) {
220  clustmarker=i;
221  isAdded=true;
222  cluster->addDigi(fDigiArray, iDigi);
223  //cluster->AddLink(FairLink("EmcDigi", iDigi));
224  FairMultiLinkedData hitLinks = theDigi->GetLinksWithType(FairRootManager::Instance()->GetBranchId("EmcHit"));
225  for (Int_t j = 0; j < hitLinks.GetNLinks(); j++){
226  PndEmcHit* hit = (PndEmcHit*)FairRootManager::Instance()->GetCloneOfLinkData(hitLinks.GetLink(j));
227  //std::cout << "Hit: " << hit->GetDetectorID() << std::endl;
228  if(hit) {
229 // std::cout << "Cluster : " << clustmarker << " Hit to add: " << hitLinks.GetLink(j) << std::endl;
230  if (cluster->GetLinks().count(hitLinks.GetLink(j)) == 0){
232  cluster->AddLink(hitLinks.GetLink(j));
233 // std::cout << "Links in Cluster: " << *cluster->GetPointerToLinks() << std::endl;
234 // std::cout << "EnteringExiting for Hit: " << hitLinks.GetLink(j) << std::endl;
235 // std::cout << "TrackEntering: " << hit->GetTrackEntering() << std::endl;
236 // std::cout << "TrackExiting: " << hit->GetTrackExiting() << std::endl;
237 // std::cout << "Resulting Enter: " << cluster->GetTrackEntering() << std::endl;
238 // std::cout << "Resulting Exit: " << cluster->GetTrackExiting() << std::endl;
239  } else {
240  //std::cout << "Hit Already exists!" << std::endl;
241  }
242  delete(hit);
243 
244  } else {
245  std::cout << "-E in PndEmcMakeCluster::Exec FairLink " << hitLinks.GetLink(j) << "to EmcHit delivers null" << std::endl;
246  }
247  }
248  }
249  else
250  {
251  PndEmcCluster* clust_clustmarker=(PndEmcCluster*) fClusterArray->At(clustmarker);
252  PndEmcCluster* clust_i=(PndEmcCluster*) fClusterArray->At(i);
253  clust_clustmarker->addCluster(clust_i, fDigiArray);
254  fClusterArray->RemoveAt(i);
255  fClusterArray->Compress();
256  clustLength--;
257  i--;
258  }
259  }
260  }
261 
262  if (!isAdded)
263  {
264  PndEmcCluster* newcluster = new((*fClusterArray)[clustLength]) PndEmcCluster();
265  newcluster->addDigi(fDigiArray, iDigi);
266 
267  FairMultiLinkedData hitLinks = theDigi->GetLinksWithType(FairRootManager::Instance()->GetBranchId("EmcHit"));
268  //std::cout << "HitLinks isNotAdded: " << hitLinks << std::endl;
269  // theDigi->Print(); std::cout << std::endl;
270  for (Int_t i = 0; i < hitLinks.GetNLinks(); i++){
271  PndEmcHit* hit = (PndEmcHit*)FairRootManager::Instance()->GetCloneOfLinkData(hitLinks.GetLink(i));
272  if(hit) {
273 // std::cout << "NewCluster : " << clustLength << " Hit Added: " << hitLinks.GetLink(i) << std::endl;
274 // std::cout << "TrackEntering: " << hit->GetTrackEntering() << std::endl;
275 // std::cout << "TrackExiting: " << hit->GetTrackExiting() << std::endl;
276  newcluster->SetTrackEntering(hit->GetTrackEntering());
277  newcluster->SetTrackExiting(hit->GetTrackExiting());
278  newcluster->SetInsertHistory(kFALSE);
279  newcluster->AddLink(hitLinks.GetLink(i));
280 // std::cout << "Resulting Enter: " << newcluster->GetTrackEntering() << std::endl;
281 // std::cout << "Resulting Exit: " << newcluster->GetTrackExiting() << std::endl;
282 // std::cout << "Links in Cluster: " << *newcluster->GetPointerToLinks() << std::endl;
283  delete(hit);
284  } else {
285  std::cout << "-E in PndEmcMakeCluster::Exec FairLink " << hitLinks.GetLink(i) << "to EmcHit delivers null" << std::endl;
286  }
287  }
288  //newcluster->SetLink(FairLink("EmcDigi", iDigi));
289  }
290  }
291 // for (int k = 0; k < fClusterArray->GetEntriesFast(); k++){
292 // PndEmcCluster* myCluster = (PndEmcCluster*)fClusterArray->At(k);
293 // std::cout << k << " : Entering: " << myCluster->GetTrackEntering() << std::endl;
294 // std::cout << k << " : Exiting: " << myCluster->GetTrackExiting() << std::endl;
295 // }
296 // std::cout << std::endl;
297 
298  fWriteOutArray->AbsorbObjects(fClusterArray);
299 }
Double_t fDigiEnergyTresholdBWD
bool isInCluster(PndEmcDigi *theDigi, const TClonesArray *digiArray)
Double_t fDigiEnergyTresholdShashlyk
Double_t fClusterActiveTime
Defines how long clusters are kept open in timebased reconstruction.
virtual Double_t GetEnergy() const
Definition: PndEmcDigi.cxx:296
represents the reconstructed hit of one emc crystal
Definition: PndEmcDigi.h:40
Int_t i
Definition: run_full.C:25
FairMultiLinkedData GetTrackEntering() const
Definition: PndEmcHit.h:65
TClonesArray * fClusterArray
active clusters
FairMultiLinkedData GetTrackExiting() const
Definition: PndEmcHit.h:66
void SetTrackExiting(const FairMultiLinkedData &tracks)
void AddTracksEnteringExiting(const FairMultiLinkedData &tracksEntering, const FairMultiLinkedData &tracksExiting)
Updates the links to entering and exiting tracks.
Short_t GetModule() const
Definition: PndEmcDigi.h:103
void addCluster(PndEmcCluster *cluster, const TClonesArray *digiArray)
TClonesArray * fDigiArray
Double_t fDigiEnergyTresholdFWD
a cluster (group of neighboring crystals) of hit emc crystals
Definition: PndEmcCluster.h:29
represents the deposited energy of one emc crystal from simulation
Definition: PndEmcHit.h:26
int hit(Int_t nEvents=0, TString inFile="sim.root", TString parFile="par.root", TString inDigi="digi.root", TString outFile="hit.root", Int_t timeBased=0)
Definition: hit.C:1
Double_t fDigiEnergyTresholdBarrel
BinaryFunctor * fDigiFunctor
void SetTrackEntering(const FairMultiLinkedData &tracks)
bool HasExpired(PndEmcDigi *latestDigi, PndEmcCluster *theCluster, Int_t clusterIdx)
Finishes clusters in timebased analysis.
TClonesArray * fWriteOutArray
expired clusters
virtual void addDigi(const TClonesArray *digiArray, Int_t iDigi)
virtual void PndEmcMakeCluster::ExecuteTasks ( Option_t *  option)
inlinevirtual

Finish clusters after subtasks have been executed.

Definition at line 48 of file PndEmcMakeCluster.h.

References FinishClusters().

48  {
49  PndPersistencyTask::ExecuteTasks(option);
51  }
virtual void FinishClusters()
Calls FinishCluster() for each cluster.
void PndEmcMakeCluster::FinishCluster ( PndEmcCluster tmpclust)
private

Assign final parameters to cluster.

Calculates properties of the cluster and sets them.

Assign final parameters to cluster. Subtasks might introduce changes in cluster composition. To keep track of them, function is called after subtasks have been executed

The calculated properties include the energy, position, timestamp and Zernike moments.

Parameters
tmpclustThe cluster to work on
Returns
void

Definition at line 310 of file PndEmcMakeCluster.cxx.

References PndEmcXClMoments::AbsZernikeMoment(), PndEmcClusterProperties::Energy(), fClusterPosParam, fDigiArray, fRecoPar, PndEmcRecoPar::GetEmcClusterPosMethod(), PndEmcCluster::GetTrackEntering(), PndEmcXClMoments::Lat(), PndEmcCluster::Maxima(), PndEmcCluster::SetEnergy(), PndEmcCluster::SetLatMom(), PndEmcCluster::SetPosition(), PndEmcCluster::SetZ20(), PndEmcCluster::SetZ53(), and PndEmcClusterProperties::Where().

Referenced by FinishClusters().

311 {
312  using namespace std;
313 
314  //cout << "\tfinalizing cluster: ";
315  //cout << "\tmaxTime: " << tmpclust->GetTimeStamp() << endl;
316  //cout << "\tcontains the following digis: " << endl;
317  //for(unsigned int i=0; i<tmpclust->DigiList().size(); ++i) {
318  //cout << "\t#:" << i << "\ttime: " << ((PndEmcDigi*) (fDigiArray->UncheckedAt(tmpclust->DigiList()[i])))->GetTimeStamp() << "\tenergy: " << ((PndEmcDigi*) (fDigiArray->UncheckedAt(tmpclust->DigiList()[i])))->GetEnergy() << "\tidx: " << ((PndEmcDigi*) (fDigiArray->UncheckedAt(tmpclust->DigiList()[i])))->GetDetectorId() << endl;
319  //}
320 
321  PndEmcClusterProperties clustProperties(*tmpclust, fDigiArray);
322 
323  tmpclust->SetEnergy(clustProperties.Energy());
324  tmpclust->SetTimeStamp(tmpclust->Maxima(fDigiArray)->GetTimeStamp());
325  TVector3 tmpbumppos = clustProperties.Where(fRecoPar->GetEmcClusterPosMethod(), fClusterPosParam);
326  tmpclust->SetPosition(tmpbumppos);
327  PndEmcXClMoments xClMoments(*tmpclust, fDigiArray);
328  tmpclust->SetZ20(xClMoments.AbsZernikeMoment(2, 0, 15));
329  tmpclust->SetZ53(xClMoments.AbsZernikeMoment(5, 3, 15));
330  tmpclust->SetLatMom(xClMoments.Lat());
331  tmpclust->SetLinks(tmpclust->GetTrackEntering());
332  // std::cout << "ClusterOutput: " << std::endl;
333  // tmpclust->Print();
334  //const std::vector<Int_t>& MCTruth = tmpclust->GetMcList();
335  //std::cout<<"The cluster #"<<i<<" produced by MC Track #";
336  //for(Int_t j=0;j<MCTruth.size();++j)
337  // cout<<MCTruth[j]<<' ';
338  //cout<<endl;
339 
340  //tmpclust->fMcList.clear();
341  //if(fHitArray && fMCTrackArray && !FairRunAna::Instance()->IsTimeStamp()){
342  // // BS: this is a first order approximation only !!!!
343 
344  // std::vector <Int_t> newlist;
345  // newlist.clear();
346  // for(Int_t j=0; j<tmpclust->fDigiList.size(); j++){
347  // PndEmcDigi*m;
348  // m=(PndEmcDigi*)fDigiArray->At(tmpclust->fDigiList[j]);
349 
350  // Int_t inx;
351  // inx=m->GetHitIndex();
352 
353  // if(inx>=0){
354  // if(fHitArray->At(inx) != 0 ){//add by hujf
355  // const std::vector <Int_t> &tmplist=((PndEmcHit*) fHitArray->At(inx))->GetMcList();
356 
357  // // I copy the complete list instead of only the highest energy particle
358  // // highest energy might be a problem for Hits which belong to two real clusters?
359  // for(Int_t k=0; k<tmplist.size(); k++){
360  // newlist.push_back(tmplist[k]);
361  // }
362  // }
363  // }
364  // // if( fMCTrackArray) checked above already
365  // cleansortmclist(newlist,fMCTrackArray);
366  // tmpclust->fMcList=newlist;
367  //}
368 }
void SetEnergy(Double_t en)
PndEmcRecoPar * fRecoPar
TClonesArray * fDigiArray
virtual const PndEmcDigi * Maxima(const TClonesArray *digiArray) const
void SetZ20(Double_t z20)
std::vector< Double_t > fClusterPosParam
void SetZ53(Double_t z53)
void SetPosition(TVector3 pos)
Text_t * GetEmcClusterPosMethod()
Definition: PndEmcRecoPar.h:20
void SetLatMom(Double_t latMom)
FairMultiLinkedData GetTrackEntering() const
void PndEmcMakeCluster::FinishClusters ( )
protectedvirtual

Calls FinishCluster() for each cluster.

Returns
void

Definition at line 376 of file PndEmcMakeCluster.cxx.

References ctime, Double_t, fEventCounter, FinishCluster(), fTimer, fVerbose, fWriteOutArray, i, and rtime.

Referenced by ExecuteTasks().

377 {
378  Int_t nCluster = fWriteOutArray->GetEntriesFast();
379  for (Int_t i=0; i<nCluster; i++) {
381  }
382 
383  fEventCounter++;
384  if (fVerbose>0)
385  cout<<"PndEmcMakeCluster, event: "<<fEventCounter<<endl;
386 
387  if (fVerbose>2){
388  fTimer.Stop();
389  Double_t rtime = fTimer.RealTime();
390  Double_t ctime = fTimer.CpuTime();
391  fTimer.Reset();
392  cout << "PndEmcMakeCluster, Real time " << rtime << " s, CPU time " << ctime << " s" << endl;
393  }
394 }
static Int_t fEventCounter
Int_t i
Definition: run_full.C:25
Double_t
void FinishCluster(PndEmcCluster *tmpcluster)
Assign final parameters to cluster.
a cluster (group of neighboring crystals) of hit emc crystals
Definition: PndEmcCluster.h:29
Double_t ctime
Definition: hit_dirc.C:114
Double_t rtime
Definition: hit_dirc.C:113
TClonesArray * fWriteOutArray
expired clusters
Bool_t PndPersistencyTask::GetPersistency ( )
inlineinherited

Definition at line 32 of file PndPersistencyTask.h.

References PndPersistencyTask::fPersistency.

Referenced by PndLmdPixelHitProducerFast::GetPersistance(), PndMdtDigitization::Init(), PndMdtHitProducerIdeal::Init(), PndMdtClusterTask::Init(), PndFtsHitProducerRealFast::Init(), PndDiscTaskReconstruction::Init(), PndRichHitProducer::Init(), PndSttHitProducerRealFast::Init(), PndSttHelixHitProducer::Init(), PndDiscTaskPID::Init(), PndIdealTrackFinder::Init(), PndSttMvdGemTracking::Init(), PndMdtTrkProducer::Init(), PndFtsHitProducerRealFull::Init(), PndLmdPixelClusterTask::Init(), PndSttHitProducerRealFull::Init(), PndLmdStripClusterTask::Init(), PndEmcApdHitProducer::Init(), PndMissingPzCleanerTask::Init(), PndEmcMakeRecoHit::Init(), PndEmcMakeClusterOnline::Init(), PndTrackSmearTask::Init(), PndEmcFWEndcapTimebasedWaveforms::Init(), PndSttHitProducerIdeal::Init(), PndEmcFWEndcapDigi::Init(), PndFtsHitProducerIdeal::Init(), Init(), PndMdtPointsToWaveform::Init(), PndDiscTaskDigitization::Init(), PndEmcMakeDigi::Init(), PndSdsTimeWalkCorrTask::Init(), PndLmdPixelHitProducerFast::Init(), PndDrcHitFinder::Init(), PndRichHitFinder::Init(), PndEmcMakeCorr::Init(), PndFtofHitProducerIdeal::Init(), PndEmcHitsToWaveform::Init(), PndSciTDigiTask::Init(), PndDrcHitProducerIdeal::Init(), PndSdsHitProducerIdeal::Init(), PndSciTHitProducerIdeal::Init(), PndRecoMultiKalmanTask2::Init(), PndEmcHitProducer::Init(), PndDrcHitProducerReal::Init(), PndDskFLGHitProducerIdeal::Init(), PndEmcTmpWaveformToDigi::Init(), PndDrcDigiTask::Init(), PndEmcWaveformToDigi::Init(), PndSttMatchTracks::Init(), PndEmcWaveformToCalibratedDigi::Init(), PndTrkTracking2::Init(), PndSttFindTracks::Init(), PndEmcMultiWaveformToCalibratedDigi::Init(), PndRecoKalmanTask2::Init(), PndDrcTimeDigiTask::Init(), PndEmcExpClusterSplitter::Init(), PndFtsHoughTrackerTask::Init(), PndSdsNoiseProducer::Init(), PndEmcPhiBumpSplitter::Init(), PndSdsIdealRecoTask::Init(), PndSdsHybridHitProducer::Init(), PndRecoMultiKalmanTask::Init(), PndSdsIdealClusterTask::Init(), PndRecoKalmanTask::Init(), PndSdsStripHitProducerDif::Init(), PndGemDigitize::Init(), PndSdsStripHitProducer::Init(), PndGemFindHits::Init(), PndSdsPixelClusterTask::Init(), PndSdsStripClusterTask::Init(), PndMvdGemTrackFinderOnHits::Init(), PndBarrelTrackFinder::Init(), PndEmcFullDigiTask::PndEmcFullDigiTask(), PndEmcMakeBump::PndEmcMakeBump(), PndUnassignedHitsTask::RegisterBranches(), PndMvdClusterTask::SetPersistance(), PndMvdDigiTask::SetPersistance(), PndEmcMakeBump::SetStorageOfData(), and PndEmcFullDigiTask::StoreDigi().

32 { return fPersistency; }
bool PndEmcMakeCluster::HasExpired ( PndEmcDigi latestDigi,
PndEmcCluster theCluster,
Int_t  clusterIdx 
)
private

Finishes clusters in timebased analysis.

Checks if the timestamp of latestDigi is later than the active time of theCluster. If yes, the cluster is written and true is returned.

Parameters
latestDigiCurrent digi to check timestamp of.
theClusterCurrent cluster for which the expiration is checked.
clusterIdxIndex of theCluster in the cluster TClonesArray.
Returns
bool
Return values
trueCluster has expired and was written.
falseCluster not expired.

Definition at line 409 of file PndEmcMakeCluster.cxx.

References fClusterActiveTime, fClusterArray, and fWriteOutArray.

Referenced by Exec().

410 {
411  if(!FairRunAna::Instance()->IsTimeStamp()) return false;
412 
413  if(latestDigi->GetTimeStamp() > theCluster->GetTimeStamp() + fClusterActiveTime) {
414  fWriteOutArray->AbsorbObjects(fClusterArray, clusterIdx, clusterIdx);
415  //cout << "cluster " << clusterIdx << "has been expired" << std::endl;
416  return true;
417  } else {
418  return false;
419  }
420 }
Double_t fClusterActiveTime
Defines how long clusters are kept open in timebased reconstruction.
TClonesArray * fClusterArray
active clusters
TClonesArray * fWriteOutArray
expired clusters
InitStatus PndEmcMakeCluster::Init ( )
virtual

Init Task.

Prepares the TClonesArray of PndEmcDigi for reading and of PndEmcCluster for writing.

Returns
InitStatus
Return values
kSUCCESSsuccess

Definition at line 74 of file PndEmcMakeCluster.cxx.

References fClusterActiveTime, fClusterArray, fClusterPosParam, fDigiArray, fDigiEnergyTresholdBarrel, fDigiEnergyTresholdBWD, fDigiEnergyTresholdFWD, fDigiEnergyTresholdShashlyk, fDigiFunctor, fGeoPar, fHitArray, fMCTrackArray, fRecoPar, fStoreClusterBase, fWriteOutArray, PndEmcRecoPar::GetClusterActiveTime(), PndEmcRecoPar::GetEmcClusterPosMethod(), PndEmcRecoPar::GetEnergyThresholdBarrel(), PndEmcRecoPar::GetEnergyThresholdBWD(), PndEmcRecoPar::GetEnergyThresholdFWD(), PndEmcRecoPar::GetEnergyThresholdShashlyk(), PndEmcRecoPar::GetOffsetParmA(), PndEmcRecoPar::GetOffsetParmB(), PndEmcRecoPar::GetOffsetParmC(), PndPersistencyTask::GetPersistency(), PndEmcGeoPar::InitEmcMapper(), and PndEmcStructure::Instance().

75 {
76 
77  // Get RootManager
78  FairRootManager* ioman = FairRootManager::Instance();
79  if ( ! ioman )
80  {
81  cout << "-E- PndEmcMakeCluster::Init: "
82  << "RootManager not instantiated!" << endl;
83  return kFATAL;
84  }
85 
86  // Get input array
87  fDigiArray = (TClonesArray*) ioman->GetObject("EmcDigi");
88  if ( ! fDigiArray ) {
89  fDigiArray = (TClonesArray*) ioman->GetObject("EmcDigiSorted");
90  if ( ! fDigiArray ) {
91  cout << "-W- PndEmcMakeCluster::Init: "
92  << "No PndEmcDigi array!" << endl;
93  return kERROR;
94  }
95  }
96 
97  // Get input array
98  fHitArray = (TClonesArray*) ioman->GetObject("EmcHit");
99  if ( ! fHitArray ) {
100  cout << "-W- PndEmcMakeCluster::Init: "
101  << "No PndEmcHit array! Needed for MC Truth" << endl;
102  }
103 
104  // Get input array
105  fMCTrackArray = (TClonesArray*) ioman->GetObject("MCTrack");
106  if ( ! fMCTrackArray ) {
107  cout << "-W- PndEmcMakeCluster::Init: "
108  << "No MCTrack array! Needed for MC Truth" << endl;
109  }
110 
111  // Create and register output array
112  fClusterArray = new TClonesArray("PndEmcCluster");
113  fWriteOutArray = new TClonesArray(fClusterArray->GetClass());
114 
115  ioman->Register("EmcCluster","Emc", fWriteOutArray, GetPersistency());
116 
117  if(FairRunAna::Instance()->IsTimeStamp()) {
118  // for subsequent methods we need the "event grouping" as given by the TS buffer --> fDigiArray becomes an output array.
119  fDigiArray = new TClonesArray(fDigiArray->GetClass()); //still needed to activate array
120  ioman->Register("EmcDigiClusterBase", "Emc", fDigiArray, fStoreClusterBase);
121  }
122  fDigiFunctor = new TimeGap();
123 
126 
131  fClusterActiveTime=fRecoPar->GetClusterActiveTime() * 1.0e9; //convert from seconds to nanoseconds
132 
133  cout<<"PndEmcMakeCluster::fDigiEnergyTresholdBarrel: "<<fDigiEnergyTresholdBarrel<<endl;
134  cout<<"PndEmcMakeCluster::fDigiEnergyTresholdFWD: "<<fDigiEnergyTresholdFWD<<endl;
135  cout<<"PndEmcMakeCluster::fDigiEnergyTresholdBWD: "<<fDigiEnergyTresholdBWD<<endl;
136  cout<<"PndEmcMakeCluster::fDigiEnergyTresholdShashlyk: "<<fDigiEnergyTresholdShashlyk<<endl;
137  cout<<"PndEmcMakeCluster::fClusterActiveTime in ns(!): "<<fClusterActiveTime<<endl;
138  cout<<"PndEmcMakeCluster::ClusterPosMethod(): " << fRecoPar->GetEmcClusterPosMethod() << std::endl;
139 
140  if (!strcmp(fRecoPar->GetEmcClusterPosMethod(),"lilo"))
141  {
142  cout<<"Lilo cluster position method"<<endl;
146  }
147 
148  cout << "-I- PndEmcMakeCluster: Intialization successfull" << endl;
149  return kSUCCESS;
150 }
Double_t fDigiEnergyTresholdBWD
Double_t fDigiEnergyTresholdShashlyk
Double_t fClusterActiveTime
Defines how long clusters are kept open in timebased reconstruction.
TClonesArray * fClusterArray
active clusters
Double_t GetEnergyThresholdBarrel()
Definition: PndEmcRecoPar.h:15
TClonesArray * fHitArray
PndEmcRecoPar * fRecoPar
Double_t GetOffsetParmB()
Definition: PndEmcRecoPar.h:22
Double_t GetOffsetParmC()
Definition: PndEmcRecoPar.h:23
void InitEmcMapper()
TClonesArray * fDigiArray
Double_t fDigiEnergyTresholdFWD
Double_t GetClusterActiveTime()
Definition: PndEmcRecoPar.h:19
Double_t GetEnergyThresholdFWD()
Definition: PndEmcRecoPar.h:16
Double_t GetOffsetParmA()
Definition: PndEmcRecoPar.h:21
std::vector< Double_t > fClusterPosParam
Double_t fDigiEnergyTresholdBarrel
BinaryFunctor * fDigiFunctor
Double_t GetEnergyThresholdShashlyk()
Definition: PndEmcRecoPar.h:18
PndEmcGeoPar * fGeoPar
Text_t * GetEmcClusterPosMethod()
Definition: PndEmcRecoPar.h:20
static PndEmcStructure * Instance()
Double_t GetEnergyThresholdBWD()
Definition: PndEmcRecoPar.h:17
TClonesArray * fMCTrackArray
TClonesArray * fWriteOutArray
expired clusters
PndEmcMakeCluster& PndEmcMakeCluster::operator= ( const PndEmcMakeCluster )
private
void PndEmcMakeCluster::SetClusterActiveTime ( Double_t  time)
inline

Override EmcRecoPar cluster active time parameter ..to be set in ns!!!

Definition at line 62 of file PndEmcMakeCluster.h.

References fClusterActiveTime.

void PndEmcMakeCluster::SetParContainers ( )
protectedvirtual

Get parameter containers

Definition at line 466 of file PndEmcMakeCluster.cxx.

References fDigiPar, fGeoPar, fRecoPar, and run.

466  {
467 
468  // Get run and runtime database
469  FairRun* run = FairRun::Instance();
470  if ( ! run ) Fatal("SetParContainers", "No analysis run");
471 
472  FairRuntimeDb* db = run->GetRuntimeDb();
473  if ( ! db ) Fatal("SetParContainers", "No runtime database");
474 
475  // Get Emc geometry parameter container
476  fGeoPar = (PndEmcGeoPar*) db->getContainer("PndEmcGeoPar");
477 
478  // Get Emc digitisation parameter container
479  fDigiPar = (PndEmcDigiPar*) db->getContainer("PndEmcDigiPar");
480 
481  // Get Emc reconstruction parameter container
482  fRecoPar = (PndEmcRecoPar*) db->getContainer("PndEmcRecoPar");
483 }
PndEmcDigiPar * fDigiPar
Int_t run
Definition: autocutx.C:47
PndEmcRecoPar * fRecoPar
parameter set of Emc digitisation
Definition: PndEmcDigiPar.h:12
PndEmcGeoPar * fGeoPar
Parameter set for Emc Reco.
Definition: PndEmcRecoPar.h:12
void PndPersistencyTask::SetPersistency ( Bool_t  val = kTRUE)
inlineinherited

Definition at line 31 of file PndPersistencyTask.h.

References PndPersistencyTask::fPersistency, and val.

Referenced by barrelTrackFinder(), digi_complete(), digi_complete_newSTT(), digiOnly_complete(), PndBarrelTrackFinder::PndBarrelTrackFinder(), PndCATracking::PndCATracking(), PndDrcHitFinder::PndDrcHitFinder(), PndEmc2DLocMaxFinder::PndEmc2DLocMaxFinder(), PndEmcExpClusterSplitter::PndEmcExpClusterSplitter(), PndEmcFullDigiTask::PndEmcFullDigiTask(), PndEmcFWEndcapDigi::PndEmcFWEndcapDigi(), PndEmcFWEndcapTimebasedWaveforms::PndEmcFWEndcapTimebasedWaveforms(), PndEmcHitProducer::PndEmcHitProducer(), PndEmcHitsToWaveform::PndEmcHitsToWaveform(), PndEmcMakeBump::PndEmcMakeBump(), PndEmcMakeCluster(), PndEmcMakeClusterOnline::PndEmcMakeClusterOnline(), PndEmcMakeDigi::PndEmcMakeDigi(), PndEmcMakeRecoHit::PndEmcMakeRecoHit(), PndEmcMultiWaveformToCalibratedDigi::PndEmcMultiWaveformToCalibratedDigi(), PndEmcPhiBumpSplitter::PndEmcPhiBumpSplitter(), PndEmcTmpWaveformToDigi::PndEmcTmpWaveformToDigi(), PndEmcWaveformToCalibratedDigi::PndEmcWaveformToCalibratedDigi(), PndEmcWaveformToDigi::PndEmcWaveformToDigi(), PndFtofHitProducerIdeal::PndFtofHitProducerIdeal(), PndFtsCATracking::PndFtsCATracking(), PndFtsHitProducerIdeal::PndFtsHitProducerIdeal(), PndFtsHitProducerRealFast::PndFtsHitProducerRealFast(), PndFtsHitProducerRealFull::PndFtsHitProducerRealFull(), PndFtsHoughTrackerTask::PndFtsHoughTrackerTask(), PndGemDigitize::PndGemDigitize(), PndGemFindHits::PndGemFindHits(), PndIdealTrackFinder::PndIdealTrackFinder(), PndLmdPixelClusterTask::PndLmdPixelClusterTask(), PndLmdPixelHitProducerFast::PndLmdPixelHitProducerFast(), PndMdtClusterTask::PndMdtClusterTask(), PndMdtDigitization::PndMdtDigitization(), PndMdtHitProducerIdeal::PndMdtHitProducerIdeal(), PndMdtPointsToWaveform::PndMdtPointsToWaveform(), PndMdtTrkProducer::PndMdtTrkProducer(), PndMissingPzCleanerTask::PndMissingPzCleanerTask(), PndMvdGemTrackFinderOnHits::PndMvdGemTrackFinderOnHits(), PndMvdHitProducerIdeal::PndMvdHitProducerIdeal(), PndMvdPixelClusterTask::PndMvdPixelClusterTask(), PndMvdTimeWalkCorrTask::PndMvdTimeWalkCorrTask(), PndMvdToPix4ClusterTask::PndMvdToPix4ClusterTask(), PndRecoKalmanTask::PndRecoKalmanTask(), PndRecoKalmanTask2::PndRecoKalmanTask2(), PndRecoMultiKalmanTask::PndRecoMultiKalmanTask(), PndRecoMultiKalmanTask2::PndRecoMultiKalmanTask2(), PndRichHitFinder::PndRichHitFinder(), PndRichHitProducer::PndRichHitProducer(), PndSciTDigiTask::PndSciTDigiTask(), PndSciTHitProducerIdeal::PndSciTHitProducerIdeal(), PndSdsHitProducerIdeal::PndSdsHitProducerIdeal(), PndSdsHybridHitProducer::PndSdsHybridHitProducer(), PndSdsIdealClusterTask::PndSdsIdealClusterTask(), PndSdsIdealRecoTask::PndSdsIdealRecoTask(), PndSdsNoiseProducer::PndSdsNoiseProducer(), PndSdsPixelClusterTask::PndSdsPixelClusterTask(), PndSdsStripClusterTask::PndSdsStripClusterTask(), PndSdsStripHitProducer::PndSdsStripHitProducer(), PndSdsTimeWalkCorrTask::PndSdsTimeWalkCorrTask(), PndSttFindTracks::PndSttFindTracks(), PndSttHelixHitProducer::PndSttHelixHitProducer(), PndSttHitProducerIdeal::PndSttHitProducerIdeal(), PndSttHitProducerRealFast::PndSttHitProducerRealFast(), PndSttHitProducerRealFull::PndSttHitProducerRealFull(), PndSttMatchTracks::PndSttMatchTracks(), PndSttMvdGemTracking::PndSttMvdGemTracking(), PndTrackSmearTask::PndTrackSmearTask(), PndTrkTracking2::PndTrkTracking2(), reco(), reco_complete(), reco_complete_gf2(), reco_complete_newSTT(), reco_complete_sec(), recoideal_complete(), PndMvdClusterTask::SetPersistance(), PndMvdDigiTask::SetPersistance(), PndLmdPixelHitProducerFast::SetPersistance(), PndSdsHitProducerIdeal::SetPersistance(), PndSttMvdGemTracking::SetPersistenc(), PndMdtClusterTask::SetPersistence(), PndSttHelixHitProducer::SetPersistence(), PndMissingPzCleanerTask::SetPersistence(), PndFtsHitProducerRealFast::SetPersistence(), PndFtsHitProducerRealFull::SetPersistence(), PndSttHitProducerRealFull::SetPersistence(), PndSttHitProducerIdeal::SetPersistence(), PndSttHitProducerRealFast::SetPersistence(), PndFtsHitProducerIdeal::SetPersistence(), PndTrackSmearTask::SetPersistence(), PndSciTHitProducerIdeal::SetPersistence(), PndIdealTrackFinder::SetPersistence(), PndSttMatchTracks::SetPersistence(), PndSttFindTracks::SetPersistence(), PndFtsHoughTrackerTask::SetPersistence(), PndTrkTracking2::SetPersistence(), PndEmcMakeRecoHit::SetStorageOfData(), PndEmcFWEndcapDigi::SetStorageOfData(), PndEmcMakeClusterOnline::SetStorageOfData(), PndEmcFWEndcapTimebasedWaveforms::SetStorageOfData(), PndEmcMakeDigi::SetStorageOfData(), PndMdtPointsToWaveform::SetStorageOfData(), PndEmc2DLocMaxFinder::SetStorageOfData(), SetStorageOfData(), PndEmcHitsToWaveform::SetStorageOfData(), PndEmcMakeBump::SetStorageOfData(), PndEmcTmpWaveformToDigi::SetStorageOfData(), PndEmcWaveformToDigi::SetStorageOfData(), PndEmcWaveformToCalibratedDigi::SetStorageOfData(), PndEmcMultiWaveformToCalibratedDigi::SetStorageOfData(), PndEmcExpClusterSplitter::SetStorageOfData(), PndEmcPhiBumpSplitter::SetStorageOfData(), standard_tracking(), and PndEmcFullDigiTask::StoreDigi().

31 { fPersistency = val; }
Double_t val[nBoxes][nFEBox]
Definition: createCalib.C:11
void PndEmcMakeCluster::SetStorageOfData ( Bool_t  val)

Method to specify whether clusters are stored or not.

Definition at line 485 of file PndEmcMakeCluster.cxx.

References PndPersistencyTask::SetPersistency().

Referenced by digi_sttcombi(), emc(), emc_complete(), emc_complete_corr(), emc_correction_data_production(), emc_correction_QA_data_production(), and RecoComplete().

486 {
488  return;
489 }
Double_t val[nBoxes][nFEBox]
Definition: createCalib.C:11
void SetPersistency(Bool_t val=kTRUE)
void PndEmcMakeCluster::StoreClusterBaseDigis ( Bool_t  val = kTRUE)
inline

Method to specify whether underlying digis are stored or not.

Restoring digis makes only sense if reconstruction is done timebased

Definition at line 60 of file PndEmcMakeCluster.h.

References fStoreClusterBase, and val.

Referenced by emc_reco(), run_reco(), and run_reco_timebased().

Double_t val[nBoxes][nFEBox]
Definition: createCalib.C:11

Member Data Documentation

Double_t PndEmcMakeCluster::fClusterActiveTime
private

Defines how long clusters are kept open in timebased reconstruction.

Definition at line 101 of file PndEmcMakeCluster.h.

Referenced by Exec(), HasExpired(), Init(), and SetClusterActiveTime().

TClonesArray* PndEmcMakeCluster::fClusterArray
private

active clusters

Output array of PndEmcClusters

Definition at line 91 of file PndEmcMakeCluster.h.

Referenced by Exec(), HasExpired(), and Init().

std::vector<PndEmcCluster*> PndEmcMakeCluster::fClusterList
private

Definition at line 95 of file PndEmcMakeCluster.h.

Referenced by PndEmcMakeCluster().

std::vector<Double_t> PndEmcMakeCluster::fClusterPosParam
private

Definition at line 103 of file PndEmcMakeCluster.h.

Referenced by FinishCluster(), Init(), and PndEmcMakeCluster().

TClonesArray* PndEmcMakeCluster::fDigiArray
private

Input array of CbmDigis

Definition at line 84 of file PndEmcMakeCluster.h.

Referenced by Exec(), FinishCluster(), and Init().

Double_t PndEmcMakeCluster::fDigiEnergyTresholdBarrel
private

Definition at line 97 of file PndEmcMakeCluster.h.

Referenced by Exec(), and Init().

Double_t PndEmcMakeCluster::fDigiEnergyTresholdBWD
private

Definition at line 99 of file PndEmcMakeCluster.h.

Referenced by Exec(), and Init().

Double_t PndEmcMakeCluster::fDigiEnergyTresholdFWD
private

Definition at line 98 of file PndEmcMakeCluster.h.

Referenced by Exec(), and Init().

Double_t PndEmcMakeCluster::fDigiEnergyTresholdShashlyk
private

Definition at line 100 of file PndEmcMakeCluster.h.

Referenced by Exec(), and Init().

BinaryFunctor* PndEmcMakeCluster::fDigiFunctor
private

Definition at line 94 of file PndEmcMakeCluster.h.

Referenced by Exec(), and Init().

PndEmcDigiPar* PndEmcMakeCluster::fDigiPar
private

Geometry parameter container

Definition at line 109 of file PndEmcMakeCluster.h.

Referenced by SetParContainers().

Int_t PndEmcMakeCluster::fEventCounter =0
staticprivate

Definition at line 106 of file PndEmcMakeCluster.h.

Referenced by FinishClusters().

PndEmcGeoPar* PndEmcMakeCluster::fGeoPar
private

Definition at line 108 of file PndEmcMakeCluster.h.

Referenced by Init(), and SetParContainers().

TClonesArray* PndEmcMakeCluster::fHitArray
private

Input array of Hits and MC Tracks ... needed for MC

Definition at line 87 of file PndEmcMakeCluster.h.

Referenced by Init().

Int_t PndEmcMakeCluster::fMapVersion
private

Definition at line 104 of file PndEmcMakeCluster.h.

TClonesArray* PndEmcMakeCluster::fMCTrackArray
private

Definition at line 88 of file PndEmcMakeCluster.h.

Referenced by Init().

PndEmcRecoPar* PndEmcMakeCluster::fRecoPar
private

Digitisation parameter container

Definition at line 110 of file PndEmcMakeCluster.h.

Referenced by FinishCluster(), Init(), and SetParContainers().

Bool_t PndEmcMakeCluster::fStoreClusterBase
private

Definition at line 116 of file PndEmcMakeCluster.h.

Referenced by Init(), and StoreClusterBaseDigis().

Bool_t PndEmcMakeCluster::fStoreClusters
private

Definition at line 115 of file PndEmcMakeCluster.h.

TStopwatch PndEmcMakeCluster::fTimer
private

Definition at line 118 of file PndEmcMakeCluster.h.

Referenced by Exec(), and FinishClusters().

Int_t PndEmcMakeCluster::fVerbose
private

Reconstruction parameter container Verbosity level

Definition at line 113 of file PndEmcMakeCluster.h.

Referenced by Exec(), and FinishClusters().

TClonesArray* PndEmcMakeCluster::fWriteOutArray
private

expired clusters

Definition at line 92 of file PndEmcMakeCluster.h.

Referenced by Exec(), FinishClusters(), HasExpired(), and Init().


The documentation for this class was generated from the following files: