Removed two variables, added one step in the container
authorkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 27 Sep 2010 14:43:03 +0000 (14:43 +0000)
committerkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 27 Sep 2010 14:43:03 +0000 (14:43 +0000)
PWG4/JetTasks/AliPWG4HighPtSpectra.cxx
PWG4/JetTasks/AliPWG4HighPtSpectra.h
PWG4/macros/AddTaskPWG4HighPtSpectra.C

index 3a33d96..dab1d9f 100644 (file)
@@ -238,9 +238,12 @@ void AliPWG4HighPtSpectra::Exec(Option_t *)
   fNEventSel->Fill(0.);
   
   
-  Double_t containerInputRec[5] ;
-  Double_t containerInputTPConly[5];
-  Double_t containerInputMC[5];
+  Double_t containerInputRec[3]       = {0.,0.,0.};
+  Double_t containerInputTPConly[3]   = {0.,0.,0.};
+  Double_t containerInputMC[3]        = {0.,0.,0.};
+  Double_t containerInputRecMC[3]     = {0.,0.,0.};
+  Double_t containerInputTPConlyMC[3] = {0.,0.,0.};
+
   //Now go to rec level
   for (Int_t iTrack = 0; iTrack<nTracks; iTrack++) 
     {   
@@ -250,36 +253,43 @@ void AliPWG4HighPtSpectra::Exec(Option_t *)
       AliExternalTrackParam *trackTPC = (AliExternalTrackParam *)track->GetTPCInnerParam();
       if(!track || !trackTPC) continue;
 
-      Float_t dca2D, dcaZ;
-      track->GetImpactParameters(dca2D,dcaZ);
-      Float_t dca2DTPC, dcaZTPC;
-      track->GetImpactParametersTPC(dca2DTPC,dcaZTPC); 
-      Float_t chi2PerClusterTPC = -1.;
-      Float_t nClustersTPC = track->GetTPCNcls();//track->GetTPCclusters(0);
-      if(nClustersTPC>0.) chi2PerClusterTPC = track->GetTPCchi2()/(2.*nClustersTPC-5.);
-      Float_t chi2PerClusterTPCIter1 = -1.;
-      Float_t nClustersTPCIter1 = track->GetTPCNclsIter1();   
-      if(nClustersTPCIter1>0.) chi2PerClusterTPCIter1 = track->GetTPCchi2Iter1()/(2.*nClustersTPCIter1-5.);
-
       //fill the container
       containerInputRec[0] = track->Pt();
       containerInputRec[1] = track->Phi();
       containerInputRec[2] = track->Eta();
-      containerInputRec[3] = dca2D;
-      containerInputRec[4] = chi2PerClusterTPC;
-
+    
       //Store TPC Inner Params for TPConly tracks
       containerInputTPConly[0] = trackTPC->Pt();
       containerInputTPConly[1] = trackTPC->Phi();
       containerInputTPConly[2] = trackTPC->Eta();
-      containerInputTPConly[3] = dca2DTPC/10.; //Divide by 10 in order to store in same container. Should be corrected back when looking at output.
-      containerInputTPConly[4] = chi2PerClusterTPCIter1;//TPC;
 
       AliESDtrack* trackTPCESD = fTrackCutsTPConly->GetTPCOnlyTrack(fESD, iTrack);
       if(trackTPCESD) {
        if (fTrackCutsTPConly->AcceptTrack(trackTPCESD)) {
          if(trackTPC->GetSign()>0.) fCFManagerPos->GetParticleContainer()->Fill(containerInputTPConly,kStepReconstructedTPCOnly);
          if(trackTPC->GetSign()<0.) fCFManagerNeg->GetParticleContainer()->Fill(containerInputTPConly,kStepReconstructedTPCOnly);
+
+         //Only fill the MC containers if MC information is available
+         if(eventHandler) {
+           Int_t label = TMath::Abs(track->GetLabel());
+           TParticle *particle = stack->Particle(label) ;
+           if(!particle) continue;
+           
+           containerInputTPConlyMC[0] = particle->Pt();      
+           containerInputTPConlyMC[1] = particle->Phi();      
+           containerInputTPConlyMC[2] = particle->Eta();  
+           
+           //Container with primaries
+           if(stack->IsPhysicalPrimary(label)) {
+             if(particle->GetPDG()->Charge()>0.) {
+               fCFManagerPos->GetParticleContainer()->Fill(containerInputMC,kStepReconstructedTPCOnlyMC);
+             }
+             if(particle->GetPDG()->Charge()<0.) {
+               fCFManagerNeg->GetParticleContainer()->Fill(containerInputMC,kStepReconstructedTPCOnlyMC);
+             }
+           }
+         }
+         
        }
       }
 
@@ -294,19 +304,17 @@ void AliPWG4HighPtSpectra::Exec(Option_t *)
          TParticle *particle = stack->Particle(label) ;
          if(!particle) continue;
 
-         containerInputMC[0] = particle->Pt();      
-         containerInputMC[1] = particle->Phi();      
-         containerInputMC[2] = particle->Eta();  
-         containerInputMC[3] = 0.0;      
-         containerInputMC[4] = 0.0;  
+         containerInputRecMC[0] = particle->Pt();      
+         containerInputRecMC[1] = particle->Phi();      
+         containerInputRecMC[2] = particle->Eta();  
 
          //Container with primaries
          if(stack->IsPhysicalPrimary(label)) {
            if(particle->GetPDG()->Charge()>0.) {
-             fCFManagerPos->GetParticleContainer()->Fill(containerInputMC,kStepReconstructedMC);
+             fCFManagerPos->GetParticleContainer()->Fill(containerInputRecMC,kStepReconstructedMC);
            }
            if(particle->GetPDG()->Charge()<0.) {
-             fCFManagerNeg->GetParticleContainer()->Fill(containerInputMC,kStepReconstructedMC);
+             fCFManagerNeg->GetParticleContainer()->Fill(containerInputRecMC,kStepReconstructedMC);
            }
          }
 
@@ -337,8 +345,6 @@ void AliPWG4HighPtSpectra::Exec(Option_t *)
        containerInputMC[0] = mcPart->Pt();
        containerInputMC[1] = mcPart->Phi();      
        containerInputMC[2] = mcPart->Eta();  
-       containerInputMC[3] = 0.0;
-       containerInputMC[4] = 0.0;
 
        if(stack->IsPhysicalPrimary(iPart)) {
          if(mcPart->Charge()>0. && fCFManagerPos->CheckParticleCuts(kStepMCAcceptance,mcPart)) fCFManagerPos->GetParticleContainer()->Fill(containerInputMC,kStepMCAcceptance);
index e1c0a90..4c64acc 100644 (file)
@@ -35,11 +35,12 @@ class AliPWG4HighPtSpectra : public AliAnalysisTask {
  public:
 
   enum {
-    kStepReconstructed        = 0,
-    kStepReconstructedTPCOnly = 1,
-    kStepSecondaries          = 2,
-    kStepReconstructedMC      = 3,
-    kStepMCAcceptance         = 4
+    kStepReconstructed          = 0,
+    kStepReconstructedTPCOnly   = 1,
+    kStepSecondaries            = 2,
+    kStepReconstructedMC        = 3,
+    kStepMCAcceptance           = 4,
+    kStepReconstructedTPCOnlyMC = 5
   };
 
   AliPWG4HighPtSpectra();
index e2570fe..27b4493 100644 (file)
@@ -3,10 +3,6 @@ const Float_t phimin = 0.;
 const Float_t phimax = 2.*TMath::Pi();
 const Float_t etamin = -0.9;
 const Float_t etamax = 0.9;
-const Float_t dcarmin = -0.2;
-const Float_t dcarmax = 0.2;
-const Float_t chi2TPCmin = 0.0;
-const Float_t chi2TPCmax = 4.;
 
 const Int_t   mintrackrefsTPC = 1;
 const Int_t   mintrackrefsITS = 1;
@@ -42,16 +38,15 @@ AliPWG4HighPtSpectra* AddTaskPWG4HighPtSpectra(char *prodType = "LHC10e14")
   UInt_t ipt   = 0;
   UInt_t iphi  = 1;
   UInt_t ieta  = 2;
-  UInt_t idcar = 3;
-  UInt_t ichi2TPC = 4;
 
   //Setting up the container grid... 
-  UInt_t nstep = 5; //Steps/Modes for containers
+  UInt_t nstep = 6; //Steps/Modes for containers
   Int_t kStepReconstructed = 0;
   Int_t kStepReconstructedTPCOnly = 1;
   Int_t kStepSecondaries = 2;
   Int_t kStepReconstructedMC = 3;
   Int_t kStepMCAcceptance = 4;
+  Int_t kStepReconstructedTPCOnlyMC = 5;
 
   //redefine pt ranges in case of Jet-Jet production
   Float_t ptBinEdges[2][2];
@@ -78,31 +73,25 @@ AliPWG4HighPtSpectra* AddTaskPWG4HighPtSpectra(char *prodType = "LHC10e14")
     binWidth3 = 5.;
   }
     
-  const Int_t nvar   = 5; //number of variables on the grid: pt:phi:eta:DCAR:Chi2/NClusTPC
+  const Int_t nvar   = 3; //number of variables on the grid: pt:phi:eta
   const Int_t nbin11 = (int)((ptBinEdges[0][0]-ptmin)/ptBinEdges[0][1]);
   const Int_t nbin12 = (int)((ptBinEdges[1][0]-ptBinEdges[0][0])/ptBinEdges[1][1])+nbin11;
   const Int_t nbin13 = (int)((ptmax-ptBinEdges[1][0])/binWidth3)+nbin12;
   const Int_t nbin1  = nbin13; //bins in pt 
   const Int_t nbin2  =  18;//36; //bins in phi
   const Int_t nbin3  =  8; //bins in eta
-  const Int_t nbin4  =  40; //bins in DCAR
-  const Int_t nbin5  =  20; //bins in Chi2/#NclusTPC
 
   //arrays for the number of bins in each dimension
   Int_t iBin[nvar];
   iBin[0]=nbin1;
   iBin[1]=nbin2;
   iBin[2]=nbin3;
-  iBin[3]=nbin4;
-  iBin[4]=nbin5;
-  
+   
   //arrays for lower bounds :
   Double_t *binLim1=new Double_t[nbin1+1];
   Double_t *binLim2=new Double_t[nbin2+1];
   Double_t *binLim3=new Double_t[nbin3+1];
-  Double_t *binLim4=new Double_t[nbin4+1];
-  Double_t *binLim5=new Double_t[nbin5+1];
-
+  
   //values for bin lower bounds 
   for(Int_t i=0; i<=nbin1; i++) {
     if(i<=nbin11) binLim1[i]=(Double_t)ptmin + (ptBinEdges[0][0]-ptmin)/nbin11*(Double_t)i ;  
@@ -111,8 +100,6 @@ AliPWG4HighPtSpectra* AddTaskPWG4HighPtSpectra(char *prodType = "LHC10e14")
   }
   for(Int_t i=0; i<=nbin2; i++) binLim2[i]=(Double_t)phimin + (phimax-phimin)/nbin2*(Double_t)i ;
   for(Int_t i=0; i<=nbin3; i++) binLim3[i]=(Double_t)etamin + (etamax-etamin)/nbin3*(Double_t)i ;  
-  for(Int_t i=0; i<=nbin4; i++) binLim4[i]=(Double_t)dcarmin + (dcarmax-dcarmin)/nbin4*(Double_t)i ;
-  for(Int_t i=0; i<=nbin5; i++) binLim5[i]=(Double_t)chi2TPCmin + (chi2TPCmax-chi2TPCmin)/nbin5*(Double_t)i ;
   
 
   AliCFContainer* containerPos = new AliCFContainer("containerPos","container for positive tracks",nstep,nvar,iBin);
@@ -120,31 +107,27 @@ AliPWG4HighPtSpectra* AddTaskPWG4HighPtSpectra(char *prodType = "LHC10e14")
   containerPos -> SetBinLimits(ipt,binLim1);
   containerPos -> SetBinLimits(iphi,binLim2);
   containerPos -> SetBinLimits(ieta,binLim3);
-  containerPos -> SetBinLimits(idcar,binLim4);
-  containerPos -> SetBinLimits(ichi2TPC,binLim5);
 
   AliCFContainer* containerNeg = new AliCFContainer("containerNeg","container for negative tracks",nstep,nvar,iBin);
   //setting the bin limits
   containerNeg -> SetBinLimits(ipt,binLim1);
   containerNeg -> SetBinLimits(iphi,binLim2);
   containerNeg -> SetBinLimits(ieta,binLim3);
-  containerNeg -> SetBinLimits(idcar,binLim4);
-  containerNeg -> SetBinLimits(ichi2TPC,binLim5);
   
   //CREATE THE  CUTS -----------------------------------------------
   //Use AliESDtrackCuts
   AliESDtrackCuts *trackCuts = new AliESDtrackCuts("AliESDtrackCuts","Standard Cuts");
+  trackCuts = trackCuts->GetStandardITSTPCTrackCuts2009(kTRUE);//Primary Track Quality Selection for Global tracks
   trackCuts->SetEtaRange(-0.9,0.9);
   trackCuts->SetPtRange(0.15, 1e10);
-  trackCuts = trackCuts->GetStandardITSTPCTrackCuts2009(kTRUE);//Primary Track Quality Selection for Global tracks
 
   AliESDtrackCuts *trackCutsTPConly = new AliESDtrackCuts("AliESDtrackCuts","Standard Cuts TPC only tracks");
+  trackCutsTPConly = trackCutsTPConly->GetStandardTPCOnlyTrackCuts();//TPC only Track Quality Cuts
   trackCutsTPConly->SetEtaRange(-0.9,0.9);
   trackCutsTPConly->SetPtRange(0.15, 1e10);
-  trackCutsTPConly = trackCutsTPConly->GetStandardTPCOnlyTrackCuts();//TPC only Track Quality Cuts
-
+  trackCutsTPConly->SetMinNClustersTPC(70);
 
- // Gen-Level kinematic cuts
+  // Gen-Level kinematic cuts
   AliCFTrackKineCuts *mcKineCuts = new AliCFTrackKineCuts("mcKineCuts","MC-level kinematic cuts");
   mcKineCuts->SetPtRange(0.15,1e10);
   mcKineCuts->SetRapidityRange(-0.9,0.9);//-0.5,0.5);
@@ -159,6 +142,7 @@ AliPWG4HighPtSpectra* AddTaskPWG4HighPtSpectra(char *prodType = "LHC10e14")
   TObjArray* recTPConlyList = new TObjArray(0);
   TObjArray* secList = new TObjArray(0) ;
   TObjArray* recMCList = new TObjArray(0);
+  TObjArray* recTPConlyMCList = new TObjArray(0);
 
   printf("CREATE MC KINE CUTS\n");
   TObjArray* mcList = new TObjArray(0) ;
@@ -174,7 +158,7 @@ AliPWG4HighPtSpectra* AddTaskPWG4HighPtSpectra(char *prodType = "LHC10e14")
   manPos->SetParticleCutsList(kStepSecondaries,secList);
   manPos->SetParticleCutsList(kStepReconstructedMC,recMCList);
   manPos->SetParticleCutsList(kStepMCAcceptance,mcList);
-
+  manPos->SetParticleCutsList(kStepReconstructedTPCOnlyMC,recTPConlyMCList);
 
   AliCFManager* manNeg = new AliCFManager("manNeg","Manager for Negative tracks") ;
   manNeg->SetParticleContainer(containerNeg);
@@ -183,7 +167,7 @@ AliPWG4HighPtSpectra* AddTaskPWG4HighPtSpectra(char *prodType = "LHC10e14")
   manNeg->SetParticleCutsList(kStepSecondaries,secList);
   manNeg->SetParticleCutsList(kStepReconstructedMC,recMCList);
   manNeg->SetParticleCutsList(kStepMCAcceptance,mcList);
-
+  manNeg->SetParticleCutsList(kStepReconstructedTPCOnlyMC,recTPConlyMCList);
 
 
   printf("Create task AliPWG4HighPtSpectra\n");