CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
CSCDigiToRaw.cc
Go to the documentation of this file.
1 
15 #include "boost/dynamic_bitset.hpp"
23 
24 #include <algorithm>
25 
26 using namespace edm;
27 using namespace std;
28 
30  : alctWindowMin_(pset.getParameter<int>("alctWindowMin")),
31  alctWindowMax_(pset.getParameter<int>("alctWindowMax")),
32  clctWindowMin_(pset.getParameter<int>("clctWindowMin")),
33  clctWindowMax_(pset.getParameter<int>("clctWindowMax")),
34  preTriggerWindowMin_(pset.getParameter<int>("preTriggerWindowMin")),
35  preTriggerWindowMax_(pset.getParameter<int>("preTriggerWindowMax")),
36  // pre-LS1 - '2005'. post-LS1 - '2013', Run3 - '2020'
37  formatVersion_(pset.getParameter<unsigned>("formatVersion")),
38  // don't check for consistency with trig primitives
39  // overrides usePreTriggers
40  packEverything_(pset.getParameter<bool>("packEverything")),
41  usePreTriggers_(pset.getParameter<bool>("usePreTriggers")),
42  packByCFEB_(pset.getParameter<bool>("packByCFEB")) {}
43 
45  CSCDetId chamberId = CSCDigiToRawAccept::chamberID(cscDetId);
46  // find the entry into the map
47  map<CSCDetId, CSCEventData>::iterator chamberMapItr = info.theChamberDataMap.find(chamberId);
48  if (chamberMapItr == info.theChamberDataMap.end()) {
49  // make an entry, telling it the correct chamberType
50  int chamberType = chamberId.iChamberType();
51  chamberMapItr = info.theChamberDataMap
52  .insert(pair<CSCDetId, CSCEventData>(chamberId, CSCEventData(chamberType, info.formatVersion_)))
53  .first;
54  }
55  CSCEventData& cscData = chamberMapItr->second;
56  cscData.dmbHeader()->setCrateAddress(info.theElectronicsMap->crate(cscDetId), info.theElectronicsMap->dmb(cscDetId));
57 
58  if (info.formatVersion_ >= 2013) {
59  // Set DMB version field to distinguish between ME11s and other chambers (ME11 - 2, others - 1)
60  bool me11 = ((chamberId.station() == 1) && (chamberId.ring() == 4)) ||
61  ((chamberId.station() == 1) && (chamberId.ring() == 1));
62  if (me11) {
63  cscData.dmbHeader()->setdmbVersion(2);
64  } else {
65  cscData.dmbHeader()->setdmbVersion(1);
66  }
67  }
68  return cscData;
69 }
70 
72  const CSCCLCTPreTriggerCollection* preTriggers,
73  const CSCCLCTPreTriggerDigiCollection* preTriggerDigis,
74  FindEventDataInfo& fedInfo) const {
75  //iterate over chambers with strip digis in them
76  for (CSCStripDigiCollection::DigiRangeIterator j = stripDigis.begin(); j != stripDigis.end(); ++j) {
77  CSCDetId cscDetId = (*j).first;
78  // only digitize if there are pre-triggers
79 
80  // determine where the pretriggers are
81  std::vector<bool> preTriggerInCFEB;
82  preTriggerInCFEB.resize(CSCConstants::MAX_CFEBS_RUN2);
83 
84  // pretrigger flag must be set and the pretrigger collection must be nonzero!
85  const bool usePreTriggers = usePreTriggers_ and preTriggers != nullptr;
86  if (!usePreTriggers || packEverything_ ||
87  (usePreTriggers && CSCDigiToRawAccept::accept(cscDetId,
88  *preTriggerDigis,
92  preTriggerInCFEB))) {
93  bool me1a = (cscDetId.station() == 1) && (cscDetId.ring() == 4);
94  bool zplus = (cscDetId.endcap() == 1);
95  bool me1b = (cscDetId.station() == 1) && (cscDetId.ring() == 1);
96 
97  CSCEventData& cscData = findEventData(cscDetId, fedInfo);
98 
99  std::vector<CSCStripDigi>::const_iterator digiItr = (*j).second.first;
100  std::vector<CSCStripDigi>::const_iterator last = (*j).second.second;
101  for (; digiItr != last; ++digiItr) {
102  CSCStripDigi digi = *digiItr;
103  int strip = digi.getStrip();
104  int cfeb = digi.getCFEB();
105  // CSC strip digis in ME1/a have CFEB number 0, 1, or 2
106  // But a pretrigger in ME1/a has CFEB number 4, 5, or 6 (+4)
107  if (me1a)
109 
110  // At this point, if we are packing by CFEBs and there is no
111  // pretrigger in this CFEB, ignore this strip digi
112  if (packByCFEB_ and not preTriggerInCFEB[cfeb])
113  continue;
114 
115  // From LS1 on ME1a strips are unganged
116  if (fedInfo.formatVersion_ >= 2013) {
117  if (me1a && zplus) {
118  digi.setStrip(CSCConstants::NUM_STRIPS_ME1A_UNGANGED + 1 - strip); // 1-48 -> 48-1
119  }
120  if (me1b && !zplus) {
121  digi.setStrip(CSCConstants::NUM_STRIPS_ME1B + 1 - strip); // 1-64 -> 64-1
122  }
123  if (me1a) {
124  strip = digi.getStrip(); // reset back 1-16 to 65-80 digi
126  }
127  }
128  // During Run-1 ME1a strips are triple-ganged
129  else {
130  if (me1a && zplus) {
131  digi.setStrip(CSCConstants::NUM_STRIPS_ME1A_GANGED + 1 - strip); // 1-16 -> 16-1
132  }
133  if (me1b && !zplus) {
134  digi.setStrip(CSCConstants::NUM_STRIPS_ME1B + 1 - strip); // 1-64 -> 64-1
135  }
136  if (me1a) {
137  strip = digi.getStrip(); // reset back 1-16 to 65-80 digi
139  }
140  }
141  cscData.add(digi, cscDetId.layer());
142  }
143  }
144  }
145 }
146 
148  const CSCALCTDigiCollection& alctDigis,
149  FindEventDataInfo& fedInfo) const {
150  add(alctDigis, fedInfo);
151  for (CSCWireDigiCollection::DigiRangeIterator j = wireDigis.begin(); j != wireDigis.end(); ++j) {
152  CSCDetId cscDetId = (*j).first;
155  CSCEventData& cscData = findEventData(cscDetId, fedInfo);
156  std::vector<CSCWireDigi>::const_iterator digiItr = (*j).second.first;
157  std::vector<CSCWireDigi>::const_iterator last = (*j).second.second;
158  for (; digiItr != last; ++digiItr) {
159  cscData.add(*digiItr, cscDetId.layer());
160  }
161  }
162  }
163 }
164 
165 void CSCDigiToRaw::add(const CSCComparatorDigiCollection& comparatorDigis,
166  const CSCCLCTDigiCollection& clctDigis,
167  FindEventDataInfo& fedInfo) const {
168  add(clctDigis, fedInfo);
169  for (auto const& j : comparatorDigis) {
170  CSCDetId cscDetId = j.first;
171  CSCEventData& cscData = findEventData(cscDetId, fedInfo);
174  bool me1a = (cscDetId.station() == 1) && (cscDetId.ring() == 4);
175 
176  /*
177  Add the comparator digi to the fedInfo.
178  Move ME1/A comparators from CFEB=0 to CFEB=4 if this has not
179  been done already.
180  Consider the case for triple-ganged and unganged ME1A strips
181  */
182  for (auto digi = j.second.first; digi != j.second.second; ++digi) {
183  if (fedInfo.formatVersion_ >= 2013) {
184  // unganged case
185  if (me1a && digi->getStrip() <= CSCConstants::NUM_STRIPS_ME1A_UNGANGED) {
186  CSCComparatorDigi digi_corr(
187  CSCConstants::NUM_STRIPS_ME1B + digi->getStrip(), digi->getComparator(), digi->getTimeBinWord());
188  cscData.add(digi_corr, cscDetId);
189  } else {
190  cscData.add(*digi, cscDetId);
191  }
192  }
193  // triple-ganged case
194  else {
195  if (me1a && digi->getStrip() <= CSCConstants::NUM_STRIPS_ME1A_GANGED) {
196  CSCComparatorDigi digi_corr(
197  CSCConstants::NUM_STRIPS_ME1B + digi->getStrip(), digi->getComparator(), digi->getTimeBinWord());
198  cscData.add(digi_corr, cscDetId.layer());
199  } else {
200  cscData.add(*digi, cscDetId.layer());
201  }
202  }
203  }
204  }
205  }
206 }
207 
208 void CSCDigiToRaw::add(const CSCALCTDigiCollection& alctDigis, FindEventDataInfo& fedInfo) const {
209  for (CSCALCTDigiCollection::DigiRangeIterator j = alctDigis.begin(); j != alctDigis.end(); ++j) {
210  CSCDetId cscDetId = (*j).first;
211  CSCEventData& cscData = findEventData(cscDetId, fedInfo);
212 
213  cscData.add(std::vector<CSCALCTDigi>((*j).second.first, (*j).second.second));
214  }
215 }
216 
217 void CSCDigiToRaw::add(const CSCCLCTDigiCollection& clctDigis, FindEventDataInfo& fedInfo) const {
218  for (CSCCLCTDigiCollection::DigiRangeIterator j = clctDigis.begin(); j != clctDigis.end(); ++j) {
219  CSCDetId cscDetId = (*j).first;
220  CSCEventData& cscData = findEventData(cscDetId, fedInfo);
221 
222  bool me11a = cscDetId.station() == 1 && cscDetId.ring() == 4;
223  //CLCTs are packed by chamber not by A/B parts in ME11
224  //me11a appears only in simulation with SLHC algorithm settings
225  //without the shift, it's impossible to distinguish A and B parts
226  if (me11a && fedInfo.formatVersion_ >= 2013) {
227  std::vector<CSCCLCTDigi> shiftedDigis((*j).second.first, (*j).second.second);
228  for (std::vector<CSCCLCTDigi>::iterator iC = shiftedDigis.begin(); iC != shiftedDigis.end(); ++iC) {
229  if (iC->getCFEB() < CSCConstants::NUM_CFEBS_ME1A_UNGANGED) { //sanity check, mostly
230  (*iC) = CSCCLCTDigi(iC->isValid(),
231  iC->getQuality(),
232  iC->getPattern(),
233  iC->getStripType(),
234  iC->getBend(),
235  iC->getStrip(),
236  iC->getCFEB() + CSCConstants::NUM_CFEBS_ME1B,
237  iC->getBX(),
238  iC->getTrknmb(),
239  iC->getFullBX());
240  }
241  }
242  cscData.add(shiftedDigis);
243  } else {
244  cscData.add(std::vector<CSCCLCTDigi>((*j).second.first, (*j).second.second));
245  }
246  }
247 }
248 
249 void CSCDigiToRaw::add(const CSCCorrelatedLCTDigiCollection& corrLCTDigis, FindEventDataInfo& fedInfo) const {
250  for (CSCCorrelatedLCTDigiCollection::DigiRangeIterator j = corrLCTDigis.begin(); j != corrLCTDigis.end(); ++j) {
251  CSCDetId cscDetId = (*j).first;
252  CSCEventData& cscData = findEventData(cscDetId, fedInfo);
253 
254  bool me11a = cscDetId.station() == 1 && cscDetId.ring() == 4;
255  //LCTs are packed by chamber not by A/B parts in ME11
256  //me11a appears only in simulation with SLHC algorithm settings
257  //without the shift, it's impossible to distinguish A and B parts
258  if (me11a && fedInfo.formatVersion_ >= 2013) {
259  std::vector<CSCCorrelatedLCTDigi> shiftedDigis((*j).second.first, (*j).second.second);
260  for (std::vector<CSCCorrelatedLCTDigi>::iterator iC = shiftedDigis.begin(); iC != shiftedDigis.end(); ++iC) {
261  if (iC->getStrip() < CSCConstants::NUM_HALF_STRIPS_ME1A_UNGANGED) { //sanity check, mostly
262  (*iC) = CSCCorrelatedLCTDigi(iC->getTrknmb(),
263  iC->isValid(),
264  iC->getQuality(),
265  iC->getKeyWG(),
266  iC->getStrip() + CSCConstants::NUM_HALF_STRIPS_ME1B,
267  iC->getPattern(),
268  iC->getBend(),
269  iC->getBX(),
270  iC->getMPCLink(),
271  iC->getBX0(),
272  iC->getSyncErr(),
273  iC->getCSCID());
274  }
275  }
276  cscData.add(shiftedDigis);
277  } else {
278  cscData.add(std::vector<CSCCorrelatedLCTDigi>((*j).second.first, (*j).second.second));
279  }
280  }
281 }
282 
283 void CSCDigiToRaw::add(const CSCShowerDigiCollection& cscShowerDigis,
284  FindEventDataInfo& fedInfo,
285  enum CSCShowerType showerType) const {
286  for (const auto& shower : cscShowerDigis) {
287  const CSCDetId& cscDetId = shower.first;
288  CSCEventData& cscData = findEventData(cscDetId, fedInfo);
289 
290  switch (showerType) {
291  case CSCShowerType::lctShower:
292  cscData.addShower(std::vector<CSCShowerDigi>(shower.second.first, shower.second.second));
293  break;
294  case CSCShowerType::anodeShower:
295  cscData.addAnodeShower(std::vector<CSCShowerDigi>(shower.second.first, shower.second.second));
296  break;
297  case CSCShowerType::cathodeShower:
298  cscData.addCathodeShower(std::vector<CSCShowerDigi>(shower.second.first, shower.second.second));
299  break;
300  case CSCShowerType::anodeALCTShower:
301  cscData.addAnodeALCTShower(std::vector<CSCShowerDigi>(shower.second.first, shower.second.second));
302  break;
303  default:
304  cscData.addShower(std::vector<CSCShowerDigi>(shower.second.first, shower.second.second));
305  }
306  }
307 }
308 
309 void CSCDigiToRaw::add(const GEMPadDigiClusterCollection& gemPadClusters, FindEventDataInfo& fedInfo) const {
310  for (const auto& jclus : gemPadClusters) {
311  const GEMDetId& gemDetId = jclus.first;
312 
313  const int zendcap = gemDetId.region() == 1 ? 1 : 2;
314  CSCDetId cscDetId(zendcap, gemDetId.station(), 1, gemDetId.chamber(), 0);
315  CSCEventData& cscData = findEventData(cscDetId, fedInfo);
316 
317  cscData.add(std::vector<GEMPadDigiCluster>(jclus.second.first, jclus.second.second), gemDetId);
318  }
319 }
320 
322  const CSCWireDigiCollection& wireDigis,
323  const CSCComparatorDigiCollection& comparatorDigis,
324  const CSCALCTDigiCollection& alctDigis,
325  const CSCCLCTDigiCollection& clctDigis,
326  const CSCCLCTPreTriggerCollection* preTriggers,
327  const CSCCLCTPreTriggerDigiCollection* preTriggerDigis,
328  const CSCCorrelatedLCTDigiCollection& correlatedLCTDigis,
329  const CSCShowerDigiCollection* cscShowerDigis,
330  const CSCShowerDigiCollection* anodeShowerDigis,
331  const CSCShowerDigiCollection* cathodeShowerDigis,
332  const CSCShowerDigiCollection* anodeALCTShowerDigis,
333  const GEMPadDigiClusterCollection* gemPadDigiClusters,
334  FEDRawDataCollection& fed_buffers,
335  const CSCChamberMap* mapping,
336  const EventID& eid) const {
337  //get fed object from fed_buffers
338  // make a map from the index of a chamber to the event data from it
339  FindEventDataInfo fedInfo{mapping, formatVersion_};
340 
341  add(stripDigis, preTriggers, preTriggerDigis, fedInfo);
342  add(wireDigis, alctDigis, fedInfo);
343  add(comparatorDigis, clctDigis, fedInfo);
344  add(correlatedLCTDigis, fedInfo);
345 
346  // Starting Run-3, the CSC DAQ will pack/unpack CSC showers
347  // lctShower 4-bits sent from OTMB to MPC in trigger data
348  // anodeShower - anodeHMT 2-bits in OTMB
349  // cathodeShower - cathodeHMT 2-bits in OTMB
350  // anodeALCTShower - vector of anode HMT 2-bits per ALCT bx sent by ALCT board to OTMB
351  if (cscShowerDigis) {
352  add(*cscShowerDigis, fedInfo, CSCShowerType::lctShower);
353  add(*anodeShowerDigis, fedInfo, CSCShowerType::anodeShower);
354  add(*cathodeShowerDigis, fedInfo, CSCShowerType::cathodeShower);
355  add(*anodeALCTShowerDigis, fedInfo, CSCShowerType::anodeALCTShower);
356  }
357 
358  // Starting Run-3, the CSC DAQ will pack/unpack GEM clusters
359  if (gemPadDigiClusters) {
360  add(*gemPadDigiClusters, fedInfo);
361  }
362  int l1a = eid.event(); //need to add increments or get it from lct digis
363  int bx = l1a; //same as above
364 
365  if (fedInfo.formatVersion_ == 2005)
366  {
367  std::map<int, CSCDCCEventData> dccMap;
368  //idcc goes from startingFed to startingFED+7
369  for (int idcc = FEDNumbering::MINCSCFEDID; idcc <= FEDNumbering::MAXCSCFEDID; ++idcc) {
370  dccMap.insert(std::pair<int, CSCDCCEventData>(idcc, CSCDCCEventData(idcc, CSCConstants::NUM_DDUS, bx, l1a)));
371  }
372 
373  for (int idcc = FEDNumbering::MINCSCFEDID; idcc <= FEDNumbering::MAXCSCFEDID; ++idcc) {
374  // for every chamber with data, add to a DDU in this DCC Event
375  for (map<CSCDetId, CSCEventData>::iterator chamberItr = fedInfo.theChamberDataMap.begin();
376  chamberItr != fedInfo.theChamberDataMap.end();
377  ++chamberItr) {
378  int indexDCC = mapping->slink(chamberItr->first);
379  if (indexDCC == idcc) {
380  //FIXME (What does this mean? Is something wrong?)
381  std::map<int, CSCDCCEventData>::iterator dccMapItr = dccMap.find(indexDCC);
382  if (dccMapItr == dccMap.end()) {
383  throw cms::Exception("CSCDigiToRaw") << "Bad DCC number:" << indexDCC;
384  }
385  // get id's based on ChamberId from mapping
386 
387  int dduId = mapping->ddu(chamberItr->first);
388  int dduSlot = mapping->dduSlot(chamberItr->first);
389  int dduInput = mapping->dduInput(chamberItr->first);
390  int dmbId = mapping->dmb(chamberItr->first);
391  dccMapItr->second.addChamber(chamberItr->second, dduId, dduSlot, dduInput, dmbId, formatVersion_);
392  }
393  }
394  }
395 
396  // FIXME: FEDRawData size set to 2*64 to add FED header and trailer
397  for (std::map<int, CSCDCCEventData>::iterator dccMapItr = dccMap.begin(); dccMapItr != dccMap.end(); ++dccMapItr) {
398  boost::dynamic_bitset<> dccBits = dccMapItr->second.pack();
399  FEDRawData& fedRawData = fed_buffers.FEDData(dccMapItr->first);
400  fedRawData.resize(dccBits.size());
401  //fill data with dccEvent
402  bitset_utilities::bitsetToChar(dccBits, fedRawData.data());
403  FEDTrailer cscFEDTrailer(fedRawData.data() + (fedRawData.size() - 8));
404  cscFEDTrailer.set(fedRawData.data() + (fedRawData.size() - 8),
405  fedRawData.size() / 8,
406  evf::compute_crc(fedRawData.data(), fedRawData.size()),
407  0,
408  0);
409  }
410  }
412  else if (formatVersion_ >= 2013) {
413  std::map<int, CSCDDUEventData> dduMap;
414  unsigned int ddu_fmt_version = 0x7;
415  const unsigned postLS1_map[] = {841, 842, 843, 844, 845, 846, 847, 848, 849, 831, 832, 833,
416  834, 835, 836, 837, 838, 839, 861, 862, 863, 864, 865, 866,
417  867, 868, 869, 851, 852, 853, 854, 855, 856, 857, 858, 859};
418 
420  for (unsigned int i = 0; i < 36; i++) {
421  unsigned int iddu = postLS1_map[i];
422  // make a new one
423  CSCDDUHeader newDDUHeader(bx, l1a, iddu, ddu_fmt_version);
424 
425  dduMap.insert(std::pair<int, CSCDDUEventData>(iddu, CSCDDUEventData(newDDUHeader)));
426  }
427 
429  for (unsigned int i = 0; i < 36; i++) {
430  unsigned int iddu = postLS1_map[i];
431  // for every chamber with data, add to a DDU in this DCC Event
432  for (map<CSCDetId, CSCEventData>::iterator chamberItr = fedInfo.theChamberDataMap.begin();
433  chamberItr != fedInfo.theChamberDataMap.end();
434  ++chamberItr) {
435  unsigned int indexDDU = mapping->slink(chamberItr->first);
436 
438  // Still preLS1 DCC FEDs mapping
439  if ((indexDDU >= FEDNumbering::MINCSCFEDID) && (indexDDU <= FEDNumbering::MAXCSCFEDID)) {
440  int dduID = mapping->ddu(chamberItr->first); // try to switch to DDU ID mapping
441  // DDU ID is in expectedi post-LS1 FED ID range
442  if ((dduID >= FEDNumbering::MINCSCDDUFEDID) && (dduID <= FEDNumbering::MAXCSCDDUFEDID)) {
443  indexDDU = dduID;
444  } else // Messy
445  {
446  // Lets try to change pre-LS1 1-36 ID range to post-LS1 MINCSCDDUFEDID - MAXCSCDDUFEDID range
447  dduID &= 0xFF;
448  // indexDDU = FEDNumbering::MINCSCDDUFEDID + dduID-1;
449  if ((dduID <= 36) && (dduID > 0))
450  indexDDU = postLS1_map[dduID - 1];
451  }
452  }
453 
454  if (indexDDU == iddu) {
455  std::map<int, CSCDDUEventData>::iterator dduMapItr = dduMap.find(indexDDU);
456  if (dduMapItr == dduMap.end()) {
457  throw cms::Exception("CSCDigiToRaw") << "Bad DDU number:" << indexDDU;
458  }
459  // get id's based on ChamberId from mapping
460 
461  int dduInput = mapping->dduInput(chamberItr->first);
462  int dmbId = mapping->dmb(chamberItr->first);
463  // int crateId = mapping->crate(chamberItr->first);
464  dduMapItr->second.add(chamberItr->second, dmbId, dduInput, formatVersion_);
465  }
466  }
467  }
468 
469  // FIXME: FEDRawData size set to 2*64 to add FED header and trailer
470  for (std::map<int, CSCDDUEventData>::iterator dduMapItr = dduMap.begin(); dduMapItr != dduMap.end(); ++dduMapItr) {
471  boost::dynamic_bitset<> dduBits = dduMapItr->second.pack();
472  FEDRawData& fedRawData = fed_buffers.FEDData(dduMapItr->first);
473  fedRawData.resize(dduBits.size() / 8);
474  //fill data with dduEvent
475  bitset_utilities::bitsetToChar(dduBits, fedRawData.data());
476  FEDTrailer cscFEDTrailer(fedRawData.data() + (fedRawData.size() - 8));
477  cscFEDTrailer.set(fedRawData.data() + (fedRawData.size() - 8),
478  fedRawData.size() / 8,
479  evf::compute_crc(fedRawData.data(), fedRawData.size()),
480  0,
481  0);
482  }
483  }
484 }
01/20/05 A.Tumanov
EventNumber_t event() const
Definition: EventID.h:40
static const TGPicture * info(bool iBackgroundIsBlack)
int getCFEB() const
Get the CFEB number. Counts from 0.
Definition: CSCStripDigi.cc:25
bool accept(const CSCDetId &cscId, const LCTCollection &lcts, int bxMin, int bxMax, int nominalBX)
uint16_t formatVersion_
Definition: CSCDigiToRaw.h:91
bool usePreTriggers_
Definition: CSCDigiToRaw.h:93
const int clctWindowMin_
Definition: CSCDigiToRaw.h:86
bool packEverything_
Definition: CSCDigiToRaw.h:92
int ddu(const CSCDetId &) const
ddu id for given DetId
const int clctWindowMax_
Definition: CSCDigiToRaw.h:87
int dmb(const CSCDetId &) const
dmb id for given DetId
void setdmbVersion(unsigned int version)
Definition: CSCDMBHeader.h:32
int layer() const
Definition: CSCDetId.h:56
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:45
void addAnodeShower(const std::vector< CSCShowerDigi > &)
Add/pack anode CSCShower object (from OTMB header)
int getStrip() const
Definition: CSCStripDigi.h:41
void addAnodeALCTShower(const std::vector< CSCShowerDigi > &)
Add/pack anode CSCShower objects (from ALCT board data)
int endcap() const
Definition: CSCDetId.h:85
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
void addShower(const std::vector< CSCShowerDigi > &)
Run3 CSC Shower HMT objects.
void setStrip(int istrip)
Definition: CSCStripDigi.h:65
CSCEventData & findEventData(const CSCDetId &cscDetId, FindEventDataInfo &) const
pick out the correct data object for this chamber
Definition: CSCDigiToRaw.cc:44
void resize(size_t newsize)
Definition: FEDRawData.cc:28
int slink(const CSCDetId &) const
slink id for given DetId
const int preTriggerWindowMin_
Definition: CSCDigiToRaw.h:88
constexpr int region() const
Definition: GEMDetId.h:171
unsigned short compute_crc(unsigned char *buffer, unsigned int bufSize)
Definition: CRC16.h:46
const int preTriggerWindowMax_
Definition: CSCDigiToRaw.h:89
int dduInput(const CSCDetId &) const
ddu input for given DetId
CSCDetId chamberID(const CSCDetId &cscDetId)
CSCShowerType
CSC Shower HMT bits types.
Definition: CSCDigiToRaw.h:29
CSCDigiToRaw(const edm::ParameterSet &pset)
Constructor.
Definition: CSCDigiToRaw.cc:29
unsigned short iChamberType() const
Definition: CSCDetId.h:96
const CSCChamberMap * theElectronicsMap
Definition: CSCDigiToRaw.h:58
void createFedBuffers(const CSCStripDigiCollection &stripDigis, const CSCWireDigiCollection &wireDigis, const CSCComparatorDigiCollection &comparatorDigis, const CSCALCTDigiCollection &alctDigis, const CSCCLCTDigiCollection &clctDigis, const CSCCLCTPreTriggerCollection *preTriggers, const CSCCLCTPreTriggerDigiCollection *preTriggerDigis, const CSCCorrelatedLCTDigiCollection &correlatedLCTDigis, const CSCShowerDigiCollection *showerDigis, const CSCShowerDigiCollection *anodeShowerDigis, const CSCShowerDigiCollection *cathodeShowerDigis, const CSCShowerDigiCollection *anodeALCTShowerDigis, const GEMPadDigiClusterCollection *padDigiClusters, FEDRawDataCollection &fed_buffers, const CSCChamberMap *theMapping, const edm::EventID &eid) const
Take a vector of digis and fill the FEDRawDataCollection.
void setCrateAddress(int crate, int dmbId)
Definition: CSCDMBHeader.h:30
const int alctWindowMin_
Definition: CSCDigiToRaw.h:84
int ring() const
Definition: CSCDetId.h:68
const int alctWindowMax_
Definition: CSCDigiToRaw.h:85
constexpr int chamber() const
Definition: GEMDetId.h:183
void bitsetToChar(const boost::dynamic_bitset<> &bs, unsigned char *result)
this method takes bitset obj and returns char * array
void add(const CSCStripDigiCollection &stripDigis, const CSCCLCTPreTriggerCollection *preTriggers, const CSCCLCTPreTriggerDigiCollection *preTriggerDigis, FindEventDataInfo &) const
Definition: CSCDigiToRaw.cc:71
int crate(const CSCDetId &) const
Interface required use in digi-to-raw.
constexpr int station() const
Definition: GEMDetId.h:179
int dduSlot(const CSCDetId &) const
ddu slot for given DetId
void add(const CSCStripDigi &, int layer)
routines to add digis to the data
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:24
int station() const
Definition: CSCDetId.h:79
tuple last
Definition: dqmdumpme.py:56
void addCathodeShower(const std::vector< CSCShowerDigi > &)
Add/pack cathode CSCShower object (from OTMB header)
const CSCDMBHeader * dmbHeader() const
the DAQ motherboard header. A good place for event and chamber info
Definition: CSCEventData.h:73
bool packByCFEB_
Definition: CSCDigiToRaw.h:94
A container for a generic type of digis indexed by some index, implemented with a map&lt;IndexType...