7 #include <TClonesArray.h>
12 #include "AliAnalysisManager.h"
14 #include "AliEMCALGeometry.h"
25 fCaloTriggersOutName("EmcalPatches32x32"),
32 fTriggerBitConfig(0x0),
34 fh2CellEnergyVsTime(0),
38 for (Int_t i = 0; i < kPatchCols; i++) {
39 for (Int_t j = 0; j < kPatchRows; j++) {
40 fPatchADCSimple[i][j] = 0.;
41 fPatchESimple[i][j] = 0.;
45 SetMakeGeneralHistograms(kTRUE);
51 fCaloTriggersOutName(
"EmcalPatches32x32"),
58 fTriggerBitConfig(0x0),
60 fh2CellEnergyVsTime(0),
99 AliFatal(Form(
"%s: Container with same name %s already present. Aborting", GetName(),
fCaloTriggersOutName.Data()));
116 Int_t fgkNPhiBins = 18*8;
117 Float_t kMinPhi = 0.;
118 Float_t kMaxPhi = 2.*TMath::Pi();
119 Double_t *binsPhi =
new Double_t[fgkNPhiBins+1];
120 for(Int_t i=0; i<=fgkNPhiBins; i++) binsPhi[i]=(Double_t)kMinPhi + (kMaxPhi-kMinPhi)/fgkNPhiBins*(Double_t)i ;
122 Int_t fgkNEtaBins = 100;
123 Float_t fgkEtaMin = -1.;
124 Float_t fgkEtaMax = 1.;
125 Double_t *binsEta=
new Double_t[fgkNEtaBins+1];
126 for(Int_t i=0; i<=fgkNEtaBins; i++) binsEta[i]=(Double_t)fgkEtaMin + (fgkEtaMax-fgkEtaMin)/fgkNEtaBins*(Double_t)i ;
128 Int_t fgkNTimeBins = 600;
129 Float_t kMinTime = -200.;
130 Float_t kMaxTime = 1000;
131 Double_t *binsTime =
new Double_t[fgkNTimeBins+1];
132 for(Int_t i=0; i<=fgkNTimeBins; i++) binsTime[i]=(Double_t)kMinTime + (kMaxTime-kMinTime)/fgkNTimeBins*(Double_t)i ;
134 Double_t enBinEdges[3][2];
135 enBinEdges[0][0] = 1.;
136 enBinEdges[0][1] = 0.1;
137 enBinEdges[1][0] = 5.;
138 enBinEdges[1][1] = 0.5;
139 enBinEdges[2][0] = 100.;
140 enBinEdges[2][1] = 1.;
142 const Float_t enmin1 = 0;
143 const Float_t enmax1 = enBinEdges[0][0];
144 const Float_t enmin2 = enmax1 ;
145 const Float_t enmax2 = enBinEdges[1][0];
146 const Float_t enmin3 = enmax2 ;
147 const Float_t enmax3 = enBinEdges[2][0];
148 const Int_t nbin11 = (int)((enmax1-enmin1)/enBinEdges[0][1]);
149 const Int_t nbin12 = (int)((enmax2-enmin2)/enBinEdges[1][1])+nbin11;
150 const Int_t nbin13 = (int)((enmax3-enmin3)/enBinEdges[2][1])+nbin12;
152 Int_t fgkNEnBins=nbin13;
153 Double_t *binsEn=
new Double_t[fgkNEnBins+1];
154 for(Int_t i=0; i<=fgkNEnBins; i++) {
155 if(i<=nbin11) binsEn[i]=(Double_t)enmin1 + (enmax1-enmin1)/nbin11*(Double_t)i ;
156 if(i<=nbin12 && i>nbin11) binsEn[i]=(Double_t)enmin2 + (enmax2-enmin2)/(nbin12-nbin11)*((Double_t)i-(Double_t)nbin11) ;
157 if(i<=nbin13 && i>nbin12) binsEn[i]=(Double_t)enmin3 + (enmax3-enmin3)/(nbin13-nbin12)*((Double_t)i-(Double_t)nbin12) ;
160 fh3EEtaPhiCell =
new TH3F(
"fh3EEtaPhiCell",
"fh3EEtaPhiCell;E_{cell};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
163 fh2CellEnergyVsTime =
new TH2F(
"fh2CellEnergyVsTime",
"fh2CellEnergyVsTime;E_{cell};time",fgkNEnBins,binsEn,fgkNTimeBins,binsTime);
166 fh1CellEnergySum =
new TH1F(
"fh1CellEnergySum",
"fh1CellEnergySum;E_{cell};time",fgkNEnBins,binsEn);
171 if(binsEn)
delete [] binsEn;
172 if(binsPhi)
delete [] binsPhi;
173 if(binsEta)
delete [] binsEta;
174 if(binsTime)
delete [] binsTime;
185 AliError(Form(
"Calo cells container %s not available.",
fCaloCellsName.Data()));
197 AliError(Form(
"%s Could not create simple ADC patches",GetName()));
222 for(Int_t iCell = 0; iCell < nCell; ++iCell) {
224 Short_t cellId =
fCaloCells->GetCellNumber(iCell);
226 Double_t cellT =
fCaloCells->GetCellTime(cellId);
227 Double_t amp =
fCaloCells->GetAmplitude(iCell);
238 fGeom->GetFastORIndexFromCellIndex(cellId, absId);
239 Int_t globCol=-1, globRow=-1;
240 fGeom->GetPositionInEMCALFromAbsFastORIndex(absId, globCol, globRow);
246 fGeom->GetGlobal(cellId, pos);
247 TLorentzVector lv(pos,amp);
248 Double_t cellEta = lv.Eta();
249 Double_t cellPhi = lv.Phi();
250 if(cellPhi<0.) cellPhi+=TMath::TwoPi();
251 if(cellPhi>TMath::TwoPi()) cellPhi-=TMath::TwoPi();
271 Int_t maxRow =
fGeom->GetNTotalTRU()*2 - patchSize;
274 for (Int_t i = 0; i <= maxCol; i += stepSize) {
275 for (Int_t j = 0; j <= maxRow; j += stepSize) {
280 for (Int_t k = 0; k < patchSize; ++k) {
281 for (Int_t l = 0; l < patchSize; ++l) {
289 AliDebug(2,
"EMCal trigger patch with 0 ADC counts.");
294 Int_t cellAbsId[4]={-1,-1,-1,-1};
297 fGeom->GetAbsFastORIndexFromPositionInEMCAL(i, j, absId);
299 fGeom->GetCellIndexFromFastORIndex(absId, cellAbsId);
301 fGeom->GetGlobal(cellAbsId[0], edge1);
304 fGeom->GetAbsFastORIndexFromPositionInEMCAL(i+patchSize-1, j+patchSize-1, absId);
305 fGeom->GetCellIndexFromFastORIndex(absId, cellAbsId);
307 fGeom->GetGlobal(cellAbsId[3], edge2);
310 Int_t offsetCenter = TMath::FloorNint(0.5*patchSize);
311 fGeom->GetAbsFastORIndexFromPositionInEMCAL(i+offsetCenter-1, j+offsetCenter-1, absId);
312 fGeom->GetCellIndexFromFastORIndex(absId, cellAbsId);
314 fGeom->GetGlobal(cellAbsId[3], center1);
316 fGeom->GetAbsFastORIndexFromPositionInEMCAL(i+offsetCenter, j+offsetCenter, absId);
317 fGeom->GetCellIndexFromFastORIndex(absId, cellAbsId);
319 fGeom->GetGlobal(cellAbsId[0], center2);
321 TVector3 centerGeo(center1);
322 centerGeo += center2;
337 AliDebug(2,Form(
"Created %d trigger patches (%d) in this event",itrig,patchSize));
344 Int_t dim = TMath::FloorNint((Double_t)(
fPatchDim/2.));
355 else if(dim==4)
return 4;
356 else if(dim==8)
return 4;
357 else if(dim==16)
return 8;
AliEmcalTriggerBitConfig * fTriggerBitConfig
void SetEdge2(TLorentzVector &v)
Double_t fPatchESimple[kPatchCols][kPatchRows]
Int_t GetSlidingStepSizeFastor() const
void SetEdge1(TLorentzVector &v)
virtual ~AliEmcalPatchFromCellMaker()
AliEmcalPatchFromCellMaker()
TList * fOutput
x-section from pythia header
Bool_t FillPatchADCSimple()
Int_t GetDimFastor() const
Main data structure storing all relevant information of EMCAL/DCAL trigger patches.
AliEMCALGeometry * fGeom
whether it's an ESD analysis
void SetEdgeCell(Int_t x, Int_t y)
TClonesArray * fCaloTriggersOut
TString fCaloTriggersOutName
TH2F * fh2CellEnergyVsTime
cell E, eta, phi
Definition of new trigger bit configuration.
AliVCaloCells * fCaloCells
clusters
Double_t fPatchADCSimple[kPatchCols][kPatchRows]
trigger array out
Definition of EMCAL trigger bit configurations.
ClassImp(AliEmcalPatchFromCellMaker) AliEmcalPatchFromCellMaker
void UserCreateOutputObjects()
static const Double_t kEMCL1ADCtoGeV
Conversion from EMCAL Level1 ADC to energy.
void SetTriggerBitConfig(const AliEmcalTriggerBitConfig *ref)
void SetMakeGeneralHistograms(Bool_t g)
Class to make array of trigger patch objects in AOD/ESD events.
void UserCreateOutputObjects()
void RunSimpleOfflineTrigger()
TH1F * fh1CellEnergySum
emcal cell energy vs time
void SetCenterGeo(TVector3 &v, Double_t e)