CMS 3D CMS Logo

RunManager.cc
Go to the documentation of this file.
12 
15 
17 
26 
29 
36 
39 
48 
52 
55 
56 #include "HepPDT/ParticleDataTable.hh"
58 
59 #include "G4GeometryManager.hh"
60 #include "G4StateManager.hh"
61 #include "G4ApplicationState.hh"
62 #include "G4RunManagerKernel.hh"
63 #include "G4UImanager.hh"
64 
65 #include "G4EventManager.hh"
66 #include "G4Run.hh"
67 #include "G4Event.hh"
68 #include "G4TransportationManager.hh"
69 #include "G4ParticleTable.hh"
70 #include "G4Field.hh"
71 #include "G4FieldManager.hh"
72 
73 #include "G4LogicalVolume.hh"
74 #include "G4LogicalVolumeStore.hh"
75 #include "G4PhysicalVolumeStore.hh"
76 #include "G4Region.hh"
77 #include "G4RegionStore.hh"
78 
79 #include "G4GDMLParser.hh"
80 #include "G4SystemOfUnits.hh"
81 
82 #include <iostream>
83 #include <memory>
84 
85 #include <fstream>
86 #include <memory>
87 #include <sstream>
88 
90 
91 static void createWatchers(const edm::ParameterSet& iP,
92  SimActivityRegistry& iReg,
93  std::vector<std::shared_ptr<SimWatcher> >& oWatchers,
94  std::vector<std::shared_ptr<SimProducer> >& oProds) {
95  using namespace std;
96  using namespace edm;
97 
98  vector<ParameterSet> watchers = iP.getParameter<vector<ParameterSet> >("Watchers");
99 
100  for (vector<ParameterSet>::iterator itWatcher = watchers.begin(); itWatcher != watchers.end(); ++itWatcher) {
101  std::shared_ptr<SimWatcherMakerBase> maker(
102  SimWatcherFactory::get()->create(itWatcher->getParameter<std::string>("type")));
103  if (maker.get() == nullptr) {
104  throw edm::Exception(edm::errors::Configuration) << "Unable to find the requested Watcher";
105  }
106 
107  std::shared_ptr<SimWatcher> watcherTemp;
108  std::shared_ptr<SimProducer> producerTemp;
109  maker->make(*itWatcher, iReg, watcherTemp, producerTemp);
110  oWatchers.push_back(watcherTemp);
111  if (producerTemp) {
112  oProds.push_back(producerTemp);
113  }
114  }
115 }
116 
118  : m_generator(new Generator(p.getParameter<edm::ParameterSet>("Generator"))),
119  m_HepMC(iC.consumes<edm::HepMCProduct>(
120  p.getParameter<edm::ParameterSet>("Generator").getParameter<edm::InputTag>("HepMCProductLabel"))),
121  m_LHCtr(iC.consumes<edm::LHCTransportLinkContainer>(p.getParameter<edm::InputTag>("theLHCTlinkTag"))),
122  m_nonBeam(p.getParameter<bool>("NonBeamEvent")),
123  m_primaryTransformer(nullptr),
124  m_managerInitialized(false),
125  m_runInitialized(false),
126  m_runTerminated(false),
127  m_runAborted(false),
128  firstRun(true),
129  m_pUseMagneticField(p.getParameter<bool>("UseMagneticField")),
130  m_currentRun(nullptr),
131  m_currentEvent(nullptr),
132  m_simEvent(nullptr),
133  m_PhysicsTablesDir(p.getUntrackedParameter<std::string>("PhysicsTablesDirectory", "")),
134  m_StorePhysicsTables(p.getUntrackedParameter<bool>("StorePhysicsTables", false)),
135  m_RestorePhysicsTables(p.getUntrackedParameter<bool>("RestorePhysicsTables", false)),
136  m_UseParametrisedEMPhysics(p.getUntrackedParameter<bool>("UseParametrisedEMPhysics")),
137  m_EvtMgrVerbosity(p.getUntrackedParameter<int>("G4EventManagerVerbosity", 0)),
138  m_pField(p.getParameter<edm::ParameterSet>("MagneticField")),
139  m_pGenerator(p.getParameter<edm::ParameterSet>("Generator")),
140  m_pPhysics(p.getParameter<edm::ParameterSet>("Physics")),
141  m_pRunAction(p.getParameter<edm::ParameterSet>("RunAction")),
142  m_pEventAction(p.getParameter<edm::ParameterSet>("EventAction")),
143  m_pStackingAction(p.getParameter<edm::ParameterSet>("StackingAction")),
144  m_pTrackingAction(p.getParameter<edm::ParameterSet>("TrackingAction")),
145  m_pSteppingAction(p.getParameter<edm::ParameterSet>("SteppingAction")),
146  m_g4overlap(p.getUntrackedParameter<edm::ParameterSet>("G4CheckOverlap")),
147  m_G4Commands(p.getParameter<std::vector<std::string> >("G4Commands")),
148  m_p(p) {
150  m_kernel = new G4RunManagerKernel();
151  G4StateManager::GetStateManager()->SetExceptionHandler(new ExceptionHandler());
152 
153  m_physicsList.reset(nullptr);
154 
155  m_check = p.getUntrackedParameter<bool>("CheckGeometry", false);
156  m_WriteFile = p.getUntrackedParameter<std::string>("FileNameGDML", "");
157  m_FieldFile = p.getUntrackedParameter<std::string>("FileNameField", "");
158  m_RegionFile = p.getUntrackedParameter<std::string>("FileNameRegions", "");
159 
160  m_userRunAction = nullptr;
161  m_runInterface = nullptr;
162 
163  //Look for an outside SimActivityRegistry
164  // this is used by the visualization code
165  edm::Service<SimActivityRegistry> otherRegistry;
166  if (otherRegistry) {
167  m_registry.connect(*otherRegistry);
168  }
169  m_sVerbose.reset(nullptr);
170 
171  std::vector<edm::ParameterSet> watchers = p.getParameter<std::vector<edm::ParameterSet> >("Watchers");
172  m_hasWatchers = (watchers.empty()) ? false : true;
173 
174  if (m_hasWatchers) {
176  }
177 }
178 
180  if (!m_runTerminated) {
181  terminateRun();
182  }
183  G4StateManager::GetStateManager()->SetNewState(G4State_Quit);
184  G4GeometryManager::GetInstance()->OpenGeometry();
185  // if (m_kernel!=0) delete m_kernel;
186  delete m_runInterface;
187  delete m_generator;
188 }
189 
191  bool geomChanged = idealGeomRcdWatcher_.check(es);
192  if (geomChanged && (!firstRun)) {
193  throw cms::Exception("BadConfig") << "[SimG4Core RunManager]\n"
194  << "The Geometry configuration is changed during the job execution\n"
195  << "this is not allowed, the geometry must stay unchanged\n";
196  }
197  bool geoFromDD4hep = m_p.getParameter<bool>("g4GeometryDD4hepSource");
198  bool cuts = m_pPhysics.getParameter<bool>("CutsPerRegion");
199  bool protonCut = m_pPhysics.getParameter<bool>("CutsOnProton");
200  int verb = std::max(m_pPhysics.getUntrackedParameter<int>("Verbosity", 0),
201  m_p.getUntrackedParameter<int>("SteppingVerbosity", 0));
202  edm::LogVerbatim("SimG4CoreApplication")
203  << "RunManager: start initialising of geometry DD4Hep: " << geoFromDD4hep << "\n"
204  << " cutsPerRegion: " << cuts << " cutForProton: " << protonCut << "\n"
205  << " G4 verbosity: " << verb;
206 
207  if (m_pUseMagneticField) {
208  bool magChanged = idealMagRcdWatcher_.check(es);
209  if (magChanged && (!firstRun)) {
211  << "[SimG4Core RunManager]\n"
212  << "The MagneticField configuration is changed during the job execution\n"
213  << "this is not allowed, the MagneticField must stay unchanged\n";
214  }
215  }
216 
218  return;
219 
220  // initialise geometry
221  const DDCompactView* pDD = nullptr;
222  const cms::DDCompactView* pDD4hep = nullptr;
223  if (geoFromDD4hep) {
225  es.get<IdealGeometryRecord>().get(ph);
226  pDD4hep = ph.product();
227  } else {
229  es.get<IdealGeometryRecord>().get(ph);
230  pDD = ph.product();
231  }
233  const DDDWorld* world = new DDDWorld(pDD, pDD4hep, catalog, verb, cuts, protonCut);
234  G4VPhysicalVolume* pworld = world->GetWorldVolume();
235 
236  const G4RegionStore* regStore = G4RegionStore::GetInstance();
237  const G4PhysicalVolumeStore* pvs = G4PhysicalVolumeStore::GetInstance();
238  const G4LogicalVolumeStore* lvs = G4LogicalVolumeStore::GetInstance();
239  unsigned int numPV = pvs->size();
240  unsigned int numLV = lvs->size();
241  unsigned int nn = regStore->size();
242  edm::LogVerbatim("SimG4CoreApplication")
243  << "###RunManager: " << numPV << " PhysVolumes; " << numLV << " LogVolumes; " << nn << " Regions.";
244 
245  m_kernel->DefineWorldVolume(pworld, true);
247 
248  if (m_pUseMagneticField) {
249  // setup the magnetic field
251  es.get<IdealMagneticFieldRecord>().get(pMF);
252  const GlobalPoint g(0., 0., 0.);
253 
254  sim::FieldBuilder fieldBuilder(pMF.product(), m_pField);
255  CMSFieldManager* fieldManager = new CMSFieldManager();
256  G4TransportationManager* tM = G4TransportationManager::GetTransportationManager();
257  tM->SetFieldManager(fieldManager);
258  fieldBuilder.build(fieldManager, tM->GetPropagatorInField());
259 
260  if (!m_FieldFile.empty()) {
261  DumpMagneticField(tM->GetFieldManager()->GetDetectorField());
262  }
263  }
264 
265  // we need the track manager now
266  m_trackManager = std::make_unique<SimTrackManager>();
267 
268  // attach sensitive detector
269  AttachSD attach;
270  auto sensDets = attach.create(es, catalog, m_p, m_trackManager.get(), m_registry);
271 
272  m_sensTkDets.swap(sensDets.first);
273  m_sensCaloDets.swap(sensDets.second);
274 
275  edm::LogVerbatim("SimG4CoreApplication")
276  << " RunManager: Sensitive Detector "
277  << "building finished; found " << m_sensTkDets.size() << " Tk type Producers, and " << m_sensCaloDets.size()
278  << " Calo type producers ";
279 
281  es.get<PDTRecord>().get(fTable);
282  const HepPDT::ParticleDataTable* fPDGTable = &(*fTable);
283 
285 
286  std::unique_ptr<PhysicsListMakerBase> physicsMaker(
288  if (physicsMaker.get() == nullptr) {
289  throw edm::Exception(edm::errors::Configuration) << "Unable to find the Physics list requested";
290  }
291  m_physicsList = physicsMaker->make(m_pPhysics, m_registry);
292 
293  PhysicsList* phys = m_physicsList.get();
294  if (phys == nullptr) {
295  throw edm::Exception(edm::errors::Configuration) << "Physics list construction failed!";
296  }
297 
298  // exotic particle physics
299  double monopoleMass = m_pPhysics.getUntrackedParameter<double>("MonopoleMass", 0.);
300  if (monopoleMass > 0.0) {
301  phys->RegisterPhysics(new CMSMonopolePhysics(fPDGTable, m_pPhysics));
302  }
303  bool exotica = m_pPhysics.getUntrackedParameter<bool>("ExoticaTransport", false);
304  if (exotica) {
305  CMSExoticaPhysics exo(phys, m_pPhysics);
306  }
307 
308  // adding GFlash, Russian Roulette for eletrons and gamma,
309  // step limiters on top of any Physics Lists
311  phys->RegisterPhysics(new ParametrisedEMPhysics("EMoptions", m_pPhysics));
312 
313  std::string tableDir = m_PhysicsTablesDir;
315  m_physicsList->SetPhysicsTableRetrieved(tableDir);
316  }
317  edm::LogInfo("SimG4CoreApplication") << "RunManager: start initialisation of PhysicsList";
318 
319  m_physicsList->SetDefaultCutValue(m_pPhysics.getParameter<double>("DefaultCutValue") * CLHEP::cm);
320  m_physicsList->SetCutsWithDefault();
321  m_kernel->SetPhysics(phys);
322  m_kernel->InitializePhysics();
323 
324  if (m_kernel->RunInitialization()) {
325  m_managerInitialized = true;
326  } else {
327  throw edm::Exception(edm::errors::LogicError) << "G4RunManagerKernel initialization failed!";
328  }
329 
330  if (m_StorePhysicsTables) {
331  std::ostringstream dir;
332  dir << tableDir << '\0';
333  std::string cmd = std::string("/control/shell mkdir -p ") + tableDir;
334  if (!std::ifstream(dir.str().c_str(), std::ios::in))
335  G4UImanager::GetUIpointer()->ApplyCommand(cmd);
336  m_physicsList->StorePhysicsTable(tableDir);
337  }
338 
339  //tell all interesting parties that we are beginning the job
340  BeginOfJob aBeginOfJob(&es);
341  m_registry.beginOfJobSignal_(&aBeginOfJob);
342 
343  G4int sv = m_p.getUntrackedParameter<int>("SteppingVerbosity", 0);
344  G4double elim = m_p.getUntrackedParameter<double>("StepVerboseThreshold", 0.1) * CLHEP::GeV;
345  std::vector<int> ve = m_p.getUntrackedParameter<std::vector<int> >("VerboseEvents");
346  std::vector<int> vn = m_p.getUntrackedParameter<std::vector<int> >("VertexNumber");
347  std::vector<int> vt = m_p.getUntrackedParameter<std::vector<int> >("VerboseTracks");
348 
349  if (sv > 0) {
350  m_sVerbose = std::make_unique<CMSSteppingVerbose>(sv, elim, ve, vn, vt);
351  }
353 
354  if (!m_G4Commands.empty()) {
355  G4cout << "RunManager: Requested UI commands: " << G4endl;
356  for (unsigned it = 0; it < m_G4Commands.size(); ++it) {
357  G4cout << " " << m_G4Commands[it] << G4endl;
358  G4UImanager::GetUIpointer()->ApplyCommand(m_G4Commands[it]);
359  }
360  }
361  G4StateManager::GetStateManager()->SetNewState(G4State_Init);
362 
363  if (!m_WriteFile.empty()) {
364  G4GDMLParser gdml;
365  gdml.SetRegionExport(true);
366  gdml.SetEnergyCutsExport(true);
367  gdml.Write(m_WriteFile, pworld, true);
368  }
369 
370  // G4Region dump file name
371  auto regionFile = m_p.getUntrackedParameter<std::string>("FileNameRegions", "");
372 
373  // Geometry checks
374  if (m_check || !regionFile.empty()) {
375  CMSG4CheckOverlap check(m_g4overlap, regionFile, m_UIsession, pworld);
376  }
377 
378  // If the Geant4 particle table is needed, decomment the lines below
379  //
380  // G4cout << "Output of G4ParticleTable DumpTable:" << G4endl;
381  // G4ParticleTable::GetParticleTable()->DumpTable("ALL");
382 
383  initializeRun();
384  firstRun = false;
385 }
386 
388  G4StateManager::GetStateManager()->SetNewState(G4State_Quit);
389  if (!m_runTerminated) {
390  terminateRun();
391  }
392 }
393 
395  m_currentEvent = generateEvent(inpevt);
396  m_simEvent = new G4SimEvent;
399  if (m_generator->genVertex() != nullptr) {
401  m_generator->genVertex()->y() / centimeter,
402  m_generator->genVertex()->z() / centimeter,
403  m_generator->genVertex()->t() / second));
404  }
405  if (m_currentEvent->GetNumberOfPrimaryVertex() == 0) {
406  std::stringstream ss;
407  ss << " RunManager::produce(): event " << inpevt.id().event() << " with no G4PrimaryVertices\n";
408  throw SimG4Exception(ss.str());
409 
410  abortRun(false);
411  } else {
412  edm::LogInfo("SimG4CoreApplication") << "RunManager::produce: start Event " << inpevt.id().event() << " of weight "
413  << m_simEvent->weight() << " with " << m_simEvent->nTracks() << " tracks and "
414  << m_simEvent->nVertices() << " vertices, generated by "
415  << m_simEvent->nGenParts() << " particles ";
416 
417  m_kernel->GetEventManager()->ProcessOneEvent(m_currentEvent);
418 
419  edm::LogInfo("SimG4CoreApplication") << " RunManager::produce: ended Event " << inpevt.id().event();
420  }
421 }
422 
424  if (m_currentEvent != nullptr) {
425  delete m_currentEvent;
426  }
427  m_currentEvent = nullptr;
428  if (m_simEvent != nullptr) {
429  delete m_simEvent;
430  }
431  m_simEvent = nullptr;
432 
433  // 64 bits event ID in CMSSW converted into Geant4 event ID
434  G4int evtid = (G4int)inpevt.id().event();
435  G4Event* evt = new G4Event(evtid);
436 
438 
439  inpevt.getByToken(m_HepMC, HepMCEvt);
440 
441  m_generator->setGenEvent(HepMCEvt->GetEvent());
442 
443  // required to reset the GenParticle Id for particles transported
444  // along the beam pipe
445  // to their original value for SimTrack creation
446  resetGenParticleId(inpevt);
447 
448  if (!m_nonBeam) {
449  m_generator->HepMC2G4(HepMCEvt->GetEvent(), evt);
450  } else {
451  m_generator->nonCentralEvent2G4(HepMCEvt->GetEvent(), evt);
452  }
453 
454  return evt;
455 }
456 
458  if (m_runTerminated) {
459  return;
460  }
461  G4Track* t = m_kernel->GetEventManager()->GetTrackingManager()->GetTrack();
462  t->SetTrackStatus(fStopAndKill);
463 
464  // CMS-specific act
465  //
466  TrackingAction* uta = (TrackingAction*)m_kernel->GetEventManager()->GetUserTrackingAction();
468 
469  m_currentEvent->SetEventAborted();
470  m_kernel->GetEventManager()->GetStackManager()->clear();
471  m_kernel->GetEventManager()->GetTrackingManager()->EventAborted();
472 
473  G4StateManager* stateManager = G4StateManager::GetStateManager();
474  stateManager->SetNewState(G4State_GeomClosed);
475 }
476 
478  m_runInterface = new SimRunInterface(this, false);
479 
482 
483  G4EventManager* eventManager = m_kernel->GetEventManager();
484  eventManager->SetVerboseLevel(m_EvtMgrVerbosity);
485 
486  if (m_generator != nullptr) {
487  EventAction* userEventAction =
489  Connect(userEventAction);
490  eventManager->SetUserAction(userEventAction);
491 
492  TrackingAction* userTrackingAction = new TrackingAction(userEventAction, m_pTrackingAction, m_sVerbose.get());
493  Connect(userTrackingAction);
494  eventManager->SetUserAction(userTrackingAction);
495 
496  SteppingAction* userSteppingAction =
497  new SteppingAction(userEventAction, m_pSteppingAction, m_sVerbose.get(), m_hasWatchers);
498  Connect(userSteppingAction);
499  eventManager->SetUserAction(userSteppingAction);
500 
501  eventManager->SetUserAction(new StackingAction(userTrackingAction, m_pStackingAction, m_sVerbose.get()));
502 
503  } else {
504  edm::LogWarning("SimG4CoreApplication") << " RunManager: WARNING : "
505  << "No generator; initialized "
506  << "only RunAction!";
507  }
508 }
509 
511  m_runInitialized = false;
512  if (m_currentRun == nullptr) {
513  m_currentRun = new G4Run();
514  }
515  G4StateManager::GetStateManager()->SetNewState(G4State_GeomClosed);
516  if (m_userRunAction != nullptr) {
518  }
519  m_runAborted = false;
520  m_runInitialized = true;
521 }
522 
524  if (m_runTerminated) {
525  return;
526  }
527  if (m_userRunAction != nullptr) {
529  delete m_userRunAction;
530  m_userRunAction = nullptr;
531  }
532  delete m_currentEvent;
533  m_currentEvent = nullptr;
534  delete m_simEvent;
535  m_simEvent = nullptr;
536  if (m_kernel != nullptr) {
537  m_kernel->RunTermination();
538  }
539  m_runInitialized = false;
540  m_runTerminated = true;
541 }
542 
543 void RunManager::abortRun(bool softAbort) {
544  if (m_runAborted) {
545  return;
546  }
547  if (!softAbort) {
548  abortEvent();
549  }
550  if (m_currentRun != nullptr) {
551  delete m_currentRun;
552  m_currentRun = nullptr;
553  }
554  terminateRun();
555  m_runAborted = true;
556 }
557 
560  inpevt.getByToken(m_LHCtr, theLHCTlink);
561  if (theLHCTlink.isValid()) {
562  m_trackManager->setLHCTransportLink(theLHCTlink.product());
563  }
564 }
565 
567 
568 void RunManager::Connect(RunAction* runAction) {
571 }
572 
573 void RunManager::Connect(EventAction* eventAction) {
576 }
577 
578 void RunManager::Connect(TrackingAction* trackingAction) {
581 }
582 
583 void RunManager::Connect(SteppingAction* steppingAction) {
585 }
586 
587 void RunManager::DumpMagneticField(const G4Field* field) const {
588  std::ofstream fout(m_FieldFile.c_str(), std::ios::out);
589  if (fout.fail()) {
590  edm::LogWarning("SimG4CoreApplication") << " RunManager WARNING : "
591  << "error opening file <" << m_FieldFile << "> for magnetic field";
592  } else {
593  double rmax = 9000 * mm;
594  double zmax = 16000 * mm;
595 
596  double dr = 5 * cm;
597  double dz = 20 * cm;
598 
599  int nr = (int)(rmax / dr);
600  int nz = 2 * (int)(zmax / dz);
601 
602  double r = 0.0;
603  double z0 = -zmax;
604  double z;
605 
606  double phi = 0.0;
607  double cosf = cos(phi);
608  double sinf = sin(phi);
609 
610  double point[4] = {0.0, 0.0, 0.0, 0.0};
611  double bfield[3] = {0.0, 0.0, 0.0};
612 
613  fout << std::setprecision(6);
614  for (int i = 0; i <= nr; ++i) {
615  z = z0;
616  for (int j = 0; j <= nz; ++j) {
617  point[0] = r * cosf;
618  point[1] = r * sinf;
619  point[2] = z;
620  field->GetFieldValue(point, bfield);
621  fout << "R(mm)= " << r / mm << " phi(deg)= " << phi / degree << " Z(mm)= " << z / mm
622  << " Bz(tesla)= " << bfield[2] / tesla << " Br(tesla)= " << (bfield[0] * cosf + bfield[1] * sinf) / tesla
623  << " Bphi(tesla)= " << (bfield[0] * sinf - bfield[1] * cosf) / tesla << G4endl;
624  z += dz;
625  }
626  r += dr;
627  }
628 
629  fout.close();
630  }
631 }
Generator::eventWeight
virtual const double eventWeight() const
Definition: Generator.h:32
FieldBuilder.h
G4SimEvent::hepEvent
void hepEvent(const HepMC::GenEvent *r)
Definition: G4SimEvent.h:23
edm::ESWatcher::check
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:52
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
dataset.firstRun
firstRun
Definition: dataset.py:940
mps_setup.cmd
list cmd
Definition: mps_setup.py:244
RunManager::m_g4overlap
edm::ParameterSet m_g4overlap
Definition: RunManager.h:128
RunManager::idealGeomRcdWatcher_
edm::ESWatcher< IdealGeometryRecord > idealGeomRcdWatcher_
Definition: RunManager.h:142
SimTrackManager
Definition: SimTrackManager.h:35
ParametrisedEMPhysics
Definition: ParametrisedEMPhysics.h:16
electrons_cff.bool
bool
Definition: electrons_cff.py:393
mps_fire.i
i
Definition: mps_fire.py:428
RunAction.h
TrackingAction.h
edm::LHCTransportLinkContainer
std::vector< LHCTransportLink > LHCTransportLinkContainer
Definition: LHCTransportLinkContainer.h:8
ESTransientHandle.h
MessageLogger.h
SteppingAction.h
EventAction
Definition: EventAction.h:23
G4SimEvent
Definition: G4SimEvent.h:14
RunManager::m_pEventAction
edm::ParameterSet m_pEventAction
Definition: RunManager.h:124
funct::false
false
Definition: Factorize.h:29
edm::ESTransientHandle::product
T const * product() const
Definition: ESTransientHandle.h:51
edm::Handle::product
T const * product() const
Definition: Handle.h:70
RunManager::m_sensCaloDets
std::vector< SensitiveCaloDetector * > m_sensCaloDets
Definition: RunManager.h:133
ExceptionHandler
Definition: ExceptionHandler.h:19
getEcalConditions_orcoffint2r_cff.catalog
catalog
Definition: getEcalConditions_orcoffint2r_cff.py:40
RunManager::m_sVerbose
std::unique_ptr< CMSSteppingVerbose > m_sVerbose
Definition: RunManager.h:135
G4SimEvent::nVertices
unsigned int nVertices() const
Definition: G4SimEvent.h:21
ESHandle.h
BeginOfJob.h
DDDWorld
Definition: DDDWorld.h:14
RunManager::m_primaryTransformer
PrimaryTransformer * m_primaryTransformer
Definition: RunManager.h:98
RunManager::m_pPhysics
edm::ParameterSet m_pPhysics
Definition: RunManager.h:122
EventAction::m_beginOfEventSignal
SimActivityRegistry::BeginOfEventSignal m_beginOfEventSignal
Definition: EventAction.h:43
RunManager::m_sensTkDets
std::vector< SensitiveTkDetector * > m_sensTkDets
Definition: RunManager.h:132
EventAction::m_endOfEventSignal
SimActivityRegistry::EndOfEventSignal m_endOfEventSignal
Definition: EventAction.h:44
runTauDisplay.evtid
evtid
Definition: runTauDisplay.py:293
RunManager::m_pSteppingAction
edm::ParameterSet m_pSteppingAction
Definition: RunManager.h:127
edm::errors::LogicError
Definition: EDMException.h:37
SimActivityRegistry::endOfEventSignal_
EndOfEventSignal endOfEventSignal_
Definition: SimActivityRegistry.h:84
RunManager::stopG4
void stopG4()
Definition: RunManager.cc:387
CMSFieldManager.h
edm
HLT enums.
Definition: AlignableModifier.h:19
RunManager::produce
void produce(edm::Event &inpevt, const edm::EventSetup &es)
Definition: RunManager.cc:394
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
TrackingAction::PostUserTrackingAction
void PostUserTrackingAction(const G4Track *aTrack) override
Definition: TrackingAction.cc:43
CMSExoticaPhysics
Definition: CMSExoticaPhysics.h:13
RunManager::m_UIsession
CustomUIsession * m_UIsession
Definition: RunManager.h:96
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
RunManager::m_UseParametrisedEMPhysics
bool m_UseParametrisedEMPhysics
Definition: RunManager.h:117
RunManager::m_runInterface
SimRunInterface * m_runInterface
Definition: RunManager.h:112
CMSFieldManager
Definition: CMSFieldManager.h:24
Generator::nonCentralEvent2G4
void nonCentralEvent2G4(const HepMC::GenEvent *g, G4Event *e)
Definition: Generator.cc:542
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
RunManager::m_managerInitialized
bool m_managerInitialized
Definition: RunManager.h:100
SimActivityRegistry::dddWorldSignal_
DDDWorldSignal dddWorldSignal_
Definition: SimActivityRegistry.h:54
EventAction.h
RunManager::initG4
void initG4(const edm::EventSetup &es)
Definition: RunManager.cc:190
SteppingAction
Definition: SteppingAction.h:31
CMSG4CheckOverlap.h
CurrentG4Track.h
RunManager::m_runAborted
bool m_runAborted
Definition: RunManager.h:103
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
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
edm::LogInfo
Log< level::Info, false > LogInfo
Definition: MessageLogger.h:125
RunManager::m_userRunAction
RunAction * m_userRunAction
Definition: RunManager.h:111
beamerCreator.create
def create(alignables, pedeDump, additionalData, outputFile, config)
Definition: beamerCreator.py:44
RunManager::m_currentEvent
G4Event * m_currentEvent
Definition: RunManager.h:109
CastorDigiValidation.StackingAction
StackingAction
Definition: CastorDigiValidation.py:136
SimActivityRegistry::g4StepSignal_
G4StepSignal g4StepSignal_
Definition: SimActivityRegistry.h:74
RunManager::m_runTerminated
bool m_runTerminated
Definition: RunManager.h:102
edm::Handle< edm::HepMCProduct >
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: RunManager.cc:91
RunAction::m_beginOfRunSignal
SimActivityRegistry::BeginOfRunSignal m_beginOfRunSignal
Definition: RunAction.h:23
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
DDCompactView.h
RunManager::m_pField
edm::ParameterSet m_pField
Definition: RunManager.h:120
RunManager::m_simEvent
G4SimEvent * m_simEvent
Definition: RunManager.h:110
RunManager::m_registry
SimActivityRegistry m_registry
Definition: RunManager.h:136
RunManager::m_physicsList
std::unique_ptr< PhysicsList > m_physicsList
Definition: RunManager.h:97
DDDWorld.h
funct::sin
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
RunManager::m_PhysicsTablesDir
std::string m_PhysicsTablesDir
Definition: RunManager.h:114
g4SimHits_cfi.RunAction
RunAction
list of unwanted particles (gluons and quarks)
Definition: g4SimHits_cfi.py:222
RunManager.h
EDMException.h
G4SimEvent::nTracks
unsigned int nTracks() const
Definition: G4SimEvent.h:20
contentValuesCheck.ss
ss
Definition: contentValuesCheck.py:33
IdealMagneticFieldRecord
Definition: IdealMagneticFieldRecord.h:11
TrackingAction
Definition: TrackingAction.h:16
PrimaryTransformer
Definition: PrimaryTransformer.h:6
RPCNoise_example.check
check
Definition: RPCNoise_example.py:71
RunManager::Connect
void Connect(RunAction *)
Definition: RunManager.cc:568
RunManager::m_RegionFile
std::string m_RegionFile
Definition: RunManager.h:147
PhysicsListFactory.h
funct::cos
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
edm::EventSetup::get
T get() const
Definition: EventSetup.h:80
Generator.h
RunManager::DumpMagneticField
void DumpMagneticField(const G4Field *) const
Definition: RunManager.cc:587
SiStripMonitorCluster_cfi.zmax
zmax
Definition: SiStripMonitorCluster_cfi.py:201
g4SimHits_cfi.CustomUIsession
CustomUIsession
Definition: g4SimHits_cfi.py:87
Service.h
RunManager::m_watchers
std::vector< std::shared_ptr< SimWatcher > > m_watchers
Definition: RunManager.h:137
RunManager::m_producers
std::vector< std::shared_ptr< SimProducer > > m_producers
Definition: RunManager.h:138
DDCompactView
Compact representation of the geometrical detector hierarchy.
Definition: DDCompactView.h:81
pfDeepBoostedJetPreprocessParams_cfi.sv
sv
Definition: pfDeepBoostedJetPreprocessParams_cfi.py:352
RunManager::resetGenParticleId
void resetGenParticleId(edm::Event &inpevt)
Definition: RunManager.cc:558
DDAxes::z
IdealMagneticFieldRecord.h
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
CustomUIsession.h
SensitiveDetectorCatalog
Definition: SensitiveDetectorCatalog.h:10
G4SimEvent::nGenParts
unsigned int nGenParts() const
Definition: G4SimEvent.h:22
BeginOfJob
Definition: BeginOfJob.h:8
edm::Event::getByToken
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:531
PhysicsList
Definition: PhysicsList.h:7
HLTMuonOfflineAnalyzer_cfi.z0
z0
Definition: HLTMuonOfflineAnalyzer_cfi.py:98
DDCompactView.h
RunManager::m_check
bool m_check
Definition: RunManager.h:119
Point3DBase< float, GlobalTag >
RunManager::m_p
edm::ParameterSet m_p
Definition: RunManager.h:130
RunManager::generateEvent
G4Event * generateEvent(edm::Event &inpevt)
Definition: RunManager.cc:423
RunManager::m_G4Commands
std::vector< std::string > m_G4Commands
Definition: RunManager.h:129
g4SimHits_cfi.EventAction
EventAction
Definition: g4SimHits_cfi.py:225
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:266
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
RunManager::m_StorePhysicsTables
bool m_StorePhysicsTables
Definition: RunManager.h:115
CMSG4CheckOverlap
Definition: CMSG4CheckOverlap.h:11
funct::true
true
Definition: Factorize.h:173
SimG4Exception.h
RunAction
Definition: RunAction.h:15
edm::ParameterSet
Definition: ParameterSet.h:47
EgHLTOffHistBins_cfi.nr
nr
Definition: EgHLTOffHistBins_cfi.py:4
DDDWorld::GetWorldVolume
G4VPhysicalVolume * GetWorldVolume() const
Definition: DDDWorld.h:24
Event.h
SimActivityRegistry::endOfTrackSignal_
EndOfTrackSignal endOfTrackSignal_
Definition: SimActivityRegistry.h:89
ParametrisedEMPhysics.h
RunManager::m_trackManager
std::unique_ptr< SimTrackManager > m_trackManager
Definition: RunManager.h:140
SiStripPI::max
Definition: SiStripPayloadInspectorHelper.h:169
SimWatcherFactory.h
G4SimEvent.h
GeV
const double GeV
Definition: MathUtil.h:16
RunManager::m_LHCtr
edm::EDGetTokenT< edm::LHCTransportLinkContainer > m_LHCtr
Definition: RunManager.h:93
RunManager::m_HepMC
edm::EDGetTokenT< edm::HepMCProduct > m_HepMC
Definition: RunManager.h:92
recoMuon::in
Definition: RecoMuonEnumerators.h:6
RunManager::firstRun
bool firstRun
Definition: RunManager.h:104
StackingAction.h
Field.h
SensitiveDetectorCatalog.h
RunManager::m_runInitialized
bool m_runInitialized
Definition: RunManager.h:101
groupFilesInBlocks.fout
fout
Definition: groupFilesInBlocks.py:162
edm::EventID::event
EventNumber_t event() const
Definition: EventID.h:40
SimActivityRegistry::beginOfEventSignal_
BeginOfEventSignal beginOfEventSignal_
Definition: SimActivityRegistry.h:64
edm::Service
Definition: Service.h:30
createfilelist.int
int
Definition: createfilelist.py:10
SimActivityRegistry::endOfRunSignal_
EndOfRunSignal endOfRunSignal_
Definition: SimActivityRegistry.h:79
trackerHitRTTI::vector
Definition: trackerHitRTTI.h:21
IdealGeometryRecord.h
MagneticField.h
edm::EventSetup
Definition: EventSetup.h:57
CastorDigiValidation.SteppingAction
SteppingAction
Definition: CastorDigiValidation.py:147
RunManager::m_pRunAction
edm::ParameterSet m_pRunAction
Definition: RunManager.h:123
edm::HepMCProduct::GetEvent
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:34
CMSGDMLWriteStructure.h
get
#define get
FSQDQM_cfi.pvs
pvs
Definition: FSQDQM_cfi.py:12
G4SimEvent::collisionPoint
void collisionPoint(const math::XYZTLorentzVectorD &v)
Definition: G4SimEvent.h:27
SimActivityRegistry::beginOfJobSignal_
BeginOfJobSignal beginOfJobSignal_
Definition: SimActivityRegistry.h:49
RunManager::m_FieldFile
std::string m_FieldFile
Definition: RunManager.h:145
RunManager::GetSimTrackManager
SimTrackManager * GetSimTrackManager()
Definition: RunManager.cc:566
AttachSD.h
edm::ESTransientHandle
Definition: ESTransientHandle.h:41
RunManager::m_RestorePhysicsTables
bool m_RestorePhysicsTables
Definition: RunManager.h:116
TrackingAction::m_beginOfTrackSignal
SimActivityRegistry::BeginOfTrackSignal m_beginOfTrackSignal
Definition: TrackingAction.h:28
RunManager::RunManager
RunManager(edm::ParameterSet const &p, edm::ConsumesCollector &&i)
Definition: RunManager.cc:117
alignCSCRings.r
r
Definition: alignCSCRings.py:93
RunManager::terminateRun
void terminateRun()
Definition: RunManager.cc:523
groupFilesInBlocks.nn
nn
Definition: groupFilesInBlocks.py:150
RunAction::m_endOfRunSignal
SimActivityRegistry::EndOfRunSignal m_endOfRunSignal
Definition: RunAction.h:24
DDAxes::phi
SteppingAction::m_g4StepSignal
SimActivityRegistry::G4StepSignal m_g4StepSignal
Definition: SteppingAction.h:38
Generator
Definition: Generator.h:19
SimActivityRegistry::beginOfTrackSignal_
BeginOfTrackSignal beginOfTrackSignal_
Definition: SimActivityRegistry.h:69
std
Definition: JetResolutionObject.h:76
ExceptionHandler.h
SimActivityRegistry
Definition: SimActivityRegistry.h:43
CMSSteppingVerbose.h
RunManager::m_EvtMgrVerbosity
int m_EvtMgrVerbosity
Definition: RunManager.h:118
SimRunInterface.h
PVValHelper::dz
Definition: PVValidationHelpers.h:50
RunManager::m_pTrackingAction
edm::ParameterSet m_pTrackingAction
Definition: RunManager.h:126
edm::LogVerbatim
Log< level::Info, true > LogVerbatim
Definition: MessageLogger.h:128
RunManager::idealMagRcdWatcher_
edm::ESWatcher< IdealMagneticFieldRecord > idealMagRcdWatcher_
Definition: RunManager.h:143
SimTrackManager.h
flavorHistoryFilter_cfi.dr
dr
Definition: flavorHistoryFilter_cfi.py:37
Exception
Definition: hltDiff.cc:246
RunManager::m_kernel
G4RunManagerKernel * m_kernel
Definition: RunManager.h:88
edm::EventBase::id
edm::EventID id() const
Definition: EventBase.h:59
cms::DDCompactView
Definition: DDCompactView.h:31
RunManager::m_nonBeam
bool m_nonBeam
Definition: RunManager.h:95
G4SimEvent::weight
void weight(float w)
Definition: G4SimEvent.h:25
SimActivityRegistry::connect
void connect(Observer< const BeginOfJob * > *iObject)
Definition: SimActivityRegistry.h:51
EventSetup.h
RunManager::initializeUserActions
void initializeUserActions()
Definition: RunManager.cc:477
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
RunManager::m_pUseMagneticField
bool m_pUseMagneticField
Definition: RunManager.h:105
PrimaryTransformer.h
RunAction::EndOfRunAction
void EndOfRunAction(const G4Run *aRun) override
Definition: RunAction.cc:26
RunManager::m_pStackingAction
edm::ParameterSet m_pStackingAction
Definition: RunManager.h:125
CMSExoticaPhysics.h
Generator::HepMC2G4
void HepMC2G4(const HepMC::GenEvent *g, G4Event *e)
Definition: Generator.cc:112
CMSMonopolePhysics
Definition: CMSMonopolePhysics.h:18
AttachSD
Definition: AttachSD.h:17
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
RunManager::m_generator
Generator * m_generator
Definition: RunManager.h:90
PDTRecord.h
ConsumesCollector.h
L1TMuonDQMOffline_cfi.cuts
cuts
Definition: L1TMuonDQMOffline_cfi.py:41
edm::HepMCProduct
Definition: HepMCProduct.h:18
ParameterSet.h
Generator::genEvent
virtual const HepMC::GenEvent * genEvent() const
Definition: Generator.h:30
RunManager::initializeRun
void initializeRun()
Definition: RunManager.cc:510
HepMCProduct.h
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
ecalTB2006H4_GenSimDigiReco_cfg.G4cout
G4cout
Definition: ecalTB2006H4_GenSimDigiReco_cfg.py:303
SimActivityRegistry::beginOfRunSignal_
BeginOfRunSignal beginOfRunSignal_
Definition: SimActivityRegistry.h:59
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
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
edm::Event
Definition: Event.h:73
RunManager::m_hasWatchers
bool m_hasWatchers
Definition: RunManager.h:106
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
edm::errors::Configuration
Definition: EDMException.h:36
RunManager::m_currentRun
G4Run * m_currentRun
Definition: RunManager.h:108
PDTRecord
Definition: PDTRecord.h:14
RunManager::m_WriteFile
std::string m_WriteFile
Definition: RunManager.h:146
ParticleDataTable
HepPDT::ParticleDataTable ParticleDataTable
Definition: ParticleDataTable.h:8
RunManager::abortRun
void abortRun(bool softAbort=false)
Definition: RunManager.cc:543
edm::InputTag
Definition: InputTag.h:15
edm::ConsumesCollector
Definition: ConsumesCollector.h:45
CMSMonopolePhysics.h
IdealGeometryRecord
Definition: IdealGeometryRecord.h:25
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
RunManager::abortEvent
void abortEvent()
Definition: RunManager.cc:457
RunManager::~RunManager
~RunManager()
Definition: RunManager.cc:179
RunAction::BeginOfRunAction
void BeginOfRunAction(const G4Run *aRun) override
Definition: RunAction.cc:17
DeadROC_duringRun.dir
dir
Definition: DeadROC_duringRun.py:23
sim::FieldBuilder
Definition: FieldBuilder.h:15
SimRunInterface
Definition: SimRunInterface.h:18