Class Reference for E1039 Core & Analysis Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
EventReducer.h
Go to the documentation of this file.
1 /*
2 EventReducer.h
3 
4 This class is intended to handle all the hit list manipulation/reduction,
5 The reduction methods could initialized once for all, and then it will update
6 the hit list stored in SRawEvent. It is declared as a friend class of SRawEvent.
7 
8 Author: Kun Liu, liuk@fnal.gov
9 Created: 06-17-2015
10 */
11 
12 #ifndef _EVENTREDUCER_H
13 #define _EVENTREDUCER_H
14 
15 #include <GlobalConsts.h>
16 
17 #include <list>
18 #include <map>
19 #include <TString.h>
20 #include <TRandom.h>
21 
22 #include "SRawEvent.h"
23 #include "TriggerAnalyzer.h"
24 
25 #include <phool/recoConsts.h>
26 #include <geom_svc/GeomSvc.h>
27 
29 {
30 public:
31  EventReducer(TString options);
32  ~EventReducer();
33 
34  //main external call
35  int reduceEvent(SRawEvent* rawEvent);
36 
37  //external handle to set chamber efficiency/resolution
38  void setChamEff(double val) { chamEff = val; }
39  void setChamResol(double val) { chamResol = val; }
40 
41  //sagitta ratio reducer
42  void sagittaReducer();
43 
44  //hough transform reducer
45  void houghReducer();
46 
47  //hit cluster remover
48  void deClusterize();
49  void processCluster(std::vector<std::list<Hit>::iterator>& cluster);
50 
51  //hodosope maksing
52  void initHodoMaskLUT();
53  void hodoscopeMask(std::list<Hit>& chamberhits, std::list<Hit>& hodohits);
54  bool lineCrossing(double x1, double y1, double x2, double y2,
55  double x3, double y3, double x4, double y4);
56 
57 private:
58  //pointer to geometry service, inited outside
59  GeomSvc* p_geomSvc;
60 
61  //pointer to the reco configuration
62  recoConsts* rc;
63 
64  //pointer to trigger analyzer, inited inside
65  TriggerAnalyzer* p_triggerAna;
66 
67  //Random number
68  TRandom rndm;
69 
70  //temporary container for the hit list
71  std::list<Hit> hitlist;
72  std::list<Hit> hodohitlist;
73 
74  //loop-up table of hodoscope masking
75  typedef std::map<int, std::vector<int> > LUT;
76  LUT h2celementID_lo;
77  LUT h2celementID_hi;
78  LUT c2helementIDs;
79 
80  //flags of the hit manipulation method
81  bool afterhit; //after pulse removal
82  bool hodomask; //hodoscope masking
83  bool outoftime; //out of time hit removal
84  bool decluster; //remove hit clusters in chamber
85  bool mergehodo; //merge trigger hit with hit
86  bool triggermask; //use active trigger road for track masking
87  bool sagitta; //remove the hits which cannot form a sagitta triplet
88  bool hough; //remove the hits which cannot form a peak in hough space, will be implemented later
89  bool externalpar; //re-apply the alignment and calibration parameters
90  bool realization; //apply detector efficiency and resolution by dropping and smear
91  bool difnim; //treat the nim/FPGA triggered events differently, i.e. no trigger masking in NIM events
92 
93  //Adjustable parameters
94  double timeOffset; //timing correction
95  double chamEff; //chamber efficiency
96  double chamResol; //chamber resolution
97 
98  //SagittaReducer parameters
99  double SAGITTA_DUMP_CENTER;
100  double SAGITTA_DUMP_WIDTH;
101  double SAGITTA_TARGET_CENTER;
102  double SAGITTA_TARGET_WIDTH;
103  double Z_TARGET;
104  double Z_DUMP;
105 
106  //Hodo masking parameters
107  double TX_MAX;
108  double TY_MAX;
109  bool USE_V1495_HIT;
110  bool USE_TWTDC_HIT;
111 };
112 
113 #endif
void sagittaReducer()
void houghReducer()
bool lineCrossing(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)
void processCluster(std::vector< std::list< Hit >::iterator > &cluster)
void setChamResol(double val)
Definition: EventReducer.h:39
EventReducer(TString options)
Definition: EventReducer.cxx:6
void initHodoMaskLUT()
int reduceEvent(SRawEvent *rawEvent)
void deClusterize()
void hodoscopeMask(std::list< Hit > &chamberhits, std::list< Hit > &hodohits)
void setChamEff(double val)
Definition: EventReducer.h:38