CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Types | Public Member Functions | Private Attributes
GeometryProducer Class Reference

#include <GeometryProducer.h>

Inheritance diagram for GeometryProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Types

typedef std::vector
< boost::shared_ptr
< SimProducer > > 
Producers
 
- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 

Public Member Functions

virtual void beginJob ()
 
virtual void endJob ()
 
 GeometryProducer (edm::ParameterSet const &p)
 
virtual void produce (edm::Event &e, const edm::EventSetup &c)
 
std::vector< boost::shared_ptr
< SimProducer > > 
producers () const
 
std::vector
< SensitiveCaloDetector * > & 
sensCaloDetectors ()
 
std::vector
< SensitiveTkDetector * > & 
sensTkDetectors ()
 
virtual ~GeometryProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

AttachSDm_attach
 
std::auto_ptr< sim::FieldBuilderm_fieldBuilder
 
G4RunManagerKernel * m_kernel
 
edm::ParameterSet m_p
 
edm::ParameterSet m_pField
 
std::vector< boost::shared_ptr
< SimProducer > > 
m_producers
 
bool m_pUseMagneticField
 
bool m_pUseSensitiveDetectors
 
SimActivityRegistry m_registry
 
std::vector
< SensitiveCaloDetector * > 
m_sensCaloDets
 
std::vector
< SensitiveTkDetector * > 
m_sensTkDets
 
std::auto_ptr< SimTrackManagerm_trackManager
 
std::vector< boost::shared_ptr
< SimWatcher > > 
m_watchers
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 29 of file GeometryProducer.h.

Member Typedef Documentation

typedef std::vector<boost::shared_ptr<SimProducer> > GeometryProducer::Producers

Definition at line 32 of file GeometryProducer.h.

Constructor & Destructor Documentation

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.

57  :
58  m_kernel(0),
59  m_pUseMagneticField(p.getParameter<bool>("UseMagneticField")),
60  m_pField(p.getParameter<edm::ParameterSet>("MagneticField")),
61  m_pUseSensitiveDetectors(p.getParameter<bool>("UseSensitiveDetectors")),
62  m_attach(0), m_p(p)
63 {
64  //Look for an outside SimActivityRegistry
65  //this is used by the visualization code
67  if (otherRegistry) m_registry.connect(*otherRegistry);
69  produces<int>();
70 }
edm::ParameterSet m_pField
G4RunManagerKernel * m_kernel
SimActivityRegistry m_registry
std::vector< boost::shared_ptr< SimWatcher > > m_watchers
std::vector< boost::shared_ptr< SimProducer > > m_producers
static void createWatchers(const edm::ParameterSet &iP, SimActivityRegistry &iReg, std::vector< boost::shared_ptr< SimWatcher > > &oWatchers, std::vector< boost::shared_ptr< SimProducer > > &oProds)
void connect(SimActivityRegistry &iOther)
forwards our signals to slots connected to iOther
edm::ParameterSet m_p
GeometryProducer::~GeometryProducer ( )
virtual

Definition at line 72 of file GeometryProducer.cc.

References m_attach, and m_kernel.

73 {
74  if (m_attach!=0) delete m_attach;
75  if (m_kernel!=0) delete m_kernel;
76 }
G4RunManagerKernel * m_kernel

Member Function Documentation

void GeometryProducer::beginJob ( void  )
virtual

Reimplemented from edm::EDProducer.

Definition at line 78 of file GeometryProducer.cc.

78  {
79 }
void GeometryProducer::endJob ( void  )
virtual

Reimplemented from edm::EDProducer.

Definition at line 81 of file GeometryProducer.cc.

References gather_cfg::cout.

82 { std::cout << " GeometryProducer terminating " << std::endl; }
tuple cout
Definition: gather_cfg.py:121
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.

