ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Types | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
TBByteStreamCnvTool Class Reference

An AlgTool class to provide conversion ByteStream <-> TestBeam Instrumentation Data created Feb 2004 Walter Lampl. More...

#include <TBByteStreamCnvTool.h>

Inheritance diagram for TBByteStreamCnvTool:
Collaboration diagram for TBByteStreamCnvTool:

Public Member Functions

 TBByteStreamCnvTool (const std::string &type, const std::string &name, const IInterface *parent)
 constructor More...
 
virtual StatusCode initialize ()
 
virtual StatusCode finalize ()
 
StatusCode WriteFragment ()
 
StatusCode ReadFragment (int unrec_code)
 
StatusCode ReadFragment (TBTDC *&tdc, const std::string &key)
 
StatusCode ReadFragment (TBTDCRawCont *&tdcrawCont, const std::string &key)
 
StatusCode ReadFragment (TBADCRawCont *&adcrawCont, const std::string &key)
 
StatusCode ReadFragment (TBBPCRawCont *&bpcrawCont, const std::string &key)
 
StatusCode ReadFragment (TBMWPCRawCont *&mwpcrawCont, const std::string &key)
 
StatusCode ReadFragment (TBTriggerPatternUnit *&trigpat, const std::string &key)
 
StatusCode ReadFragment (TBScintillatorRawCont *&scintrawCont, const std::string &key)
 
StatusCode ReadFragment (TBTailCatcherRaw *&tailcatchraw, const std::string &key)
 
StatusCode ReadFragment (TBEventInfo *&tbeventinfo, const std::string &key)
 
StatusCode ReadFragment (TBLArDigitContainer *&tblardigitcont, const std::string &key)
 
StatusCode ReadFragment (TBLArCalibDigitContainer *&tblarcalibdigitcont, const std::string &key)
 
StatusCode BuildRODBlock (std::vector< uint32_t > *theRODBlock)
 
StatusCode GetRODBlock (eformat::SubDetector subdet_id, eformat::SubDetector subdet_rod_id=m_DontCheckRodSubDetID)
 
StatusCode H6BuildObjects (int unrec_code)
 
StatusCode H6RecordObjects (int unrec_code)
 
StatusCode H8BuildObjects (int unrec_code)
 
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & evtStore () const
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc. More...
 
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc. More...
 
virtual StatusCode sysInitialize () override
 Perform system initialization for an algorithm. More...
 
virtual StatusCode sysStart () override
 Handle START transition. More...
 
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles. More...
 
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles. More...
 
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T > &t)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &)
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &)
 Declare a new Gaudi property. More...
 
Gaudi::Details::PropertyBase * declareProperty (const std::string &name, T &property, const std::string &doc="none")
 Declare a new Gaudi property. More...
 
void updateVHKA (Gaudi::Details::PropertyBase &)
 
MsgStream & msg () const
 
MsgStream & msg (const MSG::Level lvl) const
 
bool msgLvl (const MSG::Level lvl) const
 

Static Public Member Functions

static const InterfaceID & interfaceID ()
 

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution More...
 
std::enable_if_t< std::is_void_v< std::result_of_t< decltype(&T::renounce)(T)> > &&!std::is_base_of_v< SG::VarHandleKeyArray, T > &&std::is_base_of_v< Gaudi::DataHandle, T >, void > renounce (T &h)
 
void extraDeps_update_handler (Gaudi::Details::PropertyBase &ExtraDeps)
 Add StoreName to extra input/output deps as needed. More...
 

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t
 

Private Member Functions

bool NextSubFrag ()
 
CaloGain::CaloGain getCaloGain (int gain)
 
unsigned short firstword (unsigned int w)
 
unsigned short secondword (unsigned int w)
 
unsigned short firstnbit (int n, unsigned short w)
 
bool testbit (int n, unsigned short w)
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleKeyArrayType &)
 specialization for handling Gaudi::Property<SG::VarHandleKeyArray> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &hndl, const SG::VarHandleType &)
 specialization for handling Gaudi::Property<SG::VarHandleBase> More...
 
Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T > &t, const SG::NotHandleType &)
 specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray> More...
 

Private Attributes

ByteStreamCnvSvcm_ByteStreamEventAccess
 
IROBDataProviderSvcm_rdpSvc
 
EventID m_lastEventID
 
eformat::SubDetector m_subdet_id
 
std::vector< uint32_t > m_rodBlock
 
const LArOnlineIDm_onlineHelper
 
std::vector< uint32_t > * m_theRodBlock
 
OFFLINE_FRAGMENTS_NAMESPACE_WRITE::ROBFragmentm_theROB
 
bool m_H6run
 
bool m_H8run
 
bool m_force_Hchoice
 
bool m_dump
 
std::vector< std::string > m_keys
 
int m_subdet_key
 
int m_subfrag_id
 
int m_subfrag_size
 
int m_subfrag_firstdata
 
SG::ReadCondHandleKey< LArCalibLineMappingm_CLKey {this, "CalibLineKey", "LArCalibLineMap", "SG calib line key"}
 
TBTDCm_tbtdc
 
TBTDCRawContm_tdcrawCont
 
TBADCRawContm_adcrawCont
 
TBBPCRawContm_bpcrawCont
 
TBMWPCRawContm_mwpcrawCont
 
TBTriggerPatternUnitm_trigpat
 
TBScintillatorRawContm_scintrawCont
 
TBTailCatcherRawm_tailcatchraw
 
TBEventInfom_eventinfo
 
TBLArDigitContainerm_tblardigitcont [4]
 
TBLArCalibDigitContainerm_tblarcalibdigitcont [4]
 
std::vector< int > m_boards
 
std::vector< int > m_samples
 
std::vector< int > m_gains
 
std::vector< int > m_febgain
 
std::vector< int > m_firstsamples
 
std::vector< short > m_arrayofsample [128][4]
 
CaloGain::CaloGain m_arrayofgain [128][4]
 
bool m_isCalib
 
unsigned char m_calib_pattern [16]
 
uint16_t m_calib_dac
 
uint16_t m_calib_delay
 
bool m_calib_error
 
int m_ev_number
 
unsigned int m_run_num
 
float m_beam_moment
 
std::string m_beam_part
 
float m_cryoX
 
float m_cryoAngle
 
float m_tableY
 
std::string m_summary_path
 
unsigned int m_h8_triggword
 
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default) More...
 
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default) More...
 
std::vector< SG::VarHandleKeyArray * > m_vhka
 
bool m_varHandleArraysDeclared
 

Static Private Attributes

static const eformat::SubDetector m_DontCheckRodSubDetID =(eformat::SubDetector)0xff
 

Detailed Description

An AlgTool class to provide conversion ByteStream <-> TestBeam Instrumentation Data created Feb 2004 Walter Lampl.

Definition at line 47 of file TBByteStreamCnvTool.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< AlgTool > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ TBByteStreamCnvTool()

TBByteStreamCnvTool::TBByteStreamCnvTool ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

constructor

Definition at line 40 of file TBByteStreamCnvTool.cxx.

42  : AthAlgTool(type,name,parent), m_lastEventID(0, UINT_MAX), m_subdet_id(eformat::TDAQ_BEAM_CRATE),
43  m_theRodBlock(0), m_theROB(0)
44 {
45  declareInterface< TBByteStreamCnvTool >( this );
46  m_tbtdc=0;
47  declareProperty("ForceHchoice",m_force_Hchoice=false);
48  declareProperty("Dump",m_dump=false);
49  declareProperty("isH6Run",m_H6run=true);
50  declareProperty("isH8Run",m_H8run=false);
51  declareProperty("Keys",m_keys);
52  declareProperty("SubDetID",m_subdet_key);
53  declareProperty("SummaryPath",m_summary_path);
54 
55 }

Member Function Documentation

◆ BuildRODBlock()

StatusCode TBByteStreamCnvTool::BuildRODBlock ( std::vector< uint32_t > *  theRODBlock)

Build a ROD data block for all Beam detector classes found in SG. Working only with TBTDC class for testing

Definition at line 221 of file TBByteStreamCnvTool.cxx.

222 {
226  MsgStream logstr(msgSvc(), name());
227  //Get necessary Data objects
228  StatusCode sc;
229 
230  // TBTDCRaw part of the block :
231  const TBTDC* tbtdc = nullptr;
232  std::string tbtdc_Key("TBTDC");
233  sc=evtStore()->retrieve(tbtdc,tbtdc_Key);
234  if (sc!=StatusCode::SUCCESS)
235  {logstr << MSG::ERROR << "Can't retrieve TBTDC with key "<< tbtdc_Key << " from StoreGate" << endmsg;
236  return sc;
237  }
238  else {
239  theRodBlock->push_back(4); // TIME_SIZE
240  theRodBlock->push_back(0x03); // TIME_ID
241  theRodBlock->push_back(tbtdc->tdc());
242  theRodBlock->push_back(tbtdc->tdcmin());
243  }
244 
245 
246  // TBBPCRaw :
247 // TBBPCRawCont * bpcrawCont;
248 // sc = m_storeGate->retrieve(bpcrawCont, "BPCRawCont");
249 // if (sc.isFailure()){
250 // logstr << MSG::DEBUG << "BeamDetectorMonitoring: Retrieval of BPCRaw failed" << endmsg;
251 // }else {
252 // TBBPCRawCont::const_iterator it_bc = bpcrawCont->begin();
253 // TBBPCRawCont::const_iterator last_bc = bpcrawCont->end();
254 // // theRodBlock->push_back(2+bpcrawCont->size()*6); // BPC_SIZE
255 // // theRodBlock->push_back(0x05); // BPC_ID (BPCRaw)
256 
257 // for(it_bc= bpcrawCont->begin();it_bc!=last_bc;it_bc++){
258 // // theRodBlock->push_back((*it_bc)->getSignal((int) TBBPCRaw::tdcLeft));
259 // // theRodBlock->push_back((*it_bc)->getSignal((int) TBBPCRaw::tdcRight));
260 // // theRodBlock->push_back((*it_bc)->getSignal((int) TBBPCRaw::tdcUp));
261 // // theRodBlock->push_back((*it_bc)->getSignal((int) TBBPCRaw::tdcDown));
262 // // theRodBlock->push_back((*it_bc)->getSignal((int) TBBPCRaw::adcHorizontal));
263 // // theRodBlock->push_back((*it_bc)->getSignal((int) TBBPCRaw::adcVertical));
264 // }
265 // }
266 
267  // Trigger Pattern :
268 // TBTriggerPatternUnit *trigpat;
269 // sc = m_storeGate->retrieve(trigpat, "TBTrigPat");
270 // if (sc.isFailure()){
271 // logstr << MSG::DEBUG << "BeamDetectorMonitoring: Retrieval of TrigPat failed" << endmsg;
272 
273 // }else {
274 // theRodBlock->push_back(3); // TrigPat_SIZE
275 // theRodBlock->push_back(0x01); // TrigPat_ID (TrigPatRaw)
276 // theRodBlock->push_back(trigpat->getTriggerWord());
277 // }
278 
279 
280  return StatusCode::SUCCESS;
281 }

◆ declareGaudiProperty() [1/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyArrayType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKeyArray>

Definition at line 170 of file AthCommonDataStore.h.

172  {
173  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
174  hndl.value(),
175  hndl.documentation());
176 
177  }

◆ declareGaudiProperty() [2/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleKeyType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleKey>

Definition at line 156 of file AthCommonDataStore.h.

158  {
159  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
160  hndl.value(),
161  hndl.documentation());
162 
163  }

◆ declareGaudiProperty() [3/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  hndl,
const SG::VarHandleType  
)
inlineprivateinherited

specialization for handling Gaudi::Property<SG::VarHandleBase>

Definition at line 184 of file AthCommonDataStore.h.

186  {
187  return *AthCommonDataStore<PBASE>::declareProperty(hndl.name(),
188  hndl.value(),
189  hndl.documentation());
190  }

◆ declareGaudiProperty() [4/4]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareGaudiProperty ( Gaudi::Property< T > &  t,
const SG::NotHandleType  
)
inlineprivateinherited

specialization for handling everything that's not a Gaudi::Property<SG::VarHandleKey> or a <SG::VarHandleKeyArray>

Definition at line 199 of file AthCommonDataStore.h.

200  {
201  return PBASE::declareProperty(t);
202  }

