CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Static Private Attributes
RunManagerMTWorker Class Reference

#include <RunManagerMTWorker.h>

Classes

struct  TLSData
 

Public Member Functions

void abortEvent ()
 
void abortRun (bool softAbort=false)
 
void beginRun (const edm::EventSetup &)
 
void Connect (EventAction *)
 
void Connect (RunAction *)
 
void Connect (SteppingAction *)
 
void Connect (TrackingAction *)
 
void endRun ()
 
SimTrackManagerGetSimTrackManager ()
 
void initializeG4 (RunManagerMT *runManagerMaster, const edm::EventSetup &es)
 
std::unique_ptr< G4SimEventproduce (const edm::Event &inpevt, const edm::EventSetup &es, RunManagerMT &runManagerMaster)
 
std::vector< std::shared_ptr< SimProducer > > & producers ()
 
 RunManagerMTWorker (const edm::ParameterSet &iConfig, edm::ConsumesCollector &&iC)
 
std::vector< SensitiveCaloDetector * > & sensCaloDetectors ()
 
std::vector< SensitiveTkDetector * > & sensTkDetectors ()
 
G4SimEventsimEvent ()
 
 ~RunManagerMTWorker ()
 

Private Member Functions

void DumpMagneticField (const G4Field *, const std::string &) const
 
G4Event * generateEvent (const edm::Event &inpevt)
 
void initializeRun ()
 
void initializeTLS ()
 
void initializeUserActions ()
 
void resetGenParticleId (const edm::Event &inpevt)
 
void terminateRun ()
 

Static Private Member Functions

static void resetTLS ()
 

Private Attributes

int m_EvtMgrVerbosity
 
Generator m_generator
 
bool m_hasWatchers
 
edm::EDGetTokenT< edm::HepMCProductm_InToken
 
edm::EDGetTokenT< edm::HepMCProductm_LHCToken
 
bool m_LHCTransport
 
edm::ESGetToken< MagneticField, IdealMagneticFieldRecordm_MagField
 
bool m_nonBeam
 
edm::ParameterSet m_p
 
edm::ParameterSet m_pCustomUIsession
 
edm::ParameterSet m_pEventAction
 
edm::ParameterSet m_pField
 
const MagneticFieldm_pMagField = nullptr
 
edm::ParameterSet m_pRunAction
 
edm::ParameterSet m_pStackingAction
 
edm::ParameterSet m_pSteppingAction
 
edm::ParameterSet m_pTrackingAction
 
bool m_pUseMagneticField
 
std::unordered_map< std::string, std::unique_ptr< SensitiveDetectorMakerBase > > m_sdMakers
 
G4SimEventm_simEvent
 
std::unique_ptr< CMSSteppingVerbosem_sVerbose
 
edm::EDGetTokenT< edm::LHCTransportLinkContainerm_theLHCTlinkToken
 

Static Private Attributes

static thread_local bool dumpMF = false
 
static thread_local TLSDatam_tls {nullptr}
 

Detailed Description

Definition at line 48 of file RunManagerMTWorker.h.

Constructor & Destructor Documentation

◆ RunManagerMTWorker()

RunManagerMTWorker::RunManagerMTWorker ( const edm::ParameterSet iConfig,
edm::ConsumesCollector &&  iC 
)
explicit

Definition at line 142 of file RunManagerMTWorker.cc.

143  : m_generator(iConfig.getParameter<edm::ParameterSet>("Generator")),
145  iConfig.getParameter<edm::ParameterSet>("Generator").getParameter<edm::InputTag>("HepMCProductLabel"))),
147  iC.consumes<edm::LHCTransportLinkContainer>(iConfig.getParameter<edm::InputTag>("theLHCTlinkTag"))),
148  m_nonBeam(iConfig.getParameter<bool>("NonBeamEvent")),
149  m_pUseMagneticField(iConfig.getParameter<bool>("UseMagneticField")),
150  m_LHCTransport(iConfig.getParameter<bool>("LHCTransport")),
151  m_EvtMgrVerbosity(iConfig.getUntrackedParameter<int>("G4EventManagerVerbosity", 0)),
152  m_pField(iConfig.getParameter<edm::ParameterSet>("MagneticField")),
153  m_pRunAction(iConfig.getParameter<edm::ParameterSet>("RunAction")),
154  m_pEventAction(iConfig.getParameter<edm::ParameterSet>("EventAction")),
155  m_pStackingAction(iConfig.getParameter<edm::ParameterSet>("StackingAction")),
156  m_pTrackingAction(iConfig.getParameter<edm::ParameterSet>("TrackingAction")),
157  m_pSteppingAction(iConfig.getParameter<edm::ParameterSet>("SteppingAction")),
158  m_pCustomUIsession(iConfig.getUntrackedParameter<edm::ParameterSet>("CustomUIsession")),
159  m_p(iConfig),
160  m_simEvent(nullptr),
161  m_sVerbose(nullptr) {
162  std::vector<std::string> onlySDs = iConfig.getParameter<std::vector<std::string>>("OnlySDs");
164  std::vector<edm::ParameterSet> watchers = iConfig.getParameter<std::vector<edm::ParameterSet>>("Watchers");
165  m_hasWatchers = !watchers.empty();
166  initializeTLS();
167  int thisID = getThreadIndex();
168  if (m_LHCTransport) {
169  m_LHCToken = iC.consumes<edm::HepMCProduct>(edm::InputTag("LHCTransport"));
170  }
171  if (m_pUseMagneticField) {
173  }
174  edm::LogVerbatim("SimG4CoreApplication") << "RunManagerMTWorker is constructed for the thread " << thisID;
175  unsigned int k = 0;
176  for (std::unordered_map<std::string, std::unique_ptr<SensitiveDetectorMakerBase>>::const_iterator itr =
177  m_sdMakers.begin();
178  itr != m_sdMakers.end();
179  ++itr, ++k)
180  edm::LogVerbatim("SimG4CoreApplication") << "SD[" << k << "] " << itr->first;
181 }

References edm::BeginRun, edm::ParameterSet::getParameter(), initializeTLS(), HLT_FULL_cff::InputTag, dqmdumpme::k, m_hasWatchers, m_LHCToken, m_LHCTransport, m_MagField, m_p, m_pUseMagneticField, m_sdMakers, SiStripFineDelayHit_cfi::MagneticField, sim::sensitiveDetectorMakers(), and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~RunManagerMTWorker()

RunManagerMTWorker::~RunManagerMTWorker ( )

Definition at line 183 of file RunManagerMTWorker.cc.

183  {
184  ++n_tls_shutdown_task;
185  resetTLS();
186 
187  {
188  //make sure all tasks are done before continuing
189  timespec s;
190  s.tv_sec = 0;
191  s.tv_nsec = 10000;
192  while (n_tls_shutdown_task != 0) {
193  nanosleep(&s, nullptr);
194  }
195  }
196 }

References resetTLS(), and alignCSCRings::s.

Member Function Documentation

◆ abortEvent()

void RunManagerMTWorker::abortEvent ( )

Definition at line 559 of file RunManagerMTWorker.cc.

