- New PID interface class, also taking care of QA histos
authormfloris <mfloris@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 3 May 2012 09:30:36 +0000 (09:30 +0000)
committermfloris <mfloris@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 3 May 2012 09:30:36 +0000 (09:30 +0000)
- Using getters for different particles in task (more compact)
- Removed q cut from task

12 files changed:
PWGLF/SPECTRA/PiKaPr/TestAOD/AliAnalysisTaskSpectraAOD.cxx
PWGLF/SPECTRA/PiKaPr/TestAOD/AliAnalysisTaskSpectraAOD.h
PWGLF/SPECTRA/PiKaPr/TestAOD/AliSpectraAODEventCuts.cxx
PWGLF/SPECTRA/PiKaPr/TestAOD/AliSpectraAODHistoManager.cxx
PWGLF/SPECTRA/PiKaPr/TestAOD/AliSpectraAODHistoManager.h
PWGLF/SPECTRA/PiKaPr/TestAOD/AliSpectraAODPID.cxx [new file with mode: 0644]
PWGLF/SPECTRA/PiKaPr/TestAOD/AliSpectraAODPID.h [new file with mode: 0644]
PWGLF/SPECTRA/PiKaPr/TestAOD/AliSpectraAODTrackCuts.cxx
PWGLF/SPECTRA/PiKaPr/TestAOD/AliSpectraAODTrackCuts.h
PWGLF/SPECTRA/PiKaPr/TestAOD/run.C
PWGLF/SPECTRA/PiKaPr/TestAOD/runAODProof.C
PWGLF/SPECTRA/PiKaPr/TestAOD/runAODProof_init.C

index 363346e..691df72 100644 (file)
@@ -42,6 +42,7 @@
 #include "AliVEvent.h"\r
 #include "AliPIDResponse.h"\r
 #include "AliStack.h"\r
+#include "AliSpectraAODPID.h"\r
 #include <iostream>\r
 \r
 \r
@@ -53,37 +54,18 @@ using namespace std;
 ClassImp(AliAnalysisTaskSpectraAOD) // EX1 This stuff tells root to implement the streamer, inspector methods etc (we discussed about it today)\r
 \r
 //________________________________________________________________________\r
-AliAnalysisTaskSpectraAOD::AliAnalysisTaskSpectraAOD(const char *name) : AliAnalysisTaskSE(name), fAOD(0), fHistMan(0), fTrackCuts(0), fEventCuts(0), fIsMC(0), fPIDResponse(0), fNSigmaPID(0), fYCut(0)\r
+AliAnalysisTaskSpectraAOD::AliAnalysisTaskSpectraAOD(const char *name) : AliAnalysisTaskSE(name), fAOD(0), fHistMan(0), fTrackCuts(0), fEventCuts(0),  fPID(0), fIsMC(0)\r
 {\r
   // Default constructor\r
-  fNSigmaPID = 3.;\r
-  fYCut = .5;\r
+\r
   DefineInput(0, TChain::Class());\r
   DefineOutput(1, AliSpectraAODHistoManager::Class());\r
   DefineOutput(2, AliSpectraAODEventCuts::Class());\r
   DefineOutput(3, AliSpectraAODTrackCuts::Class());\r
+  DefineOutput(4, AliSpectraAODPID::Class());\r
 \r
 }\r
 //________________________________________________________________________\r
-Bool_t AliAnalysisTaskSpectraAOD::CheckYCut(AODParticleSpecies_t species, AliAODTrack* track) const\r
-{\r
-  // check if the rapidity is within the set range\r
-  // note: masses are hardcoded for now. we could look them up in the pdg database, but that would mean accecing it 100k+ times per run ...\r
-  Double_t y;\r
-  if (species == kSpProton) { y = track->Y(9.38271999999999995e-01); }\r
-  if ( species == kSpKaon ) { y = track->Y(4.93676999999999977e-01); }\r
-  if ( species == kSpPion)  { y = track->Y(1.39570000000000000e-01); }\r
-  if (TMath::Abs(y) > fYCut || y < -998.) return kFALSE;\r
-  return kTRUE;\r
-}\r
-//____________________________________________________________________________\r
-Bool_t AliAnalysisTaskSpectraAOD::CheckYCut(AliAODMCParticle* particle) const\r
-{\r
-  // check if the rapidity is within the set range\r
-  Double_t y = particle->Y();\r
-  if (TMath::Abs(y) > fYCut || y < -998.) return kFALSE;\r
-  return kTRUE;\r
-}\r
 //________________________________________________________________________\r
 void AliAnalysisTaskSpectraAOD::UserCreateOutputObjects()\r
 {\r
@@ -92,14 +74,12 @@ void AliAnalysisTaskSpectraAOD::UserCreateOutputObjects()
 \r
   if (!fTrackCuts) AliFatal("Track Cuts should be set in the steering macro");\r
   if (!fEventCuts) AliFatal("Event Cuts should be set in the steering macro");\r
+  if (!fPID)       AliFatal("PID object should be set in the steering macro");\r
 \r
-  AliAnalysisManager *man = AliAnalysisManager::GetAnalysisManager();\r
-  AliInputEventHandler* inputHandler = (AliInputEventHandler*)(man->GetInputEventHandler());\r
-  fPIDResponse = inputHandler->GetPIDResponse();\r
-\r
-  PostData(1, fHistMan);\r
+  PostData(1, fHistMan  );\r
   PostData(2, fEventCuts);\r
   PostData(3, fTrackCuts);\r
+  PostData(4, fPID      );\r
 \r
 }\r
 //________________________________________________________________________\r
@@ -111,269 +91,132 @@ void AliAnalysisTaskSpectraAOD::UserExec(Option_t *)
     {\r
       AliFatal("Not processing AODs");\r
     }\r
+    \r
+  //check on centrality distribution\r
+  fHistMan->GetPtHistogram("CentCheck")->Fill(fAOD->GetCentrality()->GetCentralityPercentile("V0M"),fAOD->GetHeader()->GetCentralityP()->GetCentralityPercentileUnchecked("V0M"));\r
   \r
-  if(!fPIDResponse) {\r
-    AliError("Cannot get pid response");\r
-    return;\r
-  }\r
-  //Selection on QVector, before ANY other selection on the event\r
-  //Spectra MUST be normalized wrt events AFTER the selection on Qvector\r
-  // Can we include this in fEventCuts\r
-  Double_t Qx2EtaPos = 0, Qy2EtaPos = 0;\r
-  Double_t Qx2EtaNeg = 0, Qy2EtaNeg = 0;\r
-  Int_t multPos = 0;\r
-  Int_t multNeg = 0;\r
-  for(Int_t iT = 0; iT < fAOD->GetNumberOfTracks(); iT++) {\r
-    AliAODTrack* aodTrack = fAOD->GetTrack(iT);\r
-    if (!fTrackCuts->IsSelected(aodTrack)) continue;\r
-    if (aodTrack->Eta() >= 0){\r
-      multPos++;\r
-      Qx2EtaPos += TMath::Cos(2*aodTrack->Phi()); \r
-      Qy2EtaPos += TMath::Sin(2*aodTrack->Phi());\r
-    } else {\r
-      multNeg++;\r
-      Qx2EtaNeg += TMath::Cos(2*aodTrack->Phi()); \r
-      Qy2EtaNeg += TMath::Sin(2*aodTrack->Phi());\r
-    }\r
-  } \r
-  Double_t qPos=-999;\r
-  if(multPos!=0)qPos= TMath::Sqrt((Qx2EtaPos*Qx2EtaPos + Qy2EtaPos*Qy2EtaPos)/multPos);\r
-  Double_t qNeg=-999;\r
-  if(multNeg!=0)qNeg= TMath::Sqrt((Qx2EtaNeg*Qx2EtaNeg + Qy2EtaNeg*Qy2EtaNeg)/multNeg);\r
+  if(!fEventCuts->IsSelected(fAOD))return;//event selection\r
+        \r
+  //AliCentrality fAliCentral*;\r
+  //   if ((fAOD->GetCentrality())->GetCentralityPercentile("V0M") > 5.) return;\r
   \r
-  if((qPos>fTrackCuts->GetQvecMin() && qPos<fTrackCuts->GetQvecMax()) || (qNeg>fTrackCuts->GetQvecMin() && qNeg<fTrackCuts->GetQvecMax())){\r
-    \r
-    //check on centrality distribution\r
-    fHistMan->GetPtHistogram("CentCheck")->Fill(fAOD->GetCentrality()->GetCentralityPercentile("V0M"),fAOD->GetHeader()->GetCentralityP()->GetCentralityPercentileUnchecked("V0M"));\r
-    \r
-    if(!fEventCuts->IsSelected(fAOD))return;//event selection\r
-      \r
-    //fill q distributions vs centrality, after all event selection\r
-    fHistMan->GetqVecHistogram(kHistqVecPos)->Fill(qPos,fAOD->GetCentrality()->GetCentralityPercentile("V0M"));  // qVector distribution\r
-    fHistMan->GetqVecHistogram(kHistqVecNeg)->Fill(qNeg,fAOD->GetCentrality()->GetCentralityPercentile("V0M"));  // qVector distribution\r
-    \r
-    //AliCentrality fAliCentral*;\r
-    //   if ((fAOD->GetCentrality())->GetCentralityPercentile("V0M") > 5.) return;\r
-    \r
-    // First do MC to fill up the MC particle array, such that we can use it later\r
-    TClonesArray *arrayMC = 0;\r
-    if (fIsMC)\r
-      {\r
-       arrayMC = (TClonesArray*) fAOD->GetList()->FindObject(AliAODMCParticle::StdBranchName());\r
-       if (!arrayMC) {\r
-         AliFatal("Error: MC particles branch not found!\n");\r
-       }\r
-       Int_t nMC = arrayMC->GetEntries();\r
-       for (Int_t iMC = 0; iMC < nMC; iMC++)\r
-         {\r
-           AliAODMCParticle *partMC = (AliAODMCParticle*) arrayMC->At(iMC);\r
-           if(!partMC->Charge()) continue;//Skip neutrals\r
-           if(TMath::Abs(partMC->Eta()) > fTrackCuts->GetEta()) continue;\r
-           \r
-           fHistMan->GetPtHistogram(kHistPtGen)->Fill(partMC->Pt(),partMC->IsPhysicalPrimary());\r
-           // check for true PID + and fill P_t histos \r
-           if (CheckYCut(partMC) ){// only primary vertices and y cut satisfied\r
-             if ( partMC->PdgCode() == 2212) { fHistMan->GetPtHistogram(kHistPtGenTruePrimaryProtonPlus)->Fill(partMC->Pt(),partMC->IsPhysicalPrimary()); } \r
-             if ( partMC->PdgCode() == -2212) { fHistMan->GetPtHistogram(kHistPtGenTruePrimaryProtonMinus)->Fill(partMC->Pt(),partMC->IsPhysicalPrimary()); } \r
-             if ( partMC->PdgCode() == 321)  { fHistMan->GetPtHistogram(kHistPtGenTruePrimaryKaonPlus)->Fill(partMC->Pt(),partMC->IsPhysicalPrimary()); } \r
-             if ( partMC->PdgCode() == -321) { fHistMan->GetPtHistogram(kHistPtGenTruePrimaryKaonMinus)->Fill(partMC->Pt(),partMC->IsPhysicalPrimary()); } \r
-             if ( partMC->PdgCode() == 211)  { fHistMan->GetPtHistogram(kHistPtGenTruePrimaryPionPlus)->Fill(partMC->Pt(),partMC->IsPhysicalPrimary()); } \r
-             if ( partMC->PdgCode() == -211) { fHistMan->GetPtHistogram(kHistPtGenTruePrimaryPionMinus)->Fill(partMC->Pt(),partMC->IsPhysicalPrimary()); } \r
-           }\r
-         }\r
+  // First do MC to fill up the MC particle array, such that we can use it later\r
+  TClonesArray *arrayMC = 0;\r
+  if (fIsMC)\r
+    {\r
+      arrayMC = (TClonesArray*) fAOD->GetList()->FindObject(AliAODMCParticle::StdBranchName());\r
+      if (!arrayMC) {\r
+       AliFatal("Error: MC particles branch not found!\n");\r
       }\r
-    \r
-    //main loop on tracks\r
-    for (Int_t iTracks = 0; iTracks < fAOD->GetNumberOfTracks(); iTracks++)\r
-      {\r
-       AliAODTrack* track = fAOD->GetTrack(iTracks);\r
-       if (!fTrackCuts->IsSelected(track)) continue;\r
-       \r
-       //cut on q vectors track-by-track\r
-       if ((qPos>fTrackCuts->GetQvecMin() && qPos<fTrackCuts->GetQvecMax() && track->Eta()<0) || (qNeg>fTrackCuts->GetQvecMin() && qNeg<fTrackCuts->GetQvecMax() && track->Eta()>=0)){\r
-         \r
-         //calculate DCA for AOD track\r
-         Double_t d[2], covd[3];\r
-         AliAODTrack* track_clone=(AliAODTrack*)track->Clone("track_clone"); // need to clone because PropagateToDCA updates the track parameters\r
-         Bool_t isDCA = track_clone->PropagateToDCA(fAOD->GetPrimaryVertex(),fAOD->GetMagneticField(),9999.,d,covd);\r
-         delete track_clone;\r
-         if(!isDCA)d[0]=-999;\r
-         \r
-         fHistMan->GetPtHistogram(kHistPtRec)->Fill(track->Pt(),d[0]);  // PT histo\r
-         //Response\r
-         fHistMan->GetPIDHistogram(kHistPIDTPC)->Fill(track->GetTPCmomentum(), track->GetTPCsignal()*track->Charge()); // PID histo\r
-         \r
-         AliVParticle *inEvHMain = dynamic_cast<AliVParticle *>(track);\r
-         Double_t nsigmaTPCkProton = TMath::Abs(fPIDResponse->NumberOfSigmasTPC(inEvHMain, AliPID::kProton));\r
-         Double_t nsigmaTPCkKaon = TMath::Abs(fPIDResponse->NumberOfSigmasTPC(inEvHMain, AliPID::kKaon)); \r
-         Double_t nsigmaTPCkPion = TMath::Abs(fPIDResponse->NumberOfSigmasTPC(inEvHMain, AliPID::kPion)); \r
-         Double_t nsigmaTOFkProton=0,nsigmaTOFkKaon=0,nsigmaTOFkPion=0;\r
-         if(track->Pt()>fTrackCuts->GetPtTOFMatching()){\r
-           fHistMan->GetPIDHistogram(kHistPIDTOF)->Fill(track->P(),(track->GetTOFsignal()/100)*track->Charge()); // PID histo\r
-           nsigmaTOFkProton = TMath::Abs(fPIDResponse->NumberOfSigmasTOF(inEvHMain, AliPID::kProton));\r
-           nsigmaTOFkKaon = TMath::Abs(fPIDResponse->NumberOfSigmasTOF(inEvHMain, AliPID::kKaon)); \r
-           nsigmaTOFkPion = TMath::Abs(fPIDResponse->NumberOfSigmasTOF(inEvHMain, AliPID::kPion)); \r
-           \r
-           //TOF\r
-           fHistMan->GetPtHistogram(kHistNSigProtonTOF)->Fill(track->P(),fPIDResponse->NumberOfSigmasTOF(inEvHMain, AliPID::kProton));\r
-           fHistMan->GetPtHistogram(kHistNSigKaonTOF)->Fill(track->P(),fPIDResponse->NumberOfSigmasTOF(inEvHMain, AliPID::kKaon));\r
-           fHistMan->GetPtHistogram(kHistNSigPionTOF)->Fill(track->P(),fPIDResponse->NumberOfSigmasTOF(inEvHMain, AliPID::kPion));\r
-           fHistMan->GetPtHistogram(kHistNSigProtonPtTOF)->Fill(track->Pt(),fPIDResponse->NumberOfSigmasTOF(inEvHMain, AliPID::kProton));\r
-           fHistMan->GetPtHistogram(kHistNSigKaonPtTOF)->Fill(track->Pt(),fPIDResponse->NumberOfSigmasTOF(inEvHMain, AliPID::kKaon));\r
-           fHistMan->GetPtHistogram(kHistNSigPionPtTOF)->Fill(track->Pt(),fPIDResponse->NumberOfSigmasTOF(inEvHMain, AliPID::kPion));\r
+      Int_t nMC = arrayMC->GetEntries();\r
+      for (Int_t iMC = 0; iMC < nMC; iMC++)\r
+       {\r
+         AliAODMCParticle *partMC = (AliAODMCParticle*) arrayMC->At(iMC);\r
+         if(!partMC->Charge()) continue;//Skip neutrals\r
+         if(TMath::Abs(partMC->Eta()) > fTrackCuts->GetEta()) continue;\r
+         fHistMan->GetPtHistogram(kHistPtGen)->Fill(partMC->Pt(),partMC->IsPhysicalPrimary());\r
+\r
+         if(TMath::Abs(partMC->Y())   > fTrackCuts->GetY()  ) continue;            \r
+         // check for true PID + and fill P_t histos \r
+         Int_t charge = partMC->Charge() > 0 ? kChPos : kChNeg ;\r
+         Int_t id = fPID->GetParticleSpecie(partMC);\r
+         if(id != kSpUndefined) {\r
+           fHistMan->GetHistogram2D(kHistPtGenTruePrimary,id,charge)->Fill(partMC->Pt(),partMC->IsPhysicalPrimary());\r
          }\r
+       }\r
+    }\r
+    \r
+  //main loop on tracks\r
+  for (Int_t iTracks = 0; iTracks < fAOD->GetNumberOfTracks(); iTracks++) {\r
+    AliAODTrack* track = fAOD->GetTrack(iTracks);\r
+    if (!fTrackCuts->IsSelected(track)) continue;\r
+    \r
+    fPID->FillQAHistos(fHistMan, track, fTrackCuts);\r
+\r
+    // //cut on q vectors track-by-track FIXME\r
+    // if ((qPos>fTrackCuts->GetQvecMin() && qPos<fTrackCuts->GetQvecMax() && track->Eta()<0) || (qNeg>fTrackCuts->GetQvecMin() && qNeg<fTrackCuts->GetQvecMax() && track->Eta()>=0)){\r
          \r
-         Double_t nsigmaTPCTOFkProton = TMath::Sqrt(nsigmaTPCkProton*nsigmaTPCkProton+nsigmaTOFkProton*nsigmaTOFkProton);\r
-         Double_t nsigmaTPCTOFkKaon = TMath::Sqrt(nsigmaTPCkKaon*nsigmaTPCkKaon+nsigmaTOFkKaon*nsigmaTOFkKaon);\r
-         Double_t nsigmaTPCTOFkPion = TMath::Sqrt(nsigmaTPCkPion*nsigmaTPCkPion+nsigmaTOFkPion*nsigmaTOFkPion);\r
+    //calculate DCA for AOD track\r
+    Double_t d[2], covd[3];\r
+    AliAODTrack* track_clone=(AliAODTrack*)track->Clone("track_clone"); // need to clone because PropagateToDCA updates the track parameters\r
+    Bool_t isDCA = track_clone->PropagateToDCA(fAOD->GetPrimaryVertex(),fAOD->GetMagneticField(),9999.,d,covd);\r
+    delete track_clone;\r
+    if(!isDCA)d[0]=-999;\r
          \r
-         //TPC\r
-         fHistMan->GetPtHistogram(kHistNSigProtonTPC)->Fill(track->P(),fPIDResponse->NumberOfSigmasTPC(inEvHMain, AliPID::kProton));\r
-         fHistMan->GetPtHistogram(kHistNSigKaonTPC)->Fill(track->P(),fPIDResponse->NumberOfSigmasTPC(inEvHMain, AliPID::kKaon));\r
-         fHistMan->GetPtHistogram(kHistNSigPionTPC)->Fill(track->P(),fPIDResponse->NumberOfSigmasTPC(inEvHMain, AliPID::kPion));\r
-         fHistMan->GetPtHistogram(kHistNSigProtonPtTPC)->Fill(track->Pt(),fPIDResponse->NumberOfSigmasTPC(inEvHMain, AliPID::kProton));\r
-         fHistMan->GetPtHistogram(kHistNSigKaonPtTPC)->Fill(track->Pt(),fPIDResponse->NumberOfSigmasTPC(inEvHMain, AliPID::kKaon));\r
-         fHistMan->GetPtHistogram(kHistNSigPionPtTPC)->Fill(track->Pt(),fPIDResponse->NumberOfSigmasTPC(inEvHMain, AliPID::kPion));\r
-         //TPCTOF\r
-         fHistMan->GetPtHistogram(kHistNSigProtonTPCTOF)->Fill(track->P(),nsigmaTPCTOFkProton);\r
-         fHistMan->GetPtHistogram(kHistNSigKaonTPCTOF)->Fill(track->P(),nsigmaTPCTOFkKaon);\r
-         fHistMan->GetPtHistogram(kHistNSigPionTPCTOF)->Fill(track->P(),nsigmaTPCTOFkPion);\r
-         fHistMan->GetPtHistogram(kHistNSigProtonPtTPCTOF)->Fill(track->Pt(),nsigmaTPCTOFkProton);\r
-         fHistMan->GetPtHistogram(kHistNSigKaonPtTPCTOF)->Fill(track->Pt(),nsigmaTPCTOFkKaon);\r
-         fHistMan->GetPtHistogram(kHistNSigPionPtTPCTOF)->Fill(track->Pt(),nsigmaTPCTOFkPion);\r
+    fHistMan->GetPtHistogram(kHistPtRec)->Fill(track->Pt(),d[0]);  // PT histo\r
          \r
+    // get identity and charge\r
+    Int_t idRec  = fPID->GetParticleSpecie(track, fTrackCuts);\r
+    if(idRec == kSpUndefined) continue;\r
+    Int_t charge = track->Charge() > 0 ? kChPos : kChNeg;\r
+\r
+    // rapidity cut\r
+    if(!fTrackCuts->CheckYCut ((AODParticleSpecies_t)idRec)) continue;\r
+\r
+    // Fill histograms\r
+    fHistMan->GetHistogram2D(kHistPtRecSigma,idRec,charge)->Fill(track->Pt(),d[0]);\r
          \r
-         if( ( nsigmaTPCTOFkKaon < nsigmaTPCTOFkPion ) && ( nsigmaTPCTOFkKaon < nsigmaTPCTOFkProton )) { \r
-           if ((nsigmaTPCTOFkKaon > fNSigmaPID) || (!CheckYCut(kSpKaon, track) ) ) continue;\r
-           if ( track->Charge() > 0 ) { fHistMan->GetPtHistogram(kHistPtRecSigmaKaonPlus)->Fill(track->Pt(),d[0]); } \r
-           else { fHistMan->GetPtHistogram(kHistPtRecSigmaKaonMinus)->Fill(track->Pt(),d[0]); } \r
-         }\r
-         if( ( nsigmaTPCTOFkProton < nsigmaTPCTOFkKaon ) && ( nsigmaTPCTOFkProton < nsigmaTPCTOFkPion ) ) {\r
-           if ( nsigmaTPCTOFkProton > fNSigmaPID || (!CheckYCut(kSpProton, track) ) )  continue;\r
-           if ( track->Charge() > 0 ) { fHistMan->GetPtHistogram(kHistPtRecSigmaProtonPlus)->Fill(track->Pt(),d[0]); }\r
-           else { fHistMan->GetPtHistogram(kHistPtRecSigmaProtonMinus)->Fill(track->Pt(),d[0]); }\r
-         }\r
-         if( (nsigmaTPCTOFkPion < nsigmaTPCTOFkProton ) && ( nsigmaTPCTOFkPion < nsigmaTPCTOFkKaon ) ) {\r
-           if (nsigmaTPCTOFkPion > fNSigmaPID || (!CheckYCut(kSpPion, track) ) ) continue;\r
-           if ( track->Charge() > 0 )  { fHistMan->GetPtHistogram(kHistPtRecSigmaPionPlus)->Fill(track->Pt(),d[0]); }\r
-           else  { fHistMan->GetPtHistogram(kHistPtRecSigmaPionMinus)->Fill(track->Pt(),d[0]); }\r
-         }\r
-         /* MC Part */\r
-         // MF 22/02/2012\r
-         // fill mc DCA vs pt\r
-         if (arrayMC) {\r
-           AliAODMCParticle *partMC = (AliAODMCParticle*) arrayMC->At(TMath::Abs(track->GetLabel()));\r
-           if (!partMC) { \r
-             AliError("Cannot get MC particle");\r
-             continue; }\r
-           if (partMC->IsPhysicalPrimary())fHistMan->GetPtHistogram(kHistPtRecPrimary)->Fill(track->Pt(),d[0]);  // PT histo\r
-           if (CheckYCut(partMC)){\r
-             // primaries, true pid\r
-             //25th Apr - nsigma cut added in addition to the PDG code\r
-             if ( partMC->PdgCode() == 2212 && nsigmaTPCTOFkProton < fNSigmaPID) { fHistMan->GetPtHistogram(kHistPtRecTrueProtonPlus)->Fill(track->Pt(),d[0]); \r
-               if (partMC->IsPhysicalPrimary()) {fHistMan->GetPtHistogram(kHistPtRecTruePrimaryProtonPlus)->Fill(track->Pt(),d[0]); }}\r
-             if ( partMC->PdgCode() == -2212 && nsigmaTPCTOFkProton < fNSigmaPID) { fHistMan->GetPtHistogram(kHistPtRecTrueProtonMinus)->Fill(track->Pt(),d[0]); \r
-               if (partMC->IsPhysicalPrimary()) {fHistMan->GetPtHistogram(kHistPtRecTruePrimaryProtonMinus)->Fill(track->Pt(),d[0]); }}\r
-             if ( partMC->PdgCode() == 321 && nsigmaTPCTOFkKaon < fNSigmaPID) { fHistMan->GetPtHistogram(kHistPtRecTrueKaonPlus)->Fill(track->Pt(),d[0]); \r
-               if (partMC->IsPhysicalPrimary()) {fHistMan->GetPtHistogram(kHistPtRecTruePrimaryKaonPlus)->Fill(track->Pt(),d[0]); }}\r
-             if ( partMC->PdgCode() == -321 && nsigmaTPCTOFkKaon < fNSigmaPID) { fHistMan->GetPtHistogram(kHistPtRecTrueKaonMinus)->Fill(track->Pt(),d[0]); \r
-               if (partMC->IsPhysicalPrimary()) {fHistMan->GetPtHistogram(kHistPtRecTruePrimaryKaonMinus)->Fill(track->Pt(),d[0]); }}\r
-             if ( partMC->PdgCode() == 211 && nsigmaTPCTOFkPion < fNSigmaPID) { fHistMan->GetPtHistogram(kHistPtRecTruePionPlus)->Fill(track->Pt(),d[0]); \r
-               if (partMC->IsPhysicalPrimary()) {fHistMan->GetPtHistogram(kHistPtRecTruePrimaryPionPlus)->Fill(track->Pt(),d[0]); }}\r
-             if ( partMC->PdgCode() == -211 && nsigmaTPCTOFkPion < fNSigmaPID) { fHistMan->GetPtHistogram(kHistPtRecTruePionMinus)->Fill(track->Pt(),d[0]);  \r
-               if (partMC->IsPhysicalPrimary()) {fHistMan->GetPtHistogram(kHistPtRecTruePrimaryPionMinus)->Fill(track->Pt(),d[0]); }}\r
-             //25th Apr - Muons are added to Pions\r
-             if ( partMC->PdgCode() == 13 && nsigmaTPCTOFkPion < fNSigmaPID) { \r
-               fHistMan->GetPtHistogram(kHistPtRecTrueMuonPlus)->Fill(track->Pt(),d[0]); \r
-               if (partMC->IsPhysicalPrimary()) {\r
-                 fHistMan->GetPtHistogram(kHistPtRecTruePrimaryMuonPlus)->Fill(track->Pt(),d[0]); \r
-               }}\r
-             if ( partMC->PdgCode() == -13 && nsigmaTPCTOFkPion < fNSigmaPID) { \r
-               fHistMan->GetPtHistogram(kHistPtRecTrueMuonMinus)->Fill(track->Pt(),d[0]); \r
-               if (partMC->IsPhysicalPrimary()) {\r
-                 fHistMan->GetPtHistogram(kHistPtRecTruePrimaryMuonMinus)->Fill(track->Pt(),d[0]); \r
-               }}\r
+    /* MC Part */\r
+    if (arrayMC) {\r
+      AliAODMCParticle *partMC = (AliAODMCParticle*) arrayMC->At(TMath::Abs(track->GetLabel()));\r
+      if (!partMC) { \r
+       AliError("Cannot get MC particle");\r
+       continue; \r
+      }\r
+      // Check if it is primary, secondary from material or secondary from weak decay\r
+      Bool_t isPrimary           = partMC->IsPhysicalPrimary();\r
+      Bool_t isSecondaryMaterial = kFALSE; \r
+      Bool_t isSecondaryWeak     = kFALSE; \r
+      if(!isPrimary) {\r
+       Int_t mfl=-999,codemoth=-999;\r
+       Int_t indexMoth=partMC->GetMother(); // FIXME ignore fakes? TO BE CHECKED, on ESD is GetFirstMother()\r
+       if(indexMoth>=0){//is not fake\r
+         AliAODMCParticle* moth = (AliAODMCParticle*) arrayMC->At(indexMoth);\r
+         codemoth = TMath::Abs(moth->GetPdgCode());\r
+         mfl = Int_t (codemoth/ TMath::Power(10, Int_t(TMath::Log10(codemoth))));\r
+       }\r
+       if(mfl==3) isSecondaryWeak     = kTRUE; // add if(partMC->GetStatus() & kPDecay)? FIXME\r
+       else       isSecondaryMaterial = kTRUE;\r
+      }\r
+\r
+\r
+      // Get true ID\r
+      Bool_t idGen     = fPID->GetParticleSpecie(partMC);\r
+      //           if(TMath::Abs(partMC->Y())   > fTrackCuts->GetY()  ) continue;          // FIXME: do we need a rapidity cut on the generated?\r
+\r
+      // Fill histograms for primaries\r
+      if (isPrimary) {\r
+       fHistMan                    ->GetHistogram2D(kHistPtRecPrimary,      idGen, charge)->Fill(track->Pt(),d[0]);  // PT histo\r
+       if (idRec == idGen) fHistMan->GetHistogram2D(kHistPtRecTruePrimary,  idGen, charge)->Fill(track->Pt(),d[0]); \r
+       fHistMan                    ->GetHistogram2D(kHistPtRecSigmaPrimary, idRec, charge)->Fill(track->Pt(),d[0]); \r
              \r
-             // primaries, sigma pid \r
-             if (partMC->IsPhysicalPrimary()) { \r
-               if( ( nsigmaTPCTOFkKaon < nsigmaTPCTOFkPion ) && ( nsigmaTPCTOFkKaon < nsigmaTPCTOFkProton ) ) {\r
-                 if ( (nsigmaTPCTOFkKaon > fNSigmaPID ) || (!CheckYCut(kSpKaon, track) ) ) continue; \r
-                 if ( track->Charge() > 0 ) { fHistMan->GetPtHistogram(kHistPtRecSigmaPrimaryKaonPlus)->Fill(track->Pt(),d[0]); } \r
-                 else { fHistMan->GetPtHistogram(kHistPtRecSigmaPrimaryKaonMinus)->Fill(track->Pt(),d[0]); } \r
-               }\r
-               if( ( nsigmaTPCTOFkProton < nsigmaTPCTOFkKaon ) && ( nsigmaTPCTOFkProton < nsigmaTPCTOFkPion ) ) {\r
-                 if ( (nsigmaTPCTOFkProton > fNSigmaPID ) || (!CheckYCut(kSpProton, track) ) ) continue;\r
-                 if ( track->Charge() > 0 ) { fHistMan->GetPtHistogram(kHistPtRecSigmaPrimaryProtonPlus)->Fill(track->Pt(),d[0]); }\r
-                 else { fHistMan->GetPtHistogram(kHistPtRecSigmaPrimaryProtonMinus)->Fill(track->Pt(),d[0]); }\r
-               }\r
-               if( (nsigmaTPCTOFkPion < nsigmaTPCTOFkProton ) && ( nsigmaTPCTOFkPion < nsigmaTPCTOFkKaon ) ) {\r
-                 if ( ( nsigmaTPCTOFkPion > fNSigmaPID )  || (!CheckYCut(kSpPion, track) ) ) continue;\r
-                 if ( track->Charge() > 0 )  { fHistMan->GetPtHistogram(kHistPtRecSigmaPrimaryPionPlus)->Fill(track->Pt(),d[0]); }\r
-                 else  { fHistMan->GetPtHistogram(kHistPtRecSigmaPrimaryPionMinus)->Fill(track->Pt(),d[0]); }\r
-               }\r
-             }//end if primaries\r
-             // MF 22/02/2012\r
-             // Distinguish weak decay and material\r
-             //done quickly, code can be improved\r
-             else {//to be added in a separate class\r
-               Int_t mfl=-999,codemoth=-999;\r
-               Int_t indexMoth=partMC->GetMother(); // FIXME ignore fakes? TO BE CHECKED, on ESD is GetFirstMother()\r
-               if(indexMoth>=0){//is not fake\r
-                 AliAODMCParticle* moth = (AliAODMCParticle*) arrayMC->At(indexMoth);\r
-                 codemoth = TMath::Abs(moth->GetPdgCode());\r
-                 mfl = Int_t (codemoth/ TMath::Power(10, Int_t(TMath::Log10(codemoth))));\r
-               }\r
-               //UInt_t flag; \r
-               //flag=partMC->GetStatus();\r
-               //Printf("FLAG: %d",flag);\r
-               //if(mfl==3 && (flag&AliAODMCParticle::kPDecay)!=0){//strangeness KPDecay not working on AOD, to be understood\r
-               //Printf("\n\n\n STRANGENESS!!!!!");\r
-               //if(codemoth!=-999)Printf("mfl:%d    codemoth%d",mfl,codemoth);\r
-               //if(codemoth==310 || codemoth==130 || codemoth==321 || codemoth==3122 || codemoth==3112 ||\r
-               //codemoth==3222 || codemoth==3312 || codemoth==3322 || codemoth==3334){//K0_S, K0_L, K^+-,lambda, sigma0,sigma+,xi-,xi0, omega\r
-               if(mfl==3){//strangeness\r
-                 if( ( nsigmaTPCkKaon < nsigmaTPCkPion ) && ( nsigmaTPCkKaon < nsigmaTPCkProton ) ) { \r
-                   if ( (nsigmaTPCkKaon > fNSigmaPID )  || (!CheckYCut(kSpKaon, track) ) ) continue;\r
-                   if ( track->Charge() > 0 ) { fHistMan->GetPtHistogram(kHistPtRecSigmaSecondaryWeakDecayKaonPlus)->Fill(track->Pt(),d[0]); } \r
-                   else { fHistMan->GetPtHistogram(kHistPtRecSigmaSecondaryWeakDecayKaonMinus)->Fill(track->Pt(),d[0]); } \r
-                 }\r
-                 if( ( nsigmaTPCkProton < nsigmaTPCkKaon ) && ( nsigmaTPCkProton < nsigmaTPCkPion ) ) {\r
-                   if ( (nsigmaTPCkProton > fNSigmaPID )  || (!CheckYCut(kSpProton, track) ) ) continue;\r
-                   if ( track->Charge() > 0 ) { fHistMan->GetPtHistogram(kHistPtRecSigmaSecondaryWeakDecayProtonPlus)->Fill(track->Pt(),d[0]); }\r
-                   else { fHistMan->GetPtHistogram(kHistPtRecSigmaSecondaryWeakDecayProtonMinus)->Fill(track->Pt(),d[0]); }\r
-                 }\r
-                 if( (nsigmaTPCkPion < nsigmaTPCkProton ) && ( nsigmaTPCkPion < nsigmaTPCkKaon ) ) {\r
-                   if ( ( nsigmaTPCkPion > fNSigmaPID )  || (!CheckYCut(kSpPion, track) ) ) continue;\r
-                   if ( track->Charge() > 0 )  { fHistMan->GetPtHistogram(kHistPtRecSigmaSecondaryWeakDecayPionPlus)->Fill(track->Pt(),d[0]); }\r
-                   else  { fHistMan->GetPtHistogram(kHistPtRecSigmaSecondaryWeakDecayPionMinus)->Fill(track->Pt(),d[0]); }\r
-                 }\r
-               }//end if strangeness\r
-               else{//material\r
-                 if( ( nsigmaTPCkKaon < nsigmaTPCkPion ) && ( nsigmaTPCkKaon < nsigmaTPCkProton ) ) { \r
-                   if ( (nsigmaTPCkKaon > fNSigmaPID )  || (!CheckYCut(kSpKaon, track) ) ) continue;\r
-                   if ( track->Charge() > 0 ) { fHistMan->GetPtHistogram(kHistPtRecSigmaSecondaryMaterialKaonPlus)->Fill(track->Pt(),d[0]); } \r
-                   else { fHistMan->GetPtHistogram(kHistPtRecSigmaSecondaryMaterialKaonMinus)->Fill(track->Pt(),d[0]); } \r
-                 }\r
-                 if( ( nsigmaTPCkProton < nsigmaTPCkKaon ) && ( nsigmaTPCkProton < nsigmaTPCkPion ) ) {\r
-                   if ( (nsigmaTPCkProton > fNSigmaPID )  || (!CheckYCut(kSpProton, track) ) ) continue;\r
-                   if ( track->Charge() > 0 ) { fHistMan->GetPtHistogram(kHistPtRecSigmaSecondaryMaterialProtonPlus)->Fill(track->Pt(),d[0]); }\r
-                   else { fHistMan->GetPtHistogram(kHistPtRecSigmaSecondaryMaterialProtonMinus)->Fill(track->Pt(),d[0]); }\r
-                 }\r
-                 if( (nsigmaTPCkPion < nsigmaTPCkProton ) && ( nsigmaTPCkPion < nsigmaTPCkKaon ) ) {\r
-                   if ( ( nsigmaTPCkPion > fNSigmaPID )  || (!CheckYCut(kSpPion, track) ) ) continue;\r
-                   if ( track->Charge() > 0 )  { fHistMan->GetPtHistogram(kHistPtRecSigmaSecondaryMaterialPionPlus)->Fill(track->Pt(),d[0]); }\r
-                   else  { fHistMan->GetPtHistogram(kHistPtRecSigmaSecondaryMaterialPionMinus)->Fill(track->Pt(),d[0]); }\r
-                 }\r
-               }//end if material\r
-             }//end else (IsPhysPrim)\r
-           }//end if(CheckY)\r
-         }//end if(arrayMC)\r
-       }//end if on q vector (track)\r
-      } // end loop on tracks\r
-  }//end if on q vector (event)\r
+      }\r
+      //25th Apr - Muons are added to Pions -- FIXME\r
+      if ( partMC->PdgCode() == 13 && idRec == kSpPion) { \r
+       fHistMan->GetPtHistogram(kHistPtRecTrueMuonPlus)->Fill(track->Pt(),d[0]); \r
+       if(isPrimary)\r
+         fHistMan->GetPtHistogram(kHistPtRecTruePrimaryMuonPlus)->Fill(track->Pt(),d[0]); \r
+      }\r
+      if ( partMC->PdgCode() == -13 && idRec == kSpPion) { \r
+       fHistMan->GetPtHistogram(kHistPtRecTrueMuonMinus)->Fill(track->Pt(),d[0]); \r
+       if (isPrimary) {\r
+         fHistMan->GetPtHistogram(kHistPtRecTruePrimaryMuonMinus)->Fill(track->Pt(),d[0]); \r
+       }\r
+      }\r
+\r
+      ///..... END FIXME\r
+\r
+      // Fill secondaries\r
+      if(isSecondaryWeak    )  fHistMan->GetHistogram2D(kHistPtRecSigmaSecondaryWeakDecay, idRec, charge)->Fill(track->Pt(),d[0]);\r
+      if(isSecondaryMaterial)  fHistMan->GetHistogram2D(kHistPtRecSigmaSecondaryMaterial , idRec, charge)->Fill(track->Pt(),d[0]);\r
+           \r
+    }//end if(arrayMC)\r
+  } // end loop on tracks\r
+  \r
   PostData(1, fHistMan);\r
   PostData(2, fEventCuts);\r
   PostData(3, fTrackCuts);\r
+  PostData(4, fTrackCuts);\r
 }\r
 \r
 //_________________________________________________________________\r
index e04139a..b0766e9 100644 (file)
@@ -18,6 +18,7 @@ class AliAODEvent;
 class AliSpectraAODHistoManager;\r
 class AliSpectraAODTrackCuts;\r
 class AliSpectraAODEventCuts;\r
+class AliSpectraAODPID;\r
 #include "AliSpectraAODHistoManager.h"\r
 #include "AliAnalysisTaskSE.h"\r
 \r
@@ -27,24 +28,20 @@ class AliAnalysisTaskSpectraAOD : public AliAnalysisTaskSE
 public:\r
 \r
    // constructors\r
-   AliAnalysisTaskSpectraAOD() : AliAnalysisTaskSE(), fAOD(0), fHistMan(0), fTrackCuts(0), fEventCuts(0), fIsMC(0), fPIDResponse(0), fNSigmaPID(0), fYCut(0) {}\r
+  AliAnalysisTaskSpectraAOD() : AliAnalysisTaskSE(), fAOD(0), fHistMan(0), fTrackCuts(0), fEventCuts(0), fPID(0), fIsMC(0)\r
+ {}\r
    AliAnalysisTaskSpectraAOD(const char *name);\r
    virtual ~AliAnalysisTaskSpectraAOD() {}\r
 \r
    void SetIsMC(Bool_t isMC = kFALSE)    {fIsMC = isMC; };\r
    Bool_t GetIsMC()           const           { return fIsMC;};\r
-   void SetNSigmaForIdentification (Double_t sigma ) { fNSigmaPID = sigma; }\r
-   Double_t GetNSigmaForIdentification () const {return fNSigmaPID; }\r
-   void SetYCut (Double_t y ) { fYCut = y; }\r
-   Double_t GetYCut () const {return fYCut; }\r
 \r
    virtual void   UserCreateOutputObjects();\r
-   Bool_t         CheckYCut(AliSpectraNameSpace::AODParticleSpecies_t species, AliAODTrack* track) const;\r
-   Bool_t         CheckYCut(AliAODMCParticle* particle) const;\r
    virtual void   UserExec(Option_t *option);\r
    virtual void   Terminate(Option_t *);\r
-   void SetTrackCuts(AliSpectraAODTrackCuts * tc)   {      fTrackCuts = tc;   }\r
-   void SetEventCuts(AliSpectraAODEventCuts * vc)   {      fEventCuts = vc;   }\r
+   void SetTrackCuts(AliSpectraAODTrackCuts * tc)   {   fTrackCuts = tc;   }\r
+   void SetEventCuts(AliSpectraAODEventCuts * vc)   {   fEventCuts = vc;   }\r
+   void SetPID      (AliSpectraAODPID      * pid)   {   fPID       = pid;  }\r
 \r
 private:\r
 \r
@@ -52,10 +49,8 @@ private:
    AliSpectraAODHistoManager      * fHistMan;       // Histogram Manager\r
    AliSpectraAODTrackCuts      * fTrackCuts;     // Track Cuts\r
    AliSpectraAODEventCuts      * fEventCuts;     // Event Cuts\r
+   AliSpectraAODPID             * fPID;// PID class\r
    Bool_t          fIsMC;// true if processing MC\r
-   AliPIDResponse                        *fPIDResponse;     // ! PID response object\r
-   Double_t        fNSigmaPID; // Maximum number of sigmas allowed in particle identification\r
-   Double_t        fYCut; // Maximum rapidity - calculated from identified particle's mass\r
    AliAnalysisTaskSpectraAOD(const AliAnalysisTaskSpectraAOD&);\r
    AliAnalysisTaskSpectraAOD& operator=(const AliAnalysisTaskSpectraAOD&);\r
 \r
index d050f58..76bfe56 100644 (file)
@@ -136,3 +136,34 @@ Long64_t AliSpectraAODEventCuts::Merge(TCollection* list)
   return count+1;
 }
 
