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

#include <ALFA_Decoder_charge.h>

Inheritance diagram for ALFA_Decoder_charge:
Collaboration diagram for ALFA_Decoder_charge:

Public Types

typedef ALFA_RawData_charge m_ALFA_RawData_charge
 
typedef ALFA_RawDataCollection_charge m_ALFA_RawDataCollection_charge
 

Public Member Functions

 ALFA_Decoder_charge (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual ~ALFA_Decoder_charge ()
 
virtual StatusCode initialize ()
 
virtual StatusCode finalize ()
 
StatusCode fillCollection (const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment *robFrag, ALFA_RawDataContainer_charge *rdoCont, std::vector< unsigned int > *vecHash=NULL)
 
ALFA_RawDataCollection_chargegetCollection (unsigned int MotherBoardId, ALFA_RawDataContainer_charge *cont)
 
ALFA_RawData_chargegetRawData_charge (unsigned int PMFId, ALFA_RawDataCollection_charge *coll)
 
const eformat::FullEventFragment< const uint32_t * > * eventFragment () const
 
const eformat::ROBFragment< const uint32_t * > * robFragment () const
 
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

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

const eformat::FullEventFragment< const uint32_t * > * m_event = nullptr
 
const eformat::ROBFragment< const uint32_t * > * m_robFrag = nullptr
 
unsigned int m_fragment_number = 0U
 
ServiceHandle< IROBDataProviderSvcm_robDataProvider
 Service for reading bytestream. More...
 
ALFA_RawDataReadOut_chargem_ALFA_RawDataReadOut_charge = nullptr
 
ALFA_RawDataCollectionReadOutm_ALFA_RawDataCollectionReadOut = nullptr
 
ALFA_RawDataContainerReadOutm_ALFA_RawDataContainerReadOut = nullptr
 
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
 

Detailed Description

Definition at line 37 of file ALFA_Decoder_charge.h.

Member Typedef Documentation

◆ m_ALFA_RawData_charge

Definition at line 43 of file ALFA_Decoder_charge.h.

◆ m_ALFA_RawDataCollection_charge

Definition at line 44 of file ALFA_Decoder_charge.h.

◆ StoreGateSvc_t

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

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ ALFA_Decoder_charge()

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

Definition at line 19 of file ALFA_Decoder_charge.cxx.

21 m_robDataProvider ("ROBDataProviderSvc",name)
22 //, m_ALFA_RawDataContainerReadOut(0), m_ALFA_RawDataCollectionReadOut(0), m_ALFA_RawDataReadOut_charge(0)
23 {
24 declareInterface<ALFA_Decoder_charge>(this);
25 
26 }

◆ ~ALFA_Decoder_charge()

ALFA_Decoder_charge::~ALFA_Decoder_charge ( )
virtual

Definition at line 33 of file ALFA_Decoder_charge.cxx.

33 {}

Member Function Documentation

◆ 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; }

◆ eventFragment()

const eformat::FullEventFragment<const uint32_t*>* ALFA_Decoder_charge::eventFragment ( ) const
inline

Definition at line 63 of file ALFA_Decoder_charge.h.

63 { return m_event; }

◆ 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

◆ fillCollection()

StatusCode ALFA_Decoder_charge::fillCollection ( const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment robFrag,
ALFA_RawDataContainer_charge rdoCont,
std::vector< unsigned int > *  vecHash = NULL 
)

Definition at line 97 of file ALFA_Decoder_charge.cxx.

