new functionality and new class added
authorjotwinow <jotwinow@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 2 Mar 2010 08:06:23 +0000 (08:06 +0000)
committerjotwinow <jotwinow@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 2 Mar 2010 08:06:23 +0000 (08:06 +0000)
PWG0/PWG0depLinkDef.h
PWG0/dNdPt/AlidNdPt.cxx
PWG0/dNdPt/AlidNdPt.h
PWG0/dNdPt/AlidNdPtAnalysis.cxx
PWG0/dNdPt/AlidNdPtAnalysis.h
PWG0/dNdPt/AlidNdPtBackgroundCuts.cxx [new file with mode: 0644]
PWG0/dNdPt/AlidNdPtBackgroundCuts.h [new file with mode: 0644]
PWG0/dNdPt/AlidNdPtCutAnalysis.cxx
PWG0/dNdPt/AlidNdPtTask.cxx
PWG0/dNdPt/macros/CreatedNdPtTrackCuts.C
PWG0/libPWG0dep.pkg

index 85f23fb..74cb52a 100644 (file)
@@ -21,4 +21,6 @@
 #pragma link C++ class AlidNdPt+;
 #pragma link C++ class AlidNdPtCutAnalysis+;
 
+#pragma link C++ class AlidNdPtBackgroundCuts+;
+
 #endif
index 8fe4399..e0feef2 100644 (file)
@@ -17,6 +17,7 @@
 #include "AlidNdPtEventCuts.h"\r
 #include "AlidNdPtAcceptanceCuts.h"\r
 #include "AliPhysicsSelection.h"\r
+#include "AlidNdPtBackgroundCuts.h"\r
 #include "AlidNdPt.h"\r
 \r
 using namespace std;\r
@@ -34,6 +35,7 @@ AlidNdPt::AlidNdPt(): TNamed()
 , fTriggerClass(0) \r
 , fParticleMode(AlidNdPtHelper::kAllPart) \r
 , fPhysicsSelection(0)\r
+, fdNdPtBackgroundCuts(0)\r
 {\r
   // default constructor\r
 }\r
@@ -49,6 +51,7 @@ AlidNdPt::AlidNdPt(Char_t* name, Char_t* title): TNamed(name,title)
 , fTriggerClass(0) \r
 , fParticleMode(AlidNdPtHelper::kAllPart) \r
 , fPhysicsSelection(0)\r
+, fdNdPtBackgroundCuts(0)\r
 {\r
   // constructor\r
 }\r
@@ -60,4 +63,5 @@ AlidNdPt::~AlidNdPt() {
   if(fdNdPtAcceptanceCuts) delete fdNdPtAcceptanceCuts; fdNdPtAcceptanceCuts=NULL;\r
   if(fEsdTrackCuts) delete fEsdTrackCuts; fEsdTrackCuts=NULL;\r
   if(fPhysicsSelection) delete fPhysicsSelection; fPhysicsSelection=NULL;\r
+  if(fdNdPtBackgroundCuts) delete fdNdPtBackgroundCuts; fdNdPtBackgroundCuts=NULL;\r
 }\r
index 341ee6b..acbec06 100644 (file)
@@ -13,6 +13,7 @@ class AliESDtrackCuts;
 class AlidNdPtEventCuts;
 class AlidNdPtAcceptanceCuts;
 class AliPhysicsSelection;
+class AlidNdPtBackgroundCuts;
 
 #include "TNamed.h"
 #include "TFolder.h"
@@ -54,6 +55,7 @@ public:
   void SetTriggerClass(const Char_t *triggerClass)              { fTriggerClass = triggerClass; }
   void SetParticleMode(const AlidNdPtHelper::ParticleMode mode) { fParticleMode = mode; }
   void SetPhysicsTriggerSelection(AliPhysicsSelection* const selection)  { fPhysicsSelection = selection; }
+  void SetBackgroundCuts(AlidNdPtBackgroundCuts* const cuts)    { fdNdPtBackgroundCuts = cuts; }
 
   AlidNdPtEventCuts* GetEventCuts() const                       { return fdNdPtEventCuts; }
   AlidNdPtAcceptanceCuts* GetAcceptanceCuts() const             { return fdNdPtAcceptanceCuts; }
@@ -64,6 +66,7 @@ public:
   const Char_t* GetTriggerClass() const                         { return fTriggerClass; }
   AlidNdPtHelper::ParticleMode GetParticleMode() const          { return fParticleMode; }
   AliPhysicsSelection* GetPhysicsTriggerSelection() const       { return fPhysicsSelection; }
+  AlidNdPtBackgroundCuts* GetBackgroundCuts() const             { return fdNdPtBackgroundCuts; }
 
 private:
 
@@ -78,6 +81,7 @@ private:
   AlidNdPtHelper::ParticleMode fParticleMode;   // selected particle (pion, kaon, ...)
 
   AliPhysicsSelection* fPhysicsSelection; // physics trigger selection class
+  AlidNdPtBackgroundCuts *fdNdPtBackgroundCuts; // background cuts (cosmics and splitted tracks)
 
   ClassDef(AlidNdPt,1);
 };
index 4297b2e..08a1c15 100644 (file)
@@ -39,6 +39,8 @@
 #include "AliMCEvent.h"  \r
 #include "AliESDtrackCuts.h"  \r
 #include "AliLog.h" \r
+#include "AliMultiplicity.h"\r
+#include "AliTracker.h"\r
 \r
 #include "AlidNdPtEventCuts.h"\r
 #include "AlidNdPtAcceptanceCuts.h"\r
