CMS 3D CMS Logo

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

#include <CSCDigiToRawModule.h>

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

Public Member Functions

 CSCDigiToRawModule (const edm::ParameterSet &pset)
 Constructor. More...
 
virtual void produce (edm::Event &, const edm::EventSetup &)
 
virtual ~CSCDigiToRawModule ()
 Destructor. More...
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducer ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 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
std::vector< ConsumesInfoconsumesInfo () const
 
 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
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Static Public Member Functions

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

Private Attributes

edm::EDGetTokenT
< CSCALCTDigiCollection
al_token
 
edm::EDGetTokenT
< CSCComparatorDigiCollection
cd_token
 
edm::EDGetTokenT
< CSCCLCTDigiCollection
cl_token
 
edm::EDGetTokenT
< CSCCorrelatedLCTDigiCollection
co_token
 
CSCDigiToRawpacker
 
bool packEverything_
 
edm::EDGetTokenT
< CSCCLCTPreTriggerCollection
pr_token
 
edm::EDGetTokenT
< CSCStripDigiCollection
sd_token
 
unsigned int theFormatVersion
 
bool usePreTriggers
 
edm::EDGetTokenT
< CSCWireDigiCollection
wd_token
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
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

Author
A. Tumanov - Rice

Definition at line 29 of file CSCDigiToRawModule.h.

Constructor & Destructor Documentation

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

Constructor.

Definition at line 17 of file CSCDigiToRawModule.cc.

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

17  :
18  packer(new CSCDigiToRaw(pset))
19 {
20  //theStrip = pset.getUntrackedParameter<string>("DigiCreator", "cscunpacker");
21 
22  theFormatVersion = pset.getParameter<unsigned int>("useFormatVersion"); // pre-LS1 - '2005'. post-LS1 - '2013'
23  usePreTriggers = pset.getParameter<bool>("usePreTriggers"); // disable checking CLCT PreTriggers digis
24  packEverything_ = pset.getParameter<bool>("packEverything"); // don't check for consistency with trig primitives
25  // overrides usePreTriggers
26 
27  wd_token = consumes<CSCWireDigiCollection>( pset.getParameter<edm::InputTag>("wireDigiTag") );
28  sd_token = consumes<CSCStripDigiCollection>( pset.getParameter<edm::InputTag>("stripDigiTag") );
29  cd_token = consumes<CSCComparatorDigiCollection>( pset.getParameter<edm::InputTag>("comparatorDigiTag") );
30  pr_token = consumes<CSCCLCTPreTriggerCollection>( pset.getParameter<edm::InputTag>("preTriggerTag") );
31  al_token = consumes<CSCALCTDigiCollection>( pset.getParameter<edm::InputTag>("alctDigiTag") );
32  cl_token = consumes<CSCCLCTDigiCollection>( pset.getParameter<edm::InputTag>("clctDigiTag") );
33  co_token = consumes<CSCCorrelatedLCTDigiCollection>( pset.getParameter<edm::InputTag>("correlatedLCTDigiTag") );
34 
35  produces<FEDRawDataCollection>("CSCRawData");
36 
37 }
T getParameter(std::string const &) const
edm::EDGetTokenT< CSCCLCTPreTriggerCollection > pr_token
CSCDigiToRaw * packer
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
edm::EDGetTokenT< CSCStripDigiCollection > sd_token
CSCDigiToRawModule::~CSCDigiToRawModule ( )
virtual

Destructor.

Definition at line 40 of file CSCDigiToRawModule.cc.

References packer.

40  {
41  delete packer;
42 }
CSCDigiToRaw * packer

Member Function Documentation

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

Definition at line 44 of file CSCDigiToRawModule.cc.

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

