StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
StBfcTriggerFilterMaker.h
1 // -*- mode:c++ -*-
2 //
3 // Pibero Djawotho <pibero@tamu.edu>
4 // Texas A&M University
5 // 10 Dec 2009
6 //
7 // Trigger filter to accept events that fire selected bits of the
8 // output of the EMC layer 2 DSM, EM201. The output is a 16-bit integer
9 // that forms the basis of the trigger decision by the calorimeters.
10 // The definiton of the bits follows (as of Run 9):
11 //
12 // (Bit 0:3) Barrel HT bits (4 bits)
13 // (4:5) Endcap HT bits (2)
14 // (6) JP1, unified over the BEMC+EEMC (1)
15 // (7) JP2, unified over the BEMC+EEMC (1)
16 // (8) BJP1 for the 18 BEMC-only patches (1)
17 // (9) BJP2 for the 18 BEMC-only patches (1)
18 // (10) EJP1 for the 6 EEMC-only patches (1)
19 // (11) EJP2 for the 6 EEMC-only patches (1)
20 // (12) AJP for BEMC and EEMC but NOT the boundary (1)
21 // (13) BAJP for the BEMC-only patches (1)
22 // (14) EAJP for the EEMC-only patches (1)
23 // (15) JP0, unified over the BEMC+EEMC
24 //
25 // J.M. Engelage, C. Gagliardi, E.G. Judd: The Recabling Scheme and the New Algorithms for the EMC Trigger (April 5, 2010)
26 //
27 // http://www.star.bnl.gov/public/trg/run2009/emc_recabling.pdf
28 //
29 // An example usage is shown in the BFC macro bfcSpin.C that takes as input
30 // a fzd file then process each event through the EMC response.
31 // If the event doesn't fire any selected trigger from the EMC response
32 // alone further reconstruction is aborted at this stage. This is
33 // especially handy to decide whether or not to continue reconstruction of
34 // detectors like the TPC which can be computationally intensive.
35 
36 #ifndef ST_BFC_TRIGGER_FILTER_MAKER_H
37 #define ST_BFC_TRIGGER_FILTER_MAKER_H
38 
39 // C++ STL
40 #include <bitset>
41 #include <vector>
42 
43 using namespace std;
44 
45 // ROOT
46 #include "StMaker.h"
47 
49 public:
50  StBfcTriggerFilterMaker(const char* name = "TriggerFilter")
51  : StMaker(name)
52  , mOkAllEvents(0)
53  , mSkipAllEvents(0)
54  {
55  }
56 
57  int Init();
58  int Make();
59 
60  void SetBHT0(int value = 1) { mMask.set(0,value); }
61  void SetBHT1(int value = 1) { mMask.set(1,value); }
62  void SetBHT2(int value = 1) { mMask.set(2,value); }
63  void SetBHT3(int value = 1) { mMask.set(3,value); }
64  void SetEHT0(int value = 1) { mMask.set(4,value); }
65  void SetEHT1(int value = 1) { mMask.set(5,value); }
66  void SetJP1 (int value = 1) { mMask.set(6,value); }
67  void SetJP2 (int value = 1) { mMask.set(7,value); }
68  void SetBJP1(int value = 1) { mMask.set(8,value); }
69  void SetBJP2(int value = 1) { mMask.set(9,value); }
70  void SetEJP1(int value = 1) { mMask.set(10,value); }
71  void SetEJP2(int value = 1) { mMask.set(11,value); }
72  void SetAJP (int value = 1) { mMask.set(12,value); }
73  void SetBAJP(int value = 1) { mMask.set(13,value); }
74  void SetEAJP(int value = 1) { mMask.set(14,value); }
75  void SetJP0 (int value = 1) { mMask.set(15,value); }
76 
77  void changeJPThresh(int dsm);
78  void SetOkAllEvents (int ok = 1) { mOkAllEvents = ok ; }
79  void SetSkipAllEvents(int skip = 1) { mSkipAllEvents = skip; }
80  void addTrigger(int triggerId) { mTriggers.push_back(triggerId); }
81 
82 private:
83  bitset<16> mMask;
84  vector<int> mTriggers;
85  int mOkAllEvents;
86  int mSkipAllEvents;
87 
88  ClassDef(StBfcTriggerFilterMaker,0);
89 };
90 
91 #endif // ST_BFC_TRIGGER_FILTER_MAKER_H
void SetOkAllEvents(int ok=1)
Changes the JP Thresholds by dsm.