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 fDoPhotonQualityRejectionCut(kFALSE),
171 fPhotonQualityCut(0),
173 fElectronArraySize(500),
174 fElectronLabelArray(NULL),
175 fDCAZPrimVtxCut(1000),
176 fDCARPrimVtxCut(1000),
177 fInPlaneOutOfPlane(0),
178 fConversionPointXArray(0.0),
179 fConversionPointYArray(0.0),
180 fConversionPointZArray(0.0),
185 fITSPIDnSigmaAboveElectronLine(100),
186 fITSPIDnSigmaBelowElectronLine(-100),
188 fTRDPIDAboveCut(100),
189 fTRDPIDBelowCut(-100),
190 fDoDoubleCountingCut(kFALSE),
194 fSwitchToKappa(kFALSE),
197 fDoElecDeDxPostCalibration(kFALSE),
198 fHistoEtaDistV0s(NULL),
199 fHistoEtaDistV0sAfterdEdxCuts(NULL),
200 fHistodEdxCuts(NULL),
201 fHistoTPCdEdxbefore(NULL),
202 fHistoTPCdEdxafter(NULL),
203 fHistoTPCdEdxSigbefore(NULL),
204 fHistoTPCdEdxSigafter(NULL),
205 fHistoKappaafter(NULL),
206 fHistoTOFbefore(NULL),
207 fHistoTOFSigbefore(NULL),
208 fHistoTOFSigafter(NULL),
209 fHistoITSSigbefore(NULL),
210 fHistoITSSigafter(NULL),
211 fHistoPsiPairDeltaPhiafter(NULL),
212 fHistoTrackCuts(NULL),
213 fHistoPhotonCuts(NULL),
214 fHistoInvMassbefore(NULL),
215 fHistoArmenterosbefore(NULL),
216 fHistoInvMassafter(NULL),
217 fHistoArmenterosafter(NULL),
218 fHistoAsymmetrybefore(NULL),
219 fHistoAsymmetryafter(NULL),
220 fHistoAcceptanceCuts(NULL),
221 fHistoCutIndex(NULL),
222 fHistoEventPlanePhi(NULL),
224 fProcessAODCheck(kFALSE),
225 fMaterialBudgetWeightsInitialized(kFALSE),
226 fProfileContainingMaterialBudgetWeights(NULL),
227 fElecDeDxPostCalibrationInitialized(kFALSE),
229 fHistoEleMapMean(NULL),
230 fHistoEleMapWidth(NULL),
231 fHistoPosMapMean(NULL),
232 fHistoPosMapWidth(NULL)
255 AliAnalysisCuts(ref),
457 TH1::AddDirectory(kFALSE);
587 TAxis *AxisBeforedEdx = NULL;
588 TAxis *AxisBeforedEdxSig = NULL;
589 TAxis *AxisBeforeTOF = NULL;
590 TAxis *AxisBeforeTOFSig = NULL;
591 TAxis *AxisBeforeITSSig = NULL;
592 TAxis *AxisBeforeAsymmetry = NULL;
638 Int_t bins = AxisAfter->GetNbins();
639 Double_t from = AxisAfter->GetXmin();
643 Double_t factor = TMath::Power(to/from, 1./bins);
644 for(
Int_t i=1; i<=bins; ++i) newBins[i] = factor * newBins[i-1];
645 AxisAfter->Set(bins, newBins);
647 AxisAfter->Set(bins, newBins);
649 AxisAfter->Set(bins, newBins);
651 AxisAfter->Set(bins, newBins);
653 AxisAfter->Set(bins, newBins);
656 AxisAfter->Set(bins, newBins);
659 AxisBeforedEdx->Set(bins, newBins);
660 AxisBeforeTOF->Set(bins, newBins);
661 AxisBeforedEdxSig->Set(bins, newBins);
662 AxisBeforeTOFSig->Set(bins, newBins);
663 AxisBeforeITSSig->Set(bins, newBins);
664 AxisBeforeAsymmetry->Set(bins, newBins);
675 TH1::AddDirectory(kTRUE);
684 AliInputEventHandler* inputHandler = (AliInputEventHandler*) (man->GetInputEventHandler());
685 fPIDResponse = (AliPIDResponse*)inputHandler->GetPIDResponse();
696 AliInfo(
"Entering loading of correction map for post calibration");
698 TFile *
file = TFile::Open(filename.Data());
700 AliError(Form(
"file for electron dEdx post calibration %s not found",filename.Data()));
703 AliInfo(Form(
"found %s ",filename.Data()));
716 AliError(
"Histograms for dedx post calibration not found not found");
747 cout<<
" histograms are null..., going out"<< endl;
756 if( R > 0. && R < 33.5){
764 }
else if( R >= 30.5 && R < 72.){
772 }
else if( R >= 72. && R < 145.){
780 }
else if( R >= 145. && R < 180.){
798 cout<<
" histograms are null..., going out"<< endl;
805 if( R > 0. && R < 33.5){
813 }
else if( R >= 33.5 && R < 72.){
821 }
else if( R >= 72. && R < 145.){
829 }
else if( R >= 145. && R < 180.){
843 CornSig = (nsig - mean) / width;
851 if(!mcEvent)
return kFALSE;
853 if (particle->GetPdgCode() == 22){
863 if(particle->GetMother(0) >-1 && mcEvent->Particle(particle->GetMother(0))->GetPdgCode() == 22){
872 if(!checkForConvertedGamma)
return kTRUE;
875 TParticle* ePos = NULL;
876 TParticle* eNeg = NULL;
878 if(particle->GetNDaughters() >= 2){
879 for(
Int_t daughterIndex=particle->GetFirstDaughter();daughterIndex<=particle->GetLastDaughter();daughterIndex++){
880 if(daughterIndex<0)
continue;
881 TParticle *tmpDaughter = mcEvent->Particle(daughterIndex);
882 if(tmpDaughter->GetUniqueID() == 5){
883 if(tmpDaughter->GetPdgCode() == 11){
885 }
else if(tmpDaughter->GetPdgCode() == -11){
892 if(ePos == NULL || eNeg == NULL){
910 if(TMath::Abs(ePos->Vz()) >
fMaxZ){
913 if(TMath::Abs(eNeg->Vz()) >
fMaxZ){
938 if(!aodmcArray)
return kFALSE;
940 if (particle->GetPdgCode() == 22){
948 if(particle->GetMother() > -1 && (
static_cast<AliAODMCParticle*
>(aodmcArray->At(particle->GetMother())))->GetPdgCode() == 22){
952 if(!checkForConvertedGamma)
return kTRUE;
955 AliAODMCParticle* ePos = NULL;
956 AliAODMCParticle* eNeg = NULL;
958 if(particle->GetNDaughters() >= 2){
959 for(
Int_t daughterIndex=particle->GetDaughter(0);daughterIndex<=particle->GetDaughter(1);daughterIndex++){
960 AliAODMCParticle *tmpDaughter =
static_cast<AliAODMCParticle*
>(aodmcArray->At(daughterIndex));
961 if(!tmpDaughter)
continue;
962 if(((tmpDaughter->GetMCProcessCode())) == 5){
963 if(tmpDaughter->GetPdgCode() == 11){
965 }
else if(tmpDaughter->GetPdgCode() == -11){
972 if(ePos == NULL || eNeg == NULL){
986 Double_t rPos = sqrt( (ePos->Xv()*ePos->Xv()) + (ePos->Yv()*ePos->Yv()) );
987 Double_t rNeg = sqrt( (eNeg->Xv()*eNeg->Xv()) + (eNeg->Yv()*eNeg->Yv()) );
992 if(TMath::Abs(ePos->Zv()) >
fMaxZ){
995 if(TMath::Abs(eNeg->Zv()) >
fMaxZ){
1079 Double_t magField =
event->GetMagneticField();
1080 if( magField < 0.0 ){
1086 Double_t deltaPhi = magField * TVector2::Phi_mpi_pi( electronCandidate->Phi()-positronCandidate->Phi());
1122 UChar_t photonQuality = 0;
1159 if(!negTrack||!posTrack)
return kFALSE;
1164 if(negTrack->GetTPCNclsF()!=0){
1165 negclsToF = (
Double_t)negTrack->GetNcls(1)/(
Double_t)negTrack->GetTPCNclsF();}
1173 if(posTrack->GetTPCNclsF()!=0){
1174 posclsToF = (
Double_t)posTrack->GetNcls(1)/(
Double_t)posTrack->GetTPCNclsF();
1193 if(event->IsA()==AliESDEvent::Class()) {
1204 if(!negTrack || !posTrack) {
1214 Int_t v0PosID = posTrack->GetID();
1215 Int_t v0NegID = negTrack->GetID();
1216 AliAODv0* v0 = NULL;
1217 for(
Int_t iV=0; iV<aodEvent->GetNumberOfV0s(); iV++){
1218 v0 = aodEvent->GetV0(iV);
1220 if( (v0PosID == v0->GetPosID() && v0NegID == v0->GetNegID()) || (v0PosID == v0->GetNegID() && v0NegID == v0->GetPosID()) ){
1360 if( !negTrack->IsOn(AliESDtrack::kTPCrefit) || !posTrack->IsOn(AliESDtrack::kTPCrefit) ) {
1366 AliAODVertex * NegVtxType=negTrack->GetProdVertex();
1367 AliAODVertex * PosVtxType=posTrack->GetProdVertex();
1368 if( (NegVtxType->GetType())==AliAODVertex::kKink || (PosVtxType->GetType())==AliAODVertex::kKink) {
1381 if( !negTrack->IsOn(AliESDtrack::kTPCrefit) || !posTrack->IsOn(AliESDtrack::kTPCrefit) ) {
1387 if(negTrack->GetKinkIndex(0) > 0 || posTrack->GetKinkIndex(0) > 0 ) {
1406 if(negTrack->Charge() == posTrack->Charge()) {
1411 if(negTrack->Charge() != posTrack->Charge()) {
1428 if( posTrack->Eta() > (
fEtaCut) || posTrack->Eta() < (-
fEtaCut) ||
1459 if(negTrack->IsA()==AliAODTrack::Class()) {
1460 passCuts = passCuts *
SpecificTrackCuts(static_cast<AliAODTrack*>(negTrack), static_cast<AliAODTrack*>(posTrack),cutIndex);
1462 passCuts = passCuts *
SpecificTrackCuts(static_cast<AliESDtrack*>(negTrack), static_cast<AliESDtrack*>(posTrack),cutIndex);
1480 if(!
fPIDResponse){AliError(
"No PID Response");
return kTRUE;}
1490 Float_t KappaPlus, KappaMinus, Kappa;
1494 P[0] =negTrack->P();
1495 P[1] =posTrack->P();
1496 Eta[0] =negTrack->Eta();
1497 Eta[1] =posTrack->Eta();
1505 Kappa = ( TMath::Abs(KappaMinus) + TMath::Abs(KappaPlus) ) / 2.0 + 2.0*(KappaMinus+KappaPlus);
1518 if(!
fPIDResponse){AliError(
"No PID Response");
return kTRUE;}
1520 Short_t Charge = fCurrentTrack->Charge();
1528 P = fCurrentTrack->P();
1529 Eta = fCurrentTrack->Eta();
1639 if((fCurrentTrack->GetStatus() & AliESDtrack::kTOFpid ) && !(fCurrentTrack->GetStatus() & AliESDtrack::kTOFmismatch)){
1643 fCurrentTrack->GetIntegratedTimes(times,AliPID::kSPECIESC);
1644 Double_t TOFsignal = fCurrentTrack->GetTOFsignal();
1645 Double_t dT = TOFsignal - t0 - times[0];
1660 if((fCurrentTrack->GetStatus() & AliESDtrack::kITSpid)){
1710 for(
Int_t ii=0;ii<2;ii++){
1717 trackNegAsy= track->P()/photon->
GetPhotonP();
1728 trackNegAsy= track->P()/photon->
GetPhotonP();
1749 if(label > event->GetNumberOfTracks() )
return NULL;
1750 AliESDtrack * track = esdEvent->GetTrack(label);
1754 if(label == -999999)
return NULL;
1755 AliVTrack * track = 0x0;
1757 if(event->GetTrack(label)) track = dynamic_cast<AliVTrack*>(event->GetTrack(label));
1761 for(
Int_t ii=0; ii<
event->GetNumberOfTracks(); ii++) {
1762 if(event->GetTrack(ii)) track = dynamic_cast<AliVTrack*>(event->GetTrack(ii));
1764 if(track->GetID() == label) {
1782 if(label > event->GetNumberOfTracks() )
return NULL;
1783 AliESDtrack * track =
event->GetTrack(label);
1808 if(negProbArray && posProbArray){
1810 negTrack->GetTPCpid(negProbArray);
1811 posTrack->GetTPCpid(posProbArray);
1818 delete [] posProbArray;
1819 delete [] negProbArray;
1834 if(particle->R()>
fMaxR){
1837 if(ePos->R()>
fMaxR){
1841 if(ePos->R()<
fMinR){
1852 if(TMath::Abs(eNeg->Vz()) >
fMaxZ ){
1856 if(eNeg->Vz()!=ePos->Vz()||eNeg->R()!=ePos->R()){
1860 if(TMath::Abs(ePos->Vz()) >
fMaxZ ){
1865 if( particle->Eta() > (
fEtaCut) || particle->Eta() < (-
fEtaCut) ){
1896 if(particle->Pt()<
fPtCut){
1920 AliInfo(Form(
"Set Photoncut Number: %s",analysisCutSelection.Data()));
1921 if(analysisCutSelection.Length()!=
kNCuts) {
1922 AliError(Form(
"Cut selection has the wrong length! size is %d, number of cuts is %d", analysisCutSelection.Length(),
kNCuts));
1925 if(!analysisCutSelection.IsAlnum()){
1926 AliError(
"Cut selection is not alphanumeric");
1930 TString analysisCutSelectionLowerCase = Form(
"%s",analysisCutSelection.Data());
1931 analysisCutSelectionLowerCase.ToLower();
1932 const char *cutSelection = analysisCutSelectionLowerCase.Data();
1933 #define ASSIGNARRAY(i) fCuts[i] = ((int)cutSelection[i]>=(int)'a') ? cutSelection[i]-'a'+10 : cutSelection[i]-'0' 1958 }
else return kFALSE;
1965 }
else return kFALSE;
1972 }
else return kFALSE;
1979 }
else return kFALSE;
1985 }
else return kFALSE;
1991 }
else return kFALSE;
1998 }
else return kFALSE;
2005 }
else return kFALSE;
2013 }
else return kFALSE;
2019 }
else return kFALSE;
2027 }
else return kFALSE;
2038 }
else return kFALSE;
2049 }
else return kFALSE;
2060 }
else return kFALSE;
2070 }
else return kFALSE;
2077 }
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;
2155 }
else return kFALSE;
2158 AliError(
"Cut id out of range");
2162 AliError(
"Cut id %d not recognized");
2175 printf(
"\nConversion cutnumber \n");
2177 printf(
"%d",
fCuts[ic]);
2180 printf(
"Electron cuts & Secondary Track Cuts - only track from secondaries enter analysis: \n");
2181 printf(
"\t no like sign pairs from V0s \n");
2184 else printf(
"\t eta_{e} < %3.2f\n",
fEtaCut );
2190 printf(
"\t TPC refit \n");
2191 printf(
"\t no kinks \n");
2205 printf(
"Photon cuts: \n");
2207 else printf(
"\t using Offline V0 finder \n");
2209 printf(
"\t 2 dimensional q_{T} cut applied with maximum of %3.2f \n",
fQtMax );
2211 printf(
"\t 1 dimensional q_{T} cut applied with maximum of %3.2f \n",
fQtMax );
2214 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 );
2217 printf(
"\t psi_{pair} max cut |psi_{pair}| < %3.2f \n",
fPsiPairCut );
2219 printf(
"\t %3.2f < R_{conv} < %3.2f\n",
fMinR,
fMaxR );
2220 printf(
"\t Z_{conv} < %3.2f\n",
fMaxZ );
2222 else printf(
"\t eta_{conv} < %3.2f\n",
fEtaCut );
2226 printf(
"\t p_{T,gamma} > %3.2f\n",
fPtCut );
2238 switch (v0FinderType){
2240 cout <<
"have chosen onfly V0" << endl;
2245 cout <<
"have chosen offline V0" << endl;
2250 cout <<
"have chosen onfly V0 same sign pairing" << endl;
2255 cout <<
"have chosen onfly V0 unlike sign and same signs pairing" << endl;
2260 AliError(Form(
" v0FinderType not defined %d",v0FinderType));
2373 AliError(Form(
" EtaCut not defined %d",etaCut));
2453 AliError(
"RCut not defined");
2478 AliError(Form(
"EtaForPhiCut not defined %d",etaPhiCut));
2527 AliError(Form(
"MinPhiCut not defined %d",minPhiCut));
2576 AliError(Form(
"MaxPhiCut not defined %d",maxPhiCut));
2586 switch(singlePtCut){
2707 AliError(Form(
"singlePtCut not defined %d",singlePtCut));
2753 AliError(Form(
"Warning: clsTPCCut not defined %d",clsTPCCut));
2761 switch(ededxSigmaCut){
2823 AliError(
"TPCdEdxCutElectronLine not defined");
2833 switch(pidedxSigmaCut){
2879 AliError(Form(
"Warning: pidedxSigmaCut not defined %d",pidedxSigmaCut));
2887 switch(piMomdedxSigmaCut){
2916 AliError(Form(
"piMomdedxSigmaCut not defined %d",piMomdedxSigmaCut));
2924 switch(piMaxMomdedxSigmaCut){
2947 AliError(Form(
"piMaxMomdedxSigmaCut not defined %d",piMaxMomdedxSigmaCut));
2955 switch(LowPRejectionSigmaCut){
3038 AliError(Form(
"LowPRejectionSigmaCut not defined %d",LowPRejectionSigmaCut));
3080 AliError(
"KappaTPCCut not defined");
3091 switch(TOFelectronPID){
3123 AliError(Form(
"TOFElectronCut not defined %d",TOFelectronPID));
3132 switch(ITSelectronPID){
3194 AliError(Form(
"ITSelectronPID not defined %d",ITSelectronPID));
3203 switch(TRDelectronPID){
3210 AliError(Form(
"TRDelectronPID not defined %d",TRDelectronPID));
3262 AliError(Form(
"Warning: QtMaxCut not defined %d",QtMaxCut));
3271 switch(chi2GammaCut){
3322 AliError(Form(
"Warning: Chi2GammaCut not defined %d",chi2GammaCut));
3394 AliError(Form(
"PsiPairCut not defined %d",psiCut));
3404 switch(doPhotonAsymmetryCut){
3428 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.);
3458 fFAsymmetryCut =
new TF1(
"fFAsymmetryCut",
"[0] + [1]*tanh(2*TMath::Power(x,[2]))",0.,100.);
3466 AliError(Form(
"PhotonAsymmetryCut not defined %d",doPhotonAsymmetryCut));
3526 AliError(Form(
"Cosine Pointing Angle cut not defined %d",cosCut));
3574 AliError(Form(
"Shared Electron Cut not defined %d",sharedElec));
3624 AliError(Form(
"Shared Electron Cut not defined %d",toClose));
3632 switch(TRDElectronCut){
3649 AliError(Form(
"TRDElectronCut not defined %d",TRDElectronCut));
3659 switch(DCAZPhotonPrimVtx){
3691 cout<<
"Warning: DCAZPhotonPrimVtx not defined "<<DCAZPhotonPrimVtx<<endl;
3700 switch(DCARPhotonPrimVtx){
3732 cout<<
"Warning: DCARPhotonPrimVtx not defined "<<DCARPhotonPrimVtx<<endl;
3752 cout<<
"Warning: In-Plane or Out-Of-Plane not defined "<<inOutPlane<<endl;
3762 Int_t firstTPCRow = 0;
3772 if(radius <= radiusI){
3775 if(radius>radiusI && radius<=radiusO){
3776 firstTPCRow = (
Int_t)((radius-radiusI)/rSizeI);
3778 if(radius>radiusO && radius<=radiusOB){
3779 firstTPCRow = (
Int_t)(nClsI+(radius-radiusO)/rSizeO);
3782 if(radius>radiusOB){
3783 firstTPCRow =(
Int_t)(nClsIO+(radius-radiusOB)/rSizeOB);
3803 if(event->IsA()==AliESDEvent::Class()){
3805 if(!esdEvent)
return -999;
3806 AliESDv0 *v0 = esdEvent->GetV0(photon->
GetV0Index());
3807 if(!v0)
return -999;
3808 v0->GetPxPyPz(momV0[0],momV0[1],momV0[2]);
3810 if(event->IsA()==AliAODEvent::Class()){
3811 momV0[0] = photon->
GetPx();
3812 momV0[1] = photon->
GetPy();
3813 momV0[2] = photon->
GetPz();
3821 Double_t momV02 = momV0[0]*momV0[0] + momV0[1]*momV0[1] + momV0[2]*momV0[2];
3822 Double_t PosV02 = PosV0[0]*PosV0[0] + PosV0[1]*PosV0[1] + PosV0[2]*PosV0[2];
3825 Double_t cosinePointingAngle = -999;
3826 if(momV02*PosV02 > 0.0)
3827 cosinePointingAngle = (PosV0[0]*momV0[0] + PosV0[1]*momV0[1] + PosV0[2]*momV0[2] ) / TMath::Sqrt(momV02 * PosV02);
3829 return cosinePointingAngle;
3889 for(
Int_t i = 0; i<nV0s*2;i++){
3890 if(i==nV0*2)
continue;
3891 if(i==(nV0*2)+1)
continue;
3910 for(
Int_t i = 0;i<photons->GetEntries();i++){
3911 if(nV0 == i)
continue;
3918 Double_t dist = pow((posX - posCompX),2)+pow((posY - posCompY),2)+pow((posZ - posCompZ),2);
3924 TVector3 v1(photon->Px(),photon->Py(),photon->Pz());
3925 TVector3 v2(photonComp->Px(),photonComp->Py(),photonComp->Pz());
3926 Double_t OpeningAngle=v1.Angle(v2);
3942 cout<<
"Warning: Initialization of Standardcuts2010PbPb failed"<<endl;}
3951 cout<<
"Warning: Initialization of Standardcuts2010pp failed"<<endl;}
3959 eventPlaneAngle=eventPlaneAngle+TMath::Pi();
3960 Double_t gammaToEPAngle = eventPlaneAngle-photonPhi;
3961 if(gammaToEPAngle < 0) gammaToEPAngle=gammaToEPAngle+2*TMath::Pi();
3962 gammaToEPAngle = gammaToEPAngle-TMath::Pi();
3969 if(TMath::Abs(gammaToEPAngle)<=0.25*TMath::Pi() || TMath::Abs(gammaToEPAngle)>=0.75*TMath::Pi()){
3976 if(TMath::Abs(gammaToEPAngle)>0.25*TMath::Pi() && TMath::Abs(gammaToEPAngle)<0.75*TMath::Pi()){
3991 if(!negTrack || !posTrack) {
3994 if(negTrack->Charge() == posTrack->Charge()){
3997 Int_t nClusterITSneg = negTrack->GetITSNcls();
3998 Int_t nClusterITSpos = posTrack->GetITSNcls();
4001 if (nClusterITSneg > 1 && nClusterITSpos > 1){
4003 }
else if (nClusterITSneg > 1 || nClusterITSpos > 1){
4016 nameProfile =
"profileContainingMaterialBudgetWeights_fewRadialBins";}
4018 nameProfile =
"profileContainingMaterialBudgetWeights_manyRadialBins";}
4020 AliError(Form(
"%d not a valid flag for InitMaterialBudgetWeightingOfPi0Candidates()",flag));
4023 TFile*
file = TFile::Open(filename.Data());
4025 AliError(Form(
"File %s for materialbudgetweights not found",filename.Data()));
4030 AliError(Form(
"Histogram %s not found in file",nameProfile.Data()));
4038 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()));
4048 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.
Bool_t fDoPhotonQualityRejectionCut
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