559  {
560  if (m_tls->runTerminated) {
561  return;
562  }
563  G4Track* t = m_tls->kernel->GetEventManager()->GetTrackingManager()->GetTrack();
564  t->SetTrackStatus(fStopAndKill);
565 
566  // CMS-specific act
567  //
568  TrackingAction* uta = static_cast<TrackingAction*>(m_tls->kernel->GetEventManager()->GetUserTrackingAction());
570 
571  m_tls->currentEvent->SetEventAborted();
572  m_tls->kernel->GetEventManager()->GetStackManager()->clear();
573  m_tls->kernel->GetEventManager()->GetTrackingManager()->EventAborted();
574 }

References RunManagerMTWorker::TLSData::currentEvent, RunManagerMTWorker::TLSData::kernel, m_tls, TrackingAction::PostUserTrackingAction(), RunManagerMTWorker::TLSData::runTerminated, and submitPVValidationJobs::t.

Referenced by SimRunInterface::abortEvent(), and abortRun().

◆ abortRun()

void RunManagerMTWorker::abortRun ( bool  softAbort = false)

Definition at line 576 of file RunManagerMTWorker.cc.

576  {
577  if (!softAbort) {
578  abortEvent();
579  }
580  m_tls->currentRun = nullptr;
581  terminateRun();
582 }

References abortEvent(), RunManagerMTWorker::TLSData::currentRun, m_tls, and terminateRun().

Referenced by SimRunInterface::abortRun().

◆ beginRun()

void RunManagerMTWorker::beginRun ( const edm::EventSetup es)

Definition at line 225 of file RunManagerMTWorker.cc.

225  {
226  for (auto& maker : m_sdMakers) {
227  maker.second->beginRun(es);
228  }
229  if (m_pUseMagneticField) {
231  }
232 }

References edm::EventSetup::getData(), m_MagField, m_pMagField, m_pUseMagneticField, and m_sdMakers.

◆ Connect() [1/4]

void RunManagerMTWorker::Connect ( EventAction eventAction)

Definition at line 424 of file RunManagerMTWorker.cc.

424  {
425  eventAction->m_beginOfEventSignal.connect(m_tls->registry->beginOfEventSignal_);
426  eventAction->m_endOfEventSignal.connect(m_tls->registry->endOfEventSignal_);
427 }

References sim_act::Signaler< T >::connect(), EventAction::m_beginOfEventSignal, EventAction::m_endOfEventSignal, m_tls, and RunManagerMTWorker::TLSData::registry.

◆ Connect() [2/4]

void RunManagerMTWorker::Connect ( RunAction runAction)

◆ Connect() [3/4]

void RunManagerMTWorker::Connect ( SteppingAction steppingAction)

Definition at line 434 of file RunManagerMTWorker.cc.

434  {
435  steppingAction->m_g4StepSignal.connect(m_tls->registry->g4StepSignal_);
436 }

References sim_act::Signaler< T >::connect(), SteppingAction::m_g4StepSignal, m_tls, and RunManagerMTWorker::TLSData::registry.

◆ Connect() [4/4]

void RunManagerMTWorker::Connect ( TrackingAction trackingAction)

Definition at line 429 of file RunManagerMTWorker.cc.

429  {
430  trackingAction->m_beginOfTrackSignal.connect(m_tls->registry->beginOfTrackSignal_);
431  trackingAction->m_endOfTrackSignal.connect(m_tls->registry->endOfTrackSignal_);
432 }

References sim_act::Signaler< T >::connect(), TrackingAction::m_beginOfTrackSignal, TrackingAction::m_endOfTrackSignal, m_tls, and RunManagerMTWorker::TLSData::registry.

◆ DumpMagneticField()

void RunManagerMTWorker::DumpMagneticField ( const G4Field *  field,
const std::string &  file 
) const
private

Definition at line 624 of file RunManagerMTWorker.cc.

624  {
625  std::ofstream fout(file.c_str(), std::ios::out);
626  if (fout.fail()) {
627  edm::LogWarning("SimG4CoreApplication")
628  << " RunManager WARNING : error opening file <" << file << "> for magnetic field";
629  } else {
630  // CMS magnetic field volume
631  double rmax = 9000 * mm;
632  double zmax = 24000 * mm;
633 
634  double dr = 1 * cm;
635  double dz = 5 * cm;
636 
637  int nr = (int)(rmax / dr);
638  int nz = 2 * (int)(zmax / dz);
639 
640  double r = 0.0;
641  double z0 = -zmax;
642  double z;
643 
644  double phi = 0.0;
645  double cosf = cos(phi);
646  double sinf = sin(phi);
647 
648  double point[4] = {0.0, 0.0, 0.0, 0.0};
649  double bfield[3] = {0.0, 0.0, 0.0};
650 
651  fout << std::setprecision(6);
652  for (int i = 0; i <= nr; ++i) {
653  z = z0;
654  for (int j = 0; j <= nz; ++j) {
655  point[0] = r * cosf;
656  point[1] = r * sinf;
657  point[2] = z;
658  field->GetFieldValue(point, bfield);
659  fout << "R(mm)= " << r / mm << " phi(deg)= " << phi / degree << " Z(mm)= " << z / mm
660  << " Bz(tesla)= " << bfield[2] / tesla << " Br(tesla)= " << (bfield[0] * cosf + bfield[1] * sinf) / tesla
661  << " Bphi(tesla)= " << (bfield[0] * sinf - bfield[1] * cosf) / tesla << G4endl;
662  z += dz;
663  }
664  r += dr;
665  }
666 
667  fout.close();
668  }
669 }

References funct::cos(), flavorHistoryFilter_cfi::dr, PVValHelper::dz, geometryDiff::file, groupFilesInBlocks::fout, mps_fire::i, createfilelist::int, dqmiolumiharvest::j, EgHLTOffHistBins_cfi::nr, MillePedeFileConverter_cfg::out, phi, point, alignCSCRings::r, funct::sin(), z, HLTMuonOfflineAnalyzer_cfi::z0, and SiStripMonitorCluster_cfi::zmax.

Referenced by initializeG4().

◆ endRun()

void RunManagerMTWorker::endRun ( )

Definition at line 234 of file RunManagerMTWorker.cc.

234  {
235  int thisID = getThreadIndex();
236  edm::LogVerbatim("SimG4CoreApplication") << "RunManagerMTWorker::endRun for the thread " << thisID;
237  terminateRun();
238 }

References terminateRun().

◆ generateEvent()

G4Event * RunManagerMTWorker::generateEvent ( const edm::Event inpevt)
private

Definition at line 584 of file RunManagerMTWorker.cc.

584  {
585  m_tls->currentEvent.reset();
586  m_simEvent = nullptr;
587 
588  // 64 bits event ID in CMSSW converted into Geant4 event ID
589  G4int evtid = (G4int)inpevt.id().event();
590  G4Event* evt = new G4Event(evtid);
591 
593  inpevt.getByToken(m_InToken, HepMCEvt);
594 
595  m_generator.setGenEvent(HepMCEvt->GetEvent());
596 
597  // required to reset the GenParticle Id for particles transported
598  // along the beam pipe
599  // to their original value for SimTrack creation
600  resetGenParticleId(inpevt);
601 
602  if (!m_nonBeam) {
603  m_generator.HepMC2G4(HepMCEvt->GetEvent(), evt);
604  if (m_LHCTransport) {
606  inpevt.getByToken(m_LHCToken, LHCMCEvt);
607  m_generator.nonCentralEvent2G4(LHCMCEvt->GetEvent(), evt);
608  }
609  } else {
610  m_generator.nonCentralEvent2G4(HepMCEvt->GetEvent(), evt);
611  }
612 
613  return evt;
614 }

