BmnRoot
Loading...
Searching...
No Matches
BmnGemStripLayer.h
Go to the documentation of this file.
1#ifndef BMNGEMSTRIPLAYER_H
2#define BMNGEMSTRIPLAYER_H
3
4#include "BmnMatch.h"
5#include "BmnStripData.h"
6
7#include "TMath.h"
8
9#include <iostream>
10#include <vector>
11
12using namespace TMath;
13using namespace std;
14
15class BmnGemStripLayer {
16
17public:
18 //Constructors -------------------------------------------------------------
20
21 BmnGemStripLayer(Int_t zone_number, StripLayerType layer_type,
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
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 SetPitch(Double_t pitch);
37 void SetLayerSizes(Double_t xsize, Double_t ysize, Double_t xorig=0.0, Double_t yorig=0.0);
38 void SetAngleDeg(Double_t deg); // plus - clockwise from vertical
39
40 //never called
41 int GetFirstStripNumber(){return 0;}
42 int GetLastStripNumber(){return 0;}
43
44 Bool_t GetVerbosity() { return Verbosity; }
45 Int_t GetZoneNumber() { return LayerZoneNumber; }
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 void SetTotalClusterThreshold(Double_t th) { TotalClusterThreshold = th; }
133
134 vector<Double_t> GetSmoothStrips() { return SmoothStrips; } //for test
135 //--------------------------------------------------------------------------
136
137private:
138 //BmnGemStripLayer(const BmnGemStripLayer&) = delete;
139 //BmnGemStripLayer& operator=(const BmnGemStripLayer&) = delete;
140
141private:
142 Bool_t Verbosity;
143
144 Int_t LayerZoneNumber; //zone number of the strip layer
145 StripLayerType LayerType; //type of the strip layer: lower or upper
146
147 Double_t Pitch;
148 Double_t AngleDeg; //Angle between two sets of parellel strips: angle from vertical
149 Double_t AngleRad;
150
151 Double_t XMinLayer;
152 Double_t XMaxLayer;
153 Double_t YMinLayer;
154 Double_t YMaxLayer;
155
156 vector<DeadZoneOfStripLayer> DeadZones;
157
158 //Strip arrangement
159 StripNumberingDirection StripOrder; //strip numbering order (LeftToRight or RightToLeft)
160 Double_t XLeftPointOfStripNumbering;
161 Double_t XRightPointOfStripNumbering;
162 Double_t YLeftPointOfStripNumbering;
163 Double_t YRightPointOfStripNumbering;
164
165 //Strip layer implementation
166 vector<Double_t> Strips;
167
168 //Strip matches
169 vector<BmnMatch> StripMatches; //MC-point matches for all strips
170 vector<BmnMatch> StripDigitNumberMatches; //Digit number matches for all strips
171
172 //Strip hits (It is filled after cluster finding and fitting) --------------
173 vector<Double_t> StripHits; //positions of strip hits
174 vector<Double_t> StripHitsTotalSignal;
175 vector<Double_t> StripHitsErrors;
176 vector<Int_t> StripHitsClusterSize; //cluster size (number of strips) for each strip hit
177 vector<Double_t> SmoothStrips; //smoothed signal strips (It is filled after smoothing algorithm)
178 Double_t ClusterFindingThreshold; //min. threshold cut for strip to be included in cluster
179 Double_t TotalClusterThreshold; //min. threshold cut for total cluster signal to be written into TClonesArray
180 //--------------------------------------------------------------------------
181
182 //Strip Clusters -----------------------------------------------------------
183 vector<StripCluster> StripClusters;
184
185 static Int_t fUniqueIdU;
186 static Int_t fUniqueIdL;
187 //--------------------------------------------------------------------------
188};
189//------------------------------------------------------------------------------
190
191#endif /* BMNGEMSTRIPLAYER_H */
192
StripBorderPoint
StripNumberingDirection
StripLayerType
Double_t GetStripHitError(Int_t num)
void SmoothStripSignal(vector< Double_t > &AnalyzableStrips, Int_t NIterations, Int_t SmoothWindow, Double_t Weight)
Double_t ConvertPointToStripPosition(Double_t x, Double_t y)
Double_t GetYMinLayer()
Double_t GetYRightStripBorderPoint()
Double_t GetYMaxLayer()
Double_t GetXMinLayer()
vector< DeadZoneOfStripLayer > GetDeadZones()
Bool_t SetStripNumberingOrder(StripNumberingDirection strip_direction)
BmnMatch GetStripDigitNumberMatch(Int_t strip_num)
Bool_t SetStripMatch(Int_t strip_num, BmnMatch mc_match)
Bool_t IsPointInsideStripLayer(Double_t x, Double_t y)
void InitializeLayer()
void ResetStripDigitNumberMatches()
static void SetUpperUniqueID(Int_t id)
void MakeStripHit(StripCluster &cluster, vector< Double_t > &AnalyzableStrips, Int_t &curcnt)
Double_t ConvertNormalPointToStripY(Double_t x, Double_t y)
Double_t GetXRightStripBorderPoint()
void SetLayerSizes(Double_t xsize, Double_t ysize, Double_t xorig=0.0, Double_t yorig=0.0)
Double_t GetYLeftStripBorderPoint()
Bool_t SetStripSignal(Int_t strip_num, Double_t signal)
vector< Double_t > GetSmoothStrips()
Double_t GetXLeftStripBorderPoint()
Bool_t IsPointInsideDeadZones(Double_t x, Double_t y)
Double_t CalculateStripEquationB(Double_t strip_pos)
Bool_t AddStripSignal(Int_t strip_num, Double_t signal)
vector< StripCluster > GetStripClusters()
Int_t GetStripHitClusterSize(Int_t num)
void SetPitch(Double_t pitch)
Bool_t AddDeadZone(DeadZoneOfStripLayer dead_zone)
Double_t GetXMaxLayer()
Double_t GetClusterFindingThreshold()
virtual ~BmnGemStripLayer()
StripLayerType GetType()
Bool_t SetStripNumberingBorders(StripBorderPoint left, StripBorderPoint right)
void SetVerbosity(Bool_t verb)
void FindClustersAndStripHits()
StripNumberingDirection GetStripNumberingOrder()
BmnGemStripLayer(Int_t zone_number, StripLayerType layer_type, Double_t xsize, Double_t ysize, Double_t xorig, Double_t yorig, Double_t pitch, Double_t adeg)
Bool_t SetStripDigitNumberMatch(Int_t strip_num, BmnMatch digit_num_match)
BmnMatch GetStripMatch(Int_t strip_num)
Double_t GetStripHitPos(Int_t num)
void SetClusterFindingThreshold(Double_t threshold)
Double_t GetStripHitTotalSignal(Int_t num)
Double_t GetStripSignal(Int_t strip_num)
Bool_t AddLinkToStripMatch(Int_t strip_num, Double_t weight, Int_t mc_num)
Bool_t AddLinkToStripDigitNumberMatch(Int_t strip_num, Double_t weight, Int_t digit_num)
Bool_t AddDeadZone(Int_t n_points, Double_t *x_points, Double_t *y_points)
static void SetLowerUniqueID(Int_t id)
void SetAngleDeg(Double_t deg)
Bool_t SetStripNumberingBorders(Double_t x_left, Double_t y_left, Double_t x_right, Double_t y_right)
void SetTotalClusterThreshold(Double_t th)
Double_t ConvertNormalPointToStripX(Double_t x, Double_t y)
void ResetStripMatches()
STL namespace.