CMS 3D CMS Logo

List of all members | Classes | Public Member Functions | Private Member Functions | Private Attributes
CSCDigiToRaw Class Reference

#include <CSCDigiToRaw.h>

Classes

struct  FindEventDataInfo
 

Public Member Functions

void createFedBuffers (const CSCStripDigiCollection &stripDigis, const CSCWireDigiCollection &wireDigis, const CSCComparatorDigiCollection &comparatorDigis, const CSCALCTDigiCollection &alctDigis, const CSCCLCTDigiCollection &clctDigis, const CSCCLCTPreTriggerCollection *preTriggers, const CSCCorrelatedLCTDigiCollection &correlatedLCTDigis, const GEMPadDigiClusterCollection *padDigiClusters, FEDRawDataCollection &fed_buffers, const CSCChamberMap *theMapping, const edm::EventID &eid, uint16_t theFormatVersion=2005, bool packEverything=false) const
 Take a vector of digis and fill the FEDRawDataCollection. More...
 
 CSCDigiToRaw (const edm::ParameterSet &pset)
 Constructor. More...
 

Private Member Functions

void add (const CSCALCTDigiCollection &alctDigis, FindEventDataInfo &) const
 
void add (const CSCCLCTDigiCollection &clctDigis, FindEventDataInfo &) const
 
void add (const CSCComparatorDigiCollection &comparatorDigis, const CSCCLCTDigiCollection &clctDigis, FindEventDataInfo &, bool packEverything) const
 
void add (const CSCCorrelatedLCTDigiCollection &corrLCTDigis, FindEventDataInfo &) const
 
void add (const CSCStripDigiCollection &stripDigis, const CSCCLCTPreTriggerCollection *preTriggers, FindEventDataInfo &, bool packEverything) const
 
void add (const CSCWireDigiCollection &wireDigis, const CSCALCTDigiCollection &alctDigis, FindEventDataInfo &, bool packEverything) const
 
void add (const GEMPadDigiClusterCollection &gemPadClusters, FindEventDataInfo &) const
 
CSCEventDatafindEventData (const CSCDetId &cscDetId, FindEventDataInfo &) const
 pick out the correct data object for this chamber More...
 

Private Attributes

const int alctWindowMax_
 
const int alctWindowMin_
 
const int clctWindowMax_
 
const int clctWindowMin_
 
const int preTriggerWindowMax_
 
const int preTriggerWindowMin_
 

Detailed Description

Author
A. Tumanov - Rice

Definition at line 25 of file CSCDigiToRaw.h.

Constructor & Destructor Documentation

◆ CSCDigiToRaw()

CSCDigiToRaw::CSCDigiToRaw ( const edm::ParameterSet pset)
explicit

Constructor.

Definition at line 104 of file CSCDigiToRaw.cc.

105  : alctWindowMin_(pset.getParameter<int>("alctWindowMin")),
106  alctWindowMax_(pset.getParameter<int>("alctWindowMax")),
107  clctWindowMin_(pset.getParameter<int>("clctWindowMin")),
108  clctWindowMax_(pset.getParameter<int>("clctWindowMax")),
109  preTriggerWindowMin_(pset.getParameter<int>("preTriggerWindowMin")),
110  preTriggerWindowMax_(pset.getParameter<int>("preTriggerWindowMax")) {}

Member Function Documentation

◆ add() [1/7]

void CSCDigiToRaw::add ( const CSCALCTDigiCollection alctDigis,
FindEventDataInfo fedInfo 
) const
private

Definition at line 252 of file CSCDigiToRaw.cc.

252  {
253  for (CSCALCTDigiCollection::DigiRangeIterator j = alctDigis.begin(); j != alctDigis.end(); ++j) {
254  CSCDetId cscDetId = (*j).first;
255  CSCEventData& cscData = findEventData(cscDetId, fedInfo);
256 
257  cscData.add(std::vector<CSCALCTDigi>((*j).second.first, (*j).second.second));
258  }
259 }

References CSCEventData::add(), findEventData(), and dqmiolumiharvest::j.

Referenced by counter.Counter::register(), SequenceTypes.Task::remove(), and SequenceTypes.Task::replace().

◆ add() [2/7]

void CSCDigiToRaw::add ( const CSCCLCTDigiCollection clctDigis,
FindEventDataInfo fedInfo 
) const
private

Definition at line 261 of file CSCDigiToRaw.cc.

