BmnRoot
Loading...
Searching...
No Matches
BmnSiBTModule.h
Go to the documentation of this file.
1#ifndef BMNSiBTMODULE_H
2#define BMNSiBTMODULE_H
3
4#include "BmnMatch.h"
5
6#include "BmnSiBTLayer.h"
7
8#include <iostream>
9#include <vector>
10
11using namespace TMath;
12using namespace std;
13
14class BmnSiBTModule {
15
16public:
17 //Constructors -------------------------------------------------------------
19
20 BmnSiBTModule(Double_t z_start_pos, Double_t module_thick);
21 //--------------------------------------------------------------------------
22
23 //Destructor
24 virtual ~BmnSiBTModule();
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(BmnSiBTLayer 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 strip_match);
51
52 Double_t GetStripSignalInLayer(Int_t layer_num, Int_t strip_num);
53 BmnMatch GetStripMatchInLayer(Int_t layer_num, Int_t strip_num);
54
55 Int_t GetNStripLayers() { return StripLayers.size(); }
56 BmnSiBTLayer& GetStripLayer(Int_t num) { return StripLayers.at(num); }
57 vector<BmnSiBTLayer>& GetStripLayers() { return StripLayers; }
58
59 void ResetModuleData(); //clear all data in the module and all layers (not delete layers!)
60 //--------------------------------------------------------------------------
61
62 //Point ownership of the module --------------------------------------------
63 Bool_t IsPointInsideModule(Double_t x, Double_t y); //plane ownership
64 Bool_t IsPointInsideModule(Double_t x, Double_t y, Double_t z); //volume ownership
65 Bool_t IsPointInsideZThickness(Double_t z); // point with z-coord is between z_start and z_end of the module (inside module thickness)?
66 //--------------------------------------------------------------------------
67
68 //Methods to add a point to the module -------------------------------------
69 Bool_t AddRealPointFullOne(Double_t x, Double_t y, Double_t z,
70 Double_t px, Double_t py, Double_t pz, Double_t signal, Int_t refID);
71
72 Bool_t AddRealPointSimple(Double_t x, Double_t y, Double_t z,
73 Double_t px, Double_t py, Double_t pz, Double_t signal, Int_t refID); //old
74
75 //make a strip cluster from a single point (with gauss smearing)
76 StripCluster MakeCluster(Int_t layer_num, Double_t xcoord, Double_t ycoord, Double_t signal, Double_t radius);
77
78 //Methods to calculate intersection points in the module -------------------
80
81 //need for a separated test (find x,y intersection coords from strip positions)
82 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);
83 //--------------------------------------------------------------------------
84
85 //Added (real) points ------------------------------------------------------
86 Int_t GetNRealPoints() {return RealPointsX.size();} //quantity of added points
87 Double_t GetRealPointX(Int_t indx) { return RealPointsX.at(indx); } //X-coord of i-added point
88 Double_t GetRealPointMC(Int_t indx) { return RealPointsMC.at(indx); } //MC-index of i-added point
89
90 void ResetRealPoints() { RealPointsX.clear(); RealPointsY.clear(); RealPointsMC.clear(); }
91 //--------------------------------------------------------------------------
92
93 //Intersection points ------------------------------------------------------
94 Int_t GetNIntersectionPoints() {return IntersectionPointsX.size();} //quantity of intersections
95 Double_t GetIntersectionPointX(Int_t indx) { return IntersectionPointsX.at(indx); } //X-coord of indx-intersection point
96 Double_t GetIntersectionPointY(Int_t indx) { return IntersectionPointsY.at(indx); } //Y-coord of indx-intersection point
97 Double_t GetIntersectionPointXError(Int_t indx) { return IntersectionPointsXErrors.at(indx); } //X-coord error of indx-intersection point
98 Double_t GetIntersectionPointYError(Int_t indx) { return IntersectionPointsYErrors.at(indx); } //Y-coord error of indx-intersection point
99 Int_t GetIntersectionPoint_LowerLayerClusterSize(Int_t indx) { return IntersectionPoints_LowerLayerClusterSize.at(indx); } //cluster size in the lower layer
100 Int_t GetIntersectionPoint_UpperLayerClusterSize(Int_t indx) { return IntersectionPoints_UpperLayerClusterSize.at(indx); } //cluster size in the upper layer
101 Double_t GetIntersectionPoint_LowerLayerSripPosition(Int_t indx) { return IntersectionPoints_LowerLayerStripPosition.at(indx); } //strip position in the lower layer
102 Double_t GetIntersectionPoint_UpperLayerSripPosition(Int_t indx) { return IntersectionPoints_UpperLayerStripPosition.at(indx); } //strip position in the upper layer
103 Double_t GetIntersectionPoint_LowerLayerSripTotalSignal(Int_t indx) { return IntersectionPoints_LowerLayerStripTotalSignal.at(indx); } //total signal in the lower layer
104 Double_t GetIntersectionPoint_UpperLayerSripTotalSignal(Int_t indx) { return IntersectionPoints_UpperLayerStripTotalSignal.at(indx); } //total signal in the upper layer
105 BmnMatch GetIntersectionPointMatch(Int_t indx) { return IntersectionPointMatches.at(indx); } //Intersection point match
106
108 //--------------------------------------------------------------------------
109
110private:
111 void DefineModuleBorders(); //calculate min-max coordinates of the module from layers` parameters
112
113private:
114 BmnSiBTModule(const BmnSiBTModule&) = delete;
115 BmnSiBTModule& operator=(const BmnSiBTModule&) = delete;
116
117private:
118 Bool_t Verbosity;
119
120 Double_t XMinModule;
121 Double_t XMaxModule;
122 Double_t YMinModule;
123 Double_t YMaxModule;
124
125 Double_t ZStartModulePosition;
126
127 Double_t ModuleThickness;
128
129 vector<BmnSiBTLayer> StripLayers;
130
131 vector<Double_t> RealPointsX;
132 vector<Double_t> RealPointsY;
133 vector<Double_t> RealPointsMC; // index of MC point
134
135 vector<Double_t> IntersectionPointsX;
136 vector<Double_t> IntersectionPointsY;
137 vector<Double_t> IntersectionPointsXErrors;
138 vector<Double_t> IntersectionPointsYErrors;
139
140 vector<Int_t> IntersectionPoints_LowerLayerClusterSize; //cluster size (number of strips) in the lower layer for each intersection point
141 vector<Int_t> IntersectionPoints_UpperLayerClusterSize; //cluster size (number of strips) in the upper layer for each intersection point
142
143 vector<Double_t> IntersectionPoints_LowerLayerStripPosition; //strip position in the lower layer for each intersection point
144 vector<Double_t> IntersectionPoints_UpperLayerStripPosition; //strip position in the upper layer for each intersection point
145
146 vector<Double_t> IntersectionPoints_LowerLayerStripTotalSignal; //total signal in the lower layer for each intersection point
147 vector<Double_t> IntersectionPoints_UpperLayerStripTotalSignal; //total signal in the upper layer for each intersection point
148
149 vector<BmnMatch> IntersectionPointMatches;
150
151};
152//------------------------------------------------------------------------------
153
154#endif /* BMNSiBTMODULE_H */
155
Bool_t IsPointInsideZThickness(Double_t z)
Double_t GetXMaxModule()
StripCluster MakeCluster(Int_t layer_num, Double_t xcoord, Double_t ycoord, Double_t signal, Double_t radius)
Double_t GetIntersectionPoint_LowerLayerSripPosition(Int_t indx)
Bool_t IsPointInsideModule(Double_t x, Double_t y)
Double_t GetYMinModule()
void SetVerbosity(Bool_t verb)
Double_t GetYMaxModule()
Int_t GetNStripLayers()
Double_t GetIntersectionPointYError(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)
void ResetIntersectionPoints()
void SetZStartModulePosition(Double_t zpos_module)
Bool_t AddStripSignalInLayer(Int_t layer_num, Int_t strip_num, Double_t signal)
Double_t GetRealPointMC(Int_t indx)
Bool_t IsPointInsideModule(Double_t x, Double_t y, Double_t z)
BmnSiBTModule(Double_t z_start_pos, Double_t module_thick)
vector< BmnSiBTLayer > & GetStripLayers()
Bool_t SetStripMatchInLayer(Int_t layer_num, Int_t strip_num, BmnMatch strip_match)
Double_t GetZPositionRegistered()
Bool_t GetVerbosity()
Double_t GetIntersectionPointX(Int_t indx)
Double_t GetRealPointX(Int_t indx)
Double_t GetYSize()
Double_t GetStripSignalInLayer(Int_t layer_num, Int_t strip_num)
Double_t GetZStartModulePosition()
Bool_t SetStripSignalInLayer(Int_t layer_num, Int_t strip_num, Double_t signal)
Double_t GetXSize()
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)
BmnSiBTLayer & GetStripLayer(Int_t num)
Double_t GetModuleThickness()
Double_t GetXMinModule()
Double_t GetIntersectionPoint_LowerLayerSripTotalSignal(Int_t indx)
void AddStripLayer(BmnSiBTLayer strip_layer)
Int_t GetIntersectionPoint_UpperLayerClusterSize(Int_t indx)
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)
void ResetRealPoints()
Int_t GetIntersectionPoint_LowerLayerClusterSize(Int_t indx)
Double_t GetIntersectionPointXError(Int_t indx)
Int_t GetNRealPoints()
BmnMatch GetStripMatchInLayer(Int_t layer_num, Int_t strip_num)
Double_t GetIntersectionPointY(Int_t indx)
void ResetModuleData()
BmnMatch GetIntersectionPointMatch(Int_t indx)
Double_t GetIntersectionPoint_UpperLayerSripPosition(Int_t indx)
Int_t GetNIntersectionPoints()
virtual ~BmnSiBTModule()
void CalculateStripHitIntersectionPoints()
Double_t GetIntersectionPoint_UpperLayerSripTotalSignal(Int_t indx)
STL namespace.