20 #include <TBenchmark.h> 23 #include <TClonesArray.h> 160 AliWarning(
"Clusterizer already initialized. Unable to change the parameters.");
171 AliWarning(
"Clusterizer already initialized. Unable to change the parameters.");
182 AliWarning(
"Clusterizer already initialized. Unable to change the parameters.");
193 AliWarning(
"Clusterizer already initialized. Unable to change the parameters.");
204 AliWarning(
"Clusterizer already initialized. Unable to change the parameters.");
214 static Float_t cputime = 0;
215 static Float_t realtime = 0;
217 if (strstr(option,
"tim"))
220 if (strstr(option,
"print"))
238 for (Int_t index = 0; index <
fRecPoints->GetEntries(); index++)
255 for (Int_t index = 0; index <
fRecPoints->GetEntries(); index++)
268 if (strstr(option,
"deb") || strstr(option,
"all"))
271 AliDebug(1,Form(
"EMCAL Clusterizer found %d Rec Points",
fRecPoints->GetEntriesFast()));
273 if (strstr(option,
"tim"))
276 Printf(
"Exec took %f CPU time (%f real time) for clusterizing",
277 gBenchmark->GetCpuTime(
"EMCALClusterizer")-cputime,
gBenchmark->GetRealTime(
"EMCALClusterizer")-realtime);
278 cputime =
gBenchmark->GetCpuTime(
"EMCALClusterizer");
279 realtime =
gBenchmark->GetRealTime(
"EMCALClusterizer");
329 AliError(Form(
"Error: fShiftEta = %d is such that clusters cannot slide the whole calorimeter (nEtaDigits = %d).",
fShiftEta,
fNEtaDigits));
335 AliError(Form(
"Error: fShiftPhi = %d is such that clusters cannot slide the whole calorimeter (nPhiDigits = %d).",
fShiftPhi,
fNPhiDigits));
387 AliDebug(1,Form(
"****ExecOnce*****\n" 388 "fNphi = %d, fNeta = %d, fShiftPhi = %d, fShiftEta = %d, fTRUshift = %d\n" 389 "fNEtaDigitsSupMod = %d, fNPhiDigitsSupMod = %d, fNTRUPhi = %d, fNTRUEta = %d, fNEtaDigits = %d, fNPhiDigits = %d\n" 390 "fMaxShiftPhi = %d, fMaxShiftEta = %d, fNDigitsCluster = %d, fNClusEtaNoShift = %d, fNClusPhiNoShift = %d\n" 391 "fNClusters = %d, fNTotalClus = %d\n",
413 AliError(Form(
"%s: error initializing the clusterizer. No clusterization will be performed.",GetName()));
420 Float_t dEnergyCalibrated = 0.0, ehs = 0.0, time = 0.0;
423 while ((digit = dynamic_cast<AliEMCALDigit*>(nextdigit())))
443 ehs += dEnergyCalibrated;
444 digitsC->AddLast(digit);
448 AliDebug(1,Form(
"MakeClusters: Number of digits %d -> (e %f), ehs %f\n",
451 Int_t nSupMod=0, nModule=0, nIphi=0, nIeta=0;
452 Int_t iphi=0, ieta=0;
454 for (Int_t ishiftPhi = 0; ishiftPhi <
fMaxShiftPhi; ishiftPhi++)
458 for (Int_t ishiftEta = 0; ishiftEta <
fMaxShiftEta; ishiftEta++)
462 Int_t iTotalClus =
fNClusters * (ishiftPhi * fMaxShiftEta + ishiftEta);
464 TIter nextdigitC(digitsC);
465 while ((digit = dynamic_cast<AliEMCALDigit*>(nextdigitC())))
476 Int_t iClusPhi = iphi_eff /
fNphi;
478 if (iphi_eff < 0 || iClusPhi >= nClusPhi)
487 Int_t iClusEta = ieta_eff /
fNeta;
489 if (ieta_eff < 0 || iClusEta >= nClusEta)
493 iClusPhi = iphi_eff /
fNphi;
496 iClusEta = ieta_eff /
fNeta;
503 AliError(Form(
"iCluster out of range! iCluster = %d, fNClusters = %d (should never happen...)", iCluster,
fNClusters));
507 iCluster += iTotalClus;
511 AliError(Form(
"iCluster out of range! iCluster = %d, fNTotalClus = %d (should never happen...)", iCluster,
fNTotalClus));
517 AliError(Form(
"iDigit out of range! iDigit = %d, fNDigitsCluster = %d (should never happen...)", iDigit,
fNDigitsCluster));
523 AliError(
"Digit already added! (should never happen...)");
536 Bool_t recPointOk = kFALSE;
537 for (Int_t iCluster = 0; iCluster <
fNTotalClus; iCluster++)
550 recPoint->SetUniqueID(iCluster);
571 AliError(
"Error allocating rec points!");
Bool_t CheckAbsCellId(Int_t absId) const
void EvalDistanceToBadChannels(AliCaloCalibPedestal *caloped)
Int_t fNEtaDigits
! Total number of digits in eta
Int_t fNumberOfECAClusters
number of clusters found in EC section
virtual void Calibrate(Float_t &, Float_t &time, const Int_t cellId)
AliEMCALDigit *** fClustersArray
! Temporary array that contains clusters
void SetShiftEta(Int_t s)
Set fShiftEta; if clusterizer already initialized gives a warning and does nothing.
Float_t GetTime(void) const
TObjArray * fRecPoints
array with EMCAL clusters
virtual ~AliEMCALClusterizerFixedWindow()
Destructor.
void SetCalibAmp(Float_t amp)
Int_t fShiftPhi
Shifting number of cells in phi direction.
Float_t fECAW0
logarithmic weight for the cluster center of gravity calculation
Int_t GetNPhiSuperModule(void) const
Int_t fNClusEtaNoShift
! Max number of clusters in eta
Int_t GetNETAdiv(void) const
virtual void SetInput(Int_t numberOfECAClusters, TObjArray *recPoints, TClonesArray *digitsArr)
Int_t GetNumberOfSuperModules(void) const
clusterize in a fixed window
Cell energy calibration factors container class.
Int_t fNPhiDigits
! Total number of digits in phi
void SetTRUshift(Bool_t b)
Set fTRUshift; if clusterizer already initialized gives a warning and does nothing.
Int_t GetNPhi(void) const
Int_t GetMaximalEnergyIndex(void) const
Finds the maximum energy in the cluster.
#define AliWarning(message)
Int_t fNDigitsCluster
! Digits per cluster
void GetCellPhiEtaIndexInSModule(Int_t nSupMod, Int_t nModule, Int_t nIphi, Int_t nIeta, Int_t &iphi, Int_t &ieta) const
void ExecOnce()
Execute clusterizer. Add description.
void SetTime(Float_t time)
Int_t fNphi
Fixed window number of cells in phi direction.
Int_t fNTRUEta
! Number of TRUs in eta
Bool_t fJustClusters
false for standard reco
virtual void GetCalibrationParameters(void)
Bool_t fToUnfold
says if unfolding should be performed
Int_t fNClusPhiNoShift
! Max number of clusters in phi
Int_t fMaxShiftEta
! Max shift index in eta
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)
Int_t fInitialized
! Initialized clusterizer
Int_t fNClusters
! fNClusEtaNoShift x fNClusPhiNoShift
Float_t fTimeMin
minimum time of physical signal in a cell/digit
AliEMCALGeometry * fGeom
! pointer to geometry for utilities
Int_t GetNPHIdiv(void) const
Cell time shifts container class.
Int_t fNeta
Fixed window number of cells in eta direction.
Int_t fMaxShiftPhi
! Max shift index in phi
virtual void Digits2Clusters(Option_t *option)
Steering method to perform clusterization for the current event.
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)
TClonesArray * fDigitsArr
array with EMCAL digits
void SetNphi(Int_t n)
Set fNphi; if clusterizer already initialized gives a warning and does nothing.
#define AliDebug(logLevel, message)
AliCaloCalibPedestal * fCaloPed
! tower status map if aval
Int_t GetNEta(void) const
Int_t fNPhiDigitsSupMod
! Number of digits per SM in phi
Bool_t fTRUshift
Allows shifting inside a TRU (true) of through the whole calorimeter (false)
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 ...
void MakeClusters()
Make clusters, add more explanation.
TTree * fTreeR
tree with output clusters
Int_t fShiftEta
Shifting number of cells in eta direction.
#define AliError(message)
Int_t fNTotalClus
! Maximum total number of clusters
Int_t fNTRUPhi
! Number of TRUs in phi
virtual void SetClusterType(Int_t ver)
void SetIndexInList(Int_t val)
Float_t GetAmplitude() const
AliEMCALClusterizerFixedWindow()
Default constructor.
virtual void Print(Option_t *option) const
Print clusterizer parameters.
EMCal geometry, singleton.
Int_t fNEtaDigitsSupMod
! Number of digits per SM in eta
Float_t fMinECut
minimum energy for a digit to be a member of a cluster
Base class for the clusterization algorithm (pure abstract)
void SetShiftPhi(Int_t s)
Set fShiftPhi; if clusterizer already initialized gives a warning and does nothing.
virtual void PrintRecPoints(Option_t *option)
void SetNeta(Int_t n)
Set fNeta; if clusterizer already initialized gives a warning and does nothing.