ATLAS Offline Software
Loading...
Searching...
No Matches
IDPerfMonZmumu.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2026 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef IDPERFMON_ZMUMU_H
6#define IDPERFMON_ZMUMU_H
7
8//==============================================================================
9// Include files...
10//==============================================================================
16
21
24#include "xAODEgamma/Electron.h"
27
30
31#include <map>
32#include <string>
33#include "TH1.h"
34#include "TH2.h"
35
37
38#include "GaudiKernel/ToolHandle.h"
39#include "GaudiKernel/ServiceHandle.h"
43
46
47
48
49
51
52namespace Trig{
53 class TrigDecisionTool;
54 class MatchingTool;
55}
56
57namespace TrigConf {
58 class xAODConfigTool;
59}
60
61namespace Trk{
62 class ITrackToVertexIPEstimator;
63 class IExtrapolator;
64}
65
66
67namespace InDet {
69}
70
71namespace CP { class ITrackVertexAssociationTool;}
72
74{
75 public:
76 // Constructors & destructors
77
78 IDPerfMonZmumu(const std::string& name, ISvcLocator* pSvcLocator);
79
81
82 // Overriden class functions.
83 virtual StatusCode initialize();
84 virtual StatusCode execute(const EventContext& ctx);
85 virtual StatusCode finalize();
86
87 protected:
88
89 private:
90 // Private class member functions.
91 StatusCode bookTrees ();
94 void ExtractIDHitsInformation(const xAOD::Muon* muon_pos, const xAOD::Muon* muon_neg);
95 int GetMuonQualityValue(std::string qualityname);
96 void RegisterHistograms ();
99 StatusCode FillRecParameters (const Trk::Track* track, const xAOD::TrackParticle* trackp_for_unbias, double charge,const xAOD::Vertex* vertex, const EventContext& ctx);
100 StatusCode FillRecParametersSimple (const Trk::Track* track, float charge, const xAOD::Vertex* vertex, const EventContext& ctx);
101 StatusCode FillRecParametersTP (const xAOD::TrackParticle* trackp, const xAOD::TrackParticle* trackp_for_unbias, double charge, const xAOD::Vertex* vertex, const EventContext& ctx);
102 StatusCode FillTruthParameters (const xAOD::TrackParticle* track, const EventContext& ctx);
104 StatusCode RunFourLeptonAnalysis ();
105
106 // The Z0 tagger.
109 bool m_UseTrigger{true};
111 bool m_doIPSelection{true};
113 double m_MassWindowLow{60.};
114 double m_MassWindowHigh{120.};
116 double m_SecondMuonPtCut{15.};
117 double m_OpeningAngleCut{0.2};
118 double m_Z0GapCut{5.};
119 bool m_isMC{};
120 bool m_doRefit{};
122 bool m_doIP{};
125 bool m_skipMS{};
129
130
132 ToolHandle<IegammaTrkRefitterTool> m_TrackRefitter1;
133
135 ToolHandle<IegammaTrkRefitterTool> m_TrackRefitter2;
136
138 ToolHandle<Reco::ITrackToVertex> m_trackToVertexTool;
139
140 /* /\** @brief The trigger decision tool *\/ */
141 ToolHandle<Trig::TrigDecisionTool> m_triggerDecision;
142
143
144 /* /\** @brief The trigger decision tool *\/ */
145 ToolHandle<Trig::IMatchingTool> m_triggerMatching;
146
148 ToolHandle< InDet::IInDetTrackSelectionTool > m_selTool;
149
150
152 ToolHandle< Trk::ITrackToVertexIPEstimator > m_trackToVertexIPEstimator;
153
155 SG::ReadCondHandleKey<InDet::BeamSpotData> m_beamSpotKey { this, "BeamSpotKey", "BeamSpotData", "SG key for beam spot" };
156 ToolHandle<Trk::IExtrapolator> m_extrapolator;
157
159 ToolHandle<CP::IMuonSelectionTool> m_muonSelector;
160
161 //Validation Ntuple variables
164
166 std::string m_commonTreeName; //Tree containing all track collections
167 std::string m_defaultTreeName; //Default Tracks
168 std::string m_IDTreeName; //Default ID Tracks
169 std::string m_refit1TreeName; //Refit ID Tracks
170 std::string m_refit2TreeName; //Refit ID Tracks
171 std::string m_truthTreeName; //Truth Tracks
172 std::string m_combTreeName; //Combined Staco
173 std::string m_MSTreeName; //MS tracks
174 std::string m_FourMuTreeName; //Four lepton tree
175
176
177
180
184 std::string m_IDTreeFolder;
187 std::string m_truthTreeFolder;
188 std::string m_combTreeFolder;
189 std::string m_MSTreeFolder;
191
195 TTree* m_IDTree;
200 TTree* m_MSTree;
202
203
204
205
207 bool m_doDebug{};
208
209 ToolHandle< CP::ITrackVertexAssociationTool > m_Trk2VtxAssociationTool;
210
211 /* vertex */
212 SG::ReadHandleKey<xAOD::VertexContainer> m_vertexKey { this, "VertexContainer", "PrimaryVertices", "primary vertex container" };
213
215 SG::ReadHandleKey<xAOD::TrackParticleContainer> m_trackContainerName{this, "trackContainerName", "InDetTrackParticles"};
216
217
218 std::string m_truthName;
220 std::string m_truthLinkVecName;
221
222 // cut flow histogram
223 TH1F* m_h_cutflow{};
224
225 unsigned int m_runNumber{};
226 unsigned int m_evtNumber{};
227 unsigned int m_lumi_block{};
228 unsigned int m_event_mu{};
231 std::string m_triggerName;
232 unsigned int m_nVertex{};
233 float m_beamposX{};
234 float m_beamposY{};
235
255
268
276 double m_negative_d0{};
288
301
302 // electrons in four leptons analysis
315
328
341
354
355 //
356 double m_4mu_minv{};
357
358 double m_pv_x{};
359 double m_pv_y{};
360 double m_pv_z{};
361 unsigned int m_nTrkInVtx{};
362
363 double m_met{};
364 double m_metphi{};
365
366 // common tree
367 std::vector<float> m_IDTrack_pt;
368 std::vector<float> m_CBTrack_pt;
369 std::vector<float> m_Refit1_pt;
370 std::vector<float> m_Refit2_pt;
371 std::vector<float> m_Truth_pt;
372
373 std::vector<float> m_IDTrack_eta;
374 std::vector<float> m_CBTrack_eta;
375 std::vector<float> m_Refit1_eta;
376 std::vector<float> m_Refit2_eta;
377 std::vector<float> m_Truth_eta;
378
379 std::vector<float> m_IDTrack_phi;
380 std::vector<float> m_CBTrack_phi;
381 std::vector<float> m_Refit1_phi;
382 std::vector<float> m_Refit2_phi;
383 std::vector<float> m_Truth_phi;
384
385 std::vector<float> m_IDTrack_d0;
386 std::vector<float> m_CBTrack_d0;
387 std::vector<float> m_Refit1_d0;
388 std::vector<float> m_Refit2_d0;
389 std::vector<float> m_Truth_d0;
390
391 std::vector<float> m_IDTrack_z0;
392 std::vector<float> m_CBTrack_z0;
393 std::vector<float> m_Refit1_z0;
394 std::vector<float> m_Refit2_z0;
395 std::vector<float> m_Truth_z0;
396
397 std::vector<float> m_IDTrack_qoverp;
398 std::vector<float> m_CBTrack_qoverp;
399 std::vector<float> m_Refit1_qoverp;
400 std::vector<float> m_Refit2_qoverp;
401 std::vector<float> m_Truth_qoverp;
402
403 std::vector<int> m_Truth_parent;
404
405 std::vector<float> m_IDTrack_sigma_pt;
406 std::vector<float> m_CBTrack_sigma_pt;
407 std::vector<float> m_Refit1_sigma_pt;
408 std::vector<float> m_Refit2_sigma_pt;
409
410 std::vector<float> m_IDTrack_sigma_d0;
411 std::vector<float> m_CBTrack_sigma_d0;
412 std::vector<float> m_Refit1_sigma_d0;
413 std::vector<float> m_Refit2_sigma_d0;
414
415 std::vector<float> m_IDTrack_sigma_z0;
416 std::vector<float> m_CBTrack_sigma_z0;
417 std::vector<float> m_Refit1_sigma_z0;
418 std::vector<float> m_Refit2_sigma_z0;
419
420 std::vector<float> m_IDTrack_sigma_qoverp;
421 std::vector<float> m_CBTrack_sigma_qoverp;
422 std::vector<float> m_Refit1_sigma_qoverp;
423 std::vector<float> m_Refit2_sigma_qoverp;
424
425 std::vector<int> m_nBLhits;
426 std::vector<int> m_nPIXhits;
427 std::vector<int> m_nSCThits;
428 std::vector<int> m_nTRThits;
429
430 //
433 std::string m_MuonQualityName;
434
435 // needed to handle EventInfo now.. 2/8/21 (prob. rel.22)
436 SG::ReadHandleKey<xAOD::EventInfo> m_EventInfoKey{this, "EventInfoKey", "EventInfo"};
437};
438//==============================================================================
439
440#endif
double charge(const T &p)
Definition AtlasPID.h:1003
AthAlgorithm(const std::string &name, ISvcLocator *pSvcLocator)
Constructor.
double m_el_negative1_z0_err
ToolHandle< Trig::TrigDecisionTool > m_triggerDecision
std::vector< float > m_Refit1_qoverp
StatusCode CheckTriggerStatusAndPrescale()
virtual StatusCode finalize()
FourMuonEvent m_4mu
StatusCode RunFourLeptonAnalysis()
unsigned int m_event_mu
std::vector< float > m_Refit1_sigma_qoverp
double m_el_positive1_d0_err
double m_el_positive2_z0_err
double m_positive_d0_PVerr
std::string m_truthTreeFolder
double m_negative_2_z0_err
double m_el_negative2_z0_PV
unsigned int m_nVertex
double m_positive_sigma_qoverp
double m_negative_sigma_qoverp
const xAOD::Vertex * GetDiMuonVertex(const xAOD::TrackParticle *, const xAOD::TrackParticle *)
double m_positive_2_d0_err
void ResetCommonNtupleVectors()
std::vector< float > m_Refit2_sigma_d0
double m_el_negative1_z0_PVerr
double m_negative_2_z0_PV
std::vector< float > m_CBTrack_sigma_z0
TH1F * m_h_cutflow
link vector to map HepMC onto xAOD truth
ToolHandle< Reco::ITrackToVertex > m_trackToVertexTool
tool to extrapolate tracks to BL
std::vector< float > m_Refit1_sigma_d0
std::vector< float > m_CBTrack_d0
std::string m_refit1TreeFolder
std::string m_ValidationTreeDescription
< validation tree description - second argument in TTree
std::vector< float > m_Refit2_qoverp
double m_el_positive2_z0_PVerr
std::string m_outputTracksName
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackContainerName
IDTtacks.
std::vector< float > m_Refit1_eta
ToolHandle< Trig::IMatchingTool > m_triggerMatching
double m_el_positive1_z0_PVerr
std::string m_truthName
std::vector< float > m_CBTrack_sigma_d0
unsigned int m_lumi_block
double m_el_negative1_d0_PV
std::vector< float > m_IDTrack_d0
std::string m_MSTreeFolder
double m_positive_2_d0_PVerr
std::string m_trackParticleName
Track(Particle)TruthCollection input name.
std::string m_combTreeFolder
ToolHandle< IegammaTrkRefitterTool > m_TrackRefitter1
The track refitter.
StatusCode FillRecParametersSimple(const Trk::Track *track, float charge, const xAOD::Vertex *vertex, const EventContext &ctx)
double m_negative_2_d0_err
double m_positive_z0_PVerr
std::vector< float > m_Truth_phi
StatusCode FillRecParametersTP(const xAOD::TrackParticle *trackp, const xAOD::TrackParticle *trackp_for_unbias, double charge, const xAOD::Vertex *vertex, const EventContext &ctx)
std::vector< float > m_Truth_pt
ToolHandle< Trk::ITrackToVertexIPEstimator > m_trackToVertexIPEstimator
Needed for IP resolution studies.
std::vector< float > m_Refit2_d0
double m_el_negative2_z0_PVerr
std::string m_MuonQualityName
double m_el_positive1_z0_err
ToolHandle< Trk::IExtrapolator > m_extrapolator
double m_negative_2_d0_PVerr
bool m_validationMode
< boolean to switch to validation mode
std::vector< float > m_Refit1_phi
std::vector< float > m_Refit2_eta
double m_negative_2_z0_PVerr
std::string m_FourMuTreeFolder
Root Validation Tree.
double m_negative_2_d0_PV
std::vector< float > m_IDTrack_pt
std::vector< float > m_CBTrack_sigma_pt
std::vector< float > m_Truth_z0
double m_negative_z0_PVerr
ToolHandle< IegammaTrkRefitterTool > m_TrackRefitter2
The track refitter.
std::vector< float > m_IDTrack_sigma_d0
std::vector< float > m_Refit2_pt
unsigned int m_evtNumber
double m_positive_sigma_pt
unsigned int m_runNumber
std::string m_truthTreeName
StatusCode FillTruthParameters(const xAOD::TrackParticle *track, const EventContext &ctx)
std::string m_refit1TreeName
double m_el_negative2_z0_err
std::vector< float > m_CBTrack_z0
double m_el_positive2_d0_PV
std::string m_FourMuTreeName
std::vector< float > m_CBTrack_pt
std::vector< float > m_Refit1_sigma_pt
std::string m_triggerName
std::string m_refit2TreeName
virtual StatusCode initialize()
std::vector< float > m_Refit1_d0
std::vector< float > m_Truth_eta
double m_el_negative1_d0_PVerr
ToolHandle< CP::ITrackVertexAssociationTool > m_Trk2VtxAssociationTool
std::string m_defaultTreeName
double m_negative_d0_PVerr
double m_positive_2_z0_err
std::vector< float > m_CBTrack_sigma_qoverp
std::vector< int > m_nSCThits
std::vector< int > m_nTRThits
std::vector< float > m_IDTrack_qoverp
std::vector< float > m_Refit2_z0
std::string m_truthLinkVecName
TrackParticle input name.
std::vector< float > m_Truth_d0
std::vector< int > m_nBLhits
std::vector< float > m_Refit1_pt
double m_LeadingMuonPtCut
std::string m_defaultTreeFolder
std::string m_IDTreeFolder
double m_el_positive2_d0_err
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
used for truth parameters
std::vector< float > m_IDTrack_phi
virtual StatusCode execute(const EventContext &ctx)
Execute method.
double m_positive_2_z0_PVerr
std::vector< float > m_Refit2_sigma_pt
double m_el_negative2_d0_PV
std::string m_sTriggerChainName
std::string m_MSTreeName
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexKey
std::string m_commonTreeFolder
std::vector< float > m_IDTrack_sigma_z0
double m_negative_sigma_pt
double m_positive_2_z0_PV
std::string m_combTreeName
double m_el_positive2_z0_PV
void ExtractIDHitsInformation(const xAOD::Muon *muon_pos, const xAOD::Muon *muon_neg)
const xAOD::TruthParticle * getTruthParticle(const xAOD::IParticle &p)
ToolHandle< CP::IMuonSelectionTool > m_muonSelector
used to pass a custom muon selector
std::vector< float > m_Refit2_sigma_qoverp
double m_positive_2_d0_PV
std::string m_commonTreeName
std::vector< float > m_Refit1_z0
std::vector< float > m_Truth_qoverp
double m_el_psoitive2_d0_PVerr
std::vector< float > m_IDTrack_z0
StatusCode FillRecParameters(const Trk::Track *track, const xAOD::TrackParticle *trackp_for_unbias, double charge, const xAOD::Vertex *vertex, const EventContext &ctx)
std::vector< float > m_Refit2_phi
double m_el_negative2_d0_err
std::vector< int > m_nPIXhits
std::vector< float > m_IDTrack_sigma_pt
double m_el_positive1_d0_PV
unsigned int m_nTrkInVtx
double m_el_negative1_z0_PV
StatusCode bookTrees()
ZmumuEvent m_xZmm
int GetMuonQualityValue(std::string qualityname)
double m_el_positive1_z0_PV
std::vector< float > m_CBTrack_eta
std::string m_refit2TreeFolder
std::vector< int > m_Truth_parent
std::vector< float > m_IDTrack_sigma_qoverp
std::string m_IDTreeName
double m_el_psoitive1_d0_PVerr
SG::ReadHandleKey< xAOD::EventInfo > m_EventInfoKey
ToolHandle< InDet::IInDetTrackSelectionTool > m_selTool
The track selection Tool.
std::vector< float > m_Refit1_sigma_z0
std::vector< float > m_CBTrack_qoverp
double m_el_negative1_d0_err
std::vector< float > m_Refit2_sigma_z0
double m_el_negative2_d0_PVerr
std::vector< float > m_IDTrack_eta
std::vector< float > m_CBTrack_phi
IDPerfMonZmumu(const std::string &name, ISvcLocator *pSvcLocator)
needed for IP resolution studies
Interface for track selection tool.
Property holding a SG store/key/clid from which a ReadHandle is made.
Trigger configuration metadata tool for xAOD analysis.
Class providing the definition of the 4-vector interface.
Select isolated Photons, Electrons and Muons.
Primary Vertex Finder.
Forward iterator to traverse the main components of the trigger configuration.
The common trigger namespace for trigger analysis tools.
Ensure that the ATLAS eigen extensions are properly loaded.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
Vertex_v1 Vertex
Define the latest version of the vertex class.
TruthParticle_v1 TruthParticle
Typedef to implementation.
Muon_v1 Muon
Reference the current persistent version: