Adding the aleph parametrization for real data
[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;
c01a136b 22class TMap;
ff8c4f30 23
70fdd197 24class AliTriggerAnalysis : public TObject
ff8c4f30 25{
26 public:
c01a136b 27 enum Trigger { kAcceptAll = 1, kMB1 = 2, kMB2, kMB3, kSPDGFO, kSPDGFOBits, kV0A, kV0C, kV0ABG, kV0CBG, kZDC, kZDCA, kZDCC, kFMDA, kFMDC, kFPANY, kStartOfFlags = 0x0100, kOfflineFlag = 0x8000 }; // MB1, MB2, MB3 definition from ALICE-INT-2005-025
c8d3e441 28 enum AliceSide { kASide = 1, kCSide, kCentralBarrel };
c01a136b 29 enum V0Decision { kV0Invalid = -1, kV0Empty = 0, kV0BB, kV0BG };
ff8c4f30 30
70fdd197 31 AliTriggerAnalysis();
32 virtual ~AliTriggerAnalysis() {}
907972ff 33
34 void EnableHistograms();
ff8c4f30 35
70fdd197 36 Bool_t IsTriggerFired(const AliESDEvent* aEsd, Trigger trigger) const;
37
38 // using trigger bits in ESD
39 Bool_t IsTriggerBitFired(const AliESDEvent* aEsd, Trigger trigger) const;
40 Bool_t IsTriggerBitFired(ULong64_t triggerMask, Trigger trigger) const;
41 Bool_t IsTriggerBitFired(const AliESDEvent* aEsd, ULong64_t tclass) const;
42
43 // using ESD data from detectors
44 Bool_t IsOfflineTriggerFired(const AliESDEvent* aEsd, Trigger trigger) const;
45
46 // using trigger classes in ESD
47 Bool_t IsTriggerClassFired(const AliESDEvent* aEsd, const Char_t* tclass) const;
48
c01a136b 49 // some "raw" trigger functions
50 Bool_t SPDGFOTrigger(const AliESDEvent* aEsd, Int_t origin) const;
51 V0Decision V0Trigger(const AliESDEvent* aEsd, AliceSide side, Bool_t fillHists = kFALSE) const;
52 Bool_t ZDCTrigger(const AliESDEvent* aEsd, AliceSide side) const;
53 Bool_t FMDTrigger(const AliESDEvent* aEsd, AliceSide side) const;
54
70fdd197 55 static const char* GetTriggerName(Trigger trigger);
56
907972ff 57 void FillHistograms(const AliESDEvent* aEsd);
c01a136b 58 void FillTriggerClasses(const AliESDEvent* aEsd);
ff8c4f30 59
60 void SetSPDGFOThreshhold(Int_t t) { fSPDGFOThreshold = t; }
61 void SetV0Threshhold(Int_t aSide, Int_t cSide) { fV0AThreshold = aSide; fV0CThreshold = cSide; }
7a11141c 62 void SetFMDThreshold(Float_t low, Float_t hit) { fFMDLowCut = low; fFMDHitCut = hit; }
ff8c4f30 63
64 Int_t GetSPDGFOThreshhold() const { return fSPDGFOThreshold; }
65 Int_t GetV0AThreshold() const { return fV0AThreshold; }
66 Int_t GetV0CThreshold() const { return fV0CThreshold; }
7a11141c 67 Float_t GetFMDLowThreshold() const { return fFMDLowCut; }
68 Float_t GetFMDHitThreshold() const { return fFMDHitCut; }
907972ff 69
70 virtual Long64_t Merge(TCollection* list);
71 void WriteHistograms() const;
c01a136b 72
73 void PrintTriggerClasses() const;
ff8c4f30 74
75 protected:
70fdd197 76 Bool_t IsL0InputFired(const AliESDEvent* aEsd, UInt_t input) const;
77 Bool_t IsL1InputFired(const AliESDEvent* aEsd, UInt_t input) const;
78 Bool_t IsL2InputFired(const AliESDEvent* aEsd, UInt_t input) const;
79 Bool_t IsInputFired(const AliESDEvent* aEsd, Char_t level, UInt_t input) const;
80
c2fff146 81 Int_t SPDFiredChips(const AliESDEvent* aEsd, Int_t origin, Bool_t fillHists = kFALSE) const;
907972ff 82
c01a136b 83 Float_t V0CorrectLeadingTime(Int_t i, Float_t time, Float_t adc) const;
907972ff 84
85 Int_t FMDHitCombinations(const AliESDEvent* aEsd, AliceSide side, Bool_t fillHistograms) const;
ff8c4f30 86
87 Int_t fSPDGFOThreshold; // number of chips to accept a SPD GF0 trigger
88 Int_t fV0AThreshold; // threshold for number of BB triggers in V0A
89 Int_t fV0CThreshold; // threshold for number of BB triggers in V0C
90
7a11141c 91 Float_t fFMDLowCut; //
92 Float_t fFMDHitCut; //
907972ff 93
c01a136b 94 TH2* fHistBitsSPD; // offline trigger bits (calculated from clusters) vs hardware trigger bits
c2fff146 95 TH1* fHistFiredBitsSPD; // fired hardware bits
907972ff 96 TH1* fHistV0A; // histograms that histogram the criterion the cut is applied on: bb triggers
97 TH1* fHistV0C; // histograms that histogram the criterion the cut is applied on: bb triggers
98 TH1* fHistZDC; // histograms that histogram the criterion the cut is applied on: fired bits (6 bins)
99 TH1* fHistFMDA; // histograms that histogram the criterion the cut is applied on: number of hit combination above threshold
100 TH1* fHistFMDC; // histograms that histogram the criterion the cut is applied on: number of hit combination above threshold
101 TH1* fHistFMDSingle; // histograms that histogram the criterion the cut is applied on: single mult value (more than one entry per event)
102 TH1* fHistFMDSum; // histograms that histogram the criterion the cut is applied on: summed mult value (more than one entry per event)
c01a136b 103
104 TMap* fTriggerClasses; // counts the active trigger classes (uses the full string)
105
7a11141c 106
c01a136b 107 ClassDef(AliTriggerAnalysis, 3)
ff8c4f30 108
109 private:
70fdd197 110 AliTriggerAnalysis(const AliTriggerAnalysis&);
111 AliTriggerAnalysis& operator=(const AliTriggerAnalysis&);
ff8c4f30 112};
113
114#endif