97  {
98  msg(MSG::DEBUG) << " ALFA_RoDDecoder_charge::fillCollection" << endmsg;
99 
100 ALFA_RawDataCollection_charge* collection = nullptr;
101 
102  uint32_t wordPos = 0;
103 
104  std::vector<uint32_t> VData;
105 
106  VData.clear();
107 
108 
109 uint32_t Event_num=0;
110 uint32_t Event_num_max=0;
111 uint16_t charge_hit;
112 
113 uint16_t tmpCharge=10;
114 uint16_t MBIdNum=0;
115 
116 uint32_t EcrId=1;
117 uint32_t LvL1 =0;
118 
119 uint32_t Count_evt=0;
120 
121 
122 uint16_t CountPMF0=0;
123 
124  int n=0;
125 
126  // Check the ROB and ROD fragment for lenght and version consistency
127 /*
128  try
129  {
130  robFrag->check();
131  }
132 
133  catch (eformat::Issue &ex)
134  {
135  msg(MSG::DEBUG) <<ex.what ()<< endmsg;
136  return StatusCode::FAILURE; // error in fragment - we search for no collection
137  }
138 
139  // Check the ROB status word for truncation or corruption.
140 
141  uint32_t nstat = robFrag->nstatus();
142 
143  if (nstat)
144  {
145  const uint32_t *it;
146  robFrag->status (it);
147 
148 
149  if (*it)
150  {
151  msg(MSG::DEBUG) << " Error in ROB status word: 0x" << endmsg;
152  return StatusCode::FAILURE;
153  }
154  }
155  */
156 
157  // set the data pointer type
158 
160 
161  robFrag->rod_data(vint);
162 
163  // get number of data words in the fragment
164  uint32_t size = robFrag->rod_ndata();
165 
166  // get source ID
167  uint32_t ROD_source_ID = robFrag->rod_source_id();
168 
169 
170  uint32_t ROD_LVL1_ID = robFrag->rod_lvl1_id();
171 
172 msg(MSG::DEBUG) << "============================" << std::endl;
173 msg(MSG::DEBUG) <<"Frag Size : " << robFrag->rod_fragment_size_word() << endmsg;
174 msg(MSG::DEBUG) <<"Header Size: " << robFrag->rod_header_size_word() << endmsg;
175 msg(MSG::DEBUG) <<"Source ID : " << ROD_source_ID << endmsg;
176 msg(MSG::DEBUG) <<"Run num : " << robFrag->rod_run_no() << endmsg;
177 msg(MSG::DEBUG) <<"Version : " << robFrag->rod_version() << endmsg;
178 msg(MSG::DEBUG) << " ROD_LVL1_ID " <<ROD_LVL1_ID<< endmsg;
179 msg(MSG::DEBUG) << "============================" << std::endl;
180 
181 
182 uint32_t evt_Id = ((robFrag->rod_lvl1_id()) & 0xFF000000) >> 24;
183 uint32_t lvl1_Id = ((robFrag->rod_lvl1_id()) & 0x00FFFFFF) ;
184 
185 
186 msg(MSG::DEBUG) <<" evt_Id : " << evt_Id << " lvl1_Id : " << lvl1_Id <<endmsg;
187 
188  /*msg(MSG::DEBUG) << " **********Decoder dumping the words******** "<< endmsg;
189 
190 if (size > 0) {
191 msg(MSG::DEBUG) << " The size of this ROD-read is "<< endmsg;
192  for (unsigned int i=0; i < size; i++)
193  msg(MSG::DEBUG) << " word " << i << " = " << MSG::hex << vint[i] << MSG::dec<< endmsg;
194  } else {
195 msg(MSG::DEBUG) << " Buffer size 0 ! "<< endmsg;
196  return StatusCode::FAILURE;
197  }*/
198 
199 
203 
204  int l=0;
205 
206  if(EcrId!=evt_Id) {
207  n++;
208  l=1;
209  }
210 
211  if (n==0) Event_num = LvL1;
212  else Event_num = ((robFrag->rod_lvl1_id()) & 0x00FFFFFF) + Event_num;
213 
214  LvL1 = ((robFrag->rod_lvl1_id()) & 0x00FFFFFF)+1 ;
215  EcrId = ((robFrag->rod_lvl1_id()) & 0xFF000000) >> 24;
216 
217  if(l==1) Event_num_max=Event_num;
218 
219  Event_num = ((robFrag->rod_lvl1_id()) & 0x00FFFFFF)+1 + Event_num_max;
220 
221  Count_evt++;
222  //if (Count_evt == maxEvt) break;
223 
224  msg(MSG::INFO) << " Event_num " << Event_num << " Count_evt " << Count_evt << endmsg;
225 
226 
227 
228 
230  {
231  msg(MSG::DEBUG) << " Found the beginning of buffer "<< endmsg;
232  // Check that Lvl1d matches the one from the ROD header. this is the number of event.it corresponds to m_ALFA_RawDataReadOut_charge->ecnt_BOT() and m_ALFA_RawDataReadOut_charge->ecnt_EOT()
233  msg(MSG::DEBUG) << " Level 1 Id : " << m_ALFA_RawDataCollectionReadOut->lvl1Id()<< endmsg;
234  } else {
235  msg(MSG::DEBUG) << " Beginning of block not found BOB "<< endmsg;
236  } // BOB
237 
238 
240 
241  //Check for corrupted data
242 
244  {
245  wordPos += 1;
246  if (wordPos >= size)
247  {
248  msg(MSG::ERROR)<<" Error: data corrupted" << endmsg;
249  return StatusCode::FAILURE;
250  }
252  }
253 
254 
256  {
257  msg(MSG::DEBUG) << " Found the beginning of Link BOL"<< endmsg;
258  msg(MSG::DEBUG) << " MrodNum BOL : " << m_ALFA_RawDataCollectionReadOut->MrodNum()<< " RODinput BOL : " <<m_ALFA_RawDataCollectionReadOut->RODinput()<< endmsg;
259 
260  } // is_BOL()
261 
263  {
264  msg(MSG::DEBUG)<<" Error: collection not found " << endmsg;
265  return StatusCode::FAILURE;
266  } // is_EOB()
267 
268 
269  wordPos += 1;
270  if (wordPos >= size) {
271  msg(MSG::ERROR)<<" Error: data corrupted"<< endmsg;
272  return StatusCode::FAILURE;
273  }
274 
275 
278 
280 
282 
283  msg(MSG::DEBUG)<<" Decoding data from Slot Id number : " << slotIdNum << endmsg;
284 
285 
286  // Loop on the TDC data words and create the corresponding RDO's
287 
289  {
290  wordPos += 1;
291  if (wordPos >= size)
292  {
293  msg(MSG::DEBUG)<<" Error: data corrupted" << endmsg;
294  return StatusCode::FAILURE;
295  }
296 
298 
299  uint16_t PMFIdNum;
300  uint16_t ChannelIdNum;
301  uint16_t ChargeNum;
302 
303 
305 
306  // if(m_ALFA_RawDataReadOut_charge->ChannelNumId() ==1) msg(MSG::DEBUG)<<" DECODER : PMFId " << m_ALFA_RawDataReadOut_charge->PMFId() << " ChannelNumId " << m_ALFA_RawDataReadOut_charge->ChannelNumId() << " ChargeChanId "<< m_ALFA_RawDataReadOut_charge->ChargeChanId() <<endmsg;
307 
308 
309 
311  // && m_ALFA_RawDataReadOut_charge->bit27_24()==1
312  // msg(MSG::DEBUG) << " Creation of the new collection"<< endmsg;
313 
314 
315  CountPMF0++;
316 
318 
319  for (unsigned int i=0;i<8;i++){
320 
321  charge_hit = (char) tmpCharge & 0x00000001;
322  tmpCharge>>=1;
323 
324  if(charge_hit==1){
325  MBIdNum=i+1;
326 
327  if(CountPMF0==1) collection = getCollection(MBIdNum,rdoCont );
328  if(collection) collection->SetMBId_POT(MBIdNum);
329 
330  if(CountPMF0==1) msg(MSG::DEBUG)<<" DECODER : MBIdNum " << MBIdNum << endmsg;
331 
332 
333  }
334 
335 
336  } // loop over MBs
337 
338  } // PMFId() ==0
339 
340 
341 
342 
344  // && m_ALFA_RawDataReadOut_charge->bit27_24()==0
345 
346 
348  ChannelIdNum = m_ALFA_RawDataReadOut_charge->ChannelNumId();
349  PMFIdNum = m_ALFA_RawDataReadOut_charge->PMFId();
350 
351  auto rawData_charge = std::make_unique< ALFA_RawData_charge >(PMFIdNum);
352 
353  rawData_charge->SetChannelNum_PMF(ChannelIdNum);
354  rawData_charge->SetPMFId_PMF(PMFIdNum);
355  rawData_charge->SetMBId_PMF(MBIdNum);
356  rawData_charge->SetChargeChan_PMF(ChargeNum);
357 
358 
359  msg(MSG::DEBUG)<<" PMFIdNum = " << PMFIdNum <<" ChannelIdNum = " << ChannelIdNum <<" chargeNum = " << ChargeNum << endmsg;
360 
361  std::vector<uint16_t> ChargeHitId;
362  ChargeHitId.push_back(ChargeNum);
363  rawData_charge->SetChargeChanVect_PMF(ChargeHitId);
364 
365  rawData_charge->addData(vint[wordPos]);
366  rawData_charge->PushBack_PMF(ChargeNum);
367 
368  if(collection) collection->push_back(rawData_charge.release());
369 
370 
371  } // PMFIdNum >0 && <24
372 
373 
374 
375 
376 
377  //if(m_ALFA_RawDataReadOut_charge->PMFId()==24) // PMF 24 contains charge infos
378  //{
379  //} //TSM PMF24
380 
381 
382  } // TSM_charge
383 
384 
385  } // End of loop on AMTs (EOT)
386 
387 
389  msg(MSG::DEBUG) << " Event Counter EOT : " << m_ALFA_RawDataReadOut_charge->ecnt_EOT()<< endmsg;
390  }
391 
392  wordPos += 1;
393  if (wordPos >= size) {
394  msg(MSG::DEBUG)<<" Error: data corrupted" << endmsg;
395  return StatusCode::FAILURE;
396  }
397 
398 
400  m_ALFA_RawDataReadOut_charge->decodeWord(vint[wordPos]);
401 
402  } // End of loop on TDCs (TWC)
403 
404  wordPos += 1;
405  if (wordPos >= size)
406  {
407  msg(MSG::DEBUG)<<" Error: data corrupted" << endmsg;
408  return StatusCode::FAILURE;
409  }
410 
412 
413 
414 
415  // take full event
416 const eformat::FullEventFragment<const uint32_t*> * event = m_robDataProvider->getEvent(Gaudi::Hive::currentContext());
417 
418 msg(MSG::DEBUG) << "========FULL Event=============" << std::endl;
419 msg(MSG::DEBUG) << "Event time (sec): " << (uint32_t)event->bc_time_seconds() << std::endl;
420 msg(MSG::DEBUG) << "Event time (ns): " << (uint32_t)event->bc_time_nanoseconds() << std::endl;
421 msg(MSG::DEBUG) << "Global ID: " << (uint32_t)event->global_id() << std::endl;
422 msg(MSG::DEBUG) << "Run Type: " << (uint32_t)event->run_type() << std::endl;
423 msg(MSG::DEBUG) << "Run Number: " << (uint32_t)event->run_no() << std::endl;
424 msg(MSG::DEBUG) << "Lumi Block: " << (uint32_t)event->lumi_block() << std::endl;
425 msg(MSG::DEBUG) << "Level1 ID: " << (uint32_t)event->lvl1_id() << std::endl;
426 msg(MSG::DEBUG) << "BCID: " << (uint32_t)event->bc_id() << std::endl;
427 msg(MSG::DEBUG) << "Level1 trig type: " << (uint32_t)event->lvl1_trigger_type() << std::endl;
428 msg(MSG::DEBUG) << "Level1 Nwords: " << (uint32_t)event->nlvl1_trigger_info() << std::endl;
429 msg(MSG::DEBUG) << "============================" << std::endl;
430 
431 uint32_t Time_StampID = event->bc_time_seconds();
432 uint32_t BC_ID = event->bc_id();
433 
434 if(collection) collection->SetTimeStamp_POT(Time_StampID);
435 if(collection) collection->SetBCId_POT(BC_ID);
436 
437 
438 
439 
440 
441 
442  } //EOB
443 
444 
446  {
447  msg(MSG::DEBUG) << " Found the end of block EOB ---------------------- "<< endmsg;
448  }
449 
450  wordPos += 1;
452 
453 
454  return StatusCode::SUCCESS;
455 }

