ATLAS Offline Software
G4TrackCounter.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include "G4TrackCounter.h"
6 #include "MCTruth/TrackHelper.h"
7 #include "G4Track.hh"
8 
9 namespace G4UA
10 {
11 
12  //---------------------------------------------------------------------------
13  // Merge results
14  //---------------------------------------------------------------------------
16  {
17  nEvents += rep.nEvents;
18  nTotalTracks += rep.nTotalTracks;
19  nPrimaryTracks += rep.nPrimaryTracks;
20  nSecondaryTracks += rep.nSecondaryTracks;
21  n50MeVTracks += rep.n50MeVTracks;
22  }
23 
24  //---------------------------------------------------------------------------
25  // Increment event counter
26  //---------------------------------------------------------------------------
27  void G4TrackCounter::BeginOfEventAction(const G4Event* /*event*/)
28  {
29  m_report.nEvents++;
30  }
31 
32  //---------------------------------------------------------------------------
33  // Increment track counters
34  //---------------------------------------------------------------------------
36  {
39 
40  // Primary tracks
41  if(helper.IsPrimary() || helper.IsRegeneratedPrimary())
43 
44  // Secondary tracks
45  if(helper.IsRegisteredSecondary())
47 
48  // 50 MeV tracks
49  const double minE = 50.;
50  if(track->GetKineticEnergy() > minE)
52  }
53 
54 } // namespace G4UA
G4UA
for nSW
Definition: CalibrationDefaultProcessing.h:19
make_hlt_rep.rep
rep
Definition: make_hlt_rep.py:32
TrackHelper.h
G4UA::G4TrackCounter::Report::nSecondaryTracks
unsigned int nSecondaryTracks
Number of secondary tracks.
Definition: G4TrackCounter.h:38
G4UA::G4TrackCounter::Report::merge
void merge(const Report &rep)
Definition: G4TrackCounter.cxx:15
G4UA::G4TrackCounter::Report::nTotalTracks
unsigned int nTotalTracks
Total number of tracks.
Definition: G4TrackCounter.h:34
runBeamSpotCalibration.helper
helper
Definition: runBeamSpotCalibration.py:112
G4UA::G4TrackCounter::Report::n50MeVTracks
unsigned int n50MeVTracks
Number of tracks with kinetic E > 50 MeV.
Definition: G4TrackCounter.h:40
TrackHelper
Definition: TrackHelper.h:14
G4UA::G4TrackCounter::PreUserTrackingAction
virtual void PreUserTrackingAction(const G4Track *track) override final
Increments the track counters.
Definition: G4TrackCounter.cxx:35
G4UA::G4TrackCounter::Report::nEvents
unsigned int nEvents
Event counter. Might want a larger int for this.
Definition: G4TrackCounter.h:32
G4UA::G4TrackCounter::BeginOfEventAction
virtual void BeginOfEventAction(const G4Event *event) override final
Increments event counter.
Definition: G4TrackCounter.cxx:27
G4TrackCounter.h
G4UA::G4TrackCounter::Report
Simple struct for holding the counts Might want to use larger integral types for this....
Definition: G4TrackCounter.h:30
G4UA::G4TrackCounter::m_report
Report m_report
Track counts for this thread.
Definition: G4TrackCounter.h:60
G4UA::G4TrackCounter::Report::nPrimaryTracks
unsigned int nPrimaryTracks
Number of primary tracks.
Definition: G4TrackCounter.h:36
xAOD::track
@ track
Definition: TrackingPrimitives.h:512