ATLAS Offline Software
Loading...
Searching...
No Matches
L1CorrelationAlg Class Reference

#include <L1CorrelationAlg.h>

Inheritance diagram for L1CorrelationAlg:
Collaboration diagram for L1CorrelationAlg:

Public Member Functions

 L1CorrelationAlg (const std::string &name, ISvcLocator *pSvcLocator)
virtual StatusCode initialize () override
virtual StatusCode execute (const EventContext &ctx) const override
virtual StatusCode start () override
virtual StatusCode sysInitialize () override
 Override sysInitialize.
virtual bool isClonable () const override
 Specify if the algorithm is clonable.
virtual StatusCode sysExecute (const EventContext &ctx) override
 Execute an algorithm.
virtual const DataObjIDColl & extraOutputDeps () const override
 Return the list of extra output dependencies.
virtual bool filterPassed (const EventContext &ctx) const
 Get filter decision:
virtual void setFilterPassed (bool state, const EventContext &ctx) const
 Set filter decision:
ServiceHandle< StoreGateSvc > & evtStore ()
 The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
const ServiceHandle< StoreGateSvc > & detStore () const
 The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc.
virtual StatusCode sysStart () override
 Handle START transition.
virtual std::vector< Gaudi::DataHandle * > inputHandles () const override
 Return this algorithm's input handles.
virtual std::vector< Gaudi::DataHandle * > outputHandles () const override
 Return this algorithm's output handles.
Gaudi::Details::PropertyBase & declareProperty (Gaudi::Property< T, V, H > &t)
void updateVHKA (Gaudi::Details::PropertyBase &)
MsgStream & msg () const
bool msgLvl (const MSG::Level lvl) const

Protected Member Functions

void renounceArray (SG::VarHandleKeyArray &handlesArray)
 remove all handles from I/O resolution
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.

Private Types

typedef ServiceHandle< StoreGateSvcStoreGateSvc_t

Private Member Functions

Gaudi::Details::PropertyBase & declareGaudiProperty (Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
 specialization for handling Gaudi::Property<SG::VarHandleKey>

Private Attributes

ServiceHandle< IROBDataProviderSvcm_robDataProviderSvc {this, "ROBDataProviderSvc", "ROBDataProviderSvc", "Name of the ROB data provider"}
SG::WriteHandleKey< xAOD::TrigCompositeContainerm_trigCompositeKey {this, "TrigCompositeWriteHandleKey", "L1CorrelationTrigComposite", "Name of TrigComposite write handle"}
SG::WriteDecorHandleKey< xAOD::TrigCompositeContainerm_l1AKey {this, "l1AKey", "L1CorrelationTrigComposite.l1a_type", "L1 accept type"}
SG::WriteDecorHandleKey< xAOD::TrigCompositeContainerm_otherTypeKey {this, "otherTypeKey", "L1CorrelationTrigComposite.other_type", "Other type"}
SG::WriteDecorHandleKey< xAOD::TrigCompositeContainerm_beforeAfterKey {this, "beforeAfterKey", "L1CorrelationTrigComposite.beforeafterflag", "flag if BC is before or after nominal"}
SG::WriteDecorHandleKey< xAOD::TrigCompositeContainerm_otherTypeBeforeKey {this, "otherTypeBeforeKey", "L1CorrelationTrigComposite.other_type_before", "Trigger type (1-7) of the first fired BC before the central L1A BCID"}
SG::WriteDecorHandleKey< xAOD::TrigCompositeContainerm_otherTypeAfterKey {this, "otherTypeAfterKey", "L1CorrelationTrigComposite.other_type_after", "Trigger type (1-7) of the first fired BC after the central L1A BCID"}
SG::WriteDecorHandleKey< xAOD::TrigCompositeContainerm_beforeOffsetKey {this, "beforeOffsetKey", "L1CorrelationTrigComposite.offset_before", "Distance (in BCs) from the L1A to the first earlier neighbor trigger"}
SG::WriteDecorHandleKey< xAOD::TrigCompositeContainerm_afterOffsetKey {this, "afterOffsetKey", "L1CorrelationTrigComposite.offset_after", "Distance (in BCs) from the L1A to the first later neighbor trigger"}
SG::WriteDecorHandleKey< xAOD::TrigCompositeContainerm_passKey {this, "trigCompPassKey", "L1CorrelationTrigComposite.pass", "Key to indicate TrigComp is passed"}
SG::ReadHandleKey< TrigConf::L1Menum_l1MenuKey {this, "L1MenuKey", "DetectorStore+L1TriggerMenu", "L1 Menu"}
ToolHandle< GenericMonitoringToolm_monTool {this, "MonTool", "", "Monitoring tool"}
Gaudi::Property< bool > m_currentBCincl {this, "currentBCinclusive", true}
Gaudi::Property< std::vector< std::string > > m_l1itemlist {this, "ItemList", {"L1_EM22VHI", "L1_J400", "L1_MU14FCH"}, "list of l1 items to be used"}
std::vector< uint32_t > m_bitmasks
std::vector< uint32_t > m_bitmasks_ele
std::vector< uint32_t > m_bitmasks_mu
std::vector< uint32_t > m_bitmasks_jets
DataObjIDColl m_extendedExtraObjects
 Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.
StoreGateSvc_t m_evtStore
 Pointer to StoreGate (event store by default).
StoreGateSvc_t m_detStore
 Pointer to StoreGate (detector store by default).
std::vector< SG::VarHandleKeyArray * > m_vhka
bool m_varHandleArraysDeclared

Detailed Description

Definition at line 15 of file L1CorrelationAlg.h.

Member Typedef Documentation

◆ StoreGateSvc_t

typedef ServiceHandle<StoreGateSvc> AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::StoreGateSvc_t
privateinherited

Definition at line 388 of file AthCommonDataStore.h.

Constructor & Destructor Documentation

◆ L1CorrelationAlg()

L1CorrelationAlg::L1CorrelationAlg ( const std::string & name,
ISvcLocator * pSvcLocator )

Definition at line 13 of file L1CorrelationAlg.cxx.

13: AthReentrantAlgorithm(name, pSvcLocator) {}

Member Function Documentation

◆ declareGaudiProperty()

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

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

Definition at line 156 of file AthCommonDataStore.h.

158 {
160 hndl.value(),
161 hndl.documentation());
162
163 }
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T, V, H > &t)

