BmnRoot
Loading...
Searching...
No Matches
BmnVSPLayer.h
Go to the documentation of this file.
1#ifndef BMNVSPLAYER_H
2#define BMNVSPLAYER_H
3
4#include "Rtypes.h"
5
6#include "BmnMatch.h"
7#include "BmnStripData.h"
8
9#include <vector>
10
11using namespace std;
12
13class BmnVSPLayer {
14
15public:
16
17 //Constructors -------------------------------------------------------------
19
20 BmnVSPLayer(Int_t zone_id,
21 StripLayerType layer_type, Int_t first_strip_number,
22 Double_t xsize, Double_t ysize,
23 Double_t xorig, Double_t yorig,
24 Double_t pitch, Double_t adeg);
25 //--------------------------------------------------------------------------
26
27 //Destructor
28 virtual ~BmnVSPLayer();
29
31 void ResetLayer(); //clear all data and rebuild the layer in accordance with new parameters
32
33 Int_t GetNStrips();
34
35 void SetVerbosity(Bool_t verb) { Verbosity = verb; }
36 void SetZoneID(Int_t zone_id) { ZoneID = zone_id; }
37 void SetFirstStripNumber(Int_t first_strip_number) { FirstStripNumber = first_strip_number; }
38 void SetPitch(Double_t pitch);
39 void SetLayerSizes(Double_t xsize, Double_t ysize, Double_t xorig=0.0, Double_t yorig=0.0);
40 void SetAngleDeg(Double_t deg); // plus - clockwise from vertical
41
42 Bool_t GetVerbosity() { return Verbosity; }
43 Int_t GetZoneID() { return ZoneID; }
44 Int_t GetFirstStripNumber() { return FirstStripNumber; }
45 Int_t GetLastStripNumber() { return (GetNStrips()+FirstStripNumber) - 1; }
46 StripLayerType GetType() { return LayerType; }
47 Double_t GetPitch() { return Pitch; }
48 Double_t GetAngleDeg() { return AngleDeg; }
49 Double_t GetAngleRad() { return AngleRad; }
50 Double_t GetXSize() { return XMaxLayer-XMinLayer; }
51 Double_t GetYSize() { return YMaxLayer-YMinLayer; }
52 Double_t GetXMinLayer() { return XMinLayer; }
53 Double_t GetXMaxLayer() { return XMaxLayer; }
54 Double_t GetYMinLayer() { return YMinLayer; }
55 Double_t GetYMaxLayer() { return YMaxLayer; }
56
57 //Strip numbering methods --------------------------------------------------
58 Bool_t SetStripNumberingBorders(Double_t x_left, Double_t y_left, Double_t x_right, Double_t y_right); //or method below
61
63 Double_t GetXLeftStripBorderPoint() { return XLeftPointOfStripNumbering; }
64 Double_t GetYLeftStripBorderPoint() { return YLeftPointOfStripNumbering; }
65 Double_t GetXRightStripBorderPoint() { return XRightPointOfStripNumbering; }
66 Double_t GetYRightStripBorderPoint() { return YRightPointOfStripNumbering; }
67 //--------------------------------------------------------------------------
68
69 //Dead zones methods -------------------------------------------------------
70 Bool_t AddDeadZone(Int_t n_points, Double_t *x_points, Double_t *y_points);
72 Bool_t IsPointInsideDeadZones(Double_t x, Double_t y);
73 Bool_t IsPointInsideStripLayer(Double_t x, Double_t y);
74
75 vector<DeadZoneOfStripLayer> GetDeadZones() { return DeadZones; }
76 void ResetAllDeadZones() { DeadZones.clear(); }
77 //--------------------------------------------------------------------------
78
79 //Direct strip signal manipulation -----------------------------------------
80 Bool_t SetStripSignal(Int_t strip_num, Double_t signal); //replace signal
81 Bool_t AddStripSignal(Int_t strip_num, Double_t signal); //add signal
82
83 Double_t GetStripSignal(Int_t strip_num); //signal of strip_num-strip
84 //--------------------------------------------------------------------------
85
86 //Strip matches controls ---------------------------------------------------
87 Bool_t SetStripMatch(Int_t strip_num, BmnMatch mc_match); // set a MC-match for a strip
88 Bool_t AddLinkToStripMatch(Int_t strip_num, Double_t weight, Int_t mc_num); // add a mc-number to a MC-match
89
90 Bool_t SetStripDigitNumberMatch(Int_t strip_num, BmnMatch digit_num_match); // set a digit number match for a strip
91 Bool_t AddLinkToStripDigitNumberMatch(Int_t strip_num, Double_t weight, Int_t digit_num); // add a digit number match for a strip
92
93 BmnMatch GetStripMatch(Int_t strip_num); //mc-match for a strip
94 BmnMatch GetStripDigitNumberMatch(Int_t strip_num); //digit number match for a strip
95
98 //--------------------------------------------------------------------------
99
100 //Strip hits ---------------------------------------------------------------
101 Int_t GetNStripHits() { return StripHits.size(); } //number of hits at the layer
102 Double_t GetStripHitPos(Int_t num); //hit position
103 Double_t GetStripHitTotalSignal(Int_t num); //sum signal of the hit
104 Double_t GetStripHitError(Int_t num); //hit error
105 Int_t GetStripHitClusterSize(Int_t num); //number of strips in the cluster for the num-hit
107 //--------------------------------------------------------------------------
108
109 //Strip Clusters -----------------------------------------------------------
110 vector<StripCluster> GetStripClusters() { return StripClusters; };
111 static void SetLowerUniqueID(Int_t id) { fUniqueIdL = id; }
112 static void SetUpperUniqueID(Int_t id) { fUniqueIdU = id; }
113 //--------------------------------------------------------------------------
114
115 //Methods to convert point coordinates into strip system -------------------
116 Double_t ConvertNormalPointToStripX(Double_t x, Double_t y);
117 Double_t ConvertNormalPointToStripY(Double_t x, Double_t y);
118
119 Double_t ConvertPointToStripPosition(Double_t x, Double_t y);
120
121 Double_t CalculateStripEquationB(Double_t strip_pos);
122 //--------------------------------------------------------------------------
123
124 //Clustering and strip-hit finding methods ---------------------------------------
126 void MakeStripHit(StripCluster &cluster, vector<Double_t> &AnalyzableStrips, Int_t &curcnt);
127 void SmoothStripSignal(vector<Double_t>& AnalyzableStrips, Int_t NIterations, Int_t SmoothWindow, Double_t Weight);
128
129 void SetClusterFindingThreshold(Double_t threshold) { ClusterFindingThreshold = threshold; }
130 Double_t GetClusterFindingThreshold() { return ClusterFindingThreshold; }
131
132 vector<Double_t> GetSmoothStrips() { return SmoothStrips; } //for test (don't forget about FirstStripNumber when you use it)
133 //--------------------------------------------------------------------------
134
135private:
136 //BmnVSPLayer(const BmnVSPLayer&) = delete;
137 //BmnVSPLayer& operator=(const BmnVSPLayer&) = delete;
138
139private:
140 Bool_t Verbosity;
141
142 Int_t ZoneID; // zone id-number to recognize the layers linked together
143 Int_t FirstStripNumber; // the number that numbered strips start with
144 StripLayerType LayerType; //type of the strip layer: lower or upper
145
146 Double_t Pitch; // as a perpendicular to a strip
147 Double_t AngleDeg; //Angle between two sets of parellel strips: angle from vertical
148 Double_t AngleRad;
149
150 Double_t XMinLayer;
151 Double_t XMaxLayer;
152 Double_t YMinLayer;
153 Double_t YMaxLayer;
154
155 vector<DeadZoneOfStripLayer> DeadZones;
156
157 //Strip arrangement
158 StripNumberingDirection StripOrder; //strip numbering order (LeftToRight or RightToLeft)
159 Double_t XLeftPointOfStripNumbering;
160 Double_t XRightPointOfStripNumbering;
161 Double_t YLeftPointOfStripNumbering;
162 Double_t YRightPointOfStripNumbering;
163
164 //Strip layer implementation
165 vector<Double_t> Strips;
166
167 //Strip matches
168 vector<BmnMatch> StripMatches; //MC-point matches for all strips
169 vector<BmnMatch> StripDigitNumberMatches; //Digit number matches for all strips
170
171 //Strip hits (It is filled after cluster finding and fitting) --------------
172 vector<Double_t> StripHits; //positions of strip hits
173 vector<Double_t> StripHitsTotalSignal;
174 vector<Double_t> StripHitsErrors;
175 vector<Int_t> StripHitsClusterSize; //cluster size (number of strips) for each strip hit
176 vector<Double_t> SmoothStrips; //smoothed signal strips (It is filled after smoothing algorithm)
177 Double_t ClusterFindingThreshold; //min. threshold cut
178 //--------------------------------------------------------------------------
179
180 //Strip Clusters -----------------------------------------------------------
181 vector<StripCluster> StripClusters;
182
183 static Int_t fUniqueIdU;
184 static Int_t fUniqueIdL;
185 //--------------------------------------------------------------------------
186
187 ClassDef(BmnVSPLayer, 1);
188};
189
190//------------------------------------------------------------------------------
191
192#endif /* BMNVSPLAYER_H */
193
StripBorderPoint
StripNumberingDirection
StripLayerType
Bool_t AddStripSignal(Int_t strip_num, Double_t signal)
virtual ~BmnVSPLayer()
Double_t GetStripHitError(Int_t num)
Bool_t GetVerbosity()
Definition BmnVSPLayer.h:42
static void SetLowerUniqueID(Int_t id)
Double_t ConvertNormalPointToStripY(Double_t x, Double_t y)
void ResetStripMatches()
Double_t GetXSize()
Definition BmnVSPLayer.h:50
void SetZoneID(Int_t zone_id)
Definition BmnVSPLayer.h:36
vector< Double_t > GetSmoothStrips()
Double_t GetYLeftStripBorderPoint()
Definition BmnVSPLayer.h:64
Double_t CalculateStripEquationB(Double_t strip_pos)
Double_t ConvertNormalPointToStripX(Double_t x, Double_t y)
void MakeStripHit(StripCluster &cluster, vector< Double_t > &AnalyzableStrips, Int_t &curcnt)
Int_t GetFirstStripNumber()
Definition BmnVSPLayer.h:44
StripLayerType GetType()
Definition BmnVSPLayer.h:46
Bool_t SetStripNumberingOrder(StripNumberingDirection strip_direction)
Int_t GetLastStripNumber()
Definition BmnVSPLayer.h:45
Double_t GetXLeftStripBorderPoint()
Definition BmnVSPLayer.h:63
Bool_t AddDeadZone(DeadZoneOfStripLayer dead_zone)
void InitializeLayer()
Double_t GetStripHitPos(Int_t num)
void ResetAllDeadZones()
Definition BmnVSPLayer.h:76
Bool_t SetStripMatch(Int_t strip_num, BmnMatch mc_match)
BmnMatch GetStripMatch(Int_t strip_num)
void SetVerbosity(Bool_t verb)
Definition BmnVSPLayer.h:35
Double_t GetXMaxLayer()
Definition BmnVSPLayer.h:53
Bool_t SetStripSignal(Int_t strip_num, Double_t signal)
Double_t ConvertPointToStripPosition(Double_t x, Double_t y)
Double_t GetXMinLayer()
Definition BmnVSPLayer.h:52
vector< DeadZoneOfStripLayer > GetDeadZones()
Definition BmnVSPLayer.h:75
Double_t GetYMaxLayer()
Definition BmnVSPLayer.h:55
Bool_t SetStripNumberingBorders(Double_t x_left, Double_t y_left, Double_t x_right, Double_t y_right)
Bool_t IsPointInsideDeadZones(Double_t x, Double_t y)
void ResetStripDigitNumberMatches()
Bool_t AddLinkToStripDigitNumberMatch(Int_t strip_num, Double_t weight, Int_t digit_num)
static void SetUpperUniqueID(Int_t id)
void ResetStripHits()
BmnMatch GetStripDigitNumberMatch(Int_t strip_num)
Double_t GetAngleDeg()
Definition BmnVSPLayer.h:48
void FindClustersAndStripHits()
Int_t GetNStripHits()
Double_t GetClusterFindingThreshold()
Int_t GetStripHitClusterSize(Int_t num)
Double_t GetYSize()
Definition BmnVSPLayer.h:51
void SetFirstStripNumber(Int_t first_strip_number)
Definition BmnVSPLayer.h:37
Int_t GetZoneID()
Definition BmnVSPLayer.h:43
void SmoothStripSignal(vector< Double_t > &AnalyzableStrips, Int_t NIterations, Int_t SmoothWindow, Double_t Weight)
Bool_t SetStripDigitNumberMatch(Int_t strip_num, BmnMatch digit_num_match)
Double_t GetXRightStripBorderPoint()
Definition BmnVSPLayer.h:65
Bool_t SetStripNumberingBorders(StripBorderPoint left, StripBorderPoint right)
Int_t GetNStrips()
vector< StripCluster > GetStripClusters()
void ResetLayer()
Double_t GetStripSignal(Int_t strip_num)
void SetClusterFindingThreshold(Double_t threshold)
Double_t GetYRightStripBorderPoint()
Definition BmnVSPLayer.h:66
Double_t GetYMinLayer()
Definition BmnVSPLayer.h:54
Double_t GetStripHitTotalSignal(Int_t num)
Double_t GetAngleRad()
Definition BmnVSPLayer.h:49
BmnVSPLayer(Int_t zone_id, StripLayerType layer_type, Int_t first_strip_number, Double_t xsize, Double_t ysize, Double_t xorig, Double_t yorig, Double_t pitch, Double_t adeg)
void SetLayerSizes(Double_t xsize, Double_t ysize, Double_t xorig=0.0, Double_t yorig=0.0)
void SetPitch(Double_t pitch)
void SetAngleDeg(Double_t deg)
StripNumberingDirection GetStripNumberingOrder()
Definition BmnVSPLayer.h:62
Bool_t AddLinkToStripMatch(Int_t strip_num, Double_t weight, Int_t mc_num)
Bool_t IsPointInsideStripLayer(Double_t x, Double_t y)
Bool_t AddDeadZone(Int_t n_points, Double_t *x_points, Double_t *y_points)
Double_t GetPitch()
Definition BmnVSPLayer.h:47
STL namespace.