new triggered event selection + small corrections
authorjotwinow <jotwinow@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 15 Jan 2010 04:11:42 +0000 (04:11 +0000)
committerjotwinow <jotwinow@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 15 Jan 2010 04:11:42 +0000 (04:11 +0000)
12 files changed:
PWG0/dNdPt/AlidNdPt.cxx
PWG0/dNdPt/AlidNdPt.h
PWG0/dNdPt/AlidNdPtAnalysis.cxx
PWG0/dNdPt/AlidNdPtCorrection.cxx
PWG0/dNdPt/AlidNdPtCorrection.h
PWG0/dNdPt/AlidNdPtCutAnalysis.cxx
PWG0/dNdPt/AlidNdPtCutAnalysis.h
PWG0/dNdPt/AlidNdPtHelper.cxx
PWG0/dNdPt/AlidNdPtHelper.h
PWG0/dNdPt/macros/CreatedNdPtTrackCuts.C
PWG0/dNdPt/macros/LoadMyLibs.C
PWG0/dNdPt/macros/rundNdPt.C

index b7a23edef64580bd5738a5dc7c3dbb058dfc9d69..8fe4399049bbcf1aa12e231a7bb3f5e89222a816 100644 (file)
@@ -16,6 +16,7 @@
 #include "AliESDtrackCuts.h"  \r
 #include "AlidNdPtEventCuts.h"\r
 #include "AlidNdPtAcceptanceCuts.h"\r
+#include "AliPhysicsSelection.h"\r
 #include "AlidNdPt.h"\r
 \r
 using namespace std;\r
@@ -32,6 +33,7 @@ AlidNdPt::AlidNdPt(): TNamed()
 , fTrigger(AliTriggerAnalysis::kMB1) \r
 , fTriggerClass(0) \r
 , fParticleMode(AlidNdPtHelper::kAllPart) \r
+, fPhysicsSelection(0)\r
 {\r
   // default constructor\r
 }\r
@@ -46,14 +48,16 @@ AlidNdPt::AlidNdPt(Char_t* name, Char_t* title): TNamed(name,title)
 , fTrigger(AliTriggerAnalysis::kMB1) \r
 , fTriggerClass(0) \r
 , fParticleMode(AlidNdPtHelper::kAllPart) \r
+, fPhysicsSelection(0)\r
 {\r
   // constructor\r
 }\r
 \r
 //_____________________________________________________________________________\r
-AlidNdPt::~AlidNdPt(){\r
+AlidNdPt::~AlidNdPt() {\r
   // destructor\r
   if(fdNdPtEventCuts) delete fdNdPtEventCuts; fdNdPtEventCuts=NULL; \r
   if(fdNdPtAcceptanceCuts) delete fdNdPtAcceptanceCuts; fdNdPtAcceptanceCuts=NULL;\r
   if(fEsdTrackCuts) delete fEsdTrackCuts; fEsdTrackCuts=NULL;\r
+  if(fPhysicsSelection) delete fPhysicsSelection; fPhysicsSelection=NULL;\r
 }\r
index 3c6b4c3eacb0700856e1f137f0170ac5043483df..50107ea0cc075e67db1f5b744c4d83d4876b89c2 100644 (file)
@@ -12,6 +12,7 @@ class AliMCEvent;
 class AliESDtrackCuts; 
 class AlidNdPtEventCuts;
 class AlidNdPtAcceptanceCuts;
+class AliPhysicsSelection;
 
 #include "TNamed.h"
 #include "TFolder.h"
@@ -52,6 +53,7 @@ public:
   void SetTrigger(const AliTriggerAnalysis::Trigger trigger)    { fTrigger = trigger; }
   void SetTriggerClass(const Char_t *triggerClass)              { fTriggerClass = triggerClass; }
   void SetParticleMode(const AlidNdPtHelper::ParticleMode mode) { fParticleMode = mode; }
+  void SetPhysicsTriggerSelection(AliPhysicsSelection* const selection)  { fPhysicsSelection = selection; }
 
   AlidNdPtEventCuts* GetEventCuts() const                       { return fdNdPtEventCuts; }
   AlidNdPtAcceptanceCuts* GetAcceptanceCuts() const             { return fdNdPtAcceptanceCuts; }
@@ -61,6 +63,7 @@ public:
   AliTriggerAnalysis::Trigger GetTrigger() const                { return fTrigger; }
   const Char_t* GetTriggerClass() const                         { return fTriggerClass; }
   AlidNdPtHelper::ParticleMode GetParticleMode() const          { return fParticleMode; }
+  AliPhysicsSelection* GetPhysicsTriggerSelection() const       { return fPhysicsSelection; }
 
 private:
 
@@ -74,6 +77,8 @@ private:
   const Char_t * fTriggerClass;                 // trigger class
   AlidNdPtHelper::ParticleMode fParticleMode;   // selected particle (pion, kaon, ...)
 
+  AliPhysicsSelection* fPhysicsSelection; // physics trigger selection class
+
   ClassDef(AlidNdPt,1);
 };
 
index 19300678acde7226574998f9aba9cf74faf4dd36..e0fcb8f7fbc71e0d725d880f250dfd92f4c8bc4e 100644 (file)
@@ -31,6 +31,7 @@
 \r
 #include "AlidNdPtEventCuts.h"\r
 #include "AlidNdPtAcceptanceCuts.h"\r
+#include "AliPhysicsSelection.h"\r
 \r
 #include "AliPWG0Helper.h"\r
 #include "AlidNdPtHelper.h"\r
@@ -859,15 +860,25 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
     return;\r
   }\r
 \r
+  // get physics trigger selection \r
+  AliPhysicsSelection *trigSel = GetPhysicsTriggerSelection();\r
+  if(!trigSel) {\r
+    AliDebug(AliLog::kError, "cannot get trigSel");\r
+    return;\r
+  }\r
+\r
   // trigger selection\r
   Bool_t isEventTriggered = kTRUE;\r
   if(evtCuts->IsTriggerRequired())  {\r
     if(IsUseMCInfo()) { \r
-      static AliTriggerAnalysis* triggerAnalysis = new AliTriggerAnalysis;\r
-      isEventTriggered = triggerAnalysis->IsTriggerFired(esdEvent, GetTrigger());\r
+      //static AliTriggerAnalysis* triggerAnalysis = new AliTriggerAnalysis;\r
+      //isEventTriggered = triggerAnalysis->IsTriggerFired(esdEvent, GetTrigger());\r
+      trigSel->SetAnalyzeMC();\r
+      isEventTriggered = trigSel->IsCollisionCandidate(esdEvent);\r
     }\r
     else {\r
-      isEventTriggered = esdEvent->IsTriggerClassFired(GetTriggerClass());\r
+      //isEventTriggered = esdEvent->IsTriggerClassFired(GetTriggerClass());\r
+      isEventTriggered = trigSel->IsCollisionCandidate(esdEvent);\r
     }\r
   }\r
 \r
