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 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 &&i)
 
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
 
bool m_nonBeam
 
edm::ParameterSet m_p
 
edm::ParameterSet m_pCustomUIsession
 
edm::ParameterSet m_pEventAction
 
edm::ParameterSet m_pField
 
edm::ParameterSet m_pRunAction
 
edm::ParameterSet m_pStackingAction
 
edm::ParameterSet m_pSteppingAction
 
edm::ParameterSet m_pTrackingAction
 
bool m_pUseMagneticField
 
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 41 of file RunManagerMTWorker.h.

Constructor & Destructor Documentation

◆ RunManagerMTWorker()

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

Definition at line 148 of file RunManagerMTWorker.cc.

149  : m_generator(iConfig.getParameter<edm::ParameterSet>("Generator")),
150  m_InToken(iC.consumes<edm::HepMCProduct>(
151  iConfig.getParameter<edm::ParameterSet>("Generator").getParameter<edm::InputTag>("HepMCProductLabel"))),
153  iC.consumes<edm::LHCTransportLinkContainer>(iConfig.getParameter<edm::InputTag>("theLHCTlinkTag"))),
154  m_nonBeam(iConfig.getParameter<bool>("NonBeamEvent")),
155  m_pUseMagneticField(iConfig.getParameter<bool>("UseMagneticField")),
156  m_LHCTransport(iConfig.getParameter<bool>("LHCTransport")),
157  m_EvtMgrVerbosity(iConfig.getUntrackedParameter<int>("G4EventManagerVerbosity", 0)),
158  m_pField(iConfig.getParameter<edm::ParameterSet>("MagneticField")),
159  m_pRunAction(iConfig.getParameter<edm::ParameterSet>("RunAction")),
160  m_pEventAction(iConfig.getParameter<edm::ParameterSet>("EventAction")),
161  m_pStackingAction(iConfig.getParameter<edm::ParameterSet>("StackingAction")),
162  m_pTrackingAction(iConfig.getParameter<edm::ParameterSet>("TrackingAction")),
163  m_pSteppingAction(iConfig.getParameter<edm::ParameterSet>("SteppingAction")),
164  m_pCustomUIsession(iConfig.getUntrackedParameter<edm::ParameterSet>("CustomUIsession")),
165  m_p(iConfig),
166  m_simEvent(nullptr),
167  m_sVerbose(nullptr) {
168  std::vector<edm::ParameterSet> watchers = iConfig.getParameter<std::vector<edm::ParameterSet> >("Watchers");
169  m_hasWatchers = !watchers.empty();
170  initializeTLS();
171  int thisID = getThreadIndex();
172  if (m_LHCTransport) {
173  m_LHCToken = iC.consumes<edm::HepMCProduct>(edm::InputTag("LHCTransport"));
174  }
175  edm::LogVerbatim("SimG4CoreApplication") << "RunManagerMTWorker is constructed for the thread " << thisID;
176 }

References edm::ParameterSet::getParameter(), initializeTLS(), HLT_FULL_cff::InputTag, m_hasWatchers, m_LHCToken, and m_LHCTransport.

◆ ~RunManagerMTWorker()

RunManagerMTWorker::~RunManagerMTWorker ( )

Definition at line 178 of file RunManagerMTWorker.cc.

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

References resetTLS(), and alignCSCRings::s.

Member Function Documentation

◆ abortEvent()

void RunManagerMTWorker::abortEvent ( )

Definition at line 553 of file RunManagerMTWorker.cc.

553  {
554  if (m_tls->runTerminated) {
555  return;
556  }
557  G4Track* t = m_tls->kernel->GetEventManager()->GetTrackingManager()->GetTrack();
558  t->SetTrackStatus(fStopAndKill);
559 
560  // CMS-specific act
561  //
562  TrackingAction* uta = static_cast<TrackingAction*>(m_tls->kernel->GetEventManager()->GetUserTrackingAction());
564 
565  m_tls->currentEvent->SetEventAborted();
566  m_tls->kernel->GetEventManager()->GetStackManager()->clear();
567  m_tls->kernel->GetEventManager()->GetTrackingManager()->EventAborted();
568 }

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 570 of file RunManagerMTWorker.cc.

570  {
571  if (!softAbort) {
572  abortEvent();
573  }
574  m_tls->currentRun = nullptr;
575  terminateRun();
576 }

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

Referenced by SimRunInterface::abortRun().

◆ Connect() [1/4]

void RunManagerMTWorker::Connect ( EventAction eventAction)

Definition at line 413 of file RunManagerMTWorker.cc.

413  {
414  eventAction->m_beginOfEventSignal.connect(m_tls->registry->beginOfEventSignal_);
415  eventAction->m_endOfEventSignal.connect(m_tls->registry->endOfEventSignal_);
416 }

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 423 of file RunManagerMTWorker.cc.

423  {
424  steppingAction->m_g4StepSignal.connect(m_tls->registry->g4StepSignal_);
425 }

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 418 of file RunManagerMTWorker.cc.

418  {
419  trackingAction->m_beginOfTrackSignal.connect(m_tls->registry->beginOfTrackSignal_);
420  trackingAction->m_endOfTrackSignal.connect(m_tls->registry->endOfTrackSignal_);
421 }

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 618 of file RunManagerMTWorker.cc.

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

References funct::cos(), flavorHistoryFilter_cfi::dr, PVValHelper::dz, FrontierConditions_GlobalTag_cff::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 220 of file RunManagerMTWorker.cc.

220  {
221  int thisID = getThreadIndex();
222  edm::LogVerbatim("SimG4CoreApplication") << "RunManagerMTWorker::endRun for the thread " << thisID;
223  terminateRun();
224 }

References terminateRun().

◆ generateEvent()

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

Definition at line 578 of file RunManagerMTWorker.cc.

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

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 427 of file RunManagerMTWorker.cc.

427  {
428  initializeTLS();
429  return m_tls->trackManager.get();
430 }

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 251 of file RunManagerMTWorker.cc.

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

References applyOnce, RunManagerMT::catalog(), mps_check::command, edm::errors::Configuration, AttachSD::create(), g4SimHits_cfi::CustomUIsession, DumpMagneticField(), dumpMF, Exception, g, RunManagerMT::G4Commands(), ecalTB2006H4_GenSimDigiReco_cfg::G4cout, edm::EventSetup::get(), get, edm::ParameterSet::getUntrackedParameter(), DDDWorld::GetWorldVolume(), GeV, initializeTLS(), initializeUserActions(), RunManagerMTWorker::TLSData::kernel, m_p, m_pCustomUIsession, m_pField, m_pUseMagneticField, m_sVerbose, m_tls, RunManagerMT::physicsListForWorker(), edm::ESHandle< T >::product(), 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 444 of file RunManagerMTWorker.cc.

444  {
445  int thisID = getThreadIndex();
446  edm::LogVerbatim("SimG4CoreApplication") << "RunManagerMTWorker::initializeRun " << thisID << " is started";
447  m_tls->currentRun = new G4Run();
448  G4StateManager::GetStateManager()->SetNewState(G4State_GeomClosed);
449  if (m_tls->userRunAction) {
450  m_tls->userRunAction->BeginOfRunAction(m_tls->currentRun);
451  }
452 }

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

Referenced by produce().

◆ initializeTLS()

void RunManagerMTWorker::initializeTLS ( )
private

Definition at line 226 of file RunManagerMTWorker.cc.

226  {
227  if (m_tls) {
228  return;
229  }
230 
231  m_tls = new TLSData();
232  m_tls->registry = std::make_unique<SimActivityRegistry>();
233 
234  edm::Service<SimActivityRegistry> otherRegistry;
235  //Look for an outside SimActivityRegistry
236  // this is used by the visualization code
237  int thisID = getThreadIndex();
238  if (otherRegistry) {
239  m_tls->registry->connect(*otherRegistry);
240  if (thisID > 0) {
242  << "SimActivityRegistry service (i.e. visualization) is not supported for more than 1 thread. "
243  << " \n If this use case is needed, RunManagerMTWorker has to be updated.";
244  }
245  }
246  if (m_hasWatchers) {
248  }
249 }

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 382 of file RunManagerMTWorker.cc.

