FairShip
Loading...
Searching...
No Matches
UpstreamTaggerHit.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
5#include "UpstreamTaggerHit.h"
6
7#include <iostream>
8
9#include "FairLogger.h"
10#include "TRandom.h"
11#include "UpstreamTaggerPoint.h"
12
13using std::cout;
14using std::endl;
15
16// ----- Default constructor --------------
18 : SHiP::DetectorHit(),
19 fX(0.),
20 fY(0.),
21 fZ(0.),
22 fTime(0.),
23 fTileID(-1),
24 fTriggered(kFALSE) {}
25
26// ----- Constructor from UpstreamTaggerPoint --------------
28 const TVector3& digitizedPosition,
29 Double_t time_res)
30 : SHiP::DetectorHit(),
31 fX(0.),
32 fY(0.),
33 fZ(0.),
34 fTime(0.),
35 fTileID(-1),
36 fTriggered(kFALSE) {
37 if (!p) {
38 LOG(error) << "UpstreamTaggerHit: null UpstreamTaggerPoint pointer";
39 return;
40 }
41 fDetectorID = p->GetDetectorID();
42 fX = digitizedPosition.X();
43 fY = digitizedPosition.Y();
44 fZ = digitizedPosition.Z();
45 fTime = gRandom->Gaus(p->GetTime() + t0, time_res);
46}
47
48// ----- Print ------------------------------
50 cout << "-I- UpstreamTaggerHit: detector " << fDetectorID << endl;
51 cout << " Constituent tile ID: " << fTileID << endl;
52 cout << " Position: (" << fX << ", " << fY << ", " << fZ << ") cm" << endl;
53 cout << " Time: " << fTime << " ns" << endl;
54 cout << " ADC: " << GetADC()
55 << ", triggered: " << (fTriggered ? "yes" : "no") << endl;
56}
Int_t fDetectorID
Detector unique identifier.
Definition DetectorHit.h:40
Double_t fTime
Smeared time (ns).
Double_t fY
Digitized y position (cm).
Int_t fTileID
Unique position- and tile-size-aware constituent ID.
Double_t fZ
Digitized z position (cm).
Double_t fX
Digitized x position (cm).
Bool_t fTriggered
True when ADC is at or above the trigger threshold.