Updating AliRoot version in CreateAlienHandlerCaloEtSim.C, implementing default track...
authorcnattras <cnattras@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 22 Sep 2010 03:06:31 +0000 (03:06 +0000)
committercnattras <cnattras@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 22 Sep 2010 03:06:31 +0000 (03:06 +0000)
PWG4/totEt/AliAnalysisEt.cxx
PWG4/totEt/AliAnalysisEt.h
PWG4/totEt/AliAnalysisEtReconstructed.cxx
PWG4/totEt/AliAnalysisTaskTotEt.cxx
PWG4/totEt/AliAnalysisTaskTotEt.h
PWG4/totEt/macros/CreateAlienHandlerCaloEtSim.C

index b195b7e..0f1422c 100644 (file)
@@ -108,6 +108,7 @@ AliAnalysisEt::AliAnalysisEt() :
         ,fHistEtRecvsEtMC(0)
         ,fHistTMDeltaR(0)
         ,fTree(0)
+        ,fEsdtrackCutsTPC(0)
 {
 }
 
index 9ef82ed..0122253 100644 (file)
@@ -15,6 +15,7 @@ class TH2F;
 class TH1F;
 class AliVEvent;
 class TList;
+class AliESDtrackCuts;
 class Rtypes;
 class TDatabasePDG;
 class AliAnalysisEtCuts;
@@ -76,6 +77,7 @@ public:
     /** Total charged Et in the event within the acceptance cuts */
     Double_t GetTotChargedEtAcc() const { return fTotChargedEtAcc; }
 
+    void SetTPCOnlyTrackCuts(const AliESDtrackCuts *cuts){ fEsdtrackCutsTPC = (AliESDtrackCuts *) cuts;}
 
 protected:
        
@@ -209,6 +211,9 @@ protected:
 
     TTree *fTree; // optional TTree
     
+
+    AliESDtrackCuts* fEsdtrackCutsTPC;//esd track cuts for TPC tracks (which may also contain ITS hits)
+
 private:
     //Declare private to avoid compilation warning
     AliAnalysisEt & operator = (const AliAnalysisEt & g) ;//cpy assignment
index be6437c..e8174fb 100644 (file)
 #include "AliMagF.h"
 #include "AliVEvent.h"
 #include "AliESDEvent.h"
+#include "AliESDtrackCuts.h"
 #include "AliVParticle.h"
 #include "TDatabasePDG.h"
 #include "TList.h"
+#include "AliESDpid.h"
 #include <iostream>
 #include "TH2F.h"
 
@@ -48,9 +50,15 @@ Int_t AliAnalysisEtReconstructed::AnalyseEvent(AliVEvent* ev)
 
     Double_t protonMass = fPdgDB->GetParticle("proton")->Mass();
 
-    for (Int_t iTrack = 0; iTrack < event->GetNumberOfTracks(); iTrack++)
-    {
-        AliVParticle *track = event->GetTrack(iTrack);
+    AliESDEvent *realEvent = dynamic_cast<AliESDEvent*>(ev);
+    //for PID
+    AliESDpid *pID = new AliESDpid();
+    pID->MakePID(realEvent);
+    TObjArray* list = fEsdtrackCutsTPC->GetAcceptedTracks(realEvent);
+    Int_t nGoodTracks = list->GetEntries();
+    for (Int_t iTrack = 0; iTrack < nGoodTracks; iTrack++)
+      {
+       AliESDtrack *track = dynamic_cast<AliESDtrack*> (list->At(iTrack));
         if (!track)
         {
             Printf("ERROR: Could not get track %d", iTrack);
@@ -59,6 +67,18 @@ Int_t AliAnalysisEtReconstructed::AnalyseEvent(AliVEvent* ev)
 
         fMultiplicity++;
 
+
+       Float_t nSigmaPion,nSigmaProton,nSigmaKaon,nSigmaElectron;
+       nSigmaPion = TMath::Abs(pID->NumberOfSigmasTPC(track,AliPID::kPion));
+       nSigmaProton = TMath::Abs(pID->NumberOfSigmasTPC(track,AliPID::kProton));
+       nSigmaKaon = TMath::Abs(pID->NumberOfSigmasTPC(track,AliPID::kKaon));
+       nSigmaElectron = TMath::Abs(pID->NumberOfSigmasTPC(track,AliPID::kElectron));
+       bool isPion = (nSigmaPion<3.0 && nSigmaProton>2.0 && nSigmaKaon>2.0);
+       bool isElectron = (nSigmaElectron<2.0 && nSigmaPion>4.0 && nSigmaProton>3.0 && nSigmaKaon>3.0);
+       bool isKaon = (nSigmaPion>3.0 && nSigmaProton>2.0 && nSigmaKaon<2.0);
+       bool isProton = (nSigmaPion>3.0 && nSigmaProton<2.0 && nSigmaKaon>2.0);
+
+
         Int_t nItsClusters = dynamic_cast<AliESDtrack*>(track)->GetNcls(0);
         Int_t nTPCClusters = dynamic_cast<AliESDtrack*>(track)->GetNcls(1);
 
index 66700e3..a806544 100644 (file)
@@ -13,6 +13,7 @@
 
 #include "AliESDEvent.h"
 #include "AliMCEvent.h"
+#include "AliESDtrackCuts.h"
 
 #include "AliAnalysisTaskTotEt.h"
 #include "AliAnalysisEtReconstructedPhos.h"
@@ -33,6 +34,7 @@ AliAnalysisTaskTotEt::AliAnalysisTaskTotEt(const char *name) :
         ,fRecAnalysis(0)
         ,fMCAnalysis(0)
         ,fHistEtRecvsEtMC(0)
+        ,fEsdtrackCutsTPC(0)
 {
     // Constructor
 
@@ -74,6 +76,19 @@ void AliAnalysisTaskTotEt::UserCreateOutputObjects()
     fMCAnalysis->FillOutputList(fOutputList);
     fHistEtRecvsEtMC = new TH2F("fHistEtRecvsEtMC", "Reconstructed E_{t} vs MC E_{t}", 1000, 0.000, 100, 1000, 0.0001, 100);
     fOutputList->Add(fHistEtRecvsEtMC);
+
+
+    fEsdtrackCutsTPC = AliESDtrackCuts::GetStandardTPCOnlyTrackCuts();
+    fEsdtrackCutsTPC->SetName("fEsdTrackCutsTPCOnly");
+    fOutputList->Add(fEsdtrackCutsTPC);
+    if(fEsdtrackCutsTPC){
+      fRecAnalysis->SetTPCOnlyTrackCuts( GetTPCOnlyTrackCuts());
+      fMCAnalysis->SetTPCOnlyTrackCuts( GetTPCOnlyTrackCuts());
+    }
+    else{
+      Printf("Error: no track cuts!");
+    }
+
 }
 
 //________________________________________________________________________
index b841f00..6261c5a 100644 (file)
@@ -10,6 +10,7 @@
 \r
 class AliAnalysisEtReconstructed;\r
 class AliAnalysisEtMonteCarlo;\r
+class AliESDtrackCuts;\r
 class TH2F;\r
 class TList;\r
 \r
@@ -28,6 +29,8 @@ public:
   virtual void   UserExec(Option_t *option);\r
   virtual void   Terminate(Option_t *);\r
     \r
+  AliESDtrackCuts* GetTPCOnlyTrackCuts(){return (AliESDtrackCuts*) fOutputList->FindObject("fEsdTrackCutsTPCOnly");}\r
+\r
 private:\r
   \r
   //Declare private to avoid compilation warning\r
@@ -41,6 +44,7 @@ private:
   \r
   TH2F *fHistEtRecvsEtMC; // Rec vs MC histo\r
 \r
+  AliESDtrackCuts* fEsdtrackCutsTPC; // track cuts TPC\r
   \r
   ClassDef(AliAnalysisTaskTotEt, 1); // example of analysis\r
 };\r
index 2c1bf96..36c5717 100644 (file)
@@ -16,7 +16,7 @@ AliAnalysisGrid* CreateAlienHandlerCaloEtSim(TString outputDir, TString outputNa
   // Set versions of used packages
   plugin->SetAPIVersion("V1.1x");
   plugin->SetROOTVersion("v5-27-05");
-  plugin->SetAliROOTVersion("v4-20-08-AN");
+  plugin->SetAliROOTVersion("v4-20-09-AN-build1");
   // Declare input data to be processed.
 
   // Method 1: Create automatically XML collections using alien 'find' command.