42 StripLayerType layer_type,
91 Strips.resize(NStrips, 0.0);
115 if ((n_strips - (
Int_t)n_strips) < 1
E-10) {
116 return (
Int_t)n_strips;
118 return (
Int_t)(n_strips + 1);
141 if (
Abs(deg) <= 90.0) {
146 cerr <<
"WARNING: BmnGemStripLayer::SetAngleDeg(): the strip angle is incorrect and has been set to zero\n";
156 if (x_right < x_left)
174 cerr <<
"WARNING: SetStripNumberingBorders: left strip border point is incorrect\n";
179 cerr <<
"WARNING: SetStripNumberingBorders: right strip border point is incorrect\n";
226 if (status ==
true) {
246 for (
size_t izone = 0; izone <
DeadZones.size(); ++izone) {
264 if (strip_num >= 0 && strip_num < (
int)
Strips.size()) {
265 Strips[strip_num] = signal;
273 if (strip_num >= 0 && strip_num < (
int)
Strips.size()) {
274 Strips[strip_num] += signal;
282 if (strip_num >= 0 && strip_num < (
int)
Strips.size()) {
290 if (strip_num >= 0 && strip_num < (
int)
StripMatches.size()) {
299 if (strip_num >= 0 && strip_num < (
int)
StripMatches.size()) {
326 if (strip_num >= 0 && strip_num < (
int)
StripMatches.size()) {
358 if (num >= 0 && num < (
int)
StripHits.size()) {
498 vector<Double_t> AnalyzableStrips =
Strips;
505 for (
Int_t is = 0; is < (int)AnalyzableStrips.size(); is++) {
507 if (AnalyzableStrips.at(is) <= threshold) {
508 if (descent || ascent) {
538 cluster.
AddStrip(is, AnalyzableStrips.at(is));
543 Int_t lastnum = AnalyzableStrips.size() - 1;
552 Double_t total_cluster_signal = 0.0;
559 if (AnalyzableStrips.at(curcnt) >= AnalyzableStrips.at(curcnt - 1)) {
561 AnalyzableStrips.at(curcnt - 1) *= 0.5;
566 for (
Int_t i = 0;
i < NStripsInCluster; ++
i) {
569 total_cluster_signal += signal;
570 mean_strip_position += (strip_num + 0.5) * signal;
572 mean_strip_position /= total_cluster_signal;
574 if (mean_strip_position < 0.0)
575 mean_strip_position = 0.0;
576 if (mean_strip_position >= AnalyzableStrips.size())
577 mean_strip_position = AnalyzableStrips.size() - 0.001;
597 Double_t sumW = total_cluster_signal;
600 if (NStripsInCluster > 1) {
601 for (
Int_t i = 0;
i < NStripsInCluster; ++
i) {
604 sumWX += strip_num * signal;
605 sumWX2 += strip_num * strip_num * signal;
607 cluster_rms = (sumWX2 - sumWX * sumWX / sumW) / sumW;
631 StripHits.push_back(mean_strip_position);
647 cluster.
Error = cluster_rms;
682 Int_t NStrips = AnalyzableStrips.size();
684 for (
Int_t iteration = 0; iteration < NIterations; ++iteration) {
686 for (
Int_t istrip = 0; istrip < NStrips; ++istrip) {
688 for (
Int_t iw = istrip - SmoothWindow; iw <= istrip + SmoothWindow; ++iw) {
689 if (iw >= 0 && iw < NStrips) {
691 mean_value += AnalyzableStrips[iw] * Weight;
693 mean_value += AnalyzableStrips[iw];
696 mean_value /= 2.0 * SmoothWindow + Weight;
Double_t TotalClusterThreshold
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)
vector< DeadZoneOfStripLayer > DeadZones
virtual ~BmnGemStripLayer()
Bool_t SetStripNumberingOrder(StripNumberingDirection strip_direction)
Double_t XLeftPointOfStripNumbering
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)
vector< BmnMatch > StripDigitNumberMatches
vector< Int_t > StripHitsClusterSize
void ResetStripDigitNumberMatches()
void MakeStripHit(StripCluster &cluster, vector< Double_t > &AnalyzableStrips, Int_t &curcnt)
Double_t ConvertNormalPointToStripY(Double_t x, Double_t y)
Double_t YLeftPointOfStripNumbering
Double_t YRightPointOfStripNumbering
StripNumberingDirection StripOrder
void SetLayerSizes(Double_t xsize, Double_t ysize, Double_t xorig=0.0, Double_t yorig=0.0)
Bool_t SetStripSignal(Int_t strip_num, Double_t signal)
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)
Int_t GetStripHitClusterSize(Int_t num)
void SetPitch(Double_t pitch)
vector< Double_t > StripHitsTotalSignal
Double_t ClusterFindingThreshold
vector< Double_t > Strips
void FindClustersAndStripHits()
Bool_t SetStripDigitNumberMatch(Int_t strip_num, BmnMatch digit_num_match)
BmnMatch GetStripMatch(Int_t strip_num)
Double_t GetStripHitPos(Int_t num)
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)
vector< Double_t > SmoothStrips
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)
Double_t XRightPointOfStripNumbering
vector< BmnMatch > StripMatches
vector< StripCluster > StripClusters
vector< Double_t > StripHits
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 ConvertNormalPointToStripX(Double_t x, Double_t y)
vector< Double_t > StripHitsErrors
Bool_t SetDeadZone(Int_t n_points, Double_t *xpoints, Double_t *ypoints)
void AddStrip(Int_t strip_num, Double_t strip_signal)
vector< Double_t > Signals
virtual void SetUniqueID(UInt_t uid)
Bool_t IsInside(T xp, T yp, Int_t np, T *x, T *y)
constexpr Double_t PiOver2()
Double_t Sqrt(Double_t x)