ATLAS Offline Software
LArRodDecoder.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 // Implementation of LArRodDecoder class
7 #include "GaudiKernel/ListItem.h"
8 #include "GaudiKernel/MsgStream.h"
9 #include "GaudiKernel/Bootstrap.h"
10 #include "GaudiKernel/ISvcLocator.h"
11 #include "GaudiKernel/IToolSvc.h"
12 
14 //#include "LArByteStream/LArRodBlockStructure_0.h"
17 // IWS 14.07.2005
19 // IWS 25.04.2006
30 #include <algorithm>
31 #include <fstream>
32 
36 
37 static const InterfaceID IID_ILArRodDecoder
38  ("LArRodDecoder", 1, 0);
39 
40 LArRodDecoder::LArRodDecoder ( const std::string& type, const std::string& name,const IInterface* parent )
42  m_LArCellEthreshold(-100.),
43  m_readtdc(false),
44  m_onlineHelper(0)
45  {
46  declareInterface< LArRodDecoder >( this );
47  declareProperty("IgnoreCheckFEBs",m_IgnoreCheckFEBs);
48  declareProperty("CellCorrections",m_LArCellCorrNames );
49  declareProperty("LArCellEthreshold",m_LArCellEthreshold );
50  declareProperty("ReadTDC",m_readtdc);
51  declareProperty("DelayScale",m_delayScale=(25./240.)*CLHEP::ns);
52  declareProperty("FebExchange", m_febExchange=0); //FIXME: Very ugly hack! See explanation in .h file
53  declareProperty("FebId1", m_febId1=0);
54  declareProperty("FebId2", m_febId2=0);
55  declareProperty("FirstSample", m_firstSample=0); //FIXME: Very ugly hack! See explanation in .h file
56 
57  declareProperty("BEPreselection",m_vBEPreselection,"For channel-selection: Barrel=0, Endcap=1");
58  declareProperty("PosNegPreselection",m_vPosNegPreselection,"For channel-selection: C-Side:0, A-Side: 1");
59  declareProperty("FTNumPreselection",m_vFTPreselection,"For channel-selection: Feedthrough numbers (e.g. 0 - 31 for barrel)");
60  declareProperty("MultiDSPMode", m_MultiDSPMode=false);
61  declareProperty("CheckSum", m_CheckSum=false);
62  declareProperty("StatusMask", m_StatusMask=0x00000212);
63  declareProperty("RequiredPhysicsNSamples", m_requiredPhysicsNSamples = 0);
64 }
65 
66 // destructor
68 {
69 }
70 
71 const InterfaceID& LArRodDecoder::interfaceID( )
72 { return IID_ILArRodDecoder; }
73 
76 {
77  // Before anything, access message service
78  m_StatusNMask = !m_StatusMask;
79 
80 
81  StatusCode sc = detStore()->retrieve(m_onlineHelper, "LArOnlineID");
82  if (sc.isFailure()) {
83  msg(MSG::ERROR) << "Could not get LArOnlineID helper !" << endmsg;
84  return sc;
85  }
86 
87  IToolSvc* toolSvc;
88  sc = service( "ToolSvc",toolSvc);
89  if (sc.isFailure())
90  {msg(MSG::ERROR) << "Unable to get ToolSvc" << endmsg;
91  return sc;
92  }
93 
94  ATH_CHECK( m_evt.initialize() );
95 
96  std::vector<std::string>::const_iterator it = m_LArCellCorrNames.begin();
97  std::vector<std::string>::const_iterator it_end = m_LArCellCorrNames.end();
98  for(; it!=it_end;++it)
99  {IAlgTool* tool;
100  CaloCellCorrection* corr;
101  ListItem li(*it);
102  if((toolSvc->retrieveTool(li.type(), li.name(), tool)).isFailure() )
103  {msg(MSG::ERROR) << " Can't get AlgTool for CaloCellCorrection " << endmsg;
104  return StatusCode::FAILURE;
105  }
106 
107  corr = dynamic_cast<CaloCellCorrection*> (tool);
108  if(!corr )
109  {msg(MSG::ERROR) << " Can't d-cast to CaloCellCorrection* " << endmsg;
110  return StatusCode::FAILURE;
111  }
112  m_LArCellCorrTools.push_back(corr);
113  }
114 
115  //Build list of preselected Feedthroughs
116  if (m_vBEPreselection.size() && m_vPosNegPreselection.size() && m_vFTPreselection.size()) {
117  ATH_MSG_INFO("Building list of selected feedthroughs");
118  for (const unsigned BE : m_vBEPreselection) {
119  for (const unsigned PN : m_vPosNegPreselection) {
120  for (const unsigned FT : m_vFTPreselection) {
121  HWIdentifier finalFTId=m_onlineHelper->feedthrough_Id(BE,PN,FT);
122  unsigned int finalFTId32 = finalFTId.get_identifier32().get_compact();
123  ATH_MSG_INFO("Adding feedthrough Barrel/Endcap=" << BE << " pos/neg=" << PN << " FT=" << FT
124  << " (0x" << std::hex << finalFTId32 << std::dec << ")");
125  m_vFinalPreselection.push_back(finalFTId32);
126  }
127  }
128  }
129  std::sort(m_vFinalPreselection.begin(),m_vFinalPreselection.end());
130  }//end if something set
131  else {
132  if (m_vBEPreselection.size() || m_vPosNegPreselection.size() || m_vFTPreselection.size()) {
133  msg(MSG::ERROR) << "Feedthrough preselection: jobOption inconsistency! "<< endmsg;
134  msg(MSG::ERROR) << "Need to set all three jobOptions BEPreselection PNPreselecton and FTPreselection" << endmsg;
135  return StatusCode::FAILURE;
136  }
137  ATH_MSG_DEBUG("No feedthrough preselection by jobOptions.");
138  }
139  return sc;
140 }
141 
142 
143 
145  const uint32_t* p, uint32_t n, LArDigitContainer& coll, CaloGain::CaloGain RequestedGain) const
146 { // Digit pointer
147  LArDigit * dg=0 ;
148  CaloGain::CaloGain calogain;
149  uint32_t gain;
150  int fcNb;
151  std::vector<short> samples;
152  LArRodBlockStructure* BlStruct=prepareBlockStructure(robFrag, p, n, RequestedGain);
153  if (!BlStruct) return;
154 
155  do {
156  HWIdentifier fId( Identifier32(BlStruct->getFEBID()) );
157  unsigned int fId32 = fId.get_identifier32().get_compact();
158  if (!m_onlineHelper->isValidId(fId)) {
159  msg(MSG::WARNING) << "Invalid FEB identifer 0x" << std::hex << fId32 << std::dec << ". Skipping" << endmsg;
160  continue;
161  }
162  // std::cout << "digit FEBID=" << std::hex<< " " <<fId32 << std::dec<<std::endl;
163  if(m_febExchange) {
164  if (fId32 == m_febId1) {
166  fId32 = fId.get_identifier32().get_compact();
167  }
168  else if(fId32 == m_febId2) {
170  fId32 = fId.get_identifier32().get_compact();
171  }
172  }
173 
174  // IWS 24.01.2006 protection against NULL events (null pointer to rawdata block)
175  if (!BlStruct->hasRawDataBlock())
176  {
177  ATH_MSG_DEBUG("No Raw Data for this FEB - NULL event for FEBID 0x"<< std::hex << BlStruct->getFEBID() << std::dec);
178  continue;
179  }
180 
181  // RL 04.17.2008 skip check for some FEBs
182  int do_check=1;
183  std::vector<unsigned int>::const_iterator it_feb = m_IgnoreCheckFEBs.begin();
184  std::vector<unsigned int>::const_iterator it_feb_end = m_IgnoreCheckFEBs.end();
185  for(; it_feb!=it_feb_end;++it_feb)
186  if(fId==*it_feb) {
187  do_check=0;
188  break;
189  }
190  if(do_check) {
191  //WL 31.10.2007 //check RodStatus-word to catch corrupt events
192  if (BlStruct->getStatus() & m_StatusNMask) {
193  msg(MSG::WARNING) << "RodStatus&0x" << std::hex << m_StatusNMask << " indicates corrupt data for FEB "<< std::hex << fId32 << std::dec <<". Ignored." << endmsg;
194  continue;
195  }
196  }
197  // RL 05.11.2007 checksum
198  if(m_CheckSum) {
199  const uint32_t onsum = BlStruct->onlineCheckSum();
200  const uint32_t offsum = BlStruct->offlineCheckSum();
201  if(onsum!=offsum) {
202  msg(MSG::WARNING) << "Checksum error for FEB: " << MSG::hex << fId32 << endmsg;
203  msg(MSG::WARNING) << " online checksum = " << MSG::hex << onsum << endmsg;
204  msg(MSG::WARNING) << " offline checksum = " << MSG::hex << offsum << MSG::dec << endmsg;
205  continue;
206  }
207  }
208 
209  if (m_vFinalPreselection.size()) {
210  const unsigned int ftId=m_onlineHelper->feedthrough_Id(fId).get_identifier32().get_compact();
211  if (!std::binary_search(m_vFinalPreselection.begin(), m_vFinalPreselection.end(),ftId)) {
212  ATH_MSG_DEBUG("Feedthrough with id 0x" << MSG::hex << ftId << MSG::dec <<" not in preselection. Ignored.");
213  continue;
214  }
215  }
216  const int NthisFebChannel=m_onlineHelper->channelInSlotMax(fId);
217  while (BlStruct->getNextRawData(fcNb,samples,gain))
218  {if (fcNb>=NthisFebChannel)
219  continue;
220  if (samples.size()==0) continue; // Ignore missing cells
221  HWIdentifier cId = m_onlineHelper->channel_Id(fId,fcNb);
222  calogain=(CaloGain::CaloGain)gain;
223  dg = new LArDigit(cId, calogain, std::move(samples));
224  samples.clear();
225  coll.push_back(dg);
226  }
227  }
228  while (BlStruct->nextFEB()); //Get NextFeb
229  return;
230 }
231 
232 //*******
233 
234 
236  const uint32_t* p, uint32_t n, LArRawChannelContainer& coll, CaloGain::CaloGain RequestedGain) const
237 {
238  int32_t energy;
239  int32_t time;
240  int32_t quality;
241  uint32_t gain;
242  int fcNb;
243  HWIdentifier cId;
244  LArRodBlockStructure* BlStruct=prepareBlockStructure(robFrag, p, n, RequestedGain);
245  if (!BlStruct) return;
246 
247  do {
248  HWIdentifier fId( Identifier32(BlStruct->getFEBID()) );
249  unsigned int fId32 = fId.get_identifier32().get_compact();
250  if (!m_onlineHelper->isValidId(fId)) {
251  msg(MSG::WARNING) << "Invalid FEB identifer " << std::hex << fId32 << std::dec << ". Skipping" << endmsg;
252  continue;
253  }
254  // std::cout << "rawChan FEBID=" << std::hex <<fId32 << std::dec<<std::endl;
255 
256  if(m_febExchange) {
257  if (fId32 == m_febId1) {
259  fId32 = fId.get_identifier32().get_compact();
260  }
261  else if(fId32 == m_febId2) {
263  fId32 = fId.get_identifier32().get_compact();
264  }
265  }
266  if (!BlStruct->hasPhysicsBlock()) {
267  ATH_MSG_DEBUG("No Physics Data for this FEB - NULL event for FEBID 0x" << std::hex << BlStruct->getFEBID() << std::dec);
268  continue;
269  }
270 
271  // RL 04.17.2008 skip check for some FEBs
272  int do_check=1;
273  std::vector<unsigned int>::const_iterator it_feb = m_IgnoreCheckFEBs.begin();
274  std::vector<unsigned int>::const_iterator it_feb_end = m_IgnoreCheckFEBs.end();
275  for(; it_feb!=it_feb_end;++it_feb)
276  if(fId==*it_feb) {
277  do_check=0;
278  break;
279  }
280  if(do_check) {
281  //WL 31.10.2007 //check RodStatus-word to catch corrupt events
282  if (BlStruct->getStatus() & m_StatusNMask) {
283  msg(MSG::WARNING) << "RodStatus&0x" << std::hex << m_StatusNMask << " indicates corrupt data for FEB "<< std::hex << fId32 << std::dec <<". Ignored." << endmsg;
284  continue;
285  }
286  }
287 
288  // RL 05.11.2007 checksum
289  if(m_CheckSum) {
290  const uint32_t onsum = BlStruct->onlineCheckSum();
291  const uint32_t offsum = BlStruct->offlineCheckSum();
292  if(onsum!=offsum) {
293  msg(MSG::WARNING) << "Checksum error:" << endmsg;
294  msg(MSG::WARNING) << " online checksum = " << MSG::hex << onsum << endmsg;
295  msg(MSG::WARNING) << " offline checksum = " << MSG::hex << offsum << endmsg;
296  continue;
297  }
298  }
299 
300  if (m_vFTPreselection.size()) {
302  if (!std::binary_search(m_vFTPreselection.begin(), m_vFTPreselection.end(),ftId)) {
303  ATH_MSG_DEBUG("Feedthrough with id " << std::hex << ftId << std::dec <<" not in preselection. Ignored.");
304  continue;
305  }
306  }
307  const int NthisFebChannel=m_onlineHelper->channelInSlotMax(fId);
308  while (BlStruct->getNextEnergy(fcNb,energy,time,quality,gain)) {
309  if (fcNb>=NthisFebChannel)
310  continue;
311  cId = m_onlineHelper->channel_Id(fId,fcNb);
312  uint16_t iquality = 0;
313  uint16_t iprovenance = 0x1000;
314  if (quality>0) {
315  iprovenance |= 0x2000;
316  iquality = (quality & 0xFFFF);
317  }
318  LArRawChannel chan(cId, energy, time, iquality, iprovenance, (CaloGain::CaloGain)gain);
319  coll.push_back(chan);
320  }
321  }
322  while (BlStruct->nextFEB()); //Get NextFeb
323  return;
324 }
325 
326 
328  const uint32_t* p,
329  uint32_t n,
331  CaloGain::CaloGain RequestedGain,
332  const LArCalibLineMapping& calibLineMapping,
333  const LArOnOffIdMapping& onOffIdMapping) const
334 { // CalibDigit pointer
335  LArCalibDigit * dg=0 ;
336  uint32_t gain;
337  CaloGain::CaloGain calogain;
338  int fcNb;
339  uint16_t dac, delay;
340  bool ispulsed;
341  std::vector<short> samples;
342 
343  ATH_MSG_VERBOSE("FillCollection for LArCalibDigitContainer is called.");
344  LArRodBlockStructure* BlStruct=prepareBlockStructure(robFrag, p, n, RequestedGain);
345  if (!BlStruct) return;
346  if (BlStruct->canSetCalibration()) {
347  dac=BlStruct->getDAC();
348  delay=BlStruct->getDelay();
349  // int iFeb=0, iCan=0; //For debug purpose
350  do
351  {
352  // IWS 24.01.2006 protection against NULL events (null pointer to rawdata block)
353  if (!BlStruct->hasRawDataBlock()) {
354  ATH_MSG_DEBUG("No Raw Data for this FEB - NULL event for FEBID " << std::hex << BlStruct->getFEBID());
355  continue;
356  }
357  HWIdentifier fId(Identifier32(BlStruct->getFEBID()));
358  unsigned int fId32 = fId.get_identifier32().get_compact();
359  // RL 20.09.2006 protection against 0 FebId
360  if (!fId32){
361  ATH_MSG_DEBUG("Bad FebID=0x"<< std::hex << BlStruct->getFEBID() << " found for this FEB, skipping it!");
362  continue;
363  }
364  // RL 04.17.2008 skip check for some FEBs
365  int do_check=1;
366  std::vector<unsigned int>::const_iterator it_feb = m_IgnoreCheckFEBs.begin();
367  std::vector<unsigned int>::const_iterator it_feb_end = m_IgnoreCheckFEBs.end();
368  for(; it_feb!=it_feb_end;++it_feb)
369  if(fId==*it_feb) {
370  do_check=0;
371  break;
372  }
373  if(do_check) {
374  //WL 31.10.2007 //check RodStatus-word to catch corrupt events
375  if (BlStruct->getStatus() & m_StatusNMask) {
376  msg(MSG::WARNING) << "RodStatus&0x" << std::hex << m_StatusNMask << " indicates corrupt data for FEB "<< std::hex << fId32 << std::dec <<". Ignored." << endmsg;
377  continue;
378  }
379  }
380  // RL 05.11.2007 checksum
381  if(m_CheckSum) {
382  uint32_t onsum = BlStruct->onlineCheckSum();
383  uint32_t offsum = BlStruct->offlineCheckSum();
384  if(onsum!=offsum) {
385  msg(MSG::WARNING) << "Checksum error:" << endmsg;
386  msg(MSG::WARNING) << " online checksum = " << MSG::hex << onsum << endmsg;
387  msg(MSG::WARNING) << " offline checksum = " << MSG::hex << offsum << endmsg;
388  continue;
389  }
390  }
391  if(m_febExchange) {
392  if (fId32 == m_febId1) {
394  fId32 = fId.get_identifier32().get_compact();
395  }
396  else if(fId32 == m_febId2) {
398  fId32 = fId.get_identifier32().get_compact();
399  }
400  }
401 
402  if (m_vFinalPreselection.size()) {
403  unsigned int ftId=m_onlineHelper->feedthrough_Id(fId).get_identifier32().get_compact();
404  if (!std::binary_search(m_vFinalPreselection.begin(), m_vFinalPreselection.end(),ftId)) {
405  ATH_MSG_DEBUG("Feedthrough with id 0x" << std::hex << ftId << std::dec <<" not in preselection. Ignored.");
406  continue;
407  }
408  }
409  const int NthisFebChannel=m_onlineHelper->channelInSlotMax(fId);
410  while (BlStruct->getNextRawData(fcNb,samples,gain))
411  {if (fcNb>=NthisFebChannel)
412  continue;
413  if (samples.size()==0) continue; // Ignore missing cells
414  HWIdentifier cId = m_onlineHelper->channel_Id(fId,fcNb);
415  ispulsed=BlStruct->getPulsed(fcNb);
416 
417  calogain=(CaloGain::CaloGain)gain;
418  dg = new LArCalibDigit(cId, calogain, samples, dac, delay, ispulsed);
419  samples.clear();
420  coll.push_back(dg);
421  }
422  }
423  while (BlStruct->nextFEB()); //Get NextFeb
424  }
425  else {//Not a calibration data block, try to get from database
426  ATH_MSG_VERBOSE("Not LArCalibDigit data block found. Building it using DB values");
427  //1st step, get Calib board config object
428  const LArCalibParams* calibParams = nullptr;
429  StatusCode sc=detStore()->retrieve(calibParams);
430  if (sc.isFailure())
431  {msg(MSG::ERROR) << "Cannot load LArCalibParams from DetStore!" << endmsg;
432  return;
433  }
434  //2st step, get Event number
436  if (!evt.isValid()) {
437  ATH_MSG_ERROR("Cannot get EventInfo");
438  return; //Return empty container.
439  }
440  const unsigned eventNb=evt->eventNumber();
441  const std::vector<HWIdentifier>* calibChannelIDs;
442  do { //Loop over all FEBs in this ROD
443 
444  // IWS 24.01.2006 protection against NULL events (null pointer to rawdata block)
445  if (!BlStruct->hasRawDataBlock()) {
446  ATH_MSG_DEBUG("No Raw Data for this FEB - NULL event for FEBID 0x" << std::hex << BlStruct->getFEBID() << std::dec);
447  continue;
448  }
449  HWIdentifier fId(Identifier32(BlStruct->getFEBID()));
450  unsigned int fId32 = fId.get_identifier32().get_compact();
451  // RL 20.09.2006 protection against 0 FebId
452  if (!fId32) {
453  ATH_MSG_DEBUG("Bad FebID=0x" << std::hex << BlStruct->getFEBID() << " found for this FEB, skipping it!" << std::dec);
454  continue;
455  }
456  if(m_febExchange) {
457  if (fId32 == m_febId1) {
459  fId32 = fId.get_identifier32().get_compact();
460  }
461  else if(fId32 == m_febId2) {
463  fId32 = fId.get_identifier32().get_compact();
464  }
465  }
466  fcNb=0;
467  HWIdentifier cId;
468  do { //Search for the first connected channel of this FEB (probably the first one...)
469  fcNb++;
470  cId = m_onlineHelper->channel_Id(fId,fcNb);
471  calibChannelIDs=&calibLineMapping.calibSlotLine(cId);
472  }
473  while ( (!onOffIdMapping.isOnlineConnected(cId) || calibChannelIDs->size()==0) && fcNb<128); // This is the right conditions to exit the loop!
474 
475  if ( calibChannelIDs->size()==0 ) {
476  msg(MSG::ERROR) << "Cannot get calibration Channel ID for FEB " << std::hex << fId32 << std::dec << endmsg;
477  return;
478  }
479 
480  uint16_t dac;
481  uint16_t delay;
482 
483  std::vector<HWIdentifier>::const_iterator csl_it=calibChannelIDs->begin();
484  //Derive DAC and Delay value from this channel
485  dac=calibParams->DAC(eventNb,*csl_it);
486  delay=calibParams->Delay(eventNb,*csl_it);
487 
488  //Now start looping over channels in FEB
489  const int NthisFebChannel=m_onlineHelper->channelInSlotMax(fId);
490  //std::cout << "Processing FEB #" << iFeb++ << std::endl;
491 
492  //int iCan=0;
493 
494  fcNb=0;
495  while (BlStruct->getNextRawData(fcNb,samples,gain))
496  {
497  if (fcNb>=NthisFebChannel) continue;
498  if (samples.size()==0) continue; // Ignore missing cells
499  cId = m_onlineHelper->channel_Id(fId,fcNb);
500  calibChannelIDs=&calibLineMapping.calibSlotLine(cId);
501  //if (calibChannelIDs->size()==0)
502  //continue; //Disconnected channel
503  //For the time being, I assume we are in H8 and have only one calib channel per FEB channel
504 
505  if (calibChannelIDs->size()!=0) {
506  csl_it=calibChannelIDs->begin();
507  ispulsed=calibParams->isPulsed(eventNb,*csl_it);
508 
509  } else ispulsed=0;
510  calogain=(CaloGain::CaloGain)gain;
511  dg = new LArCalibDigit(cId, calogain, samples, dac, delay, ispulsed);
512  samples.clear();
513 
514  coll.push_back(dg);
515  //iCan++;
516  }
517  }
518  while (BlStruct->nextFEB()); //Get NextFeb
519  }
521  return;
522 }
523 
525  const uint32_t* p,
526  uint32_t n,
528  CaloGain::CaloGain RequestedGain,
529  const LArCalibLineMapping& calibLineMapping) const
530 { // Accumulated Digit pointer
532  CaloGain::CaloGain calogain;
533  uint32_t gain, ntrigger;
534  int dac, delay, NStep=-1, StepIndex=-1;
535  bool ispulsed;
536  uint16_t ispulsed_int;
537  int bitShift;
538  uint32_t FirstGoodFEB=1;
539  int fcNb;
540  std::vector< uint64_t > samplesSum;
541  std::vector< uint64_t > samples2Sum;
542 
543  // for(int i=0;i<16;i++)
544  // std::cout << " - " << std::hex << p[i] << std::endl;
545 
546  LArRodBlockStructure* BlStruct=prepareBlockStructure(robFrag, p, n, RequestedGain);
547  if (!BlStruct) return;
548  do
549  {
550  // IWS 24.01.2006 protection against NULL events (null pointer to rawdata block)
551  if (!BlStruct->hasCalibBlock())
552  {
553  ATH_MSG_DEBUG("No Calib Data for this FEB - NULL event");
554  continue;
555  }
556  if(FirstGoodFEB)
557  {
558  FirstGoodFEB=0;
559  }
560  HWIdentifier fId(Identifier32(BlStruct->getFEBID()));
561  unsigned int fId32 = fId.get_identifier32().get_compact();
562  // RL 20.09.2006 protection against 0 FebId
563  if (!fId32){
564  ATH_MSG_DEBUG("Bad FebID=0x" << std::hex << BlStruct->getFEBID() << " found for this FEB, skipping it!" << std::dec);
565  continue;
566  }
567  // RL 04.17.2008 skip check for some FEBs
568  int do_check=1;
569  std::vector<unsigned int>::const_iterator it_feb = m_IgnoreCheckFEBs.begin();
570  std::vector<unsigned int>::const_iterator it_feb_end = m_IgnoreCheckFEBs.end();
571  for(; it_feb!=it_feb_end;++it_feb)
572  if(fId==*it_feb) {
573  do_check=0;
574  break;
575  }
576  if(do_check) {
577  //WL 31.10.2007 //check RodStatus-word to catch corrupt events
578  if (BlStruct->getStatus() & m_StatusNMask) {
579  msg(MSG::WARNING) << "RodStatus&0x" << std::hex << m_StatusNMask << " indicates corrupt data for FEB "<< std::hex << fId32 << std::dec <<". Ignored." << endmsg;
580  continue;
581  }
582  }
583  // RL 05.11.2007 checksum
584  if(m_CheckSum) {
585  uint32_t onsum = BlStruct->onlineCheckSum();
586  uint32_t offsum = BlStruct->offlineCheckSum();
587  if(onsum!=offsum) {
588  msg(MSG::WARNING) << "Checksum error:" << endmsg;
589  msg(MSG::WARNING) << " online checksum = " << MSG::hex << onsum << endmsg;
590  msg(MSG::WARNING) << " offline checksum = " << MSG::hex << offsum << endmsg;
591  continue;
592  }
593  }
594  if(m_febExchange) {
595  if (fId32 == m_febId1) {
597  fId32 = fId.get_identifier32().get_compact();
598  }
599  else if(fId32 == m_febId2) {
601  fId32 = fId.get_identifier32().get_compact();
602  }
603  }
604 
605  if (m_vFinalPreselection.size()) {
606  unsigned int ftId=m_onlineHelper->feedthrough_Id(fId).get_identifier32().get_compact();
607  if (!std::binary_search(m_vFinalPreselection.begin(), m_vFinalPreselection.end(),ftId)) {
608  ATH_MSG_DEBUG("Feedthrough with id " << std::hex << ftId << std::dec <<" not in preselection. Ignored.");
609  continue;
610  }
611  }
612  int NthisFebChannel=m_onlineHelper->channelInSlotMax(fId);
613  uint32_t idum=0;
614  while (BlStruct->getNextAccumulatedCalibDigit(fcNb,samplesSum,samples2Sum,idum,gain))
615  {
616  ispulsed_int=0;
617  bitShift=0;
618  if (fcNb>=NthisFebChannel)continue;
619  if (samplesSum.size()==0) continue; // Ignore missing cells
620  HWIdentifier cId = m_onlineHelper->channel_Id(fId,fcNb);
621  calogain=(CaloGain::CaloGain)gain;
622  ntrigger=BlStruct->getNTrigger();
623  dac=BlStruct->getDAC();
624  delay=BlStruct->getDelay();
625  NStep=BlStruct->getNStep();
626  if(!NStep) NStep=1; // To be able to decode v6 code
627  StepIndex=BlStruct->getStepIndex();
628  // 08.08.2005 IWS get calib line
629  const std::vector<HWIdentifier>& calibChannelIDs = calibLineMapping.calibSlotLine(cId);
630  if (calibChannelIDs.size()==0) {
631  samplesSum.clear();
632  samples2Sum.clear();
633  continue;// connected channel
634  }
635  //GR: Loop over all the calib chans instead of just looking at the first one and set four bit isPulsed int
636  for(std::vector<HWIdentifier>::const_iterator csl_it=calibChannelIDs.begin(); csl_it!=calibChannelIDs.end();++csl_it){
637  uint32_t calibLine = m_onlineHelper->channel(*csl_it);
638  ispulsed=BlStruct->getPulsed(calibLine);
639  ispulsed_int=( ispulsed_int | ((uint16_t)ispulsed<<bitShift) );
640  bitShift++;
641  }
642 
643  dg=new LArAccumulatedCalibDigit(cId, calogain, samplesSum, samples2Sum, ntrigger, dac, delay,
644  (uint16_t)ispulsed_int, NStep, StepIndex);
645 
646  coll.push_back(dg);
647  } // End while
648  }//End do loop of FEBs
649  while (BlStruct->nextFEB()); //Get NextFeb
650 
651  return;
652 }
653 
655  const uint32_t* p, uint32_t n, LArAccumulatedDigitContainer& coll, CaloGain::CaloGain RequestedGain) const
656 { // Accumulated Digit pointer
657  LArAccumulatedDigit * dg=0 ;
658  CaloGain::CaloGain calogain;
659  uint32_t gain, ntrigger;
660  //int NStep=-1, StepIndex=-1;
661  int fcNb;
662  std::vector<uint64_t> sampleSum;
663  std::vector< uint64_t > sampleSquare;
664 
665  // for(int i=0;i<16;i++)
666  // std::cout << " - " << std::hex << p[i] << std::endl;
667 
668  LArRodBlockStructure* BlStruct=prepareBlockStructure(robFrag, p, n, RequestedGain);
669  if (!BlStruct) return;
670  do
671  {
672  // IWS 24.01.2006 protection against NULL events (null pointer to rawdata block)
673  if (!BlStruct->hasAccumBlock()) {
674  ATH_MSG_DEBUG("No Accum Data for this FEB - NULL event");
675  continue;
676  }
677  HWIdentifier fId(Identifier32(BlStruct->getFEBID()));
678  unsigned int fId32 = fId.get_identifier32().get_compact();
679  // RL 20.09.2006 protection against 0 FebId
680  if (!fId32) {
681  ATH_MSG_DEBUG("Bad FebID=0x" << std::hex << BlStruct->getFEBID() << " found for this FEB, skipping it!" << std::dec);
682  continue;
683  }
684  // RL 04.17.2008 skip check for some FEBs
685  int do_check=1;
686  std::vector<unsigned int>::const_iterator it_feb = m_IgnoreCheckFEBs.begin();
687  std::vector<unsigned int>::const_iterator it_feb_end = m_IgnoreCheckFEBs.end();
688  for(; it_feb!=it_feb_end;++it_feb)
689  if(fId==*it_feb) {
690  do_check=0;
691  break;
692  }
693  if(do_check) {
694  //WL 31.10.2007 //check RodStatus-word to catch corrupt events
695  if (BlStruct->getStatus() & m_StatusNMask) {
696  msg(MSG::WARNING) << "RodStatus&0x" << std::hex << m_StatusNMask << " indicates corrupt data for FEB "<< std::hex << fId32 << std::dec <<". Ignored." << endmsg;
697  continue;
698  }
699  }
700  // RL 05.11.2007 checksum
701  if(m_CheckSum) {
702  uint32_t onsum = BlStruct->onlineCheckSum();
703  uint32_t offsum = BlStruct->offlineCheckSum();
704  if(onsum!=offsum) {
705  msg(MSG::WARNING) << "Checksum error:" << endmsg;
706  msg(MSG::WARNING) << " online checksum = " << MSG::hex << onsum << endmsg;
707  msg(MSG::WARNING) << " offline checksum = " << MSG::hex << offsum << endmsg;
708  continue;
709  }
710  }
711  if(m_febExchange) {
712  if (fId32 == m_febId1) {
714  fId32 = fId.get_identifier32().get_compact();
715  }
716  else if(fId32 == m_febId2) {
718  fId32 = fId.get_identifier32().get_compact();
719  }
720  }
721 
722  if (m_vFinalPreselection.size()) {
723  unsigned int ftId=m_onlineHelper->feedthrough_Id(fId).get_identifier32().get_compact();
724  if (!std::binary_search(m_vFinalPreselection.begin(), m_vFinalPreselection.end(),ftId)) {
725  ATH_MSG_DEBUG("Feedthrough with id " << std::hex << ftId << std::dec <<" not in preselection. Ignored.");
726  continue;
727  }
728  }
729  int NthisFebChannel=m_onlineHelper->channelInSlotMax(fId);
730  ntrigger=BlStruct->getNTrigger();
731  //NStep=BlStruct->getNStep();
732  //if(!NStep) NStep=1; // To be able to decode v6 code
733  //StepIndex=BlStruct->getStepIndex();
734  while (BlStruct->getNextAccumulatedDigit(fcNb,sampleSum,sampleSquare,gain)) {
735  if (fcNb>=NthisFebChannel)continue;
736  if (sampleSquare.size()==0) continue; // Ignore missing cells
737  HWIdentifier cId = m_onlineHelper->channel_Id(fId,fcNb);
738  calogain=(CaloGain::CaloGain)gain;
739  dg=new LArAccumulatedDigit(cId,calogain,sampleSum,sampleSquare,ntrigger);
740  coll.push_back(dg);
741  } // End while
742  }//End do loop of FEBs
743  while (BlStruct->nextFEB()); //Get NextFeb
744 
745  return;
746 }
747 
749  const uint32_t* p, uint32_t n, LArFebHeaderContainer& coll,const CaloGain::CaloGain RequestedGain) const
750 {
751  LArFebHeader* larFebHeader;
752  //uint32_t NWtot=0;
753  HWIdentifier FEBID;
754 
755  // for(int i=0;i<16;i++)
756  // std::cout << " - " << std::hex << p[i] << std::endl;
757 
758  LArRodBlockStructure* BlStruct=prepareBlockStructure(robFrag, p, n, RequestedGain);
759  if (!BlStruct) return;
760 
761  do{
762  //Read first FEB. The header of this feb is combined with the ROD-Header
763  //NWtot=BlStruct->getNumberOfWords();
764  //if(NWtot<=4) continue;
765 
766  FEBID=HWIdentifier(Identifier32(BlStruct->getFEBID()));
767  unsigned int FEBID32 = FEBID.get_identifier32().get_compact();
768  if (!m_onlineHelper->isValidId(FEBID)) {
769  msg(MSG::WARNING) << "Invalid FEB identifer " << std:: hex << FEBID32 << std::dec << ". Skipping" << endmsg;
770  continue;
771  }
772 
773  if(m_febExchange) {
774  if (FEBID32 == m_febId1) {
776  FEBID32 = FEBID.get_identifier32().get_compact();
777  }
778  else if(FEBID32 == m_febId2) {
780  FEBID32 = FEBID.get_identifier32().get_compact();
781  }
782  }
783 
784  if (m_vFinalPreselection.size()) {
785  const unsigned int ftId=m_onlineHelper->feedthrough_Id(FEBID).get_identifier32().get_compact();
786  if (!std::binary_search(m_vFinalPreselection.begin(), m_vFinalPreselection.end(),ftId)) {
787  ATH_MSG_DEBUG("Feedthrough with id 0x" << std::hex << ftId << std::dec <<" not in preselection. Ignored.");
788  continue;
789  }
790  }
791 
792 
793 
794  larFebHeader=new LArFebHeader(FEBID);
795  //setROD header data
796 
797  larFebHeader->SetFormatVersion(robFrag.rod_version());
798  larFebHeader->SetSourceId(robFrag.rod_source_id());
799  larFebHeader->SetRunNumber(robFrag.rod_run_no());
800  larFebHeader->SetELVL1Id(robFrag.rod_lvl1_id());
801  larFebHeader->SetBCId(robFrag.rod_bc_id());
802  larFebHeader->SetLVL1TigType(robFrag.rod_lvl1_trigger_type());
803  larFebHeader->SetDetEventType(robFrag.rod_detev_type());
804 
805  //set DSP data
806  const unsigned nsample=BlStruct->getNumberOfSamples();
807  const uint32_t status= BlStruct->getStatus();
808  larFebHeader->SetDspCodeVersion(BlStruct->getDspCodeVersion());
809  larFebHeader->SetDspEventCounter(BlStruct->getDspEventCounter());
810  larFebHeader->SetRodResults1Size(BlStruct->getResults1Size());
811  larFebHeader->SetRodResults2Size(BlStruct->getResults2Size());
812  larFebHeader->SetRodRawDataSize(BlStruct->getRawDataSize());
813  larFebHeader->SetNbSweetCells1(BlStruct->getNbSweetCells1());
814  larFebHeader->SetNbSweetCells2(BlStruct->getNbSweetCells2());
815  larFebHeader->SetNbSamples(nsample);
816  larFebHeader->SetOnlineChecksum(BlStruct->onlineCheckSum());
817  larFebHeader->SetOfflineChecksum(BlStruct->offlineCheckSum());
818 
819  if(!BlStruct->hasControlWords()) {
820  larFebHeader->SetFebELVL1Id(robFrag.rod_lvl1_id());
821  larFebHeader->SetFebBCId(robFrag.rod_bc_id());
822  } else {
823  const uint16_t evtid = BlStruct->getCtrl1(0) & 0x1f;
824  const uint16_t bcid = BlStruct->getCtrl2(0) & 0x1fff;
825 
826  larFebHeader->SetFebELVL1Id(evtid);
827  larFebHeader->SetFebBCId(bcid);
828  for(int iadc=0;iadc<16;iadc++) {
829  larFebHeader->SetFebCtrl1(BlStruct->getCtrl1(iadc));
830  larFebHeader->SetFebCtrl2(BlStruct->getCtrl2(iadc));
831  larFebHeader->SetFebCtrl3(BlStruct->getCtrl3(iadc));
832  }
833  for(unsigned int i = 0; i<nsample; i++ ) {
834  larFebHeader->SetFebSCA(BlStruct->getRadd(0,i) & 0xff);
835  }
836  }
837  larFebHeader->SetRodStatus(status);
838  coll.push_back(larFebHeader);
839 
840  } while (BlStruct->nextFEB()); //Get NextFeb
841 }
842 
843 
845 LArRodDecoder::prepareBlockStructure1 (const uint16_t rodMinorVersion, const uint32_t robBlockType) const
846 {
847  const unsigned MAXMINOR = 12;
848  const unsigned MAXTYPE = 10;
849 
850  if (rodMinorVersion > MAXMINOR || robBlockType > MAXTYPE) {
851  msg(MSG::ERROR) << "Bad Rod block type " << robBlockType
852  << " / " << rodMinorVersion << endmsg;
853  return nullptr;
854  }
855  std::vector<std::unique_ptr<LArRodBlockStructure> >& blstructs =
856  *m_blstructs.get();
857  unsigned int index = robBlockType * (MAXMINOR+1) + rodMinorVersion;
858  if (blstructs.empty()) {
859  blstructs.resize ((MAXMINOR+1)*(MAXTYPE+1));
860  }
861  if (!blstructs[index]) {
862  blstructs[index] = makeBlockStructure (robBlockType, rodMinorVersion);
863  }
864  if (!blstructs[index]) {
865  msg(MSG::ERROR) << "Bad Rod block type " << robBlockType
866  << " / " << rodMinorVersion << endmsg;
867  return nullptr;
868  }
869 
870 #ifndef NDEBUG
871  ATH_MSG_DEBUG("Found version " << rodMinorVersion << " of Rod block type " << robBlockType);
872 #endif
873 
874  return blstructs[index].get();
875 }
876 
877 
880  const uint32_t* p, uint32_t n, const CaloGain::CaloGain RequestedGain) const
881 {
882 #ifndef NDEBUG
883  ATH_MSG_DEBUG("Prepare LArRodBlockStructure. Got a fragement of size " << n);
884 #endif
885 
886  //Get version and blocktype form header
887  eformat::helper::Version ver(robFrag.rod_version());
888  const uint16_t rodMinorVersion=ver.minor_version();
889  const uint32_t rodBlockType=robFrag.rod_detev_type()&0xff;
890  LArRodBlockStructure* BlStruct = prepareBlockStructure1 (rodMinorVersion, rodBlockType);
891  if (!BlStruct) {
892  return nullptr;
893  }
894 
895  //BlStruct->dumpFragment(v); // For testing purpose
896  if (!BlStruct->setFragment(p,n)) {
897  constexpr int maxMess = 100;
898  static std::atomic<int> nMess = 1;
899  int thismess = nMess++;
900  if (thismess <= maxMess) {
901  msg(MSG::ERROR) << "Could not set fragment (wrong number of samples in data ?) - container will not be filled" << endmsg;
902  if (thismess == maxMess)
903  msg(MSG::ERROR) << "This message will not be repeated" << endmsg;
904  }
905  return NULL;
906  }
907 #ifndef NDEBUG
908  ATH_MSG_VERBOSE("Set Fragment at address "<< &(p[0]) << " " << p[5]);
909 #endif
910 
911  BlStruct->setGain(RequestedGain); //Will be ignored if BlockStructure does not support fixed gains.
912  //FIXME: Very ugly hack! See explanation in LArRodDecoder.h
913  if (m_firstSample) {
914  BlStruct->setFirstSample(m_firstSample);
915  }
916  return BlStruct;
917 }
918 
919 
920 std::unique_ptr<LArRodBlockStructure>
921 LArRodDecoder::makeBlockStructure (unsigned int rodBlockType,
922  unsigned int rodMinorVersion) const
923 {
924  switch (rodBlockType) {
925  case 2:
926  // RodBlockType 2 = Transparent mode only
927  switch (rodMinorVersion) {
928  case 0: // Transparent mode v0 05.01.2004
929  case 1: // Transparent mode v0
930  case 2: // Transparent mode v0
931  case 3: // Transparent mode v0
932  case 4: // Transparent mode v0
933  return std::make_unique<LArRodBlockTransparentV0<LArRodBlockHeaderTransparentV0> >();
934  case 5: // Calibration (Transparent mode) v1 17.01.2006
935  return std::make_unique<LArRodBlockCalibrationV1>();
936  case 6: // Calibration (Transparent mode) v3 31.05.2006
937  case 7: // Calibration (Transparent mode) v3
938  case 8: // Calibration (Transparent mode) v3
939  case 9: // Calibration (Transparent mode) v3
940  case 10:// Calibration (Transparent mode) v3
941  case 11:// Calibration (Transparent mode) v3
942  case 12:// Calibration (Transparent mode) v3
943  return std::make_unique<LArRodBlockCalibrationV3>();
944  default:
945  break;
946  }
947  break;
948 
949  case 3:
950  // RodBlockType 3 = Test mode
951  return std::make_unique<LArRodBlockTransparentV0<LArRodBlockHeaderTransparentV0> >();
952 
953  case 4:
954  // RodBlockType 4 = Physics mode
955  switch (rodMinorVersion) {
956  case 0: // Physics mode v0 05.01.2004 first draft
957  return std::make_unique<LArRodBlockPhysicsV0>();
958  case 1: // Physics mode v1 19.08.2004 only small differences
959  return std::make_unique<LArRodBlockPhysicsV1>();
960  case 2: // Physics mode v2 05.10.2004 adapted to real DSP data
961  case 3: // Physics mode v2
962  case 4: // Physics mode v2
963  case 5: // Physics mode v2
964  case 6: // Physics mode v2
965  case 7: // Physics mode v2
966  case 8: // Physics mode v2
967  return std::make_unique<LArRodBlockPhysicsV2>();
968  case 9: // Physics mode v4 10.07.2007 for commissioning
969  return std::make_unique<LArRodBlockPhysicsV4>();
970  case 10: // Physics mode v5 16.06.2008 for LHC
971  case 11: // Physics mode v5 16.06.2008 for LHC
972  {
973  auto bl = std::make_unique<LArRodBlockPhysicsV5>();
974  if (m_requiredPhysicsNSamples > 0) {
975  bl->setRequiredNSamples(m_requiredPhysicsNSamples);
976  }
977  return bl;
978  }
979  case 12: // Physics mode v5 09.03.2011 for LHC
980  {
981  auto bl = std::make_unique<LArRodBlockPhysicsV6>();
982  if (m_requiredPhysicsNSamples > 0) {
983  bl->setRequiredNSamples(m_requiredPhysicsNSamples);
984  }
985  return bl;
986  }
987  default:
988  break;
989  }
990  break;
991 
992  case 5:
993  // RodBlockType 5 = Physics simulation mode
994  // Physics mode v3 11.04.2005 for simulation
995  return std::make_unique<LArRodBlockPhysicsV3>();
996 
997  case 6:
998  // RodBlockType 6 = Physics test mode
999  switch (rodMinorVersion) {
1000  case 0: // Physics mode v0 05.01.2004 first draft
1001  return std::make_unique<LArRodBlockPhysicsV0>();
1002  case 1: // Physics mode v2 05.10.2004 adapted to real DSP data
1003  case 2: // Physics mode v2
1004  return std::make_unique<LArRodBlockPhysicsV2>();
1005  default:
1006  break;
1007  }
1008  break;
1009 
1010  case 7:
1011  // RodBlockType 7 = Calibration mode
1012  switch (rodMinorVersion) {
1013  case 0: // Calibration mode v0 05.01.2004
1014  return std::make_unique<LArRodBlockCalibrationV0<LArRodBlockHeaderCalibrationV0> >();
1015  case 1: // Calibration mode v1 17.01.2006
1016  case 2: // Calibration mode v1
1017  case 3: // Calibration mode v1
1018  case 4: // Calibration mode v1
1019  return std::make_unique<LArRodBlockCalibrationV1>();
1020  case 5: // Calibration mode v2 26.04.2006
1021  return std::make_unique<LArRodBlockCalibrationV2>();
1022  case 6: // Calibration mode v3 31.05.2006
1023  case 7: // Calibration mode v3
1024  case 8: // Calibration mode v3
1025  case 9: // Calibration mode v3
1026  case 10:// Calibration mode v3
1027  case 11:// Calibration mode v3
1028  case 12:// Calibration mode v3
1029  return std::make_unique<LArRodBlockCalibrationV3>();
1030  default:
1031  break;
1032  }
1033  break;
1034 
1035  case 10:
1036  // RodBlockType 10 = Accumulated mode (used for pre-processed pedestal runs)
1037  // Accumulated mode v3 10.06.2008
1038  return std::make_unique<LArRodBlockAccumulatedV3>();
1039 
1040  default:
1041  break;
1042  }
1043 
1044  return std::unique_ptr<LArRodBlockStructure>();
1045 }
LArRodBlockStructure
Definition: LArRodBlockStructure.h:48
LArRodBlockCalibrationV2.h
LArRodBlockStructure::getNbSweetCells1
virtual uint16_t getNbSweetCells1() const
Definition: LArRodBlockStructure.cxx:255
LArRodBlockStructure::getNumberOfSamples
virtual uint32_t getNumberOfSamples() const
Definition: LArRodBlockStructure.cxx:245
LArRodBlockStructure::getRadd
virtual uint32_t getRadd(uint32_t adc, uint32_t sample) const
Definition: LArRodBlockStructure.cxx:247
Identifier32
Definition: Identifier32.h:25
LArAccumulatedCalibDigit
Data class for calibration ADC samples preprocessed by the DSP.
Definition: LArAccumulatedCalibDigit.h:42
LArRodBlockStructure::hasAccumBlock
virtual uint32_t hasAccumBlock() const
Definition: LArRodBlockStructure.h:123
LArRodBlockStructure::hasPhysicsBlock
virtual uint32_t hasPhysicsBlock() const
Definition: LArRodBlockStructure.h:124
LArRodDecoder::LArRodDecoder
LArRodDecoder(const std::string &type, const std::string &name, const IInterface *parent)
Constructor Standard AlgTool constructor.
Definition: LArRodDecoder.cxx:40
LArRodDecoder::m_readtdc
bool m_readtdc
Definition: LArRodDecoder.h:222
LArRodDecoder::m_vFinalPreselection
std::vector< unsigned int > m_vFinalPreselection
Definition: LArRodDecoder.h:237
LArRodBlockStructure::getStepIndex
virtual uint16_t getStepIndex() const
Definition: LArRodBlockStructure.h:486
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
LArRodBlockStructure::setGain
virtual int setGain(const int GainValue)
Definition: LArRodBlockStructure.cxx:224
checkCoolLatestUpdate.dg
dg
Definition: checkCoolLatestUpdate.py:9
LArRodBlockStructure::getNbSweetCells2
virtual uint16_t getNbSweetCells2() const
Definition: LArRodBlockStructure.cxx:256
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
LArAccumulatedDigitContainer
Container class for LArAccumulatedDigit.
Definition: LArAccumulatedDigitContainer.h:22
LArRodDecoder::m_onlineHelper
const LArOnlineID * m_onlineHelper
Definition: LArRodDecoder.h:239
LArRodBlockStructure::getNextAccumulatedDigit
virtual int getNextAccumulatedDigit(int &channelNumber, std::vector< uint64_t > &SamplesSum, std::vector< uint64_t > &corr2Sum, uint32_t &gain)
Definition: LArRodBlockStructure.cxx:100
LArRodDecoder::m_CheckSum
bool m_CheckSum
Definition: LArRodDecoder.h:249
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
LArRodDecoder::m_evt
SG::ReadHandleKey< xAOD::EventInfo > m_evt
Definition: LArRodDecoder.h:220
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
index
Definition: index.py:1
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
LArRodDecoder::m_LArCellCorrNames
std::vector< std::string > m_LArCellCorrNames
Definition: LArRodDecoder.h:240
LArRodDecoder.h
LArRodDecoder::m_febExchange
bool m_febExchange
Definition: LArRodDecoder.h:223
initialize
void initialize()
Definition: run_EoverP.cxx:894
LArCalibLineMapping::calibSlotLine
const std::vector< HWIdentifier > & calibSlotLine(const HWIdentifier id) const
Definition: LArCalibLineMapping.cxx:15
LArCalibLineMapping
Definition: LArCalibLineMapping.h:17
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
LArRodBlockStructure::getNTrigger
virtual uint16_t getNTrigger() const
Definition: LArRodBlockStructure.h:480
LArRodBlockStructure::getRawDataSize
virtual uint16_t getRawDataSize() const
Definition: LArRodBlockStructure.cxx:254
skel.it
it
Definition: skel.GENtoEVGEN.py:423
CaloCellCorrection
Definition: CaloCellCorrection.h:51
LArCalibParams
Definition: LArCalibParams.h:28
LArRodBlockStructure::getNStep
virtual uint16_t getNStep() const
Definition: LArRodBlockStructure.h:491
LArRodBlockPhysicsV1.h
LArRodDecoder::m_StatusNMask
uint32_t m_StatusNMask
Definition: LArRodDecoder.h:238
LArRodBlockPhysicsV0.h
LArRodDecoder::interfaceID
static const InterfaceID & interfaceID()
Definition: LArRodDecoder.cxx:71
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
LArFebHeader::SetFormatVersion
void SetFormatVersion(const uint32_t formatVersion)
set the format version
Definition: LArFebHeader.h:101
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
LArRodDecoder::m_IgnoreCheckFEBs
std::vector< unsigned int > m_IgnoreCheckFEBs
Definition: LArRodDecoder.h:241
HWIdentifier
Definition: HWIdentifier.h:13
LArRodBlockPhysicsV2.h
LArRodBlockStructure::hasRawDataBlock
virtual uint32_t hasRawDataBlock() const
Definition: LArRodBlockStructure.h:125
LArFebHeader::SetELVL1Id
void SetELVL1Id(const uint16_t elvl1Id)
set the EventID
Definition: LArFebHeader.h:113
LArRodBlockStructure::getNextEnergy
virtual int getNextEnergy(int &channelNumber, int32_t &energy, int32_t &time, int32_t &quality, uint32_t &gain)
Definition: LArRodBlockStructure.h:456
LArRodDecoder::m_MultiDSPMode
bool m_MultiDSPMode
Definition: LArRodDecoder.h:248
LArRodDecoder::m_vPosNegPreselection
std::vector< int > m_vPosNegPreselection
Definition: LArRodDecoder.h:236
LArRodBlockStructure::getCtrl2
virtual uint16_t getCtrl2(uint32_t adc) const
Definition: LArRodBlockStructure.cxx:249
LArRodBlockPhysicsV5.h
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
LArFebHeader::SetLVL1TigType
void SetLVL1TigType(const uint32_t lvl1ttype)
set the Level1 trigger type ID
Definition: LArFebHeader.h:141
LArRodBlockStructure::offlineCheckSum
virtual uint32_t offlineCheckSum() const
Definition: LArRodBlockStructure.cxx:163
AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore
const ServiceHandle< StoreGateSvc > & detStore() const
The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:95
LArRodBlockStructure::getDspCodeVersion
virtual uint32_t getDspCodeVersion() const
Definition: LArRodBlockStructure.cxx:258
LArRodBlockPhysicsV4.h
LArFebHeader::SetRodRawDataSize
void SetRodRawDataSize(const uint16_t size)
Definition: LArFebHeader.h:125
LArRodDecoder::m_vFTPreselection
std::vector< int > m_vFTPreselection
Definition: LArRodDecoder.h:234
LArRodDecoder::m_delayScale
double m_delayScale
Definition: LArRodDecoder.h:244
LArRodDecoder::m_StatusMask
uint32_t m_StatusMask
Definition: LArRodDecoder.h:238
LArRodDecoder::m_febId1
unsigned int m_febId1
Definition: LArRodDecoder.h:224
LArFebHeader::SetBCId
void SetBCId(const uint16_t bcid)
set the Bunch Crossing ID
Definition: LArFebHeader.h:117
LArCalibDigitContainer::setDelayScale
void setDelayScale(const double scale)
set delay scale
Definition: LArCalibDigitContainer.h:30
Pythia8_A14_NNPDF23LO_Var1Down_Common.ver
ver
Definition: Pythia8_A14_NNPDF23LO_Var1Down_Common.py:26
LArCalibDigitContainer
Container class for LArCalibDigit.
Definition: LArCalibDigitContainer.h:19
LArRodBlockPhysicsV6.h
LArRodDecoder::makeBlockStructure
std::unique_ptr< LArRodBlockStructure > makeBlockStructure(unsigned int rodBlockType, unsigned int rodMinorVersion) const
Definition: LArRodDecoder.cxx:921
LArOnlineID_Base::channel
int channel(const HWIdentifier id) const
Return the channel number of a hardware cell identifier channel = [0,127] in all FEB.
Definition: LArOnlineID_Base.cxx:1967
LArAccumulatedDigit
Data class for ADC samples and autocorr preprocessed by the DSP.
Definition: LArAccumulatedDigit.h:32
LArOnOffIdMapping.h
LArRodBlockStructure::getDspEventCounter
virtual int32_t getDspEventCounter() const
Definition: LArRodBlockStructure.cxx:264
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ParticleGun_FastCalo_ChargeFlip_Config.energy
energy
Definition: ParticleGun_FastCalo_ChargeFlip_Config.py:78
Identifier32::get_compact
value_type get_compact(void) const
Get the compact id.
Definition: Identifier32.h:171
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:88
LArFebHeader::SetFebELVL1Id
void SetFebELVL1Id(const uint16_t elvl1Id)
set the FEB Event ID
Definition: LArFebHeader.h:157
LArDigit
Liquid Argon digit base class.
Definition: LArDigit.h:25
LArRodBlockAccumulatedV3.h
eformat::ROBFragment
Definition: L1CaloBsDecoderUtil.h:12
lumiFormat.i
int i
Definition: lumiFormat.py:92
LArRawChannel
Liquid Argon ROD output object base class.
Definition: LArRawChannel.h:40
ReadCellNoiseFromCool.chan
chan
Definition: ReadCellNoiseFromCool.py:52
LArOnlineID_Base::channelInSlotMax
int channelInSlotMax(const HWIdentifier Id) const
Return the Maximum channel number of a given feb slot.
Definition: LArOnlineID_Base.cxx:286
beamspotman.n
n
Definition: beamspotman.py:731
LArRodBlockPhysicsV3.h
endmsg
#define endmsg
Definition: AnalysisConfig_Ntuple.cxx:63
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
01SubmitToGrid.samples
samples
Definition: 01SubmitToGrid.py:58
LArRodBlockStructure::canSetCalibration
virtual bool canSetCalibration()
Definition: LArRodBlockStructure.h:99
LArFebHeader::SetRunNumber
void SetRunNumber(const uint32_t runNumber)
set the run number
Definition: LArFebHeader.h:109
LArCalibParams::isPulsed
bool isPulsed(const unsigned event, const HWIdentifier calibLineID) const
Definition: LArCalibParams.cxx:167
LArOnlineID_Base::channel_Id
HWIdentifier channel_Id(int barrel_ec, int pos_neg, int feedthrough, int slot, int channel) const
create channel identifier from fields
Definition: LArOnlineID_Base.cxx:1569
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
LArRodDecoder::~LArRodDecoder
virtual ~LArRodDecoder()
Destructor.
Definition: LArRodDecoder.cxx:67
LArRodBlockStructure::hasControlWords
virtual uint32_t hasControlWords() const
Definition: LArRodBlockStructure.h:126
LArRodBlockStructure::getFEBID
uint32_t getFEBID() const
Definition: LArRodBlockStructure.h:297
delay
double delay(std::size_t d)
Definition: JetTrigTimerTest.cxx:14
LArFebHeader::SetDspCodeVersion
void SetDspCodeVersion(const uint32_t codeVersion)
set the version of the DSP code
Definition: LArFebHeader.h:149
LArRodDecoder::m_febId2
unsigned int m_febId2
Definition: LArRodDecoder.h:224
LArFebHeader::SetRodResults2Size
void SetRodResults2Size(const uint16_t size)
Definition: LArFebHeader.h:123
LArFebHeader::SetOnlineChecksum
void SetOnlineChecksum(const uint32_t checksum)
Definition: LArFebHeader.h:135
LArFebHeader
Holds information from the FEB Header.
Definition: LArFebHeader.h:21
LArOnlineID_Base::isValidId
bool isValidId(const HWIdentifier id) const
Returns false if the identifier is not a LAr-online id or any of the sub-fields is out of range.
Definition: LArOnlineID_Base.cxx:1333
LArRodDecoder::m_vBEPreselection
std::vector< int > m_vBEPreselection
Definition: LArRodDecoder.h:235
LArFebHeader::SetDspEventCounter
void SetDspEventCounter(const uint32_t eventCounter)
set the Event number counted by the DSP code
Definition: LArFebHeader.h:153
integrator_ascii2db.dac
dac
Definition: integrator_ascii2db.py:126
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
LArCalibParams::DAC
unsigned DAC(const unsigned event, const HWIdentifier calibLineID) const
Definition: LArCalibParams.cxx:147
LArRodBlockStructure::nextFEB
bool nextFEB()
Definition: LArRodBlockStructure.h:497
LArRodDecoder::fillCollection
void fillCollection(const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment &robFrag, const uint32_t *p, uint32_t n, LArRawChannelContainer &coll, const CaloGain::CaloGain gain) const
Definition: LArRodDecoder.cxx:235
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
LArCalibDigit
Base class for LArDigits taken during calibration runs.
Definition: LArCalibDigit.h:29
LArRodBlockTransparentV0.h
LArFebHeader::SetSourceId
void SetSourceId(const uint32_t sourceID)
set the source Id
Definition: LArFebHeader.h:105
AtlCoolConsole.tool
tool
Definition: AtlCoolConsole.py:453
LArCalibParams::Delay
unsigned Delay(const unsigned event, const HWIdentifier calibLineID) const
Definition: LArCalibParams.cxx:128
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
LArRodDecoder::m_LArCellEthreshold
float m_LArCellEthreshold
Definition: LArRodDecoder.h:221
xAOD::bcid
setEventNumber setTimeStamp bcid
Definition: EventInfo_v1.cxx:133
LArRodBlockStructure::getResults2Size
virtual uint16_t getResults2Size() const
Definition: LArRodBlockStructure.cxx:253
CaloGain::CaloGain
CaloGain
Definition: CaloGain.h:11
LArFebHeader::SetRodResults1Size
void SetRodResults1Size(const uint16_t size)
set the ROD block sizes
Definition: LArFebHeader.h:121
LArFebHeader::SetFebCtrl2
void SetFebCtrl2(const uint16_t ctrl2)
set the FEB Control Word #2
Definition: LArFebHeader.h:169
LArNewCalib_Delay_OFC_Cali.FT
FT
Definition: LArNewCalib_Delay_OFC_Cali.py:120
LArRodBlockStructure.h
DeMoScan.index
string index
Definition: DeMoScan.py:362
LArCalibParams.h
LArRodDecoder::prepareBlockStructure
LArRodBlockStructure * prepareBlockStructure(const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment &robFrag, const uint32_t *p, uint32_t n, const CaloGain::CaloGain RequestedGain) const
Definition: LArRodDecoder.cxx:879
LArFebHeader::SetNbSamples
void SetNbSamples(const uint16_t n)
Definition: LArFebHeader.h:133
LArFebHeader::SetFebSCA
void SetFebSCA(const uint16_t sca)
set the SCA's
Definition: LArFebHeader.h:181
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
LArRodBlockStructure::getNextRawData
virtual int getNextRawData(int &channelNumber, std::vector< short > &samples, uint32_t &gain)
Definition: LArRodBlockStructure.cxx:88
LArRodBlockStructure::getCtrl3
virtual uint16_t getCtrl3(uint32_t adc) const
Definition: LArRodBlockStructure.cxx:250
LArRodBlockStructure::getStatus
virtual uint32_t getStatus() const
Definition: LArRodBlockStructure.cxx:251
LArFebHeader::SetFebCtrl3
void SetFebCtrl3(const uint16_t ctrl3)
set the FEB Control Word #3
Definition: LArFebHeader.h:173
LArRodBlockStructure::getCtrl1
virtual uint16_t getCtrl1(uint32_t adc) const
Definition: LArRodBlockStructure.cxx:248
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
LArFebHeader::SetNbSweetCells2
void SetNbSweetCells2(const uint16_t n)
Definition: LArFebHeader.h:131
LArRodBlockStructure::setFragment
bool setFragment(const uint32_t *p, uint32_t n)
Definition: LArRodBlockStructure.h:252
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
LArRodBlockStructure::getDelay
virtual uint16_t getDelay() const
Definition: LArRodBlockStructure.h:474
LArRodBlockStructure::hasCalibBlock
virtual uint32_t hasCalibBlock() const
Definition: LArRodBlockStructure.h:122
LArDigitContainer
Container class for LArDigit.
Definition: LArDigitContainer.h:24
LArRodBlockStructure::getDAC
virtual uint16_t getDAC() const
Definition: LArRodBlockStructure.h:468
LArRodBlockStructure::getNextAccumulatedCalibDigit
virtual int getNextAccumulatedCalibDigit(int &channelNumber, std::vector< uint64_t > &SamplesSum, std::vector< uint64_t > &Samples2Sum, uint32_t &nStepTriggers, uint32_t &gain)
Definition: LArRodBlockStructure.cxx:94
LArFebHeaderContainer
Container class for LArFebHeader.
Definition: LArFebHeaderContainer.h:20
python.SystemOfUnits.ns
int ns
Definition: SystemOfUnits.py:130
LArRodBlockStructure::onlineCheckSum
virtual uint32_t onlineCheckSum() const
Definition: LArRodBlockStructure.cxx:155
merge.status
status
Definition: merge.py:17
LArRodDecoder::m_requiredPhysicsNSamples
unsigned short m_requiredPhysicsNSamples
Definition: LArRodDecoder.h:250
LArRodBlockStructure::getPulsed
virtual bool getPulsed(unsigned channelNumber) const
Definition: LArRodBlockStructure.h:462
ATLAS_NOT_THREAD_SAFE
StatusCode LArRodDecoder::initialize ATLAS_NOT_THREAD_SAFE()
Install fatal handler with default options.
Definition: LArRodDecoder.cxx:75
LArFebHeader::SetFebBCId
void SetFebBCId(const uint16_t bcid)
set the FEB Bunch Crossing ID
Definition: LArFebHeader.h:161
AthAlgTool
Definition: AthAlgTool.h:26
LArFebHeader::SetFebCtrl1
void SetFebCtrl1(const uint16_t ctrl1)
set the FEB Control Word #1
Definition: LArFebHeader.h:165
Identifier::get_identifier32
Identifier32 get_identifier32(void) const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
LArRodDecoder::prepareBlockStructure1
LArRodBlockStructure * prepareBlockStructure1(const uint16_t rodMinorVersion, const uint32_t robBlockType) const
Definition: LArRodDecoder.cxx:845
LArRodDecoder::m_firstSample
int m_firstSample
Definition: LArRodDecoder.h:226
LArCalibLineMapping.h
LArFebHeader::SetDetEventType
void SetDetEventType(const uint32_t detEvType)
set the Detector event type ID
Definition: LArFebHeader.h:145
LArAccumulatedCalibDigitContainer
Container class for LArAccumulatedCalibDigit.
Definition: LArAccumulatedCalibDigitContainer.h:25
LArRodBlockStructure::getResults1Size
virtual uint16_t getResults1Size() const
Definition: LArRodBlockStructure.cxx:252
LArFebHeader::SetRodStatus
void SetRodStatus(const uint32_t status)
set the ROD Status
Definition: LArFebHeader.h:177
LArFebHeader::SetNbSweetCells1
void SetNbSweetCells1(const uint16_t n)
set the number of samples and cells above thresholds
Definition: LArFebHeader.h:129
LArRodBlockCalibrationV1.h
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
LArOnOffIdMapping::isOnlineConnected
bool isOnlineConnected(const HWIdentifier &sid) const
Test whether a HWIdentifier is connected of not (inline)
Definition: LArOnOffIdMapping.h:121
LArRodBlockCalibrationV0.h
LArFebHeader::SetOfflineChecksum
void SetOfflineChecksum(const uint32_t checksum)
Definition: LArFebHeader.h:137
LArOnlineID_Base::feedthrough_Id
HWIdentifier feedthrough_Id(int barrel_ec, int pos_neg, int feedthrough) const
Create a feedthrough identifier from fields.
Definition: LArOnlineID_Base.cxx:1404
LArRawChannelContainer
Container for LArRawChannel (IDC using LArRawChannelCollection)
Definition: LArRawChannelContainer.h:26
LArRodBlockStructure::setFirstSample
void setFirstSample(const int rearrangeFirstSample)
Definition: LArRodBlockStructure.h:168
LArOnOffIdMapping
Definition: LArOnOffIdMapping.h:20
LArRodBlockCalibrationV3.h