382  {
383  m_tls->runInterface = std::make_unique<SimRunInterface>(this, false);
384  m_tls->userRunAction = std::make_unique<RunAction>(m_pRunAction, m_tls->runInterface.get(), false);
385  m_tls->userRunAction->SetMaster(false);
386  Connect(m_tls->userRunAction.get());
387 
388  G4EventManager* eventManager = m_tls->kernel->GetEventManager();
389  eventManager->SetVerboseLevel(m_EvtMgrVerbosity);
390 
391  EventAction* userEventAction =
393  Connect(userEventAction);
394  eventManager->SetUserAction(userEventAction);
395 
396  TrackingAction* userTrackingAction = new TrackingAction(userEventAction, m_pTrackingAction, m_sVerbose.get());
397  Connect(userTrackingAction);
398  eventManager->SetUserAction(userTrackingAction);
399 
400  SteppingAction* userSteppingAction =
401  new SteppingAction(userEventAction, m_pSteppingAction, m_sVerbose.get(), m_hasWatchers);
402  Connect(userSteppingAction);
403  eventManager->SetUserAction(userSteppingAction);
404 
405  eventManager->SetUserAction(new StackingAction(userTrackingAction, m_pStackingAction, m_sVerbose.get()));
406 }

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 475 of file RunManagerMTWorker.cc.

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

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 439 of file RunManagerMTWorker.cc.

439  {
440  initializeTLS();
441  return m_tls->producers;
442 }

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

◆ resetGenParticleId()

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

Definition at line 610 of file RunManagerMTWorker.cc.

610  {
612  inpevt.getByToken(m_theLHCTlinkToken, theLHCTlink);
613  if (theLHCTlink.isValid()) {
614  m_tls->trackManager->setLHCTransportLink(theLHCTlink.product());
615  }
616 }

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 193 of file RunManagerMTWorker.cc.

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

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

Referenced by ~RunManagerMTWorker().

◆ sensCaloDetectors()

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

Definition at line 435 of file RunManagerMTWorker.cc.

435  {
436  initializeTLS();
437  return m_tls->sensCaloDets;
438 }

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

◆ sensTkDetectors()

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

Definition at line 431 of file RunManagerMTWorker.cc.

431  {
432  initializeTLS();
433  return m_tls->sensTkDets;
434 }

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

◆ simEvent()

G4SimEvent* RunManagerMTWorker::simEvent ( )
inline

Definition at line 55 of file RunManagerMTWorker.h.

55 { return m_simEvent; }

References m_simEvent.

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

◆ terminateRun()

void RunManagerMTWorker::terminateRun ( )
private

Definition at line 454 of file RunManagerMTWorker.cc.

454  {
455  edm::LogVerbatim("SimG4CoreApplication") << "RunManagerMTWorker::terminateRun ";
456  if (!m_tls || m_tls->runTerminated) {
457  return;
458  }
459  int thisID = getThreadIndex();
460  edm::LogVerbatim("SimG4CoreApplication") << "RunManagerMTWorker::terminateRun " << thisID << " is started";
461  if (m_tls->userRunAction) {
462  m_tls->userRunAction->EndOfRunAction(m_tls->currentRun);
463  m_tls->userRunAction.reset();
464  }
465  m_tls->currentEvent.reset();
466  m_simEvent = nullptr;
467 
468  if (m_tls->kernel) {
469  m_tls->kernel->RunTermination();
470  }
471 
472  m_tls->runTerminated = true;
473 }

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 105 of file RunManagerMTWorker.h.

Referenced by initializeG4().

◆ m_EvtMgrVerbosity

int RunManagerMTWorker::m_EvtMgrVerbosity
private

Definition at line 92 of file RunManagerMTWorker.h.

Referenced by initializeUserActions().

◆ m_generator

Generator RunManagerMTWorker::m_generator
private