+/// FIXME: Q vector
+  // //Selection on QVector, before ANY other selection on the event
+  // //Spectra MUST be normalized wrt events AFTER the selection on Qvector
+  // // Can we include this in fEventCuts
+  // Double_t Qx2EtaPos = 0, Qy2EtaPos = 0;
+  // Double_t Qx2EtaNeg = 0, Qy2EtaNeg = 0;
+  // Int_t multPos = 0;
+  // Int_t multNeg = 0;
+  // for(Int_t iT = 0; iT < fAOD->GetNumberOfTracks(); iT++) {
+  //   AliAODTrack* aodTrack = fAOD->GetTrack(iT);
+  //   if (!fTrackCuts->IsSelected(aodTrack)) continue;
+  //   if (aodTrack->Eta() >= 0){
+  //     multPos++;
+  //     Qx2EtaPos += TMath::Cos(2*aodTrack->Phi()); 
+  //     Qy2EtaPos += TMath::Sin(2*aodTrack->Phi());
+  //   } else {
+  //     multNeg++;
+  //     Qx2EtaNeg += TMath::Cos(2*aodTrack->Phi()); 
+  //     Qy2EtaNeg += TMath::Sin(2*aodTrack->Phi());
+  //   }
+  // } 
+  // Double_t qPos=-999;
+  // if(multPos!=0)qPos= TMath::Sqrt((Qx2EtaPos*Qx2EtaPos + Qy2EtaPos*Qy2EtaPos)/multPos);
+  // Double_t qNeg=-999;
+  // if(multNeg!=0)qNeg= TMath::Sqrt((Qx2EtaNeg*Qx2EtaNeg + Qy2EtaNeg*Qy2EtaNeg)/multNeg);
+  
+  // if((qPos>fTrackCuts->GetQvecMin() && qPos<fTrackCuts->GetQvecMax()) || (qNeg>fTrackCuts->GetQvecMin() && qNeg<fTrackCuts->GetQvecMax())){
+
+  //fill q distributions vs centrality, after all event selection
+  // fHistMan->GetqVecHistogram(kHistqVecPos)->Fill(qPos,fAOD->GetCentrality()->GetCentralityPercentile("V0M"));  // qVector distribution
+  // fHistMan->GetqVecHistogram(kHistqVecNeg)->Fill(qNeg,fAOD->GetCentrality()->GetCentralityPercentile("V0M"));  // qVector distribution
index 5264c43..03342c6 100644 (file)
@@ -250,6 +250,11 @@ TH1* AliSpectraAODHistoManager::GetHistogram1D(UInt_t histoType, UInt_t particle
   // GetHistogram using particle ID and histogram type
   Int_t baseId = -1;
 
+  if (particleType == kSpUndefined) {
+    AliError ("Trying to get histo for undefined particle");
+    return 0;
+  }
+
   switch(histoType) {
   case kHistPtGenTruePrimary:
     baseId = kHistPtGenTruePrimaryPionPlus;
@@ -269,6 +274,15 @@ TH1* AliSpectraAODHistoManager::GetHistogram1D(UInt_t histoType, UInt_t particle
   case kHistPtRecSigmaSecondaryWeakDecay:
     baseId = kHistPtRecSigmaSecondaryWeakDecayPionPlus;
     break;
+  case kHistNSigTPC:
+    baseId = kHistNSigPionTPC;
+    break;
+  case kHistNSigTOF:
+    baseId = kHistNSigPionTOF;
+    break;
+  case kHistNSigTPCTOF:
+    baseId = kHistNSigPionTPCTOF;
+    break;
   default:
     baseId = -1;
   }
index 2fdc208..f5d48ed 100644 (file)
 class AliAODEvent;
 class TH1F;
 class TH2F;
-class TList;
+class TH1;
+class TH2;
+//class TList;
 #include "TNamed.h"
+#include "TList.h"
 #include "Histograms.h" // Change this file if you want to add an histogram
 #include "HistogramNames.h"
 
@@ -31,6 +34,7 @@ namespace AliSpectraNameSpace
      kSpKaon,
      kSpProton,
      kNSpecies,
+     kSpUndefined,
    }; // Particle species used in plotting
 
    const char * kParticleSpecies[] =
@@ -51,6 +55,9 @@ namespace AliSpectraNameSpace
      kHistPtRecSigmaPrimary,
      kHistPtRecSigmaSecondaryMaterial,
      kHistPtRecSigmaSecondaryWeakDecay,
+     kHistNSigTPC,
+     kHistNSigTOF,
+     kHistNSigTPCTOF,
      kNHistoTypes
    }; // Types of histos
 
