]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - PWGGA/EMCALTasks/AliAnalysisTaskEMCALClusterize.h
Relaxed the requirement for "mothers" to come before "daughters" in the data array.
[u/mrichter/AliRoot.git] / PWGGA / EMCALTasks / AliAnalysisTaskEMCALClusterize.h
index 701fa83da803aab20bedfd45850b7c94e6a301a1..a9baa0d5e2f17325392fde6671aa28bf196d8c7e 100644 (file)
@@ -9,12 +9,16 @@
 class TTree;
 class TClonesArray;
 
+#include "AliCentrality.h"
+
 //EMCAL
 class AliEMCALGeometry;
 class AliEMCALCalibData;
 class AliCaloCalibPedestal;
 class AliEMCALClusterizer;
 class AliEMCALAfterBurnerUF;
+class AliEMCALRecPoint;
+class AliAODCaloCluster;
 #include "AliEMCALRecParam.h"
 #include "AliEMCALRecoUtils.h"
 
@@ -33,6 +37,16 @@ class AliAnalysisTaskEMCALClusterize : public AliAnalysisTaskSE {
   virtual void   LocalInit()                                    { Init()                       ; }
     
   // Event methods, settings
+  
+  Bool_t         AcceptEventEMCAL();
+  void           SwitchOnSelectEMCALEvent()                    { fSelectEMCALEvent   = kTRUE   ; }
+  void           SwitchOffSelectEMCALEvent()                   { fSelectEMCALEvent   = kFALSE  ; }
+  void           SetEMCALEnergyCut(Float_t cut)                { fEMCALEnergyCut     = cut     ; }
+  void           SetEMCALNcellsCut(Int_t cut)                  { fEMCALNcellsCut     = cut     ; }
+
+  void           SwitchOnInputAODFilter()                      { fInputFromFilter    = kTRUE   ; }
+  void           SwitchOffInputAODFilter()                     { fInputFromFilter    = kFALSE  ; }
+  
   void           CheckAndGetEvent();
   
   Bool_t         IsExoticEvent();
@@ -60,7 +74,6 @@ class AliAnalysisTaskEMCALClusterize : public AliAnalysisTaskSE {
   void           SetImportGeometryFromFile(Bool_t  im, 
                                            TString pa = "")     { fImportGeometryFromFile = im ; 
                                                                   fImportGeometryFilePath = pa ; }    
-  
   //AOD methods
   void           SetAODBranchName(TString &name)                { fOutputAODBranchName = name  ; }
   void           FillAODFile(Bool_t yesno)                      { fFillAODFile         = yesno ; }
@@ -70,6 +83,11 @@ class AliAnalysisTaskEMCALClusterize : public AliAnalysisTaskSE {
   void           SwitchOffFillAODHeader()                       { fFillAODHeader     = kFALSE  ; } 
   void           SwitchOnFillAODCaloCells()                     { fFillAODCaloCells  = kTRUE   ; }
   void           SwitchOffFillAODCaloCells()                    { fFillAODCaloCells  = kFALSE  ; } 
+
+  void           SwitchOnRecalibrateWithClusterTime()           { fRecalibrateWithClusterTime  = kTRUE   ; }
+  void           SwitchOffRecalibrateWithClusterTime()          { fRecalibrateWithClusterTime  = kFALSE  ; }
+  
+
   
   //Algorithms settings
   
@@ -94,24 +112,50 @@ class AliAnalysisTaskEMCALClusterize : public AliAnalysisTaskSE {
   void           SwitchOnCellEnergySelection()                  { fSelectCell        = kTRUE   ; }
   void           SwitchOffCellEnergySelection()                 { fSelectCell        = kFALSE  ; } 
   void           SetCellCuts(Float_t e, Float_t frac)           { fSelectCellMinE    = e       ; 
-                                                                  fSelectCellMinFrac = frac    ; }  
+                                                                  fSelectCellMinFrac = frac    ; }
+  void           SetRejectBelowThreshold(Bool_t reject)         { fRejectBelowThreshold =reject ; }
   // OADB options settings
   
   void           AccessOADB() ;
   
   TString        GetPass()    ;
   
-  void           SwitchOnEMCALOADB()                            { fAccessOCDB         = kTRUE   ; }
-  void           SwitchOffEMCALOADB()                           { fAccessOCDB         = kFALSE  ; }
+  void           SwitchOnEMCALOADB()                            { fAccessOADB        = kTRUE   ; }
+  void           SwitchOffEMCALOADB()                           { fAccessOADB        = kFALSE  ; }
     
-  void           SetOADBFilePath(TString path)                  { fOADBFilePath  = path    ; }
+  void           SetOADBFilePath(TString path)                  { fOADBFilePath      = path    ; }
+  
+  // Centrality selection
+  
+  AliCentrality* GetCentrality()                                { return InputEvent()->GetCentrality() ; } //Look in AOD reader, different there
+  void           SetCentralityClass(TString name)               { fCentralityClass   = name            ; }
+  TString        GetCentralityClass()                     const { return fCentralityClass              ; }
+  Float_t        GetEventCentrality()                           { if(GetCentrality()) return GetCentrality()->GetCentralityPercentile(fCentralityClass) ;
+                                                                  else                return -1.       ; }
+  void           SetCentralityBin(Int_t min, Int_t max) //Set the centrality bin to select the event. If used, then need to get percentile
+                                                                { fCentralityBin[0]=min ; fCentralityBin[1]=max ; }
+  Float_t        GetCentralityBin(Int_t i)                const { if(i < 0 || i > 1) return -1 ; 
+                                                                  else               return fCentralityBin[i]   ; }
   
- private:
+  //MC label methods
+  
+  void           RemapMCLabelForAODs(Int_t &label);
+  void           SwitchOnRemapMCLabelForAODs()                  { fRemapMCLabelForAODs  = kTRUE   ; }
+  void           SwitchOffRemapMCLabelForAODs()                 { fRemapMCLabelForAODs  = kFALSE  ; }
+
+  void           SetClustersMCLabelFrom2SelectedLabels(AliEMCALRecPoint* recPoint, AliAODCaloCluster *clus) ;
+  void           SetClustersMCLabelFromOriginalClusters(AliAODCaloCluster * clus) ;
+  
+  void           SwitchOnUseClusterMCLabelForCell(Int_t opt = 2) { fSetCellMCLabelFromCluster = opt ; }
+  void           SwitchOffUseClusterMCLabelForCell()             { fSetCellMCLabelFromCluster = 0   ; }
+
+private:
     
-  virtual void   FillCaloClusterInAOD();
+  virtual void   FillCaloClusterInEvent();
   
   virtual void   RecPoints2Clusters();
   
+  virtual void   ResetArrays();
   
   AliVEvent             *fEvent;                   // Event 
   
@@ -131,7 +175,7 @@ class AliAnalysisTaskEMCALClusterize : public AliAnalysisTaskSE {
   //Temporal arrays
   TClonesArray          *fDigitsArr;               //! Digits array
   TObjArray             *fClusterArr;              //! Recpoints array
-  TObjArray             *fCaloClusterArr;          //-> CaloClusters array
+  TObjArray             *fCaloClusterArr;          //! CaloClusters array
 
   //Clusterizers 
   AliEMCALRecParam      *fRecParam;                // Reconstruction parameters container
@@ -142,6 +186,7 @@ class AliAnalysisTaskEMCALClusterize : public AliAnalysisTaskSE {
   //AOD
   TClonesArray          *fOutputAODBranch;         //! AOD Branch with output clusters  
   TString                fOutputAODBranchName;     // New of output AOD branch
+  Bool_t                 fOutputAODBranchSet ;     // Set the AOD clusters branch in the input event once
   Bool_t                 fFillAODFile;             // Fill the output AOD file with the new clusters, 
                                                    // if not they will be only available for the event they were generated
   Bool_t                 fFillAODHeader;           // Copy header to standard branch
@@ -152,33 +197,55 @@ class AliAnalysisTaskEMCALClusterize : public AliAnalysisTaskSE {
   AliEMCALRecoUtils*     fRecoUtils;               // Access to factorized reconstruction algorithms
   TString                fConfigName;              // Name of analysis configuration file
   
-  Int_t                  fCellLabels[12672];       // Array with MC label to be passed to digit. 
+  
+  Int_t                  fOrgClusterCellId[12672]; // Array ID of cluster to wich the cell belongs in unmodified clusters
+  Int_t                  fCellLabels[12672];       // Array with MC label to be passed to digit.
   Int_t                  fCellSecondLabels[12672]; // Array with Second MC label to be passed to digit. 
   Double_t               fCellTime[12672];         // Array with cluster time to be passed to digit in case of AODs 
   Float_t                fCellMatchdEta[12672];    // Array with cluster-track dPhi 
   Float_t                fCellMatchdPhi[12672];    // Array with cluster-track dEta 
 
+  Bool_t                 fRecalibrateWithClusterTime; // Use fCellTime to store time of cells in cluster
+  
   Int_t                  fMaxEvent;                // Set a maximum event
   
   Bool_t                 fDoTrackMatching;         // On/Off the matching recalulation to speed up analysis in PbPb
   Bool_t                 fSelectCell;              // Reject cells from cluster if energy is too low and recalculate position/energy and other
   Float_t                fSelectCellMinE;          // Min energy cell threshold, after unfolding
   Float_t                fSelectCellMinFrac;       // Min fraction of cell energy after unfolding cut
+  Bool_t                 fRejectBelowThreshold;    // split (false-default) or reject (true) cell energy below threshold after UF
   Bool_t                 fRemoveLEDEvents;         // Remove LED events, use only for LHC11a 
   Bool_t                 fRemoveExoticEvents;      // Remove exotic events
   
   Bool_t                 fImportGeometryFromFile;  // Import geometry settings in geometry.root file
   TString                fImportGeometryFilePath;  // path fo geometry.root file
 
-  Bool_t                 fOADBSet ;                //  AODB parameters already set
-  Bool_t                 fAccessOADB ;             //  Get calibration from OADB for EMCAL
-  TString                fOADBFilePath ;           //  Default path $ALICE_ROOT/OADB/EMCAL, if needed change
+  Bool_t                 fOADBSet ;                // AODB parameters already set
+  Bool_t                 fAccessOADB ;             // Get calibration from OADB for EMCAL
+  TString                fOADBFilePath ;           // Default path $ALICE_ROOT/OADB/EMCAL, if needed change
+    
+  //Centrality
+  TString                fCentralityClass;         // Name of selected centrality class     
+  Float_t                fCentralityBin[2];        // Minimum and maximum value of the centrality for the analysis
+  
+  // Event selection with some signal in EMCAL
+  Bool_t                 fSelectEMCALEvent;       //  Process the event if there is some high energy cluster 
+  Float_t                fEMCALEnergyCut;         //  At least an EMCAL cluster with this energy in the event
+  Int_t                  fEMCALNcellsCut;         //  At least an EMCAL cluster with fNCellsCut cells over fEnergyCut
+
+  Int_t                  fSetCellMCLabelFromCluster; // Use cluster MC label as cell label:
+                                                     // 0 - get the MC label stored in cells
+                                                     // 1 - from old way, select 2 most likely labels
+                                                     // 2 - from new way, get the original clusters, add all the MC labels (useful for any reclusterization with output V1 clusters)
+  Bool_t                 fRemapMCLabelForAODs ;      // Remap AOD cells MC label
+
   
+  Bool_t                 fInputFromFilter ;          // Get the input from AODs from the filter 
   
   AliAnalysisTaskEMCALClusterize(           const AliAnalysisTaskEMCALClusterize&); // not implemented
   AliAnalysisTaskEMCALClusterize& operator=(const AliAnalysisTaskEMCALClusterize&); // not implemented
 
-  ClassDef(AliAnalysisTaskEMCALClusterize, 20);
+  ClassDef(AliAnalysisTaskEMCALClusterize, 28);
 
 };