@@ -948,7 +959,7 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
   else if(GetAnalysisMode() == AlidNdPtHelper::kTPCSPDvtx || GetAnalysisMode()==AlidNdPtHelper::kTPCSPDvtxUpdate) \r
   {\r
      //multMBTracks = AlidNdPtHelper::GetSPDMBTrackMult(esdEvent,0.0);\r
-     if(vtxESD)\r
+     if(vtxESD->GetStatus())\r
        multMBTracks = vtxESD->GetNContributors();\r
   } \r
   else {\r
@@ -980,10 +991,12 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
       if(!track) continue;\r
       if(track->Charge()==0) continue;\r
 \r
+      /*\r
       // cosmics analysis\r
       if( GetParticleMode()==AlidNdPtHelper::kCosmics  && \r
           AlidNdPtHelper::IsCosmicTrack(allChargedTracks, track, i, accCuts, esdTrackCuts)==kFALSE ) \r
         continue;\r
+      */\r
 \r
       // only postive charged \r
       if(GetParticleMode() == AlidNdPtHelper::kPlus && track->Charge() < 0) \r
index 10d3c9892df28a648ff97655f0379ac853d9b249..8f00fa8c57f695c483047c31a66532b20b943ad7 100644 (file)
@@ -30,6 +30,7 @@
 \r
 #include "AlidNdPtEventCuts.h"\r
 #include "AlidNdPtAcceptanceCuts.h"\r
+#include "AliPhysicsSelection.h"\r
 \r
 #include "AliPWG0Helper.h"\r
 #include "AlidNdPtHelper.h"\r
@@ -69,7 +70,8 @@ ClassImp(AlidNdPtCorrection)
   fCorrTrackMatrix(0),\r
   fContTrackMatrix(0),\r
   fContMultTrackMatrix(0),\r
-  fCorrMatrixFileName("")\r
+  fCorrMatrixFileName(""),\r
+  fCosmicsHisto(0)\r
 {\r
   // default constructor\r
   for(Int_t i=0; i<AlidNdPtHelper::kCutSteps; i++) { \r
@@ -117,7 +119,8 @@ AlidNdPtCorrection::AlidNdPtCorrection(Char_t* name, Char_t* title, TString corr
   fCorrTrackMatrix(0),\r
   fContTrackMatrix(0),\r
   fContMultTrackMatrix(0),\r
-  fCorrMatrixFileName(corrMatrixFileName)\r
+  fCorrMatrixFileName(corrMatrixFileName),\r
+  fCosmicsHisto(0)\r
 {\r
   // constructor\r
   for(Int_t i=0; i<AlidNdPtHelper::kCutSteps; i++) { \r
@@ -156,6 +159,7 @@ AlidNdPtCorrection::~AlidNdPtCorrection() {
   if(fMCNSDEventAllPrimTrackMultHist1) delete fMCNSDEventAllPrimTrackMultHist1; fMCNSDEventAllPrimTrackMultHist1=0;\r
   if(fMCTriggerPrimTrackMultHist1) delete fMCTriggerPrimTrackMultHist1; fMCTriggerPrimTrackMultHist1=0;\r
   if(fMCEventPrimTrackMultHist1) delete fMCEventPrimTrackMultHist1; fMCEventPrimTrackMultHist1=0;\r
+  if(fCosmicsHisto) delete fCosmicsHisto; fCosmicsHisto=0;\r
 \r
   for(Int_t i=0; i<AlidNdPtHelper::kCutSteps; i++) { \r
     if(fRecTrackHist1[i]) delete fRecTrackHist1[i]; fRecTrackHist1[i]=0;\r
@@ -389,6 +393,22 @@ void AlidNdPtCorrection::Init(){
     fCorrRecEventHist2[i]->GetAxis(1)->SetTitle("multiplicity");\r
     fCorrRecEventHist2[i]->Sumw2();\r
   }\r
+  \r
+  //\r
+  // cosmics histo\r
+  //\r
+  Int_t binsCosmicsHisto[3]=  {151, 300, ptNbins};\r
+  Double_t minCosmicsHisto[3]={-1.5, -2.*TMath::Pi(), 0.0}; \r
+  Double_t maxCosmicsHisto[3]={ 1.5, 2.*TMath::Pi(), 16.0}; \r
+  sprintf(name,"fCosmicsHisto");\r
+  sprintf(title,"deta:dphi:pt");\r
+  \r
+  fCosmicsHisto = new THnSparseF(name,title,3,binsCosmicsHisto,minCosmicsHisto,maxCosmicsHisto);\r
+  fCosmicsHisto->SetBinEdges(2,binsPt);\r
+  fCosmicsHisto->GetAxis(0)->SetTitle("#Delta#eta");\r
+  fCosmicsHisto->GetAxis(1)->SetTitle("#Delta#phi (rad)");\r
+  fCosmicsHisto->GetAxis(2)->SetTitle("pt (GV/c)");\r
+  fCosmicsHisto->Sumw2();\r
 \r
   // init output folder\r
   fCorrectionFolder = CreateFolder("folderdNdPt","Correction dNdPt Folder");\r
@@ -522,15 +542,25 @@ void AlidNdPtCorrection::Process(AliESDEvent *esdEvent, AliMCEvent *mcEvent)
     return;\r
   }\r
 \r
+  // get physics trigger selection \r
+  AliPhysicsSelection *trigSel = GetPhysicsTriggerSelection();\r
+  if(!trigSel) {\r
+    AliDebug(AliLog::kError, "cannot get trigSel");\r
+    return;\r
+  }\r
+\r
   // trigger selection\r
   Bool_t isEventTriggered = kTRUE;\r
   if(evtCuts->IsTriggerRequired())  {\r
     if(IsUseMCInfo()) { \r
-      static AliTriggerAnalysis* triggerAnalysis = new AliTriggerAnalysis;\r
-      isEventTriggered = triggerAnalysis->IsTriggerFired(esdEvent, GetTrigger());\r
+      //static AliTriggerAnalysis* triggerAnalysis = new AliTriggerAnalysis;\r
+      //isEventTriggered = triggerAnalysis->IsTriggerFired(esdEvent, GetTrigger());\r
+      trigSel->SetAnalyzeMC();\r
+      isEventTriggered = trigSel->IsCollisionCandidate(esdEvent);\r
     }\r
     else {\r
-      isEventTriggered = esdEvent->IsTriggerClassFired(GetTriggerClass());\r
+      //isEventTriggered = esdEvent->IsTriggerClassFired(GetTriggerClass());\r
+      isEventTriggered = trigSel->IsCollisionCandidate(esdEvent);\r
     }\r
   }\r
 \r
@@ -628,7 +658,6 @@ void AlidNdPtCorrection::Process(AliESDEvent *esdEvent, AliMCEvent *mcEvent)
   if(isEventOK && isEventTriggered)\r
   {\r
     // get all charged tracks\r
-    //allChargedTracks = AlidNdPtHelper::GetAllChargedTracks(esdEvent,vtxESD,GetAnalysisMode());\r
     allChargedTracks = AlidNdPtHelper::GetAllChargedTracks(esdEvent,GetAnalysisMode());\r
     if(!allChargedTracks) return;\r
 \r
@@ -650,6 +679,31 @@ void AlidNdPtCorrection::Process(AliESDEvent *esdEvent, AliMCEvent *mcEvent)
       if(GetParticleMode() == AlidNdPtHelper::kMinus && track->Charge() > 0) \r
         continue;\r
 \r
+      // cosmics analysis\r
+      Bool_t isCosmic = kFALSE;\r
+      if( GetParticleMode()==AlidNdPtHelper::kCosmics )\r
+      {\r
+          for(Int_t j=0; j<entries;++j) \r
+          {\r
+            AliESDtrack *track1 = (AliESDtrack*)allChargedTracks->At(j);\r
+            if(!track1) continue;\r
+            if(track1->Charge()==0) continue;\r
+\r
+            if( esdTrackCuts->AcceptTrack(track) && accCuts->AcceptTrack(track) && \r
+               esdTrackCuts->AcceptTrack(track1) && accCuts->AcceptTrack(track1) ) \r
+            { \r
+              isCosmic = AlidNdPtHelper::IsCosmicTrack(track, track1, i, accCuts, esdTrackCuts);\r
+           }\r
+            if(isCosmic) \r
+           {\r
+             Double_t vCosmicsHisto[3] = {track->Eta()+track1->Eta(), track->Phi()-track1->Phi(), track1->Pt()};\r
+             fCosmicsHisto->Fill(vCosmicsHisto);\r
+           }\r
+         }\r
+         \r
+        if(!isCosmic) continue;\r
+      }\r
+\r
       if(esdTrackCuts->AcceptTrack(track) && accCuts->AcceptTrack(track)) \r
         multRecTemp++;\r
     }  \r
@@ -1084,6 +1138,7 @@ Long64_t AlidNdPtCorrection::Merge(TCollection* list)
     fMCNSDEventAllPrimTrackMultHist1->Add(entry->fMCNSDEventAllPrimTrackMultHist1);\r
     fMCTriggerPrimTrackMultHist1->Add(entry->fMCTriggerPrimTrackMultHist1);\r
     fMCEventPrimTrackMultHist1->Add(entry->fMCEventPrimTrackMultHist1);\r
+    fCosmicsHisto->Add(entry->fCosmicsHisto);\r
 \r
     for(Int_t i=0; i<AlidNdPtHelper::kCutSteps; i++) {\r
       fRecTrackHist1[i]->Add(entry->fRecTrackHist1[i]);\r
@@ -1156,6 +1211,14 @@ void AlidNdPtCorrection::Analyse()
   //Double_t maxPt = accCuts->GetMaxPt();\r
   //Double_t minEta = accCuts->GetMinEta();\r
   //Double_t maxEta = accCuts->GetMaxEta()-0.00001;\r
\r
+\r
+  //\r
+  // cosmics background histo\r
+  //\r
+  h2D = fCosmicsHisto->Projection(0,1);\r
+  h2D->SetName("deta_vs_dphi_cosmics");\r
+  aFolderObj->Add(h2D);\r
 \r
   //\r
   // pt profile\r
@@ -1164,6 +1227,7 @@ void AlidNdPtCorrection::Analyse()
   for(Int_t i=0; i<8; i++) {\r
     h2D = fPtvsPt[i]->Projection(1,0);\r
     sprintf(name,"PtvsMeanPt_%d",i);\r
+    h2D->SetName(name);\r
     aFolderObj->Add(h2D);\r
   }\r
 \r
index 24d6060cd309fc6ebef04871867fcb2cde98bb55..65636b33ec6d477603db378d76eb833f930cf10f 100644 (file)
@@ -262,6 +262,9 @@ private:
   THnSparseF *fContMultTrackMatrix; //-> mcVz:mcPt:mcEta (fRecMultTrackMatrix / fRecTrackMatrix)
   
   TString fCorrMatrixFileName; // file with efficiency correction matrices
+
+  //  deta, dphi, pt1 for cosmics
+  THnSparseF *fCosmicsHisto; //-> deta:dphi:pt
   
   AlidNdPtCorrection(const AlidNdPtCorrection&); // not implemented
   AlidNdPtCorrection& operator=(const AlidNdPtCorrection&); // not implemented
index 46a9f9867377835a90b7e010a76b40a123454581..6514eaf22f2c513747a7d264021720b90910b17c 100644 (file)
@@ -30,6 +30,7 @@
 \r
 #include "AlidNdPtEventCuts.h"\r
 #include "AlidNdPtAcceptanceCuts.h"\r
+#include "AliPhysicsSelection.h"\r
 \r
 #include "AliPWG0Helper.h"\r
 #include "AlidNdPtHelper.h"\r
@@ -135,12 +136,12 @@ void AlidNdPtCutAnalysis::Init(){
   // THnSparse track histograms\r
   //\r
 \r
-  //nClust:chi2PerClust:nClust/nFindableClust:DCAy:DCAz:eta:phi:pt:isKink:isPrim\r
-  Int_t binsRecMCTrackHist[10]={160,80,80,80,80,30,90,ptNbins, 2,2};\r
-  Double_t minRecMCTrackHist[10]={0., 0., 0., -10.,-10.,-1.5, 0., ptMin, 0., 0.};\r
-  Double_t maxRecMCTrackHist[10]={160.,10.,1.2, 10.,10.,1.5, 2.*TMath::Pi(), ptMax, 2.,2.};\r
+  //nClust:chi2PerClust:nClust/nFindableClust:DCAy:DCAz:eta:phi:pt:isKink:isPrim:polarity\r
+  Int_t binsRecMCTrackHist[11]={160,80,80,80,80,30,90,ptNbins, 2, 2, 2};\r
+  Double_t minRecMCTrackHist[11]={0., 0., 0., -10.,-10.,-1.5, 0., ptMin, 0., 0., 0.};\r
+  Double_t maxRecMCTrackHist[11]={160.,10.,1.2, 10.,10.,1.5, 2.*TMath::Pi(), ptMax, 2.,2., 2.};\r
 \r
-  fRecMCTrackHist = new THnSparseF("fRecMCTrackHist","nClust:chi2PerClust:nClust/nFindableClust:DCAy:DCAz:eta:phi:pt:isKink:isPrim",10,binsRecMCTrackHist,minRecMCTrackHist,maxRecMCTrackHist);\r
+  fRecMCTrackHist = new THnSparseF("fRecMCTrackHist","nClust:chi2PerClust:nClust/nFindableClust:DCAy:DCAz:eta:phi:pt:isKink:isPrim:polarity",10,binsRecMCTrackHist,minRecMCTrackHist,maxRecMCTrackHist);\r
   fRecMCTrackHist->SetBinEdges(7,binsPt);\r
 \r
   fRecMCTrackHist->GetAxis(0)->SetTitle("nClust");\r
@@ -153,6 +154,7 @@ void AlidNdPtCutAnalysis::Init(){
   fRecMCTrackHist->GetAxis(7)->SetTitle("p_{T} (GeV/c)");\r
   fRecMCTrackHist->GetAxis(8)->SetTitle("isKink");\r
   fRecMCTrackHist->GetAxis(9)->SetTitle("isPrim");\r
+  fRecMCTrackHist->GetAxis(10)->SetTitle("polarity");\r
   fRecMCTrackHist->Sumw2();\r
 \r
   // init output folder\r
@@ -181,15 +183,25 @@ void AlidNdPtCutAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent * cons
     return;\r
   }\r
 \r
+  // get physics trigger selection \r
+  AliPhysicsSelection *trigSel = GetPhysicsTriggerSelection();\r
+  if(!trigSel) {\r
+    AliDebug(AliLog::kError, "cannot get trigSel");\r
+    return;\r
+  }\r
+\r
   // trigger selection\r
   Bool_t isEventTriggered = kTRUE;\r
   if(evtCuts->IsTriggerRequired())  {\r
     if(IsUseMCInfo()) { \r
-      static AliTriggerAnalysis* triggerAnalysis = new AliTriggerAnalysis;\r
-      isEventTriggered = triggerAnalysis->IsTriggerFired(esdEvent, GetTrigger());\r
+      //static AliTriggerAnalysis* triggerAnalysis = new AliTriggerAnalysis;\r
+      //isEventTriggered = triggerAnalysis->IsTriggerFired(esdEvent, GetTrigger());\r
+      trigSel->SetAnalyzeMC();\r
+      isEventTriggered = trigSel->IsCollisionCandidate(esdEvent);\r
     }\r
     else {\r
-      isEventTriggered = esdEvent->IsTriggerClassFired(GetTriggerClass());\r
+      //isEventTriggered = esdEvent->IsTriggerClassFired(GetTriggerClass());\r
+      isEventTriggered = trigSel->IsCollisionCandidate(esdEvent);\r
     }\r
   }\r
 \r
@@ -346,7 +358,10 @@ void AlidNdPtCutAnalysis::FillHistograms(AliESDtrack *const esdTrack, AliStack *
   }\r
 \r
   // fill histo\r
-  Double_t vRecMCTrackHist[10] = {nClust,chi2PerCluster,clustPerFindClust,b[0],b[1],eta,phi,pt,isKink,isPrim}; \r
+  Int_t polarity = -2;\r
+  if (esdTrack->Charge() < 0.) polarity = 0; \r
+  else polarity = 1; \r
+  Double_t vRecMCTrackHist[11] = { nClust,chi2PerCluster,clustPerFindClust,b[0],b[1],eta,phi,pt,isKink,isPrim, polarity }; \r
   fRecMCTrackHist->Fill(vRecMCTrackHist);\r
 }\r
 \r
index e055aa368030947bba71d31e9663a561d425e8af..f4a8dae0a2e67a2c7e08134988236148d57dfebf 100644 (file)
@@ -85,7 +85,7 @@ private:
   //
   // THnSparse track histograms
   //
-  THnSparseF *fRecMCTrackHist; //-> nClust:chi2PerClust:nClust/nFindableClust:DCAy:DCAz:eta:phi:pt:isNotKink:isPrim
+  THnSparseF *fRecMCTrackHist; //-> nClust:chi2PerClust:nClust/nFindableClust:DCAy:DCAz:eta:phi:pt:isNotKink:isPrim:polarity
 
   AlidNdPtCutAnalysis(const AlidNdPtCutAnalysis&); // not implemented
   AlidNdPtCutAnalysis& operator=(const AlidNdPtCutAnalysis&); // not implemented
index d64237093ab15b46abd019a63538e78688a8a252..0fee2d8d481840663c682cf8143f8dd5ba84748f 100644 (file)
@@ -238,6 +238,7 @@ return prim;
 }
 
 //____________________________________________________________________
+/*
 Bool_t AlidNdPtHelper::IsCosmicTrack(TObjArray *allChargedTracks, AliESDtrack *track1, Int_t trackIdx, AlidNdPtAcceptanceCuts *accCuts, AliESDtrackCuts *trackCuts)
 {
 //
@@ -260,7 +261,6 @@ Bool_t AlidNdPtHelper::IsCosmicTrack(TObjArray *allChargedTracks, AliESDtrack *t
       if(!track2) continue;
       if(track2->Charge()==0) continue;
 
-      /*
       if(track1->Pt() > 6. && track2->Pt() > 6. && (track1->Charge() + track2->Charge()) == 0 ) 
       {
         printf("track1->Theta() %f, track1->Eta() %f, track1->Phi() %f, track1->Charge() %d  \n", track1->Theta(), track1->Eta(), track1->Phi(), track1->Charge());
@@ -268,6 +268,46 @@ Bool_t AlidNdPtHelper::IsCosmicTrack(TObjArray *allChargedTracks, AliESDtrack *t
 
         printf("deta %f, dphi %f, dq %d  \n", track1->Eta()-track2->Eta(), track1->Phi()-track2->Phi(), track1->Charge()+track2->Charge()); 
 
+      }
+
+      //
+      // cosmic tracks in TPC
+      //
+      //if( TMath::Abs( track1->Theta() - track2->Theta() ) < 0.004  && 
+      //  ((TMath::Abs(track1->Phi()-track2->Phi()) - TMath::Pi() )<0.004) && 
+      if( (track1->Pt()-track2->Pt()) < 0.1 && track1->Pt() > 4.0 && (track1->Charge()+track2->Charge()) == 0 )
+      {
+        //printf("COSMIC  candidate \n");
+        printf("track1->Theta() %f, track1->Eta() %f, track1->Phi() %f, track1->Charge() %d  \n", track1->Theta(), track1->Eta(), track1->Phi(), track1->Charge());
+        printf("track2->Theta() %f, track2->Eta() %f, track2->Phi() %f, track2->Charge() %d  \n", track2->Theta(), track2->Eta(), track2->Phi(), track2->Charge());
+        printf("dtheta %f, deta %f, dphi %f, dq %d  \n", track1->Theta()-track2->Theta(),  track1->Eta()-track2->Eta(), track1->Phi()-track2->Phi(), track1->Charge()+track2->Charge()); 
+       return kTRUE;
+      }
+   }
+     
+return kFALSE; 
+}
+*/
+
+//____________________________________________________________________
+Bool_t AlidNdPtHelper::IsCosmicTrack(AliESDtrack *track1, AliESDtrack *track2, Int_t trackIdx, AlidNdPtAcceptanceCuts *accCuts, AliESDtrackCuts *trackCuts)
+{
+//
+// check cosmic tracks
+//
+  if(!track1) return kFALSE;
+  if(!track2) return kFALSE;
+  if(!accCuts) return kFALSE;
+  if(!trackCuts) return kFALSE;
+
+  /*
+  if(track1->Pt() > 6. && track2->Pt() > 6. && (track1->Charge() + track2->Charge()) == 0 ) 
+  {
+        printf("track1->Theta() %f, track1->Eta() %f, track1->Phi() %f, track1->Charge() %d  \n", track1->Theta(), track1->Eta(), track1->Phi(), track1->Charge());
+        printf("track2->Theta() %f, track2->Eta() %f, track2->Phi() %f, track2->Charge() %d  \n", track2->Theta(), track2->Eta(), track2->Phi(), track2->Charge());
+
+        printf("deta %f, dphi %f, dq %d  \n", track1->Eta()-track2->Eta(), track1->Phi()-track2->Phi(), track1->Charge()+track2->Charge()); 
+
       }
       */
 
@@ -276,16 +316,18 @@ Bool_t AlidNdPtHelper::IsCosmicTrack(TObjArray *allChargedTracks, AliESDtrack *t
       //
       //if( TMath::Abs( track1->Theta() - track2->Theta() ) < 0.004  && 
       //  ((TMath::Abs(track1->Phi()-track2->Phi()) - TMath::Pi() )<0.004) && 
-      if( (track1->Pt()-track2->Pt()) < 0.1 && track1->Pt() > 6.0 && 
+
+      if( (track1->Pt()-track2->Pt()) < 0.2 && track1->Pt() > 3.0 && 
             (track1->Charge()+track2->Charge()) == 0 )
       {
         //printf("COSMIC  candidate \n");
+       /*
         printf("track1->Theta() %f, track1->Eta() %f, track1->Phi() %f, track1->Charge() %d  \n", track1->Theta(), track1->Eta(), track1->Phi(), track1->Charge());
         printf("track2->Theta() %f, track2->Eta() %f, track2->Phi() %f, track2->Charge() %d  \n", track2->Theta(), track2->Eta(), track2->Phi(), track2->Charge());
         printf("dtheta %f, deta %f, dphi %f, dq %d  \n", track1->Theta()-track2->Theta(),  track1->Eta()-track2->Eta(), track1->Phi()-track2->Phi(), track1->Charge()+track2->Charge()); 
+       */
        return kTRUE;
       }
-   }
      
 return kFALSE; 
 }
index 8d0f72a12d61a29985099358386ef168c8525405..69fbd58a38e3f0e6a60bf20fd43370dbc627a39f 100644 (file)
@@ -48,7 +48,8 @@ class AlidNdPtHelper : public TObject
     static Bool_t TestRecVertex(const AliESDVertex* vertex, AnalysisMode analysisMode, Bool_t debug = kFALSE);
 
     static Bool_t IsPrimaryParticle(AliStack *stack, Int_t idx, ParticleMode particleMode);
-    static Bool_t IsCosmicTrack(TObjArray *allChargedTracks, AliESDtrack *track, Int_t trackIdx, AlidNdPtAcceptanceCuts *accCuts, AliESDtrackCuts *trackCuts);
+    //static Bool_t IsCosmicTrack(TObjArray *allChargedTracks, AliESDtrack *track, Int_t trackIdx, AlidNdPtAcceptanceCuts *accCuts, AliESDtrackCuts *trackCuts);
+    static Bool_t IsCosmicTrack(AliESDtrack *track, AliESDtrack *track, Int_t trackIdx, AlidNdPtAcceptanceCuts *accCuts, AliESDtrackCuts *trackCuts);
     static void PrintConf(AnalysisMode analysisMode, AliTriggerAnalysis::Trigger trigger);
     static Int_t ConvertPdgToPid(TParticle *particle);
 
index 5f8374473666a64a64be860a2dc3aa83101a430c..b2adef48c6310005afe0d129dc7386b590dd034d 100644 (file)
@@ -513,7 +513,8 @@ AliESDtrackCuts* CreatedNdPtTrackCuts(Int_t cutMode=1, Bool_t fieldOn = kTRUE, B
   if (cutMode == 23) 
   {
     // beta cuts (still under investigation)
-    minNClustersTPC = 50;
+    //minNClustersTPC = 50;
+    minNClustersTPC = 90;
     maxChi2PerClusterTPC = 4.0;
     maxDCAtoVertexXY = 2.4; // cm
     maxDCAtoVertexZ  = 3.2; // cm
@@ -1010,6 +1011,35 @@ AliESDtrackCuts* CreatedNdPtTrackCuts(Int_t cutMode=1, Bool_t fieldOn = kTRUE, B
     TString tag = "TPC-only tracking";
   }
 
+  // TPC-only + pt cut + eta cut 
+  if (cutMode == 45) 
+  {
+    // beta cuts (still under investigation)
+    //minNClustersTPC = 50;
+    //maxChi2PerClusterTPC = 4.0;
+    maxDCAtoVertexXY = 2.4; // cm
+    maxDCAtoVertexZ  = 3.2; // cm
+    //minPt=0.15;
+    //maxPt=1.e10;
+
+    esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
+    esdTrackCuts->SetRequireTPCRefit(kFALSE);
+    esdTrackCuts->SetAcceptKinkDaughters(kFALSE);
+    //esdTrackCuts->SetMinNClustersTPC(minNClustersTPC);
+    //esdTrackCuts->SetMaxChi2PerClusterTPC(maxChi2PerClusterTPC);
+    esdTrackCuts->SetMaxDCAToVertexXY(maxDCAtoVertexXY);
+    esdTrackCuts->SetMaxDCAToVertexZ(maxDCAtoVertexZ);
+    esdTrackCuts->SetDCAToVertex2D(kTRUE);
+    //esdTrackCuts->SetPtRange(minPt,maxPt);
+    //esdTrackCuts->SetEtaRange(minEta,maxEta);
+
+    TString tag = "TPC-only tracking";
+  }
+
+
+
+
+
 
   // cuts for data without field
   if (!fieldOn)
index d51e00ff6f20981f33ba7e7419933b07cf0dbb10..e4f97643b35cc601d0f28f3e64d136d4ac899c65 100644 (file)
@@ -7,6 +7,7 @@ void LoadMyLibs() {
   CheckLoadLibrary("libTree");
   CheckLoadLibrary("libGui");
   CheckLoadLibrary("libMinuit");
+  CheckLoadLibrary("libSTAT");
   
   // Load AliRoot libraries
   
index b1c5bcaf861c923d064003d39bc5d1a3241f1c92..c283c88c75841040c8a4be0faaf9e14b7963e9e5 100644 (file)
@@ -1,18 +1,17 @@
-void rundNdPt(const char *fileList ="inputList.txt",const char *outFile = "outputFile.root", Int_t NumberOfFiles=10,Int_t fromFile=0, Int_t nEvents=1000, Int_t firstEvent =0, Bool_t bUseMCInfo=kTRUE, Float_t zvWindow=20., Int_t cutMode=9,Float_t etaWindow=0.9, Float_t ptMin=0.15,AlidNdPtHelper::AnalysisMode analysisMode = AlidNdPtHelper::kTPC, AlidNdPtHelper::OutputObject outputObject=AlidNdPtHelper::kCorrection,const char *corrFile = "corrMatricesFile.root",Bool_t bProof=kFALSE)
+void rundNdPt(const char *fileList ="inputList.txt",const char *outFile = "outputFile.root", Int_t NumberOfFiles=10,Int_t fromFile=0, Int_t nEvents=1000, Int_t firstEvent =0, Bool_t bUseMCInfo=kTRUE, Float_t zvWindow=20., Int_t cutMode=9,Float_t etaWindow=0.9, Float_t ptMin=0.15,AlidNdPtHelper::AnalysisMode analysisMode = AlidNdPtHelper::kTPC, AlidNdPtHelper::ParticleMode particleMode = AlidNdPtHelper::kAllPart,  AlidNdPtHelper::OutputObject outputObject=AlidNdPtHelper::kCorrection,const char *corrFile = "corrMatricesFile.root",Bool_t bProof=kFALSE)
 {
   // set Proof
   if(bProof) { 
     
     //cout << "*** START PROOF Lite SESSION ***" << endl;
-    TProof::Open(""); // 1. Enter your username here
+    //TProof::Open(""); // 1. Enter your username here
     
-    /*
-    TProofMgr * proofmgr = TProof::Mgr("lxialpod2.gsi.de:21001");
+    //TProofMgr * proofmgr = TProof::Mgr("lxialpod2.gsi.de:21001");
     //TProofMgr * proofmgr = TProof::Mgr("lxialpod.gsi.de:21001");
+    TProofMgr * proofmgr = TProof::Mgr("lxialpod.gsi.de:21004");
     //TProofMgr * proofmgr = TProof::Mgr("lxial39.gsi.de:21001");
     TProof * proof = proofmgr->CreateSession();
     proof->SetParameter("PROOF_MaxSlavesPerNode", (Long_t)10000);
-    */
 
     // -- Load AliRoot Libraries
     gROOT->LoadMacro("ProofEnableAliRootGSI.C");
@@ -25,6 +24,11 @@ void rundNdPt(const char *fileList ="inputList.txt",const char *outFile = "outpu
   // Create analysis manager
   AliAnalysisManager *mgr = new AliAnalysisManager;
 
+  //
+  // Create physics trigger selection class
+  //
+  AliPhysicsSelection *physTrigSel =  new AliPhysicsSelection();
+
   //
   // Create event cuts
   //
@@ -33,6 +37,7 @@ void rundNdPt(const char *fileList ="inputList.txt",const char *outFile = "outpu
   evtCuts->SetMeanXYZv(0.0,0.0,0.0);
   evtCuts->SetSigmaMeanXYZv(1.0,1.0,10.0);
   evtCuts->SetTriggerRequired(kTRUE);
+  //evtCuts->SetTriggerRequired(kFALSE);
 
   // Create geom. acceptance cuts
   AlidNdPtAcceptanceCuts *accCuts = new AlidNdPtAcceptanceCuts("AlidNdPtAcceptanceCuts","Geom. acceptance cuts");
@@ -42,7 +47,7 @@ void rundNdPt(const char *fileList ="inputList.txt",const char *outFile = "outpu
   accCuts->SetMaxDCAz(30.0);
 
   // Create standard esd track cuts
-  gROOT->LoadMacro("CreatedNdPtTrackCuts.C");
+  gROOT->LoadMacro("$ALICE_ROOT/PWG0/dNdPt/macros/CreatedNdPtTrackCuts.C");
   AliESDtrackCuts* esdTrackCuts = CreatedNdPtTrackCuts(cutMode);
   if (!esdTrackCuts) {
     printf("ERROR: esdTrackCuts could not be created\n");
@@ -65,14 +70,18 @@ void rundNdPt(const char *fileList ="inputList.txt",const char *outFile = "outpu
     fdNdPtCutAnalysis->SetAcceptanceCuts(accCuts);
     fdNdPtCutAnalysis->SetTrackCuts(esdTrackCuts);
     fdNdPtCutAnalysis->SetAnalysisMode(analysisMode); 
+    fdNdPtCutAnalysis->SetParticleMode(particleMode); 
     if(bUseMCInfo) 
     {
-       fdNdPtCutAnalysis->SetTrigger(AliTriggerAnalysis::kMB1); 
+       //fdNdPtCutAnalysis->SetTrigger(AliTriggerAnalysis::kMB1); 
+       physTrigSel->SetAnalyzeMC();
+       fdNdPtCutAnalysis->SetPhysicsTriggerSelection(physTrigSel); 
        fdNdPtCutAnalysis->SetUseMCInfo(kTRUE);
     }
     else { // online trigger
+    fdNdPtCutAnalysis->SetPhysicsTriggerSelection(physTrigSel); 
     //fdNdPtCutAnalysis->SetTriggerClass("CBEAMB-ABCE-NOPF-ALL"); 
-    fdNdPtCutAnalysis->SetTriggerClass("CINT1B-ABCE-NOPF-ALL");
+    //fdNdPtCutAnalysis->SetTriggerClass("CINT1B-ABCE-NOPF-ALL");
     //fdNdPtCutAnalysis->SetTriggerClass("CINT1A-ABCE-NOPF-ALL"); 
     //fdNdPtCutAnalysis->SetTriggerClass("CINT1C-ABCE-NOPF-ALL"); 
     //fdNdPtCutAnalysis->SetTriggerClass("CINT1-E-NOPF-ALL"); 
@@ -89,21 +98,26 @@ void rundNdPt(const char *fileList ="inputList.txt",const char *outFile = "outpu
     fdNdPtAnalysis->SetAcceptanceCuts(accCuts);
     fdNdPtAnalysis->SetTrackCuts(esdTrackCuts);
     fdNdPtAnalysis->SetAnalysisMode(analysisMode); 
+    fdNdPtAnalysis->SetParticleMode(particleMode); 
     if(bUseMCInfo) 
     {
-       fdNdPtAnalysis->SetTrigger(AliTriggerAnalysis::kMB1); 
+       //fdNdPtAnalysis->SetTrigger(AliTriggerAnalysis::kMB1); 
+       physTrigSel->SetAnalyzeMC();
+       fdNdPtAnalysis->SetPhysicsTriggerSelection(physTrigSel); 
+
        fdNdPtAnalysis->SetUseMCInfo(kTRUE);
+       //fdNdPtAnalysis->SetHistogramsOn(kTRUE);
+       fdNdPtAnalysis->SetHistogramsOn(kFALSE);
     }
     else { // online trigger
+    fdNdPtAnalysis->SetPhysicsTriggerSelection(physTrigSel); 
     //fdNdPtAnalysis->SetTriggerClass("CBEAMB-ABCE-NOPF-ALL"); 
-    fdNdPtAnalysis->SetTriggerClass("CINT1B-ABCE-NOPF-ALL");
+    //fdNdPtAnalysis->SetTriggerClass("CINT1B-ABCE-NOPF-ALL");
     //fdNdPtAnalysis->SetTriggerClass("CINT1A-ABCE-NOPF-ALL"); 
     //fdNdPtAnalysis->SetTriggerClass("CINT1C-ABCE-NOPF-ALL"); 
     //fdNdPtAnalysis->SetTriggerClass("CINT1-E-NOPF-ALL"); 
     }
 
-    fdNdPtAnalysis->SetHistogramsOn(kTRUE);
-    //fdNdPtAnalysis->SetHistogramsOn(kFALSE);
     task->AddAnalysisObject( fdNdPtAnalysis );
   }
 
@@ -116,14 +130,18 @@ void rundNdPt(const char *fileList ="inputList.txt",const char *outFile = "outpu
     fdNdPtCorrection->SetAcceptanceCuts(accCuts);
     fdNdPtCorrection->SetTrackCuts(esdTrackCuts);
     fdNdPtCorrection->SetAnalysisMode(analysisMode); 
+    fdNdPtCorrection->SetParticleMode(particleMode); 
     if(bUseMCInfo) 
     {
-       fdNdPtCorrection->SetTrigger(AliTriggerAnalysis::kMB1); 
+       //fdNdPtCorrection->SetTrigger(AliTriggerAnalysis::kMB1); 
+       physTrigSel->SetAnalyzeMC();
+       fdNdPtCorrection->SetPhysicsTriggerSelection(physTrigSel); 
        fdNdPtCorrection->SetUseMCInfo(kTRUE);
     }
     else { // online trigger
+    fdNdPtCorrection->SetPhysicsTriggerSelection(physTrigSel); 
     //fdNdPtCorrection->SetTriggerClass("CBEAMB-ABCE-NOPF-ALL"); 
-    fdNdPtCorrection->SetTriggerClass("CINT1B-ABCE-NOPF-ALL");
+    //fdNdPtCorrection->SetTriggerClass("CINT1B-ABCE-NOPF-ALL");
     //fdNdPtCorrection->SetTriggerClass("CINT1A-ABCE-NOPF-ALL"); 
     //fdNdPtCorrection->SetTriggerClass("CINT1C-ABCE-NOPF-ALL"); 
     //fdNdPtCorrection->SetTriggerClass("CINT1-E-NOPF-ALL");