FairShip
Loading...
Searching...
No Matches
SiliconTargetHit.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_SILICONTARGET_SILICONTARGETHIT_H_
6#define SND_SILICONTARGET_SILICONTARGETHIT_H_
7
8#include <vector>
9
10#include "DetectorHit.h"
11#include "SiliconTargetPoint.h"
12
14 public:
17 // SiliconTargetHit(Int_t detID);
18
19 // Constructor from SiliconTargetPoint
20 SiliconTargetHit(Int_t detID, const std::vector<SiliconTargetPoint*>&);
21
23 ~SiliconTargetHit() override = default;
24
26 SiliconTargetHit(const SiliconTargetHit& hit) = default;
28
31 void Print() const;
32 Float_t GetSignal() const { return fSignal; };
33 Double_t GetX() const { return fX; }
34 Double_t GetY() const { return fY; }
35 Double_t GetZ() const { return fZ; }
36
37 constexpr int GetLayer() const {
38 return static_cast<unsigned>(fDetectorID) >> 17;
39 }
40 constexpr int GetPlane() const {
41 return (static_cast<unsigned>(fDetectorID) >> 16) % 2;
42 } // 0 is X-plane, 1 is Y-pane
43 constexpr int GetColumn() const {
44 return (static_cast<unsigned>(fDetectorID) >> 14) % 4;
45 }
46 constexpr int GetRow() const {
47 return (static_cast<unsigned>(fDetectorID) >> 13) % 2;
48 }
49 constexpr int GetStrip() const {
50 return static_cast<unsigned>(fDetectorID) % 4096;
51 }
52 constexpr int GetModule() const { return GetRow() + 1 + 2 * GetColumn(); }
53
54 bool isValid() const { return flag; }
55
56 private:
57 Float_t fSignal{0.f};
58 Double_t fX{0.};
59 Double_t fY{0.};
60 Double_t fZ{0.};
61 Bool_t flag{true};
62
64};
65
66#endif // SND_SILICONTARGET_SILICONTARGETHIT_H_
void Print(const Option_t *opt="") const override
Definition: DetectorHit.h:36
Int_t fDetectorID
Detector unique identifier.
Definition: DetectorHit.h:40
Double_t GetY() const
constexpr int GetRow() const
~SiliconTargetHit() override=default
SiliconTargetHit(const SiliconTargetHit &hit)=default
Double_t GetZ() const
SiliconTargetHit & operator=(const SiliconTargetHit &hit)=default
ClassDef(SiliconTargetHit, 2)
constexpr int GetModule() const
constexpr int GetLayer() const
Double_t GetX() const
Float_t GetSignal() const
constexpr int GetColumn() const
constexpr int GetStrip() const
constexpr int GetPlane() const
bool isValid() const