AliPhysics  5eaf189 (5eaf189)
AliEmcalCorrectionCellEmulateCrosstalk.cxx
Go to the documentation of this file.
1 // AliEmcalCorrectionCellEmulateCrosstalk
2 //
3 
4 #include <map>
5 #include <vector>
6 #include <string>
7 
8 #include <TObjArray.h>
9 #include <TFile.h>
10 
11 #include <AliEMCALGeometry.h>
12 #include <AliEMCALRecoUtils.h>
13 #include <AliAODEvent.h>
14 
16 
20 
21 // Actually registers the class with the base class
23 
28  AliEmcalCorrectionComponent("AliEmcalCorrectionCellEmulateCrosstalk"),
29  fCellEnergyDistBefore(0),
30  fCellEnergyDistAfter(0),
31  fTCardCorrClusEnerConserv(kFALSE),
32  fRandom(0),
33  fRandomizeTCard(kTRUE),
34  fTCardCorrMinAmp(0.01),
35  fTCardCorrMaxInduced(100),
36  fPrintOnce(kFALSE),
37  fAODCellsTmp(0x0)
38 {
39  for(Int_t i = 0; i < fgkNsm; i++)
40  {
44 
45  for(Int_t j = 0; j < 4 ; j++)
46  {
47  fTCardCorrInduceEner [j][i] = 0 ;
48  fTCardCorrInduceEnerFrac [j][i] = 0 ;
49  fTCardCorrInduceEnerFracP1 [j][i] = 0 ;
51  }
52  }
53 
54  ResetArrays();
55 }
56 
61 {
62  fAODCellsTmp->DeleteContainer();
63  delete fAODCellsTmp;
64 }
65 
70 {
71  // Initialization
73 
74  AliWarning("Init EMCAL crosstalk emulation");
75 
76  GetProperty("conservEnergy", fTCardCorrClusEnerConserv);
77  GetProperty("randomizeTCardInducedEnergy", fRandomizeTCard);
78  GetProperty("inducedTCardMinimumCellEnergy", fTCardCorrMinAmp);
79  GetProperty("inducedTCardMaximum", fTCardCorrMaxInduced);
80 
81  // Handle array initialization
82  // For the format of these values, see the "default" yaml configuration file
83  const std::map <std::string, Float_t (*)[fgkNsm]> properties2D = {
84  {"inducedEnergyLossConstant", fTCardCorrInduceEner},
85  {"inducedEnergyLossFraction", fTCardCorrInduceEnerFrac},
86  {"inducedEnergyLossFractionP1", fTCardCorrInduceEnerFracP1},
87  {"inducedEnergyLossFractionWidth", fTCardCorrInduceEnerFracWidth}
88  };
89  const std::map <std::string, Float_t *> properties1D = {
90  {"inducedEnergyLossMinimumFraction", fTCardCorrInduceEnerFracMin},
91  {"inducedEnergyLossMaximumFraction", fTCardCorrInduceEnerFracMax},
92  {"inducedEnergyLossProbability", fTCardCorrInduceEnerProb}
93  };
94  RetrieveAndSetProperties(properties2D);
95  RetrieveAndSetProperties(properties1D);
96 
97  if (!fRecoUtils) {
99  }
100 
101  GetProperty("printConfiguration", fPrintOnce);
102  if (fPrintOnce) {
103  PrintTCardParam();
104  }
105 
106  return kTRUE;
107 }
108 
117 void AliEmcalCorrectionCellEmulateCrosstalk::SetProperty(Float_t val[][fgkNsm], std::vector<double> & property, unsigned int iSM, const std::string & name)
118 {
119  for (unsigned int iProperty = 0; iProperty < property.size(); iProperty++) {
120  val[iProperty][iSM] = property.at(iProperty);
121  }
122 }
123 
132 void AliEmcalCorrectionCellEmulateCrosstalk::SetProperty(Float_t val[fgkNsm], std::vector<double> & property, unsigned int iSM, const std::string & name)
133 {
134  if (property.size() != 1) {
135  AliErrorStream() << "Trying to set single value for property " << name << ", but given " << property.size() << " values. Please check your configuration!\n";
136  }
137  else {
138  val[iSM] = property.at(0);
139  }
140 }
141 
146 {
148 
149  if (fCreateHisto){
150  fCellEnergyDistBefore = new TH1F("hCellEnergyDistBefore","hCellEnergyDistBefore;E_{cell} (GeV)",1000,0,10);
152  fCellEnergyDistAfter = new TH1F("hCellEnergyDistAfter","hCellEnergyDistAfter;E_{cell} (GeV)",1000,0,10);
154  }
155 }
156 
161 {
163 
164  if (!fEventManager.InputEvent()) {
165  AliError("Event ptr = 0, returning");
166  return kFALSE;
167  }
168 
169  // START PROCESSING ---------------------------------------------------------
170  // Test if cells present
171  if (fCaloCells->GetNumberOfCells()<=0)
172  {
173  AliDebug(2, Form("Number of EMCAL cells = %d, returning", fCaloCells->GetNumberOfCells()));
174  return kFALSE;
175  }
176 
177  if(fCreateHisto)
178  FillCellQA(fCellEnergyDistBefore); // "before" QA
179 
180  // CELL CROSSTALK EMULATION -------------------------------------------------------
181 
182  // Compute the induced cell energies by T-Card correlation emulation, ONLY MC
184 
185  // Add to existing cells the found induced energies in MakeCellTCardCorrelation() if new signal is larger than 10 MeV.
187 
188  // Add new cells with found induced energies in MakeCellTCardCorrelation() if new signal is larger than 10 MeV.
190 
191  // -------------------------------------------------------
192 
193  if(fCreateHisto)
194  FillCellQA(fCellEnergyDistAfter); // "after" QA
195 
196  ResetArrays();
197 
198  return kTRUE;
199 }
200 
206 {
207  Int_t id = -1;
208  Float_t amp = -1;
209 
210  if (fPrintOnce) {
211  PrintTCardParam();
212  fPrintOnce = 0;
213  }
214 
215  Int_t nCells = fCaloCells->GetNumberOfCells();
216 
217  // Loop on all cells with signal
218  for (Int_t icell = 0; icell < nCells; icell++)
219  {
220  id = fCaloCells->GetCellNumber(icell);
221  amp = fCaloCells->GetAmplitude (icell); // fCaloCells->GetCellAmplitude(id);
222 
223  if ( amp <= fTCardCorrMinAmp ) continue ;
224 
225  //
226  // First get the SM, col-row of this tower
227  Int_t imod = -1, iphi =-1, ieta=-1,iTower = -1, iIphi = -1, iIeta = -1;
228  fGeom->GetCellIndex(id,imod,iTower,iIphi,iIeta);
229  fGeom->GetCellPhiEtaIndexInSModule(imod,iTower,iIphi, iIeta,iphi,ieta);
230 
231  //
232  // Determine randomly if we want to create a correlation for this cell,
233  // depending the SM number of the cell
234  if ( fTCardCorrInduceEnerProb[imod] < 1 )
235  {
236  Float_t rand = fRandom.Uniform(0, 1);
237 
238  if ( rand > fTCardCorrInduceEnerProb[imod] ) continue;
239  }
240 
241  AliDebug(1,Form("Reference cell absId %d, iEta %d, iPhi %d, amp %2.3f",id,ieta,iphi,amp));
242 
243  //
244  // Get the absId of the cells in the cross and same T-Card
245  Int_t absIDup = -1;
246  Int_t absIDdo = -1;
247  Int_t absIDlr = -1;
248  Int_t absIDuplr = -1;
249  Int_t absIDdolr = -1;
250 
251  Int_t absIDup2 = -1;
252  Int_t absIDup2lr = -1;
253  Int_t absIDdo2 = -1;
254  Int_t absIDdo2lr = -1;
255 
256  // Only 2 columns in the T-Card, +1 for even and -1 for odd with respect reference cell
257  Int_t colShift = 0;
258  if ( (ieta%2) && ieta <= AliEMCALGeoParams::fgkEMCALCols-1 ) colShift = -1;
259  if ( !(ieta%2) && ieta >= 0 ) colShift = +1;
260 
261  absIDlr = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi, ieta+colShift);
262 
263  // Check up / down cells from reference cell not out of SM and in same T-Card
264  if ( iphi < AliEMCALGeoParams::fgkEMCALRows-1 )
265  {
266  absIDup = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi+1, ieta);
267  absIDuplr = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi+1, ieta+colShift);
268  }
269 
270  if ( iphi > 0 )
271  {
272  absIDdo = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi-1, ieta);
273  absIDdolr = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi-1, ieta+colShift);
274  }
275 
276  // Check 2 up / 2 down cells from reference cell not out of SM
277  if ( iphi < AliEMCALGeoParams::fgkEMCALRows-2 )
278  {
279  absIDup2 = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi+2, ieta);
280  absIDup2lr = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi+2, ieta+colShift);
281  }
282 
283  if ( iphi > 1 )
284  {
285  absIDdo2 = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi-2, ieta);
286  absIDdo2lr = fGeom->GetAbsCellIdFromCellIndexes(imod, iphi-2, ieta+colShift);
287  }
288 
289  // In same T-Card?
290  if ( TMath::FloorNint(iphi/8) != TMath::FloorNint((iphi+1)/8) ) { absIDup = -1 ; absIDuplr = -1 ; }
291  if ( TMath::FloorNint(iphi/8) != TMath::FloorNint((iphi-1)/8) ) { absIDdo = -1 ; absIDdolr = -1 ; }
292  if ( TMath::FloorNint(iphi/8) != TMath::FloorNint((iphi+2)/8) ) { absIDup2 = -1 ; absIDup2lr = -1 ; }
293  if ( TMath::FloorNint(iphi/8) != TMath::FloorNint((iphi-2)/8) ) { absIDdo2 = -1 ; absIDdo2lr = -1 ; }
294 
295  //
296  // Check if they are not declared bad or exist
297  Bool_t okup = AcceptCell(absIDup );
298  Bool_t okdo = AcceptCell(absIDdo );
299  Bool_t oklr = AcceptCell(absIDlr );
300  Bool_t okuplr = AcceptCell(absIDuplr );
301  Bool_t okdolr = AcceptCell(absIDdolr );
302  Bool_t okup2 = AcceptCell(absIDup2 );
303  Bool_t okdo2 = AcceptCell(absIDdo2 );
304  Bool_t okup2lr= AcceptCell(absIDup2lr);
305  Bool_t okdo2lr= AcceptCell(absIDdo2lr);
306 
307  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"
308  "\t up2 %d (%d), down2 %d (%d), up2-lr %d (%d), down2-lr %d (%d)",
309  absIDup ,okup ,absIDdo ,okdo ,absIDlr,oklr,absIDuplr ,okuplr ,absIDdolr ,okdolr ,
310  absIDup2,okup2,absIDdo2,okdo2, absIDup2lr,okup2lr,absIDdo2lr,okdo2lr));
311 
312  //
313  // Generate some energy for the nearby cells in same TCard , depending on this cell energy
314  // Check if originally the tower had no or little energy, in which case tag it as new
315  Float_t fracupdown = fTCardCorrInduceEnerFrac[0][imod]+amp*fTCardCorrInduceEnerFracP1[0][imod];
316  Float_t fracupdownleri = fTCardCorrInduceEnerFrac[1][imod]+amp*fTCardCorrInduceEnerFracP1[1][imod];
317  Float_t fracleri = fTCardCorrInduceEnerFrac[2][imod]+amp*fTCardCorrInduceEnerFracP1[2][imod];
318  Float_t frac2nd = fTCardCorrInduceEnerFrac[3][imod]+amp*fTCardCorrInduceEnerFracP1[3][imod];
319 
320  AliDebug(1,Form("Fraction for SM %d (min %2.3f, max %2.3f):\n"
321  "\t up-down : c %2.3e, p1 %2.3e, p2 %2.4e, sig %2.3e, fraction %2.3f\n"
322  "\t up-down-lr: c %2.3e, p1 %2.3e, p2 %2.4e, sig %2.3e, fraction %2.3f\n"
323  "\t left-right: c %2.3e, p1 %2.3e, p2 %2.4e, sig %2.3e, fraction %2.3f\n"
324  "\t 2nd row : c %2.3e, p1 %2.3e, p2 %2.4e, sig %2.3e, fraction %2.3f",
326  fTCardCorrInduceEner[0][imod],fTCardCorrInduceEnerFrac[0][imod],fTCardCorrInduceEnerFracP1[0][imod],fTCardCorrInduceEnerFracWidth[0][imod],fracupdown,
327  fTCardCorrInduceEner[1][imod],fTCardCorrInduceEnerFrac[1][imod],fTCardCorrInduceEnerFracP1[1][imod],fTCardCorrInduceEnerFracWidth[1][imod],fracupdownleri,
328  fTCardCorrInduceEner[2][imod],fTCardCorrInduceEnerFrac[2][imod],fTCardCorrInduceEnerFracP1[2][imod],fTCardCorrInduceEnerFracWidth[2][imod],fracleri,
329  fTCardCorrInduceEner[3][imod],fTCardCorrInduceEnerFrac[3][imod],fTCardCorrInduceEnerFracP1[3][imod],fTCardCorrInduceEnerFracWidth[3][imod],frac2nd));
330 
331  if( fracupdown < fTCardCorrInduceEnerFracMin[imod] ) fracupdown = fTCardCorrInduceEnerFracMin[imod];
332  if( fracupdown > fTCardCorrInduceEnerFracMax[imod] ) fracupdown = fTCardCorrInduceEnerFracMax[imod];
333  if( fracupdownleri < fTCardCorrInduceEnerFracMin[imod] ) fracupdownleri = fTCardCorrInduceEnerFracMin[imod];
334  if( fracupdownleri > fTCardCorrInduceEnerFracMax[imod] ) fracupdownleri = fTCardCorrInduceEnerFracMax[imod];
335  if( fracleri < fTCardCorrInduceEnerFracMin[imod] ) fracleri = fTCardCorrInduceEnerFracMin[imod];
336  if( fracleri > fTCardCorrInduceEnerFracMax[imod] ) fracleri = fTCardCorrInduceEnerFracMax[imod];
337  if( frac2nd < fTCardCorrInduceEnerFracMin[imod] ) frac2nd = fTCardCorrInduceEnerFracMin[imod];
338  if( frac2nd > fTCardCorrInduceEnerFracMax[imod] ) frac2nd = fTCardCorrInduceEnerFracMax[imod];
339 
340  // Randomize the induced fraction, if requested
341  if(fRandomizeTCard)
342  {
343  fracupdown = fRandom.Gaus(fracupdown ,fTCardCorrInduceEnerFracWidth[0][imod]);
344  fracupdownleri = fRandom.Gaus(fracupdownleri,fTCardCorrInduceEnerFracWidth[1][imod]);
345  fracleri = fRandom.Gaus(fracleri ,fTCardCorrInduceEnerFracWidth[2][imod]);
346  frac2nd = fRandom.Gaus(frac2nd ,fTCardCorrInduceEnerFracWidth[3][imod]);
347 
348  AliDebug(1,Form("Randomized fraction: up-down %2.3f; up-down-left-right %2.3f; left-right %2.3f; 2nd row %2.3f",
349  fracupdown,fracupdownleri,fracleri,frac2nd));
350  }
351 
352  // Calculate induced energy
353  Float_t indEupdown = fTCardCorrInduceEner[0][imod]+amp*fracupdown;
354  Float_t indEupdownleri = fTCardCorrInduceEner[1][imod]+amp*fracupdownleri;
355  Float_t indEleri = fTCardCorrInduceEner[2][imod]+amp*fracleri;
356  Float_t indE2nd = fTCardCorrInduceEner[3][imod]+amp*frac2nd;
357 
358  AliDebug(1,Form("Induced energy: up-down %2.3f; up-down-left-right %2.3f; left-right %2.3f; 2nd row %2.3f",
359  indEupdown,indEupdownleri,indEleri,indE2nd));
360 
361  // Check if we induce too much energy, in such case use a constant value
362  if ( fTCardCorrMaxInduced < indE2nd ) indE2nd = fTCardCorrMaxInduced;
363  if ( fTCardCorrMaxInduced < indEupdownleri ) indEupdownleri = fTCardCorrMaxInduced;
364  if ( fTCardCorrMaxInduced < indEupdown ) indEupdown = fTCardCorrMaxInduced;
365  if ( fTCardCorrMaxInduced < indEleri ) indEleri = fTCardCorrMaxInduced;
366 
367  AliDebug(1,Form("Induced energy, saturated?: up-down %2.3f; up-down-left-right %2.3f; left-right %2.3f; 2nd row %2.3f",
368  indEupdown,indEupdownleri,indEleri,indE2nd));
369 
370  //
371  // Add the induced energy, check if cell existed
372  if ( okup )
373  {
374  fTCardCorrCellsEner[absIDup] += indEupdown;
375 
376  if ( fCaloCells->GetCellAmplitude(absIDup) < 0.01 ) fTCardCorrCellsNew[absIDup] = kTRUE;
377  }
378 
379  if ( okdo )
380  {
381  fTCardCorrCellsEner[absIDdo] += indEupdown;
382 
383  if ( fCaloCells->GetCellAmplitude(absIDdo) < 0.01 ) fTCardCorrCellsNew[absIDdo] = kTRUE;
384  }
385 
386  if ( oklr )
387  {
388  fTCardCorrCellsEner[absIDlr] += indEleri;
389 
390  if ( fCaloCells->GetCellAmplitude(absIDlr) < 0.01 ) fTCardCorrCellsNew[absIDlr] = kTRUE;
391  }
392 
393  if ( okuplr )
394  {
395  fTCardCorrCellsEner[absIDuplr] += indEupdownleri;
396 
397  if ( fCaloCells->GetCellAmplitude(absIDuplr ) < 0.01 ) fTCardCorrCellsNew[absIDuplr] = kTRUE;
398  }
399 
400  if ( okdolr )
401  {
402  fTCardCorrCellsEner[absIDdolr] += indEupdownleri;
403 
404  if ( fCaloCells->GetCellAmplitude(absIDdolr ) < 0.01 ) fTCardCorrCellsNew[absIDdolr] = kTRUE;
405  }
406 
407  if ( okup2 )
408  {
409  fTCardCorrCellsEner[absIDup2] += indE2nd;
410 
411  if ( fCaloCells->GetCellAmplitude(absIDup2) < 0.01 ) fTCardCorrCellsNew[absIDup2] = kTRUE;
412  }
413 
414  if ( okup2lr )
415  {
416  fTCardCorrCellsEner[absIDup2lr] += indE2nd;
417 
418  if ( fCaloCells->GetCellAmplitude(absIDup2lr) < 0.01 ) fTCardCorrCellsNew[absIDup2lr] = kTRUE;
419  }
420 
421  if ( okdo2 )
422  {
423  fTCardCorrCellsEner[absIDdo2] += indE2nd;
424 
425  if ( fCaloCells->GetCellAmplitude(absIDdo2) < 0.01 ) fTCardCorrCellsNew[absIDdo2] = kTRUE;
426  }
427 
428  if ( okdo2lr )
429  {
430  fTCardCorrCellsEner[absIDdo2lr] += indE2nd;
431 
432  if ( fCaloCells->GetCellAmplitude(absIDdo2lr) < 0.01 ) fTCardCorrCellsNew[absIDdo2lr] = kTRUE;
433  }
434 
435  //
436  // Subtract the added energy to main cell, if energy conservation is requested
438  {
439  if ( oklr ) fTCardCorrCellsEner[id] -= indEleri;
440  if ( okuplr ) fTCardCorrCellsEner[id] -= indEupdownleri;
441  if ( okdolr ) fTCardCorrCellsEner[id] -= indEupdownleri;
442  if ( okup ) fTCardCorrCellsEner[id] -= indEupdown;
443  if ( okdo ) fTCardCorrCellsEner[id] -= indEupdown;
444  if ( okup2 ) fTCardCorrCellsEner[id] -= indE2nd;
445  if ( okup2lr ) fTCardCorrCellsEner[id] -= indE2nd;
446  if ( okdo2 ) fTCardCorrCellsEner[id] -= indE2nd;
447  if ( okdo2lr ) fTCardCorrCellsEner[id] -= indE2nd;
448  } // conserve energy
449 
450  } // cell loop
451 
452 }
453 
460 {
461  Short_t absId = -1;
462  Double_t amp = -1;
463  Double_t time = -1;
464  Int_t mclabel = -1;
465  Double_t efrac = 0.;
466 
467  // Add the induced energy to the cells and copy them into a new temporal container
468  // used in AddInducedEnergiesToNewCells() to refill the default cells list fCaloCells
469  // Create the data member only once. Done here, not sure where to do this properly in the framework.
470  //
471  if ( !fAODCellsTmp )
472  fAODCellsTmp = new AliAODCaloCells("tmpCaloCellsAOD","tmpCaloCellsAOD",AliAODCaloCells::kEMCALCell);
473 
474  Int_t nCells = fCaloCells->GetNumberOfCells();
475  fAODCellsTmp->CreateContainer(nCells);
476 
477  for (Int_t icell = 0; icell < nCells; icell++)
478  {
479  // Get cell
480  fCaloCells->GetCell(icell, absId, amp, time, mclabel, efrac);
481 
482  amp+=fTCardCorrCellsEner[absId];
483 
484  // Set new amplitude in new temporal container
485  fAODCellsTmp->SetCell(icell, absId, amp, time, mclabel, efrac);
486  }
487 }
488 
493 {
494  // Count how many new cells
495  //
496  Int_t nCells = fCaloCells->GetNumberOfCells();
497  Int_t nCellsNew = 0;
498  for(Int_t j = 0; j < fgkNEMCalCells; j++)
499  {
500  // Newly created?
501  if ( !fTCardCorrCellsNew[j] ) continue;
502 
503  // Accept only if at least 10 MeV
504  if ( fTCardCorrCellsEner[j] < 0.01 ) continue;
505 
506  nCellsNew++;
507  }
508 
509  // Delete default cells container and create new one with larger arrays
510  // to contain new cells.
511  //
512  fCaloCells->DeleteContainer();
513  fCaloCells->CreateContainer(nCells+nCellsNew);
514 
515  // Recover the original input from fAODCellsTmp filled in AddInducedEnergiesToExistingCells()
516  //
517  Short_t absId = -1;
518  Float_t amp = -1;
519  Double_t time = 0;
520  Int_t mclabel = -1;
521  Double_t efrac = -1;
522  Bool_t highgain = 1;
523  Int_t cellNumber = -1;
524 
525  for(Int_t j = 0; j < nCells; j++)
526  {
527  absId = fAODCellsTmp->GetCellNumber(j);
528  amp = fAODCellsTmp->GetAmplitude(j);
529  time = fAODCellsTmp->GetTime(j);
530  mclabel = fAODCellsTmp->GetMCLabel(j);
531  efrac = fAODCellsTmp->GetEFraction(j);
532  highgain = fAODCellsTmp->GetHighGain(j);
533  fCaloCells->SetCell(j, absId, amp, time, mclabel, efrac, highgain);
534  }
535 
536  // Add the new cells
537  //
538  for(Int_t j = 0; j < fgkNEMCalCells; j++)
539  {
540  // Newly created?
541  if ( !fTCardCorrCellsNew[j] ) continue;
542 
543  // Accept only if at least 10 MeV
544  if ( fTCardCorrCellsEner[j] < 0.01 ) continue;
545 
546  // Add new cell
547  cellNumber = nCells;
548  absId = j;
549  amp = fTCardCorrCellsEner[j];
550  time = 615.*1e-9;
551  mclabel = -1;
552  efrac = 0.;
553 
554  Int_t ok = fCaloCells->SetCell(cellNumber, absId, amp, time, mclabel, efrac,1);
555 
556  if ( !ok ) AliError("Induced new cell could not be added!");
557 
558  nCells++;
559  }
560 
561  if ( nCellsNew > 0 ) fCaloCells->Sort();
562 }
563 
568 {
569  for(Int_t j = 0; j < fgkNEMCalCells; j++)
570  {
571  fTCardCorrCellsEner[j] = 0.;
572  fTCardCorrCellsNew [j] = kFALSE;
573  }
574 
575  if ( fAODCellsTmp ) fAODCellsTmp->DeleteContainer();
576 }
577 
587 {
588  if ( absID < 0 || absID >= 24*48*fGeom->GetNumberOfSuperModules() )
589  return kFALSE;
590 
591  Int_t imod = -1,iTower = -1, iIphi = -1, iIeta = -1;
592  if (!fGeom->GetCellIndex(absID,imod,iTower,iIphi,iIeta))
593  return kFALSE;
594 
595  return kTRUE;
596 }
597 
602 {
603  printf("T-Card emulation activated, energy conservation <%d>, randomize E <%d>, induced energy parameters:\n",
605  printf("T-Card emulation super-modules fraction: Min cell E %2.2f Max induced E %2.2f\n",
607 
608  for(Int_t ism = 0; ism < fgkNsm; ism++)
609  {
610  printf("\t sm %d, fraction %2.3f, E frac abs min %2.3e max %2.3e \n",
612 
613  for(Int_t icell = 0; icell < 4; icell++)
614  {
615  printf("\t \t cell type %d, c %2.4e, p0 %2.4e, p1 %2.4e, sigma %2.4e \n",
616  icell,fTCardCorrInduceEner[icell][ism],fTCardCorrInduceEnerFrac[icell][ism],
618  }
619  }
620 }
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...
Bool_t fTCardCorrCellsNew[fgkNEMCalCells]
Array with induced cell energy in T-Card neighbour cells, that before had no signal.
AliEMCALGeometry * fGeom
! Geometry object
Float_t fTCardCorrMaxInduced
Maximum induced energy signal on adjacent cells.
double Double_t
Definition: External.C:58
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)...
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...
Float_t fTCardCorrInduceEnerProb[fgkNsm]
Probability to induce energy loss per SM.
void SetProperty(Float_t val[][fgkNsm], std::vector< double > &property, unsigned int iSM, const std::string &name)
AliAODCaloCells * fAODCellsTmp
! Temporal array of cells copy
AliVCaloCells * fCaloCells
! Pointer to CaloCells
Some utilities for cluster and cell treatment.
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...
int Int_t
Definition: External.C:63
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 ...
float Float_t
Definition: External.C:68
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...
TList * fOutput
! List of output histograms
short Short_t
Definition: External.C:23
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
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...
bool Bool_t
Definition: External.C:53
bool GetProperty(std::string propertyName, T &property, bool requiredProperty=true, std::string correctionName="")
Retrieve property.