◆ declareProperty()

Gaudi::Details::PropertyBase & AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::declareProperty ( Gaudi::Property< T, V, H > & t)
inlineinherited

Definition at line 145 of file AthCommonDataStore.h.

145 {
146 typedef typename SG::HandleClassifier<T>::type htype;
148 }
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T, V, H > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>

◆ detStore()

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

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

Definition at line 95 of file AthCommonDataStore.h.

◆ evtStore()

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

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

Definition at line 85 of file AthCommonDataStore.h.

◆ execute()

StatusCode L1CorrelationAlg::execute ( const EventContext & ctx) const
overridevirtual

Definition at line 139 of file L1CorrelationAlg.cxx.

139 {
140
141 //TrigComposite Container to record
142 SG::WriteHandle<xAOD::TrigCompositeContainer> wh_trigComposite(m_trigCompositeKey, ctx);
143 ATH_CHECK(wh_trigComposite.record(std::make_unique<xAOD::TrigCompositeContainer>(), std::make_unique<xAOD::TrigCompositeAuxContainer>()));
144 auto trigCompCont = wh_trigComposite.ptr();
145
146 SG::WriteDecorHandle<xAOD::TrigCompositeContainer, int> trigCompL1A(m_l1AKey, ctx);
147 SG::WriteDecorHandle<xAOD::TrigCompositeContainer, int> trigCompOther(m_otherTypeKey, ctx);
148 SG::WriteDecorHandle<xAOD::TrigCompositeContainer, int> trigCompBeforeAfter(m_beforeAfterKey, ctx);
149 SG::WriteDecorHandle<xAOD::TrigCompositeContainer, int> trigCompPass(m_passKey, ctx);
150 SG::WriteDecorHandle<xAOD::TrigCompositeContainer, int> trigCompOtherBefore(m_otherTypeBeforeKey, ctx);
151 SG::WriteDecorHandle<xAOD::TrigCompositeContainer, int> trigCompOtherAfter(m_otherTypeAfterKey, ctx);
152 SG::WriteDecorHandle<xAOD::TrigCompositeContainer, int> trigCompBeforeOffset(m_beforeOffsetKey, ctx);
153 SG::WriteDecorHandle<xAOD::TrigCompositeContainer, int> trigCompAfterOffset(m_afterOffsetKey, ctx);
154
155 //CTP ROB
156 std::vector<const OFFLINE_FRAGMENTS_NAMESPACE::ROBFragment*> robFragments;
157 std::vector<uint32_t> roblist;
158 // magic number!
159 roblist.push_back(0x770000);
160 m_robDataProviderSvc->getROBData(ctx, roblist, robFragments);
161 if (msgLvl(MSG::DEBUG)) {
162 std::ostringstream os;
163 for(auto rob : roblist){
164 os << std::hex<<rob;
165 }
166 ATH_MSG_DEBUG(roblist.size() << "/" << robFragments.size()
167 << " ROBs requested/retrieved:" << os.str());
168 }
169 if (robFragments.size()<1){
170 ATH_MSG_DEBUG("Could not retrieve ROB!");
171 return StatusCode::SUCCESS;
172 }
173 const eformat::ROBFragment<const uint32_t*>* rbf = robFragments[0];
174
175 // L1A index within the CTP readout window (not a BCID).
176 // For a symmetric window nBC = 2*k + 1, L1A sits at index k:
177 // e.g. ±1 → nBC=3 → l1a_idx=1; ±2 → nBC=5 → l1a_idx=2.
178 const int l1a_idx = static_cast<int>(CTPfragment::lvl1AcceptBunch(rbf)); // index in readout window
179
180 const int nBC = 2 * l1a_idx + 1; // symmetric by requirement
181 const int mid = l1a_idx; // central element
182
183 // Cache TBP/TAP once per BC
184 std::vector<std::vector<uint32_t>> tbpWords(nBC), tapWords(nBC);
185 for (int i = 0; i < nBC; ++i) {
186 const unsigned k = static_cast<unsigned>(i);
187 tbpWords[i] = CTPfragment::triggerDecisionBeforePrescales(rbf, k);
188 tapWords[i] = CTPfragment::triggerDecisionAfterPrescales (rbf, k);
189 }
190
191 // Helper: any-bit-on under mask
192 auto firedFromWords = [&](const std::vector<uint32_t>& w,
193 const std::vector<uint32_t>& mask) -> uint8_t {
194 const std::size_t nw = std::min(w.size(), mask.size()); // (16 by design)
195 uint8_t on = 0;
196 for (std::size_t iw = 0; iw < nw; ++iw) on |= static_cast<uint8_t>((w[iw] & mask[iw]) != 0u);
197 return on;
198 };
199
200 // Per-BC fired flags (TBP)
201 std::vector<uint8_t> firedbc(nBC,0), firedbc_ele(nBC,0), firedbc_mu(nBC,0), firedbc_jet(nBC,0);
202 for (int i = 0; i < nBC; ++i) {
203 firedbc [i] = firedFromWords(tbpWords[i], m_bitmasks);
204 firedbc_ele[i] = firedFromWords(tbpWords[i], m_bitmasks_ele);
205 firedbc_mu [i] = firedFromWords(tbpWords[i], m_bitmasks_mu );
206 firedbc_jet[i] = firedFromWords(tbpWords[i], m_bitmasks_jets);
207 }
208
209 // Central-BC inclusion flag
210 if (m_currentBCincl) {
211 firedbc[mid] = firedbc_ele[mid] = firedbc_mu[mid] = firedbc_jet[mid] = 1;
212 }
213
214 // Occupancy maps (delta BC, CTPID) for TBP/TAP
215 auto collect_ids_from_words = [this](const std::vector<uint32_t>& words) {
216 std::vector<int> ids;
217 const std::size_t nw = std::min(words.size(), this->m_bitmasks.size()); // typically 16
218 ids.reserve(32u * nw);
219 for (std::size_t iw = 0; iw < nw; ++iw) {
220 uint32_t w = words[iw];
221 if (!w) continue;
222 const unsigned base = static_cast<unsigned>(iw * 32u);
223 for (unsigned b = 0; b < 32; ++b) if (w & (1u << b)) ids.emplace_back(static_cast<int>(base + b));
224 }
225 return ids;
226 };
227
228 std::vector<int> vDeltaBC_all_TBP, vCtpId_all_TBP, vDeltaBC_all_TAP, vCtpId_all_TAP;
229 vDeltaBC_all_TBP.reserve(64); vCtpId_all_TBP.reserve(64);
230 vDeltaBC_all_TAP.reserve(64); vCtpId_all_TAP.reserve(64);
231
232 for (int i = 0; i < nBC; ++i) {
233 const int delta = i - mid;
234 {
235 const auto ids = collect_ids_from_words(tbpWords[i]);
236 vDeltaBC_all_TBP.insert(vDeltaBC_all_TBP.end(), ids.size(), delta);
237 vCtpId_all_TBP.insert (vCtpId_all_TBP.end(), ids.begin(), ids.end());
238 }
239 {
240 const auto ids = collect_ids_from_words(tapWords[i]);
241 vDeltaBC_all_TAP.insert(vDeltaBC_all_TAP.end(), ids.size(), delta);
242 vCtpId_all_TAP.insert (vCtpId_all_TAP.end(), ids.begin(), ids.end());
243 }
244 }
245
246 // Pass–fail decision: nearest neighbour on each side
247 int isPassed = 0;
248 int beforeafterflag = 0; // sign: side; abs: offset
249 int offset_before = 0, offset_after = 0;
250 for (int d = 1; d <= l1a_idx; ++d) {
251 if (firedbc[mid] && firedbc[mid - d] && offset_before == 0) { offset_before = d; isPassed = 1; }
252 if (firedbc[mid] && firedbc[mid + d] && offset_after == 0) { offset_after = d; isPassed = 1; }
253 if (offset_before && offset_after) break;
254 }
255
256 // Classification (legacy 1..7)
257 auto classify = [&](int idx)->int {
258 if (firedbc_ele[idx] && !firedbc_mu[idx] && !firedbc_jet[idx]) return 1;
259 else if (firedbc_mu [idx] && !firedbc_ele[idx] && !firedbc_jet[idx]) return 2;
260 else if (firedbc_jet[idx] && !firedbc_ele[idx] && !firedbc_mu[idx]) return 3;
261 else if (firedbc_ele[idx] && firedbc_mu[idx] && !firedbc_jet[idx]) return 4;
262 else if (firedbc_ele[idx] && firedbc_jet[idx] && !firedbc_mu[idx]) return 5;
263 else if (firedbc_mu [idx] && firedbc_jet[idx] && !firedbc_ele[idx]) return 6;
264 else if (firedbc_ele[idx] && firedbc_mu[idx] && firedbc_jet[idx]) return 7;
265 return 0;
266 };
267
268 int l1a_type = classify(mid);
269 int other_type_before = (offset_before > 0) ? classify(mid - offset_before) : 0;
270 int other_type_after = (offset_after > 0) ? classify(mid + offset_after ) : 0;
271
272 // Choose operative side
273 if (offset_before > 0 && offset_after > 0) {
274 if (offset_before < offset_after) beforeafterflag = -offset_before;
275 else if (offset_after < offset_before) beforeafterflag = +offset_after;
276 else beforeafterflag = +offset_after; // tie → positive side
277 } else if (offset_before > 0) {
278 beforeafterflag = -offset_before;
279 } else if (offset_after > 0) {
280 beforeafterflag = +offset_after;
281 }
282
283 int other_type = 0;
284 if (beforeafterflag < 0) other_type = other_type_before;
285 else if (beforeafterflag > 0) other_type = other_type_after;
286
287 // Create TrigComposite only if passed
288 if (isPassed) {
289 auto trigComp = new xAOD::TrigComposite();
290 trigCompCont->push_back(trigComp);
291 trigComp->setName("mistimemon_L1Dec");
292
293 trigCompL1A (*trigComp) = l1a_type;
294 trigCompOther (*trigComp) = other_type;
295 trigCompBeforeAfter (*trigComp) = beforeafterflag;
296 trigCompPass (*trigComp) = isPassed;
297 trigCompOtherBefore (*trigComp) = other_type_before;
298 trigCompOtherAfter (*trigComp) = other_type_after;
299 trigCompBeforeOffset(*trigComp) = offset_before;
300 trigCompAfterOffset (*trigComp) = offset_after;
301 }
302
303 // Monitoring: global summary + side-specific
304 auto mon_l1a = Monitored::Scalar<int>("l1Accept", l1a_type);
305 auto mon_otherType = Monitored::Scalar<int>("otherType", other_type);
306 auto mon_beforeAfter = Monitored::Scalar<int>("BeforeAfterFlag", beforeafterflag);
307 auto monitorIt = Monitored::Group(m_monTool, mon_l1a, mon_otherType, mon_beforeAfter);
308
309 if (offset_before > 0 && offset_after > 0) {
310 auto mon_offsetBefore = Monitored::Scalar<int>("BeforeOffset", offset_before);
311 auto mon_offsetAfter = Monitored::Scalar<int>("AfterOffset", offset_after);
312 auto mon_otherBefore = Monitored::Scalar<int>("OtherTypeBefore", other_type_before);
313 auto mon_otherAfter = Monitored::Scalar<int>("OtherTypeAfter", other_type_after);
314 auto gBoth = Monitored::Group(m_monTool, mon_offsetBefore, mon_offsetAfter, mon_otherBefore, mon_otherAfter);
315 (void)gBoth;
316 } else if (offset_before > 0) {
317 auto mon_offsetBefore = Monitored::Scalar<int>("BeforeOffset", offset_before);
318 auto mon_otherBefore = Monitored::Scalar<int>("OtherTypeBefore", other_type_before);
319 auto gB = Monitored::Group(m_monTool, mon_offsetBefore, mon_otherBefore);
320 (void)gB;
321 } else if (offset_after > 0) {
322 auto mon_offsetAfter = Monitored::Scalar<int>("AfterOffset", offset_after);
323 auto mon_otherAfter = Monitored::Scalar<int>("OtherTypeAfter", other_type_after);
324 auto gA = Monitored::Group(m_monTool, mon_offsetAfter, mon_otherAfter);
325 (void)gA;
326 }
327
328 // Full occupancy maps (TBP/TAP)
329 auto mon_dbc_all_tbp = Monitored::Collection("DeltaBCAll", vDeltaBC_all_TBP);
330 auto mon_id_all_tbp = Monitored::Collection("CTPIDAll", vCtpId_all_TBP);
331 auto mon_dbc_all_tap = Monitored::Collection("DeltaBCAll_TAP", vDeltaBC_all_TAP);
332 auto mon_id_all_tap = Monitored::Collection("CTPIDAll_TAP", vCtpId_all_TAP);
333 auto gMaps = Monitored::Group(m_monTool, mon_dbc_all_tbp, mon_id_all_tbp,
334 mon_dbc_all_tap, mon_id_all_tap);
335 (void)gMaps;
336
337 // Pair maps at abs(delta) = 1,2,3... (using cached words)
338 const auto ids0_tbp = collect_ids_from_words(tbpWords[mid]);
339 const auto ids0_tap = collect_ids_from_words(tapWords[mid]);
340
341 auto fill_pair_map = [&](int deltaSel, bool useTAP,
342 const char* varX, const char* varY) {
343 const int kN = mid + deltaSel;
344 if (kN < 0 || kN >= nBC) return;
345
346 const auto &idsN = useTAP ? collect_ids_from_words(tapWords[kN])
347 : collect_ids_from_words(tbpWords[kN]);
348 const auto& ids0 = useTAP ? ids0_tap : ids0_tbp;
349
350 if (ids0.empty() || idsN.empty()) return;
351
352 std::vector<int> vId0; vId0.reserve(ids0.size() * idsN.size());
353 std::vector<int> vIdN; vIdN.reserve(vId0.capacity());
354 for (int id0 : ids0) for (int idN : idsN) { vId0.emplace_back(id0); vIdN.emplace_back(idN); }
355
356 auto mon_x = Monitored::Collection(varX, vId0);
357 auto mon_y = Monitored::Collection(varY, vIdN);
358 auto g = Monitored::Group(m_monTool, mon_x, mon_y);
359 (void)g;
360 };
361
362 // TBP: delta = +2, −2, +1, −1
363 fill_pair_map(+2, false, "CTPID0tbp_p2", "CTPIDtbp_p2");
364 fill_pair_map(-2, false, "CTPID0tbp_m2", "CTPIDtbp_m2");
365 fill_pair_map(+1, false, "CTPID0tbp_p1", "CTPIDtbp_p1");
366 fill_pair_map(-1, false, "CTPID0tbp_m1", "CTPIDtbp_m1");
367
368 // TAP: delta = +2, −2, +1, −1
369 fill_pair_map(+2, true , "CTPID0tap_p2", "CTPIDtap_p2");
370 fill_pair_map(-2, true , "CTPID0tap_m2", "CTPIDtap_m2");
371 fill_pair_map(+1, true , "CTPID0tap_p1", "CTPIDtap_p1");
372 fill_pair_map(-1, true , "CTPID0tap_m1", "CTPIDtap_m1");
373
374 return StatusCode::SUCCESS;
375}
#define ATH_CHECK
Evaluate an expression and check for errors.
#define ATH_MSG_DEBUG(x)
bool msgLvl(const MSG::Level lvl) const
SG::WriteDecorHandleKey< xAOD::TrigCompositeContainer > m_otherTypeBeforeKey
SG::WriteDecorHandleKey< xAOD::TrigCompositeContainer > m_otherTypeKey
SG::WriteDecorHandleKey< xAOD::TrigCompositeContainer > m_beforeOffsetKey
SG::WriteHandleKey< xAOD::TrigCompositeContainer > m_trigCompositeKey
std::vector< uint32_t > m_bitmasks
Gaudi::Property< bool > m_currentBCincl
std::vector< uint32_t > m_bitmasks_ele
SG::WriteDecorHandleKey< xAOD::TrigCompositeContainer > m_otherTypeAfterKey
SG::WriteDecorHandleKey< xAOD::TrigCompositeContainer > m_afterOffsetKey
std::vector< uint32_t > m_bitmasks_jets
ToolHandle< GenericMonitoringTool > m_monTool
ServiceHandle< IROBDataProviderSvc > m_robDataProviderSvc
std::vector< uint32_t > m_bitmasks_mu
SG::WriteDecorHandleKey< xAOD::TrigCompositeContainer > m_l1AKey
SG::WriteDecorHandleKey< xAOD::TrigCompositeContainer > m_beforeAfterKey
SG::WriteDecorHandleKey< xAOD::TrigCompositeContainer > m_passKey
std::string base
Definition hcg.cxx:83
void classify(ToolHandle< IMCTruthClassifier > &m_classif, const xAOD::TruthParticle *theParticle, unsigned int &particleOutCome, unsigned int &result, int &hadron_pdg, unsigned int &particleType, unsigned int &particleOrigin)
Definition Common.cxx:75
for(size_t i=0;i< m_blockFillers.size();i++)
Fill one block.
ValuesCollection< T > Collection(std::string name, const T &collection)
Declare a monitored (double-convertible) collection.
TrigComposite_v1 TrigComposite
Declare the latest version of the class.
setEventNumber uint32_t

