BmnRoot
Loading...
Searching...
No Matches
BmnGemStripModule.h
Go to the documentation of this file.
1#ifndef BMNGEMSTRIPMODULE_H
2#define BMNGEMSTRIPMODULE_H
3
4#include "BmnMatch.h"
5#include "BmnGemStripLayer.h"
6#include "BmnGemStripMedium.h"
7
8#include "BmnStripData.h"
9
10#include "TMath.h"
11
12#include <iostream>
13#include <vector>
14
15using namespace TMath;
16using namespace std;
17
19
20struct CollPoint;
21
23
24public:
25 //Constructors -------------------------------------------------------------
27
28 BmnGemStripModule(Double_t z_start_pos,
29 ElectronDriftDirectionInModule edrift_direction,
30 Double_t DriftGap, Double_t FTransferGap, Double_t STransferGap, Double_t InductionGap);
31 //--------------------------------------------------------------------------
32
33 //Destructor
35
36 void SetVerbosity(Bool_t verb) { Verbosity = verb; }
37 Bool_t GetVerbosity() { return Verbosity; }
38
39 //Module parameters --------------------------------------------------------
40 Double_t GetXMinModule() { return XMinModule; }
41 Double_t GetXMaxModule() { return XMaxModule; }
42 Double_t GetYMinModule() { return YMinModule; }
43 Double_t GetYMaxModule() { return YMaxModule; }
44
45 Double_t GetXSize() { return XMaxModule-XMinModule; }
46 Double_t GetYSize() { return YMaxModule-YMinModule; }
47
48 void SetZStartModulePosition(Double_t zpos_module) { ZStartModulePosition = zpos_module; }
49 Double_t GetZStartModulePosition() { return ZStartModulePosition; }
50
51 void SetElectronDriftDirection(ElectronDriftDirectionInModule direction) { ElectronDriftDirection = direction; }
52 ElectronDriftDirectionInModule GetElectronDriftDirection() { return ElectronDriftDirection; }
53
54 Double_t GetModuleThickness() { return ModuleThickness; }
55 Double_t GetZPositionRegistered(); //position for all registered point (hits)
56 //--------------------------------------------------------------------------
57
58 //Strip layers controls ----------------------------------------------------
60
61 Bool_t SetStripSignalInLayer(Int_t layer_num, Int_t strip_num, Double_t signal);
62 Bool_t AddStripSignalInLayer(Int_t layer_num, Int_t strip_num, Double_t signal);
63 Bool_t SetStripMatchInLayer(Int_t layer_num, Int_t strip_num, BmnMatch mc_match); //set a MC-match for a strip in some layer
64 Bool_t SetStripDigitNumberMatchInLayer(Int_t layer_num, Int_t strip_num, BmnMatch digit_num_match); //set a digit number match for a strip in some layer
65
66 Double_t GetStripSignalInLayer(Int_t layer_num, Int_t strip_num);
67 BmnMatch GetStripMatchInLayer(Int_t layer_num, Int_t strip_num); //get a MC-match for a strip in some layer
68 BmnMatch GetStripDigitNumberMatchInLayer(Int_t layer_num, Int_t strip_num); //get a digit number match for a strip in some layer
69
70 Int_t GetNStripLayers() { return StripLayers.size(); }
71 BmnGemStripLayer& GetStripLayer(Int_t num) { return StripLayers.at(num); }
72 vector<BmnGemStripLayer>& GetStripLayers() { return StripLayers; }
73
74 void ResetModuleData(); //clear all data in the module and all layers (not delete layers!)
75 //--------------------------------------------------------------------------
76
77 //Point ownership of the module --------------------------------------------
78 Bool_t IsPointInsideModule(Double_t x, Double_t y); //plane ownership
79 Bool_t IsPointInsideModule(Double_t x, Double_t y, Double_t z); //volume ownership
80 Bool_t IsPointInsideZThickness(Double_t z); // point with z-coord is between z_start and z_end of the module (inside module thickness)?
81 //--------------------------------------------------------------------------
82
83 //Methods to add a point to the module -------------------------------------
84 Bool_t AddRealPointFull(Double_t x, Double_t y, Double_t z,
85 Double_t px, Double_t py, Double_t pz, Double_t signal, Int_t refID);
86
87 Bool_t AddRealPointFullOne(Double_t x, Double_t y, Double_t z,
88 Double_t px, Double_t py, Double_t pz, Double_t signal, Int_t refID);
89
90 Bool_t AddRealPointSimple(Double_t x, Double_t y, Double_t z,
91 Double_t px, Double_t py, Double_t pz, Double_t signal, Int_t refID); //old
92
93 //make a strip cluster from a single point (with gauss smearing)
94 StripCluster MakeCluster(Int_t layer_num, Double_t xcoord, Double_t ycoord, Double_t signal, Double_t radius);
95
96 //seed for the random generator in the full simulation (AddRealPointFull)
97 void SetAvalancheGenerationSeed(UInt_t seed) { AvalancheGenerationSeed = seed; }
98 UInt_t GetAvalancheGenerationSeed() { return AvalancheGenerationSeed; }
99
100 //controls to set up the avalanche radius in the non-full simulation (AddRealPointFullOne)
101 void SetAvalancheRadius(Double_t aval_radius);
103 //--------------------------------------------------------------------------
104
105 //Methods to calculate intersection points in the module -------------------
107
108 //need for a separated test (find x,y intersection coords from strip positions)
109 Bool_t SearchIntersectionPoint(Double_t &x, Double_t &y, Double_t strip_pos_layerA, Double_t strip_pos_layerB, Int_t layerA_index, Int_t layerB_index);
110 //--------------------------------------------------------------------------
111
112 //Added (real) points ------------------------------------------------------
113 Int_t GetNRealPoints() {return RealPointsX.size();} //quantity of added points
114 Double_t GetRealPointX(Int_t indx) { return RealPointsX.at(indx); } //X-coord of i-added point
115 Double_t GetRealPointY(Int_t indx) { return RealPointsY.at(indx); } //Y-coord of i-added point
116 Double_t GetRealPointMC(Int_t indx) { return RealPointsMC.at(indx); } //MC-index of i-added point
117
118 void ResetRealPoints() { RealPointsX.clear(); RealPointsY.clear(); RealPointsMC.clear(); }
119 //--------------------------------------------------------------------------
120
121 //Intersection points ------------------------------------------------------
122 Int_t GetNIntersectionPoints() {return IntersectionPointsX.size();} //quantity of intersections
123 Double_t GetIntersectionPointX(Int_t indx) { return IntersectionPointsX.at(indx); } //X-coord of indx-intersection point
124 Double_t GetIntersectionPointY(Int_t indx) { return IntersectionPointsY.at(indx); } //Y-coord of indx-intersection point
125 Double_t GetIntersectionPointXError(Int_t indx) { return IntersectionPointsXErrors.at(indx); } //X-coord error of indx-intersection point
126 Double_t GetIntersectionPointYError(Int_t indx) { return IntersectionPointsYErrors.at(indx); } //Y-coord error of indx-intersection point
127 Int_t GetIntersectionPoint_LowerLayerClusterSize(Int_t indx) { return IntersectionPoints_LowerLayerClusterSize.at(indx); } //cluster size in the lower layer
128 Int_t GetIntersectionPoint_UpperLayerClusterSize(Int_t indx) { return IntersectionPoints_UpperLayerClusterSize.at(indx); } //cluster size in the upper layer
129 Double_t GetIntersectionPoint_LowerLayerSripPosition(Int_t indx) { return IntersectionPoints_LowerLayerStripPosition.at(indx); } //strip position in the lower layer
130 Double_t GetIntersectionPoint_UpperLayerSripPosition(Int_t indx) { return IntersectionPoints_UpperLayerStripPosition.at(indx); } //strip position in the upper layer
131 Double_t GetIntersectionPoint_LowerLayerSripTotalSignal(Int_t indx) { return IntersectionPoints_LowerLayerStripTotalSignal.at(indx); } //total signal in the lower layer
132 Double_t GetIntersectionPoint_UpperLayerSripTotalSignal(Int_t indx) { return IntersectionPoints_UpperLayerStripTotalSignal.at(indx); } //total signal in the upper layer
133 BmnMatch GetIntersectionPointMatch(Int_t indx) { return IntersectionPointMatches.at(indx); } //Intersection point MC-match
134 BmnMatch GetIntersectionPointDigitNumberMatch(Int_t indx) { return IntersectionPointDigitNumberMatches.at(indx); } //Intersection point digit number match
135
136 StripCluster GetUpperCluster(Int_t indx) { return UpperClusters.at(indx); }
137 StripCluster GetLowerCluster(Int_t indx) { return LowerClusters.at(indx); }
138
140 //--------------------------------------------------------------------------
141
142 //Pseudo intersections -----------------------------------------------------
143 Int_t GetNPseudoIntersections() {return PseudoIntersectionsX.size();}
144 Double_t GetPseudoIntersectionX(Int_t indx) { return PseudoIntersectionsX.at(indx); }
145 Double_t GetPseudoIntersectionY(Int_t indx) { return PseudoIntersectionsY.at(indx); }
146 Double_t GetPseudoIntersectionXError(Int_t indx) { return PseudoIntersectionsXErrors.at(indx); }
147 Double_t GetPseudoIntersectionYError(Int_t indx) { return PseudoIntersectionsYErrors.at(indx); }
148 Int_t GetPseudoIntersection_LowerLayerClusterSize(Int_t indx) { return PseudoIntersections_LowerLayerClusterSize.at(indx); }
149 Int_t GetPseudoIntersection_UpperLayerClusterSize(Int_t indx) { return PseudoIntersections_UpperLayerClusterSize.at(indx); }
150 Double_t GetPseudoIntersection_LowerLayerSripPosition(Int_t indx) { return PseudoIntersections_LowerLayerStripPosition.at(indx); }
151 Double_t GetPseudoIntersection_UpperLayerSripPosition(Int_t indx) { return PseudoIntersections_UpperLayerStripPosition.at(indx); }
152 Double_t GetPseudoIntersection_LowerLayerSripTotalSignal(Int_t indx) { return PseudoIntersections_LowerLayerStripTotalSignal.at(indx); }
153 Double_t GetPseudoIntersection_UpperLayerSripTotalSignal(Int_t indx) { return PseudoIntersections_UpperLayerStripTotalSignal.at(indx); }
154 BmnMatch GetPseudoIntersectionMatch(Int_t indx) { return PseudoIntersectionMatches.at(indx); } //Pseudo intersection MC-match
155 BmnMatch GetPseudoIntersectionDigitNumberMatch(Int_t indx) { return PseudoIntersectionDigitNumberMatches.at(indx); } //Pseudo intersection point digit number match
156
157 StripCluster GetUpperCluster_PseudoIntersections(Int_t indx) { return UpperClusters_PseudoIntersections.at(indx); }
158 StripCluster GetLowerCluster_PseudoIntersections(Int_t indx) { return LowerClusters_PseudoIntersections.at(indx); }
159
161 //--------------------------------------------------------------------------
162
163private:
164 void DefineModuleBorders(); //calculate min-max coordinates of the module from layers` parameters
165 Double_t GetNumberOfClusters(Double_t beta, Double_t gamma, Double_t charge, Double_t p0, Double_t p1); //AZ-110124
166
167private:
168 BmnGemStripModule(const BmnGemStripModule&) = delete;
169 BmnGemStripModule& operator=(const BmnGemStripModule&) = delete;
170
171private:
172 Bool_t Verbosity;
173
174 Double_t XMinModule;
175 Double_t XMaxModule;
176 Double_t YMinModule;
177 Double_t YMaxModule;
178
179 Double_t ZStartModulePosition;
180
181 Double_t DriftGapThickness;
182 Double_t FirstTransferGapThickness;
183 Double_t SecondTransferGapThickness;
184 Double_t InductionGapThickness;
185 Double_t ModuleThickness;
186
187 ElectronDriftDirectionInModule ElectronDriftDirection;
188
189 vector<BmnGemStripLayer> StripLayers;
190
191 UInt_t AvalancheGenerationSeed;
192 Double_t AvalancheRadius;
193 Double_t MCD; //Mean collision distance
194 Double_t Gain;
195
196 vector<Double_t> RealPointsX;
197 vector<Double_t> RealPointsY;
198 vector<Double_t> RealPointsMC; // index of MC point
199
200 vector<Double_t> IntersectionPointsX;
201 vector<Double_t> IntersectionPointsY;
202 vector<Double_t> IntersectionPointsXErrors;
203 vector<Double_t> IntersectionPointsYErrors;
204
205 vector<Int_t> IntersectionPoints_LowerLayerClusterSize; //cluster size (number of strips) in the lower layer for each intersection point
206 vector<Int_t> IntersectionPoints_UpperLayerClusterSize; //cluster size (number of strips) in the upper layer for each intersection point
207
208 vector<Double_t> IntersectionPoints_LowerLayerStripPosition; //strip position in the lower layer for each intersection point
209 vector<Double_t> IntersectionPoints_UpperLayerStripPosition; //strip position in the upper layer for each intersection point
210
211 vector<Double_t> IntersectionPoints_LowerLayerStripTotalSignal; //total signal in the lower layer for each intersection point
212 vector<Double_t> IntersectionPoints_UpperLayerStripTotalSignal; //total signal in the upper layer for each intersection point
213
214 vector<BmnMatch> IntersectionPointMatches; // MC-matches
215 vector<BmnMatch> IntersectionPointDigitNumberMatches; // Digit number matches
216
217 vector<StripCluster> UpperClusters;
218 vector<StripCluster> LowerClusters;
219
220 //Pseudo intersections -----------------------------------------------------
221 vector<Double_t> PseudoIntersectionsX;
222 vector<Double_t> PseudoIntersectionsY;
223 vector<Double_t> PseudoIntersectionsXErrors;
224 vector<Double_t> PseudoIntersectionsYErrors;
225
226 vector<Int_t> PseudoIntersections_LowerLayerClusterSize;
227 vector<Int_t> PseudoIntersections_UpperLayerClusterSize;
228
229 vector<Double_t> PseudoIntersections_LowerLayerStripPosition;
230 vector<Double_t> PseudoIntersections_UpperLayerStripPosition;
231
232 vector<Double_t> PseudoIntersections_LowerLayerStripTotalSignal;
233 vector<Double_t> PseudoIntersections_UpperLayerStripTotalSignal;
234
235 vector<BmnMatch> PseudoIntersectionMatches; // MC-matches
236 vector<BmnMatch> PseudoIntersectionDigitNumberMatches; // Digit number matches
237
238 vector<StripCluster> UpperClusters_PseudoIntersections;
239 vector<StripCluster> LowerClusters_PseudoIntersections;
240
241//testing part -----------------------------------------------------------------
242public:
243 vector<Double_t> XElectronPos;
244 vector<Double_t> YElectronPos;
245 vector<Double_t> ElectronSignal;
246
247 vector<vector<StripCluster> > AddedClusters; //test
248
250 XElectronPos.clear();
251 YElectronPos.clear();
252 ElectronSignal.clear();
253 AddedClusters.clear(); //test
254 }
255//------------------------------------------------------------------------------
256
257private:
258 //Struct: a collision point position (an ionizing cluster position) --------
259 struct CollPoint {
260 CollPoint(Double_t _x, Double_t _y, Double_t _z) : x(_x), y(_y), z(_z) {}
261 Double_t x;
262 Double_t y;
263 Double_t z;
264 };
265};
266//------------------------------------------------------------------------------
267
268#endif /* BMNGEMSTRIPMODULE_H */
269
void ResetPseudoIntersections()
Double_t GetPseudoIntersectionX(Int_t indx)
void ResetIntersectionPoints()
void CalculateStripHitIntersectionPoints()
BmnMatch GetPseudoIntersectionMatch(Int_t indx)
void SetZStartModulePosition(Double_t zpos_module)
BmnMatch GetStripMatchInLayer(Int_t layer_num, Int_t strip_num)
void SetAvalancheRadius(Double_t aval_radius)
Double_t GetIntersectionPoint_UpperLayerSripPosition(Int_t indx)
vector< Double_t > XElectronPos
vector< vector< StripCluster > > AddedClusters
Double_t GetPseudoIntersection_UpperLayerSripPosition(Int_t indx)
void SetVerbosity(Bool_t verb)
Double_t GetIntersectionPoint_LowerLayerSripTotalSignal(Int_t indx)
Double_t GetIntersectionPointX(Int_t indx)
Double_t GetIntersectionPointY(Int_t indx)
StripCluster GetLowerCluster(Int_t indx)
BmnMatch GetStripDigitNumberMatchInLayer(Int_t layer_num, Int_t strip_num)
Double_t GetPseudoIntersection_UpperLayerSripTotalSignal(Int_t indx)
StripCluster GetLowerCluster_PseudoIntersections(Int_t indx)
BmnGemStripModule(Double_t z_start_pos, ElectronDriftDirectionInModule edrift_direction, Double_t DriftGap, Double_t FTransferGap, Double_t STransferGap, Double_t InductionGap)
Double_t GetModuleThickness()
BmnGemStripLayer & GetStripLayer(Int_t num)
Double_t GetIntersectionPointYError(Int_t indx)
void SetElectronDriftDirection(ElectronDriftDirectionInModule direction)
Int_t GetPseudoIntersection_LowerLayerClusterSize(Int_t indx)
Bool_t AddRealPointFull(Double_t x, Double_t y, Double_t z, Double_t px, Double_t py, Double_t pz, Double_t signal, Int_t refID)
Double_t GetPseudoIntersection_LowerLayerSripPosition(Int_t indx)
Double_t GetStripSignalInLayer(Int_t layer_num, Int_t strip_num)
StripCluster GetUpperCluster_PseudoIntersections(Int_t indx)
vector< Double_t > YElectronPos
void SetAvalancheGenerationSeed(UInt_t seed)
Bool_t AddRealPointSimple(Double_t x, Double_t y, Double_t z, Double_t px, Double_t py, Double_t pz, Double_t signal, Int_t refID)
BmnMatch GetIntersectionPointMatch(Int_t indx)
Double_t GetRealPointMC(Int_t indx)
UInt_t GetAvalancheGenerationSeed()
Bool_t SetStripSignalInLayer(Int_t layer_num, Int_t strip_num, Double_t signal)
vector< Double_t > ElectronSignal
Bool_t IsPointInsideModule(Double_t x, Double_t y)
BmnMatch GetPseudoIntersectionDigitNumberMatch(Int_t indx)
BmnMatch GetIntersectionPointDigitNumberMatch(Int_t indx)
Double_t GetPseudoIntersection_LowerLayerSripTotalSignal(Int_t indx)
Double_t GetPseudoIntersectionXError(Int_t indx)
Bool_t AddStripSignalInLayer(Int_t layer_num, Int_t strip_num, Double_t signal)
Double_t GetRealPointY(Int_t indx)
Bool_t AddRealPointFullOne(Double_t x, Double_t y, Double_t z, Double_t px, Double_t py, Double_t pz, Double_t signal, Int_t refID)
Bool_t SetStripMatchInLayer(Int_t layer_num, Int_t strip_num, BmnMatch mc_match)
StripCluster GetUpperCluster(Int_t indx)
Double_t GetPseudoIntersectionY(Int_t indx)
Int_t GetPseudoIntersection_UpperLayerClusterSize(Int_t indx)
Int_t GetIntersectionPoint_LowerLayerClusterSize(Int_t indx)
Double_t GetRealPointX(Int_t indx)
Double_t GetZStartModulePosition()
Double_t GetIntersectionPoint_LowerLayerSripPosition(Int_t indx)
StripCluster MakeCluster(Int_t layer_num, Double_t xcoord, Double_t ycoord, Double_t signal, Double_t radius)
void ResetElectronPointsAndClusters()
Bool_t IsPointInsideZThickness(Double_t z)
ElectronDriftDirectionInModule GetElectronDriftDirection()
Bool_t SearchIntersectionPoint(Double_t &x, Double_t &y, Double_t strip_pos_layerA, Double_t strip_pos_layerB, Int_t layerA_index, Int_t layerB_index)
Bool_t IsPointInsideModule(Double_t x, Double_t y, Double_t z)
Double_t GetIntersectionPointXError(Int_t indx)
Int_t GetIntersectionPoint_UpperLayerClusterSize(Int_t indx)
Double_t GetPseudoIntersectionYError(Int_t indx)
Double_t GetZPositionRegistered()
void AddStripLayer(BmnGemStripLayer strip_layer)
Double_t GetIntersectionPoint_UpperLayerSripTotalSignal(Int_t indx)
Bool_t SetStripDigitNumberMatchInLayer(Int_t layer_num, Int_t strip_num, BmnMatch digit_num_match)
virtual ~BmnGemStripModule()
Double_t GetAvalancheRadius()
vector< BmnGemStripLayer > & GetStripLayers()
ElectronDriftDirectionInModule
ElectronDriftDirectionInModule
@ BackwardZAxisEDrift
@ ForwardZAxisEDrift
STL namespace.