CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
CSCDigiToRawModule.cc
Go to the documentation of this file.
1 
16 
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 }
38 
39 
41  delete packer;
42 }
43 
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 }
91 
92 
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 }
128 
129 
T getParameter(std::string const &) const
edm::EDGetTokenT< CSCCLCTPreTriggerCollection > pr_token
CSCDigiToRaw * packer
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:462
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > co_token
edm::EDGetTokenT< CSCComparatorDigiCollection > cd_token
edm::EDGetTokenT< CSCWireDigiCollection > wd_token
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
unsigned int theFormatVersion
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
edm::EDGetTokenT< CSCCLCTDigiCollection > cl_token
ParameterDescriptionBase * add(U const &iLabel, T const &value)
edm::EDGetTokenT< CSCALCTDigiCollection > al_token
const T & get() const
Definition: EventSetup.h:56
CSCDigiToRawModule(const edm::ParameterSet &pset)
Constructor.
T const * product() const
Definition: ESHandle.h:86
void add(std::string const &label, ParameterSetDescription const &psetDescription)
virtual ~CSCDigiToRawModule()
Destructor.
edm::EDGetTokenT< CSCStripDigiCollection > sd_token
virtual void produce(edm::Event &, const edm::EventSetup &)
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.