CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Attributes
CSCDigiToRawModule Class Reference
Inheritance diagram for CSCDigiToRawModule:
edm::global::EDProducer<> edm::global::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 CSCDigiToRawModule (const edm::ParameterSet &pset)
 Constructor. More...
 
void produce (edm::StreamID, edm::Event &, const edm::EventSetup &) const override
 
- Public Member Functions inherited from edm::global::EDProducer<>
 EDProducer ()=default
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsStreamLuminosityBlocks () const final
 
bool wantsStreamRuns () const final
 
- Public Member Functions inherited from edm::global::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- 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 ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
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, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
 ~ProducerBase () noexcept(false) override
 
- 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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::global::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Attributes

edm::EDGetTokenT< CSCALCTDigiCollectional_token
 
edm::EDGetTokenT< CSCComparatorDigiCollectioncd_token
 
edm::EDGetTokenT< CSCCLCTDigiCollectioncl_token
 
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollectionco_token
 
std::unique_ptr< const CSCDigiToRawpacker_
 
bool packEverything_
 
edm::EDGetTokenT< CSCCLCTPreTriggerCollectionpr_token
 
edm::EDPutTokenT< FEDRawDataCollectionput_token_
 
edm::EDGetTokenT< CSCStripDigiCollectionsd_token
 
unsigned int theFormatVersion
 
bool usePreTriggers
 
edm::EDGetTokenT< CSCWireDigiCollectionwd_token
 

Additional Inherited Members

- Public Types inherited from edm::global::EDProducerBase
typedef EDProducerBase ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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 38 of file CSCDigiToRawModule.cc.

Constructor & Destructor Documentation

CSCDigiToRawModule::CSCDigiToRawModule ( const edm::ParameterSet pset)

Constructor.

Definition at line 69 of file CSCDigiToRawModule.cc.

References al_token, cd_token, cl_token, co_token, edm::ParameterSet::getParameter(), packEverything_, pr_token, put_token_, sd_token, theFormatVersion, usePreTriggers, and wd_token.

69  :
70  packer_( std::make_unique<CSCDigiToRaw>(pset))
71 {
72  //theStrip = pset.getUntrackedParameter<string>("DigiCreator", "cscunpacker");
73 
74  theFormatVersion = pset.getParameter<unsigned int>("useFormatVersion"); // pre-LS1 - '2005'. post-LS1 - '2013'
75  usePreTriggers = pset.getParameter<bool>("usePreTriggers"); // disable checking CLCT PreTriggers digis
76  packEverything_ = pset.getParameter<bool>("packEverything"); // don't check for consistency with trig primitives
77  // overrides usePreTriggers
78 
79  wd_token = consumes<CSCWireDigiCollection>( pset.getParameter<edm::InputTag>("wireDigiTag") );
80  sd_token = consumes<CSCStripDigiCollection>( pset.getParameter<edm::InputTag>("stripDigiTag") );
81  cd_token = consumes<CSCComparatorDigiCollection>( pset.getParameter<edm::InputTag>("comparatorDigiTag") );
82  if(usePreTriggers) {
83  pr_token = consumes<CSCCLCTPreTriggerCollection>( pset.getParameter<edm::InputTag>("preTriggerTag") );
84  }
85  al_token = consumes<CSCALCTDigiCollection>( pset.getParameter<edm::InputTag>("alctDigiTag") );
86  cl_token = consumes<CSCCLCTDigiCollection>( pset.getParameter<edm::InputTag>("clctDigiTag") );
87  co_token = consumes<CSCCorrelatedLCTDigiCollection>( pset.getParameter<edm::InputTag>("correlatedLCTDigiTag") );
88 
89  put_token_ = produces<FEDRawDataCollection>("CSCRawData");
90 
91 }
T getParameter(std::string const &) const
edm::EDGetTokenT< CSCCLCTPreTriggerCollection > pr_token
edm::EDPutTokenT< FEDRawDataCollection > put_token_
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > co_token
edm::EDGetTokenT< CSCComparatorDigiCollection > cd_token
edm::EDGetTokenT< CSCWireDigiCollection > wd_token
unsigned int theFormatVersion
edm::EDGetTokenT< CSCCLCTDigiCollection > cl_token
edm::EDGetTokenT< CSCALCTDigiCollection > al_token
std::unique_ptr< const CSCDigiToRaw > packer_
edm::EDGetTokenT< CSCStripDigiCollection > sd_token

