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
 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
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) 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
 
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
 
- 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

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(), 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 
25  wd_token = consumes<CSCWireDigiCollection>( pset.getParameter<edm::InputTag>("wireDigiTag") );
26  sd_token = consumes<CSCStripDigiCollection>( pset.getParameter<edm::InputTag>("stripDigiTag") );
27  cd_token = consumes<CSCComparatorDigiCollection>( pset.getParameter<edm::InputTag>("comparatorDigiTag") );
28  pr_token = consumes<CSCCLCTPreTriggerCollection>( pset.getParameter<edm::InputTag>("preTriggerTag") );
29  al_token = consumes<CSCALCTDigiCollection>( pset.getParameter<edm::InputTag>("alctDigiTag") );
30  cl_token = consumes<CSCCLCTDigiCollection>( pset.getParameter<edm::InputTag>("clctDigiTag") );
31  co_token = consumes<CSCCorrelatedLCTDigiCollection>( pset.getParameter<edm::InputTag>("correlatedLCTDigiTag") );
32 
33  produces<FEDRawDataCollection>("CSCRawData");
34 
35 }
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 38 of file CSCDigiToRawModule.cc.

References packer.

38  {
39  delete packer;
40 }
CSCDigiToRaw * packer

Member Function Documentation

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

Definition at line 42 of file CSCDigiToRawModule.cc.

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

42  {
43 /*** From python/cscPacker_cfi.py
44  wireDigiTag = cms.InputTag("simMuonCSCDigis","MuonCSCWireDigi"),
45  stripDigiTag = cms.InputTag("simMuonCSCDigis","MuonCSCStripDigi"),
46  comparatorDigiTag = cms.InputTag("simMuonCSCDigis","MuonCSCComparatorDigi"),
47  alctDigiTag = cms.InputTag("simCscTriggerPrimitiveDigis"),
48  clctDigiTag = cms.InputTag("simCscTriggerPrimitiveDigis"),
49  preTriggerTag = cms.InputTag("simCscTriggerPrimitiveDigis"),
50  correlatedLCTDigiTag = cms.InputTag("simCscTriggerPrimitiveDigis", "MPCSORTED"),
51  # if min parameter = -999 always accept
52  alctWindowMin = cms.int32(-3),
53  alctWindowMax = cms.int32(3),
54  clctWindowMin = cms.int32(-3),
55  clctWindowMax = cms.int32(3),
56  preTriggerWindowMin = cms.int32(-3),
57  preTriggerWindowMax = cms.int32(1)
58 */
59 
61 
62  desc.add<unsigned int>("useFormatVersion",2005)->
63  setComment("Set to 2005 for pre-LS1 CSC data format, 2013 - new post-LS1 CSC data format");
64  desc.add<bool>("usePreTriggers", true)->
65  setComment("Set to false if CSCCLCTPreTrigger digis are not available");
66 
67  desc.add<edm::InputTag>("wireDigiTag", edm::InputTag("simMuonCSCDigis","MuonCSCWireDigi"));
68  desc.add<edm::InputTag>("stripDigiTag",edm::InputTag("simMuonCSCDigis","MuonCSCStripDigi"));
69  desc.add<edm::InputTag>("comparatorDigiTag", edm::InputTag("simMuonCSCDigis","MuonCSCComparatorDigi"));
70  desc.add<edm::InputTag>("alctDigiTag",edm::InputTag("simCscTriggerPrimitiveDigis"));
71  desc.add<edm::InputTag>("clctDigiTag",edm::InputTag("simCscTriggerPrimitiveDigis"));
72  desc.add<edm::InputTag>("preTriggerTag", edm::InputTag("simCscTriggerPrimitiveDigis"));
73  desc.add<edm::InputTag>("correlatedLCTDigiTag",edm::InputTag("simCscTriggerPrimitiveDigis", "MPCSORTED"));
74 
75  desc.add<int32_t>("alctWindowMin", -3)->
76  setComment("If min parameter = -999 always accept");
77  desc.add<int32_t>("alctWindowMax", 3);
78  desc.add<int32_t>("clctWindowMin", -3)->
79  setComment("If min parameter = -999 always accept");
80  desc.add<int32_t>("clctWindowMax", 3);
81  desc.add<int32_t>("preTriggerWindowMin", -3)->
82  setComment("If min parameter = -999 always accept");
83  desc.add<int32_t>("preTriggerWindowMax", 1);
84 
85  descriptions.add("cscPacker", desc);
86 }
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 89 of file CSCDigiToRawModule.cc.

References al_token, cd_token, cl_token, co_token, CSCDigiToRaw::createFedBuffers(), edm::EventSetup::get(), edm::Event::getByToken(), packer, 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().

89  {
92  c.get<CSCChamberMapRcd>().get(hcham);
93  const CSCChamberMap* theMapping = hcham.product();
94 
95  std::auto_ptr<FEDRawDataCollection> fed_buffers(new FEDRawDataCollection);
96 
97  // Take digis from the event
105 
106  e.getByToken( wd_token, wireDigis );
107  e.getByToken( sd_token, stripDigis );
108  e.getByToken( cd_token, comparatorDigis );
109  e.getByToken( al_token, alctDigis );
110  e.getByToken( cl_token, clctDigis );
111  if (usePreTriggers)
112  e.getByToken( pr_token, preTriggers );
113  e.getByToken( co_token, correlatedLCTDigis );
114 
115  // Create the packed data
116  packer->createFedBuffers(*stripDigis, *wireDigis, *comparatorDigis,
117  *alctDigis, *clctDigis, *preTriggers, *correlatedLCTDigis,
118  *(fed_buffers.get()), theMapping, e, theFormatVersion, usePreTriggers);
119 
120  // put the raw data to the event
121  e.put(fed_buffers, "CSCRawData");
122 }
edm::EDGetTokenT< CSCCLCTPreTriggerCollection > pr_token
CSCDigiToRaw * packer
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:434
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:116
edm::EDGetTokenT< CSCCLCTDigiCollection > cl_token
edm::EDGetTokenT< CSCALCTDigiCollection > al_token
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
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)
Take a vector of digis and fill the FEDRawDataCollection.

Member Data Documentation

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

Definition at line 53 of file CSCDigiToRawModule.h.

Referenced by CSCDigiToRawModule(), and produce().

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

Definition at line 52 of file CSCDigiToRawModule.h.

Referenced by CSCDigiToRawModule(), and produce().

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

Definition at line 54 of file CSCDigiToRawModule.h.

Referenced by CSCDigiToRawModule(), and produce().

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

Definition at line 56 of file CSCDigiToRawModule.h.

Referenced by CSCDigiToRawModule(), and produce().

CSCDigiToRaw* CSCDigiToRawModule::packer
private

Definition at line 48 of file CSCDigiToRawModule.h.

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

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

Definition at line 55 of file CSCDigiToRawModule.h.

Referenced by CSCDigiToRawModule(), and produce().

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

Definition at line 51 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 50 of file CSCDigiToRawModule.h.

Referenced by CSCDigiToRawModule(), and produce().