|
ATLAS Offline Software
|
Go to the documentation of this file.
25 #include "TLorentzVector.h"
36 const char*
APP_NAME =
"TrigMuonMatching_example";
48 if (
chain ==
nullptr) {
58 ToolHandle<TrigConf::ITrigConfigTool> configHandle(&configTool);
66 ToolHandle<Trig::TrigDecisionTool> m_trigDec(&trigDecTool);
78 auto hmu_offline_pt =
new TH1F(
"mu_offline_pt",
"mu_offline_pt", 100, 0, 300);
79 auto hmu_hltmatch_pt =
new TH1F(
"mu_hltmatch_pt",
"mu_hltmatch_pt", 100, 0, 300);
80 auto hmu_l1match_pt =
new TH1F(
"mu_l1match_pt",
"mu_l1match_pt", 100, 0, 300);
81 auto hmu_L2SAmatch_pt =
new TH1F(
"mu_L2SAmatch_pt",
"mu_L2SAmatch_pt", 100, 0, 300);
82 auto hmu_L2CBmatch_pt =
new TH1F(
"mu_L2CBmatch_pt",
"mu_L2CBmatch_pt", 100, 0, 300);
87 event.getEntry(
entry);
91 goodMuons->setStore(goodMuonsAux);
95 std::cout <<
"Number of muons " << muons->
size() << std::endl;
96 for(
const auto*
mu : *muons){
97 std::cout <<
"muon pt " <<
mu->pt() << std::endl;
98 hmu_offline_pt->Fill(
mu->pt()*0.001);
99 Bool_t ismu26_imedium =
false;
100 Bool_t ismu50 =
false;
101 ismu26_imedium = m_match_Tool.
match(
mu,
"HLT_mu26_imedium");
102 ismu50 = m_match_Tool.
match(
mu,
"HLT_mu50");
104 std::cout <<
"HLT_mu26_imedium matched." << std::endl;
105 hmu_hltmatch_pt->Fill(
mu->pt()*0.001);
107 if(ismu50)std::cout <<
"HLT_mu50 matched." << std::endl;
110 Bool_t isMU20 =
false;
111 isMU20 = m_match_Tool.
matchL1(
mu,
"L1_MU20");
113 std::cout <<
"L1_MU20 matched." << std::endl;
114 hmu_l1match_pt->Fill(
mu->pt()*0.001);
118 Bool_t isL2SA =
false;
119 isL2SA = m_match_Tool.
matchL2SA(
mu,
"L1_MU20",
"HLT_mu26_imedium");
121 std::cout <<
"L2SA matched" << std::endl;
122 hmu_L2SAmatch_pt->Fill(
mu->pt()*0.001);
126 Bool_t isL2CB =
false;
127 isL2CB = m_match_Tool.
matchL2CB(
mu,
"HLT_mu26_imedium");
129 std::cout <<
"L2CB matched" << std::endl;
130 hmu_L2CBmatch_pt->Fill(
mu->pt()*0.001);
134 muon->makePrivateStore(*
mu);
141 if(goodMuons->
size()==2){
142 for(
const auto mu : *goodMuons){
147 std::pair<Bool_t,Bool_t> result1, result2;
150 if(!
valid) std::cout <<
"not supported 2mu14" << std::endl;
151 if(result1.first && result2.first) std::cout <<
"HLT_2mu14 matched" << std::endl;
153 std::pair<Bool_t,Bool_t> result3, result4;
154 valid = m_match_Tool.
matchDimuon(mu1, mu2,
"HLT_mu18_mu8noL1", result3, result4);
155 if(!
valid) std::cout <<
"not supported mu18_mu8noL1" << std::endl;
156 if((result1.first && result2.second) || (result1.second && result2.first)) std::cout <<
"HLT_mu18_mu8noL1 matched" << std::endl;
162 TCanvas*
c1 =
new TCanvas();
163 hmu_offline_pt -> Draw();
164 hmu_offline_pt ->SetLineColor(1);
165 hmu_hltmatch_pt -> Draw(
"same");
166 hmu_hltmatch_pt ->SetLineColor(2);
167 hmu_l1match_pt -> Draw(
"same");
168 hmu_l1match_pt ->SetLineColor(3);
169 hmu_L2SAmatch_pt -> Draw(
"same");
170 hmu_L2SAmatch_pt ->SetLineColor(4);
171 hmu_L2CBmatch_pt -> Draw(
"same");
172 hmu_L2CBmatch_pt ->SetLineColor(5);
186 auto chain =
new TChain(
"CollectionTree");
187 for (
int i = 1;
i <
argc;
i++) {
#define RETURN_CHECK(CONTEXT, EXP)
Helper macro for checking return codes in a compact form in the code.
virtual StatusCode initialize(void) override
TChain * getFilesFromCommandLine(int argc, char *argv[])
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".
The common trigger namespace for trigger analysis tools.
virtual Bool_t matchL1(const xAOD::Muon *mu, const std::string &l1item, const double DelR=0.2) const override
ICaloAffectedTool is abstract interface for tools checking if 4 mom is in calo affected region.
Forward iterator to traverse the main components of the trigger configuration.
Temporary container used until we have I/O for AuxStoreInternal.
virtual Bool_t match(const xAOD::Muon *mu, const std::string &chain, const double mindelR=0.1) const override
StatusCode readFrom(TFile *file)
POOL::TEvent event(POOL::TEvent::kClassAccess)
virtual Bool_t matchL2SA(const xAOD::Muon *mu, const std::string &l1item, const std::string &chain, const double DelR=0.2) const override
Muon_v1 Muon
Reference the current persistent version:
value_type push_back(value_type pElem)
Add an element to the end of the collection.
int main(int argc, char *argv[])
virtual Bool_t matchDimuon(const xAOD::Muon *mu1, const xAOD::Muon *mu2, const std::string &chain, std::pair< Bool_t, Bool_t > &result1, std::pair< Bool_t, Bool_t > &result2, const Double_t &mindelR=0.1) override
StatusCode retrieve(const T *&obj)
#define ASG_CHECK_SA(SOURCE, EXP)
Helper macro for checking the status code of a call outside of an ASG tool.
Error
The different types of error that can be flagged in the L1TopoRDO.
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
MuonAuxContainer_v5 MuonAuxContainer
Definition of the current Muon auxiliary container.
size_type size() const noexcept
Returns the number of elements in the collection.
Tool for accessing xAOD files outside of Athena.
virtual Bool_t matchL2CB(const xAOD::Muon *mu, const std::string &chain, const double DelR=0.2) const override
StatusCode Init(const char *appname)
Function initialising ROOT/PyROOT for using the ATLAS EDM.