◆ extraDeps_update_handler()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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

◆ extraOutputDeps()

const DataObjIDColl & AthCommonAlgorithm< Gaudi::Algorithm >::extraOutputDeps ( ) const
overridevirtualinherited

Return the list of extra output dependencies.

This list is extended to include symlinks implied by inheritance relations.

Definition at line 89 of file AthCommonAlgorithm.cxx.

54{
55 // If we didn't find any symlinks to add, just return the collection
56 // from the base class. Otherwise, return the extended collection.
57 if (!m_extendedExtraObjects.empty()) {
59 }
61}
Common base class for algorithms.

◆ filterPassed()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::filterPassed ( const EventContext & ctx) const
inlinevirtualinherited

Get filter decision:

Definition at line 93 of file AthCommonAlgorithm.h.

93 {
94 return execState( ctx ).filterPassed();
95 }
virtual bool filterPassed(const EventContext &ctx) const
Get filter decision:

◆ initialize()

StatusCode L1CorrelationAlg::initialize ( )
overridevirtual

Definition at line 15 of file L1CorrelationAlg.cxx.

15 {
16
18 ATH_CHECK(m_trigCompositeKey.initialize());
19 ATH_CHECK(m_l1MenuKey.initialize());
20 ATH_CHECK(m_passKey.initialize());
21 ATH_CHECK(m_l1AKey.initialize());
22 ATH_CHECK(m_otherTypeKey.initialize());
23 ATH_CHECK(m_beforeAfterKey.initialize());
24 ATH_CHECK(m_otherTypeBeforeKey.initialize());
25 ATH_CHECK(m_otherTypeAfterKey.initialize());
26 ATH_CHECK(m_beforeOffsetKey.initialize());
27 ATH_CHECK(m_afterOffsetKey.initialize());
28 ATH_CHECK(m_monTool.retrieve());
29
30 return StatusCode::SUCCESS;
31}
SG::ReadHandleKey< TrigConf::L1Menu > m_l1MenuKey

