ATLAS Offline Software
ALFA_CLinkAlg.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
3 */
4 
7 #include "StoreGate/ReadHandle.h"
9 
10 #include "xAODForward/ALFAData.h"
13 #include "ALFA_CLinkAlg.h"
14 
15 using namespace std;
16 
17 ALFA_CLinkAlg::ALFA_CLinkAlg(const std::string& name, ISvcLocator* pSvcLocator)
18  : AthAlgorithm(name, pSvcLocator)
19 {
20  // data type using in the local reconstruction
21  // for the simulation data the value is 0, for the real data the value is 1. Unset value is -1
22  declareProperty("DataType", m_nDataType=1, "data type using in the local reconstruction");
23  declareProperty("ProcessingMode", m_nProcessingMode=2, "Processing mode, 1=offline, 2=online");
24 
26 }
27 
28 
30 {
31 
32 }
33 
35 {
36  ATH_MSG_DEBUG ("ALFA_CLinkAlg::initialize()");
37 
46 
54 
56  ATH_CHECK( m_xaodDataKey.initialize() );
57 
58  return StatusCode::SUCCESS;
59 }
60 
62 {
63  ATH_MSG_DEBUG ("ALFA_CLinkAlg::execute()");
64 
65  const EventContext& ctx = Gaudi::Hive::currentContext();
66 
67  auto pDataEvent = std::make_unique<ALFA_CLinkEvent>();
68 
69  ATH_CHECK( LoadAllEventData(ctx, *pDataEvent) );
70  if (m_nDataType==1) {
71  DCSID DCSIds;
72  ATH_CHECK( CalcAllDCSIds (ctx, DCSIds) );
73  pDataEvent->SetDCSFolderIDs(&DCSIds);
74  }
76  ATH_CHECK( clinkEventH.record (std::move (pDataEvent)) );
77  ATH_CHECK( GenerateXAOD (ctx) );
78 
79  return StatusCode::SUCCESS;
80 }
81 
83 {
84  ATH_MSG_DEBUG ("ALFA_CLinkAlg::finalize()");
85 
86  return StatusCode::SUCCESS;
87 }
88 
90  ALFA_CLinkEvent& dataEvent) const
91 {
92  //RawDataContainer
93  if (m_nDataType==1)
94  {
96  if(!rawDataCont.isValid())
97  {
98  ATH_MSG_WARNING( "Container '"<<EVCOLLNAME_RAWDATA<<"' not found" );
99  //return StatusCode::FAILURE;
100  }
101  else ATH_CHECK(dataEvent.AddLink(EDVT_RAWDATAEVCOLLECTION, rawDataCont.cptr()));
102  }
103 
104  //DigitCollection
106  if(!digitColl.isValid()) {
107  ATH_MSG_WARNING( "Container '"<<EVCOLLNAME_DIGIT<<"' not found" );
108  //return StatusCode::FAILURE;
109  }
110  else ATH_CHECK(dataEvent.AddLink(EDVT_DIGITCOLLECTION, digitColl.cptr()));
111 
112  //ODDigitCollection
114  if(!odDigitColl.isValid()) {
115  ATH_MSG_WARNING( "Container '"<<EVCOLLNAME_ODDIGIT<<"' not found" );
116  //return StatusCode::FAILURE;
117  }
118  else ATH_CHECK(dataEvent.AddLink(EDVT_ODDIGITCOLLECTION, odDigitColl.cptr()));
119 
120  //LocRecEvCollection
122  if(!locRecEvColl.isValid()) {
123  ATH_MSG_WARNING( "Container '"<<EVCOLLNAME_LOCREC<<"' not found" );
124  //return StatusCode::FAILURE;
125  }
126  else ATH_CHECK(dataEvent.AddLink(EDVT_LOCRECEVCOLLECTION, locRecEvColl.cptr()));
127 
128  //LocRecODEvCollection
130  if(!locRecODEvColl.isValid()) {
131  ATH_MSG_WARNING( "Container '"<<EVCOLLNAME_LOCRECOD<<"' not found" );
132  //return StatusCode::FAILURE;
133  }
134  else CHECK(dataEvent.AddLink(EDVT_LOCRECODEVCOLLECTION, locRecODEvColl.cptr()));
135 
136  //LocRecCorrEvCollection
138  if(!locRecCorrEvColl.isValid()) {
139  ATH_MSG_WARNING( "Container '"<<EVCOLLNAME_LOCRECCORR<<"' not found" );
140  //return StatusCode::FAILURE;
141  }
142  else CHECK(dataEvent.AddLink(EDVT_LOCRECCORREVCOLLECTION, locRecCorrEvColl.cptr()));
143 
144  //LocRecCorrODEvCollection
146  if(!locRecCorrODEvColl.isValid()) {
147  ATH_MSG_WARNING("Container '"<<EVCOLLNAME_LOCRECCORROD<<"' not found" );
148  //return StatusCode::FAILURE;
149  }
150  else CHECK(dataEvent.AddLink(EDVT_LOCRECCORRODEVCOLLECTION, locRecCorrODEvColl.cptr()));
151 
152  return StatusCode::SUCCESS;
153 
154 }
155 
156 unsigned long long
157 ALFA_CLinkAlg::CalcDCSId (const EventContext& ctx,
159 {
160  unsigned long long ullID;
161  std::string Folder;
162 
164  EventIDRange range;
165  if (!h.range (range)) return 0;
166 
167  // Construct the ID:
168  EventIDBase time = range.start();
169  if(time.isRunLumi()){
170  ullID=static_cast<unsigned long long>(((time.run_number()&0xffff)<<16)|(time.lumi_block()&0xffff));
171  }
172  else if(time.isTimeStamp()){
173  ullID = time.time_stamp();
174  ullID <<= 32;
175  ullID |= time.time_stamp_ns_offset();
176  }
177  else{
178  ullID=0;
179  }
180 
181  return ullID;
182 }
183 
184 StatusCode ALFA_CLinkAlg::CalcAllDCSIds (const EventContext& ctx,
185  DCSID& DCSIds) const
186 {
187  bool bRes=true;
188 
189  bRes&=(DCSIds.ullBlmID=CalcDCSId(ctx, m_BLMKey))>0;
190  bRes&=(DCSIds.ullHVChannelID=CalcDCSId(ctx, m_HVChannelKey))>0;
191  bRes&=(DCSIds.ullLocalMonitoringID=CalcDCSId(ctx, m_localMonitoringKey))>0;
192  bRes&=(DCSIds.ullMovementID=CalcDCSId(ctx, m_movementKey))>0;
193  bRes&=(DCSIds.ullRadMonID=CalcDCSId(ctx, m_radmonKey))>0;
194  bRes&=(DCSIds.ullTriggerRatesID=CalcDCSId(ctx, m_triggerRatesKey))>0;
195  bRes&=(DCSIds.ullFEConfigurationID=CalcDCSId(ctx, m_FEConfigurationKey))>0;
196  bRes&=(DCSIds.ullTriggerSettingsID=CalcDCSId(ctx, m_triggerSettingsKey))>0;
197  return bRes? StatusCode::SUCCESS:StatusCode::FAILURE;
198 }
199 
200 StatusCode ALFA_CLinkAlg::GenerateXAOD(const EventContext& ctx)
201 {
202  auto pxAODContainer = std::make_unique<xAOD::ALFADataContainer>();
203  auto pxAODAuxContainer = std::make_unique<xAOD::ALFADataAuxContainer>();
204  pxAODContainer->setStore(pxAODAuxContainer.get());
205 
206  CHECK(FillXAOD_TrackingData(ctx, *pxAODContainer));
207  CHECK(FillXAOD_HeaderData(ctx, *pxAODContainer));
208 
210  ATH_CHECK( xaodData.record (std::move(pxAODContainer),
211  std::move(pxAODAuxContainer)) );
212 
213  return StatusCode::SUCCESS;
214 }
215 
217  xAOD::ALFADataContainer& xAODContainer)
218 {
219  unsigned int i;
220  int nPotID, nSideID, nODSign;
221  int arrTrackCntPerRPot[RPOTSCNT];
222  vector<int> vecFiberSel;
223 
224  //LocRecEvCollection & LocRecODEvCollection
227 
228  if(locRecEvColl.isValid() && locRecODEvColl.isValid())
229  {
230  m_nMaxTrackCnt=1;
231  // resolve max track count from LocRecEvCollection
232  memset(&arrTrackCntPerRPot[0],0,sizeof(arrTrackCntPerRPot));
233  for(const ALFA_LocRecEvent* locRecEvent : *locRecEvColl)
234  {
235  nPotID=locRecEvent->getPotNum();
236  arrTrackCntPerRPot[nPotID]++;
237  }
238  for(const ALFA_LocRecODEvent* locRecODEvent : *locRecODEvColl)
239  {
240  nPotID=locRecODEvent->getPotNum();
241  arrTrackCntPerRPot[nPotID]++;
242  }
243  for(i=0;i<RPOTSCNT;i++){
244  if(arrTrackCntPerRPot[i]>m_nMaxTrackCnt) m_nMaxTrackCnt=arrTrackCntPerRPot[i];
245  }
246 
247  memset(&arrTrackCntPerRPot[0],0,sizeof(arrTrackCntPerRPot));
249 
250  //fill data - LocRecEvCollection
251  vecFiberSel.clear();
252  for(const ALFA_LocRecEvent* locRecEvent : *locRecEvColl)
253  {
254  nPotID=locRecEvent->getPotNum();
255 
256  (m_vecDetectorPartID)[nPotID*m_nMaxTrackCnt+arrTrackCntPerRPot[nPotID]]=1;
257  (m_vecXDetCS)[nPotID*m_nMaxTrackCnt+arrTrackCntPerRPot[nPotID]]=locRecEvent->getXposition();
258  (m_vecYDetCS)[nPotID*m_nMaxTrackCnt+arrTrackCntPerRPot[nPotID]]=locRecEvent->getYposition();
259 
260  (m_vecOverU)[nPotID*m_nMaxTrackCnt+arrTrackCntPerRPot[nPotID]]=locRecEvent->getOverU();
261  (m_vecOverV)[nPotID*m_nMaxTrackCnt+arrTrackCntPerRPot[nPotID]]=locRecEvent->getOverV();
262  (m_vecNumU)[nPotID*m_nMaxTrackCnt+arrTrackCntPerRPot[nPotID]]=locRecEvent->getNumU();
263  (m_vecNumV)[nPotID*m_nMaxTrackCnt+arrTrackCntPerRPot[nPotID]]=locRecEvent->getNumV();
264 
265  vecFiberSel=locRecEvent->getFibSel();
266  for(i=0;i<vecFiberSel.size();i++)
267  {
268  (m_vecMDFibSel)[nPotID*m_nMaxTrackCnt*MDLAYERSCNT*MDPLATESCNT+arrTrackCntPerRPot[nPotID]*MDLAYERSCNT*MDPLATESCNT+i]=vecFiberSel[i];
269  }
270 
271  arrTrackCntPerRPot[nPotID]++;
272  }
273 
274  //fill data - LocRecODEvCollection
275  vecFiberSel.clear();
276  for(const ALFA_LocRecODEvent* locRecODEvent : *locRecODEvColl)
277  {
278  nPotID=locRecODEvent->getPotNum();
279  nSideID=locRecODEvent->getSide();
280 
281  nODSign=(nSideID==0)? -1:1;
282  (m_vecDetectorPartID)[nPotID*m_nMaxTrackCnt+arrTrackCntPerRPot[nPotID]]=(nSideID==0)? 3:2;
283  (m_vecXDetCS)[nPotID*m_nMaxTrackCnt+arrTrackCntPerRPot[nPotID]]=nODSign*22.0;
284  (m_vecYDetCS)[nPotID*m_nMaxTrackCnt+arrTrackCntPerRPot[nPotID]]=locRecODEvent->getYposition();
285  (m_vecOverY)[nPotID*m_nMaxTrackCnt+arrTrackCntPerRPot[nPotID]]=locRecODEvent->getOverY();
286  (m_vecNumY)[nPotID*m_nMaxTrackCnt+arrTrackCntPerRPot[nPotID]]=locRecODEvent->getNumY();
287 
288  vecFiberSel=locRecODEvent->getFibSel();
289  for(i=0;i<vecFiberSel.size();i++)
290  {
291  (m_vecODFibSel)[nPotID*m_nMaxTrackCnt*ODPLATESCNT+arrTrackCntPerRPot[nPotID]*ODPLATESCNT+i]=vecFiberSel[i];
292  }
293 
294  arrTrackCntPerRPot[nPotID]++;
295  }
296 
297  }
298  else
299  {
300  ATH_MSG_WARNING( "Cannot find '"<< EVCOLLNAME_LOCREC <<"' or '"<<EVCOLLNAME_LOCRECOD<<"' collection" );
301  //return StatusCode::FAILURE;
302  }
303 
304  //LocRecCorrEvCollection && LocRecCorrODEvCollection
307 
308  if(locRecCorrEvColl.isValid() && locRecCorrODEvColl.isValid())
309  {
310  memset(&arrTrackCntPerRPot[0],0,sizeof(arrTrackCntPerRPot));
312 
313  //fill data - LocRecCorrEvCollection - ONLY DetCS for now (TODO rest)
314  for(const ALFA_LocRecCorrEvent* locRecCorrEvent : *locRecCorrEvColl)
315  {
316  nPotID=locRecCorrEvent->getPotNum();
317 
318  (m_vecXLhcCS)[nPotID*m_nMaxTrackCnt+arrTrackCntPerRPot[nPotID]]=locRecCorrEvent->getXpositionLHC();
319  (m_vecYLhcCS)[nPotID*m_nMaxTrackCnt+arrTrackCntPerRPot[nPotID]]=locRecCorrEvent->getYpositionLHC();
320  (m_vecZLhcCS)[nPotID*m_nMaxTrackCnt+arrTrackCntPerRPot[nPotID]]=locRecCorrEvent->getZpositionLHC();
321 
322  (m_vecXRPotCS)[nPotID*m_nMaxTrackCnt+arrTrackCntPerRPot[nPotID]]=locRecCorrEvent->getXpositionPot();
323  (m_vecYRPotCS)[nPotID*m_nMaxTrackCnt+arrTrackCntPerRPot[nPotID]]=locRecCorrEvent->getYpositionPot();
324 
325  (m_vecXStatCS)[nPotID*m_nMaxTrackCnt+arrTrackCntPerRPot[nPotID]]=locRecCorrEvent->getXpositionStat();
326  (m_vecYStatCS)[nPotID*m_nMaxTrackCnt+arrTrackCntPerRPot[nPotID]]=locRecCorrEvent->getYpositionStat();
327 
328  (m_vecXBeamCS)[nPotID*m_nMaxTrackCnt+arrTrackCntPerRPot[nPotID]]=locRecCorrEvent->getXpositionBeam();
329  (m_vecYBeamCS)[nPotID*m_nMaxTrackCnt+arrTrackCntPerRPot[nPotID]]=locRecCorrEvent->getYpositionBeam();
330 
331  arrTrackCntPerRPot[nPotID]++;
332  }
333 
334  //fill data - LocRecCorrODEvCollection - ONLY DetCS for now (TODO rest)
335  for(const ALFA_LocRecCorrODEvent* locRecCorrODEvent : *locRecCorrODEvColl)
336  {
337  nPotID=locRecCorrODEvent->getPotNum();
338  nSideID=locRecCorrODEvent->getSide();
339 
340  nODSign=(nSideID==0)? -1:1;
341  (m_vecXLhcCS)[nPotID*m_nMaxTrackCnt+arrTrackCntPerRPot[nPotID]]=nODSign*22.0;
342  (m_vecYLhcCS)[nPotID*m_nMaxTrackCnt+arrTrackCntPerRPot[nPotID]]=locRecCorrODEvent->getYpositionLHC();
343  (m_vecZLhcCS)[nPotID*m_nMaxTrackCnt+arrTrackCntPerRPot[nPotID]]=locRecCorrODEvent->getZpositionLHC();
344 
345  (m_vecXRPotCS)[nPotID*m_nMaxTrackCnt+arrTrackCntPerRPot[nPotID]]=nODSign*22.0;
346  (m_vecYRPotCS)[nPotID*m_nMaxTrackCnt+arrTrackCntPerRPot[nPotID]]=locRecCorrODEvent->getYpositionPot();
347 
348  (m_vecXStatCS)[nPotID*m_nMaxTrackCnt+arrTrackCntPerRPot[nPotID]]=nODSign*22.0;
349  (m_vecYStatCS)[nPotID*m_nMaxTrackCnt+arrTrackCntPerRPot[nPotID]]=locRecCorrODEvent->getYpositionStat();
350 
351  (m_vecXBeamCS)[nPotID*m_nMaxTrackCnt+arrTrackCntPerRPot[nPotID]]=nODSign*22.0;
352  (m_vecYBeamCS)[nPotID*m_nMaxTrackCnt+arrTrackCntPerRPot[nPotID]]=locRecCorrODEvent->getYpositionBeam();
353 
354  arrTrackCntPerRPot[nPotID]++;
355  }
356  }
357  else
358  {
359  ATH_MSG_WARNING( "Cannot find '"<< EVCOLLNAME_LOCRECCORR <<"' or '"<<EVCOLLNAME_LOCRECCORROD<<"' collection" );
360  //return StatusCode::FAILURE;
361  }
362 
363  auto pData =
364  xAODContainer.push_back(std::make_unique<xAOD::ALFAData>());
365 
366  //LocRecEvCollection & LocRecODEvCollection
367  pData->setXDetCS(m_vecXDetCS);
368  pData->setYDetCS(m_vecYDetCS);
369  pData->setDetectorPartID(m_vecDetectorPartID);
370  pData->setMaxTrackCnt(m_nMaxTrackCnt);
371  pData->setOverU(m_vecOverU);
372  pData->setOverV(m_vecOverV);
373  pData->setOverY(m_vecOverY);
374  pData->setNumU(m_vecNumU);
375  pData->setNumV(m_vecNumV);
376  pData->setNumY(m_vecNumY);
377  pData->setMDFibSel(m_vecMDFibSel);
378  pData->setODFibSel(m_vecODFibSel);
379 
380  //LocRecCorrEvCollection & LocRecCorrODEvCollection
381  pData->setXLhcCS(m_vecXLhcCS);
382  pData->setYLhcCS(m_vecYLhcCS);
383  pData->setZLhcCS(m_vecZLhcCS);
384  pData->setXRPotCS(m_vecXRPotCS);
385  pData->setYRPotCS(m_vecYRPotCS);
386  pData->setXStatCS(m_vecXStatCS);
387  pData->setYStatCS(m_vecYStatCS);
388  pData->setXBeamCS(m_vecXBeamCS);
389  pData->setYBeamCS(m_vecYBeamCS);
390 
391  return StatusCode::SUCCESS;
392 }
393 
395  xAOD::ALFADataContainer& xAODContainer)
396 {
397  unsigned int i;
398  int nPotID, nPlateID, nFiberID, nSideID;
400 
401  if (m_nDataType==1)
402  {
403  //DCS IDs
404  /*
405  *m_pullDCSBlmID=DataEvent.GetDCSFolderID(EDCSI_BLM);
406  *m_pullDCSHVChannelID=DataEvent.GetDCSFolderID(EDCSI_HVCHANNEL);
407  *m_pullDCSLocalMonitoringID=DataEvent.GetDCSFolderID(EDCSI_LOCALMONITORING);
408  *m_pullDCSMovementID=DataEvent.GetDCSFolderID(EDCSI_MOVEMENT);
409  *m_pullDCSRadMonID=DataEvent.GetDCSFolderID(EDCSI_RADMON);
410  *m_pullDCSTriggerRatesID=DataEvent.GetDCSFolderID(EDCSI_TRIGGERRATES);
411  *m_pullDCSFEConfigurationID=DataEvent.GetDCSFolderID(EDCSI_FECONFIGURATION);
412  *m_pullDCSTriggerSettingsID=DataEvent.GetDCSFolderID(EDCSI_TRIGGERSETTINGS);*/
413 
414  //RawDataContainer
416  if(rawDataCont.isValid())
417  {
418  //m_nTimeStamp=pRawDataColl->GetTimeStamp();
419  //m_nTimeStamp_ns=pRawDataColl->GetTimeStampns();
420  //m_nBCId=pRawDataColl->GetBCId();
421 
422  vector<bool> vecRPPattern;
423  for (const ALFA_RawDataCollection* rawDataColl : *rawDataCont)
424  {
425  nPotID=rawDataColl->GetMBId_POT();
426  (m_vecScaler)[nPotID-1]=rawDataColl->Get_scaler_POT();
427 
428  vecRPPattern=rawDataColl->Get_pattern_POT();
429  for(i=0;i<vecRPPattern.size();i++){
430  if(i<RPOTSCNT*TRIGPATCNT) (m_vecTrigPat)[(nPotID-1)*TRIGPATCNT+i]=vecRPPattern[vecRPPattern.size()-(i+1)];
431  }
432  }
433  }
434  else
435  {
436  ATH_MSG_WARNING( "Cannot find '"<< EVCOLLNAME_RAWDATA <<"' collection" );
437  //return StatusCode::FAILURE;
438  }
439  }
440 
441  //DigitCollection
443  if(digitColl.isValid())
444  {
445  for (const ALFA_Digit* digit : *digitColl)
446  {
447  nPotID=digit->getStation(); //in range 0-7
448  nPlateID=digit->getPlate(); //indexed from 0
449  nFiberID=digit->getFiber(); //indexed from 0
450 
451  if(nPotID<RPOTSCNT && nPlateID<(MDLAYERSCNT*MDPLATESCNT) && nFiberID<MDFIBERSCNT)
452  {
453  (m_vecMDFiberHits)[(nPotID*MDLAYERSCNT*MDPLATESCNT*MDFIBERSCNT)+(nPlateID*MDFIBERSCNT)+nFiberID]=1;
454  (m_vecMDMultiplicity)[(nPotID*MDLAYERSCNT*MDPLATESCNT)+nPlateID]++;
455  }
456  else
457  {
458  ATH_MSG_ERROR( "Index exceed array size for [RPotID, nPlateID, nFiberID]= ["<<nPotID<<", "<<nPlateID<<", "<<nFiberID<<"]" );
459  //return StatusCode::FAILURE;
460  }
461  }
462  }
463  else{
464  ATH_MSG_WARNING( "Cannot find '"<< EVCOLLNAME_DIGIT <<"' collection" );
465  //return StatusCode::FAILURE;
466  }
467 
468  //ODDigitCollection
470  if(odDigitColl.isValid())
471  {
472  for (const ALFA_ODDigit* oddigit : *odDigitColl)
473  {
474  nPotID=oddigit->getStation(); //in range 0-7
475  nPlateID=oddigit->getPlate(); //indexed from 0
476  nSideID=oddigit->getSide(); //indexed from 0
477  nFiberID=oddigit->getFiber(); //indexed from 0
478 
479  if(nPotID<RPOTSCNT && nPlateID<(ODPLATESCNT) && nFiberID<ODLAYERSCNT*ODFIBERSCNT)
480  {
481  if(nSideID==0){ //right side
483  (m_vecODMultiplicityNeg)[(nPotID*ODPLATESCNT)+nPlateID]++;
484  }
485  else{ //left side
487  (m_vecODMultiplicityPos)[(nPotID*ODPLATESCNT)+nPlateID]++;
488  }
489  }
490  else
491  {
492  ATH_MSG_ERROR( "Index exceed array size for [RPotID, nPlateID, nFiberID, nSideID]= ["<<nPotID<<", "<<nPlateID<<", "<<nFiberID<<", "<<nSideID<<"]" );
493  //return StatusCode::FAILURE;
494  }
495  }
496  }
497  else
498  {
499  ATH_MSG_WARNING( "Cannot find '"<< EVCOLLNAME_ODDIGIT <<"' collection" );
500  //return StatusCode::FAILURE;
501  }
502 
503  auto pData =
504  xAODContainer.push_back(std::make_unique<xAOD::ALFAData>());
505 
506  //RawDataContainer
507  pData->setScaler(m_vecScaler);
508  //pData->setBCId(m_nBCId);
509  //pData->setTimeStamp(m_nTimeStamp);
510  //pData->setTimeStamp_ns(m_nTimeStamp_ns);
511  pData->setTrigPat(m_vecTrigPat);
512 
513  //DigitCollection
514  pData->setMDFiberHits(m_vecMDFiberHits);
515  pData->setMDMultiplicity(m_vecMDMultiplicity);
516 
517  //ODDigitCollection
518  pData->setODFiberHitsPos(m_vecODFiberHitsPos);
519  pData->setODFiberHitsNeg(m_vecODFiberHitsNeg);
520  pData->setODMultiplicityPos(m_vecODMultiplicityPos);
521  pData->setODMultiplicityNeg(m_vecODMultiplicityNeg);
522 
523  return StatusCode::SUCCESS;
524 }
525 
526 void ALFA_CLinkAlg::ClearXAODTrackingData(const int nMaxTrackCnt, eRecType eType)
527 {
528  if(eType==ERC_LOCUNCORRECTED)
529  {
530  //LocRecEvCollection & LocRecEvODCollection
531  m_vecXDetCS.resize(RPOTSCNT*nMaxTrackCnt);
532  fill_n(m_vecXDetCS.begin(),m_vecXDetCS.size(),-9999);
533  m_vecYDetCS.resize(RPOTSCNT*nMaxTrackCnt);
534  fill_n(m_vecYDetCS.begin(),m_vecYDetCS.size(),-9999);
535  m_vecDetectorPartID.resize(RPOTSCNT*nMaxTrackCnt);
536  fill_n(m_vecDetectorPartID.begin(),m_vecDetectorPartID.size(),0);
537  m_vecOverU.resize(RPOTSCNT*nMaxTrackCnt);
538  fill_n(m_vecOverU.begin(),m_vecOverU.size(),-9999);
539  m_vecOverV.resize(RPOTSCNT*nMaxTrackCnt);
540  fill_n(m_vecOverV.begin(),m_vecOverV.size(),-9999);
541  m_vecOverY.resize(RPOTSCNT*nMaxTrackCnt);
542  fill_n(m_vecOverY.begin(),m_vecOverY.size(),-9999);
543  m_vecNumU.resize(RPOTSCNT*nMaxTrackCnt);
544  fill_n(m_vecNumU.begin(),m_vecNumU.size(),-9999);
545  m_vecNumV.resize(RPOTSCNT*nMaxTrackCnt);
546  fill_n(m_vecNumV.begin(),m_vecNumV.size(),-9999);
547  m_vecNumY.resize(RPOTSCNT*nMaxTrackCnt);
548  fill_n(m_vecNumY.begin(),m_vecNumY.size(),-9999);
549  m_vecMDFibSel.resize(RPOTSCNT*nMaxTrackCnt*MDLAYERSCNT*MDPLATESCNT);
550  fill_n(m_vecMDFibSel.begin(),m_vecMDFibSel.size(),-9999);
551  m_vecODFibSel.resize(RPOTSCNT*nMaxTrackCnt*ODPLATESCNT);
552  fill_n(m_vecODFibSel.begin(),m_vecODFibSel.size(),-9999);
553  }
554  else if(eType==ERC_LOCCORRECTED)
555  {
556  m_vecXLhcCS.resize(RPOTSCNT*nMaxTrackCnt);
557  fill_n(m_vecXLhcCS.begin(),m_vecXLhcCS.size(),-9999);
558  m_vecYLhcCS.resize(RPOTSCNT*nMaxTrackCnt);
559  fill_n(m_vecYLhcCS.begin(),m_vecYLhcCS.size(),-9999);
560  m_vecZLhcCS.resize(RPOTSCNT*nMaxTrackCnt);
561  fill_n(m_vecZLhcCS.begin(),m_vecZLhcCS.size(),-9999);
562  m_vecXRPotCS.resize(RPOTSCNT*nMaxTrackCnt);
563  fill_n(m_vecXRPotCS.begin(),m_vecXRPotCS.size(),-9999);
564  m_vecYRPotCS.resize(RPOTSCNT*nMaxTrackCnt);
565  fill_n(m_vecYRPotCS.begin(),m_vecYRPotCS.size(),-9999);
566  m_vecXStatCS.resize(RPOTSCNT*nMaxTrackCnt);
567  fill_n(m_vecXStatCS.begin(),m_vecXStatCS.size(),-9999);
568  m_vecYStatCS.resize(RPOTSCNT*nMaxTrackCnt);
569  fill_n(m_vecYStatCS.begin(),m_vecYStatCS.size(),-9999);
570  m_vecXBeamCS.resize(RPOTSCNT*nMaxTrackCnt);
571  fill_n(m_vecXBeamCS.begin(),m_vecXBeamCS.size(),-9999);
572  m_vecYBeamCS.resize(RPOTSCNT*nMaxTrackCnt);
573  fill_n(m_vecYBeamCS.begin(),m_vecYBeamCS.size(),-9999);
574  }
575 }
576 
578 {
579  if (m_nDataType==1)
580  {
581  //DCS IDs
582  /*
583  *m_pullDCSBlmID=0;
584  *m_pullDCSHVChannelID=0;
585  *m_pullDCSLocalMonitoringID=0;
586  *m_pullDCSMovementID=0;
587  *m_pullDCSRadMonID=0;
588  *m_pullDCSTriggerRatesID=0;
589  *m_pullDCSFEConfigurationID=0;
590  *m_pullDCSTriggerSettingsID=0;*/
591 
592  //RawDataContainer
593  m_vecScaler.resize(RPOTSCNT);
594  fill_n(m_vecScaler.begin(),m_vecScaler.size(),-1);
595  //m_nBCId=-1;
596  //m_nTimeStamp=-1;
597  //m_nTimeStamp_ns=-1;
599  fill_n(m_vecTrigPat.begin(),m_vecTrigPat.size(),0);
600  }
601 
602  //DigitCollection
604  fill_n(m_vecMDFiberHits.begin(),m_vecMDFiberHits.size(),0);
606  fill_n(m_vecMDMultiplicity.begin(),m_vecMDMultiplicity.size(),0);
607 
608  //ODDigitCollection
610  fill_n(m_vecODFiberHitsPos.begin(),m_vecODFiberHitsPos.size(),0);
612  fill_n(m_vecODFiberHitsNeg.begin(),m_vecODFiberHitsNeg.size(),0);
613 
615  fill_n(m_vecODMultiplicityPos.begin(),m_vecODMultiplicityPos.size(),0);
617  fill_n(m_vecODMultiplicityNeg.begin(),m_vecODMultiplicityNeg.size(),0);
618 }
ALFA_CLinkAlg::m_localMonitoringKey
SG::ReadCondHandleKey< CondAttrListCollection > m_localMonitoringKey
Definition: ALFA_CLinkAlg.h:130
eRecType
eRecType
Definition: ALFA_CLinkAlg.h:50
ALFA_CLinkAlg::execute
virtual StatusCode execute() override
Definition: ALFA_CLinkAlg.cxx:61
ALFA_CLinkAlg::m_vecOverV
std::vector< float > m_vecOverV
Definition: ALFA_CLinkAlg.h:89
ALFA_CLinkAlg::m_xaodDataKey
SG::WriteHandleKey< xAOD::ALFADataContainer > m_xaodDataKey
Definition: ALFA_CLinkAlg.h:160
ALFA_CLinkAlg::m_vecYBeamCS
std::vector< float > m_vecYBeamCS
Definition: ALFA_CLinkAlg.h:106
ALFA_LocRecCorrODEvent
Definition: ALFA_LocRecCorrODEvent.h:8
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
ODLAYERSCNT
#define ODLAYERSCNT
Definition: ALFA_CLinkAlg.h:30
SG::ReadHandle::cptr
const_pointer_type cptr()
Dereference the pointer.
ALFA_CLinkAlg::m_vecXStatCS
std::vector< float > m_vecXStatCS
Definition: ALFA_CLinkAlg.h:103
ALFA_CLinkAlg::m_vecXRPotCS
std::vector< float > m_vecXRPotCS
Definition: ALFA_CLinkAlg.h:101
ALFA_CLinkEvent::AddLink
StatusCode AddLink(eDVType eType, const void *pObj)
Definition: ALFA_CLinkEvent.cxx:20
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
ALFA_CLinkAlg::m_vecZLhcCS
std::vector< float > m_vecZLhcCS
Definition: ALFA_CLinkAlg.h:100
ALFA_CLinkAlg::CalcAllDCSIds
StatusCode CalcAllDCSIds(const EventContext &ctx, DCSID &pDCSIds) const
Definition: ALFA_CLinkAlg.cxx:184
ALFA_CLinkAlg::m_nDataType
int m_nDataType
Definition: ALFA_CLinkAlg.h:59
EDVT_LOCRECODEVCOLLECTION
@ EDVT_LOCRECODEVCOLLECTION
Definition: ALFA_CLinkEvent.h:44
EVCOLLNAME_LOCRECCORR
#define EVCOLLNAME_LOCRECCORR
Definition: ALFA_CLinkEvent.h:29
ALFA_CLinkAlg::m_vecNumU
std::vector< int > m_vecNumU
Definition: ALFA_CLinkAlg.h:91
ALFA_CLinkAlg::m_vecNumV
std::vector< int > m_vecNumV
Definition: ALFA_CLinkAlg.h:92
_DCSID::ullMovementID
unsigned long long ullMovementID
Definition: ALFA_CLinkEvent.h:54
RPOTSCNT
#define RPOTSCNT
Definition: ALFA_CLinkAlg.h:26
_DCSID::ullFEConfigurationID
unsigned long long ullFEConfigurationID
Definition: ALFA_CLinkEvent.h:57
ALFA_CLinkAlg::m_FEConfigurationKey
SG::ReadCondHandleKey< CondAttrListCollection > m_FEConfigurationKey
Definition: ALFA_CLinkAlg.h:138
EVCOLLNAME_ODDIGIT
#define EVCOLLNAME_ODDIGIT
Definition: ALFA_CLinkEvent.h:26
ALFA_CLinkAlg::m_vecMDMultiplicity
std::vector< int > m_vecMDMultiplicity
Definition: ALFA_CLinkAlg.h:117
checkRpcDigits.digit
digit
Definition: checkRpcDigits.py:186
ALFA_CLinkAlg::m_locRecCorrODEvCollKey
SG::ReadHandleKey< ALFA_LocRecCorrODEvCollection > m_locRecCorrODEvCollKey
Definition: ALFA_CLinkAlg.h:155
ALFA_LocRecEvent
Definition: ALFA_LocRecEvent.h:10
_DCSID::ullHVChannelID
unsigned long long ullHVChannelID
Definition: ALFA_CLinkEvent.h:52
EDVT_LOCRECEVCOLLECTION
@ EDVT_LOCRECEVCOLLECTION
Definition: ALFA_CLinkEvent.h:44
ReadCondHandle.h
ALFA_CLinkAlg::m_vecNumY
std::vector< int > m_vecNumY
Definition: ALFA_CLinkAlg.h:93
ALFA_CLinkAlg::m_ODDigitCollKey
SG::ReadHandleKey< ALFA_ODDigitCollection > m_ODDigitCollKey
Definition: ALFA_CLinkAlg.h:147
ALFA_CLinkAlg::m_locRecODEvCollKey
SG::ReadHandleKey< ALFA_LocRecODEvCollection > m_locRecODEvCollKey
Definition: ALFA_CLinkAlg.h:151
ALFA_CLinkAlg::m_locRecEvCollKey
SG::ReadHandleKey< ALFA_LocRecEvCollection > m_locRecEvCollKey
Definition: ALFA_CLinkAlg.h:149
EVCOLLNAME_DIGIT
#define EVCOLLNAME_DIGIT
Definition: ALFA_CLinkEvent.h:25
_DCSID::ullBlmID
unsigned long long ullBlmID
Definition: ALFA_CLinkEvent.h:51
ALFA_CLinkAlg::m_vecXLhcCS
std::vector< float > m_vecXLhcCS
Definition: ALFA_CLinkAlg.h:98
ALFA_CLinkAlg::FillXAOD_TrackingData
StatusCode FillXAOD_TrackingData(const EventContext &ctx, xAOD::ALFADataContainer &xAODContainer)
Definition: ALFA_CLinkAlg.cxx:216
WriteHandle.h
Handle class for recording to StoreGate.
EDVT_DIGITCOLLECTION
@ EDVT_DIGITCOLLECTION
Definition: ALFA_CLinkEvent.h:44
ALFA_CLinkAlg::m_vecXDetCS
std::vector< float > m_vecXDetCS
Definition: ALFA_CLinkAlg.h:85
ALFA_CLinkAlg::m_vecOverU
std::vector< float > m_vecOverU
Definition: ALFA_CLinkAlg.h:88
MDLAYERSCNT
#define MDLAYERSCNT
Definition: ALFA_CLinkAlg.h:27
ALFA_CLinkAlg::m_vecScaler
std::vector< int > m_vecScaler
Definition: ALFA_CLinkAlg.h:109
ALFA_Digit
Definition: ALFA_Digit.h:8
ALFA_CLinkAlg::m_vecTrigPat
std::vector< int > m_vecTrigPat
Definition: ALFA_CLinkAlg.h:113
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
ALFA_CLinkAlg::CalcDCSId
unsigned long long CalcDCSId(const EventContext &ctx, const SG::ReadCondHandleKey< CondAttrListCollection > &key) const
Definition: ALFA_CLinkAlg.cxx:157
ALFA_CLinkAlg::initialize
virtual StatusCode initialize() override
Definition: ALFA_CLinkAlg.cxx:34
lumiFormat.i
int i
Definition: lumiFormat.py:85
h
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
extractSporadic.h
list h
Definition: extractSporadic.py:97
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
ALFA_CLinkAlg::m_vecODMultiplicityPos
std::vector< int > m_vecODMultiplicityPos
Definition: ALFA_CLinkAlg.h:122
ALFA_CLinkAlg::m_vecYStatCS
std::vector< float > m_vecYStatCS
Definition: ALFA_CLinkAlg.h:104
EDVT_RAWDATAEVCOLLECTION
@ EDVT_RAWDATAEVCOLLECTION
Definition: ALFA_CLinkEvent.h:44
EDVT_ODDIGITCOLLECTION
@ EDVT_ODDIGITCOLLECTION
Definition: ALFA_CLinkEvent.h:44
ALFADataAuxContainer.h
ALFA_CLinkAlg::m_clinkEventKey
SG::WriteHandleKey< ALFA_CLinkEvent > m_clinkEventKey
Definition: ALFA_CLinkAlg.h:158
ERC_LOCUNCORRECTED
@ ERC_LOCUNCORRECTED
Definition: ALFA_CLinkAlg.h:50
ALFA_LocRecCorrEvent
Definition: ALFA_LocRecCorrEvent.h:8
EDVT_LOCRECCORREVCOLLECTION
@ EDVT_LOCRECCORREVCOLLECTION
Definition: ALFA_CLinkEvent.h:45
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
EVCOLLNAME_RAWDATA
#define EVCOLLNAME_RAWDATA
Definition: ALFA_CLinkEvent.h:24
_DCSID::ullTriggerSettingsID
unsigned long long ullTriggerSettingsID
Definition: ALFA_CLinkEvent.h:58
ALFA_CLinkAlg::m_vecYDetCS
std::vector< float > m_vecYDetCS
Definition: ALFA_CLinkAlg.h:86
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
TRIGPATCNT
#define TRIGPATCNT
Definition: ALFA_CLinkAlg.h:34
ALFA_RawDataCollection
RDOs : Chamber Service Module, collection of RawData.
Definition: ALFA_RawDataCollection.h:19
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
ALFA_LocRecODEvent
Definition: ALFA_LocRecODEvent.h:10
DataVector
Derived DataVector<T>.
Definition: DataVector.h:794
ALFA_CLinkAlg::m_rawDataContKey
SG::ReadHandleKey< ALFA_RawDataContainer > m_rawDataContKey
Definition: ALFA_CLinkAlg.h:143
ALFAData.h
AthAlgorithm
Definition: AthAlgorithm.h:47
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
ALFA_CLinkAlg::ALFA_CLinkAlg
ALFA_CLinkAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition: ALFA_CLinkAlg.cxx:17
MDFIBERSCNT
#define MDFIBERSCNT
Definition: ALFA_CLinkAlg.h:29
ALFA_CLinkAlg::m_vecYLhcCS
std::vector< float > m_vecYLhcCS
Definition: ALFA_CLinkAlg.h:99
EDVT_LOCRECCORRODEVCOLLECTION
@ EDVT_LOCRECCORRODEVCOLLECTION
Definition: ALFA_CLinkEvent.h:45
ALFA_CLinkAlg::m_vecODFiberHitsPos
std::vector< int > m_vecODFiberHitsPos
Definition: ALFA_CLinkAlg.h:120
EVCOLLNAME_LOCRECOD
#define EVCOLLNAME_LOCRECOD
Definition: ALFA_CLinkEvent.h:28
ALFA_CLinkAlg::m_vecMDFiberHits
std::vector< int > m_vecMDFiberHits
Definition: ALFA_CLinkAlg.h:116
ALFA_CLinkAlg::m_vecODFibSel
std::vector< int > m_vecODFibSel
Definition: ALFA_CLinkAlg.h:95
ALFA_CLinkAlg::LoadAllEventData
StatusCode LoadAllEventData(const EventContext &ctx, ALFA_CLinkEvent &dataEvent) const
Definition: ALFA_CLinkAlg.cxx:89
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
_DCSID::ullLocalMonitoringID
unsigned long long ullLocalMonitoringID
Definition: ALFA_CLinkEvent.h:53
errorcheck.h
Helpers for checking error return status codes and reporting errors.
ALFA_CLinkAlg::m_digitCollKey
SG::ReadHandleKey< ALFA_DigitCollection > m_digitCollKey
Definition: ALFA_CLinkAlg.h:145
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
ALFA_CLinkAlg::m_triggerSettingsKey
SG::ReadCondHandleKey< CondAttrListCollection > m_triggerSettingsKey
Definition: ALFA_CLinkAlg.h:140
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
ALFA_CLinkAlg::ClearXAODHeaderData
void ClearXAODHeaderData()
Definition: ALFA_CLinkAlg.cxx:577
ALFA_CLinkAlg::m_BLMKey
SG::ReadCondHandleKey< CondAttrListCollection > m_BLMKey
Definition: ALFA_CLinkAlg.h:126
SG::ReadCondHandleKey< CondAttrListCollection >
ALFA_CLinkEvent
Definition: ALFA_CLinkEvent.h:61
ALFA_CLinkAlg::~ALFA_CLinkAlg
virtual ~ALFA_CLinkAlg()
Definition: ALFA_CLinkAlg.cxx:29
SG::WriteHandle
Definition: StoreGate/StoreGate/WriteHandle.h:76
ODPLATESCNT
#define ODPLATESCNT
Definition: ALFA_CLinkAlg.h:31
ALFA_CLinkAlg::m_locRecCorrEvCollKey
SG::ReadHandleKey< ALFA_LocRecCorrEvCollection > m_locRecCorrEvCollKey
Definition: ALFA_CLinkAlg.h:153
SG::WriteHandle::record
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
CaloSwCorrections.time
def time(flags, cells_name, *args, **kw)
Definition: CaloSwCorrections.py:242
ALFA_CLinkAlg::m_vecMDFibSel
std::vector< int > m_vecMDFibSel
Definition: ALFA_CLinkAlg.h:94
ALFA_CLinkAlg::GenerateXAOD
StatusCode GenerateXAOD(const EventContext &ctx)
Definition: ALFA_CLinkAlg.cxx:200
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
EVCOLLNAME_LOCREC
#define EVCOLLNAME_LOCREC
Definition: ALFA_CLinkEvent.h:27
ODFIBERSCNT
#define ODFIBERSCNT
Definition: ALFA_CLinkAlg.h:32
ALFA_CLinkAlg::ClearXAODTrackingData
void ClearXAODTrackingData(const int nMaxTrackCnt, eRecType eType)
Definition: ALFA_CLinkAlg.cxx:526
athena_checkUpload.Folder
string Folder
Definition: athena_checkUpload.py:188
_DCSID::ullTriggerRatesID
unsigned long long ullTriggerRatesID
Definition: ALFA_CLinkEvent.h:56
ALFA_CLinkAlg::FillXAOD_HeaderData
StatusCode FillXAOD_HeaderData(const EventContext &ctx, xAOD::ALFADataContainer &xAODContainer)
Definition: ALFA_CLinkAlg.cxx:394
ALFA_CLinkAlg::m_vecODMultiplicityNeg
std::vector< int > m_vecODMultiplicityNeg
Definition: ALFA_CLinkAlg.h:123
ALFA_CLinkAlg::m_HVChannelKey
SG::ReadCondHandleKey< CondAttrListCollection > m_HVChannelKey
Definition: ALFA_CLinkAlg.h:128
ALFA_CLinkAlg.h
_DCSID
Definition: ALFA_CLinkEvent.h:50
ALFA_CLinkAlg::m_vecYRPotCS
std::vector< float > m_vecYRPotCS
Definition: ALFA_CLinkAlg.h:102
_DCSID::ullRadMonID
unsigned long long ullRadMonID
Definition: ALFA_CLinkEvent.h:55
ALFA_CLinkAlg::m_vecDetectorPartID
std::vector< int > m_vecDetectorPartID
Definition: ALFA_CLinkAlg.h:87
ReadHandle.h
Handle class for reading from StoreGate.
EVCOLLNAME_LOCRECCORROD
#define EVCOLLNAME_LOCRECCORROD
Definition: ALFA_CLinkEvent.h:30
ALFA_CLinkAlg::m_vecXBeamCS
std::vector< float > m_vecXBeamCS
Definition: ALFA_CLinkAlg.h:105
ALFA_CLinkAlg::m_movementKey
SG::ReadCondHandleKey< CondAttrListCollection > m_movementKey
Definition: ALFA_CLinkAlg.h:132
ALFA_CLinkAlg::m_nProcessingMode
int m_nProcessingMode
Definition: ALFA_CLinkAlg.h:60
ALFA_CLinkAlg::finalize
virtual StatusCode finalize() override
Definition: ALFA_CLinkAlg.cxx:82
ALFA_CLinkAlg::m_nMaxTrackCnt
int m_nMaxTrackCnt
Definition: ALFA_CLinkAlg.h:84
ALFA_CLinkAlg::m_triggerRatesKey
SG::ReadCondHandleKey< CondAttrListCollection > m_triggerRatesKey
Definition: ALFA_CLinkAlg.h:136
ALFA_CLinkAlg::m_vecOverY
std::vector< float > m_vecOverY
Definition: ALFA_CLinkAlg.h:90
MDPLATESCNT
#define MDPLATESCNT
Definition: ALFA_CLinkAlg.h:28
ALFA_ODDigit
Definition: ALFA_ODDigit.h:8
ERC_LOCCORRECTED
@ ERC_LOCCORRECTED
Definition: ALFA_CLinkAlg.h:50
ALFA_CLinkAlg::m_radmonKey
SG::ReadCondHandleKey< CondAttrListCollection > m_radmonKey
Definition: ALFA_CLinkAlg.h:134
ALFADataContainer.h
ALFA_CLinkAlg::m_vecODFiberHitsNeg
std::vector< int > m_vecODFiberHitsNeg
Definition: ALFA_CLinkAlg.h:121
mapkey::key
key
Definition: TElectronEfficiencyCorrectionTool.cxx:37