ATLAS Offline Software
Loading...
Searching...
No Matches
VP1TriggerSystem.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5/***********************************************************************************
6 * @Package : VP1TriggerSystems
7 * @Class : VP1TriggerSystem
8 *
9 * @brief : Trigger Data System - access and store trigger data
10 *
11 * @author : Manuel Proissl <mproissl@cern.ch> - University of Edinburgh
12 ***********************************************************************************/
13
14//Local includes
16
17//L1 includes
18
19// check the include of the Chain.h file here below, maybe it's obsolete because it seems it's not used
20#include "TrigSteeringEvent/Chain.h" // NEW include - Requested by Francesca Pastore, 13 Sep 2013
21
28
29//L2 and EF includes
44
45//Other includes
46#include <iostream>
47#include <string>
48#include <vector>
49#include <map>
50#include <stdio.h>
51
52//Trigger System Constructor
53//_____________________________________________________________________________________________
55 : Logger("VP1TriggerSystem"),
56 m_trigDec("Trig::TrigDecisionTool/TrigDecisionTool"),
57 m_trigMatch("TrigMatchTool/TrigMatchTool") {log_verbose("constructor");}
58
59
60//Trigger System Destructor
61//_____________________________________________________________________________________________
63
64
65//Load Trigger Data from StoreGate (once new event loaded)
66//_____________________________________________________________________________________________
67bool VP1Trig::VP1TriggerSystem::loadTriggerHandles(StoreGateSvc* storeGate, const QString& triglvl)
68{
69 log_verbose("loadTriggerHandles()");
70
71 //Safety handle check
72 if(m_handleL1.size()!=0 || m_handleL2.size()!=0 || m_handleEF.size()!=0)
74
75
76 if(triglvl.compare("ALL", Qt::CaseInsensitive)==0 || triglvl.compare("L1", Qt::CaseInsensitive)==0) {
77 //######################################## L1 ############################################### >
78 log_info("Retrieving L1 data via TrigDecisionTool: start");
79
80 //VARs
81 std::string trigID;
82 //int trigcount=0;
83
84 //Try to retrieve the TrigDecisionTool
85 if(m_trigDec.retrieve().isFailure()) {
86 log_fatal("Could not retrieve TrigDecisionTool!");
87 return false; //ref: daqstatus
88 }
89 //Try to retrieve the TrigMatchTool
90 if(m_trigMatch.retrieve().isFailure()) {
91 log_fatal("Could not retrieve TrigMatchTool!");
92 return false; //ref: daqstatus
93 }
94
95 //Loading entire ChainGroup information via TrigDecisionTool
96 const Trig::ChainGroup* allChains = m_trigDec->getChainGroup(".*"); //all triggers
97 if(!allChains) {
98 log_fatal("ChainGroup could not be loaded!");
99 return false; //ref: daqstatus
100 }
101
102 //Retrieve list of valid triggers associated with ChainGroup
103 std::vector<std::string> trigList = allChains->getListOfTriggers();
104 std::vector<std::string>::iterator trigItr; //Iterator over trigList
105
106 //Loop over list of triggers
107 for(trigItr=trigList.begin(); trigItr!=trigList.end(); ++trigItr) {
108
109 //Safety Check: item not empty!
110 if((*trigItr).empty()) continue;
111
112 //Process passed triggers
113 if(m_trigDec->isPassed((*trigItr))) {
114 //++trigcount;
115 trigID = std::string((*trigItr).c_str());
116 //std::cout << "INFO :: Processing trigger chain: " << trigger << "[" << trigcount << "] ";
117
118 using namespace Trig;
119 Trig::FeatureContainer f = m_trigDec->features(trigID); //get trigger and its objects
120 //std::cout << "fsize: " << f.getCombinations().size() << std::endl;
121
122 //Export to L1 handle
123 VP1TriggerHandleL1 handleL1(f, QString::fromStdString(trigID));
124 m_handleL1.push_back(handleL1);
125 }//END: passed triggers
126 }//END: loop over chain group items
127 log_verbose("Retrieving L1 data: complete");
128 }
129
130
131 if(triglvl.compare("ALL", Qt::CaseInsensitive)==0 || triglvl.compare("L2", Qt::CaseInsensitive)==0) {
132 //######################################## L2 ############################################### >
133 // Retrieve MuonFeatureDetailsContainer based on
134 /* MuFastMon.cxx
135 Authors: Akimasa Ishikawa (akimasa.ishikawa@cern.ch)
136 Kunihiro Nagano (nagano@mail.cern.ch) */
137 log_verbose("Retrieving L2 data: start");
138
141 bool runL2=false;
142
143 while(runL2==false) {
144 if(storeGate->retrieve(mfdContainer,lastmfdContainer).isSuccess())
145 log_verbose("MuonFeatureDetailsContainer retrieved");
146
147 // -----------------------------
148 // Dump muonFeatureDetails info
149 // -----------------------------
150 std::vector<const MuonFeatureDetails*> vec_muonFeatureDetails;
151
152 for(; mfdContainer!=lastmfdContainer; ++mfdContainer) {
153 MuonFeatureDetailsContainer::const_iterator mfd = mfdContainer->begin();
154 MuonFeatureDetailsContainer::const_iterator lastmfd = mfdContainer->end();
155 for(; mfd != lastmfd; ++mfd) {
156 if((*mfd)==0) continue;
157 vec_muonFeatureDetails.push_back(*mfd);
158 }
159 }
160
161 VP1TriggerHandleL2 handleL2(vec_muonFeatureDetails);
162 m_handleL2.push_back(handleL2);
163
164 runL2=true;
165 } //END: looping MuonFetureDetails
166 log_verbose("Retrieving L2 data: complete");
167 }
168
169
170 if(triglvl.compare("ALL", Qt::CaseInsensitive)==0 || triglvl.compare("EF", Qt::CaseInsensitive)==0) {
171 //######################################## EF ############################################### >
172 //--- Note: Adapted from the code TrigEDMchecker.cxx, which was ---
173 //--- "Adapted from code by A.Hamilton to check trigger EDM; R.Goncalo 21/11/07" ---
174 log_verbose("Retrieving EF data: start");
175
178 unsigned int muonCounter=0;
179
180 if(storeGate->retrieve(trigMuon,lastTrigMuon).isSuccess()) {
181 for(; trigMuon!=lastTrigMuon; ++trigMuon) {
182
183 for(const TrigMuonEFInfo* muonInfo : *trigMuon) {
184 std::vector<std::string> chains
185 // chainsPassedByObject() doesn't compile because
186 // TrigMuonEFInfo does not provide eta()/phi().
187 // But this is in fact the only place in the repository
188 // where chainsPassedByObject is used --- so maybe it's
189 // not really the correct way to go. Just disable it for now.
190 { "CHAIN_INFO_NOT_AVAILABLE_FOR_TrigMuonEFInfo" };
191 // = m_trigMatch->chainsPassedByObject<TrigMuonEFInfo>(muonInfo);
192 std::vector<std::string>::iterator itChain; //iterator over chains
193 QList<QString> chainIDs;
194
195 for(itChain=chains.begin(); itChain!=chains.end(); ++itChain)
196 chainIDs << QString((*itChain).c_str());
197
198 VP1TriggerHandleEF handleEF(muonInfo, QString("Muon No. ")+QString::number(++muonCounter), chainIDs);
199 m_handleEF.push_back(handleEF);
200 }
201 }//loop
202 } else {
203 log_fatal("Could not retrieve TrigMuonEF from StoreGate!");
204 return false; //ref: daqstatus
205 }
206 log_verbose("Retrieving EF data: complete");
207 }//END: EF
208
209 return true; //ref: daqstatus
210}
211
212
213//Clear Trigger Handles (at governing system erase)
214//_____________________________________________________________________________________________
216{
217 log_verbose("Clearing trigger handles");
218 m_handleL1.clear();
219 m_handleL2.clear();
220 m_handleEF.clear();
221}
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
a const_iterator facade to DataHandle.
Definition SGIterator.h:164
The Athena Transient Store API.
StatusCode retrieve(const T *&ptr) const
Retrieve the default object into a const T*.
std::vector< std::string > getListOfTriggers() const
std::vector< VP1Trig::VP1TriggerHandleL1 > m_handleL1
ToolHandle< TrigMatchTool > m_trigMatch
std::vector< VP1Trig::VP1TriggerHandleEF > m_handleEF
std::vector< VP1Trig::VP1TriggerHandleL2 > m_handleL2
bool loadTriggerHandles(StoreGateSvc *m_storeGate, const QString &triglvl)
ToolHandle< Trig::TrigDecisionTool > m_trigDec
The common trigger namespace for trigger analysis tools.