BmnRoot
Loading...
Searching...
No Matches
BmnCSCModule.h
Go to the documentation of this file.
1#ifndef BMNCSCMODULE_H
2#define BMNCSCMODULE_H
3
4#include "BmnMatch.h"
5
6#include "BmnCSCLayer.h"
7
8#include <iostream>
9#include <vector>
10
11using namespace TMath;
12using namespace std;
13
15
16public:
17 //Constructors -------------------------------------------------------------
19
20 BmnCSCModule(Double_t z_start_pos, Double_t module_thick);
21 //--------------------------------------------------------------------------
22
23 //Destructor
24 virtual ~BmnCSCModule();
25
26 void SetVerbosity(Bool_t verb) { Verbosity = verb; }
27 Bool_t GetVerbosity() { return Verbosity; }
28
29 //Module parameters --------------------------------------------------------
30 Double_t GetXMinModule() { return XMinModule; }
31 Double_t GetXMaxModule() { return XMaxModule; }
32 Double_t GetYMinModule() { return YMinModule; }
33 Double_t GetYMaxModule() { return YMaxModule; }
34
35 Double_t GetXSize() { return XMaxModule-XMinModule; }
36 Double_t GetYSize() { return YMaxModule-YMinModule; }
37
38 void SetZStartModulePosition(Double_t zpos_module) { ZStartModulePosition = zpos_module; }
39 Double_t GetZStartModulePosition() { return ZStartModulePosition; }
40
41 Double_t GetModuleThickness() { return ModuleThickness; }
42 Double_t GetZPositionRegistered(); //position for all registered point (hits)
43 //--------------------------------------------------------------------------
44
45 //Strip layers controls ----------------------------------------------------
46 void AddStripLayer(BmnCSCLayer strip_layer);
47
48 Bool_t SetStripSignalInLayer(Int_t layer_num, Int_t strip_num, Double_t signal);
49 Bool_t AddStripSignalInLayer(Int_t layer_num, Int_t strip_num, Double_t signal);
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 Double_t GetStripSignalInLayer(Int_t layer_num, Int_t strip_num);
54 BmnMatch GetStripMatchInLayer(Int_t layer_num, Int_t strip_num); //get a MC-match for a strip in some layer
55 BmnMatch GetStripDigitNumberMatchInLayer(Int_t layer_num, Int_t strip_num); //get a digit number match for a strip in some layer
56
57 Int_t GetNStripLayers() { return StripLayers.size(); }
58 BmnCSCLayer& GetStripLayer(Int_t num) { return StripLayers.at(num); }
59 vector<BmnCSCLayer>& GetStripLayers() { return StripLayers; }
60
61 void ResetModuleData(); //clear all data in the module and all layers (not delete layers!)
62 //--------------------------------------------------------------------------
63
64 //Point ownership of the module --------------------------------------------
65 Bool_t IsPointInsideModule(Double_t x, Double_t y); //plane ownership
66 Bool_t IsPointInsideModule(Double_t x, Double_t y, Double_t z); //volume ownership
67 Bool_t IsPointInsideZThickness(Double_t z); // point with z-coord is between z_start and z_end of the module (inside module thickness)?
68 //--------------------------------------------------------------------------
69
70 //Methods to add a point to the module -------------------------------------
71 Bool_t AddRealPointFullOne(Double_t x, Double_t y, Double_t z,
72 Double_t px, Double_t py, Double_t pz, Double_t signal, Int_t refID);
73
74 Bool_t AddRealPointSimple(Double_t x, Double_t y, Double_t z,
75 Double_t px, Double_t py, Double_t pz, Double_t signal, Int_t refID); //old
76
77 //make a strip cluster from a single point (with gauss smearing)
78 StripCluster MakeCluster(Int_t layer_num, Double_t xcoord, Double_t ycoord, Double_t signal, Double_t radius);
79
80 //Methods to calculate intersection points in the module -------------------
82
83 //need for a separated test (find x,y intersection coords from strip positions)
84 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);
85 //--------------------------------------------------------------------------
86
87 //Added (real) points ------------------------------------------------------
88 Int_t GetNRealPoints() {return RealPointsX.size();} //quantity of added points
89 Double_t GetRealPointX(Int_t indx) { return RealPointsX.at(indx); } //X-coord of i-added point
90 Double_t GetRealPointY(Int_t indx) { return RealPointsY.at(indx); } //Y-coord of i-added point
91 Double_t GetRealPointMC(Int_t indx) { return RealPointsMC.at(indx); } //MC-index of i-added point
92
93 void ResetRealPoints() { RealPointsX.clear(); RealPointsY.clear(); RealPointsMC.clear(); }
94 //--------------------------------------------------------------------------
95
96 //Intersection points ------------------------------------------------------
97 Int_t GetNIntersectionPoints() {return IntersectionPointsX.size();} //quantity of intersections
98 Double_t GetIntersectionPointX(Int_t indx) { return IntersectionPointsX.at(indx); } //X-coord of indx-intersection point
99 Double_t GetIntersectionPointY(Int_t indx) { return IntersectionPointsY.at(indx); } //Y-coord of indx-intersection point
100 Double_t GetIntersectionPointXError(Int_t indx) { return IntersectionPointsXErrors.at(indx); } //X-coord error of indx-intersection point
101 Double_t GetIntersectionPointYError(Int_t indx) { return IntersectionPointsYErrors.at(indx); } //Y-coord error of indx-intersection point
102 Int_t GetIntersectionPoint_LowerLayerClusterSize(Int_t indx) { return IntersectionPoints_LowerLayerClusterSize.at(indx); } //cluster size in the lower layer
103 Int_t GetIntersectionPoint_UpperLayerClusterSize(Int_t indx) { return IntersectionPoints_UpperLayerClusterSize.at(indx); } //cluster size in the upper layer
104 Double_t GetIntersectionPoint_LowerLayerSripPosition(Int_t indx) { return IntersectionPoints_LowerLayerStripPosition.at(indx); } //strip position in the lower layer
105 Double_t GetIntersectionPoint_UpperLayerSripPosition(Int_t indx) { return IntersectionPoints_UpperLayerStripPosition.at(indx); } //strip position in the upper layer
106 Double_t GetIntersectionPoint_LowerLayerSripTotalSignal(Int_t indx) { return IntersectionPoints_LowerLayerStripTotalSignal.at(indx); } //total signal in the lower layer
107 Double_t GetIntersectionPoint_UpperLayerSripTotalSignal(Int_t indx) { return IntersectionPoints_UpperLayerStripTotalSignal.at(indx); } //total signal in the upper layer
108 BmnMatch GetIntersectionPointMatch(Int_t indx) { return IntersectionPointMatches.at(indx); } //Intersection point MC-match
109 BmnMatch GetIntersectionPointDigitNumberMatch(Int_t indx) { return IntersectionPointDigitNumberMatches.at(indx); } //Intersection point digit number match
110
111 StripCluster GetUpperCluster(Int_t indx) { return UpperClusters.at(indx); }
112 StripCluster GetLowerCluster(Int_t indx) { return LowerClusters.at(indx); }
113
115 //--------------------------------------------------------------------------
116
117 //Pseudo intersections -----------------------------------------------------
118 Int_t GetNPseudoIntersections() {return PseudoIntersectionsX.size();}
119 Double_t GetPseudoIntersectionX(Int_t indx) { return PseudoIntersectionsX.at(indx); }
120 Double_t GetPseudoIntersectionY(Int_t indx) { return PseudoIntersectionsY.at(indx); }
121 Double_t GetPseudoIntersectionXError(Int_t indx) { return PseudoIntersectionsXErrors.at(indx); }
122 Double_t GetPseudoIntersectionYError(Int_t indx) { return PseudoIntersectionsYErrors.at(indx); }
123 Int_t GetPseudoIntersection_LowerLayerClusterSize(Int_t indx) { return PseudoIntersections_LowerLayerClusterSize.at(indx); }
124 Int_t GetPseudoIntersection_UpperLayerClusterSize(Int_t indx) { return PseudoIntersections_UpperLayerClusterSize.at(indx); }
125 Double_t GetPseudoIntersection_LowerLayerSripPosition(Int_t indx) { return PseudoIntersections_LowerLayerStripPosition.at(indx); }
126 Double_t GetPseudoIntersection_UpperLayerSripPosition(Int_t indx) { return PseudoIntersections_UpperLayerStripPosition.at(indx); }
127 Double_t GetPseudoIntersection_LowerLayerSripTotalSignal(Int_t indx) { return PseudoIntersections_LowerLayerStripTotalSignal.at(indx); }
128 Double_t GetPseudoIntersection_UpperLayerSripTotalSignal(Int_t indx) { return PseudoIntersections_UpperLayerStripTotalSignal.at(indx); }
129 BmnMatch GetPseudoIntersectionMatch(Int_t indx) { return PseudoIntersectionMatches.at(indx); } //Pseudo intersection MC-match
130 BmnMatch GetPseudoIntersectionDigitNumberMatch(Int_t indx) { return PseudoIntersectionDigitNumberMatches.at(indx); } //Pseudo intersection point digit number match
131
132 StripCluster GetUpperCluster_PseudoIntersections(Int_t indx) { return UpperClusters_PseudoIntersections.at(indx); }
133 StripCluster GetLowerCluster_PseudoIntersections(Int_t indx) { return LowerClusters_PseudoIntersections.at(indx); }
134
136 //--------------------------------------------------------------------------
137
138
139private:
140 void DefineModuleBorders(); //calculate min-max coordinates of the module from layers` parameters
141
142private:
143 BmnCSCModule(const BmnCSCModule&) = delete;
144 BmnCSCModule& operator=(const BmnCSCModule&) = delete;
145
146private:
147 Bool_t Verbosity;
148
149 Double_t XMinModule;
150 Double_t XMaxModule;
151 Double_t YMinModule;
152 Double_t YMaxModule;
153
154 Double_t ZStartModulePosition;
155
156 Double_t ModuleThickness;
157
158 vector<BmnCSCLayer> StripLayers;
159
160 vector<Double_t> RealPointsX;
161 vector<Double_t> RealPointsY;
162 vector<Double_t> RealPointsMC; // index of MC point
163
164 vector<Double_t> IntersectionPointsX;
165 vector<Double_t> IntersectionPointsY;
166 vector<Double_t> IntersectionPointsXErrors;
167 vector<Double_t> IntersectionPointsYErrors;
168
169 vector<Int_t> IntersectionPoints_LowerLayerClusterSize; //cluster size (number of strips) in the lower layer for each intersection point
170 vector<Int_t> IntersectionPoints_UpperLayerClusterSize; //cluster size (number of strips) in the upper layer for each intersection point
171
172 vector<Double_t> IntersectionPoints_LowerLayerStripPosition; //strip position in the lower layer for each intersection point
173 vector<Double_t> IntersectionPoints_UpperLayerStripPosition; //strip position in the upper layer for each intersection point
174
175 vector<Double_t> IntersectionPoints_LowerLayerStripTotalSignal; //total signal in the lower layer for each intersection point
176 vector<Double_t> IntersectionPoints_UpperLayerStripTotalSignal; //total signal in the upper layer for each intersection point
177
178 vector<BmnMatch> IntersectionPointMatches; // MC-matches
179 vector<BmnMatch> IntersectionPointDigitNumberMatches; // Digit number matches
180
181 vector<StripCluster> UpperClusters;
182 vector<StripCluster> LowerClusters;
183
184 //Pseudo intersections -----------------------------------------------------
185 vector<Double_t> PseudoIntersectionsX;
186 vector<Double_t> PseudoIntersectionsY;
187 vector<Double_t> PseudoIntersectionsXErrors;
188 vector<Double_t> PseudoIntersectionsYErrors;
189
190 vector<Int_t> PseudoIntersections_LowerLayerClusterSize;
191 vector<Int_t> PseudoIntersections_UpperLayerClusterSize;
192
193 vector<Double_t> PseudoIntersections_LowerLayerStripPosition;
194 vector<Double_t> PseudoIntersections_UpperLayerStripPosition;
195
196 vector<Double_t> PseudoIntersections_LowerLayerStripTotalSignal;
197 vector<Double_t> PseudoIntersections_UpperLayerStripTotalSignal;
198
199 vector<BmnMatch> PseudoIntersectionMatches; // MC-matches
200 vector<BmnMatch> PseudoIntersectionDigitNumberMatches; // Digit number matches
201
202 vector<StripCluster> UpperClusters_PseudoIntersections;
203 vector<StripCluster> LowerClusters_PseudoIntersections;
204 //--------------------------------------------------------------------------
205};
206//------------------------------------------------------------------------------
207
208#endif /* BMNCSCMODULE_H */
209
BmnMatch GetIntersectionPointMatch(Int_t indx)
Double_t GetPseudoIntersectionX(Int_t indx)
StripCluster GetLowerCluster(Int_t indx)
Int_t GetPseudoIntersection_UpperLayerClusterSize(Int_t indx)
StripCluster GetUpperCluster(Int_t indx)
vector< BmnCSCLayer > & GetStripLayers()
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 GetXMinModule()
Bool_t SetStripDigitNumberMatchInLayer(Int_t layer_num, Int_t strip_num, BmnMatch digit_num_match)
virtual ~BmnCSCModule()
Int_t GetNRealPoints()
Double_t GetXMaxModule()
void ResetRealPoints()
Double_t GetYMinModule()
Double_t GetStripSignalInLayer(Int_t layer_num, Int_t strip_num)
Bool_t GetVerbosity()
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 GetIntersectionPoint_UpperLayerSripPosition(Int_t indx)
void ResetModuleData()
StripCluster GetUpperCluster_PseudoIntersections(Int_t indx)
Double_t GetIntersectionPointYError(Int_t indx)
Double_t GetRealPointMC(Int_t indx)
Double_t GetRealPointX(Int_t indx)
Double_t GetIntersectionPoint_UpperLayerSripTotalSignal(Int_t indx)
Int_t GetIntersectionPoint_UpperLayerClusterSize(Int_t indx)
BmnMatch GetStripMatchInLayer(Int_t layer_num, Int_t strip_num)
Double_t GetYMaxModule()
BmnMatch GetIntersectionPointDigitNumberMatch(Int_t indx)
void CalculateStripHitIntersectionPoints()
Double_t GetZPositionRegistered()
BmnMatch GetStripDigitNumberMatchInLayer(Int_t layer_num, Int_t strip_num)
Double_t GetIntersectionPointY(Int_t indx)
StripCluster MakeCluster(Int_t layer_num, Double_t xcoord, Double_t ycoord, Double_t signal, Double_t radius)
Double_t GetPseudoIntersection_LowerLayerSripPosition(Int_t indx)
Double_t GetPseudoIntersection_LowerLayerSripTotalSignal(Int_t indx)
Bool_t SetStripMatchInLayer(Int_t layer_num, Int_t strip_num, BmnMatch mc_match)
Double_t GetModuleThickness()
Double_t GetIntersectionPointX(Int_t indx)
void SetVerbosity(Bool_t verb)
Int_t GetNIntersectionPoints()
Bool_t AddStripSignalInLayer(Int_t layer_num, Int_t strip_num, Double_t signal)
Double_t GetPseudoIntersectionYError(Int_t indx)
Bool_t IsPointInsideZThickness(Double_t z)
Bool_t IsPointInsideModule(Double_t x, Double_t y)
Double_t GetPseudoIntersection_UpperLayerSripPosition(Int_t indx)
Double_t GetIntersectionPoint_LowerLayerSripTotalSignal(Int_t indx)
Int_t GetNStripLayers()
Double_t GetPseudoIntersection_UpperLayerSripTotalSignal(Int_t indx)
BmnMatch GetPseudoIntersectionMatch(Int_t indx)
void ResetIntersectionPoints()
Int_t GetIntersectionPoint_LowerLayerClusterSize(Int_t indx)
void ResetPseudoIntersections()
BmnMatch GetPseudoIntersectionDigitNumberMatch(Int_t indx)
Double_t GetXSize()
Bool_t SetStripSignalInLayer(Int_t layer_num, Int_t strip_num, Double_t signal)
void AddStripLayer(BmnCSCLayer strip_layer)
Double_t GetIntersectionPointXError(Int_t indx)
Int_t GetPseudoIntersection_LowerLayerClusterSize(Int_t indx)
Double_t GetIntersectionPoint_LowerLayerSripPosition(Int_t indx)
void SetZStartModulePosition(Double_t zpos_module)
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)
Double_t GetPseudoIntersectionY(Int_t indx)
Int_t GetNPseudoIntersections()
Double_t GetRealPointY(Int_t indx)
StripCluster GetLowerCluster_PseudoIntersections(Int_t indx)
Double_t GetYSize()
Double_t GetZStartModulePosition()
Double_t GetPseudoIntersectionXError(Int_t indx)
BmnCSCLayer & GetStripLayer(Int_t num)
STL namespace.