Definition at line 83 of file RunManagerMTWorker.h.

Referenced by generateEvent(), and produce().

◆ m_hasWatchers

bool RunManagerMTWorker::m_hasWatchers
private

Definition at line 90 of file RunManagerMTWorker.h.

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

◆ m_InToken

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

Definition at line 84 of file RunManagerMTWorker.h.

Referenced by generateEvent().

◆ m_LHCToken

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

Definition at line 85 of file RunManagerMTWorker.h.

Referenced by generateEvent(), and RunManagerMTWorker().

◆ m_LHCTransport

bool RunManagerMTWorker::m_LHCTransport
private

Definition at line 91 of file RunManagerMTWorker.h.

Referenced by generateEvent(), and RunManagerMTWorker().

◆ m_nonBeam

bool RunManagerMTWorker::m_nonBeam
private

Definition at line 88 of file RunManagerMTWorker.h.

Referenced by generateEvent().

◆ m_p

edm::ParameterSet RunManagerMTWorker::m_p
private

Definition at line 101 of file RunManagerMTWorker.h.

Referenced by initializeG4(), and initializeTLS().

◆ m_pCustomUIsession

edm::ParameterSet RunManagerMTWorker::m_pCustomUIsession
private

Definition at line 100 of file RunManagerMTWorker.h.

Referenced by initializeG4().

◆ m_pEventAction

edm::ParameterSet RunManagerMTWorker::m_pEventAction
private

Definition at line 96 of file RunManagerMTWorker.h.

Referenced by initializeUserActions().

◆ m_pField

edm::ParameterSet RunManagerMTWorker::m_pField
private

Definition at line 94 of file RunManagerMTWorker.h.

Referenced by initializeG4().

◆ m_pRunAction

edm::ParameterSet RunManagerMTWorker::m_pRunAction
private

Definition at line 95 of file RunManagerMTWorker.h.

Referenced by initializeUserActions().

◆ m_pStackingAction

edm::ParameterSet RunManagerMTWorker::m_pStackingAction
private

Definition at line 97 of file RunManagerMTWorker.h.

Referenced by initializeUserActions().

◆ m_pSteppingAction

edm::ParameterSet RunManagerMTWorker::m_pSteppingAction
private

Definition at line 99 of file RunManagerMTWorker.h.

Referenced by initializeUserActions().

◆ m_pTrackingAction

edm::ParameterSet RunManagerMTWorker::m_pTrackingAction
private

Definition at line 98 of file RunManagerMTWorker.h.

Referenced by initializeUserActions().

◆ m_pUseMagneticField

bool RunManagerMTWorker::m_pUseMagneticField
private

Definition at line 89 of file RunManagerMTWorker.h.

Referenced by initializeG4().

◆ m_simEvent

G4SimEvent* RunManagerMTWorker::m_simEvent
private

Definition at line 107 of file RunManagerMTWorker.h.

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

◆ m_sVerbose

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

Definition at line 108 of file RunManagerMTWorker.h.

Referenced by initializeG4(), and initializeUserActions().

◆ m_theLHCTlinkToken

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

