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