]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Add the possibility to use pPb Ntracklets vs zvtx correction profiles (J.Wilkinson)
authorzconesa <zaida.conesa.del.valle@cern.ch>
Sun, 23 Feb 2014 18:36:41 +0000 (19:36 +0100)
committerzconesa <zaida.conesa.del.valle@cern.ch>
Sun, 23 Feb 2014 18:36:41 +0000 (19:36 +0100)
PWGHF/vertexingHF/AliCFTaskVertexingHF.cxx [changed mode: 0644->0755]
PWGHF/vertexingHF/AliCFTaskVertexingHF.h [changed mode: 0644->0755]
PWGHF/vertexingHF/macros/AddTaskCFVertexingHF.C [changed mode: 0644->0755]

old mode 100644 (file)
new mode 100755 (executable)
index 5d27965..34565f5
@@ -129,7 +129,8 @@ AliCFTaskVertexingHF::AliCFTaskVertexingHF() :
   fMultiplicityEstimator(kNtrk10),
   fRefMult(9.26),
   fZvtxCorrectedNtrkEstimator(kFALSE),
-  fIsPPData(kFALSE)
+  fIsPPData(kFALSE),
+  fIsPPbData(kFALSE)
 {
   //
   //Default ctor
@@ -186,7 +187,8 @@ AliCFTaskVertexingHF::AliCFTaskVertexingHF(const Char_t* name, AliRDHFCuts* cuts
   fMultiplicityEstimator(kNtrk10),
   fRefMult(9.26),
   fZvtxCorrectedNtrkEstimator(kFALSE),
-  fIsPPData(kFALSE)
+  fIsPPData(kFALSE),
+  fIsPPbData(kFALSE)
 {
   //
   // Constructor. Initialization of Inputs and Outputs
@@ -274,7 +276,8 @@ AliCFTaskVertexingHF::AliCFTaskVertexingHF(const AliCFTaskVertexingHF& c) :
   fMultiplicityEstimator(c.fMultiplicityEstimator),
   fRefMult(c.fRefMult),
   fZvtxCorrectedNtrkEstimator(c.fZvtxCorrectedNtrkEstimator),
-  fIsPPData(c.fIsPPData)
+  fIsPPData(c.fIsPPData),
+  fIsPPbData(c.fIsPPbData)
 {
   //
   // Copy Constructor
@@ -442,8 +445,18 @@ void AliCFTaskVertexingHF::Init()
 
   fListProfiles = new TList();
   fListProfiles->SetOwner();
-  TString period[4]={"LHC10b","LHC10c","LHC10d","LHC10e"};
-  for(Int_t i=0; i<4; i++){
+  TString period[4];
+  Int_t nProfiles=4;
+  
+  if (fIsPPbData) { //if pPb, use only two estimator histos
+     period[0] = "LHC13b"; period[1] = "LHC13c";
+     nProfiles = 2;
+  } else {        // else assume pp (four histos for LHC10)
+     period[0] = "LHC10b"; period[1] = "LHC10c"; period[2] = "LHC10d"; period[3] = "LHC10e";
+     nProfiles = 4;
+  }
+
+  for(Int_t i=0; i<nProfiles; i++){
     if(fMultEstimatorAvg[i]){
       TProfile* hprof=new TProfile(*fMultEstimatorAvg[i]);
       hprof->SetName(Form("ProfileTrkVsZvtx%s\n",period[i].Data()));
@@ -1570,12 +1583,19 @@ TProfile* AliCFTaskVertexingHF::GetEstimatorHistogram(const AliVEvent* event){
   //
 
   Int_t runNo  = event->GetRunNumber();
-  Int_t period = -1;   // 0-LHC10b, 1-LHC10c, 2-LHC10d, 3-LHC10e
-  if(runNo>114930 && runNo<117223) period = 0;
-  if(runNo>119158 && runNo<120830) period = 1;
-  if(runNo>122373 && runNo<126438) period = 2;
-  if(runNo>127711 && runNo<130841) period = 3;
-  if(period<0 || period>3) return 0;
-
+  Int_t period = -1;   // pp: 0-LHC10b, 1-LHC10c, 2-LHC10d, 3-LHC10e
+                       //pPb: 0-LHC13b, 1-LHC13c
+
+  if (fIsPPbData) {    // setting run numbers for LHC13 if pPb
+      if (runNo>195343 && runNo<195484) period = 0;
+      if (runNo>195528 && runNo<195678) period = 1;
+  } else {     //else assume pp                       
+      if(runNo>114930 && runNo<117223) period = 0;
+      if(runNo>119158 && runNo<120830) period = 1;
+      if(runNo>122373 && runNo<126438) period = 2;
+      if(runNo>127711 && runNo<130841) period = 3;
+      if(period<0 || period>3) return 0;
+  }
+  
   return fMultEstimatorAvg[period];
 }
old mode 100644 (file)
new mode 100755 (executable)
index ea87641..f573152
@@ -100,7 +100,7 @@ public:
        // CORRECTION FRAMEWORK RELATED FUNCTIONS
        void           SetCFManager(AliCFManager* io) {fCFManager = io;}   // global correction manager
        AliCFManager * GetCFManager()                 {return fCFManager;} // get corr manager
-       
+
        // Setters (and getters) for the config macro
        void    SetFillFromGenerated(Bool_t flag) {fFillFromGenerated = flag;}
        Bool_t  GetFillFromGenerated() const {return fFillFromGenerated;}
@@ -129,6 +129,7 @@ public:
        void SetMultiplicityEstimator(Int_t value){ fMultiplicityEstimator=value; }
        Int_t GetMultiplicityEstimator(){ return fMultiplicityEstimator; }
        void SetIsPPData(Bool_t flag){ fIsPPData = flag; }
+       void SetIsPPbData(Bool_t flag){ fIsPPbData = flag; }
 
        void SetUseNchTrackletsWeight(Bool_t useWeight = kTRUE) { fUseNchWeight=useWeight; fUseTrackletsWeight=useWeight; }
        Bool_t GetUseNchTrackletsWeight() const {return fUseTrackletsWeight;}
@@ -151,6 +152,17 @@ public:
          if(fMultEstimatorAvg[3]) delete fMultEstimatorAvg[3];
          fMultEstimatorAvg[3]=new TProfile(*hprof);
        }
+       
+       void SetMultiplVsZProfileLHC13b(TProfile* hprof){
+         if(fMultEstimatorAvg[0]) delete fMultEstimatorAvg[0];
+         fMultEstimatorAvg[0]=new TProfile(*hprof);
+       }
+       void SetMultiplVsZProfileLHC13c(TProfile* hprof){
+         if(fMultEstimatorAvg[1]) delete fMultEstimatorAvg[1];
+         fMultEstimatorAvg[1]=new TProfile(*hprof);
+       }
+
+
        TProfile* GetEstimatorHistogram(const AliVEvent* event);
        void SetReferenceMultiplcity(Double_t rmu){fRefMult=rmu;}
        
@@ -261,8 +273,9 @@ protected:
        Double_t fRefMult;   // refrence multiplcity (period b)
        Bool_t fZvtxCorrectedNtrkEstimator; // flag to use the z-vtx corrected (if not use uncorrected) multiplicity estimator
        Bool_t fIsPPData; // flag for pp data (not checking centrality)
-
-       ClassDef(AliCFTaskVertexingHF,18); // class for HF corrections as a function of many variables
+       Bool_t fIsPPbData; // flag for pPb data (used for multiplicity corrections)
+   
+       ClassDef(AliCFTaskVertexingHF,19); // class for HF corrections as a function of many variables
 };
 
 #endif
old mode 100644 (file)
new mode 100755 (executable)
index e8d9901..f2b93a8
@@ -627,29 +627,56 @@ AliCFTaskVertexingHF *AddTaskCFVertexingHF(const char* cutFile = "./D0toKpiCuts.
            return 0x0;
          }
        }
-
+       
+       if(isPPbData) { 
+         task->SetIsPPbData(kTRUE); 
+       }
+   
        if(estimatorFilename.EqualTo("") ) {
          printf("Estimator file not provided, multiplicity corrected histograms will not be filled\n");
          task->SetUseZvtxCorrectedNtrkEstimator(kFALSE);
        } else{
-         const Char_t* periodNames[4] = {"LHC10b", "LHC10c", "LHC10d", "LHC10e"};
-         TProfile* multEstimatorAvg[4];                       
+
          TFile* fileEstimator=TFile::Open(estimatorFilename.Data());
          if(!fileEstimator)  {
            AliFatal("File with multiplicity estimator not found"); 
            return;
          }
-         for(Int_t ip=0; ip<4; ip++) {
-           multEstimatorAvg[ip] = (TProfile*)(fileEstimator->Get(Form("SPDmult10_%s",periodNames[ip]))->Clone(Form("SPDmult10_%s_clone",periodNames[ip])));  
-         }
+
          task->SetUseZvtxCorrectedNtrkEstimator(kTRUE);
-         task->SetMultiplVsZProfileLHC10b(multEstimatorAvg[0]);
-         task->SetMultiplVsZProfileLHC10c(multEstimatorAvg[1]);
-         task->SetMultiplVsZProfileLHC10d(multEstimatorAvg[2]);
-         task->SetMultiplVsZProfileLHC10e(multEstimatorAvg[3]);
          task->SetReferenceMultiplcity(refMult);
-       }
 
+         if (isPPbData) {     //Use LHC13 periods for mult correction if pPb data
+            const Char_t* periodNames[2] = {"LHC13b", "LHC13c"};
+            TProfile* multEstimatorAvg[2];
+            for(Int_t ip=0; ip<2; ip++) {
+             multEstimatorAvg[ip] = (TProfile*)(fileEstimator->Get(Form("SPDmult10_%s",periodNames[ip]))->Clone(Form("SPDmult10_%s_clone",periodNames[ip])));
+             if (!multEstimatorAvg[ip]) {
+               AliFatal(Form("Multiplicity estimator for %s not found! Please check your estimator file",periodNames[ip]));
+               return;
+             }
+            }
+            task->SetMultiplVsZProfileLHC13b(multEstimatorAvg[0]);
+            task->SetMultiplVsZProfileLHC13c(multEstimatorAvg[1]);
+         }
+         else {
+           const Char_t* periodNames[4] = {"LHC10b", "LHC10c", "LHC10d", "LHC10e"};   //else, assume pp (LHC10)
+            TProfile* multEstimatorAvg[4];
+            for(Int_t ip=0; ip<4; ip++) {
+             multEstimatorAvg[ip] = (TProfile*)(fileEstimator->Get(Form("SPDmult10_%s",periodNames[ip]))->Clone(Form("SPDmult10_%s_clone",periodNames[ip])));
+             if (!multEstimatorAvg[ip]) {
+               AliFatal(Form("Multiplicity estimator for %s not found! Please check your estimator file",periodNames[ip]));
+               return;
+             }
+            }
+            task->SetMultiplVsZProfileLHC10b(multEstimatorAvg[0]);
+            task->SetMultiplVsZProfileLHC10c(multEstimatorAvg[1]);
+            task->SetMultiplVsZProfileLHC10d(multEstimatorAvg[2]);
+            task->SetMultiplVsZProfileLHC10e(multEstimatorAvg[3]);
+         }
+
+       }
+       
 
        Printf("***************** CONTAINER SETTINGS *****************");       
        Printf("decay channel = %d",(Int_t)task->GetDecayChannel());