PMTHit.cpp
Go to the documentation of this file.
1 //==========================================================================
2 // AIDA Detector description implementation
3 //--------------------------------------------------------------------------
4 // Copyright (C) Organisation europeenne pour la Recherche nucleaire (CERN)
5 // All rights reserved.
6 //
7 // For the licensing terms see $DD4hepINSTALL/LICENSE.
8 // For the list of contributors see $DD4hepINSTALL/doc/CREDITS.
9 //
10 // Author : Whitney Armstrong
11 //
12 //==========================================================================
13 
14 #include "PMTHit.h"
15 #include "G4Track.hh"
16 
17 using namespace npdet;
18 
21  if ( &c != this ) {
22  position = c.position;
23  momentum = c.momentum;
24  length = c.length;
25  truth = c.truth;
26  energy = c.energy;
27  }
28  return *this;
29 }
30 
33  position.SetXYZ(0, 0, 0);
34  momentum.SetXYZ(0, 0, 0);
35  energy = 0.0;
36  length = 0.0;
37  truth.clear();
38  return *this;
39 }
40 
42 PMTHit& PMTHit::storePoint(const G4Step* step, const G4StepPoint* pnt) {
43  G4Track* trk = step->GetTrack();
44  G4ThreeVector pos = pnt->GetPosition();
45  G4ThreeVector mom = pnt->GetMomentum();
46 
47  truth.trackID = trk->GetTrackID();
48  truth.pdgID = trk->GetDefinition()->GetPDGEncoding();
49  truth.deposit = step->GetTotalEnergyDeposit();
50  truth.time = trk->GetGlobalTime();
51  position.SetXYZ(pos.x(), pos.y(), pos.z());
52  momentum.SetXYZ(mom.x(), mom.y(), mom.z());
53  length = 0;
54  energy = pnt->GetTotalEnergy();
55  return *this;
56 }
dd4hep::Direction momentum
Hit direction.
Definition: PMTHit.h:52
dd4hep::sim::Geant4HitData::MonteCarloContrib truth
Monte Carlo / Geant4 information.
Definition: PMTHit.h:56
Framework include files.
PMTHit & clear()
Clear hit content.
Definition: PMTHit.cpp:32
double energy
Energy of photon.
Definition: PMTHit.h:58
double length
Length of the track segment contributing to this hit.
Definition: PMTHit.h:54
PhotoMultiplier Hit definition.
Definition: PMTHit.h:38
PMTHit & operator=(const PMTHit &c)
Assignment operator.
Definition: PMTHit.cpp:20
PMTHit & storePoint(const G4Step *step, const G4StepPoint *pnt)
Store Geant4 point and step information into tracker hit structure.
Definition: PMTHit.cpp:42
dd4hep::Position position
Hit position.
Definition: PMTHit.h:50