261  {
262  for (CSCCLCTDigiCollection::DigiRangeIterator j = clctDigis.begin(); j != clctDigis.end(); ++j) {
263  CSCDetId cscDetId = (*j).first;
264  CSCEventData& cscData = findEventData(cscDetId, fedInfo);
265 
266  bool me11a = cscDetId.station() == 1 && cscDetId.ring() == 4;
267  //CLCTs are packed by chamber not by A/B parts in ME11
268  //me11a appears only in simulation with SLHC algorithm settings
269  //without the shift, it's impossible to distinguish A and B parts
270  if (me11a && fedInfo.formatVersion_ == 2013) {
271  std::vector<CSCCLCTDigi> shiftedDigis((*j).second.first, (*j).second.second);
272  for (std::vector<CSCCLCTDigi>::iterator iC = shiftedDigis.begin(); iC != shiftedDigis.end(); ++iC) {
273  if (iC->getCFEB() < 3) { //sanity check, mostly
274  (*iC) = CSCCLCTDigi(iC->isValid(),
275  iC->getQuality(),
276  iC->getPattern(),
277  iC->getStripType(),
278  iC->getBend(),
279  iC->getStrip(),
280  iC->getCFEB() + 4,
281  iC->getBX(),
282  iC->getTrknmb(),
283  iC->getFullBX());
284  }
285  }
286  cscData.add(shiftedDigis);
287  } else {
288  cscData.add(std::vector<CSCCLCTDigi>((*j).second.first, (*j).second.second));
289  }
290  }
291 }

References CSCEventData::add(), findEventData(), CSCDigiToRaw::FindEventDataInfo::formatVersion_, dqmiolumiharvest::j, CSCDetId::ring(), and CSCDetId::station().

Referenced by counter.Counter::register(), SequenceTypes.Task::remove(), and SequenceTypes.Task::replace().

◆ add() [3/7]

void CSCDigiToRaw::add ( const CSCComparatorDigiCollection comparatorDigis,
const CSCCLCTDigiCollection clctDigis,
FindEventDataInfo fedInfo,
bool  packEverything 
) const
private

Definition at line 213 of file CSCDigiToRaw.cc.

216  {
217  add(clctDigis, fedInfo);
218  for (auto const& j : comparatorDigis) {
219  CSCDetId cscDetId = j.first;
220  CSCEventData& cscData = findEventData(cscDetId, fedInfo);
221  bool me1abCheck = fedInfo.formatVersion_ == 2013;
222  if (packEverything || cscd2r::accept(cscDetId, clctDigis, clctWindowMin_, clctWindowMax_, me1abCheck)) {
223  bool me1a = (cscDetId.station() == 1) && (cscDetId.ring() == 4);
224 
225  for (auto digi = j.second.first; digi != j.second.second; ++digi) {
226  if (fedInfo.formatVersion_ == 2013) {
227  // Move ME1/A comparators from CFEB=0 to CFEB=4 if this has not
228  // been done already.
229  if (me1a && digi->getStrip() <= 48) {
230  CSCComparatorDigi digi_corr(64 + digi->getStrip(), digi->getComparator(), digi->getTimeBinWord());
231  cscData.add(digi_corr, cscDetId); // This version does ME11 strips swapping
232  // cscData.add(digi_corr, cscDetId.layer()); // This one doesn't
233  } else {
234  cscData.add(*digi, cscDetId); // This version does ME11 strips swapping
235  // cscData.add(digi, cscDetId.layer()); // This one doesn't
236  }
237  } else {
238  // Move ME1/A comparators from CFEB=0 to CFEB=4 if this has not
239  // been done already.
240  if (me1a && digi->getStrip() <= 16) {
241  CSCComparatorDigi digi_corr(64 + digi->getStrip(), digi->getComparator(), digi->getTimeBinWord());
242  cscData.add(digi_corr, cscDetId.layer());
243  } else {
244  cscData.add(*digi, cscDetId.layer());
245  }
246  }
247  }
248  }
249  }
250 }

References cscd2r::accept(), add(), CSCEventData::add(), clctWindowMax_, clctWindowMin_, findEventData(), CSCDigiToRaw::FindEventDataInfo::formatVersion_, dqmiolumiharvest::j, CSCDetId::layer(), cscPacker_cfi::packEverything, CSCDetId::ring(), and CSCDetId::station().

Referenced by counter.Counter::register(), SequenceTypes.Task::remove(), and SequenceTypes.Task::replace().

◆ add() [4/7]

void CSCDigiToRaw::add ( const CSCCorrelatedLCTDigiCollection corrLCTDigis,
FindEventDataInfo fedInfo 
) const
private

Definition at line 293 of file CSCDigiToRaw.cc.

293  {
294  for (CSCCorrelatedLCTDigiCollection::DigiRangeIterator j = corrLCTDigis.begin(); j != corrLCTDigis.end(); ++j) {
295  CSCDetId cscDetId = (*j).first;
296  CSCEventData& cscData = findEventData(cscDetId, fedInfo);
297 
298  bool me11a = cscDetId.station() == 1 && cscDetId.ring() == 4;
299  //LCTs are packed by chamber not by A/B parts in ME11
300  //me11a appears only in simulation with SLHC algorithm settings
301  //without the shift, it's impossible to distinguish A and B parts
302  if (me11a && fedInfo.formatVersion_ == 2013) {
303  std::vector<CSCCorrelatedLCTDigi> shiftedDigis((*j).second.first, (*j).second.second);
304  for (std::vector<CSCCorrelatedLCTDigi>::iterator iC = shiftedDigis.begin(); iC != shiftedDigis.end(); ++iC) {
305  if (iC->getStrip() < 96) { //sanity check, mostly
306  (*iC) = CSCCorrelatedLCTDigi(iC->getTrknmb(),
307  iC->isValid(),
308  iC->getQuality(),
309  iC->getKeyWG(),
310  iC->getStrip() + 128,
311  iC->getPattern(),
312  iC->getBend(),
313  iC->getBX(),
314  iC->getMPCLink(),
315  iC->getBX0(),
316  iC->getSyncErr(),
317  iC->getCSCID());
318  }
319  }
320  cscData.add(shiftedDigis);
321  } else {
322  cscData.add(std::vector<CSCCorrelatedLCTDigi>((*j).second.first, (*j).second.second));
323  }
324  }
325 }

References CSCEventData::add(), findEventData(), CSCDigiToRaw::FindEventDataInfo::formatVersion_, dqmiolumiharvest::j, CSCDetId::ring(), and CSCDetId::station().

Referenced by counter.Counter::register(), SequenceTypes.Task::remove(), and SequenceTypes.Task::replace().

◆ add() [5/7]

void CSCDigiToRaw::add ( const CSCStripDigiCollection stripDigis,
const CSCCLCTPreTriggerCollection preTriggers,
FindEventDataInfo fedInfo,
bool  packEverything 
) const
private

Definition at line 139 of file CSCDigiToRaw.cc.

142  { //iterate over chambers with strip digis in them
143  for (CSCStripDigiCollection::DigiRangeIterator j = stripDigis.begin(); j != stripDigis.end(); ++j) {
144  CSCDetId cscDetId = (*j).first;
145  // only digitize if there are pre-triggers
146 
147  bool me1abCheck = fedInfo.formatVersion_ == 2013;
148  /* !!! Testing. Uncomment for production */
149  const bool usePreTriggers = preTriggers != nullptr;
150  if (!usePreTriggers || packEverything ||
151  (usePreTriggers &&
152  cscd2r::accept(cscDetId, *preTriggers, preTriggerWindowMin_, preTriggerWindowMax_, me1abCheck))) {
153  bool me1a = (cscDetId.station() == 1) && (cscDetId.ring() == 4);
154  bool zplus = (cscDetId.endcap() == 1);
155  bool me1b = (cscDetId.station() == 1) && (cscDetId.ring() == 1);
156 
157  CSCEventData& cscData = findEventData(cscDetId, fedInfo);
158 
159  std::vector<CSCStripDigi>::const_iterator digiItr = (*j).second.first;
160  std::vector<CSCStripDigi>::const_iterator last = (*j).second.second;
161  for (; digiItr != last; ++digiItr) {
162  CSCStripDigi digi = *digiItr;
163  int strip = digi.getStrip();
164  if (fedInfo.formatVersion_ == 2013) {
165  if (me1a && zplus) {
166  digi.setStrip(49 - strip); // 1-48 -> 48-1
167  }
168  if (me1b && !zplus) {
169  digi.setStrip(65 - strip); // 1-64 -> 64-1
170  }
171  if (me1a) {
172  strip = digi.getStrip(); // reset back 1-16 to 65-80 digi
173  digi.setStrip(strip + 64);
174  }
175 
176  } else {
177  if (me1a && zplus) {
178  digi.setStrip(17 - strip); // 1-16 -> 16-1
179  }
180  if (me1b && !zplus) {
181  digi.setStrip(65 - strip); // 1-64 -> 64-1
182  }
183  if (me1a) {
184  strip = digi.getStrip(); // reset back 1-16 to 65-80 digi
185  digi.setStrip(strip + 64);
186  }
187  }
188  cscData.add(digi, cscDetId.layer());
189  }
190  }
191  }
192 }

References cscd2r::accept(), CSCEventData::add(), CSCDetId::endcap(), findEventData(), CSCDigiToRaw::FindEventDataInfo::formatVersion_, CSCStripDigi::getStrip(), dqmiolumiharvest::j, dqmdumpme::last, CSCDetId::layer(), cscPacker_cfi::packEverything, preTriggerWindowMax_, preTriggerWindowMin_, CSCDetId::ring(), CSCStripDigi::setStrip(), CSCDetId::station(), digitizers_cfi::strip, cscPacker_cfi::usePreTriggers, and SurfaceOrientation::zplus.

Referenced by add(), createFedBuffers(), counter.Counter::register(), SequenceTypes.Task::remove(), and SequenceTypes.Task::replace().

◆ add() [6/7]

void CSCDigiToRaw::add ( const CSCWireDigiCollection wireDigis,
const CSCALCTDigiCollection alctDigis,
FindEventDataInfo fedInfo,
bool  packEverything 
) const
private

Definition at line 194 of file CSCDigiToRaw.cc.

197  {
198  add(alctDigis, fedInfo);
199  for (CSCWireDigiCollection::DigiRangeIterator j = wireDigis.begin(); j != wireDigis.end(); ++j) {
200  CSCDetId cscDetId = (*j).first;
201  bool me1abCheck = fedInfo.formatVersion_ == 2013;
202  if (packEverything || cscd2r::accept(cscDetId, alctDigis, alctWindowMin_, alctWindowMax_, me1abCheck)) {
203  CSCEventData& cscData = findEventData(cscDetId, fedInfo);
204  std::vector<CSCWireDigi>::const_iterator digiItr = (*j).second.first;
205  std::vector<CSCWireDigi>::const_iterator last = (*j).second.second;
206  for (; digiItr != last; ++digiItr) {
207  cscData.add(*digiItr, cscDetId.layer());
208  }
209  }
210  }
211 }

References cscd2r::accept(), add(), CSCEventData::add(), alctWindowMax_, alctWindowMin_, findEventData(), CSCDigiToRaw::FindEventDataInfo::formatVersion_, dqmiolumiharvest::j, dqmdumpme::last, CSCDetId::layer(), and cscPacker_cfi::packEverything.

Referenced by counter.Counter::register(), SequenceTypes.Task::remove(), and SequenceTypes.Task::replace().

◆ add() [7/7]

void CSCDigiToRaw::add ( const GEMPadDigiClusterCollection gemPadClusters,
FindEventDataInfo fedInfo 
) const
private

Definition at line 327 of file CSCDigiToRaw.cc.

327  {
328  for (const auto& jclus : gemPadClusters) {
329  const GEMDetId& gemDetId = jclus.first;
330 
331  const int zendcap = gemDetId.region() == 1 ? 1 : 2;
332  CSCDetId cscDetId(zendcap, gemDetId.station(), 1, gemDetId.chamber(), 0);
333  CSCEventData& cscData = findEventData(cscDetId, fedInfo);
334 
335  cscData.add(std::vector<GEMPadDigiCluster>(jclus.second.first, jclus.second.second), gemDetId);
336  }
337 }

References GEMDetId::chamber(), findEventData(), GEMDetId::region(), and GEMDetId::station().

Referenced by counter.Counter::register(), SequenceTypes.Task::remove(), and SequenceTypes.Task::replace().

◆ createFedBuffers()

void CSCDigiToRaw::createFedBuffers ( const CSCStripDigiCollection stripDigis,
const CSCWireDigiCollection wireDigis,
const CSCComparatorDigiCollection comparatorDigis,
const CSCALCTDigiCollection alctDigis,
const CSCCLCTDigiCollection clctDigis,
const CSCCLCTPreTriggerCollection preTriggers,
const CSCCorrelatedLCTDigiCollection correlatedLCTDigis,
const GEMPadDigiClusterCollection padDigiClusters,
FEDRawDataCollection fed_buffers,
const CSCChamberMap theMapping,
const edm::EventID eid,
uint16_t  theFormatVersion = 2005,
bool  packEverything = false 
) const

Take a vector of digis and fill the FEDRawDataCollection.

Handle pre-LS1 format data

Handle post-LS1 format data

2013 Format

Create dummy DDU buffers

Loop over post-LS1 DDU FEDs

Lets handle possible mapping issues

Definition at line 339 of file CSCDigiToRaw.cc.

351  {
352  //bits of code from ORCA/Muon/METBFormatter - thanks, Rick:)!
353 
354  //get fed object from fed_buffers
355  // make a map from the index of a chamber to the event data from it
356  FindEventDataInfo fedInfo{mapping, format_version};
357  add(stripDigis, preTriggers, fedInfo, packEverything);
358  add(wireDigis, alctDigis, fedInfo, packEverything);
359  add(comparatorDigis, clctDigis, fedInfo, packEverything);
360  add(correlatedLCTDigis, fedInfo);
361  // Starting Run-3, the CSC DAQ will pack/unpack GEM clusters
362  if (gemPadDigiClusters) {
363  add(*gemPadDigiClusters, fedInfo);
364  }
365  int l1a = eid.event(); //need to add increments or get it from lct digis
366  int bx = l1a; //same as above
367  //int startingFED = FEDNumbering::MINCSCFEDID;
368 
369  if (fedInfo.formatVersion_ == 2005)
370  {
371  std::map<int, CSCDCCEventData> dccMap;
372  for (int idcc = FEDNumbering::MINCSCFEDID; idcc <= FEDNumbering::MAXCSCFEDID; ++idcc) {
373  //idcc goes from startingFed to startingFED+7
374  // @@ if ReadoutMapping changes, this'll have to change
375  // DCCs 1,2,4,5 have 5 DDUs. Otherwise, 4
376  //int nDDUs = (idcc < 2) || (idcc ==4) || (idcc ==5)
377  // ? 5 : 4;
378  //@@ WARNING some DCCs only have 4 DDUs, but I'm giving them all 5, for now
379  int nDDUs = 5;
380  dccMap.insert(std::pair<int, CSCDCCEventData>(idcc, CSCDCCEventData(idcc, nDDUs, bx, l1a)));
381  }
382 
383  for (int idcc = FEDNumbering::MINCSCFEDID; idcc <= FEDNumbering::MAXCSCFEDID; ++idcc) {
384  // for every chamber with data, add to a DDU in this DCC Event
385  for (map<CSCDetId, CSCEventData>::iterator chamberItr = fedInfo.theChamberDataMap.begin();
386  chamberItr != fedInfo.theChamberDataMap.end();
387  ++chamberItr) {
388  int indexDCC = mapping->slink(chamberItr->first);
389  if (indexDCC == idcc) {
390  //FIXME (What does this mean? Is something wrong?)
391  std::map<int, CSCDCCEventData>::iterator dccMapItr = dccMap.find(indexDCC);
392  if (dccMapItr == dccMap.end()) {
393  throw cms::Exception("CSCDigiToRaw") << "Bad DCC number:" << indexDCC;
394  }
395  // get id's based on ChamberId from mapping
396 
397  int dduId = mapping->ddu(chamberItr->first);
398  int dduSlot = mapping->dduSlot(chamberItr->first);
399  int dduInput = mapping->dduInput(chamberItr->first);
400  int dmbId = mapping->dmb(chamberItr->first);
401  dccMapItr->second.addChamber(chamberItr->second, dduId, dduSlot, dduInput, dmbId, format_version);
402  }
403  }
404  }
405 
406  // FIXME: FEDRawData size set to 2*64 to add FED header and trailer
407  for (std::map<int, CSCDCCEventData>::iterator dccMapItr = dccMap.begin(); dccMapItr != dccMap.end(); ++dccMapItr) {
408  boost::dynamic_bitset<> dccBits = dccMapItr->second.pack();
409  FEDRawData& fedRawData = fed_buffers.FEDData(dccMapItr->first);
410  fedRawData.resize(dccBits.size());
411  //fill data with dccEvent
413  FEDTrailer cscFEDTrailer(fedRawData.data() + (fedRawData.size() - 8));
414  cscFEDTrailer.set(fedRawData.data() + (fedRawData.size() - 8),
415  fedRawData.size() / 8,
416  evf::compute_crc(fedRawData.data(), fedRawData.size()),
417  0,
418  0);
419  }
420 
421  } else if (format_version == 2013)
422  {
423  std::map<int, CSCDDUEventData> dduMap;
424  unsigned int ddu_fmt_version = 0x7;
425  const unsigned postLS1_map[] = {841, 842, 843, 844, 845, 846, 847, 848, 849, 831, 832, 833,
426  834, 835, 836, 837, 838, 839, 861, 862, 863, 864, 865, 866,
427  867, 868, 869, 851, 852, 853, 854, 855, 856, 857, 858, 859};
428 
430  for (unsigned int i = 0; i < 36; i++) {
431  unsigned int iddu = postLS1_map[i];
432  // make a new one
433  CSCDDUHeader newDDUHeader(bx, l1a, iddu, ddu_fmt_version);
434 
435  dduMap.insert(std::pair<int, CSCDDUEventData>(iddu, CSCDDUEventData(newDDUHeader)));
436  }
437 
439  for (unsigned int i = 0; i < 36; i++) {
440  unsigned int iddu = postLS1_map[i];
441  // for every chamber with data, add to a DDU in this DCC Event
442  for (map<CSCDetId, CSCEventData>::iterator chamberItr = fedInfo.theChamberDataMap.begin();
443  chamberItr != fedInfo.theChamberDataMap.end();
444  ++chamberItr) {
445  unsigned int indexDDU = mapping->slink(chamberItr->first);
446 
448  // Still preLS1 DCC FEDs mapping
449  if ((indexDDU >= FEDNumbering::MINCSCFEDID) && (indexDDU <= FEDNumbering::MAXCSCFEDID)) {
450  int dduID = mapping->ddu(chamberItr->first); // try to switch to DDU ID mapping
451  // DDU ID is in expectedi post-LS1 FED ID range
452  if ((dduID >= FEDNumbering::MINCSCDDUFEDID) && (dduID <= FEDNumbering::MAXCSCDDUFEDID)) {
453  indexDDU = dduID;
454  } else // Messy
455  {
456  // Lets try to change pre-LS1 1-36 ID range to post-LS1 MINCSCDDUFEDID - MAXCSCDDUFEDID range
457  dduID &= 0xFF;
458  // indexDDU = FEDNumbering::MINCSCDDUFEDID + dduID-1;
459  if ((dduID <= 36) && (dduID > 0))
460  indexDDU = postLS1_map[dduID - 1];
461  }
462  }
463 
464  if (indexDDU == iddu) {
465  std::map<int, CSCDDUEventData>::iterator dduMapItr = dduMap.find(indexDDU);
466  if (dduMapItr == dduMap.end()) {
467  throw cms::Exception("CSCDigiToRaw") << "Bad DDU number:" << indexDDU;
468  }
469  // get id's based on ChamberId from mapping
470 
471  int dduInput = mapping->dduInput(chamberItr->first);
472  int dmbId = mapping->dmb(chamberItr->first);
473  // int crateId = mapping->crate(chamberItr->first);
474  dduMapItr->second.add(chamberItr->second, dmbId, dduInput, format_version);
475  }
476  }
477  }
478 
479  // FIXME: FEDRawData size set to 2*64 to add FED header and trailer
480  for (std::map<int, CSCDDUEventData>::iterator dduMapItr = dduMap.begin(); dduMapItr != dduMap.end(); ++dduMapItr) {
481  boost::dynamic_bitset<> dduBits = dduMapItr->second.pack();
482  FEDRawData& fedRawData = fed_buffers.FEDData(dduMapItr->first);
483  fedRawData.resize(dduBits.size() / 8);
484  //fill data with dduEvent
486  FEDTrailer cscFEDTrailer(fedRawData.data() + (fedRawData.size() - 8));
487  cscFEDTrailer.set(fedRawData.data() + (fedRawData.size() - 8),
488  fedRawData.size() / 8,
489  evf::compute_crc(fedRawData.data(), fedRawData.size()),
490  0,
491  0);
492  }
493  }
494 }

References add(), bitset_utilities::bitsetToChar(), l1GtPatternGenerator_cfi::bx, evf::compute_crc(), runTauDisplay::eid, Exception, FEDRawDataCollection::FEDData(), l1t_dqm_sourceclient-live_cfg::fedRawData, mps_fire::i, taus_updatedMVAIds_cff::mapping, FEDNumbering::MAXCSCDDUFEDID, FEDNumbering::MAXCSCFEDID, FEDNumbering::MINCSCDDUFEDID, FEDNumbering::MINCSCFEDID, and cscPacker_cfi::packEverything.

◆ findEventData()

CSCEventData & CSCDigiToRaw::findEventData ( const CSCDetId cscDetId,
FindEventDataInfo info 
) const
private

pick out the correct data object for this chamber

Definition at line 112 of file CSCDigiToRaw.cc.

112  {
113  CSCDetId chamberId = cscd2r::chamberID(cscDetId);
114  // find the entry into the map
115  map<CSCDetId, CSCEventData>::iterator chamberMapItr = info.theChamberDataMap.find(chamberId);
116  if (chamberMapItr == info.theChamberDataMap.end()) {
117  // make an entry, telling it the correct chamberType
118  int chamberType = chamberId.iChamberType();
119  chamberMapItr = info.theChamberDataMap
120  .insert(pair<CSCDetId, CSCEventData>(chamberId, CSCEventData(chamberType, info.formatVersion_)))
121  .first;
122  }
123  CSCEventData& cscData = chamberMapItr->second;
124  cscData.dmbHeader()->setCrateAddress(info.theElectronicsMap->crate(cscDetId), info.theElectronicsMap->dmb(cscDetId));
125 
126  if (info.formatVersion_ == 2013) {
127  // Set DMB version field to distinguish between ME11s and other chambers (ME11 - 2, others - 1)
128  bool me11 = ((chamberId.station() == 1) && (chamberId.ring() == 4)) ||
129  ((chamberId.station() == 1) && (chamberId.ring() == 1));
130  if (me11) {
131  cscData.dmbHeader()->setdmbVersion(2);
132  } else {
133  cscData.dmbHeader()->setdmbVersion(1);
134  }
135  }
136  return cscData;
137 }

References cscd2r::chamberID(), CSCEventData::dmbHeader(), CSCDetId::iChamberType(), info(), CSCDetId::ring(), CSCDMBHeader::setCrateAddress(), CSCDMBHeader::setdmbVersion(), and CSCDetId::station().

Referenced by add().

Member Data Documentation

◆ alctWindowMax_

const int CSCDigiToRaw::alctWindowMax_
private

Definition at line 77 of file CSCDigiToRaw.h.

Referenced by add().

◆ alctWindowMin_

const int CSCDigiToRaw::alctWindowMin_
private

Definition at line 76 of file CSCDigiToRaw.h.

Referenced by add().

◆ clctWindowMax_

const int CSCDigiToRaw::clctWindowMax_
private

Definition at line 79 of file CSCDigiToRaw.h.

Referenced by add().

◆ clctWindowMin_

const int CSCDigiToRaw::clctWindowMin_
private

Definition at line 78 of file CSCDigiToRaw.h.

Referenced by add().

◆ preTriggerWindowMax_

const int CSCDigiToRaw::preTriggerWindowMax_
private

Definition at line 81 of file CSCDigiToRaw.h.

Referenced by add().

◆ preTriggerWindowMin_

const int CSCDigiToRaw::preTriggerWindowMin_
private

Definition at line 80 of file CSCDigiToRaw.h.

Referenced by add().

