]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Adding new options and histograms: centrality cut in event inspector, dNdeta vs....
authormchojnac <mchojnac@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 15 Feb 2013 11:44:13 +0000 (11:44 +0000)
committermchojnac <mchojnac@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 15 Feb 2013 11:44:13 +0000 (11:44 +0000)
PWGLF/FORWARD/analysis2/AliFMDEventInspector.cxx
PWGLF/FORWARD/analysis2/AliFMDEventInspector.h
PWGLF/FORWARD/analysis2/AliFMDHistCollector.cxx
PWGLF/FORWARD/analysis2/AliFMDHistCollector.h
PWGLF/FORWARD/analysis2/AliForwardMCMultiplicityTask.cxx
PWGLF/FORWARD/analysis2/AliForwardMCMultiplicityTask.h
PWGLF/FORWARD/analysis2/AliForwardMultiplicityTask.cxx
PWGLF/FORWARD/analysis2/AliForwardMultiplicityTask.h

index d5ff9c0e4b8b7defbd9c5064bc6cd7ed40f6d9b5..b8c4734c0fbf045bd00bcd2fa9e57c382198729e 100644 (file)
@@ -74,7 +74,9 @@ AliFMDEventInspector::AliFMDEventInspector()
   fDisplacedVertex(),
   fCollWords(),
   fBgWords(),
