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
10 {
12  SetComponent();
13  fExtraComponent = 0;
15  return;
16  switch (fComponent) {
19  break;
22  break;
23  default:
24  break;
25  }
26 }
27 
28 
29 void
31 {
32  switch (fParticle->GetType()) {
33  case OFFLINE_ELECTRONS:
35  break;
36  case OFFLINE_PHOTON:
38  break;
39  case OFFLINE_MUONS:
41  break;
42  case OFFLINE_HADRONS:
44  break;
45  default:
46  cerr << "Illegal Component in G4XTankPMT" << endl;
47  exit(-1);
48  }
49 }
50 
51 
52 void
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())
70  fPMTSimData[nPMT]->GetPETimeDistribution().AddTime(peTime);
71  if (!fPMTSimData[nPMT]->HasPETimeDistribution(fComponent))
74 
75  if (fExtraComponent) {
78  if (!fPMTSimData[nPMT]->HasPETimeDistribution(comp))
79  fPMTSimData[nPMT]->MakePETimeDistribution(comp);
80  fPMTSimData[nPMT]->GetPETimeDistribution(comp).AddTime(peTime);
81  }
82 }
void SetCurrentTank(const sevt::SEvent::StationIterator sIt)
Definition: G4XTankPMT.cc:53
Describes a particle for Simulation.
Definition: Particle.h:26
sevt::SEvent::StationIterator fCurrentEventStationIt
Definition: G4XTankPMT.h:37
sevt::PMTSimData * fPMTSimData[4]
Definition: G4XTankPMT.h:38
int exit
Definition: dump1090.h:237
void SetParticle(const utl::Particle &particle)
Definition: G4XTankPMT.cc:9
electrons and positrons from shower
void AddPhoton(const int nPMT, const double peTime)
Definition: G4XTankPMT.cc:62
sevt::StationConstants::SignalComponent fComponent
Definition: G4XTankPMT.h:39
Source GetSource() const
Source of the particle (eg. shower or background)
Definition: Particle.h:107
struct particle_info particle[80]
const utl::Particle * fParticle
Definition: G4XTankPMT.h:36
int GetType() const
Definition: Particle.h:101
boost::indirect_iterator< InternalStationIterator, Station & > StationIterator
Iterator over all stations.
Definition: SEvent.h:52
utl::TimeDistributionI & GetPETimeDistribution(const StationConstants::SignalComponent source=StationConstants::eTotal)
Simulated photoelectron time distribution.
Definition: PMTSimData.h:54
void AddTime(const double time, const T weight=T(1))
Add an entry (optionally weighted) for the given time. Slot will be computed.
mu+ and mu- (including signal from mu decay electrons) from shower
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.