All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Namespaces | Typedefs | Functions
larg4Main_module.cc File Reference
#include "nusimdata/SimulationBase/MCParticle.h"
#include "nusimdata/SimulationBase/MCTruth.h"
#include "art/Framework/Core/EDProducer.h"
#include "art/Framework/Core/ModuleMacros.h"
#include "art/Framework/Principal/Event.h"
#include "art/Framework/Principal/Run.h"
#include "artg4tk/geantInit/ArtG4DetectorConstruction.hh"
#include "artg4tk/geantInit/ArtG4RunManager.hh"
#include "artg4tk/geantInit/ArtG4EventAction.hh"
#include "artg4tk/geantInit/ArtG4PrimaryGeneratorAction.hh"
#include "artg4tk/geantInit/ArtG4StackingAction.hh"
#include "artg4tk/geantInit/ArtG4SteppingAction.hh"
#include "artg4tk/geantInit/ArtG4TrackingAction.hh"
#include "larg4/pluginActions/MCTruthEventAction_service.h"
#include "larg4/pluginActions/ParticleListAction_service.h"
#include "art/Framework/Services/Optional/RandomNumberGenerator.h"
#include "art/Framework/Services/Registry/ServiceHandle.h"
#include "artg4tk/services/ActionHolder_service.hh"
#include "artg4tk/services/DetectorHolder_service.hh"
#include "artg4tk/services/PhysicsListHolder_service.hh"
#include "lardataalg/MCDumpers/MCDumpers.h"
#include "lardataobj/Simulation/GeneratedParticleInfo.h"
#include "nug4/ParticleNavigation/ParticleList.h"
#include "nurandom/RandomUtils/NuRandomService.h"
#include "Geant4/G4UImanager.hh"
#include "Geant4/G4UIterminal.hh"
#include <atomic>
#include <string>
#include <set>
#include <map>
#include <memory>
#include <vector>

Go to the source code of this file.

Classes

class  larg4::larg4Main
 

Namespaces

 larg4
 Geant4 interface.
 

Typedefs

using MCTruthCollection = std::vector< simb::MCTruth >
 

Functions

 rmvlevel_ (p.get< int >("rmvlevel", 0))
 
 uiAtBeginRun_ (p.get< bool >("uiAtBeginRun", false))
 
 afterEvent_ (p.get< std::string >("afterEvent","pass"))
 

Typedef Documentation

using MCTruthCollection = std::vector<simb::MCTruth>

Definition at line 51 of file larg4Main_module.cc.

Function Documentation

afterEvent_ ( p.get< std::string >  "afterEvent","pass")

Definition at line 137 of file larg4Main_module.cc.

138 {
139  produces<std::map<int,std::set<int>>>();
140  produces<std::vector<simb::MCParticle>>();
141  produces<art::Assns<simb::MCTruth, simb::MCParticle, sim::GeneratedParticleInfo>>();
142 
143  // We need all of the services to run @produces@ on the data they will store. We do this
144  // by retrieving the holder services.
145  art::ServiceHandle<artg4tk::ActionHolderService> actionHolder;
146  art::ServiceHandle<artg4tk::DetectorHolderService> detectorHolder;
147 
148  if (initializeDetectors_) {
149  detectorHolder->initialize();
150  // Build the detectors' logical volumes
151  detectorHolder->constructAllLVs();
152  initializeDetectors_ = false;
153  }
154 
155  // And running @callArtProduces@ on each
156  actionHolder->callArtProduces(producesCollector());
157  detectorHolder->callArtProduces(producesCollector());
158 
159  // -- Check for invalid seed value
160  if (seed_ > 900000000) {
161  throw cet::exception("largeant:BadSeedValue")
162  << "The provided largeant seed value: " << seed_ << " is invalid! Maximum seed value is 9E8.";
163  }
164  // Set up the random number engine.
165  // -- D.R.: Use the NuRandomService engine for additional control over the seed generation policy
166  (void)art::ServiceHandle<rndm::NuRandomService>()->createEngine(*this, "G4Engine", p, "seed");
167 
168  // Handle the afterEvent setting
169  if (afterEvent_ == "ui") { uiAtEndEvent_ = true; }
170  else if (afterEvent_ == "pause") {
171  pauseAfterEvent_ = true;
172  }
173 }
pdgs p
Definition: selectors.fcl:22
j template void())
Definition: json.hpp:3108
afterEvent_(p.get< std::string >("afterEvent","pass"))
rmvlevel_ ( p.get< int >  "rmvlevel", 0)
uiAtBeginRun_ ( p.get< bool >  "uiAtBeginRun", false)