CMS 3D CMS Logo

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