@@ -136,6 +138,7 @@ ClassImp(AlidNdPtAnalysis)
   for(Int_t i=0; i<AlidNdPtHelper::kCutSteps; i++) { \r
     fMCTrackHist1[i]=0;     \r
     fMCPrimTrackHist1[i]=0;     \r
+    fMCPrimTrackHist2[i]=0;     \r
     fMCSecTrackHist1[i]=0;     \r
     fRecTrackHist1[i]=0;     \r
     fRecTrackMultHist1[i]=0;     \r
@@ -229,6 +232,7 @@ AlidNdPtAnalysis::AlidNdPtAnalysis(Char_t* name, Char_t* title): AlidNdPt(name,t
   for(Int_t i=0; i<AlidNdPtHelper::kCutSteps; i++) { \r
     fMCTrackHist1[i]=0;     \r
     fMCPrimTrackHist1[i]=0;     \r
+    fMCPrimTrackHist2[i]=0;     \r
     fMCSecTrackHist1[i]=0;     \r
     fRecTrackHist1[i]=0;     \r
     fRecTrackMultHist1[i]=0; \r
@@ -305,6 +309,7 @@ AlidNdPtAnalysis::~AlidNdPtAnalysis() {
   for(Int_t i=0; i<AlidNdPtHelper::kCutSteps; i++) { \r
     if(fMCTrackHist1[i]) delete fMCTrackHist1[i]; fMCTrackHist1[i]=0;\r
     if(fMCPrimTrackHist1[i]) delete fMCPrimTrackHist1[i]; fMCPrimTrackHist1[i]=0;\r
+    if(fMCPrimTrackHist2[i]) delete fMCPrimTrackHist2[i]; fMCPrimTrackHist2[i]=0;\r
     if(fMCSecTrackHist1[i]) delete fMCSecTrackHist1[i]; fMCSecTrackHist1[i]=0;\r
     if(fRecTrackHist1[i]) delete fRecTrackHist1[i]; fRecTrackHist1[i]=0;\r
     if(fRecTrackMultHist1[i]) delete fRecTrackMultHist1[i]; fRecTrackMultHist1[i]=0;\r
@@ -344,7 +349,7 @@ void AlidNdPtAnalysis::Init(){
   Double_t maxMultTrueEventMatrix[2]={149.5,149.5}; \r
   fEventMultCorrelationMatrix = new THnSparseF("fEventMultCorrelationMatrix","mult:true_mult",2,binsMultTrueEventMatrix,minMultTrueEventMatrix,maxMultTrueEventMatrix);\r
   fEventMultCorrelationMatrix->GetAxis(0)->SetTitle("track multiplicity");\r
-  fEventMultCorrelationMatrix->GetAxis(1)->SetTitle("multiplicity");\r
+  fEventMultCorrelationMatrix->GetAxis(1)->SetTitle("true multiplicity");\r
   fEventMultCorrelationMatrix->Sumw2();\r
   \r
   Int_t binsTrackPtCorrelationMatrix[3]={ptNbins,ptNbins,etaNbins};\r
@@ -745,13 +750,13 @@ void AlidNdPtAnalysis::Init(){
   fMCTrackHist1[i]->GetAxis(2)->SetTitle("mcPhi (rad)");\r
   fMCTrackHist1[i]->Sumw2();\r
 \r
-  Int_t binsMCPrimTrackHist2[5]=  {ptNbins,etaNbins,6,20,4000};\r
-  Double_t minMCPrimTrackHist2[5]={0.,-1.,0.,0.,0.}; \r
-  Double_t maxMCPrimTrackHist2[5]={10.,1.,6.,20.,4000.}; \r
+  Int_t binsMCPrimTrackHist1[5]=  {ptNbins,etaNbins,6,20,4000};\r
+  Double_t minMCPrimTrackHist1[5]={0.,-1.,0.,0.,0.}; \r
+  Double_t maxMCPrimTrackHist1[5]={10.,1.,6.,20.,4000.}; \r
   sprintf(name,"fMCPrimTrackHist1_%d",i);\r
   sprintf(title,"mcPt:mcEta:pid:mech:mother");\r
   \r
-  fMCPrimTrackHist1[i] = new THnSparseF(name,title,5,binsMCPrimTrackHist2,minMCPrimTrackHist2,maxMCPrimTrackHist2);\r
+  fMCPrimTrackHist1[i] = new THnSparseF(name,title,5,binsMCPrimTrackHist1,minMCPrimTrackHist1,maxMCPrimTrackHist1);\r
   fMCPrimTrackHist1[i]->SetBinEdges(0,binsPt);\r
   fMCPrimTrackHist1[i]->SetBinEdges(1,binsEta);\r
   fMCPrimTrackHist1[i]->GetAxis(0)->SetTitle("mcPt (GeV/c)");\r
@@ -761,6 +766,18 @@ void AlidNdPtAnalysis::Init(){
   fMCPrimTrackHist1[i]->GetAxis(4)->SetTitle("mother");\r
   fMCPrimTrackHist1[i]->Sumw2();\r
 \r
+  Int_t binsMCPrimTrackHist2[5]=  {4000,20,4000};\r
+  Double_t minMCPrimTrackHist2[5]={0.,0.,0.}; \r
+  Double_t maxMCPrimTrackHist2[5]={4000.,20.,4000.}; \r
+  sprintf(name,"fMCPrimTrackHist2_%d",i);\r
+  sprintf(title,"pdg:mech:mother");\r
+  \r
+  fMCPrimTrackHist2[i] = new THnSparseF(name,title,5,binsMCPrimTrackHist2,minMCPrimTrackHist2,maxMCPrimTrackHist2);\r
+  fMCPrimTrackHist2[i]->GetAxis(0)->SetTitle("pdg");\r
+  fMCPrimTrackHist2[i]->GetAxis(1)->SetTitle("mech");\r
+  fMCPrimTrackHist2[i]->GetAxis(2)->SetTitle("mother");\r
+  fMCPrimTrackHist2[i]->Sumw2();\r
+\r
   Int_t binsMCSecTrackHist1[5]=  {ptNbins,etaNbins,6,20,4000};\r
   Double_t minMCSecTrackHist1[5]={0.,-1.,0.,0.,0.}; \r
   Double_t maxMCSecTrackHist1[5]={10.,1.,6.,20.,4000.}; \r
@@ -872,16 +889,16 @@ 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(evtCuts->IsTriggerRequired())  \r
+  {\r
+    AliPhysicsSelection *trigSel = GetPhysicsTriggerSelection();\r
+    if(!trigSel) {\r
+      AliDebug(AliLog::kError, "cannot get trigSel");\r
+      return;\r
+    }\r
+\r
     if(IsUseMCInfo()) { \r
       //static AliTriggerAnalysis* triggerAnalysis = new AliTriggerAnalysis;\r
       //isEventTriggered = triggerAnalysis->IsTriggerFired(esdEvent, GetTrigger());\r
@@ -889,7 +906,6 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
       isEventTriggered = trigSel->IsCollisionCandidate(esdEvent);\r
     }\r
     else {\r
-      //isEventTriggered = esdEvent->IsTriggerClassFired(GetTriggerClass());\r
       isEventTriggered = trigSel->IsCollisionCandidate(esdEvent);\r
     }\r
   }\r
@@ -968,11 +984,37 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
   {  \r
      multMBTracks = AlidNdPtHelper::GetTPCMBTrackMult(esdEvent,evtCuts,accCuts,esdTrackCuts);\r
   } \r
-  else if(GetAnalysisMode() == AlidNdPtHelper::kTPCSPDvtx || GetAnalysisMode()==AlidNdPtHelper::kTPCSPDvtxUpdate) \r
+  else if( GetAnalysisMode() == AlidNdPtHelper::kTPCITS ||  GetAnalysisMode() == AlidNdPtHelper::kTPCSPDvtx || \r
+           GetAnalysisMode()==AlidNdPtHelper::kTPCSPDvtxUpdate || GetAnalysisMode()==AlidNdPtHelper::kTPCITSHybrid ) \r
   {\r
-     //multMBTracks = AlidNdPtHelper::GetSPDMBTrackMult(esdEvent,0.0);\r
-     if(vtxESD->GetStatus())\r
-       multMBTracks = vtxESD->GetNContributors();\r
+     //if(vtxESD->GetStatus())\r
+     //  multMBTracks = vtxESD->GetNContributors();\r
+\r
+     // origin Jan Fiete GO\r
+     const AliMultiplicity* mult = esdEvent->GetMultiplicity();\r
+     if (mult) {\r
+       Int_t trackletCount = 0;\r
+       for(Int_t i=0; i<mult->GetNumberOfTracklets(); ++i) {\r
+         Float_t deltaPhi = mult->GetDeltaPhi(i);\r
+         // prevent values to be shifted by 2 Pi()\r
+         if (deltaPhi < -TMath::Pi())\r
+           deltaPhi += TMath::Pi() * 2;\r
+         if (deltaPhi > TMath::Pi())\r
+          deltaPhi -= TMath::Pi() * 2;\r
+\r
+         //if (fDeltaPhiCut > 0 && TMath::Abs(deltaPhi) > fDeltaPhiCut)\r
+         // continue;\r
+\r
+       trackletCount++;\r
+       }\r
+       //multMBTracks = mult->GetNumberOfTracklets();\r
+       multMBTracks = trackletCount;\r
+       //printf("trackletCount %d \n", trackletCount);\r
+     }\r
+     else {\r
+       AliDebug(AliLog::kError, Form("Multiplicty %p", mult));\r
+       return; \r
+     }\r
   } \r
   else {\r
     AliDebug(AliLog::kError, Form("Found analysis type %s", GetAnalysisMode()));\r
@@ -983,17 +1025,20 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
   Int_t multAll=0, multAcc=0, multRec=0;\r
   Int_t *labelsAll=0, *labelsAcc=0, *labelsRec=0;\r
 \r
+  // cosmics analysis\r
+  Int_t cosmicCount = 0;\r
+  // high-pt tracks\r
+  Int_t highPtCount = 0;\r
+\r
   // check event cuts\r
   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
     Int_t entries = allChargedTracks->GetEntries();\r
     //printf("entries %d \n",entries);\r
-     Bool_t isCosmic = kFALSE;\r
 \r
     labelsAll = new Int_t[entries];\r
     labelsAcc = new Int_t[entries];\r
@@ -1016,6 +1061,29 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
       if(!esdTrackCuts->AcceptTrack(track))\r
        continue;\r
 \r
+      //\r
+      Bool_t isOK = kFALSE;\r
+      Double_t x[3]; track->GetXYZ(x);\r
+      Double_t b[3]; AliTracker::GetBxByBz(x,b);\r
+\r
+      //\r
+      // if TPC-ITS hybrid tracking (kTPCITSHybrid)\r
+      // replace track parameters with TPC-ony track parameters\r
+      //\r
+      if( GetAnalysisMode() == AlidNdPtHelper::kTPCITSHybrid ) \r
+      {\r
+        // Relate TPC-only tracks to SPD vertex\r
+        isOK = track->RelateToVertexTPCBxByBz(esdEvent->GetPrimaryVertexSPD(), b, kVeryBig);\r
+        if(!isOK) continue;\r
+\r
+       // replace esd track parameters with TPCinner\r
+        AliExternalTrackParam  *tpcTrack  = new AliExternalTrackParam(*(track->GetTPCInnerParam()));\r
+       if (!tpcTrack) return;\r
+        track->Set(tpcTrack->GetX(),tpcTrack->GetAlpha(),tpcTrack->GetParameter(),tpcTrack->GetCovariance());\r
+\r
+        if(tpcTrack) delete tpcTrack; \r
+      } \r
+\r
       FillHistograms(track,stack,AlidNdPtHelper::kAllTracks); \r
       labelsAll[multAll] = TMath::Abs(track->GetLabel());\r
       multAll++;\r
@@ -1023,13 +1091,18 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
          //FillHistograms(track,stack,AlidNdPtHelper::kAccTracks); \r
         //labelsAcc[multAcc] = TMath::Abs(track->GetLabel());\r
         //multAcc++;\r
+      \r
+         // check high-pt tracks\r
+         if(accCuts->AcceptTrack(track) && track->Pt() > 6.)\r
+        {\r
+            //printf(" high pt: pt %f \n",track->Pt());\r
+            highPtCount++;\r
+        }\r
 \r
-         // cosmics analysis\r
-         isCosmic = kFALSE;\r
-         if( GetParticleMode()==AlidNdPtHelper::kCosmics )\r
+         // check cosmics tracks\r
+         if( GetParticleMode()==AlidNdPtHelper::kCosmic )\r
          {\r
-           Int_t mult = 0;\r
-           if(accCuts->AcceptTrack(track) ) \r
+           if(accCuts->AcceptTrack(track)) \r
           { \r
              for(Int_t j=0; j<entries;++j) \r
              {\r
@@ -1039,21 +1112,22 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
 \r
                if( esdTrackCuts->AcceptTrack(track1) && accCuts->AcceptTrack(track1) ) \r
                { \r
-                 mult++;\r
-                 isCosmic = AlidNdPtHelper::IsCosmicTrack(track,track1);\r
+                if ( AlidNdPtHelper::IsCosmicTrack(track,track1) ) { \r
+                  cosmicCount++;\r
+                  break;\r
+                }\r
               }\r
             }\r
           }\r
-          if(isCosmic) \r
-             printf("evt. number %d , mult %d \n", esdEvent->GetEventNumberInFile(), mult);\r
-\r
-           if(!isCosmic) continue;\r
+          // if(!isCosmic) continue;\r
          }\r
 \r
+         // update track parameters using vertex point \r
         if(GetAnalysisMode() == AlidNdPtHelper::kTPCSPDvtxUpdate) {\r
           // update track parameters\r
              AliExternalTrackParam cParam;\r
-            track->RelateToVertexTPC(esdEvent->GetPrimaryVertexSPD(),esdEvent->GetMagneticField(),kVeryBig,&cParam);\r
+             isOK = track->RelateToVertexTPCBxByBz(esdEvent->GetPrimaryVertexSPD(), b, kVeryBig, &cParam);\r
+             if(!isOK) continue;\r
             track->Set(cParam.GetX(),cParam.GetAlpha(),cParam.GetParameter(),cParam.GetCovariance());\r
 \r
              if(accCuts->AcceptTrack(track)) {\r
@@ -1068,8 +1142,16 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
               labelsRec[multRec] = TMath::Abs(track->GetLabel());\r
               multRec++;\r
             }\r
-          }\r
-         }\r
+        }\r
+     }\r
+     if(cosmicCount) \r
+       printf("COSMIC EVENT: number %d , mult %d \n", esdEvent->GetEventNumberInFile(), multRec);\r
+\r
+     if(highPtCount) \r
+       printf("HIGH PT EVENT: number %d , mult %d \n", esdEvent->GetEventNumberInFile(), multRec);\r
+\r
+     if(multRec > 30) \r
+       printf("HIGH MULT EVENT: number %d , mult %d \n", esdEvent->GetEventNumberInFile(), multRec);\r
 \r
      // fill track multiplicity histograms\r
      FillHistograms(allChargedTracks,labelsAll,multAll,labelsAcc,multAcc,labelsRec,multRec);\r
@@ -1090,7 +1172,7 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
      // multiplicity correlation matrix\r
      //\r
      Double_t vMultTrueEventMatrix[2] = {multRec,multMCTrueTracks};\r
-     fEventMultCorrelationMatrix->Fill(vMultTrueEventMatrix);\r
+     if(isEventOK && isEventTriggered) fEventMultCorrelationMatrix->Fill(vMultTrueEventMatrix);\r
 \r
      // \r
      // event level corrections (zv,N_MB)\r
@@ -1247,7 +1329,7 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
 \r
          // only charged particles\r
          Double_t charge = particle->GetPDG()->Charge()/3.;\r
-         if (charge == 0.0)\r
+         if (TMath::Abs(charge) < 0.001)\r
          continue;\r
 \r
          // only postive charged \r
@@ -1265,7 +1347,8 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
          if(accCuts->AcceptTrack(particle)) \r
         {\r
 \r
-           if( AlidNdPtHelper::IsPrimaryParticle(stack, iMc, GetParticleMode()) ) fGenPrimTrackMatrix->Fill(vTrackMatrix);\r
+           if( AlidNdPtHelper::IsPrimaryParticle(stack, iMc, GetParticleMode()) ) \r
+            fGenPrimTrackMatrix->Fill(vTrackMatrix);\r
 \r
           // fill control histograms\r
            if(fHistogramsOn) \r
@@ -1298,7 +1381,10 @@ void AlidNdPtAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent *const mc
              if(iMc == labelsRec[iRec]) \r
             {\r
                fRecTrackMatrix->Fill(vTrackMatrix);\r
-               if( AlidNdPtHelper::IsPrimaryParticle(stack, iMc, GetParticleMode()) ) fRecPrimTrackMatrix->Fill(vTrackMatrix);\r
+\r
+               if( AlidNdPtHelper::IsPrimaryParticle(stack, iMc, GetParticleMode()) ) \r
+                fRecPrimTrackMatrix->Fill(vTrackMatrix);\r
+\r
                if(!prim) fRecSecTrackMatrix->Fill(vTrackMatrix);\r
 \r
               // fill control histograms\r
@@ -1388,12 +1474,14 @@ void AlidNdPtAnalysis::FillHistograms(AliESDtrack *const esdTrack, AliStack *con
   Double_t values[3] = {pt,eta,phi};     \r
   fRecTrackHist1[trackObj]->Fill(values);\r
 \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
   //\r
   // Fill rec vs MC information\r
@@ -1461,6 +1549,7 @@ void AlidNdPtAnalysis::FillHistograms(AliStack *const stack, Int_t label, AlidNd
 \r
   Double_t gq = particle->GetPDG()->Charge()/3.0; // Charge units |e|/3 \r
   if(TMath::Abs(gq) < 0.001) return;\r
+\r
   Float_t gpt = particle->Pt();\r
   //Float_t qgpt = particle->Pt() * gq;\r
   Float_t geta = particle->Eta();\r
@@ -1482,10 +1571,16 @@ void AlidNdPtAnalysis::FillHistograms(AliStack *const stack, Int_t label, AlidNd
   fMCTrackHist1[trackObj]->Fill(vMCTrackHist1);\r
 \r
   Double_t vMCPrimTrackHist1[5] = {gpt,geta,pid,mech,motherPdg};\r
-  if(prim) fMCPrimTrackHist1[trackObj]->Fill(vMCPrimTrackHist1);\r
-  else     { \r
-         fMCSecTrackHist1[trackObj]->Fill(vMCPrimTrackHist1);\r
+  Double_t vMCPrimTrackHist2[5] = {TMath::Abs(particle->GetPdgCode()),mech,motherPdg};\r
+  //if(prim && AliPWG0Helper::IsPrimaryCharged(particle, label)) fMCPrimTrackHist1[trackObj]->Fill(vMCPrimTrackHist1);\r
+  if(prim) { \r
+    fMCPrimTrackHist1[trackObj]->Fill(vMCPrimTrackHist1);\r
+    if(pid == 5) fMCPrimTrackHist2[trackObj]->Fill(vMCPrimTrackHist2);\r
   }\r
+  else { \r
+    fMCSecTrackHist1[trackObj]->Fill(vMCPrimTrackHist1);\r
+  }\r
+\r
 }\r
 \r
 //_____________________________________________________________________________\r
@@ -1575,6 +1670,7 @@ Long64_t AlidNdPtAnalysis::Merge(TCollection* const list)
       fMCTrackHist1[i]->Add(entry->fMCTrackHist1[i]);\r
 \r
       fMCPrimTrackHist1[i]->Add(entry->fMCPrimTrackHist1[i]);\r
+      fMCPrimTrackHist2[i]->Add(entry->fMCPrimTrackHist2[i]);\r
       fMCSecTrackHist1[i]->Add(entry->fMCSecTrackHist1[i]);\r
 \r
       fRecTrackHist1[i]->Add(entry->fRecTrackHist1[i]);\r
@@ -2105,6 +2201,15 @@ void AlidNdPtAnalysis::Analyse()
   h2c->SetName("eff_pt_protons");\r
   aFolderObj->Add(h2c);\r
 \r
+  fMCPrimTrackHist1[1]->GetAxis(2)->SetRange(1,5); \r
+  fMCPrimTrackHist1[2]->GetAxis(2)->SetRange(1,5); \r
+  h1 = fMCPrimTrackHist1[1]->Projection(0);\r
+  h2 = fMCPrimTrackHist1[2]->Projection(0);\r
+  h2c = (TH1D *)h2->Clone();\r
+  h2c->Divide(h1);\r
+  h2c->SetName("eff_pt_selected");\r
+  aFolderObj->Add(h2c);\r
+\r
   fMCPrimTrackHist1[1]->GetAxis(2)->SetRange(1,6); \r
   fMCPrimTrackHist1[2]->GetAxis(2)->SetRange(1,6); \r
   h1 = fMCPrimTrackHist1[1]->Projection(0);\r
index 26fbb39..abaf5a1 100644 (file)
@@ -125,6 +125,7 @@ public :
 
   THnSparseF *GetMCTrackHist1(Int_t i) const {return fMCTrackHist1[i];}
   THnSparseF *GetMCPrimTrackHist1(Int_t i) const {return fMCPrimTrackHist1[i];}
+  THnSparseF *GetMCPrimTrackHist2(Int_t i) const {return fMCPrimTrackHist2[i];}
   THnSparseF *GetMCSecTrackHist1(Int_t i) const {return fMCSecTrackHist1[i];}
 
   THnSparseF *GetRecTrackHist1(Int_t i) const {return fRecTrackHist1[i];}
@@ -233,6 +234,7 @@ private:
 
   THnSparseF *fMCTrackHist1[AlidNdPtHelper::kCutSteps];     //-> mcPt:mcEta:mcPhi
   THnSparseF *fMCPrimTrackHist1[AlidNdPtHelper::kCutSteps]; //-> mcPt:mcEta:pid:mech:mother
+  THnSparseF *fMCPrimTrackHist2[AlidNdPtHelper::kCutSteps]; //-> pdg:mech:mother
   THnSparseF *fMCSecTrackHist1[AlidNdPtHelper::kCutSteps];  //-> mcPt:mcEta:pid:mech:mother
 
   THnSparseF *fRecTrackHist1[AlidNdPtHelper::kCutSteps];     //-> Pt:Eta:Phi
@@ -249,7 +251,7 @@ private:
   AlidNdPtAnalysis(const AlidNdPtAnalysis&); // not implemented
   AlidNdPtAnalysis& operator=(const AlidNdPtAnalysis&); // not implemented
 
-  ClassDef(AlidNdPtAnalysis,1);
+  ClassDef(AlidNdPtAnalysis,2);
 };
 
 #endif
diff --git a/PWG0/dNdPt/AlidNdPtBackgroundCuts.cxx b/PWG0/dNdPt/AlidNdPtBackgroundCuts.cxx
new file mode 100644 (file)
index 0000000..63f96da
--- /dev/null
@@ -0,0 +1,225 @@
+/**************************************************************************
+* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
+*                                                                        *
+* Author: The ALICE Off-line Project.                                    *
+* Contributors are mentioned in the code where appropriate.              *
+*                                                                        *
+* Permission to use, copy, modify and distribute this software and its   *
+* documentation strictly for non-commercial purposes is hereby granted   *
+* without fee, provided that the above copyright notice appears in all   *
+* copies and that both the copyright notice and this permission notice   *
+* appear in the supporting documentation. The authors make no claims     *
+* about the suitability of this software for any purpose. It is          *
+* provided "as is" without express or implied warranty.                  *
+**************************************************************************/
+
+#include <iostream>
+#include <TList.h>
+#include <TAxis.h>
+#include <THnSparse.h>
+
+#include "AliLog.h"
+#include "AliESDtrack.h"
+#include "AliExternalTrackParam.h"
+#include "TParticle.h"
+
+#include "AlidNdPtBackgroundCuts.h"
+
+using namespace std;
+
+ClassImp(AlidNdPtBackgroundCuts)
+
+//_____________________________________________________________________________
+AlidNdPtBackgroundCuts::AlidNdPtBackgroundCuts(const Char_t* name,const Char_t *title) : 
+AliAnalysisCuts(name, title)
+, fMinEta(0)
+, fMaxEta(0)
+, fMinPhi(0)
+, fMaxPhi(0)
+, fMinPt(0)
+, fMaxPt(0)
+, fMaxFracSharedClust(0)
+, fFillControlHisto(kFALSE)
+, fControlHisto(0)
+{
+  // default constructor 
+  
+  // init data members with defaults
+  Init();
+}
+
+//_____________________________________________________________________________
+AlidNdPtBackgroundCuts::~AlidNdPtBackgroundCuts()  
+{
+  // destructor
+  if(fControlHisto) delete fControlHisto;
+}
+
+//_____________________________________________________________________________
+void AlidNdPtBackgroundCuts::Init()  
+{
+  // set default values
+  SetEtaWindow();
+  SetPhiWindow();
+  SetPtWindow();
+  SetMaxFracSharedClust();
+
+  const Int_t ptNbins = 56;
+  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};
+
+  //etasum:dphi:dpt:eta1:eta2:pt1:fracSharedClust1:qsum
+  Int_t binsControlHisto[8]=  { 201,  401,              101,  30,   30,  ptNbins, 101, 3 };
+  Double_t minControlHisto[8]={-3.0, -2.*TMath::Pi(),  -10,  -1.5, -1.5, 0.,      0.,  0.}; 
+  Double_t maxControlHisto[8]={ 3.0,  2.*TMath::Pi(),   10,   1.5,  1.5, 16.,     1.,  3.}; 
+  
+  fControlHisto = new THnSparseF("fControlHisto","etasum:dphi:dpt:eta1:eta2:pt1:fracSharedClust1:qsum",8,binsControlHisto,minControlHisto,maxControlHisto);
+  fControlHisto->SetBinEdges(5,binsPt);
+  fControlHisto->GetAxis(0)->SetTitle("#eta1+#eta2");
+  fControlHisto->GetAxis(1)->SetTitle("#phi1-#phi2 (rad)");
+  fControlHisto->GetAxis(2)->SetTitle("pt1-pt2 (GeV/c)");
+  fControlHisto->GetAxis(3)->SetTitle("#eta1");
+  fControlHisto->GetAxis(4)->SetTitle("#eta2");
+  fControlHisto->GetAxis(5)->SetTitle("pt1 (GeV/c)");
+  fControlHisto->GetAxis(6)->SetTitle("fracSharedClust1");
+  fControlHisto->GetAxis(7)->SetTitle("q1+q2");
+  fControlHisto->Sumw2();
+}
+
+//_____________________________________________________________________________
+Bool_t AlidNdPtBackgroundCuts::IsBackgroundTrack(AliESDtrack *track1, AliESDtrack *track2)
+{
+  // 
+  // check whether track is cosmic or splitted one
+  //
+  if(!track1) return kFALSE;
+  if(!track2) return kFALSE;
+  const AliExternalTrackParam *tpcTrack1 =  track1->GetTPCInnerParam();
+  const AliExternalTrackParam *tpcTrack2 =  track2->GetTPCInnerParam();
+  if(!tpcTrack1) return kFALSE;
+  if(!tpcTrack2) return kFALSE;
+
+  if( IsHistogramsOn() ) 
+  {
+    Float_t etasum = tpcTrack1->Eta() + tpcTrack2->Eta();
+    Float_t dphi   = tpcTrack1->Phi() - tpcTrack2->Phi();
+    Float_t dpt    = tpcTrack1->Pt()  - tpcTrack2->Pt();
+    Float_t pt1    = tpcTrack1->Pt();
+    Float_t qsum   = track1->Charge() + track2->Charge();
+    if(qsum == -2) qsum = 1;
+
+    Float_t nclust1 =  track1->GetTPCNclsIter1() ; // first tracking pass
+    Float_t nclust2 =  track2->GetTPCNclsIter1() ; // first tracking pass
+    Float_t fracSharedClust1 = 0.0;
+    if(nclust1) fracSharedClust1 = track1->GetTPCnclsS()/Float_t(nclust1); 
+  
+    //Float_t dsphi = (tpcTrack1->GetSnp()-tpcTrack2->GetSnp()) / TMath::Sqrt(tpcTrack1->GetSigmaSnp2()+tpcTrack2->GetSigmaSnp2());    
+    //Float_t dtanl = (tpcTrack1->GetTgl()-tpcTrack2->GetTgl()) / TMath::Sqrt(tpcTrack1->GetSigmaTgl2()+tpcTrack2->GetSigmaTgl2());
+    //Float_t dsphi = tpcTrack1->GetSnp()-tpcTrack2->GetSnp();
+    //Float_t dtanl = tpcTrack1->GetTgl()-tpcTrack2->GetTgl();
+    //
+
+
+    /*
+    printf("tpcTrack1->GetSnp() %e, track1->Pt() %f, track1->Theta() %f, track1->Eta() %f, track1->Phi() %f, track1->Charge() %d  \n", tpcTrack1->GetSnp(), track1->Pt(), track1->Theta(), track1->Eta(), track1->Phi(), track1->Charge());
+
+    printf("tpcTrack2->GetSnp() %e, track2->Pt() %f, track2->Theta() %f, track2->Eta() %f, track2->Phi() %f, track2->Charge() %d  \n", tpcTrack2->GetSnp(), track2->Pt(), track2->Theta(), track2->Eta(), track2->Phi(), track2->Charge());
+    */
+
+    Double_t vControlHisto[8] = {etasum, dphi, dpt, tpcTrack1->Eta(), tpcTrack2->Eta(), pt1, fracSharedClust1,qsum};
+    if(nclust1 > 70 && nclust2 > 70)
+       fControlHisto->Fill(vControlHisto);
+  }
+
+  if ( IsCosmicTrack(track1,track2) || IsSplittedTrack(track1,track2) ) return kTRUE;
+  else return kFALSE;
+
+return kFALSE;
+}
+
+//_____________________________________________________________________________
+Bool_t AlidNdPtBackgroundCuts::IsCosmicTrack(AliESDtrack *track1, AliESDtrack *track2)
+{
+  // 
+  // check whether track is cosmic
+  //
+  if(!track1) return kFALSE;
+  if(!track2) return kFALSE;
+  const AliExternalTrackParam *tpcTrack1 =  track1->GetTPCInnerParam();
+  const AliExternalTrackParam *tpcTrack2 =  track2->GetTPCInnerParam();
+  if(!tpcTrack1) return kFALSE;
+  if(!tpcTrack2) return kFALSE;
+
+ /*
+  Float_t etasum = tpcTrack1->Eta() + tpcTrack2->Eta();
+  Float_t dphi = tpcTrack1->Phi() - tpcTrack2->Phi();
+  Float_t dpt  = tpcTrack1->Pt()  - tpcTrack2->Pt();
+  Float_t pt1  = tpcTrack1->Pt();
+  */
+  Float_t qsum = track1->Charge() + track2->Charge();
+
+  Float_t nclust =  track1->GetTPCNclsIter1() ; // first tracking pass
+  Float_t fracSharedClust = 0.0;
+  if(nclust) fracSharedClust = track1->GetTPCnclsS()/Float_t(nclust); 
+
+  if( qsum != 0) return kFALSE;
+
+return kFALSE;
+}
+
+//_____________________________________________________________________________
+Bool_t AlidNdPtBackgroundCuts::IsSplittedTrack(AliESDtrack *track1, AliESDtrack *track2)
+{
+  // 
+  // check whether track is cosmic
+  //
+  if(!track1) return kFALSE;
+  if(!track2) return kFALSE;
+  const AliExternalTrackParam *tpcTrack1 =  track1->GetTPCInnerParam();
+  const AliExternalTrackParam *tpcTrack2 =  track2->GetTPCInnerParam();
+  if(!tpcTrack1) return kFALSE;
+  if(!tpcTrack2) return kFALSE;
+
+  /*
+  Float_t etasum = tpcTrack1->Eta() + tpcTrack2->Eta();
+  Float_t dphi = tpcTrack1->Phi() - tpcTrack2->Phi();
+  Float_t dpt  = tpcTrack1->Pt()  - tpcTrack2->Pt();
+  Float_t pt1  = tpcTrack1->Pt();
+  Float_t qsum = track1->Charge() + track2->Charge();
+
+  Float_t nclust =  track1->GetTPCNclsIter1() ; // first tracking pass
+  Float_t fracSharedClust = 0.0;
+  if(nclust) fracSharedClust = track1->GetTPCnclsS()/Float_t(nclust); 
+  */
+
+return kFALSE;
+}
+
+
+
+//_____________________________________________________________________________
+Long64_t AlidNdPtBackgroundCuts::Merge(TCollection* list) 
+{
+  // Merge list of objects (needed by PROOF)
+  if (!list)
+  return 0;
+
+  if (list->IsEmpty())
+  return 1;
+
+  TIterator* iter = list->MakeIterator();
+  TObject* obj = 0;
+
+  Int_t count=0;
+  while((obj = iter->Next()) != 0) 
+  {
+    AlidNdPtBackgroundCuts* entry = dynamic_cast<AlidNdPtBackgroundCuts*>(obj);
+    if (entry == 0)  
+      continue; 
+  
+    fControlHisto->Add(entry->fControlHisto);
+
+  count++;
+  }
+
+return count;
+}
diff --git a/PWG0/dNdPt/AlidNdPtBackgroundCuts.h b/PWG0/dNdPt/AlidNdPtBackgroundCuts.h
new file mode 100644 (file)
index 0000000..493a2d2
--- /dev/null
@@ -0,0 +1,79 @@
+#ifndef ALIDNDPTBACKGROUNDCUTS_H\r
+#define ALIDNDPTBACKGROUNDCUTS_H\r
+\r
+//------------------------------------------------------------------------------\r
+// Class to keep selection cuts for \r
+// cosmic and kinks and splitted tracks. \r
+// \r
+// Author: J.Otwinowski 25/01/2010\r
+//------------------------------------------------------------------------------\r
+\r
+class TParticle;\r
+class AliESDtrack;\r
+class AliExternalTrackParam;\r
+\r
+#include "AliAnalysisCuts.h"\r
+\r
+class AlidNdPtBackgroundCuts : public AliAnalysisCuts\r
+{\r
+public:\r
+  AlidNdPtBackgroundCuts(const Char_t* name ="AlidNdPtBackgroundCuts", const Char_t *title ="");\r
+  virtual ~AlidNdPtBackgroundCuts(); \r
\r
+  // setters \r
+  void SetEtaWindow(const Float_t min=-10., const Float_t max=10.)  { fMinEta=min; fMaxEta=max; }\r
+  void SetPhiWindow(const Float_t min=0., const Float_t max=1e99)  { fMinPhi=min; fMaxPhi=max;}\r
+  void SetPtWindow(const Float_t min=0., const Float_t max=1e99)   { fMinPt=min;  fMaxPt=max;}\r
+  void SetMaxFracSharedClust(const Float_t max=1.)   {fMaxFracSharedClust=max;}\r
+\r
+  // getters \r
+  Float_t GetMinEta() const {return fMinEta;}\r
+  Float_t GetMaxEta() const {return fMaxEta;}\r
+  Float_t GetMinPhi() const {return fMinPhi;}\r
+  Float_t GetMaxPhi() const {return fMaxPhi;}\r
+  Float_t GetMinPt() const  {return fMinPt;}\r
+  Float_t GetMaxPt() const  {return fMaxPt;}\r
+\r
+  Float_t GetMaxFracSharedClust() const {return fMaxFracSharedClust;}\r
+\r
+  // Get control histo\r
+  THnSparseF *GetControlHisto() const {return fControlHisto;} \r
+\r
+  // cuts init function\r
+  void Init();\r
+\r
+  // check MC tracks\r
+  virtual Bool_t IsSelected(TObject *) {return kTRUE;}\r
+  virtual Bool_t IsSelected(TList *) {return kTRUE;}\r
+\r
+  //\r
+  Bool_t IsBackgroundTrack(AliESDtrack *track1, AliESDtrack *track2);\r
+  Bool_t IsCosmicTrack(AliESDtrack *track1, AliESDtrack *track2);\r
+  Bool_t IsSplittedTrack(AliESDtrack *track1, AliESDtrack *track2);\r
+  \r
+  // Merge output objects (needed by PROOF) \r
+  virtual Long64_t Merge(TCollection* list);\r
+\r
+  // fill control histograms\r
+  void  SetHistogramsOn(Bool_t fill=kTRUE) {fFillControlHisto = fill; }\r
+  Bool_t  IsHistogramsOn() const {return fFillControlHisto; }\r
+\r
+private:\r
+  Float_t fMinEta; // min pseudorapidity limit\r
+  Float_t fMaxEta; // max pseudorapidity limit\r
+  Float_t fMinPhi; // min azimuthal angle (rad) limit\r
+  Float_t fMaxPhi; // max azimuthal angle (rad) limit\r
+  Float_t fMinPt;  // min pt limit\r
+  Float_t fMaxPt;  // max pt limit\r
+  Float_t fMaxFracSharedClust; // max fraction of track shared clusters \r
+\r
+  Bool_t  fFillControlHisto;  // flag to fill control histograms \r
+  THnSparseF *fControlHisto;  //-> etasum:dphi:dpt:pt1:fracSharedClust1:qsum\r
+\r
+  AlidNdPtBackgroundCuts(const AlidNdPtBackgroundCuts&); // not implemented\r
+  AlidNdPtBackgroundCuts& operator=(const AlidNdPtBackgroundCuts&); // not implemented\r
+\r
+  ClassDef(AlidNdPtBackgroundCuts, 1)\r
+};\r
+\r
+#endif // \r
index 57e2ab9..20582a5 100644 (file)
 #include "AliMCEvent.h"  \r
 #include "AliESDtrackCuts.h"  \r
 #include "AliLog.h" \r
+#include "AliTracker.h" \r
 \r
 #include "AlidNdPtEventCuts.h"\r
 #include "AlidNdPtAcceptanceCuts.h"\r
+#include "AlidNdPtBackgroundCuts.h"\r
 #include "AliPhysicsSelection.h"\r
 \r
 #include "AliPWG0Helper.h"\r
@@ -134,10 +136,10 @@ void AlidNdPtCutAnalysis::Init(){
   Int_t binsRecMCEventHist[4]={100,100,100,150};\r
   Double_t minRecMCEventHist[4]={-1.0*kFact,-1.0*kFact,-1.0*kFact,0.}; \r
   Double_t maxRecMCEventHist[4]={1.0*kFact,1.0*kFact,1.0*kFact,150.}; \r
-  fRecMCEventHist = new THnSparseF("fRecMCEventHist","mcXv-Xv:mcYv-Yv:mcZv-Zv:Mult",4,binsRecMCEventHist,minRecMCEventHist,maxRecMCEventHist);\r
-  fRecMCEventHist->GetAxis(0)->SetTitle("mcXv-Xv (cm)");\r
-  fRecMCEventHist->GetAxis(1)->SetTitle("mcYv-Yv (cm)");\r
-  fRecMCEventHist->GetAxis(2)->SetTitle("mcZv-Zv (cm)");\r
+  fRecMCEventHist = new THnSparseF("fRecMCEventHist","Xv-mcXv:Yv-mcYv:Zv-mcZv:Mult",4,binsRecMCEventHist,minRecMCEventHist,maxRecMCEventHist);\r
+  fRecMCEventHist->GetAxis(0)->SetTitle("Xv-mcXv (cm)");\r
+  fRecMCEventHist->GetAxis(1)->SetTitle("Yv-mcYv (cm)");\r
+  fRecMCEventHist->GetAxis(2)->SetTitle("Zv-mcZv (cm)");\r
   fRecMCEventHist->GetAxis(3)->SetTitle("Mult");\r
   fRecMCEventHist->Sumw2();\r
 \r
@@ -192,16 +194,16 @@ 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(evtCuts->IsTriggerRequired())  \r
+  {\r
+    AliPhysicsSelection *trigSel = GetPhysicsTriggerSelection();\r
+    if(!trigSel) {\r
+      AliDebug(AliLog::kError, "cannot get trigSel");\r
+      return;\r
+    }\r
+\r
     if(IsUseMCInfo()) { \r
       //static AliTriggerAnalysis* triggerAnalysis = new AliTriggerAnalysis;\r
       //isEventTriggered = triggerAnalysis->IsTriggerFired(esdEvent, GetTrigger());\r
@@ -209,7 +211,6 @@ void AlidNdPtCutAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent * cons
       isEventTriggered = trigSel->IsCollisionCandidate(esdEvent);\r
     }\r
     else {\r
-      //isEventTriggered = esdEvent->IsTriggerClassFired(GetTriggerClass());\r
       isEventTriggered = trigSel->IsCollisionCandidate(esdEvent);\r
     }\r
   }\r
@@ -265,8 +266,6 @@ void AlidNdPtCutAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent * cons
   Bool_t bRedoTPCVertex = evtCuts->IsRedoTPCVertex();\r
   Bool_t bUseConstraints = evtCuts->IsUseBeamSpotConstraint();\r
   const AliESDVertex* vtxESD = AlidNdPtHelper::GetVertex(esdEvent,evtCuts,accCuts,esdTrackCuts,GetAnalysisMode(),kFALSE,bRedoTPCVertex,bUseConstraints); \r
-  if(!vtxESD) return; \r
-\r
   Bool_t isRecVertex = AlidNdPtHelper::TestRecVertex(vtxESD, GetAnalysisMode(), kFALSE);\r
   Bool_t isEventOK = evtCuts->AcceptEvent(esdEvent,mcEvent,vtxESD) && isRecVertex;\r
 \r
@@ -282,6 +281,33 @@ void AlidNdPtCutAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent * cons
   Double_t vEventCount[2] = { isEventTriggered, isTrigAndVertex};\r
   fEventCount->Fill(vEventCount);\r
 \r
+  //\r
+  // cosmic background and splitted tracks\r
+  //\r
+  if(GetParticleMode() == AlidNdPtHelper::kBackgroundTrack) \r
+  {\r
+    AlidNdPtBackgroundCuts *backCuts = GetBackgroundCuts(); \r
+    if(!backCuts) return;\r
+\r
+    for (Int_t iTrack = 0; iTrack < esdEvent->GetNumberOfTracks(); iTrack++) \r
+    {\r
+      AliESDtrack *track1 = esdEvent->GetTrack(iTrack);\r
+      if(!track1) continue; \r
+      if(track1->Charge()==0) continue; \r
+\r
+      for (Int_t jTrack = iTrack+1; jTrack < esdEvent->GetNumberOfTracks(); jTrack++) \r
+      {\r
+        AliESDtrack *track2 = esdEvent->GetTrack(jTrack);\r
+        if(!track2) continue; \r
+        if(track2->Charge()==0) continue; \r
+\r
+       //printf("track2->Charge() %d\n",track2->Charge());\r
+\r
+        backCuts->IsBackgroundTrack(track1, track2);\r
+      }\r
+    }\r
+  }\r
+\r
   // check event cuts\r
   if(isEventOK && isEventTriggered)\r
   {\r
@@ -296,27 +322,52 @@ void AlidNdPtCutAnalysis::Process(AliESDEvent *const esdEvent, AliMCEvent * cons
       if(!track) continue;\r
 \r
       //\r
+      Bool_t isOK = kFALSE;\r
+      Double_t x[3]; track->GetXYZ(x);\r
+      Double_t b[3]; AliTracker::GetBxByBz(x,b);\r
+\r
+      //\r
+      // if TPC-ITS hybrid tracking (kTPCITSHybrid)\r
+      // replace track parameters with TPC-ony track parameters\r
+      //\r
+      if( GetAnalysisMode() == AlidNdPtHelper::kTPCITSHybrid ) \r
+      {\r
+        // Relate TPC-only tracks to SPD vertex\r
+        isOK = track->RelateToVertexTPCBxByBz(esdEvent->GetPrimaryVertexSPD(), b, kVeryBig);\r
+        if(!isOK) continue;\r
+\r
+       // replace esd track parameters with TPCinner\r
+        AliExternalTrackParam  *tpcTrack  = new AliExternalTrackParam(*(track->GetTPCInnerParam()));\r
+       if (!tpcTrack) return;\r
+        track->Set(tpcTrack->GetX(),tpcTrack->GetAlpha(),tpcTrack->GetParameter(),tpcTrack->GetCovariance());\r
+\r
+        if(tpcTrack) delete tpcTrack; \r
+      } \r
+\r
+      //\r
       if (GetAnalysisMode()==AlidNdPtHelper::kTPCSPDvtxUpdate) \r
       {\r
         //\r
         // update track parameters\r
        //\r
-           AliExternalTrackParam cParam;\r
-          track->RelateToVertexTPC(esdEvent->GetPrimaryVertexSPD(),esdEvent->GetMagneticField(),kVeryBig,&cParam);\r
-          track->Set(cParam.GetX(),cParam.GetAlpha(),cParam.GetParameter(),cParam.GetCovariance());\r
+        AliExternalTrackParam cParam;\r
+        isOK = track->RelateToVertexTPCBxByBz(esdEvent->GetPrimaryVertexSPD(), b, kVeryBig, &cParam);\r
+       if(!isOK) continue;\r
+\r
+       track->Set(cParam.GetX(),cParam.GetAlpha(),cParam.GetParameter(),cParam.GetCovariance());\r
       }\r
 \r
       FillHistograms(track, stack);\r
       multAll++;\r
     }\r
 \r
-  Double_t vRecEventHist[5] = {vtxESD->GetXv(),vtxESD->GetYv(),vtxESD->GetZv(),vtxESD->GetZRes(),multAll};\r
-  fRecEventHist->Fill(vRecEventHist);\r
+    Double_t vRecEventHist[5] = {vtxESD->GetXv(),vtxESD->GetYv(),vtxESD->GetZv(),vtxESD->GetZRes(),multAll};\r
+    fRecEventHist->Fill(vRecEventHist);\r
 \r
-  if(IsUseMCInfo()) {\r
-    Double_t vRecMCEventHist[5] = {vtxESD->GetXv()-vtxMC[0],vtxESD->GetYv()-vtxMC[1],vtxESD->GetZv()-vtxMC[2],multAll};\r
-    fRecMCEventHist->Fill(vRecMCEventHist);\r
-  }\r
+    if(IsUseMCInfo()) {\r
+      Double_t vRecMCEventHist[5] = {vtxESD->GetXv()-vtxMC[0],vtxESD->GetYv()-vtxMC[1],vtxESD->GetZv()-vtxMC[2],multAll};\r
+      fRecMCEventHist->Fill(vRecMCEventHist);\r
+    }\r
   }\r
 \r
   if(allChargedTracks) delete allChargedTracks; allChargedTracks = 0;\r
@@ -335,11 +386,13 @@ void AlidNdPtCutAnalysis::FillHistograms(AliESDtrack *const esdTrack, AliStack *
   Float_t pt = esdTrack->Pt();\r
   Float_t eta = esdTrack->Eta();\r
   Float_t phi = esdTrack->Phi();\r
-  Int_t nClust = esdTrack->GetTPCclusters(0);\r
+  //Int_t nClust = esdTrack->GetTPCclusters(0);\r
+  Int_t nClust = esdTrack->GetTPCNclsIter1();\r
   Int_t nFindableClust = esdTrack->GetTPCNclsF();\r
 \r
   Float_t chi2PerCluster = 0.;\r
-  if(nClust>0.) chi2PerCluster = esdTrack->GetTPCchi2()/Float_t(nClust);\r
+  //if(nClust>0.) chi2PerCluster = esdTrack->GetTPCchi2()/Float_t(nClust);\r
+  if(nClust>0.) chi2PerCluster = esdTrack->GetTPCchi2Iter1()/Float_t(nClust);\r
 \r
   Float_t clustPerFindClust = 0.;\r
   if(nFindableClust>0.) clustPerFindClust = Float_t(nClust)/nFindableClust;\r
@@ -388,6 +441,8 @@ Long64_t AlidNdPtCutAnalysis::Merge(TCollection* const list)
   TIterator* iter = list->MakeIterator();\r
   TObject* obj = 0;\r
 \r
+  //TList *collPhysSelection = new TList;\r
+\r
   // collection of generated histograms\r
   Int_t count=0;\r
   while((obj = iter->Next()) != 0) {\r
@@ -402,10 +457,18 @@ Long64_t AlidNdPtCutAnalysis::Merge(TCollection* const list)
 \r
     // track histo\r
     fRecMCTrackHist->Add(entry->fRecMCTrackHist);\r
+\r
+    // physics selection\r
+    //collPhysSelection->Add(entry->GetPhysicsTriggerSelection());\r
     \r
   count++;\r
   }\r
 \r
+  //AliPhysicsSelection *trigSelection = GetPhysicsTriggerSelection();\r
+  //trigSelection->Merge(collPhysSelection);\r
+\r
+  //if(collPhysSelection) delete collPhysSelection;\r
+\r
 return count;\r
 }\r
 \r
index 7c48211..e48f6de 100644 (file)
@@ -71,7 +71,6 @@ AlidNdPtTask::~AlidNdPtTask()
 //____________________________________________________________________________\r
 Bool_t AlidNdPtTask::Notify()\r
 {\r
-  /*\r
   static Int_t count = 0;\r
   count++;\r
   Printf("Processing %d. file", count);\r
@@ -82,12 +81,9 @@ Bool_t AlidNdPtTask::Notify()
     Printf("ERROR: Could not get ESDInputHandler");\r
     return kFALSE;\r
   } else {\r
-    //Printf("esdH->Notify() %s", esdH->Notify());\r
-    //Printf("fTree->GetCurrentFile()->GetName() %s", fTree->GetCurrentFile()->GetName());\r
     if(chain)\r
-    Printf("chain->GetCurrentFile()->GetName() %s %s", chain->GetCurrentFile()->GetName(),  );\r
+    Printf("chain->GetCurrentFile()->GetName() %s", chain->GetCurrentFile()->GetName());\r
   }\r
-  */\r
 \r
 return kTRUE;\r
 }\r
index 71d8bf6..91f2ce5 100644 (file)
@@ -74,7 +74,8 @@ AliESDtrackCuts* CreatedNdPtTrackCuts(Int_t cutMode=1, Bool_t fieldOn = kTRUE, B
     maxChi2PerClusterTPC = 3.5;
 
     esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
-    esdTrackCuts->SetMaxDCAToVertex(maxDCAtoVertex);    
+    esdTrackCuts->SetMaxDCAToVertexXY(maxDCAtoVertex);    
+    esdTrackCuts->SetMaxDCAToVertexZ(maxDCAtoVertex);    
     esdTrackCuts->SetRequireTPCRefit(kFALSE);
     esdTrackCuts->SetAcceptKinkDaughters(kFALSE);
     esdTrackCuts->SetMinNClustersTPC(minNClustersTPC);
@@ -167,7 +168,8 @@ AliESDtrackCuts* CreatedNdPtTrackCuts(Int_t cutMode=1, Bool_t fieldOn = kTRUE, B
     maxDCAtoVertex = 3.0; // cm
 
     esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
-    esdTrackCuts->SetMaxDCAToVertex(maxDCAtoVertex);    
+    esdTrackCuts->SetMaxDCAToVertexXY(maxDCAtoVertex);    
+    esdTrackCuts->SetMaxDCAToVertexZ(maxDCAtoVertex);    
     esdTrackCuts->SetRequireTPCRefit(kFALSE);
     esdTrackCuts->SetAcceptKinkDaughters(kTRUE);
     //esdTrackCuts->SetMinNClustersTPC(minNClustersTPC);
@@ -185,7 +187,8 @@ AliESDtrackCuts* CreatedNdPtTrackCuts(Int_t cutMode=1, Bool_t fieldOn = kTRUE, B
     maxDCAtoVertex = 3.0; // cm
 
     esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
-    esdTrackCuts->SetMaxDCAToVertex(maxDCAtoVertex);    
+    esdTrackCuts->SetMaxDCAToVertexXY(maxDCAtoVertex);    
+    esdTrackCuts->SetMaxDCAToVertexZ(maxDCAtoVertex);    
     esdTrackCuts->SetRequireTPCRefit(kFALSE);
     esdTrackCuts->SetAcceptKinkDaughters(kTRUE);
     //esdTrackCuts->SetMinNClustersTPC(minNClustersTPC);
@@ -209,7 +212,8 @@ AliESDtrackCuts* CreatedNdPtTrackCuts(Int_t cutMode=1, Bool_t fieldOn = kTRUE, B
     esdTrackCuts->SetAcceptKinkDaughters(kTRUE);
     esdTrackCuts->SetMinNClustersTPC(minNClustersTPC);
     esdTrackCuts->SetMaxChi2PerClusterTPC(maxChi2PerClusterTPC);
-    esdTrackCuts->SetMaxDCAToVertex(maxDCAtoVertex);    
+    esdTrackCuts->SetMaxDCAToVertexXY(maxDCAtoVertex);    
+    esdTrackCuts->SetMaxDCAToVertexZ(maxDCAtoVertex);    
     esdTrackCuts->SetPtRange(minPt,maxPt);
 
     TString tag = "TPC-only tracking";
@@ -509,20 +513,18 @@ AliESDtrackCuts* CreatedNdPtTrackCuts(Int_t cutMode=1, Bool_t fieldOn = kTRUE, B
     TString tag = "TPC-only tracking";
   }
 
-  // TPC-only + pt cut + eta cut 
+  // TPC-only 
   if (cutMode == 23) 
   {
     // beta cuts (still under investigation)
-    //minNClustersTPC = 50;
     minNClustersTPC = 70;
     maxChi2PerClusterTPC = 4.0;
     maxDCAtoVertexXY = 2.4; // cm
     maxDCAtoVertexZ  = 3.2; // cm
-    //minPt=0.15;
-    //maxPt=1.e10;
 
     esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
     esdTrackCuts->SetRequireTPCRefit(kFALSE);
+    esdTrackCuts->SetRequireTPCStandAlone(kTRUE);
     esdTrackCuts->SetAcceptKinkDaughters(kFALSE);
     esdTrackCuts->SetMinNClustersTPC(minNClustersTPC);
     esdTrackCuts->SetMaxChi2PerClusterTPC(maxChi2PerClusterTPC);
@@ -1036,10 +1038,56 @@ AliESDtrackCuts* CreatedNdPtTrackCuts(Int_t cutMode=1, Bool_t fieldOn = kTRUE, B
     TString tag = "TPC-only tracking";
   }
 
+  // TPC-tracks + SPD point + ITS refit
+  if (cutMode == 50) 
+  {
+    Int_t    minclsTPC=70;
+    Double_t maxchi2perTPCcl=4.;
+    //Double_t maxEtaInAcc=0.8;
+    Double_t maxdcaxyITSTPC=0.2;
+    Double_t maxdcazITSTPC=1.e9;
+
+    esdTrackCuts->SetMaxDCAToVertexXY(maxdcaxyITSTPC);
+    esdTrackCuts->SetMaxDCAToVertexZ(maxdcazITSTPC);
+    esdTrackCuts->SetDCAToVertex2D(kFALSE);
+    esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
+    esdTrackCuts->SetRequireITSRefit(kTRUE);
+    esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kAny);
+    esdTrackCuts->SetRequireTPCStandAlone(kTRUE);
+    esdTrackCuts->SetAcceptKinkDaughters(kFALSE);
+    esdTrackCuts->SetMinNClustersTPC(minclsTPC);
+    esdTrackCuts->SetMaxChi2PerClusterTPC(maxchi2perTPCcl);
+    //esdTrackCuts->SetEtaRange(-maxEtaInAcc,maxEtaInAcc);
 
+    TString tag = "TPC-tracks + ITS refit + >1 SPD cluster";
+  }
 
+  // TPC-tracks + SPD point + ITS refit
+  if (cutMode == 60) 
+  {
+    Int_t    minclsITS=4;
+    Int_t    minclsTPC=70;
+    Double_t maxchi2perTPCcl=4.;
+    //Double_t maxEtaInAcc=0.8;
+    Double_t maxdcaxyITSTPC=0.2;
+    Double_t maxdcazITSTPC=1.e9;
+
+    esdTrackCuts->SetMaxDCAToVertexXY(maxdcaxyITSTPC);
+    esdTrackCuts->SetMaxDCAToVertexZ(maxdcazITSTPC);
+    esdTrackCuts->SetDCAToVertex2D(kFALSE);
+    esdTrackCuts->SetRequireSigmaToVertex(kFALSE);
+    esdTrackCuts->SetRequireITSRefit(kTRUE);
+    esdTrackCuts->SetMinNClustersITS(minclsITS);
+    esdTrackCuts->SetClusterRequirementITS(AliESDtrackCuts::kSPD,AliESDtrackCuts::kAny);
+    //esdTrackCuts->SetRequireTPCStandAlone(kTRUE);
+    esdTrackCuts->SetRequireTPCRefit(kTRUE);
+    esdTrackCuts->SetAcceptKinkDaughters(kFALSE);
+    esdTrackCuts->SetMinNClustersTPC(minclsTPC);
+    esdTrackCuts->SetMaxChi2PerClusterTPC(maxchi2perTPCcl);
+    //esdTrackCuts->SetEtaRange(-maxEtaInAcc,maxEtaInAcc);
 
-
+    TString tag = "Global tracking: TPC refit + ITS refit + >3 ITS clusters + >=1 SPD cluster";
+  }
 
   // cuts for data without field
   if (!fieldOn)
index 05e8648..feb3ffb 100644 (file)
@@ -13,7 +13,8 @@ SRCS = TPC/AliTPCClusterHistograms.cxx \
       dNdPt/AlidNdPtEventCuts.cxx \
       dNdPt/AlidNdPt.cxx \
       dNdPt/AlidNdPtCutAnalysis.cxx \
-       dNdPt/AlidNdPtTask.cxx 
+      dNdPt/AlidNdPtTask.cxx \
+      dNdPt/AlidNdPtBackgroundCuts.cxx 
 
 HDRS = $(SRCS:.cxx=.h)