FairShip
Loading...
Searching...
No Matches
CaloScoringPlaneHit Class Reference

Digitised scoring-plane hit with a particle-identification outcome. More...

#include <CaloScoringPlaneHit.h>

Inheritance diagram for CaloScoringPlaneHit:
[legend]
Collaboration diagram for CaloScoringPlaneHit:
[legend]

Public Member Functions

 CaloScoringPlaneHit ()
 CaloScoringPlaneHit (const CaloScoringPlanePoint *p, Double_t t0, Double_t pos_res, Double_t time_res, Int_t pid, TRandom *rng=nullptr)
 ~CaloScoringPlaneHit () override=default
 CaloScoringPlaneHit (const CaloScoringPlaneHit &hit)=default
CaloScoringPlaneHit & operator= (const CaloScoringPlaneHit &hit)=default
Double_t GetX () const
Double_t GetY () const
Double_t GetZ () const
TVector3 GetXYZ () const
Double_t GetTime () const
Double_t GetPx () const
Double_t GetPy () const
Double_t GetPz () const
TVector3 GetMom () const
Double_t GetP () const
Int_t GetPid () const
void SetPid (Int_t pid)
Bool_t IsIdentified () const
Bool_t IsElectron () const
Bool_t IsHadron () const
Bool_t IsMuon () const
void Print () const
void Print (const Option_t *opt="") const override
Public Member Functions inherited from SHiP::DetectorHit
 DetectorHit ()
 DetectorHit (Int_t detID, Float_t digi)
 ~DetectorHit () override=default
Double_t GetDigi () const
Int_t GetDetectorID () const
void SetDigi (Float_t d)
void SetDetectorID (Int_t detID)
void Print (const Option_t *opt="") const override

Private Member Functions

 ClassDefOverride (CaloScoringPlaneHit, 1)

Private Attributes

Double_t fX = 0.
 smeared x (cm)
Double_t fY = 0.
 smeared y (cm)
Double_t fZ = 0.
 z of the MC point (cm)
Double_t fTime = 0.
 smeared time incl. t0 (ns)
Double_t fPx = 0.
 MC-truth momentum (GeV/c).
Double_t fPy = 0.
Double_t fPz = 0.
Int_t fPid = CaloScoringPlanePID::kUnknown
 identified species

Additional Inherited Members

Protected Member Functions inherited from SHiP::DetectorHit
 ClassDefOverride (SHiP::DetectorHit, 1)
Protected Attributes inherited from SHiP::DetectorHit
Float_t fdigi
 digitized detector hit
Int_t fDetectorID
 Detector unique identifier.

Detailed Description

Digitised scoring-plane hit with a particle-identification outcome.

Position and time are smeared from the MC point; the momentum is the MC-truth momentum at the plane. The PID outcome (electron / hadron / muon, or unknown) is drawn with CaloScoringPlanePID from energy-dependent confusion matrices and stored as a CaloScoringPlanePID::Species value. The MC truth link is kept in the separate digiCaloScoringPlane2MC branch.

Definition at line 24 of file CaloScoringPlaneHit.h.

Constructor & Destructor Documentation

◆ CaloScoringPlaneHit() [1/3]

CaloScoringPlaneHit::CaloScoringPlaneHit ( )

Definition at line 13 of file CaloScoringPlaneHit.cxx.

13: SHiP::DetectorHit() {}

◆ CaloScoringPlaneHit() [2/3]

CaloScoringPlaneHit::CaloScoringPlaneHit ( const CaloScoringPlanePoint * p,
Double_t t0,
Double_t pos_res,
Double_t time_res,
Int_t pid,
TRandom * rng = nullptr )
Parameters
pMC point
t0event time offset (ns)
pos_resGaussian x/y resolution (cm), 0 = no smearing
time_resGaussian time resolution (ns), 0 = no smearing
pididentified species (CaloScoringPlanePID::Species)
rnggenerator for the smearing (gRandom if null); nothing is drawn without smearing

Definition at line 15 of file CaloScoringPlaneHit.cxx.

19 : SHiP::DetectorHit() {
20 if (!p) {
21 LOG(error) << "CaloScoringPlaneHit: null CaloScoringPlanePoint pointer";
22 return;
23 }
24 TRandom& random = rng ? *rng : *gRandom;
25 fDetectorID = p->GetDetectorID();
26 fX = pos_res > 0. ? random.Gaus(p->GetX(), pos_res) : p->GetX();
27 fY = pos_res > 0. ? random.Gaus(p->GetY(), pos_res) : p->GetY();
28 fZ = p->GetZ();
29 const Double_t t = p->GetTime() + t0;
30 fTime = time_res > 0. ? random.Gaus(t, time_res) : t;
31 fPx = p->GetPx();
32 fPy = p->GetPy();
33 fPz = p->GetPz();
34 fPid = pid;
35}
Double_t fTime
smeared time incl. t0 (ns)
Double_t fX
smeared x (cm)
Double_t fZ
z of the MC point (cm)
Double_t fY
smeared y (cm)
Int_t fPid
identified species
Double_t fPx
MC-truth momentum (GeV/c).
Int_t fDetectorID
Detector unique identifier.
Definition DetectorHit.h:40

◆ ~CaloScoringPlaneHit()

CaloScoringPlaneHit::~CaloScoringPlaneHit ( )
overridedefault

◆ CaloScoringPlaneHit() [3/3]

CaloScoringPlaneHit::CaloScoringPlaneHit ( const CaloScoringPlaneHit & hit)
default

Member Function Documentation