References RunManagerMTWorker::TLSData::currentEvent, edm::EventID::event(), runTauDisplay::evtid, edm::Event::getByToken(), edm::HepMCProduct::GetEvent(), Generator::HepMC2G4(), edm::EventBase::id(), m_generator, m_InToken, m_LHCToken, m_LHCTransport, m_nonBeam, m_simEvent, m_tls, Generator::nonCentralEvent2G4(), resetGenParticleId(), and Generator::setGenEvent().

Referenced by produce().

◆ GetSimTrackManager()

SimTrackManager * RunManagerMTWorker::GetSimTrackManager ( )

Definition at line 438 of file RunManagerMTWorker.cc.

438  {
439  initializeTLS();
440  return m_tls->trackManager.get();
441 }

References initializeTLS(), m_tls, and RunManagerMTWorker::TLSData::trackManager.

Referenced by SimRunInterface::SimRunInterface().

◆ initializeG4()

void RunManagerMTWorker::initializeG4 ( RunManagerMT runManagerMaster,
const edm::EventSetup es 
)

Definition at line 265 of file RunManagerMTWorker.cc.

265  {
266  G4Timer timer;
267  timer.Start();
268 
269  // I guess everything initialized here should be in thread_local storage
270  initializeTLS();
272  return;
273 
274  int thisID = getThreadIndex();
275  edm::LogVerbatim("SimG4CoreApplication") << "RunManagerMTWorker::initializeThread " << thisID << " is started";
276 
277  // Initialize per-thread output
278  G4Threading::G4SetThreadId(thisID);
279  G4UImanager::GetUIpointer()->SetUpForAThread(thisID);
280  const std::string& uitype = m_pCustomUIsession.getUntrackedParameter<std::string>("Type", "MessageLogger");
281  if (uitype == "MessageLogger") {
282  new CustomUIsession();
283  } else if (uitype == "MessageLoggerThreadPrefix") {
285  } else if (uitype == "FilePerThread") {
287  } else {
289  << "Invalid value of CustomUIsession.Type '" << uitype
290  << "', valid are MessageLogger, MessageLoggerThreadPrefix, FilePerThread";
291  }
292 
293  // Initialize worker part of shared resources (geometry, physics)
294  G4WorkerThread::BuildGeometryAndPhysicsVector();
295 
296  // Create worker run manager
297  m_tls->kernel.reset(G4WorkerRunManagerKernel::GetRunManagerKernel());
298  if (nullptr == m_tls->kernel) {
299  m_tls->kernel = std::make_unique<G4WorkerRunManagerKernel>();
300  }
301 
302  // Define G4 exception handler
303  double th = m_p.getParameter<double>("ThresholdForGeometryExceptions") * CLHEP::GeV;
304  G4StateManager::GetStateManager()->SetExceptionHandler(new ExceptionHandler(th));
305 
306  // Set the geometry for the worker, share from master
307  auto worldPV = runManagerMaster->world().GetWorldVolume();
308  m_tls->kernel->WorkerDefineWorldVolume(worldPV);
309  G4TransportationManager* tM = G4TransportationManager::GetTransportationManager();
310  tM->SetWorldForTracking(worldPV);
311 
312  // we need the track manager now
313  m_tls->trackManager = std::make_unique<SimTrackManager>();
314 
315  // setup the magnetic field
316  if (m_pUseMagneticField) {
317  const GlobalPoint g(0.f, 0.f, 0.f);
318 
319  sim::FieldBuilder fieldBuilder(m_pMagField, m_pField);
320 
321  CMSFieldManager* fieldManager = new CMSFieldManager();
322  tM->SetFieldManager(fieldManager);
323  fieldBuilder.build(fieldManager, tM->GetPropagatorInField());
324 
325  std::string fieldFile = m_p.getUntrackedParameter<std::string>("FileNameField", "");
326  if (!fieldFile.empty()) {
327  std::call_once(applyOnce, []() { dumpMF = true; });
328  if (dumpMF) {
329  edm::LogVerbatim("SimG4CoreApplication") << "RunManagerMTWorker: Dump magnetic field to file " << fieldFile;
330  DumpMagneticField(tM->GetFieldManager()->GetDetectorField(), fieldFile);
331  }
332  }
333  }
334 
335  // attach sensitive detector
336  auto sensDets = sim::attachSD(
337  m_sdMakers, es, runManagerMaster->catalog(), m_p, m_tls->trackManager.get(), *(m_tls->registry.get()));
338 
339  m_tls->sensTkDets.swap(sensDets.first);
340  m_tls->sensCaloDets.swap(sensDets.second);
341 
342  edm::LogVerbatim("SimG4CoreApplication")
343  << "RunManagerMTWorker: Sensitive Detectors are built in thread " << thisID << " found "
344  << m_tls->sensTkDets.size() << " Tk type SD, and " << m_tls->sensCaloDets.size() << " Calo type SD";
345 
346  // Set the physics list for the worker, share from master
347  PhysicsList* physicsList = runManagerMaster->physicsListForWorker();
348 
349  edm::LogVerbatim("SimG4CoreApplication")
350  << "RunManagerMTWorker: start initialisation of PhysicsList for the thread " << thisID;
351 
352  // Geant4 UI commands in PreInit state
353  if (!runManagerMaster->G4Commands().empty()) {
354  G4cout << "RunManagerMTWorker: Requested UI commands: " << G4endl;
355  for (const std::string& command : runManagerMaster->G4Commands()) {
356  G4cout << " " << command << G4endl;
357  G4UImanager::GetUIpointer()->ApplyCommand(command);
358  }
359  }
360  G4StateManager::GetStateManager()->SetNewState(G4State_Init);
361 
362  physicsList->InitializeWorker();
363  m_tls->kernel->SetPhysics(physicsList);
364  m_tls->kernel->InitializePhysics();
365 
366  if (!m_tls->kernel->RunInitialization()) {
368  << "RunManagerMTWorker: Geant4 kernel initialization failed in thread " << thisID;
369  }
370  //tell all interesting parties that we are beginning the job
371  BeginOfJob aBeginOfJob(&es);
372  m_tls->registry->beginOfJobSignal_(&aBeginOfJob);
373 
374  G4int sv = m_p.getUntrackedParameter<int>("SteppingVerbosity", 0);
375  G4double elim = m_p.getUntrackedParameter<double>("StepVerboseThreshold", 0.1) * CLHEP::GeV;
376  std::vector<int> ve = m_p.getUntrackedParameter<std::vector<int>>("VerboseEvents");
377  std::vector<int> vn = m_p.getUntrackedParameter<std::vector<int>>("VertexNumber");
378  std::vector<int> vt = m_p.getUntrackedParameter<std::vector<int>>("VerboseTracks");
379 
380  if (sv > 0) {
381  m_sVerbose = std::make_unique<CMSSteppingVerbose>(sv, elim, ve, vn, vt);
382  }
384 
385  G4StateManager::GetStateManager()->SetNewState(G4State_Idle);
386  m_tls->threadInitialized = true;
387 
388  timer.Stop();
389  edm::LogVerbatim("SimG4CoreApplication")
390  << "RunManagerMTWorker::initializeThread done for the thread " << thisID << " " << timer;
391 }

