14 #include <TRefArray.h> 17 #include <TGeoManager.h> 22 #include "AliAODEvent.h" 23 #include "AliESDEvent.h" 24 #include "AliMultSelection.h" 25 #include "AliEMCALGeometry.h" 26 #include "AliVCluster.h" 27 #include "AliVCaloCells.h" 29 #include "AliOADBContainer.h" 30 #include "AliDataFile.h" 41 fEMCALGeo(0x0), fLoadMatrices(0),
42 fEMCALGeoName(
"EMCAL_COMPLETE12SMV1_DCAL_8SM"),
45 fOADBFilePath(
""), fCalibFilePath(
""),
46 fCorrectClusters(kFALSE), fRecalPosition(kTRUE),
47 fCaloClustersArr(0x0), fEMCALCells(0x0),
49 fOutputContainer(0x0),
50 fCheckCentrality(kFALSE), fCentralityClass(
"V0M"), fCentWithEventSel(kFALSE),
51 fCentMin(-1), fCentMax(10000000),
52 fVertex(), fFilteredInput(kFALSE),
53 fImportGeometryFromFile(1), fImportGeometryFilePath(
""),
54 fEmin(0.5), fEmax(15.),
55 fEBkgmin(0.5), fEBkgmax(15.),
56 fL0min(0.01), fL0max(0.5),
57 fL0Bkgmin(1.0), fL0Bkgmax(3.0),
58 fOpAnglemin(0.), fOpAnglemax(3.0),
59 fDTimeCut(100.), fTimeMax(1000000), fTimeMin(-1000000),
60 fAsyCut(1.), fMinNCells(2), fGroupNCells(0),
61 fLogWeight(4.5), fSameSM(kFALSE),
62 fNMaskCellColumns(11), fMaskCellColumns(0x0),
63 fSelectOnlyCellSignalOutOfCollision(0),
64 fCellEnergyHiso(0), fClusterTopology(0),
65 fSelectOnlyPhotonsInDifferentSM(0),
67 fInvMassCutMin(110.), fInvMassCutMax(160.),
69 fNbins(300), fMinBin(0.), fMaxBin(300.),
70 fNTimeBins(1000), fMinTimeBin(0.), fMaxTimeBin(1000.),
71 fNEnergybins(1000), fMinEnergyBin(0.), fMaxEnergyBin(100.),
73 fMomentum1(), fMomentum2(), fMomentum12(),
75 fHmgg(0x0), fHmggDifferentSM(0x0),
76 fHmggMaskFrame(0x0), fHmggDifferentSMMaskFrame(0x0),
77 fHOpeningAngle(0x0), fHOpeningAngleDifferentSM(0x0),
78 fHAsymmetry(0x0), fHAsymmetryDifferentSM(0x0),
80 fhClusterTime(0x0), fhClusterPairDiffTime(0x0)
82 for(
Int_t iMod=0; iMod < AliEMCALGeoParams::fgkEMCALModules; iMod++)
84 for(
Int_t iX=0; iX<24; iX++)
86 for(
Int_t iZ=0; iZ<48; iZ++)
108 for(
Int_t iSMPair = 0; iSMPair < AliEMCALGeoParams::fgkEMCALModules/2; iSMPair++)
115 for(
Int_t iSMPair = 0; iSMPair < AliEMCALGeoParams::fgkEMCALModules-2; iSMPair++)
122 for(
Int_t iSM = 0; iSM < AliEMCALGeoParams::fgkEMCALModules; iSM++)
209 for(
Int_t iMod=0; iMod < AliEMCALGeoParams::fgkEMCALModules; iMod++)
211 for(
Int_t iX=0; iX<24; iX++)
213 for(
Int_t iZ=0; iZ<48; iZ++)
215 fHmpi0[iMod][iZ][iX] = 0 ;
235 for(
Int_t iSMPair = 0; iSMPair < AliEMCALGeoParams::fgkEMCALModules/2; iSMPair++)
242 for(
Int_t iSMPair = 0; iSMPair < AliEMCALGeoParams::fgkEMCALModules-2; iSMPair++)
249 for(
Int_t iSM = 0; iSM < AliEMCALGeoParams::fgkEMCALModules; iSM++)
285 DefineOutput(1, TList::Class());
314 AliDebug(1,Form(
"It will use fLogWeight %.3f",
fLogWeight));
326 else if (e1i >
fEmax)
continue;
328 else if (c1->GetNCells() <
fMinNCells)
continue;
338 AliInfo(Form(
"Std : i %d, E %f, dispersion %f, m02 %f, m20 %f\n",c1->GetID(),c1->E(),c1->GetDispersion(),c1->GetM02(),c1->GetM20()));
339 c1->GetPosition(pos);
340 AliInfo(Form(
"Std : i %d, x %f, y %f, z %f\n",c1->GetID(), pos[0], pos[1], pos[2]));
351 AliDebug(2,Form(
"Energy: after recalibration %f",c1->E()));
359 AliDebug(2,Form(
"after linearity correction %f",c1->E()));
364 AliDebug(2,Form(
"after smearing %f\n",c1->E()));
368 AliInfo(Form(
"Cor : i %d, E %f, dispersion %f, m02 %f, m20 %f\n",c1->GetID(),c1->E(),c1->GetDispersion(),c1->GetM02(),c1->GetM20()));
369 c1->GetPosition(pos);
370 AliInfo(Form(
"Cor : i %d, x %f, y %f, z %f\n",c1->GetID(), pos[0], pos[1], pos[2]));
393 Int_t bc = InputEvent()->GetBunchCrossNumber();
394 Int_t nSM = (
fEMCALGeo->GetEMCGeometry())->GetNumberOfSuperModules();
396 Int_t nbClusterInTopoHisto[nSM];
398 for(
Int_t iSM = 0; iSM < nSM; iSM++)
400 nbClusterInTopoHisto[iSM] = 0;
415 else if (e1i >
fEmax)
continue;
419 else if (c1->GetNCells() <
fMinNCells)
continue;
427 AliInfo(Form(
"IMA : i %d, E %f, dispersion %f, m02 %f, m20 %f",c1->GetID(),e1i,c1->GetDispersion(),c1->GetM02(),c1->GetM20()));
428 c1->GetPosition(pos);
429 AliInfo(Form(
"IMA : i %d, x %f, y %f, z %f",c1->GetID(), pos[0], pos[1], pos[2]));
454 AliEMCALGeometry* geom = AliEMCALGeometry::GetInstance();
456 for(
Int_t iCell = 0; iCell < c1->GetNCells(); iCell++)
458 Int_t iSupMod = -1, iIeta =-1, iIphi =-1, iTower =-1, ietaCell =-1, iphiCell =-1;
460 Int_t CellID = c1->GetCellsAbsId()[iCell];
461 geom->GetCellIndex(CellID,iSupMod,iTower,iIphi,iIeta);
462 geom->GetCellPhiEtaIndexInSModule(iSupMod,iTower,iIphi,iIeta,iphiCell,ietaCell);
466 Float_t AmpFraction = amp / e1i;
468 AliDebug(2,Form(
"Cell ID: %i, Cell row: %i, Cell col: %i, Cell amp: %f, Cell amp fraction: %f\n",CellID,iphiCell,ietaCell,amp,AmpFraction));
470 switch (iPosInNoisyQuartet) {
495 if(amp && AmpFraction)
497 nbClusterInTopoHisto[iSupMod1] = nbClusterInTopoHisto[iSupMod1] + 1;
511 else if (e2i >
fEmax)
continue;
515 else if (c2->GetNCells() <
fMinNCells)
continue;
540 if(TMath::Abs(time1-time2) >
fDTimeCut)
continue;
542 if(invmass < fMaxBin && invmass >
fMinBin )
557 if(iSupMod1==iSupMod2)
586 for(
Int_t i = 0; i < nSM/2; i++)
589 if((iSupMod1==j && iSupMod2==j+1) || (iSupMod1==j+1 && iSupMod2==j))
597 for(
Int_t i = 0; i < nSM-2; i++)
599 if((iSupMod1==i && iSupMod2==i+2) || (iSupMod1==i+2 && iSupMod2==i))
616 for(
Int_t i = 0; i < nSM/2; i++)
623 for(
Int_t i = 0; i < nSM-2; i++)
634 for(
Int_t icell = 0; icell < c1->GetNCells(); icell++)
636 Int_t absID = c1->GetCellAbsId(icell);
640 for(
Int_t icell = 0; icell < c2->GetNCells(); icell++)
642 Int_t absID = c2->GetCellAbsId(icell);
654 if(iSupMod1==iSupMod2)
665 if((iSupMod1==0 && iSupMod2==2) || (iSupMod1==2 && iSupMod2==0))
671 if((iSupMod1==1 && iSupMod2==3) || (iSupMod1==3 && iSupMod2==1))
677 if((iSupMod1==0 && iSupMod2==1) || (iSupMod1==1 && iSupMod2==0))
682 if((iSupMod1==2 && iSupMod2==3) || (iSupMod1==3 && iSupMod2==2))
693 if(
fSameSM && iSupMod1!=iSupMod2)
continue;
698 fHmpi0[iSupMod1][ieta1][iphi1]->Fill(invmass);
699 fHmpi0[iSupMod2][ieta2][iphi2]->Fill(invmass);
724 for (
Int_t j = -fGroupNCells; j < fGroupNCells+1; j++)
726 Int_t absId11 =
fEMCALGeo->GetAbsCellIdFromCellIndexes(iSupMod1, iphi1+j, ieta1+i);
727 Int_t absId22 =
fEMCALGeo->GetAbsCellIdFromCellIndexes(iSupMod2, iphi2+j, ieta2+i);
732 for(
Int_t icell = 0; icell < c1->GetNCells(); icell++)
734 if(c1->GetCellsAbsId()[icell] == absId11) ok1=kTRUE;
737 for(
Int_t icell = 0; icell < c2->GetNCells(); icell++)
739 if(c2->GetCellsAbsId()[icell] == absId22) ok2=kTRUE;
742 if(ok1 && (ieta1+i >= 0) && (iphi1+j >= 0) && (ieta1+i < 48) && (iphi1+j < 24))
744 fHmpi0[iSupMod1][ieta1+i][iphi1+j]->Fill(invmass);
748 if(ok2 && (ieta2+i >= 0) && (iphi2+j >= 0) && (ieta2+i < 48) && (iphi2+j < 24))
750 fHmpi0[iSupMod2][ieta2+i][iphi2+j]->Fill(invmass);
757 AliDebug(1,Form(
"Mass in (SM%d,%d,%d) and (SM%d,%d,%d): %.3f GeV E1_i=%f E1_ii=%f E2_i=%f E2_ii=%f\n",
758 iSupMod1,iphi1,ieta1,iSupMod2,iphi2,ieta2,
fMomentum12.M(),e1i,c1->E(),e2i,c2->E()));
763 for(
Int_t iSM = 0; iSM < nSM; iSM++)
765 AliDebug(2,Form(
"nbClusterInTopo = %i\n",nbClusterInTopoHisto[iSM]));
767 if(nbClusterInTopoHisto[iSM] == 0)
continue;
798 if ( !calibFactorsFile ) AliFatal(
"Cannot recover the calibration factors");
800 for(
Int_t ism = 0; ism <
fEMCALGeo->GetNumberOfSuperModules(); ism++)
802 TH2F * histo = (
TH2F*) calibFactorsFile->Get(Form(
"EMCALRecalFactors_SM%d",ism));
803 printf(
"In AliAnalysisTaskEMCALPi0CalibSelection::InitEnergyCalibrationFactors \n ---Recover calibration factor for : EMCALRecalFactors_SM%d %p\n",ism,histo);
808 AliWarning(Form(
"Null histogram with calibration factors for SM%d, 1 will be used for the full SM!",ism));
818 Int_t runnumber = InputEvent()->GetRunNumber() ;
827 if (runnumber < 140000)
fImportGeometryFilePath = AliDataFile::GetFileNameOADB(
"EMCAL/geometry_2010.root").data();
828 else if(runnumber < 171000)
fImportGeometryFilePath = AliDataFile::GetFileNameOADB(
"EMCAL/geometry_2011.root").data();
829 else if(runnumber < 198000)
fImportGeometryFilePath = AliDataFile::GetFileNameOADB(
"EMCAL/geometry_2012.root").data();
841 AliInfo(
"Load user defined EMCAL geometry matrices");
843 AliOADBContainer emcGeoMat(
"AliEMCALgeo");
846 emcGeoMat.InitFromFile(Form(
"%s/EMCALlocal2master.root",
fOADBFilePath.Data()),
"AliEMCALgeo");
848 emcGeoMat.InitFromFile(AliDataFile::GetFileNameOADB(
"EMCAL/EMCALlocal2master.root").data(),
"AliEMCALgeo");
852 for(
Int_t mod = 0; mod < (
fEMCALGeo->GetEMCGeometry())->GetNumberOfSuperModules(); mod++)
856 AliDebug(1,Form(
"EMCAL matrices SM %d, %p",mod,((TGeoHMatrix*) matEMCAL->At(mod))));
859 fMatrix[mod] = (TGeoHMatrix*) matEMCAL->At(mod) ;
871 AliWarning(Form(
"Set matrix for SM %d from gGeoManager",mod));
872 fEMCALGeo->SetMisalMatrix(
fEMCALGeo->GetMatrixForSuperModuleFromGeoManager(mod),mod) ;
876 AliError(Form(
"Alignment matrix for SM %d is not available",mod));
880 else if(!gGeoManager)
882 AliInfo(
"Get geo matrices from data");
884 if(!strcmp(InputEvent()->GetName(),
"AliAODEvent"))
886 AliWarning(
"Use ideal geometry, values geometry matrix not kept in AODs");
890 AliDebug(1,
"AliAnalysisTaskEMCALClusterize Load Misaligned matrices");
892 for(
Int_t mod=0; mod < (
fEMCALGeo->GetEMCGeometry())->GetNumberOfSuperModules(); mod++)
894 if(InputEvent()->GetEMCALMatrix(mod))
897 InputEvent()->GetEMCALMatrix(mod)->Print();
899 fEMCALGeo->SetMisalMatrix(InputEvent()->GetEMCALMatrix(mod),mod) ;
907 for(
Int_t mod = 0; mod < (
fEMCALGeo->GetEMCGeometry())->GetNumberOfSuperModules(); mod++)
909 AliWarning(Form(
"Set matrix for SM %d from gGeoManager",mod));
910 fEMCALGeo->SetMisalMatrix(
fEMCALGeo->GetMatrixForSuperModuleFromGeoManager(mod),mod) ;
924 AliOADBContainer *contRFTD=
new AliOADBContainer(
"");
927 contRFTD->InitFromFile(Form(
"%s/EMCALTemperatureCorrCalib.root",
fOADBFilePath.Data()),
"AliEMCALRunDepTempCalibCorrections");
929 contRFTD->InitFromFile(AliDataFile::GetFileNameOADB(
"EMCAL/EMCALTemperatureCorrCalib.root").data(),
"AliEMCALRunDepTempCalibCorrections");
931 Int_t runnumber = InputEvent()->GetRunNumber() ;
933 TH1S *htd=(TH1S*)contRFTD->GetObject(runnumber);
938 AliWarning(Form(
"No TemperatureCorrCalib Objects for run: %d",runnumber));
943 Int_t maxEntry = contRFTD->GetNumberOfEntries();
945 while ( (ic < maxEntry) && (contRFTD->UpperLimit(ic) < runnumber) )
951 Int_t closest = lower;
952 if ( (ic<maxEntry) &&
953 (contRFTD->LowerLimit(ic)-runnumber) < (runnumber - contRFTD->UpperLimit(lower)) )
958 AliWarning(Form(
"TemperatureCorrCalib Objects found closest id %d from run: %d",
959 closest, contRFTD->LowerLimit(closest)));
961 htd = (TH1S*) contRFTD->GetObjectByIndex(closest);
967 AliInfo(
"Recalibrate (Temperature) EMCAL");
971 for (
Int_t ism = 0; ism < nSM; ++ism)
973 for (
Int_t icol = 0; icol < 48; ++icol)
975 for (
Int_t irow = 0; irow < 24; ++irow)
979 Int_t absID =
fEMCALGeo->GetAbsCellIdFromCellIndexes(ism, irow, icol);
981 AliDebug(3,Form(
" ism %d, icol %d, irow %d,absID %d - Calib factor %1.5f - ",ism, icol, irow, absID, factor));
983 factor *= htd->GetBinContent(absID) / 10000. ;
987 AliDebug(3,Form(
"T factor %1.5f - final factor %1.5f",
988 htd->GetBinContent(absID) / 10000.,
994 else AliInfo(
"Do NOT recalibrate EMCAL with T variations, no params TH1");
1006 Int_t nSM = (
fEMCALGeo->GetEMCGeometry())->GetNumberOfSuperModules();
1009 const Int_t buffersize = 255;
1010 char hname[buffersize], htitl[buffersize], htitlEnergy[buffersize];
1012 fhNEvents =
new TH1I(
"hNEvents",
"Number of analyzed events" , 1 , 0 , 1 ) ;
1019 Form(
"Number of events in centrality bins, |vz|<10 cm, method <%s> ",
fCentralityClass.Data()),
1020 1000,-1000.,1000.) ;
1025 (
"hCentralitySelected",
1026 Form(
"Number of selected events in centrality bin, |vz|<10 cm, method <%s> ",
fCentralityClass.Data()),
1033 fHmgg->SetXTitle(
"m_{#gamma #gamma} (MeV/c^{2})");
1034 fHmgg->SetYTitle(
"p_{T #gamma #gamma} (GeV/c)");
1052 fHAsymmetry =
new TH2F(
"hasym",
"2-cluster opening angle",100,0.,1.,100,0,10);
1054 fHAsymmetry->SetYTitle(
"p_{T #gamma #gamma} (GeV/c)");
1075 for(
Int_t iSM = 0; iSM < nSM; iSM++)
1077 snprintf(hname, buffersize,
"hmgg_SM%d",iSM);
1078 snprintf(htitl, buffersize,
"Two-gamma inv. mass for super mod %d",iSM);
1080 fHmggSM[iSM]->SetXTitle(
"m_{#gamma #gamma} (MeV/c^{2})");
1081 fHmggSM[iSM]->SetYTitle(
"p_{T #gamma #gamma} (GeV/c)");
1084 snprintf(hname, buffersize,
"hmgg_SM%d_MaskFrame",iSM);
1085 snprintf(htitl, buffersize,
"Two-gamma inv. mass for super mod %d",iSM);
1091 snprintf(hname, buffersize,
"hmgg_SM%d_Zone1",iSM);
1092 snprintf(htitl, buffersize,
"Two-gamma inv. mass for super mod %d in zone 1",iSM);
1094 fHmggSM_Zone1[iSM]->SetXTitle(
"m_{#gamma #gamma} (MeV/c^{2})");
1095 fHmggSM_Zone1[iSM]->SetYTitle(
"p_{T #gamma #gamma} (GeV/c)");
1098 snprintf(hname, buffersize,
"hmgg_SM%d_Zone2",iSM);
1099 snprintf(htitl, buffersize,
"Two-gamma inv. mass for super mod %d in zone 2",iSM);
1101 fHmggSM_Zone2[iSM]->SetXTitle(
"m_{#gamma #gamma} (MeV/c^{2})");
1102 fHmggSM_Zone2[iSM]->SetYTitle(
"p_{T #gamma #gamma} (GeV/c)");
1105 snprintf(hname, buffersize,
"hmgg_SM%d_Zone3",iSM);
1106 snprintf(htitl, buffersize,
"Two-gamma inv. mass for super mod %d in zone 3",iSM);
1108 fHmggSM_Zone3[iSM]->SetXTitle(
"m_{#gamma #gamma} (MeV/c^{2})");
1109 fHmggSM_Zone3[iSM]->SetYTitle(
"p_{T #gamma #gamma} (GeV/c)");
1112 snprintf(hname, buffersize,
"hmgg_SM%d_Zone4",iSM);
1113 snprintf(htitl, buffersize,
"Two-gamma inv. mass for super mod %d in zone 4",iSM);
1115 fHmggSM_Zone4[iSM]->SetXTitle(
"m_{#gamma #gamma} (MeV/c^{2})");
1116 fHmggSM_Zone4[iSM]->SetYTitle(
"p_{T #gamma #gamma} (GeV/c)");
1119 snprintf(hname, buffersize,
"hmgg_SM%d_Zone5",iSM);
1120 snprintf(htitl, buffersize,
"Two-gamma inv. mass for super mod %d in zone 5",iSM);
1122 fHmggSM_Zone5[iSM]->SetXTitle(
"m_{#gamma #gamma} (MeV/c^{2})");
1123 fHmggSM_Zone5[iSM]->SetYTitle(
"p_{T #gamma #gamma} (GeV/c)");
1126 snprintf(hname, buffersize,
"hmgg_SM%d_Zone6",iSM);
1127 snprintf(htitl, buffersize,
"Two-gamma inv. mass for super mod %d in zone 6",iSM);
1129 fHmggSM_Zone6[iSM]->SetXTitle(
"m_{#gamma #gamma} (MeV/c^{2})");
1130 fHmggSM_Zone6[iSM]->SetYTitle(
"p_{T #gamma #gamma} (GeV/c)");
1133 snprintf(hname, buffersize,
"hmgg_SM%d_Zone7",iSM);
1134 snprintf(htitl, buffersize,
"Two-gamma inv. mass for super mod %d in zone 7",iSM);
1136 fHmggSM_Zone7[iSM]->SetXTitle(
"m_{#gamma #gamma} (MeV/c^{2})");
1137 fHmggSM_Zone7[iSM]->SetYTitle(
"p_{T #gamma #gamma} (GeV/c)");
1142 snprintf(hname,buffersize,
"hmgg_PairSameSectorSM%d",iSM);
1143 snprintf(htitl,buffersize,
"Two-gamma inv. mass for SM pair Sector: %d",iSM);
1149 snprintf(hname,buffersize,
"hmgg_PairSameSectorSM%d_MaskFrame",iSM);
1150 snprintf(htitl,buffersize,
"Two-gamma inv. mass for SM pair Sector: %d",iSM);
1157 Form(
"cluster pair time difference vs E, Sector %d",iSM),
1158 100,0,10, 200,-100,100);
1166 snprintf(hname,buffersize,
"hmgg_PairSameSideSM%d",iSM);
1167 snprintf(htitl,buffersize,
"Two-gamma inv. mass for SM pair Sector: %d",iSM);
1173 snprintf(hname,buffersize,
"hmgg_PairSameSideSM%d_MaskFrame",iSM);
1174 snprintf(htitl,buffersize,
"Two-gamma inv. mass for SM pair Sector: %d",iSM);
1181 Form(
"cluster pair time difference vs E, Side %d",iSM),
1182 100,0,10, 200,-100,100);
1188 snprintf(hname, buffersize,
"hopang_SM%d",iSM);
1189 snprintf(htitl, buffersize,
"Opening angle for super mod %d",iSM);
1195 snprintf(hname,buffersize,
"hopang_PairSM%d",iSM);
1196 snprintf(htitl,buffersize,
"Opening angle for SM pair: %d",iSM);
1202 snprintf(hname, buffersize,
"hasym_SM%d",iSM);
1203 snprintf(htitl, buffersize,
"Asymmetry for super mod %d",iSM);
1206 fHAsymmetrySM[iSM]->SetYTitle(
"p_{T #gamma #gamma} (GeV/c)");
1209 snprintf(hname,buffersize,
"hasym_PairSM%d",iSM);
1210 snprintf(htitl,buffersize,
"Asymmetry for SM pair: %d",iSM);
1220 Form(
"Entries in grid of cells in Module %d",iSM),
1221 colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
1227 Form(
"Accumulated energy in grid of cells in Module %d",iSM),
1228 colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
1234 Form(
"Accumulated asymmetry in grid of cells in Module %d",iSM),
1235 colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
1241 colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
1246 fhClusterTimeSM[iSM] =
new TH2F(Form(
"hClusterTime_SM%d",iSM),
"cluster time vs E",100,0,10, 200,-1000,1000);
1252 Form(
"cluster pair time difference vs E, SM %d",iSM),
1253 100,0,10, 200,-100,100);
1263 Form(
"cluster topology for cluster in position 0 in noisy quartet, SM %d",iSM),
1264 21,-10.5,10.5, 21,-10.5,10.5);
1270 Form(
"cluster topology for cluster in position 1 in noisy quartet, SM %d",iSM),
1271 21,-10.5,10.5, 21,-10.5,10.5);
1277 Form(
"cluster topology for cluster in position 2 in noisy quartet, SM %d",iSM),
1278 21,-10.5,10.5, 21,-10.5,10.5);
1284 Form(
"cluster topology for cluster in position 3 in noisy quartet, SM %d",iSM),
1285 21,-10.5,10.5, 21,-10.5,10.5);
1291 Form(
"cluster topology for cluster in position 0 in noisy quartet, SM %d",iSM),
1292 21,-10.5,10.5, 21,-10.5,10.5);
1298 Form(
"cluster topology for cluster in position 1 in noisy quartet, SM %d",iSM),
1299 21,-10.5,10.5, 21,-10.5,10.5);
1305 Form(
"cluster topology for cluster in position 2 in noisy quartet, SM %d",iSM),
1306 21,-10.5,10.5, 21,-10.5,10.5);
1312 Form(
"cluster topology for cluster in position 3 in noisy quartet, SM %d",iSM),
1313 21,-10.5,10.5, 21,-10.5,10.5);
1320 Form(
"cluster topology for cluster in position 0 in noisy quartet, SM %d",iSM),
1321 21,-10.5,10.5, 21,-10.5,10.5);
1327 Form(
"cluster topology for cluster in position 1 in noisy quartet, SM %d",iSM),
1328 21,-10.5,10.5, 21,-10.5,10.5);
1334 Form(
"cluster topology for cluster in position 2 in noisy quartet, SM %d",iSM),
1335 21,-10.5,10.5, 21,-10.5,10.5);
1341 Form(
"cluster topology for cluster in position 3 in noisy quartet, SM %d",iSM),
1342 21,-10.5,10.5, 21,-10.5,10.5);
1349 Int_t nchannels = nSM*AliEMCALGeoParams::fgkEMCALRows*AliEMCALGeoParams::fgkEMCALCols;
1350 for(
Int_t ibc = 0; ibc < 4; ibc++)
1352 fHTpi0[ibc] =
new TH2F(Form(
"hTime_BC%d",ibc),Form(
"Time of cell clusters under pi0 peak, bunch crossing %d",ibc),
1355 fHTpi0[ibc]->SetYTitle(
"time (ns)");
1356 fHTpi0[ibc]->SetXTitle(
"abs. Id. ");
1359 fhClusterTime =
new TH2F(
"hClusterTime",
"cluster time vs E",100,0,10, 100,0,1000);
1369 for(
Int_t iMod=0; iMod < nSM; iMod++)
1371 for(
Int_t iRow=0; iRow < AliEMCALGeoParams::fgkEMCALRows; iRow++)
1373 for(
Int_t iCol=0; iCol < AliEMCALGeoParams::fgkEMCALCols; iCol++)
1375 snprintf(hname,buffersize,
"%d_%d_%d",iMod,iCol,iRow);
1376 snprintf(htitl,buffersize,
"Two-gamma inv. mass for super mod %d, cell(col,row)=(%d,%d)",iMod,iCol,iRow);
1378 fHmpi0[iMod][iCol][iRow]->SetXTitle(
"mass (MeV/c^{2})");
1383 snprintf(htitlEnergy,buffersize,
"Energy for super mod %d, cell(col,row)=(%d,%d)",iMod,iCol,iRow);
1385 fhEnergy[iMod][iCol][iRow]->SetXTitle(
"E (GeV)");
1448 if((irow >= 2 && irow <= 21) && ((icol >= 42 && icol <= 46) || (icol >= 13 && icol <= 37) || (icol >= 1 && icol <= 9)))
1450 if((irow >= 2 && irow <= 3) || (irow >= 20 && irow <= 21))
1459 if((irow >= 2 && irow <= 21) && ((icol >= 1 && icol <= 5) || (icol >= 10 && icol <= 34) || (icol >= 38 && icol <= 46)))
1461 if((irow >= 2 && irow <= 3) || (irow >= 20 && irow <= 21))
1493 if((irow >= 2 && irow <= 21) && ((icol >= 42 && icol <= 46) || (icol >= 13 && icol <= 37) || (icol >= 1 && icol <= 9)))
1495 if((irow >= 2 && irow <= 3) || (irow >= 20 && irow <= 21))
1508 if((irow >= 2 && irow <= 21) && ((icol >= 1 && icol <= 5) || (icol >= 10 && icol <= 34) || (icol >= 38 && icol <= 46)))
1510 if((irow >= 2 && irow <= 3) || (irow >= 20 && irow <= 21))
1546 if((irow >= 2 && irow <= 21) && ((icol >= 42 && icol <= 46) || (icol >= 13 && icol <= 37) || (icol >= 1 && icol <= 9)))
1548 if((icol >= 1 && icol <= 3) || (icol >= 44 && icol <= 46))
1557 if((irow >= 2 && irow <= 21) && ((icol >= 1 && icol <= 5) || (icol >= 10 && icol <= 34) || (icol >= 38 && icol <= 46)))
1559 if((icol >= 1 && icol <= 3) || (icol >= 44 && icol <= 46))
1591 if((irow >= 2 && irow <= 21) && ((icol >= 42 && icol <= 46) || (icol >= 13 && icol <= 37) || (icol >= 1 && icol <= 9)))
1593 if((icol >= 1 && icol <= 3) || (icol >= 44 && icol <= 46))
1606 if((irow >= 2 && irow <= 21) && ((icol >= 1 && icol <= 5) || (icol >= 10 && icol <= 34) || (icol >= 38 && icol <= 46)))
1608 if((icol >= 1 && icol <= 3) || (icol >= 44 && icol <= 46))
1647 if(((icol-col0)*(icol-col0)) / (a*a) + ((irow-row0)*(irow-row0) / (b*b)) > 1)
1683 if((((icol-col0)*(icol-col0)) / (aLarge*aLarge) + ((irow-row0)*(irow-row0) / (bLarge*bLarge)) < 1) && (((icol-col0)*(icol-col0)) / (aSmall*aSmall) + ((irow-row0)*(irow-row0) / (bSmall*bSmall)) > 1))
1717 if(((icol-col0)*(icol-col0)) / (a*a) + ((irow-row0)*(irow-row0) / (b*b)) < 1)
1745 if (esdevent) triggerClass = esdevent->GetFiredTriggerClasses();
1746 else if(aodevent) triggerClass = aodevent->GetFiredTriggerClasses();
1748 AliDebug(1,Form(
"Event %d, FiredClass %s",
1753 AliDebug(1,
"Reject event!");
1757 AliDebug(1,
"Accept event!");
1762 AliVEvent*
event = 0;
1764 else event = InputEvent();
1768 AliWarning(
"Input event not available!");
1776 AliMultSelection* multSelection = (AliMultSelection * ) event->FindListObject(
"MultSelection") ;
1777 if ( multSelection )
1785 if ( cent < fCentMin || cent >=
fCentMax ) return ;
1791 AliDebug(1,Form(
"<<< %s: Event %d >>>",event->GetName(), (
Int_t)Entry()));
1795 event->GetPrimaryVertex()->GetXYZ(
fVertex) ;
1838 printf(
"Cluster cuts: %2.2f < E < %2.2f GeV; number of cells > %d; Assymetry < %1.2f, pair time diff < %2.2f, %2.2f < t < %2.2f ns\n",
1847 printf(
"Switchs:\n \t Remove Bad Channels? %d; Use filtered input? %d; Correct Clusters? %d, and their position? %d \n \t Mass per channel same SM clusters? %d\n",
1885 else AliWarning(
"Mask column not set, position larger than allocated set size first") ;
1932 AliDebug(1,
"Not implemented");
Float_t fTimeMin
Minimum cluster time (ns).
Bool_t IsRunDepRecalibrationOn() const
TH2F * fHmggSM_Zone4[AliEMCALGeoParams::fgkEMCALModules]
! Two-cluster invariant mass per SM in zone 4.
Float_t fDTimeCut
Maximum difference between time of cluster pairs (ns).
TList * fOutputContainer
! Histogram container.
Float_t fTimeMax
Maximum cluster time (ns).
TH2F * fHmggPairSameSectorSMMaskFrame[AliEMCALGeoParams::fgkEMCALModules/2]
! Two-cluster invariant mass per Pair, mask clusters facing frames.
TGeoHMatrix * fMatrix[AliEMCALGeoParams::fgkEMCALModules]
Bool_t IsInZone3(Int_t iSupMod, Int_t ieta, Int_t iphi)
TH2F * fhClusterPairDiffTimeSameSide[AliEMCALGeoParams::fgkEMCALModules-2]
! Diference in time of clusters same side.
TRefArray * fCaloClustersArr
! List of clusters.
Bool_t IsInZone6(Int_t iSupMod, Int_t ieta, Int_t iphi)
Float_t fEBkgmin
Minimum cluster energy (GeV) for bkg shape study (only for high M02 clusters).
TH2F * fHmggSM_Zone3[AliEMCALGeoParams::fgkEMCALModules]
! Two-cluster invariant mass per SM in zone 3.
Int_t fNTimeBins
N time bins of invariant mass histograms.
Bool_t CheckCellFiducialRegion(const AliEMCALGeometry *geom, const AliVCluster *cluster, AliVCaloCells *cells)
TH2F * fhTowerDecayPhotonHit[AliEMCALGeoParams::fgkEMCALModules]
! Cells ordered in column/row for different module, number of times a decay photon hits...
Float_t fInvMassCutMax
Maximum mass cut for clusters to fill time or other histograms.
TH2F * fHAsymmetryPairSM[AliEMCALGeoParams::fgkEMCALModules]
! Two-cluster asymmetry vs pt per Pair,with mass close to pi0.
TH1F * fHmpi0[AliEMCALGeoParams::fgkEMCALModules][AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]
< Two-cluster invariant mass assigned to each cell.
Float_t fL0min
Minimum cluster L0.
Float_t fCentMin
Minimum centrality selected.
Bool_t IsInZone4(Int_t iSupMod, Int_t ieta, Int_t iphi)
TH1F * fhCentralitySelected
! Centrality selected events.
TString fImportGeometryFilePath
Path fo geometry.root file.
TH2F * fhTopoClusterAmpCase0[AliEMCALGeoParams::fgkEMCALModules]
! Cell amplitude map for type 0 cluster in noisy quartet
Bool_t fSameSM
Combine clusters in channels on same SM.
Bool_t fLoadMatrices
Matrices set from configuration, not get from geometry.root or from ESDs/AODs.
Float_t fEmax
Maximum cluster energy (GeV).
void SetEMCALChannelRecalibrationFactor(Int_t iSM, Int_t iCol, Int_t iRow, Double_t c=1)
AliEMCALRecoUtils * fRecoUtils
Access to reconstruction utilities.
AliEMCALGeometry * fEMCALGeo
! EMCAL geometry pointer.
Float_t fCentMax
Maximum centrality selected.
Int_t GetNumberOfCellsFromEMCALBorder() const
Float_t fMaxTimeBin
Maximum time bins of invariant mass histograms.
Bool_t fSelectOnlyPhotonsInDifferentSM
Select only pairs of photons that are not in the same SM.
Float_t fLogWeight
Logarithmic weight used in cluster recalibration.
Bool_t IsInZone7(Int_t iSupMod, Int_t ieta, Int_t iphi)
TH2F * fHAsymmetry
! Two-cluster asymmetry vs pt of pair, with mass close to pi0.
This task provides the input for the EMCal energy calibration with pi0 invariant mass analysis per ch...
Bool_t IsBadChannelsRemovalSwitchedOn() const
Float_t fMinTimeBin
Minimum time bins of invariant mass histograms.
Int_t fNMaskCellColumns
Number of masked columns.
Int_t GetParticleType() const
Bool_t IsInZone5(Int_t iSupMod, Int_t ieta, Int_t iphi)
Int_t FindPositionInNoisyQuartet(Int_t irow, Int_t icol, Int_t iSM)
Int_t fMinNCells
Minimum ncells in cluster.
TH2F * fHOpeningAngleDifferentSM
! Two-cluster opening angle vs pt of pair, each cluster in different SM, with mass close to pi0...
TH2F * fhClusterPairDiffTimeSameSM[AliEMCALGeoParams::fgkEMCALModules]
! Diference in time of clusters same SM.
Bool_t IsRecalibrationOn() const
Some utilities for cluster and cell treatment.
TH2F * fHOpeningAngle
! Two-cluster opening angle vs pt of pair, with mass close to pi0.
TH2F * fhClusterTimeSM[AliEMCALGeoParams::fgkEMCALModules]
! Timing of clusters vs energy per SM.
TH2F * fHmggSM_Zone5[AliEMCALGeoParams::fgkEMCALModules]
! Two-cluster invariant mass per SM in zone 5.
TH2F * fHOpeningAngleSM[AliEMCALGeoParams::fgkEMCALModules]
! Two-cluster opening angle vs pt per SM,with mass close to pi0.
TLorentzVector fMomentum2
Cluster kinematics, temporal.
TH2F * fhTopoClusterAmpCase2[AliEMCALGeoParams::fgkEMCALModules]
! Cell amplitude map for type 2 cluster in noisy quartet
Float_t fInvMassCutMin
Minimum mass cut for clusters to fill time or other histograms.
Float_t GetEMCALChannelRecalibrationFactor(Int_t iSM, Int_t iCol, Int_t iRow) const
TH2F * fhTopoClusterAmpCase3[AliEMCALGeoParams::fgkEMCALModules]
! Cell amplitude map for type 3 cluster in noisy quartet
Float_t fOpAnglemax
Maximum cluster opening angle for bkg shape study.
Float_t fMinEnergyBin
Minimum energy bins of cell energy histograms.
Bool_t IsInZone2(Int_t iSupMod, Int_t ieta, Int_t iphi)
void SetMaskCellColumn(Int_t ipos, Int_t icol)
Int_t fGroupNCells
Group n cells.
Int_t fNEnergybins
N energy bins of cell energy histograms.
TH2F * fHAsymmetrySM[AliEMCALGeoParams::fgkEMCALModules]
! Two-cluster asymmetry vs pt per SM,with mass close to pi0.
TString fCalibFilePath
Full path with file with energy calibration factors per channel from previous iteration.
Bool_t fCheckCentrality
Activate centrality selection.
void RecalculateClusterShowerShapeParameters(const AliEMCALGeometry *geom, AliVCaloCells *cells, AliVCluster *cluster)
TH1F * fhCentrality
! Centrality all events.
TH2F * fHmggSM[AliEMCALGeoParams::fgkEMCALModules]
! Two-cluster invariant mass per SM.
virtual ~AliAnalysisTaskEMCALPi0CalibSelection()
Destructor.
TH2F * fhTowerDecayPhotonHitMaskFrame[AliEMCALGeoParams::fgkEMCALModules]
! Cells ordered in column/row for different module, number of times a decay photon hits...
TH2F * fhTopoClusterAmpCase1[AliEMCALGeoParams::fgkEMCALModules]
! Cell amplitude map for type 1 cluster in noisy quartet
TH2F * fhTopoClusterCase2[AliEMCALGeoParams::fgkEMCALModules]
! Cell amplitude map for type 2 cluster in noisy quartet
Bool_t fSelectOnlyCellSignalOutOfCollision
Select cells / clusters that are due to noise, i.e. signal in EMCal that happens not during collision...
TH2F * fHmggSM_Zone6[AliEMCALGeoParams::fgkEMCALModules]
! Two-cluster invariant mass per SM in zone 6.
TH2F * fHmgg
! Two-cluster invariant mass vs pt of pair.
TH2F * fHTpi0[4]
! Time of cell under pi0 mass, for 4 bunch crossings.
Float_t fEBkgmax
Maximum cluster energy (GeV) for bkg shape study (only for high M02 clusters).
AliAnalysisTaskEMCALPi0CalibSelection()
Default constructor. Arrays initialization is done here.
TH1F * fhEnergy[AliEMCALGeoParams::fgkEMCALModules][AliEMCALGeoParams::fgkEMCALCols][AliEMCALGeoParams::fgkEMCALRows]
! Energy distribution for each cell.
Float_t fMinBin
Minimum mass bins of invariant mass histograms.
TH2F * fhTopoClusterAmpFractionCase2[AliEMCALGeoParams::fgkEMCALModules]
! Cell amplitude fraction map for type 2 cluster in noisy quartet
TH2F * fhTopoClusterCase0[AliEMCALGeoParams::fgkEMCALModules]
! Cell amplitude map for type 0 cluster in noisy quartet
Bool_t fRecalPosition
Switch on/off cluster position calculation, in case alignment matrices are not available.
TH2F * fhTopoClusterCase1[AliEMCALGeoParams::fgkEMCALModules]
! Cell amplitude map for type 1 cluster in noisy quartet
void RecalibrateClusterEnergy(const AliEMCALGeometry *geom, AliVCluster *cluster, AliVCaloCells *cells, Int_t bc=-1)
Float_t fMaxEnergyBin
Maximum energy bins of cell energy histograms.
TString fTriggerName
Trigger name must contain this name.
Bool_t fChangeBkgShape
Select clusters with nominal M02 cuts (fL0min,fL0max) plus high M02 clusters (fL0Bkgmin,fL0Bkgmax)
TH2F * fHmggDifferentSMMaskFrame
! Two-cluster invariant mass vs pt of pair, each cluster in different SM,mask clusters facing frames...
TH2F * fhTopoClusterAmpFractionCase3[AliEMCALGeoParams::fgkEMCALModules]
! Cell amplitude fraction map for type 3 cluster in noisy quartet
TH2F * fhClusterPairDiffTime
! Diference in time of clusters.
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 UserExec(Option_t *opt)
void InitEnergyCalibrationFactors()
Float_t fEmin
Minimum cluster energy (GeV).
Bool_t MaskFrameCluster(Int_t iSM, Int_t ieta) const
Int_t fNbins
N mass bins of invariant mass histograms.
TH2F * fHmggSM_Zone2[AliEMCALGeoParams::fgkEMCALModules]
! Two-cluster invariant mass per SM in zone 2.
Bool_t IsGoodCluster(AliVCluster *cluster, const AliEMCALGeometry *geom, AliVCaloCells *cells, Int_t bc=-1)
TH2F * fhClusterTime
! Timing of clusters vs energy.
void GetMaxEnergyCell(const AliEMCALGeometry *geom, AliVCaloCells *cells, const AliVCluster *clu, Int_t &absId, Int_t &iSupMod, Int_t &ieta, Int_t &iphi, Bool_t &shared)
TLorentzVector fMomentum12
Cluster pair kinematics, temporal.
TH2F * fhTowerDecayPhotonAsymmetry[AliEMCALGeoParams::fgkEMCALModules]
! Cells ordered in column/row for different module, accumulated asymmetry in the tower by decay photo...
TH2F * fHmggPairSameSideSMMaskFrame[AliEMCALGeoParams::fgkEMCALModules-2]
! Two-cluster invariant mass per Pair, mask clusters facing frames.
void InitTemperatureCorrections()
Bool_t fCorrectClusters
Correct clusters energy, position etc.
void UserCreateOutputObjects()
Create output container, init geometry.
Float_t fL0max
Maximum cluster L0.
void RecalculateClusterPosition(const AliEMCALGeometry *geom, AliVCaloCells *cells, AliVCluster *clu)
void SetNMaskCellColumns(Int_t n)
TH2F * fHmggSMMaskFrame[AliEMCALGeoParams::fgkEMCALModules]
! Two-cluster invariant mass per SM, mask clusters facing frames.
void Terminate(Option_t *opt)
Create cuts/param objects and publish to slot. Comment out for the moment.
TH2F * fhTowerDecayPhotonEnergy[AliEMCALGeoParams::fgkEMCALModules]
! Cells ordered in column/row for different module, accumulated energy in the tower by decay photons...
void RecalculateClusterPID(AliVCluster *cluster)
void PrintInfo()
Print settings.
Float_t fL0Bkgmax
Maximum cluster L0 for bkg shape study.
TH2F * fHmggPairSameSideSM[AliEMCALGeoParams::fgkEMCALModules-2]
! Two-cluster invariant mass per Pair.
TH2F * fhTopoClusterAmpFractionCase0[AliEMCALGeoParams::fgkEMCALModules]
! Cell amplitude fraction map for type 0 cluster in noisy quartet
Bool_t fCentWithEventSel
Embedded event selection.
Float_t fL0Bkgmin
Minimum cluster L0 for bkg shape study.
TH2F * fhTopoClusterCase3[AliEMCALGeoParams::fgkEMCALModules]
! Cell amplitude map for type 3 cluster in noisy quartet
Float_t fMaxBin
Maximum mass bins of invariant mass histograms.
TH2F * fHmggDifferentSM
! Two-cluster invariant mass vs pt of pair, each cluster in different SM.
TH2F * fhClusterPairDiffTimeSameSector[AliEMCALGeoParams::fgkEMCALModules/2]
! Diference in time of clusters same sector.
TH1I * fhNEvents
! Number of events counter histogram.
TLorentzVector fMomentum1
Cluster kinematics, temporal.
TH2F * fHmggMaskFrame
! Two-cluster invariant mass vs pt of pair, mask clusters facing frames.
Bool_t fImportGeometryFromFile
Import geometry settings in geometry.root file.
Bool_t IsInZone1(Int_t iSupMod, Int_t ieta, Int_t iphi)
Float_t fAsyCut
Asymmetry cut.
Double_t fVertex[3]
Primary vertex.
Float_t CorrectClusterEnergyLinearity(AliVCluster *clu)
TString fOADBFilePath
Default path $ALICE_PHYSICS/OADB/EMCAL, if needed change.
TH2F * fHOpeningAnglePairSM[AliEMCALGeoParams::fgkEMCALModules]
! Two-cluster opening angle vs pt per Pair,with mass close to pi0.
Bool_t ClusterContainsBadChannel(const AliEMCALGeometry *geom, const UShort_t *cellList, Int_t nCells)
Float_t fOpAnglemin
Minimum cluster opening angle for bkg shape study.
void SetEMCALChannelRecalibrationFactors(const TObjArray *map)
AliVCaloCells * fEMCALCells
! List of cells.
Bool_t fFilteredInput
Read input produced with filter.
TString fEMCALGeoName
Name of geometry to use.
TH2F * fHAsymmetryDifferentSM
! Two-cluster asymmetry vs pt of pair, each cluster in different SM, with mass close to pi0...
void InitGeometryMatrices()
TH2F * fHmggSM_Zone1[AliEMCALGeoParams::fgkEMCALModules]
! Two-cluster invariant mass per SM in zone 1.
Bool_t fClusterTopology
Draw cluster topology histo.
TH2F * fhTopoClusterAmpFractionCase1[AliEMCALGeoParams::fgkEMCALModules]
! Cell amplitude fraction map for type 1 cluster in noisy quartet
TH2F * fHmggSM_Zone7[AliEMCALGeoParams::fgkEMCALModules]
! Two-cluster invariant mass per SM in zone 7.
TString fCentralityClass
Set which centrality class.
TH2F * fHmggPairSameSectorSM[AliEMCALGeoParams::fgkEMCALModules/2]
! Two-cluster invariant mass per Pair.
Bool_t fCellEnergyHiso
Draw cell ernergy histo.