◆ inputHandles()

virtual std::vector< Gaudi::DataHandle * > AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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.

◆ isClonable()

virtual bool AthCommonAlgorithm< Gaudi::Algorithm >::isClonable ( ) const
inlineoverridevirtualinherited

Specify if the algorithm is clonable.

Only relevant for non-reentrant algorithms. Actual number of clones needs to be set via the "Cardinality" property.

Reimplemented in AFP_DigiTop, AlgB, AlgT, BCM_Digitization, CscDigitBuilder, CscDigitToCscRDO, G4AtlasAlg, G4RunAlg, HGTD_Digitization, HiveAlgBase, InDet::GNNSeedingTrackMaker, InDet::SCT_Clusterization, InDet::SiSPGNNTrackMaker, InDet::SiSPSeededTrackFinder, InDet::SiTrackerSpacePointFinder, ISF::SimKernelMT, ITk::StripDigitization, ITkPixelCablingAlg, ITkStripCablingAlg, LArHitEMapMaker, LArTTL1Maker, LUCID_DigiTop, LVL1::L1TopoSimulation, MergeCalibHits, MergeGenericMuonSimHitColl, MergeHijingPars, MergeMcEventCollection, MergeTrackRecordCollection, MergeTruthJets, MergeTruthParticles, MuonDigitizer, PileUpMTAlg, PixelDigitization, RoIBResultToxAOD, SCT_ByteStreamErrorsTestAlg, SCT_CablingCondAlgFromCoraCool, SCT_CablingCondAlgFromText, SCT_ConditionsParameterTestAlg, SCT_ConditionsSummaryTestAlg, SCT_ConfigurationConditionsTestAlg, SCT_Digitization, SCT_FlaggedConditionTestAlg, SCT_LinkMaskingTestAlg, SCT_MajorityConditionsTestAlg, SCT_ModuleVetoTestAlg, SCT_MonitorConditionsTestAlg, SCT_PrepDataToxAOD, SCT_RawDataToxAOD, SCT_ReadCalibChipDataTestAlg, SCT_ReadCalibDataTestAlg, SCT_RODVetoTestAlg, SCT_SensorsTestAlg, SCT_SiliconConditionsTestAlg, SCT_StripVetoTestAlg, SCT_TdaqEnabledTestAlg, SCT_TestCablingAlg, SCTEventFlagWriter, SCTRawDataProvider, SCTSiLorentzAngleTestAlg, SCTSiPropertiesTestAlg, SGInputLoader, Simulation::BeamEffectsAlg, TileHitVecToCnt, TileMuonFitter, TilePulseForTileMuonReceiver, TileRawChannelMaker, TRTDigitization, and ZDC_DigiTop.