References applyOnce, sim::attachSD(), sim::FieldBuilder::build(), RunManagerMT::catalog(), mps_check::command, edm::errors::Configuration, g4SimHits_cfi::CustomUIsession, DumpMagneticField(), dumpMF, Exception, f, g, RunManagerMT::G4Commands(), ecalTB2006H4_GenSimDigiReco_cfg::G4cout, edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), DDDWorld::GetWorldVolume(), GeV, initializeTLS(), initializeUserActions(), RunManagerMTWorker::TLSData::kernel, m_p, m_pCustomUIsession, m_pField, m_pMagField, m_pUseMagneticField, m_sdMakers, m_sVerbose, m_tls, RunManagerMT::physicsListForWorker(), RunManagerMTWorker::TLSData::registry, RunManagerMTWorker::TLSData::sensCaloDets, RunManagerMTWorker::TLSData::sensTkDets, AlCaHLTBitMon_QueryRunRegistry::string, pfDeepBoostedJetPreprocessParams_cfi::sv, RunManagerMTWorker::TLSData::threadInitialized, RunManagerMTWorker::TLSData::trackManager, and RunManagerMT::world().

Referenced by produce().

◆ initializeRun()

void RunManagerMTWorker::initializeRun ( )
private

Definition at line 455 of file RunManagerMTWorker.cc.

455  {
456  int thisID = getThreadIndex();
457  edm::LogVerbatim("SimG4CoreApplication") << "RunManagerMTWorker::initializeRun " << thisID << " is started";
458  m_tls->currentRun = new G4Run();
459  G4StateManager::GetStateManager()->SetNewState(G4State_GeomClosed);
460  if (nullptr != m_tls->userRunAction) {
461  m_tls->userRunAction->BeginOfRunAction(m_tls->currentRun);
462  }
463 }

References RunManagerMTWorker::TLSData::currentRun, m_tls, and RunManagerMTWorker::TLSData::userRunAction.

Referenced by produce().

◆ initializeTLS()

void RunManagerMTWorker::initializeTLS ( )
private

Definition at line 240 of file RunManagerMTWorker.cc.

240  {
241  if (nullptr != m_tls) {
242  return;
243  }
244 
245  m_tls = new TLSData();
246  m_tls->registry = std::make_unique<SimActivityRegistry>();
247 
248  edm::Service<SimActivityRegistry> otherRegistry;
249  //Look for an outside SimActivityRegistry
250  // this is used by the visualization code
251  int thisID = getThreadIndex();
252  if (otherRegistry) {
253  m_tls->registry->connect(*otherRegistry);
254  if (thisID > 0) {
256  << "SimActivityRegistry service (i.e. visualization) is not supported for more than 1 thread. "
257  << " \n If this use case is needed, RunManagerMTWorker has to be updated.";
258  }
259  }
260  if (m_hasWatchers) {
262  }
263 }

References edm::errors::Configuration, createWatchers(), Exception, m_hasWatchers, m_p, m_tls, RunManagerMTWorker::TLSData::producers, RunManagerMTWorker::TLSData::registry, and RunManagerMTWorker::TLSData::watchers.

Referenced by GetSimTrackManager(), initializeG4(), producers(), RunManagerMTWorker(), sensCaloDetectors(), and sensTkDetectors().

◆ initializeUserActions()

void RunManagerMTWorker::initializeUserActions ( )
private

Definition at line 393 of file RunManagerMTWorker.cc.

393  {
394  m_tls->runInterface = std::make_unique<SimRunInterface>(this, false);
395  m_tls->userRunAction = std::make_unique<RunAction>(m_pRunAction, m_tls->runInterface.get(), false);
396  m_tls->userRunAction->SetMaster(false);
397  Connect(m_tls->userRunAction.get());
398 
399  G4EventManager* eventManager = m_tls->kernel->GetEventManager();
400  eventManager->SetVerboseLevel(m_EvtMgrVerbosity);
401 
402  EventAction* userEventAction =
404  Connect(userEventAction);
405  eventManager->SetUserAction(userEventAction);
406 
407  TrackingAction* userTrackingAction = new TrackingAction(userEventAction, m_pTrackingAction, m_sVerbose.get());
408  Connect(userTrackingAction);
409  eventManager->SetUserAction(userTrackingAction);
410 
411  SteppingAction* userSteppingAction =
412  new SteppingAction(userEventAction, m_pSteppingAction, m_sVerbose.get(), m_hasWatchers);
413  Connect(userSteppingAction);
414  eventManager->SetUserAction(userSteppingAction);
415 
416  eventManager->SetUserAction(new StackingAction(userTrackingAction, m_pStackingAction, m_sVerbose.get()));
417 }

References Connect(), g4SimHits_cfi::EventAction, RunManagerMTWorker::TLSData::kernel, m_EvtMgrVerbosity, m_hasWatchers, m_pEventAction, m_pRunAction, m_pStackingAction, m_pSteppingAction, m_pTrackingAction, m_sVerbose, m_tls, RunManagerMTWorker::TLSData::runInterface, CastorDigiValidation::StackingAction, CastorDigiValidation::SteppingAction, g4SimHits_cfi::TrackingAction, RunManagerMTWorker::TLSData::trackManager, and RunManagerMTWorker::TLSData::userRunAction.

Referenced by initializeG4().

◆ produce()

std::unique_ptr< G4SimEvent > RunManagerMTWorker::produce ( const edm::Event inpevt,
const edm::EventSetup es,
RunManagerMT runManagerMaster 
)

Definition at line 486 of file RunManagerMTWorker.cc.

