7 #include <TClonesArray.h> 12 #include "AliAnalysisManager.h" 14 #include "AliEMCALGeometry.h" 15 #include "AliEMCALTriggerPatchInfo.h" 16 #include "AliEMCALTriggerBitConfig.h" 17 #include "AliEMCALTriggerConstants.h" 26 fCaloTriggersOutName("EmcalPatches32x32"),
33 fTriggerBitConfig(0x0),
35 fh2CellEnergyVsTime(0),
39 for (
Int_t i = 0; i < kPatchCols; i++) {
40 for (
Int_t j = 0; j < kPatchRows; j++) {
41 fPatchADCSimple[i][j] = 0.;
42 fPatchESimple[i][j] = 0.;
46 SetMakeGeneralHistograms(kTRUE);
52 fCaloTriggersOutName(
"EmcalPatches32x32"),
59 fTriggerBitConfig(0x0),
61 fh2CellEnergyVsTime(0),
100 AliFatal(Form(
"%s: Container with same name %s already present. Aborting", GetName(),
fCaloTriggersOutName.Data()));
117 Int_t fgkNPhiBins = 18*8;
119 Float_t kMaxPhi = 2.*TMath::Pi();
121 for(
Int_t i=0; i<=fgkNPhiBins; i++) binsPhi[i]=(
Double_t)kMinPhi + (kMaxPhi-kMinPhi)/fgkNPhiBins*(
Double_t)i ;
123 Int_t fgkNEtaBins = 100;
127 for(
Int_t i=0; i<=fgkNEtaBins; i++) binsEta[i]=(
Double_t)fgkEtaMin + (fgkEtaMax-fgkEtaMin)/fgkNEtaBins*(
Double_t)i ;
129 Int_t fgkNTimeBins = 600;
133 for(
Int_t i=0; i<=fgkNTimeBins; i++) binsTime[i]=(
Double_t)kMinTime + (kMaxTime-kMinTime)/fgkNTimeBins*(
Double_t)i ;
136 enBinEdges[0][0] = 1.;
137 enBinEdges[0][1] = 0.1;
138 enBinEdges[1][0] = 5.;
139 enBinEdges[1][1] = 0.5;
140 enBinEdges[2][0] = 100.;
141 enBinEdges[2][1] = 1.;
144 const Float_t enmax1 = enBinEdges[0][0];
145 const Float_t enmin2 = enmax1 ;
146 const Float_t enmax2 = enBinEdges[1][0];
147 const Float_t enmin3 = enmax2 ;
148 const Float_t enmax3 = enBinEdges[2][0];
149 const Int_t nbin11 = (int)((enmax1-enmin1)/enBinEdges[0][1]);
150 const Int_t nbin12 = (int)((enmax2-enmin2)/enBinEdges[1][1])+nbin11;
151 const Int_t nbin13 = (int)((enmax3-enmin3)/enBinEdges[2][1])+nbin12;
153 Int_t fgkNEnBins=nbin13;
155 for(
Int_t i=0; i<=fgkNEnBins; i++) {
156 if(i<=nbin11) binsEn[i]=(
Double_t)enmin1 + (enmax1-enmin1)/nbin11*(
Double_t)i ;
157 if(i<=nbin12 && i>nbin11) binsEn[i]=(
Double_t)enmin2 + (enmax2-enmin2)/(nbin12-nbin11)*((
Double_t)i-(
Double_t)nbin11) ;
158 if(i<=nbin13 && i>nbin12) binsEn[i]=(
Double_t)enmin3 + (enmax3-enmin3)/(nbin13-nbin12)*((
Double_t)i-(
Double_t)nbin12) ;
161 fh3EEtaPhiCell =
new TH3F(
"fh3EEtaPhiCell",
"fh3EEtaPhiCell;E_{cell};#eta;#phi",fgkNEnBins,binsEn,fgkNEtaBins,binsEta,fgkNPhiBins,binsPhi);
164 fh2CellEnergyVsTime =
new TH2F(
"fh2CellEnergyVsTime",
"fh2CellEnergyVsTime;E_{cell};time",fgkNEnBins,binsEn,fgkNTimeBins,binsTime);
167 fh1CellEnergySum =
new TH1F(
"fh1CellEnergySum",
"fh1CellEnergySum;E_{cell};time",fgkNEnBins,binsEn);
172 if(binsEn)
delete [] binsEn;
173 if(binsPhi)
delete [] binsPhi;
174 if(binsEta)
delete [] binsEta;
175 if(binsTime)
delete [] binsTime;
186 AliError(Form(
"Calo cells container %s not available.",
fCaloCellsName.Data()));
198 AliError(Form(
"%s Could not create simple ADC patches",GetName()));
223 for(
Int_t iCell = 0; iCell < nCell; ++iCell) {
239 fGeom->GetFastORIndexFromCellIndex(cellId, absId);
240 Int_t globCol=-1, globRow=-1;
241 fGeom->GetPositionInEMCALFromAbsFastORIndex(absId, globCol, globRow);
247 fGeom->GetGlobal(cellId, pos);
248 TLorentzVector lv(pos,amp);
251 if(cellPhi<0.) cellPhi+=TMath::TwoPi();
252 if(cellPhi>TMath::TwoPi()) cellPhi-=TMath::TwoPi();
272 Int_t maxRow =
fGeom->GetNTotalTRU()*2 - patchSize;
275 for (
Int_t i = 0; i <= maxCol; i += stepSize) {
276 for (
Int_t j = 0; j <= maxRow; j += stepSize) {
281 for (
Int_t k = 0; k < patchSize; ++k) {
282 for (
Int_t l = 0; l < patchSize; ++l) {
290 AliDebug(2,
"EMCal trigger patch with 0 ADC counts.");
295 Int_t cellAbsId[4]={-1,-1,-1,-1};
298 fGeom->GetAbsFastORIndexFromPositionInEMCAL(i, j, absId);
300 fGeom->GetCellIndexFromFastORIndex(absId, cellAbsId);
302 fGeom->GetGlobal(cellAbsId[0], edge1);
305 fGeom->GetAbsFastORIndexFromPositionInEMCAL(i+patchSize-1, j+patchSize-1, absId);
306 fGeom->GetCellIndexFromFastORIndex(absId, cellAbsId);
308 fGeom->GetGlobal(cellAbsId[3], edge2);
311 Int_t offsetCenter = TMath::FloorNint(0.5*patchSize);
312 fGeom->GetAbsFastORIndexFromPositionInEMCAL(i+offsetCenter-1, j+offsetCenter-1, absId);
313 fGeom->GetCellIndexFromFastORIndex(absId, cellAbsId);
315 fGeom->GetGlobal(cellAbsId[3], center1);
317 fGeom->GetAbsFastORIndexFromPositionInEMCAL(i+offsetCenter, j+offsetCenter, absId);
318 fGeom->GetCellIndexFromFastORIndex(absId, cellAbsId);
320 fGeom->GetGlobal(cellAbsId[0], center2);
322 TVector3 centerGeo(center1);
323 centerGeo += center2;
327 AliEMCALTriggerPatchInfo *trigger =
328 new ((*fCaloTriggersOut)[itrig]) AliEMCALTriggerPatchInfo();
331 trigger->SetCenterGeo(centerGeo, enAmp);
332 trigger->SetEdge1(edge1, enAmp);
333 trigger->SetEdge2(edge2, enAmp);
334 trigger->SetADCAmp(adcAmp);
335 trigger->SetEdgeCell(i*2, j*2);
338 AliDebug(2,Form(
"Created %d trigger patches (%d) in this event",itrig,patchSize));
356 else if(dim==4)
return 4;
357 else if(dim==8)
return 4;
358 else if(dim==16)
return 8;
Double_t fPatchESimple[kPatchCols][kPatchRows]
Int_t GetSlidingStepSizeFastor() const
Base task in the EMCAL framework.
Bool_t fLocalInitialized
whether or not the task has been already initialized
Bool_t Run()
Run function. This is the core function of the analysis and contains the user code. Therefore users have to implement this function.
virtual ~AliEmcalPatchFromCellMaker()
AliEmcalPatchFromCellMaker()
AliEMCALTriggerBitConfig * fTriggerBitConfig
void ExecOnce()
Perform steps needed to initialize the analysis.
Bool_t FillPatchADCSimple()
Int_t GetDimFastor() const
AliEMCALGeometry * fGeom
!emcal geometry
TString fCaloCellsName
name of calo cell collection
TClonesArray * fCaloTriggersOut
TString fCaloTriggersOutName
TH2F * fh2CellEnergyVsTime
cell E, eta, phi
AliVCaloCells * fCaloCells
!cells
Double_t fPatchADCSimple[kPatchCols][kPatchRows]
trigger array out
AliEmcalList * fOutput
!output list
void UserCreateOutputObjects()
void SetMakeGeneralHistograms(Bool_t g)
virtual void ExecOnce()
Perform steps needed to initialize the analysis.
void UserCreateOutputObjects()
Main initialization function on the worker.
void RunSimpleOfflineTrigger()
TH1F * fh1CellEnergySum
emcal cell energy vs time