BmnRoot
Loading...
Searching...
No Matches
BmnSiliconModule.h
Go to the documentation of this file.
1#ifndef BMNSILICONMODULE_H
2#define BMNSILICONMODULE_H
3
4#include "Rtypes.h"
5#include "BmnSiliconLayer.h"
6#include "BmnMatch.h"
7
9
10public:
11 //Constructors -------------------------------------------------------------
13
14 BmnSiliconModule(Double_t z_start_pos);
15 //--------------------------------------------------------------------------
16
17 //Destructor
18 virtual ~BmnSiliconModule();
19
20 void SetVerbosity(Bool_t verb) { Verbosity = verb; }
21 Bool_t GetVerbosity() { return Verbosity; }
22
23 //Module parameters --------------------------------------------------------
24 Double_t GetXMinModule() { return XMinModule; }
25 Double_t GetXMaxModule() { return XMaxModule; }
26 Double_t GetYMinModule() { return YMinModule; }
27 Double_t GetYMaxModule() { return YMaxModule; }
28
29 Double_t GetXSize() { return XMaxModule-XMinModule; }
30 Double_t GetYSize() { return YMaxModule-YMinModule; }
31
32 void SetZStartModulePosition(Double_t zpos_module) { ZStartModulePosition = zpos_module; }
33 Double_t GetZStartModulePosition() { return ZStartModulePosition; }
34
35 Double_t GetModuleThickness() { return ModuleThickness; }
36 Double_t GetZPositionRegistered(); //position for all registered point (hits)
37
38 Bool_t SetModuleRotation(Double_t angleDeg, Double_t rot_center_x, Double_t rot_center_y); //angle is counter-clockwise
39 Double_t GetModuleRotationAngleDeg() { return ModuleRotationAlgleDeg; }
40 Double_t GetModuleRotationCenterX() { return ModuleRotationCenterX; }
41 Double_t GetModuleRotationCenterY() { return ModuleRotationCenterY; }
42 //--------------------------------------------------------------------------
43
44 //Strip layers controls ----------------------------------------------------
45 void AddStripLayer(BmnSiliconLayer strip_layer);
46
47 Bool_t SetStripSignalInLayer(Int_t layer_num, Int_t strip_num, Double_t signal);
48 Bool_t AddStripSignalInLayer(Int_t layer_num, Int_t strip_num, Double_t signal);
49
50 Bool_t SetStripMatchInLayer(Int_t layer_num, Int_t strip_num, BmnMatch mc_match); //set a MC-match for a strip in some layer
51 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
52
53 Bool_t SetStripSignalInLayerByZoneId(Int_t zone_id, Int_t strip_num, Double_t signal);
54 Bool_t AddStripSignalInLayerByZoneId(Int_t zone_id, Int_t strip_num, Double_t signal);
55
56 Bool_t SetStripMatchInLayerByZoneId(Int_t zone_id, Int_t strip_num, BmnMatch mc_match);
57 Bool_t AddStripMatchInLayerByZoneId(Int_t zone_id, Int_t strip_num, Double_t weight, Int_t mc_num);
58
59 Bool_t SetStripDigitNumberMatchInLayerByZoneId(Int_t zone_id, Int_t strip_num, BmnMatch digit_num_match);
60 Bool_t AddStripDigitNumberMatchInLayerByZoneId(Int_t zone_id, Int_t strip_num, Double_t weight, Int_t digit_num);
61
62 Double_t GetStripSignalInLayer(Int_t layer_num, Int_t strip_num);
63
64 BmnMatch GetStripMatchInLayer(Int_t layer_num, Int_t strip_num); //get a MC-match for a strip in some layer
65 BmnMatch GetStripDigitNumberMatchInLayer(Int_t layer_num, Int_t strip_num); //get a digit number match for a strip in some layer
66
67 Int_t GetFirstStripInZone(Int_t zone_id);
68 Int_t GetLastStripInZone(Int_t zone_id);
69
70 Double_t GetStripSignalInZone(Int_t zone_id, Int_t strip_num);
71
72 BmnMatch GetStripMatchInZone(Int_t zone_id, Int_t strip_num);
73 BmnMatch GetStripDigitNumberMatchInZone(Int_t zone_id, Int_t strip_num);
74
75 Int_t GetNStripLayers() { return StripLayers.size(); }
76 BmnSiliconLayer& GetStripLayer(Int_t num) { return StripLayers.at(num); }
77 vector<BmnSiliconLayer>& GetStripLayers() { return StripLayers; }
78
79 void ResetModuleData(); //clear all data in the module and all layers (not delete layers!)
80 //--------------------------------------------------------------------------
81
82 //Point ownership of the module --------------------------------------------
83 Bool_t IsPointInsideModule(Double_t x, Double_t y, Bool_t isLocal); //plane ownership
84 Bool_t IsPointInsideModule(Double_t x, Double_t y, Double_t z, Bool_t isLocal); //volume ownership
85 Bool_t IsPointInsideZThickness(Double_t z); // point with z-coord is between z_start and z_end of the module (inside module thickness)?
86 //--------------------------------------------------------------------------
87
88 //Methods to add a point to the module -------------------------------------
89 Bool_t AddRealPointSimple(Double_t x, Double_t y, Double_t z,
90 Double_t px, Double_t py, Double_t pz, Double_t signal, Int_t refID);
91
92 Bool_t AddRealPointFullOne(Double_t x, Double_t y, Double_t z,
93 Double_t px, Double_t py, Double_t pz, Double_t signal, Int_t refID);
94
95 Bool_t AddRealPointFullOne_WithIncline(Double_t x, Double_t y, Double_t z,
96 Double_t px, Double_t py, Double_t pz, Double_t signal, Int_t refID);
97
98 Bool_t AddRealPointFull(Double_t x, Double_t y, Double_t z,
99 Double_t px, Double_t py, Double_t pz, Double_t signal, Int_t refID);
100
101
102 //make a strip cluster from a single point (with gauss smearing)
103 StripCluster MakeCluster(Int_t layer_num, Double_t xcoord, Double_t ycoord, Double_t signal, Double_t radius);
104 //--------------------------------------------------------------------------
105
106 //Methods to calculate intersection points in the module -------------------
108
109 //need for a separated test (find x,y intersection coords from strip positions)
110 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);
111 //--------------------------------------------------------------------------
112
113 //coordinate transformation (2D rotation in the local XY-plane) ------------
114 Double_t ConvertRotatedToLocalX(Double_t xrot, Double_t yrot);
115 Double_t ConvertRotatedToLocalY(Double_t xrot, Double_t yrot);
116 Double_t ConvertLocalToRotatedX(Double_t xloc, Double_t yloc);
117 Double_t ConvertLocalToRotatedY(Double_t xloc, Double_t yloc);
118 //--------------------------------------------------------------------------
119
120 //Added (real) points ------------------------------------------------------
121 Int_t GetNRealPoints() {return RealPointsX.size();} //quantity of added points
122 Double_t GetRealPointX(Int_t indx) { return RealPointsX.at(indx); } //X-coord of i-added point
123 Double_t GetRealPointY(Int_t indx) { return RealPointsY.at(indx); } //Y-coord of i-added point
124 Double_t GetRealPointMC(Int_t indx) { return RealPointsMC.at(indx); } //MC-index of i-added point
125
126 void ResetRealPoints() { RealPointsX.clear(); RealPointsY.clear(); RealPointsMC.clear();}
127 //--------------------------------------------------------------------------
128
129 //Intersection points ------------------------------------------------------
130 Int_t GetNIntersectionPoints() {return IntersectionPointsX.size();} //quantity of intersections
131 Double_t GetIntersectionPointX(Int_t indx) { return IntersectionPointsX.at(indx); } //X-coord of indx-intersection point
132 Double_t GetIntersectionPointY(Int_t indx) { return IntersectionPointsY.at(indx); } //Y-coord of indx-intersection point
133 Double_t GetIntersectionPointXError(Int_t indx) { return IntersectionPointsXErrors.at(indx); } //X-coord error of indx-intersection point
134 Double_t GetIntersectionPointYError(Int_t indx) { return IntersectionPointsYErrors.at(indx); } //Y-coord error of indx-intersection point
135 Int_t GetIntersectionPoint_LowerLayerClusterSize(Int_t indx) { return IntersectionPoints_LowerLayerClusterSize.at(indx); } //cluster size in the lower layer
136 Int_t GetIntersectionPoint_UpperLayerClusterSize(Int_t indx) { return IntersectionPoints_UpperLayerClusterSize.at(indx); } //cluster size in the upper layer
137 Double_t GetIntersectionPoint_LowerLayerSripPosition(Int_t indx) { return IntersectionPoints_LowerLayerStripPosition.at(indx); } //strip position in the lower layer
138 Double_t GetIntersectionPoint_UpperLayerSripPosition(Int_t indx) { return IntersectionPoints_UpperLayerStripPosition.at(indx); } //strip position in the upper layer
139 Double_t GetIntersectionPoint_LowerLayerSripTotalSignal(Int_t indx) { return IntersectionPoints_LowerLayerStripTotalSignal.at(indx); } //total signal in the lower layer
140 Double_t GetIntersectionPoint_UpperLayerSripTotalSignal(Int_t indx) { return IntersectionPoints_UpperLayerStripTotalSignal.at(indx); } //total signal in the upper layer
141 BmnMatch GetIntersectionPointMatch(Int_t indx) { return IntersectionPointMatches.at(indx); } //Intersection point MC-match
142 BmnMatch GetIntersectionPointDigitNumberMatch(Int_t indx) { return IntersectionPointDigitNumberMatches.at(indx); } //Intersection point digit number match
143
144 StripCluster GetUpperCluster(Int_t indx) { return UpperClusters.at(indx); }
145 StripCluster GetLowerCluster(Int_t indx) { return LowerClusters.at(indx); }
146
148 //--------------------------------------------------------------------------
149
150 //Pseudo intersections -----------------------------------------------------
151 Int_t GetNPseudoIntersections() {return PseudoIntersectionsX.size();}
152 Double_t GetPseudoIntersectionX(Int_t indx) { return PseudoIntersectionsX.at(indx); }
153 Double_t GetPseudoIntersectionY(Int_t indx) { return PseudoIntersectionsY.at(indx); }
154 Double_t GetPseudoIntersectionXError(Int_t indx) { return PseudoIntersectionsXErrors.at(indx); }
155 Double_t GetPseudoIntersectionYError(Int_t indx) { return PseudoIntersectionsYErrors.at(indx); }
156 Int_t GetPseudoIntersection_LowerLayerClusterSize(Int_t indx) { return PseudoIntersections_LowerLayerClusterSize.at(indx); }
157 Int_t GetPseudoIntersection_UpperLayerClusterSize(Int_t indx) { return PseudoIntersections_UpperLayerClusterSize.at(indx); }
158 Double_t GetPseudoIntersection_LowerLayerSripPosition(Int_t indx) { return PseudoIntersections_LowerLayerStripPosition.at(indx); }
159 Double_t GetPseudoIntersection_UpperLayerSripPosition(Int_t indx) { return PseudoIntersections_UpperLayerStripPosition.at(indx); }
160 Double_t GetPseudoIntersection_LowerLayerSripTotalSignal(Int_t indx) { return PseudoIntersections_LowerLayerStripTotalSignal.at(indx); }
161 Double_t GetPseudoIntersection_UpperLayerSripTotalSignal(Int_t indx) { return PseudoIntersections_UpperLayerStripTotalSignal.at(indx); }
162 BmnMatch GetPseudoIntersectionMatch(Int_t indx) { return PseudoIntersectionMatches.at(indx); } //Pseudo intersection MC-match
163 BmnMatch GetPseudoIntersectionDigitNumberMatch(Int_t indx) { return PseudoIntersectionDigitNumberMatches.at(indx); } //Pseudo ntersection point digit number match
164
165 StripCluster GetUpperCluster_PseudoIntersections(Int_t indx) { return UpperClusters_PseudoIntersections.at(indx); }
166 StripCluster GetLowerCluster_PseudoIntersections(Int_t indx) { return LowerClusters_PseudoIntersections.at(indx); }
167
169 //--------------------------------------------------------------------------
170
171private:
172 void DefineModuleBorders(); //calculate min-max coordinates of the module from layers` parameters
173
174private:
175 BmnSiliconModule(const BmnSiliconModule&) = delete;
176 BmnSiliconModule& operator=(const BmnSiliconModule&) = delete;
177
178private:
179 Bool_t Verbosity;
180
181 Double_t XMinModule;
182 Double_t XMaxModule;
183 Double_t YMinModule;
184 Double_t YMaxModule;
185
186 Double_t ZStartModulePosition;
187 Double_t ModuleThickness;
188
189 Double_t ModuleRotationAlgleDeg; //module rotation angle is counter-clockwise
190 Double_t ModuleRotationAlgleRad;
191 Double_t ModuleRotationCenterX;
192 Double_t ModuleRotationCenterY;
193
194 vector<BmnSiliconLayer> StripLayers;
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
242private:
243 //Struct: a collision point position (an ionizing cluster position) --------
244 struct CollPoint {
245 CollPoint(Double_t _x, Double_t _y, Double_t _z) : x(_x), y(_y), z(_z) {}
246 Double_t x;
247 Double_t y;
248 Double_t z;
249 };
250};
251//------------------------------------------------------------------------------
252
253#endif /* BMNSILICONMODULE_H */
254
Bool_t SetStripMatchInLayerByZoneId(Int_t zone_id, Int_t strip_num, BmnMatch mc_match)
Double_t GetPseudoIntersection_LowerLayerSripTotalSignal(Int_t indx)
BmnMatch GetStripMatchInLayer(Int_t layer_num, Int_t strip_num)
Double_t GetPseudoIntersectionY(Int_t indx)
Double_t GetIntersectionPointXError(Int_t indx)
Double_t GetYMinModule()
Int_t GetPseudoIntersection_UpperLayerClusterSize(Int_t indx)
Double_t GetXMinModule()
BmnMatch GetIntersectionPointDigitNumberMatch(Int_t indx)
Double_t GetPseudoIntersectionX(Int_t indx)
Double_t GetZStartModulePosition()
Bool_t IsPointInsideZThickness(Double_t z)
Bool_t SetStripDigitNumberMatchInLayerByZoneId(Int_t zone_id, Int_t strip_num, BmnMatch digit_num_match)
Double_t GetStripSignalInZone(Int_t zone_id, Int_t strip_num)
Double_t GetPseudoIntersectionYError(Int_t indx)
Double_t ConvertLocalToRotatedX(Double_t xloc, Double_t yloc)
Double_t GetPseudoIntersection_UpperLayerSripTotalSignal(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)
BmnMatch GetIntersectionPointMatch(Int_t indx)
Double_t GetXMaxModule()
Double_t GetIntersectionPointY(Int_t indx)
Double_t GetPseudoIntersection_LowerLayerSripPosition(Int_t indx)
Int_t GetLastStripInZone(Int_t zone_id)
Double_t GetRealPointY(Int_t indx)
Bool_t SetStripMatchInLayer(Int_t layer_num, Int_t strip_num, BmnMatch mc_match)
Double_t GetModuleRotationCenterX()
void AddStripLayer(BmnSiliconLayer strip_layer)
Double_t ConvertLocalToRotatedY(Double_t xloc, Double_t yloc)
Int_t GetIntersectionPoint_LowerLayerClusterSize(Int_t indx)
StripCluster GetUpperCluster(Int_t indx)
BmnMatch GetStripDigitNumberMatchInZone(Int_t zone_id, Int_t strip_num)
Double_t GetModuleRotationAngleDeg()
Bool_t SetModuleRotation(Double_t angleDeg, Double_t rot_center_x, Double_t rot_center_y)
Double_t GetIntersectionPoint_LowerLayerSripPosition(Int_t indx)
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)
Double_t GetZPositionRegistered()
BmnMatch GetStripMatchInZone(Int_t zone_id, Int_t strip_num)
Bool_t AddStripMatchInLayerByZoneId(Int_t zone_id, Int_t strip_num, Double_t weight, Int_t mc_num)
Double_t GetStripSignalInLayer(Int_t layer_num, Int_t strip_num)
Double_t GetPseudoIntersection_UpperLayerSripPosition(Int_t indx)
Double_t GetIntersectionPointX(Int_t indx)
vector< BmnSiliconLayer > & GetStripLayers()
Double_t GetModuleRotationCenterY()
Double_t GetIntersectionPoint_UpperLayerSripTotalSignal(Int_t indx)
Bool_t SetStripSignalInLayer(Int_t layer_num, Int_t strip_num, Double_t signal)
StripCluster GetLowerCluster_PseudoIntersections(Int_t indx)
Int_t GetIntersectionPoint_UpperLayerClusterSize(Int_t indx)
Bool_t SetStripDigitNumberMatchInLayer(Int_t layer_num, Int_t strip_num, BmnMatch digit_num_match)
Double_t GetIntersectionPoint_UpperLayerSripPosition(Int_t indx)
Bool_t AddRealPointFullOne_WithIncline(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 AddStripDigitNumberMatchInLayerByZoneId(Int_t zone_id, Int_t strip_num, Double_t weight, Int_t digit_num)
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 AddStripSignalInLayerByZoneId(Int_t zone_id, Int_t strip_num, Double_t signal)
Double_t ConvertRotatedToLocalX(Double_t xrot, Double_t yrot)
Bool_t IsPointInsideModule(Double_t x, Double_t y, Bool_t isLocal)
StripCluster MakeCluster(Int_t layer_num, Double_t xcoord, Double_t ycoord, Double_t signal, Double_t radius)
BmnMatch GetStripDigitNumberMatchInLayer(Int_t layer_num, Int_t strip_num)
Double_t GetIntersectionPointYError(Int_t indx)
void CalculateStripHitIntersectionPoints()
Bool_t SetStripSignalInLayerByZoneId(Int_t zone_id, Int_t strip_num, Double_t signal)
Double_t GetIntersectionPoint_LowerLayerSripTotalSignal(Int_t indx)
Double_t GetRealPointMC(Int_t indx)
void SetZStartModulePosition(Double_t zpos_module)
void SetVerbosity(Bool_t verb)
Double_t GetRealPointX(Int_t indx)
StripCluster GetUpperCluster_PseudoIntersections(Int_t indx)
BmnMatch GetPseudoIntersectionDigitNumberMatch(Int_t indx)
Double_t GetPseudoIntersectionXError(Int_t indx)
Int_t GetFirstStripInZone(Int_t zone_id)
Bool_t AddStripSignalInLayer(Int_t layer_num, Int_t strip_num, Double_t signal)
Int_t GetPseudoIntersection_LowerLayerClusterSize(Int_t indx)
Double_t GetModuleThickness()
BmnSiliconLayer & GetStripLayer(Int_t num)
Double_t ConvertRotatedToLocalY(Double_t xrot, Double_t yrot)
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)
Double_t GetYMaxModule()
Int_t GetNPseudoIntersections()
BmnMatch GetPseudoIntersectionMatch(Int_t indx)
StripCluster GetLowerCluster(Int_t indx)