CMS 3D CMS Logo

RunManager.cc
Go to the documentation of this file.
13 
18 
20 
29 
32 
40 
42 
51 
54 
57 
58 #include "HepPDT/ParticleDataTable.hh"
60 
61 #include "G4GeometryManager.hh"
62 #include "G4StateManager.hh"
63 #include "G4ApplicationState.hh"
64 #include "G4RunManagerKernel.hh"
65 #include "G4UImanager.hh"
66 
67 #include "G4EventManager.hh"
68 #include "G4Run.hh"
69 #include "G4Event.hh"
70 #include "G4TransportationManager.hh"
71 #include "G4ParticleTable.hh"
72 #include "G4Field.hh"
73 #include "G4FieldManager.hh"
74 
75 #include "G4GDMLParser.hh"
76 #include "G4SystemOfUnits.hh"
77 
78 #include <iostream>
79 #include <sstream>
80 #include <fstream>
81 #include <memory>
82 
84 
85 static
87  SimActivityRegistry& iReg,
88  std::vector<std::shared_ptr<SimWatcher> >& oWatchers,
89  std::vector<std::shared_ptr<SimProducer> >& oProds
90  )
91 {
92  using namespace std;
93  using namespace edm;
94 
95  vector<ParameterSet> watchers = iP.getParameter<vector<ParameterSet> >("Watchers");
96 
97  for(vector<ParameterSet>::iterator itWatcher = watchers.begin();
98  itWatcher != watchers.end();
99  ++itWatcher) {
100  std::shared_ptr<SimWatcherMakerBase> maker(
102  (itWatcher->getParameter<std::string> ("type")) );
103  if(maker.get()==nullptr) {
105  << "Unable to find the requested Watcher";
106  }
107 
108  std::shared_ptr<SimWatcher> watcherTemp;
109  std::shared_ptr<SimProducer> producerTemp;
110  maker->make(*itWatcher,iReg,watcherTemp,producerTemp);
111  oWatchers.push_back(watcherTemp);
112  if(producerTemp) {
113  oProds.push_back(producerTemp);
114  }
115  }
116 }
117 
119  : m_generator(new Generator(p.getParameter<edm::ParameterSet>("Generator"))),
120  m_HepMC(iC.consumes<edm::HepMCProduct>(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), m_runTerminated(false), m_runAborted(false),
126  firstRun(true),
127  m_pUseMagneticField(p.getParameter<bool>("UseMagneticField")),
128  m_currentRun(nullptr), m_currentEvent(nullptr), m_simEvent(nullptr),
129  m_PhysicsTablesDir(p.getParameter<std::string>("PhysicsTablesDirectory")),
130  m_StorePhysicsTables(p.getParameter<bool>("StorePhysicsTables")),
131  m_RestorePhysicsTables(p.getParameter<bool>("RestorePhysicsTables")),
132  m_EvtMgrVerbosity(p.getUntrackedParameter<int>("G4EventManagerVerbosity",0)),
133  m_pField(p.getParameter<edm::ParameterSet>("MagneticField")),
134  m_pGenerator(p.getParameter<edm::ParameterSet>("Generator")),
135  m_pPhysics(p.getParameter<edm::ParameterSet>("Physics")),
136  m_pRunAction(p.getParameter<edm::ParameterSet>("RunAction")),
137  m_pEventAction(p.getParameter<edm::ParameterSet>("EventAction")),
138  m_pStackingAction(p.getParameter<edm::ParameterSet>("StackingAction")),
139  m_pTrackingAction(p.getParameter<edm::ParameterSet>("TrackingAction")),
140  m_pSteppingAction(p.getParameter<edm::ParameterSet>("SteppingAction")),
141  m_g4overlap(p.getParameter<edm::ParameterSet>("G4CheckOverlap")),
142  m_G4Commands(p.getParameter<std::vector<std::string> >("G4Commands")),
143  m_p(p)
144 {
145  m_UIsession.reset(new CustomUIsession());
146  m_kernel = new G4RunManagerKernel();
147  G4StateManager::GetStateManager()->SetExceptionHandler(new ExceptionHandler());
148 
149  m_physicsList.reset(nullptr);
150  m_prodCuts.reset(nullptr);
151  m_attach = nullptr;
152 
153  m_check = p.getUntrackedParameter<bool>("CheckOverlap",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
170  = p.getParameter<std::vector<edm::ParameterSet> >("Watchers");
171  m_hasWatchers = (watchers.empty()) ? false : true;
172 
173  if(m_hasWatchers) {
175  }
176 }
177 
179 {
180  if (!m_runTerminated) { terminateRun(); }
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 {
190  bool geomChanged = idealGeomRcdWatcher_.check(es);
191  if (geomChanged && (!firstRun)) {
192  throw cms::Exception("BadConfig")
193  << "[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  if (m_pUseMagneticField) {
198  bool magChanged = idealMagRcdWatcher_.check(es);
199  if (magChanged && (!firstRun)) {
201  << "[SimG4Core RunManager]\n"
202  << "The MagneticField configuration is changed during the job execution\n"
203  << "this is not allowed, the MagneticField must stay unchanged\n";
204  }
205  }
206 
207  if (m_managerInitialized) return;
208 
209  // DDDWorld: get the DDCV from the ES and use it to build the World
211  es.get<IdealGeometryRecord>().get(pDD);
212 
214  SensitiveDetectorCatalog catalog_;
215  const DDDWorld * world = new DDDWorld(&(*pDD), map_, catalog_, false);
217 
219  {
220  // setup the magnetic field
222  es.get<IdealMagneticFieldRecord>().get(pMF);
223  const GlobalPoint g(0.,0.,0.);
224 
225  sim::FieldBuilder fieldBuilder(pMF.product(), m_pField);
226  CMSFieldManager* fieldManager = new CMSFieldManager();
227  G4TransportationManager * tM =
228  G4TransportationManager::GetTransportationManager();
229  tM->SetFieldManager(fieldManager);
230  fieldBuilder.build( fieldManager, tM->GetPropagatorInField());
231 
232  if(!m_FieldFile.empty()) {
233  DumpMagneticField(tM->GetFieldManager()->GetDetectorField());
234  }
235  }
236 
237  // we need the track manager now
238  m_trackManager = std::unique_ptr<SimTrackManager>(new SimTrackManager);
239 
240  // attach sensitive detector
241  m_attach = new AttachSD;
242 
243  std::pair< std::vector<SensitiveTkDetector*>,
244  std::vector<SensitiveCaloDetector*> > sensDets =
245  m_attach->create(*world,(*pDD),catalog_,m_p,m_trackManager.get(),
246  m_registry);
247 
248  m_sensTkDets.swap(sensDets.first);
249  m_sensCaloDets.swap(sensDets.second);
250 
251  edm::LogInfo("SimG4CoreApplication")
252  << " RunManager: Sensitive Detector "
253  << "building finished; found "
254  << m_sensTkDets.size()
255  << " Tk type Producers, and "
256  << m_sensCaloDets.size()
257  << " Calo type producers ";
258 
260  es.get<PDTRecord>().get(fTable);
261  const HepPDT::ParticleDataTable *fPDGTable = &(*fTable);
262 
264 
265  std::unique_ptr<PhysicsListMakerBase>
266  physicsMaker(PhysicsListFactory::get()->create(
267  m_pPhysics.getParameter<std::string> ("type")));
268  if (physicsMaker.get()==nullptr) {
270  << "Unable to find the Physics list requested";
271  }
272  m_physicsList = physicsMaker->make(m_pPhysics,m_registry);
273 
274  PhysicsList* phys = m_physicsList.get();
275  if (phys==nullptr) {
277  << "Physics list construction failed!";
278  }
279 
280  // exotic particle physics
281  double monopoleMass = m_pPhysics.getUntrackedParameter<double>("MonopoleMass",0);
282  if(monopoleMass > 0.0) {
283  phys->RegisterPhysics(new CMSMonopolePhysics(fPDGTable,m_pPhysics));
284  }
285  bool exotica = m_pPhysics.getUntrackedParameter<bool>("ExoticaTransport",false);
286  if(exotica) { CMSExoticaPhysics exo(phys, m_pPhysics); }
287 
288  // adding GFlash, Russian Roulette for eletrons and gamma,
289  // step limiters on top of any Physics Lists
290  phys->RegisterPhysics(new ParametrisedEMPhysics("EMoptions",m_pPhysics));
291 
292  m_physicsList->ResetStoredInAscii();
293  std::string tableDir = m_PhysicsTablesDir;
295  m_physicsList->SetPhysicsTableRetrieved(tableDir);
296  }
297  edm::LogInfo("SimG4CoreApplication")
298  << "RunManager: start initialisation of PhysicsList";
299 
300  int verb = std::max(m_pPhysics.getUntrackedParameter<int>("Verbosity",0),
301  m_p.getParameter<int>("SteppingVerbosity"));
302  m_kernel->SetVerboseLevel(verb);
303 
304  m_physicsList->SetDefaultCutValue(m_pPhysics.getParameter<double>("DefaultCutValue")*CLHEP::cm);
305  m_physicsList->SetCutsWithDefault();
306  if(m_pPhysics.getParameter<bool>("CutsPerRegion")) {
307  m_prodCuts.reset(new DDG4ProductionCuts(map_, verb, m_pPhysics));
308  m_prodCuts->update();
309  }
310 
311  m_kernel->SetPhysics(phys);
312  m_kernel->InitializePhysics();
313 
314  if (m_kernel->RunInitialization()) { m_managerInitialized = true; }
315  else {
317  << "G4RunManagerKernel initialization failed!";
318  }
319 
321  {
322  std::ostringstream dir;
323  dir << tableDir << '\0';
324  std::string cmd = std::string("/control/shell mkdir -p ")+tableDir;
325  if (!std::ifstream(dir.str().c_str(), std::ios::in))
326  G4UImanager::GetUIpointer()->ApplyCommand(cmd);
327  m_physicsList->StorePhysicsTable(tableDir);
328  }
329 
330  //tell all interesting parties that we are beginning the job
331  BeginOfJob aBeginOfJob(&es);
332  m_registry.beginOfJobSignal_(&aBeginOfJob);
333 
334  G4int sv = m_p.getParameter<int>("SteppingVerbosity");
335  G4double elim = m_p.getParameter<double>("StepVerboseThreshold")*CLHEP::GeV;
336  std::vector<int> ve = m_p.getParameter<std::vector<int> >("VerboseEvents");
337  std::vector<int> vn = m_p.getParameter<std::vector<int> >("VertexNumber");
338  std::vector<int> vt = m_p.getParameter<std::vector<int> >("VerboseTracks");
339 
340  if(sv > 0) {
341  m_sVerbose.reset(new CMSSteppingVerbose(sv, elim, ve, vn, vt));
342  }
344 
345  if(!m_G4Commands.empty()) {
346  G4cout << "RunManager: Requested UI commands: " << G4endl;
347  for (unsigned it=0; it<m_G4Commands.size(); ++it) {
348  G4cout << " " << m_G4Commands[it] << G4endl;
349  G4UImanager::GetUIpointer()->ApplyCommand(m_G4Commands[it]);
350  }
351  }
352 
353  if(!m_WriteFile.empty()) {
354  G4GDMLParser gdml;
355  gdml.SetRegionExport(true);
356  gdml.SetEnergyCutsExport(true);
357  gdml.Write(m_WriteFile, world->GetWorldVolume(), true);
358  }
359 
360  if(!m_RegionFile.empty()) {
361  G4RegionReporter rrep;
363  }
364 
366 
367  // If the Geant4 particle table is needed, decomment the lines below
368  //
369  // G4cout << "Output of G4ParticleTable DumpTable:" << G4endl;
370  // G4ParticleTable::GetParticleTable()->DumpTable("ALL");
371 
372  initializeRun();
373  firstRun= false;
374 }
375 
377 {
378  G4StateManager::GetStateManager()->SetNewState(G4State_Quit);
379  if (!m_runTerminated) { terminateRun(); }
380 }
381 
383 {
384  m_currentEvent = generateEvent(inpevt);
385  m_simEvent = new G4SimEvent;
388  if (m_generator->genVertex() !=nullptr ) {
391  m_generator->genVertex()->y()/centimeter,
392  m_generator->genVertex()->z()/centimeter,
393  m_generator->genVertex()->t()/second));
394  }
395  if (m_currentEvent->GetNumberOfPrimaryVertex()==0) {
396  std::stringstream ss;
397  ss << " RunManager::produce(): event " << inpevt.id().event()
398  << " with no G4PrimaryVertices\n" ;
399  throw SimG4Exception(ss.str());
400 
401  abortRun(false);
402  } else {
403  edm::LogInfo("SimG4CoreApplication")
404  << "RunManager::produce: start Event " << inpevt.id().event()
405  << " of weight " << m_simEvent->weight()
406  << " with " << m_simEvent->nTracks() << " tracks and "
407  << m_simEvent->nVertices()
408  << " vertices, generated by " << m_simEvent->nGenParts() << " particles ";
409 
410  m_kernel->GetEventManager()->ProcessOneEvent(m_currentEvent);
411 
412  edm::LogInfo("SimG4CoreApplication")
413  << " RunManager::produce: ended Event " << inpevt.id().event();
414  }
415 }
416 
418 {
419  if (m_currentEvent!=nullptr) { delete m_currentEvent; }
420  m_currentEvent = nullptr;
421  if (m_simEvent!=nullptr) { delete m_simEvent; }
422  m_simEvent = nullptr;
423 
424  // 64 bits event ID in CMSSW converted into Geant4 event ID
425  G4int evtid = (G4int)inpevt.id().event();
426  G4Event * evt = new G4Event(evtid);
427 
429 
430  inpevt.getByToken( m_HepMC, HepMCEvt ) ;
431 
432  m_generator->setGenEvent(HepMCEvt->GetEvent());
433 
434  // required to reset the GenParticle Id for particles transported
435  // along the beam pipe
436  // to their original value for SimTrack creation
437  resetGenParticleId( inpevt );
438 
439  if (!m_nonBeam)
440  {
441  m_generator->HepMC2G4(HepMCEvt->GetEvent(),evt);
442  }
443  else
444  {
445  m_generator->nonBeamEvent2G4(HepMCEvt->GetEvent(),evt);
446  }
447 
448  return evt;
449 }
450 
452 {
453  if (m_runTerminated) { return; }
454  G4Track* t =
455  m_kernel->GetEventManager()->GetTrackingManager()->GetTrack();
456  t->SetTrackStatus(fStopAndKill) ;
457 
458  // CMS-specific act
459  //
460  TrackingAction* uta =
461  (TrackingAction*)m_kernel->GetEventManager()->GetUserTrackingAction() ;
462  uta->PostUserTrackingAction(t) ;
463 
464  m_currentEvent->SetEventAborted();
465  m_kernel->GetEventManager()->GetStackManager()->clear() ;
466  m_kernel->GetEventManager()->GetTrackingManager()->EventAborted() ;
467 
468  G4StateManager* stateManager = G4StateManager::GetStateManager();
469  stateManager->SetNewState(G4State_GeomClosed);
470 }
471 
473 {
474  m_runInterface = new SimRunInterface(this, false);
475 
478 
479  G4EventManager * eventManager = m_kernel->GetEventManager();
480  eventManager->SetVerboseLevel(m_EvtMgrVerbosity);
481 
482  if (m_generator!=nullptr) {
483  EventAction * userEventAction =
485  m_sVerbose.get());
486  Connect(userEventAction);
487  eventManager->SetUserAction(userEventAction);
488 
489  TrackingAction* userTrackingAction =
490  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,
501 
502  } else {
503  edm::LogWarning("SimG4CoreApplication") << " RunManager: WARNING : "
504  << "No generator; initialized "
505  << "only RunAction!";
506  }
507 }
508 
510 {
511  m_runInitialized = false;
512  if (m_currentRun==nullptr) { m_currentRun = new G4Run(); }
513  G4StateManager::GetStateManager()->SetNewState(G4State_GeomClosed);
515  m_runAborted = false;
516  m_runInitialized = true;
517 }
518 
520 {
521  if(m_runTerminated) { return; }
522  if (m_userRunAction!=nullptr) {
524  delete m_userRunAction;
525  m_userRunAction = nullptr;
526  }
527  delete m_currentEvent;
528  m_currentEvent = nullptr;
529  delete m_simEvent;
530  m_simEvent = nullptr;
531  if(m_kernel != nullptr) { m_kernel->RunTermination(); }
532  m_runInitialized = false;
533  m_runTerminated = true;
534 }
535 
536 void RunManager::abortRun(bool softAbort)
537 {
538  if(m_runAborted) { return; }
539  if (!softAbort) { abortEvent(); }
540  if (m_currentRun!=nullptr) { delete m_currentRun; m_currentRun = nullptr; }
541  terminateRun();
542  m_runAborted = true;
543 }
544 
546 {
548  inpevt.getByToken( m_LHCtr, theLHCTlink );
549  if ( theLHCTlink.isValid() ) {
550  m_trackManager->setLHCTransportLink( theLHCTlink.product() );
551  }
552 }
553 
555 {
556  return m_trackManager.get();
557 }
558 
560 {
563 }
564 
566 {
569 }
570 
571 void RunManager::Connect(TrackingAction* trackingAction)
572 {
575 }
576 
577 void RunManager::Connect(SteppingAction* steppingAction)
578 {
580 }
581 
582 void RunManager::DumpMagneticField(const G4Field* field) const
583 {
584  std::ofstream fout(m_FieldFile.c_str(), std::ios::out);
585  if(fout.fail()){
586  edm::LogWarning("SimG4CoreApplication")
587  << " RunManager WARNING : "
588  << "error opening file <" << m_FieldFile << "> for magnetic field";
589  } else {
590  double rmax = 9000*mm;
591  double zmax = 16000*mm;
592 
593  double dr = 5*cm;
594  double dz = 20*cm;
595 
596  int nr = (int)(rmax/dr);
597  int nz = 2*(int)(zmax/dz);
598 
599  double r = 0.0;
600  double z0 = -zmax;
601  double z;
602 
603  double phi = 0.0;
604  double cosf = cos(phi);
605  double sinf = sin(phi);
606 
607  double point[4] = {0.0,0.0,0.0,0.0};
608  double bfield[3] = {0.0,0.0,0.0};
609 
610  fout << std::setprecision(6);
611  for(int i=0; i<=nr; ++i) {
612  z = z0;
613  for(int j=0; j<=nz; ++j) {
614  point[0] = r*cosf;
615  point[1] = r*sinf;
616  point[2] = z;
617  field->GetFieldValue(point, bfield);
618  fout << "R(mm)= " << r/mm << " phi(deg)= " << phi/degree
619  << " Z(mm)= " << z/mm << " Bz(tesla)= " << bfield[2]/tesla
620  << " Br(tesla)= " << (bfield[0]*cosf + bfield[1]*sinf)/tesla
621  << " Bphi(tesla)= " << (bfield[0]*sinf - bfield[1]*cosf)/tesla
622  << G4endl;
623  z += dz;
624  }
625  r += dr;
626  }
627 
628  fout.close();
629  }
630 }
T getParameter(std::string const &) const
bool m_check
Definition: RunManager.h:129
EventNumber_t event() const
Definition: EventID.h:41
Map map_
T getUntrackedParameter(std::string const &, T const &) const
edm::EDGetTokenT< edm::HepMCProduct > m_HepMC
Definition: RunManager.h:103
virtual const math::XYZTLorentzVector * genVertex() const
Definition: Generator.h:30
SimTrackManager * GetSimTrackManager()
Definition: RunManager.cc:554
void BeginOfRunAction(const G4Run *aRun) override
Definition: RunAction.cc:19
edm::ESWatcher< IdealMagneticFieldRecord > idealMagRcdWatcher_
Definition: RunManager.h:155
const double GeV
Definition: MathUtil.h:16
const G4VPhysicalVolume * GetWorldVolume() const
Definition: DDDWorld.h:18
RunManager(edm::ParameterSet const &p, edm::ConsumesCollector &&i)
Definition: RunManager.cc:118
virtual const double eventWeight() const
Definition: Generator.h:31
std::pair< std::vector< SensitiveTkDetector * >, std::vector< SensitiveCaloDetector * > > create(const DDDWorld &, const DDCompactView &, const SensitiveDetectorCatalog &, edm::ParameterSet const &, const SimTrackManager *, SimActivityRegistry &reg) const
Definition: AttachSD.cc:15
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:14
G4Event * m_currentEvent
Definition: RunManager.h:120
void abortRun(bool softAbort=false)
Definition: RunManager.cc:536
def create(alignables, pedeDump, additionalData, outputFile, config)
edm::EDGetTokenT< edm::LHCTransportLinkContainer > m_LHCtr
Definition: RunManager.h:104
SimActivityRegistry m_registry
Definition: RunManager.h:148
virtual const HepMC::GenEvent * genEvent() const
Definition: Generator.h:29
edm::ParameterSet m_p
Definition: RunManager.h:140
SimActivityRegistry::G4StepSignal m_g4StepSignal
HepPDT::ParticleDataTable ParticleDataTable
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
std::vector< std::shared_ptr< SimProducer > > m_producers
Definition: RunManager.h:150
void initializeRun()
Definition: RunManager.cc:509
void connect(Observer< const BeginOfJob * > *iObject)
void HepMC2G4(const HepMC::GenEvent *g, G4Event *e)
Definition: Generator.cc:107
EndOfEventSignal endOfEventSignal_
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
void initializeUserActions()
Definition: RunManager.cc:472
SimActivityRegistry::EndOfRunSignal m_endOfRunSignal
Definition: RunAction.h:25
Generator * m_generator
Definition: RunManager.h:101
BeginOfRunSignal beginOfRunSignal_
SimActivityRegistry::EndOfEventSignal m_endOfEventSignal
Definition: EventAction.h:51
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:86
bool m_hasWatchers
Definition: RunManager.h:117
bool m_pUseMagneticField
Definition: RunManager.h:116
#define nullptr
edm::ESWatcher< IdealGeometryRecord > idealGeomRcdWatcher_
Definition: RunManager.h:154
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
void abortEvent()
Definition: RunManager.cc:451
std::vector< SensitiveCaloDetector * > m_sensCaloDets
Definition: RunManager.h:144
std::vector< SensitiveTkDetector * > m_sensTkDets
Definition: RunManager.h:143
BeginOfJobSignal beginOfJobSignal_
bool m_nonBeam
Definition: RunManager.h:106
U second(std::pair< T, U > const &p)
void weight(float w)
Definition: G4SimEvent.h:26
RunAction
list of unwanted particles (gluons and quarks)
int m_EvtMgrVerbosity
Definition: RunManager.h:128
std::string m_WriteFile
Definition: RunManager.h:158
bool firstRun
Definition: RunManager.h:115
SimRunInterface * m_runInterface
Definition: RunManager.h:123
void terminateRun()
Definition: RunManager.cc:519
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
bool m_RestorePhysicsTables
Definition: RunManager.h:127
void hepEvent(const HepMC::GenEvent *r)
Definition: G4SimEvent.h:24
std::vector< std::shared_ptr< SimWatcher > > m_watchers
Definition: RunManager.h:149
std::unique_ptr< CMSSteppingVerbose > m_sVerbose
Definition: RunManager.h:147
void setGenEvent(const HepMC::GenEvent *inpevt)
Definition: Generator.h:25
BeginOfEventSignal beginOfEventSignal_
SimActivityRegistry::EndOfTrackSignal m_endOfTrackSignal
bool isValid() const
Definition: HandleBase.h:74
G4Run * m_currentRun
Definition: RunManager.h:119
void resetGenParticleId(edm::Event &inpevt)
Definition: RunManager.cc:545
EndOfRunSignal endOfRunSignal_
edm::ParameterSet m_pStackingAction
Definition: RunManager.h:135
unsigned int nTracks() const
Definition: G4SimEvent.h:21
void connect(Observer< const T * > *iObs)
does not take ownership of memory
Definition: Signaler.h:59
edm::ParameterSet m_pEventAction
Definition: RunManager.h:134
bool m_runTerminated
Definition: RunManager.h:113
unsigned int nVertices() const
Definition: G4SimEvent.h:22
edm::ParameterSet m_pField
Definition: RunManager.h:130
edm::ParameterSet m_pPhysics
Definition: RunManager.h:132
edm::ParameterSet m_pSteppingAction
Definition: RunManager.h:137
edm::ParameterSet m_g4overlap
Definition: RunManager.h:138
const HepMC::GenEvent * GetEvent() const
Definition: HepMCProduct.h:38
T const * product() const
Definition: Handle.h:81
unsigned int nGenParts() const
Definition: G4SimEvent.h:23
void stopG4()
Definition: RunManager.cc:376
RunAction * m_userRunAction
Definition: RunManager.h:122
DDDWorldSignal dddWorldSignal_
void nonBeamEvent2G4(const HepMC::GenEvent *g, G4Event *e)
Definition: Generator.cc:572
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
G4Event * generateEvent(edm::Event &inpevt)
Definition: RunManager.cc:417
void ReportRegions(const std::string &ss)
void DumpMagneticField(const G4Field *) const
Definition: RunManager.cc:582
bool m_runInitialized
Definition: RunManager.h:112
SimActivityRegistry::BeginOfRunSignal m_beginOfRunSignal
Definition: RunAction.h:24
edm::EventID id() const
Definition: EventBase.h:60
void Connect(RunAction *)
Definition: RunManager.cc:559
HLT enums.
list cmd
Definition: mps_setup.py:239
std::string m_RegionFile
Definition: RunManager.h:159
T get() const
Definition: EventSetup.h:68
std::vector< LHCTransportLink > LHCTransportLinkContainer
AttachSD * m_attach
Definition: RunManager.h:142
PrimaryTransformer * m_primaryTransformer
Definition: RunManager.h:109
firstRun
Definition: dataset.py:938
std::string m_PhysicsTablesDir
Definition: RunManager.h:125
void PostUserTrackingAction(const G4Track *aTrack) override
bool m_StorePhysicsTables
Definition: RunManager.h:126
std::unique_ptr< CustomUIsession > m_UIsession
Definition: RunManager.h:107
dbl *** dir
Definition: mlp_gen.cc:35
EndOfTrackSignal endOfTrackSignal_
std::unique_ptr< DDG4ProductionCuts > m_prodCuts
Definition: RunManager.h:146
def check(config)
Definition: trackerTree.py:14
edm::ParameterSet m_pRunAction
Definition: RunManager.h:133
std::unique_ptr< SimTrackManager > m_trackManager
Definition: RunManager.h:152
T const * product() const
Definition: ESHandle.h:84
edm::ParameterSet m_pTrackingAction
Definition: RunManager.h:136
void collisionPoint(const math::XYZTLorentzVectorD &v)
Definition: G4SimEvent.h:28
std::vector< std::string > m_G4Commands
Definition: RunManager.h:139
SimActivityRegistry::BeginOfEventSignal m_beginOfEventSignal
Definition: EventAction.h:50
std::string m_FieldFile
Definition: RunManager.h:157
std::unique_ptr< PhysicsList > m_physicsList
Definition: RunManager.h:108
G4SimEvent * m_simEvent
Definition: RunManager.h:121
bool m_managerInitialized
Definition: RunManager.h:111
void initG4(const edm::EventSetup &es)
Definition: RunManager.cc:188
T get(const Candidate &c)
Definition: component.h:55
void EndOfRunAction(const G4Run *aRun) override
Definition: RunAction.cc:31
*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
BeginOfTrackSignal beginOfTrackSignal_
G4RunManagerKernel * m_kernel
Definition: RunManager.h:99
bool m_runAborted
Definition: RunManager.h:114
void produce(edm::Event &inpevt, const edm::EventSetup &es)
Definition: RunManager.cc:382
SimActivityRegistry::BeginOfTrackSignal m_beginOfTrackSignal