FairShip
Loading...
Searching...
No Matches
MTCDetHit.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 SND_MTC_MTCDETHIT_H_
6#define SND_MTC_MTCDETHIT_H_
7
8#include <vector>
9
10#include "DetectorHit.h"
11
12class MTCDetPoint;
13
15 public:
17 MTCDetHit();
19 MTCDetHit(const MTCDetHit& hit) = default;
20 MTCDetHit& operator=(const MTCDetHit& hit) = default;
21 // Constructor from MTCDetPoint
22 MTCDetHit(int detID, const std::vector<MTCDetPoint*>&,
23 const std::vector<Float_t>&);
24
26 ~MTCDetHit() override = default;
27
30 void Print() const;
31 Float_t GetSignal() const { return signals; };
32 Float_t GetTime() const { return time; };
33 /*
34 Example of fiberID: 123051820, where:
35 - 1: MTC unique ID
36 - 23: layer number
37 - 0: station type (0 for +5 degrees, 1 for -5 degrees, 2 for scint plane)
38 - 5: z-layer number (0-5)
39 - 1820: local fibre ID within the station
40 Example of SiPM global channel (what is seen in the output file): 123004123,
41 where:
42 - 1: MTC unique ID
43 - 23: layer number
44 - 0: station type (0 for +5 degrees, 1 for -5 degrees)
45 - 0: mat number (only 0 by June 2025)
46 - 4: SiPM number (0-N, where N is the number of SiPMs in the station)
47 - 123: number of the SiPM channel (0-127, 128 channels per SiPM)
48*/
49 Int_t GetChannelID() const { return fDetectorID; }
50 Int_t GetLayer() const {
51 return static_cast<int>(fDetectorID / 1000000) % 100;
52 }
53 Int_t GetStationType() const {
54 return static_cast<int>(fDetectorID / 100000) % 10;
55 }
56 Int_t GetSiPM() const { return (static_cast<int>(fDetectorID / 1000) % 10); }
57 Int_t GetSiPMChan() const { return (fDetectorID % 1000); }
58 TVector3 GetChannelCoordinates() const { return TVector3(Xch, Ych, Zch); }
59 Float_t GetEnergy() const;
60 void setInvalid() { flag = false; }
61 bool isValid() const { return flag; }
62 /*
63 SND@LHC comment: from Guido (22.9.2021): A threshold of 3.5pe should
64 be used, which corresponds to 0.031MeV. 1 SiPM channel has 104 pixels,
65 pixel can only see 0 or >0 photons.
66 */
67 private:
68 Float_t signals = 0;
69 Float_t time;
70 Float_t Xch = 0.0, Ych = 0.0, Zch = 0.0;
71 Bool_t flag{true};
72
74};
75
76#endif // SND_MTC_MTCDETHIT_H_
~MTCDetHit() override=default
TVector3 GetChannelCoordinates() const
Definition: MTCDetHit.h:58
ClassDef(MTCDetHit, 6)
Int_t GetSiPMChan() const
Definition: MTCDetHit.h:57
bool isValid() const
Definition: MTCDetHit.h:61
Float_t time
Definition: MTCDetHit.h:69
Int_t GetStationType() const
Definition: MTCDetHit.h:53
Bool_t flag
flag
Definition: MTCDetHit.h:71
Float_t signals
Definition: MTCDetHit.h:68
Float_t Ych
Definition: MTCDetHit.h:70
Float_t GetTime() const
Definition: MTCDetHit.h:32
Float_t Zch
Definition: MTCDetHit.h:70
Float_t GetEnergy() const
Definition: MTCDetHit.cxx:139
void setInvalid()
Definition: MTCDetHit.h:60
Float_t GetSignal() const
Definition: MTCDetHit.h:31
Float_t Xch
Definition: MTCDetHit.h:70
void Print() const
Definition: MTCDetHit.cxx:145
Int_t GetChannelID() const
Definition: MTCDetHit.h:49
Int_t GetSiPM() const
Definition: MTCDetHit.h:56
Int_t GetLayer() const
Definition: MTCDetHit.h:50
MTCDetHit(const MTCDetHit &hit)=default
MTCDetHit & operator=(const MTCDetHit &hit)=default
void Print(const Option_t *opt="") const override
Definition: DetectorHit.h:36
Int_t fDetectorID
Detector unique identifier.
Definition: DetectorHit.h:40