Definition at line 86 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:86
RunManagerMTWorker::m_tls
static thread_local TLSData * m_tls
Definition: RunManagerMTWorker.h:103
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
RunManagerMTWorker::initializeG4
void initializeG4(RunManagerMT *runManagerMaster, const edm::EventSetup &es)
Definition: RunManagerMTWorker.cc:251
RunManagerMTWorker::TLSData::trackManager
std::unique_ptr< SimTrackManager > trackManager
Definition: RunManagerMTWorker.cc:122
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:107
CustomUIsessionThreadPrefix
Definition: CustomUIsessionThreadPrefix.h:13
edm::Handle::product
T const * product() const
Definition: Handle.h:70
RunManagerMTWorker::TLSData::producers
std::vector< std::shared_ptr< SimProducer > > producers
Definition: RunManagerMTWorker.cc:126
ExceptionHandler
Definition: ExceptionHandler.h:19
EventAction::m_beginOfEventSignal
SimActivityRegistry::BeginOfEventSignal m_beginOfEventSignal
Definition: EventAction.h:46
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:125
RunManagerMTWorker::resetTLS
static void resetTLS()
Definition: RunManagerMTWorker.cc:193
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:89285
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:83
RunManagerMTWorker::abortEvent
void abortEvent()
Definition: RunManagerMTWorker.cc:553
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
RunManagerMTWorker::m_LHCTransport
bool m_LHCTransport
Definition: RunManagerMTWorker.h:91
SteppingAction
Definition: SteppingAction.h:31
RunManagerMTWorker::simEvent
G4SimEvent * simEvent()
Definition: RunManagerMTWorker.h:55
RunManagerMTWorker::m_pEventAction
edm::ParameterSet m_pEventAction
Definition: RunManagerMTWorker.h:96
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
RunManagerMTWorker::Connect
void Connect(RunAction *)
Definition: RunManagerMTWorker.cc:408
AttachSD::create
std::pair< std::vector< SensitiveTkDetector * >, std::vector< SensitiveCaloDetector * > > create(const edm::EventSetup &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *, SimActivityRegistry &reg) const
Definition: AttachSD.cc:15
RunManagerMTWorker::m_EvtMgrVerbosity
int m_EvtMgrVerbosity
Definition: RunManagerMTWorker.h:92
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:100
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:124
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
RunManagerMT::catalog
const SensitiveDetectorCatalog & catalog() const
Definition: RunManagerMT.h:77
TrackingAction
Definition: TrackingAction.h:16
RunManagerMTWorker::m_p
edm::ParameterSet m_p
Definition: RunManagerMTWorker.h:101
alignCSCRings.s
s
Definition: alignCSCRings.py:92
RunManagerMTWorker::initializeUserActions
void initializeUserActions()
Definition: RunManagerMTWorker.cc:382
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
RunManagerMTWorker::m_hasWatchers
bool m_hasWatchers
Definition: RunManagerMTWorker.h:90
edm::EventSetup::get
T get() const
Definition: EventSetup.h:87
RunManagerMTWorker::TLSData::currentRun
G4Run * currentRun
Definition: RunManagerMTWorker.cc:130
SiStripMonitorCluster_cfi.zmax
zmax
Definition: SiStripMonitorCluster_cfi.py:201
g4SimHits_cfi.CustomUIsession
CustomUIsession
Definition: g4SimHits_cfi.py:112
RunManagerMTWorker::TLSData::currentEvent
std::unique_ptr< G4Event > currentEvent
Definition: RunManagerMTWorker.cc:131
pfDeepBoostedJetPreprocessParams_cfi.sv
sv
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:352
DDAxes::z
RunManagerMT::world
const DDDWorld & world() const
Definition: RunManagerMT.h:75
edm::ESHandle< MagneticField >
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
submitPVResolutionJobs.count
count
Definition: submitPVResolutionJobs.py:352
RunManagerMTWorker::DumpMagneticField
void DumpMagneticField(const G4Field *, const std::string &) const
Definition: RunManagerMTWorker.cc:618
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:97
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:535
PhysicsList
Definition: PhysicsList.h:7
HLTMuonOfflineAnalyzer_cfi.z0
z0
Definition: HLTMuonOfflineAnalyzer_cfi.py:98
Point3DBase< float, GlobalTag >
edm::EventID::run
RunNumber_t run() const
Definition: EventID.h:38
g4SimHits_cfi.EventAction
EventAction
Definition: g4SimHits_cfi.py:258
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:299
RunManagerMTWorker::initializeRun
void initializeRun()
Definition: RunManagerMTWorker.cc:444
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
RunManagerMTWorker::m_LHCToken
edm::EDGetTokenT< edm::HepMCProduct > m_LHCToken
Definition: RunManagerMTWorker.h:85
RunManagerMTWorker::generateEvent
G4Event * generateEvent(const edm::Event &inpevt)
Definition: RunManagerMTWorker.cc:578
RunManagerMTWorker::m_pSteppingAction
edm::ParameterSet m_pSteppingAction
Definition: RunManagerMTWorker.h:99
RunManagerMTWorker::terminateRun
void terminateRun()
Definition: RunManagerMTWorker.cc:454
RunManagerMTWorker::TLSData::kernel
std::unique_ptr< G4RunManagerKernel > kernel
Definition: RunManagerMTWorker.cc:118
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:94
DDDWorld::GetWorldVolume
G4VPhysicalVolume * GetWorldVolume() const
Definition: DDDWorld.h:24
RunManagerMTWorker::TLSData::runTerminated
bool runTerminated
Definition: RunManagerMTWorker.cc:134
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:120
edm::EventID::event
EventNumber_t event() const
Definition: EventID.h:40
edm::Service
Definition: Service.h:30
createfilelist.int
int
Definition: createfilelist.py:10
FrontierConditions_GlobalTag_cff.file
file
Definition: FrontierConditions_GlobalTag_cff.py:13
RunManagerMT::G4Commands
const std::vector< std::string > & G4Commands() const
Definition: RunManagerMT.h:79
RunManagerMTWorker::m_nonBeam
bool m_nonBeam
Definition: RunManagerMTWorker.h:88
RunManagerMTWorker::TLSData::threadInitialized
bool threadInitialized
Definition: RunManagerMTWorker.cc:133
RunManagerMTWorker::m_sVerbose
std::unique_ptr< CMSSteppingVerbose > m_sVerbose
Definition: RunManagerMTWorker.h:108
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:34
get
#define get
RunManagerMTWorker::resetGenParticleId
void resetGenParticleId(const edm::Event &inpevt)
Definition: RunManagerMTWorker.cc:610
G4SimEvent::collisionPoint
void collisionPoint(const math::XYZTLorentzVectorD &v)
Definition: G4SimEvent.h:27
TrackingAction::m_beginOfTrackSignal
SimActivityRegistry::BeginOfTrackSignal m_beginOfTrackSignal
Definition: TrackingAction.h:28
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:38
RunManagerMT::physicsListForWorker
PhysicsList * physicsListForWorker() const
Definition: RunManagerMT.h:84
PVValHelper::dz
Definition: PVValidationHelpers.h:51
RunManagerMTWorker::m_InToken
edm::EDGetTokenT< edm::HepMCProduct > m_InToken
Definition: RunManagerMTWorker.h:84
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
RunManagerMTWorker::TLSData::registry
std::unique_ptr< SimActivityRegistry > registry
Definition: RunManagerMTWorker.cc:121
flavorHistoryFilter_cfi.dr
dr
Definition: flavorHistoryFilter_cfi.py:37
Exception
Definition: hltDiff.cc:245
applyOnce
static std::once_flag applyOnce
Definition: RunManagerMTWorker.cc:72
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:119
AttachSD
Definition: AttachSD.h:17
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
RunManagerMTWorker::TLSData::sensTkDets
std::vector< SensitiveTkDetector * > sensTkDets
Definition: RunManagerMTWorker.cc:123
RunManagerMTWorker::initializeTLS
void initializeTLS()
Definition: RunManagerMTWorker.cc:226
edm::HepMCProduct
Definition: HepMCProduct.h:21
RunManagerMTWorker::m_pTrackingAction
edm::ParameterSet m_pTrackingAction
Definition: RunManagerMTWorker.h:98
Generator::genEvent
virtual const HepMC::GenEvent * genEvent() const
Definition: Generator.h:30
RunManagerMTWorker::dumpMF
static thread_local bool dumpMF
Definition: RunManagerMTWorker.h:105
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
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::errors::Configuration
Definition: EDMException.h:36
RunManagerMTWorker::m_pUseMagneticField
bool m_pUseMagneticField
Definition: RunManagerMTWorker.h:89
edm::InputTag
Definition: InputTag.h:15
RunManagerMTWorker::TLSData::currentRunNumber
edm::RunNumber_t currentRunNumber
Definition: RunManagerMTWorker.cc:132
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:95
sim::FieldBuilder
Definition: FieldBuilder.h:15