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 
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 }
36 
37 
39  delete packer;
40 }
41 
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 }
87 
88 
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 }
123 
124 
T getParameter(std::string const &) const
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
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
unsigned int theFormatVersion
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:116
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:55
CSCDigiToRawModule(const edm::ParameterSet &pset)
Constructor.
T const * product() const
Definition: ESHandle.h:62
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)
Take a vector of digis and fill the FEDRawDataCollection.