42 #include "Geant4/G4UImanager.hh" 43 #include "Geant4/G4UIterminal.hh" 75 G4UImanager*
UI_{
nullptr};
135 ,
seed_(p.get<
long>(
"seed", -1))
136 ,
macroPath_(p.get<std::string>(
"macroPath",
"FW_SEARCH_PATH"))
138 ,
g4MacroFile_(p.get<std::string>(
"visMacro",
"larg4.mac"))
142 ,
afterEvent_(p.get<std::string>(
"afterEvent",
"pass"))
144 p.get<std::string>(
"DroppedParticleInstanceName",
"droppedMCParticles"))
148 produces<sim::ParticleAncestryMap>();
149 produces<std::vector<simb::MCParticle>>();
153 produces<art::Assns<simb::MCTruth, simb::MCParticle, sim::GeneratedParticleInfo>>();
172 if (
seed_ > 900000000) {
174 <<
"The provided largeant seed value: " <<
seed_ <<
" is invalid! Maximum seed value is 9E8.";
216 actionHolder->initialize();
219 actionHolder->setCurrArtRun(r);
238 UI_ = G4UImanager::GetUIpointer();
241 std::string macroLocation =
"";
244 << (macroWasFound ?
"successful " :
"unsuccessful ") <<
"and path is: \n" 251 std::string commandToExecute =
"/control/execute ";
252 commandToExecute.append(macroLocation);
253 UI_->ApplyCommand(commandToExecute);
281 pla->ParticleFilter();
283 pla->setInputCollections(mclists);
290 e.
put(
pla->ParticleCollection());
291 e.
put(
pla->AssnsMCTruthToMCParticle());
292 e.
put(
pla->DroppedTracksCollection());
310 std::vector<art::Handle<MCTruthCollection>> result;
base_engine_t & createEngine(seed_t seed)
static bool initializeDetectors_
static std::atomic< int > processingRun_
bool fStoreDroppedMCParticles
Store dropped particles.
void endRun(art::Run &) override
ProductID getProductID(std::string const &instance_name="") const
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
static std::unique_ptr< artg4tk::ArtG4RunManager > runManager_
void produce(art::Event &e) override
std::vector< art::Handle< MCTruthCollection > > inputCollections(art::Event const &e) const
EDProducer(fhicl::ParameterSet const &pset)
cet::search_path pathFinder_
Contains data associated to particles from detector simulation.
std::string fDroppedParticleInstanceName
Name of the dropped particle collection.
PutHandle< PROD > put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
void initializePhysicsList() const
EDProductGetter const * productGetter(ProductID const pid) const
Utility functions to print MC truth information.
#define DEFINE_ART_MODULE(klass)
Use Geant4's user "hooks" to maintain a list of particles generated by Geant4.
std::vector< simb::MCTruth > MCTruthCollection
An art service to assist in the distribution of guaranteed unique seeds to all engines within an art ...
std::vector< art::InputTag > inputCollectionTags_
ProducesCollector & producesCollector() noexcept
G4VUserPhysicsList * makePhysicsList() const
Handle< PROD > getHandle(SelectorBase const &) const
MaybeLogger_< ELseverityLevel::ELsev_success, false > LogDebug
art::ServiceHandle< larg4::ParticleListActionService > pla
void callArtProduces(art::ProducesCollector &)
EventNumber_t event() const
void beginRun(art::Run &r) override
larg4Main(fhicl::ParameterSet const &p)
Particle list in DetSim contains Monte Carlo particle information.
cet::coded_exception< error, detail::translate > exception
decltype(auto) constexpr empty(T &&obj)
ADL-aware version of std::empty.
std::vector< Handle< PROD > > getMany(SelectorBase const &selector=MatchAllSelector{}) const