◆ finalize()

StatusCode ALFA_Decoder_charge::finalize ( )
virtual

Definition at line 78 of file ALFA_Decoder_charge.cxx.

78  {
79 
80 msg(MSG::DEBUG) << " ALFA_RoDDecoder_charge::FINALIZE" << endmsg;
81 
82 msg(MSG::DEBUG) << " Bytestream summary:" << m_fragment_number << " fragments found" << endmsg;
83 
84 
88 
89  return StatusCode::SUCCESS;
90 }

◆ getCollection()

ALFA_RawDataCollection_charge * ALFA_Decoder_charge::getCollection ( unsigned int  MotherBoardId,
ALFA_RawDataContainer_charge cont 
)

Definition at line 463 of file ALFA_Decoder_charge.cxx.

463  {
464 
465 msg(MSG::DEBUG) << " ALFA_RoDDecoder_charge::getCollection" << endmsg;
466 
468 
470  bool collExists = false;
473 
474 
475  for (; it!=itE; ++it) {
476  if ((*it)->GetMBId_POT() == MBIdNum) {
477  collExists = true;
478  cont_it = it;
479  }
480  }
481  if (collExists) {
482  msg(MSG::DEBUG) << " Collection exists " << endmsg;
483  return nullptr;
484 
485  } else { // if collection does not exist create it
486  coll = new ALFA_RawDataCollection_charge(MBIdNum);
487  msg(MSG::DEBUG) << " create collection; MBId " << MBIdNum <<endmsg;
488  cont->push_back(coll); // add collection to container
489  }
490 
491 
492  return coll;
493 }

