Main Page
Class Categories
Classes
Namespaces
File List
File Members
exper-sw
cosmosw
AugerSW
Offline
source
main
Modules
MdSimulation
Deprecated
G4XTankGroundSimulationAG
G4XTankPMT.cc
Go to the documentation of this file.
1
#include <utl/ParticleCases.h>
2
3
#include "
G4XTankPMT.h
"
4
5
using namespace
G4XTankSimulatorAG;
6
7
8
void
9
G4XTankPMT::SetParticle
(
const
utl::Particle
&
particle
)
10
{
11
fParticle
= &
particle
;
12
SetComponent
();
13
fExtraComponent
= 0;
14
if
(particle.
GetSource
() !=
utl::Particle::eShowerFromMuonDecay
)
15
return
;
16
switch
(
fComponent
) {
17
case
sevt::StationConstants::eElectron
:
18
fExtraComponent
=
sevt::StationConstants::eShowerMuonDecayElectron
;
19
break
;
20
case
sevt::StationConstants::ePhoton
:
21
fExtraComponent
=
sevt::StationConstants::eShowerMuonDecayPhoton
;
22
break
;
23
default
:
24
break
;
25
}
26
}
27
28
29
void
30
G4XTankPMT::SetComponent
()
31
{
32
switch
(
fParticle
->
GetType
()) {
33
case
OFFLINE_ELECTRONS
:
34
fComponent
=
sevt::StationConstants::eElectron
;
35
break
;
36
case
OFFLINE_PHOTON
:
37
fComponent
=
sevt::StationConstants::ePhoton
;
38
break
;
39
case
OFFLINE_MUONS
:
40
fComponent
=
sevt::StationConstants::eMuon
;
41
break
;
42
case
OFFLINE_HADRONS
:
43
fComponent
=
sevt::StationConstants::eHadron
;
44
break
;
45
default
:
46
cerr <<
"Illegal Component in G4XTankPMT"
<< endl;
47
exit
(-1);
48
}
49
}
50
51
52
void
53
G4XTankPMT::SetCurrentTank
(
const
sevt::SEvent::StationIterator
stationIt)
54
{
55
fCurrentEventStationIt
= stationIt;
56
for
(
int
i = 1; i <= 3; ++i)
57
fPMTSimData
[i] = &
fCurrentEventStationIt
->GetPMT(i).GetSimData();
58
}
59
60
61
void
62
G4XTankPMT::AddPhoton
(
const
int
nPMT,
const
double
peTime)
63
{
64
if
((peTime > 1e6) || (peTime < -1e6)) {
65
cerr <<
"Dubious PE release time "
<< peTime << endl;
66
exit
(-1);
67
}
68
if
(!
fPMTSimData
[nPMT]->HasPETimeDistribution())
69
fPMTSimData
[nPMT]->
MakePETimeDistribution
();
70
fPMTSimData
[nPMT]->
GetPETimeDistribution
().
AddTime
(peTime);
71
if
(!
fPMTSimData
[nPMT]->HasPETimeDistribution(
fComponent
))
72
fPMTSimData
[nPMT]->
MakePETimeDistribution
(
fComponent
);
73
fPMTSimData
[nPMT]->
GetPETimeDistribution
(
fComponent
).
AddTime
(peTime);
74
75
if
(
fExtraComponent
) {
76
const
sevt::StationConstants::SignalComponent
comp =
77
static_cast<
sevt::StationConstants::SignalComponent
>
(
fExtraComponent
);
78
if
(!
fPMTSimData
[nPMT]->HasPETimeDistribution(comp))
79
fPMTSimData
[nPMT]->MakePETimeDistribution(comp);
80
fPMTSimData
[nPMT]->
GetPETimeDistribution
(comp).
AddTime
(peTime);
81
}
82
}
G4XTankSimulatorAG::G4XTankPMT::SetCurrentTank
void SetCurrentTank(const sevt::SEvent::StationIterator sIt)
Definition:
G4XTankPMT.cc:53
utl::Particle::eShowerFromMuonDecay
Definition:
Particle.h:34
utl::Particle
Describes a particle for Simulation.
Definition:
Particle.h:26
G4XTankSimulatorAG::G4XTankPMT::fCurrentEventStationIt
sevt::SEvent::StationIterator fCurrentEventStationIt
Definition:
G4XTankPMT.h:37
G4XTankSimulatorAG::G4XTankPMT::fPMTSimData
sevt::PMTSimData * fPMTSimData[4]
Definition:
G4XTankPMT.h:38
G4XTankSimulatorAG::G4XTankPMT::fExtraComponent
int fExtraComponent
Definition:
G4XTankPMT.h:40
G4XTankSimulatorAG::G4XTankPMT::SetComponent
void SetComponent()
Definition:
G4XTankPMT.cc:30
exit
int exit
Definition:
dump1090.h:237
G4XTankSimulatorAG::G4XTankPMT::SetParticle
void SetParticle(const utl::Particle &particle)
Definition:
G4XTankPMT.cc:9
OFFLINE_PHOTON
#define OFFLINE_PHOTON
Definition:
Modules/SdSimulation/Deprecated/UpgradeASCIITests/G4TankSimulatorASCII/ParticleCases.h:39
sevt::StationConstants::eElectron
electrons and positrons from shower
Definition:
SEvent/StationConstants.h:15
G4XTankSimulatorAG::G4XTankPMT::AddPhoton
void AddPhoton(const int nPMT, const double peTime)
Definition:
G4XTankPMT.cc:62
G4XTankSimulatorAG::G4XTankPMT::fComponent
sevt::StationConstants::SignalComponent fComponent
Definition:
G4XTankPMT.h:39
sevt::StationConstants::eShowerMuonDecayPhoton
photons from muon decay in shower
Definition:
SEvent/StationConstants.h:55
sevt::StationConstants::ePhoton
gammas from shower
Definition:
SEvent/StationConstants.h:17
sevt::StationConstants::eHadron
all hadrons from shower
Definition:
SEvent/StationConstants.h:21
OFFLINE_MUONS
#define OFFLINE_MUONS
Definition:
Modules/SdSimulation/Deprecated/UpgradeASCIITests/G4TankSimulatorASCII/ParticleCases.h:46
utl::Particle::GetSource
Source GetSource() const
Source of the particle (eg. shower or background)
Definition:
Particle.h:107
sevt::StationConstants::SignalComponent
SignalComponent
Definition:
SEvent/StationConstants.h:11
particle
struct particle_info particle[80]
G4XTankSimulatorAG::G4XTankPMT::fParticle
const utl::Particle * fParticle
Definition:
G4XTankPMT.h:36
utl::Particle::GetType
int GetType() const
Definition:
Particle.h:101
OFFLINE_ELECTRONS
#define OFFLINE_ELECTRONS
Definition:
Modules/SdSimulation/Deprecated/UpgradeASCIITests/G4TankSimulatorASCII/ParticleCases.h:42
sevt::SEvent::StationIterator
boost::indirect_iterator< InternalStationIterator, Station & > StationIterator
Iterator over all stations.
Definition:
SEvent.h:52
sevt::PMTSimData::GetPETimeDistribution
utl::TimeDistributionI & GetPETimeDistribution(const StationConstants::SignalComponent source=StationConstants::eTotal)
Simulated photoelectron time distribution.
Definition:
PMTSimData.h:54
utl::TimeDistribution::AddTime
void AddTime(const double time, const T weight=T(1))
Add an entry (optionally weighted) for the given time. Slot will be computed.
Definition:
TimeDistribution.h:112
sevt::StationConstants::eMuon
mu+ and mu- (including signal from mu decay electrons) from shower
Definition:
SEvent/StationConstants.h:19
G4XTankPMT.h
OFFLINE_HADRONS
#define OFFLINE_HADRONS
Definition:
Modules/SdSimulation/Deprecated/UpgradeASCIITests/G4TankSimulatorASCII/ParticleCases.h:69
sevt::StationConstants::eShowerMuonDecayElectron
electrons from muon decay in shower
Definition:
SEvent/StationConstants.h:57
sevt::PMTSimData::MakePETimeDistribution
void MakePETimeDistribution(const StationConstants::SignalComponent source=StationConstants::eTotal)
Create a PE release time distribution (optionally for given source)
Definition:
PMTSimData.cc:12
, generated on Tue Sep 26 2023.