FairRoot/PandaRoot
PndEmcExpClusterSplitter.cxx
Go to the documentation of this file.
1 //--------------------------------------------------------------------------
2 // File and Version Information:
3 // $Id:$
4 //
5 // Description:
6 // Class PndEmcExpClusterSplitter.
7 // Implementation of ClusterSplitter which splits
8 // on the basis of exponential distance from the bump centroid.
9 //
10 // Environment:
11 // Software developed for the BaBar Detector at the SLAC B-Factory.
12 //
13 // Adapted for the PANDA experiment at GSI
14 //
15 // Author List:
16 // Phil Strother
17 //
18 // Copyright Information:
19 // Copyright (C) 1997 Imperial College
20 //
21 // Modified:
22 // M. Babai
23 //------------------------------------------------------------------------
24 
25 
26 //-----------------------
27 // This Class's Header --
28 //-----------------------
30 
31 //---------------
32 // C++ Headers --
33 //---------------
34 //#include <vector>
35 //#include <set>
36 //#include <map>
37 #include <iostream>
38 
39 //-------------------------------
40 // Collaborating Class Headers --
41 //-------------------------------
42 
43 #include "FairRootManager.h"
44 #include "FairRunAna.h"
45 #include "FairRuntimeDb.h"
46 #include "TClonesArray.h"
47 
49 #include "PndEmcXClMoments.h"
50 
51 #include "PndEmcRecoPar.h"
52 #include "PndEmcGeoPar.h"
53 #include "PndEmcDigiPar.h"
54 #include "PndEmcStructure.h"
55 #include "PndEmcMapper.h"
56 
57 #include "PndDetectorList.h"
58 #include "PndEmcTwoCoordIndex.h"
59 #include "PndEmcBump.h"
60 #include "PndEmcCluster.h"
61 #include "PndEmcDigi.h"
62 #include "PndEmcSharedDigi.h"
63 #include "PndEmcXtal.h"
64 #include "PndEmcDataTypes.h"
65 using std::endl;
66 
67 //----------------
68 // Constructors --
69 //----------------
70 
72 fDigiArray(0), fClusterArray(0), fBumpArray(0), fSharedDigiArray(0), fGeoPar(new PndEmcGeoPar()), fDigiPar(new PndEmcDigiPar()), fRecoPar(new PndEmcRecoPar()), fClusterPosParam(), fMoliereRadius(0), fMoliereRadiusShashlyk(0), fExponentialConstant(0), fMaxIterations(0), fCentroidShift(0), fMaxBumps(0), fMinDigiEnergy(0)
73 {
74  fClusterPosParam.clear();
75  SetPersistency(kTRUE);
76 }
77 
78 //--------------
79 // Destructor --
80 //--------------
81 
83 {
84 // delete fGeoPar;
85 // delete fDigiPar;
86 // delete fRecoPar;
87 }
88 
96 
97  // Get RootManager
98  FairRootManager* ioman = FairRootManager::Instance();
99  if ( ! ioman ){
100  cout << "-E- PndEmcExpClusterSplitter::Init: "
101  << "RootManager not instantiated!" << endl;
102  return kFATAL;
103  }
104 
105  // Geometry loading
108 
109  // Get input array
110  if(FairRunAna::Instance()->IsTimeStamp()) {
111  fDigiArray = (TClonesArray*) ioman->GetObject("EmcDigiClusterBase");
112  } else {
113  fDigiArray = (TClonesArray*) ioman->GetObject("EmcDigi");
114  }
115  if ( ! fDigiArray ) {
116  cout << "-W- PndEmcExpClusterSplitter::Init: "
117  << "No PndEmcDigi array!" << endl;
118  return kERROR;
119  }
120 
121  fClusterArray = dynamic_cast<TClonesArray *> (ioman->GetObject("EmcCluster"));
122  if ( ! fClusterArray ) {
123  cout << "-W- PndEmcExpClusterSplitter::Init: "
124  << "No PndEmcCluster array!" << endl;
125  return kERROR;
126  }
127 
131  // Energy fall off with distance from centre of cluster is
132  // exp(-a*dist/Mr) Mr is the moliere radius. dist is distance from
133  // centre in cm, a is the above parameter. The optimized value for
134  // logarithimc cluster positioning is 2.5 For linear cluster
135  // positioning a should be set to 1.5
136 
138  // Set the max number of iterations that the splitting algorithm is allowed
139  // to do before it decides that enough is enough.
140 
142  // Set the tolerance level to which it is said that a bump is
143  // said not to have moved since the last iteration.
144  // The default is a millimetre.
146  // Set an upper limit on the number of bumps allowed in a cluster if it
147  // is to be split.
148 
150  // Set minimum SharedDigi energy to 20keV.
151 
152  if (!strcmp(fRecoPar->GetEmcClusterPosMethod(),"lilo"))
153  {
154  cout<<"Lilo cluster position method"<<endl;
158  }
159 
160  // Create and register output array
161  fBumpArray = new TClonesArray("PndEmcBump");
162  ioman->Register("EmcBump","Emc",fBumpArray,GetPersistency());
163 
164  fSharedDigiArray = new TClonesArray("PndEmcSharedDigi");
165  ioman->Register("EmcSharedDigi","Emc",fSharedDigiArray,GetPersistency());
166 
167  HowManyDidis = 0;
168 
169  cout << "-I- PndEmcExpClusterSplitter: Intialization successfull" << endl;
170  return kSUCCESS;
171 }
172 
190 {
191 
193  // Reset output array
194  if ( ! fBumpArray ) Fatal("Exec", "No Bump Array");
195  fBumpArray->Delete();
196  if ( ! fSharedDigiArray ) Fatal("Exec", "No Shared Digi Array");
197  fSharedDigiArray->Delete();
198 
199  int nClusters = fClusterArray->GetEntriesFast();
200 
201  for (Int_t iCluster = 0; iCluster < nClusters; iCluster++){
202  PndEmcCluster* theCluster = (PndEmcCluster*) fClusterArray->At(iCluster);
203 
204  int numberOfBumps = -1;
205  numberOfBumps = (theCluster->LocalMaxMap()).size();
206 
207  if (numberOfBumps<=1 || numberOfBumps >= fMaxBumps){
208  // Limit the max number of bumps in the cluster to 8 (default)
209  // in this case, we clearly have a cluster, but no bumps to speak of.
210  // Make 1 bump with weights all equal to 1
211 
212  std::map<Int_t, Int_t>::const_iterator theDigiIterator;
213 
214  PndEmcBump* theNewBump = AddBump();
215  theNewBump->MadeFrom(iCluster);
216  theNewBump->SetLink(FairLink("EmcCluster", iCluster));
217 
218  for(theDigiIterator = theCluster->MemberDigiMap().begin();
219  theDigiIterator != theCluster->MemberDigiMap().end(); ++theDigiIterator){
220  PndEmcDigi *theDigi = (PndEmcDigi *) fDigiArray->At(theDigiIterator->second);
221  AddSharedDigi(theDigi, 1.0); // PndEmcSharedDigi* sharedDigi= //[R.K.03/2017] unused variable
222  Int_t iSharedDigi=fSharedDigiArray->GetEntriesFast()-1;
223  theNewBump->addDigi(fSharedDigiArray,iSharedDigi);
224  }
225  }
226  else {
227  std::map<Int_t,Int_t> theMaximaDigis=theCluster->LocalMaxMap();
228  std::map<Int_t,Int_t>::iterator theMaximaDigisIterator;
229  std::map<PndEmcTwoCoordIndex*, TVector3*> theCentroidPoints;
230  std::map<PndEmcTwoCoordIndex*, TVector3*> theMaximaPoints;
231  std::map<PndEmcTwoCoordIndex*, PndEmcBump*> theIndexedBumps;
232  std::map<PndEmcTwoCoordIndex*, TVector3*> theAllDigiPoints;
233 
234  std::map<Int_t, Int_t> theDigiDict = theCluster->MemberDigiMap();
235 
236  double totalEnergy=0;
237 
238  for(theMaximaDigisIterator = theMaximaDigis.begin();
239  theMaximaDigisIterator != theMaximaDigis.end();
240  ++theMaximaDigisIterator){
241  PndEmcDigi *theMaxDigi = (PndEmcDigi *) fDigiArray->At(theMaximaDigisIterator->second);
242 
243  Int_t detId = theMaximaDigisIterator->first;
244  PndEmcTwoCoordIndex *theTCI = fEmcMap->GetTCI(detId);
245 
246  totalEnergy += theMaxDigi->GetEnergy();
247 
248  TVector3 *digiLocation = new TVector3(theMaxDigi->where());
249  TVector3 *sameLocation = new TVector3(theMaxDigi->where());
250 
251  theMaximaPoints.insert(std::map<PndEmcTwoCoordIndex*, TVector3*>::value_type(theTCI, digiLocation));
252  theCentroidPoints.insert(std::map<PndEmcTwoCoordIndex*, TVector3*>::value_type(theTCI, sameLocation));
253  }
254 
255  std::map<Int_t,Int_t>::iterator theAllDigisIterator;
256  // This loop works out the location of all the digis in the cluster
257 
258  for( theAllDigisIterator = theDigiDict.begin(); theAllDigisIterator != theDigiDict.end();
259  ++theAllDigisIterator){
260  Int_t detId = theAllDigisIterator->first;
261  PndEmcTwoCoordIndex *theTCI = fEmcMap->GetTCI(detId);
262  PndEmcDigi *theDigi = (PndEmcDigi *) fDigiArray->At(theAllDigisIterator->second);
263  TVector3 *digiLocation = new TVector3(theDigi->where());
264  theAllDigiPoints.insert(std::map<PndEmcTwoCoordIndex*, TVector3*>::value_type( theTCI, digiLocation ));
265  }
266 
267  theMaximaDigisIterator = theMaximaDigis.begin();
268 
269  // Now we can create the EmcBumps
270 
271  // The algorithm is as follows: We will index each bump by its
272  // maximum digi's PndEmcTwoCoordIndex. We will set up a list of
273  // bump centroids which to start with will be synonymous with the
274  // location of the maxima. We then apportion a weight to each
275  // digi, according to its distance from the centroids. We then
276  // construct the bumps according to these weights, which will
277  // presumably give a different set of centroids. This is repeated
278  // until the centroids are static within tolerance, or we reach
279  // the maximum number of iterations.
280 
281  Int_t iterations = 0;
282 
283  Double_t averageCentroidShift;
284 
285  do {
286  if (fVerbose>=3){
287  std::cout<<"iteration No "<<iterations<<std::endl;
288  }
289  averageCentroidShift=0.0;
290 
291  // First clean up the old bumps
292  std::map<PndEmcTwoCoordIndex*, PndEmcBump*>::iterator theBumpKiller = theIndexedBumps.begin();
293  while(theBumpKiller != theIndexedBumps.end()){
294  PndEmcBump *theBump = theBumpKiller->second;
295  delete theBump;
296  ++theBumpKiller;
297  }
298  theIndexedBumps.clear();
299 
300  // Then loop over all the maxima and assign weights accordingly
301  for (theMaximaDigisIterator = theMaximaDigis.begin();
302  theMaximaDigisIterator != theMaximaDigis.end();
303  ++theMaximaDigisIterator) {
304  Int_t detId = theMaximaDigisIterator->first;
305  PndEmcTwoCoordIndex *theCurrentMaximaTCI = fEmcMap->GetTCI(detId);
306 
307  if (fVerbose>=3){
308  std::cout<<"***************** current maximum: theta = "<<theCurrentMaximaTCI->XCoord()
309  <<", phi = "<<theCurrentMaximaTCI->YCoord()<<"*********"<<std::endl;
310  }
311 
312  // Create the bump which will correspond to this digi maxima
313  PndEmcBump* theNewBump = new PndEmcBump();
314  theNewBump->MadeFrom(iCluster);
315  theIndexedBumps.insert(std::map<PndEmcTwoCoordIndex*,
316  PndEmcBump*>::value_type(theCurrentMaximaTCI, theNewBump));
317 
318 
319  // Now we will look over all the digis and add each of them
320  // to this Bump with an appropriate weight
321 
322  for (theAllDigisIterator = theDigiDict.begin();
323  theAllDigisIterator != theDigiDict.end();++theAllDigisIterator) {
324  PndEmcDigi *theCurrentDigi = (PndEmcDigi *) fDigiArray->At(theAllDigisIterator->second);
325  PndEmcTwoCoordIndex *theCurrentTCI = theCurrentDigi->GetTCI();
326 
327  Double_t weight;
328 
329  // We are on the first pass and the digi is not a local max, or we are not on the
330  // first pass. Assign a weight according to the distance from the centroid position.
331 
332  Double_t myEnergy = 0;
333  Double_t myDistance = 0;
334 
335  // Now share the digi out according to its distance from the maxima,
336  // and the maxima energies
337 
338  Double_t totalDistanceEnergy=0;
339 
340  //Moliere Radius for Shashlyk is different
341  Double_t MoliereRadius;
342  if(theCurrentDigi->GetModule() == 5)
343  MoliereRadius = fMoliereRadiusShashlyk;
344  else
345  MoliereRadius = fMoliereRadius;
346 
347  std::map<PndEmcTwoCoordIndex*,TVector3*>::iterator theMaxPointsIterator;
348 
349  for(theMaxPointsIterator = theCentroidPoints.begin(); theMaxPointsIterator != theCentroidPoints.end();++theMaxPointsIterator){
350  PndEmcTwoCoordIndex *theMaxPointsTCI =theMaxPointsIterator->first;
351 
352  TVector3 *theMaxPoint = theMaxPointsIterator->second;
353  TVector3 *theCurrentDigiPoint = theAllDigiPoints.find(theCurrentTCI)->second;
354 
355  Double_t theDistance;
356 
357  // This next bit just checks to see if the maxima point in
358  // hand is the same as the crystal from which we are
359  // trying to find distance - just an FP trap really.
360 
361  if ((*theCurrentTCI)==(*theMaxPointsTCI)){
362  theDistance=0.0;
363  } else {
364  TVector3 distance( *theMaxPoint - *theCurrentDigiPoint);
365 
366  theDistance = distance.Mag();
367  }
368 
369  if (*theCurrentMaximaTCI == *(theMaxPointsTCI)){
370  // i.e. the maximum we are trying to find the distance from is
371  // the one for which we are currently trying to make a bump
372  myDistance = theDistance;
373  Int_t iCurentMaxDigi = (theDigiDict.find(theMaxPointsTCI->Index()))->second;
374  myEnergy = ((PndEmcDigi *) fDigiArray->At(iCurentMaxDigi))->GetEnergy();
375  }
376 
377  Int_t iMaxPoint = (theDigiDict.find(theMaxPointsTCI->Index()))->second;
378  totalDistanceEnergy += ((PndEmcDigi *) fDigiArray->At(iMaxPoint))->GetEnergy() *
379  exp(-fExponentialConstant * theDistance/MoliereRadius);
380  }
381 
382  if(totalDistanceEnergy > 0.0)
383  weight = myEnergy*exp(-fExponentialConstant*
384  myDistance/MoliereRadius) / ( totalDistanceEnergy);
385  else
386  weight=0;
387 
388  if (fVerbose>=3){
389  std::cout<<"\t digi theta = "<<theCurrentDigi->GetTCI()->XCoord()
390  <<", phi = "<<theCurrentDigi->GetTCI()->YCoord()<<std::endl;
391  std::cout<<"energy = "<<theCurrentDigi->GetEnergy()<<", weight = "<< weight<<std::endl;
392  }
393  PndEmcSharedDigi* sharedDigi= AddSharedDigi( theCurrentDigi, weight );
394 
395  if (fVerbose>=3){
396  std::cout<<"shared digi energy = "<<sharedDigi->GetEnergy()<<std::endl;
397  }
398 
399  Int_t iSharedDigi=fSharedDigiArray->GetEntriesFast()-1;
400  if( sharedDigi->GetEnergy() > fMinDigiEnergy){
401  theNewBump->addDigi( fSharedDigiArray, iSharedDigi );
402  } else {
403  fSharedDigiArray->RemoveAt(iSharedDigi);
404  fSharedDigiArray->Compress();
405  }
406  }
407 
408  // Compute the shift of the centroid we have just calculated
409  TVector3 *theOldCentroid = theCentroidPoints.find(theCurrentMaximaTCI)->second;
410 
411  PndEmcClusterProperties clusterProperties(*theNewBump, fSharedDigiArray);
412 
413  TVector3 newbumppos = clusterProperties.Where(fRecoPar->GetEmcClusterPosMethod(), fClusterPosParam);
414  theNewBump->SetPosition(newbumppos);
415  TVector3 centroidShift(*theOldCentroid - newbumppos);
416  averageCentroidShift+=centroidShift.Mag();
417  }
418 
419  averageCentroidShift/=(Double_t)numberOfBumps;
420 
421  // Put the new centroids in the list of centroid points,
422  // remembering to delete the old ones.
423  std::map<PndEmcTwoCoordIndex*, TVector3*>::iterator
424  theCentroidPointsIterator = theCentroidPoints.begin();
425  for(theCentroidPointsIterator = theCentroidPoints.begin();
426  theCentroidPointsIterator != theCentroidPoints.end();
427  ++theCentroidPointsIterator) {
428  delete theCentroidPointsIterator->second;
429  }
430  theCentroidPoints.clear();
431 
432  std::map<PndEmcTwoCoordIndex*, PndEmcBump*>::iterator theIndexedBumpsIterator;
433  for(theIndexedBumpsIterator = theIndexedBumps.begin();
434  theIndexedBumpsIterator != theIndexedBumps.end(); ++theIndexedBumpsIterator){
435  TVector3 *theNewCentroid = new TVector3((theIndexedBumpsIterator->second)->where());
436  theCentroidPoints.insert(std::map<PndEmcTwoCoordIndex*, TVector3*>::value_type(theIndexedBumpsIterator->first,theNewCentroid));
437  }
438 
439  iterations++;
440 
441  } while (iterations < fMaxIterations && averageCentroidShift > fCentroidShift);
442  //End of do loop
443 
444  // Finally append the new bumps to the TClonesArray.
445  std::map<PndEmcTwoCoordIndex*, PndEmcBump*>::iterator theBumpsIterator;
446  PndEmcBump *theBump;
447 
448  for(theBumpsIterator = theIndexedBumps.begin(); theBumpsIterator != theIndexedBumps.end();++theBumpsIterator){
449  theBump = theBumpsIterator->second;
450  Int_t size_ba = fBumpArray->GetEntriesFast();
451  PndEmcBump* theNextBump = new((*fBumpArray)[size_ba]) PndEmcBump(*(theBump));
452  if (fVerbose>0)
453  std::cout << "Bump Created!" << std::endl;
454  theNextBump->SetInsertHistory(kFALSE);
455  theNextBump->SetLink(FairLink("EmcCluster", iCluster));
456  PndEmcCluster* myCluster = (PndEmcCluster*)fClusterArray->At(iCluster);
457  theNextBump->AddLinks(myCluster->GetTrackEntering());
458  theNextBump->SetTimeStamp(myCluster->GetTimeStamp());
459  theNextBump->SetTimeStampError(myCluster->GetTimeStampError());
460  }
461 
462  std::map<PndEmcTwoCoordIndex*,TVector3*>::iterator theGrimReaper = theMaximaPoints.begin();
463  for(theGrimReaper = theMaximaPoints.begin();
464  theGrimReaper != theMaximaPoints.end();
465  ++theGrimReaper){
466  delete theGrimReaper->second;
467  }
468  theMaximaPoints.clear();
469 
470  for(theGrimReaper = theAllDigiPoints.begin();
471  theGrimReaper != theAllDigiPoints.end();
472  ++theGrimReaper){
473  delete theGrimReaper->second;
474  }
475  theAllDigiPoints.clear();
476 
477  for(theGrimReaper = theCentroidPoints.begin();
478  theGrimReaper != theCentroidPoints.end();
479  ++theGrimReaper){
480  delete theGrimReaper->second;
481  }
482  theCentroidPoints.clear();
483  }
484 
485  Int_t nBumps = (theCluster->LocalMaxMap()).size();
486  theCluster->SetNBumps(nBumps);
487  }
488 
489  // At that moment internal state fEnergy and fWhere of Clusters are
490  // not initialized, the following make it possible to see energy and
491  // position from output root file
492  Int_t nBump = fBumpArray->GetEntriesFast();
493 
494  Double_t fTimeError; //CalibTimeOfaDigi, //[R.K.03/2017] unused variable
495  Double_t WeightedFactor1(0.), NormWeightedFactor1(0.), AverageTime1(0.);
496  //Double_t WeightedFactor2(0.), NormWeightedFactor2(0.), AverageTime2(0.);
497  //Double_t WeightedFactor3(0.), NormWeightedFactor3(0.), AverageTime3(0.);
498  for (Int_t i=0; i<nBump; i++){
499  PndEmcBump *tmpbump = (PndEmcBump*) fBumpArray->At(i);
500  PndEmcClusterProperties clusterProperties(*tmpbump, fSharedDigiArray);
501 
502  if (!tmpbump->IsEnergyValid())
503  tmpbump->SetEnergy(clusterProperties.Energy());
504  if (!tmpbump->IsPositionValid())
505  tmpbump->SetPosition(clusterProperties.Where(fRecoPar->GetEmcClusterPosMethod(), fClusterPosParam));
506  PndEmcXClMoments xClMoments(*tmpbump, fSharedDigiArray);
507  tmpbump->SetZ20(xClMoments.AbsZernikeMoment(2, 0, 15));
508  tmpbump->SetZ53(xClMoments.AbsZernikeMoment(5, 3, 15));
509  tmpbump->SetLatMom(xClMoments.Lat());
510 
511  //for time information
512  WeightedFactor1 = 0.;//= WeightedFactor2 = WeightedFactor3 = 0.;
513  AverageTime1 = 0.;//AverageTime2 = AverageTime3 = 0.;
514  Double_t fMaxDigiEnergy = -1.;
515  const std::vector<Int_t>& listOfDigi = tmpbump->DigiList();
516  for(size_t id=0;id <listOfDigi.size();++id){
517  PndEmcDigi* theDigi = (PndEmcDigi*)fSharedDigiArray->At(listOfDigi[id]);
518  //CalibTimeOfaDigi = digiCalibrator.CalibrationEvtTimeByDigi(theDigi, kFALSE);
519  fTimeError = digiCalibrator.GetTimeResolutionOfDigi(theDigi);
520  WeightedFactor1 += 1./fTimeError/fTimeError;
521  //WeightedFactor2 += theDigi->GetEnergy()*1./fTimeError/fTimeError;
522  //WeightedFactor3 += theDigi->GetEnergy();
523  if(theDigi->GetEnergy() > fMaxDigiEnergy){
524  fMaxDigiEnergy = theDigi->GetEnergy();
525  tmpbump->SetEventNo(theDigi->fEvtNo);
526  //tmpbump->SetTimeStamp1(theDigi->GetTimeStamp());
527  //tmpbump->fSeedPosition = theDigi->where();
528  }
529  }
530  for(size_t id=0;id <listOfDigi.size();++id){
531  PndEmcDigi* theDigi = (PndEmcDigi*)fSharedDigiArray->At(listOfDigi[id]);
532  digiCalibrator.CalibrationEvtTimeByDigi(theDigi, kFALSE); //CalibTimeOfaDigi = //[R.K.03/2017] unused variable
533  fTimeError = digiCalibrator.GetTimeResolutionOfDigi(theDigi);
534  NormWeightedFactor1 = 1./fTimeError/fTimeError;
535  NormWeightedFactor1 /= WeightedFactor1;
536  AverageTime1 += NormWeightedFactor1*theDigi->GetTimeStamp();
537 
538  //NormWeightedFactor2 = theDigi->GetEnergy()*1./fTimeError/fTimeError;
539  //NormWeightedFactor2 /= WeightedFactor2;
540  //AverageTime2 += NormWeightedFactor2*theDigi->GetTimeStamp();
541 
542  //NormWeightedFactor3 = theDigi->GetEnergy();
543  //NormWeightedFactor3 /= WeightedFactor3;
544  //AverageTime3 += NormWeightedFactor3*theDigi->GetTimeStamp();
545  }
546  tmpbump->SetTimeStamp(AverageTime1);
547  HowManyDidis += tmpbump->NumberOfDigis();
548  //tmpbump->SetTimeStamp1(AverageTime1);
549  //tmpbump->SetTimeStamp2(AverageTime2);
550  //tmpbump->SetTimeStamp3(AverageTime3);
551  //end for time information
552  }
553 
554  if (fVerbose>=1){
555  std::cout<<"PndEmcExpClusterSplitter:: Number of clusters = "<<nClusters<<std::endl;
556  std::cout<<"PndEmcExpClusterSplitter:: Number of bumps = "<<nBump<<std::endl;
557  }
558 
559 }
560 
567 {
568  TClonesArray& clref = *fBumpArray;
569  Int_t size = clref.GetEntriesFast();
570  return new(clref[size]) PndEmcBump();
571 }
572 
581  TClonesArray& clref = *fSharedDigiArray;
582  Int_t size = clref.GetEntriesFast();
583  return new(clref[size]) PndEmcSharedDigi(*digi, weight);
584 }
585 
594 {
595  cout<<"================================================="<<endl;
596  cout<<"PndEmcExpClusterSplitter::FinishTask"<<endl;
597  cout<<"================================================="<<endl;
598  cout<<"read digis #"<<HowManyDidis<<endl;
599 }
600 
602 
603  // Get run and runtime database
604  FairRun* run = FairRun::Instance();
605  if ( ! run ) Fatal("SetParContainers", "No analysis run");
606 
607  FairRuntimeDb* db = run->GetRuntimeDb();
608  if ( ! db ) Fatal("SetParContainers", "No runtime database");
609  // Get Emc digitisation parameter container
610  fGeoPar = (PndEmcGeoPar*) db->getContainer("PndEmcGeoPar");
611  // Get Emc digitisation parameter container
612  fDigiPar = (PndEmcDigiPar*) db->getContainer("PndEmcDigiPar");
613  // Get Emc reconstruction parameter container
614  fRecoPar = (PndEmcRecoPar*) db->getContainer("PndEmcRecoPar");
615 }
616 
void SetEnergy(Double_t en)
virtual void MadeFrom(Int_t clusterIndex)
Definition: PndEmcBump.cxx:76
int fVerbose
Definition: poormantracks.C:24
std::vector< Double_t > fClusterPosParam
TClonesArray * digi
Int_t run
Definition: autocutx.C:47
virtual Double_t GetEnergy() const
Definition: PndEmcDigi.cxx:296
represents the reconstructed hit of one emc crystal
Definition: PndEmcDigi.h:40
friend F32vec4 exp(const F32vec4 &a)
Definition: P4_F32vec4.h:109
Int_t i
Definition: run_full.C:25
virtual void Exec(Option_t *opt)
Runs the task.
Double_t CalibrationEvtTimeByDigi(PndEmcDigi *theDigi, bool PrintOut=kFALSE) const
PndTransMap * map
Definition: sim_emc_apd.C:99
Double_t GetMoliereRadius()
Definition: PndEmcRecoPar.h:32
virtual Double_t Lat() const
#define verbose
void SetEventNo(Int_t evtNo)
Definition: PndEmcBump.h:57
Double_t GetCentroidShift()
Definition: PndEmcRecoPar.h:36
bool IsEnergyValid() const
Definition: PndEmcCluster.h:77
virtual void SetNBumps(unsigned nbumps)
TVector3 Where(TString method, std::vector< Double_t > params)
void SetPersistency(Bool_t val=kTRUE)
const std::vector< Int_t > & DigiList() const
Definition: PndEmcCluster.h:40
stores crystal index coordinates (x,y) or (theta,phi)
PndEmcTwoCoordIndex * GetTCI(Int_t DetectorId)
virtual Double_t AbsZernikeMoment(int n, int m, Double_t R0=15) const
Emc geometry mapper.
Definition: PndEmcMapper.h:22
Double_t GetMinDigiEnergy()
Definition: PndEmcRecoPar.h:38
Double_t GetOffsetParmB()
Definition: PndEmcRecoPar.h:22
Double_t GetOffsetParmC()
Definition: PndEmcRecoPar.h:23
PndEmcRecoPar * fRecoPar
Reconstruction parameter container.
Short_t GetModule() const
Definition: PndEmcDigi.h:103
void InitEmcMapper()
Int_t GetMaxBumps()
Definition: PndEmcRecoPar.h:37
Double_t GetExponentialConstant()
Definition: PndEmcRecoPar.h:34
PndEmcDigiCalibrator digiCalibrator
Double_t
const std::map< Int_t, Int_t > & LocalMaxMap() const
Definition: PndEmcCluster.h:42
Double_t GetMoliereRadiusShashlyk()
Definition: PndEmcRecoPar.h:33
used to share PndEmcDigis between bumps
splits clusters on the basis of exponential distance from the bump centroid
parameter set of Emc digitisation
Definition: PndEmcDigiPar.h:12
PndEmcGeoPar * fGeoPar
Geometry parameter container.
PndEmcDigiPar * fDigiPar
Digitisation parameter container.
Double_t GetOffsetParmA()
Definition: PndEmcRecoPar.h:21
a cluster (group of neighboring crystals) of hit emc crystals
Definition: PndEmcCluster.h:29
const std::map< Int_t, Int_t > & MemberDigiMap() const
Definition: PndEmcCluster.h:43
void SetZ20(Double_t z20)
Int_t NumberOfDigis() const
virtual Double_t Energy() const
void SetZ53(Double_t z53)
Int_t fEvtNo
Definition: PndEmcDigi.h:118
virtual Double_t GetEnergy() const
bool IsPositionValid() const
Definition: PndEmcCluster.h:78
virtual InitStatus Init()
Init Task.
virtual void FinishTask()
Called at end of task.
PndEmcSharedDigi * AddSharedDigi(PndEmcDigi *, Double_t weight)
Adds a new PndEmcSharedDigi to fSharedDigiArray and returns it.
ClassImp(PndAnaContFact)
const TVector3 & where() const
Definition: PndEmcDigi.h:111
void SetPosition(TVector3 pos)
Int_t GetMaxIterations()
Definition: PndEmcRecoPar.h:35
PndEmcBump * AddBump()
Adds a new PndEmcBump to fBumpArray and returns it.
Double_t GetTimeResolutionOfDigi(PndEmcDigi *theDigi) const
Text_t * GetEmcClusterPosMethod()
Definition: PndEmcRecoPar.h:20
static PndEmcStructure * Instance()
static PndEmcMapper * Instance()
void SetLatMom(Double_t latMom)
represents a reconstructed (splitted) emc cluster
Definition: PndEmcBump.h:34
FairMultiLinkedData GetTrackEntering() const
Parameter set for Emc Reco.
Definition: PndEmcRecoPar.h:12
PndEmcTwoCoordIndex * GetTCI() const
Definition: PndEmcDigi.cxx:216
virtual void addDigi(const TClonesArray *digiArray, Int_t iDigi)