14 #include <TRefArray.h>
17 #include <TGeoManager.h>
22 #include "AliAODEvent.h"
23 #include "AliESDEvent.h"
24 #include "AliEMCALGeometry.h"
25 #include "AliVCluster.h"
26 #include "AliVCaloCells.h"
27 #include "AliEMCALRecoUtils.h"
28 #include "AliOADBContainer.h"
39 fEMCALGeo(0x0), fLoadMatrices(0),
40 fEMCALGeoName(
"EMCAL_COMPLETE12SMV1_DCAL_8SM"),
42 fRecoUtils(new AliEMCALRecoUtils),
43 fOADBFilePath(
""), fCalibFilePath(
""),
44 fCorrectClusters(kFALSE), fRecalPosition(kTRUE),
45 fCaloClustersArr(0x0), fEMCALCells(0x0),
47 fOutputContainer(0x0),
48 fVertex(), fFilteredInput(kFALSE),
49 fImportGeometryFromFile(1), fImportGeometryFilePath(
""),
50 fEmin(0.5), fEmax(15.),
51 fL0min(0.01), fL0max(0.5),
52 fDTimeCut(100.), fTimeMax(1000000), fTimeMin(-1000000),
53 fAsyCut(1.), fMinNCells(2), fGroupNCells(0),
54 fLogWeight(4.5), fSameSM(kFALSE),
55 fNMaskCellColumns(11), fMaskCellColumns(0x0),
56 fInvMassCutMin(110.), fInvMassCutMax(160.),
59 fMinBin(0.), fMaxBin(300.),
60 fNTimeBins(1000), fMinTimeBin(0.), fMaxTimeBin(1000.),
62 fMomentum1(), fMomentum2(), fMomentum12(),
64 fHmgg(0x0), fHmggDifferentSM(0x0),
65 fHmggMaskFrame(0x0), fHmggDifferentSMMaskFrame(0x0),
66 fHOpeningAngle(0x0), fHOpeningAngleDifferentSM(0x0),
67 fHAsymmetry(0x0), fHAsymmetryDifferentSM(0x0),
69 fhClusterTime(0x0), fhClusterPairDiffTime(0x0)
71 for(Int_t iMod=0; iMod < AliEMCALGeoParams::fgkEMCALModules; iMod++)
73 for(Int_t iX=0; iX<24; iX++)
75 for(Int_t iZ=0; iZ<48; iZ++)
96 for(Int_t iSMPair = 0; iSMPair < AliEMCALGeoParams::fgkEMCALModules/2; iSMPair++)
103 for(Int_t iSMPair = 0; iSMPair < AliEMCALGeoParams::fgkEMCALModules-2; iSMPair++)
110 for(Int_t iSM = 0; iSM < AliEMCALGeoParams::fgkEMCALModules; iSM++)
142 AliAnalysisTaskSE(name),
143 fEMCALGeo(0x0), fLoadMatrices(0),
144 fEMCALGeoName(
"EMCAL_COMPLETE12SMV1_DCAL_8SM"),
146 fRecoUtils(new AliEMCALRecoUtils),
147 fOADBFilePath(
""), fCalibFilePath(
""),
148 fCorrectClusters(kFALSE), fRecalPosition(kTRUE),
149 fCaloClustersArr(0x0), fEMCALCells(0x0),
151 fOutputContainer(0x0),
152 fVertex(), fFilteredInput(kFALSE),
153 fImportGeometryFromFile(1), fImportGeometryFilePath(
""),
154 fEmin(0.5), fEmax(15.),
155 fL0min(0.01), fL0max(0.5),
156 fDTimeCut(100.), fTimeMax(1000000), fTimeMin(-1000000),
157 fAsyCut(1.), fMinNCells(2), fGroupNCells(0),
158 fLogWeight(4.5), fSameSM(kFALSE),
159 fNMaskCellColumns(11), fMaskCellColumns(0x0),
160 fInvMassCutMin(110.), fInvMassCutMax(160.),
163 fMinBin(0.), fMaxBin(300.),
164 fNTimeBins(1000), fMinTimeBin(0.), fMaxTimeBin(1000.),
166 fMomentum1(), fMomentum2(), fMomentum12(),
168 fHmgg(0x0), fHmggDifferentSM(0x0),
169 fHmggMaskFrame(0x0), fHmggDifferentSMMaskFrame(0x0),
170 fHOpeningAngle(0x0), fHOpeningAngleDifferentSM(0x0),
171 fHAsymmetry(0x0), fHAsymmetryDifferentSM(0x0),
173 fhClusterTime(0x0), fhClusterPairDiffTime(0x0)
175 for(Int_t iMod=0; iMod < AliEMCALGeoParams::fgkEMCALModules; iMod++)
177 for(Int_t iX=0; iX<24; iX++)
179 for(Int_t iZ=0; iZ<48; iZ++)
181 fHmpi0[iMod][iZ][iX] = 0 ;
200 for(Int_t iSMPair = 0; iSMPair < AliEMCALGeoParams::fgkEMCALModules/2; iSMPair++)
207 for(Int_t iSMPair = 0; iSMPair < AliEMCALGeoParams::fgkEMCALModules-2; iSMPair++)
214 for(Int_t iSM = 0; iSM < AliEMCALGeoParams::fgkEMCALModules; iSM++)
238 DefineOutput(1, TList::Class());
264 if(
fRecoUtils->GetParticleType()!=AliEMCALRecoUtils::kPhoton)
265 AliFatal(Form(
"Wrong particle type for cluster position recalculation! = %d\n",
fRecoUtils->GetParticleType()));
267 AliDebug(1,Form(
"It will use fLogWeight %.3f",
fLogWeight));
269 Float_t pos[]={0,0,0};
275 Float_t e1i = c1->E();
276 if (e1i <
fEmin)
continue;
277 else if (e1i >
fEmax)
continue;
279 else if (c1->GetNCells() <
fMinNCells)
continue;
281 else if (c1->GetM02() <
fL0min || c1->GetM02() >
fL0max)
continue;
283 if(
fRecoUtils->ClusterContainsBadChannel(
fEMCALGeo, c1->GetCellsAbsId(), c1->GetNCells()))
continue;
287 AliInfo(Form(
"Std : i %d, E %f, dispersion %f, m02 %f, m20 %f\n",c1->GetID(),c1->E(),c1->GetDispersion(),c1->GetM02(),c1->GetM20()));
288 c1->GetPosition(pos);
289 AliInfo(Form(
"Std : i %d, x %f, y %f, z %f\n",c1->GetID(), pos[0], pos[1], pos[2]));
300 AliDebug(2,Form(
"Energy: after recalibration %f",c1->E()));
306 c1->SetE(
fRecoUtils->CorrectClusterEnergyLinearity(c1));
308 AliDebug(2,Form(
"after linearity correction %f",c1->E()));
313 AliDebug(2,Form(
"after smearing %f\n",c1->E()));
317 AliInfo(Form(
"Cor : i %d, E %f, dispersion %f, m02 %f, m20 %f\n",c1->GetID(),c1->E(),c1->GetDispersion(),c1->GetM02(),c1->GetM20()));
318 c1->GetPosition(pos);
319 AliInfo(Form(
"Cor : i %d, x %f, y %f, z %f\n",c1->GetID(), pos[0], pos[1], pos[2]));
338 Bool_t shared = kFALSE;
340 Float_t pos[] = {0,0,0};
342 Int_t bc = InputEvent()->GetBunchCrossNumber();
343 Int_t nSM = (
fEMCALGeo->GetEMCGeometry())->GetNumberOfSuperModules();
350 if(
fRecoUtils->ClusterContainsBadChannel(
fEMCALGeo, c1->GetCellsAbsId(), c1->GetNCells()))
continue;
352 Float_t e1i = c1->E();
354 if (e1i <
fEmin)
continue;
355 else if (e1i >
fEmax)
continue;
359 else if (c1->GetNCells() <
fMinNCells)
continue;
361 else if (c1->GetM02() <
fL0min || c1->GetM02() >
fL0max)
continue;
365 AliInfo(Form(
"IMA : i %d, E %f, dispersion %f, m02 %f, m20 %f",c1->GetID(),e1i,c1->GetDispersion(),c1->GetM02(),c1->GetM20()));
366 c1->GetPosition(pos);
367 AliInfo(Form(
"IMA : i %d, x %f, y %f, z %f",c1->GetID(), pos[0], pos[1], pos[2]));
381 Double_t time1 = c1->GetTOF()*1.e9;
393 Float_t e2i = c2->E();
394 if (e2i <
fEmin)
continue;
395 else if (e2i >
fEmax)
continue;
399 else if (c2->GetNCells() <
fMinNCells)
continue;
401 else if (c2->GetM02() <
fL0min || c2->GetM02() >
fL0max)
continue;
416 Double_t time2 = c2->GetTOF()*1.e9;
421 if(TMath::Abs(time1-time2) >
fDTimeCut)
continue;
423 if(invmass < fMaxBin && invmass >
fMinBin )
436 if(iSupMod1==iSupMod2)
442 Bool_t zone1 =
IsInZone1(iSupMod1,ieta1,iphi1);
443 Bool_t zone2 =
IsInZone2(iSupMod1,ieta1,iphi1);
444 Bool_t zone3 =
IsInZone3(iSupMod1,ieta1,iphi1);
445 Bool_t zone4 =
IsInZone4(iSupMod1,ieta1,iphi1);
446 Bool_t zone5 =
IsInZone5(iSupMod1,ieta1,iphi1);
447 Bool_t zone6 =
IsInZone6(iSupMod1,ieta1,iphi1);
448 Bool_t zone7 =
IsInZone7(iSupMod1,ieta1,iphi1);
465 for(Int_t i = 0; i < nSM/2; i++)
468 if((iSupMod1==j && iSupMod2==j+1) || (iSupMod1==j+1 && iSupMod2==j))
476 for(Int_t i = 0; i < nSM-2; i++)
478 if((iSupMod1==i && iSupMod2==i+2) || (iSupMod1==i+2 && iSupMod2==i))
495 for(Int_t i = 0; i < nSM/2; i++)
502 for(Int_t i = 0; i < nSM-2; i++)
513 for(Int_t icell = 0; icell < c1->GetNCells(); icell++)
515 Int_t absID = c1->GetCellAbsId(icell);
519 for(Int_t icell = 0; icell < c2->GetNCells(); icell++)
521 Int_t absID = c2->GetCellAbsId(icell);
526 Float_t opangle =
fMomentum1.Angle(fMomentum2.Vect())*TMath::RadToDeg();
533 if(iSupMod1==iSupMod2)
544 if((iSupMod1==0 && iSupMod2==2) || (iSupMod1==2 && iSupMod2==0))
550 if((iSupMod1==1 && iSupMod2==3) || (iSupMod1==3 && iSupMod2==1))
556 if((iSupMod1==0 && iSupMod2==1) || (iSupMod1==1 && iSupMod2==0))
561 if((iSupMod1==2 && iSupMod2==3) || (iSupMod1==3 && iSupMod2==2))
572 if(
fSameSM && iSupMod1!=iSupMod2)
continue;
576 fHmpi0[iSupMod1][ieta1][iphi1]->Fill(invmass);
577 fHmpi0[iSupMod2][ieta2][iphi2]->Fill(invmass);
599 for (Int_t j = -fGroupNCells; j < fGroupNCells+1; j++)
601 Int_t absId11 =
fEMCALGeo->GetAbsCellIdFromCellIndexes(iSupMod1, iphi1+j, ieta1+i);
602 Int_t absId22 =
fEMCALGeo->GetAbsCellIdFromCellIndexes(iSupMod2, iphi2+j, ieta2+i);
607 for(Int_t icell = 0; icell < c1->GetNCells(); icell++)
609 if(c1->GetCellsAbsId()[icell] == absId11) ok1=kTRUE;
612 for(Int_t icell = 0; icell < c2->GetNCells(); icell++)
614 if(c2->GetCellsAbsId()[icell] == absId22) ok2=kTRUE;
617 if(ok1 && (ieta1+i >= 0) && (iphi1+j >= 0) && (ieta1+i < 48) && (iphi1+j < 24))
619 fHmpi0[iSupMod1][ieta1+i][iphi1+j]->Fill(invmass);
622 if(ok2 && (ieta2+i >= 0) && (iphi2+j >= 0) && (ieta2+i < 48) && (iphi2+j < 24))
624 fHmpi0[iSupMod2][ieta2+i][iphi2+j]->Fill(invmass);
630 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",
631 iSupMod1,iphi1,ieta1,iSupMod2,iphi2,ieta2,
fMomentum12.M(),e1i,c1->E(),e2i,c2->E()));
651 if ( !calibFactorsFile ) AliFatal(
"Cannot recover the calibration factors");
653 for(Int_t ism = 0; ism <
fEMCALGeo->GetNumberOfSuperModules(); ism++)
655 TH2F * histo = (TH2F*) calibFactorsFile->Get(Form(
"EMCALRecalFactors_SM%d",ism));
656 printf(
"In AliAnalysisTaskEMCALPi0CalibSelection::InitEnergyCalibrationFactors \n ---Recover calibration factor for : EMCALRecalFactors_SM%d %p\n",ism,histo);
659 fRecoUtils->SetEMCALChannelRecalibrationFactors(ism,histo);
661 AliWarning(Form(
"Null histogram with calibration factors for SM%d, 1 will be used for the full SM!",ism));
671 Int_t runnumber = InputEvent()->GetRunNumber() ;
694 AliInfo(
"Load user defined EMCAL geometry matrices");
696 AliOADBContainer emcGeoMat(
"AliEMCALgeo");
700 emcGeoMat.InitFromFile(Form(
"%s/EMCALlocal2master.root",
fOADBFilePath.Data()),
"AliEMCALgeo");
702 TObjArray *matEMCAL=(TObjArray*)emcGeoMat.GetObject(runnumber,
"EmcalMatrices");
704 for(Int_t mod = 0; mod < (
fEMCALGeo->GetEMCGeometry())->GetNumberOfSuperModules(); mod++)
708 AliDebug(1,Form(
"EMCAL matrices SM %d, %p",mod,((TGeoHMatrix*) matEMCAL->At(mod))));
711 fMatrix[mod] = (TGeoHMatrix*) matEMCAL->At(mod) ;
723 AliWarning(Form(
"Set matrix for SM %d from gGeoManager",mod));
724 fEMCALGeo->SetMisalMatrix(
fEMCALGeo->GetMatrixForSuperModuleFromGeoManager(mod),mod) ;
728 AliError(Form(
"Alignment matrix for SM %d is not available",mod));
732 else if(!gGeoManager)
734 AliInfo(
"Get geo matrices from data");
736 if(!strcmp(InputEvent()->GetName(),
"AliAODEvent"))
738 AliWarning(
"Use ideal geometry, values geometry matrix not kept in AODs");
742 AliDebug(1,
"AliAnalysisTaskEMCALClusterize Load Misaligned matrices");
744 for(Int_t mod=0; mod < (
fEMCALGeo->GetEMCGeometry())->GetNumberOfSuperModules(); mod++)
746 if(InputEvent()->GetEMCALMatrix(mod))
749 InputEvent()->GetEMCALMatrix(mod)->Print();
751 fEMCALGeo->SetMisalMatrix(InputEvent()->GetEMCALMatrix(mod),mod) ;
759 for(Int_t mod = 0; mod < (
fEMCALGeo->GetEMCGeometry())->GetNumberOfSuperModules(); mod++)
761 AliWarning(Form(
"Set matrix for SM %d from gGeoManager",mod));
762 fEMCALGeo->SetMisalMatrix(
fEMCALGeo->GetMatrixForSuperModuleFromGeoManager(mod),mod) ;
774 if(!
fRecoUtils->IsRunDepRecalibrationOn())
return;
776 AliOADBContainer *contRFTD=
new AliOADBContainer(
"");
778 contRFTD->InitFromFile(Form(
"%s/EMCALTemperatureCorrCalib.root",
fOADBFilePath.Data()),
"AliEMCALRunDepTempCalibCorrections");
780 Int_t runnumber = InputEvent()->GetRunNumber() ;
782 TH1S *htd=(TH1S*)contRFTD->GetObject(runnumber);
787 AliWarning(Form(
"No TemperatureCorrCalib Objects for run: %d",runnumber));
792 Int_t maxEntry = contRFTD->GetNumberOfEntries();
794 while ( (ic < maxEntry) && (contRFTD->UpperLimit(ic) < runnumber) )
800 Int_t closest = lower;
801 if ( (ic<maxEntry) &&
802 (contRFTD->LowerLimit(ic)-runnumber) < (runnumber - contRFTD->UpperLimit(lower)) )
807 AliWarning(Form(
"TemperatureCorrCalib Objects found closest id %d from run: %d",
808 closest, contRFTD->LowerLimit(closest)));
810 htd = (TH1S*) contRFTD->GetObjectByIndex(closest);
816 AliInfo(
"Recalibrate (Temperature) EMCAL");
818 Int_t nSM =
fEMCALGeo->GetNumberOfSuperModules();
820 for (Int_t ism = 0; ism < nSM; ++ism)
822 for (Int_t icol = 0; icol < 48; ++icol)
824 for (Int_t irow = 0; irow < 24; ++irow)
826 Float_t factor =
fRecoUtils->GetEMCALChannelRecalibrationFactor(ism,icol,irow);
828 Int_t absID =
fEMCALGeo->GetAbsCellIdFromCellIndexes(ism, irow, icol);
830 AliDebug(3,Form(
" ism %d, icol %d, irow %d,absID %d - Calib factor %1.5f - ",ism, icol, irow, absID, factor));
832 factor *= htd->GetBinContent(absID) / 10000. ;
834 fRecoUtils->SetEMCALChannelRecalibrationFactor(ism,icol,irow,factor);
836 AliDebug(3,Form(
"T factor %1.5f - final factor %1.5f",
837 htd->GetBinContent(absID) / 10000.,
838 fRecoUtils->GetEMCALChannelRecalibrationFactor(ism,icol,irow)));
843 else AliInfo(
"Do NOT recalibrate EMCAL with T variations, no params TH1");
855 Int_t nSM = (
fEMCALGeo->GetEMCGeometry())->GetNumberOfSuperModules();
858 const Int_t buffersize = 255;
859 char hname[buffersize], htitl[buffersize];
861 fhNEvents =
new TH1I(
"hNEvents",
"Number of analyzed events" , 1 , 0 , 1 ) ;
865 fHmgg->SetXTitle(
"m_{#gamma #gamma} (MeV/c^{2})");
866 fHmgg->SetYTitle(
"p_{T #gamma #gamma} (GeV/c)");
874 fHOpeningAngle =
new TH2F(
"hopang",
"2-cluster opening angle",100,0.,50.,100,0,10);
884 fHAsymmetry =
new TH2F(
"hasym",
"2-cluster opening angle",100,0.,1.,100,0,10);
886 fHAsymmetry->SetYTitle(
"p_{T #gamma #gamma} (GeV/c)");
889 fHAsymmetryDifferentSM =
new TH2F(
"hasymDifferentSM",
"2-cluster opening angle, different SM",100,0,1.,100,0,10);
907 for(Int_t iSM = 0; iSM < nSM; iSM++)
909 snprintf(hname, buffersize,
"hmgg_SM%d",iSM);
910 snprintf(htitl, buffersize,
"Two-gamma inv. mass for super mod %d",iSM);
912 fHmggSM[iSM]->SetXTitle(
"m_{#gamma #gamma} (MeV/c^{2})");
913 fHmggSM[iSM]->SetYTitle(
"p_{T #gamma #gamma} (GeV/c)");
916 snprintf(hname, buffersize,
"hmgg_SM%d_MaskFrame",iSM);
917 snprintf(htitl, buffersize,
"Two-gamma inv. mass for super mod %d",iSM);
923 snprintf(hname, buffersize,
"hmgg_SM%d_Zone1",iSM);
924 snprintf(htitl, buffersize,
"Two-gamma inv. mass for super mod %d in zone 1",iSM);
926 fHmggSM_Zone1[iSM]->SetXTitle(
"m_{#gamma #gamma} (MeV/c^{2})");
927 fHmggSM_Zone1[iSM]->SetYTitle(
"p_{T #gamma #gamma} (GeV/c)");
930 snprintf(hname, buffersize,
"hmgg_SM%d_Zone2",iSM);
931 snprintf(htitl, buffersize,
"Two-gamma inv. mass for super mod %d in zone 2",iSM);
933 fHmggSM_Zone2[iSM]->SetXTitle(
"m_{#gamma #gamma} (MeV/c^{2})");
934 fHmggSM_Zone2[iSM]->SetYTitle(
"p_{T #gamma #gamma} (GeV/c)");
937 snprintf(hname, buffersize,
"hmgg_SM%d_Zone3",iSM);
938 snprintf(htitl, buffersize,
"Two-gamma inv. mass for super mod %d in zone 3",iSM);
940 fHmggSM_Zone3[iSM]->SetXTitle(
"m_{#gamma #gamma} (MeV/c^{2})");
941 fHmggSM_Zone3[iSM]->SetYTitle(
"p_{T #gamma #gamma} (GeV/c)");
944 snprintf(hname, buffersize,
"hmgg_SM%d_Zone4",iSM);
945 snprintf(htitl, buffersize,
"Two-gamma inv. mass for super mod %d in zone 4",iSM);
947 fHmggSM_Zone4[iSM]->SetXTitle(
"m_{#gamma #gamma} (MeV/c^{2})");
948 fHmggSM_Zone4[iSM]->SetYTitle(
"p_{T #gamma #gamma} (GeV/c)");
951 snprintf(hname, buffersize,
"hmgg_SM%d_Zone5",iSM);
952 snprintf(htitl, buffersize,
"Two-gamma inv. mass for super mod %d in zone 5",iSM);
954 fHmggSM_Zone5[iSM]->SetXTitle(
"m_{#gamma #gamma} (MeV/c^{2})");
955 fHmggSM_Zone5[iSM]->SetYTitle(
"p_{T #gamma #gamma} (GeV/c)");
958 snprintf(hname, buffersize,
"hmgg_SM%d_Zone6",iSM);
959 snprintf(htitl, buffersize,
"Two-gamma inv. mass for super mod %d in zone 6",iSM);
961 fHmggSM_Zone6[iSM]->SetXTitle(
"m_{#gamma #gamma} (MeV/c^{2})");
962 fHmggSM_Zone6[iSM]->SetYTitle(
"p_{T #gamma #gamma} (GeV/c)");
965 snprintf(hname, buffersize,
"hmgg_SM%d_Zone7",iSM);
966 snprintf(htitl, buffersize,
"Two-gamma inv. mass for super mod %d in zone 7",iSM);
968 fHmggSM_Zone7[iSM]->SetXTitle(
"m_{#gamma #gamma} (MeV/c^{2})");
969 fHmggSM_Zone7[iSM]->SetYTitle(
"p_{T #gamma #gamma} (GeV/c)");
974 snprintf(hname,buffersize,
"hmgg_PairSameSectorSM%d",iSM);
975 snprintf(htitl,buffersize,
"Two-gamma inv. mass for SM pair Sector: %d",iSM);
981 snprintf(hname,buffersize,
"hmgg_PairSameSectorSM%d_MaskFrame",iSM);
982 snprintf(htitl,buffersize,
"Two-gamma inv. mass for SM pair Sector: %d",iSM);
989 Form(
"cluster pair time difference vs E, Sector %d",iSM),
990 100,0,10, 200,-100,100);
998 snprintf(hname,buffersize,
"hmgg_PairSameSideSM%d",iSM);
999 snprintf(htitl,buffersize,
"Two-gamma inv. mass for SM pair Sector: %d",iSM);
1005 snprintf(hname,buffersize,
"hmgg_PairSameSideSM%d_MaskFrame",iSM);
1006 snprintf(htitl,buffersize,
"Two-gamma inv. mass for SM pair Sector: %d",iSM);
1013 Form(
"cluster pair time difference vs E, Side %d",iSM),
1014 100,0,10, 200,-100,100);
1020 snprintf(hname, buffersize,
"hopang_SM%d",iSM);
1021 snprintf(htitl, buffersize,
"Opening angle for super mod %d",iSM);
1027 snprintf(hname,buffersize,
"hopang_PairSM%d",iSM);
1028 snprintf(htitl,buffersize,
"Opening angle for SM pair: %d",iSM);
1034 snprintf(hname, buffersize,
"hasym_SM%d",iSM);
1035 snprintf(htitl, buffersize,
"Asymmetry for super mod %d",iSM);
1036 fHAsymmetrySM[iSM] =
new TH2F(hname,htitl,100,0.,1.,100,0,10);
1038 fHAsymmetrySM[iSM]->SetYTitle(
"p_{T #gamma #gamma} (GeV/c)");
1041 snprintf(hname,buffersize,
"hasym_PairSM%d",iSM);
1042 snprintf(htitl,buffersize,
"Asymmetry for SM pair: %d",iSM);
1052 Form(
"Entries in grid of cells in Module %d",iSM),
1053 colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
1059 Form(
"Accumulated energy in grid of cells in Module %d",iSM),
1060 colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
1066 Form(
"Accumulated asymmetry in grid of cells in Module %d",iSM),
1067 colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
1072 fhTowerDecayPhotonHitMaskFrame[iSM] =
new TH2F (Form(
"hTowerDecPhotonHit_Mod%d_MaskFrame",iSM),Form(
"Entries in grid of cells in Module %d",iSM),
1073 colmax+2,-1.5,colmax+0.5, rowmax+2,-1.5,rowmax+0.5);
1078 fhClusterTimeSM[iSM] =
new TH2F(Form(
"hClusterTime_SM%d",iSM),
"cluster time vs E",100,0,10, 100,0,1000);
1084 Form(
"cluster pair time difference vs E, SM %d",iSM),
1085 100,0,10, 200,-100,100);
1091 Int_t nchannels = nSM*AliEMCALGeoParams::fgkEMCALRows*AliEMCALGeoParams::fgkEMCALCols;
1092 for(Int_t ibc = 0; ibc < 4; ibc++)
1094 fHTpi0[ibc] =
new TH2F(Form(
"hTime_BC%d",ibc),Form(
"Time of cell clusters under pi0 peak, bunch crossing %d",ibc),
1097 fHTpi0[ibc]->SetYTitle(
"time (ns)");
1098 fHTpi0[ibc]->SetXTitle(
"abs. Id. ");
1101 fhClusterTime =
new TH2F(
"hClusterTime",
"cluster time vs E",100,0,10, 100,0,1000);
1106 fhClusterPairDiffTime =
new TH2F(
"hClusterPairDiffTime",
"cluster pair time difference vs E",100,0,10, 800,-400,400);
1111 for(Int_t iMod=0; iMod < nSM; iMod++)
1113 for(Int_t iRow=0; iRow < AliEMCALGeoParams::fgkEMCALRows; iRow++)
1115 for(Int_t iCol=0; iCol < AliEMCALGeoParams::fgkEMCALCols; iCol++)
1117 snprintf(hname,buffersize,
"%d_%d_%d",iMod,iCol,iRow);
1118 snprintf(htitl,buffersize,
"Two-gamma inv. mass for super mod %d, cell(col,row)=(%d,%d)",iMod,iCol,iRow);
1120 fHmpi0[iMod][iCol][iRow]->SetXTitle(
"mass (MeV/c^{2})");
1182 if((irow >= 2 && irow <= 21) && ((icol >= 42 && icol <= 46) || (icol >= 13 && icol <= 37) || (icol >= 1 && icol <= 9)))
1184 if((irow >= 2 && irow <= 3) || (irow >= 20 && irow <= 21))
1193 if((irow >= 2 && irow <= 21) && ((icol >= 1 && icol <= 5) || (icol >= 10 && icol <= 34) || (icol >= 38 && icol <= 46)))
1195 if((irow >= 2 && irow <= 3) || (irow >= 20 && irow <= 21))
1227 if((irow >= 2 && irow <= 21) && ((icol >= 42 && icol <= 46) || (icol >= 13 && icol <= 37) || (icol >= 1 && icol <= 9)))
1229 if((irow >= 2 && irow <= 3) || (irow >= 20 && irow <= 21))
1242 if((irow >= 2 && irow <= 21) && ((icol >= 1 && icol <= 5) || (icol >= 10 && icol <= 34) || (icol >= 38 && icol <= 46)))
1244 if((irow >= 2 && irow <= 3) || (irow >= 20 && irow <= 21))
1280 if((irow >= 2 && irow <= 21) && ((icol >= 42 && icol <= 46) || (icol >= 13 && icol <= 37) || (icol >= 1 && icol <= 9)))
1282 if((icol >= 1 && icol <= 3) || (icol >= 44 && icol <= 46))
1291 if((irow >= 2 && irow <= 21) && ((icol >= 1 && icol <= 5) || (icol >= 10 && icol <= 34) || (icol >= 38 && icol <= 46)))
1293 if((icol >= 1 && icol <= 3) || (icol >= 44 && icol <= 46))
1325 if((irow >= 2 && irow <= 21) && ((icol >= 42 && icol <= 46) || (icol >= 13 && icol <= 37) || (icol >= 1 && icol <= 9)))
1327 if((icol >= 1 && icol <= 3) || (icol >= 44 && icol <= 46))
1340 if((irow >= 2 && irow <= 21) && ((icol >= 1 && icol <= 5) || (icol >= 10 && icol <= 34) || (icol >= 38 && icol <= 46)))
1342 if((icol >= 1 && icol <= 3) || (icol >= 44 && icol <= 46))
1374 Float_t col0 = 47/2;
1375 Float_t row0 = 23/2;
1381 if(((icol-col0)*(icol-col0)) / (a*a) + ((irow-row0)*(irow-row0) / (b*b)) > 1)
1408 Float_t col0 = 47/2;
1409 Float_t row0 = 23/2;
1412 Float_t aLarge = 3-col0;
1413 Float_t bLarge = 2-row0;
1414 Float_t aSmall = 16-col0;
1415 Float_t bSmall = 7-row0;
1417 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))
1444 Float_t col0 = 47/2;
1445 Float_t row0 = 23/2;
1448 Float_t a = 16-col0;
1451 if(((icol-col0)*(icol-col0)) / (a*a) + ((irow-row0)*(irow-row0) / (b*b)) < 1)
1475 AliESDEvent* esdevent =
dynamic_cast<AliESDEvent*
> (InputEvent());
1476 AliAODEvent* aodevent =
dynamic_cast<AliAODEvent*
> (InputEvent());
1478 TString triggerClass =
"";
1479 if (esdevent) triggerClass = esdevent->GetFiredTriggerClasses();
1480 else if(aodevent) triggerClass = aodevent->GetFiredTriggerClasses();
1482 AliDebug(1,Form(
"Event %d, FiredClass %s",
1483 (Int_t)Entry(),(((AliESDEvent*)InputEvent())->GetFiredTriggerClasses()).
Data()));
1487 AliDebug(1,
"Reject event!");
1491 AliDebug(1,
"Accept event!");
1496 AliVEvent*
event = 0;
1498 else event = InputEvent();
1502 AliWarning(
"Input event not available!");
1506 AliDebug(1,Form(
"<<< %s: Event %d >>>",event->GetName(), (Int_t)Entry()));
1510 event->GetPrimaryVertex()->GetXYZ(
fVertex) ;
1553 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",
1558 printf(
"Cluster maximal cell away from border at least %d cells\n",
fRecoUtils->GetNumberOfCellsFromEMCALBorder()) ;
1562 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",
1570 if(
fLoadMatrices) {
for(Int_t ism = 0; ism < AliEMCALGeoParams::fgkEMCALModules; ism++)
if(
fMatrix[ism])
fMatrix[ism]->Print() ; }
1597 else AliWarning(
"Mask column not set, position larger than allocated set size first") ;
1605 AliDebug(1,
"Not implemented");
Float_t fTimeMin
Minimum cluster time (ns).
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).
ClassImp(AliAnalysisTaskTriggerRates) AliAnalysisTaskTriggerRates
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)
TH2F * fHmggSM_Zone3[AliEMCALGeoParams::fgkEMCALModules]
! Two-cluster invariant mass per SM in zone 3.
Int_t fNTimeBins
N time bins of invariant mass histograms.
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.
Bool_t IsInZone4(Int_t iSupMod, Int_t ieta, Int_t iphi)
TString fImportGeometryFilePath
Path fo geometry.root file.
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).
AliEMCALRecoUtils * fRecoUtils
Access to reconstruction utilities.
AliEMCALGeometry * fEMCALGeo
! EMCAL geometry pointer.
Float_t fMaxTimeBin
Maximum time bins of invariant mass histograms.
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...
Float_t fMinTimeBin
Minimum time bins of invariant mass histograms.
Int_t fNMaskCellColumns
Number of masked columns.
Bool_t IsInZone5(Int_t iSupMod, Int_t ieta, Int_t iphi)
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.
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.
Float_t fInvMassCutMin
Minimum mass cut for clusters to fill time or other 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.
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.
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 * 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.
AliAnalysisTaskEMCALPi0CalibSelection()
Default constructor. Arrays initialization is done here.
Float_t fMinBin
Minimum mass bins of invariant mass histograms.
Bool_t fRecalPosition
Switch on/off cluster position calculation, in case alignment matrices are not available.
TString fTriggerName
Trigger name must contain this name.
TH2F * fHmggDifferentSMMaskFrame
! Two-cluster invariant mass vs pt of pair, each cluster in different SM,mask clusters facing frames...
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.
TH2F * fhClusterTime
! Timing of clusters vs energy.
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 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 PrintInfo()
Print settings.
TH2F * fHmggPairSameSideSM[AliEMCALGeoParams::fgkEMCALModules-2]
! Two-cluster invariant mass per Pair.
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.
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.
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.
TH2F * fHmggSM_Zone7[AliEMCALGeoParams::fgkEMCALModules]
! Two-cluster invariant mass per SM in zone 7.
TH2F * fHmggPairSameSectorSM[AliEMCALGeoParams::fgkEMCALModules/2]
! Two-cluster invariant mass per Pair.