Definition at line 68 of file AthCommonAlgorithm.h.

68 {
69 return true;
70 }

◆ msg()

MsgStream & AthCommonMsg< Gaudi::Algorithm >::msg ( ) const
inlineinherited

Definition at line 24 of file AthCommonMsg.h.

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

◆ msgLvl()

bool AthCommonMsg< Gaudi::Algorithm >::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< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::renounce ( T & h)
inlineprotectedinherited

Definition at line 380 of file AthCommonDataStore.h.

381 {
382 h.renounce();
384 }
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)

◆ renounceArray()

void AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::renounceArray ( SG::VarHandleKeyArray & handlesArray)
inlineprotectedinherited

remove all handles from I/O resolution

Definition at line 364 of file AthCommonDataStore.h.

364 {
366 }

◆ setFilterPassed()

virtual void AthCommonAlgorithm< Gaudi::Algorithm >::setFilterPassed ( bool state,
const EventContext & ctx ) const
inlinevirtualinherited

Set filter decision:

Reimplemented in AthFilterAlgorithm.

Definition at line 99 of file AthCommonAlgorithm.h.

99 {
101 }
virtual void setFilterPassed(bool state, const EventContext &ctx) const
Set filter decision:

◆ start()

StatusCode L1CorrelationAlg::start ( )
overridevirtual

