CMS 3D CMS Logo

CSCDigiToRaw.cc
Go to the documentation of this file.
1 
13 #include "boost/dynamic_bitset.hpp"
22 #include <algorithm>
23 
24 using namespace edm;
25 using namespace std;
26 
27 namespace cscd2r
28 {
30 CSCDetId chamberID(const CSCDetId & cscDetId)
31 {
32  CSCDetId chamberId = cscDetId.chamberId();
33  if (chamberId.ring() ==4)
34  {
35  chamberId = CSCDetId(chamberId.endcap(), chamberId.station(), 1, chamberId.chamber(), 0);
36  }
37  return chamberId;
38 }
39 
40 template<typename LCTCollection>
41 bool accept(const CSCDetId & cscId, const LCTCollection & lcts,
42  int bxMin, int bxMax, bool me1abCheck = false)
43 {
44  if (bxMin == -999) return true;
45  int nominalBX = 6;
46  CSCDetId chamberId = chamberID(cscId);
47  typename LCTCollection::Range lctRange = lcts.get(chamberId);
48  bool result = false;
49  for (typename LCTCollection::const_iterator lctItr = lctRange.first;
50  lctItr != lctRange.second; ++lctItr)
51  {
52  int bx = lctItr->getBX() - nominalBX;
53  if (bx >= bxMin && bx <= bxMax)
54  {
55  result = true;
56  break;
57  }
58  }
59 
60  bool me1 = cscId.station() == 1 && cscId.ring() == 1;
61  //this is another "creative" recovery of smart ME1A-ME1B TMB logic cases:
62  //wire selective readout requires at least one (A)LCT in the full chamber
63  if (me1 && result == false && me1abCheck){
64  CSCDetId me1aId = CSCDetId(chamberId.endcap(), chamberId.station(), 4, chamberId.chamber(), 0);
65  lctRange = lcts.get(me1aId);
66  for (typename LCTCollection::const_iterator lctItr = lctRange.first;
67  lctItr != lctRange.second; ++lctItr)
68  {
69  int bx = lctItr->getBX() - nominalBX;
70  if (bx >= bxMin && bx <= bxMax)
71  {
72  result = true;
73  break;
74  }
75  }
76  }
77 
78  return result;
79 }
80 
81 // need to specialize for pretriggers, since they don't have a getBX()
82 template<>
83 bool accept(const CSCDetId & cscId, const CSCCLCTPreTriggerCollection & lcts,
84  int bxMin, int bxMax, bool me1abCheck)
85 {
86  if (bxMin == -999) return true;
87  int nominalBX = 6;
88  CSCDetId chamberId = chamberID(cscId);
89  CSCCLCTPreTriggerCollection::Range lctRange = lcts.get(chamberId);
90  bool result = false;
91  for (CSCCLCTPreTriggerCollection::const_iterator lctItr = lctRange.first;
92  lctItr != lctRange.second; ++lctItr)
93  {
94  int bx = *lctItr - nominalBX;
95  if (bx >= bxMin && bx <= bxMax)
96  {
97  result = true;
98  break;
99  }
100  }
101  bool me1a = cscId.station() == 1 && cscId.ring() == 4;
102  if (me1a && result == false && me1abCheck) {
103  //check pretriggers in me1a as well; relevant for TMB emulator writing to separate detIds
104  lctRange = lcts.get(cscId);
105  for (CSCCLCTPreTriggerCollection::const_iterator lctItr = lctRange.first;
106  lctItr != lctRange.second; ++lctItr)
107  {
108  int bx = *lctItr - nominalBX;
109  if (bx >= bxMin && bx <= bxMax)
110  {
111  result = true;
112  break;
113  }
114  }
115  }
116  return result;
117 }
118 
119 }
120 
121 
123  : alctWindowMin_(pset.getParameter<int>("alctWindowMin")),
124  alctWindowMax_(pset.getParameter<int>("alctWindowMax")),
125  clctWindowMin_(pset.getParameter<int>("clctWindowMin")),
126  clctWindowMax_(pset.getParameter<int>("clctWindowMax")),
127  preTriggerWindowMin_(pset.getParameter<int>("preTriggerWindowMin")),
128  preTriggerWindowMax_(pset.getParameter<int>("preTriggerWindowMax"))
129 {}
130 
132 {
133  CSCDetId chamberId = cscd2r::chamberID(cscDetId);
134  // find the entry into the map
135  map<CSCDetId, CSCEventData>::iterator chamberMapItr = info.theChamberDataMap.find(chamberId);
136  if (chamberMapItr == info.theChamberDataMap.end())
137  {
138  // make an entry, telling it the correct chamberType
139  int chamberType = chamberId.iChamberType();
140  chamberMapItr = info.theChamberDataMap.insert(pair<CSCDetId, CSCEventData>(chamberId, CSCEventData(chamberType, info.formatVersion_))).first;
141  }
142  CSCEventData & cscData = chamberMapItr->second;
143  cscData.dmbHeader()->setCrateAddress(info.theElectronicsMap->crate(cscDetId), info.theElectronicsMap->dmb(cscDetId));
144 
145  if (info.formatVersion_ == 2013)
146  {
147  // Set DMB version field to distinguish between ME11s and other chambers (ME11 - 2, others - 1)
148  bool me11 = ((chamberId.station()==1) && (chamberId.ring()==4)) || ((chamberId.station()==1) && (chamberId.ring()==1));
149  if (me11)
150  {
151  cscData.dmbHeader()->setdmbVersion(2);
152  }
153  else
154  {
155  cscData.dmbHeader()->setdmbVersion(1);
156  }
157 
158  }
159  return cscData;
160 }
161 
162 
163 
165  const CSCCLCTPreTriggerCollection & preTriggers,
166  FindEventDataInfo& fedInfo,
167  bool usePreTriggers,
168  bool packEverything ) const
169 { //iterate over chambers with strip digis in them
170  for (CSCStripDigiCollection::DigiRangeIterator j=stripDigis.begin(); j!=stripDigis.end(); ++j)
171  {
172  CSCDetId cscDetId=(*j).first;
173  // only digitize if there are pre-triggers
174 
175  bool me1abCheck = fedInfo.formatVersion_ == 2013;
176  /* !!! Testing. Uncomment for production */
177  if (!usePreTriggers || packEverything ||
178  (usePreTriggers && cscd2r::accept(cscDetId, preTriggers, preTriggerWindowMin_, preTriggerWindowMax_, me1abCheck)) )
179  {
180  bool me1a = (cscDetId.station()==1) && (cscDetId.ring()==4);
181  bool zplus = (cscDetId.endcap() == 1);
182  bool me1b = (cscDetId.station()==1) && (cscDetId.ring()==1);
183 
184  CSCEventData & cscData = findEventData(cscDetId, fedInfo);
185 
186  std::vector<CSCStripDigi>::const_iterator digiItr = (*j).second.first;
187  std::vector<CSCStripDigi>::const_iterator last = (*j).second.second;
188  for ( ; digiItr != last; ++digiItr)
189  {
190  CSCStripDigi digi = *digiItr;
191  int strip = digi.getStrip();
192  if (fedInfo.formatVersion_ == 2013)
193  {
194  if ( me1a && zplus )
195  {
196  digi.setStrip(49-strip); // 1-48 -> 48-1
197  }
198  if ( me1b && !zplus)
199  {
200  digi.setStrip(65-strip); // 1-64 -> 64-1
201  }
202  if ( me1a )
203  {
204  strip = digi.getStrip(); // reset back 1-16 to 65-80 digi
205  digi.setStrip(strip+64);
206  }
207 
208  }
209  else
210  {
211  if ( me1a && zplus )
212  {
213  digi.setStrip(17-strip); // 1-16 -> 16-1
214  }
215  if ( me1b && !zplus)
216  {
217  digi.setStrip(65-strip); // 1-64 -> 64-1
218  }
219  if ( me1a )
220  {
221  strip = digi.getStrip(); // reset back 1-16 to 65-80 digi
222  digi.setStrip(strip+64);
223  }
224  }
225  cscData.add(digi, cscDetId.layer() );
226  }
227  }
228  }
229 }
230 
231 
233  const CSCALCTDigiCollection & alctDigis,
234  FindEventDataInfo& fedInfo,
235  bool packEverything) const
236 {
237  add(alctDigis, fedInfo);
238  for (CSCWireDigiCollection::DigiRangeIterator j=wireDigis.begin(); j!=wireDigis.end(); ++j)
239  {
240  CSCDetId cscDetId=(*j).first;
241  bool me1abCheck = fedInfo.formatVersion_ == 2013;
242  if (packEverything || cscd2r::accept(cscDetId, alctDigis, alctWindowMin_, alctWindowMax_, me1abCheck))
243  {
244  CSCEventData & cscData = findEventData(cscDetId, fedInfo);
245  std::vector<CSCWireDigi>::const_iterator digiItr = (*j).second.first;
246  std::vector<CSCWireDigi>::const_iterator last = (*j).second.second;
247  for ( ; digiItr != last; ++digiItr)
248  {
249  cscData.add(*digiItr, cscDetId.layer() );
250  }
251  }
252  }
253 
254 }
255 
256 void CSCDigiToRaw::add(const CSCComparatorDigiCollection & comparatorDigis,
257  const CSCCLCTDigiCollection & clctDigis,
258  FindEventDataInfo& fedInfo,
259  bool packEverything) const
260 {
261  add(clctDigis,fedInfo);
262  for (auto const& j : comparatorDigis)
263  {
264  CSCDetId cscDetId=j.first;
265  CSCEventData & cscData = findEventData(cscDetId, fedInfo);
266  bool me1abCheck = fedInfo.formatVersion_ == 2013;
267  if (packEverything || cscd2r::accept(cscDetId, clctDigis, clctWindowMin_, clctWindowMax_, me1abCheck))
268  {
269  bool me1a = (cscDetId.station()==1) && (cscDetId.ring()==4);
270 
271 
272  for(auto digi = j.second.first; digi != j.second.second; ++digi)
273  {
274  if (fedInfo.formatVersion_ == 2013)
275  {
276  // Move ME1/A comparators from CFEB=0 to CFEB=4 if this has not
277  // been done already.
278  if (me1a && digi->getStrip() <= 48)
279  {
280  CSCComparatorDigi digi_corr(64+digi->getStrip(),
281  digi->getComparator(),
282  digi->getTimeBinWord());
283  cscData.add(digi_corr, cscDetId); // This version does ME11 strips swapping
284  // cscData.add(digi_corr, cscDetId.layer()); // This one doesn't
285  }
286  else
287  {
288  cscData.add(*digi, cscDetId); // This version does ME11 strips swapping
289  // cscData.add(digi, cscDetId.layer()); // This one doesn't
290  }
291  }
292  else
293  {
294  // Move ME1/A comparators from CFEB=0 to CFEB=4 if this has not
295  // been done already.
296  if (me1a && digi->getStrip() <= 16)
297  {
298  CSCComparatorDigi digi_corr(64+digi->getStrip(),
299  digi->getComparator(),
300  digi->getTimeBinWord());
301  cscData.add(digi_corr, cscDetId.layer());
302  }
303  else
304  {
305  cscData.add(*digi, cscDetId.layer());
306  }
307  }
308  }
309  }
310  }
311 }
312 
314  FindEventDataInfo& fedInfo) const
315 {
316  for (CSCALCTDigiCollection::DigiRangeIterator j=alctDigis.begin(); j!=alctDigis.end(); ++j)
317  {
318  CSCDetId cscDetId=(*j).first;
319  CSCEventData & cscData = findEventData(cscDetId,fedInfo);
320 
321  cscData.add(std::vector<CSCALCTDigi>((*j).second.first, (*j).second.second));
322  }
323 }
324 
326  FindEventDataInfo& fedInfo) const
327 {
328  for (CSCCLCTDigiCollection::DigiRangeIterator j=clctDigis.begin(); j!=clctDigis.end(); ++j)
329  {
330  CSCDetId cscDetId=(*j).first;
331  CSCEventData & cscData = findEventData(cscDetId, fedInfo);
332 
333  bool me11a = cscDetId.station() == 1 && cscDetId.ring() == 4;
334  //CLCTs are packed by chamber not by A/B parts in ME11
335  //me11a appears only in simulation with SLHC algorithm settings
336  //without the shift, it's impossible to distinguish A and B parts
337  if (me11a && fedInfo.formatVersion_ == 2013){
338  std::vector<CSCCLCTDigi> shiftedDigis((*j).second.first, (*j).second.second);
339  for (std::vector<CSCCLCTDigi>::iterator iC = shiftedDigis.begin(); iC != shiftedDigis.end(); ++iC) {
340  if (iC->getCFEB() >= 0 && iC->getCFEB() < 3){//sanity check, mostly
341  (*iC) = CSCCLCTDigi(iC->isValid(), iC->getQuality(), iC->getPattern(), iC->getStripType(),
342  iC->getBend(), iC->getStrip(), iC->getCFEB()+4, iC->getBX(),
343  iC->getTrknmb(), iC->getFullBX());
344  }
345  }
346  cscData.add(shiftedDigis);
347  } else {
348  cscData.add(std::vector<CSCCLCTDigi>((*j).second.first, (*j).second.second));
349  }
350  }
351 }
352 
353 void CSCDigiToRaw::add(const CSCCorrelatedLCTDigiCollection & corrLCTDigis, FindEventDataInfo& fedInfo) const
354 {
355  for (CSCCorrelatedLCTDigiCollection::DigiRangeIterator j=corrLCTDigis.begin(); j!=corrLCTDigis.end(); ++j)
356  {
357  CSCDetId cscDetId=(*j).first;
358  CSCEventData & cscData = findEventData(cscDetId, fedInfo);
359 
360  bool me11a = cscDetId.station() == 1 && cscDetId.ring() == 4;
361  //LCTs are packed by chamber not by A/B parts in ME11
362  //me11a appears only in simulation with SLHC algorithm settings
363  //without the shift, it's impossible to distinguish A and B parts
364  if (me11a && fedInfo.formatVersion_ == 2013){
365  std::vector<CSCCorrelatedLCTDigi> shiftedDigis((*j).second.first, (*j).second.second);
366  for (std::vector<CSCCorrelatedLCTDigi>::iterator iC = shiftedDigis.begin(); iC != shiftedDigis.end(); ++iC) {
367  if (iC->getStrip() >= 0 && iC->getStrip() < 96){//sanity check, mostly
368  (*iC) = CSCCorrelatedLCTDigi(iC->getTrknmb(), iC->isValid(), iC->getQuality(),
369  iC->getKeyWG(), iC->getStrip() + 128, iC->getPattern(),
370  iC->getBend(), iC->getBX(), iC->getMPCLink(),
371  iC->getBX0(), iC->getSyncErr(), iC->getCSCID());
372  }
373  }
374  cscData.add(shiftedDigis);
375  } else {
376  cscData.add(std::vector<CSCCorrelatedLCTDigi>((*j).second.first, (*j).second.second));
377  }
378  }
379 
380 }
381 
382 
384  const CSCWireDigiCollection& wireDigis,
385  const CSCComparatorDigiCollection& comparatorDigis,
386  const CSCALCTDigiCollection& alctDigis,
387  const CSCCLCTDigiCollection& clctDigis,
388  const CSCCLCTPreTriggerCollection & preTriggers,
389  const CSCCorrelatedLCTDigiCollection& correlatedLCTDigis,
390  FEDRawDataCollection& fed_buffers,
391  const CSCChamberMap* mapping,
392  Event & e, uint16_t format_version, bool use_pre_triggers,
393  bool packEverything) const
394 {
395 
396  //bits of code from ORCA/Muon/METBFormatter - thanks, Rick:)!
397 
398  //get fed object from fed_buffers
399  // make a map from the index of a chamber to the event data from it
400  FindEventDataInfo fedInfo{mapping, format_version};
401  add(stripDigis, preTriggers,fedInfo, use_pre_triggers, packEverything);
402  add(wireDigis, alctDigis,fedInfo, packEverything);
403  add(comparatorDigis, clctDigis,fedInfo, packEverything);
404  add(correlatedLCTDigis,fedInfo);
405 
406  int l1a=e.id().event(); //need to add increments or get it from lct digis
407  int bx = l1a;//same as above
408  //int startingFED = FEDNumbering::MINCSCFEDID;
409 
410  if (fedInfo.formatVersion_ == 2005)
411  {
412  std::map<int, CSCDCCEventData> dccMap;
413  for (int idcc=FEDNumbering::MINCSCFEDID;
414  idcc<=FEDNumbering::MAXCSCFEDID; ++idcc)
415  {
416  //idcc goes from startingFed to startingFED+7
417  // @@ if ReadoutMapping changes, this'll have to change
418  // DCCs 1,2,4,5 have 5 DDUs. Otherwise, 4
419  //int nDDUs = (idcc < 2) || (idcc ==4) || (idcc ==5)
420  // ? 5 : 4;
421  //@@ WARNING some DCCs only have 4 DDUs, but I'm giving them all 5, for now
422  int nDDUs = 5;
423  dccMap.insert(std::pair<int, CSCDCCEventData>(idcc, CSCDCCEventData(idcc, nDDUs, bx, l1a) ) );
424  }
425 
426  for (int idcc=FEDNumbering::MINCSCFEDID;
427  idcc<=FEDNumbering::MAXCSCFEDID; ++idcc)
428  {
429 
430  // for every chamber with data, add to a DDU in this DCC Event
431  for (map<CSCDetId, CSCEventData>::iterator chamberItr = fedInfo.theChamberDataMap.begin();
432  chamberItr != fedInfo.theChamberDataMap.end(); ++chamberItr)
433  {
434  int indexDCC = mapping->slink(chamberItr->first);
435  if (indexDCC == idcc)
436  {
437  //FIXME (What does this mean? Is something wrong?)
438  std::map<int, CSCDCCEventData>::iterator dccMapItr = dccMap.find(indexDCC);
439  if (dccMapItr == dccMap.end())
440  {
441  throw cms::Exception("CSCDigiToRaw") << "Bad DCC number:" << indexDCC;
442  }
443  // get id's based on ChamberId from mapping
444 
445  int dduId = mapping->ddu(chamberItr->first);
446  int dduSlot = mapping->dduSlot(chamberItr->first);
447  int dduInput = mapping->dduInput(chamberItr->first);
448  int dmbId = mapping->dmb(chamberItr->first);
449  dccMapItr->second.addChamber(chamberItr->second, dduId, dduSlot, dduInput, dmbId, format_version);
450  }
451  }
452  }
453 
454  // FIXME: FEDRawData size set to 2*64 to add FED header and trailer
455  for (std::map<int, CSCDCCEventData>::iterator dccMapItr = dccMap.begin();
456  dccMapItr != dccMap.end(); ++dccMapItr)
457  {
458  boost::dynamic_bitset<> dccBits = dccMapItr->second.pack();
459  FEDRawData & fedRawData = fed_buffers.FEDData(dccMapItr->first);
460  fedRawData.resize(dccBits.size());
461  //fill data with dccEvent
462  bitset_utilities::bitsetToChar(dccBits, fedRawData.data());
463  FEDTrailer cscFEDTrailer(fedRawData.data()+(fedRawData.size()-8));
464  cscFEDTrailer.set(fedRawData.data()+(fedRawData.size()-8),
465  fedRawData.size()/8,
466  evf::compute_crc(fedRawData.data(),fedRawData.size()), 0, 0);
467  }
468 
469  }
470  else if (format_version == 2013)
471  {
472 
473  std::map<int, CSCDDUEventData> dduMap;
474  unsigned int ddu_fmt_version = 0x7;
475  const unsigned postLS1_map [] = { 841, 842, 843, 844, 845, 846, 847, 848, 849,
476  831, 832, 833, 834, 835, 836, 837, 838, 839,
477  861, 862, 863, 864, 865, 866, 867, 868, 869,
478  851, 852, 853, 854, 855, 856, 857, 858, 859 };
479 
480 
482  for (unsigned int i = 0; i < 36; i++)
483  {
484  unsigned int iddu = postLS1_map[i];
485  // make a new one
486  CSCDDUHeader newDDUHeader(bx,l1a, iddu, ddu_fmt_version);
487 
488  dduMap.insert(std::pair<int, CSCDDUEventData>(iddu, CSCDDUEventData(newDDUHeader) ) );
489  }
490 
491 
493  for (unsigned int i = 0; i < 36; i++)
494  {
495  unsigned int iddu = postLS1_map[i];
496  // for every chamber with data, add to a DDU in this DCC Event
497  for (map<CSCDetId, CSCEventData>::iterator chamberItr = fedInfo.theChamberDataMap.begin();
498  chamberItr != fedInfo.theChamberDataMap.end(); ++chamberItr)
499  {
500  unsigned int indexDDU = mapping->slink(chamberItr->first);
501 
503  if ( (indexDDU >= FEDNumbering::MINCSCFEDID) && (indexDDU <= FEDNumbering::MAXCSCFEDID) ) // Still preLS1 DCC FEDs mapping
504  {
505 
506  int dduID = mapping->ddu(chamberItr->first); // try to switch to DDU ID mapping
507  if ((dduID >= FEDNumbering::MINCSCDDUFEDID) && (dduID <= FEDNumbering::MAXCSCDDUFEDID) ) // DDU ID is in expectedi post-LS1 FED ID range
508  {
509  indexDDU = dduID;
510  }
511  else // Messy
512  {
513  // Lets try to change pre-LS1 1-36 ID range to post-LS1 MINCSCDDUFEDID - MAXCSCDDUFEDID range
514  dduID &= 0xFF;
515  if ((dduID <= 36) && (dduID > 0)) indexDDU = postLS1_map[dduID -1]; // indexDDU = FEDNumbering::MINCSCDDUFEDID + dduID-1;
516  }
517 
518  }
519 
520  if (indexDDU == iddu)
521  {
522  std::map<int, CSCDDUEventData>::iterator dduMapItr = dduMap.find(indexDDU);
523  if (dduMapItr == dduMap.end())
524  {
525  throw cms::Exception("CSCDigiToRaw") << "Bad DDU number:" << indexDDU;
526  }
527  // get id's based on ChamberId from mapping
528 
529  int dduInput = mapping->dduInput(chamberItr->first);
530  int dmbId = mapping->dmb(chamberItr->first);
531  // int crateId = mapping->crate(chamberItr->first);
532  dduMapItr->second.add( chamberItr->second, dmbId, dduInput, format_version );
533  }
534  }
535  }
536 
537  // FIXME: FEDRawData size set to 2*64 to add FED header and trailer
538  for (std::map<int, CSCDDUEventData>::iterator dduMapItr = dduMap.begin();
539  dduMapItr != dduMap.end(); ++dduMapItr)
540  {
541  boost::dynamic_bitset<> dduBits = dduMapItr->second.pack();
542  FEDRawData & fedRawData = fed_buffers.FEDData(dduMapItr->first);
543  fedRawData.resize(dduBits.size()/8);
544  //fill data with dduEvent
545  bitset_utilities::bitsetToChar(dduBits, fedRawData.data());
546  FEDTrailer cscFEDTrailer(fedRawData.data()+(fedRawData.size()-8));
547  cscFEDTrailer.set(fedRawData.data()+(fedRawData.size()-8),
548  fedRawData.size()/8,
549  evf::compute_crc(fedRawData.data(),fedRawData.size()), 0, 0);
550 
551  }
552  }
553 }
554 
555 
01/20/05 A.Tumanov
int chamber() const
Definition: CSCDetId.h:68
EventNumber_t event() const
Definition: EventID.h:41
static const TGPicture * info(bool iBackgroundIsBlack)
bool accept(const CSCDetId &cscId, const CSCCLCTPreTriggerCollection &lcts, int bxMin, int bxMax, bool me1abCheck)
Definition: CSCDigiToRaw.cc:83
PixelRecoRange< float > Range
const int clctWindowMin_
Definition: CSCDigiToRaw.h:82
int ddu(const CSCDetId &) const
ddu id for given DetId
const int clctWindowMax_
Definition: CSCDigiToRaw.h:83
int dmb(const CSCDetId &) const
dmb id for given DetId
void setdmbVersion(unsigned int version)
Definition: CSCDMBHeader.h:37
int layer() const
Definition: CSCDetId.h:61
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
int getStrip() const
Definition: CSCStripDigi.h:41
int endcap() const
Definition: CSCDetId.h:93
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
void setStrip(int istrip)
Definition: CSCStripDigi.h:62
CSCEventData & findEventData(const CSCDetId &cscDetId, FindEventDataInfo &) const
pick out the correct data object for this chamber
void resize(size_t newsize)
Definition: FEDRawData.cc:32
int slink(const CSCDetId &) const
slink id for given DetId
const int preTriggerWindowMin_
Definition: CSCDigiToRaw.h:84
unsigned short compute_crc(unsigned char *buffer, unsigned int bufSize)
Definition: CRC16.h:46
const int preTriggerWindowMax_
Definition: CSCDigiToRaw.h:85
int dduInput(const CSCDetId &) const
ddu input for given DetId
CSCDetId chamberId() const
Definition: CSCDetId.h:53
CSCDetId chamberID(const CSCDetId &cscDetId)
takes layer ID, converts to chamber ID, switching ME1A to ME11
Definition: CSCDigiToRaw.cc:30
CSCDigiToRaw(const edm::ParameterSet &pset)
Constructor.
unsigned short iChamberType() const
Definition: CSCDetId.h:107
const CSCChamberMap * theElectronicsMap
Definition: CSCDigiToRaw.h:50
void setCrateAddress(int crate, int dmbId)
Definition: CSCDMBHeader.h:35
bool accept(const CSCDetId &cscId, const LCTCollection &lcts, int bxMin, int bxMax, bool me1abCheck=false)
Definition: CSCDigiToRaw.cc:41
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) const
Take a vector of digis and fill the FEDRawDataCollection.
const int alctWindowMin_
Definition: CSCDigiToRaw.h:80
int ring() const
Definition: CSCDetId.h:75
const int alctWindowMax_
Definition: CSCDigiToRaw.h:81
void bitsetToChar(const boost::dynamic_bitset<> &bs, unsigned char *result)
this method takes bitset obj and returns char * array
int crate(const CSCDetId &) const
Interface required use in digi-to-raw.
std::vector< DigiType >::const_iterator const_iterator
int dduSlot(const CSCDetId &) const
ddu slot for given DetId
void add(const CSCStripDigi &, int layer)
routines to add digis to the data
edm::EventID id() const
Definition: EventBase.h:59
HLT enums.
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:28
int station() const
Definition: CSCDetId.h:86
std::pair< const_iterator, const_iterator > Range
void add(const CSCStripDigiCollection &stripDigis, const CSCCLCTPreTriggerCollection &preTriggers, FindEventDataInfo &, bool usePreTriggers, bool packEverything) const
const CSCDMBHeader * dmbHeader() const
the DAQ motherboard header. A good place for event and chamber info
Definition: CSCEventData.h:82