85 {
86  m_kernel = G4RunManagerKernel::GetRunManagerKernel();
87  if (m_kernel==0) m_kernel = new G4RunManagerKernel();
88  std::cout << " GeometryProducer initializing " << std::endl;
89  // DDDWorld: get the DDCV from the ES and use it to build the World
91  es.get<IdealGeometryRecord>().get(pDD);
92 
94  SensitiveDetectorCatalog catalog_;
95  const DDDWorld * world = new DDDWorld(&(*pDD), map_, catalog_, false);
97 
99  {
100  // setup the magnetic field
102  es.get<IdealMagneticFieldRecord>().get(pMF);
103  const GlobalPoint g(0.,0.,0.);
104  std::cout << "B-field(T) at (0,0,0)(cm): " << pMF->inTesla(g) << std::endl;
105 
106  m_fieldBuilder = std::auto_ptr<sim::FieldBuilder>
107  (new sim::FieldBuilder(&(*pMF), m_pField));
108  // G4TransportationManager * tM = G4TransportationManager::GetTransportationManager();
109  // m_fieldBuilder->configure("MagneticFieldType",tM->GetFieldManager(),tM->GetPropagatorInField());
110  }
111 
113  {
114  std::cout << " instantiating sensitive detectors " << std::endl;
115  // instantiate and attach the sensitive detectors
116  m_trackManager = std::auto_ptr<SimTrackManager>(new SimTrackManager);
117  if (m_attach==0) m_attach = new AttachSD;
118  {
119  std::pair< std::vector<SensitiveTkDetector*>,
120  std::vector<SensitiveCaloDetector*> >
121  sensDets = m_attach->create(*world,(*pDD),catalog_,m_p,m_trackManager.get(),m_registry);
122 
123  m_sensTkDets.swap(sensDets.first);
124  m_sensCaloDets.swap(sensDets.second);
125  }
126 
127  std::cout << " Sensitive Detector building finished; found " << m_sensTkDets.size()
128  << " Tk type Producers, and " << m_sensCaloDets.size()
129  << " Calo type producers " << std::endl;
130  }
131  for(Producers::iterator itProd = m_producers.begin();itProd != m_producers.end();
132  ++itProd) { (*itProd)->produce(e,es); }
133 }
std::pair< std::vector< SensitiveTkDetector * >, std::vector< SensitiveCaloDetector * > > create(const DDDWorld &w, const DDCompactView &cpv, SensitiveDetectorCatalog &clg, edm::ParameterSet const &p, const SimTrackManager *m, SimActivityRegistry &reg) const
Definition: AttachSD.cc:23
edm::ParameterSet m_pField
std::auto_ptr< SimTrackManager > m_trackManager
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
G4RunManagerKernel * m_kernel
SimActivityRegistry m_registry
std::vector< SensitiveTkDetector * > m_sensTkDets
DDDWorldSignal dddWorldSignal_
std::auto_ptr< sim::FieldBuilder > m_fieldBuilder
std::vector< boost::shared_ptr< SimProducer > > m_producers
tuple cout
Definition: gather_cfg.py:121
edm::ParameterSet m_p
std::vector< SensitiveCaloDetector * > m_sensCaloDets
std::vector<boost::shared_ptr<SimProducer> > GeometryProducer::producers ( ) const
inline

Definition at line 38 of file GeometryProducer.h.

References m_producers.

39  { return m_producers; }
std::vector< boost::shared_ptr< SimProducer > > m_producers
std::vector<SensitiveCaloDetector*>& GeometryProducer::sensCaloDetectors ( )
inline

Definition at line 41 of file GeometryProducer.h.

References m_sensCaloDets.

41 { return m_sensCaloDets; }
std::vector< SensitiveCaloDetector * > m_sensCaloDets
std::vector<SensitiveTkDetector*>& GeometryProducer::sensTkDetectors ( )
inline

Definition at line 40 of file GeometryProducer.h.

References m_sensTkDets.

40 { return m_sensTkDets; }
std::vector< SensitiveTkDetector * > m_sensTkDets

Member Data Documentation

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().

SimActivityRegistry GeometryProducer::m_registry
private

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().