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
CSCDigiProducer Class Reference

#include <CSCDigiProducer.h>

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

Public Types

typedef CSCDigitizer::DigiSimLinks DigiSimLinks
 
- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
typedef WorkerT< EDProducerWorkerType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 

Public Member Functions

 CSCDigiProducer (const edm::ParameterSet &ps)
 
virtual void produce (edm::Event &e, const edm::EventSetup &c)
 
virtual ~CSCDigiProducer ()
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
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 ()
 
ProductHolderIndex indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndex > &) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

std::string collection_for_XF
 
std::string geometryType
 
std::string mix_
 
CSCDigitizer theDigitizer
 
CSCStripConditionstheStripConditions
 

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::EDProducer
CurrentProcessingContext const * currentContext () const
 
- 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 8 of file CSCDigiProducer.h.

Member Typedef Documentation

Definition at line 11 of file CSCDigiProducer.h.

Constructor & Destructor Documentation

CSCDigiProducer::CSCDigiProducer ( const edm::ParameterSet ps)
explicit

Definition at line 20 of file CSCDigiProducer.cc.

References collection_for_XF, edm::hlt::Exception, geometryType, edm::RandomNumberGenerator::getEngine(), edm::ParameterSet::getParameter(), edm::Service< T >::isAvailable(), mix_, CSCStripConditions::setRandomEngine(), CSCDigitizer::setRandomEngine(), CSCDigitizer::setStripConditions(), AlCaHLTBitMon_QueryRunRegistry::string, theDigitizer, and theStripConditions.

21 : theDigitizer(ps),
23 {
24  produces<CSCWireDigiCollection>("MuonCSCWireDigi");
25  produces<CSCStripDigiCollection>("MuonCSCStripDigi");
26  produces<CSCComparatorDigiCollection>("MuonCSCComparatorDigi");
27  produces<DigiSimLinks>("MuonCSCWireDigiSimLinks");
28  produces<DigiSimLinks>("MuonCSCStripDigiSimLinks");
29  std::string stripConditions( ps.getParameter<std::string>("stripConditions") );
30  geometryType = ps.getParameter<std::string>("GeometryType");
31  edm::ParameterSet stripPSet = ps.getParameter<edm::ParameterSet>("strips");
32  if( stripConditions == "Configurable" )
33  {
35  }
36  else if ( stripConditions == "Database" )
37  {
39  }
40  else
41  {
42  throw cms::Exception("CSCDigiProducer")
43  << "Bad option for strip conditions: "
44  << stripConditions;
45  }
47 
49  if ( ! rng.isAvailable()) {
50  throw cms::Exception("Configuration")
51  << "CSCDigitizer requires the RandomNumberGeneratorService\n"
52  "which is not present in the configuration file. You must add the service\n"
53  "in the configuration file or remove the modules that require it.";
54  }
55 
56  CLHEP::HepRandomEngine& engine = rng->getEngine();
57 
60 
61  //Name of Collection used for create the XF
62  mix_ = ps.getParameter<std::string>("mixLabel");
63  collection_for_XF = ps.getParameter<std::string>("InputCollection");
64 
65 }
T getParameter(std::string const &) const
CSCDigitizer theDigitizer
void setRandomEngine(CLHEP::HepRandomEngine &engine)
CSCStripConditions * theStripConditions
void setRandomEngine(CLHEP::HepRandomEngine &engine)
std::string geometryType
std::string mix_
bool isAvailable() const
Definition: Service.h:47
void setStripConditions(CSCStripConditions *cond)
virtual CLHEP::HepRandomEngine & getEngine() const =0
Use this to get the random number engine, this is the only function most users should call...
std::string collection_for_XF
CSCDigiProducer::~CSCDigiProducer ( )
virtual

Definition at line 68 of file CSCDigiProducer.cc.

References theStripConditions.

69 {
70  delete theStripConditions;
71 }
CSCStripConditions * theStripConditions

Member Function Documentation

void CSCDigiProducer::produce ( edm::Event e,
const edm::EventSetup c 
)
virtual

Produces the EDM products,

Implements edm::EDProducer.

Definition at line 74 of file CSCDigiProducer.cc.

References collection_for_XF, CSCDigitizer::doAction(), geometryType, edm::EventSetup::get(), edm::Event::getByLabel(), edm::EventSetup::getData(), CSCStripConditions::initializeEvent(), HLT_ES_cff::magfield, mix_, edm::Handle< T >::product(), edm::Event::put(), CSCDigitizer::setGeometry(), CSCDigitizer::setMagneticField(), CSCDigitizer::setParticleDataTable(), theDigitizer, and theStripConditions.

