\r
\r
//________________________________________________________________________\r
-void AliAnalysisTaskBFPsi::SetInputCorrection(const char* filename, \r
- const char* gCollSystem) {\r
+void AliAnalysisTaskBFPsi::SetInputCorrection(TString filename, \r
+ TString gCollSystem) {\r
//Open files that will be used for correction\r
TString gCollidingSystem = gCollSystem;\r
\r
+ cout<<filename<<endl;\r
+\r
+ // No file specified -> run without corrections\r
+ if(!filename.Contains(".root")) {\r
+ AliInfo(Form("No correction file specified (= %s) --> run without corrections",filename.Data()));\r
+ return;\r
+ }\r
+\r
//Open the input file\r
TFile *f = TFile::Open(filename);\r
if(!f->IsOpen()) {\r
- Printf("File not found!!!");\r
+ AliInfo(Form("File %s not found --> run without corrections",filename.Data()));\r
return;\r
}\r
\r
\r
//=======================================correction\r
Double_t correction = GetTrackbyTrackCorrectionMatrix(vEta, vPhi, vPt, vCharge, gCentrality); \r
-\r
//Printf("CORRECTIONminus: %.2f | Centrality %lf",correction,gCentrality);\r
\r
// add the track to the TObjArray\r
if( vPt < fPtMin || vPt > fPtMax) continue;\r
if( vEta < fEtaMin || vEta > fEtaMax) continue;\r
\r
- // //Exclude resonances\r
- // if(fExcludeResonancesInMC) {\r
- // TParticle *particle = track->Particle();\r
- // if(!particle) continue;\r
+ // Remove neutral tracks\r
+ if( vCharge == 0 ) continue;\r
+\r
+ //Exclude resonances\r
+ if(fExcludeResonancesInMC) {\r
\r
- // Bool_t kExcludeParticle = kFALSE;\r
- // Int_t gMotherIndex = particle->GetFirstMother();\r
- // if(gMotherIndex != -1) {\r
- // AliMCParticle* motherTrack = dynamic_cast<AliMCParticle *>(event->GetTrack(gMotherIndex));\r
- // if(motherTrack) {\r
- // TParticle *motherParticle = motherTrack->Particle();\r
- // if(motherParticle) {\r
- // Int_t pdgCodeOfMother = motherParticle->GetPdgCode();\r
- // //if((pdgCodeOfMother == 113)||(pdgCodeOfMother == 213)||(pdgCodeOfMother == 221)||(pdgCodeOfMother == 223)||(pdgCodeOfMother == 331)||(pdgCodeOfMother == 333)) {\r
- // if(pdgCodeOfMother == 113) {\r
- // kExcludeParticle = kTRUE;\r
- // }\r
- // }\r
- // }\r
- // }\r
+ Bool_t kExcludeParticle = kFALSE;\r
+ Int_t gMotherIndex = aodTrack->GetMother();\r
+ if(gMotherIndex != -1) {\r
+ AliAODMCParticle* motherTrack = dynamic_cast<AliAODMCParticle *>(mcEvent->GetTrack(gMotherIndex));\r
+ if(motherTrack) {\r
+ Int_t pdgCodeOfMother = motherTrack->GetPdgCode();\r
+ //if((pdgCodeOfMother == 113)||(pdgCodeOfMother == 213)||(pdgCodeOfMother == 221)||(pdgCodeOfMother == 223)||(pdgCodeOfMother == 331)||(pdgCodeOfMother == 333)) {\r
+ //if(pdgCodeOfMother == 113) {\r
+ if(pdgCodeOfMother == 113 // rho0\r
+ || pdgCodeOfMother == 213 || pdgCodeOfMother == -213 // rho+\r
+ || pdgCodeOfMother == 221 // eta\r
+ || pdgCodeOfMother == 331 // eta'\r
+ || pdgCodeOfMother == 223 // omega\r
+ || pdgCodeOfMother == 333 // phi\r
+ || pdgCodeOfMother == 311 || pdgCodeOfMother == -311 // K0\r
+ || pdgCodeOfMother == 313 || pdgCodeOfMother == -313 // K0*\r
+ || pdgCodeOfMother == 323 || pdgCodeOfMother == -323 // K+*\r
+ \r
+ ) {\r
+ kExcludeParticle = kTRUE;\r
+ }\r
+ }\r
+ }\r
\r
- // //Exclude from the analysis decay products of rho0, rho+, eta, eta' and phi\r
- // if(kExcludeParticle) continue;\r
- // }\r
+ //Exclude from the analysis decay products of rho0, rho+, eta, eta' and phi\r
+ if(kExcludeParticle) continue;\r
+ }\r
\r
// fill QA histograms\r
fHistPt->Fill(vPt,gCentrality);\r
if(vCharge > 0) fHistEtaPhiPos->Fill(vEta,vPhi,gCentrality); \r
else if(vCharge < 0) fHistEtaPhiNeg->Fill(vEta,vPhi,gCentrality);\r
\r
- //=======================================correction (NO corrections in case of MC truth)\r
- Double_t correction = 1.; \r
+ //=======================================correction\r
+ Double_t correction = GetTrackbyTrackCorrectionMatrix(vEta, vPhi, vPt, vCharge, gCentrality); \r
+ //Printf("CORRECTIONminus: %.2f | Centrality %lf",correction,gCentrality); \r
\r
// add the track to the TObjArray\r
tracksAccepted->Add(new AliBFBasicParticle(vEta, vPhi, vPt, vCharge, correction)); \r
//exclude non stable particles\r
if(!(gMCEvent->IsPhysicalPrimary(iTracks))) continue;\r
\r
+ vCharge = track->Charge();\r
vEta = track->Eta();\r
vPt = track->Pt();\r
vY = track->Y();\r
else if (fUsePID){\r
if( vY < fEtaMin || vY > fEtaMax) continue;\r
}\r
+\r
+ // Remove neutral tracks\r
+ if( vCharge == 0 ) continue;\r
\r
//analyze one set of particles\r
if(fUseMCPdgCode) {\r
if(kExcludeParticle) continue;\r
}\r
\r
- vCharge = track->Charge();\r
vPhi = track->Phi();\r
//Printf("phi (before): %lf",vPhi);\r
\r
\r
//vPhi *= TMath::RadToDeg();\r
\r
- //=======================================correction (NO corrections in case of MC truth)\r
- Double_t correction = 1.;\r
+ //=======================================correction\r
+ Double_t correction = GetTrackbyTrackCorrectionMatrix(vEta, vPhi, vPt, vCharge, gCentrality); \r
+ //Printf("CORRECTIONminus: %.2f | Centrality %lf",correction,gCentrality);\r
\r
tracksAccepted->Add(new AliBFBasicParticle(vEta, vPhi, vPt, vCharge, correction)); \r
} //track loop\r