ATLAS Offline Software
Loading...
Searching...
No Matches
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
16namespace 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
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) {
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
153 // Get a vector of header words
154 const std::vector<uint32_t> CTPResult_v1::header() const {
155 return {
156 headerMarker(),
157 headerSize(),
159 sourceID(),
160 runNumber(),
161 L1ID(),
162 BCID(),
163 triggerType(),
164 eventType()
165 };
166 }
167
168 // Get the header words
169 void CTPResult_v1::setHeader(const uint32_t marker, const uint32_t version, const uint32_t sourceid, const uint32_t l1id, const uint32_t runNum, const uint32_t bcid, const uint32_t trigType, const uint32_t evtType) {
170 setHeaderMarker(marker);
171 setHeaderSize(8);
172 setHeaderFormatVersion(version);
173 setSourceID(sourceid);
174 setRunNumber(runNum);
175 setL1ID(l1id);
176 setBCID(bcid);
177 setTriggerType(trigType);
178 setEventType(evtType);
179 }
180
181 // Get a vector of trailer words
182 const std::vector<uint32_t> CTPResult_v1::trailer() const {
183 return {
184 errorStatus(),
185 infoStatus(),
187 numDataWords(),
189 };
190 }
191
192 // Set the trailer words
193 void CTPResult_v1::setTrailer(const uint32_t numData, const uint32_t errStat, const uint32_t infoStat, const uint32_t numStat, const uint32_t statPos) {
194 setErrorStatus(errStat);
195 setInfoStatus(infoStat);
196 setNumStatusWords(numStat);
197 setNumDataWords(numData);
198 setStatusPosition(statPos);
199 }
200}
#define AUXSTORE_PRIMITIVE_GETTER(CL, TYPE, NAME)
Macro creating the reader function for a primitive auxiliary property.
#define AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(CL, TYPE, NAME, SETTER)
Macro creating the accessors of primitive auxiliary properties.
#define AUXSTORE_OBJECT_SETTER_AND_GETTER(CL, TYPE, NAME, SETTER)
Macro creating the accessors of complex auxiliary properties.
Helper class to provide type-safe access to aux data.
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:572
This is the trigger result for each item before prescale, after prescale and after veto.
void setHeaderFormatVersion(const uint32_t word)
Set the format version of the header.
uint32_t numDataWords() const
Retrieve the number of data words.
void setEventType(const uint32_t word)
Set the LVL1 event type.
uint32_t L1ID() const
Retrieve the extended LVL1 ID.
const std::vector< std::vector< uint32_t > > & tbpWords() const
Get the TBP words for all bunch crossings.
void setInfoStatus(const uint32_t word)
Set the info status word.
uint32_t numStatusWords() const
Retrieve the number of status words in the trailer.
const std::vector< std::vector< uint32_t > > & tapWords() const
Get the TAP words for all bunch crossings.
std::vector< uint32_t > getTBPWords(const int bunchPosition=-1) const
Get the TBP (Trigger Before Prescale) words.
void setNumberOfBunches(const uint32_t nBCs)
Set the number of bunch crossings.
uint32_t infoStatus() const
Retrieve the info status word.
uint32_t headerSize() const
Retrieve the number of words in the header.
void setHeader(const uint32_t marker, const uint32_t version, const uint32_t sourceid, const uint32_t l1id=0, const uint32_t runNum=0, const uint32_t bcid=0, const uint32_t trigType=0, const uint32_t evtType=0)
Set the header words.
void setHeaderSize(const uint32_t word)
Set the number of words in the header.
std::vector< uint32_t > getTAPWords(const int bunchPosition=-1) const
Get the TAP (Trigger After Prescale) words.
uint32_t triggerType() const
Retrieve the LVL1 trigger type.
uint32_t runNumber() const
Retrieve the run number.
uint32_t statusPosition() const
Retrieve the position of status information in the ROD.
uint32_t BCID() const
Retrieve the bunch crossing ID.
void setNumStatusWords(const uint32_t word)
Set the number of status words in the trailer.
uint32_t headerFormatVersion() const
Retrieve the format version of the header.
void setHeaderMarker(const uint32_t word)
Set the header marker word.
const std::vector< uint32_t > trailer() const
Get the trailer words.
void setRunNumber(const uint32_t word)
Set the run number.
uint32_t errorStatus() const
Retrieve the error status word.
void setTriggerType(const uint32_t word)
Set the LVL1 trigger type.
void setBCID(const uint32_t word)
Set the bunch crossing ID.
const std::vector< std::vector< uint32_t > > & tipWords() const
Get the TIP words for all bunch crossings.
const std::vector< std::vector< uint32_t > > & tavWords() const
Get the TAV words for all bunch crossings.
void setL1ID(const uint32_t word)
Set the extended LVL1 ID.
void setSourceID(const uint32_t word)
Set the sub-detector source ID.
void setStatusPosition(const uint32_t word)
Set the position of status information in the ROD.
void setTrailer(const uint32_t numData, const uint32_t errStat=0, const uint32_t infoStat=0, const uint32_t numStat=2, const uint32_t statPos=1)
Set the trailer words.
uint32_t eventType() const
Retrieve the LVL1 event type.
void setNumDataWords(const uint32_t num)
Set the number of data words.
uint32_t headerMarker() const
Retrieve the header marker word.
const CTPResult_v1::CTPBunchCrossing getBC(const int bunch=-1) const
Get the CTPBunchCrossing object for a specific bunch in the readout window.
std::vector< uint32_t > getTIPWords(const int bunchPosition=-1) const
Get the TIP (Trigger Inputs to the CTP) words (in Run3 512 items)
std::vector< uint32_t > getTAVWords(const int bunchPosition=-1) const
Get the TAV (Trigger After Veto) words.
uint32_t numberOfBunches() const
Get the number of bunch crossings.
const std::vector< uint32_t > header() const
Get the header words.
void setErrorStatus(const uint32_t word)
Set the error status word.
void setL1AcceptBunchPosition(const uint32_t pos)
Set the L1Accept bunch position.
uint32_t sourceID() const
Retrieve the sub-detector source ID.
uint32_t l1AcceptBunchPosition() const
Get the L1 accept bunch position.
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(BTagging_v1, float, IP2D_pb, setIP2D_pb) AUXSTORE_PRIMITIVE_SETTER_AND_GETTER(BTagging_v1
static const SG::AuxElement::Accessor< ElementLink< IParticleContainer > > acc("originalObjectLink")
Object used for setting/getting the dynamic decoration in question.
setEventNumber setTimeStamp bcid
setEventNumber uint32_t
This is the trigger result for each item before prescale, after prescale and after veto for a single ...
std::vector< uint32_t > tapWords
std::vector< uint32_t > tbpWords
std::vector< uint32_t > tavWords
std::vector< uint32_t > tipWords