Further fix to make the alignment task work on grid
[u/mrichter/AliRoot.git] / PWG0 / AliTriggerAnalysis.h
CommitLineData
70fdd197 1/* $Id: AliTriggerAnalysis.h 35782 2009-10-22 11:54:31Z jgrosseo $ */
ff8c4f30 2
70fdd197 3#ifndef ALITRIGGERANALYSIS_H
4#define ALITRIGGERANALYSIS_H
ff8c4f30 5
6#include <TObject.h>
ff8c4f30 7
7a11141c 8/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
9 * See cxx source for full Copyright notice */
10
11//-------------------------------------------------------------------------
70fdd197 12// Implementation of Class AliTriggerAnalysis
13// This class provides function to check if events have been triggered based on the data in the ESD
14// The trigger bits, trigger class inputs and only the data (offline trigger) can be used
7a11141c 15// Origin: Jan Fiete Grosse-Oetringhaus, CERN
16//-------------------------------------------------------------------------
17
ff8c4f30 18class AliESDEvent;
907972ff 19class TH1;
90dc86e9 20class TH2;
70fdd197 21class TCollection;
ff8c4f30 22
70fdd197 23class AliTriggerAnalysis : public TObject
ff8c4f30 24{
25 public:
c2fff146 26 enum Trigger { kAcceptAll = 1, kMB1 = 2, kMB2, kMB3, kSPDGFO, kSPDGFOBits, kV0A, kV0C, kZDC, kZDCA, kZDCC, kFMDA, kFMDC, kFPANY, kStartOfFlags = 0x0100, kOfflineFlag = 0x8000 }; // MB1, MB2, MB3 definition from ALICE-INT-2005-025
c8d3e441 27 enum AliceSide { kASide = 1, kCSide, kCentralBarrel };
ff8c4f30 28
70fdd197 29 AliTriggerAnalysis();
30 virtual ~AliTriggerAnalysis() {}
907972ff 31
32 void EnableHistograms();
ff8c4f30 33
70fdd197 34 Bool_t IsTriggerFired(const AliESDEvent* aEsd, Trigger trigger) const;
35
36 // using trigger bits in ESD
37 Bool_t IsTriggerBitFired(const AliESDEvent* aEsd, Trigger trigger) const;
38 Bool_t IsTriggerBitFired(ULong64_t triggerMask, Trigger trigger) const;
39 Bool_t IsTriggerBitFired(const AliESDEvent* aEsd, ULong64_t tclass) const;
40
41 // using ESD data from detectors
42 Bool_t IsOfflineTriggerFired(const AliESDEvent* aEsd, Trigger trigger) const;
43
44 // using trigger classes in ESD
45 Bool_t IsTriggerClassFired(const AliESDEvent* aEsd, const Char_t* tclass) const;
46
47 static const char* GetTriggerName(Trigger trigger);
48
907972ff 49 void FillHistograms(const AliESDEvent* aEsd);
ff8c4f30 50
51 void SetSPDGFOThreshhold(Int_t t) { fSPDGFOThreshold = t; }
52 void SetV0Threshhold(Int_t aSide, Int_t cSide) { fV0AThreshold = aSide; fV0CThreshold = cSide; }
7a11141c 53 void SetFMDThreshold(Float_t low, Float_t hit) { fFMDLowCut = low; fFMDHitCut = hit; }
ff8c4f30 54
55 Int_t GetSPDGFOThreshhold() const { return fSPDGFOThreshold; }
56 Int_t GetV0AThreshold() const { return fV0AThreshold; }
57 Int_t GetV0CThreshold() const { return fV0CThreshold; }
7a11141c 58 Float_t GetFMDLowThreshold() const { return fFMDLowCut; }
59 Float_t GetFMDHitThreshold() const { return fFMDHitCut; }
907972ff 60
61 virtual Long64_t Merge(TCollection* list);
62 void WriteHistograms() const;
ff8c4f30 63
64 protected:
70fdd197 65 Bool_t IsL0InputFired(const AliESDEvent* aEsd, UInt_t input) const;
66 Bool_t IsL1InputFired(const AliESDEvent* aEsd, UInt_t input) const;
67 Bool_t IsL2InputFired(const AliESDEvent* aEsd, UInt_t input) const;
68 Bool_t IsInputFired(const AliESDEvent* aEsd, Char_t level, UInt_t input) const;
69
c2fff146 70 Int_t SPDFiredChips(const AliESDEvent* aEsd, Int_t origin, Bool_t fillHists = kFALSE) const;
71 Bool_t SPDGFOTrigger(const AliESDEvent* aEsd, Int_t origin) const;
907972ff 72
73 Int_t V0BBTriggers(const AliESDEvent* aEsd, AliceSide side) const;
ff8c4f30 74 Bool_t V0Trigger(const AliESDEvent* aEsd, AliceSide side) const;
907972ff 75
ff8c4f30 76 Bool_t ZDCTrigger(const AliESDEvent* aEsd, AliceSide side) const;
907972ff 77
78 Int_t FMDHitCombinations(const AliESDEvent* aEsd, AliceSide side, Bool_t fillHistograms) const;
7a11141c 79 Bool_t FMDTrigger(const AliESDEvent* aEsd, AliceSide side) const;
ff8c4f30 80
81 Int_t fSPDGFOThreshold; // number of chips to accept a SPD GF0 trigger
82 Int_t fV0AThreshold; // threshold for number of BB triggers in V0A
83 Int_t fV0CThreshold; // threshold for number of BB triggers in V0C
84
7a11141c 85 Float_t fFMDLowCut; //
86 Float_t fFMDHitCut; //
907972ff 87
88 TH1* fHistSPD; // histograms that histogram the criterion the cut is applied on: fired chips
90dc86e9 89 TH2* fHistBitsSPD; // offline trigger bits vs hardware trigger bits
c2fff146 90 TH1* fHistFiredBitsSPD; // fired hardware bits
907972ff 91 TH1* fHistV0A; // histograms that histogram the criterion the cut is applied on: bb triggers
92 TH1* fHistV0C; // histograms that histogram the criterion the cut is applied on: bb triggers
93 TH1* fHistZDC; // histograms that histogram the criterion the cut is applied on: fired bits (6 bins)
94 TH1* fHistFMDA; // histograms that histogram the criterion the cut is applied on: number of hit combination above threshold
95 TH1* fHistFMDC; // histograms that histogram the criterion the cut is applied on: number of hit combination above threshold
96 TH1* fHistFMDSingle; // histograms that histogram the criterion the cut is applied on: single mult value (more than one entry per event)
97 TH1* fHistFMDSum; // histograms that histogram the criterion the cut is applied on: summed mult value (more than one entry per event)
7a11141c 98
c2fff146 99 ClassDef(AliTriggerAnalysis, 2)
ff8c4f30 100
101 private:
70fdd197 102 AliTriggerAnalysis(const AliTriggerAnalysis&);
103 AliTriggerAnalysis& operator=(const AliTriggerAnalysis&);
ff8c4f30 104};
105
106#endif