CGEM BOSS 6.6.5.g
BESIII Offline Software System
Loading...
Searching...
No Matches
CgemDigitizerSvc.h
Go to the documentation of this file.
1#ifndef CGEMDIGITIZERSVC_H
2#define CGEMDIGITIZERSVC_H
3
4#include <CLHEP/Units/PhysicalConstants.h>
5#include <CLHEP/Geometry/Point3D.h>
6#include <vector>
7#include <map>
8#include <iostream>
9
10#include "GaudiKernel/Algorithm.h"
11#include "GaudiKernel/Property.h"
12#include "GaudiKernel/MsgStream.h"
13
14#include "GaudiKernel/IIncidentListener.h"
15#include "GaudiKernel/Service.h"
16#include "GaudiKernel/IInterface.h"
18#include "GaudiKernel/IDataProviderSvc.h"
19#include "GaudiKernel/IIncidentListener.h"
20
21#include "GaudiKernel/NTuple.h"
22#include "GaudiKernel/INTupleSvc.h"
23
24#include "CLHEP/Vector/ThreeVector.h"
25
38
39#include "TH1D.h"
40#include "TRandom.h"
41
42typedef float Float_t;
43
44class CgemDigitizerSvc : public Service, virtual public ICgemDigitizerSvc{
45
46public:
47 CgemDigitizerSvc(const std::string& name, ISvcLocator* svcloc);
49
50 virtual StatusCode queryInterface(const InterfaceID& riid, void** ppvUnknown);
51 virtual StatusCode initialize();
52 virtual StatusCode finalize();
53
54 /* particle = 0,1,2,3,4 (e,mu,pi,K,p) */
55 /* p: momentum (GeV/c) */
56 /* trkPosIn & trkPosOut: starting & exit positions (x,y,z) of the track segment in drift area */
57 StatusCode setTrack(int layer, int particle, int charge, double p, double trkPosIn[], double trkPosOut[]);
58 StatusCode setTrack(int layer, std::vector<int>particle, std::vector<int> charge, std::vector<double> p, std::vector<vector<double> > trkPosIn, std::vector<vector<double> > trkPosOut);
59 /* output info of fired strips */
60 int getNXstrips() const {return m_nXstrips;}
61 int getNVstrips() const {return m_nVstrips;}
62 int getXstripSheet(int n) const {return m_xstripSheet[n];}
63 int getXstripID(int n) const {return m_xstripID[n];}
64 int getVstripSheet(int n) const {return m_vstripSheet[n];}
65 int getVstripID(int n) const {return m_vstripID[n];}
66 // luxl modified code m_xstripQ2->m_xstripQ
67 double getXstripQ2(int n) const {return m_xstripQ[n];}//measured Q
68 double getVstripQ2(int n) const {return m_vstripQ[n];}
69 double getXstripQ(int n) const {return m_xstripQ2[n];}//sum of induced charge simulated
70 double getVstripQ(int n) const {return m_vstripQ2[n];}
71 double getXstripT(int n) const {return m_xstripT[n];}
72 double getVstripT(int n) const {return m_vstripT[n];}
73 double getXfirstT(int n) const {return m_xfirstT[n];}
74 double getVfirstT(int n) const {return m_vfirstT[n];}
75 double getQsaturation(int layer, int sheet, int view, int id) { return Qsaturation[layer][sheet][view][id]; }
76
77private:
78 void clear();
79 void positionToStrips();
80
81 void checkMemorySize();
82
83 int m_ionModel;
84 int m_driftAvaModel;
85 int m_inductionModel;
86 bool m_garfDebugging;
87 bool m_debugInduction;
88 int m_magConfig; /* 0 for without mag, 1 for 1 Tesla */
89 std::string m_LUTFilePath;
90 double sample_delay;//ns
91 vector<double> m_GainMultiplier;
92 double m_TransMultiplier;
93 double m_DiffuMultiplier;
94 double m_ScaleSignalX;
95
96 double Qsaturation[3][2][2][1395];
97
98 int m_Ngaps_microSector;
99 vector<double> m_gapShift_microSector;
100 vector<double> m_microSector_width;
101 vector<double> m_QinGausSigma;
102 double m_gap_microSector;
103
104 bool m_storeFlag;
105 bool m_saturation;
106 bool m_saveNt;
107 bool m_samplingDebugging;
108
109 ICgemGeomSvc* m_geomSvc;
110 CgemGeoLayer* m_cgemLayer;
111 CgemGeoReadoutPlane* m_cgemReadoutPlane;
112 Ionization* m_pIon;
113 DriftAndAvalanche* m_pDriftAndAva;
114 Induction* m_pInduction;
115
116 HitHistMap m_hitmap;
117
118 /* position and time of multiplied electrons */
119 int m_layer;
120 int m_nSheet;
121 int m_nMultiE;
122 const std::vector<Float_t>* m_pmultiEx;
123 const std::vector<Float_t>* m_pmultiEy;
124 const std::vector<Float_t>* m_pmultiEz;
125 const std::vector<Float_t>* m_pmultiEt;
126
127 /* fired strips */
128 int m_nXstrips;
129 int m_nVstrips;
130 std::vector<int> m_xstripSheet;
131 std::vector<int> m_xstripID;
132 std::vector<int> m_vstripSheet;
133 std::vector<int> m_vstripID;
134 std::vector<double> m_xstripQ;
135 std::vector<double> m_vstripQ;
136 std::vector<double> m_xstripQ2;
137 std::vector<double> m_vstripQ2;
138 std::vector<double> m_xstripT;
139 std::vector<double> m_vstripT;
140 std::vector<double> m_xfirstT;
141 std::vector<double> m_vfirstT;
142 std::map<int, int> m_mapQ[2][2];//[nSheet][XV-view]
143 std::map<int, double> m_mapT[2][2];
144 std::map<int, TH1D*> m_mapThis[2][2];
145
146 /* ntuple */
147 NTuple::Tuple* m_tuple;
148 NTuple::Item<int> m_ntNIonE;
149 /* NTuple::Item<int> m_ntNGem1E; */
150 /* NTuple::Item<int> m_ntNGem2E; */
151 /* NTuple::Item<int> m_ntNGem3E; */
152 NTuple::Item<int> m_ntNMultiE;
153 NTuple::Item<int> m_ntNxstrips;
154 NTuple::Item<int> m_ntNvstrips;
155 NTuple::Array<double> m_ntxstripQ;
156 NTuple::Array<double> m_ntxstripT;
157 NTuple::Array<double> m_ntvstripQ;
158 NTuple::Array<double> m_ntvstripT;
159 NTuple::Array<double> m_XstripID;
160 NTuple::Array<double> m_VstripID;
161
162
163};
164
165
166#endif /* CGEMDIGITIZERSVC_H */
float Float_t
const Int_t n
std::map< IndexGar, std::vector< int > > HitHistMap
Definition: IndexGar.h:41
virtual StatusCode finalize()
double getXstripT(int n) const
double getVstripQ(int n) const
int getVstripSheet(int n) const
int getVstripID(int n) const
double getQsaturation(int layer, int sheet, int view, int id)
int getXstripSheet(int n) const
double getXstripQ2(int n) const
int getNXstrips() const
double getVfirstT(int n) const
double getVstripQ2(int n) const
StatusCode setTrack(int layer, std::vector< int >particle, std::vector< int > charge, std::vector< double > p, std::vector< vector< double > > trkPosIn, std::vector< vector< double > > trkPosOut)
virtual StatusCode initialize()
StatusCode setTrack(int layer, int particle, int charge, double p, double trkPosIn[], double trkPosOut[])
virtual StatusCode queryInterface(const InterfaceID &riid, void **ppvUnknown)
double getVstripT(int n) const
double getXstripQ(int n) const
int getNVstrips() const
int getXstripID(int n) const
double getXfirstT(int n) const