trigger class selection and more histograms added
authorjotwinow <jotwinow@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 11 Dec 2009 15:22:33 +0000 (15:22 +0000)
committerjotwinow <jotwinow@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 11 Dec 2009 15:22:33 +0000 (15:22 +0000)
PWG0/dNdPt/AlidNdPt.cxx
PWG0/dNdPt/AlidNdPt.h
PWG0/dNdPt/AlidNdPtAnalysis.cxx
PWG0/dNdPt/AlidNdPtAnalysis.h
PWG0/dNdPt/AlidNdPtCorrection.cxx
PWG0/dNdPt/AlidNdPtCutAnalysis.cxx
PWG0/dNdPt/AlidNdPtCutAnalysis.h

index 35c1674..466b75d 100644 (file)
@@ -30,6 +30,7 @@ AlidNdPt::AlidNdPt(): TNamed()
 , fUseMCInfo(kFALSE)\r
 , fAnalysisMode(AlidNdPtHelper::kTPC) \r
 , fTrigger(AliTriggerAnalysis::kMB1) \r
+, fTriggerClass(0) \r
 {\r
   // default constructor\r
 }\r
@@ -42,6 +43,7 @@ AlidNdPt::AlidNdPt(Char_t* name, Char_t* title): TNamed(name,title)
 , fUseMCInfo(kFALSE)\r
 , fAnalysisMode(AlidNdPtHelper::kTPC) \r
 , fTrigger(AliTriggerAnalysis::kMB1) \r
+, fTriggerClass(0) \r
 {\r
   // constructor\r
 }\r
index d9be713..e48680f 100644 (file)
@@ -50,6 +50,7 @@ public:
   void SetUseMCInfo(const Bool_t info)                          { fUseMCInfo = info; }
   void SetAnalysisMode(const AlidNdPtHelper::AnalysisMode mode) { fAnalysisMode = mode; }
   void SetTrigger(const AliTriggerAnalysis::Trigger trigger)    { fTrigger = trigger; }
+  void SetTriggerClass(const Char_t *triggerClass)              { fTriggerClass = triggerClass; }
 
   AlidNdPtEventCuts* GetEventCuts() const                       { return fdNdPtEventCuts; }
   AlidNdPtAcceptanceCuts* GetAcceptanceCuts() const             { return fdNdPtAcceptanceCuts; }
@@ -57,6 +58,7 @@ public:
   Bool_t IsUseMCInfo() const                                    { return fUseMCInfo; }
   AlidNdPtHelper::AnalysisMode GetAnalysisMode() const          { return fAnalysisMode; }
   AliTriggerAnalysis::Trigger GetTrigger() const                { return fTrigger; }
+  const Char_t* GetTriggerClass() const                         { return fTriggerClass; }
 
 private:
 
@@ -67,6 +69,7 @@ private:
   Bool_t fUseMCInfo;                            // use MC information
   AlidNdPtHelper::AnalysisMode fAnalysisMode;   // analysis mode TPC only, TPC + ITS
   AliTriggerAnalysis::Trigger fTrigger;         // trigger definition MB1, MB2 ...
+  const Char_t * fTriggerClass;                 // trigger class
 
   ClassDef(AlidNdPt,1);
 };
index 0f14e6f..42c88c7 100644 (file)
@@ -92,6 +92,7 @@ ClassImp(AlidNdPtAnalysis)
   fRecTrackNSDEventMatrix(0),\r
 \r
   // track rec. efficiency correction (fRecPrimTrackMatrix / fGenPrimTrackMatrix)\r
+  fGenTrackMatrix(0),\r
   fGenPrimTrackMatrix(0),\r
   fRecPrimTrackMatrix(0),\r
 \r
@@ -114,7 +115,10 @@ ClassImp(AlidNdPtAnalysis)
   fRecMCTrackHist1(0),\r
 \r
   //multple reconstructed tracks\r