◆ getRawData_charge()

ALFA_RawData_charge* ALFA_Decoder_charge::getRawData_charge ( unsigned int  PMFId,
ALFA_RawDataCollection_charge coll 
)

◆ initialize()

StatusCode ALFA_Decoder_charge::initialize ( )
virtual

Definition at line 41 of file ALFA_Decoder_charge.cxx.

41  {
42 
43 
44  StatusCode sc;
46  msg(MSG::DEBUG) << " ALFA_RoDDecoder_charge::initialize" << endmsg;
47  if (sc.isFailure()) return sc;
48 
49  // Get ROBDataProviderSvc
50  if (m_robDataProvider.retrieve().isFailure()) {
51  msg(MSG::FATAL) << "Failed to retrieve service " << m_robDataProvider << endmsg;
52  return StatusCode::FAILURE;
53  } else {
54  msg(MSG::DEBUG) << "Retrieved service " << m_robDataProvider << endmsg;
55  }
56 
57 
59 
60 
61  // Initialize decoding classes
65 
66 
67  return StatusCode::SUCCESS;
68 }

◆ 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 & ALFA_Decoder_charge::interfaceID ( )
static

Definition at line 10 of file ALFA_Decoder_charge.cxx.

11 {
12  return IID_IALFA_Decoder_charge;
13 }

