CMS 3D CMS Logo

List of all members | Public Types | Public Member Functions | Protected Attributes | Private Member Functions | Private Attributes
ESUnpacker Class Reference

#include <ESUnpacker.h>

Public Types

typedef unsigned int Word32
 
typedef unsigned long long Word64
 

Public Member Functions

 ESUnpacker (const edm::ParameterSet &ps)
 
void interpretRawData (int fedId, const FEDRawData &rawData, ESRawDataCollection &dccs, ESLocalRawDataCollection &kchips, ESDigiCollection &digis)
 
void setBX (int i)
 
void setLV1 (int i)
 
void setOrbitNumber (int i)
 
void setRunNumber (int i)
 
void setTriggerType (int i)
 
void word2digi (int kchip, int kPACE[4], const Word64 &word, ESDigiCollection &digis)
 
 ~ESUnpacker ()
 

Protected Attributes

Word64 m1
 
Word64 m12
 
Word64 m16
 
Word64 m2
 
Word64 m32
 
Word64 m4
 
Word64 m5
 
Word64 m6
 
Word64 m8
 
int pl_ [4288][4]
 
int x_ [4288][4]
 
int y_ [4288][4]
 
int zside_ [4288][4]
 

Private Member Functions

std::string print (const Word64 &word) const
 

Private Attributes

int bx_
 
int dac_
 
bool debug_
 
int FEch_ [36]
 
int fedId_
 
int gain_
 
edm::FileInPath lookup_
 
int lv1_
 
int optoRX0_
 
int optoRX1_
 
int optoRX2_
 
int orbit_number_
 
int precision_
 
const edm::ParameterSet pset_
 
int run_number_
 
int runtype_
 
int seqtype_
 
int trgtype_
 
int vmajor_
 
int vminor_
 

Detailed Description

Definition at line 22 of file ESUnpacker.h.

Member Typedef Documentation

◆ Word32

typedef unsigned int ESUnpacker::Word32

Definition at line 24 of file ESUnpacker.h.

◆ Word64

typedef unsigned long long ESUnpacker::Word64

Definition at line 25 of file ESUnpacker.h.

Constructor & Destructor Documentation

◆ ESUnpacker()

ESUnpacker::ESUnpacker ( const edm::ParameterSet ps)

Definition at line 10 of file ESUnpacker.cc.

References debug_, geometryDiff::file, edm::FileInPath::fullPath(), edm::ParameterSet::getParameter(), edm::ParameterSet::getUntrackedParameter(), mps_fire::i, lookup_, m1, m12, m16, m2, m32, m4, m5, m6, m8, submitDQMOfflineCAF::nLines, pl_, pset_, x_, y_, and zside_.

11  : pset_(ps), fedId_(0), run_number_(0), orbit_number_(0), bx_(0), lv1_(0), trgtype_(0) {
12  debug_ = pset_.getUntrackedParameter<bool>("debugMode", false);
13  lookup_ = ps.getParameter<edm::FileInPath>("LookupTable");
14 
15  m1 = ~(~Word64(0) << 1);
16  m2 = ~(~Word64(0) << 2);
17  m4 = ~(~Word64(0) << 4);
18  m5 = ~(~Word64(0) << 5);
19  m6 = ~(~Word64(0) << 6);
20  m8 = ~(~Word64(0) << 8);
21  m12 = ~(~Word64(0) << 12);
22  m16 = ~(~Word64(0) << 16);
23  m32 = ~(~Word64(0) << 32);
24 
25  // read in look-up table
26  int nLines, iz, ip, ix, iy, fed, kchip, pace, bundle, fiber, optorx;
27  std::ifstream file;
28  file.open(lookup_.fullPath().c_str());
29  if (file.is_open()) {
30  file >> nLines;
31 
32  for (int i = 0; i < nLines; ++i) {
33  file >> iz >> ip >> ix >> iy >> fed >> kchip >> pace >> bundle >> fiber >> optorx;
34 
35  zside_[kchip - 1][pace - 1] = iz;
36  pl_[kchip - 1][pace - 1] = ip;
37  x_[kchip - 1][pace - 1] = ix;
38  y_[kchip - 1][pace - 1] = iy;
39  }
40 
41  } else {
42  edm::LogWarning("Invalid Data") << "ESUnpacker::ESUnpacker : Look up table file can not be found in "
43  << lookup_.fullPath().c_str();
44  }
45 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
bool debug_
Definition: ESUnpacker.h:64
int run_number_
Definition: ESUnpacker.h:47
edm::FileInPath lookup_
Definition: ESUnpacker.h:65
int fedId_
Definition: ESUnpacker.h:46
std::string fullPath() const
Definition: FileInPath.cc:161
int y_[4288][4]
Definition: ESUnpacker.h:72
Word64 m5
Definition: ESUnpacker.h:70
int x_[4288][4]
Definition: ESUnpacker.h:72
Word64 m12
Definition: ESUnpacker.h:70
T getUntrackedParameter(std::string const &, T const &) const
int zside_[4288][4]
Definition: ESUnpacker.h:72
Word64 m1
Definition: ESUnpacker.h:70
Word64 m32
Definition: ESUnpacker.h:70
Word64 m2
Definition: ESUnpacker.h:70
int pl_[4288][4]
Definition: ESUnpacker.h:72
Word64 m8
Definition: ESUnpacker.h:70
Word64 m6
Definition: ESUnpacker.h:70
const edm::ParameterSet pset_
Definition: ESUnpacker.h:41
Log< level::Warning, false > LogWarning
Word64 m16
Definition: ESUnpacker.h:70
int orbit_number_
Definition: ESUnpacker.h:48
int trgtype_
Definition: ESUnpacker.h:56
cms_uint64_t Word64
Word64 m4
Definition: ESUnpacker.h:70

◆ ~ESUnpacker()

ESUnpacker::~ESUnpacker ( )

Definition at line 47 of file ESUnpacker.cc.

47 {}

Member Function Documentation

◆ interpretRawData()

void ESUnpacker::interpretRawData ( int  fedId,
const FEDRawData rawData,
ESRawDataCollection dccs,
ESLocalRawDataCollection kchips,
ESDigiCollection digis 
)

Definition at line 49 of file ESUnpacker.cc.

References bx_, FEDHeader::bxID(), FEDHeader::check(), FEDTrailer::check(), dac_, debug_, FEch_, l1tstage2_dqm_sourceclient-live_cfg::fedId, fedId_, FEDTrailer::fragmentLength(), gain_, ESDCCHeaderBlock::getOptoRX0(), ESDCCHeaderBlock::getOptoRX1(), ESDCCHeaderBlock::getOptoRX2(), RecoTauValidation_cfi::header, dqmiolumiharvest::j, LogDebug, lv1_, FEDHeader::lvl1ID(), m1, m12, m16, m32, m4, m6, m8, FEDHeader::moreHeaders(), FEDTrailer::moreTrailers(), l1ctLayer2EG_cff::nWords, optoRX0_, optoRX1_, optoRX2_, orbit_number_, precision_, print(), edm::SortedCollection< T, SORT >::push_back(), l1tstage2_dqm_sourceclient-live_cfg::rawData, runtype_, seqtype_, ESKCHIPBlock::setBC(), ESDCCHeaderBlock::setBX(), ESDCCHeaderBlock::setDAC(), ESDCCHeaderBlock::setDCCErrors(), ESKCHIPBlock::setEC(), ESDCCHeaderBlock::setFEChannelStatus(), ESDCCHeaderBlock::setFedId(), ESKCHIPBlock::setFlag1(), ESKCHIPBlock::setFlag2(), ESDCCHeaderBlock::setGain(), ESKCHIPBlock::setId(), ESDCCHeaderBlock::setLV1(), ESDCCHeaderBlock::setMajorVersion(), ESDCCHeaderBlock::setMinorVersion(), ESKCHIPBlock::setOptoBC(), ESDCCHeaderBlock::setOptoBC0(), ESDCCHeaderBlock::setOptoBC1(), ESDCCHeaderBlock::setOptoBC2(), ESKCHIPBlock::setOptoEC(), ESDCCHeaderBlock::setOptoRX0(), ESDCCHeaderBlock::setOptoRX1(), ESDCCHeaderBlock::setOptoRX2(), ESDCCHeaderBlock::setOrbitNumber(), ESDCCHeaderBlock::setPrecision(), ESDCCHeaderBlock::setRunType(), ESDCCHeaderBlock::setSeqType(), ESDCCHeaderBlock::setTriggerType(), FEDHeader::sourceID(), trgtype_, vmajor_, vminor_, word2digi(), and testProducerWithPsetDescEmpty_cfi::x1.

Referenced by ESRawToDigi::produce().

53  {
54  unsigned int nWords = rawData.size() / sizeof(Word64);
55  if (nWords == 0)
56  return;
57  int dccWords = 6;
58  int head, kPACE[4], kFlag1, kFlag2, kBC, kEC, optoBC, optoEC;
59  int kid = -1;
60 
61  ESDCCHeaderBlock ESDCCHeader;
62  ESDCCHeader.setFedId(fedId);
63 
64  // Event header
65  const Word64* header = reinterpret_cast<const Word64*>(rawData.data());
66  --header;
67  bool moreHeaders = true;
68  while (moreHeaders) {
69  ++header;
70  FEDHeader ESHeader(reinterpret_cast<const unsigned char*>(header));
71  if (!ESHeader.check()) {
72  if (debug_)
73  edm::LogWarning("Invalid Data") << "ES : Failed header check !";
74  return;
75  }
76 
77  fedId_ = ESHeader.sourceID();
78  lv1_ = ESHeader.lvl1ID();
79  bx_ = ESHeader.bxID();
80 
81  if (debug_) {
82  LogDebug("ESUnpacker") << "[ESUnpacker]: FED Header candidate. Is header? " << ESHeader.check();
83  if (ESHeader.check())
84  LogDebug("ESUnpacker") << ". BXID: " << bx_ << " SourceID : " << fedId_ << " L1ID: " << lv1_;
85  else
86  LogDebug("ESUnpacker") << " WARNING!, this is not a ES Header";
87  }
88 
89  moreHeaders = ESHeader.moreHeaders();
90  }
91  if (fedId != fedId_) {
92  if (debug_)
93  edm::LogWarning("Invalid Data") << "Invalid ES data with source id " << fedId_;
94  ESDCCHeader.setDCCErrors(1);
95  dccs.push_back(ESDCCHeader);
96  return;
97  }
98  ESDCCHeader.setLV1(lv1_);
99  ESDCCHeader.setBX(bx_);
100 
101  // Event trailer
102  int slinkCRC = 1;
103  const Word64* trailer = reinterpret_cast<const Word64*>(rawData.data()) + (nWords - 1);
104  ++trailer;
105  bool moreTrailers = true;
106  while (moreTrailers) {
107  --trailer;
108  FEDTrailer ESTrailer(reinterpret_cast<const unsigned char*>(trailer));
109  if (!ESTrailer.check()) {
110  ++trailer;
111  if (debug_)
112  edm::LogWarning("Invalid Data") << "ES : Failed trailer check !";
113  return;
114  }
115  if (ESTrailer.fragmentLength() != nWords) {
116  if (debug_)
117  edm::LogWarning("Invalid Data") << "Invalid ES data : the length is not correct !";
118  ESDCCHeader.setDCCErrors(2);
119  dccs.push_back(ESDCCHeader);
120  return;
121  }
122  if (ESTrailer.fragmentLength() < 8) {
123  if (debug_)
124  edm::LogWarning("Invalid Data") << "Invalid ES data : the length is not correct !";
125  ESDCCHeader.setDCCErrors(3);
126  dccs.push_back(ESDCCHeader);
127  return;
128  }
129  slinkCRC = (*trailer >> 2) & 0x1;
130  if (debug_) {
131  LogDebug("ESUnpacker") << "[ESUnpacker]: FED Trailer candidate. Is trailer? " << ESTrailer.check();
132  if (ESTrailer.check())
133  LogDebug("ESUnpacker") << ". Length of the ES event: " << ESTrailer.fragmentLength();
134  else
135  LogDebug("ESUnpacker") << " WARNING!, this is not a ES Trailer";
136  }
137 
138  moreTrailers = ESTrailer.moreTrailers();
139  }
140 
141  if (slinkCRC != 0) {
142  ESDCCHeader.setDCCErrors(101);
143  dccs.push_back(ESDCCHeader);
144  return;
145  }
146 
147  // DCC data
148  std::vector<int> FEch_status;
149  int dccHeaderCount = 0;
150  int dccLineCount = 0;
151  int dccHead, dccLine;
152  int dccCRC1_ = 0;
153  int dccCRC2_ = 0;
154  int dccCRC3_ = 0;
155  for (const Word64* word = (header + 1); word != (header + dccWords + 1); ++word) {
156  if (debug_)
157  LogDebug("ESUnpacker") << "DCC : " << print(*word);
158  dccHead = (*word >> 60) & m4;
159  if (dccHead == 3)
160  dccHeaderCount++;
161  dccLine = (*word >> 56) & m4;
162  dccLineCount++;
163  if (dccLine != dccLineCount) {
164  if (debug_)
165  edm::LogWarning("Invalid Data") << "Invalid ES data : DCC header order is not correct !";
166  ESDCCHeader.setDCCErrors(4);
167  dccs.push_back(ESDCCHeader);
168  return;
169  }
170  if (dccLineCount == 1) {
171  dccCRC1_ = (*word >> 24) & m1;
172  dccCRC2_ = (*word >> 25) & m1;
173  dccCRC3_ = (*word >> 26) & m1;
174  } else if (dccLineCount == 2) {
175  runtype_ = (*word >> 0) & m4;
176  seqtype_ = (*word >> 4) & m4;
177  dac_ = (*word >> 8) & m12;
178  gain_ = (*word >> 20) & m1;
179  precision_ = (*word >> 21) & m1;
180  trgtype_ = (*word >> 34) & m6;
181 
182  ESDCCHeader.setRunType(runtype_);
183  ESDCCHeader.setSeqType(seqtype_);
184  ESDCCHeader.setTriggerType(trgtype_);
185  ESDCCHeader.setDAC(dac_);
186  ESDCCHeader.setGain(gain_);
187  ESDCCHeader.setPrecision(precision_);
188  }
189  if (dccLineCount == 3) {
190  orbit_number_ = (*word >> 0) & m32;
191  vminor_ = (*word >> 40) & m8;
192  vmajor_ = (*word >> 48) & m8;
193 
194  ESDCCHeader.setOrbitNumber(orbit_number_);
195  ESDCCHeader.setMajorVersion(vmajor_);
196  ESDCCHeader.setMinorVersion(vminor_);
197  }
198  if (dccLineCount == 4)
199  optoRX0_ = (*word >> 48) & m8;
200  if (dccLineCount == 5)
201  optoRX1_ = (*word >> 48) & m8;
202  if (dccLineCount == 6)
203  optoRX2_ = (*word >> 48) & m8;
204  if (dccLineCount >= 4) {
205  for (unsigned int j = 0; j < 12; ++j) {
206  FEch_[(dccLineCount - 4) * 12 + j] = (*word >> (j * 4)) & m4;
207  FEch_status.push_back(FEch_[(dccLineCount - 4) * 12 + j]);
208  }
209  }
210  }
211  if (vmajor_ < 4) {
212  if (debug_)
213  edm::LogWarning("Invalid Data") << "Invalid ES data format : " << vmajor_ << " " << vminor_;
214  return;
215  }
216  if (dccHeaderCount != 6) {
217  edm::LogWarning("Invalid Data") << "Invalid ES data : DCC header lines are " << dccHeaderCount;
218  ESDCCHeader.setDCCErrors(5);
219  dccs.push_back(ESDCCHeader);
220  return;
221  }
222  ESDCCHeader.setOptoRX0(optoRX0_ + dccCRC1_);
223  ESDCCHeader.setOptoRX1(optoRX1_ + dccCRC2_);
224  ESDCCHeader.setOptoRX2(optoRX2_ + dccCRC3_);
225  ESDCCHeader.setFEChannelStatus(FEch_status);
226  int enableOptoRX[3] = {-1, -1, -1};
227  int NenableOptoRX = 0;
228  if (optoRX0_ == 128) {
229  enableOptoRX[NenableOptoRX] = 0;
230  NenableOptoRX++;
231  }
232  if (optoRX1_ == 128) {
233  enableOptoRX[NenableOptoRX] = 1;
234  NenableOptoRX++;
235  }
236  if (optoRX2_ == 128) {
237  enableOptoRX[NenableOptoRX] = 2;
238  }
239 
240  // Event data
241  int iopto = 0;
242  int opto = -1;
243  for (const Word64* word = (header + dccWords + 1); word != trailer; ++word) {
244  if (debug_)
245  LogDebug("ESUnpacker") << "Event : " << print(*word);
246 
247  head = (*word >> 60) & m4;
248 
249  if (head == 12) {
250  if ((opto == 0 && ESDCCHeader.getOptoRX0() == 129) || (opto == 1 && ESDCCHeader.getOptoRX1() == 129) ||
251  (opto == 2 && ESDCCHeader.getOptoRX2() == 129))
252  word2digi(kid, kPACE, *word, digis);
253  } else if (head == 9) {
254  kid = (*word >> 2) & 0x07ff;
255  kPACE[0] = (*word >> 16) & m1;
256  kPACE[1] = (*word >> 17) & m1;
257  kPACE[2] = (*word >> 18) & m1;
258  kPACE[3] = (*word >> 19) & m1;
259  kFlag2 = (*word >> 20) & m4;
260  kFlag1 = (*word >> 24) & m8;
261  kBC = (*word >> 32) & m16;
262  kEC = (*word >> 48) & m8;
263 
264  ESKCHIPBlock ESKCHIP;
265  ESKCHIP.setId(kid);
266  ESKCHIP.setBC(kBC);
267  ESKCHIP.setEC(kEC);
268  ESKCHIP.setOptoBC(optoBC);
269  ESKCHIP.setOptoEC(optoEC);
270  ESKCHIP.setFlag1(kFlag1);
271  ESKCHIP.setFlag2(kFlag2);
272  kchips.push_back(ESKCHIP);
273  } else if (head == 6) {
274  optoBC = (*word >> 32) & m16;
275  optoEC = (*word >> 48) & m8;
276 
277  opto = enableOptoRX[iopto];
278  if (opto == 0)
279  ESDCCHeader.setOptoBC0(optoBC);
280  else if (opto == 1)
281  ESDCCHeader.setOptoBC1(optoBC);
282  else if (opto == 2)
283  ESDCCHeader.setOptoBC2(optoBC);
284  if (iopto < 2)
285  ++iopto;
286  }
287  }
288 
289  dccs.push_back(ESDCCHeader);
290 }
void setOptoBC2(const int &optoBC2)
int runtype_
Definition: ESUnpacker.h:54
void setOrbitNumber(const int &orbit)
int vmajor_
Definition: ESUnpacker.h:58
bool debug_
Definition: ESUnpacker.h:64
void setGain(const int &gain)
void setOptoBC(const int &OptoBC)
Definition: ESKCHIPBlock.h:27
void setFEChannelStatus(const std::vector< int > &FEch)
void setFedId(const int &fedId)
void setId(const int &kId)
Definition: ESKCHIPBlock.h:14
int fedId_
Definition: ESUnpacker.h:46
int optoRX0_
Definition: ESUnpacker.h:59
int getOptoRX1() const
void setOptoRX1(const int &optoRX1)
void push_back(T const &t)
Word64 m12
Definition: ESUnpacker.h:70
void setPrecision(const int &precision)
void setOptoBC0(const int &optoBC0)
void setDCCErrors(const int &dccErrs)
void setEC(const int &EC)
Definition: ESKCHIPBlock.h:26
void setBX(const int &BX)
uint64_t word
void setFlag1(const int &flag1)
Definition: ESKCHIPBlock.h:29
int getOptoRX2() const
int seqtype_
Definition: ESUnpacker.h:55
int optoRX2_
Definition: ESUnpacker.h:61
void setMajorVersion(const int &vmajor)
void setSeqType(const int &seqType)
Word64 m1
Definition: ESUnpacker.h:70
int vminor_
Definition: ESUnpacker.h:57
void setLV1(const int &LV1)
Word64 m32
Definition: ESUnpacker.h:70
void setOptoBC1(const int &optoBC1)
int optoRX1_
Definition: ESUnpacker.h:60
void setOptoRX0(const int &optoRX0)
void setMinorVersion(const int &vminor)
void setOptoEC(const int &OptoEC)
Definition: ESKCHIPBlock.h:28
void word2digi(int kchip, int kPACE[4], const Word64 &word, ESDigiCollection &digis)
Definition: ESUnpacker.cc:292
void setOptoRX2(const int &optoRX2)
int precision_
Definition: ESUnpacker.h:53
void setFlag2(const int &flag2)
Definition: ESKCHIPBlock.h:30
Word64 m8
Definition: ESUnpacker.h:70
int FEch_[36]
Definition: ESUnpacker.h:62
void setBC(const int &BC)
Definition: ESKCHIPBlock.h:25
int getOptoRX0() const
void setTriggerType(const int &trgType)
void setRunType(const int &runType)
Word64 m6
Definition: ESUnpacker.h:70
Log< level::Warning, false > LogWarning
Word64 m16
Definition: ESUnpacker.h:70
unsigned long long Word64
Definition: ESUnpacker.h:25
int orbit_number_
Definition: ESUnpacker.h:48
void setDAC(const int &dac)
int trgtype_
Definition: ESUnpacker.h:56
cms_uint64_t Word64
#define LogDebug(id)
Word64 m4
Definition: ESUnpacker.h:70
std::string print(const Word64 &word) const
Definition: ESUnpacker.cc:346

◆ print()

std::string ESUnpacker::print ( const Word64 word) const
private

Definition at line 346 of file ESUnpacker.cc.

References str.

Referenced by interpretRawData().

346  {
347  std::ostringstream str;
348  str << "Word64: " << reinterpret_cast<const std::bitset<64>&>(word);
349  return str.str();
350 }
uint64_t word
#define str(s)

◆ setBX()

void ESUnpacker::setBX ( int  i)
inline

Definition at line 39 of file ESUnpacker.h.

References bx_, and mps_fire::i.

39 { bx_ = i; };

◆ setLV1()

void ESUnpacker::setLV1 ( int  i)
inline

Definition at line 40 of file ESUnpacker.h.

References mps_fire::i, and lv1_.

40 { lv1_ = i; };

◆ setOrbitNumber()

void ESUnpacker::setOrbitNumber ( int  i)
inline

Definition at line 38 of file ESUnpacker.h.

References mps_fire::i, and orbit_number_.

38 { orbit_number_ = i; };
int orbit_number_
Definition: ESUnpacker.h:48

◆ setRunNumber()

void ESUnpacker::setRunNumber ( int  i)
inline

Definition at line 37 of file ESUnpacker.h.

References mps_fire::i, and run_number_.

37 { run_number_ = i; };
int run_number_
Definition: ESUnpacker.h:47

◆ setTriggerType()

void ESUnpacker::setTriggerType ( int  i)
inline

Definition at line 41 of file ESUnpacker.h.

References mps_fire::i, and trgtype_.

41 { trgtype_ = i; };
int trgtype_
Definition: ESUnpacker.h:56

◆ word2digi()

void ESUnpacker::word2digi ( int  kchip,
int  kPACE[4],
const Word64 word,
ESDigiCollection digis 
)

Definition at line 292 of file ESUnpacker.cc.

References gpuClustering::adc, debug_, hcalRecHitTable_cff::detId, hgcalPerformanceValidation::df, mps_fire::i, LogDebug, m16, m2, m5, pl_, ESDigiCollection::push_back(), nano_mu_digi_cff::strip, ESDetId::validDetId(), vmajor_, vminor_, x_, y_, ecaldqm::zside(), and zside_.

Referenced by interpretRawData().

292  {
293  int pace = (word >> 53) & m2;
294  if (kPACE[pace] == 0)
295  return;
296  if (kid > 1511 || kid < 1)
297  return;
298 
299  int adc[3];
300  adc[0] = (word >> 0) & m16;
301  adc[1] = (word >> 16) & m16;
302  adc[2] = (word >> 32) & m16;
303  int strip = (word >> 48) & m5;
304 
305  if (debug_)
306  LogDebug("ESUnpacker") << kid << " " << strip << " " << pace << " " << adc[0] << " " << adc[1] << " " << adc[2];
307 
308  int zside, plane, ix, iy;
309  zside = zside_[kid - 1][pace];
310  plane = pl_[kid - 1][pace];
311  ix = x_[kid - 1][pace];
312  iy = y_[kid - 1][pace];
313 
314  // convert strip number from electronics id to detector id
315  if (vmajor_ == 4 && (vminor_ == 2 || vminor_ == 3)) {
316  if (zside == 1 && plane == 1 && iy <= 20)
317  strip = 31 - strip;
318  if (zside == 1 && plane == 2 && ix > 20)
319  strip = 31 - strip;
320  if (zside == -1 && plane == 1 && iy > 20)
321  strip = 31 - strip;
322  if (zside == -1 && plane == 2 && ix <= 20)
323  strip = 31 - strip;
324  }
325 
326  if (debug_)
327  LogDebug("ESUnpacker") << "DetId : " << zside << " " << plane << " " << ix << " " << iy << " " << strip + 1;
328 
329  if (ESDetId::validDetId(strip + 1, ix, iy, plane, zside)) {
330  ESDetId detId(strip + 1, ix, iy, plane, zside);
332  df.setSize(3);
333 
334  for (int i = 0; i < 3; i++)
335  df.setSample(i, adc[i]);
336 
337  digis.push_back(df);
338 
339  if (debug_)
340  LogDebug("ESUnpacker") << "Si : " << detId.zside() << " " << detId.plane() << " " << detId.six() << " "
341  << detId.siy() << " " << detId.strip() << " (" << kid << "," << pace << ") "
342  << df.sample(0).adc() << " " << df.sample(1).adc() << " " << df.sample(2).adc();
343  }
344 }
int vmajor_
Definition: ESUnpacker.h:58
bool debug_
Definition: ESUnpacker.h:64
int y_[4288][4]
Definition: ESUnpacker.h:72
Word64 m5
Definition: ESUnpacker.h:70
int x_[4288][4]
Definition: ESUnpacker.h:72
int zside(DetId const &)
int zside_[4288][4]
Definition: ESUnpacker.h:72
uint64_t word
int vminor_
Definition: ESUnpacker.h:57
Word64 m2
Definition: ESUnpacker.h:70
int pl_[4288][4]
Definition: ESUnpacker.h:72
static bool validDetId(int istrip, int ixs, int iys, int iplane, int iz)
check if a valid index combination
Definition: ESDetId.cc:15
void push_back(unsigned int i)
Word64 m16
Definition: ESUnpacker.h:70
uint16_t *__restrict__ uint16_t const *__restrict__ adc
#define LogDebug(id)

Member Data Documentation

◆ bx_

int ESUnpacker::bx_
private

Definition at line 49 of file ESUnpacker.h.

Referenced by interpretRawData(), and setBX().

◆ dac_

int ESUnpacker::dac_
private

Definition at line 51 of file ESUnpacker.h.

Referenced by interpretRawData().

◆ debug_

bool ESUnpacker::debug_
private

Definition at line 64 of file ESUnpacker.h.

Referenced by ESUnpacker(), interpretRawData(), and word2digi().

◆ FEch_

int ESUnpacker::FEch_[36]
private

Definition at line 62 of file ESUnpacker.h.

Referenced by interpretRawData().

◆ fedId_

int ESUnpacker::fedId_
private

Definition at line 46 of file ESUnpacker.h.

Referenced by interpretRawData().

◆ gain_

int ESUnpacker::gain_
private

Definition at line 52 of file ESUnpacker.h.

Referenced by interpretRawData().

◆ lookup_

edm::FileInPath ESUnpacker::lookup_
private

Definition at line 65 of file ESUnpacker.h.

Referenced by ESUnpacker().

◆ lv1_

int ESUnpacker::lv1_
private

Definition at line 50 of file ESUnpacker.h.

Referenced by interpretRawData(), and setLV1().

◆ m1

Word64 ESUnpacker::m1
protected

Definition at line 70 of file ESUnpacker.h.

Referenced by ESUnpacker(), and interpretRawData().

◆ m12

Word64 ESUnpacker::m12
protected

Definition at line 70 of file ESUnpacker.h.

Referenced by ESUnpacker(), and interpretRawData().

◆ m16

Word64 ESUnpacker::m16
protected

Definition at line 70 of file ESUnpacker.h.

Referenced by ESUnpacker(), interpretRawData(), and word2digi().

◆ m2

Word64 ESUnpacker::m2
protected

Definition at line 70 of file ESUnpacker.h.

Referenced by ESUnpacker(), and word2digi().

◆ m32

Word64 ESUnpacker::m32
protected

Definition at line 70 of file ESUnpacker.h.

Referenced by ESUnpacker(), and interpretRawData().

◆ m4

Word64 ESUnpacker::m4
protected

Definition at line 70 of file ESUnpacker.h.

Referenced by ESUnpacker(), and interpretRawData().

◆ m5

Word64 ESUnpacker::m5
protected

Definition at line 70 of file ESUnpacker.h.

Referenced by ESUnpacker(), and word2digi().

◆ m6

Word64 ESUnpacker::m6
protected

Definition at line 70 of file ESUnpacker.h.

Referenced by ESUnpacker(), and interpretRawData().

◆ m8

Word64 ESUnpacker::m8
protected

Definition at line 70 of file ESUnpacker.h.

Referenced by ESUnpacker(), and interpretRawData().

◆ optoRX0_

int ESUnpacker::optoRX0_
private

Definition at line 59 of file ESUnpacker.h.

Referenced by interpretRawData().

◆ optoRX1_

int ESUnpacker::optoRX1_
private

Definition at line 60 of file ESUnpacker.h.

Referenced by interpretRawData().

◆ optoRX2_

int ESUnpacker::optoRX2_
private

Definition at line 61 of file ESUnpacker.h.

Referenced by interpretRawData().

◆ orbit_number_

int ESUnpacker::orbit_number_
private

Definition at line 48 of file ESUnpacker.h.

Referenced by interpretRawData(), and setOrbitNumber().

◆ pl_

int ESUnpacker::pl_[4288][4]
protected

Definition at line 72 of file ESUnpacker.h.

Referenced by ESUnpacker(), and word2digi().

◆ precision_

int ESUnpacker::precision_
private

Definition at line 53 of file ESUnpacker.h.

Referenced by interpretRawData().

◆ pset_

const edm::ParameterSet ESUnpacker::pset_
private

Definition at line 41 of file ESUnpacker.h.

Referenced by ESUnpacker().

◆ run_number_

int ESUnpacker::run_number_
private

Definition at line 47 of file ESUnpacker.h.

Referenced by setRunNumber().

◆ runtype_

int ESUnpacker::runtype_
private

Definition at line 54 of file ESUnpacker.h.

Referenced by interpretRawData().

◆ seqtype_

int ESUnpacker::seqtype_
private

Definition at line 55 of file ESUnpacker.h.

Referenced by interpretRawData().

◆ trgtype_

int ESUnpacker::trgtype_
private

Definition at line 56 of file ESUnpacker.h.

Referenced by interpretRawData(), and setTriggerType().

◆ vmajor_

int ESUnpacker::vmajor_
private

Definition at line 58 of file ESUnpacker.h.

Referenced by interpretRawData(), and word2digi().

◆ vminor_

int ESUnpacker::vminor_
private

Definition at line 57 of file ESUnpacker.h.

Referenced by interpretRawData(), and word2digi().

◆ x_

int ESUnpacker::x_[4288][4]
protected

Definition at line 72 of file ESUnpacker.h.

Referenced by ESUnpacker(), and word2digi().

◆ y_

int ESUnpacker::y_[4288][4]
protected

Definition at line 72 of file ESUnpacker.h.

Referenced by ESUnpacker(), and word2digi().

◆ zside_

int ESUnpacker::zside_[4288][4]
protected

Definition at line 72 of file ESUnpacker.h.

Referenced by ESUnpacker(), and word2digi().