]> git.uio.no Git - u/mrichter/AliRoot.git/blob - ANALYSIS/AliTriggerAnalysis.h
removing new class from compiled code because it breaks compilation on some systems
[u/mrichter/AliRoot.git] / ANALYSIS / AliTriggerAnalysis.h
1 /* $Id: AliTriggerAnalysis.h 35782 2009-10-22 11:54:31Z jgrosseo $ */
2
3 #ifndef ALITRIGGERANALYSIS_H
4 #define ALITRIGGERANALYSIS_H
5
6 #include <TObject.h>
7
8 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
9  * See cxx source for full Copyright notice                               */
10
11 //-------------------------------------------------------------------------
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
15 //   Origin: Jan Fiete Grosse-Oetringhaus, CERN
16 //-------------------------------------------------------------------------
17
18 class AliESDEvent;
19 class AliESDtrackCuts;
20 class TH1F;
21 class TH2F;
22 class TCollection;
23 class TMap;
24
25 class AliTriggerAnalysis : public TObject
26 {
27   public:
28     enum Trigger { kAcceptAll = 1, kMB1 = 2, kMB2, kMB3, kSPDGFO, kSPDGFOBits, kV0A, kV0C, kV0OR, kV0AND, 
29                    kV0ABG, kV0CBG, kZDC, kZDCA, kZDCC, kZNA, kZNC, kZNABG, kZNCBG, kFMDA, kFMDC, kFPANY, kNSD1, kMB1Prime, 
30                    kSPDGFOL0, kSPDGFOL1, kZDCTDCA, kZDCTDCC, kZDCTime, kCTPV0A, kCTPV0C, kTPCLaserWarmUp, kSPDClsVsTrkBG,
31                    kCentral,kSemiCentral, kT0, kT0BG, kT0Pileup, kEMCAL,
32                    kStartOfFlags = 0x0100, kOfflineFlag = 0x8000, kOneParticle = 0x10000, kOneTrack = 0x20000}; // MB1, MB2, MB3 definition from ALICE-INT-2005-025
33     enum AliceSide { kASide = 1, kCSide, kCentralBarrel };
34     enum V0Decision { kV0Invalid = -1, kV0Empty = 0, kV0BB, kV0BG, kV0Fake };
35     enum T0Decision { kT0Invalid = -1, kT0Empty = 0, kT0BB, kT0DecBG, kT0DecPileup };
36     
37     AliTriggerAnalysis();
38     virtual ~AliTriggerAnalysis();
39     
40     void EnableHistograms();
41     void SetAnalyzeMC(Bool_t flag = kTRUE) { fMC = flag; }
42     
43     Bool_t IsTriggerFired(const AliESDEvent* aEsd, Trigger trigger);
44     Int_t EvaluateTrigger(const AliESDEvent* aEsd, Trigger trigger);
45     
46     // using trigger bits in ESD
47     Bool_t IsTriggerBitFired(const AliESDEvent* aEsd, Trigger trigger) const;
48     Bool_t IsTriggerBitFired(ULong64_t triggerMask, Trigger trigger) const;
49     Bool_t IsTriggerBitFired(const AliESDEvent* aEsd, ULong64_t tclass) const;
50     
51     // using ESD data from detectors
52     Bool_t IsOfflineTriggerFired(const AliESDEvent* aEsd, Trigger trigger);
53
54     // using trigger classes in ESD
55     Bool_t IsTriggerClassFired(const AliESDEvent* aEsd, const Char_t* tclass) const;
56     
57     // some "raw" trigger functions
58     Int_t SPDFiredChips(const AliESDEvent* aEsd, Int_t origin, Bool_t fillHists = kFALSE, Int_t layer = 0);
59     Bool_t SPDGFOTrigger(const AliESDEvent* aEsd, Int_t origin);
60     Bool_t IsSPDClusterVsTrackletBG(const AliESDEvent* esd, Bool_t fillHists = kFALSE);
61     V0Decision V0Trigger(const AliESDEvent* aEsd, AliceSide side, Bool_t online, Bool_t fillHists = kFALSE);
62     T0Decision T0Trigger(const AliESDEvent* aEsd, Bool_t online, Bool_t fillHists = kFALSE);
63     Bool_t ZDCTrigger   (const AliESDEvent* aEsd, AliceSide side) const;
64     Bool_t ZDCTDCTrigger(const AliESDEvent* aEsd, AliceSide side, Bool_t useZN=kTRUE, Bool_t useZP=kFALSE, Bool_t fillHists=kFALSE) const;
65     Bool_t ZDCTimeTrigger(const AliESDEvent *aEsd, Bool_t fillHists=kFALSE) const;
66     Bool_t ZDCTimeBGTrigger(const AliESDEvent *aEsd, AliceSide side) const;
67     Bool_t FMDTrigger(const AliESDEvent* aEsd, AliceSide side);
68     Int_t SSDClusters(const AliESDEvent* aEsd);
69     Bool_t EMCALCellsTrigger(const AliESDEvent *aEsd);
70     static const char* GetTriggerName(Trigger trigger);
71     
72     Bool_t IsLaserWarmUpTPCEvent(const AliESDEvent* esd);
73     
74     void FillHistograms(const AliESDEvent* aEsd);
75     void FillTriggerClasses(const AliESDEvent* aEsd);
76     
77     void SetSPDGFOThreshhold(Int_t t) { fSPDGFOThreshold = t; }
78     void SetSPDGFOEfficiency(TH1F* hist) { fSPDGFOEfficiency = hist; }
79     void SetSPDClustersVsTrackletsParameters(Float_t a, Float_t b) { fASPDCvsTCut = a; fBSPDCvsTCut =b;}
80     void SetV0TimeOffset(Float_t offset) { fV0TimeOffset = offset; }
81     void SetV0AdcThr(Float_t thr) { fV0AdcThr = thr; }
82     void SetV0HwPars(Float_t thr, Float_t winLow, Float_t winHigh) { fV0HwAdcThr = thr; fV0HwWinLow = winLow; fV0HwWinHigh = winHigh; }
83     void SetFMDThreshold(Float_t low, Float_t hit) { fFMDLowCut = low; fFMDHitCut = hit; }
84     void SetDoFMD(Bool_t flag = kTRUE) {fDoFMD = flag;}
85     void SetZDCCutParams(Float_t refSum, Float_t refDelta, Float_t sigmaSum, Float_t sigmaDelta) { fZDCCutRefSum = refSum; fZDCCutRefDelta = refDelta; fZDCCutSigmaSum = sigmaSum; fZDCCutSigmaDelta = sigmaDelta; }
86     void SetCorrZDCCutParams(Float_t refSum, Float_t refDelta, Float_t sigmaSum, Float_t sigmaDelta) { fZDCCutRefSumCorr = refSum; fZDCCutRefDeltaCorr = refDelta; fZDCCutSigmaSumCorr = sigmaSum; fZDCCutSigmaDeltaCorr = sigmaDelta; }
87     void SetZNCorrCutParams(Float_t znaTimeCorr, Float_t zncTimeCorr)
88     { fZDCCutZNATimeCorr = znaTimeCorr; fZDCCutZNCTimeCorr = zncTimeCorr; }
89
90     Int_t GetSPDGFOThreshhold() const { return fSPDGFOThreshold; }
91     Float_t GetV0TimeOffset() const { return fV0TimeOffset; }
92     Float_t GetV0AdcThr()     const { return fV0AdcThr; }
93     Float_t GetFMDLowThreshold() const { return fFMDLowCut; }
94     Float_t GetFMDHitThreshold() const { return fFMDHitCut; }
95     TMap * GetTriggerClasses() const { return fTriggerClasses;}
96
97
98     virtual Long64_t Merge(TCollection* list);
99     void SaveHistograms() const;
100     
101     void PrintTriggerClasses() const;
102     void SetESDTrackCuts(AliESDtrackCuts* cuts) { fEsdTrackCuts = cuts;}
103     AliESDtrackCuts* GetESDTrackCuts() const  {return fEsdTrackCuts;}
104
105     void SetTPCOnly(Bool_t bTPCOnly) {fTPCOnly = bTPCOnly;}
106     Bool_t GetTPCOnly() const {return fTPCOnly;}
107
108   protected:
109     Bool_t IsL0InputFired(const AliESDEvent* aEsd, UInt_t input) const;
110     Bool_t IsL1InputFired(const AliESDEvent* aEsd, UInt_t input) const;
111     Bool_t IsL2InputFired(const AliESDEvent* aEsd, UInt_t input) const;
112     Bool_t IsInputFired(const AliESDEvent* aEsd, Char_t level, UInt_t input) const;
113     
114     Float_t V0CorrectLeadingTime(Int_t i, Float_t time, Float_t adc, Int_t runNumber) const;
115     Float_t V0LeadingTimeWeight(Float_t adc) const;
116     
117     Int_t FMDHitCombinations(const AliESDEvent* aEsd, AliceSide side, Bool_t fillHists = kFALSE);
118
119     Int_t fSPDGFOThreshold;         // number of chips to accept a SPD GF0 trigger
120     TH1F* fSPDGFOEfficiency;         // SPD FASTOR efficiency - is applied in SPDFiredChips. Histogram contains efficiency as function of chip number (bin 1..400: first layer; 401..1200: second layer)
121     
122     Float_t fV0TimeOffset;          // time offset applied to the times read from the V0 (in ns)
123     Float_t fV0AdcThr;              // thresholds applied on V0 ADC data
124     Float_t fV0HwAdcThr;            // online V0 trigger - thresholds applied on ADC data 
125     Float_t fV0HwWinLow;            // online V0 trigger - lower edge of time window
126     Float_t fV0HwWinHigh;           // online V0 trigger - upper edge of time window
127     
128     Float_t fZDCCutRefSum;          // ZDC time cut configuration
129     Float_t fZDCCutRefDelta;        // ZDC time cut configuration
130     Float_t fZDCCutSigmaSum;        // ZDC time cut configuration
131     Float_t fZDCCutSigmaDelta;      // ZDC time cut configuration
132
133     Float_t fZDCCutRefSumCorr;      // Corrected ZDC time cut configuration
134     Float_t fZDCCutRefDeltaCorr;    // Corrected ZDC time cut configuration
135     Float_t fZDCCutSigmaSumCorr;    // Corrected ZDC time cut configuration
136     Float_t fZDCCutSigmaDeltaCorr;  // Corrected ZDC time cut configuration
137
138     Float_t fZDCCutZNATimeCorr;     // Corrected ZNA time cut configuration
139     Float_t fZDCCutZNCTimeCorr;     // Corrected ZNA time cut configuration
140
141     Float_t fASPDCvsTCut; // constant for the linear cut in SPD clusters vs tracklets
142     Float_t fBSPDCvsTCut; // slope for the linear cut in SPD  clusters vs tracklets
143
144
145
146     Bool_t  fDoFMD;                 // If false, skips the FMD (physics selection runs much faster)
147     Float_t fFMDLowCut;             // 
148     Float_t fFMDHitCut;             // 
149     
150     TH2F* fHistBitsSPD;        // offline trigger bits (calculated from clusters) vs hardware trigger bits
151     TH1F* fHistFiredBitsSPD;   // fired hardware bits
152     TH2F* fHistSPDClsVsTrk;    // histogram of clusters vs tracklet BG cut
153     TH1F* fHistV0A;            // histograms that histogram the criterion the cut is applied on: bb triggers
154     TH1F* fHistV0C;            // histograms that histogram the criterion the cut is applied on: bb triggers
155     TH1F* fHistZDC;            //histograms that histogram the criterion the cut is applied on: fired bits (6 bins)
156     TH1F* fHistTDCZDC;         // histograms that histogram the criterion the cut is applied on: TDC bits (32 bins)
157     TH2F* fHistTimeZDC;        // histograms that histogram the criterion the cut is applied on: ZDC TDC timing
158     TH2F* fHistTimeCorrZDC;    // histograms that histogram the criterion the cut is applied on: ZDC Corrected TDC timing
159     TH1F* fHistFMDA;           // histograms that histogram the criterion the cut is applied on: number of hit combination above threshold
160     TH1F* fHistFMDC;           // histograms that histogram the criterion the cut is applied on: number of hit combination above threshold
161     TH1F* fHistFMDSingle;      // histograms that histogram the criterion the cut is applied on: single mult value (more than one entry per event)
162     TH1F* fHistFMDSum;         // histograms that histogram the criterion the cut is applied on: summed mult value (more than one entry per event)
163     TH1F* fHistT0;             // histograms that histogram the criterion the cut is applied on: bb triggers
164     TMap* fTriggerClasses;    // counts the active trigger classes (uses the full string)
165     
166     Bool_t fMC;              // flag if MC is analyzed
167     AliESDtrackCuts* fEsdTrackCuts;  //Track Cuts to select ESD tracks
168
169     Bool_t fTPCOnly;         // flag to set whether TPC only tracks have to be used for the offline trigger 
170
171     ClassDef(AliTriggerAnalysis, 19)
172     
173   private:
174     AliTriggerAnalysis(const AliTriggerAnalysis&);
175     AliTriggerAnalysis& operator=(const AliTriggerAnalysis&);
176 };
177
178 #endif