]> git.uio.no Git - u/mrichter/AliRoot.git/blame - ANALYSIS/AliTRDTriggerAnalysis.h
From Jochen Klein: patch which extends the functionality of
[u/mrichter/AliRoot.git] / ANALYSIS / AliTRDTriggerAnalysis.h
CommitLineData
99d87d49 1/* Copyright(c) 2013, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice */
3
4// evaluate TRD trigger conditions,
5// potentially with hardened conditions to remove
6// triggers caused by conversions of low-pt photons
7// at large radii
8//
9// Author: Jochen Klein <jochen.klein@cern.ch>
10
11#ifndef ALITRDTRIGGERANALYSIS_H
12#define ALITRDTRIGGERANALYSIS_H
13
d384e2d6 14class AliVEvent;
99d87d49 15
16class AliTRDTriggerAnalysis : public TObject
17{
18public:
19 AliTRDTriggerAnalysis();
20 ~AliTRDTriggerAnalysis();
21
16edfc85 22 enum TRDTrigger_t { kHCO = 0, kHJT, kHSE, kHQU, kHEE, kHlast };
99d87d49 23
16edfc85 24 void ResetTriggers();
d384e2d6 25 Bool_t CalcTriggers(const AliVEvent* event);
99d87d49 26
16edfc85
AG
27 Bool_t IsFired(TRDTrigger_t trg) const {
28 Obsolete("IsFired(...) is deprecated, use CheckCondition instead",
29 "now", "asap");
30 return CheckCondition(trg);
31 }
32
33 Bool_t HasTriggeredConfirmed(TRDTrigger_t trg) const {
34 return (HasTriggered(trg) && CheckCondition(trg));
35 }
36 Bool_t HasTriggered(TRDTrigger_t trg) const {
37 return (fTriggerClasses & (1 << trg));
38 }
39 Bool_t HasFired(TRDTrigger_t trg) const {
40 return (fTriggerInputs & (1 << trg));
41 }
42 Bool_t CheckCondition(TRDTrigger_t trg) const {
43 return (fTriggerFlags[2 * trg] | fTriggerFlags[2 * trg + 1]);
44 }
45 Bool_t CheckCondition(TRDTrigger_t trg, Int_t stack) const {
46 Int_t idx = 2 * trg + (stack / 64);
47 Int_t bit = stack % 64;
48 return (fTriggerFlags[idx] & (1ULL << bit));
49 }
50
51 Bool_t CheckTrgFlags(Int_t bit, Int_t sector) const {
52 return (fTriggerContribs[sector] & (1 << bit));
53 }
54
55 void SetRequireMatch(Bool_t val) { fRequireMatch = val; }
56 Bool_t GetRequireMatch() const { return fRequireMatch; }
57
58 void SetRequireMatchElectron(Bool_t val) { fRequireMatchElectron = val; }
59 Bool_t GetRequireMatchElectron() const { return fRequireMatchElectron; }
60
61 void SetRequireInTime(Bool_t val) { fRequireInTime = val; }
62 Bool_t GetRequireInTime() const { return fRequireInTime; }
63
64 void SetVerbosity(UChar_t val) { fVerbosity = val; }
65 UChar_t GetVerbosity() const { return fVerbosity; }
99d87d49 66
67protected:
16edfc85
AG
68 void MarkClass(TRDTrigger_t trg) { fTriggerClasses |= (1 << trg); }
69 void MarkInput(TRDTrigger_t trg) { fTriggerInputs |= (1 << trg); }
70 void MarkCondition(TRDTrigger_t trg, Int_t stack)
71 {
72 Int_t idx = 2 * trg + (stack / 64);
73 Int_t bit = stack % 64;
74 fTriggerFlags[idx] |= (1ULL << bit);
75 }
76
77
78 static const Int_t fgkNstacks = 90; // no. of TRD stacks (global)
79 ULong64_t fTriggerFlags[2 * kHlast]; //! internal representation of condition checks
80 UChar_t fTriggerInputs; //! internal representation of trigger inputs
81 UChar_t fTriggerClasses; //! internal representation of trigger classes
99d87d49 82
83 // configuration
16edfc85 84 UChar_t fVerbosity; // verbosity level
99d87d49 85 Bool_t fRequireMatch; // require a matched global track
86 // for all conditions
87 Bool_t fRequireMatchElectron; // require a matched global track
88 // for the electron conditions
89 Bool_t fRequireInTime; // require the tracks to be in time
90
91 // trigger thresholds
16edfc85
AG
92 UChar_t fTRDlayerMaskEl; // mask for tracklet requirements
93 UChar_t fTRDnTrackletsEl; // min. number of tracklets
99d87d49 94 Float_t fTRDptHSE; // pt threshold for HSE trigger
95 UChar_t fTRDpidHSE; // PID threshold for HSE trigger
96 Float_t fTRDptHQU; // pt threshold for HQU trigger
97 UChar_t fTRDpidHQU; // PID threshold for HQU trigger
98 Float_t fTRDptHEE; // pt threshold for HEE trigger
99 UChar_t fTRDpidHEE; // PID threshold for HEE trigger
100 UChar_t fTRDminSectorHEE; // min sector for HEE trigger
101 UChar_t fTRDmaxSectorHEE; // max sector for HEE trigger
102 Float_t fTRDptHJT; // pt threshold for HJT trigger
103 UChar_t fTRDnHJT; // no of track threshold for HJT trigger
104
16edfc85
AG
105 UInt_t fTriggerContribs[18]; // temporary for debugging !!!
106
99d87d49 107 ClassDef(AliTRDTriggerAnalysis, 1);
108};
109
110#endif