ATLAS Offline Software
Loading...
Searching...
No Matches
TriggerMuonValidationPlots.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7#include <utility>
8
10TriggerMuonValidationPlots::TriggerMuonValidationPlots(PlotBase* pParent, const std::string& sDir, std::vector<unsigned int> authors,
11 bool /*isData*/, bool doTrigMuonL1Validation, bool doTrigMuonL2Validation,
12 bool doTrigMuonEFValidation, std::vector<std::vector<std::string>> ChainSeed,
13 std::vector<std::string> L1MuonItems) :
14 PlotBase(pParent, sDir),
15 m_selectedAuthors(std::move(authors)),
16 m_doTrigMuonL1Validation(doTrigMuonL1Validation),
17 m_doTrigMuonL2Validation(doTrigMuonL2Validation),
18 m_doTrigMuonEFValidation(doTrigMuonEFValidation),
19 m_ChainSeed(std::move(ChainSeed)),
20 m_L1MuonItems(std::move(L1MuonItems)) {
21 for (unsigned int i = 0; i < m_ChainSeed.size(); i++) {
22 m_chains.push_back(m_ChainSeed[i][0]);
23 m_seeds.push_back(m_ChainSeed[i][1]);
24 }
25
26 if (m_doTrigMuonL1Validation) m_oL1TriggerMuonPlots = std::make_unique<L1TriggerMuonPlots>(this, "trigger/L1");
28 m_oL2TriggerMuonPlots.push_back(std::make_unique<HLTriggerMuonPlots>(this, "trigger/L2/StandAlone"));
29 m_oL2TriggerMuonPlots.push_back(std::make_unique<HLTriggerMuonPlots>(this, "trigger/L2/Combined"));
31 std::make_unique<ResoTriggerMuonPlots>(this, "trigger/L2/StandAlone/Resolution/BARREL/", ""));
32 m_oL2TriggerMuonBarrelResolutionPlots.push_back(std::make_unique<ResoTriggerMuonPlots>(this, "trigger/L2/Combined/Resolution/BARREL/", ""));
34 std::make_unique<ResoTriggerMuonPlots>(this, "trigger/L2/StandAlone/Resolution/ENDCAPS/", ""));
36 std::make_unique<ResoTriggerMuonPlots>(this, "trigger/L2/Combined/Resolution/ENDCAPS/", ""));
38 std::make_unique<ResoTriggerMuonPlots>(this, "trigger/L2/StandAlone/Resolution/WHOLE_DETECT/", ""));
39 m_oL2TriggerMuonResolutionPlots.push_back(std::make_unique<ResoTriggerMuonPlots>(this, "trigger/L2/Combined/Resolution/WHOLE_DETECT/", ""));
40 }
41
42 // define a histogram class for each of the selected muon authors
43 for (unsigned int i = 0; i < m_selectedAuthors.size(); i++) {
44 std::string sAuthor = Muon::EnumDefs::toString((xAOD::Muon::Author)m_selectedAuthors[i]);
45 if (m_doTrigMuonEFValidation) m_oEFTriggerMuonPlots.push_back(std::make_unique<HLTriggerMuonPlots>(this, "trigger/EF/" + sAuthor));
48 std::make_unique<ResoTriggerMuonPlots>(this, "trigger/EF/" + sAuthor + "/Resolution/BARREL/", ""));
51 std::make_unique<ResoTriggerMuonPlots>(this, "trigger/EF/" + sAuthor + "/Resolution/ENDCAPS/", ""));
54 std::make_unique<ResoTriggerMuonPlots>(this, "trigger/EF/" + sAuthor + "/Resolution/WHOLE_DETECT/", ""));
55 }
56
57 for (unsigned int i = 0; i < m_L1MuonItems.size(); i++) {
60 std::make_unique<TriggerEfficiencyPlots>(this, "trigger/" + m_L1MuonItems[i] + "_Efficiency/BARREL/"));
63 std::make_unique<TriggerEfficiencyPlots>(this, "trigger/" + m_L1MuonItems[i] + "_Efficiency/ENDCAPS/"));
66 std::make_unique<TriggerEfficiencyPlots>(this, "trigger/" + m_L1MuonItems[i] + "_Efficiency/WHOLE_DETECT/"));
67 }
68 for (unsigned int i = 0; i < m_chains.size(); i++) {
71 std::make_unique<TriggerEfficiencyPlots>(this, "trigger/" + m_chains[i] + "_Efficiency/BARREL/"));
74 std::make_unique<TriggerEfficiencyPlots>(this, "trigger/" + m_chains[i] + "_Efficiency/ENDCAPS/"));
77 std::make_unique<TriggerEfficiencyPlots>(this, "trigger/" + m_chains[i] + "_Efficiency/WHOLE_DETECT/"));
78 }
79 for (unsigned int i = 0; i < m_chains.size(); i++) {
82 std::make_unique<TriggerEfficiencyPlots>(this, "trigger/" + m_chains[i] + "_wrt_" + m_seeds[i] + "_Efficiency/BARREL/"));
85 std::make_unique<TriggerEfficiencyPlots>(this, "trigger/" + m_chains[i] + "_wrt_" + m_seeds[i] + "_Efficiency/ENDCAPS/"));
88 std::make_unique<TriggerEfficiencyPlots>(this, "trigger/" + m_chains[i] + "_wrt_" + m_seeds[i] + "_Efficiency/WHOLE_DETECT/"));
89 }
90 PlateauTreshold = 0.;
91}
92
94
96
98
100
102 for (unsigned int i = 0; i < m_selectedAuthors.size(); i++) {
103 if (Trigmu.isAuthor((xAOD::Muon::Author)m_selectedAuthors[i])) {
104 // if (Trigmu.isAuthor( (xAOD::Muon::Author)m_selectedAuthors[i] ) || m_selectedAuthors[i]==xAOD::Muon::NumberOfMuonAuthors) {
105 m_oEFTriggerMuonPlots[i]->fill(Trigmu);
106 }
107 }
108}
109
111 for (unsigned int i = 0; i < m_selectedAuthors.size(); i++) {
112 if (Trigmu.isAuthor((xAOD::Muon::Author)m_selectedAuthors[i])) {
113 // if (Trigmu.isAuthor( (xAOD::Muon::Author)m_selectedAuthors[i] ) || m_selectedAuthors[i]==xAOD::Muon::NumberOfMuonAuthors) {
114 m_oEFTriggerMuonResolutionPlots[i]->fill(Trigmu, Recomu);
115 if (std::abs(Recomu.eta()) < 1.05) m_oEFTriggerMuonBarrelResolutionPlots[i]->fill(Trigmu, Recomu);
116 if (std::abs(Recomu.eta()) > 1.05) m_oEFTriggerMuonEndcapsResolutionPlots[i]->fill(Trigmu, Recomu);
117 }
118 }
119}
120
122 m_oL2TriggerMuonResolutionPlots[0]->fill(L2SAmu, Recomu);
123 if (std::abs(Recomu.eta()) < 1.05) m_oL2TriggerMuonBarrelResolutionPlots[0]->fill(L2SAmu, Recomu);
124 if (std::abs(Recomu.eta()) > 1.05) m_oL2TriggerMuonEndcapsResolutionPlots[0]->fill(L2SAmu, Recomu);
125}
126
128 m_oL2TriggerMuonResolutionPlots[1]->fill(L2CBmu, Recomu);
129 if (std::abs(Recomu.eta()) < 1.05) m_oL2TriggerMuonBarrelResolutionPlots[1]->fill(L2CBmu, Recomu);
130 if (std::abs(Recomu.eta()) > 1.05) m_oL2TriggerMuonEndcapsResolutionPlots[1]->fill(L2CBmu, Recomu);
131}
132
134
135void TriggerMuonValidationPlots::fill(const xAOD::Muon& Trigmu, const xAOD::Muon& Recomu) { fillTriggerMuonPlots(Trigmu, Recomu); }
136
138 fillTriggerMuonPlots(L2SAmu, Recomu);
139}
140
142 fillTriggerMuonPlots(L2CBmu, Recomu);
143}
144
146
148
150
151void TriggerMuonValidationPlots::fillNumEff(const xAOD::Muon& mu, const std::string& selectedChain) {
152 float PlateauTreshold = findTrigTreshold(selectedChain);
153 PlateauTreshold = PlateauTreshold * 1000. * 1.05;
154 for (unsigned int i = 0; i < m_chains.size(); i++) {
155 if (m_chains[i] == selectedChain) {
157 if (((mu.eta()) > -1.05) && ((mu.eta()) < 1.05)) m_oEFTriggerChainBarrelEfficiencyPlots[i]->fillNumerator(mu, PlateauTreshold);
158 if (((mu.eta()) < -1.05) || ((mu.eta()) > 1.05)) m_oEFTriggerChainEndcapsEfficiencyPlots[i]->fillNumerator(mu, PlateauTreshold);
159 }
160 }
161}
162
163void TriggerMuonValidationPlots::fillDenEff(const xAOD::Muon& mu, const std::string& selectedChain) {
164 float PlateauTreshold = findTrigTreshold(selectedChain);
165 PlateauTreshold = PlateauTreshold * 1000. * 1.05;
166 for (unsigned int i = 0; i < m_chains.size(); i++) {
167 if (m_chains[i] == selectedChain) {
168 m_oEFTriggerChainEfficiencyPlots[i]->fillDenominator(mu, PlateauTreshold);
169 if (((mu.eta()) > -1.05) && ((mu.eta()) < 1.05))
171 if (((mu.eta()) < -1.05) || ((mu.eta()) > 1.05))
173 }
174 }
175}
176
177void TriggerMuonValidationPlots::fillFeatPlots(const xAOD::Muon& mu, const std::string& selectedChain) {
178 float PlateauTreshold = findTrigTreshold(selectedChain);
179 PlateauTreshold = PlateauTreshold * 1000. * 1.05;
180 for (unsigned int i = 0; i < m_chains.size(); i++) {
181 if (m_chains[i] == selectedChain) {
183 if (((mu.eta()) > -1.05) && ((mu.eta()) < 1.05)) m_oEFTriggerChainBarrelEfficiencyPlots[i]->fillFeatures(mu, PlateauTreshold);
184 if (((mu.eta()) < -1.05) || ((mu.eta()) > 1.05)) m_oEFTriggerChainEndcapsEfficiencyPlots[i]->fillFeatures(mu, PlateauTreshold);
185 }
186 }
187}
188
189void TriggerMuonValidationPlots::fillNumL1Eff(const xAOD::Muon& mu, const std::string& selectedL1MuonItem) {
190 float PlateauTreshold = findTrigTreshold(selectedL1MuonItem);
191 PlateauTreshold = PlateauTreshold * 1000. * 1.05;
192 for (unsigned int i = 0; i < m_L1MuonItems.size(); i++) {
193 if (m_L1MuonItems[i] == selectedL1MuonItem) {
195 if (((mu.eta()) > -1.05) && ((mu.eta()) < 1.05)) m_oL1TriggerChainBarrelEfficiencyPlots[i]->fillNumerator(mu, PlateauTreshold);
196 if (((mu.eta()) < -1.05) || ((mu.eta()) > 1.05)) m_oL1TriggerChainEndcapsEfficiencyPlots[i]->fillNumerator(mu, PlateauTreshold);
197 }
198 }
199}
200
201void TriggerMuonValidationPlots::fillDenL1Eff(const xAOD::Muon& mu, const std::string& selectedL1MuonItem) {
202 float PlateauTreshold = findTrigTreshold(selectedL1MuonItem);
203 PlateauTreshold = PlateauTreshold * 1000. * 1.05;
204 for (unsigned int i = 0; i < m_L1MuonItems.size(); i++) {
205 if (m_L1MuonItems[i] == selectedL1MuonItem) {
206 m_oL1TriggerChainEfficiencyPlots[i]->fillDenominator(mu, PlateauTreshold);
207 if (((mu.eta()) > -1.05) && ((mu.eta()) < 1.05))
209 if (((mu.eta()) < -1.05) || ((mu.eta()) > 1.05))
211 }
212 }
213}
214void TriggerMuonValidationPlots::fillFeatPlots(const xAOD::MuonRoI& TrigL1mu, const std::string& selectedL1MuonItem) {
215 float PlateauTreshold = findTrigTreshold(selectedL1MuonItem);
216 PlateauTreshold = PlateauTreshold * 1000. * 1.05;
219 ROIinMuons->setStore(ROIinMuonsAux);
220 xAOD::Muon* myROI = new xAOD::Muon();
221 ROIinMuons->push_back(myROI);
222 myROI->setP4(TrigL1mu.thrValue(), TrigL1mu.eta(), TrigL1mu.phi());
223
224 for (unsigned int i = 0; i < m_L1MuonItems.size(); i++) {
225 if (m_L1MuonItems[i] == selectedL1MuonItem) {
226 m_oL1TriggerChainEfficiencyPlots[i]->fillFeatures(*myROI, PlateauTreshold);
227 if (((TrigL1mu.eta()) > -1.05) && ((TrigL1mu.eta()) < 1.05))
229 if (((TrigL1mu.eta()) < -1.05) || ((TrigL1mu.eta()) > 1.05))
231 }
232 }
233 delete ROIinMuons;
234 delete ROIinMuonsAux;
235}
236
237void TriggerMuonValidationPlots::fillDenRELEff(const xAOD::Muon& mu, const std::string& selectedChain) {
238 float PlateauTreshold = findTrigTreshold(selectedChain);
239 PlateauTreshold = PlateauTreshold * 1000. * 1.05;
240 for (unsigned int i = 0; i < m_chains.size(); i++) {
241 if (m_chains[i] == selectedChain) {
243 if (((mu.eta()) > -1.05) && ((mu.eta()) < 1.05))
245 if (((mu.eta()) < -1.05) || ((mu.eta()) > 1.05))
247 }
248 }
249}
250
251void TriggerMuonValidationPlots::fillNumRELEff(const xAOD::Muon& mu, const std::string& selectedChain) {
252 float PlateauTreshold = findTrigTreshold(selectedChain);
253 PlateauTreshold = PlateauTreshold * 1000. * 1.05;
254 for (unsigned int i = 0; i < m_chains.size(); i++) {
255 if (m_chains[i] == selectedChain) {
257 if (((mu.eta()) > -1.05) && ((mu.eta()) < 1.05))
259 if (((mu.eta()) < -1.05) || ((mu.eta()) > 1.05))
261 }
262 }
263}
264
266 float PlateauTreshold;
267 std::string str(chain);
268 TString temp;
269 if (str.find("HLT_") != std::string::npos) {
270 for (unsigned int l = 0; l < str.size(); l++) {
271 if (isdigit(str[l])) {
272 for (unsigned int a = l; a < str.size(); a++) {
273 // if (str[a]=='_') break;
274 if ((isdigit(str[a])) == 0) break;
275 temp += str[a];
276 }
277 break;
278 }
279 }
280 }
281 if (str.find("L1_MU") != std::string::npos) {
282 for (unsigned int l = 0; l < str.size(); l++) {
283 if ((str[l]) == 'U') {
284 for (unsigned int a = l + 1; a < str.size(); a++) {
285 // if (str[a]=='_') break;
286 temp += str[a];
287 }
288 break;
289 }
290 }
291 }
292 PlateauTreshold = temp.Atof();
293 return PlateauTreshold;
294}
static Double_t a
value_type push_back(value_type pElem)
Add an element to the end of the collection.
PlotBase(PlotBase *parent, const std::string &sDir)
Definition PlotBase.cxx:29
void fillNumEff(const xAOD::Muon &Trigmu, const std::string &selectedChain)
std::vector< std::unique_ptr< TriggerEfficiencyPlots > > m_oL1TriggerChainBarrelEfficiencyPlots
std::vector< std::unique_ptr< ResoTriggerMuonPlots > > m_oL2TriggerMuonBarrelResolutionPlots
std::vector< std::unique_ptr< ResoTriggerMuonPlots > > m_oEFTriggerMuonBarrelResolutionPlots
std::vector< std::unique_ptr< ResoTriggerMuonPlots > > m_oEFTriggerMuonResolutionPlots
std::vector< std::unique_ptr< ResoTriggerMuonPlots > > m_oL2TriggerMuonEndcapsResolutionPlots
std::vector< std::unique_ptr< HLTriggerMuonPlots > > m_oL2TriggerMuonPlots
void fillDenRELEff(const xAOD::Muon &Trigmu, const std::string &selectedChain)
std::vector< std::unique_ptr< TriggerEfficiencyPlots > > m_oEFTriggerChainRELEfficiencyPlots
void fillNumL1Eff(const xAOD::Muon &Trigmu, const std::string &selectedChain)
void fillTriggerMuonPlots(const xAOD::Muon &Trigmu)
virtual ~TriggerMuonValidationPlots()
std::vector< std::unique_ptr< HLTriggerMuonPlots > > m_oEFTriggerMuonPlots
std::vector< std::string > m_seeds
std::vector< std::unique_ptr< TriggerEfficiencyPlots > > m_oEFTriggerChainBarrelEfficiencyPlots
void fillDenEff(const xAOD::Muon &Trigmu, const std::string &selectedChain)
std::vector< std::unique_ptr< TriggerEfficiencyPlots > > m_oEFTriggerChainEfficiencyPlots
TriggerMuonValidationPlots(PlotBase *pParent, const std::string &sDir, std::vector< unsigned int > authors, bool isData, bool doTrigMuonL1Validation, bool doTrigMuonL2Validation, bool doTrigMuonEFValidation, std::vector< std::vector< std::string > > ChainSeed, std::vector< std::string > L1MuonItems)
void fillFeatPlots(const xAOD::Muon &Trigmu, const std::string &selectedChain)
std::vector< unsigned int > m_selectedAuthors
std::vector< std::unique_ptr< TriggerEfficiencyPlots > > m_oEFTriggerChainEndcapsEfficiencyPlots
std::vector< std::string > m_chains
std::vector< std::vector< std::string > > m_ChainSeed
std::vector< std::unique_ptr< TriggerEfficiencyPlots > > m_oL1TriggerChainEndcapsEfficiencyPlots
void fillDenL1Eff(const xAOD::Muon &Trigmu, const std::string &selectedChain)
std::vector< std::unique_ptr< TriggerEfficiencyPlots > > m_oEFTriggerChainEndcapsRELEfficiencyPlots
float findTrigTreshold(const TString &chain)
std::vector< std::unique_ptr< ResoTriggerMuonPlots > > m_oEFTriggerMuonEndcapsResolutionPlots
std::vector< std::string > m_L1MuonItems
void fill(const xAOD::MuonRoI &TrigL1mu)
std::vector< std::unique_ptr< TriggerEfficiencyPlots > > m_oL1TriggerChainEfficiencyPlots
std::unique_ptr< L1TriggerMuonPlots > m_oL1TriggerMuonPlots
std::vector< std::unique_ptr< ResoTriggerMuonPlots > > m_oL2TriggerMuonResolutionPlots
std::vector< std::unique_ptr< TriggerEfficiencyPlots > > m_oEFTriggerChainBarrelRELEfficiencyPlots
void fillNumRELEff(const xAOD::Muon &Trigmu, const std::string &selectedChain)
float eta() const
The pseudorapidity ( ) of the muon candidate.
float thrValue() const
The highest threshold value (in MeV) passed by the muon candidate.
float phi() const
The azimuthal angle ( ) of the muon candidate.
virtual double eta() const
The pseudorapidity ( ) of the particle.
bool isAuthor(const Author author) const
Returns 'true' if 'author' is the an author of this muon.
Definition Muon_v1.cxx:97
void setP4(double pt, double eta, double phi)
Set method for IParticle values.
Definition Muon_v1.cxx:58
static const char * toString(Muon::EnumDefs::DetRegion reg)
STL namespace.
L2CombinedMuon_v1 L2CombinedMuon
Define the latest version of the muon CB class.
Muon_v1 Muon
Reference the current persistent version:
MuonAuxContainer_v5 MuonAuxContainer
Definition of the current Muon auxiliary container.
L2StandAloneMuon_v2 L2StandAloneMuon
Define the latest version of the muon SA class.
MuonContainer_v1 MuonContainer
Definition of the current "Muon container version".
MuonRoI_v1 MuonRoI
Definition MuonRoI.h:15