<commit_before>/* $Id: AliPhysicsSelection.h 35782 2009-10-22 11:54:31Z jgrosseo $ */

#ifndef ALIPHYSICSSELECTION_H
#define ALIPHYSICSSELECTION_H

/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 * See cxx source for full Copyright notice                               */

//-------------------------------------------------------------------------
//                      Implementation of   Class AliPhysicsSelection
// 
// This class selects collision candidates from data runs, applying selection cuts on triggers 
// and background rejection based on the content of the ESD
//
//   Origin: <NAME>, CERN
//           <NAME>, CERN
//-------------------------------------------------------------------------

#include <AliAnalysisCuts.h>
#include <TList.h>
#include "TObjString.h"
#include "AliVEvent.h"
#include "AliAnalysisManager.h"

//#define VERBOSE_STAT

class AliESDEvent;
class TH2F;
class TH1F;
class TCollection;
class AliTriggerAnalysis;
class AliAnalysisTaskSE;
class AliOADBPhysicsSelection ;
class AliOADBFillingScheme    ;
class AliOADBTriggerAnalysis;
class TPRegexp;

class AliPhysicsSelection : public AliAnalysisCuts
{
public:

public:
  enum {kStatTriggerClass=1,kStatHWTrig,kStatV0ABG,kStatV0CBG,kStatMB1,kStatMB1Prime,kStatLaserCut,kStatFO1,kStatFO2,kStatFO2L1,kStatV0A,kStatV0C,kStatZDCA,kStatZDCC,kStatZDCAC,kStatZDCTime,kStatV0,kStatOffline,kStatBG,kStatAccepted};

#ifdef VERBOSE_STAT
  enum {kStatRowAllB=0, kStatRowAllAC, kStatRowAllE, kStatRowBG,kStatRowAcc,kStatRowBGFrac,kStatRowAccFrac,kStatRowErrGoodFrac,kStatRowGoodFrac,kStatRowErrGood,kStatRowGood}; // offset wrt fBGStatOffset
#else
  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 *);

  AliPhysicsSelection();
  virtual ~AliPhysicsSelection();
    
  // AliAnalysisCuts interface
  virtual UInt_t GetSelectionMask(const TObject* obj) { return IsCollisionCandidate((const AliESDEvent*) obj); }
  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(const AliESDEvent* aEsd);
  Bool_t Initialize(Int_t runNumber);
    
  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(const Option_t* option = "") const;
  virtual Long64_t Merge(TCollection* list);
  void SaveHistograms(const char* folder = 0);
    
  const TList* GetCollisionTriggerClasses() const { return &fCollTrigClasses; }
  const TList* GetBGTriggerClasses()        const { return &fBGTrigClasses; }
  void AddCollisionTriggerClass(const char* className);
  void AddBGTriggerClass(const char* className)       ;
  void SetCustomOADBObjects(AliOADBPhysicsSelection * oadbPS, AliOADBFillingScheme * oadbFS, AliOADBTriggerAnalysis * oadbTA = 0) { fPSOADB = oadbPS; fFillOADB = oadbFS; fTriggerOADB = oadbTA; fUsingCustomClasses = kTRUE;}
  const AliOADBPhysicsSelection * GetOADBPhysicsSelection() const {return fPSOADB;  }
  const AliOADBFillingScheme    * GetOADBFillingScheme()    const {return fFillOADB;}
  const AliOADBTriggerAnalysis  * GetOADBTriggerAnalysis()  const {return fTriggerOADB;}

  const Int_t GetBGStatOffset() const { return fBGStatOffset; }


  AliTriggerAnalysis* GetTriggerAnalysis(Int_t i = 0) { return (fTriggerAnalysis.GetEntries() > 0) ? (AliTriggerAnalysis*) fTriggerAnalysis.At(i) : 0; }    
    
  const TH2F* GetStatisticsHistogram(Int_t idx=kStatIdxAll) const { return fHistStatistics[idx]; }
  const TH2F* GetBunchCrossingHistogram() const { return fHistBunchCrossing; }
  virtual TObject *GetStatistics(const Option_t *option) const;
    
  void SetBIFactors(const AliESDEvent * aESD);<commit_msg>coverity fix<commit_after>/* $Id: AliPhysicsSelection.h 35782 2009-10-22 11:54:31Z jgrosseo $ */

