ATLAS Offline Software
CTPResult_v1.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
6 // System include(s):
7 #include <iostream>
8 #include <stdexcept>
9 
10 // xAOD include(s):
12 
13 // Local include(s):
15 
16 namespace xAOD {
17 
18  // get/set the number of the CTP version to be used
19  AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(CTPResult_v1, uint32_t, ctpVersionNumber, setCtpVersionNumber);
20 
21  // Get/set the header marker word
23 
24  // Get/set the number of header words
26 
27  // Get/set the version of header format
28  AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(CTPResult_v1, uint32_t, headerFormatVersion, setHeaderFormatVersion);
29 
30  // Get/set the sub detector source ID
32 
33  // Get/set the run number
35 
36  // Get/set the extended LVL1 ID
38 
39  // Get/set the bunch crossing ID
41 
42  // Get/set the LVL1 trigger type
44 
45  // Get/set the LVL1 event type
47 
48  // get/set the vector TIP words for all bunch crossings
49  AUXSTORE_OBJECT_SETTER_AND_GETTER(CTPResult_v1, std::vector<std::vector<uint32_t>>, tipWords, setTIPWords)
50 
51  // get/set the vector TBP words for all bunch crossings
52  AUXSTORE_OBJECT_SETTER_AND_GETTER(CTPResult_v1, std::vector<std::vector<uint32_t>>, tbpWords, setTBPWords)
53 
54  // get/set the vector TAP words for all bunch crossings
55  AUXSTORE_OBJECT_SETTER_AND_GETTER(CTPResult_v1, std::vector<std::vector<uint32_t>>, tapWords, setTAPWords)
56 
57  // get/set the vector TAV words for all bunch crossings
58  AUXSTORE_OBJECT_SETTER_AND_GETTER(CTPResult_v1, std::vector<std::vector<uint32_t>>, tavWords, setTAVWords)
59 
60  // get the time stamp in seconds
62 
63  // get the time stamp in nanoseconds
64  AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(CTPResult_v1, uint32_t, timeNanoSec, setTimeNanoSec)
65 
66  // get/set the raw data words
67  AUXSTORE_OBJECT_SETTER_AND_GETTER(CTPResult_v1, std::vector<uint32_t>, additionalWords, setAdditionalWords)
68 
69  // get/set the turn counter
70  AUXSTORE_PRIMITIVE_SETTER_AND_GETTER( CTPResult_v1, uint32_t, turnCounter, setTurnCounter )
71 
72  // Get/set the error status word
74 
75  // Get/set the info status word
77 
78  // Get/set the number of status words
79  AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(CTPResult_v1, uint32_t, numStatusWords, setNumStatusWords);
80 
81  // Get/set the number data words
83 
84  // Get/set the position of status information in ROD (LVL1 assumes 1)
85  AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(CTPResult_v1, uint32_t, statusPosition, setStatusPosition);
86 
87  // get the number of bunches
89 
90  // get the L1 Accept Bunch Position
91  AUXSTORE_PRIMITIVE_GETTER(CTPResult_v1, uint32_t, l1AcceptBunchPosition)
92 
93  // Get the CTPBunchCrossing object for a specific bunch in the readout window. Returns L1A bunch by default.
95  int idx;
96  if (bunch == -1) {
97  idx = l1AcceptBunchPosition();
98  } else {
99  idx = bunch;
100  }
102  bc.tipWords = tipWords()[idx];
103  bc.tbpWords = tbpWords()[idx];
104  bc.tapWords = tapWords()[idx];
105  bc.tavWords = tavWords()[idx];
106  return bc;
107  }
108 
109  // set the number of bunches
111  if(nBCs > tipWords().size()) {
112  static const SG::AuxElement::Accessor< uint32_t > accNumOfBunches("numberOfBunches");
113  static const SG::AuxElement::Accessor< std::vector<std::vector<uint32_t> > > accTIPWords("tipWords");
114  static const SG::AuxElement::Accessor< std::vector<std::vector<uint32_t> > > accTBPWords("tbpWords");
115  static const SG::AuxElement::Accessor< std::vector<std::vector<uint32_t> > > accTAPWords("tapWords");
116  static const SG::AuxElement::Accessor< std::vector<std::vector<uint32_t> > > accTAVWords("tavWords");
117  accNumOfBunches( *this ) = nBCs;
118  accTIPWords( *this ).resize(nBCs);
119  accTBPWords( *this ).resize(nBCs);
120  accTAPWords( *this ).resize(nBCs);
121  accTAVWords( *this ).resize(nBCs);
122  }
123  }
124 
125  // set the L1 Accept Bunch Position
127  if(pos < numberOfBunches()) {
128  static const SG::Accessor< uint32_t > acc("l1AcceptBunchPosition");
129  acc( *this ) = pos;
130  }
131  }
132 
133  // Get TIP words for a specific bunch crossing
134  std::vector<uint32_t> CTPResult_v1::getTIPWords(const int bunch) const {
135  return getBC(bunch).tipWords;
136  }
137 
138  // Get TBP words for a specific bunch crossing
139  std::vector<uint32_t> CTPResult_v1::getTBPWords(const int bunch) const {
140  return getBC(bunch).tbpWords;
141  }
142 
143  // Get TAP words for a specific bunch crossing
144  std::vector<uint32_t> CTPResult_v1::getTAPWords(const int bunch) const {
145  return getBC(bunch).tapWords;
146  }
147 
148  // Get TAV words for a specific bunch crossing
149  std::vector<uint32_t> CTPResult_v1::getTAVWords(const int bunch) const {
150  return getBC(bunch).tavWords;
151  }
152 }
xAOD::AUXSTORE_PRIMITIVE_SETTER_AND_GETTER
AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(BTagging_v1, float, IP2D_pb, setIP2D_pb) AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(BTagging_v1
xAOD::CTPResult_v1::getTAVWords
std::vector< uint32_t > getTAVWords(const int bunchPosition=-1) const
Get the TAV (Trigger After Veto) words.
Definition: CTPResult_v1.cxx:149
SG::Accessor
Helper class to provide type-safe access to aux data.
Definition: Control/AthContainers/AthContainers/Accessor.h:68
AuxStoreAccessorMacros.h
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
xAOD
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Definition: ICaloAffectedTool.h:24
xAOD::CTPResult_v1::CTPBunchCrossing::tapWords
std::vector< uint32_t > tapWords
Definition: CTPResult_v1.h:34
const
bool const RAWDATA *ch2 const
Definition: LArRodBlockPhysicsV0.cxx:560
xAOD::CTPResult_v1
This is the trigger result for each item before prescale, after prescale and after veto....
Definition: CTPResult_v1.h:23
CTPResult_v1.h
PixelByteStreamErrors::BCID
@ BCID
Definition: PixelByteStreamErrors.h:13
python.setupRTTAlg.size
int size
Definition: setupRTTAlg.py:39
xAOD::CTPResult_v1::CTPBunchCrossing::tbpWords
std::vector< uint32_t > tbpWords
Definition: CTPResult_v1.h:33
xAOD::CTPResult_v1::CTPBunchCrossing::tipWords
std::vector< uint32_t > tipWords
Definition: CTPResult_v1.h:32
xAOD::CTPResult_v1::setL1AcceptBunchPosition
void setL1AcceptBunchPosition(const uint32_t pos)
Set the L1Accept bunch position.
Definition: CTPResult_v1.cxx:126
xAOD::CTPResult_v1::CTPBunchCrossing::tavWords
std::vector< uint32_t > tavWords
Definition: CTPResult_v1.h:35
xAOD::CTPResult_v1::tipWords
const std::vector< std::vector< uint32_t > > & tipWords() const
Get the TIP words for all bunch crossings.
python.LumiBlobConversion.pos
pos
Definition: LumiBlobConversion.py:16
xAOD::CTPResult_v1::numberOfBunches
uint32_t numberOfBunches() const
Get the number of bunch crossings.
DeMoAtlasDataLoss.runNumber
string runNumber
Definition: DeMoAtlasDataLoss.py:64
AUXSTORE_PRIMITIVE_GETTER
#define AUXSTORE_PRIMITIVE_GETTER(CL, TYPE, NAME)
Macro creating the reader function for a primitive auxiliary property.
Definition: AuxStoreAccessorMacros.h:59
LArNewCalib_DelayDump_OFC_Cali.idx
idx
Definition: LArNewCalib_DelayDump_OFC_Cali.py:69
RunTileMonitoring.triggerType
triggerType
Definition: RunTileMonitoring.py:162
xAOD::CTPResult_v1::getTAPWords
std::vector< uint32_t > getTAPWords(const int bunchPosition=-1) const
Get the TAP (Trigger After Prescale) words.
Definition: CTPResult_v1.cxx:144
xAOD::CTPResult_v1::CTPBunchCrossing
This is the trigger result for each item before prescale, after prescale and after veto for a single ...
Definition: CTPResult_v1.h:31
xAOD::CTPResult_v1::getBC
const CTPResult_v1::CTPBunchCrossing getBC(const int bunch=-1) const
Get the CTPBunchCrossing object for a specific bunch in the readout window.
Definition: CTPResult_v1.cxx:94
xAOD::CTPResult_v1::getTIPWords
std::vector< uint32_t > getTIPWords(const int bunchPosition=-1) const
Get the TIP (Trigger Inputs to the CTP) words (in Run3 512 items)
Definition: CTPResult_v1.cxx:134
xAOD::CTPResult_v1::getTBPWords
std::vector< uint32_t > getTBPWords(const int bunchPosition=-1) const
Get the TBP (Trigger Before Prescale) words.
Definition: CTPResult_v1.cxx:139
xAOD::CTPResult_v1::setNumberOfBunches
void setNumberOfBunches(const uint32_t nBCs)
Set the number of bunch crossings.
Definition: CTPResult_v1.cxx:110
xAOD::AUXSTORE_OBJECT_SETTER_AND_GETTER
AUXSTORE_OBJECT_SETTER_AND_GETTER(CaloRings_v1, RingSetLinks, ringSetLinks, setRingSetLinks) unsigned CaloRings_v1
Definition: CaloRings_v1.cxx:27