ATLAS Offline Software
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
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 (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, QString triglvl)
 
void clearTriggerHandles ()
 
std::vector< VP1Trig::VP1TriggerHandleEFgetHandleEF ()
 
std::vector< VP1Trig::VP1TriggerHandleL2getHandleL2 ()
 
std::vector< VP1Trig::VP1TriggerHandleL1getHandleL1 ()
 

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 55 of file VP1TriggerSystem.h.

Constructor & Destructor Documentation

◆ VP1TriggerSystem()

VP1Trig::VP1TriggerSystem::VP1TriggerSystem ( )

Definition at line 58 of file VP1TriggerSystem.cxx.

59  : Logger("VP1TriggerSystem"),
60  m_trigDec("Trig::TrigDecisionTool/TrigDecisionTool"),
61  m_trigMatch("TrigMatchTool/TrigMatchTool") {log_verbose("constructor");}

◆ ~VP1TriggerSystem()

VP1Trig::VP1TriggerSystem::~VP1TriggerSystem ( )
virtual

Definition at line 66 of file VP1TriggerSystem.cxx.

66 {log_verbose("destructor");}

Member Function Documentation

◆ clearTriggerHandles()

void VP1Trig::VP1TriggerSystem::clearTriggerHandles ( )
private

Definition at line 220 of file VP1TriggerSystem.cxx.

221 {
222  log_verbose("Clearing trigger handles");
223  m_handleL1.clear();
224  m_handleL2.clear();
225  m_handleEF.clear();
226 }

◆ getHandleEF()

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

Definition at line 86 of file VP1TriggerSystem.h.

◆ getHandleL1()

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

Definition at line 88 of file VP1TriggerSystem.h.

◆ getHandleL2()

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

Definition at line 87 of file VP1TriggerSystem.h.

◆ loadTriggerHandles()

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

Definition at line 71 of file VP1TriggerSystem.cxx.

