20 #include <TBenchmark.h> 23 #include <TClonesArray.h> 88 if (strstr(option,
"tim"))
91 if (strstr(option,
"print"))
109 for (Int_t index = 0; index <
fRecPoints->GetEntries(); index++)
123 for (Int_t index = 0; index <
fRecPoints->GetEntries(); index++)
136 if (strstr(option,
"deb") || strstr(option,
"all"))
139 AliDebug(1,Form(
"EMCAL Clusterizer found %d Rec Points",
fRecPoints->GetEntriesFast()));
141 if (strstr(option,
"tim"))
144 printf(
"Exec took %f seconds for Clusterizing",
166 Int_t nSupMod1=0, nModule1=0, nIphi1=0, nIeta1=0, iphi1=0, ieta1=0;
167 Int_t nSupMod2=0, nModule2=0, nIphi2=0, nIeta2=0, iphi2=0, ieta2=0;
168 Int_t rowdiff=0, coldiff=0;
178 if (nSupMod1 != nSupMod2 )
184 if (!TMath::AreEqualAbs(smPhi1, smPhi2, 1e-3))
return 2;
195 rowdiff = TMath::Abs(iphi1 - iphi2);
196 coldiff = TMath::Abs(ieta1 - ieta2);
202 AliDebug(9, Form(
"AliEMCALClusterizerNxN::AreNeighbours(): id1=%d, (row %d, col %d) ; id2=%d, (row %d, col %d), shared %d \n",
203 d1->
GetId(), iphi1,ieta1, d2->
GetId(), iphi2,ieta2, shared));
209 AliDebug(9, Form(
"NOT AliEMCALClusterizerNxN::AreNeighbours(): id1=%d, (row %d, col %d) ; id2=%d, (row %d, col %d), shared %d \n",
210 d1->
GetId(), iphi1,ieta1, d2->
GetId(), iphi2,ieta2, shared));
222 AliFatal(
"Did not get geometry from EMCALLoader");
231 while ( (digit = static_cast<AliEMCALDigit*>(nextdigit())) )
234 Float_t time = digit->
GetTime();
238 digitsC.AddLast(digit);
241 TIter nextdigitC(&digitsC);
243 AliDebug(1,Form(
"MakeClusters: Number of digits %d -> (e %f)\n",
246 Bool_t bDone = kFALSE;
247 while ( bDone != kTRUE )
250 Int_t iMaxEnergyDigit = -1;
251 Float_t dMaxEnergyDigit = -1;
255 while ( (digit = static_cast<AliEMCALDigit *>(nextdigitC())) )
258 Float_t time = digit->
GetTime();
264 if (dEnergyCalibrated > dMaxEnergyDigit)
266 dMaxEnergyDigit = dEnergyCalibrated;
267 iMaxEnergyDigit = digit->
GetId();
268 pMaxEnergyDigit = digit;
273 if (iMaxEnergyDigit < 0 || digitsC.GetEntries() <= 0)
279 AliDebug (2, Form(
"Max digit found: %1.5f AbsId: %d", dMaxEnergyDigit, iMaxEnergyDigit));
282 TList clusterDigitList;
283 clusterDigitList.SetOwner(kFALSE);
284 clusterDigitList.AddLast(pMaxEnergyDigit);
286 Double_t clusterCandidateEnergy = dMaxEnergyDigit;
291 while ( (digit = static_cast<AliEMCALDigit *>(nextdigitC())) )
293 if (digit == pMaxEnergyDigit)
continue;
296 AliDebug(5, Form(
"-> Digit ENERGY: %1.5f", dEnergyCalibrated));
300 Float_t time = pMaxEnergyDigit->
GetTime();
302 Bool_t shared = kFALSE;
305 clusterDigitList.AddLast(digit);
306 clusterCandidateEnergy += dEnergyCalibrated;
330 AliDebug(9, Form(
"Number of cells per cluster (max is 9!): %d", clusterDigitList.GetEntries()));
332 for (Int_t idig = 0; idig < clusterDigitList.GetEntries(); idig++)
338 digitsC.Remove(digit);
347 digitsC.Remove(pMaxEnergyDigit);
350 AliDebug (2, Form(
"Number of digits left: %d", digitsC.GetEntries()));
Bool_t CheckAbsCellId(Int_t absId) const
void EvalDistanceToBadChannels(AliCaloCalibPedestal *caloped)
virtual Int_t AreNeighbours(AliEMCALDigit *d1, AliEMCALDigit *d2, Bool_t &shared) const
printf("Chi2/npoints = %f\n", TMath::Sqrt(chi2/npoints))
Int_t fNumberOfECAClusters
number of clusters found in EC section
virtual void Calibrate(Float_t &, Float_t &time, const Int_t cellId)
Float_t GetTime(void) const
virtual void Digits2Clusters(Option_t *option)
TObjArray * fRecPoints
array with EMCAL clusters
void SetCalibAmp(Float_t amp)
Float_t fECAW0
logarithmic weight for the cluster center of gravity calculation
virtual void SetInput(Int_t numberOfECAClusters, TObjArray *recPoints, TClonesArray *digitsArr)
Cell energy calibration factors container class.
Double_t GetPhiCenterOfSM(Int_t nsupmod) const
Int_t fNRowDiff
How many neighbors to consider along row (phi)
Int_t GetMaximalEnergyIndex(void) const
Finds the maximum energy in the cluster.
void GetCellPhiEtaIndexInSModule(Int_t nSupMod, Int_t nModule, Int_t nIphi, Int_t nIeta, Int_t &iphi, Int_t &ieta) const
void SetTime(Float_t time)
AliEMCALClusterizerNxN()
Default constructor.
Float_t fTimeCut
maximum time difference between the digits inside EMC cluster
Bool_t fJustClusters
false for standard reco
virtual void GetCalibrationParameters(void)
Bool_t fToUnfold
says if unfolding should be performed
Bool_t GetCellIndex(Int_t absId, Int_t &nSupMod, Int_t &nModule, Int_t &nIphi, Int_t &nIeta) const
virtual void MakeUnfolding()
virtual void AddDigit(AliEMCALDigit &digit, const Float_t energy, const Bool_t shared)
Float_t fTimeMin
minimum time of physical signal in a cell/digit
AliEMCALGeometry * fGeom
! pointer to geometry for utilities
virtual void MakeClusters()
Make clusters.
Cell time shifts container class.
Double_t GetCalibAmp() const
pedestal/bad map monitoring and calibration tools
Float_t fTimeMax
maximum time of physical signal in a cell/digit
#define AliFatal(message)
static const int fgkEMCALCols
Number of columns per module for EMCAL.
Create clusters of maximum size NxM.
TClonesArray * fDigitsArr
array with EMCAL digits
#define AliDebug(logLevel, message)
AliCaloCalibPedestal * fCaloPed
! tower status map if aval
AliEMCALEMCGeometry * GetEMCGeometry() const
virtual void GetCaloCalibPedestal(void)
AliEMCALUnfolding * fClusterUnfolding
! pointer to unfolding object
virtual void EvalAll(Float_t logWeight, TClonesArray *digits, const Bool_t justClusters)
Evaluates cluster parameters: position, shower shape, primaries ...
Float_t fECAClusteringThreshold
minimum energy to seed a EC digit in a cluster
TTree * fTreeR
tree with output clusters
Bool_t fEnergyGrad
If true only cluster if neighboring cell has less energy.
Int_t fNColDiff
How many neighbors to consider along col (eta)
virtual void SetClusterType(Int_t ver)
void SetIndexInList(Int_t val)
Float_t GetAmplitude() const
virtual void Print(Option_t *option) const
Print clusterizer parameters.
EMCal geometry, singleton.
Float_t fMinECut
minimum energy for a digit to be a member of a cluster
Base class for the clusterization algorithm (pure abstract)
virtual ~AliEMCALClusterizerNxN()
Destructtor.
virtual void PrintRecPoints(Option_t *option)