488  {
489  // The initialization and begin/end run is a bit convoluted due to
490  // - Geant4 deals per-thread
491  // - OscarMTProducer deals per-stream
492  // and framework/TBB is free to schedule work in streams to the
493  // threads as it likes.
494  //
495  // We have to do the per-thread initialization, and per-thread
496  // per-run initialization here by ourselves.
497 
498  if (nullptr == m_tls || !m_tls->threadInitialized) {
499  edm::LogVerbatim("SimG4CoreApplication")
500  << "RunManagerMTWorker::produce(): stream " << inpevt.streamID() << " thread " << getThreadIndex()
501  << " Geant4 initialisation for this thread";
502  initializeG4(&runManagerMaster, es);
503  m_tls->threadInitialized = true;
504  }
505  // Initialize run
506  if (inpevt.id().run() != m_tls->currentRunNumber) {
507  edm::LogVerbatim("SimG4CoreApplication")
508  << "RunID= " << inpevt.id().run() << " TLS RunID= " << m_tls->currentRunNumber;
509  if (m_tls->currentRunNumber != 0 && !m_tls->runTerminated) {
510  // If previous run in this thread was not terminated via endRun() call,
511  // terminate it now
512  terminateRun();
513  }
514  initializeRun();
515  m_tls->currentRunNumber = inpevt.id().run();
516  }
517  m_tls->runInterface->setRunManagerMTWorker(this); // For UserActions
518 
519  m_tls->currentEvent.reset(generateEvent(inpevt));
520 
521  auto simEvent = std::make_unique<G4SimEvent>();
522  m_simEvent = simEvent.get();
525  if (m_generator.genVertex() != nullptr) {
526  auto genVertex = m_generator.genVertex();
527  m_simEvent->collisionPoint(math::XYZTLorentzVectorD(genVertex->x() / CLHEP::cm,
528  genVertex->y() / CLHEP::cm,
529  genVertex->z() / CLHEP::cm,
530  genVertex->t() / CLHEP::second));
531  }
532  if (m_tls->currentEvent->GetNumberOfPrimaryVertex() == 0) {
533  std::stringstream ss;
534  ss << "RunManagerMTWorker::produce: event " << inpevt.id().event() << " with no G4PrimaryVertices \n";
535  throw SimG4Exception(ss.str());
536 
537  } else {
538  edm::LogVerbatim("SimG4CoreApplication")
539  << "RunManagerMTWorker::produce: start EventID=" << inpevt.id().event() << " StreamID=" << inpevt.streamID()
540  << " threadIndex=" << getThreadIndex() << " weight=" << m_simEvent->weight() << "; "
541  << m_tls->currentEvent->GetNumberOfPrimaryVertex() << " vertices for Geant4; generator produced "
542  << m_simEvent->nGenParts() << " particles.";
543 
544  m_tls->kernel->GetEventManager()->ProcessOneEvent(m_tls->currentEvent.get());
545  }
546 
547  //remove memory only needed during event processing
548  m_tls->currentEvent.reset();
549 
550  for (auto& sd : m_tls->sensCaloDets) {
551  sd->reset();
552  }
553  edm::LogVerbatim("SimG4CoreApplication") << "RunManagerMTWorker::produce: ended Event " << inpevt.id().event();
554 
555  m_simEvent = nullptr;
556  return simEvent;
557 }

References G4SimEvent::collisionPoint(), RunManagerMTWorker::TLSData::currentEvent, RunManagerMTWorker::TLSData::currentRunNumber, edm::EventID::event(), Generator::eventWeight(), generateEvent(), Generator::genEvent(), Generator::genVertex(), G4SimEvent::hepEvent(), edm::EventBase::id(), initializeG4(), initializeRun(), RunManagerMTWorker::TLSData::kernel, m_generator, m_simEvent, m_tls, G4SimEvent::nGenParts(), edm::EventID::run(), RunManagerMTWorker::TLSData::runInterface, RunManagerMTWorker::TLSData::runTerminated, sd, edm::second(), RunManagerMTWorker::TLSData::sensCaloDets, simEvent(), contentValuesCheck::ss, edm::Event::streamID(), terminateRun(), RunManagerMTWorker::TLSData::threadInitialized, and G4SimEvent::weight().

◆ producers()

std::vector< std::shared_ptr< SimProducer > > & RunManagerMTWorker::producers ( )

Definition at line 450 of file RunManagerMTWorker.cc.

450  {
451  initializeTLS();
452  return m_tls->producers;
453 }

References initializeTLS(), m_tls, and RunManagerMTWorker::TLSData::producers.

◆ resetGenParticleId()

void RunManagerMTWorker::resetGenParticleId ( const edm::Event inpevt)
private

Definition at line 616 of file RunManagerMTWorker.cc.

616  {
618  inpevt.getByToken(m_theLHCTlinkToken, theLHCTlink);
619  if (theLHCTlink.isValid()) {
620  m_tls->trackManager->setLHCTransportLink(theLHCTlink.product());
621  }
622 }

References edm::Event::getByToken(), edm::HandleBase::isValid(), m_theLHCTlinkToken, m_tls, edm::Handle< T >::product(), and RunManagerMTWorker::TLSData::trackManager.

Referenced by generateEvent().

◆ resetTLS()

void RunManagerMTWorker::resetTLS ( )
staticprivate

Definition at line 198 of file RunManagerMTWorker.cc.

198  {
199  m_tls = nullptr;
200 
201  if (active_tlsdata != 0 and not tls_shutdown_timeout) {
202  ++n_tls_shutdown_task;
203  //need to run tasks on each thread which has set the tls
204  {
205  tbb::task_arena arena(tbb::task_arena::attach{});
206  arena.enqueue([]() { RunManagerMTWorker::resetTLS(); });
207  }
208  timespec s;
209  s.tv_sec = 0;
210  s.tv_nsec = 10000;
211  //we do not want this thread to be used for a new task since it
212  // has already cleared its structures. In order to fill all TBB
213  // threads we wait for all TLSes to clear
214  int count = 0;
215  while (active_tlsdata.load() != 0 and ++count < 1000) {
216  nanosleep(&s, nullptr);
217  }
218  if (count >= 1000) {
219  tls_shutdown_timeout = true;
220  }
221  }
222  --n_tls_shutdown_task;
223 }

References submitPVResolutionJobs::count, m_tls, and alignCSCRings::s.

Referenced by ~RunManagerMTWorker().

◆ sensCaloDetectors()

std::vector< SensitiveCaloDetector * > & RunManagerMTWorker::sensCaloDetectors ( )

Definition at line 446 of file RunManagerMTWorker.cc.

446  {
447  initializeTLS();
448  return m_tls->sensCaloDets;
449 }

References initializeTLS(), m_tls, and RunManagerMTWorker::TLSData::sensCaloDets.

◆ sensTkDetectors()

std::vector< SensitiveTkDetector * > & RunManagerMTWorker::sensTkDetectors ( )

Definition at line 442 of file RunManagerMTWorker.cc.

442  {
443  initializeTLS();
444  return m_tls->sensTkDets;
445 }

References initializeTLS(), m_tls, and RunManagerMTWorker::TLSData::sensTkDets.

◆ simEvent()

G4SimEvent* RunManagerMTWorker::simEvent ( )
inline

Definition at line 63 of file RunManagerMTWorker.h.

63 { return m_simEvent; }

References m_simEvent.

Referenced by produce(), and SimRunInterface::simEvent().

◆ terminateRun()

void RunManagerMTWorker::terminateRun ( )
private

Definition at line 465 of file RunManagerMTWorker.cc.

465  {
466  edm::LogVerbatim("SimG4CoreApplication") << "RunManagerMTWorker::terminateRun ";
467  if (nullptr == m_tls || m_tls->runTerminated) {
468  return;
469  }
470  int thisID = getThreadIndex();
471  edm::LogVerbatim("SimG4CoreApplication") << "RunManagerMTWorker::terminateRun " << thisID << " is started";
472  if (m_tls->userRunAction) {
473  m_tls->userRunAction->EndOfRunAction(m_tls->currentRun);
474  m_tls->userRunAction.reset();
475  }
476  m_tls->currentEvent.reset();
477  m_simEvent = nullptr;
478 
479  if (m_tls->kernel) {
480  m_tls->kernel->RunTermination();
481  }
482 
483  m_tls->runTerminated = true;
484 }

