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
13
using
std::cout;
14
using
std::endl;
15
16
// ----- Default constructor --------------
17
UpstreamTaggerHit::UpstreamTaggerHit
()
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 --------------
27
UpstreamTaggerHit::UpstreamTaggerHit
(
UpstreamTaggerPoint
* p, Double_t t0,
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 ------------------------------
49
void
UpstreamTaggerHit::Print
()
const
{
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
}
UpstreamTaggerHit.h
UpstreamTaggerPoint.h
SHiP::DetectorHit::fDetectorID
Int_t fDetectorID
Detector unique identifier.
Definition
DetectorHit.h:40
SHiP::DetectorHit::DetectorHit
DetectorHit()
Definition
DetectorHit.cxx:10
UpstreamTaggerHit::fTime
Double_t fTime
Smeared time (ns).
Definition
UpstreamTaggerHit.h:64
UpstreamTaggerHit::fY
Double_t fY
Digitized y position (cm).
Definition
UpstreamTaggerHit.h:62
UpstreamTaggerHit::UpstreamTaggerHit
UpstreamTaggerHit()
Definition
UpstreamTaggerHit.cxx:17
UpstreamTaggerHit::GetADC
Int_t GetADC() const
Definition
UpstreamTaggerHit.h:49
UpstreamTaggerHit::fTileID
Int_t fTileID
Unique position- and tile-size-aware constituent ID.
Definition
UpstreamTaggerHit.h:65
UpstreamTaggerHit::fZ
Double_t fZ
Digitized z position (cm).
Definition
UpstreamTaggerHit.h:63
UpstreamTaggerHit::fX
Double_t fX
Digitized x position (cm).
Definition
UpstreamTaggerHit.h:61
UpstreamTaggerHit::Print
void Print() const
Definition
UpstreamTaggerHit.cxx:49
UpstreamTaggerHit::fTriggered
Bool_t fTriggered
True when ADC is at or above the trigger threshold.
Definition
UpstreamTaggerHit.h:66
UpstreamTaggerPoint
Definition
UpstreamTaggerPoint.h:16
SHiP
Definition
ActsFrame.hpp:19
UpstreamTagger
UpstreamTaggerHit.cxx
Generated by
Doxygen
1.15.0