ATLAS Offline Software
Loading...
Searching...
No Matches
VP1Trig::VP1TriggerSystem Class Reference

#include <VP1TriggerSystem.h>

Inheritance diagram for VP1Trig::VP1TriggerSystem:
Collaboration diagram for VP1Trig::VP1TriggerSystem:

Public Member Functions

 VP1TriggerSystem ()
virtual ~VP1TriggerSystem ()
void log_info (const QString &msg)
void log_warning (const QString &msg)
void log_verbose (const QString &msg)
void log_error (const QString &msg)
void log_fatal (const QString &msg)
void log_debug (const QString &msg)
std::string prefix (std::string str)
QString qstr (char c)
QString qstr (const std::string &str)

Static Public Member Functions

static const QString pfx1 ()
static const QString pfx2 ()
static const QString pfx3 ()

Private Member Functions

bool loadTriggerHandles (StoreGateSvc *m_storeGate, const QString &triglvl)
void clearTriggerHandles ()
const std::vector< VP1Trig::VP1TriggerHandleEF > & getHandleEF ()
const std::vector< VP1Trig::VP1TriggerHandleL2 > & getHandleL2 ()
const std::vector< VP1Trig::VP1TriggerHandleL1 > & getHandleL1 ()

Private Attributes

ToolHandle< Trig::TrigDecisionToolm_trigDec
ToolHandle< TrigMatchToolm_trigMatch
std::vector< VP1Trig::VP1TriggerHandleEFm_handleEF
std::vector< VP1Trig::VP1TriggerHandleL2m_handleL2
std::vector< VP1Trig::VP1TriggerHandleL1m_handleL1
std::string m_name
int m_lvl

Friends

class VP1TriggerProcessor

Detailed Description

Definition at line 48 of file VP1TriggerSystem.h.

Constructor & Destructor Documentation

◆ VP1TriggerSystem()

VP1Trig::VP1TriggerSystem::VP1TriggerSystem ( )

Definition at line 54 of file VP1TriggerSystem.cxx.

55 : Logger("VP1TriggerSystem"),
56 m_trigDec("Trig::TrigDecisionTool/TrigDecisionTool"),
57 m_trigMatch("TrigMatchTool/TrigMatchTool") {log_verbose("constructor");}
ToolHandle< TrigMatchTool > m_trigMatch
ToolHandle< Trig::TrigDecisionTool > m_trigDec

◆ ~VP1TriggerSystem()

VP1Trig::VP1TriggerSystem::~VP1TriggerSystem ( )
virtual

Definition at line 62 of file VP1TriggerSystem.cxx.

62{log_verbose("destructor");}

Member Function Documentation

◆ clearTriggerHandles()

void VP1Trig::VP1TriggerSystem::clearTriggerHandles ( )
private

Definition at line 215 of file VP1TriggerSystem.cxx.

216{
217 log_verbose("Clearing trigger handles");
218 m_handleL1.clear();
219 m_handleL2.clear();
220 m_handleEF.clear();
221}
std::vector< VP1Trig::VP1TriggerHandleL1 > m_handleL1
std::vector< VP1Trig::VP1TriggerHandleEF > m_handleEF
std::vector< VP1Trig::VP1TriggerHandleL2 > m_handleL2

◆ getHandleEF()

const std::vector< VP1Trig::VP1TriggerHandleEF > & VP1Trig::VP1TriggerSystem::getHandleEF ( )
inlineprivate

Definition at line 72 of file VP1TriggerSystem.h.

72{ return m_handleEF; };

◆ getHandleL1()

const std::vector< VP1Trig::VP1TriggerHandleL1 > & VP1Trig::VP1TriggerSystem::getHandleL1 ( )
inlineprivate

Definition at line 74 of file VP1TriggerSystem.h.

74{ return m_handleL1; };

◆ getHandleL2()

const std::vector< VP1Trig::VP1TriggerHandleL2 > & VP1Trig::VP1TriggerSystem::getHandleL2 ( )
inlineprivate

Definition at line 73 of file VP1TriggerSystem.h.

73{ return m_handleL2; };

◆ loadTriggerHandles()

bool VP1Trig::VP1TriggerSystem::loadTriggerHandles ( StoreGateSvc * m_storeGate,
const QString & triglvl )
private

Definition at line 67 of file VP1TriggerSystem.cxx.

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
139 SG::ConstIterator<MuonFeatureDetailsContainer> mfdContainer;
140 SG::ConstIterator<MuonFeatureDetailsContainer> lastmfdContainer;
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
176 SG::ConstIterator<TrigMuonEFInfoContainer> trigMuon;
177 SG::ConstIterator<TrigMuonEFInfoContainer> lastTrigMuon;
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}
DataModel_detail::const_iterator< DataVector > const_iterator
Definition DataVector.h:838
std::vector< std::string > getListOfTriggers() const

◆ log_debug()

void VP1Trig::Logger::log_debug ( const QString & msg)
inherited

Definition at line 54 of file graphics/VP1/VP1Systems/VP1TriggerSystems/src/Logger.cxx.

54 {
55 std::cout<<prefix(m_name)<<"DEBUG "<<msg.toStdString()<<std::endl;
56}
MsgStream & msg
Definition testRead.cxx:32

◆ log_error()

void VP1Trig::Logger::log_error ( const QString & msg)
inherited

Definition at line 46 of file graphics/VP1/VP1Systems/VP1TriggerSystems/src/Logger.cxx.

46 {
47 std::cout<<prefix(m_name)<<"ERROR "<<msg.toStdString()<<std::endl;
48}

◆ log_fatal()

void VP1Trig::Logger::log_fatal ( const QString & msg)
inherited

Definition at line 49 of file graphics/VP1/VP1Systems/VP1TriggerSystems/src/Logger.cxx.

49 {
50 std::cout<<prefix(m_name)<<"FATAL "<<msg.toStdString()<<std::endl;
51}

◆ log_info()

void VP1Trig::Logger::log_info ( const QString & msg)
inherited

Definition at line 32 of file graphics/VP1/VP1Systems/VP1TriggerSystems/src/Logger.cxx.

32 {
33 if(m_lvl>=1)
34 std::cout<<prefix(m_name)<<"INFO "<<msg.toStdString()<<std::endl;
35}

◆ log_verbose()

void VP1Trig::Logger::log_verbose ( const QString & msg)
inherited

Definition at line 40 of file graphics/VP1/VP1Systems/VP1TriggerSystems/src/Logger.cxx.

40 {
41 if(m_lvl>=3)
42 std::cout<<prefix(m_name)<<"VERBOSE "<<msg.toStdString()<<std::endl;
43}

◆ log_warning()

void VP1Trig::Logger::log_warning ( const QString & msg)
inherited

Definition at line 36 of file graphics/VP1/VP1Systems/VP1TriggerSystems/src/Logger.cxx.

36 {
37 if(m_lvl>=2)
38 std::cout<<prefix(m_name)<<"WARNING "<<msg.toStdString()<<std::endl;
39}

◆ pfx1()

const QString VP1Trig::Logger::pfx1 ( )
inlinestaticinherited

Definition at line 51 of file graphics/VP1/VP1Systems/VP1TriggerSystems/VP1TriggerSystems/Logger.h.

51{return " ";}

◆ pfx2()

const QString VP1Trig::Logger::pfx2 ( )
inlinestaticinherited

Definition at line 52 of file graphics/VP1/VP1Systems/VP1TriggerSystems/VP1TriggerSystems/Logger.h.

52{return " ";}

◆ pfx3()

const QString VP1Trig::Logger::pfx3 ( )
inlinestaticinherited

Definition at line 53 of file graphics/VP1/VP1Systems/VP1TriggerSystems/VP1TriggerSystems/Logger.h.

53{return " ";}

◆ prefix()

std::string VP1Trig::Logger::prefix ( std::string str)
inherited

Definition at line 61 of file graphics/VP1/VP1Systems/VP1TriggerSystems/src/Logger.cxx.

62{
63 //15 character prefix standard
64 if(int(str.size())>15) {
65 str.resize(15);
66 str=str+std::string("... ");
67 return str;
68 }
69 else if(int(str.size())==15) {
70 str=str+std::string(" ");
71 return str;
72 }
73 int q=21-int(str.size());
74 for(int i=0;i<q;++i)
75 str=str+std::string(" ");
76 return str;
77}

◆ qstr() [1/2]

QString VP1Trig::Logger::qstr ( char c)
inherited

Definition at line 82 of file graphics/VP1/VP1Systems/VP1TriggerSystems/src/Logger.cxx.

83{
84 std::stringstream ss; ss<<c;
85 std::string cStr=ss.str();
86 ss.str(std::string()); ss.clear();
87 return QString::fromStdString(cStr);
88}
static Double_t ss

◆ qstr() [2/2]

QString VP1Trig::Logger::qstr ( const std::string & str)
inherited

Definition at line 93 of file graphics/VP1/VP1Systems/VP1TriggerSystems/src/Logger.cxx.

94{
95 return QString::fromStdString(str);
96}

◆ VP1TriggerProcessor

friend class VP1TriggerProcessor
friend

Definition at line 56 of file VP1TriggerSystem.h.

Member Data Documentation

◆ m_handleEF

std::vector<VP1Trig::VP1TriggerHandleEF> VP1Trig::VP1TriggerSystem::m_handleEF
private

Definition at line 67 of file VP1TriggerSystem.h.

◆ m_handleL1

std::vector<VP1Trig::VP1TriggerHandleL1> VP1Trig::VP1TriggerSystem::m_handleL1
private

Definition at line 69 of file VP1TriggerSystem.h.

◆ m_handleL2

std::vector<VP1Trig::VP1TriggerHandleL2> VP1Trig::VP1TriggerSystem::m_handleL2
private

Definition at line 68 of file VP1TriggerSystem.h.

◆ m_lvl

int VP1Trig::Logger::m_lvl
privateinherited

◆ m_name

std::string VP1Trig::Logger::m_name
privateinherited

◆ m_trigDec

ToolHandle<Trig::TrigDecisionTool> VP1Trig::VP1TriggerSystem::m_trigDec
private

Definition at line 63 of file VP1TriggerSystem.h.

◆ m_trigMatch

ToolHandle<TrigMatchTool> VP1Trig::VP1TriggerSystem::m_trigMatch
private

Definition at line 64 of file VP1TriggerSystem.h.


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