BmnRoot
Loading...
Searching...
No Matches
BmnSiProfLayer.h
Go to the documentation of this file.
1#ifndef BMNSiProfLAYER_H
2#define BMNSiProfLAYER_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
16
17public:
18 //Constructors -------------------------------------------------------------
20
21 BmnSiProfLayer(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
28 virtual ~BmnSiProfLayer();
29
30 void InitializeLayer();
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 Bool_t GetVerbosity() { return Verbosity; }
41 Int_t GetZoneNumber() { return LayerZoneNumber; }
42 StripLayerType GetType() { return LayerType; }
43 Double_t GetPitch() { return Pitch; }
44 Double_t GetAngleDeg() { return AngleDeg; }
45 Double_t GetAngleRad() { return AngleRad; }
46 Double_t GetXSize() { return XMaxLayer-XMinLayer; }
47 Double_t GetYSize() { return YMaxLayer-YMinLayer; }
48 Double_t GetXMinLayer() { return XMinLayer; }
49 Double_t GetXMaxLayer() { return XMaxLayer; }
50 Double_t GetYMinLayer() { return YMinLayer; }
51 Double_t GetYMaxLayer() { return YMaxLayer; }
52
53 //Strip numbering methods --------------------------------------------------
54 Bool_t SetStripNumberingBorders(Double_t x_left, Double_t y_left, Double_t x_right, Double_t y_right); //or method below
56 Bool_t SetStripNumberingOrder(StripNumberingDirection strip_direction);
57
59 Double_t GetXLeftStripBorderPoint() { return XLeftPointOfStripNumbering; }
60 Double_t GetYLeftStripBorderPoint() { return YLeftPointOfStripNumbering; }
61 Double_t GetXRightStripBorderPoint() { return XRightPointOfStripNumbering; }
62 Double_t GetYRightStripBorderPoint() { return YRightPointOfStripNumbering; }
63 //--------------------------------------------------------------------------
64
65 //Dead zones methods -------------------------------------------------------
66 Bool_t AddDeadZone(Int_t n_points, Double_t *x_points, Double_t *y_points);
67 Bool_t AddDeadZone(DeadZoneOfStripLayer dead_zone);
68 Bool_t IsPointInsideDeadZones(Double_t x, Double_t y);
69 Bool_t IsPointInsideStripLayer(Double_t x, Double_t y);
70
71 vector<DeadZoneOfStripLayer> GetDeadZones() { return DeadZones; }
72 void ResetAllDeadZones() { DeadZones.clear(); }
73 //--------------------------------------------------------------------------
74
75 //Direct strip signal manipulation -----------------------------------------
76 Bool_t SetStripSignal(Int_t strip_num, Double_t signal); //replace signal
77 Bool_t AddStripSignal(Int_t strip_num, Double_t signal); //add signal
78
79 Double_t GetStripSignal(Int_t strip_num); //signal of strip_num-strip
80 //--------------------------------------------------------------------------
81
82 //Strip matches controls ---------------------------------------------------
83 Bool_t SetStripMatch(Int_t strip_num, BmnMatch strip_match);
84 Bool_t AddLinkToStripMatch(Int_t strip_num, Double_t weight, Int_t refID);
85
86 BmnMatch GetStripMatch(Int_t strip_num); //match of strip_num-strip
87 void ResetStripMatches();
88 //--------------------------------------------------------------------------
89
90 //Strip hits ---------------------------------------------------------------
91 Int_t GetNStripHits() { return StripHits.size(); } //number of hits at the layer
92 Double_t GetStripHitPos(Int_t num); //hit position
93 Double_t GetStripHitTotalSignal(Int_t num); //sum signal of the hit
94 Double_t GetStripHitError(Int_t num); //hit error
95 Int_t GetStripHitClusterSize(Int_t num); //number of strips in the cluster for the num-hit
96 void ResetStripHits();
97 //--------------------------------------------------------------------------
98
99 //Methods to convert point coordinates into strip system -------------------
100 Double_t ConvertNormalPointToStripX(Double_t x, Double_t y);
101 Double_t ConvertNormalPointToStripY(Double_t x, Double_t y);
102
103 Double_t ConvertPointToStripPosition(Double_t x, Double_t y);
104
105 Double_t CalculateStripEquationB(Double_t strip_pos);
106 //--------------------------------------------------------------------------
107
108 //Clustering and strip-hit finding methods ---------------------------------------
110 void MakeStripHit(StripCluster &cluster, vector<Double_t> &AnalyzableStrips, Int_t &curcnt);
111 void SmoothStripSignal(vector<Double_t>& AnalyzableStrips, Int_t NIterations, Int_t SmoothWindow, Double_t Weight);
112
113 void SetClusterFindingThreshold(Double_t threshold) { ClusterFindingThreshold = threshold; }
114 Double_t GetClusterFindingThreshold() { return ClusterFindingThreshold; }
115
116 vector<Double_t> GetSmoothStrips() { return SmoothStrips; } //for test
117 //--------------------------------------------------------------------------
118
119private:
120 //BmnSiProfLayer(const BmnSiProfLayer&) = delete;
121 //BmnSiProfLayer& operator=(const BmnSiProfLayer&) = delete;
122
123private:
124 Bool_t Verbosity;
125
126 Int_t LayerZoneNumber; //zone number of the strip layer
127 StripLayerType LayerType; //type of the strip layer: lower or upper
128
129 Double_t Pitch;
130 Double_t AngleDeg; //Angle between two sets of parallel strips: angle from vertical
131 Double_t AngleRad;
132
133 Double_t XMinLayer;
134 Double_t XMaxLayer;
135 Double_t YMinLayer;
136 Double_t YMaxLayer;
137
138 vector<DeadZoneOfStripLayer> DeadZones;
139
140 //Strip arrangement
141 StripNumberingDirection StripOrder; //strip numbering order (LeftToRight or RightToLeft)
142 Double_t XLeftPointOfStripNumbering;
143 Double_t XRightPointOfStripNumbering;
144 Double_t YLeftPointOfStripNumbering;
145 Double_t YRightPointOfStripNumbering;
146
147 //Strip layer implementation
148 vector<Double_t> Strips;
149
150 //Strip matches
151 vector<BmnMatch> StripMatches; //ID-point matches for all strips
152
153 //Strip hits (It is filled after cluster finding and fitting) --------------
154 vector<Double_t> StripHits; //positions of strip hits
155 vector<Double_t> StripHitsTotalSignal;
156 vector<Double_t> StripHitsErrors;
157 vector<Int_t> StripHitsClusterSize; //cluster size (number of strips) for each strip hit
158 vector<Double_t> SmoothStrips; //smoothed signal strips (It is filled after smoothing algorithm)
159 Double_t ClusterFindingThreshold; //min. threshold cut
160 //--------------------------------------------------------------------------
161};
162//------------------------------------------------------------------------------
163
164#endif /* BMNSiProfLAYER_H */
165
StripBorderPoint
StripNumberingDirection
StripLayerType
Double_t GetXMaxLayer()
Double_t GetYSize()
Double_t ConvertNormalPointToStripX(Double_t x, Double_t y)
Double_t GetStripSignal(Int_t strip_num)
Bool_t IsPointInsideDeadZones(Double_t x, Double_t y)
Bool_t SetStripSignal(Int_t strip_num, Double_t signal)
Double_t GetStripHitError(Int_t num)
Double_t GetAngleRad()
vector< Double_t > GetSmoothStrips()
Double_t ConvertNormalPointToStripY(Double_t x, Double_t y)
Double_t GetStripHitPos(Int_t num)
StripLayerType GetType()
Double_t GetXLeftStripBorderPoint()
Double_t GetYLeftStripBorderPoint()
Bool_t SetStripMatch(Int_t strip_num, BmnMatch strip_match)
Bool_t GetVerbosity()
void SetLayerSizes(Double_t xsize, Double_t ysize, Double_t xorig=0.0, Double_t yorig=0.0)
void MakeStripHit(StripCluster &cluster, vector< Double_t > &AnalyzableStrips, Int_t &curcnt)
StripNumberingDirection GetStripNumberingOrder()
Int_t GetNStripHits()
Double_t CalculateStripEquationB(Double_t strip_pos)
Bool_t AddDeadZone(Int_t n_points, Double_t *x_points, Double_t *y_points)
Int_t GetZoneNumber()
Double_t GetClusterFindingThreshold()
Bool_t AddLinkToStripMatch(Int_t strip_num, Double_t weight, Int_t refID)
vector< DeadZoneOfStripLayer > GetDeadZones()
Bool_t IsPointInsideStripLayer(Double_t x, Double_t y)
Double_t GetYMaxLayer()
Double_t GetXRightStripBorderPoint()
Double_t ConvertPointToStripPosition(Double_t x, Double_t y)
Double_t GetXMinLayer()
void SetVerbosity(Bool_t verb)
void SetClusterFindingThreshold(Double_t threshold)
Double_t GetStripHitTotalSignal(Int_t num)
Bool_t AddStripSignal(Int_t strip_num, Double_t signal)
void ResetAllDeadZones()
Double_t GetYRightStripBorderPoint()
Double_t GetYMinLayer()
Double_t GetXSize()
Bool_t SetStripNumberingOrder(StripNumberingDirection strip_direction)
void SetAngleDeg(Double_t deg)
Bool_t SetStripNumberingBorders(Double_t x_left, Double_t y_left, Double_t x_right, Double_t y_right)
Double_t GetPitch()
Double_t GetAngleDeg()
Int_t GetStripHitClusterSize(Int_t num)
virtual ~BmnSiProfLayer()
void SetPitch(Double_t pitch)
BmnMatch GetStripMatch(Int_t strip_num)
void FindClustersAndStripHits()
void SmoothStripSignal(vector< Double_t > &AnalyzableStrips, Int_t NIterations, Int_t SmoothWindow, Double_t Weight)
STL namespace.