Member Function Documentation

void CSCDigiToRawModule::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 94 of file CSCDigiToRawModule.cc.

References edm::ConfigurationDescriptions::add(), and edm::ParameterSetDescription::add().

94  {
95 /*** From python/cscPacker_cfi.py
96  wireDigiTag = cms.InputTag("simMuonCSCDigis","MuonCSCWireDigi"),
97  stripDigiTag = cms.InputTag("simMuonCSCDigis","MuonCSCStripDigi"),
98  comparatorDigiTag = cms.InputTag("simMuonCSCDigis","MuonCSCComparatorDigi"),
99  alctDigiTag = cms.InputTag("simCscTriggerPrimitiveDigis"),
100  clctDigiTag = cms.InputTag("simCscTriggerPrimitiveDigis"),
101  preTriggerTag = cms.InputTag("simCscTriggerPrimitiveDigis"),
102  correlatedLCTDigiTag = cms.InputTag("simCscTriggerPrimitiveDigis", "MPCSORTED"),
103  # if min parameter = -999 always accept
104  alctWindowMin = cms.int32(-3),
105  alctWindowMax = cms.int32(3),
106  clctWindowMin = cms.int32(-3),
107  clctWindowMax = cms.int32(3),
108  preTriggerWindowMin = cms.int32(-3),
109  preTriggerWindowMax = cms.int32(1)
110 */
111 
113 
114  desc.add<unsigned int>("useFormatVersion",2005)->
115  setComment("Set to 2005 for pre-LS1 CSC data format, 2013 - new post-LS1 CSC data format");
116  desc.add<bool>("usePreTriggers", true)->
117  setComment("Set to false if CSCCLCTPreTrigger digis are not available");
118  desc.add<bool>("packEverything", false)->
119  setComment("Set to true to disable trigger-related constraints on readout data");
120 
121  desc.add<edm::InputTag>("wireDigiTag", edm::InputTag("simMuonCSCDigis","MuonCSCWireDigi"));
122  desc.add<edm::InputTag>("stripDigiTag",edm::InputTag("simMuonCSCDigis","MuonCSCStripDigi"));
123  desc.add<edm::InputTag>("comparatorDigiTag", edm::InputTag("simMuonCSCDigis","MuonCSCComparatorDigi"));
124  desc.add<edm::InputTag>("alctDigiTag",edm::InputTag("simCscTriggerPrimitiveDigis"));
125  desc.add<edm::InputTag>("clctDigiTag",edm::InputTag("simCscTriggerPrimitiveDigis"));
126  desc.add<edm::InputTag>("preTriggerTag", edm::InputTag("simCscTriggerPrimitiveDigis"));
127  desc.add<edm::InputTag>("correlatedLCTDigiTag",edm::InputTag("simCscTriggerPrimitiveDigis", "MPCSORTED"));
128 
129  desc.add<int32_t>("alctWindowMin", -3)->
130  setComment("If min parameter = -999 always accept");
131  desc.add<int32_t>("alctWindowMax", 3);
132  desc.add<int32_t>("clctWindowMin", -3)->
133  setComment("If min parameter = -999 always accept");
134  desc.add<int32_t>("clctWindowMax", 3);
135  desc.add<int32_t>("preTriggerWindowMin", -3)->
136  setComment("If min parameter = -999 always accept");
137  desc.add<int32_t>("preTriggerWindowMax", 1);
138 
139  descriptions.add("cscPacker", desc);
140 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void CSCDigiToRawModule::produce ( edm::StreamID  ,
edm::Event e,
const edm::EventSetup c 
) const
override

reverse mapping for packer

Definition at line 143 of file CSCDigiToRawModule.cc.

References al_token, cd_token, cl_token, co_token, DEFINE_FWK_MODULE, edm::Event::emplace(), edm::EventSetup::get(), edm::Event::getByToken(), eostools::move(), packer_, packEverything_, pr_token, edm::ESHandle< T >::product(), put_token_, sd_token, theFormatVersion, usePreTriggers, and wd_token.

Referenced by JSONExport.JsonExport::export(), HTMLExport.HTMLExport::export(), and HTMLExport.HTMLExportStatic::export().

143  {
146  c.get<CSCChamberMapRcd>().get(hcham);
147  const CSCChamberMap* theMapping = hcham.product();
148 
149  FEDRawDataCollection fed_buffers;
150 
151  // Take digis from the event
159 
160  e.getByToken( wd_token, wireDigis );
161  e.getByToken( sd_token, stripDigis );
162  e.getByToken( cd_token, comparatorDigis );
163  e.getByToken( al_token, alctDigis );
164  e.getByToken( cl_token, clctDigis );
165  if (usePreTriggers)
166  e.getByToken( pr_token, preTriggers );
167  e.getByToken( co_token, correlatedLCTDigis );
168 
169  // Create the packed data
170  packer_->createFedBuffers(*stripDigis, *wireDigis, *comparatorDigis,
171  *alctDigis, *clctDigis, *preTriggers, *correlatedLCTDigis,
172  fed_buffers, theMapping, e, theFormatVersion, usePreTriggers,
174 
175  // put the raw data to the event
176  e.emplace(put_token_, std::move(fed_buffers));
177 }
edm::EDGetTokenT< CSCCLCTPreTriggerCollection > pr_token
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
edm::EDPutTokenT< FEDRawDataCollection > put_token_
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > co_token
edm::EDGetTokenT< CSCComparatorDigiCollection > cd_token
edm::EDGetTokenT< CSCWireDigiCollection > wd_token
unsigned int theFormatVersion
edm::EDGetTokenT< CSCCLCTDigiCollection > cl_token
OrphanHandle< PROD > emplace(EDPutTokenT< PROD > token, Args &&...args)
puts a new product
Definition: Event.h:453
edm::EDGetTokenT< CSCALCTDigiCollection > al_token
std::unique_ptr< const CSCDigiToRaw > packer_
T get() const
Definition: EventSetup.h:62
edm::EDGetTokenT< CSCStripDigiCollection > sd_token
T const * product() const
Definition: ESHandle.h:86
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

edm::EDGetTokenT<CSCALCTDigiCollection> CSCDigiToRawModule::al_token
private

Definition at line 60 of file CSCDigiToRawModule.cc.

Referenced by CSCDigiToRawModule(), and produce().

edm::EDGetTokenT<CSCComparatorDigiCollection> CSCDigiToRawModule::cd_token
private

Definition at line 59 of file CSCDigiToRawModule.cc.

Referenced by CSCDigiToRawModule(), and produce().

edm::EDGetTokenT<CSCCLCTDigiCollection> CSCDigiToRawModule::cl_token
private

Definition at line 61 of file CSCDigiToRawModule.cc.

Referenced by CSCDigiToRawModule(), and produce().

edm::EDGetTokenT<CSCCorrelatedLCTDigiCollection> CSCDigiToRawModule::co_token
private

Definition at line 63 of file CSCDigiToRawModule.cc.

Referenced by CSCDigiToRawModule(), and produce().

std::unique_ptr<const CSCDigiToRaw> CSCDigiToRawModule::packer_
private

Definition at line 55 of file CSCDigiToRawModule.cc.

Referenced by produce().

bool CSCDigiToRawModule::packEverything_
private

Definition at line 53 of file CSCDigiToRawModule.cc.

Referenced by CSCDigiToRawModule(), and produce().

edm::EDGetTokenT<CSCCLCTPreTriggerCollection> CSCDigiToRawModule::pr_token
private

Definition at line 62 of file CSCDigiToRawModule.cc.

Referenced by CSCDigiToRawModule(), and produce().

edm::EDPutTokenT<FEDRawDataCollection> CSCDigiToRawModule::put_token_
private

Definition at line 65 of file CSCDigiToRawModule.cc.

Referenced by CSCDigiToRawModule(), and produce().

edm::EDGetTokenT<CSCStripDigiCollection> CSCDigiToRawModule::sd_token
private

Definition at line 58 of file CSCDigiToRawModule.cc.

Referenced by CSCDigiToRawModule(), and produce().

unsigned int CSCDigiToRawModule::theFormatVersion
private

Definition at line 51 of file CSCDigiToRawModule.cc.

Referenced by CSCDigiToRawModule(), and produce().

bool CSCDigiToRawModule::usePreTriggers
private

Definition at line 52 of file CSCDigiToRawModule.cc.

Referenced by CSCDigiToRawModule(), and produce().

edm::EDGetTokenT<CSCWireDigiCollection> CSCDigiToRawModule::wd_token
private

Definition at line 57 of file CSCDigiToRawModule.cc.

Referenced by CSCDigiToRawModule(), and produce().