diff --git a/PWGLF/SPECTRA/PiKaPr/TestAOD/AliSpectraAODPID.cxx b/PWGLF/SPECTRA/PiKaPr/TestAOD/AliSpectraAODPID.cxx
new file mode 100644 (file)
index 0000000..d4ee35b
--- /dev/null
@@ -0,0 +1,170 @@
+#include "AliSpectraAODPID.h"
+#include "AliAODEvent.h"      
+#include "TH1F.h"             
+#include "TH2F.h"             
+#include "TList.h"            
+#include "AliAODTrack.h"      
+#include "AliAODMCParticle.h" 
+#include "AliPIDResponse.h"   
+#include "AliAnalysisManager.h"
+#include "AliInputEventHandler.h"
+#include "AliSpectraAODTrackCuts.h"
+
+ClassImp(AliSpectraAODPID)
+
+AliSpectraAODPID::AliSpectraAODPID() : TObject(), fPIDType(kNSigmaTPCTOF), fNSigmaPID(3), fPIDResponse(0) {
+
+}
+
+AliSpectraAODPID::AliSpectraAODPID(AODPIDType_t pidType) : TObject(), fPIDType(pidType), fNSigmaPID(3), fPIDResponse(0) {
+
+
+
+}
+
+
+
+void AliSpectraAODPID::FillQAHistos(AliSpectraAODHistoManager * hman, AliAODTrack * track, AliSpectraAODTrackCuts * trackCuts) {
+
+  // fill a bunch of QA histos
+
+
+  // Get PID response object, if needed
+  if(!fPIDResponse) {
+    AliAnalysisManager *man = AliAnalysisManager::GetAnalysisManager();
+    AliInputEventHandler* inputHandler = (AliInputEventHandler*)(man->GetInputEventHandler());
+    fPIDResponse = inputHandler->GetPIDResponse();
+  }
+  
+  //Response
+  AliVParticle *inEvHMain = dynamic_cast<AliVParticle *>(track);
+
+  hman->GetPIDHistogram(kHistPIDTPC)->Fill(track->GetTPCmomentum(), track->GetTPCsignal()*track->Charge()); // PID histo
+
+
+  Double_t nsigmaTPCkProton = TMath::Abs(fPIDResponse->NumberOfSigmasTPC(inEvHMain, AliPID::kProton));
+  Double_t nsigmaTPCkKaon = TMath::Abs(fPIDResponse->NumberOfSigmasTPC(inEvHMain, AliPID::kKaon)); 
+  Double_t nsigmaTPCkPion = TMath::Abs(fPIDResponse->NumberOfSigmasTPC(inEvHMain, AliPID::kPion)); 
+  Double_t nsigmaTOFkProton=0,nsigmaTOFkKaon=0,nsigmaTOFkPion=0;
+
+  if(track->Pt()>trackCuts->GetPtTOFMatching()){
+    hman->GetPIDHistogram(kHistPIDTOF)->Fill(track->P(),(track->GetTOFsignal()/100)*track->Charge()); // PID histo
+    nsigmaTOFkProton = TMath::Abs(fPIDResponse->NumberOfSigmasTOF(inEvHMain, AliPID::kProton));
+    nsigmaTOFkKaon = TMath::Abs(fPIDResponse->NumberOfSigmasTOF(inEvHMain, AliPID::kKaon)); 
+    nsigmaTOFkPion = TMath::Abs(fPIDResponse->NumberOfSigmasTOF(inEvHMain, AliPID::kPion)); 
+    
+    //TOF
+    hman->GetPtHistogram(kHistNSigProtonTOF)->Fill(track->P(),fPIDResponse->NumberOfSigmasTOF(inEvHMain, AliPID::kProton));
+    hman->GetPtHistogram(kHistNSigKaonTOF)->Fill(track->P(),fPIDResponse->NumberOfSigmasTOF(inEvHMain, AliPID::kKaon));
+    hman->GetPtHistogram(kHistNSigPionTOF)->Fill(track->P(),fPIDResponse->NumberOfSigmasTOF(inEvHMain, AliPID::kPion));
+    hman->GetPtHistogram(kHistNSigProtonPtTOF)->Fill(track->Pt(),fPIDResponse->NumberOfSigmasTOF(inEvHMain, AliPID::kProton));
+    hman->GetPtHistogram(kHistNSigKaonPtTOF)->Fill(track->Pt(),fPIDResponse->NumberOfSigmasTOF(inEvHMain, AliPID::kKaon));
+    hman->GetPtHistogram(kHistNSigPionPtTOF)->Fill(track->Pt(),fPIDResponse->NumberOfSigmasTOF(inEvHMain, AliPID::kPion));
+  }
+  
+  Double_t nsigmaTPCTOFkProton = TMath::Sqrt(nsigmaTPCkProton*nsigmaTPCkProton+nsigmaTOFkProton*nsigmaTOFkProton);
+  Double_t nsigmaTPCTOFkKaon = TMath::Sqrt(nsigmaTPCkKaon*nsigmaTPCkKaon+nsigmaTOFkKaon*nsigmaTOFkKaon);
+  Double_t nsigmaTPCTOFkPion = TMath::Sqrt(nsigmaTPCkPion*nsigmaTPCkPion+nsigmaTOFkPion*nsigmaTOFkPion);
+  
+  //TPC
+  hman->GetPtHistogram(kHistNSigProtonTPC)->Fill(track->P(),fPIDResponse->NumberOfSigmasTPC(inEvHMain, AliPID::kProton));
+  hman->GetPtHistogram(kHistNSigKaonTPC)->Fill(track->P(),fPIDResponse->NumberOfSigmasTPC(inEvHMain, AliPID::kKaon));
+  hman->GetPtHistogram(kHistNSigPionTPC)->Fill(track->P(),fPIDResponse->NumberOfSigmasTPC(inEvHMain, AliPID::kPion));
+  hman->GetPtHistogram(kHistNSigProtonPtTPC)->Fill(track->Pt(),fPIDResponse->NumberOfSigmasTPC(inEvHMain, AliPID::kProton));
+  hman->GetPtHistogram(kHistNSigKaonPtTPC)->Fill(track->Pt(),fPIDResponse->NumberOfSigmasTPC(inEvHMain, AliPID::kKaon));
+  hman->GetPtHistogram(kHistNSigPionPtTPC)->Fill(track->Pt(),fPIDResponse->NumberOfSigmasTPC(inEvHMain, AliPID::kPion));
+  //TPCTOF
+  hman->GetPtHistogram(kHistNSigProtonTPCTOF)->Fill(track->P(),nsigmaTPCTOFkProton);
+  hman->GetPtHistogram(kHistNSigKaonTPCTOF)->Fill(track->P(),nsigmaTPCTOFkKaon);
+  hman->GetPtHistogram(kHistNSigPionTPCTOF)->Fill(track->P(),nsigmaTPCTOFkPion);
+  hman->GetPtHistogram(kHistNSigProtonPtTPCTOF)->Fill(track->Pt(),nsigmaTPCTOFkProton);
+  hman->GetPtHistogram(kHistNSigKaonPtTPCTOF)->Fill(track->Pt(),nsigmaTPCTOFkKaon);
+  hman->GetPtHistogram(kHistNSigPionPtTPCTOF)->Fill(track->Pt(),nsigmaTPCTOFkPion);
+
+}
+
+Int_t AliSpectraAODPID::GetParticleSpecie(AliAODMCParticle * part) {
+  // return PID according to MC truth
+  switch(TMath::Abs(part->PdgCode())){
+  case 2212:
+    return kSpProton;
+    break;
+  case 321:
+    return kSpKaon;
+    break;
+  case 211:
+    return kSpPion;
+    break;
+  default:
+    return kSpUndefined;
+  } 
+}
+
+
+Int_t AliSpectraAODPID::GetParticleSpecie(AliAODTrack      * trk, AliSpectraAODTrackCuts * trackCuts) {
+  // return PID according to detectors
+  
+  // Get PID response object, if needed
+  if(!fPIDResponse) {
+    AliAnalysisManager *man = AliAnalysisManager::GetAnalysisManager();
+    AliInputEventHandler* inputHandler = (AliInputEventHandler*)(man->GetInputEventHandler());
+    fPIDResponse = inputHandler->GetPIDResponse();
+  }
+
+  if(!fPIDResponse) {
+    AliFatal("Cannot get pid response");
+    return 0;
+  }
+
+
+  // Compute nsigma for each hypthesis
+  AliVParticle *inEvHMain = dynamic_cast<AliVParticle *>(trk);
+
+  // --- TPC
+  Double_t nsigmaTPCkProton = TMath::Abs(fPIDResponse->NumberOfSigmasTPC(inEvHMain, AliPID::kProton));
+  Double_t nsigmaTPCkKaon   = TMath::Abs(fPIDResponse->NumberOfSigmasTPC(inEvHMain, AliPID::kKaon)); 
+  Double_t nsigmaTPCkPion   = TMath::Abs(fPIDResponse->NumberOfSigmasTPC(inEvHMain, AliPID::kPion)); 
+  // --- TOF
+  Double_t nsigmaTOFkProton=0,nsigmaTOFkKaon=0,nsigmaTOFkPion=0;
+  if(trk->Pt()>trackCuts->GetPtTOFMatching()){
+    nsigmaTOFkProton = TMath::Abs(fPIDResponse->NumberOfSigmasTOF(inEvHMain, AliPID::kProton));
+    nsigmaTOFkKaon   = TMath::Abs(fPIDResponse->NumberOfSigmasTOF(inEvHMain, AliPID::kKaon)); 
+    nsigmaTOFkPion   = TMath::Abs(fPIDResponse->NumberOfSigmasTOF(inEvHMain, AliPID::kPion)); 
+  }
+         
+  // --- combined
+  Double_t nsigmaTPCTOFkProton = TMath::Sqrt(nsigmaTPCkProton*nsigmaTPCkProton+nsigmaTOFkProton*nsigmaTOFkProton);
+  Double_t nsigmaTPCTOFkKaon   = TMath::Sqrt(nsigmaTPCkKaon*nsigmaTPCkKaon+nsigmaTOFkKaon*nsigmaTOFkKaon);
+  Double_t nsigmaTPCTOFkPion   = TMath::Sqrt(nsigmaTPCkPion*nsigmaTPCkPion+nsigmaTOFkPion*nsigmaTOFkPion);
+
+
+  // select the nsigma to be used for the actual PID
+  Double_t nsigmaPion, nsigmaKaon, nsigmaProton;
+
+  switch (fPIDType) {
+  case kNSigmaTPC:
+    nsigmaProton  =  nsigmaTPCkProton;
+    nsigmaKaon   =  nsigmaTPCkKaon  ;
+    nsigmaPion    =  nsigmaTPCkPion  ;
+    break;
+  case kNSigmaTOF:
+    nsigmaProton  =  nsigmaTOFkProton;
+    nsigmaKaon   =  nsigmaTOFkKaon  ;
+    nsigmaPion    =  nsigmaTOFkPion  ;
+    break;
+  case kNSigmaTPCTOF:
+    nsigmaProton  =  nsigmaTPCTOFkProton;
+    nsigmaKaon   =  nsigmaTPCTOFkKaon  ;
+    nsigmaPion    =  nsigmaTPCTOFkPion  ;
+    break;
+  }
+
+  // guess the particle based on the smaller nsigma
+  if( ( nsigmaKaon   < nsigmaPion ) && ( nsigmaKaon < nsigmaProton ) && (nsigmaKaon   < fNSigmaPID)) return kSpKaon;
+  if( ( nsigmaPion   < nsigmaKaon ) && ( nsigmaPion < nsigmaProton ) && (nsigmaPion   < fNSigmaPID)) return kSpPion;
+  if( ( nsigmaProton < nsigmaKaon ) && ( nsigmaProton < nsigmaPion ) && (nsigmaProton < fNSigmaPID)) return kSpProton;
+
+  // else, return undefined
+  return kSpUndefined;
+
+}
diff --git a/PWGLF/SPECTRA/PiKaPr/TestAOD/AliSpectraAODPID.h b/PWGLF/SPECTRA/PiKaPr/TestAOD/AliSpectraAODPID.h
new file mode 100644 (file)
index 0000000..7ed647f
--- /dev/null
@@ -0,0 +1,71 @@
+
+#ifndef ALISPECTRAAODPID_H
+#define ALISPECTRAAODPID_H
+
+/*  See cxx source for full Copyright notice */
+
+//-------------------------------------------------------------------------
+//                      AliSpectraAODPID
+//
+//
+//
+//
+// Authors: Michele Floris, CERN, Leonardo Milano, Torino
+//-------------------------------------------------------------------------
+
+class AliAODEvent;
+class TH1F;
+class TH2F;
+class TList;
+class AliAODTrack;
+class AliAODMCParticle;
+class AliPIDResponse;  
+class AliSpectraAODTrackCuts; 
+
+#include "TNamed.h"
+#include "AliSpectraAODHistoManager.h" 
+
+namespace AliSpectraNameSpace {
+
+  enum AODPIDType_t
+   {
+       kNSigmaTPC,
+       kNSigmaTOF,
+       kNSigmaTPCTOF, // squared sum
+   };
+
+
+
+}
+
+using namespace AliSpectraNameSpace;
+
+class AliSpectraAODPID : public TObject
+{
+public:
+  AliSpectraAODPID() ;
+  AliSpectraAODPID(AODPIDType_t pidType);
+  virtual  ~AliSpectraAODPID() {}
+
+  void FillQAHistos(AliSpectraAODHistoManager * hman, AliAODTrack * track, AliSpectraAODTrackCuts * trackCuts) ;
+  void SetNSigmaCut(Float_t nsigma) { fNSigmaPID = nsigma; }
+
+  Int_t GetParticleSpecie(AliAODTrack      * trk, AliSpectraAODTrackCuts * trackCuts);
+  Int_t GetParticleSpecie(AliAODMCParticle * trk);
+  
+
+private:
+
+  AODPIDType_t fPIDType; // PID type
+  Float_t fNSigmaPID; // number of sigma for PID cut
+  AliPIDResponse   *fPIDResponse;     // ! PID response object
+
+
+  AliSpectraAODPID(const AliSpectraAODPID&);
+  AliSpectraAODPID& operator=(const AliSpectraAODPID&);
+
+  ClassDef(AliSpectraAODPID, 1);
+
+};
+#endif
+
index 75a7072..d5d1937 100644 (file)
@@ -41,7 +41,8 @@ using namespace std;
 ClassImp(AliSpectraAODTrackCuts)
 
 