Definition at line 33 of file L1CorrelationAlg.cxx.

33 {
34
35 //get L1 menu and initialise bitMasks based on l1 em/j/mu triggers
36 SG::ReadHandle<TrigConf::L1Menu> rh_l1Menu = SG::makeHandle(m_l1MenuKey);
37 ATH_CHECK(rh_l1Menu.isValid());
38
39 std::vector<int> ctpids_ele;
40 std::vector<int> ctpids_mu;
41 std::vector<int> ctpids_jets;
42 std::vector<int> ctpids;
43
44 for(const TrigConf::L1Item& item : *rh_l1Menu){
45 for(unsigned int nl1=0; nl1<m_l1itemlist.size(); nl1++){
46 if(m_l1itemlist[nl1].compare(item.name()) == 0 ){
47 ATH_MSG_DEBUG("L1CorrAlgInit: Configured to use item:" <<item.name().c_str()<< " CTPID:"<<item.ctpId());
48 ctpids.push_back( item.ctpId() );
49 if( m_l1itemlist[nl1].find( "L1_EM" ) != std::string::npos ){
50 ctpids_ele.push_back( item.ctpId() );
51 }
52 if( m_l1itemlist[nl1].find( "L1_MU" ) != std::string::npos ){
53 ctpids_mu.push_back( item.ctpId() );
54 }
55 if(( m_l1itemlist[nl1].find( "L1_J") != std::string::npos ) || ( m_l1itemlist[nl1].find( "L1_jJ" ) != std::string::npos)){
56 ctpids_jets.push_back( item.ctpId() );
57 }
58 }
59 }
60 }
61
62 // init with 0
63 m_bitmasks.clear();
64 m_bitmasks_ele.clear();
65 m_bitmasks_mu.clear();
66 m_bitmasks_jets.clear();
67 for(int n=0; n<16 ; n++){
68 uint32_t tmpword=0;
69 m_bitmasks.push_back(tmpword);
70 m_bitmasks_ele.push_back(tmpword);
71 m_bitmasks_mu.push_back(tmpword);
72 m_bitmasks_jets.push_back(tmpword);
73 }
74
75 //all ctpids
76 for(unsigned int n=0; n<ctpids.size() ; n++){
77 // check in which word it belongs
78 int cycle = ctpids[n] / 32;
79 int pos = ctpids[n] % 32;
80
81 uint32_t currentmask = m_bitmasks[cycle];
82 uint32_t tmpmask = 1;
83 // shift this pos positions to left
84 tmpmask = tmpmask << (pos);
85
86 // OR this with the existing mask
87 m_bitmasks[cycle] = tmpmask | currentmask;
88 }
89
90 //electrons
91 for(unsigned int n=0; n<ctpids_ele.size() ; n++){
92 // check in which word it belongs
93 int cycle = ctpids_ele[n] / 32;
94 int pos = ctpids_ele[n] % 32;
95
96 uint32_t currentmask = m_bitmasks_ele[cycle];
97 uint32_t tmpmask = 1;
98 // shift this pos positions to left
99 tmpmask = tmpmask << (pos);
100
101 // OR this with the existing mask
102 m_bitmasks_ele[cycle] = tmpmask | currentmask;
103 }
104
105 //muons
106 for(unsigned int n=0; n<ctpids_mu.size() ; n++){
107 // check in which word it belongs
108 int cycle = ctpids_mu[n] / 32;
109 int pos = ctpids_mu[n] % 32;
110
111 uint32_t currentmask = m_bitmasks_mu[cycle];
112 uint32_t tmpmask = 1;
113 // shift this pos positions to left
114 tmpmask = tmpmask << (pos);
115
116 // OR this with the existing mask
117 m_bitmasks_mu[cycle] = tmpmask | currentmask;
118 }
119
120 //jets
121 for(unsigned int n=0; n<ctpids_jets.size() ; n++){
122 // check in which word it belongs
123 int cycle = ctpids_jets[n] / 32;
124 int pos = ctpids_jets[n] % 32;
125
126 uint32_t currentmask = m_bitmasks_jets[cycle];
127 uint32_t tmpmask = 1;
128 // shift this pos positions to left
129 tmpmask = tmpmask << (pos);
130
131 // OR this with the existing mask
132 m_bitmasks_jets[cycle] = tmpmask | currentmask;
133 }
134
135 return StatusCode::SUCCESS;
136}
double cycle(double a, double b)
Gaudi::Property< std::vector< std::string > > m_l1itemlist
virtual bool isValid() override final
Can the handle be successfully dereferenced?
std::string find(const std::string &s)
return a remapped string
Definition hcg.cxx:140
std::pair< int, int > compare(const AmgSymMatrix(N) &m1, const AmgSymMatrix(N) &m2, double precision=1e-9, bool relative=false)
compare two matrices, returns the indices of the first element that fails the condition,...
SG::ReadCondHandle< T > makeHandle(const SG::ReadCondHandleKey< T > &key, const EventContext &ctx=Gaudi::Hive::currentContext())

