Belle II Software  release-08-01-10
TpcDigitizerModule.h
1 /**************************************************************************
2  * basf2 (Belle II Analysis Software Framework) *
3  * Author: The Belle II Collaboration *
4  * *
5  * See git log for contributors and copyright holders. *
6  * This file is licensed under LGPL-3.0, see LICENSE.md. *
7  **************************************************************************/
8 
9 #ifndef TPCDIGITIZERMODULE_H
10 #define TPCDIGITIZERMODULE_H
11 
12 #include <framework/core/Module.h>
13 #include <framework/datastore/StoreArray.h>
14 #include <beast/microtpc/dataobjects/MicrotpcHit.h>
15 
16 #include <TF1.h>
17 #include <TVector3.h>
18 #include <TVector2.h>
19 
20 #include <vector>
21 #include <map>
22 #include <tuple>
23 
25 constexpr int MAXSIZE = 26880;
27 constexpr int MAXtSIZE = 10000;
28 
29 namespace Belle2 {
34  namespace microtpc {
44  class TpcDigitizerModule : public Module {
45 
46  public:
47 
52 
54  virtual ~TpcDigitizerModule();
55 
59  virtual void initialize() override;
60 
63  virtual void beginRun() override;
64 
68  virtual void event() override;
69 
72  virtual void endRun() override;
73 
76  virtual void terminate() override;
77 
78 
79  private:
80 
84  void getXMLData();
85 
87  //bool Pixelization(int);
88  void Pixelization();
89 
93  /*TLorentzVector Drift(
94  double x1, double y1, double z1,
95  double st, double sl, double vd
96  );*/
97  virtual void Drift(double, double, double, double&, double&, double&, double&, double, double, double);
98 
100  TVector2 GEMGeo1(double x1, double y1);
101 
103  TVector2 GEMGeo2(double x1, double y1);
104 
106  Int_t m_phase;
112  double m_GEMGain1;
116  double m_ScaleGain1;
118  double m_GEMGain2;
122  double m_ScaleGain2;
124  double m_GEMpitch;
136  double m_ChipRowY;
142  double m_TOTA1;
144  double m_TOTB1;
146  double m_TOTC1;
148  double m_TOTQ1;
150  double m_TOTA2;
152  double m_TOTB2;
154  double m_TOTC2;
156  double m_TOTQ2;
158  double m_z_DG;
160  double m_z_TG;
162  double m_z_CG;
164  double m_Dt_DG;
166  double m_Dt_TG;
168  double m_Dt_CG;
170  double m_Dl_DG;
172  double m_Dl_TG;
174  double m_Dl_CG;
176  double m_v_DG;
178  double m_v_TG;
180  double m_v_CG;
182  double m_Workfct;
184  double m_Fanofac;
186  double m_GasAbs;
188  //int m_dchip[10][80][336][MAXtSIZE];
189  std::map<std::tuple<int, int, int>, int> m_dchip;
191  std::map<std::tuple<int, int>, int> m_dchip_map;
193  std::map<std::tuple<int, int>, int> m_dchip_pdg_map;
195  std::map<std::tuple<int, int>, int> m_dchip_trkID_map;
197  std::map<std::tuple<int, int>, int> m_dchip_detNb_map;
201  int m_nTPC = 0;
203  std::vector<TVector3> m_TPCCenter;
205  std::vector<float> m_TPCAngleX;
207  std::vector<float> m_TPCAngleZ;
208 
210  double m_lowerTimingCut = 0;
212  double m_upperTimingCut = 1000000;
213 
215  int olddetNb = -1;
216 
218  int oldtrkID = -1;
219 
220  };
221 
222  }
224 }
225 
226 #endif /* TPCDIGITIZERMODULE_H */
Base class for Modules.
Definition: Module.h:72
Accessor to arrays stored in the data store.
Definition: StoreArray.h:113
double m_lowerTimingCut
Lower timing cut.
double m_ChipRowY
Chip row y dimension.
std::map< std::tuple< int, int >, int > m_dchip_pdg_map
chip pdg map arrays
int m_LookAtRec
Flag 0/1 only look at nuclear recoils.
double m_Dl_CG
Longitudinal diffusion in collection gap.
double m_Dl_DG
Longitudinal diffusion in drift gap.
std::map< std::tuple< int, int >, int > m_dchip_trkID_map
chip track ID map arrays
TVector2 GEMGeo1(double x1, double y1)
GEMazition of GEM1.
virtual void initialize() override
Initialize the Module.
TF1 * fctToT_Calib1
Define ToT calib 1.
virtual void event() override
This method is the core of the module.
double m_v_DG
Drift velocity in drift gap.
virtual void endRun() override
This method is called if the current run ends.
double m_ChipColumnX
Chip column x dimension.
void getXMLData()
reads data from MICROTPC.xml: tube location, drift data filename, sigma of impulse response function
TpcDigitizerModule()
Constructor: Sets the description, the properties and the parameters of the module.
virtual void terminate() override
This method is called at the end of the event processing.
double m_upperTimingCut
Upper timing cut.
std::map< std::tuple< int, int, int >, int > m_dchip
chip store arrays
TF1 * fctToT_Calib2
Define ToT calib 2.
std::map< std::tuple< int, int >, int > m_dchip_detNb_map
chip Nb map arrays
virtual void beginRun() override
Called when entering a new run.
std::vector< TVector3 > m_TPCCenter
TPC coordinate.
double m_Dt_CG
Transverse diffusion in collection gap.
std::vector< float > m_TPCAngleZ
TPC angle Z.
std::map< std::tuple< int, int >, int > m_dchip_map
chip map arrays
double m_Dt_TG
Transverse diffusion in transfer gap.
std::vector< float > m_TPCAngleX
TPC angle X.
int m_PixelTimeBinNb
Pixel time number of bin.
double m_Dt_DG
Transverse diffusion in drift gap.
void Pixelization()
Produces the pixelization.
StoreArray< MicrotpcHit > m_microtpcHit
Array for MicrotpcHit.
int m_PixelThresholdRMS
Pixel threshold RMS.
double m_v_CG
Drift velocity in collection gap.
virtual void Drift(double, double, double, double &, double &, double &, double &, double, double, double)
Drift ionization Make the ionization drifting from (x,y,z) to GEM1 top plane.
TVector2 GEMGeo2(double x1, double y1)
GEMazition of GEM2.
double m_Dl_TG
Longitudinal diffusion in transfer gap.
double m_v_TG
Drift velocity in transfer gap.
Abstract base class for different kinds of events.