#include <GeometryProducer.h>
Definition at line 29 of file GeometryProducer.h.
typedef std::vector<boost::shared_ptr<SimProducer> > GeometryProducer::Producers |
Definition at line 32 of file GeometryProducer.h.
GeometryProducer::GeometryProducer | ( | edm::ParameterSet const & | p | ) | [explicit] |
Definition at line 57 of file GeometryProducer.cc.
References SimActivityRegistry::connect(), createWatchers(), m_p, m_producers, m_registry, and m_watchers.
: m_kernel(0), m_pUseMagneticField(p.getParameter<bool>("UseMagneticField")), m_pField(p.getParameter<edm::ParameterSet>("MagneticField")), m_pUseSensitiveDetectors(p.getParameter<bool>("UseSensitiveDetectors")), m_attach(0), m_p(p) { //Look for an outside SimActivityRegistry //this is used by the visualization code edm::Service<SimActivityRegistry> otherRegistry; if (otherRegistry) m_registry.connect(*otherRegistry); createWatchers(m_p, m_registry, m_watchers, m_producers); produces<int>(); }
GeometryProducer::~GeometryProducer | ( | ) | [virtual] |
void GeometryProducer::beginJob | ( | void | ) | [virtual] |
void GeometryProducer::endJob | ( | void | ) | [virtual] |
Reimplemented from edm::EDProducer.
Definition at line 81 of file GeometryProducer.cc.
References gather_cfg::cout.
{ std::cout << " GeometryProducer terminating " << std::endl; }
void GeometryProducer::produce | ( | edm::Event & | e, |
const edm::EventSetup & | c | ||
) | [virtual] |
Implements edm::EDProducer.
Definition at line 84 of file GeometryProducer.cc.
References gather_cfg::cout, AttachSD::create(), SimActivityRegistry::dddWorldSignal_, g, edm::EventSetup::get(), m_attach, m_fieldBuilder, m_kernel, m_p, m_pField, m_producers, m_pUseMagneticField, m_pUseSensitiveDetectors, m_registry, m_sensCaloDets, m_sensTkDets, and m_trackManager.
{ m_kernel = G4RunManagerKernel::GetRunManagerKernel(); if (m_kernel==0) m_kernel = new G4RunManagerKernel(); std::cout << " GeometryProducer initializing " << std::endl; // DDDWorld: get the DDCV from the ES and use it to build the World edm::ESTransientHandle<DDCompactView> pDD; es.get<IdealGeometryRecord>().get(pDD); G4LogicalVolumeToDDLogicalPartMap map_; SensitiveDetectorCatalog catalog_; const DDDWorld * world = new DDDWorld(&(*pDD), map_, catalog_, false); m_registry.dddWorldSignal_(world); if (m_pUseMagneticField) { // setup the magnetic field edm::ESHandle<MagneticField> pMF; es.get<IdealMagneticFieldRecord>().get(pMF); const GlobalPoint g(0.,0.,0.); std::cout << "B-field(T) at (0,0,0)(cm): " << pMF->inTesla(g) << std::endl; m_fieldBuilder = std::auto_ptr<sim::FieldBuilder> (new sim::FieldBuilder(&(*pMF), m_pField)); // G4TransportationManager * tM = G4TransportationManager::GetTransportationManager(); // m_fieldBuilder->configure("MagneticFieldType",tM->GetFieldManager(),tM->GetPropagatorInField()); } if (m_pUseSensitiveDetectors) { std::cout << " instantiating sensitive detectors " << std::endl; // instantiate and attach the sensitive detectors m_trackManager = std::auto_ptr<SimTrackManager>(new SimTrackManager); if (m_attach==0) m_attach = new AttachSD; { std::pair< std::vector<SensitiveTkDetector*>, std::vector<SensitiveCaloDetector*> > sensDets = m_attach->create(*world,(*pDD),catalog_,m_p,m_trackManager.get(),m_registry); m_sensTkDets.swap(sensDets.first); m_sensCaloDets.swap(sensDets.second); } std::cout << " Sensitive Detector building finished; found " << m_sensTkDets.size() << " Tk type Producers, and " << m_sensCaloDets.size() << " Calo type producers " << std::endl; } for(Producers::iterator itProd = m_producers.begin();itProd != m_producers.end(); ++itProd) { (*itProd)->produce(e,es); } }
std::vector<boost::shared_ptr<SimProducer> > GeometryProducer::producers | ( | ) | const [inline] |
std::vector<SensitiveCaloDetector*>& GeometryProducer::sensCaloDetectors | ( | ) | [inline] |
Definition at line 41 of file GeometryProducer.h.
References m_sensCaloDets.
{ return m_sensCaloDets; }
std::vector<SensitiveTkDetector*>& GeometryProducer::sensTkDetectors | ( | ) | [inline] |
AttachSD* GeometryProducer::m_attach [private] |
Definition at line 52 of file GeometryProducer.h.
Referenced by produce(), and ~GeometryProducer().
std::auto_ptr<sim::FieldBuilder> GeometryProducer::m_fieldBuilder [private] |
Definition at line 50 of file GeometryProducer.h.
Referenced by produce().
G4RunManagerKernel* GeometryProducer::m_kernel [private] |
Definition at line 43 of file GeometryProducer.h.
Referenced by produce(), and ~GeometryProducer().
edm::ParameterSet GeometryProducer::m_p [private] |
Definition at line 55 of file GeometryProducer.h.
Referenced by GeometryProducer(), and produce().
edm::ParameterSet GeometryProducer::m_pField [private] |
Definition at line 45 of file GeometryProducer.h.
Referenced by produce().
std::vector<boost::shared_ptr<SimProducer> > GeometryProducer::m_producers [private] |
Definition at line 49 of file GeometryProducer.h.
Referenced by GeometryProducer(), produce(), and producers().
bool GeometryProducer::m_pUseMagneticField [private] |
Definition at line 44 of file GeometryProducer.h.
Referenced by produce().
bool GeometryProducer::m_pUseSensitiveDetectors [private] |
Definition at line 46 of file GeometryProducer.h.
Referenced by produce().
Definition at line 47 of file GeometryProducer.h.
Referenced by GeometryProducer(), and produce().
std::vector<SensitiveCaloDetector*> GeometryProducer::m_sensCaloDets [private] |
Definition at line 54 of file GeometryProducer.h.
Referenced by produce(), and sensCaloDetectors().
std::vector<SensitiveTkDetector*> GeometryProducer::m_sensTkDets [private] |
Definition at line 53 of file GeometryProducer.h.
Referenced by produce(), and sensTkDetectors().
std::auto_ptr<SimTrackManager> GeometryProducer::m_trackManager [private] |
Definition at line 51 of file GeometryProducer.h.
Referenced by produce().
std::vector<boost::shared_ptr<SimWatcher> > GeometryProducer::m_watchers [private] |
Definition at line 48 of file GeometryProducer.h.
Referenced by GeometryProducer().