CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Private Attributes
CSCDigiProducer Class Reference

#include <CSCDigiProducer.h>

Inheritance diagram for CSCDigiProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Types

typedef CSCDigitizer::DigiSimLinks DigiSimLinks
 
- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 

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::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

edm::EDGetTokenT< CrossingFrame< PSimHit > > cf_token
 
std::string geometryType
 
CSCDigitizer theDigitizer
 
CSCStripConditionstheStripConditions
 

Additional Inherited Members

- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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 12 of file CSCDigiProducer.h.

Member Typedef Documentation

Definition at line 15 of file CSCDigiProducer.h.

Constructor & Destructor Documentation

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

Definition at line 27 of file CSCDigiProducer.cc.

References cf_token, Exception, geometryType, edm::ParameterSet::getParameter(), edm::Service< T >::isAvailable(), CSCDigitizer::setStripConditions(), AlCaHLTBitMon_QueryRunRegistry::string, muonCSCDigis_cfi::stripConditions, theDigitizer, and theStripConditions.

28 : theDigitizer(ps),
30 {
31  produces<CSCWireDigiCollection>("MuonCSCWireDigi");
32  produces<CSCStripDigiCollection>("MuonCSCStripDigi");
33  produces<CSCComparatorDigiCollection>("MuonCSCComparatorDigi");
34  produces<DigiSimLinks>("MuonCSCWireDigiSimLinks");
35  produces<DigiSimLinks>("MuonCSCStripDigiSimLinks");
36  std::string stripConditions( ps.getParameter<std::string>("stripConditions") );
37  geometryType = ps.getParameter<std::string>("GeometryType");
38  edm::ParameterSet stripPSet = ps.getParameter<edm::ParameterSet>("strips");
39  if( stripConditions == "Configurable" )
40  {
42  }
43  else if ( stripConditions == "Database" )
44  {
46  }
47  else
48  {
49  throw cms::Exception("CSCDigiProducer")
50  << "Bad option for strip conditions: "
51  << stripConditions;
52  }
54 
56  if ( ! rng.isAvailable()) {
57  throw cms::Exception("Configuration")
58  << "CSCDigitizer requires the RandomNumberGeneratorService\n"
59  "which is not present in the configuration file. You must add the service\n"
60  "in the configuration file or remove the modules that require it.";
61  }
62 
63  std::string mix_ = ps.getParameter<std::string>("mixLabel");
64  std::string collection_ = ps.getParameter<std::string>("InputCollection");
65  cf_token = consumes<CrossingFrame<PSimHit> >( edm::InputTag(mix_, collection_) );
66 }
T getParameter(std::string const &) const
CSCDigitizer theDigitizer
CSCStripConditions * theStripConditions
std::string geometryType
edm::EDGetTokenT< CrossingFrame< PSimHit > > cf_token
bool isAvailable() const
Definition: Service.h:46
void setStripConditions(CSCStripConditions *cond)
CSCDigiProducer::~CSCDigiProducer ( )
virtual

Definition at line 69 of file CSCDigiProducer.cc.

References theStripConditions.

70 {
71  delete theStripConditions;
72 }
CSCStripConditions * theStripConditions

Member Function Documentation

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

Produces the EDM products,

Definition at line 75 of file CSCDigiProducer.cc.

References cf_token, CSCDigitizer::doAction(), edm::EventID::event(), geometryType, edm::EventSetup::get(), edm::Event::getByToken(), edm::EventSetup::getData(), edm::RandomNumberGenerator::getEngine(), hfClusterShapes_cfi::hits, edm::EventBase::id(), CSCStripConditions::initializeEvent(), eostools::move(), edm::Handle< T >::product(), edm::Event::put(), edm::EventID::run(), CSCDigitizer::setGeometry(), CSCDigitizer::setMagneticField(), CSCDigitizer::setParticleDataTable(), edm::Event::streamID(), theDigitizer, and theStripConditions.

75  {
76 
77  edm::LogVerbatim("CSCDigitizer") << "[CSCDigiProducer::produce] starting event " <<
78  ev.id().event() << " of run " << ev.id().run();
80  CLHEP::HepRandomEngine* engine = &rng->getEngine(ev.streamID());
81 
83  ev.getByToken(cf_token, cf);
84 
85  std::unique_ptr<MixCollection<PSimHit> >
86  hits( new MixCollection<PSimHit>(cf.product()) );
87 
88  // Create empty output
89 
90  std::unique_ptr<CSCWireDigiCollection> pWireDigis(new CSCWireDigiCollection());
91  std::unique_ptr<CSCStripDigiCollection> pStripDigis(new CSCStripDigiCollection());
92  std::unique_ptr<CSCComparatorDigiCollection> pComparatorDigis(new CSCComparatorDigiCollection());
93  std::unique_ptr<DigiSimLinks> pWireDigiSimLinks(new DigiSimLinks() );
94  std::unique_ptr<DigiSimLinks> pStripDigiSimLinks(new DigiSimLinks() );
95 
96  //@@ DOES NOTHING IF NO HITS. Remove this for when there's real neutrons
97  if(hits->size() > 0)
98  {
99  // find the geometry & conditions for this event
101  eventSetup.get<MuonGeometryRecord>().get(geometryType,hGeom);
102  const CSCGeometry *pGeom = &*hGeom;
103 
104  theDigitizer.setGeometry( pGeom );
105 
106  // find the magnetic field
108  eventSetup.get<IdealMagneticFieldRecord>().get(magfield);
109 
110  theDigitizer.setMagneticField(&*magfield);
111 
112 
113  // set the particle table
115  eventSetup.getData( pdt );
117 
118  theStripConditions->initializeEvent(eventSetup);
119 
120  // run the digitizer
121  theDigitizer.doAction(*hits, *pWireDigis, *pStripDigis, *pComparatorDigis,
122  *pWireDigiSimLinks, *pStripDigiSimLinks, engine);
123  }
124 
125 
126  // store them in the event
127  ev.put(std::move(pWireDigis), "MuonCSCWireDigi");
128  ev.put(std::move(pStripDigis), "MuonCSCStripDigi");
129  ev.put(std::move(pComparatorDigis), "MuonCSCComparatorDigi");
130  ev.put(std::move(pWireDigiSimLinks), "MuonCSCWireDigiSimLinks");
131  ev.put(std::move(pStripDigiSimLinks), "MuonCSCStripDigiSimLinks");
132 }
CSCDigitizer::DigiSimLinks DigiSimLinks
CSCDigitizer theDigitizer
MuonDigiCollection< CSCDetId, CSCStripDigi > CSCStripDigiCollection
CSCStripConditions * theStripConditions
bool ev
virtual CLHEP::HepRandomEngine & getEngine(StreamID const &)=0
Use this engine in event methods.
virtual void initializeEvent(const edm::EventSetup &es)
std::string geometryType
MuonDigiCollection< CSCDetId, CSCComparatorDigi > CSCComparatorDigiCollection
edm::EDGetTokenT< CrossingFrame< PSimHit > > cf_token
MuonDigiCollection< CSCDetId, CSCWireDigi > CSCWireDigiCollection
T const * product() const
Definition: Handle.h:81
void setParticleDataTable(const ParticleDataTable *pdt)
void doAction(MixCollection< PSimHit > &simHits, CSCWireDigiCollection &wireDigis, CSCStripDigiCollection &stripDigis, CSCComparatorDigiCollection &comparators, DigiSimLinks &wireDigiSimLinks, DigiSimLinks &stripDigiSimLinks, CLHEP::HepRandomEngine *)
Definition: CSCDigitizer.cc:45
void setGeometry(const CSCGeometry *geom)
sets geometry
Definition: CSCDigitizer.h:62
void setMagneticField(const MagneticField *field)
sets the magnetic field
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

edm::EDGetTokenT<CrossingFrame<PSimHit> > CSCDigiProducer::cf_token
private

Definition at line 28 of file CSCDigiProducer.h.

Referenced by CSCDigiProducer(), and produce().

std::string CSCDigiProducer::geometryType
private

Definition at line 27 of file CSCDigiProducer.h.

Referenced by CSCDigiProducer(), and produce().

CSCDigitizer CSCDigiProducer::theDigitizer
private

Definition at line 25 of file CSCDigiProducer.h.

Referenced by CSCDigiProducer(), and produce().

CSCStripConditions* CSCDigiProducer::theStripConditions
private

Definition at line 26 of file CSCDigiProducer.h.

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