-  fMCMultRecTrackHist1(0) \r
+  fMCMultRecTrackHist1(0), \r
+\r
+  // rec. track control histograms\r
+  fRecTrackHist2(0)\r
 {\r
   // default constructor\r
   for(Int_t i=0; i<AlidNdPtHelper::kCutSteps; i++) { \r
@@ -179,6 +183,7 @@ AlidNdPtAnalysis::AlidNdPtAnalysis(Char_t* name, Char_t* title): AlidNdPt(name,t
   fRecTrackNSDEventMatrix(0),\r
 \r
   // track rec. efficiency correction (fRecPrimTrackMatrix / fGenPrimTrackMatrix)\r
+  fGenTrackMatrix(0),\r
   fGenPrimTrackMatrix(0),\r
   fRecPrimTrackMatrix(0),\r
 \r
@@ -201,7 +206,10 @@ AlidNdPtAnalysis::AlidNdPtAnalysis(Char_t* name, Char_t* title): AlidNdPt(name,t
   fRecMCTrackHist1(0),\r
 \r
   //multple reconstructed tracks\r
-  fMCMultRecTrackHist1(0) \r
+  fMCMultRecTrackHist1(0), \r
+\r
+  // rec. track control histograms\r
+  fRecTrackHist2(0)\r
 {\r
   // constructor\r
   for(Int_t i=0; i<AlidNdPtHelper::kCutSteps; i++) { \r
@@ -260,6 +268,7 @@ AlidNdPtAnalysis::~AlidNdPtAnalysis() {
   if(fRecTrackNSDEventMatrix) delete fRecTrackNSDEventMatrix; fRecTrackNSDEventMatrix=0;\r
 \r
   //\r
+  if(fGenTrackMatrix) delete fGenTrackMatrix; fGenTrackMatrix=0;\r
   if(fGenPrimTrackMatrix) delete fGenPrimTrackMatrix; fGenPrimTrackMatrix=0;\r
   if(fRecPrimTrackMatrix) delete fRecPrimTrackMatrix; fRecPrimTrackMatrix=0;\r
   //\r
@@ -286,6 +295,7 @@ AlidNdPtAnalysis::~AlidNdPtAnalysis() {
   }\r
   if(fRecMCTrackHist1) delete fRecMCTrackHist1; fRecMCTrackHist1=0;\r
   if(fMCMultRecTrackHist1) delete fMCMultRecTrackHist1; fMCMultRecTrackHist1=0; \r
+  if(fRecTrackHist2) delete fRecTrackHist2; fRecTrackHist2=0; \r
   //\r
   if(fAnalysisFolder) delete fAnalysisFolder; fAnalysisFolder=0;\r
 }\r
@@ -575,6 +585,15 @@ void AlidNdPtAnalysis::Init(){
   //\r
   // tracks correction matrices\r
   //\r
+  fGenTrackMatrix = new THnSparseF("fGenTrackMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
+  fGenTrackMatrix->SetBinEdges(0,binsZv);\r
+  fGenTrackMatrix->SetBinEdges(1,binsPt);\r
+  fGenTrackMatrix->SetBinEdges(2,binsEta);\r
+  fGenTrackMatrix->GetAxis(0)->SetTitle("mcZv (cm)");\r
+  fGenTrackMatrix->GetAxis(1)->SetTitle("mcPt (GeV/c)");\r
+  fGenTrackMatrix->GetAxis(2)->SetTitle("mcEta");\r
+  fGenTrackMatrix->Sumw2();\r
+\r
   fGenPrimTrackMatrix = new THnSparseF("fGenPrimTrackMatrix","mcZv:mcPt:mcEta",3,binsTrackMatrix);\r
   fGenPrimTrackMatrix->SetBinEdges(0,binsZv);\r
   fGenPrimTrackMatrix->SetBinEdges(1,binsPt);\r
@@ -756,9 +775,9 @@ void AlidNdPtAnalysis::Init(){
   fRecTrackHist1[i] = new THnSparseF(name,title,3,binsRecTrackHist1,minRecTrackHist1,maxRecTrackHist1);\r
   fRecTrackHist1[i]->SetBinEdges(0,binsPt);\r
   fRecTrackHist1[i]->SetBinEdges(1,binsEta);\r
-  fRecTrackHist1[i]->GetAxis(0)->SetTitle("Pt (GeV/c)");\r
-  fRecTrackHist1[i]->GetAxis(1)->SetTitle("Eta");\r
-  fRecTrackHist1[i]->GetAxis(2)->SetTitle("Phi (rad)");\r
+  fRecTrackHist1[i]->GetAxis(0)->SetTitle("p_{T} (GeV/c)");\r
+  fRecTrackHist1[i]->GetAxis(1)->SetTitle("#eta");\r
+  fRecTrackHist1[i]->GetAxis(2)->SetTitle("#phi (rad)");\r
   fRecTrackHist1[i]->Sumw2();\r
 \r
   // \r
@@ -799,6 +818,21 @@ void AlidNdPtAnalysis::Init(){
   fMCMultRecTrackHist1->GetAxis(1)->SetTitle("mcEta");\r
   fMCMultRecTrackHist1->GetAxis(2)->SetTitle("pid");\r
 \r
+  //nClust:chi2PerClust:pt:eta:phi\r
+  Int_t binsRecTrackHist2[5]={160,100,ptNbins,etaNbins,90};\r
+  Double_t minRecTrackHist2[5]={0., 0., 0, -1.5, 0.};\r
+  Double_t maxRecRecTrackHist2[5]={160.,10., 16, 1.5, 2.*TMath::Pi()};\r
+\r
+  fRecTrackHist2 = new THnSparseF("fRecTrackHist2","nClust:chi2PerClust:pt:eta:phi",5,binsRecTrackHist2,minRecTrackHist2,maxRecRecTrackHist2);\r
+  fRecTrackHist2->SetBinEdges(2,binsPt);\r
+  fRecTrackHist2->SetBinEdges(3,binsEta);\r
+  fRecTrackHist2->GetAxis(0)->SetTitle("nClust");\r
+  fRecTrackHist2->GetAxis(1)->SetTitle("chi2PerClust");\r
+  fRecTrackHist2->GetAxis(2)->SetTitle("p_{T} (GeV/c)");\r
+  fRecTrackHist2->GetAxis(3)->SetTitle("#eta");\r
+  fRecTrackHist2->GetAxis(4)->SetTitle("#phi (rad)");\r
+  fRecTrackHist2->Sumw2();\r
+\r
   // init folder\r
   fAnalysisFolder = CreateFolder("folderdNdPt","Analysis dNdPt Folder");\r
 }\r
@@ -827,8 +861,9 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
   // trigger selection\r
   Bool_t isEventTriggered = kTRUE;\r
   if(evtCuts->IsTriggerRequired())  {\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
+    isEventTriggered = esdEvent->IsTriggerClassFired(GetTriggerClass());\r
   }\r
 \r
   // use MC information\r
@@ -836,7 +871,6 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
   AliGenEventHeader* genHeader = 0;\r
   AliStack* stack = 0;\r
   TArrayF vtxMC(3);\r
-  //AlidNdPtHelper::MCProcessType evtType = AlidNdPtHelper::kInvalidProcess;\r
   AliPWG0Helper::MCProcessType evtType = AliPWG0Helper::kInvalidProcess;\r
 \r
   Int_t multMCTrueTracks = 0;\r
@@ -860,7 +894,6 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
       return;\r
     }\r
     // get event type (ND=0x1, DD=0x2, SD=0x4)\r
-    //evtType = AlidNdPtHelper::GetEventProcessType(header);\r
     evtType = AliPWG0Helper::GetEventProcessType(header);\r
     AliDebug(AliLog::kDebug+1, Form("Found process type %d", evtType));\r
 \r
@@ -896,7 +929,7 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
     isRecVertex = kTRUE;\r
   }\r
   Bool_t isEventOK = evtCuts->AcceptEvent(esdEvent,mcEvent,vtxESD) && isRecVertex; \r
-  //printf("isEventOK %d \n",isEventOK);\r
+  //printf("isEventOK %d, isEventTriggered %d \n",isEventOK, isEventTriggered);\r
 \r
   // MB bias tracks\r
   Int_t multMBTracks = 0; \r
@@ -987,7 +1020,6 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
      if(isEventOK && isEventTriggered) fRecEventMatrix->Fill(vEventMatrix);\r
 \r
      // single diffractive\r
-     //if(evtType == AlidNdPtHelper::kSD) {\r
      if(evtType == AliPWG0Helper::kSD) {\r
        fGenSDEventMatrix->Fill(vEventMatrix); \r
        if(isEventTriggered) fTriggerSDEventMatrix->Fill(vEventMatrix);\r
@@ -995,7 +1027,6 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
      }\r
 \r
      // double diffractive\r
-     //if(evtType == AlidNdPtHelper::kDD) {\r
      if(evtType == AliPWG0Helper::kDD) {\r
        fGenDDEventMatrix->Fill(vEventMatrix); \r
        if(isEventTriggered) fTriggerDDEventMatrix->Fill(vEventMatrix);\r
@@ -1003,7 +1034,6 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
      }\r
 \r
      // non diffractive\r
-     //if(evtType == AlidNdPtHelper::kND) {\r
      if(evtType == AliPWG0Helper::kND) {\r
        fGenNDEventMatrix->Fill(vEventMatrix); \r
        if(isEventTriggered) fTriggerNDEventMatrix->Fill(vEventMatrix);\r
@@ -1011,7 +1041,6 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
      }\r
 \r
      // non single diffractive\r
-     //if(evtType != AlidNdPtHelper::kSD) {\r
      if(evtType != AliPWG0Helper::kSD) {\r
        fGenNSDEventMatrix->Fill(vEventMatrix); \r
        if(isEventTriggered) fTriggerNSDEventMatrix->Fill(vEventMatrix);\r
@@ -1126,6 +1155,13 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
          if (!particle)\r
          continue;\r
 \r
+         Double_t vTrackMatrix[3] = {vtxMC[2],particle->Pt(),particle->Eta()}; \r
+\r
+        // all genertated primaries including neutral\r
+         if( iMc < stack->GetNprimary() ) {\r
+           fGenTrackMatrix->Fill(vTrackMatrix);\r
+        }\r
+\r
          // only charged particles\r
          Double_t charge = particle->GetPDG()->Charge()/3.;\r
          if (charge == 0.0)\r
@@ -1145,8 +1181,7 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
          // check accepted\r
          if(accCuts->AcceptTrack(particle)) \r
         {\r
-           Double_t vTrackMatrix[3] = {vtxMC[2],particle->Pt(),particle->Eta()}; \r
-           //if(prim) fGenPrimTrackMatrix->Fill(vTrackMatrix);\r
+\r
            if( AlidNdPtHelper::IsPrimaryParticle(stack, iMc, GetAnalysisMode()) ) fGenPrimTrackMatrix->Fill(vTrackMatrix);\r
 \r
           // fill control histograms\r
@@ -1261,10 +1296,21 @@ void AlidNdPtAnalysis::FillHistograms(AliESDtrack *const esdTrack, AliStack *con
   Float_t dca[2], bCov[3];\r
   esdTrack->GetImpactParameters(dca,bCov);\r
 \r
+  Int_t nClust = esdTrack->GetTPCclusters(0);\r
+  Float_t chi2PerCluster = 0.;\r
+  if(nClust>0.) chi2PerCluster = esdTrack->GetTPCchi2()/Float_t(nClust);\r
+\r
 \r
   // fill histograms\r
   Double_t values[3] = {pt,eta,phi};     \r
   fRecTrackHist1[trackObj]->Fill(values);\r
+\r
+  Double_t values1[5] = {nClust,chi2PerCluster,pt,eta,phi};      \r
+  if(trackObj == AlidNdPtHelper::kRecTracks)  \r
+  {\r
+    if(fHistogramsOn)\r
+      fRecTrackHist2->Fill(values1);\r
+  }\r
  \r
   //\r
   // Fill rec vs MC information\r
@@ -1308,7 +1354,6 @@ void AlidNdPtAnalysis::FillHistograms(AliESDtrack *const esdTrack, AliStack *con
 \r
     Double_t vRecMCTrackHist1[4]={gpt,geta,dpt,deta};\r
     fRecMCTrackHist1->Fill(vRecMCTrackHist1);\r
-\r
   }\r
 }\r
 \r
@@ -1423,6 +1468,7 @@ Long64_t AlidNdPtAnalysis::Merge(TCollection* list)
     fRecTrackNSDEventMatrix->Add(entry->fRecTrackNSDEventMatrix);\r
 \r
     //\r
+    fGenTrackMatrix->Add(entry->fGenTrackMatrix);\r
     fGenPrimTrackMatrix->Add(entry->fGenPrimTrackMatrix);\r
     fRecPrimTrackMatrix->Add(entry->fRecPrimTrackMatrix);\r
     //\r
@@ -1452,6 +1498,7 @@ Long64_t AlidNdPtAnalysis::Merge(TCollection* list)
     }\r
     fRecMCTrackHist1->Add(entry->fRecMCTrackHist1);\r
     fMCMultRecTrackHist1->Add(entry->fMCMultRecTrackHist1);\r
+    fRecTrackHist2->Add(entry->fRecTrackHist2);\r
 \r
   count++;\r
   }\r
@@ -1528,14 +1575,17 @@ void AlidNdPtAnalysis::Analyse()
   // reconstructed pt histograms\r
   //\r
   h = fRecTrackHist1[0]->Projection(0);\r
+  h->Scale(1.,"width");\r
   h->SetName("pt_all_ch");\r
   aFolderObj->Add(h);\r
 \r
   h = fRecTrackHist1[1]->Projection(0);\r
+  h->Scale(1.,"width");\r
   h->SetName("pt_acc");\r
   aFolderObj->Add(h);\r
 \r
   h = fRecTrackHist1[2]->Projection(0);\r
+  h->Scale(1.,"width");\r
   h->SetName("pt_rec");\r
   aFolderObj->Add(h);\r
 \r
@@ -1615,6 +1665,41 @@ void AlidNdPtAnalysis::Analyse()
   aFolderObj->Add(h2D);\r
 \r
   //\r
+  // reconstructed nClust, chi2 vs pt, eta, phi\r
+  //\r
+  if(fHistogramsOn) {\r
+\r
+    h2D = fRecTrackHist2->Projection(0,1);\r
+    h2D->SetName("nClust_chi2_rec");\r
+    aFolderObj->Add(h2D);\r
+\r
+    h2D = fRecTrackHist2->Projection(0,2);\r
+    h2D->SetName("nClust_pt_rec");\r
+    aFolderObj->Add(h2D);\r
+\r
+    h2D = fRecTrackHist2->Projection(0,3);\r
+    h2D->SetName("nClust_eta_rec");\r
+    aFolderObj->Add(h2D);\r
+\r
+    h2D = fRecTrackHist2->Projection(0,4);\r
+    h2D->SetName("nClust_phi_rec");\r
+    aFolderObj->Add(h2D);\r
+\r
+    h2D = fRecTrackHist2->Projection(1,2);\r
+    h2D->SetName("chi2_pt_rec");\r
+    aFolderObj->Add(h2D);\r
+\r
+    h2D = fRecTrackHist2->Projection(1,3);\r
+    h2D->SetName("chi2_eta_rec");\r
+    aFolderObj->Add(h2D);\r
+\r
+    h2D = fRecTrackHist2->Projection(1,4);\r
+    h2D->SetName("chi2_phi_rec");\r
+    aFolderObj->Add(h2D);\r
+\r
+  }\r
+\r
+  //\r
   // calculate corrections for empty events\r
   // with multMB==0 \r
   //\r
index cf2974b..54b14ff 100644 (file)
@@ -111,6 +111,7 @@ public :
   THnSparseF *GetRecTrackNSDEventMatrix() {return fRecTrackNSDEventMatrix;}
 
   //
+  THnSparseF *GetGenTrackMatrix() {return fGenTrackMatrix;}
   THnSparseF *GetGenPrimTrackMatrix() {return fGenPrimTrackMatrix;}
   THnSparseF *GetRecPrimTrackMatrix() {return fRecPrimTrackMatrix;}
 
@@ -138,6 +139,8 @@ public :
   THnSparseF *GetRecMCTrackHist1() {return fRecMCTrackHist1;}
   THnSparseF *GetMCMultRecTrackHist1() {return fMCMultRecTrackHist1;}
 
+  THnSparseF *GetRecTrackHist2() {return fRecTrackHist2;}
+
 private:
 
   // analysis folder 
@@ -210,6 +213,7 @@ private:
   //
 
   // track rec. efficiency correction (fRecPrimTrackMatrix / fGenPrimTrackMatrix)
+  THnSparseF *fGenTrackMatrix; //-> mcZv:mcPt:mcEta
   THnSparseF *fGenPrimTrackMatrix; //-> mcZv:mcPt:mcEta
   THnSparseF *fRecPrimTrackMatrix; //-> mcZv:mcPt:mcEta
 
@@ -247,6 +251,9 @@ private:
   //multple reconstructed tracks
   THnSparseF *fMCMultRecTrackHist1; //-> mcPt:mcEta:pid
 
+  // track control histograms
+  THnSparseF *fRecTrackHist2;  //-> nclust:chi2:Pt:Eta:Phi
+
   AlidNdPtAnalysis(const AlidNdPtAnalysis&); // not implemented
   AlidNdPtAnalysis& operator=(const AlidNdPtAnalysis&); // not implemented
 
index 0d09195..8c25a46 100644 (file)
@@ -525,8 +525,9 @@ void AlidNdPtCorrection::Process(AliESDEvent *esdEvent, AliMCEvent *mcEvent)
   // trigger selection\r
   Bool_t isEventTriggered = kTRUE;\r
   if(evtCuts->IsTriggerRequired())  {\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
+    isEventTriggered = esdEvent->IsTriggerClassFired(GetTriggerClass());\r
   }\r
 \r
   // use MC information\r
index c749238..756c696 100644 (file)
@@ -42,6 +42,7 @@ ClassImp(AlidNdPtCutAnalysis)
 //_____________________________________________________________________________\r
   AlidNdPtCutAnalysis::AlidNdPtCutAnalysis(): AlidNdPt(),\r
   fAnalysisFolder(0),\r
+  fEventCount(0),\r
   fRecEventHist(0),\r
   fMCEventHist(0),\r
   fRecMCEventHist(0),\r
@@ -54,6 +55,7 @@ ClassImp(AlidNdPtCutAnalysis)
 //_____________________________________________________________________________\r
 AlidNdPtCutAnalysis::AlidNdPtCutAnalysis(Char_t* name, Char_t* title): AlidNdPt(name,title),\r
   fAnalysisFolder(0),\r
+  fEventCount(0),\r
   fRecEventHist(0),\r
   fMCEventHist(0),\r
   fRecMCEventHist(0),\r
@@ -66,6 +68,7 @@ AlidNdPtCutAnalysis::AlidNdPtCutAnalysis(Char_t* name, Char_t* title): AlidNdPt(
 //_____________________________________________________________________________\r
 AlidNdPtCutAnalysis::~AlidNdPtCutAnalysis() {\r
   // \r
+  if(fEventCount) delete fEventCount; fEventCount=0;\r
   if(fRecEventHist) delete fRecEventHist; fRecEventHist=0;\r
   if(fMCEventHist) delete fMCEventHist; fMCEventHist=0;\r
   if(fRecMCEventHist) delete fRecMCEventHist; fRecMCEventHist=0;\r
@@ -85,6 +88,15 @@ void AlidNdPtCutAnalysis::Init(){
 \r
   Double_t binsPt[ptNbins+1] = {0.,0.05,0.1,0.15,0.2,0.25,0.3,0.35,0.4,0.45,0.5,0.55,0.6,0.65,0.7,0.75,0.8,0.85,0.9,0.95,1.0,1.1,1.2,1.3,1.4,1.5,1.6,1.7,1.8,1.9,2.0,2.2,2.4,2.6,2.8,3.0,3.2,3.4,3.6,3.8,4.0,4.5,5.0,5.5,6.0,6.5,7.0,7.5,8.0,9.0,10.0,11.0,12.0,13.0,14.0,15.0,16.0};\r
 \r
+  // \r
+  Int_t binsEventCount[2]={2,2};\r
+  Double_t minEventCount[2]={0,0}; \r
+  Double_t maxEventCount[2]={2,2}; \r
+  fEventCount = new THnSparseF("fEventCount","trig vs trig+vertex",2,binsEventCount,minEventCount,maxEventCount);\r
+  fEventCount->GetAxis(0)->SetTitle("trig");\r
+  fEventCount->GetAxis(1)->SetTitle("trig+vert");\r
+  fEventCount->Sumw2();\r
+\r
   //Xv:Yv:Zv:ResZv:Mult\r
   Int_t binsRecEventHist[5]={100,100,140,100,150};\r
   Double_t minRecEventHist[5]={-3.,-3.,-35.,0.,0.}; \r
@@ -171,8 +183,9 @@ void AlidNdPtCutAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent * cons
   // trigger selection\r
   Bool_t isEventTriggered = kTRUE;\r
   if(evtCuts->IsTriggerRequired())  {\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
+    isEventTriggered = esdEvent->IsTriggerClassFired(GetTriggerClass());\r
   }\r
 \r
   // use MC information\r
@@ -233,6 +246,15 @@ void AlidNdPtCutAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent * cons
 \r
   TObjArray *allChargedTracks=0;\r
   Int_t multAll=0;\r
+  \r
+  //\r
+  // event counter\r
+  // \r
+  //printf("isEventOK %d, isEventTriggered %d \n",isEventOK,isEventTriggered);\r
+\r
+  Bool_t isTrigAndVertex = isEventTriggered && isEventOK;\r
+  Double_t vEventCount[2] = { isEventTriggered, isTrigAndVertex};\r
+  fEventCount->Fill(vEventCount);\r
 \r
   // check event cuts\r
   if(isEventOK && isEventTriggered)\r
@@ -332,6 +354,7 @@ Long64_t AlidNdPtCutAnalysis::Merge(TCollection* list)
     if (entry == 0) continue; \r
   \r
     // event histo\r
+    fEventCount->Add(entry->fEventCount);\r
     fRecEventHist->Add(entry->fRecEventHist);\r
     fRecMCEventHist->Add(entry->fRecMCEventHist);\r
     fMCEventHist->Add(entry->fMCEventHist);\r
@@ -380,8 +403,37 @@ void AlidNdPtCutAnalysis::Analyse()
   Double_t maxDCAr = accCuts->GetMaxDCAr();\r
 \r
   //\r
+  // Event counters\r
+  //\r
+  h2D = (TH2D*)fEventCount->Projection(0,1);\r
+  h2D->SetName("trig_vs_trigANDvertex");\r
+  aFolderObj->Add(h2D);\r
+\r
+  fEventCount->GetAxis(0)->SetRange(1,1); // triggered\r
+  h1D = (TH2D*)fEventCount->Projection(1);\r
+  h1D->SetTitle("rec. vertex for triggered events");\r
+  h1D->SetName("trigANDvertex");\r
+  aFolderObj->Add(h1D);\r
+\r
+  //\r
   // Create rec. event histograms\r
   //\r
+  h1D = (TH1D *)fRecEventHist->Projection(0);\r
+  h1D->SetName("rec_xv");\r
+  aFolderObj->Add(h1D);\r
+\r
+  h1D = (TH1D *)fRecEventHist->Projection(1);\r
+  h1D->SetName("rec_yv");\r
+  aFolderObj->Add(h1D);\r
+\r
+  h1D = (TH1D *)fRecEventHist->Projection(2);\r
+  h1D->SetName("rec_zv");\r
+  aFolderObj->Add(h1D);\r
+\r
+  h2D = (TH2D *)fRecEventHist->Projection(3,4);\r
+  h2D->SetName("rec_resZv_vs_Mult");\r
+  aFolderObj->Add(h2D);\r
+\r
   h2D = (TH2D *)fRecEventHist->Projection(0,1);\r
   h2D->SetName("rec_xv_vs_yv");\r
   aFolderObj->Add(h2D);\r
@@ -394,7 +446,6 @@ void AlidNdPtCutAnalysis::Analyse()
   h2D->SetName("rec_resZv_vs_Mult");\r
   aFolderObj->Add(h2D);\r
 \r
-\r
   //\r
   // MC available\r
   //\r
@@ -456,8 +507,12 @@ void AlidNdPtCutAnalysis::Analyse()
   h2D->SetName("ratio_nClust_nFindableClust_vs_eta");\r
   aFolderObj->Add(h2D);\r
 \r
+  h2D = (TH2D *)fRecMCTrackHist->Projection(5,6);\r
+  h2D->SetName("eta_vs_phi");\r
+  aFolderObj->Add(h2D);\r
+\r
   //\r
-  fRecMCTrackHist->GetAxis(7)->SetRangeUser(minEta,maxEta);  \r
+  fRecMCTrackHist->GetAxis(5)->SetRangeUser(minEta,maxEta);  \r
 \r
   h2D = (TH2D *)fRecMCTrackHist->Projection(0,6);\r
   h2D->SetName("nClust_vs_phi");\r
@@ -471,10 +526,6 @@ void AlidNdPtCutAnalysis::Analyse()
   h2D->SetName("ratio_nClust_nFindableClust_vs_phi");\r
   aFolderObj->Add(h2D);\r
 \r
-  h2D = (TH2D *)fRecMCTrackHist->Projection(5,6);\r
-  h2D->SetName("eta_vs_phi");\r
-  aFolderObj->Add(h2D);\r
-\r
   //\r
   fRecMCTrackHist->GetAxis(7)->SetRangeUser(0.0,maxPt);  \r
 \r
@@ -511,9 +562,14 @@ void AlidNdPtCutAnalysis::Analyse()
   h2D->SetName("nClust_vs_ratio_nClust_nFindableClust");\r
   aFolderObj->Add(h2D);\r
 \r
+  //\r
   // DCAy cuts\r
+  //\r
+  fRecMCTrackHist->GetAxis(0)->SetRange(50,160); // nClust/track > 50\r
+  fRecMCTrackHist->GetAxis(1)->SetRangeUser(0.,3.9999); // chi2/cluster < 4.0\r
   fRecMCTrackHist->GetAxis(3)->SetRange(1,fRecMCTrackHist->GetAxis(3)->GetNbins());\r
-  fRecMCTrackHist->GetAxis(4)->SetRangeUser(-1.0,1.0);\r
+  //fRecMCTrackHist->GetAxis(4)->SetRangeUser(-1.0,1.0);\r
+  fRecMCTrackHist->GetAxis(4)->SetRange(1,fRecMCTrackHist->GetAxis(4)->GetNbins());\r
 \r
   // sec\r
   fRecMCTrackHist->GetAxis(9)->SetRange(1,1);\r
@@ -528,7 +584,7 @@ void AlidNdPtCutAnalysis::Analyse()
   aFolderObj->Add(h1D);\r
 \r
   // DCAz cuts\r
-  fRecMCTrackHist->GetAxis(3)->SetRangeUser(-1.0,1.0);\r
+  //fRecMCTrackHist->GetAxis(3)->SetRangeUser(-1.0,1.0);\r
   fRecMCTrackHist->GetAxis(4)->SetRange(1,fRecMCTrackHist->GetAxis(4)->GetNbins());\r
 \r
   // sec\r
index 8034435..e055aa3 100644 (file)
@@ -60,6 +60,7 @@ public :
   void FillHistograms(AliESDtrack *const esdTrack, AliStack *const stack);
 
   // Getters
+  THnSparseF *GetEventCount()   {return fEventCount;}
   THnSparseF *GetRecEventHist()   {return fRecEventHist;}
   THnSparseF *GetMCEventHist()    {return fMCEventHist;}
   THnSparseF *GetRecMCEventHist() {return fRecMCEventHist;}
@@ -75,6 +76,8 @@ private:
   //
   // THnSparse event histograms
   //
+  THnSparseF *fEventCount; //-> trig, trig + vertex
+
   THnSparseF *fRecEventHist;   //-> Xv:Yv:Zv:ResZv:Mult
   THnSparseF *fMCEventHist;    //-> mcXv:mcYv:mcZv
   THnSparseF *fRecMCEventHist; //-> Xv-mcXv:Yv-mcYv:Zv-mcZv:Mult