ATTPCROOT  0.3.0-alpha
A ROOT-based framework for analyzing data from active target detectors
AtPSA.h
Go to the documentation of this file.
1 #ifndef AtPSA_H
2 #define AtPSA_H
3 
4 #include "AtHit.h" // IWYU pragma: keep
5 
6 #include <Rtypes.h>
7 
8 #include <cstddef>
9 #include <map>
10 #include <memory>
11 #include <utility>
12 #include <vector>
13 
14 class TClonesArray;
15 class AtRawEvent;
16 class AtEvent;
17 class AtPad;
18 class TBuffer;
19 class TClass;
20 class TMemberInspector;
21 
27 class AtPSA {
28 private:
29  // Access in PSA methods through getThreshold()
30  Int_t fThreshold{-1};
31  Int_t fThresholdlow{-1};
32 
33 protected:
34  TClonesArray *fMCSimPointArray{};
35 
36  Bool_t fUsingLowThreshold{false};
37 
38  // Variables from parameter file
39  Double_t fBField{};
40  Double_t fEField{};
41  Int_t fTB0{};
42 
43  // This was hard coded too many places to leave as a variable...
44  Int_t fNumTbs{512}; //< the number of time buckets used in taking data
45  Int_t fTBTime{}; //< time duration of a time bucket in ns
46  Int_t fEntTB{}; //< Timebucket of the entrance window
47  Double_t fDriftVelocity{}; //< drift velocity of electron in cm/us
48  Double_t fZk{}; //< Relative position of micromegas-cathode
49 
50  using HitVector = std::vector<std::unique_ptr<AtHit>>;
51 
52 public:
53  AtPSA() = default;
54  virtual ~AtPSA() = default;
55 
56  virtual void Init();
57 
58  void SetThreshold(Int_t threshold);
59  void SetThresholdLow(Int_t thresholdlow);
60  int GetThreshold() { return fThreshold; }
61  int GetThresholdLow() { return fThresholdlow; }
62 
63  void SetSimulatedEvent(TClonesArray *MCSimPointArray);
64 
65  AtEvent Analyze(AtRawEvent &rawEvent);
66  virtual void Analyze(AtRawEvent *rawEvent, AtEvent *event);
67  virtual HitVector AnalyzePad(AtPad *pad) = 0;
68 
69  // virtual HitVector AnalyzeTrace(const std::vector<double> &trace) = 0;
70  virtual std::unique_ptr<AtPSA> Clone() = 0;
71 
72 protected:
73  // Protected functions
74  void TrackMCPoints(std::multimap<Int_t, std::size_t> &map,
75  AtHit &hit); //< Assign MC Points kinematics to each hit.
76 
77  [[deprecated]] Double_t CalculateZ(Double_t peakIdx);
78 
79  Double_t CalculateZGeo(Double_t peakIdx);
80  Double_t getThreshold(int padSize = -1);
81 
82  virtual double getZhitVariance(double zLoc, double zLocVar) const;
83  virtual std::pair<double, double> getXYhitVariance() const;
84  ClassDef(AtPSA, 5)
85 };
86 
87 #endif
AtPSA::SetThresholdLow
void SetThresholdLow(Int_t thresholdlow)
Definition: AtPSA.cxx:79
AtPSA::CalculateZ
Double_t CalculateZ(Double_t peakIdx)
Calculate z position in mm using the peak index.
Definition: AtPSA.cxx:85
AtPSA::SetSimulatedEvent
void SetSimulatedEvent(TClonesArray *MCSimPointArray)
Definition: AtPSA.cxx:67
AtPSA::CalculateZGeo
Double_t CalculateZGeo(Double_t peakIdx)
Definition: AtPSA.cxx:90
AtPSA::fUsingLowThreshold
Bool_t fUsingLowThreshold
Definition: AtPSA.h:36
AtPSA::TrackMCPoints
void TrackMCPoints(std::multimap< Int_t, std::size_t > &map, AtHit &hit)
Definition: AtPSA.cxx:95
AtPSA::fEField
Double_t fEField
Definition: AtPSA.h:40
AtPSA::SetThreshold
void SetThreshold(Int_t threshold)
Definition: AtPSA.cxx:72
AtPSA::HitVector
std::vector< std::unique_ptr< AtHit > > HitVector
Definition: AtPSA.h:50
AtPSA::fNumTbs
Int_t fNumTbs
Definition: AtPSA.h:44
AtEvent
Definition: AtEvent.h:22
AtPSA::Clone
virtual std::unique_ptr< AtPSA > Clone()=0
AtRawEvent
Definition: AtRawEvent.h:34
AtPSA::Analyze
AtEvent Analyze(AtRawEvent &rawEvent)
Definition: AtPSA.cxx:116
AtPSA::fBField
Double_t fBField
Definition: AtPSA.h:39
AtPSA::getXYhitVariance
virtual std::pair< double, double > getXYhitVariance() const
Definition: AtPSA.cxx:200
AtPSA::fMCSimPointArray
TClonesArray * fMCSimPointArray
Definition: AtPSA.h:34
AtPSA::fZk
Double_t fZk
Definition: AtPSA.h:48
AtPSA::getThreshold
Double_t getThreshold(int padSize=-1)
Definition: AtPSA.cxx:179
AtHit.h
AtPSA::GetThresholdLow
int GetThresholdLow()
Definition: AtPSA.h:61
AtPSA::fTB0
Int_t fTB0
Definition: AtPSA.h:41
AtPSA::fEntTB
Int_t fEntTB
Definition: AtPSA.h:46
AtPSA::fDriftVelocity
Double_t fDriftVelocity
Definition: AtPSA.h:47
AtPSA::~AtPSA
virtual ~AtPSA()=default
AtPSA::GetThreshold
int GetThreshold()
Definition: AtPSA.h:60
AtPSA::AtPSA
AtPSA()=default
AtPad
Container class for AtPadBase objects.
Definition: AtPad.h:38
AtPSA
Definition: AtPSA.h:27
AtPSA::getZhitVariance
virtual double getZhitVariance(double zLoc, double zLocVar) const
Definition: AtPSA.cxx:195
AtPSA::AnalyzePad
virtual HitVector AnalyzePad(AtPad *pad)=0
AtHit
Point in space with charge.
Definition: AtHit.h:27
AtPSA::Init
virtual void Init()
Definition: AtPSA.cxx:30
AtPSA::fTBTime
Int_t fTBTime
Definition: AtPSA.h:45