-AliSpectraAODTrackCuts::AliSpectraAODTrackCuts(const char *name) : TNamed(name, "AOD Track Cuts"), fIsSelected(0), fTrackBits(0), fEtaCut(0), fDCACut(0), fPCut(0), fPtCut(0), fPtCutTOFMatching(0),fQvecCutMin(0),fQvecCutMax(0), fHistoCuts(0), fTrack(0)
+AliSpectraAODTrackCuts::AliSpectraAODTrackCuts(const char *name) : TNamed(name, "AOD Track Cuts"), fIsSelected(0), fTrackBits(0), fEtaCut(0), fDCACut(0), fPCut(0), fPtCut(0), fYCut(0),
+ fPtCutTOFMatching(0),fQvecCutMin(0),fQvecCutMax(0), fHistoCuts(0), fTrack(0)
 
 {
    // Constructor
@@ -53,6 +54,7 @@ AliSpectraAODTrackCuts::AliSpectraAODTrackCuts(const char *name) : TNamed(name,
    fPtCutTOFMatching=0.6; //default value fot matching with TOF
    fQvecCutMin = -100000.0; // default value of qvec cut ~ no cut 
    fQvecCutMax = 100000.0; // default value of qvec cut ~ no cut 
+   fYCut       = 100000.0; // default value of y cut ~ no cut 
    
 }
 
@@ -86,6 +88,17 @@ Bool_t AliSpectraAODTrackCuts::CheckEtaCut()
    fHistoCuts->Fill(kTrkEta);
    return kFALSE;
 }
+
+Bool_t AliSpectraAODTrackCuts::CheckYCut(AODParticleSpecies_t species) 
+{
+  // check if the rapidity is within the set range
+  Double_t y;
+  if (species == kSpProton) { y = fTrack->Y(9.38271999999999995e-01); }
+  if ( species == kSpKaon ) { y = fTrack->Y(4.93676999999999977e-01); }
+  if ( species == kSpPion)  { y = fTrack->Y(1.39570000000000000e-01); }
+  if (TMath::Abs(y) > fYCut || y < -998.) return kFALSE;
+  return kTRUE;
+}
 //_______________________________________________________
 Bool_t AliSpectraAODTrackCuts::CheckDCACut()
 {
index ed8eda3..392469c 100644 (file)
 
 class AliAODEvent;
 class AliSpectraAODHistoManager;
-
+#include "AliAODMCParticle.h"
+#include "AliSpectraAODHistoManager.h"
 #include "TNamed.h"
 
+using namespace AliSpectraNameSpace;
+
 class AliSpectraAODTrackCuts : public TNamed
 {
 public:
@@ -29,11 +32,12 @@ public:
    AliSpectraAODTrackCuts(const char *name);
    virtual  ~AliSpectraAODTrackCuts() {} // To be implemented
 
-   Bool_t IsSelected(AliAODTrack * track);
+  Bool_t IsSelected(AliAODTrack * track);
 
    void SetTrackType(UInt_t bit);
    Bool_t CheckTrackType();
    Bool_t CheckEtaCut();
+   Bool_t CheckYCut(AODParticleSpecies_t specie); // not included in standard cuts
    Bool_t CheckDCACut();
    Bool_t CheckPCut();
    Bool_t CheckPtCut();
@@ -46,10 +50,12 @@ public:
    void SetDCA(Float_t dca)   { fDCACut = dca; }
    void SetP(Float_t p)       { fPCut = p; }
    void SetPt(Float_t pt)     { fPtCut = pt; }
+   void SetY(Float_t y) { fYCut = y;}
    void SetPtTOFMatching(Float_t pt)     { fPtCutTOFMatching = pt; }
    void SetQvecMin(Float_t qvecmin)     { fQvecCutMin = qvecmin; }
    void SetQvecMax(Float_t qvecmax)     { fQvecCutMax = qvecmax; }
    Float_t GetEta()       const    { return fEtaCut; }
+   Float_t GetY()         const    { return fYCut; }
    Float_t GetDCA()       const    { return fDCACut; }
    Float_t GetP()         const    { return fPCut; }
    Float_t GetPt()        const    { return fPtCut; }
@@ -62,18 +68,19 @@ public:
    
  private:
    
-   Bool_t         fIsSelected;      // True if cuts are selected
-   UInt_t         fTrackBits;       // Type of track to be used
-   Float_t        fEtaCut;          // Allowed absolute maximum value of Eta
-   Float_t        fDCACut;          // Maximum value of DCA
-   Float_t        fPCut;            // Maximum value of P
-   Float_t        fPtCut;           // Maximum value of Pt
-   Float_t        fPtCutTOFMatching;           // TOF Matching
-   Float_t        fQvecCutMin;           // Minimum value of Qvec, done in the analysis task
-   Float_t        fQvecCutMax;           // Minimum value of Qvec, done in the analysis task
-   
-   TH1I *         fHistoCuts;       // Cuts statistics
-   AliAODTrack *  fTrack;           //! Track pointer
+   Bool_t           fIsSelected;      // True if cuts are selected
+   UInt_t           fTrackBits;       // Type of track to be used
+   Float_t          fEtaCut;          // Allowed absolute maximum value of Eta
+   Float_t          fDCACut;          // Maximum value of DCA
+   Float_t          fPCut;            // Maximum value of P
+   Float_t          fPtCut;           // Maximum value of Pt
+   Float_t          fYCut;           // Maximum value of Y
+   Float_t          fPtCutTOFMatching;           // TOF Matching
+   Float_t          fQvecCutMin;           // Minimum value of Qvec
+   Float_t          fQvecCutMax;           // Minimum value of Qvec
+   AliPIDResponse   *fPIDResponse; // PID response  
+   TH1I             *fHistoCuts;       // Cuts statistics
+   AliAODTrack      *fTrack;           //! Track pointer
    
    AliSpectraAODTrackCuts(const AliSpectraAODTrackCuts&);
    AliSpectraAODTrackCuts& operator=(const AliSpectraAODTrackCuts&);
index 4b48f85..15d85ae 100644 (file)
@@ -1,32 +1,18 @@
 void run()
 {
 
-   gSystem->Load("libTree.so");
-   gSystem->Load("libGeom.so");
-   gSystem->Load("libVMC.so");
-   gSystem->Load("libPhysics.so");
-   gSystem->Load("libSTEERBase.so");
-   gSystem->Load("libESD.so");
-   gSystem->Load("libAOD.so");
-   gSystem->Load("libANALYSIS.so");
-   gSystem->Load("libANALYSISalice.so");
-   gSystem->Load("libANALYSIS");
-   gSystem->Load("libANALYSISalice");
-   gROOT->LoadMacro("$ALICE_ROOT/PWG0/CreateESDChain.C");
-   gSystem->AddIncludePath("-I$ALICE_ROOT/include");
-   gStyle->SetPalette(1);
-   gStyle->SetFillColor(kWhite);
-
-   gROOT->LoadMacro("AliSpectraAODTrackCuts.cxx+g");
-   gROOT->LoadMacro("AliSpectraAODEventCuts.cxx+g");
-   gROOT->LoadMacro("AliSpectraAODHistoManager.cxx+g");
-   gROOT->LoadMacro("AliAnalysisTaskSpectraAOD.cxx+g");
-
-
-
-
-
-
 
+  LoadLibs();
+
+  gROOT->LoadMacro("$ALICE_ROOT/PWG0/CreateESDChain.C");
+  gSystem->AddIncludePath("-I$ALICE_ROOT/include");
+  gStyle->SetPalette(1);
+  gStyle->SetFillColor(kWhite);
+  
+  gROOT->LoadMacro("AliSpectraAODTrackCuts.cxx+g");
+  gROOT->LoadMacro("AliSpectraAODEventCuts.cxx+g");
+  gROOT->LoadMacro("AliSpectraAODHistoManager.cxx+g");
+  gROOT->LoadMacro("AliSpectraAODPID.cxx+g");
+  gROOT->LoadMacro("AliAnalysisTaskSpectraAOD.cxx+g");
 
 }
index a0fd8b2..c05c026 100644 (file)
@@ -80,11 +80,16 @@ void runAODProof(Int_t c=2, const char * proofMode = "full")
    // Double_t CentCutMax[4]={10,20,30,40};
    // Double_t QvecCutMin[4]={0,0,0,0};
    // Double_t QvecCutMax[4]={100,100,100,100};
+   AliSpectraAODPID * pid = new AliSpectraAODPID(AODPIDType_t::kNSigmaTPCTOF);
+   pid->SetNSigmaCut(5.);
+
    for(Int_t iCut=1;iCut<2;iCut++){
      AliAnalysisTaskSpectraAOD *task = new AliAnalysisTaskSpectraAOD("TaskAODExercise");
      mgr->AddTask(task);
      //physics selection
      task->SelectCollisionCandidates();     
+     // set pid object
+     task->SetPID(pid);
      // Set the cuts
      AliSpectraAODEventCuts * vcuts = new AliSpectraAODEventCuts("Event Cuts");
      AliSpectraAODTrackCuts  * tcuts = new AliSpectraAODTrackCuts("Track Cuts");
@@ -100,7 +105,6 @@ void runAODProof(Int_t c=2, const char * proofMode = "full")
      vcuts->SetCentralityCutMin(CentCutMin[iCut]);
      task->SetEventCuts(vcuts);
      task->SetTrackCuts(tcuts);
-     task->SetNSigmaForIdentification(5.); // FIXME
      task->SetYCut(.5);
      vcuts->PrintCuts();
      tcuts->PrintCuts();
@@ -116,6 +120,8 @@ void runAODProof(Int_t c=2, const char * proofMode = "full")
                                                                     Form("Pt.AOD.1._MC_Cent%.0fto%.0f_QVec%.1fto%.1f.root",CentCutMin[iCut],CentCutMax[iCut],QvecCutMin[iCut],QvecCutMax[iCut]));
         AliAnalysisDataContainer *coutputpt3 = mgr->CreateContainer(Form("ctcutpt%d",iCut), AliSpectraAODTrackCuts::Class(),     AliAnalysisManager::kOutputContainer, 
                                                                     Form("Pt.AOD.1._MC_Cent%.0fto%.0f_QVec%.1fto%.1f.root",CentCutMin[iCut],CentCutMax[iCut],QvecCutMin[iCut],QvecCutMax[iCut]));
+        AliAnalysisDataContainer *coutputpt4 = mgr->CreateContainer(Form("cpidpt%d",iCut),  AliSpectraAODPID::Class(),     AliAnalysisManager::kOutputContainer, 
+                                                                    Form("Pt.AOD.1._MC_Cent%.0fto%.0f_QVec%.1fto%.1f.root",CentCutMin[iCut],CentCutMax[iCut],QvecCutMin[iCut],QvecCutMax[iCut]));
        }
      if (c == 1 || c==3)
        {
@@ -126,12 +132,15 @@ void runAODProof(Int_t c=2, const char * proofMode = "full")
                                                                     Form("Pt.AOD.1._data_ptcut_Cent%.0fto%.0f_QVec%.1fto%.1f.root",CentCutMin[iCut],CentCutMax[iCut],QvecCutMin[iCut],QvecCutMax[iCut]));
         AliAnalysisDataContainer *coutputpt3 = mgr->CreateContainer(Form("ctcutpt%d",iCut), AliSpectraAODTrackCuts::Class(),     AliAnalysisManager::kOutputContainer, 
                                                                     Form("Pt.AOD.1._data_ptcut_Cent%.0fto%.0f_QVec%.1fto%.1f.root",CentCutMin[iCut],CentCutMax[iCut],QvecCutMin[iCut],QvecCutMax[iCut]));
+        AliAnalysisDataContainer *coutputpt4 = mgr->CreateContainer(Form("cpidpt%d",iCut),  AliSpectraAODPID::Class(),     AliAnalysisManager::kOutputContainer, 
+                                                                    Form("Pt.AOD.1._data_Cent%.0fto%.0f_QVec%.1fto%.1f.root",CentCutMin[iCut],CentCutMax[iCut],QvecCutMin[iCut],QvecCutMax[iCut]));
         
        }
      mgr->ConnectInput(task, 0, cinput);
      mgr->ConnectOutput(task, 1, coutputpt1);
      mgr->ConnectOutput(task, 2, coutputpt2);
      mgr->ConnectOutput(task, 3, coutputpt3);
+     mgr->ConnectOutput(task, 4, coutputpt4);
    }
    mgr->SetDebugLevel(2);
    
index 7f39992..5426210 100644 (file)
@@ -3,6 +3,7 @@ void runAODProof(Int_t c, const char * proofMode = "full")
 
    gEnv->SetValue("XSec.GSI.DelegProxy", "2");
 
+   gSystem->Load("libMinuit.so");
    gSystem->Load("libTree.so");
    gSystem->Load("libGeom.so");
    gSystem->Load("libVMC.so");
@@ -20,9 +21,10 @@ void runAODProof(Int_t c, const char * proofMode = "full")
    handler->SetOverwriteMode();
    handler->SetRunMode(proofMode);
    handler->SetProofReset(0);
-   handler->SetAliROOTVersion("v4-21-29-AN");
+   handler->SetAliROOTVersion("v5-02-20-AN");
 
-   handler->SetProofCluster(Form("%s@alice-caf.cern.ch", gSystem->Getenv("CAFUSER")));
+   //   handler->SetProofCluster(Form("%s@alice-caf.cern.ch", gSystem->Getenv("CAFUSER")));
+   handler->SetProofCluster("alice-caf.cern.ch");
 //   handler->SetProofCluster(Form("%s@skaf.saske.sk",gSystem->Getenv("CAFUSER")));
 
    // Set handler for Real DATA: