7 #include <TClonesArray.h>
12 #include "AliAnalysisManager.h"
15 #include "AliVTrack.h"
27 fTracksOutName("PicoTracksInGrid"),
42 for(
Int_t i = 0; i<2; i++) {
44 fMiniPatchGrid[i] = 0;
49 fPhiMax[0] = 1.405+TMath::DegToRad()*110.;
57 for(
Int_t i = 0; i<5; i++) {
58 fNPatchesEMCal[i] = 0;
61 fPatchEnVsActivityEmcal[i] = 0;
62 fPatchEnVsActivityDcal[i] = 0;
64 for(
Int_t j = 0; j<2; j++) {
66 fActiveAreaMPP[j][i] = 0;
67 fActiveAreaCP[j][i] = 0;
68 fPatchECorr[j][i] = 0;
69 fPatchECorrPar[j][i] = 0;
71 fPatchECorrRho[j][i] = 0;
72 fPatchECorrECorrRho[j][i] = 0;
73 fh2JetPtPatchECorr[j][i] = 0;
75 fh2PatchEtaPhiEmcal[i] = 0;
76 fh2PatchEtaPhiDcal[i] = 0;
79 for(
Int_t i = 0; i<3; i++) {
80 fh2MedianTypeEmcal[i] = 0;
81 fh2MedianTypeDcal[i] = 0;
82 fpMedianTypeEmcal[i] = 0;
83 fpMedianTypeDcal[i] = 0;
85 SetMakeGeneralHistograms(kTRUE);
91 fTracksOutName(
"PicoTracksInGrid"),
106 for(
Int_t i = 0; i<2; i++) {
113 fPhiMax[0] = 1.405+TMath::DegToRad()*110.;
121 for(
Int_t i = 0; i<5; i++) {
128 for(
Int_t j = 0; j<2; j++) {
143 for(
Int_t i = 0; i<3; i++) {
165 Int_t nBinsMed = 500;
169 Int_t nBinsPhiEmcal = 132+64;
173 Int_t nBinsPhiDcal = 80+64;
177 Int_t nBinsEta = 96+64;
181 for(
Int_t i = 0; i<3; i++) {
182 fh2MedianTypeEmcal[i] =
new TH2F(Form(
"fh2MedianTypeEmcalAreaType%d",i),Form(
"fh2MedianTypeEmcalAreaType%d",i),5,0.5,5.5,nBinsMed,minMed,maxMed);
185 fh2MedianTypeDcal[i] =
new TH2F(Form(
"fh2MedianTypeDcalAreaType%d",i),Form(
"fh2MedianTypeDcalAreaType%d",i),5,0.5,5.5,nBinsMed,minMed,maxMed);
188 fpMedianTypeEmcal[i] =
new TProfile(Form(
"fpMedianTypeEmcalAreaType%d",i),Form(
"fpMedianTypeEmcalAreaType%d",i),5,0.5,5.5,
"s");
191 fpMedianTypeDcal[i] =
new TProfile(Form(
"fpMedianTypeDcalAreaType%d",i),Form(
"fpMedianTypeDcalAreaType%d",i),5,0.5,5.5,
"s");
195 TString det[2] = {
"Emcal",
"Dcal"};
196 for(
Int_t i = 0; i<5; i++) {
197 fh1RhoEmcal[i] =
new TH1F(Form(
"fh1RhoEmcal_%d",i),Form(
"fh1RhoEmcal_%d",i),500,0.,1000.);
199 fh1RhoDcal[i] =
new TH1F(Form(
"fh1RhoDcal_%d",i),Form(
"fh1RhoDcal_%d",i),500,0.,1000.);
202 fPatchEnVsActivityEmcal[i] =
new TH2F(Form(
"fh2PatchEnVsActivityEmcal_%d",i),Form(
"fh2PatchEnVsActivityEmcal_%d",i),300,0.,300.,150,-0.5,149.5);
205 fPatchEnVsActivityDcal[i] =
new TH2F(Form(
"fh2PatchEnVsActivityDcal_%d",i),Form(
"fh2PatchEnVsActivityDcal_%d",i),300,0.,300.,150,-0.5,149.5);
208 for(
Int_t j = 0; j<2; j++) {
209 fPatchECorr[j][i] =
new TH1F(Form(
"fPatchECorr%s_%d",det[j].
Data(),i),Form(
"fPatchECorr%s_%d;#it{E}_{patch}^{corr}",det[j].
Data(),i),250,-50.,200.);
212 fPatchECorrPar[j][i] =
new TH1F(Form(
"fPatchECorrPar%s_%d",det[j].
Data(),i),Form(
"fPatchECorrPar%s_%d;#it{E}_{patch}^{corr}",det[j].
Data(),i),250,-50.,200.);
215 fPatchERaw[j][i] =
new TH1F(Form(
"fPatchERaw%s_%d",det[j].
Data(),i),Form(
"fPatchERaw%s_%d;#it{E}_{patch}^{corr}",det[j].
Data(),i),250,-50.,200.);
218 fPatchECorrRho[j][i] =
new TH2F(Form(
"fPatchECorrRho%s_%d",det[j].
Data(),i),Form(
"fPatchECorrRho%s_%d;#it{E}_{patch}^{corr};#rho",det[j].
Data(),i),250,-50.,200.,500,0.,500.);
221 fPatchECorrECorrRho[j][i] =
new TH3F(Form(
"fPatchECorrECorrRho%s_%d",det[j].
Data(),i),Form(
"fPatchECorrECorrRho%s_%d;#it{E}_{patch,det1}^{corr};#it{E}_{patch,det2}^{corr};#rho",det[j].
Data(),i),210,-30.,180.,210,-30.,180.,250,0.,250.);
224 fh2JetPtPatchECorr[j][i] =
new TH2F(Form(
"fh2JetPtPatchECorr%s_%d",det[j].
Data(),i),Form(
"fh2JetPtPatchECorr%s_%d",det[j].
Data(),i),250,-50.,200.,250,-50.,200.);
228 fh2PatchEtaPhiEmcal[i] =
new TH2F(Form(
"fh2PatchEtaPhiEmcal_%d",i),Form(
"fh2PatchEtaPhiEmcal_%d;#eta;#phi",i),nBinsEta,etaMin,etaMax,nBinsPhiEmcal,phiMinEmcal,phiMaxEmcal);
231 fh2PatchEtaPhiDcal[i] =
new TH2F(Form(
"fh2PatchEtaPhiDcal_%d",i),Form(
"fh2PatchEtaPhiDcal_%d;#eta;#phi",i),nBinsEta,etaMin,etaMax,nBinsPhiDcal,phiMinDcal,phiMaxDcal);
235 fMultVsRho =
new TH2F(
"fMultVsRho",
"fMultVsRho",3000,0,3000,400,0,400);
247 if(!b)
return kFALSE;
249 if(!b)
return kFALSE;
270 for(
Int_t i = 0; i<4; i++) {
271 for(
Int_t type = 0; type<2; type++) {
272 for(
Int_t areaT = 0; areaT<1; areaT++) {
290 for(
Int_t i = 1; i<5; i++) {
292 for(
Int_t type = 0; type<2; type++) {
293 EleadID[i][type] = -1;
294 Elead[i][type] = -1e6;
295 EleadRaw[i][type] = -1e6;
297 if(type==1) subType = 0;
309 if((
fPatchGrid[type][i].At(
id)-sub)>Elead[i][type]) {
310 EleadID[i][type] = id;
311 Elead[i][type] =
fPatchGrid[type][i].At(
id)-sub;
313 if(
fPatchGrid[type][i].At(
id)>EleadRaw[i][type])
314 EleadRaw[i][type] =
fPatchGrid[type][i].At(
id);
321 for(
Int_t k = 0; k<2; k++) {
335 cont->ResetCurrentID();
358 if(!cont)
return NULL;
361 Int_t closest_id = -1;
363 cont->ResetCurrentID();
367 dphi = TVector2::Phi_mpi_pi(dphi);
368 Double_t dr = TMath::Sqrt ( dphi * dphi + deta * deta );
371 closest_id = cont->GetCurrentID();
374 jet = cont->
GetJet(closest_id);
387 for(
Int_t type = 0; type<2; type++) {
388 for(
Int_t i = 0; i<
fPatchGrid[type][patchType].GetSize(); i+=stepSize) {
389 if(
fPatchGrid[type][patchType].At(i)>0.) count++;
407 if(patchType>0) level = 1;
437 else if(areaType==2) active =
fActiveAreaCP[type][patchType].At(
id);
440 if(area>0. && active>1) {
444 if(type==0 && areaType==0) {
448 if(type==1 && areaType==0) {
455 Double_t med = TMath::Median(c,arr);
464 AliVParticle *track = NULL;
466 if(!trackCont)
return kFALSE;
467 trackCont->ResetCurrentID();
485 for(
Int_t type = 0; type<2; type++) {
490 for(
Int_t k = 0; k<2; k++) {
491 for(
Int_t l = 0; l<2; l++) {
525 if(pt<0)
return kFALSE;
530 for(
Int_t type = 0; type<2; type++) {
536 for(
Int_t k = 0; k<nm; k++) {
537 for(
Int_t l = 0; l<nm; l++) {
570 for(
Int_t i = 0; i<2; i++) {
586 if(type<0 || type>1)
return -1;
600 Printf(
"Got too large id %d %d type: %d",
id,
fNCells,type);
601 Printf(
"eta: %f phi: %f",eta,phi);
602 Printf(
"etaRel: %f phiRel: %f",etaRel,phiRel);
617 AliDebug(2,Form(
"id: %d type: %d row: %d col: %d eta: %f phi: %f",
id,type,row,col,eta,phi));
648 if(patchType>0) level = 1;
651 Int_t ntc = TMath::FloorNint(nmp/stepmp);
660 if(patchType>0) level = 1;
663 Int_t ntr = TMath::FloorNint(nmp/stepmp);
702 AliDebug(2,Form(
"EMCal: %d x %d",nCellsEtaE,nCellsPhiE));
703 AliDebug(2,Form(
"DCal: row: %d x col: %d",nCellsEtaD,nCellsPhiD));
704 AliDebug(2,Form(
"fNCells: %d fNCellsE: %d fnCellsD: %d",
fNCells,
fNCellsEMCal,fNCellsDCal));
716 if(
fCellGrid[0].GetSize()<0)
return kFALSE;
717 if(
fCellGrid[1].GetSize()<0)
return kFALSE;
719 Int_t nMiniPatches[2];
722 for(
Int_t i = 0; i<2; i++) {
739 conv = 1./(step*step);
756 if(
fCellGrid[0].GetSize()<0)
return kFALSE;
757 if(
fCellGrid[1].GetSize()<0)
return kFALSE;
760 if(type<0 || type>4)
return kFALSE;
763 for(
Int_t i = 0; i<2; i++)
766 Int_t nPatchesT = nPatches[0] + nPatches[1];
769 AliDebug(2,Form(
"Create trigger patch of type %d with dim %d and with %d patches EMCAL: %d DCAL: %d",type,dim,nPatchesT,nPatches[0],nPatches[1]));
771 for(
Int_t i = 0; i<2; i++) {
787 if(ipatch==0) ncell = 4;
788 if(ipatch==1) ncell = 4;
789 if(ipatch==2) ncell = 8;
790 if(ipatch==3) ncell = 16;
791 if(ipatch==4) ncell = 32;
811 else if(atype==1) active =
fActiveAreaCP[type][ipatch].At(
id);
815 if(atype==0) fac = 4.;
823 if(!
fL1Slide || level==0)
return dim;
826 else if(dim==8)
return 4;
827 else if(dim==16)
return 4;
828 else if(dim==32)
return 8;
836 if(step<0)
return step;
838 return stepMiniPatch;
855 if(level==0 && dim==4) type = 0;
859 if(dim==16) type = 3;
860 if(dim==32) type = 4;
869 AliDebug(11,Form(
"EMCal phi edges not defined %f-%f",
fPhiMin[0],
fPhiMax[0]));
874 AliDebug(11,Form(
"DCal phi edges not defined %f-%f",
fPhiMin[1],
fPhiMax[1]));
879 AliDebug(11,Form(
"EMCal eta edges not well defined %f-%f",
fEtaMin[0],
fEtaMax[0]));
884 AliDebug(11,Form(
"DCal eta edges not well defined %f-%f",
fEtaMin[1],
fEtaMax[1]));
888 for(
Int_t type = 0; type<2; type++) {
891 Double_t nCellsColExact = nPatchPhi32 * 32. ;
895 Double_t nCellsRowExact = nPatchEta32 * 32. ;
899 fPhiMin[type] += phi_extra*0.5;
900 fPhiMax[type] -= phi_extra*0.5;
902 Double_t row_extra = deta/fCellSize - TMath::Floor(nCellsRowExact);
904 fEtaMin[type] += eta_extra*0.5;
905 fEtaMax[type] -= eta_extra*0.5;
906 AliDebug(2,Form(
"type: %d exact: col: %f row: %f",type,nCellsColExact,nCellsRowExact));
Bool_t fL1Slide
track array out
void GetEtaPhiFromMiniPatchID(const Int_t id, const Int_t type, Double_t &eta, Double_t &phi) const
virtual AliVParticle * GetNextAcceptParticle()
Bool_t InitPatches(const Int_t dim, const Int_t level)
Double_t GetRhoVal() const
TArrayI fActiveAreaMPP[2][5]
TH1F * fPatchECorrPar[2][5]
corrected patch energy for EMCal and DCal
AliJetContainer * GetJetContainer(Int_t i=0) const
void GetEtaPhiFromGridID(const Int_t id, const Int_t type, Double_t &eta, Double_t &phi) const
Int_t GetTriggerPatchID(const Int_t row, const Int_t col, const Int_t type, const Int_t dim, const Int_t patchType) const
TProfile * fpMedianTypeDcal[3]
median vs patch type for 3 types of area calculation
Bool_t CreateGridPatches(const Int_t dim, const Int_t level)
Int_t GetMiniPatchID(const Int_t row, const Int_t col, const Int_t type) const
Int_t GetPatchDim(const Int_t ipatch) const
Int_t GetNColTriggerPatches(const Int_t type, const Int_t dim, const Int_t patchType) const
TH1F * fh1RhoEmcal[5]
median vs patch type for 3 types of area calculation
Container for particles within the EMCAL framework.
TH2F * fPatchEnVsActivityDcal[5]
patch energy vs active cells
Int_t GetNRowTriggerPatches(const Int_t type, const Int_t dim, const Int_t patchType) const
Int_t GetSlidingStepSizeMiniPatches(const Int_t dim, const Int_t level=1) const
AliParticleContainer * GetParticleContainer(Int_t i=0) const
Get particle container attached to this task.
Int_t GetNParticles(Int_t i=0) const
Get number of particles in container attached to this task with index i.
TH2F * fMultVsRho
jet pt vs leading patch energy
TArrayI fActiveAreaCP[2][5]
void SetJetPhiLimits(Float_t min, Float_t max)
void PrintAcceptance() const
TH2F * fPatchEnVsActivityEmcal[5]
rho distributions for passive area
Double_t CalculateMedian(const Int_t patchType, const Int_t type, const Int_t areaType=0)
Int_t GetNCellsCol(const Int_t type) const
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.
Int_t GetNCellsRow(const Int_t type) const
Int_t GetNTriggerPatches(const Int_t type, const Int_t dim, const Int_t level) const
AliEmcalJet * GetClosestJet(const Double_t eta, const Double_t phi, const Int_t icont=0) const
ClassImp(AliEmcalPicoTrackInGridMaker) AliEmcalPicoTrackInGridMaker
TH1F * fPatchECorr[2][5]
patch energy vs active cells
Int_t GetSlidingStepSizeCells(const Int_t dim, const Int_t level=1) const
AliEmcalJet * GetNextAcceptJet()
TH2F * fh2PatchEtaPhiEmcal[5]
Ecorr,det1 vs Ecorr,det2 vs rho,det2 opposite side for dijet in acceptance like events.
Int_t GetNRowMiniPatches(const Int_t type) const
Bool_t Data(TH1F *h, Double_t *rangefit, Bool_t writefit, Double_t &sgn, Double_t &errsgn, Double_t &bkg, Double_t &errbkg, Double_t &sgnf, Double_t &errsgnf, Double_t &sigmafit, Int_t &status)
void UserCreateOutputObjects()
TH3F * fPatchECorrECorrRho[2][5]
corrected patch energy vs rho opposite side
Float_t GetJetRadius() const
AliEmcalList * fOutput
!output list
TArrayD fMiniPatchGrid[2]
Int_t GetCellType(const Double_t eta, const Double_t phi) const
TH2F * fh2MedianTypeDcal[3]
median vs patch type for 3 types of area calculation
AliEmcalPicoTrackInGridMaker()
Double_t GetPatchAreaActive(const Int_t id, const Int_t type, const Int_t ipatch, const Int_t atype) const
void SetMakeGeneralHistograms(Bool_t g)
TH1F * fPatchERaw[2][5]
corrected patch energy with inclusive mean rho for EMCal and DCal
Base task in the EMCAL jet framework.
Represent a jet reconstructed using the EMCal jet framework.
Double_t GetPatchArea(const Int_t ipatch) const
TProfile * fpMedianTypeEmcal[3]
median vs patch type for 3 types of area calculation
virtual ~AliEmcalPicoTrackInGridMaker()
void UserCreateOutputObjects()
Main initialization function on the worker.
TH1F * fh1RhoDcal[5]
rho distributions for passive area
Bool_t CreateGridMiniPatches()
Int_t GetGridID(const AliVParticle *vp) const
TH2F * fh2JetPtPatchECorr[2][5]
patch positions in DCal
void SetJetEtaLimits(Float_t min, Float_t max)
TH2F * fPatchECorrRho[2][5]
uncorrected patch energy for EMCal and DCal
Int_t GetTriggerPatchIdStepSizeNoOverlap(const Int_t dim, const Int_t level=1) const
void GetEtaPhiFromTriggerPatchID(const Int_t id, const Int_t type, const Int_t dim, const Int_t level, Double_t &eta, Double_t &phi) const
Int_t GetNColMiniPatches(const Int_t type) const
Double_t CalculateSum(const Int_t patchType) const
TH2F * fh2MedianTypeEmcal[3]
Container for jet within the EMCAL jet framework.
TH2F * fh2PatchEtaPhiDcal[5]
patch positions in EMCal
Int_t GetPatchType(const Int_t dim, const Int_t level) const
AliEmcalJet * GetJet(Int_t i) const