11 #include <AliEMCALGeometry.h> 12 #include <AliEMCALRecoUtils.h> 13 #include <AliAODEvent.h> 29 fCellEnergyDistBefore(0),
30 fCellEnergyDistAfter(0),
31 fTCardCorrClusEnerConserv(kFALSE),
33 fRandomizeTCard(kTRUE),
34 fTCardCorrMinAmp(0.01),
35 fTCardCorrMaxInduced(100),
44 for(
Int_t j = 0; j < 4 ; j++)
72 AliWarning(
"Init EMCAL crosstalk emulation");
81 const std::map <std::string, Float_t (*)[fgkNsm]> properties2D = {
87 const std::map <std::string, Float_t *> properties1D = {
117 for (
unsigned int iProperty = 0; iProperty <
property.size(); iProperty++) {
118 val[iProperty][iSM] =
property.at(iProperty);
132 if (property.size() != 1) {
133 AliErrorStream() <<
"Trying to set single value for property " << name <<
", but given " <<
property.size() <<
" values. Please check your configuration!\n";
136 val[iSM] =
property.at(0);
148 fCellEnergyDistBefore =
new TH1F(
"hCellEnergyDistBefore",
"hCellEnergyDistBefore;E_{cell} (GeV)",1000,0,10);
150 fCellEnergyDistAfter =
new TH1F(
"hCellEnergyDistAfter",
"hCellEnergyDistAfter;E_{cell} (GeV)",1000,0,10);
163 AliError(
"Event ptr = 0, returning");
171 AliDebug(2, Form(
"Number of EMCAL cells = %d, returning",
fCaloCells->GetNumberOfCells()));
218 Int_t imod = -1, iphi =-1, ieta=-1,iTower = -1, iIphi = -1, iIeta = -1;
219 fGeom->GetCellIndex(
id,imod,iTower,iIphi,iIeta);
220 fGeom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,iphi,ieta);
229 AliDebug(1,Form(
"Reference cell absId %d, iEta %d, iPhi %d, amp %2.3f",
id,ieta,iphi,amp));
236 Int_t absIDuplr = -1;
237 Int_t absIDdolr = -1;
240 Int_t absIDup2lr = -1;
242 Int_t absIDdo2lr = -1;
246 if ( (ieta%2) && ieta <= AliEMCALGeoParams::fgkEMCALCols-1 ) colShift = -1;
247 if ( !(ieta%2) && ieta >= 0 ) colShift = +1;
249 absIDlr =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi, ieta+colShift);
252 if ( iphi < AliEMCALGeoParams::fgkEMCALRows-1 )
254 absIDup =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi+1, ieta);
255 absIDuplr =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi+1, ieta+colShift);
260 absIDdo =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi-1, ieta);
261 absIDdolr =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi-1, ieta+colShift);
265 if ( iphi < AliEMCALGeoParams::fgkEMCALRows-2 )
267 absIDup2 =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi+2, ieta);
268 absIDup2lr =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi+2, ieta+colShift);
273 absIDdo2 =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi-2, ieta);
274 absIDdo2lr =
fGeom->GetAbsCellIdFromCellIndexes(imod, iphi-2, ieta+colShift);
278 if ( TMath::FloorNint(iphi/8) != TMath::FloorNint((iphi+1)/8) ) { absIDup = -1 ; absIDuplr = -1 ; }
279 if ( TMath::FloorNint(iphi/8) != TMath::FloorNint((iphi-1)/8) ) { absIDdo = -1 ; absIDdolr = -1 ; }
280 if ( TMath::FloorNint(iphi/8) != TMath::FloorNint((iphi+2)/8) ) { absIDup2 = -1 ; absIDup2lr = -1 ; }
281 if ( TMath::FloorNint(iphi/8) != TMath::FloorNint((iphi-2)/8) ) { absIDdo2 = -1 ; absIDdo2lr = -1 ; }
295 AliDebug(1,Form(
"Same T-Card cells:\n \t up %d (%d), down %d (%d), left-right %d (%d), up-lr %d (%d), down-lr %d (%d)\n" 296 "\t up2 %d (%d), down2 %d (%d), up2-lr %d (%d), down2-lr %d (%d)",
297 absIDup ,okup ,absIDdo ,okdo ,absIDlr,oklr,absIDuplr ,okuplr ,absIDdolr ,okdolr ,
298 absIDup2,okup2,absIDdo2,okdo2, absIDup2lr,okup2lr,absIDdo2lr,okdo2lr));
308 AliDebug(1,Form(
"Fraction for SM %d (min %2.3f, max %2.3f):\n" 309 "\t up-down : c %2.3e, p1 %2.3e, p2 %2.4e, sig %2.3e, fraction %2.3f\n" 310 "\t up-down-lr: c %2.3e, p1 %2.3e, p2 %2.4e, sig %2.3e, fraction %2.3f\n" 311 "\t left-right: c %2.3e, p1 %2.3e, p2 %2.4e, sig %2.3e, fraction %2.3f\n" 312 "\t 2nd row : c %2.3e, p1 %2.3e, p2 %2.4e, sig %2.3e, fraction %2.3f",
336 AliDebug(1,Form(
"Randomized fraction: up-down %2.3f; up-down-left-right %2.3f; left-right %2.3f; 2nd row %2.3f",
337 fracupdown,fracupdownleri,fracleri,frac2nd));
346 AliDebug(1,Form(
"Induced energy: up-down %2.3f; up-down-left-right %2.3f; left-right %2.3f; 2nd row %2.3f",
347 indEupdown,indEupdownleri,indEleri,indE2nd));
355 AliDebug(1,Form(
"Induced energy, saturated?: up-down %2.3f; up-down-left-right %2.3f; left-right %2.3f; 2nd row %2.3f",
356 indEupdown,indEupdownleri,indEleri,indE2nd));
457 fCaloCells->GetCell(icell, absId, amp, time, mclabel, efrac);
459 if(amp <= 0.01) continue ;
466 fCaloCells->SetCell(icell, absId, amp, time, mclabel, efrac);
487 Int_t cellNumber = nCells;
493 fCaloCells->SetCell(cellNumber, absId, amp, time, mclabel, efrac);
522 if ( absID < 0 || absID >= 24*48*
fGeom->GetNumberOfSuperModules() )
525 Int_t imod = -1,iTower = -1, iIphi = -1, iIeta = -1;
526 if (!
fGeom->GetCellIndex(absID,imod,iTower,iIphi,iIeta))
537 printf(
"T-Card emulation activated, energy conservation <%d>, randomize E <%d>, induced energy parameters:\n",
539 printf(
"T-Card emulation super-modules fraction: Min cell E %2.2f Max induced E %2.2f\n",
544 printf(
"\t sm %d, fraction %2.3f, E frac abs min %2.3e max %2.3e \n",
547 for(
Int_t icell = 0; icell < 4; icell++)
549 printf(
"\t \t cell type %d, c %2.4e, p0 %2.4e, p1 %2.4e, sigma %2.4e \n",
Float_t fTCardCorrInduceEnerFracP1[4][fgkNsm]
Induced energy loss gauss fraction param1 on 0-same row, diff col, 1-up/down cells left/right col 2-l...
void AddInducedEnergiesToNewCells()
Bool_t fTCardCorrCellsNew[fgkNEMCalCells]
Array with induced cell energy in T-Card neighbour cells, that before had no signal.
AliEMCALGeometry * fGeom
! Geometry object
Bool_t fPrintOnce
Print once analysis parameters.
Bool_t fRandomizeTCard
Use random induced energy.
virtual void ResetArrays()
Float_t fTCardCorrMaxInduced
Maximum induced energy signal on adjacent cells.
static const Int_t fgkNsm
Total number of super-modules.
static const Int_t fgkNEMCalCells
Total number of cells in the calorimeter, 10*48*24 (EMCal) + 4*48*8 (EMCal/DCal 1/3) + 6*32*24 (DCal)...
TRandom3 fRandom
Random generator.
Correction component to emulate cell-level crosstalk in the EMCal correction framework.
Bool_t fTCardCorrClusEnerConserv
When making correlation, subtract from the reference cell the induced energy on the neighbour cells...
virtual ~AliEmcalCorrectionCellEmulateCrosstalk()
virtual void UserCreateOutputObjects()
Float_t fTCardCorrInduceEnerProb[fgkNsm]
Probability to induce energy loss per SM.
AliVEvent * InputEvent() const
void SetProperty(Float_t val[][fgkNsm], std::vector< double > &property, unsigned int iSM, const std::string &name)
AliVCaloCells * fCaloCells
! Pointer to CaloCells
void MakeCellTCardCorrelation()
AliEMCALRecoUtils * fRecoUtils
Pointer to RecoUtils.
Float_t fTCardCorrInduceEnerFrac[4][fgkNsm]
Induced energy loss gauss fraction param0 on 0-same row, diff col, 1-up/down cells left/right col 2-l...
Float_t fTCardCorrMinAmp
Minimum cell energy to induce signal on adjacent cells.
Float_t fTCardCorrInduceEnerFracWidth[4][fgkNsm]
Induced energy loss gauss witdth on 0-same row, diff col, 1-up/down cells left/right col 2-left/righ ...
void AddInducedEnergiesToExistingCells()
Base class for correction components in the EMCal correction framework.
Float_t fTCardCorrCellsEner[fgkNEMCalCells]
Array with induced cell energy in T-Card neighbour cells.
Float_t fTCardCorrInduceEnerFracMin[fgkNsm]
In case fTCardCorrInduceEnerFracP1 is non null, restrict the minimum fraction of induced energy per S...
void UserCreateOutputObjects()
TList * fOutput
! List of output histograms
Bool_t fCreateHisto
Flag to make some basic histograms.
TH1F * fCellEnergyDistBefore
! cell energy distribution, before energy smearing
TH1F * fCellEnergyDistAfter
! cell energy distribution, after energy smearing
virtual Bool_t Initialize()
Bool_t AcceptCell(Int_t absID)
Float_t fTCardCorrInduceEner[4][fgkNsm]
Induced energy loss gauss constant on 0-same row, diff col, 1-up/down cells left/right col 2-left/rig...
static RegisterCorrectionComponent< AliEmcalCorrectionCellEmulateCrosstalk > reg
AliEmcalCorrectionEventManager fEventManager
Minimal task which inherits from AliAnalysisTaskSE and manages access to the event.
Float_t fTCardCorrInduceEnerFracMax[fgkNsm]
In case fTCardCorrInduceEnerFracP1 is non null, restrict the maximum fraction of induced energy per S...
AliEmcalCorrectionCellEmulateCrosstalk()
bool GetProperty(std::string propertyName, T &property, bool requiredProperty=true, std::string correctionName="")
Retrieve property.
void RetrieveAndSetProperties(const T &properties)