ATLAS Offline Software
TrigDecisionChecker.h
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 
9 #ifndef TrigDecisionChecker_TrigDecisionChecker_H
10 #define TrigDecisionChecker_TrigDecisionChecker_H
11 
12 // std stuff
13 #include <vector>
14 #include <string>
15 #include <map>
16 #include <fstream>
17 #include <iostream>
18 
19 // Base class
21 
22 // core stuff
23 #include "GaudiKernel/ToolHandle.h"
24 
25 // Trigger includes
27 
28 // fwd declare muon printing tool
29 namespace Rec {
30  class IMuonPrintingTool;
31 }
32 
44 {
45 
46  public:
47 
48  TrigDecisionChecker(const std::string &name, ISvcLocator *pSvcLocator);
50 
51  // IAlgorithm virtual methods to implement
55 
56  private:
57  template <class T> StatusCode checkEDM(const std::string& trigItem);
58  StatusCode checkTauEDM(const std::string& trigItem);
59 
60  StatusCode checkMuonEDM(const std::string& trigItem);
61 
62  StatusCode checkBphysEDM(const std::string& trigItem);
63 
64  StatusCode checkBjetEDM(const std::string& trigItem);
65 
66  StatusCode checkElectronEDM(const std::string& trigItem);
67 
68  StatusCode checkPhotonEDM(const std::string& trigItem);
69 
70  StatusCode checkMinBiasEDM(const std::string& trigItem);
75 
76  StatusCode checkJetEDM(const std::string& trigItem);
77 
78  StatusCode checkMetEDM(const std::string& trigItem);
79 
80  Gaudi::Property<bool> m_eventDecisionPrintout{this, "WriteEventDecision", true};
81 
82  // write out trigger counts
83  Gaudi::Property<std::string> m_printoutFileName{ this, "WriteOutFilename", "", "when set the stat is saved in this file"};
84 
85 
86 
87 
88 
89 
90  // useful for bookkeeping:
91  std::map<std::string,int> m_L1Summary;
92  std::vector<std::string> m_summary;
93  std::vector<int> m_summaryPass;
94  std::vector<int> m_summaryPassRaw;
95  std::vector<int> m_summaryPassPhys;
96  std::vector<int> m_summaryChainPass;
97  std::vector<int> m_summaryChainPassRaw;
98  std::vector<int> m_summaryChainPassPhys;
99  std::vector<int> m_summaryChainPT;
100  std::vector<int> m_summaryChainPS;
102 
103  // tests: check efficiency for a few signatures in blocks on 100 events
104  Gaudi::Property<int> m_monitoringBlockSize{ this, "MonitoringBlock", 100};
105 
106  std::vector<int> m_countEvent;
107  std::vector<int> m_runCountSigs;
108  std::vector<std::vector<int>* > m_countSigs;
109  Gaudi::Property<std::vector<std::string>> m_countSigNames{ this, "MonitoredChains", {} };
110  int m_eventNumber = 0;
111  float m_muSum = 0;
112 
113  ToolHandle<Trig::TrigDecisionTool> m_trigDec{this, "TrigDecisionTool", "Trig::TrigDecisionTool/TrigDecisionTool"};
114 
116  Gaudi::Property<std::vector<std::string>> m_muonItems{ this, "MuonItems", {} };
117 
118  // Bjet triggers to test output for
119  Gaudi::Property<std::vector<std::string>> m_bjetItems{ this, "BjetItems", {} };
120 
121  Gaudi::Property<std::vector<std::string>> m_bphysItems{ this, "BphysicsItems", {} };
122 
123  // Electron triggers to test output for
124  Gaudi::Property<std::vector<std::string>> m_electronItems{ this, "ElectronItems", {} };
125 
126  // Photon triggers to test output for
127  Gaudi::Property<std::vector<std::string>> m_photonItems{ this, "PhotonItems", {} };
128 
129  // Tau triggers to test output for
130  Gaudi::Property<std::vector<std::string>> m_TauItems{ this, "TauItems", {} };
131 
132  // MinBias triggers to test output for
133  Gaudi::Property<std::vector<std::string>> m_minBiasItems{ this, "MinBiasItems", {} };
134 
135  // Jet triggers to test output for
136  Gaudi::Property<std::vector<std::string>> m_jetItems{ this, "JetItems", {} };
137 
138  // Met triggers to test output for
139  Gaudi::Property<std::vector<std::string>> m_metItems{ this, "MetItems", {} };
140 
141  // ...check prescale and passthrough factors
142  std::vector<float> m_chainPrescales;
143  std::vector<float> m_chainPrescalesCalculated;
144  std::vector<float> m_chain_passthrough;
145  std::vector<float> m_chain_passthrough_calculated;
146  std::vector<int> m_lower_chain_accept;
147  std::map<std::string,std::string> m_lowerChainMap;
148 
149  // needed for mu value
150  std::string m_eventInfoName;
151 
152  // Check pass bits
153  Gaudi::Property<bool> m_checkBits{ this, "CheckTrigPassBits", false, "TrigPassBits retrieval from TDT"};
154 
155 };
156 
157 #endif
TrigDecisionChecker::m_jetItems
Gaudi::Property< std::vector< std::string > > m_jetItems
Definition: TrigDecisionChecker.h:136
TrigDecisionChecker::m_chain_passthrough
std::vector< float > m_chain_passthrough
Definition: TrigDecisionChecker.h:144
TrigDecisionChecker::checkTrigSpacePointCounts
void checkTrigSpacePointCounts(const Trig::FeatureContainer &fc)
Definition: TrigDecisionChecker.cxx:1040
TrigDecisionChecker::m_countEvent
std::vector< int > m_countEvent
Definition: TrigDecisionChecker.h:106
TrigDecisionChecker::checkTrigT2MBTSBits
void checkTrigT2MBTSBits(const Trig::FeatureContainer &fc)
Definition: TrigDecisionChecker.cxx:1071
TrigDecisionChecker::m_monitoringBlockSize
Gaudi::Property< int > m_monitoringBlockSize
Definition: TrigDecisionChecker.h:104
TrigDecisionChecker::m_eventDecisionPrintout
Gaudi::Property< bool > m_eventDecisionPrintout
Definition: TrigDecisionChecker.h:80
TrigDecisionChecker::checkMetEDM
StatusCode checkMetEDM(const std::string &trigItem)
Definition: TrigDecisionChecker.cxx:1193
TrigDecisionChecker::m_chain_passthrough_calculated
std::vector< float > m_chain_passthrough_calculated
Definition: TrigDecisionChecker.h:145
TrigDecisionChecker::checkMinBiasEDM
StatusCode checkMinBiasEDM(const std::string &trigItem)
Definition: TrigDecisionChecker.cxx:1024
TrigDecisionChecker::checkElectronEDM
StatusCode checkElectronEDM(const std::string &trigItem)
Definition: TrigDecisionChecker.cxx:926
TrigDecisionChecker::m_countSigs
std::vector< std::vector< int > * > m_countSigs
Definition: TrigDecisionChecker.h:108
TrigDecisionTool.h
TrigDecisionChecker::m_summaryPassRaw
std::vector< int > m_summaryPassRaw
Definition: TrigDecisionChecker.h:94
TrigDecisionChecker::m_summaryChainPassRaw
std::vector< int > m_summaryChainPassRaw
Definition: TrigDecisionChecker.h:97
TrigDecisionChecker::m_chainPrescalesCalculated
std::vector< float > m_chainPrescalesCalculated
Definition: TrigDecisionChecker.h:143
TrigDecisionChecker::m_bphysItems
Gaudi::Property< std::vector< std::string > > m_bphysItems
Definition: TrigDecisionChecker.h:121
TrigDecisionChecker::m_checkBits
Gaudi::Property< bool > m_checkBits
Definition: TrigDecisionChecker.h:153
TrigDecisionChecker::m_electronItems
Gaudi::Property< std::vector< std::string > > m_electronItems
Bphysics chains to test.
Definition: TrigDecisionChecker.h:124
TrigDecisionChecker::checkBjetEDM
StatusCode checkBjetEDM(const std::string &trigItem)
Definition: TrigDecisionChecker.cxx:644
Trig::FeatureContainer
Definition: FeatureContainer.h:54
TrigDecisionChecker::m_minBiasItems
Gaudi::Property< std::vector< std::string > > m_minBiasItems
Definition: TrigDecisionChecker.h:133
AthAlgorithm.h
TrigDecisionChecker::checkJetEDM
StatusCode checkJetEDM(const std::string &trigItem)
Definition: TrigDecisionChecker.cxx:1141
TrigDecisionChecker::checkMuonEDM
StatusCode checkMuonEDM(const std::string &trigItem)
Definition: TrigDecisionChecker.cxx:798
TrigDecisionChecker::m_summaryChainPT
std::vector< int > m_summaryChainPT
Definition: TrigDecisionChecker.h:99
TrigDecisionChecker::m_lowerChainMap
std::map< std::string, std::string > m_lowerChainMap
Definition: TrigDecisionChecker.h:147
TrigDecisionChecker::m_summaryPass
std::vector< int > m_summaryPass
Definition: TrigDecisionChecker.h:93
TrigDecisionChecker
Definition: TrigDecisionChecker.h:44
TrigDecisionChecker::m_summaryPassPhys
std::vector< int > m_summaryPassPhys
Definition: TrigDecisionChecker.h:95
TrigDecisionChecker::finalize
StatusCode finalize()
std Gaudi finalize method
Definition: TrigDecisionChecker.cxx:137
TrigDecisionChecker::TrigDecisionChecker
TrigDecisionChecker(const std::string &name, ISvcLocator *pSvcLocator)
std Gaudi Algorithm constructor
Definition: TrigDecisionChecker.cxx:73
Rec
Name: MuonSpContainer.h Package : offline/Reconstruction/MuonIdentification/muonEvent.
Definition: FakeTrackBuilder.h:10
TrigDecisionChecker::checkEDM
StatusCode checkEDM(const std::string &trigItem)
Definition: TrigDecisionChecker.cxx:578
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
TrigDecisionChecker::m_summaryChainPS
std::vector< int > m_summaryChainPS
Definition: TrigDecisionChecker.h:100
TrigDecisionChecker::m_summary
std::vector< std::string > m_summary
Definition: TrigDecisionChecker.h:92
TrigDecisionChecker::execute
StatusCode execute()
std Gaudi execute method -> use TrigDecisionTool to 'look' at the trigger data
Definition: TrigDecisionChecker.cxx:248
TrigDecisionChecker::~TrigDecisionChecker
~TrigDecisionChecker()
std deconstructor
Definition: TrigDecisionChecker.cxx:82
TrigDecisionChecker::m_runCountSigs
std::vector< int > m_runCountSigs
Definition: TrigDecisionChecker.h:107
TrigDecisionChecker::m_lower_chain_accept
std::vector< int > m_lower_chain_accept
Definition: TrigDecisionChecker.h:146
TrigDecisionChecker::checkBphysEDM
StatusCode checkBphysEDM(const std::string &trigItem)
Bphysics EDM checker.
Definition: TrigDecisionChecker.cxx:887
TrigDecisionChecker::checkPhotonEDM
StatusCode checkPhotonEDM(const std::string &trigItem)
Definition: TrigDecisionChecker.cxx:981
TrigDecisionChecker::initialize
StatusCode initialize()
std Gaudi initialize method
Definition: TrigDecisionChecker.cxx:85
TrigDecisionChecker::checkTrigTrackCounts
void checkTrigTrackCounts(const Trig::FeatureContainer &fc)
Definition: TrigDecisionChecker.cxx:1111
AthAlgorithm
Definition: AthAlgorithm.h:47
TrigDecisionChecker::m_chainPrescales
std::vector< float > m_chainPrescales
Definition: TrigDecisionChecker.h:142
TrigDecisionChecker::m_summaryChainPassPhys
std::vector< int > m_summaryChainPassPhys
Definition: TrigDecisionChecker.h:98
TrigDecisionChecker::checkTauEDM
StatusCode checkTauEDM(const std::string &trigItem)
Definition: TrigDecisionChecker.cxx:841
TrigDecisionChecker::checkTrigVertexCounts
void checkTrigVertexCounts(const Trig::FeatureContainer &fc)
Definition: TrigDecisionChecker.cxx:1091
TrigDecisionChecker::m_bjetItems
Gaudi::Property< std::vector< std::string > > m_bjetItems
Definition: TrigDecisionChecker.h:119
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
TrigDecisionChecker::m_TauItems
Gaudi::Property< std::vector< std::string > > m_TauItems
Definition: TrigDecisionChecker.h:130
TrigDecisionChecker::m_eventInfoName
std::string m_eventInfoName
Definition: TrigDecisionChecker.h:150
TrigDecisionChecker::m_muSum
float m_muSum
Definition: TrigDecisionChecker.h:111
TrigDecisionChecker::m_countSigNames
Gaudi::Property< std::vector< std::string > > m_countSigNames
Definition: TrigDecisionChecker.h:109
TrigDecisionChecker::m_metItems
Gaudi::Property< std::vector< std::string > > m_metItems
Definition: TrigDecisionChecker.h:139
TrigDecisionChecker::m_muonItems
Gaudi::Property< std::vector< std::string > > m_muonItems
Muon triggers to test output for.
Definition: TrigDecisionChecker.h:116
TrigDecisionChecker::m_printoutFileName
Gaudi::Property< std::string > m_printoutFileName
Definition: TrigDecisionChecker.h:83
TrigDecisionChecker::m_first_event
bool m_first_event
Definition: TrigDecisionChecker.h:101
TrigDecisionChecker::m_photonItems
Gaudi::Property< std::vector< std::string > > m_photonItems
Definition: TrigDecisionChecker.h:127
TrigDecisionChecker::m_trigDec
ToolHandle< Trig::TrigDecisionTool > m_trigDec
interface to use the trigger data: TriggerTool
Definition: TrigDecisionChecker.h:113
TrigDecisionChecker::m_summaryChainPass
std::vector< int > m_summaryChainPass
Definition: TrigDecisionChecker.h:96
TrigDecisionChecker::m_eventNumber
int m_eventNumber
Definition: TrigDecisionChecker.h:110
TrigDecisionChecker::m_L1Summary
std::map< std::string, int > m_L1Summary
Definition: TrigDecisionChecker.h:91