72 {
73  log_verbose("loadTriggerHandles()");
74 
75  //Safety handle check
76  if(m_handleL1.size()!=0 || m_handleL2.size()!=0 || m_handleEF.size()!=0)
78 
79 
80  if(triglvl.compare("ALL", Qt::CaseInsensitive)==0 || triglvl.compare("L1", Qt::CaseInsensitive)==0) {
81  //######################################## L1 ############################################### >
82  log_info("Retrieving L1 data via TrigDecisionTool: start");
83 
84  //VARs
85  std::string trigID;
86  int trigcount=0;
87 
88  //Try to retrieve the TrigDecisionTool
89  if(m_trigDec.retrieve().isFailure()) {
90  log_fatal("Could not retrieve TrigDecisionTool!");
91  return false; //ref: daqstatus
92  }
93  //Try to retrieve the TrigMatchTool
94  if(m_trigMatch.retrieve().isFailure()) {
95  log_fatal("Could not retrieve TrigMatchTool!");
96  return false; //ref: daqstatus
97  }
98 
99  //Loading entire ChainGroup information via TrigDecisionTool
100  const Trig::ChainGroup* allChains = m_trigDec->getChainGroup(".*"); //all triggers
101  if(!allChains) {
102  log_fatal("ChainGroup could not be loaded!");
103  return false; //ref: daqstatus
104  }
105 
106  //Retrieve list of valid triggers associated with ChainGroup
107  std::vector<std::string> trigList = allChains->getListOfTriggers();
108  std::vector<std::string>::iterator trigItr; //Iterator over trigList
109 
110  //Loop over list of triggers
111  for(trigItr=trigList.begin(); trigItr!=trigList.end(); ++trigItr) {
112 
113  //Safety Check: item not empty!
114  if((*trigItr).empty()) continue;
115 
116  //Process passed triggers
117  if(m_trigDec->isPassed((*trigItr))) {
118  ++trigcount;
119  trigID = std::string((*trigItr).c_str());
120  //std::cout << "INFO :: Processing trigger chain: " << trigger << "[" << trigcount << "] ";
121 
122  using namespace Trig;
123  Trig::FeatureContainer f = m_trigDec->features(trigID); //get trigger and its objects
124  //std::cout << "fsize: " << f.getCombinations().size() << std::endl;
125 
126  //Export to L1 handle
127  VP1TriggerHandleL1 handleL1(f, QString::fromStdString(trigID));
128  m_handleL1.push_back(handleL1);
129  }//END: passed triggers
130  }//END: loop over chain group items
131  log_verbose("Retrieving L1 data: complete");
132  }
133 
134 
135  if(triglvl.compare("ALL", Qt::CaseInsensitive)==0 || triglvl.compare("L2", Qt::CaseInsensitive)==0) {
136  //######################################## L2 ############################################### >
137  // Retrieve MuonFeatureDetailsContainer based on
138  /* MuFastMon.cxx
139  Authors: Akimasa Ishikawa (akimasa.ishikawa@cern.ch)
140  Kunihiro Nagano (nagano@mail.cern.ch) */
141  log_verbose("Retrieving L2 data: start");
142 
143  const DataHandle<MuonFeatureDetailsContainer> mfdContainer;
144  const DataHandle<MuonFeatureDetailsContainer> lastmfdContainer;
145  bool runL2=false;
146 
147  while(runL2==false) {
148  if(storeGate->retrieve(mfdContainer,lastmfdContainer).isSuccess())
149  log_verbose("MuonFeatureDetailsContainer retrieved");
150 
151  if(!mfdContainer) {
152  log_fatal("MuonFeatureDetailsContainer not retrieved!");
153  return false; //ref: daqstatus
154  }
155 
156  // -----------------------------
157  // Dump muonFeatureDetails info
158  // -----------------------------
159  std::vector<const MuonFeatureDetails*> vec_muonFeatureDetails;
160 
161  for(; mfdContainer!=lastmfdContainer; mfdContainer++) {
162  MuonFeatureDetailsContainer::const_iterator mfd = mfdContainer->begin();
163  MuonFeatureDetailsContainer::const_iterator lastmfd = mfdContainer->end();
164  for(; mfd != lastmfd; ++mfd) {
165  if((*mfd)==0) continue;
166  vec_muonFeatureDetails.push_back(*mfd);
167  }
168  }
169 
170  VP1TriggerHandleL2 handleL2(vec_muonFeatureDetails);
171  m_handleL2.push_back(handleL2);
172 
173  runL2=true;
174  } //END: looping MuonFetureDetails
175  log_verbose("Retrieving L2 data: complete");
176  }
177 
178 
179  if(triglvl.compare("ALL", Qt::CaseInsensitive)==0 || triglvl.compare("EF", Qt::CaseInsensitive)==0) {
180  //######################################## EF ############################################### >
181  //--- Note: Adapted from the code TrigEDMchecker.cxx, which was ---
182  //--- "Adapted from code by A.Hamilton to check trigger EDM; R.Goncalo 21/11/07" ---
183  log_verbose("Retrieving EF data: start");
184 
185  const DataHandle<TrigMuonEFInfoContainer> trigMuon;
186  const DataHandle<TrigMuonEFInfoContainer> lastTrigMuon;
187  unsigned int muonCounter=0;
188 
189  if(storeGate->retrieve(trigMuon,lastTrigMuon).isSuccess()) {
190  for(int i=0; trigMuon!=lastTrigMuon; ++trigMuon, ++i) {
191  TrigMuonEFInfoContainer::const_iterator MuonItr = trigMuon->begin(); //Iterators over top-level EDM
192  TrigMuonEFInfoContainer::const_iterator MuonItrE = trigMuon->end(); //objects (TrigMuonEFInfoContainer)
193 
194  for(int j=0; MuonItr!=MuonItrE; ++MuonItr, ++j ) { //looping over TrigMuonEFInfo objects
195  const TrigMuonEFInfo* muonInfo = (*MuonItr);
196  std::vector<std::string> chains = m_trigMatch->chainsPassedByObject<TrigMuonEFInfo>(muonInfo);
197  std::vector<std::string>::iterator itChain; //iterator over chains
198  QList<QString> chainIDs;
199 
200  for(itChain=chains.begin(); itChain!=chains.end(); ++itChain)
201  chainIDs << QString((*itChain).c_str());
202 
203  VP1TriggerHandleEF handleEF(muonInfo, QString("Muon No. ")+QString::number(++muonCounter), chainIDs);
204  m_handleEF.push_back(handleEF);
205  }
206  }//loop
207  } else {
208  log_fatal("Could not retrieve TrigMuonEF from StoreGate!");
209  return false; //ref: daqstatus
210  }
211  log_verbose("Retrieving EF data: complete");
212  }//END: EF
213 
214  return true; //ref: daqstatus
215 }

◆ 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 }

◆ 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()

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

◆ pfx2()

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

◆ pfx3()

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

◆ 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=str.substr(0,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 }

◆ qstr() [2/2]

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

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

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

Friends And Related Function Documentation

◆ VP1TriggerProcessor

friend class VP1TriggerProcessor
friend

Definition at line 70 of file VP1TriggerSystem.h.

Member Data Documentation

◆ m_handleEF

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

Definition at line 81 of file VP1TriggerSystem.h.

◆ m_handleL1

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

Definition at line 83 of file VP1TriggerSystem.h.

◆ m_handleL2

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

Definition at line 82 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 77 of file VP1TriggerSystem.h.

◆ m_trigMatch

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

Definition at line 78 of file VP1TriggerSystem.h.


The documentation for this class was generated from the following files:
xAOD::iterator
JetConstituentVector::iterator iterator
Definition: JetConstituentVector.cxx:68
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
VP1Trig::VP1TriggerSystem::m_trigDec
ToolHandle< Trig::TrigDecisionTool > m_trigDec
Definition: VP1TriggerSystem.h:77
VP1Trig::Logger::m_name
std::string m_name
Definition: graphics/VP1/VP1Systems/VP1TriggerSystems/VP1TriggerSystems/Logger.h:70
PowhegControl_ttHplus_NLO.ss
ss
Definition: PowhegControl_ttHplus_NLO.py:83
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
VP1Trig::VP1TriggerSystem::clearTriggerHandles
void clearTriggerHandles()
Definition: VP1TriggerSystem.cxx:220
Trig
The common trigger namespace for trigger analysis tools.
Definition: LArCellMonAlg.h:33
VP1Trig::VP1TriggerSystem::m_trigMatch
ToolHandle< TrigMatchTool > m_trigMatch
Definition: VP1TriggerSystem.h:78
VP1Trig::Logger::log_verbose
void log_verbose(const QString &msg)
Definition: graphics/VP1/VP1Systems/VP1TriggerSystems/src/Logger.cxx:40
VP1Trig::Logger::log_fatal
void log_fatal(const QString &msg)
Definition: graphics/VP1/VP1Systems/VP1TriggerSystems/src/Logger.cxx:49
Trig::FeatureContainer
Definition: FeatureContainer.h:54
VP1Trig::VP1TriggerSystem::m_handleEF
std::vector< VP1Trig::VP1TriggerHandleEF > m_handleEF
Definition: VP1TriggerSystem.h:81
VP1Trig::Logger::m_lvl
int m_lvl
Definition: graphics/VP1/VP1Systems/VP1TriggerSystems/VP1TriggerSystems/Logger.h:71
lumiFormat.i
int i
Definition: lumiFormat.py:85
VP1Trig::VP1TriggerSystem::m_handleL1
std::vector< VP1Trig::VP1TriggerHandleL1 > m_handleL1
Definition: VP1TriggerSystem.h:83
hist_file_dump.f
f
Definition: hist_file_dump.py:135
Trig::ChainGroup
Definition: ChainGroup.h:51
python.selection.number
number
Definition: selection.py:20
VP1Trig::VP1TriggerSystem::m_handleL2
std::vector< VP1Trig::VP1TriggerHandleL2 > m_handleL2
Definition: VP1TriggerSystem.h:82
python.copyTCTOutput.chains
chains
Definition: copyTCTOutput.py:81
VP1Trig::Logger::log_info
void log_info(const QString &msg)
Definition: graphics/VP1/VP1Systems/VP1TriggerSystems/src/Logger.cxx:32
VP1Trig::Logger::prefix
std::string prefix(std::string str)
Definition: graphics/VP1/VP1Systems/VP1TriggerSystems/src/Logger.cxx:61
python.CaloScaleNoiseConfig.str
str
Definition: CaloScaleNoiseConfig.py:78
extractSporadic.q
list q
Definition: extractSporadic.py:98
str
Definition: BTagTrackIpAccessor.cxx:11
Trig::ChainGroup::getListOfTriggers
std::vector< std::string > getListOfTriggers() const
Definition: ChainGroup.cxx:467
VP1Trig::Logger::Logger
Logger()
Definition: graphics/VP1/VP1Systems/VP1TriggerSystems/src/Logger.cxx:19
python.compressB64.c
def c
Definition: compressB64.py:93
python.AutoConfigFlags.msg
msg
Definition: AutoConfigFlags.py:7
TrigMuonEFInfo
Definition: TrigMuonEFInfo.h:24
python.PyKernel.storeGate
storeGate
Definition: PyKernel.py:40