◆ 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  }

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

◆ 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  }

◆ robFragment()

const eformat::ROBFragment<const uint32_t*>* ALFA_Decoder_charge::robFragment ( ) const
inline

Definition at line 64 of file ALFA_Decoder_charge.h.

64 { return m_robFrag; }

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

◆ 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  }

Member Data Documentation

◆ m_ALFA_RawDataCollectionReadOut

ALFA_RawDataCollectionReadOut* ALFA_Decoder_charge::m_ALFA_RawDataCollectionReadOut = nullptr
private

Definition at line 78 of file ALFA_Decoder_charge.h.

◆ m_ALFA_RawDataContainerReadOut

ALFA_RawDataContainerReadOut* ALFA_Decoder_charge::m_ALFA_RawDataContainerReadOut = nullptr
private

Definition at line 79 of file ALFA_Decoder_charge.h.

◆ m_ALFA_RawDataReadOut_charge

ALFA_RawDataReadOut_charge* ALFA_Decoder_charge::m_ALFA_RawDataReadOut_charge = nullptr
private

Definition at line 77 of file ALFA_Decoder_charge.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_event

const eformat::FullEventFragment<const uint32_t*>* ALFA_Decoder_charge::m_event = nullptr
private

Definition at line 68 of file ALFA_Decoder_charge.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_fragment_number

unsigned int ALFA_Decoder_charge::m_fragment_number = 0U
private

