CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Classes | Public Member Functions | Private Attributes
HcalUnpacker Class Reference

#include <HcalUnpacker.h>

Classes

struct  Collections
 

Public Member Functions

 HcalUnpacker (int sourceIdOffset, int beg, int end)
 for normal data More...
 
 HcalUnpacker (int sourceIdOffset)
 For histograms, no begin and end. More...
 
void setExpectedOrbitMessageTime (int time)
 
void unpack (const FEDRawData &raw, const HcalElectronicsMap &emap, std::vector< HcalHistogramDigi > &histoDigis)
 
void unpack (const FEDRawData &raw, const HcalElectronicsMap &emap, Collections &conts, HcalUnpackerReport &report, bool silent=false)
 
void unpack (const FEDRawData &raw, const HcalElectronicsMap &emap, std::vector< HBHEDataFrame > &precision, std::vector< HcalTriggerPrimitiveDigi > &tp)
 
void unpack (const FEDRawData &raw, const HcalElectronicsMap &emap, std::vector< HODataFrame > &precision, std::vector< HcalTriggerPrimitiveDigi > &tp)
 
void unpack (const FEDRawData &raw, const HcalElectronicsMap &emap, std::vector< HFDataFrame > &precision, std::vector< HcalTriggerPrimitiveDigi > &tp)
 

Private Attributes

int endSample_
 last sample from fed raw data to copy (if present) More...
 
int expectedOrbitMessageTime_
 Expected orbit bunch time (needed to evaluate time differences) More...
 
int sourceIdOffset_
 number to subtract from the source id to get the dcc id More...
 
int startSample_
 first sample from fed raw data to copy More...
 
std::set< HcalElectronicsIdunknownIds_
 
std::set< HcalElectronicsIdunknownIdsTrig_
 Recorded to limit number of times a log message is generated. More...
 

Detailed Description

Definition at line 19 of file HcalUnpacker.h.

Constructor & Destructor Documentation

HcalUnpacker::HcalUnpacker ( int  sourceIdOffset,
int  beg,
int  end 
)
inline

for normal data

Definition at line 35 of file HcalUnpacker.h.

35 : sourceIdOffset_(sourceIdOffset), startSample_(beg), endSample_(end), expectedOrbitMessageTime_(-1) { }
int sourceIdOffset_
number to subtract from the source id to get the dcc id
Definition: HcalUnpacker.h:48
int endSample_
last sample from fed raw data to copy (if present)
Definition: HcalUnpacker.h:50
int startSample_
first sample from fed raw data to copy
Definition: HcalUnpacker.h:49
int expectedOrbitMessageTime_
Expected orbit bunch time (needed to evaluate time differences)
Definition: HcalUnpacker.h:51
#define end
Definition: vmac.h:38
HcalUnpacker::HcalUnpacker ( int  sourceIdOffset)
inline

For histograms, no begin and end.

Definition at line 37 of file HcalUnpacker.h.

37 : sourceIdOffset_(sourceIdOffset), startSample_(-1), endSample_(-1), expectedOrbitMessageTime_(-1) { }
int sourceIdOffset_
number to subtract from the source id to get the dcc id
Definition: HcalUnpacker.h:48
int endSample_
last sample from fed raw data to copy (if present)
Definition: HcalUnpacker.h:50
int startSample_
first sample from fed raw data to copy
Definition: HcalUnpacker.h:49
int expectedOrbitMessageTime_
Expected orbit bunch time (needed to evaluate time differences)
Definition: HcalUnpacker.h:51

Member Function Documentation

void HcalUnpacker::setExpectedOrbitMessageTime ( int  time)
inline

Definition at line 38 of file HcalUnpacker.h.

References expectedOrbitMessageTime_, and cond::rpcobgas::time.

Referenced by HcalRawToDigi::HcalRawToDigi().

int expectedOrbitMessageTime_
Expected orbit bunch time (needed to evaluate time differences)
Definition: HcalUnpacker.h:51
void HcalUnpacker::unpack ( const FEDRawData raw,
const HcalElectronicsMap emap,
std::vector< HcalHistogramDigi > &  histoDigis 
)

Definition at line 346 of file HcalUnpacker.cc.

References HcalHTRData::check(), FEDRawData::data(), DetId::det(), f, benchmark_cfg::fc, HcalHistogramDigi::getArray(), HcalHTRData::getHistogramFibers(), HcalDCCHeader::getSourceId(), HcalDCCHeader::getSpigotData(), HcalDCCHeader::getSpigotPresent(), HcalHTRData::getSubmodule(), DetId::Hcal, HcalHTRData::isHistogramEvent(), HcalElectronicsMap::lookup(), DetId::null(), HcalElectronicsId::setHTR(), FEDRawData::size(), sourceIdOffset_, HcalDCCHeader::SPIGOT_COUNT, DetId::subdetId(), unknownIds_, and HcalHTRData::unpackHistogram().

Referenced by HcalHistogramRawToDigi::produce(), HcalRawToDigi::produce(), and unpack().

346  {
347 
348  // get the DCC header
349  const HcalDCCHeader* dccHeader=(const HcalDCCHeader*)(raw.data());
350  int dccid=dccHeader->getSourceId()-sourceIdOffset_;
351 
352  // check the summary status
353 
354  // walk through the HTR data...
355  HcalHTRData htr;
356  for (int spigot=0; spigot<HcalDCCHeader::SPIGOT_COUNT; spigot++) {
357  if (!dccHeader->getSpigotPresent(spigot)) continue;
358 
359  int retval=dccHeader->getSpigotData(spigot,htr,raw.size());
360  // check
361  if (retval || !htr.check()) {
362  edm::LogWarning("Invalid Data") << "Invalid HTR data observed on spigot " << spigot << " of DCC with source id " << dccHeader->getSourceId();
363  continue;
364  }
365  if (!htr.isHistogramEvent()) {
366  edm::LogWarning("Invalid Data") << "Non-histogram data passed to histogram unpacker on spigot " << spigot << " of DCC with source id " << dccHeader->getSourceId();
367  continue;
368  }
369 
370  unsigned int smid=htr.getSubmodule();
371  int htr_tb=smid&0x1;
372  int htr_slot=(smid>>1)&0x1F;
373  int htr_cr=(smid>>6)&0x1F;
374 
375  // find out the fibers
376  int f[2],fc;
377  htr.getHistogramFibers(f[0],f[1]);
378 
379  for (int nf=0; nf<2; nf++) {
380  if (f[nf]<0 || (nf==1 && f[0]==f[1])) continue; // skip if invalid or the same
381  for (fc=0; fc<=2; fc++) {
382  HcalElectronicsId eid(fc,f[nf],spigot,dccid);
383  eid.setHTR(htr_cr,htr_slot,htr_tb);
384  DetId did=emap.lookup(eid);
385 
386  if (did.null() || did.det()!=DetId::Hcal || did.subdetId()==0) {
387  if (unknownIds_.find(eid)==unknownIds_.end()) {
388  edm::LogWarning("HCAL") << "HcalHistogramUnpacker: No match found for electronics id :" << eid;
389  unknownIds_.insert(eid);
390  }
391  continue;
392  }
393  histoDigis.push_back(HcalHistogramDigi(HcalDetId(did))); // add it!
394  HcalHistogramDigi& digi=histoDigis.back();
395 
396  // unpack the four capids
397  for (int capid=0; capid<4; capid++)
398  htr.unpackHistogram(f[nf],fc,capid,digi.getArray(capid));
399 
400  }
401  }
402  }
403 }
std::set< HcalElectronicsId > unknownIds_
Definition: HcalUnpacker.h:52
int sourceIdOffset_
number to subtract from the source id to get the dcc id
Definition: HcalUnpacker.h:48
bool check() const
Check for a good event Requires a minimum length, matching wordcount and length, not an empty event...
Definition: HcalHTRData.cc:62
void getHistogramFibers(int &a, int &b) const
Get the fiber numbers for the data present in this event (only in histogram mode!) ...
Definition: HcalHTRData.cc:388
int getSpigotData(int nspigot, HcalHTRData &decodeTool, int validSize) const
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
bool unpackHistogram(int fiber, int fiberchan, int capid, unsigned short *histogram) const
Unpack special histogramming mode data.
Definition: HcalHTRData.cc:408
double f[11][100]
bool getSpigotPresent(unsigned int nspigot) const
Read the &quot;PRESENT&quot; bit for this spigot.
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
int getSourceId() const
Definition: HcalDCCHeader.h:34
Definition: DetId.h:20
bool null() const
is this a null id ?
Definition: DetId.h:47
static const int SPIGOT_COUNT
Definition: HcalDCCHeader.h:21
uint16_t * getArray(int capid)
get the array for the specified capid
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:29
unsigned int getSubmodule() const
Get the HTR submodule number.
Definition: HcalHTRData.cc:306
Detector det() const
get the detector field from this detid
Definition: DetId.h:37
Readout chain identification for Hcal [31:26] Unused (so far) [25] Trigger-chain id flag [24:20] Read...
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
bool isHistogramEvent() const
Is this event a histogram event? (do not call standard unpack in this case!!!!!)
Definition: HcalHTRData.cc:360
void HcalUnpacker::unpack ( const FEDRawData raw,
const HcalElectronicsMap emap,
Collections conts,
HcalUnpackerReport report,
bool  silent = false 
)

work through the samples

work through the samples

Definition at line 63 of file HcalUnpacker.cc.

References HcalUnpacker::Collections::calibCont, DetId::Calo, HcalHTRData::check(), HOUnrolledTP::checked, HcalUnpackerReport::countSpigotFormatError(), HcalUnpackerReport::countUnmappedDigi(), HcalUnpackerReport::countUnmappedTPDigi(), FEDRawData::data(), HcalHTRData::dataPointers(), DetId::det(), endSample_, expectedOrbitMessageTime_, benchmark_cfg::fc, HcalQIESample::fiber(), HcalQIESample::fiberAndChan(), HcalQIESample::fiberChan(), HcalHTRData::getFirmwareFlavor(), HcalHTRData::getFormatVersion(), HcalHTRData::getNPS(), HcalDCCHeader::getSourceId(), HcalDCCHeader::getSpigotCRCError(), HcalDCCHeader::getSpigotData(), HcalDCCHeader::getSpigotPresent(), HcalHTRData::getSubmodule(), HcalUnpacker::Collections::hbheCont, DetId::Hcal, HcalBarrel, HcalCalibration, HcalEmpty, HcalEndcap, HcalForward, HcalOther, HcalOuter, HcalUnpacker::Collections::hfCont, HcalUnpacker::Collections::hoCont, i, HcalDetId::ieta(), HOUnrolledTP::ieta, HcalDetId::iphi(), HOUnrolledTP::iphi, HcalHTRData::isHistogramEvent(), isTPGSOI(), HcalHTRData::isUnsuppressed(), LogDebug, HcalElectronicsMap::lookup(), HcalElectronicsMap::lookupTrigger(), DetId::null(), HcalTriggerPrimitiveSample::raw(), HcalQIESample::raw(), HOUnrolledTP::samples, HOUnrolledTP::setbit(), HcalElectronicsId::setHTR(), FEDRawData::size(), HcalTriggerPrimitiveSample::slb(), HcalTriggerPrimitiveSample::slbAndChan(), HcalTriggerPrimitiveSample::slbChan(), HOUnrolledTP::soi, sourceIdOffset_, HcalDCCHeader::SPIGOT_COUNT, startSample_, HcalOtherDetId::subdet(), HcalZDCDetId::SubdetectorId, DetId::subdetId(), HcalUnpacker::Collections::tpCont, HcalUnpacker::Collections::tphoCont, HcalUnpacker::Collections::ttp, HcalTrigTowerDetId::Undefined, unknownIds_, unknownIdsTrig_, HcalTTPUnpacker::unpack(), TrackValidation_HighPurity_cff::valid, HOUnrolledTP::valid, HcalHTRData::wasMarkAndPassZSTP(), and HcalUnpacker::Collections::zdcCont.

64  {
65 
66  if (raw.size()<16) {
67  if (!silent) edm::LogWarning("Invalid Data") << "Empty/invalid DCC data, size = " << raw.size();
68  return;
69  }
70 
71  // get the DCC header
72  const HcalDCCHeader* dccHeader=(const HcalDCCHeader*)(raw.data());
73  int dccid=dccHeader->getSourceId()-sourceIdOffset_;
74 
75  // check the summary status
76 
77  // walk through the HTR data...
78  HcalHTRData htr;
79  const unsigned short* daq_first, *daq_last, *tp_first, *tp_last;
80  const HcalQIESample* qie_begin, *qie_end, *qie_work;
81  const HcalTriggerPrimitiveSample *tp_begin, *tp_end, *tp_work;
82  for (int spigot=0; spigot<HcalDCCHeader::SPIGOT_COUNT; spigot++) {
83  if (!dccHeader->getSpigotPresent(spigot)) continue;
84 
85  int retval=dccHeader->getSpigotData(spigot,htr,raw.size());
86  if (retval!=0) {
87  if (retval==-1) {
88  if (!silent) edm::LogWarning("Invalid Data") << "Invalid HTR data (data beyond payload size) observed on spigot " << spigot << " of DCC with source id " << dccHeader->getSourceId();
89  report.countSpigotFormatError();
90  }
91  continue;
92  }
93  // check
94  if (dccHeader->getSpigotCRCError(spigot)) {
95  if (!silent)
96  edm::LogWarning("Invalid Data") << "CRC Error on HTR data observed on spigot " << spigot << " of DCC with source id " << dccHeader->getSourceId();
97  report.countSpigotFormatError();
98  continue;
99  }
100  if (!htr.check()) {
101  if (!silent)
102  edm::LogWarning("Invalid Data") << "Invalid HTR data observed on spigot " << spigot << " of DCC with source id " << dccHeader->getSourceId();
103  report.countSpigotFormatError();
104  continue;
105  }
106  if (htr.isHistogramEvent()) {
107  if (!silent) edm::LogWarning("Invalid Data") << "Histogram data passed to non-histogram unpacker on spigot " << spigot << " of DCC with source id " << dccHeader->getSourceId();
108  continue;
109  }
110  if ((htr.getFirmwareFlavor()&0xE0)==0x80) { // some kind of TTP data
111  if (colls.ttp!=0) {
112  HcalTTPUnpacker ttpUnpack;
113  colls.ttp->push_back(HcalTTPDigi());
114  ttpUnpack.unpack(htr,colls.ttp->back());
115  } else {
116  LogDebug("HcalTechTrigProcessor") << "Skipping data on spigot " << spigot << " of DCC with source id " << dccHeader->getSourceId() << " which is from the TechTrigProcessor (use separate unpacker!)";
117  }
118  continue;
119  }
120  if (htr.getFirmwareFlavor()>=0x80) {
121  if (!silent) edm::LogWarning("HcalUnpacker") << "Skipping data on spigot " << spigot << " of DCC with source id " << dccHeader->getSourceId() << " which is of unknown flavor " << htr.getFirmwareFlavor();
122  continue;
123  }
124 
125  // calculate "real" number of presamples
126  int nps=htr.getNPS()-startSample_;
127 
128  // get pointers
129  htr.dataPointers(&daq_first,&daq_last,&tp_first,&tp_last);
130  unsigned int smid=htr.getSubmodule();
131  int htr_tb=smid&0x1;
132  int htr_slot=(smid>>1)&0x1F;
133  int htr_cr=(smid>>6)&0x1F;
134 
135  tp_begin=(HcalTriggerPrimitiveSample*)tp_first;
136  tp_end=(HcalTriggerPrimitiveSample*)(tp_last+1); // one beyond last..
137 
139  int currFiberChan=0x3F; // invalid fiber+channel...
140  int ncurr=0;
141  bool valid=false;
142 
143  bool tpgSOIbitInUse=htr.getFormatVersion()>=3; // version 3 and later
144  bool isHOtpg=htr.getFormatVersion()>=3 && htr.getFirmwareFlavor()==0; // HO is flavor zero
145  int npre=0;
146  /*
147  Unpack the trigger primitives
148  */
149  if (isHOtpg) {
150  HOUnrolledTP unrolled[24];
151  for (tp_work=tp_begin; tp_work!=tp_end; tp_work++) {
152  if (tp_work->raw()==0xFFFF) continue; // filler word
153  int sector=tp_work->slbChan();
154  if (sector>2) continue;
155 
156  for (int ibit=0; ibit<8; ibit++) {
157  int linear=sector*8+ibit;
158  if (!unrolled[linear].checked) {
159  unrolled[linear].checked=true;
160  int fiber=(linear/3)+1;
161  int fc=(linear%3);
162  // electronics id (use precision match for HO TP)
163  HcalElectronicsId eid(fc,fiber,spigot,dccid);
164  eid.setHTR(htr_cr,htr_slot,htr_tb);
165  DetId did=emap.lookup(eid);
166  if (!did.null()) {
167  if (did.det()==DetId::Hcal && ((HcalSubdetector)did.subdetId())==HcalOuter ) {
168  HcalDetId hid(did);
169  unrolled[linear].valid=true;
170  unrolled[linear].ieta=hid.ieta();
171  unrolled[linear].iphi=hid.iphi();
172  }
173  } else {
174  report.countUnmappedTPDigi(eid);
175  }
176  }
177  if (unrolled[linear].valid) {
178  if (isTPGSOI(*tp_work)) unrolled[linear].soi=unrolled[linear].samples;
179  if (tp_work->raw()&(1<<ibit)) unrolled[linear].setbit(unrolled[linear].samples);
180  unrolled[linear].samples++;
181  }
182  }
183  }
184  for (int i=0; i<24; i++) {
185  if (unrolled[i].valid)
186  colls.tphoCont->push_back(HOTriggerPrimitiveDigi(
187  unrolled[i].ieta,
188  unrolled[i].iphi,
189  unrolled[i].samples,
190  unrolled[i].soi,
191  unrolled[i].databits));
192  }
193  } else { // regular TPs (not HO)
194  for (tp_work=tp_begin; tp_work!=tp_end; tp_work++) {
195  if (tp_work->raw()==0xFFFF) continue; // filler word
196  if (tp_work->slbAndChan()!=currFiberChan) { // start new set
197  npre=0;
198  currFiberChan=tp_work->slbAndChan();
199  // lookup the right channel
200  HcalElectronicsId eid(tp_work->slbChan(),tp_work->slb(),spigot,dccid,htr_cr,htr_slot,htr_tb);
201  DetId did=emap.lookupTrigger(eid);
202  if (did.null()) {
203  report.countUnmappedTPDigi(eid);
204  if (unknownIdsTrig_.find(eid)==unknownIdsTrig_.end()) {
205  if (!silent) edm::LogWarning("HCAL") << "HcalUnpacker: No trigger primitive match found for electronics id :" << eid;
206  unknownIdsTrig_.insert(eid);
207  }
208  valid=false;
209  continue;
210  } else if (did==HcalTrigTowerDetId::Undefined ||
211  (did.det()==DetId::Hcal && did.subdetId()==0)) {
212  // known to be unmapped
213  valid=false;
214  continue;
215  }
216  HcalTrigTowerDetId id(did);
217  colls.tpCont->push_back(HcalTriggerPrimitiveDigi(id));
218  // set the various bits
219  if (!tpgSOIbitInUse) colls.tpCont->back().setPresamples(nps);
220  colls.tpCont->back().setZSInfo(htr.isUnsuppressed(),htr.wasMarkAndPassZSTP(tp_work->slb(),tp_work->slbChan()));
221 
222  // no hits recorded for current
223  ncurr=0;
224  valid=true;
225  }
226  // add the word (if within settings or recent firmware [recent firmware ignores startSample/endSample])
227  if (valid && ((tpgSOIbitInUse && ncurr<10) || (ncurr>=startSample_ && ncurr<=endSample_))) {
228  colls.tpCont->back().setSample(colls.tpCont->back().size(),*tp_work);
229  colls.tpCont->back().setSize(colls.tpCont->back().size()+1);
230  }
231  // set presamples,if SOI
232  if (valid && tpgSOIbitInUse && isTPGSOI(*tp_work)) {
233  colls.tpCont->back().setPresamples(ncurr);
234  }
235  ncurr++;
236  npre++;
237  }
238  }
239 
240 
241  qie_begin=(HcalQIESample*)daq_first;
242  qie_end=(HcalQIESample*)(daq_last+1); // one beyond last..
243 
245  currFiberChan=0x3F; // invalid fiber+channel...
246  ncurr=0;
247  valid=false;
248 
249 
250  for (qie_work=qie_begin; qie_work!=qie_end; ) {
251  if (qie_work->raw()==0xFFFF) {
252  qie_work++;
253  continue; // filler word
254  }
255  // always at the beginning ...
256  currFiberChan=qie_work->fiberAndChan();
257 
258  // lookup the right channel
259  HcalElectronicsId eid(qie_work->fiberChan(),qie_work->fiber(),spigot,dccid);
260  eid.setHTR(htr_cr,htr_slot,htr_tb);
261  DetId did=emap.lookup(eid);
262 
263  if (!did.null()) {
264  if (did.det()==DetId::Calo && did.subdetId()==HcalZDCDetId::SubdetectorId) {
265  colls.zdcCont->push_back(ZDCDataFrame(HcalZDCDetId(did)));
266  qie_work=HcalUnpacker_impl::unpack<ZDCDataFrame>(qie_work, qie_end, colls.zdcCont->back(), nps, eid, startSample_, endSample_, expectedOrbitMessageTime_, htr);
267  } else if (did.det()==DetId::Hcal) {
268  switch (((HcalSubdetector)did.subdetId())) {
269  case (HcalBarrel):
270  case (HcalEndcap): {
271  colls.hbheCont->push_back(HBHEDataFrame(HcalDetId(did)));
272  qie_work=HcalUnpacker_impl::unpack<HBHEDataFrame>(qie_work, qie_end, colls.hbheCont->back(), nps, eid, startSample_, endSample_, expectedOrbitMessageTime_, htr);
273  } break;
274  case (HcalOuter): {
275  colls.hoCont->push_back(HODataFrame(HcalDetId(did)));
276  qie_work=HcalUnpacker_impl::unpack<HODataFrame>(qie_work, qie_end, colls.hoCont->back(), nps, eid, startSample_, endSample_, expectedOrbitMessageTime_, htr);
277  } break;
278  case (HcalForward): {
279  colls.hfCont->push_back(HFDataFrame(HcalDetId(did)));
280  qie_work=HcalUnpacker_impl::unpack<HFDataFrame>(qie_work, qie_end, colls.hfCont->back(), nps, eid, startSample_, endSample_, expectedOrbitMessageTime_, htr);
281  } break;
282  case (HcalOther) : {
283  HcalOtherDetId odid(did);
284  if (odid.subdet()==HcalCalibration) {
285  colls.calibCont->push_back(HcalCalibDataFrame(HcalCalibDetId(did)));
286  qie_work=HcalUnpacker_impl::unpack<HcalCalibDataFrame>(qie_work, qie_end, colls.calibCont->back(), nps, eid, startSample_, endSample_, expectedOrbitMessageTime_, htr);
287  }
288  } break;
289  case (HcalEmpty):
290  default: {
291  for (int fiberC=qie_work->fiberAndChan();
292  qie_work!=qie_end && qie_work->fiberAndChan()==fiberC;
293  qie_work++);
294  }
295  break;
296  }
297  }
298  } else {
299  report.countUnmappedDigi(eid);
300  if (unknownIds_.find(eid)==unknownIds_.end()) {
301  if (!silent) edm::LogWarning("HCAL") << "HcalUnpacker: No match found for electronics id :" << eid;
302  unknownIds_.insert(eid);
303  }
304  for (int fiberC=qie_work->fiberAndChan();
305  qie_work!=qie_end && qie_work->fiberAndChan()==fiberC;
306  qie_work++);
307  }
308  }
309  }
310 }
#define LogDebug(id)
int i
Definition: DBlmapReader.cc:9
std::set< HcalElectronicsId > unknownIds_
Definition: HcalUnpacker.h:52
int sourceIdOffset_
number to subtract from the source id to get the dcc id
Definition: HcalUnpacker.h:48
int endSample_
last sample from fed raw data to copy (if present)
Definition: HcalUnpacker.h:50
int startSample_
first sample from fed raw data to copy
Definition: HcalUnpacker.h:49
uint16_t raw() const
get the raw word
Definition: HcalQIESample.h:22
bool check() const
Check for a good event Requires a minimum length, matching wordcount and length, not an empty event...
Definition: HcalHTRData.cc:62
int fiberAndChan() const
get the id channel
Definition: HcalQIESample.h:38
int fiberChan() const
get the fiber channel number
Definition: HcalQIESample.h:36
bool getSpigotCRCError(unsigned int nspigot) const
Read the &quot;CRC-Mismatch&quot; bit for this spigot.
static bool isTPGSOI(const HcalTriggerPrimitiveSample &s)
Definition: HcalUnpacker.cc:42
int getSpigotData(int nspigot, HcalHTRData &decodeTool, int validSize) const
int slbChan() const
get the slb channel number
int getFormatVersion() const
Get the version number of this event.
Definition: HcalHTRData.h:34
size_t size() const
Lenght of the data buffer in bytes.
Definition: FEDRawData.h:47
bool isUnsuppressed() const
Is this event an unsuppresed event?
Definition: HcalHTRData.cc:328
int slbAndChan() const
get the id channel
int expectedOrbitMessageTime_
Expected orbit bunch time (needed to evaluate time differences)
Definition: HcalUnpacker.h:51
HcalSubdetector
Definition: HcalAssistant.h:32
uint16_t raw() const
get the raw word
int fiber() const
get the fiber number
Definition: HcalQIESample.h:34
bool getSpigotPresent(unsigned int nspigot) const
Read the &quot;PRESENT&quot; bit for this spigot.
int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:39
std::set< HcalElectronicsId > unknownIdsTrig_
Recorded to limit number of times a log message is generated.
Definition: HcalUnpacker.h:52
int getSourceId() const
Definition: HcalDCCHeader.h:34
Definition: DetId.h:20
void setHTR(int crate, int slot, int tb)
static const int SubdetectorId
Definition: HcalZDCDetId.h:22
void dataPointers(const unsigned short **daq_first, const unsigned short **daq_last, const unsigned short **tp_first, const unsigned short **tp_last) const
Obtain the starting and ending pointers for external unpacking of the data.
Definition: HcalHTRData.cc:128
bool unpack(const HcalHTRData &data, HcalTTPDigi &digi)
bool null() const
is this a null id ?
Definition: DetId.h:47
void setbit(int i)
Definition: HcalUnpacker.cc:60
int getNPS() const
Get the number of presamples in daq data.
Definition: HcalHTRData.cc:375
static const HcalTrigTowerDetId Undefined
int getFirmwareFlavor() const
Get the HTR firmware flavor.
Definition: HcalHTRData.cc:384
int slb() const
get the slb site number
static const int SPIGOT_COUNT
Definition: HcalDCCHeader.h:21
bool wasMarkAndPassZSTP(int slb, int slbchan) const
Was this channel passed as part of Mark&amp;Pass ZS?
Definition: HcalHTRData.cc:339
const unsigned char * data() const
Return a const pointer to the beginning of the data buffer.
Definition: FEDRawData.cc:29
const DetId lookupTrigger(HcalElectronicsId fId) const
brief lookup the trigger logical detid associated with the given electronics id
unsigned int getSubmodule() const
Get the HTR submodule number.
Definition: HcalHTRData.cc:306
Detector det() const
get the detector field from this detid
Definition: DetId.h:37
Readout chain identification for Hcal [31:26] Unused (so far) [25] Trigger-chain id flag [24:20] Read...
const DetId lookup(HcalElectronicsId fId) const
lookup the logical detid associated with the given electronics id
bool isHistogramEvent() const
Is this event a histogram event? (do not call standard unpack in this case!!!!!)
Definition: HcalHTRData.cc:360
void HcalUnpacker::unpack ( const FEDRawData raw,
const HcalElectronicsMap emap,
std::vector< HBHEDataFrame > &  precision,
std::vector< HcalTriggerPrimitiveDigi > &  tp 
)

