CMS 3D CMS Logo

CSCDigiToRawModule.cc
Go to the documentation of this file.
1 
16 
22 
24 
35 
36 namespace edm {
38 }
39 
40 class CSCDigiToRaw;
41 
43 public:
46 
47  // Operations
48  void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override;
49 
50  // Fill parameters descriptions
51  static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
52 
53 private:
54  bool usePreTriggers_; // Select if to use Pre-Triggers CLCT digis
55  bool useGEMs_;
57 
58  std::unique_ptr<const CSCDigiToRaw> packer_;
59 
71 
73 };
74 
76  usePreTriggers_ = pset.getParameter<bool>("usePreTriggers"); // disable checking CLCT PreTriggers digis
77 
78  useGEMs_ = pset.getParameter<bool>("useGEMs");
79  useCSCShowers_ = pset.getParameter<bool>("useCSCShowers");
80  wd_token = consumes<CSCWireDigiCollection>(pset.getParameter<edm::InputTag>("wireDigiTag"));
81  sd_token = consumes<CSCStripDigiCollection>(pset.getParameter<edm::InputTag>("stripDigiTag"));
82  cd_token = consumes<CSCComparatorDigiCollection>(pset.getParameter<edm::InputTag>("comparatorDigiTag"));
83  if (usePreTriggers_) {
84  pr_token = consumes<CSCCLCTPreTriggerCollection>(pset.getParameter<edm::InputTag>("preTriggerTag"));
85  prdigi_token = consumes<CSCCLCTPreTriggerDigiCollection>(pset.getParameter<edm::InputTag>("preTriggerDigiTag"));
86  }
87  al_token = consumes<CSCALCTDigiCollection>(pset.getParameter<edm::InputTag>("alctDigiTag"));
88  cl_token = consumes<CSCCLCTDigiCollection>(pset.getParameter<edm::InputTag>("clctDigiTag"));
89  co_token = consumes<CSCCorrelatedLCTDigiCollection>(pset.getParameter<edm::InputTag>("correlatedLCTDigiTag"));
90  cham_token = esConsumes<CSCChamberMap, CSCChamberMapRcd>();
91  if (useGEMs_) {
92  gem_token = consumes<GEMPadDigiClusterCollection>(pset.getParameter<edm::InputTag>("padDigiClusterTag"));
93  }
94  if (useCSCShowers_) {
95  shower_token = consumes<CSCShowerDigiCollection>(pset.getParameter<edm::InputTag>("showerDigiTag"));
96  }
97  put_token_ = produces<FEDRawDataCollection>("CSCRawData");
98 }
99 
102 
103  desc.add<unsigned int>("formatVersion", 2005)
104  ->setComment("Set to 2005 for pre-LS1 CSC data format, 2013 - new post-LS1 CSC data format");
105  desc.add<bool>("usePreTriggers", true)->setComment("Set to false if CSCCLCTPreTrigger digis are not available");
106  desc.add<bool>("packEverything", false)
107  ->setComment("Set to true to disable trigger-related constraints on readout data");
108  desc.add<bool>("useGEMs", false)->setComment("Pack GEM trigger data");
109  desc.add<bool>("useCSCShowers", false)->setComment("Pack CSC shower trigger data");
110 
111  desc.add<edm::InputTag>("wireDigiTag", edm::InputTag("simMuonCSCDigis", "MuonCSCWireDigi"));
112  desc.add<edm::InputTag>("stripDigiTag", edm::InputTag("simMuonCSCDigis", "MuonCSCStripDigi"));
113  desc.add<edm::InputTag>("comparatorDigiTag", edm::InputTag("simMuonCSCDigis", "MuonCSCComparatorDigi"));
114  desc.add<edm::InputTag>("alctDigiTag", edm::InputTag("simCscTriggerPrimitiveDigis"));
115  desc.add<edm::InputTag>("clctDigiTag", edm::InputTag("simCscTriggerPrimitiveDigis"));
116  desc.add<edm::InputTag>("preTriggerTag", edm::InputTag("simCscTriggerPrimitiveDigis"));
117  desc.add<edm::InputTag>("preTriggerDigiTag", edm::InputTag("simCscTriggerPrimitiveDigis"));
118  desc.add<edm::InputTag>("correlatedLCTDigiTag", edm::InputTag("simCscTriggerPrimitiveDigis", "MPCSORTED"));
119  desc.add<edm::InputTag>("padDigiClusterTag", edm::InputTag("simMuonGEMPadDigiClusters"));
120  desc.add<edm::InputTag>("showerDigiTag", edm::InputTag("simCscTriggerPrimitiveDigis"));
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("cscPackerDef", desc);
130 }
131 
134  edm::ESHandle<CSCChamberMap> hcham = c.getHandle(cham_token);
135  const CSCChamberMap* theMapping = hcham.product();
136 
137  FEDRawDataCollection fed_buffers;
138 
139  // Take digis from the event
146 
147  // collections that are always packed
148  e.getByToken(wd_token, wireDigis);
149  e.getByToken(sd_token, stripDigis);
150  e.getByToken(cd_token, comparatorDigis);
151  e.getByToken(al_token, alctDigis);
152  e.getByToken(cl_token, clctDigis);
153  e.getByToken(co_token, correlatedLCTDigis);
154 
155  // packing with pre-triggers
156  CSCCLCTPreTriggerCollection const* preTriggersPtr = nullptr;
157  CSCCLCTPreTriggerDigiCollection const* preTriggerDigisPtr = nullptr;
158  if (usePreTriggers_) {
159  preTriggersPtr = &e.get(pr_token);
160  preTriggerDigisPtr = &e.get(prdigi_token);
161  }
162 
163  // collections that are packed optionally
164 
165  // packing of GEM hits
166  const GEMPadDigiClusterCollection* padDigiClustersPtr = nullptr;
167  if (useGEMs_) {
168  padDigiClustersPtr = &e.get(gem_token);
169  }
170 
171  // packing of CSC shower digis
172  const CSCShowerDigiCollection* cscShowerDigisPtr = nullptr;
173  if (useCSCShowers_) {
174  cscShowerDigisPtr = &e.get(shower_token);
175  }
176 
177  // Create the packed data
178  packer_->createFedBuffers(*stripDigis,
179  *wireDigis,
180  *comparatorDigis,
181  *alctDigis,
182  *clctDigis,
183  preTriggersPtr,
184  preTriggerDigisPtr,
185  *correlatedLCTDigis,
186  cscShowerDigisPtr,
187  padDigiClustersPtr,
188  fed_buffers,
189  theMapping,
190  e.id());
191 
192  // put the raw data to the event
193  e.emplace(put_token_, std::move(fed_buffers));
194 }
195 
ConfigurationDescriptions.h
CSCCLCTPreTriggerCollection
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:100
Handle.h
CSCCorrelatedLCTDigiCollection.h
ESHandle.h
CSCDigiToRawModule::usePreTriggers_
bool usePreTriggers_
Definition: CSCDigiToRawModule.cc:54
CSCChamberMapRcd.h
edm::EDGetTokenT< CSCWireDigiCollection >
FEDRawDataCollection
Definition: FEDRawDataCollection.h:18
edm
HLT enums.
Definition: AlignableModifier.h:19
edm::EDPutTokenT< FEDRawDataCollection >
MuonDigiCollection
A container for a generic type of digis indexed by some index, implemented with a map<IndexType,...
Definition: MuonDigiCollection.h:87
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
CSCDigiToRawModule::sd_token
edm::EDGetTokenT< CSCStripDigiCollection > sd_token
Definition: CSCDigiToRawModule.cc:61
CSCDigiToRawModule::useCSCShowers_
bool useCSCShowers_
Definition: CSCDigiToRawModule.cc:56
CSCDigiToRawModule::prdigi_token
edm::EDGetTokenT< CSCCLCTPreTriggerDigiCollection > prdigi_token
Definition: CSCDigiToRawModule.cc:66
CSCCLCTPreTriggerCollection.h
edm::Handle< CSCWireDigiCollection >
ESGetToken.h
CSCDigiToRawModule::wd_token
edm::EDGetTokenT< CSCWireDigiCollection > wd_token
Definition: CSCDigiToRawModule.cc:60
CSCDigiToRawModule::al_token
edm::EDGetTokenT< CSCALCTDigiCollection > al_token
Definition: CSCDigiToRawModule.cc:63
CSCDigiToRaw
Definition: CSCDigiToRaw.h:26
CSCCLCTPreTriggerDigiCollection.h
GEMPadDigiClusterCollection.h
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:67
edm::ESHandle
Definition: DTSurvey.h:22
CSCDigiToRawModule::produce
void produce(edm::StreamID, edm::Event &, const edm::EventSetup &) const override
Definition: CSCDigiToRawModule.cc:132
CSCDigiToRawModule::useGEMs_
bool useGEMs_
Definition: CSCDigiToRawModule.cc:55
GEMPadDigiClusterCollection
ParameterSetDescription.h
CSCDigiToRawModule::gem_token
edm::EDGetTokenT< GEMPadDigiClusterCollection > gem_token
Definition: CSCDigiToRawModule.cc:70
edm::global::EDProducer
Definition: EDProducer.h:32
edm::ConfigurationDescriptions
Definition: ConfigurationDescriptions.h:28
CSCDigiToRawModule::cd_token
edm::EDGetTokenT< CSCComparatorDigiCollection > cd_token
Definition: CSCDigiToRawModule.cc:62
CSCDigiToRawModule::put_token_
edm::EDPutTokenT< FEDRawDataCollection > put_token_
Definition: CSCDigiToRawModule.cc:72
edm::ParameterSet
Definition: ParameterSet.h:47
Event.h
CSCDigiToRawModule::pr_token
edm::EDGetTokenT< CSCCLCTPreTriggerCollection > pr_token
Definition: CSCDigiToRawModule.cc:65
CSCChamberMap
Definition: CSCChamberMap.h:11
FEDRawDataCollection.h
CSCDigiToRawModule::cham_token
edm::ESGetToken< CSCChamberMap, CSCChamberMapRcd > cham_token
Definition: CSCDigiToRawModule.cc:69
CSCStripDigiCollection.h
edm::EventSetup
Definition: EventSetup.h:58
CSCDigiToRawModule::cl_token
edm::EDGetTokenT< CSCCLCTDigiCollection > cl_token
Definition: CSCDigiToRawModule.cc:64
CSCDigiToRawModule::shower_token
edm::EDGetTokenT< CSCShowerDigiCollection > shower_token
Definition: CSCDigiToRawModule.cc:68
edm::ESGetToken< CSCChamberMap, CSCChamberMapRcd >
InputTag.h
CSCDigiToRawModule
Definition: CSCDigiToRawModule.cc:42
CSCDigiToRawModule::CSCDigiToRawModule
CSCDigiToRawModule(const edm::ParameterSet &pset)
Constructor.
Definition: CSCDigiToRawModule.cc:75
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
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:58
EventSetup.h
CSCComparatorDigiCollection.h
CSCWireDigiCollection.h
CSCALCTDigiCollection.h
ConsumesCollector.h
ParameterSet.h
CSCCLCTDigiCollection.h
EDProducer.h
c
auto & c
Definition: CAHitNtupletGeneratorKernelsImpl.h:56
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
CSCShowerDigiCollection.h