EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DSTEmulator.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file DSTEmulator.h
1 #ifndef G4EVAL_DSTEMULATOR_H
2 #define G4EVAL_DSTEMULATOR_H
3 
9 #include <fun4all/SubsysReco.h>
10 #include <trackbase/TrkrDefs.h>
14 
15 #include <map>
16 #include <set>
17 #include <string>
18 #include <vector>
19 #include <TRandom.h>
20 
21 #include "DSTCompressor.h"
22 
23 class PHG4Hit;
24 class PHG4HitContainer;
25 class PHG4Particle;
27 class SvtxTrack;
28 class SvtxTrackMap;
30 class TrkrCluster;
34 class TrkrHitTruthAssoc;
35 
36 class TFile;
37 class TNtuple;
38 
39 class DSTEmulator : public SubsysReco
40 {
41  public:
42 
44  DSTEmulator( const std::string& = "DSTEmulator",
45  const std::string &filename = "DSTana.root",
46  int nBits = 8,
47  int sabotage = 0,
48  bool compress = true);
49 
51  int Init(PHCompositeNode*) override;
52 
54  int InitRun(PHCompositeNode*) override;
55 
57  int process_event(PHCompositeNode*) override;
58 
60  int End(PHCompositeNode*) override;
61 
62  private:
63 
66 
68  void evaluate_tracks();
69  float compress_dx(float in_val);
70  float compress_dy(float in_val);
71  // get geant hits associated to a cluster
72  using G4HitSet = std::set<PHG4Hit*>;
76  std::pair<int,int> get_max_contributor( SvtxTrack* ) const;
77 
79  int get_embed(PHG4Particle*) const;
80 
83 
86 
89 
92 
95 
98 
100 
106 
109 
110  // map cluster keys to g4hits
111  using G4HitMap = std::map<TrkrDefs::cluskey,G4HitSet>;
113 
117 
118  TNtuple *_dst_data;
119 
120  // output file
121  std::string _filename;
122  TFile *_tfile;
123 
125 
126  // Number of bits for the integer representation after compression
127  int nBits = 8;
128  // replace the decompressed residuals by a large number
129  int sabotage = 0;
130  // random seed
131  TRandom rnd;
132  // switch to apply the compressed residuals to cluster positions
133  bool apply_compression = true;
134 
135 };
136 
137 #endif // G4EVAL_DSTEMULATOR_H