◆ sysExecute()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysExecute ( const EventContext & ctx)
overridevirtualinherited

Execute an algorithm.

We override this in order to work around an issue with the Algorithm base class storing the event context in a member variable that can cause crashes in MT jobs.

Reimplemented in AthAnalysisAlgorithm.

Definition at line 80 of file AthCommonAlgorithm.cxx.

41{
42 return BaseAlg::sysExecute (ctx);
43}

◆ sysInitialize()

StatusCode AthCommonAlgorithm< Gaudi::Algorithm >::sysInitialize ( )
overridevirtualinherited

Override sysInitialize.

Override sysInitialize from the base class.

Loop through all output handles, and if they're WriteCondHandles, automatically register them and this Algorithm with the CondSvc

Scan through all outputHandles, and if they're WriteCondHandles, register them with the CondSvc

Reimplemented from AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >.

Reimplemented in AthAnalysisAlgorithm, AthFilterAlgorithm, AthHistogramAlgorithm, HypoBase, InputMakerBase, and PyAthena::Alg.

Definition at line 60 of file AthCommonAlgorithm.cxx.

71 {
73
74 if (sc.isFailure()) {
75 return sc;
76 }
77
78 ServiceHandle<ICondSvc> cs("CondSvc",name());
79 for (auto h : outputHandles()) {
80 if (h->isCondition() && h->mode() == Gaudi::DataHandle::Writer) {
81 // do this inside the loop so we don't create the CondSvc until needed
82 if ( cs.retrieve().isFailure() ) {
83 ATH_MSG_WARNING("no CondSvc found: won't autoreg WriteCondHandles");
85 }
86 if (cs->regHandle(this,*h).isFailure()) {
88 ATH_MSG_ERROR("unable to register WriteCondHandle " << h->fullKey()
89 << " with CondSvc");
90 }
91 }
92 }
93 return sc;
94}
#define ATH_MSG_ERROR(x)
#define ATH_MSG_WARNING(x)
virtual StatusCode sysInitialize() override
virtual std::vector< Gaudi::DataHandle * > outputHandles() const override

◆ sysStart()

virtual StatusCode AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::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< Gaudi::Algorithm > >::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) {
313 for (auto k : keys) {
314 k->setOwner(this);
315 }
316 }
317 }

Member Data Documentation

◆ m_afterOffsetKey

SG::WriteDecorHandleKey<xAOD::TrigCompositeContainer> L1CorrelationAlg::m_afterOffsetKey {this, "afterOffsetKey", "L1CorrelationTrigComposite.offset_after", "Distance (in BCs) from the L1A to the first later neighbor trigger"}
private

Definition at line 32 of file L1CorrelationAlg.h.

32{this, "afterOffsetKey", "L1CorrelationTrigComposite.offset_after", "Distance (in BCs) from the L1A to the first later neighbor trigger"};

◆ m_beforeAfterKey

SG::WriteDecorHandleKey<xAOD::TrigCompositeContainer> L1CorrelationAlg::m_beforeAfterKey {this, "beforeAfterKey", "L1CorrelationTrigComposite.beforeafterflag", "flag if BC is before or after nominal"}
private

Definition at line 28 of file L1CorrelationAlg.h.

28{this, "beforeAfterKey", "L1CorrelationTrigComposite.beforeafterflag", "flag if BC is before or after nominal"};

◆ m_beforeOffsetKey

SG::WriteDecorHandleKey<xAOD::TrigCompositeContainer> L1CorrelationAlg::m_beforeOffsetKey {this, "beforeOffsetKey", "L1CorrelationTrigComposite.offset_before", "Distance (in BCs) from the L1A to the first earlier neighbor trigger"}
private

Definition at line 31 of file L1CorrelationAlg.h.

31{this, "beforeOffsetKey", "L1CorrelationTrigComposite.offset_before", "Distance (in BCs) from the L1A to the first earlier neighbor trigger"};

◆ m_bitmasks

std::vector<uint32_t> L1CorrelationAlg::m_bitmasks
private

Definition at line 40 of file L1CorrelationAlg.h.

◆ m_bitmasks_ele

std::vector<uint32_t> L1CorrelationAlg::m_bitmasks_ele
private

Definition at line 41 of file L1CorrelationAlg.h.

◆ m_bitmasks_jets

std::vector<uint32_t> L1CorrelationAlg::m_bitmasks_jets
private

Definition at line 43 of file L1CorrelationAlg.h.

◆ m_bitmasks_mu

std::vector<uint32_t> L1CorrelationAlg::m_bitmasks_mu
private

Definition at line 42 of file L1CorrelationAlg.h.

◆ m_currentBCincl

Gaudi::Property<bool> L1CorrelationAlg::m_currentBCincl {this, "currentBCinclusive", true}
private

Definition at line 36 of file L1CorrelationAlg.h.

36{this, "currentBCinclusive", true};

◆ m_detStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_detStore
privateinherited

Pointer to StoreGate (detector store by default).

Definition at line 393 of file AthCommonDataStore.h.

◆ m_evtStore

StoreGateSvc_t AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_evtStore
privateinherited

Pointer to StoreGate (event store by default).

Definition at line 390 of file AthCommonDataStore.h.

◆ m_extendedExtraObjects

DataObjIDColl AthCommonAlgorithm< Gaudi::Algorithm >::m_extendedExtraObjects
privateinherited

Extra output dependency collection, extended by AthAlgorithmDHUpdate to add symlinks.

Empty if no symlinks were found.

Definition at line 108 of file AthCommonAlgorithm.h.

◆ m_l1AKey

SG::WriteDecorHandleKey<xAOD::TrigCompositeContainer> L1CorrelationAlg::m_l1AKey {this, "l1AKey", "L1CorrelationTrigComposite.l1a_type", "L1 accept type"}
private

Definition at line 26 of file L1CorrelationAlg.h.

26{this, "l1AKey", "L1CorrelationTrigComposite.l1a_type", "L1 accept type"};

◆ m_l1itemlist

Gaudi::Property<std::vector<std::string> > L1CorrelationAlg::m_l1itemlist {this, "ItemList", {"L1_EM22VHI", "L1_J400", "L1_MU14FCH"}, "list of l1 items to be used"}
private

Definition at line 37 of file L1CorrelationAlg.h.

37{this, "ItemList", {"L1_EM22VHI", "L1_J400", "L1_MU14FCH"}, "list of l1 items to be used"};

◆ m_l1MenuKey

SG::ReadHandleKey<TrigConf::L1Menu> L1CorrelationAlg::m_l1MenuKey {this, "L1MenuKey", "DetectorStore+L1TriggerMenu", "L1 Menu"}
private

Definition at line 34 of file L1CorrelationAlg.h.

34{this, "L1MenuKey", "DetectorStore+L1TriggerMenu", "L1 Menu"};

◆ m_monTool

ToolHandle<GenericMonitoringTool> L1CorrelationAlg::m_monTool {this, "MonTool", "", "Monitoring tool"}
private

Definition at line 35 of file L1CorrelationAlg.h.

35{this, "MonTool", "", "Monitoring tool"};

◆ m_otherTypeAfterKey

SG::WriteDecorHandleKey<xAOD::TrigCompositeContainer> L1CorrelationAlg::m_otherTypeAfterKey {this, "otherTypeAfterKey", "L1CorrelationTrigComposite.other_type_after", "Trigger type (1-7) of the first fired BC after the central L1A BCID"}
private

Definition at line 30 of file L1CorrelationAlg.h.

30{this, "otherTypeAfterKey", "L1CorrelationTrigComposite.other_type_after", "Trigger type (1-7) of the first fired BC after the central L1A BCID"};

◆ m_otherTypeBeforeKey

SG::WriteDecorHandleKey<xAOD::TrigCompositeContainer> L1CorrelationAlg::m_otherTypeBeforeKey {this, "otherTypeBeforeKey", "L1CorrelationTrigComposite.other_type_before", "Trigger type (1-7) of the first fired BC before the central L1A BCID"}
private

Definition at line 29 of file L1CorrelationAlg.h.

29{this, "otherTypeBeforeKey", "L1CorrelationTrigComposite.other_type_before", "Trigger type (1-7) of the first fired BC before the central L1A BCID"};

◆ m_otherTypeKey

SG::WriteDecorHandleKey<xAOD::TrigCompositeContainer> L1CorrelationAlg::m_otherTypeKey {this, "otherTypeKey", "L1CorrelationTrigComposite.other_type", "Other type"}
private

Definition at line 27 of file L1CorrelationAlg.h.

27{this, "otherTypeKey", "L1CorrelationTrigComposite.other_type", "Other type"};

◆ m_passKey

SG::WriteDecorHandleKey<xAOD::TrigCompositeContainer> L1CorrelationAlg::m_passKey {this, "trigCompPassKey", "L1CorrelationTrigComposite.pass", "Key to indicate TrigComp is passed"}
private

Definition at line 33 of file L1CorrelationAlg.h.

33{this, "trigCompPassKey", "L1CorrelationTrigComposite.pass", "Key to indicate TrigComp is passed"};

◆ m_robDataProviderSvc

ServiceHandle<IROBDataProviderSvc> L1CorrelationAlg::m_robDataProviderSvc {this, "ROBDataProviderSvc", "ROBDataProviderSvc", "Name of the ROB data provider"}
private

Definition at line 24 of file L1CorrelationAlg.h.

24{this, "ROBDataProviderSvc", "ROBDataProviderSvc", "Name of the ROB data provider"};

◆ m_trigCompositeKey

SG::WriteHandleKey<xAOD::TrigCompositeContainer> L1CorrelationAlg::m_trigCompositeKey {this, "TrigCompositeWriteHandleKey", "L1CorrelationTrigComposite", "Name of TrigComposite write handle"}
private

Definition at line 25 of file L1CorrelationAlg.h.

25{this, "TrigCompositeWriteHandleKey", "L1CorrelationTrigComposite", "Name of TrigComposite write handle"};

◆ m_varHandleArraysDeclared

bool AthCommonDataStore< AthCommonMsg< Gaudi::Algorithm > >::m_varHandleArraysDeclared
privateinherited

Definition at line 399 of file AthCommonDataStore.h.

◆ m_vhka

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

Definition at line 398 of file AthCommonDataStore.h.


The documentation for this class was generated from the following files: