]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
add method to get centrality of the event for a given centrality class, use it in...
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 26 Nov 2010 14:35:51 +0000 (14:35 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 26 Nov 2010 14:35:51 +0000 (14:35 +0000)
PWG4/PartCorrBase/AliAnaPartCorrBaseClass.cxx
PWG4/PartCorrBase/AliAnaPartCorrBaseClass.h
PWG4/PartCorrDep/AliAnaPi0.cxx

index 61bfc40e2bb71dc3c389bb4672a7668732cc7607..640a6a7fc23ee53b96d18c0581ea81c08738147d 100755 (executable)
@@ -53,6 +53,7 @@ ClassImp(AliAnaPartCorrBaseClass)
     fOutputAODBranch(0x0), fNewAOD(kFALSE),
     fOutputAODName(""), fOutputAODClassName(""),
     fAODObjArrayName(""), fAddToHistogramsName(""),
     fOutputAODBranch(0x0), fNewAOD(kFALSE),
     fOutputAODName(""), fOutputAODClassName(""),
     fAODObjArrayName(""), fAddToHistogramsName(""),
+    fCentralityClass("V0M"),fCentralityOpt(10),
     fCaloPID(0x0), fFidCut(0x0), fIC(0x0),fMCUtils(0x0), fNMS(0x0),
     fCaloUtils(0x0),
     fHistoPtBins(0),   fHistoPtMax(0.),   fHistoPtMin(0.),
     fCaloPID(0x0), fFidCut(0x0), fIC(0x0),fMCUtils(0x0), fNMS(0x0),
     fCaloUtils(0x0),
     fHistoPtBins(0),   fHistoPtMax(0.),   fHistoPtMin(0.),
@@ -361,6 +362,24 @@ Int_t AliAnaPartCorrBaseClass::GetEventNumber() const {
        
        return fReader->GetEventNumber() ; 
 }
        
        return fReader->GetEventNumber() ; 
 }
+
+//__________________________________________________
+Int_t AliAnaPartCorrBaseClass::GetEventCentrality() const {
+  //Return current event centrality
+  
+  if(GetCentrality()){
+    if(fCentralityOpt==100)     return (Int_t) GetCentrality()->GetCentralityPercentile(fCentralityClass);
+    else if(fCentralityOpt==10) return GetCentrality()->GetCentralityClass10(fCentralityClass); 
+    else if(fCentralityOpt==5)  return GetCentrality()->GetCentralityClass5(fCentralityClass);
+    else {
+      printf("AliAnaPartCorrBaseClass::Unknown centrality option %d, use 5, 10 or 100\n",fCentralityOpt);
+      return 0;
+    } 
+  }
+  else return 0;
+  
+}
+
        
 //__________________________________________________
 AliStack *  AliAnaPartCorrBaseClass::GetMCStack() const {
        
 //__________________________________________________
 AliStack *  AliAnaPartCorrBaseClass::GetMCStack() const {
index fc8e232deb1148bd40e4c46ab2d8247ee4648ef1..a6e043484254389a730e243bfe30da501965f4c0 100755 (executable)
@@ -86,8 +86,14 @@ public:
   Int_t GetModuleNumber(AliVCluster * cluster) const {
          return fCaloUtils->GetModuleNumber(cluster);}
        
   Int_t GetModuleNumber(AliVCluster * cluster) const {
          return fCaloUtils->GetModuleNumber(cluster);}
        
-  AliESDCentrality* GetCentrality() const {return fReader->GetCentrality();}
-  
+  //Centrality
+  AliESDCentrality* GetCentrality() const  { return fReader->GetCentrality() ;}
+  void SetCentralityClass(TString name)    { fCentralityClass   = name       ;}
+  void SetCentralityOpt(Int_t opt)         { fCentralityOpt     = opt        ;}
+  TString GetCentralityClass()     const   { return fCentralityClass         ;}
+  Int_t   GetCentralityPercent()   const   { return fCentralityOpt           ;}
+  Int_t   GetEventCentrality()     const ;
   virtual void Terminate(TList * /*outputList*/) {;}
        
   //analysis AOD branch
   virtual void Terminate(TList * /*outputList*/) {;}
        
   //analysis AOD branch
@@ -316,8 +322,11 @@ private:
   Bool_t        fNewAOD ;            //  Flag, new aod branch added to the analysis or not.
   TString       fOutputAODName ;     //  Name of output AOD branch;
   TString       fOutputAODClassName; //  Type of aod objects to be stored in the TClonesArray (AliAODPWG4Particle, AliAODPWG4ParticleCorrelation ...)  
   Bool_t        fNewAOD ;            //  Flag, new aod branch added to the analysis or not.
   TString       fOutputAODName ;     //  Name of output AOD branch;
   TString       fOutputAODClassName; //  Type of aod objects to be stored in the TClonesArray (AliAODPWG4Particle, AliAODPWG4ParticleCorrelation ...)  
-  TString       fAODObjArrayName ;   // Name of ref array kept in a TList in AliAODParticleCorrelation with clusters or track references.
-  TString       fAddToHistogramsName;// Add this string to histograms name
+  TString       fAODObjArrayName ;   //  Name of ref array kept in a TList in AliAODParticleCorrelation with clusters or track references.
+  TString       fAddToHistogramsName;//  Add this string to histograms name
+  
+  TString       fCentralityClass;    // Name of selected centrality class     
+  Int_t         fCentralityOpt;      // Option for the returned value of the centrality, possible options 5, 10, 100
   
   //Analysis helper classes access pointers
   AliCaloPID               * fCaloPID; //! PID calculation
   
   //Analysis helper classes access pointers
   AliCaloPID               * fCaloPID; //! PID calculation
@@ -353,7 +362,7 @@ private:
   Int_t   fHistoTrMMax   ;  // Maximum value of track multiplicity histogram range
   Int_t   fHistoTrMMin   ;  // Minimum value of track multiplicity histogram range
   
   Int_t   fHistoTrMMax   ;  // Maximum value of track multiplicity histogram range
   Int_t   fHistoTrMMin   ;  // Minimum value of track multiplicity histogram range
   
-  ClassDef(AliAnaPartCorrBaseClass,13)
+  ClassDef(AliAnaPartCorrBaseClass,14)
 } ;
 
 
 } ;
 
 
index f574ebb377929834b310c33977cf223e746f8de9..410d43803f5f047cf2efe9740ca3b55348503087 100755 (executable)
@@ -674,13 +674,13 @@ void AliAnaPi0::MakeAnalysisFillHistograms()
       continue ; 
     if(TMath::Abs(vert[2]) > GetZvertexCut()) continue ;   //vertex cut
     if (evtIndex1 != currentEvtIndex) {
       continue ; 
     if(TMath::Abs(vert[2]) > GetZvertexCut()) continue ;   //vertex cut
     if (evtIndex1 != currentEvtIndex) {
-      //Get Reaction Plan position and calculate RP bin
-      //does not exist in ESD yet????
-      curCentrBin = 0 ; 
+      curCentrBin = GetEventCentrality();
       curRPBin    = 0 ;
       curZvertBin = (Int_t)(0.5*GetNZvertBin()*(vert[2]+GetZvertexCut())/GetZvertexCut()) ;
       fhEvents->Fill(curCentrBin+0.5,curZvertBin+0.5,curRPBin+0.5) ;
       currentEvtIndex = evtIndex1 ; 
       curRPBin    = 0 ;
       curZvertBin = (Int_t)(0.5*GetNZvertBin()*(vert[2]+GetZvertexCut())/GetZvertexCut()) ;
       fhEvents->Fill(curCentrBin+0.5,curZvertBin+0.5,curRPBin+0.5) ;
       currentEvtIndex = evtIndex1 ; 
+      //if(GetDebug() > 1) 
+        printf("AliAnaPi0::MakeAnalysisFillHistograms() - Centrality %d, Vertex Bin %d, RP bin %d\n",curCentrBin,curRPBin,curZvertBin);
     }
     
     //printf("AliAnaPi0::MakeAnalysisFillHistograms(): Photon 1 Evt %d  Vertex : %f,%f,%f\n",evtIndex1, GetVertex(evtIndex1)[0] ,GetVertex(evtIndex1)[1],GetVertex(evtIndex1)[2]);
     }
     
     //printf("AliAnaPi0::MakeAnalysisFillHistograms(): Photon 1 Evt %d  Vertex : %f,%f,%f\n",evtIndex1, GetVertex(evtIndex1)[0] ,GetVertex(evtIndex1)[1],GetVertex(evtIndex1)[2]);