Definition at line 71 of file ALFA_Decoder_charge.h.

◆ m_robDataProvider

ServiceHandle<IROBDataProviderSvc> ALFA_Decoder_charge::m_robDataProvider
private

Service for reading bytestream.

Definition at line 74 of file ALFA_Decoder_charge.h.

◆ m_robFrag

const eformat::ROBFragment<const uint32_t*>* ALFA_Decoder_charge::m_robFrag = nullptr
private

Definition at line 69 of file ALFA_Decoder_charge.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:
ALFA_RawDataReadOut_charge::is_EOT
bool is_EOT() const
Definition: ALFA_RawDataReadOut_charge.h:96
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
ALFA_RawDataReadOut_charge::ChargeChanId
uint16_t ChargeChanId() const
Definition: ALFA_RawDataReadOut_charge.h:113
python.Constants.FATAL
int FATAL
Definition: Control/AthenaCommon/python/Constants.py:19
ALFA_RawDataCollection_charge
RDOs : Chamber Service Module, collection of RawData.
Definition: ALFA_RawDataCollection_charge.h:19
ALFA_RawDataContainerReadOut::decodeWord
void decodeWord(uint32_t dataWord)
Definition: ALFA_RawDataContainerReadOut.cxx:26
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
ALFA_Decoder_charge::m_fragment_number
unsigned int m_fragment_number
Definition: ALFA_Decoder_charge.h:71
AthCommonDataStore::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
initialize
void initialize()
Definition: run_EoverP.cxx:894
xAOD::char
char
Definition: TrigDecision_v1.cxx:38
ALFA_RawDataCollectionReadOut::is_TWC
bool is_TWC() const
Definition: ALFA_RawDataCollectionReadOut.h:91
ALFA_RawDataReadOut_charge
Definition: ALFA_RawDataReadOut_charge.h:28
skel.it
it
Definition: skel.GENtoEVGEN.py:396
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_evtStore
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
Definition: AthCommonDataStore.h:390
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_vhka
std::vector< SG::VarHandleKeyArray * > m_vhka
Definition: AthCommonDataStore.h:398
ALFA_RawDataReadOut_charge::is_TDCch
bool is_TDCch() const
Definition: ALFA_RawDataReadOut_charge.h:98
ALFA_Decoder_charge::m_robDataProvider
ServiceHandle< IROBDataProviderSvc > m_robDataProvider
Service for reading bytestream.
Definition: ALFA_Decoder_charge.h:74
UploadAMITag.l
list l
Definition: UploadAMITag.larcaf.py:158
ALFA_RawDataReadOut_charge::ChannelNumId
uint16_t ChannelNumId() const
Definition: ALFA_RawDataReadOut_charge.h:112
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
ALFA_RawDataReadOut_charge::SlotId
uint16_t SlotId() const
Definition: ALFA_RawDataReadOut_charge.h:103
ALFA_RawDataCollectionReadOut::is_BOL
bool is_BOL() const
Definition: ALFA_RawDataCollectionReadOut.h:89
TruthTest.itE
itE
Definition: TruthTest.py:25
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
ALFA_Decoder_charge::getCollection
ALFA_RawDataCollection_charge * getCollection(unsigned int MotherBoardId, ALFA_RawDataContainer_charge *cont)
Definition: ALFA_Decoder_charge.cxx:463
SG::VarHandleKeyArray::setOwner
virtual void setOwner(IDataHandleHolder *o)=0
IDTPMcnv.htype
htype
Definition: IDTPMcnv.py:29
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
OFFLINE_FRAGMENTS_NAMESPACE::PointerType
const DataType * PointerType
Definition: RawEvent.h:25
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
AthCommonDataStore
Definition: AthCommonDataStore.h:52
ALFA_RawDataCollection_charge::SetTimeStamp_POT
void SetTimeStamp_POT(uint32_t TimeStamp)
Definition: ALFA_RawDataCollection_charge.cxx:60
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
xAOD::uint16_t
setWord1 uint16_t
Definition: eFexEMRoI_v1.cxx:93
event
POOL::TEvent event(POOL::TEvent::kClassAccess)
lumiFormat.i
int i
Definition: lumiFormat.py:85
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
ALFA_RawDataReadOut_charge::PMFId
uint16_t PMFId() const
Definition: ALFA_RawDataReadOut_charge.h:111
ALFA_RawDataCollectionReadOut::decodeWord
void decodeWord(uint32_t dataWord)
Definition: ALFA_RawDataCollectionReadOut.cxx:27
test_pyathena.parent
parent
Definition: test_pyathena.py:15
ALFA_Decoder_charge::m_robFrag
const eformat::ROBFragment< const uint32_t * > * m_robFrag
Definition: ALFA_Decoder_charge.h:69
AthCommonDataStore< AthCommonMsg< AlgTool > >::m_detStore
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
Definition: AthCommonDataStore.h:393
ALFA_RawDataCollectionReadOut::lvl1Id
uint32_t lvl1Id() const
Definition: ALFA_RawDataCollectionReadOut.h:95
ALFA_Decoder_charge::m_event
const eformat::FullEventFragment< const uint32_t * > * m_event
Definition: ALFA_Decoder_charge.h:68
AthAlgTool::AthAlgTool
AthAlgTool()
Default constructor:
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
ALFA_RawDataCollection_charge::SetBCId_POT
void SetBCId_POT(uint32_t BCId)
Definition: ALFA_RawDataCollection_charge.cxx:65
ALFA_RawDataReadOut_charge::ecnt_EOT
uint16_t ecnt_EOT() const
Definition: ALFA_RawDataReadOut_charge.h:106
merge_scale_histograms.doc
string doc
Definition: merge_scale_histograms.py:9
ALFA_RawDataCollectionReadOut
Definition: ALFA_RawDataCollectionReadOut.h:32
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
ALFA_RawDataCollection_charge::SetMBId_POT
void SetMBId_POT(uint16_t MB_number)
Definition: ALFA_RawDataCollection_charge.cxx:43
ALFA_RawDataCollectionReadOut::RODinput
uint16_t RODinput() const
Definition: ALFA_RawDataCollectionReadOut.h:105
a
TList * a
Definition: liststreamerinfos.cxx:10
h
ALFA_RawDataCollectionReadOut::MrodNum
uint16_t MrodNum() const
Definition: ALFA_RawDataCollectionReadOut.h:104
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
ALFA_RawDataCollectionReadOut::is_EOB
bool is_EOB() const
Definition: ALFA_RawDataCollectionReadOut.h:92
DEBUG
#define DEBUG
Definition: page_access.h:11
AthCommonMsg< AlgTool >::msg
MsgStream & msg() const
Definition: AthCommonMsg.h:24
SG::VarHandleBase::vhKey
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
Definition: StoreGate/src/VarHandleBase.cxx:623
ALFA_RawDataReadOut_charge::decodeWord
void decodeWord(uint32_t dataWord)
Definition: ALFA_RawDataReadOut_charge.cxx:30
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
ALFA_Decoder_charge::m_ALFA_RawDataContainerReadOut
ALFA_RawDataContainerReadOut * m_ALFA_RawDataContainerReadOut
Definition: ALFA_Decoder_charge.h:79
ALFA_Decoder_charge::m_ALFA_RawDataReadOut_charge
ALFA_RawDataReadOut_charge * m_ALFA_RawDataReadOut_charge
Definition: ALFA_Decoder_charge.h:77
ALFA_Decoder_charge::m_ALFA_RawDataCollectionReadOut
ALFA_RawDataCollectionReadOut * m_ALFA_RawDataCollectionReadOut
Definition: ALFA_Decoder_charge.h:78
ALFA_RawDataReadOut_charge::bit24_27
uint16_t bit24_27() const
Definition: ALFA_RawDataReadOut_charge.h:118
ALFA_RawDataCollectionReadOut::is_BOB
bool is_BOB() const
Definition: ALFA_RawDataCollectionReadOut.h:87
AthCommonDataStore::declareGaudiProperty
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition: AthCommonDataStore.h:156
ALFA_RawDataContainerReadOut
Definition: ALFA_RawDataContainerReadOut.h:31
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
fitman.k
k
Definition: fitman.py:528