]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Add PID code
authorakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 28 Jul 2011 15:40:36 +0000 (15:40 +0000)
committerakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 28 Jul 2011 15:40:36 +0000 (15:40 +0000)
PWG2/FEMTOSCOPY/AliFemto/AliAnalysisTaskFemto.cxx
PWG2/FEMTOSCOPY/AliFemto/AliAnalysisTaskFemto.h
PWG2/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticlePID.cxx
PWG2/FEMTOSCOPY/AliFemto/AliFemtoCutMonitorParticlePID.h
PWG2/FEMTOSCOPY/AliFemto/AliFemtoEventReaderAOD.cxx
PWG2/FEMTOSCOPY/AliFemto/AliFemtoEventReaderAOD.h
PWG2/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESDChain.cxx
PWG2/FEMTOSCOPY/AliFemto/AliFemtoEventReaderESDChain.h
PWG2/FEMTOSCOPY/AliFemto/AliFemtoTrack.cxx
PWG2/FEMTOSCOPY/AliFemto/AliFemtoTrack.h

index bb5511c50944eceeb50571eb85ec0ba7cd30fbdf..ae6cbf6f5958c4e0c6e582c291835a45aa61fabf 100644 (file)
@@ -41,7 +41,9 @@ AliAnalysisTaskFemto::AliAnalysisTaskFemto(const char *name, const char *aConfig
     fManager(0x0),\r
     fAnalysisType(0),\r
     fConfigMacro(0),\r
-    fConfigParams(0)\r
+    fConfigParams(0),\r
+    fESDpid(0),\r
+    fAODpidUtil(0)\r
 {\r
   // Constructor.\r
   // Input slot #0 works with an Ntuple\r
@@ -64,7 +66,9 @@ AliAnalysisTaskFemto::AliAnalysisTaskFemto(const char *name, const char *aConfig
     fManager(0x0),\r
     fAnalysisType(0),\r
     fConfigMacro(0),\r
-    fConfigParams(0)\r
+    fConfigParams(0),\r
+    fESDpid(0),\r
+    fAODpidUtil(0)\r
 {\r
   // Constructor.\r
   // Input slot #0 works with an Ntuple\r
@@ -87,11 +91,15 @@ AliAnalysisTaskFemto::AliAnalysisTaskFemto(const AliAnalysisTaskFemto& aFemtoTas
     fManager(0x0),\r
     fAnalysisType(0),\r
     fConfigMacro(0),\r
-    fConfigParams(0)\r
+    fConfigParams(0),\r
+    fESDpid(0),\r
+    fAODpidUtil(0)\r
 {\r
   // copy constructor\r
   fESD = aFemtoTask.fESD; \r
+  fESDpid = aFemtoTask.fESDpid; \r
   fAOD = aFemtoTask.fAOD; \r
+  fAODpidUtil = aFemtoTask.fAODpidUtil;\r
   fStack = aFemtoTask.fStack;\r
   fOutputList = aFemtoTask.fOutputList;   \r
   fReader = aFemtoTask.fReader;       \r
@@ -110,7 +118,9 @@ AliAnalysisTaskFemto& AliAnalysisTaskFemto::operator=(const AliAnalysisTaskFemto
     return *this;\r
 \r
   fESD = aFemtoTask.fESD; \r
+  fESDpid = aFemtoTask.fESDpid;\r
   fAOD = aFemtoTask.fAOD; \r
+  fAODpidUtil = aFemtoTask.fAODpidUtil;\r
   fStack = aFemtoTask.fStack;\r
   fOutputList = aFemtoTask.fOutputList;   \r
   fReader = aFemtoTask.fReader;       \r
@@ -138,7 +148,9 @@ void AliAnalysisTaskFemto::ConnectInputData(Option_t *) {
   AliInfo(Form("   ConnectInputData %s\n", GetName()));\r
 \r
   fESD = 0;\r
+  fESDpid = 0;\r
   fAOD = 0;\r
+  fAODpidUtil = 0;\r
   fAnalysisType = 0;\r
 \r
   TTree* tree = dynamic_cast<TTree*> (GetInputData(0));\r
@@ -147,6 +159,7 @@ void AliAnalysisTaskFemto::ConnectInputData(Option_t *) {
     return;\r
   } \r
 \r
+  AliFemtoEventReaderESDChain *femtoReader = dynamic_cast<AliFemtoEventReaderESDChain *> (fReader);\r
   if ((dynamic_cast<AliFemtoEventReaderESDChain *> (fReader)) ||\r
       (dynamic_cast<AliFemtoEventReaderESDChainKine *> (fReader))) {\r
     AliESDInputHandler *esdH = dynamic_cast<AliESDInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());\r
@@ -160,10 +173,13 @@ void AliAnalysisTaskFemto::ConnectInputData(Option_t *) {
 //       } \r
 //       else {\r
        fESD = esdH->GetEvent();\r
+        fESDpid = esdH->GetESDpid();\r
+        femtoReader->SetESDPid(fESDpid);\r
 //       }\r
     }\r
   }\r
   \r
+    AliFemtoEventReaderAODChain *femtoReaderAOD = dynamic_cast<AliFemtoEventReaderAODChain *> (fReader);\r
   if (dynamic_cast<AliFemtoEventReaderAODChain *> (fReader)) {\r
     AliAODInputHandler *aodH = dynamic_cast<AliAODInputHandler*> (AliAnalysisManager::GetAnalysisManager()->GetInputEventHandler());\r
        \r
@@ -185,6 +201,10 @@ void AliAnalysisTaskFemto::ConnectInputData(Option_t *) {
       fAnalysisType = 2;\r
       \r
       fAOD = aodH->GetEvent();\r
+\r
+      fAODpidUtil = aodH->GetAODpidUtil();\r
+      printf("aodH->GetAODpidUtil(): %x",aodH->GetAODpidUtil());\r
+      femtoReaderAOD->SetAODpidUtil(fAODpidUtil);\r
     }\r
   }\r
 \r
@@ -268,6 +288,7 @@ void AliAnalysisTaskFemto::Exec(Option_t *) {
     } \r
     else {\r
       fESD = esdH->GetEvent();\r
+      fESDpid = esdH->GetESDpid();   \r
     }\r
 \r
     AliInfo(Form("Tracks in ESD: %d \n",fESD->GetNumberOfTracks()));\r
index ec90796ad03ce7a6089e9d1e97990b23c5469483..a96f2de6c924310afa342ed5ef01ce9c4e9b7bd0 100644 (file)
 #include "AliFemtoEventReaderStandard.h"
 #include "AliFemtoManager.h"
 
+#include "AliESDpid.h"
+#include "AliAODpidUtil.h"
+
+
 class AliAnalysisTaskFemto : public AliAnalysisTask {
  public:
-  AliAnalysisTaskFemto() : AliAnalysisTask(), fESD(0), fAOD(0), fStack(0), fOutputList(0), fReader(0x0), fManager(0x0), fAnalysisType(0), fConfigMacro(0), fConfigParams(0) {}
+  AliAnalysisTaskFemto() : AliAnalysisTask(), fESD(0), fESDpid(0), fAOD(0), fAODpidUtil(0), fStack(0), fOutputList(0), fReader(0x0), fManager(0x0), fAnalysisType(0), fConfigMacro(0), fConfigParams(0) {}
   AliAnalysisTaskFemto(const char *name, const char *aConfigMacro, const char *aConfigParams);
   AliAnalysisTaskFemto(const char *name, const char *aConfigMacro);
   AliAnalysisTaskFemto(const AliAnalysisTaskFemto& aFemtoTask);
@@ -52,7 +56,10 @@ class AliAnalysisTaskFemto : public AliAnalysisTask {
 
  private:
   AliESDEvent                 *fESD;          //! ESD object
+  AliESDpid                   *fESDpid;       //! ESDpid object
   AliAODEvent                 *fAOD;          //! AOD object
+  AliAODpidUtil               *fAODpidUtil;   // AliAODpidUtil object
+
   AliStack                    *fStack;        //! Stack from Kinematics
   TList                       *fOutputList;   //  AliFemto results list
   AliFemtoEventReader         *fReader;       //! Reference to the reader
@@ -61,6 +68,7 @@ class AliAnalysisTaskFemto : public AliAnalysisTask {
   char                        *fConfigMacro;  //  Config macro location
   char                        *fConfigParams; //  Config macro parameters
 
+
   ClassDef(AliAnalysisTaskFemto, 3); // example of analysis
 };
 
index 6b78b3b456f88fd5c701a0621c9eddba500283c8..8ef8df6a6ccc9578b18a14ebd7099c086a540c08 100644 (file)
 AliFemtoCutMonitorParticlePID::AliFemtoCutMonitorParticlePID():
   fTPCdEdx(0),
   fTOFParticle(0),
-  fTOFTime(0x0)
+  fTOFTime(0x0),
+  ftofHist(0)
 {
   // Default constructor
-  fTPCdEdx = new TH2D("TPCdEdx", "TPC dEdx vs momentum", 190, 0.1, 2.0, 500, 0.0, 500.0);
-  fTOFTime = new TH2D("TOFTime", "TOF Time vs momentum", 190, 0.1, 2.0, 800, -2000.0, 2000.0);
+  fTPCdEdx =  new TH2D("TPCdEdx", "TPC dEdx vs. momentum", 200, 0.1, 4.0, 250, 0.0, 500.0);
+  fTOFTime = new TH2D("TOFTime", "TOF Time vs. momentum", 190, 0.1, 2.0, 400, -4000.0, 4000.0);
+  ftofHist=new TH2D("TOFHist","TOF momentum vs v",100,0.,1.1,100,0.,3.0);
 }
 
 AliFemtoCutMonitorParticlePID::AliFemtoCutMonitorParticlePID(const char *aName, Int_t aTOFParticle):
   AliFemtoCutMonitor(),
   fTPCdEdx(0),
   fTOFParticle(aTOFParticle),
-  fTOFTime(0x0)
+  fTOFTime(0x0),
+  ftofHist(0)
 {
   // Normal constructor
   char name[200];
   snprintf(name, 200, "TPCdEdx%s", aName);
-  fTPCdEdx = new TH2D(name, "TPC dEdx vs. momentum", 190, 0.1, 2.0, 500, 0.0, 500.0);
+  fTPCdEdx = new TH2D(name, "TPC dEdx vs. momentum", 200, 0.1, 4.0, 250, 0.0, 500.0);
 
   snprintf(name, 200, "TOFTime%s", aName);
-  fTOFTime = new TH2D(name, "TOF Time vs. momentum", 190, 0.1, 2.0, 800, -2000.0, 2000.0);
+  fTOFTime = new TH2D(name, "TOF Time vs. momentum", 190, 0.1, 2.0, 400, -4000.0, 4000.0);
+
+  snprintf(name, 200, "TOFHist%s", aName);
+  ftofHist=new TH2D(name,"TOF momentum vs v",100,0.,1.1,100,0.,3.0);
 }
 
 AliFemtoCutMonitorParticlePID::AliFemtoCutMonitorParticlePID(const AliFemtoCutMonitorParticlePID &aCut):
   AliFemtoCutMonitor(),
   fTPCdEdx(0),
   fTOFParticle(0),
+  ftofHist(0),
   fTOFTime(0x0)
 {
   // copy constructor
@@ -48,6 +55,9 @@ AliFemtoCutMonitorParticlePID::AliFemtoCutMonitorParticlePID(const AliFemtoCutMo
 
   if (fTOFTime) delete fTOFTime;
   fTOFTime = new TH2D(*aCut.fTOFTime);
+
+  if (ftofHist) delete ftofHist; 
+  ftofHist= new TH2D(*aCut.ftofHist);
 }
 
 AliFemtoCutMonitorParticlePID::~AliFemtoCutMonitorParticlePID()
@@ -55,6 +65,7 @@ AliFemtoCutMonitorParticlePID::~AliFemtoCutMonitorParticlePID()
   // Destructor
   delete fTPCdEdx;
   delete fTOFTime;
+  delete ftofHist;
 }
 
 AliFemtoCutMonitorParticlePID& AliFemtoCutMonitorParticlePID::operator=(const AliFemtoCutMonitorParticlePID& aCut)
@@ -69,6 +80,8 @@ AliFemtoCutMonitorParticlePID& AliFemtoCutMonitorParticlePID::operator=(const Al
   if (fTOFTime) delete fTOFTime;
   fTOFTime = new TH2D(*aCut.fTOFTime);
   
+  if(ftofHist) delete ftofHist;
+  ftofHist = new TH2D(*aCut.ftofHist);
   return *this;
 }
 
@@ -85,12 +98,16 @@ void AliFemtoCutMonitorParticlePID::Fill(const AliFemtoTrack* aTrack)
   float tMom = aTrack->P().Mag();
   float tdEdx = aTrack->TPCsignal();
   float tTOF = 0.0;
+  short tchg = aTrack->Charge();
   if (fTOFParticle == 0) tTOF = aTrack->TOFpionTime();
   if (fTOFParticle == 1) tTOF = aTrack->TOFkaonTime();
   if (fTOFParticle == 2) tTOF = aTrack->TOFprotonTime();
 
   fTPCdEdx->Fill(tMom, tdEdx);
   fTOFTime->Fill(tMom, tTOF);
+
+  float vp= aTrack->VTOF();
+  ftofHist->Fill(vp,tMom);
 }
 
 void AliFemtoCutMonitorParticlePID::Write()
@@ -98,6 +115,7 @@ void AliFemtoCutMonitorParticlePID::Write()
   // Write out the relevant histograms
   fTPCdEdx->Write();
   fTOFTime->Write();
+  ftofHist->Write();
 }
 
 TList *AliFemtoCutMonitorParticlePID::GetOutputList()
@@ -105,6 +123,6 @@ TList *AliFemtoCutMonitorParticlePID::GetOutputList()
   TList *tOutputList = new TList();
   tOutputList->Add(fTPCdEdx);
   tOutputList->Add(fTOFTime);
-
+  tOutputList->Add(ftofHist);
   return tOutputList;
 }
index 7a579627387df00e72ffa9d84d4ace2696cdacdf..920de21bac890101f3807fea854684e40a632dee 100644 (file)
@@ -49,6 +49,7 @@ private:
   TH2D *fTPCdEdx;     // TPC dEdx information
   Int_t fTOFParticle; // Select TOF time hypothesis, 0-pion, 1-kaon, 2-proton
   TH2D *fTOFTime;     // TOF time
+  TH2D* ftofHist;     // TOF hist with vp
 
 };
 
index 33c08e078a79eb89b935a6e297889c3fd342a0f6..4114afaad09f2972fcc4816a9a4feb505032c6c1 100644 (file)
@@ -15,7 +15,6 @@
 #include "AliAODTrack.h"
 #include "AliAODVertex.h"
 #include "AliAODMCHeader.h"
-#include "AliESDtrack.h"
 
 #include "AliFmPhysicalHelixD.h"
 #include "AliFmThreeVectorF.h"
@@ -25,6 +24,9 @@
 #include "AliFemtoEvent.h"
 #include "AliFemtoModelHiddenInfo.h"
 #include "AliFemtoModelGlobalHiddenInfo.h"
+#include "AliPID.h"
+
+#include "AliAODpidUtil.h"
 
 ClassImp(AliFemtoEventReaderAOD)
 
@@ -48,7 +50,8 @@ AliFemtoEventReaderAOD::AliFemtoEventReaderAOD():
   fInputFile(" "),
   fFileName(" "),
   fTree(0x0),
-  fAodFile(0x0)
+  fAodFile(0x0),
+  fAODpidUtil(0)
 {
   // default constructor
   fAllTrue.ResetAllBits(kTRUE);
@@ -71,7 +74,8 @@ AliFemtoEventReaderAOD::AliFemtoEventReaderAOD(const AliFemtoEventReaderAOD &aRe
   fInputFile(" "),
   fFileName(" "),
   fTree(0x0),
-  fAodFile(0x0)
+  fAodFile(0x0),
+  fAODpidUtil(0)
 {
   // copy constructor
   fInputFile = aReader.fInputFile;
@@ -84,6 +88,7 @@ AliFemtoEventReaderAOD::AliFemtoEventReaderAOD(const AliFemtoEventReaderAOD &aRe
   fAllFalse.ResetAllBits(kFALSE);
   fFilterBit = aReader.fFilterBit;
   fPWG2AODTracks = aReader.fPWG2AODTracks;
+  fAODpidUtil = aReader.fAODpidUtil;
   fCentRange[0] = aReader.fCentRange[0];
   fCentRange[1] = aReader.fCentRange[1];
 }
@@ -121,6 +126,7 @@ AliFemtoEventReaderAOD& AliFemtoEventReaderAOD::operator=(const AliFemtoEventRea
   fAllFalse.ResetAllBits(kFALSE);
   fFilterBit = aReader.fFilterBit;
   fPWG2AODTracks = aReader.fPWG2AODTracks;
+  fAODpidUtil = aReader.fAODpidUtil;
   fCentRange[0] = aReader.fCentRange[0];
   fCentRange[1] = aReader.fCentRange[1];
 
@@ -217,6 +223,8 @@ AliFemtoEvent* AliFemtoEventReaderAOD::ReturnHbtEvent()
 
 void AliFemtoEventReaderAOD::CopyAODtoFemtoEvent(AliFemtoEvent *tEvent)
 {
+
   // A function that reads in the AOD event
   // and transfers the neccessary information into
   // the internal AliFemtoEvent
@@ -281,19 +289,21 @@ void AliFemtoEventReaderAOD::CopyAODtoFemtoEvent(AliFemtoEvent *tEvent)
     nofTracks=fPWG2AODTracks->GetEntries();
   else
     nofTracks=fEvent->GetNumberOfTracks();
+  cout<<"nofTracks: "<<nofTracks<<endl;
 
   AliCentrality *cent = fEvent->GetCentrality();
-
+  
   if (cent && fUsePreCent) {
     if ((cent->GetCentralityPercentile("V0M")*10 < fCentRange[0]) ||
        (cent->GetCentralityPercentile("V0M")*10 > fCentRange[1]))
       {
        cout << "Centrality " << cent->GetCentralityPercentile("V0M") << " outside of preselection range " << fCentRange[0] << " - " << fCentRange[1] << endl;
-
+       
        return;
       }
   }
 
+
   int realnofTracks=0;   // number of track which we use in a analysis
   int tracksPrim=0;     
 
@@ -316,11 +326,13 @@ void AliFemtoEventReaderAOD::CopyAODtoFemtoEvent(AliFemtoEvent *tEvent)
          continue;
        }
 
        if (aodtrack->IsOn(AliESDtrack::kTPCrefit))
          if (aodtrack->Chi2perNDF() < 6.0) 
            if (aodtrack->Eta() < 0.9)
              tNormMult++;
 
+
        CopyAODtoFemtoTrack(aodtrack, trackCopy, pwg2aodtrack);
        
        if (mcP) {
@@ -428,11 +440,11 @@ void AliFemtoEventReaderAOD::CopyAODtoFemtoEvent(AliFemtoEvent *tEvent)
 
        if (aodtrack->IsPrimaryCandidate()) tracksPrim++;
        
-       if (!aodtrack->TestFilterBit(fFilterBit)) {
+       if (!aodtrack->TestFilterBit(fFilterBit)) {
          delete trackCopy;
          continue;
        }
-       
+
        CopyAODtoFemtoTrack(aodtrack, trackCopy, 0);
        
        if (mcP) {
@@ -555,7 +567,9 @@ void AliFemtoEventReaderAOD::CopyAODtoFemtoEvent(AliFemtoEvent *tEvent)
   tEvent->SetNumberOfTracks(realnofTracks);//setting number of track which we read in event    
   tEvent->SetNormalizedMult(tracksPrim);
 
+  AliCentrality *cent = fEvent->GetCentrality();
   if (cent) tEvent->SetNormalizedMult(lrint(10*cent->GetCentralityPercentile("V0M")));
+//  if (cent) tEvent->SetNormalizedMult((int) cent->GetCentralityPercentile("V0M"));
 
   if (cent) {
     tEvent->SetCentralityV0(cent->GetCentralityPercentile("V0M"));
@@ -595,7 +609,70 @@ void AliFemtoEventReaderAOD::CopyAODtoFemtoTrack(const AliAODTrack *tAodTrack,
   tFemtoTrack->SetPidProbPion(aodpid[2]);
   tFemtoTrack->SetPidProbKaon(aodpid[3]);
   tFemtoTrack->SetPidProbProton(aodpid[4]);
-                                               
+               
+  //PID////////////////////////////
+      double tTOF = 0.0;
+
+      if (tAodTrack->GetStatus()&0x8000) {  //AliESDtrack::kTOFpid=0x8000
+       tTOF = tAodTrack->GetTOFsignal();
+       tAodTrack->GetIntegratedTimes(aodpid);
+      }
+
+      tFemtoTrack->SetTofExpectedTimes(tTOF-aodpid[2], tTOF-aodpid[3], tTOF-aodpid[4]);
+
+//////  TPC ////////////////////////////////////////////
+
+      float nsigmaTPCK=-1000.;                                                  
+      float nsigmaTPCPi=-1000.;                                                 
+      float nsigmaTPCP=-1000.;                                                  
+          
+         // cout<<"in reader fESDpid"<<fESDpid<<endl;
+
+      if (tAodTrack->IsOn(0x0080)){ //AliESDtrack::kTPCpid=0x0080
+        nsigmaTPCK = fAODpidUtil->NumberOfSigmasTPC(tAodTrack,AliPID::kKaon);
+        nsigmaTPCPi = fAODpidUtil->NumberOfSigmasTPC(tAodTrack,AliPID::kPion);
+        nsigmaTPCP = fAODpidUtil->NumberOfSigmasTPC(tAodTrack,AliPID::kProton);
+    //    cout<<" K "<<nsigmaTPCK<<" pi "<<nsigmaTPCPi<<" P "<<nsigmaTPCP<<endl;
+      }
+       tFemtoTrack->SetNSigmaTPCPi(nsigmaTPCPi);
+       tFemtoTrack->SetNSigmaTPCK(nsigmaTPCK);
+       tFemtoTrack->SetNSigmaTPCP(nsigmaTPCP);
+
+      ///////TOF//////////////////////
+
+      float vp=-1000.;
+      float nsigmaTOFPi=-1000.;
+      float nsigmaTOFK=-1000.;
+      float nsigmaTOFP=-1000.;
+
+      if ((tAodTrack->GetStatus()&0x8000) && //AliESDtrack::kTOFpid=0x8000
+         (tAodTrack->GetStatus()&0x2000) && //AliESDtrack::kTOFout=0x2000
+         (tAodTrack->GetStatus()&0x80000000) && //AliESDtrack::kTIME=0x80000000
+         !(tAodTrack->GetStatus()&0x100000)) //AliESDtrack::kTOFmismatch=0x100000
+       {
+         if(tAodTrack->IsOn(0x8000)) //AliESDtrack::kTOFpid=0x8000
+           {
+             double tZero = fAODpidUtil->GetTOFResponse().GetStartTime(tAodTrack->P());
+
+             //nsigmaTOFPi = fAODpidUtil->NumberOfSigmasTOF(tAodTrack,AliPID::kPion,tZero);
+             //nsigmaTOFK = fAODpidUtil->NumberOfSigmasTOF(tAodTrack,AliPID::kKaon,tZero);
+             //nsigmaTOFP = fAODpidUtil->NumberOfSigmasTOF(tAodTrack,AliPID::kProton,tZero);
+             nsigmaTOFPi = fAODpidUtil->NumberOfSigmasTOF(tAodTrack,AliPID::kPion);
+             nsigmaTOFK = fAODpidUtil->NumberOfSigmasTOF(tAodTrack,AliPID::kKaon);
+             nsigmaTOFP = fAODpidUtil->NumberOfSigmasTOF(tAodTrack,AliPID::kProton);
+
+             Double_t len=200;// esdtrack->GetIntegratedLength(); !!!!!
+             Double_t tof=tAodTrack->GetTOFsignal();
+             if(tof > 0.) vp=len/tof/0.03;
+           }
+       }
+       tFemtoTrack->SetVTOF(vp);
+       tFemtoTrack->SetNSigmaTOFPi(nsigmaTOFPi);
+       tFemtoTrack->SetNSigmaTOFK(nsigmaTOFK);
+       tFemtoTrack->SetNSigmaTOFP(nsigmaTOFP);
+      
+      //////////////////////////////////////
+                               
   double pxyz[3];
   tAodTrack->PxPyPz(pxyz);//reading noconstrained momentum
   AliFemtoThreeVector v(pxyz[0],pxyz[1],pxyz[2]);
@@ -636,9 +713,9 @@ void AliFemtoEventReaderAOD::CopyAODtoFemtoTrack(const AliAODTrack *tAodTrack,
   tFemtoTrack->SetTPCchi2(tAodTrack->Chi2perNDF());       
   tFemtoTrack->SetTPCncls(tAodTrack->GetTPCNcls());       
   tFemtoTrack->SetTPCnclsF(tAodTrack->GetTPCNcls());      
-  tFemtoTrack->SetTPCsignal(tAodTrack->GetTPCsignal());
   tFemtoTrack->SetTPCsignalN(1); 
   tFemtoTrack->SetTPCsignalS(1); 
+  tFemtoTrack->SetTPCsignal(tAodTrack->GetTPCsignal());
 
   if (tPWG2AODTrack) {
     // Copy the PWG2 specific information if it exists
@@ -719,5 +796,13 @@ void AliFemtoEventReaderAOD::SetCentralityPreSelection(double min, double max)
 }
 
 
+void AliFemtoEventReaderAOD::SetAODpidUtil(AliAODpidUtil *aAODpidUtil)
+{
+  fAODpidUtil = aAODpidUtil;
+  printf("fAODpidUtil: %x\n",fAODpidUtil);
+}
+
+
+
 
 
index be205a3aaced78fa7ed428d9fd8b994ebf5a92a4..9ba5391abdc27e1cfabb2cfddb1d7e2c8d385310 100644 (file)
@@ -21,6 +21,8 @@
 #include "AliPWG2AODTrack.h"
 #include "AliAODMCParticle.h"
 
+#include "AliAODpidUtil.h"
+
 class AliFemtoEvent;
 class AliFemtoTrack;
 
@@ -39,6 +41,7 @@ class AliFemtoEventReaderAOD : public AliFemtoEventReader
   void SetFilterBit(UInt_t ibit);
   void SetReadMC(unsigned char a);
   void SetCentralityPreSelection(double min, double max);
+  void SetAODpidUtil(AliAODpidUtil *aAODpidUtil);
 
  protected:
   virtual void CopyAODtoFemtoEvent(AliFemtoEvent *tEvent);
@@ -57,6 +60,7 @@ class AliFemtoEventReaderAOD : public AliFemtoEventReader
   unsigned char  fReadMC;           // Attempt to read the MC information from the AOD
   unsigned char  fUsePreCent;       // Use centrality pre-selection to speed up analysis
   double         fCentRange[2];     // Centrality pre-selection range
+  AliAODpidUtil* fAODpidUtil;
 
  private:
 
index f367b5660fdf11af563cb04db368a9e88918dbaa..ce85e93caf70b26c3e1f4d2a62f0c3e2e032c3b8 100644 (file)
@@ -22,6 +22,7 @@
 #include "SystemOfUnits.h"
 #include "AliFemtoEvent.h"
 #include "AliFemtoModelHiddenInfo.h"
+#include "AliPID.h"
 
 ClassImp(AliFemtoEventReaderESDChain)
 
@@ -43,7 +44,10 @@ AliFemtoEventReaderESDChain::AliFemtoEventReaderESDChain():
   fUsePhysicsSel(kFALSE),
   fSelect(0x0),
   fTrackType(kGlobal),
-  fEstEventMult(kITSTPC)
+  fEstEventMult(kITSTPC),
+  fESDpid(0),
+  fIsPidOwner(0),
+  fEventTrig(AliVEvent::kMB) //trigger
 {
   //constructor with 0 parameters , look at default settings 
 //   fClusterPerPadrow = (list<Int_t> **) malloc(sizeof(list<Int_t> *) * AliESDfriendTrack::kMaxTPCcluster);
@@ -70,7 +74,10 @@ AliFemtoEventReaderESDChain::AliFemtoEventReaderESDChain(const AliFemtoEventRead
   fUsePhysicsSel(kFALSE),
   fSelect(0x0),
   fTrackType(kGlobal),
-  fEstEventMult(kITSTPC)
+  fEstEventMult(kITSTPC),
+  fESDpid(0),
+  fIsPidOwner(0),
+  fEventTrig(AliVEvent::kMB) //trigger
 {
   // Copy constructor
   fConstrained = aReader.fConstrained;
@@ -86,6 +93,8 @@ AliFemtoEventReaderESDChain::AliFemtoEventReaderESDChain(const AliFemtoEventRead
     fSelect = new AliPhysicsSelection();
   fTrackType = aReader.fTrackType;
   fEstEventMult = aReader.fEstEventMult;
+fEventTrig = aReader.fEventTrig; //trigger
+
 //   fEventFriend = aReader.fEventFriend;
 //   fClusterPerPadrow = (list<Int_t> **) malloc(sizeof(list<Int_t> *) * AliESDfriendTrack::kMaxTPCcluster);
 //   for (int tPad=0; tPad<AliESDfriendTrack::kMaxTPCcluster; tPad++) {
@@ -438,7 +447,7 @@ AliFemtoEvent* AliFemtoEventReaderESDChain::ReturnHbtEvent()
       trackCopy->SetPidProbPion(esdpid[2]);
       trackCopy->SetPidProbKaon(esdpid[3]);
       trackCopy->SetPidProbProton(esdpid[4]);
-
+      
       esdpid[0] = -100000.0;
       esdpid[1] = -100000.0;
       esdpid[2] = -100000.0;
@@ -453,7 +462,66 @@ AliFemtoEvent* AliFemtoEventReaderESDChain::ReturnHbtEvent()
       }
 
       trackCopy->SetTofExpectedTimes(tTOF-esdpid[2], tTOF-esdpid[3], tTOF-esdpid[4]);
-                                       
+
+//////  TPC ////////////////////////////////////////////
+
+      float nsigmaTPCK=-1000.;                                                        
+      float nsigmaTPCPi=-1000.;                                                        
+      float nsigmaTPCP=-1000.;                                                        
+          
+  
+      if (esdtrack->IsOn(AliESDtrack::kTPCpid)){
+        nsigmaTPCK = fESDpid->NumberOfSigmasTPC(esdtrack,AliPID::kKaon);
+        nsigmaTPCPi = fESDpid->NumberOfSigmasTPC(esdtrack,AliPID::kPion);
+        nsigmaTPCP = fESDpid->NumberOfSigmasTPC(esdtrack,AliPID::kProton);
+
+      }
+      trackCopy->SetNSigmaTPCPi(nsigmaTPCPi);
+      trackCopy->SetNSigmaTPCK(nsigmaTPCK);
+      trackCopy->SetNSigmaTPCP(nsigmaTPCP);
+
+///// TOF ///////////////////////////////////////////////
+
+      float vp=-1000.;
+      float nsigmaTOFPi=-1000.;
+      float nsigmaTOFK=-1000.;
+      float nsigmaTOFP=-1000.;
+
+       if ((esdtrack->GetStatus()&AliESDtrack::kTOFpid) &&
+          (esdtrack->GetStatus()&AliESDtrack::kTOFout) &&
+          (esdtrack->GetStatus()&AliESDtrack::kTIME) &&
+          !(esdtrack->GetStatus()&AliESDtrack::kTOFmismatch))
+       {
+
+         //if ((esdtrack->GetStatus()&AliESDtrack::kTOFpid) &&
+         //(esdtrack->GetStatus()&AliESDtrack::kTOFout) &&
+         //(esdtrack->GetStatus()&AliESDtrack::kTIME)){
+ // collect info from ESDpid class
+
+      if (esdtrack->IsOn(AliESDtrack::kTOFpid)){
+
+      double tZero = fESDpid->GetTOFResponse().GetStartTime(esdtrack->P());
+
+      nsigmaTOFPi = fESDpid->NumberOfSigmasTOF(esdtrack,AliPID::kPion,tZero);
+      nsigmaTOFK = fESDpid->NumberOfSigmasTOF(esdtrack,AliPID::kKaon,tZero);
+      nsigmaTOFP = fESDpid->NumberOfSigmasTOF(esdtrack,AliPID::kProton,tZero);
+
+      Double_t len=esdtrack->GetIntegratedLength();
+      Double_t tof=esdtrack->GetTOFsignal();
+      if(tof > 0.) vp=len/tof/0.03;
+       
+
+  }
+
+      
+}
+      trackCopy->SetVTOF(vp);
+      trackCopy->SetNSigmaTOFPi(nsigmaTOFPi);
+      trackCopy->SetNSigmaTOFK(nsigmaTOFK);
+      trackCopy->SetNSigmaTOFP(nsigmaTOFP);
+
+
+                       
       double pxyz[3];
       double rxyz[3];
       double impact[2];
@@ -751,6 +819,11 @@ void AliFemtoEventReaderESDChain::SetReadTrackType(ReadTrackType aType)
   fTrackType = aType;
 }
 
+//trigger
+void AliFemtoEventReaderESDChain::SetEventTrigger(UInt_t eventtrig)
+{
+  fEventTrig = eventtrig;
+}
 
 
 
index a100e6f079b112946520782c658bacab497950aa..fb3b3a162f07975b6b4ce936f03b5e8c58f3c0c0 100644 (file)
@@ -21,6 +21,8 @@
 #include "AliPhysicsSelection.h"
 #include <list>
 
+#include "AliESDpid.h"
+
 class AliFemtoEvent;
 
 class AliFemtoEventReaderESDChain : public AliFemtoEventReader 
@@ -46,6 +48,7 @@ class AliFemtoEventReaderESDChain : public AliFemtoEventReader
 
   void SetUsePhysicsSelection(const bool usephysics);
   void SetUseMultiplicity(EstEventMult aType);
+  void SetEventTrigger(UInt_t eventtrig); //trigger
 
   bool GetConstrained() const;
   bool GetReadTPCInner() const;
@@ -55,7 +58,7 @@ class AliFemtoEventReaderESDChain : public AliFemtoEventReader
 
   void SetESDSource(AliESDEvent *aESD);
   //  void SetESDfriendSource(AliESDfriend *aFriend);
-
+  void SetESDPid(AliESDpid *esdPid) { fESDpid = esdPid; }
  protected:
 
  private:
@@ -74,12 +77,17 @@ class AliFemtoEventReaderESDChain : public AliFemtoEventReader
   AliPhysicsSelection *fSelect;  //Class to select only physics events
   ReadTrackType  fTrackType;     // Type of track read
   EstEventMult   fEstEventMult;  // Type of the event multiplicity estimator
+  UInt_t         fEventTrig;     //event trigger
 
 /*   list<Int_t>  **fSharedList;       //! Table (one list per padrow) of clusters which are shared */
 /*   list<Int_t>  **fClusterPerPadrow; //! Table (one list per padrow) of clusters in each padrow */
                
   Float_t GetSigmaToVertex(double *impact, double *covar);
 
+
+  AliESDpid *fESDpid;
+  Bool_t fIsPidOwner;
+
 #ifdef __ROOT__
   ClassDef(AliFemtoEventReaderESDChain, 1)
 #endif
index 5a11ac2f72ae8fa3c249e3734edbca460731ff6d..013f2804968d81d0ce7ce32be221c6415732ef2a 100644 (file)
@@ -51,6 +51,13 @@ AliFemtoTrack::AliFemtoTrack():
   fTPCsignal(0),
   fTPCsignalN(0),    
   fTPCsignalS(0),
+  fVTOF(0),
+  fNSigmaTPCPi(0),
+  fNSigmaTPCK(0),
+  fNSigmaTPCP(0),
+  fNSigmaTOFPi(0),
+  fNSigmaTOFK(0),
+  fNSigmaTOFP(0),
   fSigmaToVertex(0),
   fClusters(159),
   fShared(159),
@@ -96,6 +103,13 @@ AliFemtoTrack::AliFemtoTrack(const AliFemtoTrack& t) :
   fTPCsignal(0),
   fTPCsignalN(0),    
   fTPCsignalS(0),
+  fVTOF(0),
+  fNSigmaTPCPi(0),
+  fNSigmaTPCK(0),
+  fNSigmaTPCP(0),
+  fNSigmaTOFPi(0),
+  fNSigmaTOFK(0),
+  fNSigmaTOFP(0),
   fSigmaToVertex(0),
   fClusters(159),
   fShared(159),
@@ -132,6 +146,13 @@ AliFemtoTrack::AliFemtoTrack(const AliFemtoTrack& t) :
   fTPCsignal=t.fTPCsignal;
   fTPCsignalN=t.fTPCsignalN;    
   fTPCsignalS=t.fTPCsignalS;  
+  fVTOF=t.fVTOF;
+  fNSigmaTPCPi=t.fNSigmaTPCPi;
+  fNSigmaTPCK=t.fNSigmaTPCK;
+  fNSigmaTPCP=t.fNSigmaTPCP;
+  fNSigmaTOFPi=t.fNSigmaTOFPi;
+  fNSigmaTOFK=t.fNSigmaTOFK;
+  fNSigmaTOFP=t.fNSigmaTOFP;
   fSigmaToVertex=t.fSigmaToVertex;
   fClusters=t.fClusters;
   fShared=t.fShared;
@@ -180,6 +201,13 @@ AliFemtoTrack& AliFemtoTrack::operator=(const AliFemtoTrack& aTrack)
   fTPCsignal=aTrack.fTPCsignal;
   fTPCsignalN=aTrack.fTPCsignalN;    
   fTPCsignalS=aTrack.fTPCsignalS;  
+  fVTOF=aTrack.fVTOF;    
+  fNSigmaTPCPi=aTrack.fNSigmaTPCPi;    
+  fNSigmaTPCK=aTrack.fNSigmaTPCK;    
+  fNSigmaTPCP=aTrack.fNSigmaTPCP;    
+  fNSigmaTOFPi=aTrack.fNSigmaTOFPi;    
+  fNSigmaTOFK=aTrack.fNSigmaTOFK;    
+  fNSigmaTOFP=aTrack.fNSigmaTOFP;    
   fClusters=aTrack.fClusters;
   fShared=aTrack.fShared;
   fNominalTpcEntrancePoint=aTrack.fNominalTpcEntrancePoint;
@@ -225,6 +253,13 @@ void AliFemtoTrack::SetTPCnclsF(const short& aTPCnclsF){fTPCnclsF=aTPCnclsF;}
 void AliFemtoTrack::SetTPCsignal(const float& aTPCsig){fTPCsignal=aTPCsig;}
 void AliFemtoTrack::SetTPCsignalN(const short& aTPCsignalN){fTPCsignalN=aTPCsignalN;}    
 void AliFemtoTrack::SetTPCsignalS(const float& aTPCsignalS){fTPCsignalS=aTPCsignalS;} 
+void AliFemtoTrack::SetVTOF(const float& aVTOF){fVTOF=aVTOF;}
+void AliFemtoTrack::SetNSigmaTPCPi(const float& aNSigmaTPCPi){fNSigmaTPCPi=aNSigmaTPCPi;}
+void AliFemtoTrack::SetNSigmaTPCK(const float& aNSigmaTPCK){fNSigmaTPCK=aNSigmaTPCK;}
+void AliFemtoTrack::SetNSigmaTPCP(const float& aNSigmaTPCP){fNSigmaTPCP=aNSigmaTPCP;}
+void AliFemtoTrack::SetNSigmaTOFPi(const float& aNSigmaTOFPi){fNSigmaTOFPi=aNSigmaTOFPi;}
+void AliFemtoTrack::SetNSigmaTOFK(const float& aNSigmaTOFK){fNSigmaTOFK=aNSigmaTOFK;}
+void AliFemtoTrack::SetNSigmaTOFP(const float& aNSigmaTOFP){fNSigmaTOFP=aNSigmaTOFP;}
 void AliFemtoTrack::SetSigmaToVertex(const float& aSigma){fSigmaToVertex=aSigma;} 
 
 
@@ -248,6 +283,13 @@ short AliFemtoTrack::TPCnclsF() const{return fTPCnclsF;}
 float AliFemtoTrack::TPCsignal() const{return fTPCsignal;}
 short AliFemtoTrack::TPCsignalN() const{return fTPCsignalN;}    
 float AliFemtoTrack::TPCsignalS() const{return fTPCsignalS;} 
+float AliFemtoTrack::VTOF() const{return fVTOF;}
+float AliFemtoTrack::NSigmaTPCPi() const{return fNSigmaTPCPi;}
+float AliFemtoTrack::NSigmaTPCK() const{return fNSigmaTPCK;}
+float AliFemtoTrack::NSigmaTPCP() const{return fNSigmaTPCP;}
+float AliFemtoTrack::NSigmaTOFPi() const{return fNSigmaTOFPi;}
+float AliFemtoTrack::NSigmaTOFK() const{return fNSigmaTOFK;}
+float AliFemtoTrack::NSigmaTOFP() const{return fNSigmaTOFP;}
 float AliFemtoTrack::SigmaToVertex() const{return fSigmaToVertex;} 
 float AliFemtoTrack::TOFpionTime() const{return fTofPionTime;}
 float AliFemtoTrack::TOFkaonTime() const{return fTofKaonTime;}
index c4544fb4acf302523d1c39a37b30b43a63b73228..2f930eb5f4e707304dad414a707dee52cff8950d 100644 (file)
@@ -68,6 +68,16 @@ public:
   float TPCsignal() const;
   short TPCsignalN() const;    
   float TPCsignalS() const;   
+  //new PID
+  float NSigmaTPCPi() const;   
+  float NSigmaTPCK() const;   
+  float NSigmaTPCP() const;   
+  float VTOF() const;   
+  float NSigmaTOFPi() const;   
+  float NSigmaTOFK() const;   
+  float NSigmaTOFP() const;   
+
 
   float TOFpionTime() const;
   float TOFkaonTime() const;
@@ -105,6 +115,15 @@ public:
   void SetTPCsignalN(const short& s);    
   void SetTPCsignalS(const float& x);   
 
+  //new PID
+  void SetNSigmaTPCPi(const float& x);   
+  void SetNSigmaTPCK(const float& x);   
+  void SetNSigmaTPCP(const float& x);   
+  void SetVTOF(const float& x);   
+  void SetNSigmaTOFPi(const float& x);   
+  void SetNSigmaTOFK(const float& x);   
+  void SetNSigmaTOFP(const float& x);  
+
   void SetTPCcluster(const short& aNBit, const Bool_t& aValue);
   void SetTPCshared(const short& aNBit, const Bool_t& aValue);
 
@@ -176,6 +195,15 @@ public:
   float fTPCsignal;      // dEdx TPC value
   short fTPCsignalN;     // number of points used for dEdx
   float fTPCsignalS;     // RMS of dEdx measurement
+
+  float fVTOF;     // v=length/TOF
+  float fNSigmaTPCPi;     // nsigma TPC for pion
+  float fNSigmaTPCK;     // nsigma TPC for K
+  float fNSigmaTPCP;     // nsigma TPC for P
+  float fNSigmaTOFPi;     // nsigma TPC for pion
+  float fNSigmaTOFK;     // nsigma TPC for K
+  float fNSigmaTOFP;     // nsigma TPC for P
+
   float fSigmaToVertex;  // Distance from track to vertex in sigmas
   TBits fClusters;       // Cluster per padrow map
   TBits fShared;         // Sharing per padrow map