44  {
45 /*** From python/cscPacker_cfi.py
46  wireDigiTag = cms.InputTag("simMuonCSCDigis","MuonCSCWireDigi"),
47  stripDigiTag = cms.InputTag("simMuonCSCDigis","MuonCSCStripDigi"),
48  comparatorDigiTag = cms.InputTag("simMuonCSCDigis","MuonCSCComparatorDigi"),
49  alctDigiTag = cms.InputTag("simCscTriggerPrimitiveDigis"),
50  clctDigiTag = cms.InputTag("simCscTriggerPrimitiveDigis"),
51  preTriggerTag = cms.InputTag("simCscTriggerPrimitiveDigis"),
52  correlatedLCTDigiTag = cms.InputTag("simCscTriggerPrimitiveDigis", "MPCSORTED"),
53  # if min parameter = -999 always accept
54  alctWindowMin = cms.int32(-3),
55  alctWindowMax = cms.int32(3),
56  clctWindowMin = cms.int32(-3),
57  clctWindowMax = cms.int32(3),
58  preTriggerWindowMin = cms.int32(-3),
59  preTriggerWindowMax = cms.int32(1)
60 */
61 
63 
64  desc.add<unsigned int>("useFormatVersion",2005)->
65  setComment("Set to 2005 for pre-LS1 CSC data format, 2013 - new post-LS1 CSC data format");
66  desc.add<bool>("usePreTriggers", true)->
67  setComment("Set to false if CSCCLCTPreTrigger digis are not available");
68  desc.add<bool>("packEverything", false)->
69  setComment("Set to true to disable trigger-related constraints on readout data");
70 
71  desc.add<edm::InputTag>("wireDigiTag", edm::InputTag("simMuonCSCDigis","MuonCSCWireDigi"));
72  desc.add<edm::InputTag>("stripDigiTag",edm::InputTag("simMuonCSCDigis","MuonCSCStripDigi"));
73  desc.add<edm::InputTag>("comparatorDigiTag", edm::InputTag("simMuonCSCDigis","MuonCSCComparatorDigi"));
74  desc.add<edm::InputTag>("alctDigiTag",edm::InputTag("simCscTriggerPrimitiveDigis"));
75  desc.add<edm::InputTag>("clctDigiTag",edm::InputTag("simCscTriggerPrimitiveDigis"));
76  desc.add<edm::InputTag>("preTriggerTag", edm::InputTag("simCscTriggerPrimitiveDigis"));
77  desc.add<edm::InputTag>("correlatedLCTDigiTag",edm::InputTag("simCscTriggerPrimitiveDigis", "MPCSORTED"));
78 
79  desc.add<int32_t>("alctWindowMin", -3)->
80  setComment("If min parameter = -999 always accept");
81  desc.add<int32_t>("alctWindowMax", 3);
82  desc.add<int32_t>("clctWindowMin", -3)->
83  setComment("If min parameter = -999 always accept");
84  desc.add<int32_t>("clctWindowMax", 3);
85  desc.add<int32_t>("preTriggerWindowMin", -3)->
86  setComment("If min parameter = -999 always accept");
87  desc.add<int32_t>("preTriggerWindowMax", 1);
88 
89  descriptions.add("cscPacker", desc);
90 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void CSCDigiToRawModule::produce ( edm::Event e,
const edm::EventSetup c 
)
virtual

reverse mapping for packer

Implements edm::EDProducer.

Definition at line 93 of file CSCDigiToRawModule.cc.

References al_token, cd_token, cl_token, co_token, CSCDigiToRaw::createFedBuffers(), edm::EventSetup::get(), edm::Event::getByToken(), packer, packEverything_, pr_token, edm::ESHandle< class >::product(), edm::Event::put(), sd_token, theFormatVersion, usePreTriggers, and wd_token.

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

93  {
96  c.get<CSCChamberMapRcd>().get(hcham);
97  const CSCChamberMap* theMapping = hcham.product();
98 
99  std::auto_ptr<FEDRawDataCollection> fed_buffers(new FEDRawDataCollection);
100 
101  // Take digis from the event
109 
110  e.getByToken( wd_token, wireDigis );
111  e.getByToken( sd_token, stripDigis );
112  e.getByToken( cd_token, comparatorDigis );
113  e.getByToken( al_token, alctDigis );
114  e.getByToken( cl_token, clctDigis );
115  if (usePreTriggers)
116  e.getByToken( pr_token, preTriggers );
117  e.getByToken( co_token, correlatedLCTDigis );
118 
119  // Create the packed data
120  packer->createFedBuffers(*stripDigis, *wireDigis, *comparatorDigis,
121  *alctDigis, *clctDigis, *preTriggers, *correlatedLCTDigis,
122  *(fed_buffers.get()), theMapping, e, theFormatVersion, usePreTriggers,
124 
125  // put the raw data to the event
126  e.put(fed_buffers, "CSCRawData");
127 }
edm::EDGetTokenT< CSCCLCTPreTriggerCollection > pr_token
CSCDigiToRaw * packer
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:464
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > co_token
edm::EDGetTokenT< CSCComparatorDigiCollection > cd_token
edm::EDGetTokenT< CSCWireDigiCollection > wd_token
unsigned int theFormatVersion
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:120
edm::EDGetTokenT< CSCCLCTDigiCollection > cl_token
edm::EDGetTokenT< CSCALCTDigiCollection > al_token
const T & get() const
Definition: EventSetup.h:56
T const * product() const
Definition: ESHandle.h:86
edm::EDGetTokenT< CSCStripDigiCollection > sd_token
void createFedBuffers(const CSCStripDigiCollection &stripDigis, const CSCWireDigiCollection &wireDigis, const CSCComparatorDigiCollection &comparatorDigis, const CSCALCTDigiCollection &alctDigis, const CSCCLCTDigiCollection &clctDigis, const CSCCLCTPreTriggerCollection &preTriggers, const CSCCorrelatedLCTDigiCollection &correlatedLCTDigis, FEDRawDataCollection &fed_buffers, const CSCChamberMap *theMapping, edm::Event &e, uint16_t theFormatVersion=2005, bool usePreTriggers=true, bool packEverything=false)
Take a vector of digis and fill the FEDRawDataCollection.

Member Data Documentation

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

Definition at line 54 of file CSCDigiToRawModule.h.

Referenced by CSCDigiToRawModule(), and produce().

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

Definition at line 53 of file CSCDigiToRawModule.h.

Referenced by CSCDigiToRawModule(), and produce().

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

Definition at line 55 of file CSCDigiToRawModule.h.

Referenced by CSCDigiToRawModule(), and produce().

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

Definition at line 57 of file CSCDigiToRawModule.h.

Referenced by CSCDigiToRawModule(), and produce().

CSCDigiToRaw* CSCDigiToRawModule::packer
private

Definition at line 49 of file CSCDigiToRawModule.h.

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

bool CSCDigiToRawModule::packEverything_
private

Definition at line 47 of file CSCDigiToRawModule.h.

Referenced by CSCDigiToRawModule(), and produce().

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

Definition at line 56 of file CSCDigiToRawModule.h.

Referenced by CSCDigiToRawModule(), and produce().

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

Definition at line 52 of file CSCDigiToRawModule.h.

Referenced by CSCDigiToRawModule(), and produce().

unsigned int CSCDigiToRawModule::theFormatVersion
private

Definition at line 45 of file CSCDigiToRawModule.h.

Referenced by CSCDigiToRawModule(), and produce().

bool CSCDigiToRawModule::usePreTriggers
private

Definition at line 46 of file CSCDigiToRawModule.h.

Referenced by CSCDigiToRawModule(), and produce().

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

Definition at line 51 of file CSCDigiToRawModule.h.

Referenced by CSCDigiToRawModule(), and produce().