CMS 3D CMS Logo

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