rebinning added as data mamber - setters for vertex and multiplicity cuts
authorlmilano <lmilano@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 21 Jun 2012 08:59:20 +0000 (08:59 +0000)
committerlmilano <lmilano@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 21 Jun 2012 08:59:20 +0000 (08:59 +0000)
PWGLF/SPECTRA/PiKaPr/TestAOD/AddTaskSpectraAOD.C
PWGLF/SPECTRA/PiKaPr/TestAOD/AliAnalysisTaskSpectraAOD.cxx
PWGLF/SPECTRA/PiKaPr/TestAOD/AliAnalysisTaskSpectraAOD.h
PWGLF/SPECTRA/PiKaPr/TestAOD/AliSpectraAODEventCuts.cxx
PWGLF/SPECTRA/PiKaPr/TestAOD/AliSpectraAODEventCuts.h
PWGLF/SPECTRA/PiKaPr/TestAOD/AliSpectraAODHistoManager.cxx
PWGLF/SPECTRA/PiKaPr/TestAOD/AliSpectraAODHistoManager.h
PWGLF/SPECTRA/PiKaPr/TestAOD/runAODProof.C
PWGLF/SPECTRA/PiKaPr/TestAOD/runGrid.C

index 6d2bed0..fbfa21e 100644 (file)
@@ -1,4 +1,4 @@
-AliAnalysisTaskSpectraAOD* AddTaskSpectraAOD(Bool_t mc=kTRUE,\r
+AliAnalysisTaskSpectraAOD* AddTaskSpectraAOD(Bool_t mc=kFALSE,\r
                                             Double_t CentCutMin=0,\r
                                             Double_t CentCutMax=100,\r
                                             Double_t QvecCutMin=0,\r
@@ -14,8 +14,9 @@ AliAnalysisTaskSpectraAOD* AddTaskSpectraAOD(Bool_t mc=kTRUE,
                                             UInt_t trkbitQVector=1,\r
                                             Bool_t UseCentPatchAOD049=kFALSE,\r
                                             Double_t DCA=100000,\r
-                                            UInt_t minNclsTPC=70\r
-                                            ){\r
+                                            UInt_t minNclsTPC=70,\r
+                                            Int_t nrebin=0,\r
+                                            TString opt=""){\r
   \r
   AliAnalysisManager *mgr = AliAnalysisManager::GetAnalysisManager();\r
   if (!mgr) \r
@@ -63,7 +64,7 @@ AliAnalysisTaskSpectraAOD* AddTaskSpectraAOD(Bool_t mc=kTRUE,
   if(mc==1)evcuts->SetIsMC(kTRUE);\r
   evcuts->PrintCuts();\r
   \r
-  AliAnalysisTaskSpectraAOD *task = new AliAnalysisTaskSpectraAOD(Form("TaskAODSpectraCent%.0fto%.0f_QVec%.1fto%.1f_Eta%.1fto%.1f_%.1fSigmaPID_TrBit%d",       \r
+  AliAnalysisTaskSpectraAOD *task = new AliAnalysisTaskSpectraAOD(Form("TaskAODSpectraCent%.0fto%.0f_QVec%.1fto%.1f_Eta%.1fto%.1f_%.1fSigmaPID_TrBit%d%s",     \r
                                                                       CentCutMin,\r
                                                                       CentCutMax,\r
                                                                       QvecCutMin,\r
@@ -71,31 +72,32 @@ AliAnalysisTaskSpectraAOD* AddTaskSpectraAOD(Bool_t mc=kTRUE,
                                                                       EtaMin,\r
                                                                       EtaMax,\r
                                                                       Nsigmapid,\r
-                                                                      trkbit));\r
+                                                                      trkbit,\r
+                                                                      opt.Data()));\r
   task->SetPID(pid);  \r
   task->SetEventCuts(evcuts);\r
   task->SetTrackCuts(trcuts);\r
+  task->SetNRebin(nrebin);\r
   if(mc==1)task->SetIsMC(kTRUE);\r
   \r
   TString outputFileName = AliAnalysisManager::GetCommonFileName();\r
   \r
   TString typeofdata=mc?"MC":"Data";\r
   \r
-  outputFileName += Form(":OutputAODSpectraTask_%s_Cent%.0fto%.0f_QVec%.1fto%.1f_Eta%.1fto%.1f_%.1fSigmaPID_TrBit%d.root",typeofdata.Data(),evcuts->GetCentralityMin(),evcuts->GetCentralityMax(),evcuts->GetQVectorCutMin(), evcuts->GetQVectorCutMax(),trcuts->GetEtaMin(),trcuts->GetEtaMax(),pid->GetNSigmaCut(),trcuts->GetTrackType());\r
+  outputFileName += Form(":OutputAODSpectraTask_%s_Cent%.0fto%.0f_QVec%.1fto%.1f_Eta%.1fto%.1f_%.1fSigmaPID_TrBit%d%s",typeofdata.Data(),evcuts->GetCentralityMin(),evcuts->GetCentralityMax(),evcuts->GetQVectorCutMin(), evcuts->GetQVectorCutMax(),trcuts->GetEtaMin(),trcuts->GetEtaMax(),pid->GetNSigmaCut(),trcuts->GetTrackType(),opt.Data());\r
   \r
   cout<<"outputFileName:  "<<outputFileName<<endl;\r
   AliAnalysisDataContainer *cinput = mgr->GetCommonInputContainer();      \r
   AliAnalysisDataContainer *coutputpt1 = mgr->CreateContainer("chistpt", AliSpectraAODHistoManager::Class(),  AliAnalysisManager::kOutputContainer,outputFileName);\r
   AliAnalysisDataContainer *coutputpt2 = mgr->CreateContainer("cvcutpt", AliSpectraAODEventCuts::Class(),    AliAnalysisManager::kOutputContainer,outputFileName);\r
-  AliAnalysisDataContainer *coutputpt3 = mgr->CreateContainer("ctcutpt%d", AliSpectraAODTrackCuts::Class(),     AliAnalysisManager::kOutputContainer, outputFileName);\r
-  AliAnalysisDataContainer *coutputpt4 = mgr->CreateContainer("cpidpt%d",  AliSpectraAODPID::Class(),     AliAnalysisManager::kOutputContainer,outputFileName);\r
+  AliAnalysisDataContainer *coutputpt3 = mgr->CreateContainer("ctcutpt", AliSpectraAODTrackCuts::Class(),     AliAnalysisManager::kOutputContainer, outputFileName);\r
+  AliAnalysisDataContainer *coutputpt4 = mgr->CreateContainer("cpidpt",  AliSpectraAODPID::Class(),     AliAnalysisManager::kOutputContainer,outputFileName);\r
   \r
   mgr->ConnectInput(task, 0, cinput);\r
   mgr->ConnectOutput(task, 1, coutputpt1);\r
   mgr->ConnectOutput(task, 2, coutputpt2);\r
   mgr->ConnectOutput(task, 3, coutputpt3);\r
   mgr->ConnectOutput(task, 4, coutputpt4);\r
-  //return task;\r
   \r
   mgr->AddTask(task);\r
   return task;\r
index 337c6a4..6d67259 100644 (file)
@@ -56,23 +56,24 @@ using namespace std;
 ClassImp(AliAnalysisTaskSpectraAOD) // EX1 This stuff tells root to implement the streamer, inspector methods etc (we discussed about it today)\r
 \r
 //________________________________________________________________________\r
-AliAnalysisTaskSpectraAOD::AliAnalysisTaskSpectraAOD(const char *name) : AliAnalysisTaskSE(name), fAOD(0), fHistMan(0), fTrackCuts(0), fEventCuts(0),  fPID(0), fIsMC(0)\r
+AliAnalysisTaskSpectraAOD::AliAnalysisTaskSpectraAOD(const char *name) : AliAnalysisTaskSE(name), fAOD(0), fHistMan(0), fTrackCuts(0), fEventCuts(0),  fPID(0), fIsMC(0), fNRebin(0)\r
 {\r
   // Default constructor\r
-\r
+  \r
   DefineInput(0, TChain::Class());\r
   DefineOutput(1, AliSpectraAODHistoManager::Class());\r
   DefineOutput(2, AliSpectraAODEventCuts::Class());\r
   DefineOutput(3, AliSpectraAODTrackCuts::Class());\r
   DefineOutput(4, AliSpectraAODPID::Class());\r
-\r
+  fNRebin=0;\r
+  \r
 }\r
 //________________________________________________________________________\r
 //________________________________________________________________________\r
 void AliAnalysisTaskSpectraAOD::UserCreateOutputObjects()\r
 {\r
   // create output objects\r
-  fHistMan = new AliSpectraAODHistoManager("SpectraHistos");\r
+  fHistMan = new AliSpectraAODHistoManager("SpectraHistos",fNRebin);\r
 \r
   if (!fTrackCuts) AliFatal("Track Cuts should be set in the steering macro");\r
   if (!fEventCuts) AliFatal("Event Cuts should be set in the steering macro");\r
index 21380cd..8d7c91b 100644 (file)
@@ -28,9 +28,9 @@ class AliAnalysisTaskSpectraAOD : public AliAnalysisTaskSE
 public:\r
 \r
    // constructors\r
-  AliAnalysisTaskSpectraAOD() : AliAnalysisTaskSE(), fAOD(0), fHistMan(0), fTrackCuts(0), fEventCuts(0), fPID(0), fIsMC(0)\r
+  AliAnalysisTaskSpectraAOD() : AliAnalysisTaskSE(), fAOD(0), fHistMan(0), fTrackCuts(0), fEventCuts(0), fPID(0), fIsMC(0), fNRebin(0)\r
  {}\r
-   AliAnalysisTaskSpectraAOD(const char *name);\r
+  AliAnalysisTaskSpectraAOD(const char *name);\r
    virtual ~AliAnalysisTaskSpectraAOD() {}\r
 \r
    void SetIsMC(Bool_t isMC = kFALSE)    {fIsMC = isMC; };\r
@@ -48,6 +48,8 @@ public:
    void SetTrackCuts(AliSpectraAODTrackCuts * tc)   {   fTrackCuts = tc;   }\r
    void SetEventCuts(AliSpectraAODEventCuts * vc)   {   fEventCuts = vc;   }\r
    void SetPID      (AliSpectraAODPID      * pid)   {   fPID       = pid;  }\r
+   void SetNRebin(Int_t nreb){fNRebin=nreb;}\r
+   Int_t   GetNRebin() {return fNRebin;}\r
 \r
 private:\r
 \r
@@ -57,6 +59,7 @@ private:
    AliSpectraAODEventCuts      * fEventCuts;     // Event Cuts\r
    AliSpectraAODPID             * fPID;// PID class\r
    Bool_t          fIsMC;// true if processing MC\r
+   Int_t      fNRebin; //rebin of histos\r
    AliAnalysisTaskSpectraAOD(const AliAnalysisTaskSpectraAOD&);\r
    AliAnalysisTaskSpectraAOD& operator=(const AliAnalysisTaskSpectraAOD&);\r
 \r
index 3bb29d7..b251045 100644 (file)
@@ -42,7 +42,7 @@ using namespace std;
 
 ClassImp(AliSpectraAODEventCuts)
 
-AliSpectraAODEventCuts::AliSpectraAODEventCuts(const char *name) : TNamed(name, "AOD Event Cuts"), fAOD(0), fTrackBits(0),fIsMC(0), fIsSelected(0), fCentralityCutMin(0), fCentralityCutMax(0), fQVectorCutMin(0), fQVectorCutMax(0), fHistoCuts(0),fHistoVtxBefSel(0),fHistoVtxAftSel(0),fHistoEtaBefSel(0),fHistoEtaAftSel(0),fHistoNChAftSel(0),fHistoQVector(0)
+AliSpectraAODEventCuts::AliSpectraAODEventCuts(const char *name) : TNamed(name, "AOD Event Cuts"), fAOD(0), fTrackBits(0),fIsMC(0), fIsSelected(0), fCentralityCutMin(0), fCentralityCutMax(0), fQVectorCutMin(0), fQVectorCutMax(0), fVertexCutMin(0), fVertexCutMax(0), fMultiplicityCutMin(0), fMultiplicityCutMax(0), fHistoCuts(0),fHistoVtxBefSel(0),fHistoVtxAftSel(0),fHistoEtaBefSel(0),fHistoEtaAftSel(0),fHistoNChAftSel(0),fHistoQVector(0)
 ,fHistoEP(0)
 {
   // Constructor
@@ -64,6 +64,10 @@ AliSpectraAODEventCuts::AliSpectraAODEventCuts(const char *name) : TNamed(name,
   // fQVectorNegCutMax=10000.0;
   fQVectorCutMin=0.0;
   fQVectorCutMax=10000.0;
+  fVertexCutMin=-10.0;
+  fVertexCutMax=10.0;
+  fMultiplicityCutMin=-0.0;
+  fMultiplicityCutMax=10000.0;
   fTrackBits=1;
 }
 
@@ -81,7 +85,7 @@ Bool_t AliSpectraAODEventCuts::IsSelected(AliAODEvent * aod,AliSpectraAODTrackCu
   AliAODVertex * vertex = fAOD->GetPrimaryVertex();//FIXME vertex is recreated
   if(vertex)fHistoVtxBefSel->Fill(vertex->GetZ());
   fIsSelected =kFALSE;
-  if(CheckVtxRange() && CheckCentralityCut()){ //selection on vertex and Centrality
+  if(CheckVtxRange() && CheckCentralityCut() && CheckMultiplicityCut()){ //selection on vertex and Centrality
     fIsSelected=CheckQVectorCut(); // QVector is calculated only if the centrality and vertex are correct (performance)
   }
   if(fIsSelected){
@@ -98,6 +102,7 @@ Bool_t AliSpectraAODEventCuts::IsSelected(AliAODEvent * aod,AliSpectraAODTrackCu
       Nch++;
     }
   }
+  Printf("NCHARGED_EvSel : %d",Nch);
   if(fIsSelected)fHistoNChAftSel->Fill(Nch);
   return fIsSelected;
 }
@@ -112,7 +117,7 @@ Bool_t AliSpectraAODEventCuts::CheckVtxRange()
       fHistoCuts->Fill(kVtxNoEvent);
       return kFALSE;
     }
-  if (TMath::Abs(vertex->GetZ()) < 10)
+  if (vertex->GetZ() > fVertexCutMin && vertex->GetZ() < fVertexCutMax)
     {
       return kTRUE;
     }
@@ -134,6 +139,22 @@ Bool_t AliSpectraAODEventCuts::CheckCentralityCut()
 }
 
 //______________________________________________________
+Bool_t AliSpectraAODEventCuts::CheckMultiplicityCut()
+{
+  // Check multiplicity cut
+  Int_t Ncharged=0;
+  for (Int_t iTracks = 0; iTracks < fAOD->GetNumberOfTracks(); iTracks++){
+    AliAODTrack* track = fAOD->GetTrack(iTracks);
+    if (!fTrackCuts->IsSelected(track,kFALSE)) continue;
+    Ncharged++;
+  }
+  Printf("NCHARGED_cut : %d",Ncharged);
+  if(Ncharged>fMultiplicityCutMin && Ncharged<fMultiplicityCutMax)return kTRUE;
+  
+  return kFALSE;
+}
+
+//______________________________________________________
 Bool_t AliSpectraAODEventCuts::CheckQVectorCut()
 {
   // Check qvector cut
@@ -195,6 +216,8 @@ void AliSpectraAODEventCuts::PrintCuts()
   // cout << " > QPosRange: [" << fQVectorPosCutMin <<"," <<fQVectorPosCutMax<<"]"<< endl;
   // cout << " > QNegRange: [" << fQVectorNegCutMin <<"," <<fQVectorNegCutMax<<"]"<< endl;
   cout << " > QRange: [" << fQVectorCutMin <<"," <<fQVectorCutMax<<"]"<< endl;
+  cout << " > Vertex: [" << fVertexCutMin <<"," <<fVertexCutMax<<"]"<< endl;
+  cout << " > Multiplicity: [" << fMultiplicityCutMin <<"," <<fMultiplicityCutMax<<"]"<< endl;
   cout << " > Centrality: [" << fCentralityCutMin <<"," <<fCentralityCutMax<<"]"<< endl;
 }
 //______________________________________________________
index edee76f..964402e 100644 (file)
@@ -25,7 +25,7 @@ class AliSpectraAODEventCuts : public TNamed
   enum {  kProcessedEvents = 0,kPhysSelEvents,kAcceptedEvents, kVtxRange, kVtxCentral, kVtxNoEvent, kQVector, kNVtxCuts};
 
   // Constructors
- AliSpectraAODEventCuts() : TNamed(), fAOD(0), fTrackBits(0), fIsMC(0), fUseCentPatchAOD049(0), fIsSelected(0), fCentralityCutMin(0), fCentralityCutMax(0), fQVectorCutMin(0), fQVectorCutMax(0), fHistoCuts(0),fHistoVtxBefSel(0),fHistoVtxAftSel(0),fHistoEtaBefSel(0),fHistoEtaAftSel(0),fHistoNChAftSel(0),fHistoQVector(0),fHistoEP(0) {}
+ AliSpectraAODEventCuts() : TNamed(), fAOD(0), fTrackBits(0), fIsMC(0), fUseCentPatchAOD049(0), fIsSelected(0), fCentralityCutMin(0), fCentralityCutMax(0), fQVectorCutMin(0), fQVectorCutMax(0), fVertexCutMin(0), fVertexCutMax(0), fMultiplicityCutMin(0), fMultiplicityCutMax(0), fHistoCuts(0),fHistoVtxBefSel(0),fHistoVtxAftSel(0),fHistoEtaBefSel(0),fHistoEtaAftSel(0),fHistoNChAftSel(0),fHistoQVector(0),fHistoEP(0) {}
   AliSpectraAODEventCuts(const char *name);
   virtual  ~AliSpectraAODEventCuts() {}
   
@@ -39,15 +39,17 @@ class AliSpectraAODEventCuts : public TNamed
   Bool_t IsSelected(AliAODEvent * aod,AliSpectraAODTrackCuts     *trackcuts);
   Bool_t CheckVtxRange();
   Bool_t CheckCentralityCut();
+  Bool_t CheckMultiplicityCut();
   Bool_t CheckQVectorCut();
   void  SetCentralityCutMin(Float_t cut)  { fCentralityCutMin = cut; }
   void  SetCentralityCutMax(Float_t cut)  { fCentralityCutMax = cut; }
   //void  SetQVectorPosCut(Float_t min,Float_t max)  { fQVectorPosCutMin = min; fQVectorPosCutMax = max; }
   //void  SetQVectorNegCut(Float_t min,Float_t max)  { fQVectorNegCutMin = min; fQVectorNegCutMax = max; }
   void  SetQVectorCut(Float_t min,Float_t max)  { fQVectorCutMin = min; fQVectorCutMax = max; }
+  void  SetVertexCut(Float_t min,Float_t max)  { fVertexCutMin = min; fVertexCutMax = max; }
+  void  SetMultiplicityCut(Float_t min,Float_t max)  { fMultiplicityCutMin = min; fMultiplicityCutMax = max; }
   void SetTrackBits(UInt_t TrackBits) {fTrackBits=TrackBits;}
 
-
   UInt_t GetTrackType()  const    { return fTrackBits;}
   TH1I * GetHistoCuts()         {  return fHistoCuts; }
   TH1F * GetHistoVtxBefSel()         {  return fHistoVtxBefSel; }
@@ -67,6 +69,10 @@ class AliSpectraAODEventCuts : public TNamed
   //Float_t  GetQVectorNegCutMax()  const {  return fQVectorNegCutMax; }
   Float_t  GetQVectorCutMin()  const {  return fQVectorCutMin; }
   Float_t  GetQVectorCutMax()  const {  return fQVectorCutMax; }
+  Float_t  GetVertexCutMin()  const {  return fVertexCutMin; }
+  Float_t  GetVertexCutMax()  const {  return fVertexCutMax; }
+  Float_t  GetMultiplicityCutMin()  const {  return fMultiplicityCutMin; }
+  Float_t  GetMultiplicityCutMax()  const {  return fMultiplicityCutMax; }
   void   PrintCuts();
   Double_t ApplyCentralityPatchAOD049();
 
@@ -93,6 +99,10 @@ class AliSpectraAODEventCuts : public TNamed
   /* Float_t         fQVectorNegCutMax;     // maximum qvecNeg */
   Float_t         fQVectorCutMin;     // minimum qvecPos
   Float_t         fQVectorCutMax;     // maximum qvecPos
+  Float_t         fVertexCutMin;     // minimum vertex position
+  Float_t         fVertexCutMax;     // maximum vertex position
+  Float_t         fMultiplicityCutMin;     // minimum multiplicity position
+  Float_t         fMultiplicityCutMax;     // maximum multiplicity position
   TH1I            *fHistoCuts;        // Cuts statistics
   TH1F            *fHistoVtxBefSel;        // Vtx distr before event selection
   TH1F            *fHistoVtxAftSel;        // Vtx distr after event selection
index 0f8fff0..43309d7 100644 (file)
@@ -46,92 +46,97 @@ using namespace AliSpectraNameSpace;
 #include "HistogramNames.cxx" // generate this automatically running createNames.py 
 
 const char * kParticleSpecies[] =
-   {
-       "PionPlus",
-       "KaonPlus",
-       "ProtonPlus",
-       "PionMinus",
-       "KaonMinus",
-       "ProtonMinus",
-   };
+  {
+    "PionPlus",
+    "KaonPlus",
+    "ProtonPlus",
+    "PionMinus",
+    "KaonMinus",
+    "ProtonMinus",
+  };
 
 
-AliSpectraAODHistoManager::AliSpectraAODHistoManager(const char *name): TNamed(name, "AOD Spectra Histo Manager"), fOutputList(0)
+AliSpectraAODHistoManager::AliSpectraAODHistoManager(const char *name,Int_t nrebin): TNamed(name, "AOD Spectra Histo Manager"), fOutputList(0), fNRebin(0)
 {
   // ctor
-   fOutputList = new TList;
-   fOutputList->SetOwner();
-   Bool_t oldStatus = TH1::AddDirectoryStatus();
-   TH1::AddDirectory(kFALSE);
-   for (Int_t ihist  = 0; ihist < kNHist ; ihist++)
-   {
+  fNRebin=nrebin;
+  fOutputList = new TList;
+  fOutputList->SetOwner();
+  Bool_t oldStatus = TH1::AddDirectoryStatus();
+  TH1::AddDirectory(kFALSE);
+  for (Int_t ihist  = 0; ihist < kNHist ; ihist++)
+    {
       if (ihist <= kNPtGenHist) BookPtGenHistogram(kHistName[ihist]);  // PT histos
       if (ihist > kNPtGenHist && ihist <= kNPtRecHist) BookPtRecHistogram(kHistName[ihist]);  // PT histos
       if (ihist > kNPtRecHist && ihist <= kNHistPID) BookPIDHistogram(kHistName[ihist]);  // PID histos
       if (ihist > kNHistPID && ihist <= kNHistNSig) BookNSigHistogram(kHistName[ihist]);  // NSigmaSep histos
       if (ihist > kNHistNSig) BookqVecHistogram(kHistName[ihist]);  // qDistr histos
-   }
+    }
    
-   TH1::AddDirectory(oldStatus);
-
+  TH1::AddDirectory(oldStatus);
 }
 
 //_______________________________________________________
 
 TH2F* AliSpectraAODHistoManager::BookPtGenHistogram(const char * name)
 {
-   // Return a pt histogram with predefined binning, set the ID and add it to the output list
-   AliInfo(Form("Booking pt histogram %s", name));
+  // Return a pt histogram with predefined binning, set the ID and add it to the output list
+  AliInfo(Form("Booking pt gen histogram %s", name));
    
-   //standard histo
-   const Double_t templBins[] = {0.05,0.1,0.12,0.14,0.16,0.18,0.20,0.25,0.30,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.1,2.2,2.3,2.4,2.5,2.6,2.7,2.8,2.9,3.0,3.2,3.4,3.6,3.8,4.0,4.2,4.4,4.6,4.8,5.0};
-   Int_t nbinsTempl=52;
+  //standard histo
+  const Double_t templBins[] = {0.05,0.1,0.12,0.14,0.16,0.18,0.20,0.25,0.30,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.1,2.2,2.3,2.4,2.5,2.6,2.7,2.8,2.9,3.0,3.2,3.4,3.6,3.8,4.0,4.2,4.4,4.6,4.8,5.0};
+  Int_t nbinsTempl=52;
    
-   TH2F * hist = new TH2F(name,Form("P_{T} distribution (%s)", name),nbinsTempl,templBins,2,-0.5,1.5);//need to be at least 1 becuase the generated are filled with (pt,IsPhysPrim)
-   hist->GetXaxis()->SetTitle("generated P_{T} (GeV / c)");
-   hist->GetYaxis()->SetTitle("IsPhysicalPrimary()");
-   hist->SetMarkerStyle(kFullCircle);
-   hist->Sumw2();
-   fOutputList->Add(hist);
+  TH2F * hist = new TH2F(name,Form("P_{T} distribution (%s)", name),nbinsTempl,templBins,2,-0.5,1.5);//need to be at least 1 becuase the generated are filled with (pt,IsPhysPrim)
+  hist->GetXaxis()->SetTitle("generated P_{T} (GeV / c)");
+  hist->GetYaxis()->SetTitle("IsPhysicalPrimary()");
+  hist->SetMarkerStyle(kFullCircle);
+  hist->Sumw2();
+  fOutputList->Add(hist);
    
-   return hist;
+  return hist;
 }
 
 
 //_______________________________________________________
 TH2F* AliSpectraAODHistoManager::BookPtRecHistogram(const char * name)
 {
-   // Return a pt histogram with predefined binning, set the ID and add it to the output list
-   AliInfo(Form("Booking pt histogram %s", name));
+  // Return a pt histogram with predefined binning, set the ID and add it to the output list
+  AliInfo(Form("Booking pt rec histogram %s,  rebin:%d", name, fNRebin));
    
-   //standard histo
-   const Double_t templBins[] = {0.05,0.1,0.12,0.14,0.16,0.18,0.20,0.25,0.30,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.1,2.2,2.3,2.4,2.5,2.6,2.7,2.8,2.9,3.0,3.2,3.4,3.6,3.8,4.0,4.2,4.4,4.6,4.8,5.0};
-   Int_t nbinsTempl=52;
+  //standard histo
+  const Double_t templBins[] = {0.05,0.1,0.12,0.14,0.16,0.18,0.20,0.25,0.30,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.1,2.2,2.3,2.4,2.5,2.6,2.7,2.8,2.9,3.0,3.2,3.4,3.6,3.8,4.0,4.2,4.4,4.6,4.8,5.0};
+  Int_t nbinsTempl=52;
    
-   TH2F * hist = new TH2F(name,Form("reconstructed P_{T} distribution (%s)", name),nbinsTempl,templBins,500,-3,3);//need to be at least 1 becuase the generated are filled with (pt,IsPhysPrim)
-   hist->GetXaxis()->SetTitle("P_{T} (GeV / c)");
-   hist->GetYaxis()->SetTitle("DCA xy");
-   hist->SetMarkerStyle(kFullCircle);
-   hist->Sumw2();
-   fOutputList->Add(hist);
-
-   return hist;
+  TH2F * hist = new TH2F(name,Form("reconstructed P_{T} distribution (%s)", name),nbinsTempl,templBins,3000,-3,3);//need to be at least 1 becuase the generated are filled with (pt,IsPhysPrim)
+  if(fNRebin!=0)hist->RebinY(fNRebin);
+  hist->GetXaxis()->SetTitle("P_{T} (GeV / c)");
+  hist->GetYaxis()->SetTitle("DCA xy");
+  hist->SetMarkerStyle(kFullCircle);
+  hist->Sumw2();
+  fOutputList->Add(hist);
+
+  return hist;
 }
 
 //_____________________________________________________________________________
 
 TH2F* AliSpectraAODHistoManager::BookPIDHistogram(const char * name)
 {
-   // Return a pt histogram with predefined binning, set the ID and add it to the output list
-   AliInfo(Form("Booking PID histogram %s", name));
+  // Return a pt histogram with predefined binning, set the ID and add it to the output list
+  AliInfo(Form("Booking PID histogram %s, rebin:%d", name, fNRebin));
 
-   TH2F * hist = new TH2F(name, Form("Particle Identification (%s)", name), 100, 0, 2.5, 200, -1000, 1000);
-   hist->GetXaxis()->SetTitle("(GeV / c)");
-   hist->GetYaxis()->SetTitle("PID signal");
-//  hist->Sumw2();
-   fOutputList->Add(hist);
+  TH2F * hist = new TH2F(name, Form("Particle Identification (%s)", name), 1000, 0, 2.5, 2000, -1000, 1000);
+  if(fNRebin!=0){
+    hist->RebinY(fNRebin);
+    hist->RebinX(fNRebin);
+  }
+  hist->GetXaxis()->SetTitle("(GeV / c)");
+  hist->GetYaxis()->SetTitle("PID signal");
+  //  hist->Sumw2();
+  fOutputList->Add(hist);
 
-   return hist;
+  return hist;
 }
 
 //_____________________________________________________________________________
@@ -139,9 +144,13 @@ TH2F* AliSpectraAODHistoManager::BookPIDHistogram(const char * name)
 TH2F* AliSpectraAODHistoManager::BookNSigHistogram(const char * name)
 {
   // Return a pt histogram with predefined binning, set the ID and add it to the output list
-  AliInfo(Form("Booking NSigma histogram %s", name));
+  AliInfo(Form("Booking NSigma histogram %s, rebin:%d", name, fNRebin));
   
-  TH2F * hist = new TH2F(name, Form("Particle Identification (%s)", name), 100, 0, 2.5, 200,-40, 40);
+  TH2F * hist = new TH2F(name, Form("Particle Identification (%s)", name), 1000, 0, 2.5, 2000,-40, 40);
+  if(fNRebin!=0){
+    hist->RebinY(fNRebin);
+    hist->RebinX(fNRebin);
+  }
   hist->GetXaxis()->SetTitle("P (GeV / c)");
   hist->GetYaxis()->SetTitle("TPC");
   //hist->Sumw2();
index 1d3565b..0314fb5 100644 (file)
@@ -67,8 +67,8 @@ using namespace AliSpectraNameSpace;
 class AliSpectraAODHistoManager : public TNamed
 {
 public:
-   AliSpectraAODHistoManager() :  TNamed(), fOutputList(0) {}
-   AliSpectraAODHistoManager(const char *name);
+   AliSpectraAODHistoManager() :  TNamed(), fOutputList(0), fNRebin(0) {}
+  AliSpectraAODHistoManager(const char *name,Int_t nrebin);
    virtual  ~AliSpectraAODHistoManager() {}
 
 
@@ -100,13 +100,15 @@ public:
    //TH2F*   GetTH2F(UInt_t id)            {      return (TH2F*) GetPIDHistogram(id);   }
 
   TList * GetOutputList() {return fOutputList;}
+  void    SetNRebin(Int_t nreb){fNRebin=nreb;}
+  Int_t   GetNRebin() {return fNRebin;}
 
   Long64_t Merge(TCollection* list);
 
 
 private:
    TList     *fOutputList;  // List of Pt Histo's
-
+   Int_t      fNRebin; //rebin of histos
    AliSpectraAODHistoManager(const AliSpectraAODHistoManager&);
    AliSpectraAODHistoManager& operator=(const AliSpectraAODHistoManager&);
 
index c879f4d..2079186 100644 (file)
@@ -34,8 +34,6 @@ void runAODProof(Int_t c=4, const char * proofMode = "full")
   handler->SetOverwriteMode();
   handler->SetRunMode(proofMode);
   handler->SetProofReset(0);
-  //handler->SetROOTVersion("v5-33-02a");
-  //handler->SetAliROOTVersion("v5-03-11-AN");
   handler->SetAliROOTVersion("v5-03-32-AN");
   
   //handler->SetNproofWorkers(80);
@@ -57,13 +55,15 @@ void runAODProof(Int_t c=4, const char * proofMode = "full")
 
   handler->SetAliRootMode("default");
   handler->AddIncludePath("-I. -I$ROOTSYS/include -I$ALICE_ROOT/include -I$ALICE_ROOT/TOF -I$ALICE_ROOT/PWGLF");
-  handler->SetAdditionalLibs("libPWGLFspectra.so");
+  //handler->SetAdditionalLibs("libPWGLFspectra.so");
+  // gROOT->LoadMacro("AliSpectraAODTrackCuts.cxx+g");
+  // gROOT->LoadMacro("AliSpectraAODEventCuts.cxx+g");
+  // gROOT->LoadMacro("AliSpectraAODHistoManager.cxx+g");
+  // gROOT->LoadMacro("AliSpectraAODPID.cxx+g");
+  // gROOT->LoadMacro("AliAnalysisTaskSpectraAOD.cxx+g");
   
-  // handler->SetAliRootMode("default");
   // handler->SetAdditionalLibs("AliSpectraAODHistoManager.cxx AliSpectraAODHistoManager.h AliSpectraAODPID.cxx AliSpectraAODPID.h AliSpectraAODTrackCuts.cxx AliSpectraAODTrackCuts.h AliSpectraAODEventCuts.cxx AliSpectraAODEventCuts.h AliAnalysisTaskSpectraAOD.cxx AliAnalysisTaskSpectraAOD.h");
   // handler->SetAnalysisSource("Histograms.h HistogramNames.h AliSpectraAODHistoManager.cxx+ AliSpectraAODTrackCuts.cxx+ AliSpectraAODEventCuts.cxx+ AliSpectraAODPID.cxx+ AliAnalysisTaskSpectraAOD.cxx+");
-  //   handler->SetFileForTestMode("filelist.txt"); // list of local files for testing
-  //  handler->SetAliRootMode("");
   handler->SetClearPackages();
   
   AliAnalysisManager *mgr = new AliAnalysisManager("testAnalysis");
index 98f53dd..8410848 100644 (file)
@@ -1,7 +1,7 @@
 class  AliAnalysisManager;
 class  AliAnalysisAlien;
 
-void runGrid(TString mode="test",Bool_t mc=kTRUE,Int_t day=15,Int_t month=6, Int_t year=2012) 
+void runGrid(TString mode="test",Bool_t mc=0,Int_t day=15,Int_t month=6, Int_t year=2012) 
 {
   //to be used with Aliroot > v5-03-32-AN
   AliLog::SetGlobalDebugLevel(100);
@@ -55,7 +55,6 @@ void runGrid(TString mode="test",Bool_t mc=kTRUE,Int_t day=15,Int_t month=6, Int
   gROOT->LoadMacro("$ALICE_ROOT/PWGLF/SPECTRA/PiKaPr/TestAOD/AddTaskSpectraAOD.C");
   //LOOP OVER SELECTION
   //                            0    1    2    3    4    5
-  Bool_t mc=kTRUE;
   Double_t CentCutMin[4]= {     0,  20,  20,  20};
   Double_t CentCutMax[4]= {   100,  50,  50,  50};
   Double_t QvecCutMin[4]=    {  0,   0,   0, 1.5};
@@ -72,17 +71,22 @@ void runGrid(TString mode="test",Bool_t mc=kTRUE,Int_t day=15,Int_t month=6, Int
   Bool_t UseCentPatchAOD049=kFALSE;
   Double_t DCA=100000;
   UInt_t minNclsTPC=70;
+  Int_t nrebin=0;
+  TString opt="";
+  
   for(Int_t icut=0;icut<4;icut++){
     //if(icut!=0)continue;
-    AliAnalysisTaskSpectraAOD *taskAOD =AddTaskSpectraAOD(mc,CentCutMin[icut],CentCutMax[icut],QvecCutMin[icut],QvecCutMax[icut],EtaMin[icut],EtaMax[icut],Nsigmapid,pt,p,y,ptTofMatch,trkbit,trkbitQVector,UseCentPatchAOD049,DCA,minNclsTPC);
+    AliAnalysisTaskSpectraAOD *taskAOD =AddTaskSpectraAOD(mc,CentCutMin[icut],CentCutMax[icut],QvecCutMin[icut],QvecCutMax[icut],EtaMin[icut],EtaMax[icut],Nsigmapid,pt,p,y,ptTofMatch,trkbit,trkbitQVector,UseCentPatchAOD049,DCA,minNclsTPC,nrebin,opt.Data());
     
     taskAOD->GetOutputSlot(1)->GetContainer()->SetName(Form("%s_%s",taskAOD->GetOutputSlot(1)->GetContainer()->GetName(),taskAOD->GetName()));
     taskAOD->GetOutputSlot(2)->GetContainer()->SetName(Form("%s_%s",taskAOD->GetOutputSlot(2)->GetContainer()->GetName(),taskAOD->GetName()));
     taskAOD->GetOutputSlot(3)->GetContainer()->SetName(Form("%s_%s",taskAOD->GetOutputSlot(3)->GetContainer()->GetName(),taskAOD->GetName()));
     taskAOD->GetOutputSlot(4)->GetContainer()->SetName(Form("%s_%s",taskAOD->GetOutputSlot(4)->GetContainer()->GetName(),taskAOD->GetName()));
     
-    //cout<<"OutSlot :"<<taskAOD->GetOutputSlot(1)->GetContainer()->GetName()<<endl;
-    //return;
+    // taskAOD->GetEventCuts()->SetMultiplicityCut(800,2000);
+    // taskAOD->GetEventCuts()->SetVertexCut(-8,10);
+    // taskAOD->GetEventCuts()->PrintCuts();
+    
   }
   
   mgr->SetDebugLevel(2);