All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
ParticleListAction_service.cc
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file ParticleListAction.cxx
3 /// \brief Use Geant4's user "hooks" to maintain a list of particles generated by Geant4.
4 ///
5 /// \author seligman@nevis.columbia.edu
6 ///
7 /// Design considerations
8 /// ---------------------
9 ///
10 /// This class relies on the MCTruth index from
11 /// g4b::PrimaryParticleInformation to operate correctly. This index
12 /// is an integer value that corresponds to an MCTruth object, as
13 /// accessed through art::Handle<std::vector<simb::MCTruth>> objects.
14 /// However, the order in which MCTruth objects are processed must be
15 /// consistent between this service and the MCTruthEventAction
16 /// service, which creates the PrimaryParticleInformation object,
17 /// otherwise the Assns objects created here will be incorrect.
18 ///
19 /// Through art 3.09, one can rely on the order returned by a given
20 /// Event::getMany call to be predictable and consistent within the
21 /// same program. However, this behavior should not necessarily be
22 /// relied upon, and a different implementation of this class would
23 /// insulate users from such details, making the implementation
24 /// simpler. One should determine whether storing an art::ProductID
25 /// object along with an MCTruthIndex might be more helpful.
26 ///
27 ////////////////////////////////////////////////////////////////////////
28 
30 
31 #include "art/Framework/Services/Registry/ServiceDefinitionMacros.h"
32 
33 DEFINE_ART_SERVICE(larg4::ParticleListActionService)
Use Geant4&#39;s user &quot;hooks&quot; to maintain a list of particles generated by Geant4.