Add flag to define collision system
authorfnoferin <fnoferin@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 15 Jul 2013 09:58:36 +0000 (09:58 +0000)
committerfnoferin <fnoferin@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 15 Jul 2013 09:58:36 +0000 (09:58 +0000)
PWGPP/pid/AddTaskK0sBayes.C
PWGPP/pid/AddTaskLambdaBayes.C
PWGPP/pid/AddTaskPhiBayes.C
PWGPP/pid/AliAnalysisTaskK0sBayes.cxx
PWGPP/pid/AliAnalysisTaskK0sBayes.h
PWGPP/pid/AliAnalysisTaskLambdaBayes.cxx
PWGPP/pid/AliAnalysisTaskLambdaBayes.h
PWGPP/pid/AliAnalysisTaskPhiBayes.cxx
PWGPP/pid/AliAnalysisTaskPhiBayes.h

index b88d8cc..b9a5b65 100644 (file)
@@ -1,4 +1,4 @@
-AliAnalysisTask *AddTaskK0sBayes(Bool_t ismc=kFALSE,Bool_t qa=kTRUE,Int_t filterbit=4){
+AliAnalysisTask *AddTaskK0sBayes(Bool_t ismc=kFALSE,Bool_t qa=kTRUE,Int_t filterbit=4,Int_t typeCol=2){
 
   //get the current analysis manager
   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
@@ -21,6 +21,7 @@ AliAnalysisTask *AddTaskK0sBayes(Bool_t ismc=kFALSE,Bool_t qa=kTRUE,Int_t filter
   if(qa) task->SetQA();
   task->SetEtaCut(0.8);
   task->SetFilterBit(filterbit);
+  task->SetTypeCollisions(typeCol);
 
   mgr->AddTask(task);
 
index c1dd5c6..289bbaf 100644 (file)
@@ -1,4 +1,4 @@
-AliAnalysisTask *AddTaskLambdaBayes(Bool_t ismc=kFALSE,Bool_t qa=kTRUE,Int_t filterbit=4){
+AliAnalysisTask *AddTaskLambdaBayes(Bool_t ismc=kFALSE,Bool_t qa=kTRUE,Int_t filterbit=4,Int_t typeCol=2){
 
   //get the current analysis manager
   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
@@ -21,6 +21,7 @@ AliAnalysisTask *AddTaskLambdaBayes(Bool_t ismc=kFALSE,Bool_t qa=kTRUE,Int_t fil
   if(qa) task->SetQA();
   task->SetEtaCut(0.8);
   task->SetFilterBit(filterbit);
+  task->SetTypeCollisions(typeCol);
 
   mgr->AddTask(task);
 
index 606b608..ccf1cb9 100644 (file)
@@ -1,4 +1,4 @@
-AliAnalysisTask *AddTaskPhiBayes(Bool_t ismc=kFALSE,Bool_t qa=kTRUE,Int_t filterbit=16){
+AliAnalysisTask *AddTaskPhiBayes(Bool_t ismc=kFALSE,Bool_t qa=kTRUE,Int_t filterbit=16,Int_t typeCol=2){
 
   //get the current analysis manager
   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();
@@ -21,6 +21,7 @@ AliAnalysisTask *AddTaskPhiBayes(Bool_t ismc=kFALSE,Bool_t qa=kTRUE,Int_t filter
   if(qa) task->SetQA();
   task->SetEtaCut(0.8);
   task->SetFilterBit(filterbit);
+  task->SetTypeCollisions(typeCol);
 
   mgr->AddTask(task);
 
index 64b92de..fe6fa22 100644 (file)
@@ -73,7 +73,8 @@ AliAnalysisTaskK0sBayes::AliAnalysisTaskK0sBayes():
   fNpiPos(0),
   fNpiNeg(0),
   fHmismTOF(0),
-  fHchannelTOFdistr(0)
+  fHchannelTOFdistr(0),
+  fTypeCol(2)
 {
   // Default constructor (should not be used)
   fList->SetName("contKsBayes1");
@@ -128,7 +129,8 @@ AliAnalysisTaskK0sBayes::AliAnalysisTaskK0sBayes(const char *name):
   fNpiPos(0),
   fNpiNeg(0),
   fHmismTOF(0),
-  fHchannelTOFdistr(0)
+  fHchannelTOFdistr(0),
+  fTypeCol(2)
 {
 
   DefineOutput(1, TList::Class());
@@ -370,7 +372,7 @@ void AliAnalysisTaskK0sBayes::UserExec(Option_t *)
        v0Centr = centrality->GetCentralityPercentile("TRK"); 
       }
 
-      if(TMath::Abs(v0Centr - trkCentr) < 5.0 && v0Centr>0){ // consistency cut on centrality selection
+      if((TMath::Abs(v0Centr - trkCentr) < 5.0 || (fTypeCol!=2)) && v0Centr>0){ // consistency cut on centrality selection
         fCentrality = v0Centr;
        Analyze(fOutputAOD); // Do analysis!!!!
 
@@ -412,6 +414,9 @@ void AliAnalysisTaskK0sBayes::Analyze(AliAODEvent* aodEvent)
   if(fCentrality < 50) addMismatchForMC += 0.01;
   if(fCentrality < 20) addMismatchForMC += 0.02;
 
+  if(fTypeCol == 0) addMismatchForMC = 0.005;
+  else if(fTypeCol == 1) addMismatchForMC *= 0.5;
+
   fPsi = 0;
   /* Compute TPC EP */
   Double_t Qx2 = 0, Qy2 = 0;
@@ -566,11 +571,13 @@ void AliAnalysisTaskK0sBayes::Analyze(AliAODEvent* aodEvent)
 
     Int_t tofMatch1 = (KpTrack->GetStatus() & AliVTrack::kTOFout) && (KpTrack->GetStatus() & AliVTrack::kTIME);
 
+    /*
     if(mcArray){
       Int_t labelK = TMath::Abs(KpTrack->GetLabel());
       AliAODMCParticle *mcp1 = (AliAODMCParticle*)mcArray->At(labelK);
-//       pdg1 = TMath::Abs(mcp1->GetPdgCode());
+      pdg1 = TMath::Abs(mcp1->GetPdgCode());
     }
+    */
 
     fPidKp = Int_t(probP[2]*100);
 
@@ -673,12 +680,13 @@ void AliAnalysisTaskK0sBayes::Analyze(AliAODEvent* aodEvent)
       nSigmaComb2=5;
 
       Int_t tofMatch2 = (KnTrack->GetStatus() & AliVTrack::kTOFout) && (KnTrack->GetStatus() & AliVTrack::kTIME);
-
+      /*
       if(mcArray){
        Int_t labelK = TMath::Abs(KnTrack->GetLabel());
        AliAODMCParticle *mcp2 = (AliAODMCParticle*)mcArray->At(labelK);
-//     pdg2 = TMath::Abs(mcp2->GetPdgCode());
-     }
+       pdg2 = TMath::Abs(mcp2->GetPdgCode());
+      }
+      */
 
       fPidKn = Int_t(probN[2]*100);
 
@@ -1032,8 +1040,7 @@ Int_t AliAnalysisTaskK0sBayes::FindDaugheterIndex(AliAODTrack *trk){
 Int_t AliAnalysisTaskK0sBayes::IsChannelValid(Float_t etaAbs){
   if(!fIsMC) return 1; // used only on MC
 
-  Int_t run = fOutputAOD->GetRunNumber();
-  if( (run>=136851&&run<=139846) || (run>=165772 && run<=170718) ){ // LHC10h or LHC11h because of TOF matching window at 3 cm
+  if(fTypeCol == 2){ // LHC10h or LHC11h because of TOF matching window at 3 cm
     Int_t channel = Int_t(4334.09 - 4758.36 * etaAbs -1989.71 * etaAbs*etaAbs + 1957.62*etaAbs*etaAbs*etaAbs); 
   
     if(!(channel%20)) return 0; // 5% additional loss in MC
index cb01dc6..7e81d0c 100644 (file)
@@ -47,6 +47,9 @@ class AliAnalysisTaskK0sBayes : public AliAnalysisTaskSE {
   void SetFilterBit(Int_t fb){fFilterBit=fb;};
   Int_t GetFilterBit() const {return fFilterBit;};
 
+  void SetTypeCollisions(Int_t type){fTypeCol = type;}; // 0=pp, 1=pPb, 2=PbPb
+  Int_t GetTypeCollisions() const {return fTypeCol;}; 
+
  private:
   AliAnalysisTaskK0sBayes(const AliAnalysisTaskK0sBayes &old); 
   AliAnalysisTaskK0sBayes& operator=(const AliAnalysisTaskK0sBayes &source); 
@@ -135,7 +138,9 @@ class AliAnalysisTaskK0sBayes : public AliAnalysisTaskSE {
   TH1F *fHmismTOF; //! TOF mismatch distribution
   TH1D *fHchannelTOFdistr; //! TOF channel distance w.r.t. IP
 
-  ClassDef(AliAnalysisTaskK0sBayes, 1);    //Analysis task for bayesian (K0s)
+  Int_t fTypeCol; // type of collision system (0=pp, 1=pPb, 2=PbPb)
+
+  ClassDef(AliAnalysisTaskK0sBayes, 2);    //Analysis task for bayesian (K0s)
 };
 
 #endif
index 1a50325..d3cced1 100644 (file)
@@ -73,7 +73,8 @@ AliAnalysisTaskLambdaBayes::AliAnalysisTaskLambdaBayes():
   fNpPos(0),
   fNpNeg(0),
   fHmismTOF(0),
-  fHchannelTOFdistr(0)
+  fHchannelTOFdistr(0),
+  fTypeCol(2)
 {
   // Default constructor (should not be used)
   fList->SetName("contLambdaBayes1");
@@ -128,7 +129,8 @@ AliAnalysisTaskLambdaBayes::AliAnalysisTaskLambdaBayes(const char *name):
   fNpPos(0),
   fNpNeg(0),
   fHmismTOF(0),
-  fHchannelTOFdistr(0)
+  fHchannelTOFdistr(0),
+  fTypeCol(2)
 {
 
   DefineOutput(1, TList::Class());
@@ -370,7 +372,7 @@ void AliAnalysisTaskLambdaBayes::UserExec(Option_t *)
        v0Centr = centrality->GetCentralityPercentile("TRK"); 
       }
 
-      if(TMath::Abs(v0Centr - trkCentr) < 5.0 && v0Centr>0){ // consistency cut on centrality selection
+      if((TMath::Abs(v0Centr - trkCentr) < 5.0 || (fTypeCol!=2)) && v0Centr>0){ // consistency cut on centrality selection
         fCentrality = v0Centr;
        Analyze(fOutputAOD); // Do analysis!!!!
 
@@ -412,6 +414,9 @@ void AliAnalysisTaskLambdaBayes::Analyze(AliAODEvent* aodEvent)
   if(fCentrality < 50) addMismatchForMC += 0.01;
   if(fCentrality < 20) addMismatchForMC += 0.02;
 
+  if(fTypeCol == 0) addMismatchForMC = 0.005;
+  else if(fTypeCol == 1) addMismatchForMC *= 0.5;
+
   fPsi = 0;
   /* Compute TPC EP */
   Double_t Qx2 = 0, Qy2 = 0;
@@ -567,12 +572,13 @@ void AliAnalysisTaskLambdaBayes::Analyze(AliAODEvent* aodEvent)
     if(! (TMath::Abs(nSigmaTPC) < 5)) continue;
 
     Int_t tofMatch1 = (KpTrack->GetStatus() & AliVTrack::kTOFout) && (KpTrack->GetStatus() & AliVTrack::kTIME);
-
+    /*
     if(mcArray){
       Int_t labelK = TMath::Abs(KpTrack->GetLabel());
       AliAODMCParticle *mcp1 = (AliAODMCParticle*)mcArray->At(labelK);
-//       pdg1 = TMath::Abs(mcp1->GetPdgCode());
+      pdg1 = TMath::Abs(mcp1->GetPdgCode());
     }
+    */
 
     fPidKp = Int_t(probP[4]*100);
 
@@ -673,12 +679,13 @@ void AliAnalysisTaskLambdaBayes::Analyze(AliAODEvent* aodEvent)
       nSigmaComb2=5;
 
       Int_t tofMatch2 = (KnTrack->GetStatus() & AliVTrack::kTOFout) && (KnTrack->GetStatus() & AliVTrack::kTIME);
-
+      /*
       if(mcArray){
        Int_t labelK = TMath::Abs(KnTrack->GetLabel());
        AliAODMCParticle *mcp2 = (AliAODMCParticle*)mcArray->At(labelK);
-//     pdg2 = TMath::Abs(mcp2->GetPdgCode());
-     }
+       pdg2 = TMath::Abs(mcp2->GetPdgCode());
+      }
+      */
 
       fPidKn = Int_t(probN[2]*100);
 
@@ -927,8 +934,7 @@ Int_t AliAnalysisTaskLambdaBayes::FindDaugheterIndex(AliAODTrack *trk){
 Int_t AliAnalysisTaskLambdaBayes::IsChannelValid(Float_t etaAbs){
   if(!fIsMC) return 1; // used only on MC
 
-  Int_t run = fOutputAOD->GetRunNumber();
-  if( (run>=136851&&run<=139846) || (run>=165772 && run<=170718) ){ // LHC10h or LHC11h because of TOF matching window at 3 cm
+  if( fTypeCol==2){ // LHC10h or LHC11h because of TOF matching window at 3 cm
     Int_t channel = Int_t(4334.09 - 4758.36 * etaAbs -1989.71 * etaAbs*etaAbs + 1957.62*etaAbs*etaAbs*etaAbs); 
   
     if(!(channel%20)) return 0; // 5% additional loss in MC
index 5b17a96..ca54979 100644 (file)
@@ -47,6 +47,9 @@ class AliAnalysisTaskLambdaBayes : public AliAnalysisTaskSE {
   void SetFilterBit(Int_t fb){fFilterBit=fb;};
   Int_t GetFilterBit() const {return fFilterBit;};
 
+  void SetTypeCollisions(Int_t type){fTypeCol = type;}; // 0=pp, 1=pPb, 2=PbPb
+  Int_t GetTypeCollisions() const {return fTypeCol;}; 
+
  private:
   AliAnalysisTaskLambdaBayes(const AliAnalysisTaskLambdaBayes &old); 
   AliAnalysisTaskLambdaBayes& operator=(const AliAnalysisTaskLambdaBayes &source); 
@@ -135,7 +138,9 @@ class AliAnalysisTaskLambdaBayes : public AliAnalysisTaskSE {
   TH1F *fHmismTOF; //! TOF mismatch distribution
   TH1D *fHchannelTOFdistr; //! TOF channel distance w.r.t. IP
 
-  ClassDef(AliAnalysisTaskLambdaBayes, 1);    //Analysis task for Bayesian (Lambda)
+  Int_t fTypeCol; // type of collision system (0=pp, 1=pPb, 2=PbPb)
+
+  ClassDef(AliAnalysisTaskLambdaBayes, 2);    //Analysis task for Bayesian (Lambda)
 };
 
 #endif
index d39e9d2..66a5899 100644 (file)
@@ -70,7 +70,8 @@ AliAnalysisTaskPhiBayes::AliAnalysisTaskPhiBayes():
   fContPid(NULL),
   fContPid2(NULL),
   fHmismTOF(0),
-  fHchannelTOFdistr(0)
+  fHchannelTOFdistr(0),
+  fTypeCol(2)
 {
   // Default constructor (should not be used)
   fList->SetName("contPhiBayes1");
@@ -122,7 +123,8 @@ AliAnalysisTaskPhiBayes::AliAnalysisTaskPhiBayes(const char *name):
   fContPid(NULL),
   fContPid2(NULL),
   fHmismTOF(0),
-  fHchannelTOFdistr(0)
+  fHchannelTOFdistr(0),
+  fTypeCol(2)
 {
 
   DefineOutput(1, TList::Class());
@@ -362,7 +364,7 @@ void AliAnalysisTaskPhiBayes::UserExec(Option_t *)
        v0Centr = centrality->GetCentralityPercentile("TRK"); 
       }
 
-      if(TMath::Abs(v0Centr - trkCentr) < 5.0 && v0Centr>0){ // consistency cut on centrality selection
+      if((TMath::Abs(v0Centr - trkCentr) < 5.0 || (fTypeCol!=2)) && v0Centr>0){ // consistency cut on centrality selection
         fCentrality = v0Centr;
        Analyze(fOutputAOD); // Do analysis!!!!
 
@@ -403,6 +405,9 @@ void AliAnalysisTaskPhiBayes::Analyze(AliAODEvent* aodEvent)
   if(fCentrality < 50) addMismatchForMC += 0.01;
   if(fCentrality < 20) addMismatchForMC += 0.02;
 
+  if(fTypeCol == 0) addMismatchForMC = 0.005;
+  else if(fTypeCol == 1) addMismatchForMC *= 0.5;
+
   fPsi = 0;
   /* Compute TPC EP */
   Double_t Qx2 = 0, Qy2 = 0;
@@ -555,12 +560,13 @@ void AliAnalysisTaskPhiBayes::Analyze(AliAODEvent* aodEvent)
     if(! (TMath::Abs(nSigmaTPC) < 5)) continue;
 
     Int_t tofMatch1 = (KpTrack->GetStatus() & AliVTrack::kTOFout) && (KpTrack->GetStatus() & AliVTrack::kTIME);
-
+    /*
     if(mcArray){
       Int_t labelK = TMath::Abs(KpTrack->GetLabel());
       AliAODMCParticle *mcp1 = (AliAODMCParticle*)mcArray->At(labelK);
-//       pdg1 = TMath::Abs(mcp1->GetPdgCode());
+      pdg1 = TMath::Abs(mcp1->GetPdgCode());
     }
+    */
 
     fPidKp = Int_t(probP[3]*100);
 
@@ -665,12 +671,13 @@ void AliAnalysisTaskPhiBayes::Analyze(AliAODEvent* aodEvent)
       nSigmaComb2=5;
 
       Int_t tofMatch2 = (KnTrack->GetStatus() & AliVTrack::kTOFout) && (KnTrack->GetStatus() & AliVTrack::kTIME);
-
+      /*
       if(mcArray){
        Int_t labelK = TMath::Abs(KnTrack->GetLabel());
        AliAODMCParticle *mcp2 = (AliAODMCParticle*)mcArray->At(labelK);
-//     pdg2 = TMath::Abs(mcp2->GetPdgCode());
-     }
+       pdg2 = TMath::Abs(mcp2->GetPdgCode());
+      }
+      */
 
       fPidKn = Int_t(probN[3]*100);
 
@@ -814,8 +821,7 @@ void AliAnalysisTaskPhiBayes::Terminate(Option_t *)
 Int_t AliAnalysisTaskPhiBayes::IsChannelValid(Float_t etaAbs){
   if(!fIsMC) return 1; // used only on MC
 
-  Int_t run = fOutputAOD->GetRunNumber();
-  if( (run>=136851&&run<=139846) || (run>=165772 && run<=170718) ){ // LHC10h or LHC11h because of TOF matching window at 3 cm
+  if(fTypeCol == 2){ // LHC10h or LHC11h because of TOF matching window at 3 cm
     Int_t channel = Int_t(4334.09 - 4758.36 * etaAbs -1989.71 * etaAbs*etaAbs + 1957.62*etaAbs*etaAbs*etaAbs); 
   
     if(!(channel%20)) return 0; // 5% additional loss in MC
index 6fd3dc2..f89a6bb 100644 (file)
@@ -47,6 +47,9 @@ class AliAnalysisTaskPhiBayes : public AliAnalysisTaskSE {
   void SetFilterBit(Int_t fb){fFilterBit=fb;};
   Int_t GetFilterBit() const {return fFilterBit;};
 
+  void SetTypeCollisions(Int_t type){fTypeCol = type;}; // 0=pp, 1=pPb, 2=PbPb
+  Int_t GetTypeCollisions() const {return fTypeCol;}; 
+
  private:
   AliAnalysisTaskPhiBayes(const AliAnalysisTaskPhiBayes &old); 
   AliAnalysisTaskPhiBayes& operator=(const AliAnalysisTaskPhiBayes &source); 
@@ -120,7 +123,9 @@ class AliAnalysisTaskPhiBayes : public AliAnalysisTaskSE {
   TH1F *fHmismTOF;         //! TOF mismatch distribution
   TH1D *fHchannelTOFdistr; //! TOF channel distance w.r.t. IP
 
-  ClassDef(AliAnalysisTaskPhiBayes, 1);    //Analysis task for bayesian (K0s)
+  Int_t fTypeCol; // type of collision system (0=pp, 1=pPb, 2=PbPb)
+
+  ClassDef(AliAnalysisTaskPhiBayes, 2);    //Analysis task for bayesian (K0s)
 };
 
 #endif