25 #include "AliKFVertex.h" 26 #include "AliAODTrack.h" 28 #include "AliAODEvent.h" 29 #include "AliESDtrack.h" 30 #include "AliAnalysisManager.h" 31 #include "AliInputEventHandler.h" 32 #include "AliMCEventHandler.h" 33 #include "AliAODHandler.h" 34 #include "AliPIDResponse.h" 39 #include "AliMCEvent.h" 41 #include "TObjString.h" 42 #include "AliAODEvent.h" 43 #include "AliESDEvent.h" 44 #include "AliCentrality.h" 48 #include "AliGenCocktailEventHeader.h" 49 #include "AliGenDPMjetEventHeader.h" 50 #include "AliGenPythiaEventHeader.h" 51 #include "AliGenHijingEventHeader.h" 52 #include "AliTriggerAnalysis.h" 54 #include "AliAODMCParticle.h" 55 #include "AliAODMCHeader.h" 56 #include "AliTRDTriggerAnalysis.h" 78 "piMaxMomdedxSigmaCut",
79 "LowPRejectionSigmaCut",
86 "DoPhotonAsymmetryCut",
87 "CosinePointingAngle",
98 AliAnalysisCuts(name,title),
101 fDoLightOutput(kFALSE),
102 fV0ReaderName(
"V0ReaderV1"),
107 fEtaForPhiCutMin(-10.),
108 fEtaForPhiCutMax(10.),
111 fDoShrinkTPCAcceptance(kFALSE),
115 fDoAsymPtCut(kFALSE),
121 fLineCutZRSlopeMin(0.),
122 fLineCutZValueMin(0),
123 fChi2CutConversion(1000),
124 fPIDProbabilityCutNegativeParticle(0),
125 fPIDProbabilityCutPositiveParticle(0),
126 fDodEdxSigmaCut(kTRUE),
127 fDoTOFsigmaCut(kFALSE),
128 fPIDTRDEfficiency(1),
130 fPIDnSigmaAboveElectronLine(100),
131 fPIDnSigmaBelowElectronLine(-100),
132 fTofPIDnSigmaAboveElectronLine(100),
133 fTofPIDnSigmaBelowElectronLine(-100),
134 fPIDnSigmaAbovePionLine(0),
135 fPIDnSigmaAbovePionLineHighPt(-100),
136 fPIDMinPnSigmaAbovePionLine(0),
137 fPIDMaxPnSigmaAbovePionLine(0),
138 fDoKaonRejectionLowP(kFALSE),
139 fDoProtonRejectionLowP(kFALSE),
140 fDoPionRejectionLowP(kFALSE),
141 fPIDnSigmaAtLowPAroundKaonLine(0),
142 fPIDnSigmaAtLowPAroundProtonLine(0),
143 fPIDnSigmaAtLowPAroundPionLine(0),
144 fPIDMinPKaonRejectionLowP(1.5),
145 fPIDMinPProtonRejectionLowP(2),
146 fPIDMinPPionRejectionLowP(0),
147 fDoQtGammaSelection(kTRUE),
151 fUseEtaMinCut(kFALSE),
152 fUseOnFlyV0Finder(kTRUE),
153 fUseOnFlyV0FinderSameSign(0),
154 fDoPhotonAsymmetryCut(kTRUE),
155 fDoPhotonPDependentAsymCut(kFALSE),
157 fMinPPhotonAsymmetryCut(100.),
158 fMinPhotonAsymmetry(0.),
159 fUseCorrectedTPCClsInfo(kFALSE),
161 fOpeningAngle(0.005),
163 fDo2DPsiPairChi2(kFALSE),
164 fIncludeRejectedPsiPair(kFALSE),
165 fCosPAngleCut(10000),
166 fDoToCloseV0sCut(kFALSE),
168 fDoSharedElecCut(kFALSE),
169 fDoPhotonQualitySelectionCut(kFALSE),
170 fPhotonQualityCut(0),
172 fElectronArraySize(500),
173 fElectronLabelArray(NULL),
174 fDCAZPrimVtxCut(1000),
175 fDCARPrimVtxCut(1000),
176 fInPlaneOutOfPlane(0),
177 fConversionPointXArray(0.0),
178 fConversionPointYArray(0.0),
179 fConversionPointZArray(0.0),
184 fITSPIDnSigmaAboveElectronLine(100),
185 fITSPIDnSigmaBelowElectronLine(-100),
187 fTRDPIDAboveCut(100),
188 fTRDPIDBelowCut(-100),
189 fDoDoubleCountingCut(kFALSE),
193 fSwitchToKappa(kFALSE),
196 fDoElecDeDxPostCalibration(kFALSE),
197 fHistoEtaDistV0s(NULL),
198 fHistoEtaDistV0sAfterdEdxCuts(NULL),
199 fHistodEdxCuts(NULL),
200 fHistoTPCdEdxbefore(NULL),
201 fHistoTPCdEdxafter(NULL),
202 fHistoTPCdEdxSigbefore(NULL),
203 fHistoTPCdEdxSigafter(NULL),
204 fHistoKappaafter(NULL),
205 fHistoTOFbefore(NULL),
206 fHistoTOFSigbefore(NULL),
207 fHistoTOFSigafter(NULL),
208 fHistoITSSigbefore(NULL),
209 fHistoITSSigafter(NULL),
210 fHistoPsiPairDeltaPhiafter(NULL),
211 fHistoTrackCuts(NULL),
212 fHistoPhotonCuts(NULL),
213 fHistoInvMassbefore(NULL),
214 fHistoArmenterosbefore(NULL),
215 fHistoInvMassafter(NULL),
216 fHistoArmenterosafter(NULL),
217 fHistoAsymmetrybefore(NULL),
218 fHistoAsymmetryafter(NULL),
219 fHistoAcceptanceCuts(NULL),
220 fHistoCutIndex(NULL),
221 fHistoEventPlanePhi(NULL),
223 fProcessAODCheck(kFALSE),
224 fMaterialBudgetWeightsInitialized(kFALSE),
225 fProfileContainingMaterialBudgetWeights(NULL),
226 fElecDeDxPostCalibrationInitialized(kFALSE),
228 fHistoEleMapMean(NULL),
229 fHistoEleMapWidth(NULL),
230 fHistoPosMapMean(NULL),
231 fHistoPosMapWidth(NULL)
254 AliAnalysisCuts(ref),
455 TH1::AddDirectory(kFALSE);
585 TAxis *AxisBeforedEdx = NULL;
586 TAxis *AxisBeforedEdxSig = NULL;
587 TAxis *AxisBeforeTOF = NULL;
588 TAxis *AxisBeforeTOFSig = NULL;
589 TAxis *AxisBeforeITSSig = NULL;
590 TAxis *AxisBeforeAsymmetry = NULL;
636 Int_t bins = AxisAfter->GetNbins();
637 Double_t from = AxisAfter->GetXmin();
641 Double_t factor = TMath::Power(to/from, 1./bins);
642 for(
Int_t i=1; i<=bins; ++i) newBins[i] = factor * newBins[i-1];
643 AxisAfter->Set(bins, newBins);
645 AxisAfter->Set(bins, newBins);
647 AxisAfter->Set(bins, newBins);
649 AxisAfter->Set(bins, newBins);
651 AxisAfter->Set(bins, newBins);
654 AxisAfter->Set(bins, newBins);
657 AxisBeforedEdx->Set(bins, newBins);
658 AxisBeforeTOF->Set(bins, newBins);
659 AxisBeforedEdxSig->Set(bins, newBins);
660 AxisBeforeTOFSig->Set(bins, newBins);
661 AxisBeforeITSSig->Set(bins, newBins);
662 AxisBeforeAsymmetry->Set(bins, newBins);
673 TH1::AddDirectory(kTRUE);
682 AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
683 fPIDResponse = (AliPIDResponse*)inputHandler->GetPIDResponse();
694 AliInfo(
"Entering loading of correction map for post calibration");
696 TFile *
file = TFile::Open(filename.Data());
698 AliError(Form(
"file for electron dEdx post calibration %s not found",filename.Data()));
701 AliInfo(Form(
"found %s ",filename.Data()));
714 AliError(
"Histograms for dedx post calibration not found not found");
745 cout<<
" histograms are null..., going out"<< endl;
754 if( R > 0. && R < 33.5){
762 }
else if( R >= 30.5 && R < 72.){
770 }
else if( R >= 72. && R < 145.){
778 }
else if( R >= 145. && R < 180.){
796 cout<<
" histograms are null..., going out"<< endl;
803 if( R > 0. && R < 33.5){
811 }
else if( R >= 33.5 && R < 72.){
819 }
else if( R >= 72. && R < 145.){
827 }
else if( R >= 145. && R < 180.){
841 CornSig = (nsig - mean) / width;
849 if(!mcEvent)
return kFALSE;
851 if (particle->GetPdgCode() == 22){
861 if(particle->GetMother(0) >-1 && mcEvent->Particle(particle->GetMother(0))->GetPdgCode() == 22){
870 if(!checkForConvertedGamma)
return kTRUE;
873 TParticle* ePos = NULL;
874 TParticle* eNeg = NULL;
876 if(particle->GetNDaughters() >= 2){
877 for(
Int_t daughterIndex=particle->GetFirstDaughter();daughterIndex<=particle->GetLastDaughter();daughterIndex++){
878 if(daughterIndex<0)
continue;
879 TParticle *tmpDaughter = mcEvent->Particle(daughterIndex);
880 if(tmpDaughter->GetUniqueID() == 5){
881 if(tmpDaughter->GetPdgCode() == 11){
883 }
else if(tmpDaughter->GetPdgCode() == -11){
890 if(ePos == NULL || eNeg == NULL){
908 if(TMath::Abs(ePos->Vz()) >
fMaxZ){
911 if(TMath::Abs(eNeg->Vz()) >
fMaxZ){
936 if(!aodmcArray)
return kFALSE;
938 if (particle->GetPdgCode() == 22){
946 if(particle->GetMother() > -1 && (
static_cast<AliAODMCParticle*
>(aodmcArray->At(particle->GetMother())))->GetPdgCode() == 22){
950 if(!checkForConvertedGamma)
return kTRUE;
953 AliAODMCParticle* ePos = NULL;
954 AliAODMCParticle* eNeg = NULL;
956 if(particle->GetNDaughters() >= 2){
957 for(
Int_t daughterIndex=particle->GetDaughter(0);daughterIndex<=particle->GetDaughter(1);daughterIndex++){
958 AliAODMCParticle *tmpDaughter =
static_cast<AliAODMCParticle*
>(aodmcArray->At(daughterIndex));
959 if(!tmpDaughter)
continue;
960 if(((tmpDaughter->GetMCProcessCode())) == 5){
961 if(tmpDaughter->GetPdgCode() == 11){
963 }
else if(tmpDaughter->GetPdgCode() == -11){
970 if(ePos == NULL || eNeg == NULL){
984 Double_t rPos = sqrt( (ePos->Xv()*ePos->Xv()) + (ePos->Yv()*ePos->Yv()) );
985 Double_t rNeg = sqrt( (eNeg->Xv()*eNeg->Xv()) + (eNeg->Yv()*eNeg->Yv()) );
990 if(TMath::Abs(ePos->Zv()) >
fMaxZ){
993 if(TMath::Abs(eNeg->Zv()) >
fMaxZ){
1077 Double_t magField =
event->GetMagneticField();
1078 if( magField < 0.0 ){
1084 Double_t deltaPhi = magField * TVector2::Phi_mpi_pi( electronCandidate->Phi()-positronCandidate->Phi());
1120 UChar_t photonQuality = 0;
1153 if(!negTrack||!posTrack)
return kFALSE;
1158 if(negTrack->GetTPCNclsF()!=0){
1159 negclsToF = (
Double_t)negTrack->GetNcls(1)/(
Double_t)negTrack->GetTPCNclsF();}
1167 if(posTrack->GetTPCNclsF()!=0){
1168 posclsToF = (
Double_t)posTrack->GetNcls(1)/(
Double_t)posTrack->GetTPCNclsF();
1187 if(event->IsA()==AliESDEvent::Class()) {
1198 if(!negTrack || !posTrack) {
1208 Int_t v0PosID = posTrack->GetID();
1209 Int_t v0NegID = negTrack->GetID();
1210 AliAODv0* v0 = NULL;
1211 for(
Int_t iV=0; iV<aodEvent->GetNumberOfV0s(); iV++){
1212 v0 = aodEvent->GetV0(iV);
1214 if( (v0PosID == v0->GetPosID() && v0NegID == v0->GetNegID()) || (v0PosID == v0->GetNegID() && v0NegID == v0->GetPosID()) ){
1353 if( !negTrack->IsOn(AliESDtrack::kTPCrefit) || !posTrack->IsOn(AliESDtrack::kTPCrefit) ) {
1359 AliAODVertex * NegVtxType=negTrack->GetProdVertex();
1360 AliAODVertex * PosVtxType=posTrack->GetProdVertex();
1361 if( (NegVtxType->GetType())==AliAODVertex::kKink || (PosVtxType->GetType())==AliAODVertex::kKink) {
1374 if( !negTrack->IsOn(AliESDtrack::kTPCrefit) || !posTrack->IsOn(AliESDtrack::kTPCrefit) ) {
1380 if(negTrack->GetKinkIndex(0) > 0 || posTrack->GetKinkIndex(0) > 0 ) {
1399 if(negTrack->Charge() == posTrack->Charge()) {
1404 if(negTrack->Charge() != posTrack->Charge()) {
1421 if( posTrack->Eta() > (
fEtaCut) || posTrack->Eta() < (-
fEtaCut) ||
1452 if(negTrack->IsA()==AliAODTrack::Class()) {
1453 passCuts = passCuts *
SpecificTrackCuts(static_cast<AliAODTrack*>(negTrack), static_cast<AliAODTrack*>(posTrack),cutIndex);
1455 passCuts = passCuts *
SpecificTrackCuts(static_cast<AliESDtrack*>(negTrack), static_cast<AliESDtrack*>(posTrack),cutIndex);
1473 if(!
fPIDResponse){AliError(
"No PID Response");
return kTRUE;}
1483 Float_t KappaPlus, KappaMinus, Kappa;
1485 CentrnSig[0]=
fPIDResponse->NumberOfSigmasTPC(negTrack,AliPID::kElectron);
1486 CentrnSig[1]=
fPIDResponse->NumberOfSigmasTPC(posTrack,AliPID::kElectron);
1487 P[0] =negTrack->P();
1488 P[1] =posTrack->P();
1489 Eta[0] =negTrack->Eta();
1490 Eta[1] =posTrack->Eta();
1495 KappaMinus =
fPIDResponse->NumberOfSigmasTPC(negTrack, AliPID::kElectron);
1496 KappaPlus =
fPIDResponse->NumberOfSigmasTPC(posTrack, AliPID::kElectron);
1498 Kappa = ( TMath::Abs(KappaMinus) + TMath::Abs(KappaPlus) ) / 2.0 + 2.0*(KappaMinus+KappaPlus);
1511 if(!
fPIDResponse){AliError(
"No PID Response");
return kTRUE;}
1513 Short_t Charge = fCurrentTrack->Charge();
1521 P = fCurrentTrack->P();
1522 Eta = fCurrentTrack->Eta();
1632 if((fCurrentTrack->GetStatus() & AliESDtrack::kTOFpid ) && !(fCurrentTrack->GetStatus() & AliESDtrack::kTOFmismatch)){
1636 fCurrentTrack->GetIntegratedTimes(times,AliPID::kSPECIESC);
1637 Double_t TOFsignal = fCurrentTrack->GetTOFsignal();
1638 Double_t dT = TOFsignal - t0 - times[0];
1653 if((fCurrentTrack->GetStatus() & AliESDtrack::kITSpid)){
1703 for(
Int_t ii=0;ii<2;ii++){
1710 trackNegAsy= track->P()/photon->
GetPhotonP();
1721 trackNegAsy= track->P()/photon->
GetPhotonP();
1742 if(label > event->GetNumberOfTracks() )
return NULL;
1743 AliESDtrack * track = esdEvent->GetTrack(label);
1747 if(label == -999999)
return NULL;
1748 AliVTrack * track = 0x0;
1750 if(event->GetTrack(label)) track = dynamic_cast<AliVTrack*>(event->GetTrack(label));
1754 for(
Int_t ii=0; ii<
event->GetNumberOfTracks(); ii++) {
1755 if(event->GetTrack(ii)) track = dynamic_cast<AliVTrack*>(event->GetTrack(ii));
1757 if(track->GetID() == label) {
1775 if(label > event->GetNumberOfTracks() )
return NULL;
1776 AliESDtrack * track =
event->GetTrack(label);
1801 if(negProbArray && posProbArray){
1803 negTrack->GetTPCpid(negProbArray);
1804 posTrack->GetTPCpid(posProbArray);
1811 delete [] posProbArray;
1812 delete [] negProbArray;
1827 if(particle->R()>
fMaxR){
1830 if(ePos->R()>
fMaxR){
1834 if(ePos->R()<
fMinR){
1845 if(TMath::Abs(eNeg->Vz()) >
fMaxZ ){
1849 if(eNeg->Vz()!=ePos->Vz()||eNeg->R()!=ePos->R()){
1853 if(TMath::Abs(ePos->Vz()) >
fMaxZ ){
1858 if( particle->Eta() > (
fEtaCut) || particle->Eta() < (-
fEtaCut) ){
1889 if(particle->Pt()<
fPtCut){
1913 AliInfo(Form(
"Set Photoncut Number: %s",analysisCutSelection.Data()));
1914 if(analysisCutSelection.Length()!=
kNCuts) {
1915 AliError(Form(
"Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(),
kNCuts));
1918 if(!analysisCutSelection.IsAlnum()){
1919 AliError(
"Cut selection is not alphanumeric");
1923 TString analysisCutSelectionLowerCase = Form(
"%s",analysisCutSelection.Data());
1924 analysisCutSelectionLowerCase.ToLower();
1925 const char *cutSelection = analysisCutSelectionLowerCase.Data();
1926 #define ASSIGNARRAY(i) fCuts[i] = ((int)cutSelection[i]>=(int)'a') ? cutSelection[i]-'a'+10 : cutSelection[i]-'0' 1951 }
else return kFALSE;
1958 }
else return kFALSE;
1965 }
else return kFALSE;
1972 }
else return kFALSE;
1978 }
else return kFALSE;
1984 }
else return kFALSE;
1991 }
else return kFALSE;
1998 }
else return kFALSE;
2006 }
else return kFALSE;
2012 }
else return kFALSE;
2020 }
else return kFALSE;
2031 }
else return kFALSE;
2042 }
else return kFALSE;
2053 }
else return kFALSE;
2063 }
else return kFALSE;
2070 }
else return kFALSE;
2078 }
else return kFALSE;
2085 }
else return kFALSE;
2092 }
else return kFALSE;
2099 }
else return kFALSE;
2106 }
else return kFALSE;
2113 }
else return kFALSE;
2120 }
else return kFALSE;
2127 }
else return kFALSE;
2134 }
else return kFALSE;
2141 }
else return kFALSE;
2148 }
else return kFALSE;
2151 AliError(
"Cut id out of range");
2155 AliError(
"Cut id %d not recognized");
2168 printf(
"\nConversion cutnumber \n");
2170 printf(
"%d",
fCuts[ic]);
2173 printf(
"Electron cuts & Secondary Track Cuts - only track from secondaries enter analysis: \n");
2174 printf(
"\t no like sign pairs from V0s \n");
2177 else printf(
"\t eta_{e} < %3.2f\n",
fEtaCut );
2183 printf(
"\t TPC refit \n");
2184 printf(
"\t no kinks \n");
2198 printf(
"Photon cuts: \n");
2200 else printf(
"\t using Offline V0 finder \n");
2202 printf(
"\t 2 dimensional q_{T} cut applied with maximum of %3.2f \n",
fQtMax );
2204 printf(
"\t 1 dimensional q_{T} cut applied with maximum of %3.2f \n",
fQtMax );
2207 printf(
"\t 2 dimensional triangle chi^{2} and psi_{pair} cut applied with maximum of chi^{2} = %3.2f and |psi_{pair}| = %3.2f \n",
fChi2CutConversion,
fPsiPairCut );
2210 printf(
"\t psi_{pair} max cut |psi_{pair}| < %3.2f \n",
fPsiPairCut );
2212 printf(
"\t %3.2f < R_{conv} < %3.2f\n",
fMinR,
fMaxR );
2213 printf(
"\t Z_{conv} < %3.2f\n",
fMaxZ );
2215 else printf(
"\t eta_{conv} < %3.2f\n",
fEtaCut );
2219 printf(
"\t p_{T,gamma} > %3.2f\n",
fPtCut );
2230 switch (v0FinderType){
2232 cout <<
"have chosen onfly V0" << endl;
2237 cout <<
"have chosen offline V0" << endl;
2242 cout <<
"have chosen onfly V0 same sign pairing" << endl;
2247 cout <<
"have chosen onfly V0 unlike sign and same signs pairing" << endl;
2252 AliError(Form(
" v0FinderType not defined %d",v0FinderType));
2365 AliError(Form(
" EtaCut not defined %d",etaCut));
2445 AliError(
"RCut not defined");
2470 AliError(Form(
"EtaForPhiCut not defined %d",etaPhiCut));
2519 AliError(Form(
"MinPhiCut not defined %d",minPhiCut));
2568 AliError(Form(
"MaxPhiCut not defined %d",maxPhiCut));
2578 switch(singlePtCut){
2699 AliError(Form(
"singlePtCut not defined %d",singlePtCut));
2745 AliError(Form(
"Warning: clsTPCCut not defined %d",clsTPCCut));
2753 switch(ededxSigmaCut){
2815 AliError(
"TPCdEdxCutElectronLine not defined");
2825 switch(pidedxSigmaCut){
2871 AliError(Form(
"Warning: pidedxSigmaCut not defined %d",pidedxSigmaCut));
2879 switch(piMomdedxSigmaCut){
2908 AliError(Form(
"piMomdedxSigmaCut not defined %d",piMomdedxSigmaCut));
2916 switch(piMaxMomdedxSigmaCut){
2939 AliError(Form(
"piMaxMomdedxSigmaCut not defined %d",piMaxMomdedxSigmaCut));
2947 switch(LowPRejectionSigmaCut){
3030 AliError(Form(
"LowPRejectionSigmaCut not defined %d",LowPRejectionSigmaCut));
3072 AliError(
"KappaTPCCut not defined");
3083 switch(TOFelectronPID){
3115 AliError(Form(
"TOFElectronCut not defined %d",TOFelectronPID));
3124 switch(ITSelectronPID){
3186 AliError(Form(
"ITSelectronPID not defined %d",ITSelectronPID));
3195 switch(TRDelectronPID){
3202 AliError(Form(
"TRDelectronPID not defined %d",TRDelectronPID));
3254 AliError(Form(
"Warning: QtMaxCut not defined %d",QtMaxCut));
3263 switch(chi2GammaCut){
3302 AliError(Form(
"Warning: Chi2GammaCut not defined %d",chi2GammaCut));
3374 AliError(Form(
"PsiPairCut not defined %d",psiCut));
3384 switch(doPhotonAsymmetryCut){
3408 fFAsymmetryCut =
new TF1(
"fFAsymmetryCut",
"[0] + [1]*tanh(2*TMath::Power(x,[2]))",0.,100.);
3418 fFAsymmetryCut =
new TF1(
"fFAsymmetryCut",
"[0] + [1]*tanh(2*TMath::Power(x,[2]))",0.,100.);
3438 fFAsymmetryCut =
new TF1(
"fFAsymmetryCut",
"[0] + [1]*tanh(2*TMath::Power(x,[2]))",0.,100.);
3446 AliError(Form(
"PhotonAsymmetryCut not defined %d",doPhotonAsymmetryCut));
3506 AliError(Form(
"Cosine Pointing Angle cut not defined %d",cosCut));
3543 AliError(Form(
"Shared Electron Cut not defined %d",sharedElec));
3593 AliError(Form(
"Shared Electron Cut not defined %d",toClose));
3601 switch(TRDElectronCut){
3618 AliError(Form(
"TRDElectronCut not defined %d",TRDElectronCut));
3628 switch(DCAZPhotonPrimVtx){
3660 cout<<
"Warning: DCAZPhotonPrimVtx not defined "<<DCAZPhotonPrimVtx<<endl;
3669 switch(DCARPhotonPrimVtx){
3701 cout<<
"Warning: DCARPhotonPrimVtx not defined "<<DCARPhotonPrimVtx<<endl;
3721 cout<<
"Warning: In-Plane or Out-Of-Plane not defined "<<inOutPlane<<endl;
3731 Int_t firstTPCRow = 0;
3741 if(radius <= radiusI){
3744 if(radius>radiusI && radius<=radiusO){
3745 firstTPCRow = (
Int_t)((radius-radiusI)/rSizeI);
3747 if(radius>radiusO && radius<=radiusOB){
3748 firstTPCRow = (
Int_t)(nClsI+(radius-radiusO)/rSizeO);
3751 if(radius>radiusOB){
3752 firstTPCRow =(
Int_t)(nClsIO+(radius-radiusOB)/rSizeOB);
3772 if(event->IsA()==AliESDEvent::Class()){
3774 if(!esdEvent)
return -999;
3775 AliESDv0 *v0 = esdEvent->GetV0(photon->
GetV0Index());
3776 if(!v0)
return -999;
3777 v0->GetPxPyPz(momV0[0],momV0[1],momV0[2]);
3779 if(event->IsA()==AliAODEvent::Class()){
3780 momV0[0] = photon->
GetPx();
3781 momV0[1] = photon->
GetPy();
3782 momV0[2] = photon->
GetPz();
3790 Double_t momV02 = momV0[0]*momV0[0] + momV0[1]*momV0[1] + momV0[2]*momV0[2];
3791 Double_t PosV02 = PosV0[0]*PosV0[0] + PosV0[1]*PosV0[1] + PosV0[2]*PosV0[2];
3794 Double_t cosinePointingAngle = -999;
3795 if(momV02*PosV02 > 0.0)
3796 cosinePointingAngle = (PosV0[0]*momV0[0] + PosV0[1]*momV0[1] + PosV0[2]*momV0[2] ) / TMath::Sqrt(momV02 * PosV02);
3798 return cosinePointingAngle;
3858 for(
Int_t i = 0; i<nV0s*2;i++){
3859 if(i==nV0*2)
continue;
3860 if(i==(nV0*2)+1)
continue;
3879 for(
Int_t i = 0;i<photons->GetEntries();i++){
3880 if(nV0 == i)
continue;
3887 Double_t dist = pow((posX - posCompX),2)+pow((posY - posCompY),2)+pow((posZ - posCompZ),2);
3893 TVector3 v1(photon->Px(),photon->Py(),photon->Pz());
3894 TVector3 v2(photonComp->Px(),photonComp->Py(),photonComp->Pz());
3895 Double_t OpeningAngle=v1.Angle(v2);
3911 cout<<
"Warning: Initialization of Standardcuts2010PbPb failed"<<endl;}
3920 cout<<
"Warning: Initialization of Standardcuts2010pp failed"<<endl;}
3928 eventPlaneAngle=eventPlaneAngle+TMath::Pi();
3929 Double_t gammaToEPAngle = eventPlaneAngle-photonPhi;
3930 if(gammaToEPAngle < 0) gammaToEPAngle=gammaToEPAngle+2*TMath::Pi();
3931 gammaToEPAngle = gammaToEPAngle-TMath::Pi();
3938 if(TMath::Abs(gammaToEPAngle)<=0.25*TMath::Pi() || TMath::Abs(gammaToEPAngle)>=0.75*TMath::Pi()){
3945 if(TMath::Abs(gammaToEPAngle)>0.25*TMath::Pi() && TMath::Abs(gammaToEPAngle)<0.75*TMath::Pi()){
3960 if(!negTrack || !posTrack) {
3963 if(negTrack->Charge() == posTrack->Charge()){
3966 Int_t nClusterITSneg = negTrack->GetITSNcls();
3967 Int_t nClusterITSpos = posTrack->GetITSNcls();
3970 if (nClusterITSneg > 1 && nClusterITSpos > 1){
3972 }
else if (nClusterITSneg > 1 || nClusterITSpos > 1){
3985 nameProfile =
"profileContainingMaterialBudgetWeights_fewRadialBins";}
3987 nameProfile =
"profileContainingMaterialBudgetWeights_manyRadialBins";}
3989 AliError(Form(
"%d not a valid flag for InitMaterialBudgetWeightingOfPi0Candidates()",flag));
3992 TFile*
file = TFile::Open(filename.Data());
3994 AliError(Form(
"File %s for materialbudgetweights not found",filename.Data()));
3999 AliError(Form(
"Histogram %s not found in file",nameProfile.Data()));
4007 AliInfo(Form(
"MaterialBudgetWeightingOfPi0Candidates initialized with flag %d. This means %d radial bins will be used for the weighting. File used: %s.",flag,
fProfileContainingMaterialBudgetWeights->GetNbinsX(), filename.Data()));
4017 if (bin > 0 && bin <= fProfileContainingMaterialBudgetWeights->GetNbinsX()){
Double_t fTofPIDnSigmaAboveElectronLine
sigma cut RRnewTOF
Double_t fMinRDC
Min R for Double Counting Cut.
Bool_t SetDCARPhotonPrimVtxCut(Int_t DCARPhotonPrimVtx)
TH2F ** fHistoEleMapWidth
TH2F * fHistoTOFSigafter
TOF Sigma after cuts.
Bool_t SetQtMaxCut(Int_t QtMaxCut)
Float_t fMaxPhiCut
phi sector cut
Bool_t fPreSelCut
Flag for preselection cut used in V0Reader.
Double_t fMinPPhotonAsymmetryCut
Min Momentum for Asymmetry Cut.
TH2F * fHistoAcceptanceCuts
bookkeeping for acceptance cuts
Double_t fPIDTRDEfficiency
required electron efficiency for TRD PID
Double_t GetArmenterosAlpha() const
TH2F * fHistodEdxCuts
bookkeeping for dEdx cuts
Bool_t RejectSharedElectronV0s(AliAODConversionPhoton *photon, Int_t nV0, Int_t nV0s)
Double_t fOpenAngle
Opening Angle for Double Counting Cut.
TH2F * fHistoPhotonCuts
bookkeeping for photon specific cuts
Double_t fPIDnSigmaAbovePionLine
sigma cut
virtual Double_t GetPz() const =0
Bool_t fDodEdxSigmaCut
flag to use the dEdxCut based on sigmas
TObjString * fCutString
cut number used for analysis
Double_t fMinClsTPC
minimum clusters in the TPC
Int_t GetFirstTPCRow(Double_t radius)
static const char * fgkCutNames[kNCuts]
Bool_t InitializeElecDeDxPostCalibration(TString filename)
Double_t fDCAZPrimVtxCut
cut value for the maximum distance in Z between the photon & the primary vertex [cm] ...
Bool_t fSwitchToKappa
switches from standard dEdx nSigma TPC cuts to Kappa TPC
TH1F * fHistoCutIndex
bookkeeping for cuts
Bool_t PIDProbabilityCut(AliConversionPhotonBase *photon, AliVEvent *event)
Bool_t SetLowPRejectionCuts(Int_t LowPRejectionSigmaCut)
TH2F * fHistoTPCdEdxSigafter
TPC Sigm dEdx after cuts.
Double_t fMinPhotonAsymmetry
Asymmetry Cut.
Double_t fTRDPIDAboveCut
TRD cut range.
Float_t fEtaForPhiCutMin
eta cut for phi sector selection
Bool_t fDoElecDeDxPostCalibration
Bool_t SetSinglePtCut(Int_t singlePtCut)
Float_t GetPsiPair() const
Bool_t fMaterialBudgetWeightsInitialized
weights for conversions photons due due deviating material budget in MC compared to data ...
TH2F * fHistoTPCdEdxafter
TPC dEdx after cuts.
Double_t GetConversionZ() const
Double_t fDeltaR
Delta R for Double Counting Cut.
Bool_t fUseOnFlyV0Finder
flag
Int_t fInPlaneOutOfPlane
In-Plane Out-Of Plane Analysis.
Float_t GetDCAzToPrimVtx() const
TH2F * fHistoArmenterosafter
armenteros podolanski plot after cuts
AliPIDResponse * fPIDResponse
PID response.
Bool_t AsymmetryCut(AliConversionPhotonBase *photon, AliVEvent *event)
virtual Double_t GetPx() const =0
Double_t fPIDMinPPionRejectionLowP
Momentum limit to apply proton rejection.
TH2F * fHistoPsiPairDeltaPhiafter
TOF Sigma after cuts.
TH2F * fHistoArmenterosbefore
armenteros podolanski plot before cuts
Bool_t SetToCloseV0sCut(Int_t toClose)
void InitCutHistograms(TString name="", Bool_t preCut=kTRUE)
Double_t fLineCutZValue
linecut
Double_t fNSigmaMass
nsigma cut
TH2F * fHistoTOFbefore
TOF before cuts.
Bool_t SetTOFElectronPIDCut(Int_t TOFelectronPID)
Bool_t fDoShrinkTPCAcceptance
Flag for shrinking the TPC acceptance due to different reasons.
Bool_t PhotonIsSelectedAODMC(AliAODMCParticle *particle, TClonesArray *aodmcArray, Bool_t checkForConvertedGamma=kTRUE)
AliConversionPhotonCuts(const char *name="V0Cuts", const char *title="V0 Cuts")
Float_t fMinPhiCut
phi sector cut
Bool_t fIncludeRejectedPsiPair
TH1F * fHistoInvMassafter
e+e- inv mass distribution after cuts
Bool_t SetMinPhiSectorCut(Int_t minPhiCut)
void FillElectonLabelArray(AliAODConversionPhoton *photon, Int_t nV0)
Double_t fSinglePtCut2
second pt cut for electron/positron if asymmetric cut is chosen
Double_t GetCorrectedElectronTPCResponse(Short_t charge, Double_t nsig, Double_t P, Double_t Eta, Double_t R)
AliESDtrack * GetESDTrack(AliESDEvent *event, Int_t label)
TH2F * fHistoITSSigafter
ITS Sigma after cuts.
static AliConversionPhotonCuts * GetStandardCuts2010PbPb()
Double_t fDoKaonRejectionLowP
Kaon rejection at low p.
Int_t fElectronArraySize
Size of electron array.
TH2F * fHistoTOFSigbefore
TOF Sigma before cuts.
Int_t fIsHeavyIon
flag for pp (0), PbPb (1), pPb (2)
Float_t GetChi2perNDF() const
Bool_t RejectToCloseV0s(AliAODConversionPhoton *photon, TList *photons, Int_t nV0)
virtual Double_t GetPhotonP() const =0
Double_t GetArmenterosQt() const
Double_t fLineCutZRSlope
linecut
virtual Double_t GetPhotonPhi() const =0
Bool_t InPlaneOutOfPlaneCut(Double_t photonPhi, Double_t eventPlaneAngle=-100, Bool_t fill=kTRUE)
Bool_t fElecDeDxPostCalibrationInitialized
flag to check that initialization worked
Bool_t PhotonCuts(AliConversionPhotonBase *photon, AliVEvent *event)
Bool_t SetChi2GammaCut(Int_t chi2GammaCut)
Bool_t SetCut(cutIds cutID, Int_t cut)
Double_t fLineCutZRSlopeMin
linecut
Double_t fDoPionRejectionLowP
Pion rejection at low p.
TH1F * fHistoInvMassbefore
e+e- inv mass distribution before cuts
TH1F * fHistoEventPlanePhi
EventPlaneAngle Minus Photon Angle.
Bool_t fUseITSpid
flag to use tof pid
Int_t GetTrackLabelNegative() const
TH1F * fHistoEtaDistV0sAfterdEdxCuts
eta-distribution of all V0s after Finder selection after dEdx cuts
Float_t fConversionPointYArray
Array with conversion Point y.
Double_t fTRDPIDBelowCut
TRD cut range.
Double_t fPIDMaxPnSigmaAbovePionLine
sigma cut
Double_t fITSPIDnSigmaAboveElectronLine
sigma cut RRnewTOF
Double_t fDCARPrimVtxCut
cut value for the maximum distance in R between the photon & the primary vertex [cm] ...
void DeterminePhotonQuality(AliVTrack *negTrack, AliVTrack *posTrack)
Bool_t SetITSElectronPIDCut(Int_t ITSelectronPID)
Bool_t SetPhotonAsymmetryCut(Int_t doPhotonAsymmetryCut)
TH2F * fHistoITSSigbefore
ITS Sigma before cuts.
Int_t GetTrackLabelPositive() const
Double_t fPIDnSigmaAtLowPAroundKaonLine
sigma cut
Bool_t SetKappaTPCCut(Int_t kappaCut)
Double_t fPIDnSigmaAtLowPAroundPionLine
sigma cut
Bool_t fDoTOFsigmaCut
flag to use TOF pid cut RRnewTOF
Bool_t SetDCAZPhotonPrimVtxCut(Int_t DCAZPhotonPrimVtx)
Int_t GetTrackLabel(Int_t i) const
Bool_t SetMinMomPiondEdxCut(Int_t piMinMomdedxSigmaCut)
Double_t fPIDMinPnSigmaAbovePionLine
sigma cut
virtual ~AliConversionPhotonCuts()
Double_t fPIDnSigmaBelowElectronLine
sigma cut
Bool_t SetEtaCut(Int_t etaCut)
Int_t * fElectronLabelArray
Double_t fPIDProbabilityCutPositiveParticle
Bool_t PhotonIsSelectedMC(TParticle *particle, AliMCEvent *mcEvent, Bool_t checkForConvertedGamma=kTRUE)
Class handling all kinds of selection cuts for Gamma Conversion analysis.
Bool_t fDoPhotonAsymmetryCut
flag to use the PhotonAsymetryCut
TString fV0ReaderName
Name of the V0 reader.
Float_t GetDCArToPrimVtx() const
TH2F * fHistoAsymmetryafter
asymmetry plot after cuts
Bool_t fDoPhotonPDependentAsymCut
flag to use the PhotonAsymetryCut with P dependent cut
virtual Double_t GetPhotonPt() const =0
TProfile * fProfileContainingMaterialBudgetWeights
Bool_t InitializeCutsFromCutString(const TString analysisCutSelection)
Bool_t SetCosPAngleCut(Int_t cosCut)
Bool_t SetEtaForPhiCut(Int_t etaPhiCut)
Bool_t SetTPCClusterCut(Int_t clsTPCCut)
Bool_t InitializeMaterialBudgetWeights(Int_t flag, TString filename)
Bool_t fDoPhotonQualitySelectionCut
Bool_t fUseTOFpid
flag to use tof pid
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)
Float_t GetMaterialBudgetCorrectingWeightForTrueGamma(AliAODConversionPhoton *gamma)
Bool_t SetRCut(Int_t RCut)
TList * fHistograms
List of QA histograms.
Bool_t fDoQtGammaSelection
Select gammas using qtMax.
Double_t GetConversionY() const
Float_t fKappaMinCut
maximum Kappa cut
TH2F * fHistoTPCdEdxbefore
TPC dEdx before cuts.
Bool_t fProcessAODCheck
Flag for processing check for AOD to be contained in AliAODs.root and AliAODGammaConversion.root.
TH2F * fHistoKappaafter
Kappa vs photon pt after cuts.
Float_t fKappaMaxCut
maximum Kappa cut
virtual Double_t GetPy() const =0
Bool_t SetTRDElectronCut(Int_t TRDElectronCut)
void FillPhotonCutIndex(Int_t photoncut)
Double_t fSinglePtCut
pt cut for electron/positron
Bool_t SetPsiPairCut(Int_t psiCut)
UChar_t GetPhotonQuality() const
TH2F * fHistoTPCdEdxSigbefore
TPC Sigma dEdx before cuts.
Bool_t SpecificTrackCuts(AliAODTrack *negTrack, AliAODTrack *posTrack, Int_t &cutIndex)
Cut functions.
Double_t fQtMax
Maximum Qt from Armenteros to select Gammas.
Double_t fTofPIDnSigmaBelowElectronLine
sigma cut RRnewTOF
Float_t fOpeningAngle
min opening angle for meson
UChar_t DeterminePhotonQualityAOD(AliAODConversionPhoton *, AliVEvent *)
Double_t fChi2CutConversion
chi2cut
Bool_t SelectV0Finder(Bool_t onfly)
TH1F * fHistoEtaDistV0s
eta-distribution of all V0s after Finder selection
Bool_t fDo2DQt
Select gammas using ellipse cut.
Bool_t AcceptanceCuts(AliConversionPhotonBase *photon)
Bool_t fDoDoubleCountingCut
Flag to reject double counting.
Double_t fMinClsTPCToF
minimum clusters to findable clusters
void PrintCutsWithValues()
TFile * file
TList with histograms for a given trigger.
Float_t GetKappaTPC(AliConversionPhotonBase *gamma, AliVEvent *event)
Double_t fLineCutZValueMin
linecut
AliVTrack * GetTrack(AliVEvent *event, Int_t label)
Bool_t CosinePAngleCut(const AliConversionPhotonBase *photon, AliVEvent *event) const
Int_t fUseOnFlyV0FinderSameSign
int to set same sign pairing
Double_t fPIDnSigmaAbovePionLineHighPt
sigma cut
Double_t fPIDMinPProtonRejectionLowP
Momentum limit to apply proton rejection.
Float_t fConversionPointXArray
Array with conversion Point x.
Double_t fEtaCutMin
eta cut
static AliConversionPhotonCuts * GetStandardCuts2010pp()
Bool_t SetMaxMomPiondEdxCut(Int_t piMaxMomdedxSigmaCut)
Double_t fPIDnSigmaAtLowPAroundProtonLine
sigma cut
Bool_t PsiPairCut(const AliConversionPhotonBase *photon) const
Double_t fMaxPtPIDITS
max pt for ITS PID
Bool_t SetTPCdEdxCutElectronLine(Int_t ededxSigmaCut)
TH2F ** fHistoPosMapWidth
Bool_t dEdxCuts(AliVTrack *track, AliConversionPhotonBase *photon)
void CalculateDistanceOfClossetApproachToPrimVtx(const AliVVertex *primVertex)
Bool_t fUseCorrectedTPCClsInfo
flag to use corrected tpc cl info
Double_t fPIDnSigmaAboveElectronLine
sigma cut
Bool_t TracksAreSelected(AliVTrack *negTrack, AliVTrack *posTrack)
Double_t fPIDProbabilityCutNegativeParticle
Bool_t KappaCuts(AliConversionPhotonBase *photon, AliVEvent *event)
Bool_t SetInPlaneOutOfPlane(Int_t inOutPlane)
Bool_t SetMaxPhiSectorCut(Int_t maxPhiCut)
Bool_t fDoTRDPID
flag to use TRD pid
Bool_t SetSharedElectronCut(Int_t sharedElec)
Double_t fITSPIDnSigmaBelowElectronLine
sigma cut RRnewTOF
Bool_t SetV0Finder(Int_t v0FinderType)
Bool_t AcceptanceCut(TParticle *particle, TParticle *ePos, TParticle *eNeg)
Bool_t SetTRDElectronPIDCut(Int_t TRDelectronPID)
Bool_t fDoLightOutput
switch for running light output, kFALSE -> normal mode, kTRUE -> light mode
Bool_t fDoAsymPtCut
Flag for setting asymmetric pT cut on electron/positron.
TH1F * fHistoTrackCuts
bookkeeping for track cuts
Double_t GetCosineOfPointingAngle(const AliConversionPhotonBase *photon, AliVEvent *event) const
Double_t GetConversionRadius() const
Bool_t ArmenterosQtCut(AliConversionPhotonBase *photon)
Bool_t CorrectedTPCClusterCut(AliConversionPhotonBase *photon, AliVEvent *event)
Float_t fEtaForPhiCutMax
eta cut for phi sector selection
Double_t fDoProtonRejectionLowP
Proton rejection at low p.
Double_t GetConversionX() const
virtual Double_t GetPhotonEta() const =0
Double_t fPIDMinPKaonRejectionLowP
Momentum limit to apply kaon rejection.
Bool_t PhotonIsSelected(AliConversionPhotonBase *photon, AliVEvent *event)
Float_t fConversionPointZArray
Array with conversion Point z.
Bool_t SetTPCdEdxCutPionLine(Int_t pidedxSigmaCut)
TH2F * fHistoAsymmetrybefore
asymmetry plot after cuts