◆ ClassDefOverride()

CaloScoringPlaneHit::ClassDefOverride ( CaloScoringPlaneHit ,
1  )
private

◆ GetMom()

TVector3 CaloScoringPlaneHit::GetMom ( ) const
inline

Definition at line 54 of file CaloScoringPlaneHit.h.

54{ return TVector3(fPx, fPy, fPz); }

◆ GetP()

Double_t CaloScoringPlaneHit::GetP ( ) const
inline

Definition at line 55 of file CaloScoringPlaneHit.h.

55{ return GetMom().Mag(); }
TVector3 GetMom() const

◆ GetPid()

Int_t CaloScoringPlaneHit::GetPid ( ) const
inline

Identified species, a CaloScoringPlanePID::Species value.

Definition at line 58 of file CaloScoringPlaneHit.h.

58{ return fPid; }

◆ GetPx()

Double_t CaloScoringPlaneHit::GetPx ( ) const
inline

Definition at line 51 of file CaloScoringPlaneHit.h.

51{ return fPx; }

◆ GetPy()

Double_t CaloScoringPlaneHit::GetPy ( ) const
inline

Definition at line 52 of file CaloScoringPlaneHit.h.

52{ return fPy; }

◆ GetPz()

Double_t CaloScoringPlaneHit::GetPz ( ) const
inline

Definition at line 53 of file CaloScoringPlaneHit.h.

53{ return fPz; }

◆ GetTime()

Double_t CaloScoringPlaneHit::GetTime ( ) const
inline

Definition at line 49 of file CaloScoringPlaneHit.h.

49{ return fTime; }

◆ GetX()

Double_t CaloScoringPlaneHit::GetX ( ) const
inline

Definition at line 45 of file CaloScoringPlaneHit.h.

45{ return fX; }

◆ GetXYZ()

TVector3 CaloScoringPlaneHit::GetXYZ ( ) const
inline

Definition at line 48 of file CaloScoringPlaneHit.h.

48{ return TVector3(fX, fY, fZ); }

◆ GetY()

Double_t CaloScoringPlaneHit::GetY ( ) const
inline

Definition at line 46 of file CaloScoringPlaneHit.h.

46{ return fY; }

◆ GetZ()

Double_t CaloScoringPlaneHit::GetZ ( ) const
inline

Definition at line 47 of file CaloScoringPlaneHit.h.

47{ return fZ; }

◆ IsElectron()

Bool_t CaloScoringPlaneHit::IsElectron ( ) const
inline

◆ IsHadron()

Bool_t CaloScoringPlaneHit::IsHadron ( ) const
inline

◆ IsIdentified()

Bool_t CaloScoringPlaneHit::IsIdentified ( ) const
inline

◆ IsMuon()

Bool_t CaloScoringPlaneHit::IsMuon ( ) const
inline

Definition at line 63 of file CaloScoringPlaneHit.h.

◆ operator=()

CaloScoringPlaneHit & CaloScoringPlaneHit::operator= ( const CaloScoringPlaneHit & hit)
default

◆ Print() [1/2]

void CaloScoringPlaneHit::Print ( ) const

Definition at line 37 of file CaloScoringPlaneHit.cxx.

37 {
38 std::cout << "-I- CaloScoringPlaneHit: detector " << fDetectorID << std::endl;
39 std::cout << " Position: (" << fX << ", " << fY << ", " << fZ << ") cm"
40 << " time " << fTime << " ns" << std::endl;
41 std::cout << " Momentum: (" << fPx << ", " << fPy << ", " << fPz
42 << ") GeV/c PID " << CaloScoringPlanePID::SpeciesName(fPid)
43 << std::endl;
44}
static const char * SpeciesName(Int_t species)

◆ Print() [2/2]

void SHiP::DetectorHit::Print ( const Option_t * opt = "") const
inlineoverride

Definition at line 36 of file DetectorHit.h.

36{}

◆ SetPid()

void CaloScoringPlaneHit::SetPid ( Int_t pid)
inline

Definition at line 59 of file CaloScoringPlaneHit.h.

59{ fPid = pid; }

Member Data Documentation

◆ fPid

Int_t CaloScoringPlaneHit::fPid = CaloScoringPlanePID::kUnknown
private

identified species

Definition at line 76 of file CaloScoringPlaneHit.h.

◆ fPx

Double_t CaloScoringPlaneHit::fPx = 0.
private

MC-truth momentum (GeV/c).

Definition at line 73 of file CaloScoringPlaneHit.h.

◆ fPy

Double_t CaloScoringPlaneHit::fPy = 0.
private

Definition at line 74 of file CaloScoringPlaneHit.h.

◆ fPz

Double_t CaloScoringPlaneHit::fPz = 0.
private

Definition at line 75 of file CaloScoringPlaneHit.h.

◆ fTime

Double_t CaloScoringPlaneHit::fTime = 0.
private

smeared time incl. t0 (ns)

Definition at line 72 of file CaloScoringPlaneHit.h.

◆ fX

Double_t CaloScoringPlaneHit::fX = 0.
private

smeared x (cm)

Definition at line 69 of file CaloScoringPlaneHit.h.

◆ fY

Double_t CaloScoringPlaneHit::fY = 0.
private

smeared y (cm)

Definition at line 70 of file CaloScoringPlaneHit.h.

◆ fZ

Double_t CaloScoringPlaneHit::fZ = 0.
private

z of the MC point (cm)

Definition at line 71 of file CaloScoringPlaneHit.h.


The documentation for this class was generated from the following files: