Analysis Software
Documentation for sPHENIX simulation 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 "DSTCompressor.h"
10 
11 #include <trackbase/ActsGeometry.h>
12 #include <trackbase/TrkrDefs.h>
14 
15 #include <fun4all/SubsysReco.h>
16 
17 #include <TRandom.h>
18 
19 #include <map>
20 #include <set>
21 #include <string>
22 #include <vector>
23 
24 class PHG4Hit;
25 class PHG4HitContainer;
26 class PHG4Particle;
28 class SvtxTrack;
29 class SvtxTrackMap;
31 class TrkrCluster;
35 class TrkrHitTruthAssoc;
36 
37 class TFile;
38 class TNtuple;
39 
40 class DSTEmulator : public SubsysReco
41 {
42  public:
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:
65 
67  void evaluate_tracks();
68  float compress_dx(float in_val);
69  float compress_dy(float in_val);
70  // get geant hits associated to a cluster
71  using G4HitSet = std::set<PHG4Hit*>;
75  std::pair<int, int> get_max_contributor(SvtxTrack*) const;
76 
78  int get_embed(PHG4Particle*) const;
79 
82 
85 
88 
91 
94 
97 
99 
105 
108 
109  // map cluster keys to g4hits
110  using G4HitMap = std::map<TrkrDefs::cluskey, G4HitSet>;
112 
115 
116  TNtuple* _dst_data{};
117 
118  // output file
120  TFile* _tfile;
121 
123 
124  // Number of bits for the integer representation after compression
125  int nBits = 8;
126  // replace the decompressed residuals by a large number
127  int sabotage = 0;
128  // random seed
129  TRandom rnd;
130  // switch to apply the compressed residuals to cluster positions
131  bool apply_compression = true;
132 };
133 
134 #endif // G4EVAL_DSTEMULATOR_H