FairShip
Loading...
Searching...
No Matches
CaloScoringPlaneHit.cxx
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
6
7#include <iostream>
8
10#include "FairLogger.h"
11#include "TRandom.h"
12
14
16 Double_t t0, Double_t pos_res,
17 Double_t time_res, Int_t pid,
18 TRandom* rng)
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}
36
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}
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).
static const char * SpeciesName(Int_t species)
Int_t fDetectorID
Detector unique identifier.
Definition DetectorHit.h:40