#ifndef ALIPHYSICSSELECTION_H
#define ALIPHYSICSSELECTION_H

/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
 * See cxx source for full Copyright notice                               */

//-------------------------------------------------------------------------
//                      Implementation of   Class AliPhysicsSelection
// 
// This class selects collision candidates from data runs, applying selection cuts on triggers 
// and background rejection based on the content of the ESD
//
//   Origin: <NAME>, CERN
//           <NAME>, CERN
//-------------------------------------------------------------------------

#include <AliAnalysisCuts.h>
#include <TList.h>
#include "TObjString.h"
#include "AliVEvent.h"
#include "AliAnalysisManager.h"

//#define VERBOSE_STAT

class AliESDEvent;
class TH2F;
class TH1F;
class TCollection;
class AliTriggerAnalysis;
class AliAnalysisTaskSE;
class AliOADBPhysicsSelection ;
class AliOADBFillingScheme    ;
class AliOADBTriggerAnalysis;
class TPRegexp;

class AliPhysicsSelection : public AliAnalysisCuts
{
public:

public:
  enum {kStatTriggerClass=1,kStatHWTrig,kStatV0ABG,kStatV0CBG,kStatMB1,kStatMB1Prime,kStatLaserCut,kStatFO1,kStatFO2,kStatFO2L1,kStatV0A,kStatV0C,kStatZDCA,kStatZDCC,kStatZDCAC,kStatZDCTime,kStatV0,kStatOffline,kStatBG,kStatAccepted};

#ifdef VERBOSE_STAT
  enum {kStatRowAllB=0, kStatRowAllAC, kStatRowAllE, kStatRowBG,kStatRowAcc,kStatRowBGFrac,kStatRowAccFrac,kStatRowErrGoodFrac,kStatRowGoodFrac,kStatRowErrGood,kStatRowGood}; // offset wrt fBGStatOffset
#else
  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 *);

  AliPhysicsSelection();
  virtual ~AliPhysicsSelection();
    
  // AliAnalysisCuts interface
  virtual UInt_t GetSelectionMask(const TObject* obj) { return IsCollisionCandidate((const AliESDEvent*) obj); }
  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(const AliESDEvent* aEsd);
  Bool_t Initialize(Int_t runNumber);
    
  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(const Option_t* option = "") const;
  virtual Long64_t Merge(TCollection* list);
  void SaveHistograms(const char* folder = 0);
    
  const TList* GetCollisionTriggerClasses() const { return &fCollTrigClasses; }
  const TList* GetBGTriggerClasses()        const { return &fBGTrigClasses; }
  void AddCollisionTriggerClass(const char* className);
  void AddBGTriggerClass(const char* className)       ;
  void SetCustomOADBObjects(AliOADBPhysicsSelection * oadbPS, AliOADBFillingScheme * oadbFS, AliOADBTriggerAnalysis * oadbTA = 0) { fPSOADB = oadbPS; fFillOADB = oadbFS; fTriggerOADB = oadbTA; fUsingCustomClasses = kTRUE;}
  const AliOADBPhysicsSelection * GetOADBPhysicsSelection() const {return fPSOADB;  }
  const AliOADBFillingScheme    * GetOADBFillingScheme()    const {return fFillOADB;}
  const AliOADBTriggerAnalysis  * GetOADBTriggerAnalysis()  const {return fTriggerOADB;}

  Int_t GetBGStatOffset() const { return fBGStatOffset; }


  AliTriggerAnalysis* GetTriggerAnalysis(Int_t i = 0) { return (fTriggerAnalysis.GetEntries() > 0) ? (AliTriggerAnalysis*) fTriggerAnalysis.At(i) : 0; }    
    
  const TH2F* GetStatisticsHistogram(Int_t idx=kStatIdxAll) const { return fHistStatistics[idx]; }
  const TH2F* GetBunchCrossingHistogram() const { return fHistBunchCrossing; }
  virtual TObject *GetStatistics(const Option_t *option) const;
    
  void SetBIFactors(const AliESDEvent * aESD);
{'fraction_non_alphanumeric': 0.12055175611452416, 'fraction_numerical': 0.014837139214095282, 'mean_word_length': 4.355679702048417, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3602429', 'n_tokens_mistral': 2988, 'n_tokens_neox': 2875, 'n_words': 619}