74  {
75 
78 
79  std::auto_ptr<MixCollection<PSimHit> >
80  hits( new MixCollection<PSimHit>(cf.product()) );
81 
82  // Create empty output
83 
84  std::auto_ptr<CSCWireDigiCollection> pWireDigis(new CSCWireDigiCollection());
85  std::auto_ptr<CSCStripDigiCollection> pStripDigis(new CSCStripDigiCollection());
86  std::auto_ptr<CSCComparatorDigiCollection> pComparatorDigis(new CSCComparatorDigiCollection());
87  std::auto_ptr<DigiSimLinks> pWireDigiSimLinks(new DigiSimLinks() );
88  std::auto_ptr<DigiSimLinks> pStripDigiSimLinks(new DigiSimLinks() );
89 
90  //@@ DOES NOTHING IF NO HITS. Remove this for when there's real neutrons
91  if(hits->size() > 0)
92  {
93  // find the geometry & conditions for this event
95  eventSetup.get<MuonGeometryRecord>().get(geometryType,hGeom);
96  const CSCGeometry *pGeom = &*hGeom;
97 
98  theDigitizer.setGeometry( pGeom );
99 
100  // find the magnetic field
102  eventSetup.get<IdealMagneticFieldRecord>().get(magfield);
103 
104  theDigitizer.setMagneticField(&*magfield);
105 
106 
107  // set the particle table
109  eventSetup.getData( pdt );
111 
112  theStripConditions->initializeEvent(eventSetup);
113 
114  // run the digitizer
115  theDigitizer.doAction(*hits, *pWireDigis, *pStripDigis, *pComparatorDigis,
116  *pWireDigiSimLinks, *pStripDigiSimLinks);
117  }
118 
119 
120  // store them in the event
121  e.put(pWireDigis, "MuonCSCWireDigi");
122  e.put(pStripDigis, "MuonCSCStripDigi");
123  e.put(pComparatorDigis, "MuonCSCComparatorDigi");
124  e.put(pWireDigiSimLinks, "MuonCSCWireDigiSimLinks");
125  e.put(pStripDigiSimLinks, "MuonCSCStripDigiSimLinks");
126 }
CSCDigitizer::DigiSimLinks DigiSimLinks
CSCDigitizer theDigitizer
tuple magfield
Definition: HLT_ES_cff.py:2311
MuonDigiCollection< CSCDetId, CSCStripDigi > CSCStripDigiCollection
CSCStripConditions * theStripConditions
virtual void initializeEvent(const edm::EventSetup &es)
std::string geometryType
MuonDigiCollection< CSCDetId, CSCComparatorDigi > CSCComparatorDigiCollection
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:94
std::string mix_
void doAction(MixCollection< PSimHit > &simHits, CSCWireDigiCollection &wireDigis, CSCStripDigiCollection &stripDigis, CSCComparatorDigiCollection &comparators, DigiSimLinks &wireDigiSimLinks, DigiSimLinks &stripDigiSimLinks)
Definition: CSCDigitizer.cc:45
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:361
MuonDigiCollection< CSCDetId, CSCWireDigi > CSCWireDigiCollection
void setParticleDataTable(const ParticleDataTable *pdt)
T const * product() const
Definition: Handle.h:74
std::string collection_for_XF
void setGeometry(const CSCGeometry *geom)
sets geometry
Definition: CSCDigitizer.h:57
void setMagneticField(const MagneticField *field)
sets the magnetic field

Member Data Documentation

std::string CSCDigiProducer::collection_for_XF
private

Definition at line 27 of file CSCDigiProducer.h.

Referenced by CSCDigiProducer(), and produce().

std::string CSCDigiProducer::geometryType
private

Definition at line 24 of file CSCDigiProducer.h.

Referenced by CSCDigiProducer(), and produce().

std::string CSCDigiProducer::mix_
private

Definition at line 26 of file CSCDigiProducer.h.

Referenced by CSCDigiProducer(), and produce().

CSCDigitizer CSCDigiProducer::theDigitizer
private

Definition at line 21 of file CSCDigiProducer.h.

Referenced by CSCDigiProducer(), and produce().

CSCStripConditions* CSCDigiProducer::theStripConditions
private

Definition at line 22 of file CSCDigiProducer.h.

Referenced by CSCDigiProducer(), produce(), and ~CSCDigiProducer().