BmnRoot
Loading...
Searching...
No Matches
BmnSiBTLayer.h
Go to the documentation of this file.
1#ifndef BMNSiBTLAYER_H
2#define BMNSiBTLAYER_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 BmnSiBTLayer(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 ~BmnSiBTLayer();
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 //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
60 Bool_t SetStripNumberingOrder(StripNumberingDirection strip_direction);
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);
71 Bool_t AddDeadZone(DeadZoneOfStripLayer dead_zone);
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 strip_match);
88 Bool_t AddLinkToStripMatch(Int_t strip_num, Double_t weight, Int_t refID);
89
90 BmnMatch GetStripMatch(Int_t strip_num); //match of strip_num-strip
91 void ResetStripMatches();
92 //--------------------------------------------------------------------------
93
94 //Strip hits ---------------------------------------------------------------
95 Int_t GetNStripHits() { return StripHits.size(); } //number of hits at the layer
96 Double_t GetStripHitPos(Int_t num); //hit position
97 Double_t GetStripHitTotalSignal(Int_t num); //sum signal of the hit
98 Double_t GetStripHitError(Int_t num); //hit error
99 Int_t GetStripHitClusterSize(Int_t num); //number of strips in the cluster for the num-hit
100 void ResetStripHits();
101 //--------------------------------------------------------------------------
102
103 //Methods to convert point coordinates into strip system -------------------
104 Double_t ConvertNormalPointToStripX(Double_t x, Double_t y);
105 Double_t ConvertNormalPointToStripY(Double_t x, Double_t y);
106
107 Double_t ConvertPointToStripPosition(Double_t x, Double_t y);
108
109 Double_t CalculateStripEquationB(Double_t strip_pos);
110 //--------------------------------------------------------------------------
111
112 //Clustering and strip-hit finding methods ---------------------------------------
114 void MakeStripHit(StripCluster &cluster, vector<Double_t> &AnalyzableStrips, Int_t &curcnt);
115 void SmoothStripSignal(vector<Double_t>& AnalyzableStrips, Int_t NIterations, Int_t SmoothWindow, Double_t Weight);
116
117 void SetClusterFindingThreshold(Double_t threshold) { ClusterFindingThreshold = threshold; }
118 Double_t GetClusterFindingThreshold() { return ClusterFindingThreshold; }
119
120 vector<Double_t> GetSmoothStrips() { return SmoothStrips; } //for test
121 //--------------------------------------------------------------------------
122
123private:
124 //BmnSiBTLayer(const BmnSiBTLayer&) = delete;
125 //BmnSiBTLayer& operator=(const BmnSiBTLayer&) = delete;
126
127private:
128 Bool_t Verbosity;
129
130 Int_t LayerZoneNumber; //zone number of the strip layer
131 StripLayerType LayerType; //type of the strip layer: lower or upper
132
133 Double_t Pitch;
134 Double_t AngleDeg; //Angle between two sets of parallel strips: angle from vertical
135 Double_t AngleRad;
136
137 Double_t XMinLayer;
138 Double_t XMaxLayer;
139 Double_t YMinLayer;
140 Double_t YMaxLayer;
141
142 vector<DeadZoneOfStripLayer> DeadZones;
143
144 //Strip arrangement
145 StripNumberingDirection StripOrder; //strip numbering order (LeftToRight or RightToLeft)
146 Double_t XLeftPointOfStripNumbering;
147 Double_t XRightPointOfStripNumbering;
148 Double_t YLeftPointOfStripNumbering;
149 Double_t YRightPointOfStripNumbering;
150
151 //Strip layer implementation
152 vector<Double_t> Strips;
153
154 //Strip matches
155 vector<BmnMatch> StripMatches; //ID-point matches for all strips
156
157 //Strip hits (It is filled after cluster finding and fitting) --------------
158 vector<Double_t> StripHits; //positions of strip hits
159 vector<Double_t> StripHitsTotalSignal;
160 vector<Double_t> StripHitsErrors;
161 vector<Int_t> StripHitsClusterSize; //cluster size (number of strips) for each strip hit
162 vector<Double_t> SmoothStrips; //smoothed signal strips (It is filled after smoothing algorithm)
163 Double_t ClusterFindingThreshold; //min. threshold cut
164 //--------------------------------------------------------------------------
165};
166//------------------------------------------------------------------------------
167
168#endif /* BMNSiBTLAYER_H */
169
StripBorderPoint
StripNumberingDirection
StripLayerType
Double_t GetStripHitTotalSignal(Int_t num)
void InitializeLayer()
Double_t GetXSize()
void ResetStripHits()
void SetPitch(Double_t pitch)
virtual ~BmnSiBTLayer()
vector< DeadZoneOfStripLayer > GetDeadZones()
Bool_t IsPointInsideStripLayer(Double_t x, Double_t y)
Int_t GetNStrips()
Double_t GetPitch()
Double_t ConvertNormalPointToStripX(Double_t x, Double_t y)
Double_t ConvertPointToStripPosition(Double_t x, Double_t y)
Double_t GetAngleRad()
Double_t GetYLeftStripBorderPoint()
Double_t GetXMaxLayer()
int GetFirstStripNumber()
void SetAngleDeg(Double_t deg)
void SetClusterFindingThreshold(Double_t threshold)
Bool_t SetStripNumberingBorders(Double_t x_left, Double_t y_left, Double_t x_right, Double_t y_right)
Double_t GetYSize()
Double_t GetYMaxLayer()
Double_t GetStripSignal(Int_t strip_num)
void SmoothStripSignal(vector< Double_t > &AnalyzableStrips, Int_t NIterations, Int_t SmoothWindow, Double_t Weight)
Int_t GetStripHitClusterSize(Int_t num)
Bool_t SetStripMatch(Int_t strip_num, BmnMatch strip_match)
Double_t GetClusterFindingThreshold()
Double_t ConvertNormalPointToStripY(Double_t x, Double_t y)
Double_t GetAngleDeg()
void ResetAllDeadZones()
Int_t GetZoneNumber()
Double_t GetYRightStripBorderPoint()
void SetVerbosity(Bool_t verb)
void MakeStripHit(StripCluster &cluster, vector< Double_t > &AnalyzableStrips, Int_t &curcnt)
int GetLastStripNumber()
StripLayerType GetType()
Bool_t SetStripNumberingOrder(StripNumberingDirection strip_direction)
Double_t GetYMinLayer()
Double_t GetXMinLayer()
Bool_t SetStripSignal(Int_t strip_num, Double_t signal)
Int_t GetNStripHits()
Bool_t AddLinkToStripMatch(Int_t strip_num, Double_t weight, Int_t refID)
Double_t GetXLeftStripBorderPoint()
Double_t GetXRightStripBorderPoint()
void FindClustersAndStripHits()
Bool_t GetVerbosity()
vector< Double_t > GetSmoothStrips()
BmnMatch GetStripMatch(Int_t strip_num)
Bool_t IsPointInsideDeadZones(Double_t x, Double_t y)
Bool_t AddDeadZone(Int_t n_points, Double_t *x_points, Double_t *y_points)
Double_t GetStripHitPos(Int_t num)
void SetLayerSizes(Double_t xsize, Double_t ysize, Double_t xorig=0.0, Double_t yorig=0.0)
Bool_t AddStripSignal(Int_t strip_num, Double_t signal)
Double_t GetStripHitError(Int_t num)
void ResetStripMatches()
Double_t CalculateStripEquationB(Double_t strip_pos)
StripNumberingDirection GetStripNumberingOrder()
STL namespace.