CMS 3D CMS Logo

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