PandaRoot
PndSdsChargeWeightingAlgorithms.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 #ifndef _PNDSDSCHARGEWEIGHTINGALGORITHMS_H
14 #define _PNDSDSCHARGEWEIGHTINGALGORITHMS_H
15 
16 #include <vector>
17 #include "TObject.h"
18 #include "TClonesArray.h"
19 #include "TH2F.h"
20 #include "PndSdsDigiStrip.h"
21 #include "PndSdsChargeConversion.h"
22 class PndSdsCluster;
23 // class RunInfo;
24 class PndSdsCalcStrip;
25 
26 class PndSdsChargeWeightingAlgorithms : public TObject {
37  public:
38  PndSdsChargeWeightingAlgorithms(TClonesArray *arr);
40  : TObject(other), fDigiArray(other.fDigiArray), fCalcStrip(other.fCalcStrip), fChargeConverter(other.fChargeConverter), fVerbose(other.fVerbose){};
43  {
44  fDigiArray = other.fDigiArray;
45  fCalcStrip = other.fCalcStrip;
46  fChargeConverter = other.fChargeConverter;
47  fVerbose = other.fVerbose;
48  return *this;
49  };
50 
63  std::pair<Double_t, Double_t> CenterOfGravity(const PndSdsCluster *Cluster);
64 
77  std::pair<Double_t, Double_t> HeadTail(const PndSdsCluster *Cluster);
78 
90  std::pair<Double_t, Double_t> Eta(const PndSdsCluster *Cluster, const TH2F *PosVsEta);
91 
92  std::pair<Double_t, Double_t> EtaValue(const PndSdsCluster *Cluster, Double_t &stripno, Int_t &NmbOfStrips); // calculates the eta value for the given cluster.
104  std::pair<Double_t, Double_t> Binary(const PndSdsCluster *Cluster);
105 
117  std::pair<Double_t, Double_t> Median(const PndSdsCluster *Cluster);
118 
130  std::pair<Double_t, Double_t> AutoSelect(const PndSdsCluster *Cluster);
131 
144  // void MakedNdEta(const std::vector<PndSdsCluster>& Cluster, RunInfo& info);
147  void SetDigiArray(TClonesArray *darray) { fDigiArray = darray; };
148  void SetCalcStrip(PndSdsCalcStrip *calc) { fCalcStrip = calc; };
149  void SetChargeConverter(PndSdsChargeConversion *ChargeConverter) { fChargeConverter = ChargeConverter; };
150  void SetVerbose(Int_t level = 0) { fVerbose = level; };
151 
152  private:
153  Double_t DigiCharge(Int_t digiIndex);
154  Double_t DigiChargeError(Int_t digiIndex);
155  Int_t DigiStripno(Int_t digiIndex);
156  Double_t Erfmod(Double_t x, Double_t p0, Double_t p1, Double_t p2, Double_t p3);
157  TClonesArray *fDigiArray;
158  PndSdsCalcStrip *fCalcStrip;
159  PndSdsChargeConversion *fChargeConverter;
160  Int_t fVerbose;
161 
162  ClassDef(PndSdsChargeWeightingAlgorithms, 1);
163 };
164 #endif
std::pair< Double_t, Double_t > HeadTail(const PndSdsCluster *Cluster)
std::pair< Double_t, Double_t > CenterOfGravity(const PndSdsCluster *Cluster)
std::pair< Double_t, Double_t > Median(const PndSdsCluster *Cluster)
std::pair< Double_t, Double_t > AutoSelect(const PndSdsCluster *Cluster)
std::pair< Double_t, Double_t > Binary(const PndSdsCluster *Cluster)
Class to store the Digis which belong to one cluster This class holds the information which Digi belo...
Definition: PndSdsCluster.h:30
PndSdsChargeWeightingAlgorithms(TClonesArray *arr)
std::pair< Double_t, Double_t > EtaValue(const PndSdsCluster *Cluster, Double_t &stripno, Int_t &NmbOfStrips)
Class for calculating strip indices from wafer hits.
void SetChargeConverter(PndSdsChargeConversion *ChargeConverter)
PndSdsChargeWeightingAlgorithms(PndSdsChargeWeightingAlgorithms &other)
std::pair< Double_t, Double_t > Eta(const PndSdsCluster *Cluster, const TH2F *PosVsEta)
PndSdsChargeWeightingAlgorithms & operator=(PndSdsChargeWeightingAlgorithms &other)