FairShip
Loading...
Searching...
No Matches
splitcalHit.h
Go to the documentation of this file.
1// SPDX-License-Identifier: LGPL-3.0-or-later
2// SPDX-FileCopyrightText: Copyright CERN for the benefit of the SHiP
3// Collaboration
4
5#ifndef SPLITCAL_SPLITCALHIT_H_
6#define SPLITCAL_SPLITCALHIT_H_
7
8#include <vector>
9
10#include "DetectorHit.h"
11
12class splitcalPoint;
13
15 public:
18
24 splitcalHit(Int_t detID, Float_t tdc);
25 splitcalHit(const std::vector<splitcalPoint>& points, Double_t t0);
27 ~splitcalHit() override = default;
28
31 void Print() const;
32 Float_t GetTDC() const { return fdigi; }
33 void setInvalid() { flag = false; }
34 bool isValid() const { return flag; }
35
36 std::string GetPaddedString(int id);
37 std::string GetDetectorElementName(int id);
38 void Decoder(int id, int& isPrecision, int& nLayer, int& nModuleX,
39 int& nMdouleY, int& nStrip);
40 void Decoder(const std::string& encodedID, int& isPrecision, int& nLayer,
41 int& nModuleX, int& nMdouleY, int& nStrip);
42
43 void SetXYZ(double x, double y, double z) {
44 _x = x;
45 _y = y;
46 _z = z;
47 }
48 void SetIDs(int isPrecision, int nLayer, int nModuleX, int nModuleY,
49 int nStrip) {
50 _isPrecisionLayer = isPrecision;
51 _nLayer = nLayer;
52 _nModuleX = nModuleX;
53 _nModuleY = nModuleY;
54 _nStrip = nStrip;
55 }
56 void SetEnergy(double e) { _energy = e; }
57 void UpdateEnergy(double e) { _energy = _energy + e; }
58 void SetIsX(bool x) { _isX = x; }
59 void SetIsY(bool y) { _isY = y; }
60 void SetIsUsed(int u) { _isUsed = u; }
61 void SetXYZErrors(double xError, double yError, double zError) {
62 _xError = xError;
63 _yError = yError;
64 _zError = zError;
65 }
66
67 double GetX() const { return _x; }
68 double GetY() const { return _y; }
69 double GetZ() const { return _z; }
70 double GetEnergy() const { return _energy; }
71 int GetIsPrecisionLayer() const { return _isPrecisionLayer; }
72 int GetLayerNumber() const { return _nLayer; }
73 int GetModuleXNumber() const { return _nModuleX; }
74 int GetModuleYNumber() const { return _nModuleY; }
75 int GetStripNumber() const { return _nStrip; }
76 bool IsX() const { return _isX; }
77 bool IsY() const { return _isY; }
78 int IsUsed() const { return _isUsed; }
79 double GetXError() const { return _xError; }
80 double GetYError() const { return _yError; }
81 double GetZError() const { return _zError; }
82
84 splitcalHit(const splitcalHit& point) = default;
85 splitcalHit& operator=(const splitcalHit& point) = default;
86
87 private:
88 Bool_t flag{true};
90 double _energy;
92 bool _isX, _isY;
93
95};
96
97#endif // SPLITCAL_SPLITCALHIT_H_
void Print(const Option_t *opt="") const override
Definition: DetectorHit.h:36
Float_t fdigi
digitized detector hit
Definition: DetectorHit.h:39
void SetEnergy(double e)
Definition: splitcalHit.h:56
int GetModuleXNumber() const
Definition: splitcalHit.h:73
double _xError
Definition: splitcalHit.h:89
int GetStripNumber() const
Definition: splitcalHit.h:75
double _x
Definition: splitcalHit.h:89
bool IsY() const
Definition: splitcalHit.h:77
double _z
Definition: splitcalHit.h:89
~splitcalHit() override=default
void UpdateEnergy(double e)
Definition: splitcalHit.h:57
int _isPrecisionLayer
Definition: splitcalHit.h:91
std::string GetPaddedString(int id)
Definition: splitcalHit.cxx:99
void Print() const
int GetIsPrecisionLayer() const
Definition: splitcalHit.h:71
double _y
Definition: splitcalHit.h:89
double GetX() const
Definition: splitcalHit.h:67
bool IsX() const
Definition: splitcalHit.h:76
void setInvalid()
Definition: splitcalHit.h:33
bool isValid() const
Definition: splitcalHit.h:34
double GetEnergy() const
Definition: splitcalHit.h:70
double GetXError() const
Definition: splitcalHit.h:79
Bool_t flag
Definition: splitcalHit.h:88
double GetYError() const
Definition: splitcalHit.h:80
void SetIsX(bool x)
Definition: splitcalHit.h:58
double GetZError() const
Definition: splitcalHit.h:81
double GetZ() const
Definition: splitcalHit.h:69
void SetIsUsed(int u)
Definition: splitcalHit.h:60
splitcalHit(const splitcalHit &point)=default
void SetXYZ(double x, double y, double z)
Definition: splitcalHit.h:43
void Decoder(int id, int &isPrecision, int &nLayer, int &nModuleX, int &nMdouleY, int &nStrip)
double _zError
Definition: splitcalHit.h:89
Float_t GetTDC() const
Definition: splitcalHit.h:32
int IsUsed() const
Definition: splitcalHit.h:78
double _energy
Definition: splitcalHit.h:90
splitcalHit & operator=(const splitcalHit &point)=default
void SetIsY(bool y)
Definition: splitcalHit.h:59
std::string GetDetectorElementName(int id)
ClassDef(splitcalHit, 6)
void SetXYZErrors(double xError, double yError, double zError)
Definition: splitcalHit.h:61
void SetIDs(int isPrecision, int nLayer, int nModuleX, int nModuleY, int nStrip)
Definition: splitcalHit.h:48
double GetY() const
Definition: splitcalHit.h:68
double _yError
Definition: splitcalHit.h:89
int GetLayerNumber() const
Definition: splitcalHit.h:72
int GetModuleYNumber() const
Definition: splitcalHit.h:74