CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
RunManager.cc
Go to the documentation of this file.
12 
16 
18 
25 
28 
32 
37 
39 
41 
43 
44 #include "HepPDT/defs.h"
45 #include "HepPDT/TableBuilder.hh"
46 #include "HepPDT/ParticleDataTable.hh"
48 
49 #include "G4GeometryManager.hh"
50 #include "G4StateManager.hh"
51 #include "G4ApplicationState.hh"
52 #include "G4RunManagerKernel.hh"
53 #include "G4UImanager.hh"
54 
55 #include "G4EventManager.hh"
56 #include "G4Run.hh"
57 #include "G4Event.hh"
58 #include "G4TransportationManager.hh"
59 #include "G4ParticleTable.hh"
60 #include "G4Field.hh"
61 #include "G4FieldManager.hh"
62 
63 #include "G4GDMLParser.hh"
64 #include "G4SystemOfUnits.hh"
65 
66 #include <iostream>
67 #include <sstream>
68 #include <fstream>
69 #include <memory>
70 
72 
73 //#include "SimG4Core/Application/interface/ExceptionHandler.h"
74 
75 static
77  SimActivityRegistry& iReg,
78  std::vector<std::shared_ptr<SimWatcher> >& oWatchers,
79  std::vector<std::shared_ptr<SimProducer> >& oProds
80  )
81 {
82  using namespace std;
83  using namespace edm;
84  vector<ParameterSet> watchers;
85  try {
86  watchers = iP.getParameter<vector<ParameterSet> >("Watchers");
87  } catch( edm::Exception) {
88  }
89 
90  for(vector<ParameterSet>::iterator itWatcher = watchers.begin();
91  itWatcher != watchers.end();
92  ++itWatcher) {
93  std::auto_ptr<SimWatcherMakerBase> maker(
95  (itWatcher->getParameter<std::string> ("type")) );
96  if(maker.get()==0) {
97  throw SimG4Exception("Unable to find the requested Watcher");
98  }
99 
100  std::shared_ptr<SimWatcher> watcherTemp;
101  std::shared_ptr<SimProducer> producerTemp;
102  maker->make(*itWatcher,iReg,watcherTemp,producerTemp);
103  oWatchers.push_back(watcherTemp);
104  if(producerTemp) {
105  oProds.push_back(producerTemp);
106  }
107  }
108 }
109 
110 //RunManager::RunManager(edm::ParameterSet const & p, edm::ConsumesCollector && iC)
112  : m_generator(0), m_nonBeam(p.getParameter<bool>("NonBeamEvent")),
113  m_primaryTransformer(0),
114  m_managerInitialized(false),
115  m_runInitialized(false), m_runTerminated(false), m_runAborted(false),
116  firstRun(true),
117  m_pUseMagneticField(p.getParameter<bool>("UseMagneticField")),
118  m_currentRun(0), m_currentEvent(0), m_simEvent(0),
119  m_PhysicsTablesDir(p.getParameter<std::string>("PhysicsTablesDirectory")),
120  m_StorePhysicsTables(p.getParameter<bool>("StorePhysicsTables")),
121  m_RestorePhysicsTables(p.getParameter<bool>("RestorePhysicsTables")),
122  m_EvtMgrVerbosity(p.getUntrackedParameter<int>("G4EventManagerVerbosity",0)),
123  m_pField(p.getParameter<edm::ParameterSet>("MagneticField")),
124  m_pGenerator(p.getParameter<edm::ParameterSet>("Generator")),
125  m_pPhysics(p.getParameter<edm::ParameterSet>("Physics")),
126  m_pRunAction(p.getParameter<edm::ParameterSet>("RunAction")),
127  m_pEventAction(p.getParameter<edm::ParameterSet>("EventAction")),
128  m_pStackingAction(p.getParameter<edm::ParameterSet>("StackingAction")),
129  m_pTrackingAction(p.getParameter<edm::ParameterSet>("TrackingAction")),
130  m_pSteppingAction(p.getParameter<edm::ParameterSet>("SteppingAction")),
131  m_G4Commands(p.getParameter<std::vector<std::string> >("G4Commands")),
132  m_p(p), m_fieldBuilder(0), m_chordFinderSetter(nullptr),
133  m_theLHCTlinkTag(p.getParameter<edm::InputTag>("theLHCTlinkTag"))
134 {
135  //m_HepMC = iC.consumes<edm::HepMCProduct>(p.getParameter<edm::InputTag>("HepMCProduct"));
136 
137  m_kernel = G4RunManagerKernel::GetRunManagerKernel();
138  if (m_kernel==0) m_kernel = new G4RunManagerKernel();
139 
140  //m_CustomExceptionHandler = new ExceptionHandler(this) ;
141 
142  m_check = p.getUntrackedParameter<bool>("CheckOverlap",false);
143  m_WriteFile = p.getUntrackedParameter<std::string>("FileNameGDML","");
144  m_FieldFile = p.getUntrackedParameter<std::string>("FileNameField","");
145  if("" != m_FieldFile) { m_FieldFile += ".txt"; }
146 
147  m_userRunAction = 0;
148  m_runInterface = 0;
149 
150  //Look for an outside SimActivityRegistry
151  // this is used by the visualization code
152  edm::Service<SimActivityRegistry> otherRegistry;
153  if(otherRegistry){
154  m_registry.connect(*otherRegistry);
155  }
156 
158 
160  m_InTag = m_pGenerator.getParameter<std::string>("HepMCProductLabel") ;
161 
162 }
163 
165 {
166  if (!m_runTerminated) { terminateRun(); }
167  G4StateManager::GetStateManager()->SetNewState(G4State_Quit);
168  G4GeometryManager::GetInstance()->OpenGeometry();
169  // if (m_kernel!=0) delete m_kernel;
170  delete m_runInterface;
171 }
172 
174 {
175  bool geomChanged = idealGeomRcdWatcher_.check(es);
176  if (geomChanged && (!firstRun)) {
177  throw cms::Exception("BadConfig")
178  << "[SimG4Core RunManager]\n"
179  << "The Geometry configuration is changed during the job execution\n"
180  << "this is not allowed, the geometry must stay unchanged\n";
181  }
182  if (m_pUseMagneticField) {
183  bool magChanged = idealMagRcdWatcher_.check(es);
184  if (magChanged && (!firstRun)) {
185  throw cms::Exception("BadConfig")
186  << "[SimG4Core RunManager]\n"
187  << "The MagneticField configuration is changed during the job execution\n"
188  << "this is not allowed, the MagneticField must stay unchanged\n";
189  }
190  }
191 
192  if (m_managerInitialized) return;
193 
194  // DDDWorld: get the DDCV from the ES and use it to build the World
196  es.get<IdealGeometryRecord>().get(pDD);
197 
199  SensitiveDetectorCatalog catalog_;
200  const DDDWorld * world = new DDDWorld(&(*pDD), map_, catalog_, m_check);
202 
203  if("" != m_WriteFile) {
204  G4GDMLParser gdml;
205  gdml.Write(m_WriteFile, world->GetWorldVolume());
206  }
207 
209  {
210  // setup the magnetic field
212  es.get<IdealMagneticFieldRecord>().get(pMF);
213  const GlobalPoint g(0.,0.,0.);
214 
216  m_fieldBuilder = new sim::FieldBuilder(&(*pMF), m_pField);
217  G4TransportationManager * tM =
218  G4TransportationManager::GetTransportationManager();
219  m_fieldBuilder->build( tM->GetFieldManager(),
220  tM->GetPropagatorInField(),
222  if("" != m_FieldFile) {
223  DumpMagneticField(tM->GetFieldManager()->GetDetectorField());
224  }
225  }
226 
227  // we need the track manager now
228  m_trackManager = std::auto_ptr<SimTrackManager>(new SimTrackManager);
229 
230  // attach sensitive detector
231  m_attach = new AttachSD;
232 
233  std::pair< std::vector<SensitiveTkDetector*>,
234  std::vector<SensitiveCaloDetector*> > sensDets =
235  m_attach->create(*world,(*pDD),catalog_,m_p,m_trackManager.get(),
236  m_registry);
237 
238  m_sensTkDets.swap(sensDets.first);
239  m_sensCaloDets.swap(sensDets.second);
240 
241  edm::LogInfo("SimG4CoreApplication")
242  << " RunManager: Sensitive Detector "
243  << "building finished; found "
244  << m_sensTkDets.size()
245  << " Tk type Producers, and "
246  << m_sensCaloDets.size()
247  << " Calo type producers ";
248 
250  es.get<PDTRecord>().get(fTable);
251  const HepPDT::ParticleDataTable *fPDGTable = &(*fTable);
252 
254 
255  std::auto_ptr<PhysicsListMakerBase>
256  physicsMaker(PhysicsListFactory::get()->create(
257  m_pPhysics.getParameter<std::string> ("type")));
258  if (physicsMaker.get()==0) {
259  throw SimG4Exception("Unable to find the Physics list requested");
260  }
261  m_physicsList =
262  physicsMaker->make(map_,fPDGTable,m_chordFinderSetter,m_pPhysics,m_registry);
263 
264  PhysicsList* phys = m_physicsList.get();
265  if (phys==0) {
266  throw SimG4Exception("Physics list construction failed!");
267  }
268 
269  // adding GFlash, Russian Roulette for eletrons and gamma,
270  // step limiters on top of any Physics Lists
271  phys->RegisterPhysics(new ParametrisedEMPhysics("EMoptions",m_pPhysics));
272 
273  m_kernel->SetPhysics(phys);
274  m_kernel->InitializePhysics();
275 
276  m_physicsList->ResetStoredInAscii();
277  std::string tableDir = m_PhysicsTablesDir;
279  m_physicsList->SetPhysicsTableRetrieved(tableDir);
280  }
281  if (m_kernel->RunInitialization()) { m_managerInitialized = true; }
282  else {
283  throw SimG4Exception("G4RunManagerKernel initialization failed!");
284  }
285 
287  {
288  std::ostringstream dir;
289  dir << tableDir << '\0';
290  std::string cmd = std::string("/control/shell mkdir -p ")+tableDir;
291  if (!std::ifstream(dir.str().c_str(), std::ios::in))
292  G4UImanager::GetUIpointer()->ApplyCommand(cmd);
293  m_physicsList->StorePhysicsTable(tableDir);
294  }
295 
296  //tell all interesting parties that we are beginning the job
297  BeginOfJob aBeginOfJob(&es);
298  m_registry.beginOfJobSignal_(&aBeginOfJob);
299 
301 
302  for (unsigned it=0; it<m_G4Commands.size(); it++) {
303  edm::LogInfo("SimG4CoreApplication") << "RunManager:: Requests UI: "
304  << m_G4Commands[it];
305  G4UImanager::GetUIpointer()->ApplyCommand(m_G4Commands[it]);
306  }
307 
308  // If the Geant4 particle table is needed, decomment the lines below
309  //
310  // G4cout << "Output of G4ParticleTable DumpTable:" << G4endl;
311  // G4ParticleTable::GetParticleTable()->DumpTable("ALL");
312 
313  initializeRun();
314  firstRun= false;
315 }
316 
318 {
319  G4StateManager::GetStateManager()->SetNewState(G4State_Quit);
320  if (!m_runTerminated) { terminateRun(); }
321 }
322 
324 {
325  m_currentEvent = generateEvent(inpevt);
326  m_simEvent = new G4SimEvent;
329  if (m_generator->genVertex() !=0 ) {
332  m_generator->genVertex()->y()/centimeter,
333  m_generator->genVertex()->z()/centimeter,
334  m_generator->genVertex()->t()/second));
335  }
336  if (m_currentEvent->GetNumberOfPrimaryVertex()==0) {
337  edm::LogError("SimG4CoreApplication")
338  << " RunManager::produce event " << inpevt.id().event()
339  << " with no G4PrimaryVertices \n Aborting Run" ;
340 
341  abortRun(false);
342  } else {
343  m_kernel->GetEventManager()->ProcessOneEvent(m_currentEvent);
344  }
345 
346  edm::LogInfo("SimG4CoreApplication")
347  << " RunManager: saved : Event " << inpevt.id().event()
348  << " of weight " << m_simEvent->weight()
349  << " with " << m_simEvent->nTracks() << " tracks and "
350  << m_simEvent->nVertices()
351  << " vertices, generated by " << m_simEvent->nGenParts() << " particles ";
352 }
353 
355 {
356  if (m_currentEvent!=0) { delete m_currentEvent; }
357  m_currentEvent = 0;
358  if (m_simEvent!=0) { delete m_simEvent; }
359  m_simEvent = 0;
360  G4Event * evt = new G4Event(inpevt.id().event());
361 
363 
364  inpevt.getByLabel( m_InTag, HepMCEvt ) ;
365 
366  m_generator->setGenEvent(HepMCEvt->GetEvent());
367 
368  // required to reset the GenParticle Id for particles transported
369  // along the beam pipe
370  // to their original value for SimTrack creation
371  resetGenParticleId( inpevt );
372 
373  if (!m_nonBeam)
374  {
375  m_generator->HepMC2G4(HepMCEvt->GetEvent(),evt);
376  }
377  else
378  {
379  m_generator->nonBeamEvent2G4(HepMCEvt->GetEvent(),evt);
380  }
381 
382  return evt;
383 }
384 
386 {
387  if (m_runTerminated) { return; }
388  G4Track* t =
389  m_kernel->GetEventManager()->GetTrackingManager()->GetTrack();
390  t->SetTrackStatus(fStopAndKill) ;
391 
392  // CMS-specific act
393  //
394  TrackingAction* uta =
395  (TrackingAction*)m_kernel->GetEventManager()->GetUserTrackingAction() ;
396  uta->PostUserTrackingAction(t) ;
397 
398  m_currentEvent->SetEventAborted();
399 
400  // do NOT call this method for now
401  // because it'll set abortRequested=true (withing G4EventManager)
402  // this will make Geant4, in the event *next* after the aborted one
403  // NOT to get the primary, thus there's NOTHING to trace, and it goes
404  // to the end of G4Event::DoProcessing(G4Event*), where abortRequested
405  // will be reset to true again
406  //
407  //m_kernel->GetEventManager()->AbortCurrentEvent();
408  //
409  // instead, mimic what it does, except (re)setting abortRequested
410  //
411  m_kernel->GetEventManager()->GetStackManager()->clear() ;
412  m_kernel->GetEventManager()->GetTrackingManager()->EventAborted() ;
413 
414  G4StateManager* stateManager = G4StateManager::GetStateManager();
415  stateManager->SetNewState(G4State_GeomClosed);
416 }
417 
419 {
420  m_runInterface = new SimRunInterface(this, false);
421 
424 
425  G4EventManager * eventManager = m_kernel->GetEventManager();
426  eventManager->SetVerboseLevel(m_EvtMgrVerbosity);
427 
428  if (m_generator!=0) {
429  EventAction * userEventAction =
431  Connect(userEventAction);
432  eventManager->SetUserAction(userEventAction);
433 
434  TrackingAction* userTrackingAction =
435  new TrackingAction(userEventAction,m_pTrackingAction);
436  Connect(userTrackingAction);
437  eventManager->SetUserAction(userTrackingAction);
438 
439  SteppingAction* userSteppingAction =
440  new SteppingAction(userEventAction,m_pSteppingAction);
441  Connect(userSteppingAction);
442  eventManager->SetUserAction(userSteppingAction);
443 
444  eventManager->SetUserAction(new StackingAction(userTrackingAction,
446 
447  } else {
448  edm::LogWarning("SimG4CoreApplication") << " RunManager: WARNING : "
449  << "No generator; initialized "
450  << "only RunAction!";
451  }
452 }
453 
455 {
456  m_runInitialized = false;
457  if (m_currentRun==0) { m_currentRun = new G4Run(); }
458  G4StateManager::GetStateManager()->SetNewState(G4State_GeomClosed);
460  m_runAborted = false;
461  m_runInitialized = true;
462 }
463 
465 {
466  if (m_userRunAction!=0) {
468  delete m_userRunAction;
469  m_userRunAction = 0;
470  }
471  /*
472  if (m_currentRun!=0) {
473  delete m_currentRun;
474  m_currentRun = 0;
475  }
476  */
477  if (m_kernel!=0 && !m_runTerminated) {
478  delete m_currentEvent;
479  m_currentEvent = 0;
480  delete m_simEvent;
481  m_simEvent = 0;
482  m_kernel->RunTermination();
483  m_runInitialized = false;
484  m_runTerminated = true;
485  }
486 }
487 
488 void RunManager::abortRun(bool softAbort)
489 {
490  m_runAborted = false;
491  if (!softAbort) { abortEvent(); }
492  if (m_currentRun!=0) { delete m_currentRun; m_currentRun = 0; }
493  m_runInitialized = false;
494  m_runAborted = true;
495  terminateRun();
496 }
497 
499 {
501  inpevt.getByLabel( m_theLHCTlinkTag, theLHCTlink );
502  if ( theLHCTlink.isValid() ) {
503  m_trackManager->setLHCTransportLink( theLHCTlink.product() );
504  }
505 }
506 
508 {
509  return m_trackManager.get();
510 }
511 
513 {
516 }
517 
519 {
522 }
523 
524 void RunManager::Connect(TrackingAction* trackingAction)
525 {
528 }
529 
530 void RunManager::Connect(SteppingAction* steppingAction)
531 {
533 }
534 
535 void RunManager::DumpMagneticField(const G4Field* field) const
536 {
537  std::ofstream fout(m_FieldFile.c_str(), std::ios::out);
538  if(fout.fail()){
539  edm::LogWarning("SimG4CoreApplication")
540  << " RunManager WARNING : "
541  << "error opening file <" << m_FieldFile << "> for magnetic field";
542  } else {
543  double rmax = 9000*mm;
544  double zmax = 16000*mm;
545 
546  double dr = 5*cm;
547  double dz = 20*cm;
548 
549  int nr = (int)(rmax/dr);
550  int nz = 2*(int)(zmax/dz);
551 
552  double r = 0.0;
553  double z0 = -zmax;
554  double z;
555 
556  double phi = 0.0;
557  double cosf = cos(phi);
558  double sinf = sin(phi);
559 
560  double point[4] = {0.0,0.0,0.0,0.0};
561  double bfield[3] = {0.0,0.0,0.0};
562 
563  fout << std::setprecision(6);
564  for(int i=0; i<=nr; ++i) {
565  z = z0;
566  for(int j=0; j<=nz; ++j) {
567  point[0] = r*cosf;
568  point[1] = r*sinf;
569  point[2] = z;
570  field->GetFieldValue(point, bfield);
571  fout << "R(mm)= " << r/mm << " phi(deg)= " << phi/degree
572  << " Z(mm)= " << z/mm << " Bz(tesla)= " << bfield[2]/tesla
573  << " Br(tesla)= " << (bfield[0]*cosf + bfield[1]*sinf)/tesla
574  << " Bphi(tesla)= " << (bfield[0]*sinf - bfield[1]*cosf)/tesla
575  << G4endl;
576  z += dz;
577  }
578  r += dr;
579  }
580 
581  fout.close();
582  }
583 }
T getParameter(std::string const &) const
bool m_check
Definition: RunManager.h:131
EventNumber_t event() const
Definition: EventID.h:41
edm::ParameterSet m_pGenerator
Definition: RunManager.h:134
T getUntrackedParameter(std::string const &, T const &) const
std::auto_ptr< SimTrackManager > m_trackManager
Definition: RunManager.h:154
int i
Definition: DBlmapReader.cc:9
virtual const math::XYZTLorentzVector * genVertex() const
Definition: Generator.h:30
SimTrackManager * GetSimTrackManager()
Definition: RunManager.cc:507
edm::ESWatcher< IdealMagneticFieldRecord > idealMagRcdWatcher_
Definition: RunManager.h:159
const G4VPhysicalVolume * GetWorldVolume() const
Definition: DDDWorld.h:18
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:120
void abortRun(bool softAbort=false)
Definition: RunManager.cc:488
SimActivityRegistry m_registry
Definition: RunManager.h:150
virtual const HepMC::GenEvent * genEvent() const
Definition: Generator.h:29
edm::ParameterSet m_p
Definition: RunManager.h:143
SimActivityRegistry::G4StepSignal m_g4StepSignal
HepPDT::ParticleDataTable ParticleDataTable
std::vector< std::shared_ptr< SimProducer > > m_producers
Definition: RunManager.h:152
void initializeRun()
Definition: RunManager.cc:454
void HepMC2G4(const HepMC::GenEvent *g, G4Event *e)
Definition: Generator.cc:100
EndOfEventSignal endOfEventSignal_
Sin< T >::type sin(const T &t)
Definition: Sin.h:22
void initializeUserActions()
Definition: RunManager.cc:418
#define nullptr
SimActivityRegistry::EndOfRunSignal m_endOfRunSignal
Definition: RunAction.h:23
Generator * m_generator
Definition: RunManager.h:107
BeginOfRunSignal beginOfRunSignal_
string firstRun
Definition: dataset.py:395
SimActivityRegistry::EndOfEventSignal m_endOfEventSignal
Definition: EventAction.h:46
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:76
bool m_pUseMagneticField
Definition: RunManager.h:118
edm::ESWatcher< IdealGeometryRecord > idealGeomRcdWatcher_
Definition: RunManager.h:158
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
float float float z
void abortEvent()
Definition: RunManager.cc:385
std::vector< SensitiveCaloDetector * > m_sensCaloDets
Definition: RunManager.h:148
std::vector< SensitiveTkDetector * > m_sensTkDets
Definition: RunManager.h:147
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:130
std::auto_ptr< PhysicsList > m_physicsList
Definition: RunManager.h:111
std::string m_WriteFile
Definition: RunManager.h:164
bool firstRun
Definition: RunManager.h:117
void build(G4FieldManager *fM=nullptr, G4PropagatorInField *fP=nullptr, ChordFinderSetter *setter=nullptr)
Definition: FieldBuilder.cc:48
SimRunInterface * m_runInterface
Definition: RunManager.h:123
void terminateRun()
Definition: RunManager.cc:464
Cos< T >::type cos(const T &t)
Definition: Cos.h:22
string cmd
Definition: asciidump.py:19
int j
Definition: DBlmapReader.cc:9
bool m_RestorePhysicsTables
Definition: RunManager.h:129
void hepEvent(const HepMC::GenEvent *r)
Definition: G4SimEvent.h:25
std::vector< std::shared_ptr< SimWatcher > > m_watchers
Definition: RunManager.h:151
void setGenEvent(const HepMC::GenEvent *inpevt)
Definition: Generator.h:25
BeginOfEventSignal beginOfEventSignal_
SimActivityRegistry::EndOfTrackSignal m_endOfTrackSignal
void EndOfRunAction(const G4Run *aRun)
Definition: RunAction.cc:28
bool isValid() const
Definition: HandleBase.h:76
G4Run * m_currentRun
Definition: RunManager.h:119
void resetGenParticleId(edm::Event &inpevt)
Definition: RunManager.cc:498
EndOfRunSignal endOfRunSignal_
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:402
edm::ParameterSet m_pStackingAction
Definition: RunManager.h:139
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:138
bool m_runTerminated
Definition: RunManager.h:115
unsigned int nVertices() const
Definition: G4SimEvent.h:23
tuple out
Definition: dbtoconf.py:99
edm::ParameterSet m_pField
Definition: RunManager.h:133
edm::ParameterSet m_pPhysics
Definition: RunManager.h:136
edm::ParameterSet m_pSteppingAction
Definition: RunManager.h:141
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:317
RunAction * m_userRunAction
Definition: RunManager.h:122
void BeginOfRunAction(const G4Run *aRun)
Definition: RunAction.cc:16
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:508
bool check(const edm::EventSetup &iSetup)
Definition: ESWatcher.h:57
std::string m_InTag
Definition: RunManager.h:108
G4Event * generateEvent(edm::Event &inpevt)
Definition: RunManager.cc:354
void DumpMagneticField(const G4Field *) const
Definition: RunManager.cc:535
bool m_runInitialized
Definition: RunManager.h:114
SimActivityRegistry::BeginOfRunSignal m_beginOfRunSignal
Definition: RunAction.h:22
edm::EventID id() const
Definition: EventBase.h:56
sim::ChordFinderSetter * m_chordFinderSetter
Definition: RunManager.h:156
void Connect(RunAction *)
Definition: RunManager.cc:512
AttachSD * m_attach
Definition: RunManager.h:146
PrimaryTransformer * m_primaryTransformer
Definition: RunManager.h:112
sim::FieldBuilder * m_fieldBuilder
Definition: RunManager.h:155
std::string m_PhysicsTablesDir
Definition: RunManager.h:127
bool m_StorePhysicsTables
Definition: RunManager.h:128
void connect(SimActivityRegistry &iOther)
forwards our signals to slots connected to iOther
dbl *** dir
Definition: mlp_gen.cc:35
volatile std::atomic< bool > shutdown_flag false
EndOfTrackSignal endOfTrackSignal_
edm::ParameterSet m_pRunAction
Definition: RunManager.h:137
RunManager(edm::ParameterSet const &p)
Definition: RunManager.cc:111
edm::ParameterSet m_pTrackingAction
Definition: RunManager.h:140
void collisionPoint(const math::XYZTLorentzVectorD &v)
Definition: G4SimEvent.h:29
std::vector< std::string > m_G4Commands
Definition: RunManager.h:142
SurfaceDeformation * create(int type, const std::vector< double > &params)
SimActivityRegistry::BeginOfEventSignal m_beginOfEventSignal
Definition: EventAction.h:45
std::string m_FieldFile
Definition: RunManager.h:163
G4SimEvent * m_simEvent
Definition: RunManager.h:121
bool m_managerInitialized
Definition: RunManager.h:113
void initG4(const edm::EventSetup &es)
Definition: RunManager.cc:173
T get(const Candidate &c)
Definition: component.h:55
edm::InputTag m_theLHCTlinkTag
Definition: RunManager.h:161
*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:105
bool m_runAborted
Definition: RunManager.h:116
void produce(edm::Event &inpevt, const edm::EventSetup &es)
Definition: RunManager.cc:323
Definition: DDAxes.h:10
SimActivityRegistry::BeginOfTrackSignal m_beginOfTrackSignal