CSCDigiToRaw::preTriggerWindowMax_
const int preTriggerWindowMax_
Definition: CSCDigiToRaw.h:81
CSCDMBHeader::setdmbVersion
void setdmbVersion(unsigned int version)
Definition: CSCDMBHeader.h:32
mps_fire.i
i
Definition: mps_fire.py:428
CSCEventData
Definition: CSCEventData.h:29
CSCDDUHeader
Definition: CSCDDUHeader.h:11
GEMDetId::region
constexpr int region() const
Definition: GEMDetId.h:168
CSCDetId::ring
int ring() const
Definition: CSCDetId.h:68
digitizers_cfi.strip
strip
Definition: digitizers_cfi.py:19
CSCDCCEventData
01/20/05 A.Tumanov
Definition: CSCDCCEventData.h:13
l1GtPatternGenerator_cfi.bx
bx
Definition: l1GtPatternGenerator_cfi.py:18
CSCStripDigi::getStrip
int getStrip() const
Definition: CSCStripDigi.h:41
FEDNumbering::MAXCSCFEDID
Definition: FEDNumbering.h:52
info
static const TGPicture * info(bool iBackgroundIsBlack)
Definition: FWCollectionSummaryWidget.cc:153
CSCEventData::dmbHeader
const CSCDMBHeader * dmbHeader() const
the DAQ motherboard header. A good place for event and chamber info
Definition: CSCEventData.h:76
CSCDigiToRaw::preTriggerWindowMin_
const int preTriggerWindowMin_
Definition: CSCDigiToRaw.h:80
FEDNumbering::MAXCSCDDUFEDID
Definition: FEDNumbering.h:90
CSCDetId::iChamberType
unsigned short iChamberType() const
Definition: CSCDetId.h:96
CSCCLCTDigi
Definition: CSCCLCTDigi.h:17
FEDRawData
Definition: FEDRawData.h:19
bitset_utilities::bitsetToChar
void bitsetToChar(const boost::dynamic_bitset<> &bs, unsigned char *result)
this method takes bitset obj and returns char * array
Definition: bitset_append.cc:32
dqmdumpme.last
last
Definition: dqmdumpme.py:56
l1t_dqm_sourceclient-live_cfg.fedRawData
fedRawData
Definition: l1t_dqm_sourceclient-live_cfg.py:188
cscPacker_cfi.usePreTriggers
usePreTriggers
Definition: cscPacker_cfi.py:27
CSCDetId::layer
int layer() const
Definition: CSCDetId.h:56
CSCDMBHeader::setCrateAddress
void setCrateAddress(int crate, int dmbId)
Definition: CSCDMBHeader.h:30
CSCComparatorDigi
Definition: CSCComparatorDigi.h:16
CSCDigiToRaw::alctWindowMax_
const int alctWindowMax_
Definition: CSCDigiToRaw.h:77
FEDRawDataCollection::FEDData
const FEDRawData & FEDData(int fedid) const
retrieve data for fed
Definition: FEDRawDataCollection.cc:19
evf::compute_crc
unsigned short compute_crc(unsigned char *buffer, unsigned int bufSize)
Definition: CRC16.h:46
cscPacker_cfi.packEverything
packEverything
Definition: cscPacker_cfi.py:28
GEMDetId::chamber
constexpr int chamber() const
Definition: GEMDetId.h:180
FEDTrailer
Definition: FEDTrailer.h:14
GEMDetId
Definition: GEMDetId.h:18
CSCDetId
Definition: CSCDetId.h:26
CSCEventData::add
void add(const CSCStripDigi &, int layer)
routines to add digis to the data
Definition: CSCEventData.cc:467
runTauDisplay.eid
eid
Definition: runTauDisplay.py:298
FEDNumbering::MINCSCFEDID
Definition: FEDNumbering.h:51
CSCDigiToRaw::findEventData
CSCEventData & findEventData(const CSCDetId &cscDetId, FindEventDataInfo &) const
pick out the correct data object for this chamber
Definition: CSCDigiToRaw.cc:112
cscd2r::accept
bool accept(const CSCDetId &cscId, const LCTCollection &lcts, int bxMin, int bxMax, bool me1abCheck=false)
Definition: CSCDigiToRaw.cc:38
CSCStripDigi
Definition: CSCStripDigi.h:17
CSCDDUEventData
Definition: CSCDDUEventData.h:19
CSCDigiToRaw::alctWindowMin_
const int alctWindowMin_
Definition: CSCDigiToRaw.h:76
CSCDigiToRaw::add
void add(const CSCStripDigiCollection &stripDigis, const CSCCLCTPreTriggerCollection *preTriggers, FindEventDataInfo &, bool packEverything) const
Definition: CSCDigiToRaw.cc:139
CSCDetId::endcap
int endcap() const
Definition: CSCDetId.h:85
Exception
Definition: hltDiff.cc:246
SurfaceOrientation::zplus
Definition: Surface.h:19
FEDNumbering::MINCSCDDUFEDID
Definition: FEDNumbering.h:89
GEMDetId::station
constexpr int station() const
Definition: GEMDetId.h:176
CSCDetId::station
int station() const
Definition: CSCDetId.h:79
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
cscd2r::chamberID
CSCDetId chamberID(const CSCDetId &cscDetId)
takes layer ID, converts to chamber ID, switching ME1A to ME11
Definition: CSCDigiToRaw.cc:29
CSCStripDigi::setStrip
void setStrip(int istrip)
Definition: CSCStripDigi.h:62
DigiContainerIterator
Definition: MuonDigiCollection.h:30
taus_updatedMVAIds_cff.mapping
mapping
Definition: taus_updatedMVAIds_cff.py:29
CSCDigiToRaw::clctWindowMin_
const int clctWindowMin_
Definition: CSCDigiToRaw.h:78
CSCCorrelatedLCTDigi
Definition: CSCCorrelatedLCTDigi.h:19
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
CSCDigiToRaw::clctWindowMax_
const int clctWindowMax_
Definition: CSCDigiToRaw.h:79