-  fCentMethod("V0M")
+  fCentMethod("V0M"),
+  fminCent(-1.0),
+  fmaxCent(-1.0)               
 {
   // 
   // Constructor 
@@ -113,7 +115,9 @@ AliFMDEventInspector::AliFMDEventInspector(const char* name)
   fDisplacedVertex(),
   fCollWords(),
   fBgWords(),
-  fCentMethod("V0M")
+  fCentMethod("V0M"),
+  fminCent(-1.0),
+  fmaxCent(-1.0)       
 {
   // 
   // Constructor 
@@ -155,7 +159,9 @@ AliFMDEventInspector::AliFMDEventInspector(const AliFMDEventInspector& o)
     fDisplacedVertex(o.fDisplacedVertex),
   fCollWords(),
   fBgWords(),
-  fCentMethod(o.fCentMethod)
+  fCentMethod(o.fCentMethod),
+  fminCent(o.fminCent),
+  fmaxCent(o.fmaxCent)         
 {
   // 
   // Copy constructor 
@@ -219,6 +225,9 @@ AliFMDEventInspector::operator=(const AliFMDEventInspector& o)
   fUseDisplacedVertices  = o.fUseDisplacedVertices;
   fDisplacedVertex       = o.fDisplacedVertex;
   fCentMethod            = o.fCentMethod;
+  fminCent              = o.fminCent;
+  fmaxCent              = o.fmaxCent; 
+
   if (fList) { 
     fList->SetName(GetName());
     if (fHEventsTr)    fList->Add(fHEventsTr);
@@ -620,8 +629,7 @@ AliFMDEventInspector::Process(const AliESDEvent* event,
   // Return:
   //    0 (or kOk) on success, otherwise a bit mask of error codes 
   //
-  DGUARD(fDebug,1,"Process event in AliFMDEventInspector");
-
+  DGUARD(fDebug,1,"Process event in AliFMDEventInspector"); 
   // --- Check that we have an event ---------------------------------
   if (!event) { 
     AliWarning("No ESD event found for input event");
@@ -661,6 +669,12 @@ AliFMDEventInspector::Process(const AliESDEvent* event,
     if (fDebug > 3) 
       AliWarning("Failed to get centrality");
   }
+//check centrality cut
+  if(fminCent>0.0&&cent<fminCent)
+       return  kNoEvent; 
+  if(fmaxCent>0.0&&cent>fmaxCent)
+        return  kNoEvent; 
   fHCent->Fill(cent);
   if (qual == 0) fHCentVsQual->Fill(0., cent);
   else { 
index 86f7f5aa888fe6b10c6a06a3c3a21f9bba70a1fd..faba7bc9b7d8ad3388dca04b6dd03e0687f7c4ba 100644 (file)
@@ -237,6 +237,16 @@ public:
   {
     fUseDisplacedVertices = use;
   }  
+  // Settter for fmincentrality 
+  void SetMinCentrality(Double_t mincent=-1.0)
+  {                    
+       fminCent=mincent;
+  }
+  // Settter for fmincentrality 
+  void SetMaxCentrality(Double_t maxcent=-1.0)
+  {                    
+       fmaxCent=maxcent;
+  }
   /** 
    * Set the centrality method to use.  Possible values are 
    *
@@ -313,6 +323,13 @@ public:
    * 
    * @param option Not used 
    */
+  // getter for fmincentrality
+  Double_t GetMinCentrality() const { return fminCent;}
+  // gettter for fmaxcentrality 
+ Double_t GetMaxCentrality() const { return fmaxCent;}
+
+
+
   void Print(Option_t* option="") const;
   /** 
    * Store information about running conditions in output list 
@@ -505,7 +522,10 @@ protected:
   TList    fCollWords;     //! Configured collision words 
   TList    fBgWords;       //! Configured background words 
   TString  fCentMethod;
-  ClassDef(AliFMDEventInspector,7); // Inspect the event 
+  Double_t fminCent;  //min centrality
+  Double_t fmaxCent;  //max centrailty                 
+
+  ClassDef(AliFMDEventInspector,8); // Inspect the event 
 };
 
 #endif
index 4392a4c70ac34d336f7329d94ca928c232a81c10..5e3609a9c63b4119c9e1af23b4a4d409681ef374 100644 (file)
@@ -20,6 +20,7 @@
 #include "AliForwardCorrectionManager.h"
 #include "AliLog.h"
 #include <TH2D.h>
+#include <TH3D.h>
 #include <TH1I.h>
 #include <TProfile.h>
 #include <TProfile2D.h>
@@ -578,7 +579,10 @@ Bool_t
 AliFMDHistCollector::Collect(const AliForwardUtil::Histos& hists,
                             AliForwardUtil::Histos& sums,
                             UShort_t                vtxbin, 
-                            TH2D&                   out)
+                            TH2D&                   out,
+                            TList*                  lout,
+                            Double_t                cent,
+                            TList*      sumsv)
 {
   // 
   // Do the calculations 
@@ -603,7 +607,6 @@ AliFMDHistCollector::Collect(const AliForwardUtil::Histos& hists,
                                                vMax < 0 ? 'm' : 'p', 
                                                int(TMath::Abs(vMax)))));
   
-  
   for (UShort_t d=1; d<=3; d++) { 
     UShort_t nr = (d == 1 ? 1 : 2);
     UShort_t db = d << 4;
@@ -611,14 +614,26 @@ AliFMDHistCollector::Collect(const AliForwardUtil::Histos& hists,
       UShort_t rb = db | ((q+1));
       // Skipping selected FMD rings 
       if (rb & fSkipFMDRings) continue;
-
       Char_t      r = (q == 0 ? 'I' : 'O');
       TH2D*       h = hists.Get(d,r);
       TH2D*       t = static_cast<TH2D*>(h->Clone(Form("FMD%d%c_tmp",d,r)));
       Int_t       i = (d == 1 ? 1 : 2*d + (q == 0 ? -2 : -1));
       TH2D*       o = sums.Get(d, r);
-      
-      
+      TH2D*      ovrt=0x0;
+      if(sumsv)
+      {        
+       AliForwardUtil::Histos* sumsvhistos=static_cast<AliForwardUtil::Histos*>(sumsv->At(vtxbin-1));
+       if(sumsvhistos)
+       {
+               ovrt=sumsvhistos->Get(d, r);
+       }       
+      }        
+      TH3D* detavcent=0x0;
+      if(lout)
+      {
+        detavcent=static_cast<TH3D*>(lout->FindObject(Form("FMD%d%cetavcent",d,r)));         
+      }        
       // Get valid range 
       Int_t first = 0;
       Int_t last  = 0;
@@ -645,7 +660,34 @@ AliFMDHistCollector::Collect(const AliForwardUtil::Histos& hists,
       }
       // Add to our per-ring sum 
       o->Add(t);
-      
+      if(ovrt) 
+       ovrt->Add(t);   
+      // fillinig the deta v cent histo
+      if(cent>0&&detavcent)
+      {
+               Int_t nYbins=t->GetYaxis()->GetNbins();
+               Int_t nXbins=t->GetXaxis()->GetNbins();
+               Int_t cenbin=detavcent->GetYaxis()->FindBin(cent);
+               if(cenbin>0&&cenbin<=detavcent->GetYaxis()->GetNbins()) 
+               {
+                       TH1D* projectionX=(TH1D*)t->ProjectionX("tmp",1,nYbins);
+                       for (int ibineta=1;ibineta<nXbins;ibineta++) 
+                       {
+                               Double_t v1=projectionX->GetBinContent(ibineta);
+                               Double_t e1=projectionX->GetBinError(ibineta);
+                               Double_t v2=detavcent->GetBinContent(ibineta,cenbin,1);
+                               Double_t e2=detavcent->GetBinError(ibineta,cenbin,1);
+                               detavcent->SetBinContent(ibineta,cenbin,1,v1+v2);
+                               detavcent->SetBinError(ibineta,cenbin,1,TMath::Sqrt(e1*e1+e2*e2));
+                               if (t->GetBinContent(ibineta,0)>0.0)
+                                       detavcent->SetBinContent(ibineta,cenbin,0,detavcent->GetBinContent(ibineta,cenbin,0)+t->GetBinContent(ibineta,0));
+                               if (t->GetBinContent(ibineta,nYbins+1)>0.0)
+                                       detavcent->SetBinContent(ibineta,cenbin,2,detavcent->GetBinContent(ibineta,cenbin,2)+t->GetBinContent(ibineta,nYbins+1));         
+                       }
+               }       
+      }                              
+
+
       // Outer rings have better phi segmentation - rebin to same as inner. 
       if (q == 1) t->RebinY(2);
 
@@ -711,7 +753,7 @@ AliFMDHistCollector::Collect(const AliForwardUtil::Histos& hists,
       delete t;
     } // for r
   } // for d 
 return kTRUE;
+ return kTRUE;
 }
 
 //____________________________________________________________________
index 4277425a83ce7690b1e43ce46c737d801fa2fa77..ec517f22517c7f6b57249aaf06d65cfa6fd2b224 100644 (file)
@@ -161,7 +161,10 @@ public:
   virtual Bool_t Collect(const AliForwardUtil::Histos& hists, 
                         AliForwardUtil::Histos&       sums, 
                         UShort_t                      vtxBin, 
-                        TH2D&                         out);
+                        TH2D&                         out,
+                        TList*                         lout=0x0,
+                        Double_t                       cent=-1.0,
+                        TList*       sumsv=0x0);
   /** 
    * Output diagnostic histograms to directory 
    * 
index 29985bd27b78f4dd140076b2ab740b495bc985fd..6231d5407c2d54b1af92c878a0114c0b20904269 100644 (file)
@@ -48,7 +48,9 @@ AliForwardMCMultiplicityTask::AliForwardMCMultiplicityTask()
     fCorrections(),
     fHistCollector(),
     fEventPlaneFinder(),
-    fList(0)
+    fList(0),
+    fListVertexBins(0)     
+       
 {
   // 
   // Constructor
@@ -75,7 +77,8 @@ AliForwardMCMultiplicityTask::AliForwardMCMultiplicityTask(const char* name)
     fCorrections("corrections"),
     fHistCollector("collector"),
     fEventPlaneFinder("eventplane"),
-    fList(0)
+    fList(0),
+    fListVertexBins(0)         
 {
   // 
   // Constructor 
@@ -107,7 +110,8 @@ AliForwardMCMultiplicityTask::AliForwardMCMultiplicityTask(const AliForwardMCMul
     fCorrections(o.fCorrections),
     fHistCollector(o.fHistCollector),
     fEventPlaneFinder(o.fEventPlaneFinder),
-    fList(o.fList) 
+    fList(o.fList),    
+    fListVertexBins(o.fListVertexBins)          
 {
   // 
   // Copy constructor 
@@ -151,7 +155,7 @@ AliForwardMCMultiplicityTask::operator=(const AliForwardMCMultiplicityTask& o)
   fMCRingSums        = o.fMCRingSums;
   fPrimary           = o.fPrimary;
   fList              = o.fList;
-
+  fListVertexBins    = o.fListVertexBins;      
   return *this;
 }
 
@@ -239,6 +243,29 @@ AliForwardMCMultiplicityTask::SetupForData()
   fMCRingSums.Get(3, 'I')->SetMarkerColor(AliForwardUtil::RingColor(3, 'I'));
   fMCRingSums.Get(3, 'O')->SetMarkerColor(AliForwardUtil::RingColor(3, 'O'));
 
+
+  for(int i=1;i<=pv->GetNbins();i++)   
+  {
+       TString nametmp=Form("vtxbin%03d",i);
+       //TList* lbin= new TList();
+       //lbin->SetName(nametmp.Data());
+       //lbin->SetOwner();
+       //fListVertexBins->Add(lbin);
+       AliForwardUtil::Histos* bin=new AliForwardUtil::Histos();
+       bin->Init(*pe);
+       bin->Get(1, 'I')->SetName(Form("%s%s",bin->Get(1, 'I')->GetName(),nametmp.Data()));
+       bin->Get(2, 'I')->SetName(Form("%s%s",bin->Get(2, 'I')->GetName(),nametmp.Data()));
+       bin->Get(2, 'O')->SetName(Form("%s%s",bin->Get(2, 'O')->GetName(),nametmp.Data())); 
+       bin->Get(3, 'I')->SetName(Form("%s%s",bin->Get(3, 'I')->GetName(),nametmp.Data()));
+       bin->Get(3, 'O')->SetName(Form("%s%s",bin->Get(3, 'O')->GetName(),nametmp.Data()));
+       fList->Add(bin->Get(1, 'I'));
+       fList->Add(bin->Get(2, 'I'));
+       fList->Add(bin->Get(2, 'O'));
+       fList->Add(bin->Get(3, 'I'));
+       fList->Add(bin->Get(3, 'O'));
+       fListVertexBins->Add(bin);
+
+}
   fEventInspector.SetupForData(*pv);
   fSharingFilter.SetupForData(*pe);
   fDensityCalculator.SetupForData(*pe);
@@ -262,6 +289,10 @@ AliForwardMCMultiplicityTask::UserCreateOutputObjects()
   fList = new TList;
   fList->SetOwner();
 
+  fListVertexBins=new TList();
+  fListVertexBins->SetOwner();         
+  //fList->Add(fListVertexBins);
+       
   AliAnalysisManager* am = AliAnalysisManager::GetAnalysisManager();
   AliAODHandler*      ah = 
     dynamic_cast<AliAODHandler*>(am->GetOutputEventHandler());
@@ -294,6 +325,9 @@ AliForwardMCMultiplicityTask::UserCreateOutputObjects()
   fHistCollector.CreateOutputObjects(fList);
   fEventPlaneFinder.CreateOutputObjects(fList);
 
+
+       
+
   PostData(1, fList);
 }
 //____________________________________________________________________
@@ -433,7 +467,7 @@ AliForwardMCMultiplicityTask::UserExec(Option_t*)
   fCorrections.CompareResults(fHistos, fMCHistos);
     
   if (!fHistCollector.Collect(fHistos, fRingSums, 
-                             ivz, fAODFMD.GetHistogram())) {
+                             ivz, fAODFMD.GetHistogram(),0x0,-1,fListVertexBins)) {
     AliWarning("Histogram collector failed");
     return;
   }
index b60b86a1b66c61f1bb8ea8c156d40087d29bd8a2..d6bfe08b9d622b947932ecc333ae8248efd93c51 100644 (file)
@@ -220,8 +220,9 @@ protected:
   AliFMDEventPlaneFinder    fEventPlaneFinder;  // Algorithm
 
   TList* fList; // Output list 
+  TList* fListVertexBins; // list of the signal  in vertex bin 
 
-  ClassDef(AliForwardMCMultiplicityTask,2) // Forward multiplicity class
+  ClassDef(AliForwardMCMultiplicityTask,3) // Forward multiplicity class
 };
 
 #endif
index 99c11b9b0bb1f70d8cf0d616ae8d4c12c69c9fb5..9bbffa6841c8e43ff87d77bfdf6efb851453f690 100644 (file)
@@ -22,6 +22,7 @@
 #include "AliForwardCorrectionManager.h"
 #include "AliAnalysisManager.h"
 #include <TH1.h>
+#include <TH3D.h>
 #include <TDirectory.h>
 #include <TTree.h>
 #include <TROOT.h>
@@ -42,7 +43,13 @@ AliForwardMultiplicityTask::AliForwardMultiplicityTask()
     fCorrections(),
     fHistCollector(),
     fEventPlaneFinder(),
+    fFMD1icent(0),
+    fFMD2icent(0),
+    fFMD2ocent(0),
+    fFMD3icent(0),
+    fFMD3ocent(0),
     fList(0)
+
 {
   // 
   // Constructor
@@ -65,7 +72,14 @@ AliForwardMultiplicityTask::AliForwardMultiplicityTask(const char* name)
     fCorrections("corrections"),
     fHistCollector("collector"),
     fEventPlaneFinder("eventplane"),
+    fFMD1icent(0),
+    fFMD2icent(0),
+    fFMD2ocent(0),
+    fFMD3icent(0),
+    fFMD3ocent(0),
     fList(0)
+
+
 {
   // 
   // Constructor 
@@ -93,7 +107,13 @@ AliForwardMultiplicityTask::AliForwardMultiplicityTask(const AliForwardMultiplic
     fCorrections(o.fCorrections),
     fHistCollector(o.fHistCollector),
     fEventPlaneFinder(o.fEventPlaneFinder),
-    fList(o.fList) 
+     fFMD1icent(o.fFMD1icent),
+    fFMD2icent(o.fFMD2icent),
+    fFMD2ocent(o.fFMD2ocent),
+    fFMD3icent(o.fFMD3icent),
+    fFMD3ocent(o.fFMD3ocent),
+    fList(o.fList)
+
 {
   // 
   // Copy constructor 
@@ -134,6 +154,11 @@ AliForwardMultiplicityTask::operator=(const AliForwardMultiplicityTask& o)
   fAODFMD            = o.fAODFMD;
   fAODEP             = o.fAODEP;
   fRingSums          = o.fRingSums;
+  fFMD1icent        = o.fFMD1icent;
+  fFMD2icent        = o.fFMD2icent;
+  fFMD2ocent        = o.fFMD2ocent;
+  fFMD3icent        = o.fFMD3icent;
+  fFMD3ocent        = o.fFMD3ocent;
   fList              = o.fList;
 
   return *this;
@@ -203,6 +228,19 @@ AliForwardMultiplicityTask::SetupForData()
   fCorrections.SetupForData(*pe);
   fHistCollector.SetupForData(*pv,*pe);
   fEventPlaneFinder.SetupForData(*pe);
+  
+  fFMD1icent=new TH3D("FMD1Ietavcent","FMD1ietavcent;#eta;cent",pe->GetNbins(),pe->GetXmin(),pe->GetXmax(),101,-0.5,100.5,1,0,1);
+  fFMD2icent=new TH3D("FMD2Ietavcent","FMD2ietavcent;#eta;cent",pe->GetNbins(),pe->GetXmin(),pe->GetXmax(),101,-0.5,100.5,1,0,1);
+  fFMD2ocent=new TH3D("FMD2Oetavcent","FMD2oetavcent;#eta;cent",pe->GetNbins(),pe->GetXmin(),pe->GetXmax(),101,-0.5,100.5,1,0,1);
+  fFMD3icent=new TH3D("FMD3Ietavcent","FMD3ietavcent;#eta;cent",pe->GetNbins(),pe->GetXmin(),pe->GetXmax(),101,-0.5,100.5,1,0,1);
+  fFMD3ocent=new TH3D("FMD3Oetavcent","FMD3oetavcent;#eta;cent",pe->GetNbins(),pe->GetXmin(),pe->GetXmax(),101,-0.5,100.5,1,0,1);
+  fList->Add(fFMD1icent);
+  fList->Add(fFMD2icent);
+  fList->Add(fFMD2ocent);
+  fList->Add(fFMD3icent);
+  fList->Add(fFMD3ocent);
+
+       
 
   this->Print();
   return true;
@@ -325,7 +363,7 @@ AliForwardMultiplicityTask::UserExec(Option_t*)
   }
 
   if (!fHistCollector.Collect(fHistos, fRingSums, 
-                             ivz, fAODFMD.GetHistogram())) {
+                             ivz, fAODFMD.GetHistogram(),fList,fAODFMD.GetCentrality())) {
     AliWarning("Histogram collector failed");
     return;
   }
index 37533256c6c7364727aa94f91ba77c2e06631bde..79ad8b7bdb5436bda90cd25d388679ab684fc89c 100644 (file)
@@ -28,6 +28,7 @@
 class AliESDEvent;
 class TH2D;
 class TList;
+class TH3D;    
 
 /** 
  * Calculate the multiplicity in the forward regions event-by-event 
@@ -210,9 +211,17 @@ protected:
   AliFMDHistCollector     fHistCollector;     // Algorithm
   AliFMDEventPlaneFinder  fEventPlaneFinder;  // Algorithm
 
+  TH3D* fFMD1icent; // Histogram for dndeta FMD1i vs centrality 
+  TH3D* fFMD2icent; // Histogram for dndeta FMD2i vs centrality
+  TH3D* fFMD2ocent; // Histogram for dndeta FMD2o vs centrality
+  TH3D* fFMD3icent; // Histogram for dndeta FMD3i vs centrality
+  TH3D* fFMD3ocent; // Histogram for dndeta FMD3o vs centrality
+
   TList* fList; // Output list 
+       
 
-  ClassDef(AliForwardMultiplicityTask,2) // Forward multiplicity class
+  ClassDef(AliForwardMultiplicityTask,3) // Forward multiplicity class
 };
 
 #endif