CMS 3D CMS Logo

CSCDigiToRawModule.cc
Go to the documentation of this file.
1 
15 
21 
23 
31 
32 namespace edm {
34 }
35 
36 class CSCDigiToRaw;
37 
39 public:
42 
43  // Operations
44  void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override;
45 
46  // Fill parameters descriptions
47  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
48 
49 private:
50  unsigned int theFormatVersion; // Select which version of data format to use Pre-LS1: 2005, Post-LS1: 2013
51  bool usePreTriggers; // Select if to use Pre-Triigers CLCT digis
52  bool packEverything_; // bypass all cuts and (pre)trigger requirements
53 
54  std::unique_ptr<const CSCDigiToRaw> packer_;
55 
63 
65 };
66 
68  //theStrip = pset.getUntrackedParameter<string>("DigiCreator", "cscunpacker");
69 
70  theFormatVersion = pset.getParameter<unsigned int>("useFormatVersion"); // pre-LS1 - '2005'. post-LS1 - '2013'
71  usePreTriggers = pset.getParameter<bool>("usePreTriggers"); // disable checking CLCT PreTriggers digis
72  packEverything_ = pset.getParameter<bool>("packEverything"); // don't check for consistency with trig primitives
73  // overrides usePreTriggers
74 
75  wd_token = consumes<CSCWireDigiCollection>(pset.getParameter<edm::InputTag>("wireDigiTag"));
76  sd_token = consumes<CSCStripDigiCollection>(pset.getParameter<edm::InputTag>("stripDigiTag"));
77  cd_token = consumes<CSCComparatorDigiCollection>(pset.getParameter<edm::InputTag>("comparatorDigiTag"));
78  if (usePreTriggers) {
79  pr_token = consumes<CSCCLCTPreTriggerCollection>(pset.getParameter<edm::InputTag>("preTriggerTag"));
80  }
81  al_token = consumes<CSCALCTDigiCollection>(pset.getParameter<edm::InputTag>("alctDigiTag"));
82  cl_token = consumes<CSCCLCTDigiCollection>(pset.getParameter<edm::InputTag>("clctDigiTag"));
83  co_token = consumes<CSCCorrelatedLCTDigiCollection>(pset.getParameter<edm::InputTag>("correlatedLCTDigiTag"));
84 
85  put_token_ = produces<FEDRawDataCollection>("CSCRawData");
86 }
87 
89  /*** From python/cscPacker_cfi.py
90  wireDigiTag = cms.InputTag("simMuonCSCDigis","MuonCSCWireDigi"),
91  stripDigiTag = cms.InputTag("simMuonCSCDigis","MuonCSCStripDigi"),
92  comparatorDigiTag = cms.InputTag("simMuonCSCDigis","MuonCSCComparatorDigi"),
93  alctDigiTag = cms.InputTag("simCscTriggerPrimitiveDigis"),
94  clctDigiTag = cms.InputTag("simCscTriggerPrimitiveDigis"),
95  preTriggerTag = cms.InputTag("simCscTriggerPrimitiveDigis"),
96  correlatedLCTDigiTag = cms.InputTag("simCscTriggerPrimitiveDigis", "MPCSORTED"),
97  # if min parameter = -999 always accept
98  alctWindowMin = cms.int32(-3),
99  alctWindowMax = cms.int32(3),
100  clctWindowMin = cms.int32(-3),
101  clctWindowMax = cms.int32(3),
102  preTriggerWindowMin = cms.int32(-3),
103  preTriggerWindowMax = cms.int32(1)
104 */
105 
107 
108  desc.add<unsigned int>("useFormatVersion", 2005)
109  ->setComment("Set to 2005 for pre-LS1 CSC data format, 2013 - new post-LS1 CSC data format");
110  desc.add<bool>("usePreTriggers", true)->setComment("Set to false if CSCCLCTPreTrigger digis are not available");
111  desc.add<bool>("packEverything", false)
112  ->setComment("Set to true to disable trigger-related constraints on readout data");
113 
114  desc.add<edm::InputTag>("wireDigiTag", edm::InputTag("simMuonCSCDigis", "MuonCSCWireDigi"));
115  desc.add<edm::InputTag>("stripDigiTag", edm::InputTag("simMuonCSCDigis", "MuonCSCStripDigi"));
116  desc.add<edm::InputTag>("comparatorDigiTag", edm::InputTag("simMuonCSCDigis", "MuonCSCComparatorDigi"));
117  desc.add<edm::InputTag>("alctDigiTag", edm::InputTag("simCscTriggerPrimitiveDigis"));
118  desc.add<edm::InputTag>("clctDigiTag", edm::InputTag("simCscTriggerPrimitiveDigis"));
119  desc.add<edm::InputTag>("preTriggerTag", edm::InputTag("simCscTriggerPrimitiveDigis"));
120  desc.add<edm::InputTag>("correlatedLCTDigiTag", edm::InputTag("simCscTriggerPrimitiveDigis", "MPCSORTED"));
121 
122  desc.add<int32_t>("alctWindowMin", -3)->setComment("If min parameter = -999 always accept");
123  desc.add<int32_t>("alctWindowMax", 3);
124  desc.add<int32_t>("clctWindowMin", -3)->setComment("If min parameter = -999 always accept");
125  desc.add<int32_t>("clctWindowMax", 3);
126  desc.add<int32_t>("preTriggerWindowMin", -3)->setComment("If min parameter = -999 always accept");
127  desc.add<int32_t>("preTriggerWindowMax", 1);
128 
129  descriptions.add("cscPacker", desc);
130 }
131 
135  c.get<CSCChamberMapRcd>().get(hcham);
136  const CSCChamberMap* theMapping = hcham.product();
137 
138  FEDRawDataCollection fed_buffers;
139 
140  // Take digis from the event
148 
149  e.getByToken(wd_token, wireDigis);
150  e.getByToken(sd_token, stripDigis);
151  e.getByToken(cd_token, comparatorDigis);
152  e.getByToken(al_token, alctDigis);
153  e.getByToken(cl_token, clctDigis);
154  if (usePreTriggers)
155  e.getByToken(pr_token, preTriggers);
156  e.getByToken(co_token, correlatedLCTDigis);
157 
158  // Create the packed data
159  packer_->createFedBuffers(*stripDigis,
160  *wireDigis,
161  *comparatorDigis,
162  *alctDigis,
163  *clctDigis,
164  *preTriggers,
165  *correlatedLCTDigis,
166  fed_buffers,
167  theMapping,
168  e,
172 
173  // put the raw data to the event
174  e.emplace(put_token_, std::move(fed_buffers));
175 }
176 
ConfigurationDescriptions.h
edm::ESHandle::product
T const * product() const
Definition: ESHandle.h:86
edm::StreamID
Definition: StreamID.h:30
CSCDigiToRawModule::fillDescriptions
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Definition: CSCDigiToRawModule.cc:88
Handle.h
CSCCorrelatedLCTDigiCollection.h
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
CSCDigiToRawModule::usePreTriggers
bool usePreTriggers
Definition: CSCDigiToRawModule.cc:51
ESHandle.h
CSCChamberMapRcd.h
edm::EDGetTokenT< CSCWireDigiCollection >
FEDRawDataCollection
Definition: FEDRawDataCollection.h:18
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::EDPutTokenT< FEDRawDataCollection >
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
CSCDigiToRawModule::sd_token
edm::EDGetTokenT< CSCStripDigiCollection > sd_token
Definition: CSCDigiToRawModule.cc:57
CSCCLCTPreTriggerCollection.h
edm::Handle< CSCWireDigiCollection >
CSCDigiToRawModule::wd_token
edm::EDGetTokenT< CSCWireDigiCollection > wd_token
Definition: CSCDigiToRawModule.cc:56
CSCDigiToRawModule::theFormatVersion
unsigned int theFormatVersion
Definition: CSCDigiToRawModule.cc:50
CSCDigiToRawModule::al_token
edm::EDGetTokenT< CSCALCTDigiCollection > al_token
Definition: CSCDigiToRawModule.cc:59
CSCDigiToRaw
Definition: CSCDigiToRaw.h:23
MakerMacros.h
DEFINE_FWK_MODULE
#define DEFINE_FWK_MODULE(type)
Definition: MakerMacros.h:16
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
CSCDigiToRawModule::co_token
edm::EDGetTokenT< CSCCorrelatedLCTDigiCollection > co_token
Definition: CSCDigiToRawModule.cc:62
edm::ESHandle
Definition: DTSurvey.h:22
CSCDigiToRawModule::produce
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
Definition: CSCDigiToRawModule.cc:132
ParameterSetDescription.h
edm::global::EDProducer
Definition: EDProducer.h:32
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
CSCDigiToRawModule::cd_token
edm::EDGetTokenT< CSCComparatorDigiCollection > cd_token
Definition: CSCDigiToRawModule.cc:58
CSCDigiToRawModule::put_token_
edm::EDPutTokenT< FEDRawDataCollection > put_token_
Definition: CSCDigiToRawModule.cc:64
HLT_2018_cff.InputTag
InputTag
Definition: HLT_2018_cff.py:79016
edm::ParameterSet
Definition: ParameterSet.h:36
Event.h
CSCDigiToRawModule::pr_token
edm::EDGetTokenT< CSCCLCTPreTriggerCollection > pr_token
Definition: CSCDigiToRawModule.cc:61
CSCChamberMap
Definition: CSCChamberMap.h:11
FEDRawDataCollection.h
CSCStripDigiCollection.h
edm::EventSetup
Definition: EventSetup.h:57
CSCDigiToRawModule::cl_token
edm::EDGetTokenT< CSCCLCTDigiCollection > cl_token
Definition: CSCDigiToRawModule.cc:60
HltBtagPostValidation_cff.c
c
Definition: HltBtagPostValidation_cff.py:31
CSCDigiToRawModule::packEverything_
bool packEverything_
Definition: CSCDigiToRawModule.cc:52
get
#define get
InputTag.h
CSCDigiToRawModule
Definition: CSCDigiToRawModule.cc:38
CSCDigiToRawModule::CSCDigiToRawModule
CSCDigiToRawModule(const edm::ParameterSet &pset)
Constructor.
Definition: CSCDigiToRawModule.cc:67
eostools.move
def move(src, dest)
Definition: eostools.py:511
std
Definition: JetResolutionObject.h:76
ConfigurationDescriptions
CSCDigiToRaw.h
CSCDigiToRawModule::packer_
std::unique_ptr< const CSCDigiToRaw > packer_
Definition: CSCDigiToRawModule.cc:54
CSCChamberMapRcd
Definition: CSCChamberMapRcd.h:5
EventSetup.h
CSCComparatorDigiCollection.h
CSCWireDigiCollection.h
CSCALCTDigiCollection.h
ConsumesCollector.h
ParameterSet.h
CSCCLCTDigiCollection.h
EDProducer.h
edm::Event
Definition: Event.h:73
edm::InputTag
Definition: InputTag.h:15
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37