References RunManagerMTWorker::TLSData::currentEvent, RunManagerMTWorker::TLSData::currentRun, RunManagerMTWorker::TLSData::kernel, m_simEvent, m_tls, RunManagerMTWorker::TLSData::runTerminated, and RunManagerMTWorker::TLSData::userRunAction.

Referenced by abortRun(), endRun(), and produce().

Member Data Documentation

◆ dumpMF

thread_local bool RunManagerMTWorker::dumpMF = false
staticprivate

Definition at line 115 of file RunManagerMTWorker.h.

Referenced by initializeG4().

◆ m_EvtMgrVerbosity

int RunManagerMTWorker::m_EvtMgrVerbosity
private

Definition at line 102 of file RunManagerMTWorker.h.

Referenced by initializeUserActions().

◆ m_generator

Generator RunManagerMTWorker::m_generator
private

Definition at line 91 of file RunManagerMTWorker.h.

Referenced by generateEvent(), and produce().

◆ m_hasWatchers

bool RunManagerMTWorker::m_hasWatchers
private

Definition at line 100 of file RunManagerMTWorker.h.

Referenced by initializeTLS(), initializeUserActions(), and RunManagerMTWorker().

◆ m_InToken

edm::EDGetTokenT<edm::HepMCProduct> RunManagerMTWorker::m_InToken
private

Definition at line 92 of file RunManagerMTWorker.h.

Referenced by generateEvent().

◆ m_LHCToken

edm::EDGetTokenT<edm::HepMCProduct> RunManagerMTWorker::m_LHCToken
private

Definition at line 93 of file RunManagerMTWorker.h.

Referenced by generateEvent(), and RunManagerMTWorker().

◆ m_LHCTransport

bool RunManagerMTWorker::m_LHCTransport
private

Definition at line 101 of file RunManagerMTWorker.h.

Referenced by generateEvent(), and RunManagerMTWorker().

◆ m_MagField

edm::ESGetToken<MagneticField, IdealMagneticFieldRecord> RunManagerMTWorker::m_MagField
private

Definition at line 95 of file RunManagerMTWorker.h.

Referenced by beginRun(), and RunManagerMTWorker().

◆ m_nonBeam

bool RunManagerMTWorker::m_nonBeam
private

Definition at line 98 of file RunManagerMTWorker.h.

Referenced by generateEvent().

◆ m_p

edm::ParameterSet RunManagerMTWorker::m_p
private

Definition at line 111 of file RunManagerMTWorker.h.

Referenced by initializeG4(), initializeTLS(), and RunManagerMTWorker().

◆ m_pCustomUIsession

edm::ParameterSet RunManagerMTWorker::m_pCustomUIsession
private

Definition at line 110 of file RunManagerMTWorker.h.

Referenced by initializeG4().

◆ m_pEventAction

edm::ParameterSet RunManagerMTWorker::m_pEventAction
private

Definition at line 106 of file RunManagerMTWorker.h.

Referenced by initializeUserActions().

◆ m_pField

edm::ParameterSet RunManagerMTWorker::m_pField
private

Definition at line 104 of file RunManagerMTWorker.h.

Referenced by initializeG4().

◆ m_pMagField

const MagneticField* RunManagerMTWorker::m_pMagField = nullptr
private

Definition at line 96 of file RunManagerMTWorker.h.

Referenced by beginRun(), and initializeG4().

◆ m_pRunAction

edm::ParameterSet RunManagerMTWorker::m_pRunAction
private

Definition at line 105 of file RunManagerMTWorker.h.

Referenced by initializeUserActions().

◆ m_pStackingAction

edm::ParameterSet RunManagerMTWorker::m_pStackingAction
private

Definition at line 107 of file RunManagerMTWorker.h.

Referenced by initializeUserActions().

◆ m_pSteppingAction

edm::ParameterSet RunManagerMTWorker::m_pSteppingAction
private

Definition at line 109 of file RunManagerMTWorker.h.

Referenced by initializeUserActions().

◆ m_pTrackingAction

edm::ParameterSet RunManagerMTWorker::m_pTrackingAction
private

Definition at line 108 of file RunManagerMTWorker.h.

Referenced by initializeUserActions().

◆ m_pUseMagneticField

bool RunManagerMTWorker::m_pUseMagneticField
private

Definition at line 99 of file RunManagerMTWorker.h.

Referenced by beginRun(), initializeG4(), and RunManagerMTWorker().

◆ m_sdMakers

std::unordered_map<std::string, std::unique_ptr<SensitiveDetectorMakerBase> > RunManagerMTWorker::m_sdMakers
private

Definition at line 119 of file RunManagerMTWorker.h.

Referenced by beginRun(), initializeG4(), and RunManagerMTWorker().

◆ m_simEvent

G4SimEvent* RunManagerMTWorker::m_simEvent
private

Definition at line 117 of file RunManagerMTWorker.h.

Referenced by generateEvent(), produce(), simEvent(), and terminateRun().

◆ m_sVerbose

std::unique_ptr<CMSSteppingVerbose> RunManagerMTWorker::m_sVerbose
private

Definition at line 118 of file RunManagerMTWorker.h.

Referenced by initializeG4(), and initializeUserActions().

◆ m_theLHCTlinkToken

edm::EDGetTokenT<edm::LHCTransportLinkContainer> RunManagerMTWorker::m_theLHCTlinkToken
private

Definition at line 94 of file RunManagerMTWorker.h.

Referenced by resetGenParticleId().

◆ m_tls