◆ declareProperty() [1/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleBase hndl,
const std::string &  doc,
const SG::VarHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleBase. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 245 of file AthCommonDataStore.h.

249  {
250  this->declare(hndl.vhKey());
251  hndl.vhKey().setOwner(this);
252 
253  return PBASE::declareProperty(name,hndl,doc);
254  }

◆ declareProperty() [2/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKey hndl,
const std::string &  doc,
const SG::VarHandleKeyType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
hndlObject holding the property value.
docDocumentation string for the property.

This is the version for types that derive from SG::VarHandleKey. The property value object is put on the input and output lists as appropriate; then we forward to the base class.

Definition at line 221 of file AthCommonDataStore.h.

225  {
226  this->declare(hndl);
227  hndl.setOwner(this);
228 
229  return PBASE::declareProperty(name,hndl,doc);
230  }

◆ declareProperty() [3/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
SG::VarHandleKeyArray hndArr,
const std::string &  doc,
const SG::VarHandleKeyArrayType  
)
inlineinherited

Definition at line 259 of file AthCommonDataStore.h.

263  {
264 
265  // std::ostringstream ost;
266  // ost << Algorithm::name() << " VHKA declareProp: " << name
267  // << " size: " << hndArr.keys().size()
268  // << " mode: " << hndArr.mode()
269  // << " vhka size: " << m_vhka.size()
270  // << "\n";
271  // debug() << ost.str() << endmsg;
272 
273  hndArr.setOwner(this);
274  m_vhka.push_back(&hndArr);
275 
276  Gaudi::Details::PropertyBase* p = PBASE::declareProperty(name, hndArr, doc);
277  if (p != 0) {
278  p->declareUpdateHandler(&AthCommonDataStore<PBASE>::updateVHKA, this);
279  } else {
280  ATH_MSG_ERROR("unable to call declareProperty on VarHandleKeyArray "
281  << name);
282  }
283 
284  return p;
285 
286  }

◆ declareProperty() [4/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc,
const SG::NotHandleType  
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This is the generic version, for types that do not derive from SG::VarHandleKey. It just forwards to the base class version of declareProperty.

Definition at line 333 of file AthCommonDataStore.h.

337  {
338  return PBASE::declareProperty(name, property, doc);
339  }

◆ declareProperty() [5/6]

Gaudi::Details::PropertyBase* AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
)
inlineinherited

Declare a new Gaudi property.

Parameters
nameName of the property.
propertyObject holding the property value.
docDocumentation string for the property.

This dispatches to either the generic declareProperty or the one for VarHandle/Key/KeyArray.

Definition at line 352 of file AthCommonDataStore.h.

355  {
356  typedef typename SG::HandleClassifier<T>::type htype;
357  return declareProperty (name, property, doc, htype());
358  }

◆ declareProperty() [6/6]

Gaudi::Details::PropertyBase& AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty ( Gaudi::Property< T > &  t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145  {
146  typedef typename SG::HandleClassifier<T>::type htype;
148  }

◆ detStore()

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::detStore ( ) const
inlineinherited

The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 95 of file AthCommonDataStore.h.

95 { return m_detStore; }

◆ evtStore() [1/2]

ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( )
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 85 of file AthCommonDataStore.h.

85 { return m_evtStore; }

◆ evtStore() [2/2]

const ServiceHandle<StoreGateSvc>& AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore ( ) const
inlineinherited

The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.

Definition at line 90 of file AthCommonDataStore.h.

90 { return m_evtStore; }

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::extraDeps_update_handler ( Gaudi::Details::PropertyBase &  ExtraDeps)
protectedinherited

Add StoreName to extra input/output deps as needed.

use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given

◆ finalize()

StatusCode TBByteStreamCnvTool::finalize ( )
virtual

Definition at line 152 of file TBByteStreamCnvTool.cxx.

153 {
154  return StatusCode::SUCCESS;
155 }

◆ firstnbit()

unsigned short TBByteStreamCnvTool::firstnbit ( int  n,
unsigned short  w 
)
inlineprivate

Definition at line 197 of file TBByteStreamCnvTool.h.

197  {
198  unsigned short tmp=0;
199  for(unsigned short i=0;i<n;i++) tmp = tmp | (1<<i);
200  return (w & tmp);
201  }

◆ firstword()

unsigned short TBByteStreamCnvTool::firstword ( unsigned int  w)
inlineprivate

Definition at line 190 of file TBByteStreamCnvTool.h.

190  {
191  return 65535 & w;
192  }

◆ getCaloGain()

CaloGain::CaloGain TBByteStreamCnvTool::getCaloGain ( int  gain)
inlineprivate

Definition at line 150 of file TBByteStreamCnvTool.h.

150  {
151  switch(gain){
152  case 0:
153  return CaloGain::LARLOWGAIN;
154  case 1:
156  case 2:
157  return CaloGain::LARHIGHGAIN;
158  default:
159  return CaloGain::UNKNOWNGAIN;
160  }
161  }

◆ GetRODBlock()

StatusCode TBByteStreamCnvTool::GetRODBlock ( eformat::SubDetector  subdet_id,
eformat::SubDetector  subdet_rod_id = m_DontCheckRodSubDetID 
)

Definition at line 425 of file TBByteStreamCnvTool.cxx.

428 {MsgStream logstr(msgSvc(), name());
429  logstr << MSG::DEBUG << "GetRODBlock" << endmsg;
430  if (!m_rdpSvc)
431  {logstr << MSG::ERROR << "ROBDataProviderSvc not loaded. Can't read ByteStream" << endmsg;
432  return StatusCode::FAILURE;
433  }
434 
435  const RawEvent* re = m_rdpSvc->getEvent();
436 
437  if (!re)
438  {logstr <<MSG::FATAL << "Can't get RawEvent!" << endmsg;
439  return StatusCode::FAILURE;
440  }
441 
442  const size_t MAX_ROBFRAGMENTS = 2048*1024;
443  OFFLINE_FRAGMENTS_NAMESPACE::PointerType robF[MAX_ROBFRAGMENTS];
444  size_t robcount = re->children(robF,MAX_ROBFRAGMENTS);
445  // re->start(robF);
446  if (robcount == MAX_ROBFRAGMENTS)
447  {
448  logstr <<MSG::FATAL << "ROB buffer overflow" << endmsg;
449  return StatusCode::FAILURE;
450  }
451 
452  for (size_t irob=0; irob<robcount; ++irob) //Loop over all ROB-Fragments
453  {
455 
456  logstr << MSG::DEBUG << "ROB Frag *****************************" << endmsg;
457  MSG::hex(logstr) << MSG::DEBUG <<"Marker : " << rob.marker() << endmsg;
458  MSG::hex(logstr) << MSG::DEBUG <<"Frag Size : " << rob.fragment_size_word() << endmsg;
459  MSG::hex(logstr) << MSG::DEBUG <<"Header Size: " << rob.header_size_word() << endmsg;
460  MSG::hex(logstr) << MSG::DEBUG <<"Source ID : " << rob.source_id() << endmsg;
461  MSG::hex(logstr) << MSG::DEBUG <<"Version : " << rob.version() << endmsg;
462  try
463  {
464  rob.check();
465  }
466  catch (...)
467  {
468  logstr << MSG::ERROR << "Got invalid ROB fragment!" << endmsg;
469  return StatusCode::FAILURE;
470  }
471 
472  logstr << MSG::DEBUG << "ROD Frag *****************************" << endmsg;
473  MSG::hex(logstr) << MSG::DEBUG <<"Frag Size : " << rob.rod_fragment_size_word() << endmsg;
474  MSG::hex(logstr) << MSG::DEBUG <<"Header Size: " << rob.rod_header_size_word() << endmsg;
475  MSG::hex(logstr) << MSG::DEBUG <<"Source ID : " << rob.rod_source_id() << endmsg;
476  MSG::hex(logstr) << MSG::DEBUG <<"Run num : " << rob.rod_run_no() << endmsg;
477  MSG::hex(logstr) << MSG::DEBUG <<"Version : " << rob.rod_version() << endmsg;
478 
479  eformat::helper::SourceIdentifier rod_sid(rob.rod_source_id());
480  if (subdet_rod_id==m_DontCheckRodSubDetID || rod_sid.subdetector_id()==subdet_rod_id)
481  {
482  MSG::hex(logstr) << MSG::DEBUG << "Found requested ROD (id="
483  << rod_sid.subdetector_id() << ")" << endmsg;
484  // Set H6 or H8 mode :
485  if (!m_force_Hchoice)
486  {
487  logstr<< MSG::INFO << "Guessing from ROD header -> " ;
488  if (rob.rod_detev_type()&1)
489  {
490  logstr<< " H6 !" << endmsg;
491  m_H6run = true;
492  m_H8run = false;
493  }
494  else
495  {
496  logstr<< " H8 !" << endmsg;
497  m_H6run = false;
498  m_H8run = true;
499  }
500  }
501  m_h8_triggword = rob.rod_lvl1_trigger_type();
502  // Event number ?
503  m_ev_number = rob.rod_lvl1_id();
504  if(m_dump) MSG::dec(logstr) << MSG::INFO << " Ev. number(header)=" << m_ev_number <<endmsg;
505 
507  rob.rod_data(rodPointer);
508  m_rodBlock.clear();
509  for(size_t i=0; i<rob.rod_ndata(); ++i)
510  {
511  m_rodBlock.push_back(*rodPointer);
512  ++rodPointer;
513  }
514 
515  if (m_rodBlock.size()==0)
516  {
517  logstr << MSG::FATAL << "Error reading bytestream event: "
518  << "Empty ROD block" << endmsg;
519  return StatusCode::FAILURE;
520  }
521  logstr << MSG::DEBUG << "Got Rod Block for Test Beam Instrumentation data from ByteStream" << endmsg;
522  return StatusCode::SUCCESS;
523  }// end if requested ROD
524  }//end loop over ROBs
525 
526  MSG::hex(logstr) << MSG::WARNING << " Didn't find SubDet ID for Beam Instruments. Should be "<< subdet_id<<endmsg;
527  return StatusCode::FAILURE;
528 }

◆ H6BuildObjects()

StatusCode TBByteStreamCnvTool::H6BuildObjects ( int  unrec_code)

Build all beam detectors raw objects from m_rodBlock using H6 convention. Objects are recorded in SG if they do not correspond to unrec_code Will return faillure if : -one of the object could not be recorded in SG -the requested object (unrec_code) was not found

Definition at line 532 of file TBByteStreamCnvTool.cxx.

535 {
543  MsgStream logstr(msgSvc(), name());
544  logstr << MSG::DEBUG << "H6BuildObject called for " << unrec_code<< endmsg;
545 
546  const EventContext& ctx = Gaudi::Hive::currentContext();
547 
548  StatusCode sc=StatusCode::FAILURE;
549  //bool gotobject=false;
550  //bool recordfailure=false;
551 
552  // for string conversion
553  std::ostringstream os;
554 
555  // Get ROD block.
556  sc=GetRODBlock(m_subdet_id); //Possible improvement: Check if vector is already valid.
557  if (sc!=StatusCode::SUCCESS)
558  return sc;
559  if (m_rodBlock.size()<2)
560  {MsgStream logstr(msgSvc(), name());
561  logstr << MSG::ERROR << "ReadRodBlock: RodBlock too small!" << endmsg;
562  return StatusCode::FAILURE;
563  }
564 
565 
566 
567 
569  m_tailcatchraw = 0;
570  m_bpcrawCont = new TBBPCRawCont();
573 
574  for(int i=0;i<4;i++) m_tblardigitcont[i] = new TBLArDigitContainer();
575  for(int i=0;i<4;i++) m_tblarcalibdigitcont[i] = new TBLArCalibDigitContainer();
576 
577  std::string name1,name2;
578  m_tdcrawCont = new TBTDCRawCont();
579  TBTDCRaw* dummytdc = new TBTDCRaw("dummy",true,0,true);
580  m_tdcrawCont->push_back(dummytdc);
581 
582  m_adcrawCont = new TBADCRawCont();
583  TBADCRaw* dummyadc = new TBADCRaw("dummy",true,0);
584  m_adcrawCont->push_back(dummyadc);
585 
587 
588 
589  // with this initialisation, first call of NextSubFrag will initialise correctly the index :
590  m_subfrag_id=0;
591  m_subfrag_size=2;
593  while(NextSubFrag()){
594  MSG::dec(logstr) << MSG::DEBUG << "size "<<m_subfrag_size<<endmsg;
595  MSG::hex(logstr) << MSG::DEBUG << "ID "<< m_subfrag_id<<endmsg;
596  switch(m_subfrag_id){
597  case 0x01: // HEADER_ID -----------------------------------------
598  {
599  logstr << MSG::DEBUG << "H6BuildObject : HEADER_ID "<< m_subfrag_size << endmsg;
600  //m_trigpat = new TBTriggerPatternUnit();
602  MSG::hex(logstr) << MSG::DEBUG << "Header "<<m_rodBlock[m_subfrag_firstdata];
603  MSG::hex(logstr) <<" "<<m_rodBlock[m_subfrag_firstdata+1];
604  MSG::hex(logstr) <<" "<<m_rodBlock[m_subfrag_firstdata+2];
605  MSG::hex(logstr) <<" "<<m_rodBlock[m_subfrag_firstdata+3]<<endmsg;
606  // if(unrec_code == 30 ) gotobject=true;
607  if(m_dump) MSG::dec(logstr) << MSG::INFO << " Ev. number(0x01)="<< m_rodBlock[m_subfrag_firstdata] <<endmsg;
611  m_run_num,
613  m_beam_part,
614  m_cryoX,
615  m_cryoAngle,
616  m_tableY);
617  }
618  break;
619 
620  case 0x02: // MINI-ROD Data Fragment ... oh what fun ... ------------
621  {
622  logstr << MSG::DEBUG << " Found mini-ROD data in beam crate fragment, size " << m_subfrag_size << endmsg;
623 
624  // bool calibdigit_requested = (unrec_code==20)||(unrec_code==21)||(unrec_code==22)||(unrec_code==23);
625  //
626  short m_feedthrough[8] = {0,0,0,0,1,1,1,1};
627  int m_sampleOrder[32] = {
628  0,1,2,3,4,5,6,7,8,9,10,
629  11,12,13,14,15,16,17,18,19,20,
630  21,22,23,24,25,26,27,28,29,30,
631  31};
632  int m_sort[64] = { 55, 39, 23, 7, 119, 103, 87, 71,
633  54, 38, 22, 6, 118, 102, 86, 70,
634  53, 37, 21, 5, 117, 101, 85, 69,
635  52, 36, 20, 4, 116, 100, 84, 68,
636  51, 35, 19, 3, 115, 99, 83, 67,
637  50, 34, 18, 2, 114, 98, 82, 66,
638  49, 33, 17, 1, 113, 97, 81, 65,
639  48, 32, 16, 0, 112, 96, 80, 64
640  } ;
641 
642 
643  constexpr short m_slot[8]={5,7,9,11,3,4,5,6};
644 
645  constexpr int NWREC = 8;
647  for(unsigned int nfeb=0;nfeb<m_boards.size();nfeb++){ // FEB loop ----------------------------------
648  pos += NWREC*3; // skip FEB header
649  if(m_dump) logstr << MSG::DEBUG << " Board "<< nfeb << endmsg;
650  for(int s=0;s<m_samples[0];s++){ // sample loop ----------------------------------
651  pos +=NWREC;
652  int samp;
653  for(unsigned int g=0;g<m_gains.size();g++){ // gain loop ----------------------------------
654  int gainmode;
655 
656  // According to 'FebAuto' keys, sort sample (cf Petr G. doc)
657  if(m_febgain[nfeb]==0){ // Default behavior
658  gainmode=m_gains[g];
659  if((gainmode==0)&&((m_sampleOrder[0]=m_firstsamples[0])!=0))
660  {
661  for(int j=0;j<m_firstsamples[0];j++) {m_sampleOrder[j+1]=j;}
662  }
663  }
664  else { // this FEB is AutoGain and first sample given in m_febgain
665  gainmode=0;
666  if((m_sampleOrder[0]=m_febgain[nfeb])!=0){
667  for(int j=0;j<m_febgain[nfeb];j++) {m_sampleOrder[j+1]=j;}
668  }
669  }
670  samp=m_sampleOrder[s];
671 
672  if(m_dump&&(gainmode==2)) logstr << MSG::DEBUG << " channels ";
673  for( int i= 0 ;i<64; i++){ // channel loop ----------------------------------
674  int chan= m_sort[i];
675 
676  unsigned short tmp1 = firstword(m_rodBlock[pos]);
677  unsigned short gain1 = ((tmp1>>12)&3) - 1;
678  m_arrayofsample[chan+8][gainmode][samp]=firstnbit(12,tmp1);
679 
680  unsigned short tmp2 = secondword(m_rodBlock[pos]);
681  unsigned short gain2 = ((tmp2>>12)&3) - 1;
682  m_arrayofsample[chan][gainmode][samp]=firstnbit(12,tmp2);
683 
684  m_arrayofgain[chan+8][gainmode] = getCaloGain(gain1);
685  m_arrayofgain[chan][gainmode] = getCaloGain(gain2);
686 
687 
688  // if(m_dump&(gainmode==2)) logstr << MSG::INFO << " " <<firstnbit(12,tmp1);
689  if(m_dump&&(gainmode==2)) logstr << MSG::DEBUG << " (," << chan << ","<< gainmode <<"," << samp <<","<< m_arrayofsample[chan+8][gainmode][samp]<<")";
690  pos++;
691  } // end channel loop
692 
693  if(m_dump&&(gainmode==2)) logstr << MSG::DEBUG <<endmsg;
694  } // end gain loop
695  }// end sample loop
696  pos+= NWREC*2;
697  logstr << MSG::DEBUG << " Creating LArDigit for board "<< nfeb << ". m_febgain=" << m_febgain[nfeb] <<endmsg;
698  // create and store LArDigit.
699  for(unsigned int g=0;g<m_gains.size();g++){ // loop on reqested gains
700  int gainmode;
701  if(m_febgain[nfeb]==0){ // Default behavior
702  gainmode= m_gains[g];
703  } else { // this FEB is AutoGain and first sample given in m_febgain
704  gainmode=0;
705  }
706 
707  logstr << MSG::DEBUG << "Gain mode="<< gainmode <<endmsg;
708  for(int i=0;i<128;i++) { // loop on channels
709 
710  std::vector<short> samplevec(m_arrayofsample[i][gainmode]);
711  samplevec.resize(m_samples[0]);
713  HWIdentifier hwid=m_onlineHelper->channel_Id(1,1,m_feedthrough[m_boards[nfeb]-1],m_slot[m_boards[nfeb]-1],i);
714  LArDigit * lardig= new LArDigit(hwid,gain,samplevec);
715  m_tblardigitcont[gainmode]->push_back(lardig);
716  if(m_isCalib) {
717  bool isPulsed=false;
718  const std::vector<HWIdentifier>& calibChannelIDs=calibLine->calibSlotLine(hwid);
719  if (calibChannelIDs.size() != 0) {
720  // Now figure out if any calibration line connected to this channel is pulsed.
721  // I'm going to cheat and use the fact that we only pulsed one board at a time
722  // and only wrote the corresponding digits (EMEC/HEC/FCAL)
723  for (HWIdentifier calChan : calibChannelIDs) {
724  int chan = m_onlineHelper->channel(calChan);
725  int bit = chan%8;
726  int byte = chan/8;
727  // if( 1<<bit & m_calib_pattern[byte] ) {
728  if( 128>>bit & m_calib_pattern[byte] ) {
729  isPulsed = true;
730  }
731  }
732  }
733  LArCalibDigit * larcalibdig= new LArCalibDigit(hwid,gain,samplevec,m_calib_dac,m_calib_delay,isPulsed);
734  m_tblarcalibdigitcont[gainmode]->push_back(larcalibdig);
735  }
736  }
737  if(m_febgain[nfeb]!=0){ // this FEB is AutoGain ignore every gain in FebGain
738  break;
739  }
740  }
741  }// FEB loop
742 
743  }
744  break;
745 
746  case 0x03: // TIME_ID -----------------------------------------
747  {
748  logstr << MSG::DEBUG << "H6BuildObject : TIME_ID "<< m_subfrag_size << endmsg;
749  name1="word1frag0x03chan";
750  name2="word2frag0x03chan";
751 
752 
753  if(m_subfrag_size!=5) {
754  logstr<<MSG::ERROR<< "Beam counter subfrag (0x03) has not expected size" <<endmsg;
755  sc=StatusCode::FAILURE;
756  break;
757  }
759  int tmp1,tmp2;
760 
761  tmp1 = firstword(m_rodBlock[pos]);
763 
764  if(m_dump) logstr << MSG::INFO << " sub frag 0x03 : word1="<<tmp1<<" word2="<< tmp2 <<endmsg;
765 
766  TBTDCRaw * clocktdc = new TBTDCRaw(name1+'0',false,tmp1,false);
767  TBTDCRaw * clock_deltdc = new TBTDCRaw(name2+'0',false,tmp2,false);
768  m_tdcrawCont->push_back(clocktdc);
769  m_tdcrawCont->push_back(clock_deltdc);
770 
771  tmp1 = firstword(m_rodBlock[pos+1]);
773 
774  if(m_dump) logstr << MSG::INFO << " sub frag 0x03 : word1="<<tmp1<<" word2="<< tmp2 <<endmsg;
775 
776  TBTDCRaw * scale1 = new TBTDCRaw(name1+'1',false,tmp1,false);
777  TBTDCRaw * scale1bis = new TBTDCRaw(name2+'1',false,tmp2,false);
779  m_tdcrawCont->push_back(scale1bis);
780 
781  tmp1 = firstword(m_rodBlock[pos+2]);
783 
784  if(m_dump) logstr << MSG::INFO << " sub frag 0x03 : word1="<<tmp1<<" word2="<< tmp2 <<endmsg;
785 
786  TBTDCRaw * scale2 = new TBTDCRaw(name1+'2',false,tmp1,false);
787  TBTDCRaw * scale2bis = new TBTDCRaw(name2+'2',false,tmp2,false);
789  m_tdcrawCont->push_back(scale2bis);
790 
791  }
792  break;
793  case 0x04: // TAIL_ID -----------------------------------------
794  {
795  name1="word1frag0x06chan";
796  name2="word2frag0x06chan";
797  std::string tcname="tc";
798  std::vector<TBScintillatorRaw *> theScints;
799  if(m_subfrag_size!=26) {
800  logstr<<MSG::ERROR<< "Beam counter subfrag (0x04) has not expected size" <<endmsg;
801  sc=StatusCode::FAILURE;
802  break;
803  }
804  logstr << MSG::DEBUG << "H6BuildObject : building tailcatcher " << endmsg;
805  for(unsigned int i=0;i<24;i++){
806  int tmp1,tmp2;
808  unsigned short word1=firstword(m_rodBlock[pos]);
809  unsigned short word2=secondword(m_rodBlock[pos]);
810 
811  tmp1 = firstnbit(10,word1);
812  tmp2 = firstnbit(10,word2);
813 
814  os.str("");
815  os << name1 << i;
816  TBADCRaw* adc1 = new TBADCRaw(os.str(),false,abs(tmp1));
817  os.str("");
818  os << name2 << i;
819  TBADCRaw* adc2 = new TBADCRaw(os.str(),false,abs(tmp2));
820  if(testbit(10,word1)) adc1->setOverflow(); // if bit10=0 -> Overflow
821  if(testbit(10,word2)) adc2->setOverflow(); // if bit10=0 -> Overflow
822  m_adcrawCont->push_back(adc1);
823  m_adcrawCont->push_back(adc2);
824  os.str("");
825  os << tcname << 2*i;
827  os.str("");
828  os << tcname << 2*i+1;
830  theScints.push_back(s1);
831  theScints.push_back(s2);
832  }
833 
834  m_tailcatchraw = new TBTailCatcherRaw("TailCatherRaw",false,theScints);
835  //if(unrec_code == 4 ) gotobject=true;
836  }
837  break;
838 
839  case 0x05: // BPC_ID -----------------------------------------
840  {
841  name1="word1frag0x05chan";
842  name2="word2frag0x05chan";
843  //m_bpcrawCont = new TBBPCRawCont();
844  int bpcnum = (m_subfrag_size - 2) / 3; // cause we store 6 tdc/adc in 16bits word
845  logstr << MSG::DEBUG << "H6BuildObject : number of BPCRaw "<< bpcnum << endmsg;
846  // get bpc raw information for each chamber:
847  for(int i=0;i<bpcnum;i++){
848  std::string bpcname = "BPC";
849  os.str("");
850  os << bpcname << i;
851  bpcname= os.str();
852  std::vector<const TBTDCRaw*> theTDCs;
853  std::vector<const TBADCRaw*> theADCs;
855 
856  unsigned int tmp1,tmp2;
857  tmp1=firstword(m_rodBlock[pos+i*3]);
859  os.str("");
860  os << name1 << (i*3);
861  TBADCRaw* tbadcH = new TBADCRaw(os.str(),(tmp1>1023),tmp1);
862  os.str("");
863  os << name2 << (i*3);
864  TBADCRaw* tbadcV = new TBADCRaw(os.str(),(tmp1>1023),tmp2);
865  m_adcrawCont->push_back(tbadcH);
866  m_adcrawCont->push_back(tbadcV);
867 
868  // first word is right :
869  tmp1=firstword(m_rodBlock[pos+i*3+1]);
871  os.str("");
872  os << name2 << (i*3+1);
873  TBTDCRaw * tbtdcL = new TBTDCRaw(os.str(),(tmp2>2047),tmp2,0);
874  os.str("");
875  os << name1 << (i*3+1);
876  TBTDCRaw * tbtdcR = new TBTDCRaw(os.str(),(tmp1>2047),tmp1,0);
877  // no under threshold ??
878  m_tdcrawCont->push_back(tbtdcR);
879  m_tdcrawCont->push_back(tbtdcL);
880  MSG::hex(logstr) << MSG::DEBUG << bpcname<< " "<< tmp1;
881  MSG::hex(logstr) << " "<< tmp2<<" ";
882 
883  tmp1=firstword(m_rodBlock[pos+i*3+2]);
885  os.str("");
886  os << name1 << (i*3+2);
887  TBTDCRaw * tbtdcU = new TBTDCRaw(os.str(),(tmp1>2047),tmp1,0);
888  os.str("");
889  os << name2 << (i*3+2);
890  TBTDCRaw * tbtdcD = new TBTDCRaw(os.str(),(tmp2>2047),tmp2,0);
891  // no under threshold ??
892  m_tdcrawCont->push_back(tbtdcU);
893  m_tdcrawCont->push_back(tbtdcD);
894  MSG::hex(logstr) << MSG::DEBUG << bpcname<< " "<< tmp1;
895  MSG::hex(logstr) << " "<< tmp2<<endmsg;
896 
897 
898  theTDCs.push_back(tbtdcL);
899  theTDCs.push_back(tbtdcR); // Fill the tdc/adc list
900  theTDCs.push_back(tbtdcU); // for this BPC
901  theTDCs.push_back(tbtdcD); // !! THE ORDER MATTERS !!
902  theADCs.push_back(tbadcH);
903  theADCs.push_back(tbadcV);
904  TBBPCRaw *bpcraw = new TBBPCRaw(bpcname,m_tdcrawCont,theTDCs,m_adcrawCont,theADCs);
905  m_bpcrawCont->push_back(bpcraw);
906  }
907  //if( unrec_code == 5 ) gotobject=true;
908 
909  }
910  break;
911 
912  case 0x06: // SCINTILLATOR_ID -----------------------------------------
913  {
914  name1="word1frag0x06chan";
915  name2="word2frag0x06chan";
916  if(m_subfrag_size!=11) {
917  logstr<<MSG::ERROR<< "Beam counter subfrag (0x06) has not expected size" <<endmsg;
918  sc=StatusCode::FAILURE;
919  break;
920  }
921 
922  logstr << MSG::DEBUG << " Building TBScintillatorRawCont with key " << m_keys[6] << endmsg;
923 
924  TBScintillatorRaw * S1 = new TBScintillatorRaw("S1");
925  TBScintillatorRaw * S2 = new TBScintillatorRaw("S2");
926  TBScintillatorRaw * S3 = new TBScintillatorRaw("S3");
928  TBScintillatorRaw * Veto = new TBScintillatorRaw("Veto");
929  TBScintillatorRaw * Halo = new TBScintillatorRaw("Halo");
930  TBScintillatorRaw * muon[8];
931 
932  logstr << MSG::DEBUG << " building muon counters:";
933  for(int i=0;i<8;i++) {
934  std::string scintname="muon";
935  os.str("");
936  os << scintname << (i+1);
937  scintname=os.str();
938  logstr << MSG::DEBUG << " " << scintname;
939  muon[i] = new TBScintillatorRaw(scintname);
940  }
941  logstr << endmsg;
942 
943  int tmp1,tmp2;
945  unsigned short word1=firstword(m_rodBlock[pos]);
946  unsigned short word2=secondword(m_rodBlock[pos]);
947 
948  tmp1 = firstnbit(10,word1);
949  tmp2 = firstnbit(10,word2);
950 
951  TBADCRaw* Badc = new TBADCRaw(name1+'0',false,abs(tmp1));
952  TBADCRaw* Haloadc = new TBADCRaw(name2+'0',false,abs(tmp2));
953  if(testbit(10,word1)) Badc->setOverflow(); // if bit10=0 -> Overflow
954  if(testbit(10,word2)) Haloadc->setOverflow(); // if bit10=0 -> Overflow
955  m_adcrawCont->push_back(Badc);
956  m_adcrawCont->push_back(Haloadc);
957 
958  tmp1 = firstnbit(10,firstword(m_rodBlock[pos+1]));
960  TBADCRaw* S3adc = new TBADCRaw(name1+'1',false,abs(tmp1));
961  TBADCRaw* S2adc = new TBADCRaw(name2+'1',false,abs(tmp2));
962  if(testbit(10,word1)) S3adc->setOverflow(); // if bit10=0 -> Overflow
963  if(testbit(10,word2)) S2adc->setOverflow(); // if bit10=0 -> Overflow
964  m_adcrawCont->push_back(S3adc);
965  m_adcrawCont->push_back(S2adc);
966 
967  tmp1 = firstnbit(10,firstword(m_rodBlock[pos+2]));
968  TBADCRaw* S1adc = new TBADCRaw(name1+'2',false,abs(tmp1));
969  if(testbit(10,word1)) S1adc->setOverflow(); // if bit10=0 -> Overflow
970  m_adcrawCont->push_back(S1adc);
971 
972  for(int i=0;i<4;i++) {
973  tmp1 = firstnbit(10,secondword(m_rodBlock[pos+2+i]));
975  os.str("");
976  os << name1 << (0+2+i);
977  TBADCRaw* adc1 = new TBADCRaw(os.str(),false,abs(tmp1));
978  os.str("");
979  os << name2 << (0+3+i);
980  TBADCRaw* adc2 = new TBADCRaw(os.str(),false,abs(tmp2));
981  // muon[i]
982  // muon[i+1]->setSignal(abs(tmp2));
983  if(testbit(10,word1)) adc1->setOverflow(); // if bit10=0 -> Overflow
984  if(testbit(10,word2)) adc2->setOverflow(); // if bit10=0 -> Overflow
985  m_adcrawCont->push_back(adc1);
986  m_adcrawCont->push_back(adc2);
987  muon[2*i]->setSignals(m_tdcrawCont,dummytdc,m_adcrawCont,adc1);
988  muon[2*i+1]->setSignals(m_tdcrawCont,dummytdc,m_adcrawCont,adc2);
989  }
990 
991 
992  tmp1 = firstnbit(11,secondword(m_rodBlock[pos+6]));
993  TBTDCRaw* S2tdc = new TBTDCRaw(name2+'6',false,abs(tmp1),0);
994  m_tdcrawCont->push_back(S2tdc);
995 
996  // Overflows ?? underthreshold ??
997  tmp1 = firstnbit(11,firstword(m_rodBlock[pos+7]));
999  TBTDCRaw* S3tdc = new TBTDCRaw(name1+'7',false,abs(tmp1),0);
1000  TBTDCRaw* Btdc = new TBTDCRaw(name2+'7',false,abs(tmp2),0);
1001  m_tdcrawCont->push_back(S3tdc);
1002  m_tdcrawCont->push_back(Btdc);
1003 
1004  tmp1 = firstnbit(11,firstword(m_rodBlock[pos+8]));
1006  TBTDCRaw* Halotdc = new TBTDCRaw(name1+'8',false,abs(tmp1),0);
1007  TBTDCRaw* VetoORtdc = new TBTDCRaw(name2+'8',false,abs(tmp2),0);
1008  m_tdcrawCont->push_back(Halotdc);
1009  m_tdcrawCont->push_back(VetoORtdc);
1010 
1011 
1012  // Fill container
1013  S1->setSignals(m_tdcrawCont,dummytdc,m_adcrawCont,S1adc);
1014  S2->setSignals(m_tdcrawCont,S2tdc,m_adcrawCont,S2adc);
1015 
1016 
1017  // logstr << MSG::INFO << "S1 adc ovf = "<< S1->isADCOverflow() << " // S1adc = "<< S1adc->isOverflow() <<endmsg;
1018  // logstr << MSG::INFO << "S2 adc ovf = "<< S2->isADCOverflow() << " // S2adc = "<< S2adc->isOverflow() <<endmsg;
1019 
1020  S3->setSignals(m_tdcrawCont,S3tdc,m_adcrawCont,S3adc);
1021  Veto->setSignals(m_tdcrawCont,VetoORtdc,m_adcrawCont,dummyadc);
1022  Halo->setSignals(m_tdcrawCont,Halotdc,m_adcrawCont,Haloadc);
1023  B->setSignals(m_tdcrawCont,Btdc,m_adcrawCont,Badc);
1024 
1029  m_scintrawCont->push_back(Halo);
1031  for(int i=0;i<8;i++) {
1033  }
1034 
1035  logstr << MSG::DEBUG << " Should I record TBScintillatorRawCont with key " << m_keys[6] << " ? " << endmsg;
1036  //if(unrec_code == 6 ) gotobject=true;
1037  }
1038  break;
1039 
1040  case 0x07: // MWPC_ID -----------------------------------------
1041  {
1043  int nword = m_subfrag_size - 2;
1044  logstr << MSG::DEBUG << " Found MWPC subfragment. Nword= "<<nword << endmsg;
1045 
1046  std::string mwpcnames[8]= {"X2","Y2","X3","Y3","X4","Y4","X5","Y5"};
1047  bool isX[9]={true,false,true,false,true,false,true,false};
1048  TBMWPCRaw * mwpcraw[8];
1049  for( int i=0;i<8;i++){
1050  mwpcraw[i] = new TBMWPCRaw(mwpcnames[i]);
1051  }
1052 
1053  unsigned short status= secondword(m_rodBlock[pos+nword-1]);
1054  //bool error = false ;
1055  if(status==0) status= firstword(m_rodBlock[pos+nword-1]);
1056  else { // first 16 bit word is data
1057  unsigned short word1=firstword(m_rodBlock[pos+nword-1]);
1058  int w; // cluster width
1059  int c; // the starting channel of a cluster (0<start<4096)
1060  int chamber; // 0=X2, 1=Y2, 2=X3, 3=Y3, 4=X4, 5=Y4, 6=X5, 7=Y5
1061  int wire; // wire number
1062 
1063  w = (int) (word1>>12); c = (int) ((0xfff & word1) - w/2 + !(w&1));
1064  if( c < 768 ) {chamber = c/128; wire=c-chamber*128;}
1065  else {chamber=6+(c-768)/64; wire=c-768-(chamber-6)*64;}
1066 
1067  if(chamber>7){logstr << MSG::DEBUG << "Wrong MWPC chamber number : "<< chamber <<endmsg;}
1068  else{
1069  mwpcraw[chamber]->addCwireno(wire);
1070  mwpcraw[chamber]->addNwires(w);
1071  mwpcraw[chamber]->setXchambers(isX[chamber]);
1072  logstr << MSG::DEBUG << " MWPC chamber="<< chamber<< " wire=" << wire << " (w="<<w<<")" << " c="<<c<< endmsg;
1073  }
1074  }
1075 
1076  if(status != 0x1000) {MSG::hex(logstr)<< MSG::DEBUG << "MWPC status word error =" << status <<endmsg; /*error=true;*/}
1077 
1078  for( int i=0;i<m_subfrag_size-2;i++){ // "-2" because last full word contains status word (see above)
1079  unsigned short word1=firstword(m_rodBlock[pos+i]);
1080  unsigned short word2=secondword(m_rodBlock[pos+i]);
1081  int w; // cluster width
1082  int c; // the starting channel of a cluster (0<start<4096)
1083  int chamber; // 0=X2, 1=Y2, 2=X3, 3=Y3, 4=X4, 5=Y4, 6=X5, 7=Y5
1084  int wire; // wire number
1085 
1086  w = (int) (word1>>12); c = (int) ((0xfff & word1) - w/2 + !(w&1));
1087  if( c < 768 ) {chamber = c/128; wire=c-chamber*128;}
1088  else {chamber=6+(c-768)/64; wire=c-768-(chamber-6)*64;}
1089 
1090  if(chamber>7){logstr << MSG::DEBUG << "Wrong MWPC chamber number : "<< chamber <<endmsg;}
1091  else{
1092  mwpcraw[chamber]->addCwireno(wire);
1093  mwpcraw[chamber]->addNwires(w);
1094  mwpcraw[chamber]->setXchambers(isX[chamber]);
1095  logstr << MSG::DEBUG << " MWPC chamber="<< chamber<< " wire=" << wire << " (w="<<w<<")" << " c="<<c<< endmsg;
1096  }
1097 
1098  w = (int) (word2>>12); c = (int) ((0xfff & word2) - w/2 + !(w&1));
1099  if( c < 768 ) {chamber = c/128; wire=c-chamber*128;}
1100  else {chamber=6+(c-768)/64; wire=c-768-(chamber-6)*64;}
1101 
1102 
1103  if(chamber>7){logstr << MSG::INFO << "Wrong MWPC chamber number : "<< chamber <<endmsg;}
1104  else{
1105  mwpcraw[chamber]->addCwireno(wire);
1106  mwpcraw[chamber]->addNwires(w);
1107  mwpcraw[chamber]->setXchambers(isX[chamber]);
1108  logstr << MSG::DEBUG << " MWPC chamber="<< chamber<< " wire=" << wire << " (w="<<w<<")" << " c="<<c<< endmsg;
1109  }
1110 
1111  }
1112 
1113  for( int i=0;i<8;i++){
1114  m_mwpcrawCont->push_back(mwpcraw[i]);
1115  }
1116 
1117  logstr << MSG::DEBUG << " End of MWPC subfragment " << endmsg;
1118  //if(unrec_code == 7 ) gotobject=true;
1119 
1120  }
1121  break;
1122  case 0xf1: // Run header -----------------------------------------
1123  {
1125  char *strw;
1126  int nword = m_subfrag_size - 2;
1127  if(nword%16){
1128  logstr << MSG::ERROR << "bad number of lines. nwords=" << nword <<endmsg;
1129  break;
1130  }
1131  int nline= nword / 16;
1132  strw = (char*)&m_rodBlock[pos];
1133  for(int i=0;i<nline;i++){
1134  // strw = (char*) &m_rodBlock[pos+i*64];
1135  std::string sline="";
1136  std::string skey="";
1137  for(int j=0;j<63;j++) {
1138  if(strw[i*64+j]==0) break;
1139  sline+=strw[i*64+j];
1140  }
1141  //logstr << MSG::INFO << sline << endmsg;
1142  std::istringstream iss (sline);
1143  iss >> skey;
1144  if(skey=="RunNumber") {
1145  MSG::dec(logstr) << MSG::DEBUG << sline << endmsg;
1146  iss >> m_run_num;
1147  }
1148  if(skey=="BeamMomentum") {
1149  MSG::dec(logstr) << MSG::DEBUG << sline << endmsg;
1150  iss >> m_beam_moment;
1151  }
1152  if(skey=="BeamParticle") {
1153  MSG::dec(logstr) << MSG::DEBUG << sline << endmsg;
1154  iss >> m_beam_part;
1155  }
1156  if(skey=="CryoX") {
1157  MSG::dec(logstr) << MSG::DEBUG << sline << endmsg;
1158  iss >> m_cryoX;
1159  }
1160  if(skey=="CryoAngle") {
1161  MSG::dec(logstr) << MSG::DEBUG << sline << endmsg;
1162  iss >> m_cryoAngle;
1163  }
1164  if(skey=="TableY") {
1165  MSG::dec(logstr) << MSG::DEBUG << sline << endmsg;
1166  iss >> m_tableY;
1167  }
1168  if(skey=="miniROD") {
1169  logstr << MSG::DEBUG << sline << endmsg;
1170  m_boards.clear();
1171  int board;
1172  // iss>>board;
1173  while(iss.good()) {iss>>board;m_boards.push_back(board);}
1174  logstr << MSG::DEBUG << "Found nboards="<< m_boards.size() << endmsg;
1175  for(unsigned i=0;i<m_boards.size();i++)logstr << MSG::DEBUG << m_boards[i]<<" ";
1176  logstr << MSG::DEBUG<<endmsg;
1177  }
1178  if(skey=="FebSamples") {
1179  MSG::dec(logstr) << MSG::DEBUG << sline << endmsg;
1180  m_samples.clear();
1181  int sample;
1182  // iss>>sample;
1183  while(iss.good()) {iss>>sample;m_samples.push_back(sample);}
1184  MSG::dec(logstr) << MSG::DEBUG << "nsample="<< m_samples.size() << endmsg;
1185  for(unsigned i=0;i<m_samples.size();i++)logstr << MSG::DEBUG << m_samples[i]<<" ";
1186  logstr << MSG::DEBUG<<endmsg;
1187  }
1188  if(skey=="FebGains") {
1189  MSG::dec(logstr) << MSG::DEBUG << sline << endmsg;
1190  m_gains.clear();
1191  int gain;
1192  // iss>>gain;
1193  while(iss.good()) {iss>>gain;m_gains.push_back(gain);}
1194  int gs=m_gains.size() ;
1195  if(gs>1) if(m_gains[gs-1]==m_gains[gs-2])m_gains.resize(gs-1);
1196  MSG::dec(logstr) << MSG::DEBUG << "numb of gains="<< m_gains.size() << endmsg;
1197  for(unsigned i=0;i<m_gains.size();i++)logstr << MSG::DEBUG << m_gains[i]<<" ";
1198  logstr << MSG::DEBUG<<endmsg;
1199  }
1200  if(skey=="FebAuto") {
1201  MSG::dec(logstr) << MSG::DEBUG << sline << endmsg;
1202  m_febgain.clear();
1203  int gain;
1204  // iss>>gain;
1205  while(iss.good()) {iss>>gain;m_febgain.push_back(gain);}
1206  MSG::dec(logstr) << MSG::DEBUG << "n febauto="<< m_febgain.size() << " " << endmsg;
1207  for(unsigned i=0;i<m_febgain.size();i++)logstr << MSG::DEBUG << m_febgain[i]<<" ";
1208  logstr << MSG::DEBUG<<endmsg;
1209  }
1210  if(skey=="FebFirstSample") {
1211  MSG::dec(logstr) << MSG::DEBUG << sline << endmsg;
1212  m_firstsamples.clear();
1213  int firstsample;
1214  // iss>>firstsample;
1215  while(iss.good()) {iss>>firstsample;m_firstsamples.push_back(firstsample);}
1216  MSG::dec(logstr) << MSG::DEBUG << "firstsample="<< m_firstsamples.size() << endmsg;
1217  }
1218  }
1219 
1220  // If there was no febgain initialise to 0 :
1221  if(m_febgain.size()==0) m_febgain.resize(8,0);
1222  // now initialize every vector :
1223  for(int i=0;i<128;i++) {for(int j=0;j<4;j++) {m_arrayofsample[i][j].clear();m_arrayofsample[i][j].resize(32,0);}}
1224 
1225  // m_summary_path = m_summary_path+"/run";
1226 // m_summary_path = m_summary_path+m_run_num;
1227 // m_summary_path = m_summary_path+".summary";
1228  std::ofstream outfile(m_summary_path.c_str());
1229 
1230  outfile << "Run number " << m_run_num << std::endl;
1231  outfile << std::endl;
1232  outfile << "Beam Type \t " << m_beam_part << std::endl;
1233  outfile << "Beam Momentum \t " << m_beam_moment << std::endl;
1234  outfile << std::endl;
1235  outfile << "Cryostat X pos \t " << m_cryoX << std::endl;
1236  outfile << "Cryostat Angle \t " << m_cryoAngle << std::endl;
1237  outfile << "Table Y pos \t " << m_tableY << std::endl;
1238 
1239 
1240 
1241  }
1242  break;
1243  case 0xff : // Calib_ID ------------------------------------
1244  {
1246  int nword = m_subfrag_size - 2;
1247  logstr << MSG::DEBUG << " Found Calib_ID subfragment. Nword= "<<nword << endmsg;
1248  if(nword!=6) { // expect 6 words (to hold 22 bytes)
1249  logstr<<MSG::ERROR<< "Calibration subfrag (0xff) has not expected size" <<endmsg;
1250  sc=StatusCode::FAILURE;
1251  break;
1252  }
1253 
1254  m_isCalib = true;
1255 
1256  for(int i=0;i<4;i++){ // get channel pattern
1257  int first16 = firstword(m_rodBlock[pos+i]);
1258  int second16 = secondword(m_rodBlock[pos+i]);
1259 
1260  m_calib_pattern[4*i] = 255 & first16;
1261  m_calib_pattern[4*i+1] = first16 >> 8;
1262  m_calib_pattern[4*i+2] = 255 & second16;
1263  m_calib_pattern[4*i+3] = second16 >> 8;
1264  }
1265 
1266  logstr << MSG::DEBUG << "Found calibration header information " << endmsg;
1267  logstr << MSG::DEBUG << " Calib pattern: " << endmsg;
1268  for(int byte=0; byte<16; byte++) {
1269  logstr << MSG::DEBUG << " byte " << byte << " : " ;
1270  for(int bit=0; bit<8; bit++) {
1271  // bool onoff = 1<<bit & m_calib_pattern[byte];
1272  bool onoff = 128>>bit & m_calib_pattern[byte];
1273  logstr << MSG::DEBUG << onoff << "/" ;
1274  }
1275  logstr << MSG::DEBUG << endmsg;
1276  }
1277 
1278  // See http://cern.ch/atlas-fcaltb/Memos/DAQ/DataFormat.general.pdf
1279  // http://cern.ch/atlas-fcaltb/Data-taking/CBT2/Beam_fragment_format.sxw.pdf
1280  // (Petr Gorbunov H6 FCAL documentation.)
1282 
1283  unsigned first16 = firstword(m_rodBlock[pos+5]);
1284  m_calib_delay = 255 & first16;
1285  m_calib_error = ((first16 >> 8) != 0);
1286 
1287  // logstr << MSG::DEBUG << " Pattern 0/1/2/3 = " << m_calib_pattern[0]
1288  // << "/" << m_calib_pattern[1]
1289  // << "/" << m_calib_pattern[2]
1290  // << "/" << m_calib_pattern[3] << endmsg;
1291  logstr << MSG::DEBUG << " DAC = " << m_calib_dac << endmsg;
1292  logstr << MSG::DEBUG << " DELAY = " << m_calib_delay << endmsg;
1293  }
1294  break;
1295  default : // -----------------------------------------
1296  logstr << MSG::DEBUG << "Found undefined subfragment id= "<< m_subfrag_id << endmsg;
1297  break;
1298  }
1299  }
1300 
1301  sc = H6RecordObjects(unrec_code);
1302  return sc;
1303 
1304 
1305 }

◆ H6RecordObjects()

StatusCode TBByteStreamCnvTool::H6RecordObjects ( int  unrec_code)

Definition at line 1942 of file TBByteStreamCnvTool.cxx.

1943 {
1944 
1945  StatusCode sc;
1946  MsgStream logstr(msgSvc(), name());
1947  logstr << MSG::DEBUG << "About to try recording. unrec_code = " << unrec_code << endmsg;
1948 
1949  if( !m_tailcatchraw) {
1950  logstr << MSG::DEBUG << " WARNING! Did not find TailCatcher. Returning an empty one : this may crash every attempt to use it" << endmsg;
1952  }
1953 
1954  if(unrec_code!=1) { // If object was not requested by the converter, store it in SG
1955  logstr << MSG::DEBUG << "Recording TBTriggerPatternUnit with key " << m_keys[1] << endmsg;
1956  sc = evtStore()->record(m_trigpat,m_keys[1]);
1957  if ( sc.isFailure( ) ) {
1958  logstr << MSG::ERROR << "Cannot record TBTrigPat " << endmsg;
1959  }
1960  }
1961 
1962  if(unrec_code!=4){ // If object was not requested by the converter, store it in SG
1963  logstr << MSG::DEBUG << "Recording TBTailCatcherRaw with key " << m_keys[4] << endmsg;
1964  sc = evtStore()->record(m_tailcatchraw,m_keys[4]);
1965  if ( sc.isFailure( ) ) {
1966  logstr << MSG::ERROR << "Cannot record TailCatcherRaw " << endmsg;
1967  }
1968  }
1969 
1970  if(unrec_code!=5) { // If object was not requested by the converter, store it in SG
1971  logstr << MSG::DEBUG << "Recording TBBPCRawCont with key " << m_keys[5] << endmsg;
1972  // if(! evtStore()->contains<TBBPCRawCont>(m_keys[5])) {
1973  sc = evtStore()->record(m_bpcrawCont,m_keys[5]);
1974  if ( sc.isFailure( ) ) {
1975  logstr << MSG::ERROR << "Cannot record BPCRawCont" << endmsg;
1976  }
1977  // } else {
1978  // logstr << MSG::ERROR << " Object TBBPCRawCont already in SG (memory leak!)" << endmsg;
1979  // }
1980  }
1981 
1982  if(unrec_code!=6){ // If object was not requested by the converter, store it in SG
1983  logstr << MSG::DEBUG << "Recording TBScintillatorRawCont with key " << m_keys[6] << endmsg;
1984  // if(! evtStore()->contains<TBScintillatorRawCont>(m_keys[6])) {
1985  sc = evtStore()->record(m_scintrawCont,m_keys[6]);
1986  if ( sc.isFailure( ) ) {
1987  logstr << MSG::ERROR << "Cannot record ScintRawCont " << endmsg;
1988  }
1989  // } else {
1990  // logstr << MSG::ERROR << " Object TBScintillatorRawCont already in SG (memory leak!)" << endmsg;
1991  // }
1992  }
1993 
1994  if(unrec_code!=7){ // If object was not requested by the converter, store it in SG
1995  // if(! evtStore()->contains<TBMWPCRawCont>(m_keys[7])) {
1996  logstr << MSG::DEBUG << "record TBMWPCRawCont with key " << m_keys[7] <<endmsg;
1997  sc = evtStore()->record(m_mwpcrawCont,m_keys[7]);
1998  if ( sc.isFailure( ) ) {
1999  logstr << MSG::ERROR << "Cannot record MWPCRawCont " << endmsg;
2000  }
2001  // } else {
2002  // logstr << MSG::ERROR << " Object TBMWPCRawCont already in SG (memory leak!)" << endmsg;
2003  // }
2004  }
2005 
2006  // TDCRaw and ADCRaw are special since they are build from all
2007  // subfragments in H6. Record them slightly differently.
2008 
2009  if(unrec_code!=2){ // If object was not requested by the converter, store it in SG
2010  logstr << MSG::DEBUG << "record TDC cont with key " << m_keys[2] << endmsg;
2011  // if(! evtStore()->contains<TBTDCRawCont>(m_keys[2])) {
2012  sc = evtStore()->record(m_tdcrawCont,m_keys[2]);
2013  if ( sc.isFailure( ) ) {
2014  logstr << MSG::ERROR << "Cannot record TDCCont " << endmsg;
2015  }
2016  }
2017  // } else {
2018  // logstr << MSG::ERROR << " Object TBTDCRawCont already in SG (memory leak!)" << endmsg;
2019  // }
2020 
2021 
2022  if(unrec_code!=3){ // If object was not requested by the converter, store it in SG
2023  logstr << MSG::DEBUG << "record ADC cont with key " << m_keys[3] << endmsg;
2024  // if(! evtStore()->contains<TBADCRawCont>(m_keys[3])) {
2025  sc = evtStore()->record(m_adcrawCont,m_keys[3]);
2026  if ( sc.isFailure( ) ) {
2027  logstr << MSG::FATAL << "Cannot record ADCCont " << endmsg;
2028  }
2029  }
2030  // } else {
2031  // logstr << MSG::ERROR << " Object TBADCRawCont already in SG (memory leak!)" << endmsg;
2032  // }
2033 
2034  for(int c=10;c<14;c++){
2035  if(unrec_code!=c){ // If object was not requested by the converter, store it in SG
2036 
2037  logstr << MSG::DEBUG << "record TBLArDigitContainer with key " << m_keys[c] << " and size " << m_tblardigitcont[c-10]->size() << endmsg;
2038  sc = evtStore()->record(m_tblardigitcont[c-10],m_keys[c]);
2039  if ( sc.isFailure( ) ) {
2040  logstr << MSG::FATAL << "Cannot record " <<m_keys[c-10]<< endmsg;
2041  }
2042  }
2043  }
2044 
2045  for(int c=10;c<14;c++){
2046  if(unrec_code!=c){ // If object was not requested by the converter, store it in SG
2047 
2048  logstr << MSG::DEBUG << "record TBLArCalibDigitContainer with key " << m_keys[c] << " and size " << m_tblarcalibdigitcont[c-10]->size() << endmsg;
2049  sc = evtStore()->record(m_tblarcalibdigitcont[c-10],m_keys[c]);
2050  if ( sc.isFailure( ) ) {
2051  logstr << MSG::FATAL << "Cannot record " <<m_keys[c-10]<< endmsg;
2052  }
2053  }
2054  }
2055 
2056  if(unrec_code!=30){ // If object was not requested by the converter, store it in SG
2057  sc = evtStore()->record(m_eventinfo,"TBEventInfo");
2058  if ( sc.isFailure( ) ) {
2059  logstr << MSG::FATAL << "Cannot record TBEventInfo "<< endmsg;
2060  }
2061  }
2062  // } else {
2063  // logstr << MSG::ERROR << " Object TBADCRawCont already in SG (memory leak!)" << endmsg;
2064  // }
2065 
2066  logstr << MSG::DEBUG << " End of H6 Record " << endmsg;
2067 
2068  // Print run summary in text file
2069 
2070  return sc;
2071 
2072 }

◆ H8BuildObjects()

StatusCode TBByteStreamCnvTool::H8BuildObjects ( int  unrec_code)

Build all beam detectors raw objects from m_rodBlock using H8 convention. Objects are recorded in SG if they do not correspond to unrec_code Will return faillure if : -one of the object could not be recorded in SG -the requested object (unrec_code) was not found

Definition at line 1309 of file TBByteStreamCnvTool.cxx.

1312 {
1321  MsgStream logstr(msgSvc(), name());
1322  logstr << MSG::DEBUG << "H8BuildObject invoked for code " << unrec_code<< endmsg;
1323 
1324  StatusCode sc=StatusCode::FAILURE;
1325  bool gotobject=false;
1326  bool recordfailure=false;
1327 
1328  bool goodRodBlock=true; // This is a hack to avoid runtime exceptions
1329 
1330  std::string name;
1331 
1332 
1333  // Get ROD block.
1334  sc=GetRODBlock(m_subdet_id,eformat::TDAQ_BEAM_CRATE); //Possible improvement: Check if vector is already valid.
1335  //sc=GetRODBlock(EventFormat::TDAQ_BEAM_CRATE);
1336 
1337  if (sc!=StatusCode::SUCCESS) {
1338  // return sc;
1339  logstr << MSG::ERROR << "ReadRodBlock: RodBlock error! Will try to fill SG with empty objects." << endmsg;
1340  goodRodBlock=false;
1341  }
1342  if (m_rodBlock.size()<2) {
1343  logstr << MSG::ERROR << "ReadRodBlock: RodBlock too small! Will try to fill SG with empty objects." << endmsg;
1344  // return StatusCode::FAILURE;
1345  goodRodBlock=false;
1346  }
1347 
1348  m_tdcrawCont = new TBTDCRawCont();
1349  m_adcrawCont = new TBADCRawCont();
1350 
1351  // Define some dummy ADC & TDC :
1352  TBADCRaw* dummyadc = new TBADCRaw("dummy",true,0);
1353  TBTDCRaw* dummytdc = new TBTDCRaw("dummy",true,0,true);
1354  m_tdcrawCont->push_back(dummytdc);
1355  m_adcrawCont->push_back(dummyadc);
1356 
1357 
1358  // Scintillator init :
1359  TBScintillatorRaw * S0 = new TBScintillatorRaw("S0");
1360  TBScintillatorRaw * S1 = new TBScintillatorRaw("S1");
1361  TBScintillatorRaw * S2up = new TBScintillatorRaw("S2-Up");
1362  TBScintillatorRaw * S2down = new TBScintillatorRaw("S2-Down");
1363  TBScintillatorRaw * S3left = new TBScintillatorRaw("S3-Left");
1364  TBScintillatorRaw * S3right = new TBScintillatorRaw("S3-Right");
1365  TBScintillatorRaw * C1 = new TBScintillatorRaw("C1");
1366  TBScintillatorRaw * C2 = new TBScintillatorRaw("C2");
1367  TBScintillatorRaw * muTag = new TBScintillatorRaw("muTag");
1368  TBScintillatorRaw * muHalo = new TBScintillatorRaw("muHalo");
1369  TBScintillatorRaw * muVeto = new TBScintillatorRaw("muVeto");
1370  TBScintillatorRaw * sTRT = new TBScintillatorRaw("TRTSci");
1371 
1372  // S0 has only TDC
1373  TBTDCRaw* S0tdc =dummytdc;
1374  // S1,S2,S3 have 1 TDC +1 ADC
1375  TBADCRaw * S1adc=dummyadc;
1376  TBTDCRaw * S1tdc=dummytdc;
1377 
1378  TBADCRaw * S2upadc=dummyadc;
1379  TBTDCRaw * S2uptdc=dummytdc;
1380  TBADCRaw * S2downadc=dummyadc;
1381  TBTDCRaw * S2downtdc=dummytdc;
1382 
1383  TBADCRaw * S3leftadc=dummyadc;
1384  TBTDCRaw * S3lefttdc=dummytdc;
1385  TBADCRaw * S3rightadc=dummyadc;
1386  TBTDCRaw * S3righttdc=dummytdc;
1387  //Clock phase
1388  TBTDCRaw * ClockPhasetdc=dummytdc;
1389 
1390  //The following Scintillators have only ADC
1391  TBADCRaw * muTagadc=dummyadc;
1392  TBADCRaw * C1adc=dummyadc;
1393  TBADCRaw * C2adc=dummyadc;
1394  TBADCRaw * muHaloadc=dummyadc;
1395  TBADCRaw * muVetoadc=dummyadc;
1396  TBADCRaw * sTRTadc=dummyadc;
1397 
1398  // Define BPCs
1399  // Some data words for tdc channels may be absent and if not they arrive in a
1400  // different order than the one we need to store in TBBPCRaw. So we need all this stuff to get
1401  // everything done :
1402  int BPCNum=5;
1403  TBBPCRaw* bpcraw[5];
1404  TBTDCRaw * BPCtdc[5][4];
1405  short tdc_order[4] = {2,3,0,1}; // bytestream : udlr - TBBPCRaw lrud
1406  for(int i=0;i<BPCNum;i++){
1407  bpcraw[i] = new TBBPCRaw("BPC");
1408  for(int j=0;j<4;j++) BPCtdc[i][j]=0;
1409  }
1410  bpcraw[0]->setDetectorName("BPC-2");
1411  bpcraw[1]->setDetectorName("BPC-1");
1412  bpcraw[2]->setDetectorName("BPC0");
1413  bpcraw[3]->setDetectorName("BPC1");
1414  bpcraw[4]->setDetectorName("BPC2");
1415 
1416  // for string conversion
1417  std::ostringstream os;
1418 
1419  // Now loop through fragment
1420 
1421  // with this initialisation, first call of NextSubFrag will initialise correctly the index :
1422  m_subfrag_id=0;
1423  m_subfrag_size=2;
1425  // while(NextSubFrag()){
1426  while(NextSubFrag() and goodRodBlock){ // Hack for bad ROD block
1427  switch(m_subfrag_id){
1428  case 0x10: // ADC1 block --------------------------------------
1429  {
1430  name="frag0x10chan";
1431  logstr << MSG::DEBUG << "Got SubFragment " << MSG::hex << m_subfrag_id << " name=" << name
1432  << " Data words = " << MSG::dec << m_subfrag_size-2<<endmsg;
1433 
1435 
1436  // Overflows ??
1437 
1438  S1adc = new TBADCRaw(name+"0",false,m_rodBlock[pos] & 0xfff);
1439  // do not set signal here cause we also need TDC (in 0x11)
1440  logstr << MSG::DEBUG << "S1adc: 0x" << MSG::hex << (int)(m_rodBlock[pos] & 0xfff) << " [0x" << m_rodBlock[pos] << "]"
1441  << MSG::dec << endmsg;
1442  m_adcrawCont->push_back(S1adc);
1443 
1444  pos++; // 2
1445  S2upadc = new TBADCRaw(name+"1",false,m_rodBlock[pos] & 0xfff);
1446  logstr << MSG::DEBUG << "S2 :" << MSG::hex << (m_rodBlock[pos] & 0xfff) << " [0x" << m_rodBlock[pos] << "]"
1447  << MSG::dec << endmsg;
1448  m_adcrawCont->push_back(S2upadc);
1449 
1450 
1451  pos++; // 2
1452  S3rightadc = new TBADCRaw(name+"2",false,m_rodBlock[pos] & 0xfff);
1453  logstr << MSG::DEBUG << "S3 :" << MSG::hex << (m_rodBlock[pos] & 0xfff) << " [0x" << m_rodBlock[pos] << "]"
1454  << MSG::dec << endmsg;
1455  m_adcrawCont->push_back(S3rightadc);
1456 
1457 
1458  pos++; // 2
1459  muTagadc = new TBADCRaw(name+"3",false,m_rodBlock[pos] & 0xfff);
1460  logstr << MSG::DEBUG << "muTag :" << MSG::hex << (m_rodBlock[pos] & 0xfff) << " [0x" << m_rodBlock[pos] << "]"
1461  << MSG::dec << endmsg;
1462  m_adcrawCont->push_back(muTagadc);
1463  //muTag->setSignals(m_tdcrawCont,dummytdc,m_adcrawCont,muTagadc);
1464 
1465  pos++; // 2
1466  C1adc = new TBADCRaw(name+"4",false,m_rodBlock[pos] & 0xfff);
1467  logstr << MSG::DEBUG << "C1 :" << MSG::hex << (m_rodBlock[pos] & 0xfff) << " [0x" << m_rodBlock[pos] << "]"
1468  << MSG::dec << endmsg;
1469  m_adcrawCont->push_back(C1adc);
1470  //C1->setSignals(m_tdcrawCont,dummytdc,m_adcrawCont,C1adc);
1471 
1472  pos++; // 2
1473  C2adc = new TBADCRaw(name+"5",false,m_rodBlock[pos] & 0xfff);
1474  logstr << MSG::DEBUG << "C2 :" << MSG::hex << (m_rodBlock[pos] & 0xfff) << " [0x" << m_rodBlock[pos] << "]"
1475  << MSG::dec << endmsg;
1476  m_adcrawCont->push_back(C2adc);
1477  //C2->setSignals(m_tdcrawCont,dummytdc,m_adcrawCont,C2adc);
1478 
1479 
1480  pos++; // 2
1481  muHaloadc = new TBADCRaw(name+"6",false,m_rodBlock[pos] & 0xfff);
1482  logstr << MSG::DEBUG << "muHalo :" << MSG::hex << (m_rodBlock[pos] & 0xfff) << " [0x" << m_rodBlock[pos] << "]"
1483  << MSG::dec << endmsg;
1484  m_adcrawCont->push_back(muHaloadc);
1485  //muHalo->setSignals(m_tdcrawCont,dummytdc,m_adcrawCont,muHaloadc);
1486 
1487  pos++; // 2
1488  muVetoadc = new TBADCRaw(name+"7",false,m_rodBlock[pos] & 0xfff);
1489  logstr << MSG::DEBUG << "muVeto :" << MSG::hex << (m_rodBlock[pos] & 0xfff) << " [0x" << m_rodBlock[pos] << "]"
1490  << MSG::dec << endmsg;
1491  m_adcrawCont->push_back(muVetoadc);
1492  //muVeto->setSignals(m_tdcrawCont,dummytdc,m_adcrawCont,muVetoadc);
1493 
1494  if(m_dump){
1495  logstr << MSG::INFO << " DUMP : ";
1496  logstr << name << " "<< m_subfrag_size-2 <<" words - " << S1adc->getADC() << " " << S2upadc->getADC();
1497  logstr << " " << S3rightadc->getADC()<< " " << muTagadc->getADC() << " " << C1adc->getADC();
1498  logstr << " " << C2adc->getADC() << " " << muHaloadc->getADC() << " "<< muVetoadc->getADC() <<endmsg ;
1499 
1500  }
1501 
1502  }
1503  break;
1504  case 0x11: // ADC2 segment ----------------------------------
1505  {
1506  name="frag0x11chan";
1507  logstr << MSG::DEBUG << "Got SubFragment " << MSG::hex << m_subfrag_id << " name=" << name
1508  << " Data words = " << MSG::dec << m_subfrag_size-2<<endmsg;
1509 
1511 
1512  // channel 0 not used
1513  // Modification: 2005/01/27 W.L. channel 0 used by TRT Scintillator
1514  sTRTadc = new TBADCRaw(name+"0",false,m_rodBlock[pos] & 0xfff);
1515  logstr << MSG::DEBUG << "sTRT:" << MSG::hex << (m_rodBlock[pos] & 0xfff) << " [0x" << m_rodBlock[pos] << "]"
1516  << MSG::dec << endmsg;
1517  pos++; //1
1518  S2downadc = new TBADCRaw(name+"1",false,m_rodBlock[pos] & 0xfff);
1519  logstr << MSG::DEBUG << "S2 :" << MSG::hex << (m_rodBlock[pos] & 0xfff) << " [0x" << m_rodBlock[pos] << "]"
1520  << MSG::dec << endmsg;
1521  m_adcrawCont->push_back(S2downadc);
1522 
1523  pos++; // 2
1524  S3leftadc = new TBADCRaw(name+"2",false,m_rodBlock[pos] & 0xfff);
1525  logstr << MSG::DEBUG << "S3 :" << MSG::hex << (m_rodBlock[pos] & 0xfff) << " [0x" << m_rodBlock[pos] << "]"
1526  << MSG::dec << endmsg;
1527  m_adcrawCont->push_back(S3leftadc);
1528 
1529  if(m_dump){
1530  logstr << MSG::INFO << " DUMP : ";
1531  logstr << name << " "<< m_subfrag_size-2 <<" words - " << S2downadc->getADC() << " " << S3leftadc->getADC()<<endmsg;
1532  }
1533 
1534  }
1535  break;
1536  case 0x12: // ps TDC --------------------------------------
1537  {
1538  name="frag0x12chan";
1539  logstr << MSG::DEBUG << "Got SubFragment " << MSG::hex << m_subfrag_id << " name=" << name
1540  << " Data words = " << MSG::dec << m_subfrag_size-2<<endmsg;
1542  if(m_dump) logstr << MSG::INFO << " DUMP : "<< name<< " "<< m_subfrag_size-2 <<" words - " ;
1543 
1544  for( int i=0;i<m_subfrag_size-2;i++){
1546  // get channel number
1547  const int chan= (m_rodBlock[pos] >> 16) & 0x1F;
1548  const unsigned int tdc = m_rodBlock[pos] & 0xfff; // 12 first bits (0-11)
1549  const int corrup = (m_rodBlock[pos]>>21)&0x3f; // test bits 21-26
1550  const bool endofdata=(((m_rodBlock[pos] >> 24)&0x7)==0x4);
1551  // from doc it appears that endofdata <=> corrup==32
1552  const bool overflow=(m_rodBlock[pos]>>12)&1;
1553  const bool underthresh=(m_rodBlock[pos]>>13)&1;
1554  logstr << MSG::DEBUG << MSG::dec << "Pos=" << pos <<" Chan "<< chan << "=" << tdc << ", OV=" << overflow
1555  << ", UN=" <<underthresh << " EOD="<< endofdata << ", corrupt=" << corrup
1556  << " [0x" << MSG::hex << m_rodBlock[pos] << "]" << MSG::dec <<endmsg;
1557  if(m_dump)
1558  MSG::dec(logstr) << " "<< (m_rodBlock[pos] & 0xfff);
1559 
1560 
1561  if (!endofdata && !corrup) {
1562  os.str("");
1563  os << name << chan;
1564  switch(chan){
1565  case 0:
1566  ClockPhasetdc = new TBTDCRaw(os.str(),overflow,tdc,underthresh);
1567  m_tdcrawCont->push_back(ClockPhasetdc);
1568  break;
1569  case 1:
1570  S1tdc = new TBTDCRaw(os.str(),overflow,tdc,underthresh);
1571  m_tdcrawCont->push_back(S1tdc);
1572  break;
1573  case 2:
1574  S2downtdc = new TBTDCRaw(os.str(),overflow,tdc,underthresh);
1575  m_tdcrawCont->push_back(S2downtdc);
1576  break;
1577  case 3:
1578  S3lefttdc = new TBTDCRaw(os.str(),overflow,tdc,underthresh);
1579  m_tdcrawCont->push_back(S3lefttdc);
1580  break;
1581  case 4:
1582  S2uptdc = new TBTDCRaw(os.str(),overflow,tdc,underthresh);
1583  m_tdcrawCont->push_back(S2uptdc);
1584  break;
1585  case 5:
1586  S3righttdc = new TBTDCRaw(os.str(),overflow,tdc,underthresh);
1587  m_tdcrawCont->push_back(S3righttdc);
1588  break;
1589  case 6:
1590  S0tdc = new TBTDCRaw(os.str(),overflow,tdc,underthresh);
1591  m_tdcrawCont->push_back(S0tdc);
1592  break;
1593  default:
1594  break;
1595  } // end switch
1596  }//end if not corrupted and not end of data
1597  else
1598 
1599  if (endofdata) {
1600  if (i==m_subfrag_size-3)
1601  logstr << MSG::DEBUG << " End of data word found at pos " << pos <<endmsg;
1602  else
1603  logstr << MSG::ERROR << " Unexpected end-of-data word found at pos " << pos <<endmsg;
1604  }
1605  else // corrupt
1606  logstr<< MSG::ERROR << "Corrupted data in SubFragment 0x12 pos=" << pos << "channel=" <<chan << " [0x" <<
1607  MSG::hex << m_rodBlock[pos] << "]" << MSG::dec<<endmsg;
1608  } //end loop over subfrags
1609  if(m_dump) logstr << endmsg;
1610  }
1611  break;
1612  case 0x13: // ns TDC (for BPC) --------------------------------------
1613  {
1614  name="frag0x13chan";
1615  logstr << MSG::DEBUG << "Got SubFragment " << MSG::hex << m_subfrag_id << " name=" << name
1616  << " Data words = " << MSG::dec << m_subfrag_size-2<<endmsg;
1617  if(m_dump) logstr << MSG::INFO << " DUMP : "<< name<< " "<< m_subfrag_size-2 <<" words - " << endmsg;
1618  for( int i=0;i<m_subfrag_size-2;i++){
1620  // get channel number
1621  const int chan= (m_rodBlock[pos] >> 17) & 0xF; // bits 17-20
1622  const unsigned int tdc = m_rodBlock[pos] & 0xffff; // 16 first bits (0-15)
1623  const bool corrup = (m_rodBlock[pos]>>21)&0x1; // test bit 21
1624  const bool endofdata=!((m_rodBlock[pos] >> 23)&0x1); // test bit 23
1625  logstr << MSG::DEBUG << MSG::dec <<"Pos=" << pos << " Chan "<< chan << "=" << tdc
1626  << " EOD="<< endofdata << ", corrupt=" << corrup
1627  << " [0x" << MSG::hex << m_rodBlock[pos] << "]" << MSG::dec <<endmsg;
1628  if (!endofdata && !corrup) {
1629  os.str("");
1630  os << name << chan;
1631  TBTDCRaw * tbtdc = new TBTDCRaw(os.str(),false,tdc,false);
1632  m_tdcrawCont->push_back(tbtdc);
1633  const short bpc_ind = chan / 4 ;
1634  if(bpc_ind>4) {
1635  logstr<< MSG::DEBUG << "Error in 0x13 : found chan="<<chan<<" corresponding to bpc "<<bpc_ind<<endmsg;
1636  continue;
1637  }
1638  const short signaltype = tdc_order[chan % 4];
1639  if (BPCtdc[bpc_ind][signaltype]==NULL)
1640  BPCtdc[bpc_ind][signaltype] = tbtdc;
1641  }
1642  else
1643  if (endofdata) {
1644  if (i==m_subfrag_size-3)
1645  logstr << MSG::DEBUG << " End of data word found at pos " << pos <<endmsg;
1646  else
1647  logstr << MSG::ERROR << " Unexpected end-of-data word found at pos " << pos <<endmsg;
1648  }
1649  else // corrupt
1650  logstr<< MSG::ERROR << "Corrupted data in SubFragment 0x13 pos=" << pos << "channel=" <<chan << " [0x" <<
1651  MSG::hex << m_rodBlock[pos] << "]" << MSG::dec<<endmsg;
1652  } // end for loop
1653 
1654  }
1655  break;
1656  case 0x14: // ns TDC (for BPC) --------------------------------------
1657  {
1658  name="frag0x14chan";
1659  logstr << MSG::DEBUG << "Got SubFragment " << MSG::hex << m_subfrag_id << " name=" << name
1660  << " Data words = " << MSG::dec << m_subfrag_size-2<<endmsg;
1661 
1662 
1663  if(m_dump) logstr << MSG::INFO << " DUMP : "<< name<< " "<< m_subfrag_size-2 <<" words - " << endmsg;
1664 
1665 
1666  for( int i=0;i<m_subfrag_size-2;i++){
1668 
1669  // get channel number
1670  const int chan= (m_rodBlock[pos] >> 17) & 0xF; // bits 17-20
1671  const unsigned int tdc = m_rodBlock[pos] & 0xffff; // 16 first bits (0-15)
1672  const bool corrup = (m_rodBlock[pos]>>21)&0x1; // test bit 21
1673  const bool endofdata=!((m_rodBlock[pos] >> 23)&0x1); // test bit 23
1674  //const bool overflow=(m_rodBlock[pos]>>12)&1;
1675  //const bool underthresh=(m_rodBlock[pos]>>13)&1;
1676  logstr << MSG::DEBUG << MSG::dec << "Pos=" << pos << " Chan "<< chan << "=" << tdc
1677  << " EOD="<< endofdata << ", corrupt=" << corrup
1678  << " [0x" << MSG::hex << m_rodBlock[pos] << "]" << MSG::dec <<endmsg;
1679 
1680  if (!endofdata && !corrup) {
1681  os.str("");
1682  os << name << chan;
1683  TBTDCRaw * tbtdc = new TBTDCRaw(os.str(),false,tdc,false);
1684  m_tdcrawCont->push_back(tbtdc);
1685  const short bpc_ind = chan / 4 + 3;
1686  if(bpc_ind>4) { logstr<< MSG::DEBUG << "Error in 0x14 : found chan="<<chan<<" corresponding to bpc "<<bpc_ind<<endmsg;continue;}
1687  const short signaltype = tdc_order[chan % 4];
1688  if (BPCtdc[bpc_ind][signaltype]==NULL)
1689  BPCtdc[bpc_ind][signaltype] = tbtdc;
1690  }
1691  else
1692  if (endofdata) {
1693  if (i==m_subfrag_size-3)
1694  logstr << MSG::DEBUG << " End of data word found at pos " << pos <<endmsg;
1695  else
1696  logstr << MSG::ERROR << " Unexpected end-of-data word found at pos " << pos <<endmsg;
1697  }
1698  else // corrupt
1699  logstr<< MSG::ERROR << "Corrupted data in SubFragment 0x14 pos=" << pos << "channel=" <<chan << " [0x" <<
1700  MSG::hex << m_rodBlock[pos] << "]" << MSG::dec<<endmsg;
1701  } // end for loop
1702  }
1703  break;
1704  case 0x15: // trigger word --------------------------------------
1705  {
1706  logstr << MSG::INFO << "Found trigger word fragment" << endmsg;
1707  }
1708  break;
1709  default :
1710  logstr << MSG::DEBUG << "Found undefined subfragment id= "<< m_subfrag_id << endmsg;
1711  break;
1712 
1713  }
1714  }
1715 
1716 
1717 
1718  logstr << MSG::DEBUG << "Filling Scint" << endmsg;
1719 
1720  // fill scint container
1722  //m_scintrawCont->push_back(S0);
1723  //logstr << MSG::DEBUG << "S1 " << endmsg
1724 
1725  // Here some tdc maybe missing, so test for them :
1726  if(S0tdc) S0->setSignals(m_tdcrawCont,S0tdc,m_adcrawCont,dummyadc); //Scintillator 0 has only TDC
1727  else S0->setSignals(m_tdcrawCont,dummytdc,m_adcrawCont,dummyadc);
1729 
1730  if(S1tdc && S1adc) S1->setSignals(m_tdcrawCont,S1tdc,m_adcrawCont,S1adc);
1731  else S1->setSignals(m_tdcrawCont,dummytdc,m_adcrawCont,S1adc);
1733 
1734  if(S2uptdc) S2up->setSignals(m_tdcrawCont,S2uptdc,m_adcrawCont,S2upadc);
1735  else S2up->setSignals(m_tdcrawCont,dummytdc,m_adcrawCont,S2upadc);
1736  m_scintrawCont->push_back(S2up);
1737 
1738  if(S2downtdc) S2down->setSignals(m_tdcrawCont,S2downtdc,m_adcrawCont,S2downadc);
1739  else S2down->setSignals(m_tdcrawCont,dummytdc,m_adcrawCont,S2downadc);
1740  m_scintrawCont->push_back(S2down);
1741 
1742  if(S3lefttdc) S3left->setSignals(m_tdcrawCont,S3lefttdc,m_adcrawCont,S3leftadc);
1743  else S3left->setSignals(m_tdcrawCont,dummytdc,m_adcrawCont,S3leftadc);
1744  m_scintrawCont->push_back(S3left);
1745 
1746  if(S3righttdc) S3right->setSignals(m_tdcrawCont,S3righttdc,m_adcrawCont,S3rightadc);
1747  else S3right->setSignals(m_tdcrawCont,dummytdc,m_adcrawCont,S3rightadc);
1748  m_scintrawCont->push_back(S3right);
1749 
1750  C1->setSignals(m_tdcrawCont,dummytdc,m_adcrawCont,C1adc);
1751  m_scintrawCont->push_back(C1);
1752  C2->setSignals(m_tdcrawCont,dummytdc,m_adcrawCont,C2adc);
1754  muTag->setSignals(m_tdcrawCont,dummytdc,m_adcrawCont,muTagadc);
1755  m_scintrawCont->push_back(muTag);
1756  muHalo->setSignals(m_tdcrawCont,dummytdc,m_adcrawCont,muHaloadc);
1757  m_scintrawCont->push_back(muHalo);
1758  muVeto->setSignals(m_tdcrawCont,dummytdc,m_adcrawCont,muVetoadc);
1759  m_scintrawCont->push_back(muVeto);
1760  sTRT->setSignals(m_tdcrawCont,dummytdc,m_adcrawCont,sTRTadc);
1761  m_scintrawCont->push_back(sTRT);
1762 
1763 
1764  // fill bpc container
1765  logstr << MSG::DEBUG << "Filling BPC" << endmsg;
1766  m_bpcrawCont = new TBBPCRawCont();
1767 
1768  for(int i=0;i<BPCNum;i++){
1769  std::vector<const TBTDCRaw*> listtdc;
1770  std::vector<const TBADCRaw*> listadc;
1771  for(int j=0;j<4;j++){
1772  if(BPCtdc[i][j]==0) listtdc.push_back(dummytdc);
1773  else listtdc.push_back(BPCtdc[i][j]);
1774  }
1775  listadc.push_back(dummyadc); listadc.push_back(dummyadc);
1776  bpcraw[i]->setSignals(m_tdcrawCont,listtdc,m_adcrawCont,listadc);
1777  m_bpcrawCont->push_back(bpcraw[i]);
1778  }
1779 
1780 
1781 
1782  // -----------------------------------------------------------------------------------------------
1783 
1784  // Now Get info from TileAux RodBlock subdet ID = 0x70
1785  //sc=GetRODBlock((EventFormat::SubDetector) 0x70); //Possible improvement: Check if vector is already valid.
1786  sc=GetRODBlock(m_subdet_id,eformat::TILECAL_LASER_CRATE);
1787  if (sc!=StatusCode::SUCCESS) {
1788  // return sc;
1789  goodRodBlock = false;
1790  logstr << MSG::ERROR << "Tile laser crate ROD block error! Nothing valid in SG." << endmsg;
1791  }
1792  if (m_rodBlock.size()<2) {
1793  logstr << MSG::ERROR << "Tile laser crate ROD block too small! Nothing valid in SG" << endmsg;
1794  // return StatusCode::FAILURE;
1795  goodRodBlock = false;
1796  }
1797 
1798  // with this initialisation, first call of NextSubFrag will initialise correctly the index :
1799  m_subfrag_id=0;
1800  m_subfrag_size=2;
1802  // while(NextSubFrag()){
1803  while(NextSubFrag() and goodRodBlock ){
1804  switch(m_subfrag_id){
1805  case 0x1: // ADC1 block --------------------------------------
1806  {
1807  name="frag0x1chan";
1809  TBScintillatorRaw * SC1 = new TBScintillatorRaw("SC1");
1810  TBADCRaw* SC1adc = new TBADCRaw(name+"0",false,m_rodBlock[pos] & 0xfff);
1811  m_adcrawCont->push_back(SC1adc);
1812  SC1->setSignals(m_tdcrawCont,dummytdc,m_adcrawCont,SC1adc);
1813  m_scintrawCont->push_back(SC1);
1814 
1815  pos++;
1816  TBScintillatorRaw * SC2 = new TBScintillatorRaw("SC2");
1817  TBADCRaw* SC2adc = new TBADCRaw(name+"1",false,m_rodBlock[pos] & 0xfff);
1818  m_adcrawCont->push_back(SC2adc);
1819  SC2->setSignals(m_tdcrawCont,dummytdc,m_adcrawCont,SC2adc);
1820  m_scintrawCont->push_back(SC2);
1821  logstr << MSG::DEBUG << "Found Scintillator SC1 and SC2" << endmsg;
1822  break;
1823  }
1824  case 0x2: // ADC2 block --------------------------------------
1825  {
1826 
1828  for(int i=0;i<8;i++){
1829  pos=pos+i;
1830  std::stringstream RawName;
1831  RawName << "frag0x1chan"<<i;
1832  TBADCRaw* MuWalladc = new TBADCRaw(RawName.str(),false,m_rodBlock[pos] & 0xfff);
1833  m_adcrawCont->push_back(MuWalladc);
1834 
1835  std::stringstream MuWallName;
1836  MuWallName << "MuWall"<<i;
1837  TBScintillatorRaw* MuWallScint = new TBScintillatorRaw(MuWallName.str());
1838  MuWallScint->setSignals(m_tdcrawCont,dummytdc,m_adcrawCont,MuWalladc);
1839  m_scintrawCont->push_back(MuWallScint);
1840  }
1841  logstr << MSG::DEBUG << "Found first muWall block" << endmsg;
1842  break;
1843  }
1844  case 0x3: // ADC3 block --------------------------------------
1845  {
1846 
1848 
1849  for(int i=0;i<4;i++){
1850  pos=pos+i;
1851  std::stringstream RawName;
1852  RawName << "frag0x1chan"<<(i+8);
1853  TBADCRaw* MuWalladc = new TBADCRaw(name,false,m_rodBlock[pos] & 0xfff);
1854  m_adcrawCont->push_back(MuWalladc);
1855 
1856  std::stringstream MuWallName;
1857  MuWallName << "MuWall"<<i+8;
1858  TBScintillatorRaw* MuWallScint = new TBScintillatorRaw(MuWallName.str());
1859  MuWallScint->setSignals(m_tdcrawCont,dummytdc,m_adcrawCont,MuWalladc);
1860  m_scintrawCont->push_back(MuWallScint);
1861  }
1862  logstr << MSG::DEBUG << "Found second muWall block" << endmsg;
1863  break;
1864  }
1865  default :
1866  if (m_subfrag_id!=3 && m_subfrag_id!=5 && m_subfrag_id!=7)
1867  logstr << MSG::DEBUG << "Found undefined subfragment id= "<< m_subfrag_id << endmsg;
1868  break;
1869 
1870  }
1871  }
1872 
1873 
1874 
1875 
1876  // -----------------------------------------------------------------------------------------------
1877 
1878  // Now record object if they have not been invoked from converter
1879 
1880 // if(unrec_code!=1){ // If object was not requested by the converter, store it in SG
1881 // sc = m_storeGate->record(m_trigpat,m_keys[1]);
1882 // if ( sc.isFailure( ) ) {recordfailure=true;
1883 // logstr << MSG::FATAL << "Cannot record TBTrigPat " << endmsg;
1884 // }
1885 // }else {sc=StatusCode::SUCCESS; gotobject=true;} // else return success to converter
1886 
1887 
1888  if(unrec_code!=5){ // If object was not requested by the converter, store it in SG
1889  sc = evtStore()->record(m_bpcrawCont,m_keys[5]);
1890  if ( sc.isFailure( ) ) {recordfailure=true;
1891  logstr << MSG::FATAL << "Cannot record BPCRawCont" << endmsg;
1892  }
1893  }else {sc=StatusCode::SUCCESS; gotobject=true;} // else return success to converter
1894 
1895 
1896  if(unrec_code!=6){ // If object was not requested by the converter, store it in SG
1897  sc = evtStore()->record(m_scintrawCont,m_keys[6]);
1898  if ( sc.isFailure( ) ) {recordfailure=true;
1899  logstr << MSG::FATAL << "Cannot record ScintRawCont " << endmsg;
1900  }
1901  } else {sc=StatusCode::SUCCESS; gotobject=true;} // else return success to converter
1902 
1903 
1904  if(unrec_code!=2){ // If object was not requested by the converter, store it in SG
1905  sc = evtStore()->record(m_tdcrawCont,m_keys[2]);
1906  if ( sc.isFailure( ) ) {recordfailure=true;
1907  logstr << MSG::FATAL << "Cannot record TDCCont " << endmsg;
1908  }
1909  }else {sc=StatusCode::SUCCESS; gotobject=true;} // else return success to converter
1910 
1911  if(unrec_code!=3){ // If object was not requested by the converter, store it in SG
1912  sc = evtStore()->record(m_adcrawCont,m_keys[3]);
1913  if ( sc.isFailure( ) ) {recordfailure=true;
1914  logstr << MSG::FATAL << "Cannot record ADCCont " << endmsg;
1915  }
1916  }else {sc=StatusCode::SUCCESS; gotobject=true;} // else return success to converter
1917 
1918 
1921  if(unrec_code!=1) { // If object was not requested by the converter, store it in SG
1922  logstr << MSG::DEBUG << "Recording TBTriggerPatternUnit with key " << m_keys[1] << endmsg;
1923  // if(! evtStore()->contains<TBTriggerPatternUnit>(m_keys[1])) {
1924  sc = evtStore()->record(m_trigpat,m_keys[1]);
1925  if ( sc.isFailure( ) ) {
1926  logstr << MSG::ERROR << "Cannot record TBTrigPat " << endmsg;
1927  }
1928  } else {
1929  sc=StatusCode::SUCCESS;
1930  gotobject=true;
1931  } // else return success to converter
1932 
1933 
1934  logstr << MSG::DEBUG << " End of H8 Build " << endmsg;
1935  if(!gotobject) {logstr<< MSG::ERROR<< " Could not find object of type "<<unrec_code << endmsg; sc=StatusCode::FAILURE;}
1936  if(recordfailure) {logstr<< MSG::ERROR<< " One object could not be recorded "<< endmsg; sc=StatusCode::FAILURE;}
1937 
1938 
1939  return sc;
1940 }

◆ initialize()

StatusCode TBByteStreamCnvTool::initialize ( )
virtual

Definition at line 57 of file TBByteStreamCnvTool.cxx.

59  if (sc!=StatusCode::SUCCESS)
60  return sc;
61  MsgStream logstr(msgSvc(), name());
62  logstr << MSG::DEBUG << "Initialize" << endmsg;
63 
64  const LArOnlineID* online_id;
65  sc = detStore()->retrieve(online_id, "LArOnlineID");
66  if (sc.isFailure()) {
67  logstr << MSG::FATAL << "Could not get LArOnlineID helper !" << endmsg;
68  return StatusCode::FAILURE;
69  }
70  else {
71  m_onlineHelper=online_id;
72  logstr << MSG::DEBUG << " Found the LArOnlineID helper. " << endmsg;
73  }
74 
75  IToolSvc* toolSvc;
76  sc=service( "ToolSvc",toolSvc );
77  if (sc.isFailure()) {
78  logstr << MSG::ERROR << "Unable to retrieve ToolSvc" << endmsg;
79  return StatusCode::FAILURE;
80  }
81 
82  IService* svc;
83  sc= service("ByteStreamCnvSvc",svc);
84  if (sc!=StatusCode::SUCCESS)
85  {logstr << MSG::ERROR << " Can't get ByteStreamEventAccess interface " << endmsg;
86  return StatusCode::FAILURE;
87  }
88 
90  if (m_ByteStreamEventAccess==NULL)
91  {
92  logstr <<MSG::ERROR<< " Can't cast to ByteStreamCnvSvc " <<endmsg;
93  return StatusCode::FAILURE ;
94  }
95 
96  sc=service("ROBDataProviderSvc",svc);
97  if (sc!=StatusCode::SUCCESS)
98  {logstr << MSG::WARNING << " Can't get ROBDataProviderSvc. Reading of ByteStream Data not possible " << endmsg;
99  m_rdpSvc=0;
100  }
101  else
102  {m_rdpSvc=dynamic_cast<IROBDataProviderSvc*>(svc);
103  if(m_rdpSvc == 0 )
104  {logstr <<MSG::ERROR<< "Can't cast to ROBDataProviderSvc " <<endmsg;
105  return StatusCode::FAILURE;
106  }
107  }
108 
109 
110  std::vector<std::string>::const_iterator it = m_keys.begin();
111  std::vector<std::string>::const_iterator it_e = m_keys.end();
112  std::vector<std::string> keys;
113  keys.resize(24);
114  for(; it!=it_e;++it) {
115  const ListItem &item(*it);
116  const std::string &t = item.type();
117  const std::string &nm = item.name();
118  logstr << MSG::DEBUG << " type "<<t<<" name="<<nm<<endmsg;
119  if(t=="TBTDC") keys[0]=nm;
120  if(t=="TBTriggerPatternUnit") keys[1]=nm;
121  if(t=="TBTDCRawCont") keys[2]=nm;
122  if(t=="TBADCRawCont") keys[3]=nm;
123  if(t=="TBTailCatcherRaw") keys[4]=nm;
124  if(t=="TBBPCRawCont") keys[5]=nm;
125  if(t=="TBScintillatorRawCont") keys[6]=nm;
126  if(t=="TBMWPCRawCont") keys[7]=nm;
127  }
128  // Fixed name.
129  keys[10]="FREE";
130  keys[11]="LOW";
131  keys[12]="MEDIUM";
132  keys[13]="HIGH";
133  // name for Calib Digits
134  keys[20]="FREE";
135  keys[21]="LOW";
136  keys[22]="MEDIUM";
137  keys[23]="HIGH";
138 
139 
140  m_keys=std::move(keys);
141  m_subdet_id=(eformat::SubDetector)m_subdet_key;
142 
143  m_isCalib = false;
144 
145  m_febgain.clear();
146 
148 
149  return StatusCode::SUCCESS;
150 }

◆ inputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::inputHandles ( ) const
overridevirtualinherited

Return this algorithm's input handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ interfaceID()

const InterfaceID & TBByteStreamCnvTool::interfaceID ( )
static

Definition at line 31 of file TBByteStreamCnvTool.cxx.

32 {
33  static const InterfaceID IID_ITBByteStreamCnvTool
34  ("TBByteStreamCnvTool", 1, 0);
35  return IID_ITBByteStreamCnvTool;
36 }

◆ msg() [1/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

24  {
25  return this->msgStream();
26  }

◆ msg() [2/2]

MsgStream& AthCommonMsg< AlgTool >::msg ( const MSG::Level  lvl) const
inlineinherited

Definition at line 27 of file AthCommonMsg.h.

27  {
28  return this->msgStream(lvl);
29  }

◆ msgLvl()

bool AthCommonMsg< AlgTool >::msgLvl ( const MSG::Level  lvl) const
inlineinherited

Definition at line 30 of file AthCommonMsg.h.

30  {
31  return this->msgLevel(lvl);
32  }

◆ NextSubFrag()

bool TBByteStreamCnvTool::NextSubFrag ( )
inlineprivate

Definition at line 114 of file TBByteStreamCnvTool.h.

114  {
116  if(m_subfrag_firstdata<int(m_rodBlock.size())){
119  return true;
120  }else return false;
121  }

◆ outputHandles()

virtual std::vector<Gaudi::DataHandle*> AthCommonDataStore< AthCommonMsg< AlgTool > >::outputHandles ( ) const
overridevirtualinherited

Return this algorithm's output handles.

We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.

◆ ReadFragment() [1/12]

StatusCode TBByteStreamCnvTool::ReadFragment ( int  unrec_code)

Definition at line 292 of file TBByteStreamCnvTool.cxx.

292  {
293 
294  StatusCode sc;
295  if(m_H6run) sc=H6BuildObjects(unrec_code); // build all objects, do not record object unrec_code
296  if(m_H8run) sc=H8BuildObjects(unrec_code); // build all objects, do not record object unrec_code
297  return sc;
298 }

◆ ReadFragment() [2/12]

StatusCode TBByteStreamCnvTool::ReadFragment ( TBADCRawCont *&  adcrawCont,
const std::string &  key 
)

Definition at line 339 of file TBByteStreamCnvTool.cxx.

340 {MsgStream logstr(msgSvc(), name());
341  logstr << MSG::DEBUG <<" in ReadFragment (TBADCRawCont) key="<<key<<endmsg;
343  if(sc) adcrawCont = m_adcrawCont;
344  return sc;
345 }

◆ ReadFragment() [3/12]

StatusCode TBByteStreamCnvTool::ReadFragment ( TBBPCRawCont *&  bpcrawCont,
const std::string &  key 
)

Definition at line 322 of file TBByteStreamCnvTool.cxx.

323 {MsgStream logstr(msgSvc(), name());
324  logstr << MSG::DEBUG <<" in ReadFragment (TBBPCRawCont) key="<<key<<endmsg;
326  if(sc) bpcrawCont = m_bpcrawCont;
327  logstr << MSG::DEBUG <<" End ReadFragment (TBBPCRawCont) key="<<key<<endmsg;
328  return sc;
329 }

◆ ReadFragment() [4/12]

StatusCode TBByteStreamCnvTool::ReadFragment ( TBEventInfo *&  tbeventinfo,
const std::string &  key 
)

Definition at line 377 of file TBByteStreamCnvTool.cxx.

378 {MsgStream logstr(msgSvc(), name());
379  logstr << MSG::DEBUG <<" in ReadFragment (TBEventInfo) key="<<key<<endmsg;
381  if(sc) tbeventinfo = m_eventinfo;
382  return sc;
383 }

◆ ReadFragment() [5/12]

StatusCode TBByteStreamCnvTool::ReadFragment ( TBLArCalibDigitContainer *&  tblarcalibdigitcont,
const std::string &  key 
)

Definition at line 404 of file TBByteStreamCnvTool.cxx.

405 {MsgStream logstr(msgSvc(), name());
406  logstr << MSG::DEBUG <<" in ReadFragment (TBLArCalibDigitContainer) key="<<key<<endmsg;
407  int code=0;
408  if(key=="FREE") code = 20;
409  if(key=="LOW") code = 21;
410  if(key=="HIGH") code = 22;
411  if(key=="MEDIUM") code = 23;
412  if(code){
414  if(sc) tblarcalibdigitcont = m_tblarcalibdigitcont[code-20];
415  return sc;
416  }else{
417  logstr << MSG::ERROR <<" Can not create a LArCalibDigitContainer with key="<<key<<endmsg;
418  tblarcalibdigitcont =0;
419  return StatusCode::FAILURE;
420  }
421 }

◆ ReadFragment() [6/12]

StatusCode TBByteStreamCnvTool::ReadFragment ( TBLArDigitContainer *&  tblardigitcont,
const std::string &  key 
)

Definition at line 385 of file TBByteStreamCnvTool.cxx.

386 {MsgStream logstr(msgSvc(), name());
387  logstr << MSG::DEBUG <<" in ReadFragment (TBLArDigitContainer) key="<<key<<endmsg;
388  int code=0;
389  if(key=="FREE") code = 10;
390  if(key=="LOW") code = 11;
391  if(key=="HIGH") code = 12;
392  if(key=="MEDIUM") code = 13;
393  if(code){
395  if(sc) tblardigitcont = m_tblardigitcont[code-10];
396  return sc;
397  }else{
398  logstr << MSG::ERROR <<" Can not create a LArDigitContainer with key="<<key<<endmsg;
399  tblardigitcont =0;
400  return StatusCode::FAILURE;
401  }
402 }

◆ ReadFragment() [7/12]

StatusCode TBByteStreamCnvTool::ReadFragment ( TBMWPCRawCont *&  mwpcrawCont,
const std::string &  key 
)

Definition at line 331 of file TBByteStreamCnvTool.cxx.

332 {MsgStream logstr(msgSvc(), name());
333  logstr << MSG::DEBUG <<" in ReadFragment (TBMWPCRawCont) key="<<key<<endmsg;
335  if(sc) mwpcrawCont = m_mwpcrawCont;
336  return sc;
337 }

◆ ReadFragment() [8/12]

StatusCode TBByteStreamCnvTool::ReadFragment ( TBScintillatorRawCont *&  scintrawCont,
const std::string &  key 
)

Definition at line 362 of file TBByteStreamCnvTool.cxx.

363 {MsgStream logstr(msgSvc(), name());
364  logstr << MSG::DEBUG <<" in ReadFragment (TBScintrawcont) key="<<key<<endmsg;
366  if(sc) scintrawCont = m_scintrawCont;
367  return sc;
368 }

◆ ReadFragment() [9/12]

StatusCode TBByteStreamCnvTool::ReadFragment ( TBTailCatcherRaw *&  tailcatchraw,
const std::string &  key 
)

Definition at line 370 of file TBByteStreamCnvTool.cxx.

371 {MsgStream logstr(msgSvc(), name());
372  logstr << MSG::DEBUG <<" in ReadFragment (TBTailCatcherRaw) key="<<key<<endmsg;
374  if(sc) tailcatchraw = m_tailcatchraw;
375  return sc;
376 }

◆ ReadFragment() [10/12]

StatusCode TBByteStreamCnvTool::ReadFragment ( TBTDC *&  tdc,
const std::string &  key 
)

This method is used only for testing

Definition at line 300 of file TBByteStreamCnvTool.cxx.

301 {
303  MsgStream logstr(msgSvc(), name());
304  logstr << MSG::DEBUG <<" in ReadFragment (TBTDC) key="<<key<<endmsg;
305  StatusCode sc=GetRODBlock(m_subdet_id); //Possible improvement: Check if vector is already valid.
306  if (sc!=StatusCode::SUCCESS)
307  return sc;
308  if (m_rodBlock.size()<2)
309  {
310  logstr << "ReadRodBlock: RodBlock too small!" << endmsg;
311  return StatusCode::FAILURE;
312  }
313  int tdc=m_rodBlock[0];
314  int tdcmin=m_rodBlock[1];
315  logstr << MSG::DEBUG <<" tdc = "<< tdc <<endmsg;
316  logstr << MSG::DEBUG <<" tdcmin = "<< tdcmin <<endmsg;
317  tbtdc=new TBTDC(tdc,tdcmin);
318  return StatusCode::SUCCESS;
319  // return sc;
320 }

◆ ReadFragment() [11/12]

StatusCode TBByteStreamCnvTool::ReadFragment ( TBTDCRawCont *&  tdcrawCont,
const std::string &  key 
)

Definition at line 346 of file TBByteStreamCnvTool.cxx.

347 {MsgStream logstr(msgSvc(), name());
348  logstr << MSG::DEBUG <<" in ReadFragment (TBTDCRawCont) key="<<key<<endmsg;
350  if(sc) tdcrawCont = m_tdcrawCont;
351  return sc;
352 }

◆ ReadFragment() [12/12]

StatusCode TBByteStreamCnvTool::ReadFragment ( TBTriggerPatternUnit *&  trigpat,
const std::string &  key 
)

Definition at line 354 of file TBByteStreamCnvTool.cxx.

355 {MsgStream logstr(msgSvc(), name());
356  logstr << MSG::DEBUG <<" in ReadFragment (TBTriggerPatternUnit) key="<<key<<endmsg;
358  if(sc) trigpat = m_trigpat;
359  return sc;
360 }

◆ renounce()

std::enable_if_t<std::is_void_v<std::result_of_t<decltype(&T::renounce)(T)> > && !std::is_base_of_v<SG::VarHandleKeyArray, T> && std::is_base_of_v<Gaudi::DataHandle, T>, void> AthCommonDataStore< AthCommonMsg< AlgTool > >::renounce ( T &  h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381  {
382  h.renounce();
383  PBASE::renounce (h);
384  }

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::renounceArray ( SG::VarHandleKeyArray handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364  {
365  handlesArray.renounce();
366  }

◆ secondword()

unsigned short TBByteStreamCnvTool::secondword ( unsigned int  w)
inlineprivate

Definition at line 193 of file TBByteStreamCnvTool.h.

193  {
194  return w >> 16;
195  }

◆ sysInitialize()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysInitialize ( )
overridevirtualinherited

Perform system initialization for an algorithm.

We override this to declare all the elements of handle key arrays at the end of initialization. See comments on updateVHKA.

Reimplemented in DerivationFramework::CfAthAlgTool, AthCheckedComponent< AthAlgTool >, AthCheckedComponent<::AthAlgTool >, and asg::AsgMetadataTool.

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< AlgTool > >::sysStart ( )
overridevirtualinherited

Handle START transition.

We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.

◆ testbit()

bool TBByteStreamCnvTool::testbit ( int  n,
unsigned short  w 
)
inlineprivate

Definition at line 203 of file TBByteStreamCnvTool.h.

203  {
204  return (w & (1<<n));
205  }

◆ updateVHKA()

void AthCommonDataStore< AthCommonMsg< AlgTool > >::updateVHKA ( Gaudi::Details::PropertyBase &  )
inlineinherited

Definition at line 308 of file AthCommonDataStore.h.

308  {
309  // debug() << "updateVHKA for property " << p.name() << " " << p.toString()
310  // << " size: " << m_vhka.size() << endmsg;
311  for (auto &a : m_vhka) {
312  std::vector<SG::VarHandleKey*> keys = a->keys();
313  for (auto k : keys) {
314  k->setOwner(this);
315  }
316  }
317  }

◆ WriteFragment()

StatusCode TBByteStreamCnvTool::WriteFragment ( )

This creates the fragment for beam detectors calling BuildRodBlock method

Definition at line 163 of file TBByteStreamCnvTool.cxx.

164 {
168  MsgStream logstr(msgSvc(), name());
169  logstr << MSG::DEBUG << "WriteFragment" << endmsg;
170  //Check if Fragment is already written
171  const EventInfo* thisEventInfo;
172  StatusCode sc=evtStore()->retrieve(thisEventInfo);
173  if (sc!=StatusCode::SUCCESS)
174  {logstr << MSG::WARNING << "No EventInfo object found!" << endmsg;
175  return sc;
176  }
177  const EventID* thisEvent=thisEventInfo->event_ID();
178  if (m_lastEventID==*thisEvent)
179  {logstr << MSG::WARNING << "LArByteStrem persistency representation for Event #"<<thisEvent->event_number()
180  << " already created!" << endmsg;
181  return StatusCode::SUCCESS;
182  }
183  else //New event ID
184  m_lastEventID=*thisEvent;
185 
186  // Get the already existing part of the RawEvent
188 
189  // delete previous fragments
190  if (m_theRodBlock) delete m_theRodBlock;
191  if (m_theROB) delete m_theROB;
192 
193  //Make a new ROD-Fragment
194  m_theRodBlock=new std::vector<uint32_t>;
195 
197 
198  if (sc!=StatusCode::SUCCESS)
199  return sc;
200 
201  //Header elements for new Fragments
202  const uint8_t module_id=0;
203  const uint32_t lvl1_id=re->lvl1_id();
204  const uint32_t bc_id=0;
205  const uint32_t lvl1_type = 0;
206  const uint32_t detev_type=0;
207  const bool status_place=eformat::STATUS_BACK;
208  const uint32_t run_no=re->run_no();
209 
210  //Make a new ROB-Fragment...
211  eformat::helper::SourceIdentifier robsid(m_subdet_id, module_id);
213  (robsid.code(),run_no,lvl1_id,bc_id,lvl1_type,detev_type,m_theRodBlock->size(),
214  &(*m_theRodBlock)[0],status_place);
215 
216  re->append(m_theROB); //Append the newly created Subdetector-Fragment to the full event
217  logstr << MSG::DEBUG << "Appended TestBeam fragment to ByteStream" << endmsg;
218  return StatusCode::SUCCESS;
219 }

Member Data Documentation

◆ m_adcrawCont

TBADCRawCont* TBByteStreamCnvTool::m_adcrawCont
private

Definition at line 129 of file TBByteStreamCnvTool.h.

◆ m_arrayofgain

CaloGain::CaloGain TBByteStreamCnvTool::m_arrayofgain[128][4]
private

Definition at line 147 of file TBByteStreamCnvTool.h.

◆ m_arrayofsample

std::vector<short> TBByteStreamCnvTool::m_arrayofsample[128][4]
private

Definition at line 146 of file TBByteStreamCnvTool.h.

◆ m_beam_moment

float TBByteStreamCnvTool::m_beam_moment
private

Definition at line 177 of file TBByteStreamCnvTool.h.

◆ m_beam_part

std::string TBByteStreamCnvTool::m_beam_part
private

Definition at line 178 of file TBByteStreamCnvTool.h.

◆ m_boards

std::vector<int> TBByteStreamCnvTool::m_boards
private

Definition at line 141 of file TBByteStreamCnvTool.h.

◆ m_bpcrawCont

TBBPCRawCont* TBByteStreamCnvTool::m_bpcrawCont
private

Definition at line 130 of file TBByteStreamCnvTool.h.

◆ m_ByteStreamEventAccess

ByteStreamCnvSvc* TBByteStreamCnvTool::m_ByteStreamEventAccess
private

Definition at line 91 of file TBByteStreamCnvTool.h.

◆ m_calib_dac

uint16_t TBByteStreamCnvTool::m_calib_dac
private

Definition at line 168 of file TBByteStreamCnvTool.h.

◆ m_calib_delay

uint16_t TBByteStreamCnvTool::m_calib_delay
private

Definition at line 169 of file TBByteStreamCnvTool.h.

◆ m_calib_error

bool TBByteStreamCnvTool::m_calib_error
private

Definition at line 170 of file TBByteStreamCnvTool.h.

◆ m_calib_pattern

unsigned char TBByteStreamCnvTool::m_calib_pattern[16]
private

Definition at line 167 of file TBByteStreamCnvTool.h.

◆ m_CLKey

SG::ReadCondHandleKey<LArCalibLineMapping> TBByteStreamCnvTool::m_CLKey {this, "CalibLineKey", "LArCalibLineMap", "SG calib line key"}
private

Definition at line 123 of file TBByteStreamCnvTool.h.

◆ m_cryoAngle

float TBByteStreamCnvTool::m_cryoAngle
private

Definition at line 180 of file TBByteStreamCnvTool.h.

◆ m_cryoX

float TBByteStreamCnvTool::m_cryoX
private

Definition at line 179 of file TBByteStreamCnvTool.h.

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default)

Definition at line 393 of file AthCommonDataStore.h.

◆ m_DontCheckRodSubDetID

const eformat::SubDetector TBByteStreamCnvTool::m_DontCheckRodSubDetID =(eformat::SubDetector)0xff
staticprivate

Definition at line 89 of file TBByteStreamCnvTool.h.

◆ m_dump

bool TBByteStreamCnvTool::m_dump
private

Definition at line 105 of file TBByteStreamCnvTool.h.

◆ m_ev_number

int TBByteStreamCnvTool::m_ev_number
private

Definition at line 175 of file TBByteStreamCnvTool.h.

◆ m_eventinfo

TBEventInfo* TBByteStreamCnvTool::m_eventinfo
private

Definition at line 135 of file TBByteStreamCnvTool.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default)

Definition at line 390 of file AthCommonDataStore.h.

◆ m_febgain

std::vector<int> TBByteStreamCnvTool::m_febgain
private

Definition at line 144 of file TBByteStreamCnvTool.h.

◆ m_firstsamples

std::vector<int> TBByteStreamCnvTool::m_firstsamples
private

Definition at line 145 of file TBByteStreamCnvTool.h.

◆ m_force_Hchoice

bool TBByteStreamCnvTool::m_force_Hchoice
private

Definition at line 104 of file TBByteStreamCnvTool.h.

◆ m_gains

std::vector<int> TBByteStreamCnvTool::m_gains
private

Definition at line 143 of file TBByteStreamCnvTool.h.

◆ m_H6run

bool TBByteStreamCnvTool::m_H6run
private

Definition at line 102 of file TBByteStreamCnvTool.h.

◆ m_h8_triggword

unsigned int TBByteStreamCnvTool::m_h8_triggword
private

Definition at line 187 of file TBByteStreamCnvTool.h.

◆ m_H8run

bool TBByteStreamCnvTool::m_H8run
private

Definition at line 103 of file TBByteStreamCnvTool.h.

◆ m_isCalib

bool TBByteStreamCnvTool::m_isCalib
private

Definition at line 166 of file TBByteStreamCnvTool.h.

◆ m_keys

std::vector<std::string> TBByteStreamCnvTool::m_keys
private

Definition at line 106 of file TBByteStreamCnvTool.h.

◆ m_lastEventID

EventID TBByteStreamCnvTool::m_lastEventID
private

Definition at line 93 of file TBByteStreamCnvTool.h.

◆ m_mwpcrawCont

TBMWPCRawCont* TBByteStreamCnvTool::m_mwpcrawCont
private

Definition at line 131 of file TBByteStreamCnvTool.h.

◆ m_onlineHelper

const LArOnlineID* TBByteStreamCnvTool::m_onlineHelper
private

Definition at line 96 of file TBByteStreamCnvTool.h.

◆ m_rdpSvc

IROBDataProviderSvc* TBByteStreamCnvTool::m_rdpSvc
private

Definition at line 92 of file TBByteStreamCnvTool.h.

◆ m_rodBlock

std::vector<uint32_t> TBByteStreamCnvTool::m_rodBlock
private

Definition at line 95 of file TBByteStreamCnvTool.h.

◆ m_run_num

unsigned int TBByteStreamCnvTool::m_run_num
private

Definition at line 176 of file TBByteStreamCnvTool.h.

◆ m_samples

std::vector<int> TBByteStreamCnvTool::m_samples
private

Definition at line 142 of file TBByteStreamCnvTool.h.

◆ m_scintrawCont

TBScintillatorRawCont* TBByteStreamCnvTool::m_scintrawCont
private

Definition at line 133 of file TBByteStreamCnvTool.h.

◆ m_subdet_id

eformat::SubDetector TBByteStreamCnvTool::m_subdet_id
private

Definition at line 94 of file TBByteStreamCnvTool.h.

◆ m_subdet_key

int TBByteStreamCnvTool::m_subdet_key
private

Definition at line 107 of file TBByteStreamCnvTool.h.

◆ m_subfrag_firstdata

int TBByteStreamCnvTool::m_subfrag_firstdata
private

Definition at line 112 of file TBByteStreamCnvTool.h.

◆ m_subfrag_id

int TBByteStreamCnvTool::m_subfrag_id
private

Definition at line 110 of file TBByteStreamCnvTool.h.

◆ m_subfrag_size

int TBByteStreamCnvTool::m_subfrag_size
private

Definition at line 111 of file TBByteStreamCnvTool.h.

◆ m_summary_path

std::string TBByteStreamCnvTool::m_summary_path
private

Definition at line 182 of file TBByteStreamCnvTool.h.

◆ m_tableY

float TBByteStreamCnvTool::m_tableY
private

Definition at line 181 of file TBByteStreamCnvTool.h.

◆ m_tailcatchraw

TBTailCatcherRaw* TBByteStreamCnvTool::m_tailcatchraw
private

Definition at line 134 of file TBByteStreamCnvTool.h.

◆ m_tblarcalibdigitcont

TBLArCalibDigitContainer* TBByteStreamCnvTool::m_tblarcalibdigitcont[4]
private

Definition at line 137 of file TBByteStreamCnvTool.h.

◆ m_tblardigitcont

TBLArDigitContainer* TBByteStreamCnvTool::m_tblardigitcont[4]
private

Definition at line 136 of file TBByteStreamCnvTool.h.

◆ m_tbtdc

TBTDC* TBByteStreamCnvTool::m_tbtdc
private

Definition at line 127 of file TBByteStreamCnvTool.h.

◆ m_tdcrawCont

TBTDCRawCont* TBByteStreamCnvTool::m_tdcrawCont
private

Definition at line 128 of file TBByteStreamCnvTool.h.

◆ m_theROB

OFFLINE_FRAGMENTS_NAMESPACE_WRITE::ROBFragment* TBByteStreamCnvTool::m_theROB
private

Definition at line 100 of file TBByteStreamCnvTool.h.

◆ m_theRodBlock

std::vector<uint32_t>* TBByteStreamCnvTool::m_theRodBlock
private

Definition at line 99 of file TBByteStreamCnvTool.h.

◆ m_trigpat

TBTriggerPatternUnit* TBByteStreamCnvTool::m_trigpat
private

Definition at line 132 of file TBByteStreamCnvTool.h.

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< AlgTool > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

std::vector<SG::VarHandleKeyArray*> AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
privateinherited

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files:
TBByteStreamCnvTool::m_tableY
float m_tableY
Definition: TBByteStreamCnvTool.h:181
TBTDCRaw
Definition: TBTDCRaw.h:21
plotBeamSpotCompare.x1
x1
Definition: plotBeamSpotCompare.py:216
RawEventWrite
OFFLINE_FRAGMENTS_NAMESPACE_WRITE::FullEventFragment RawEventWrite
data type for writing raw event
Definition: RawEvent.h:39
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:195
TBByteStreamCnvTool::m_h8_triggword
unsigned int m_h8_triggword
Definition: TBByteStreamCnvTool.h:187
ReadCellNoiseFromCoolCompare.s1
s1
Definition: ReadCellNoiseFromCoolCompare.py:378
TBByteStreamCnvTool::m_boards
std::vector< int > m_boards
Definition: TBByteStreamCnvTool.h:141
S1
struct TBPatternUnitContext S1
TBByteStreamCnvTool::m_tailcatchraw
TBTailCatcherRaw * m_tailcatchraw
Definition: TBByteStreamCnvTool.h:134
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
scale2
#define scale2
Definition: JetAttributeHisto.cxx:42
TBByteStreamCnvTool::m_cryoX
float m_cryoX
Definition: TBByteStreamCnvTool.h:179
ReadCellNoiseFromCool.name1
name1
Definition: ReadCellNoiseFromCool.py:233
DeMoUpdate.tmp2
string tmp2
Definition: DeMoUpdate.py:1168
python.PerfMonSerializer.p
def p
Definition: PerfMonSerializer.py:743
xAOD::word1
word1
Definition: eFexEMRoI_v1.cxx:82
TBBPCRaw
raw data class for BPC measurement
Definition: TBBPCRaw.h:33
TBByteStreamCnvTool::m_summary_path
std::string m_summary_path
Definition: TBByteStreamCnvTool.h:182
TBADCRaw
Definition: TBADCRaw.h:21
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:19
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:575
TBByteStreamCnvTool::m_H8run
bool m_H8run
Definition: TBByteStreamCnvTool.h:103
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
TBMWPCRaw::addNwires
void addNwires(int nwire)
Definition: TBMWPCRaw.h:67
TBByteStreamCnvTool::m_firstsamples
std::vector< int > m_firstsamples
Definition: TBByteStreamCnvTool.h:145
TBByteStreamCnvTool::m_calib_error
bool m_calib_error
Definition: TBByteStreamCnvTool.h:170
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
Veto
struct TBPatternUnitContext Veto
TBByteStreamCnvTool::m_tbtdc
TBTDC * m_tbtdc
Definition: TBByteStreamCnvTool.h:127
calibdata.chamber
chamber
Definition: calibdata.py:32
AthCommonDataStore< AthCommonMsg< AlgTool > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
CaloGain::UNKNOWNGAIN
@ UNKNOWNGAIN
Definition: CaloGain.h:20
initialize
void initialize()
Definition: run_EoverP.cxx:894
S3
struct TBPatternUnitContext S3
TBH6ByteStream-Monitor-EventStorage.tdcmin
tdcmin
Definition: TBH6ByteStream-Monitor-EventStorage.py:143
CaloCondBlobAlgs_fillNoiseFromASCII.gain
gain
Definition: CaloCondBlobAlgs_fillNoiseFromASCII.py:110
CaloTime_fillDB.gain2
gain2
Definition: CaloTime_fillDB.py:357
RawEvent
OFFLINE_FRAGMENTS_NAMESPACE::FullEventFragment RawEvent
data type for reading raw event
Definition: RawEvent.h:37
TBMWPCRawCont
Definition: TBMWPCRawCont.h:18
skel.it
it
Definition: skel.GENtoEVGEN.py:423
ByteStreamCnvSvc::getRawEvent
virtual RawEventWrite * getRawEvent() override
Implementation of IByteStreamEventAccess: Get RawEvent.
Definition: ByteStreamCnvSvc.h:55
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
TBByteStreamCnvTool::m_keys
std::vector< std::string > m_keys
Definition: TBByteStreamCnvTool.h:106
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
TBByteStreamCnvTool::m_lastEventID
EventID m_lastEventID
Definition: TBByteStreamCnvTool.h:93
TBByteStreamCnvTool::m_H6run
bool m_H6run
Definition: TBByteStreamCnvTool.h:102
TBMWPCRaw
Definition: TBMWPCRaw.h:23
TBByteStreamCnvTool::m_arrayofgain
CaloGain::CaloGain m_arrayofgain[128][4]
Definition: TBByteStreamCnvTool.h:147
TBByteStreamCnvTool::getCaloGain
CaloGain::CaloGain getCaloGain(int gain)
Definition: TBByteStreamCnvTool.h:150
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
HWIdentifier
Definition: HWIdentifier.h:13
TBByteStreamCnvTool::m_theROB
OFFLINE_FRAGMENTS_NAMESPACE_WRITE::ROBFragment * m_theROB
Definition: TBByteStreamCnvTool.h:100
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
TBByteStreamCnvTool::m_CLKey
SG::ReadCondHandleKey< LArCalibLineMapping > m_CLKey
Definition: TBByteStreamCnvTool.h:124
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
TBByteStreamCnvTool::m_beam_moment
float m_beam_moment
Definition: TBByteStreamCnvTool.h:177
TBByteStreamCnvTool::m_rodBlock
std::vector< uint32_t > m_rodBlock
Definition: TBByteStreamCnvTool.h:95
TBByteStreamCnvTool::m_theRodBlock
std::vector< uint32_t > * m_theRodBlock
Definition: TBByteStreamCnvTool.h:99
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
TBByteStreamCnvTool::m_febgain
std::vector< int > m_febgain
Definition: TBByteStreamCnvTool.h:144
TBBeamDetector::setOverflow
virtual void setOverflow()
Definition: TBBeamDetector.h:51
PyPoolBrowser.item
item
Definition: PyPoolBrowser.py:129
TBByteStreamCnvTool::m_eventinfo
TBEventInfo * m_eventinfo
Definition: TBByteStreamCnvTool.h:135
TBByteStreamCnvTool::m_calib_pattern
unsigned char m_calib_pattern[16]
Definition: TBByteStreamCnvTool.h:167
AthCommonDataStore< AthCommonMsg< AlgTool > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
IROBDataProviderSvc
Interface class for managing ROB for both online and offline.
Definition: IROBDataProviderSvc.h:25
TBLArCalibDigitContainer
Liquid Argon Calibration Digit Container
Definition: TBLArCalibDigitContainer.h:26
OFFLINE_FRAGMENTS_NAMESPACE::PointerType
const DataType * PointerType
Definition: RawEvent.h:25
TBByteStreamCnvTool::GetRODBlock
StatusCode GetRODBlock(eformat::SubDetector subdet_id, eformat::SubDetector subdet_rod_id=m_DontCheckRodSubDetID)
Definition: TBByteStreamCnvTool.cxx:425
TBByteStreamCnvTool::firstnbit
unsigned short firstnbit(int n, unsigned short w)
Definition: TBByteStreamCnvTool.h:197
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
ByteStreamCnvSvc
Gaudi Conversion Service class for ByteStream Persistency.
Definition: ByteStreamCnvSvc.h:34
TBBeamDetector::setDetectorName
virtual void setDetectorName(const std::string &tbBeamDetectorName)
Definition: TBBeamDetector.h:48
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
FullCPAlgorithmsTest_eljob.sample
sample
Definition: FullCPAlgorithmsTest_eljob.py:100
StdJOSetup.msgSvc
msgSvc
Provide convenience handles for various services.
Definition: StdJOSetup.py:36
LArDigit
Liquid Argon digit base class.
Definition: LArDigit.h:25
TBByteStreamCnvTool::H6RecordObjects
StatusCode H6RecordObjects(int unrec_code)
Definition: TBByteStreamCnvTool.cxx:1942
TBByteStreamCnvTool::m_gains
std::vector< int > m_gains
Definition: TBByteStreamCnvTool.h:143
eformat::ROBFragment
Definition: L1CaloBsDecoderUtil.h:12
lumiFormat.i
int i
Definition: lumiFormat.py:92
ReadCellNoiseFromCool.chan
chan
Definition: ReadCellNoiseFromCool.py:52
TBByteStreamCnvTool::m_samples
std::vector< int > m_samples
Definition: TBByteStreamCnvTool.h:142
python.CaloCondTools.g
g
Definition: CaloCondTools.py:15
beamspotman.n
n
Definition: beamspotman.py:731
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
EventInfo::event_ID
EventID * event_ID()
the unique identification of the event.
Definition: EventInfo/EventInfo/EventInfo.h:210
TBByteStreamCnvTool::m_mwpcrawCont
TBMWPCRawCont * m_mwpcrawCont
Definition: TBByteStreamCnvTool.h:131
TBByteStreamCnvTool::m_tdcrawCont
TBTDCRawCont * m_tdcrawCont
Definition: TBByteStreamCnvTool.h:128
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
TBScintillatorRaw
Definition: TBScintillatorRaw.h:26
TBByteStreamCnvTool::m_isCalib
bool m_isCalib
Definition: TBByteStreamCnvTool.h:166
test_pyathena.parent
parent
Definition: test_pyathena.py:15
TBByteStreamCnvTool::secondword
unsigned short secondword(unsigned int w)
Definition: TBByteStreamCnvTool.h:193
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
TBByteStreamCnvTool::m_subdet_key
int m_subdet_key
Definition: TBByteStreamCnvTool.h:107
TBTDC::tdc
int tdc() const
Definition: TBTDC.h:28
TBTDCRawCont
Definition: TBTDCRawCont.h:21
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
TBByteStreamCnvTool::m_ev_number
int m_ev_number
Definition: TBByteStreamCnvTool.h:175
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
DeMoUpdate.tmp
string tmp
Definition: DeMoUpdate.py:1167
TBByteStreamCnvTool::m_ByteStreamEventAccess
ByteStreamCnvSvc * m_ByteStreamEventAccess
Definition: TBByteStreamCnvTool.h:91
ReadFromCoolCompare.os
os
Definition: ReadFromCoolCompare.py:231
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
TBByteStreamCnvTool::ReadFragment
StatusCode ReadFragment(int unrec_code)
Definition: TBByteStreamCnvTool.cxx:292
TBTDC
Definition: TBTDC.h:17
SG::VarHandleKeyArray::renounce
virtual void renounce()=0
SG::HandleClassifier::type
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
Definition: HandleClassifier.h:54
TBTriggerPatternUnit::setTriggerWord
void setTriggerWord(unsigned int word)
Definition: TBTriggerPatternUnit.cxx:26
CaloTime_fillDB.gain1
gain1
Definition: CaloTime_fillDB.py:356
TBByteStreamCnvTool::NextSubFrag
bool NextSubFrag()
Definition: TBByteStreamCnvTool.h:114
TBByteStreamCnvTool::m_subfrag_firstdata
int m_subfrag_firstdata
Definition: TBByteStreamCnvTool.h:112
TBByteStreamCnvTool::H6BuildObjects
StatusCode H6BuildObjects(int unrec_code)
Definition: TBByteStreamCnvTool.cxx:532
TBByteStreamCnvTool::m_subfrag_id
int m_subfrag_id
Definition: TBByteStreamCnvTool.h:110
pmontree.code
code
Definition: pmontree.py:443
IROBDataProviderSvc::getEvent
virtual const RawEvent * getEvent()=0
Retrieve the whole event.
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
TBByteStreamCnvTool::m_trigpat
TBTriggerPatternUnit * m_trigpat
Definition: TBByteStreamCnvTool.h:132
TBByteStreamCnvTool::m_beam_part
std::string m_beam_part
Definition: TBByteStreamCnvTool.h:178
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:192
LArCalibDigit
Base class for LArDigits taken during calibration runs.
Definition: LArCalibDigit.h:29
EventInfo
This class provides general information about an event. Event information is provided by the accessor...
Definition: EventInfo/EventInfo/EventInfo.h:42
TBByteStreamCnvTool::m_run_num
unsigned int m_run_num
Definition: TBByteStreamCnvTool.h:176
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
dqt_zlumi_alleff_HIST.B
B
Definition: dqt_zlumi_alleff_HIST.py:110
LArOnlineID
Definition: LArOnlineID.h:20
item
Definition: ItemListSvc.h:43
CaloGain::LARHIGHGAIN
@ LARHIGHGAIN
Definition: CaloGain.h:18
TBByteStreamCnvTool::m_force_Hchoice
bool m_force_Hchoice
Definition: TBByteStreamCnvTool.h:104
TBByteStreamCnvTool::BuildRODBlock
StatusCode BuildRODBlock(std::vector< uint32_t > *theRODBlock)
Definition: TBByteStreamCnvTool.cxx:221
TBByteStreamCnvTool::m_cryoAngle
float m_cryoAngle
Definition: TBByteStreamCnvTool.h:180
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:18
CaloGain::CaloGain
CaloGain
Definition: CaloGain.h:11
TBByteStreamCnvTool::m_onlineHelper
const LArOnlineID * m_onlineHelper
Definition: TBByteStreamCnvTool.h:96
TBMWPCRaw::addCwireno
void addCwireno(int cwire)
Definition: TBMWPCRaw.h:59
TBByteStreamCnvTool::m_tblarcalibdigitcont
TBLArCalibDigitContainer * m_tblarcalibdigitcont[4]
Definition: TBByteStreamCnvTool.h:137
CaloGain::LARMEDIUMGAIN
@ LARMEDIUMGAIN
Definition: CaloGain.h:18
a
TList * a
Definition: liststreamerinfos.cxx:10
CalibCoolCompareRT.nm
nm
Definition: CalibCoolCompareRT.py:110
h
OFFLINE_FRAGMENTS_NAMESPACE_WRITE::ROBFragment
eformat::write::ROBFragment ROBFragment
Definition: RawEvent.h:33
TBEventInfo
Definition: TBEventInfo.h:27
TBTDC::tdcmin
int tdcmin() const
Definition: TBTDC.h:31
TBByteStreamCnvTool::m_calib_dac
uint16_t m_calib_dac
Definition: TBByteStreamCnvTool.h:168
TBByteStreamCnvTool::m_scintrawCont
TBScintillatorRawCont * m_scintrawCont
Definition: TBByteStreamCnvTool.h:133
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TBByteStreamCnvTool::m_bpcrawCont
TBBPCRawCont * m_bpcrawCont
Definition: TBByteStreamCnvTool.h:130
re
const boost::regex re(r_e)
DEBUG
#define DEBUG
Definition: page_access.h:11
ReadCellNoiseFromCoolCompare.s2
s2
Definition: ReadCellNoiseFromCoolCompare.py:379
TBByteStreamCnvTool::m_calib_delay
uint16_t m_calib_delay
Definition: TBByteStreamCnvTool.h:169
TBByteStreamCnvTool::m_rdpSvc
IROBDataProviderSvc * m_rdpSvc
Definition: TBByteStreamCnvTool.h:92
S2
struct TBPatternUnitContext S2
EventID
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
Definition: EventID.h:35
TBByteStreamCnvTool::H8BuildObjects
StatusCode H8BuildObjects(int unrec_code)
Definition: TBByteStreamCnvTool.cxx:1309
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:616
TBByteStreamCnvTool::m_DontCheckRodSubDetID
static const eformat::SubDetector m_DontCheckRodSubDetID
Definition: TBByteStreamCnvTool.h:89
TBADCRaw::getADC
signal_type getADC() const
Definition: TBADCRaw.h:35
declareProperty
#define declareProperty(n, p, h)
Definition: BaseFakeBkgTool.cxx:15
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:790
merge.status
status
Definition: merge.py:17
TBTriggerPatternUnit
Definition: TBTriggerPatternUnit.h:27
scale1
#define scale1
Definition: JetAttributeHisto.cxx:41
TBByteStreamCnvTool::testbit
bool testbit(int n, unsigned short w)
Definition: TBByteStreamCnvTool.h:203
TBLArDigitContainer
Gaudi Class ID.
Definition: TBLArDigitContainer.h:40
TBByteStreamCnvTool::firstword
unsigned short firstword(unsigned int w)
Definition: TBByteStreamCnvTool.h:190
python.CaloScaleNoiseConfig.default
default
Definition: CaloScaleNoiseConfig.py:79
TBTailCatcherRaw
Definition: TBTailCatcherRaw.h:25
CaloGain::LARLOWGAIN
@ LARLOWGAIN
Definition: CaloGain.h:18
python.IoTestsLib.w
def w
Definition: IoTestsLib.py:200
TBMWPCRaw::setXchambers
void setXchambers(bool isX)
Definition: TBMWPCRaw.h:72
TBByteStreamCnvTool::m_subfrag_size
int m_subfrag_size
Definition: TBByteStreamCnvTool.h:111
TBByteStreamCnvTool::m_subdet_id
eformat::SubDetector m_subdet_id
Definition: TBByteStreamCnvTool.h:94
TBADCRawCont
Definition: TBADCRawCont.h:20
PrepareReferenceFile.outfile
outfile
Definition: PrepareReferenceFile.py:42
TBScintillatorRawCont
Definition: TBScintillatorRawCont.h:18
python.compressB64.c
def c
Definition: compressB64.py:93
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
TBScintillatorRaw::setSignals
void setSignals(const TBTDCRawCont *tdcCont, TBTDCRaw *tbtdc, const TBADCRawCont *adcCont, TBADCRaw *tbadc)
Definition: TBScintillatorRaw.cxx:20
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
TBBPCRaw::setSignals
void setSignals(const TBTDCRawCont *theTDCCont, const std::vector< const TBTDCRaw * > &theTDCs, const TBADCRawCont *theADCCont, const std::vector< const TBADCRaw * > &theADCs)
Definition: TBBPCRaw.cxx:35
TBByteStreamCnvTool::m_tblardigitcont
TBLArDigitContainer * m_tblardigitcont[4]
Definition: TBByteStreamCnvTool.h:136
TBByteStreamCnvTool::m_arrayofsample
std::vector< short > m_arrayofsample[128][4]
Definition: TBByteStreamCnvTool.h:146
fitman.k
k
Definition: fitman.py:528
TBBPCRawCont
Definition: TBBPCRawCont.h:17
TBByteStreamCnvTool::m_dump
bool m_dump
Definition: TBByteStreamCnvTool.h:105
TBByteStreamCnvTool::m_adcrawCont
TBADCRawCont * m_adcrawCont
Definition: TBByteStreamCnvTool.h:129
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37