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, 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. 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 usePreTriggers, bool packEverything) const
 
void add (const CSCWireDigiCollection &wireDigis, const CSCALCTDigiCollection &alctDigis, FindEventDataInfo &, bool packEverything) 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 23 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/6]

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/6]

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/6]

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/6]

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/6]

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

Definition at line 139 of file CSCDigiToRaw.cc.

143  { //iterate over chambers with strip digis in them
144  for (CSCStripDigiCollection::DigiRangeIterator j = stripDigis.begin(); j != stripDigis.end(); ++j) {
145  CSCDetId cscDetId = (*j).first;
146  // only digitize if there are pre-triggers
147 
148  bool me1abCheck = fedInfo.formatVersion_ == 2013;
149  /* !!! Testing. Uncomment for production */
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/6]

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().

◆ 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,
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.

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 327 of file CSCDigiToRaw.cc.

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

References add(), bitset_utilities::bitsetToChar(), simKBmtfDigis_cfi::bx, evf::compute_crc(), MillePedeFileConverter_cfg::e, 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 75 of file CSCDigiToRaw.h.

Referenced by add().

◆ alctWindowMin_

const int CSCDigiToRaw::alctWindowMin_
private

Definition at line 74 of file CSCDigiToRaw.h.

Referenced by add().

◆ clctWindowMax_

const int CSCDigiToRaw::clctWindowMax_
private

Definition at line 77 of file CSCDigiToRaw.h.

Referenced by add().

◆ clctWindowMin_

const int CSCDigiToRaw::clctWindowMin_
private

Definition at line 76 of file CSCDigiToRaw.h.

Referenced by add().

◆ preTriggerWindowMax_

const int CSCDigiToRaw::preTriggerWindowMax_
private

Definition at line 79 of file CSCDigiToRaw.h.

Referenced by add().

◆ preTriggerWindowMin_

const int CSCDigiToRaw::preTriggerWindowMin_
private

Definition at line 78 of file CSCDigiToRaw.h.

Referenced by add().

CSCDigiToRaw::preTriggerWindowMax_
const int preTriggerWindowMax_
Definition: CSCDigiToRaw.h:79
CSCDMBHeader::setdmbVersion
void setdmbVersion(unsigned int version)
Definition: CSCDMBHeader.h:32
mps_fire.i
i
Definition: mps_fire.py:355
CSCEventData
Definition: CSCEventData.h:28
CSCDDUHeader
Definition: CSCDDUHeader.h:11
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
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:152
CSCEventData::dmbHeader
const CSCDMBHeader * dmbHeader() const
the DAQ motherboard header. A good place for event and chamber info
Definition: CSCEventData.h:75
CSCDigiToRaw::preTriggerWindowMin_
const int preTriggerWindowMin_
Definition: CSCDigiToRaw.h:78
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
simKBmtfDigis_cfi.bx
bx
Definition: simKBmtfDigis_cfi.py:55
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:75
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
FEDTrailer
Definition: FEDTrailer.h:14
CSCDetId
Definition: CSCDetId.h:26
CSCEventData::add
void add(const CSCStripDigi &, int layer)
routines to add digis to the data
Definition: CSCEventData.cc:467
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
CSCDigiToRaw::add
void add(const CSCStripDigiCollection &stripDigis, const CSCCLCTPreTriggerCollection &preTriggers, FindEventDataInfo &, bool usePreTriggers, bool packEverything) const
Definition: CSCDigiToRaw.cc:139
CSCStripDigi
Definition: CSCStripDigi.h:17
CSCDDUEventData
Definition: CSCDDUEventData.h:19
CSCDigiToRaw::alctWindowMin_
const int alctWindowMin_
Definition: CSCDigiToRaw.h:74
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
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:28
CSCDigiToRaw::clctWindowMin_
const int clctWindowMin_
Definition: CSCDigiToRaw.h:76
CSCCorrelatedLCTDigi
Definition: CSCCorrelatedLCTDigi.h:19
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37
CSCDigiToRaw::clctWindowMax_
const int clctWindowMax_
Definition: CSCDigiToRaw.h:77