thread_local RunManagerMTWorker::TLSData * RunManagerMTWorker::m_tls {nullptr}
staticprivate
Generator::eventWeight
virtual const double eventWeight() const
Definition: Generator.h:32
G4SimEvent::hepEvent
void hepEvent(const HepMC::GenEvent *r)
Definition: G4SimEvent.h:23
RunManagerMTWorker::m_theLHCTlinkToken
edm::EDGetTokenT< edm::LHCTransportLinkContainer > m_theLHCTlinkToken
Definition: RunManagerMTWorker.h:94
RunManagerMTWorker::m_tls
static thread_local TLSData * m_tls
Definition: RunManagerMTWorker.h:113
RunManagerMTWorker::initializeG4
void initializeG4(RunManagerMT *runManagerMaster, const edm::EventSetup &es)
Definition: RunManagerMTWorker.cc:265
RunManagerMTWorker::TLSData::trackManager
std::unique_ptr< SimTrackManager > trackManager
Definition: RunManagerMTWorker.cc:116
mps_fire.i
i
Definition: mps_fire.py:428
edm::LHCTransportLinkContainer
std::vector< LHCTransportLink > LHCTransportLinkContainer
Definition: LHCTransportLinkContainer.h:8
EventAction
Definition: EventAction.h:23
RunManagerMTWorker::m_simEvent
G4SimEvent * m_simEvent
Definition: RunManagerMTWorker.h:117
CustomUIsessionThreadPrefix
Definition: CustomUIsessionThreadPrefix.h:13
edm::Handle::product
T const * product() const
Definition: Handle.h:70
RunManagerMTWorker::m_sdMakers
std::unordered_map< std::string, std::unique_ptr< SensitiveDetectorMakerBase > > m_sdMakers
Definition: RunManagerMTWorker.h:119
RunManagerMTWorker::TLSData::producers
std::vector< std::shared_ptr< SimProducer > > producers
Definition: RunManagerMTWorker.cc:120
ExceptionHandler
Definition: ExceptionHandler.h:19
EventAction::m_beginOfEventSignal
SimActivityRegistry::BeginOfEventSignal m_beginOfEventSignal
Definition: EventAction.h:46
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
EventAction::m_endOfEventSignal
SimActivityRegistry::EndOfEventSignal m_endOfEventSignal
Definition: EventAction.h:47
runTauDisplay.evtid
evtid
Definition: runTauDisplay.py:293
RunManagerMTWorker::TLSData::watchers
std::vector< std::shared_ptr< SimWatcher > > watchers
Definition: RunManagerMTWorker.cc:119
RunManagerMTWorker::resetTLS
static void resetTLS()
Definition: RunManagerMTWorker.cc:198
TrackingAction::PostUserTrackingAction
void PostUserTrackingAction(const G4Track *aTrack) override
Definition: TrackingAction.cc:68
math::XYZTLorentzVectorD
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:14
SimG4Exception
Definition: SimG4Exception.h:13
Generator::genVertex
virtual const math::XYZTLorentzVector * genVertex() const
Definition: Generator.h:31
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
CMSFieldManager
Definition: CMSFieldManager.h:24
Generator::nonCentralEvent2G4
void nonCentralEvent2G4(const HepMC::GenEvent *g, G4Event *e)
Definition: Generator.cc:549
RunManagerMTWorker::m_generator
Generator m_generator
Definition: RunManagerMTWorker.h:91
RunManagerMTWorker::abortEvent
void abortEvent()
Definition: RunManagerMTWorker.cc:559
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
RunManagerMTWorker::m_LHCTransport
bool m_LHCTransport
Definition: RunManagerMTWorker.h:101
SteppingAction
Definition: SteppingAction.h:32
RunManagerMTWorker::simEvent
G4SimEvent * simEvent()
Definition: RunManagerMTWorker.h:63
RunManagerMTWorker::m_pEventAction
edm::ParameterSet m_pEventAction
Definition: RunManagerMTWorker.h:106
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
RunManagerMTWorker::Connect
void Connect(RunAction *)
Definition: RunManagerMTWorker.cc:419
RunManagerMTWorker::m_EvtMgrVerbosity
int m_EvtMgrVerbosity
Definition: RunManagerMTWorker.h:102
CastorDigiValidation.StackingAction
StackingAction
Definition: CastorDigiValidation.py:136
mps_check.command
list command
Definition: mps_check.py:25
RunManagerMTWorker::m_pCustomUIsession
edm::ParameterSet m_pCustomUIsession
Definition: RunManagerMTWorker.h:110
edm::ConsumesCollector::esConsumes
auto esConsumes()
Definition: ConsumesCollector.h:97
edm::Handle< edm::HepMCProduct >
RunAction::m_beginOfRunSignal
SimActivityRegistry::BeginOfRunSignal m_beginOfRunSignal
Definition: RunAction.h:23
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
RunManagerMTWorker::TLSData::sensCaloDets
std::vector< SensitiveCaloDetector * > sensCaloDets
Definition: RunManagerMTWorker.cc:118
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
RunManagerMT::catalog
const SensitiveDetectorCatalog & catalog() const
Definition: RunManagerMT.h:71
TrackingAction
Definition: TrackingAction.h:16
RunManagerMTWorker::m_p
edm::ParameterSet m_p
Definition: RunManagerMTWorker.h:111
alignCSCRings.s
s
Definition: alignCSCRings.py:92
RunManagerMTWorker::initializeUserActions
void initializeUserActions()
Definition: RunManagerMTWorker.cc:393
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
RunManagerMTWorker::m_hasWatchers
bool m_hasWatchers
Definition: RunManagerMTWorker.h:100
RunManagerMTWorker::TLSData::currentRun
G4Run * currentRun
Definition: RunManagerMTWorker.cc:124
SiStripMonitorCluster_cfi.zmax
zmax
Definition: SiStripMonitorCluster_cfi.py:201
g4SimHits_cfi.CustomUIsession
CustomUIsession
Definition: g4SimHits_cfi.py:121
RunManagerMTWorker::TLSData::currentEvent
std::unique_ptr< G4Event > currentEvent
Definition: RunManagerMTWorker.cc:125
pfDeepBoostedJetPreprocessParams_cfi.sv
sv
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:352
DDAxes::z
RunManagerMT::world
const DDDWorld & world() const
Definition: RunManagerMT.h:69
TrackingAction::m_endOfTrackSignal
SimActivityRegistry::EndOfTrackSignal m_endOfTrackSignal
Definition: TrackingAction.h:29
Generator::setGenEvent
void setGenEvent(const HepMC::GenEvent *inpevt)
Definition: Generator.h:24
CustomUIsessionToFile
Definition: CustomUIsessionToFile.h:19
edm::ConsumesCollector::consumes
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
Definition: ConsumesCollector.h:55
submitPVResolutionJobs.count
count
Definition: submitPVResolutionJobs.py:352
RunManagerMTWorker::DumpMagneticField
void DumpMagneticField(const G4Field *, const std::string &) const
Definition: RunManagerMTWorker.cc:624
G4SimEvent::nGenParts
unsigned int nGenParts() const
Definition: G4SimEvent.h:22
BeginOfJob
Definition: BeginOfJob.h:8
RunManagerMTWorker::m_pStackingAction
edm::ParameterSet m_pStackingAction
Definition: RunManagerMTWorker.h:107
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
PhysicsList
Definition: PhysicsList.h:7
HLTMuonOfflineAnalyzer_cfi.z0
z0
Definition: HLTMuonOfflineAnalyzer_cfi.py:98
dqmdumpme.k
k
Definition: dqmdumpme.py:60
Point3DBase< float, GlobalTag >
edm::EventID::run
RunNumber_t run() const
Definition: EventID.h:38
g4SimHits_cfi.EventAction
EventAction
Definition: g4SimHits_cfi.py:266
sim_act::Signaler::connect
void connect(Observer< const T * > *iObs)
does not take ownership of memory
Definition: Signaler.h:55
g4SimHits_cfi.TrackingAction
TrackingAction
Definition: g4SimHits_cfi.py:307
RunManagerMTWorker::initializeRun
void initializeRun()
Definition: RunManagerMTWorker.cc:455
RunManagerMTWorker::m_LHCToken
edm::EDGetTokenT< edm::HepMCProduct > m_LHCToken
Definition: RunManagerMTWorker.h:93
geometryDiff.file
file
Definition: geometryDiff.py:13
RunManagerMTWorker::generateEvent
G4Event * generateEvent(const edm::Event &inpevt)
Definition: RunManagerMTWorker.cc:584
RunManagerMTWorker::m_pSteppingAction
edm::ParameterSet m_pSteppingAction
Definition: RunManagerMTWorker.h:109
RunManagerMTWorker::terminateRun
void terminateRun()
Definition: RunManagerMTWorker.cc:465
RunManagerMTWorker::TLSData::kernel
std::unique_ptr< G4RunManagerKernel > kernel
Definition: RunManagerMTWorker.cc:112
edm::ParameterSet
Definition: ParameterSet.h:47
EgHLTOffHistBins_cfi.nr
nr
Definition: EgHLTOffHistBins_cfi.py:4
RunManagerMTWorker::m_pField
edm::ParameterSet m_pField
Definition: RunManagerMTWorker.h:104
DDDWorld::GetWorldVolume
G4VPhysicalVolume * GetWorldVolume() const
Definition: DDDWorld.h:24
RunManagerMTWorker::TLSData::runTerminated
bool runTerminated
Definition: RunManagerMTWorker.cc:128
GeV
const double GeV
Definition: MathUtil.h:16
groupFilesInBlocks.fout
fout
Definition: groupFilesInBlocks.py:162
RunManagerMTWorker::TLSData::runInterface
std::unique_ptr< SimRunInterface > runInterface
Definition: RunManagerMTWorker.cc:114
edm::EventID::event
EventNumber_t event() const
Definition: EventID.h:40
edm::Service
Definition: Service.h:30
createfilelist.int
int
Definition: createfilelist.py:10
RunManagerMT::G4Commands
const std::vector< std::string > & G4Commands() const
Definition: RunManagerMT.h:73
RunManagerMTWorker::m_nonBeam
bool m_nonBeam
Definition: RunManagerMTWorker.h:98
RunManagerMTWorker::TLSData::threadInitialized
bool threadInitialized
Definition: RunManagerMTWorker.cc:127
RunManagerMTWorker::m_sVerbose
std::unique_ptr< CMSSteppingVerbose > m_sVerbose
Definition: RunManagerMTWorker.h:118
RunManagerMTWorker::m_pMagField
const MagneticField * m_pMagField
Definition: RunManagerMTWorker.h:96
CastorDigiValidation.SteppingAction
SteppingAction
Definition: CastorDigiValidation.py:147
edm::HepMCProduct::GetEvent
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:37
createWatchers
static void createWatchers(const edm::ParameterSet &iP, SimActivityRegistry &iReg, std::vector< std::shared_ptr< SimWatcher >> &oWatchers, std::vector< std::shared_ptr< SimProducer >> &oProds)
Definition: GeometryProducer.cc:37
RunManagerMTWorker::resetGenParticleId
void resetGenParticleId(const edm::Event &inpevt)
Definition: RunManagerMTWorker.cc:616
G4SimEvent::collisionPoint
void collisionPoint(const math::XYZTLorentzVectorD &v)
Definition: G4SimEvent.h:27
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TrackingAction::m_beginOfTrackSignal
SimActivityRegistry::BeginOfTrackSignal m_beginOfTrackSignal
Definition: TrackingAction.h:28
edm::EventSetup::getData
bool getData(T &iHolder) const
Definition: EventSetup.h:127
alignCSCRings.r
r
Definition: alignCSCRings.py:93
RunAction::m_endOfRunSignal
SimActivityRegistry::EndOfRunSignal m_endOfRunSignal
Definition: RunAction.h:24
DDAxes::phi
edm::Event::streamID
StreamID streamID() const
Definition: Event.h:98
SteppingAction::m_g4StepSignal
SimActivityRegistry::G4StepSignal m_g4StepSignal
Definition: SteppingAction.h:39
RunManagerMT::physicsListForWorker
PhysicsList * physicsListForWorker() const
Definition: RunManagerMT.h:78
RunManagerMTWorker::m_MagField
edm::ESGetToken< MagneticField, IdealMagneticFieldRecord > m_MagField
Definition: RunManagerMTWorker.h:95
sim::attachSD
std::pair< std::vector< SensitiveTkDetector * >, std::vector< SensitiveCaloDetector * > > attachSD(const std::unordered_map< std::string, std::unique_ptr< SensitiveDetectorMakerBase >> &, const edm::EventSetup &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *, SimActivityRegistry &reg)
PVValHelper::dz
Definition: PVValidationHelpers.h:51
RunManagerMTWorker::m_InToken
edm::EDGetTokenT< edm::HepMCProduct > m_InToken
Definition: RunManagerMTWorker.h:92
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
edm::Transition::BeginRun
RunManagerMTWorker::TLSData::registry
std::unique_ptr< SimActivityRegistry > registry
Definition: RunManagerMTWorker.cc:115
sim::sensitiveDetectorMakers
std::unordered_map< std::string, std::unique_ptr< SensitiveDetectorMakerBase > > sensitiveDetectorMakers(edm::ParameterSet const &, edm::ConsumesCollector, std::vector< std::string > const &chosenMakers)
Definition: sensitiveDetectorMakers.cc:22
flavorHistoryFilter_cfi.dr
dr
Definition: flavorHistoryFilter_cfi.py:37
Exception
Definition: hltDiff.cc:245
applyOnce
static std::once_flag applyOnce
Definition: RunManagerMTWorker.cc:66
edm::EventBase::id
edm::EventID id() const
Definition: EventBase.h:59
G4SimEvent::weight
void weight(float w)
Definition: G4SimEvent.h:25
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
sd
double sd
Definition: CascadeWrapper.h:113
Generator::HepMC2G4
void HepMC2G4(const HepMC::GenEvent *g, G4Event *e)
Definition: Generator.cc:112
RunManagerMTWorker::TLSData::userRunAction
std::unique_ptr< RunAction > userRunAction
Definition: RunManagerMTWorker.cc:113
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
RunManagerMTWorker::TLSData::sensTkDets
std::vector< SensitiveTkDetector * > sensTkDets
Definition: RunManagerMTWorker.cc:117
RunManagerMTWorker::initializeTLS
void initializeTLS()
Definition: RunManagerMTWorker.cc:240
edm::HepMCProduct
Definition: HepMCProduct.h:21
RunManagerMTWorker::m_pTrackingAction
edm::ParameterSet m_pTrackingAction
Definition: RunManagerMTWorker.h:108
Generator::genEvent
virtual const HepMC::GenEvent * genEvent() const
Definition: Generator.h:30
RunManagerMTWorker::dumpMF
static thread_local bool dumpMF
Definition: RunManagerMTWorker.h:115
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
SiStripFineDelayHit_cfi.MagneticField
MagneticField
Definition: SiStripFineDelayHit_cfi.py:7
ecalTB2006H4_GenSimDigiReco_cfg.G4cout
G4cout
Definition: ecalTB2006H4_GenSimDigiReco_cfg.py:285
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
point
*vegas h *****************************************************used in the default bin number in original ***version of VEGAS is ***a higher bin number might help to derive a more precise ***grade subtle point
Definition: invegas.h:5
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
edm::Log
Definition: MessageLogger.h:70
edm::errors::Configuration
Definition: EDMException.h:36
RunManagerMTWorker::m_pUseMagneticField
bool m_pUseMagneticField
Definition: RunManagerMTWorker.h:99
edm::InputTag
Definition: InputTag.h:15
RunManagerMTWorker::TLSData::currentRunNumber
edm::RunNumber_t currentRunNumber
Definition: RunManagerMTWorker.cc:126
g
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e g
Definition: Activities.doc:4
RunManagerMTWorker::m_pRunAction
edm::ParameterSet m_pRunAction
Definition: RunManagerMTWorker.h:105
sim::FieldBuilder
Definition: FieldBuilder.h:15