]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - ANALYSIS/AliPhysicsSelection.h
changing default for cut on tracks which have shared TPC clusters to ***OFF*** (was...
[u/mrichter/AliRoot.git] / ANALYSIS / AliPhysicsSelection.h
index 3045993c9da6575f7436214d849a6ec406515247..6c6e6223c90c4f2ff2d15fd779ad96e644199358 100644 (file)
@@ -19,8 +19,9 @@
 #include <AliAnalysisCuts.h>
 #include <TList.h>
 #include "TObjString.h"
+#include "AliVEvent.h"
 
-#define VERBOSE_STAT
+//#define VERBOSE_STAT
 
 class AliESDEvent;
 class TH2F;
@@ -29,21 +30,22 @@ class TCollection;
 class AliTriggerAnalysis;
 class AliAnalysisTaskSE;
 
+
 class AliPhysicsSelection : public AliAnalysisCuts
 {
 public:
 
 public:
-  enum {kStatTriggerClass=1,kStatHWTrig,kStatV0ABG,kStatV0CBG,kStatMB1,kStatMB1Prime,kStatFMD,kStatFO1,kStatFO2,kStatV0A,kStatV0C,kStatSSD1,kStatFO1AndV0,kStatV0,kStatAny2Hits,kStatOffline,kStatBG,kStatAccepted};
+  enum {kStatTriggerClass=1,kStatHWTrig,kStatV0ABG,kStatV0CBG,kStatMB1,kStatMB1Prime,kStatFMD,kStatFO1,kStatFO2,kStatFO2L1,kStatV0A,kStatV0C,kStatZDCA,kStatZDCC,kStatZDCAC,kStatZDCTime,kStatV0,kStatOffline,kStatBG,kStatAccepted};
 
 #ifdef VERBOSE_STAT
-  enum {kStatRowBG=5,kStatRowAcc,kStatRowBGFrac,kStatRowAccFrac,kStatRowErrGoodFrac,kStatRowGoodFrac,kStatRowErrGood,kStatRowGood};
+  enum {kStatRowAllB=0, kStatRowAllAC, kStatRowAllE, kStatRowBG,kStatRowAcc,kStatRowBGFrac,kStatRowAccFrac,kStatRowErrGoodFrac,kStatRowGoodFrac,kStatRowErrGood,kStatRowGood}; // offset wrt fBGStatOffset
 #else
-  enum {kStatRowBG=5,kStatRowAcc,kStatRowGood};
+  enum {kStatRowAllB=0, kStatRowAllAC, kStatRowAllE, kStatRowBG, kStatRowAcc,kStatRowGood}; // offset wrt fBGStatOffset
 #endif
 
   enum {kStatIdxAll=0,kStatIdxBin0=1};
-
+  enum ETriggerLogic { kCINT1 = 0, kCMBS2A, kCMBS2C, kCMBAC, kCMBACS2, kHighMultL1 };
 
   typedef Bool_t (*Bin0Callback_t)(const AliESDEvent *);
 
@@ -55,18 +57,21 @@ public:
   virtual Bool_t IsSelected(TList*) { return kFALSE; }
   virtual Bool_t IsSelected(TObject*)  {return kFALSE;}
     
+  Int_t  GetCurrentRun() const {return fCurrentRun;}
   UInt_t IsCollisionCandidate(const AliESDEvent* aEsd);
-  Bool_t Initialize(Int_t runNumber);
+  Bool_t Initialize(const AliESDEvent* aEsd);
+  Bool_t Initialize(Int_t runNumber, Bool_t pp);
     
   void SetAnalyzeMC(Bool_t flag = kTRUE) { fMC = flag; }
   void SetSkipTriggerClassSelection(Bool_t flag = kTRUE) { fSkipTriggerClassSelection = flag; }
   void SetSkipV0(Bool_t flag=kTRUE) { fSkipV0 = flag;}
+  void SetSkipZDCTime(Bool_t flag=kTRUE) { fSkipZDCTime = flag;}
    
   void AddBackgroundIdentification(AliAnalysisCuts* background) { fBackgroundIdentification = background; }
     
   virtual void Print(Option_t* option = "") const;
   virtual Long64_t Merge(TCollection* list);
-  void SaveHistograms(const char* folder = 0) const;
+  void SaveHistograms(const char* folder = 0);
     
   const TList* GetCollisionTriggerClasses() const { return &fCollTrigClasses; }
   const TList* GetBGTriggerClasses()        const { return &fBGTrigClasses; }
@@ -77,22 +82,23 @@ public:
     
   const TH2F* GetStatisticsHistogram(Int_t idx=kStatIdxAll) const { return fHistStatistics[idx]; }
   const TH2F* GetBunchCrossingHistogram() const { return fHistBunchCrossing; }
+  virtual TObject *GetStatistics(Option_t *option) const;
     
-  void SetBIFactors(Int_t run);
+  void SetBIFactors(const AliESDEvent * aESD);
   
   void SetUseBXNumbers(Bool_t flag = kTRUE) {fUseBXNumbers = flag;}
-  void SetComputeBG   (Bool_t flag = kTRUE) {fComputeBG    = flag; if(flag) fUseBXNumbers = flag;}
-  void SetUseMuonTriggers(Bool_t flag = kTRUE) { Printf("ERROR: Use of AliPhysicsSelection::SetUseMuonTriggers is deprecated. Use AliVEvent::kMUON selection instead.", flag); }
+  void SetComputeBG   (UInt_t flag = AliVEvent::kMB) {fComputeBG    = flag; if(flag) fUseBXNumbers = flag;}
+  void SetUseMuonTriggers(Bool_t) { Printf("ERROR: Use of AliPhysicsSelection::SetUseMuonTriggers is deprecated. Use AliVEvent::kMUON selection instead."); }
   void SetBin0Callback( const char * cb) {fBin0CallBack = cb;} 
   void SetBin0CallbackViaPointer( Bin0Callback_t cb) {fBin0CallBackPointer = cb;}// WARNING: THIS SHOULD NOT BE USED, WILL BE REMOVED SOON
   
-
 protected:
-  UInt_t CheckTriggerClass(const AliESDEvent* aEsd, const char* trigger) const;
+  UInt_t CheckTriggerClass(const AliESDEvent* aEsd, const char* trigger, Int_t& triggerLogic) const;
   Int_t GetTriggerScheme(UInt_t runNumber) const;
   const char * GetBXIDs(UInt_t runNumber, const char * trigger ) ;
   const char * GetFillingScheme(UInt_t runNumber) ;
   TH2F * BookHistStatistics(const char * tag) ;
+  Int_t GetStatRow(const char * triggerBXClass, UInt_t offlineTriggerType, UInt_t ** rowIDs) const;
 
   Int_t fCurrentRun;      // run number for which the object is initialized
   Bool_t fMC;             // flag if MC is analyzed
@@ -110,12 +116,16 @@ protected:
   Bool_t fSkipTriggerClassSelection;  // flag that determines if the trigger classs selection is skipped
   Bool_t fUsingCustomClasses;         // flag that is set if costum trigger classes are defined
   Bool_t fSkipV0;                     // ignore information from v0
+  Bool_t fSkipZDCTime;                     // ignore ZDC timing cut (used in HI)
 
   Float_t fBIFactorA;                 // ratio of interacting over non interacting bunch intensities for beam 1
   Float_t fBIFactorC;                 // ratio of interacting over non interacting bunch intensities for beam 2
+  Float_t fBIFactorAC;                // ratio of interacting over non interacting bunch intensities for beam 1&2: 
+                                      // for some trigger classes we do not distinguish betweem 1 and 2
 
 
-  Bool_t fComputeBG; // Switch on computation of background and filling of relevant stat table entries. If you enable this you can only process one run at a time (the relative bunch intensity used to compute this chages from run to run)
+  UInt_t fComputeBG; // Switch on computation of background and filling of relevant stat table entries. If you enable this you can only process one run at a time (the relative bunch intensity used to compute this chages from run to run); This is a mask of the trigger types to be used in the selection, as defined in AliVEvent
+  Int_t fBGStatOffset; // Offset of the BG statistics computed at the end of the processing. It depends on how many trigger classes you have selected
   Bool_t fUseBXNumbers;        // Explicitely select "good" bunch crossing numbers (exclude pilot, afterpulses and fakes). If you anable this you can only process  runs within the same filling scheme.
   Bool_t fUseMuonTriggers;     // if true, also use the muon triggers
   TString fFillingScheme; // stores the filling scheme of the current run.
@@ -123,7 +133,9 @@ protected:
   TString fBin0CallBack; // callback used to determine if an event is in the bin0 (name of the task where the callback is implemented);
   Bin0Callback_t fBin0CallBackPointer; //! don't stream this. TO BE REMOVED SOON
 
-  ClassDef(AliPhysicsSelection, 9)
+  Bool_t fIsPP; // True if processing pp run, false if heavy ion
+
+  ClassDef(AliPhysicsSelection, 12)
     
     private:
   AliPhysicsSelection(const AliPhysicsSelection&);