Definition at line 322 of file HcalUnpacker.cc.

References trackerHits::c, HcalUnpacker::Collections::hbheCont, csvReporter::r, HcalUnpacker::Collections::tpCont, and unpack().

322  {
323  Collections c;
324  c.hbheCont=&container;
325  c.tpCont=&tp;
327  unpack(raw,emap,c,r);
328 }
void unpack(const FEDRawData &raw, const HcalElectronicsMap &emap, std::vector< HcalHistogramDigi > &histoDigis)
void HcalUnpacker::unpack ( const FEDRawData raw,
const HcalElectronicsMap emap,
std::vector< HODataFrame > &  precision,
std::vector< HcalTriggerPrimitiveDigi > &  tp 
)

Definition at line 330 of file HcalUnpacker.cc.

References trackerHits::c, HcalUnpacker::Collections::hoCont, csvReporter::r, HcalUnpacker::Collections::tpCont, and unpack().

330  {
331  Collections c;
332  c.hoCont=&container;
333  c.tpCont=&tp;
335  unpack(raw,emap,c,r);
336 }
void unpack(const FEDRawData &raw, const HcalElectronicsMap &emap, std::vector< HcalHistogramDigi > &histoDigis)
void HcalUnpacker::unpack ( const FEDRawData raw,
const HcalElectronicsMap emap,
std::vector< HFDataFrame > &  precision,
std::vector< HcalTriggerPrimitiveDigi > &  tp 
)

Definition at line 338 of file HcalUnpacker.cc.

References trackerHits::c, HcalUnpacker::Collections::hfCont, csvReporter::r, HcalUnpacker::Collections::tpCont, and unpack().

338  {
339  Collections c;
340  c.hfCont=&container;
341  c.tpCont=&tp;
343  unpack(raw,emap,c,r);
344 }
void unpack(const FEDRawData &raw, const HcalElectronicsMap &emap, std::vector< HcalHistogramDigi > &histoDigis)

Member Data Documentation

int HcalUnpacker::endSample_
private

last sample from fed raw data to copy (if present)

Definition at line 50 of file HcalUnpacker.h.

Referenced by unpack().

int HcalUnpacker::expectedOrbitMessageTime_
private

Expected orbit bunch time (needed to evaluate time differences)

Definition at line 51 of file HcalUnpacker.h.

Referenced by setExpectedOrbitMessageTime(), and unpack().

int HcalUnpacker::sourceIdOffset_
private

number to subtract from the source id to get the dcc id

Definition at line 48 of file HcalUnpacker.h.

Referenced by unpack().

int HcalUnpacker::startSample_
private

first sample from fed raw data to copy

Definition at line 49 of file HcalUnpacker.h.

Referenced by unpack().

std::set<HcalElectronicsId> HcalUnpacker::unknownIds_
private

Definition at line 52 of file HcalUnpacker.h.

Referenced by unpack().

std::set<HcalElectronicsId> HcalUnpacker::unknownIdsTrig_
private

Recorded to limit number of times a log message is generated.

Definition at line 52 of file HcalUnpacker.h.

Referenced by unpack().