ATLAS Offline Software
IDPerfMonZmumu.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 //==================================================================================
6 // Include files...
7 //==================================================================================
8 // This files header
10 // Standard headers
11 #include "TTree.h"
12 #include "TLorentzVector.h"
13 
17 
20 
21 // ATLAS headers
22 #include "GaudiKernel/IInterface.h"
23 #include "StoreGate/StoreGateSvc.h"
24 
27 
30 
35 
38 
43 
44 //==================================================================================
45 // Public Methods
46 //==================================================================================
48  ISvcLocator* pSvcLocator):
49  AthAlgorithm(name, pSvcLocator),
50  m_isMC(false),
51  m_doRefit(false),
52  m_TrackRefitter1(""),
53  m_TrackRefitter2(""),
54  m_trackToVertexTool("Reco::TrackToVertex"),
55  m_triggerDecision("Trig::TrigDecisionTool/TrigDecisionTool"),
56  m_triggerMatching("Trig::MatchingTool/MatchingTool"),
57  m_selTool( "InDet::InDetTrackSelectionTool/TrackSelectionTool"),
58  m_trackToVertexIPEstimator("Trk::TrackToVertexIPEstimator"),
59  m_extrapolator("Trk::Extrapolator/AtlasExtrapolator"),
60  m_muonSelector("CP::MuonSelectionTool/MuonSelectionTool"),
61  m_validationMode(true),
62 
63  m_commonTreeName ("commonTree"),
64  m_defaultTreeName("Default_Particle"),
65  m_IDTreeName ("ID_InDetTrackParticle"),
66  m_refit1TreeName ("Refit1_SiAndTRT"),
67  m_refit2TreeName ("Refit2_SiOnly"),
68  m_truthTreeName ("TruthParams"),
69  m_combTreeName ("CombinedTrackParticle"),
70  m_MSTreeName ("MS_TrackParticle"),
71  m_FourMuTreeName ("FourMu"),
72 
73  m_ValidationTreeDescription("Small Tree for Zmumu fits"),
74 
75  m_commonTreeFolder ("/ZmumuValidation/common"),
76  m_defaultTreeFolder("/ZmumuValidation/default"),
77  m_IDTreeFolder ("/ZmumuValidation/ID"),
78  m_refit1TreeFolder ("/ZmumuValidation/refit1"),
79  m_refit2TreeFolder ("/ZmumuValidation/refit2"),
80  m_truthTreeFolder ("/ZmumuValidation/truth"),
81  m_combTreeFolder ("/ZmumuValidation/comb"),
82  m_MSTreeFolder ("/ZmumuValidation/ms"),
83  m_FourMuTreeFolder ("/ZmumuValidation/fourmu"),
84 
85  m_commonTree (nullptr),
86  m_defaultTree(nullptr),
87  m_IDTree(nullptr),
88  m_refit1Tree(nullptr),
89  m_refit2Tree(nullptr),
90  m_truthTree(nullptr),
91  m_combTree(nullptr),
92  m_MSTree(nullptr),
93  m_FourMuTree(nullptr),
94  m_doRemoval(true),
95  m_doDebug(false),
96  m_Trk2VtxAssociationTool("CP::TrackVertexAssociationTool", this)
97 {
98  // Properties that are set from the python scripts.
99 
100  declareProperty("UseTrigger" , m_UseTrigger = true);
101  declareProperty("doIsoSelection", m_doIsoSelection = true );
102  declareProperty("doIPSelection", m_doIPSelection = true );
103  declareProperty("doMCPSelection", m_doMCPSelection = true );
104  declareProperty("isMC", m_isMC = false);
105  declareProperty("doRefit", m_doRefit = false);
106  declareProperty("doIPextrToPV", m_doIP = false);
107  declareProperty("Extrapolator", m_extrapolator );
108  declareProperty("MassWindowLow", m_MassWindowLow = 60.0, "Lower cut in mu+mu- invariant mass" );
109  declareProperty("MassWindowHigh", m_MassWindowHigh = 120.0, "Upper cut in mu+mu- invariant mass" );
110  declareProperty("OpeningAngle", m_OpeningAngleCut = 0.2, "Opening angle between the two muons (in radians)");
111  declareProperty("OutputTracksName", m_outputTracksName = "ZmumuTracks");
112  declareProperty("PtLeadingMuon", m_LeadingMuonPtCut = 20., "Pt cut on the leading muon");
113  declareProperty("PtSecondMuon", m_SecondMuonPtCut = 15., "Pt cut on the second muon");
114  declareProperty("ReFitterTool1", m_TrackRefitter1, "ToolHandle for track fitter implementation");
115  declareProperty("ReFitterTool2", m_TrackRefitter2, "ToolHandle for track fitter implementation");
116  declareProperty("TrackToVertexTool", m_trackToVertexTool);
117  declareProperty("TrackTruthName", m_truthName="TrackTruthCollection");
118  declareProperty("TrackParticleName", m_trackParticleName="CombinedTrackParticle");
119  declareProperty("triggerChainName", m_sTriggerChainName);
120  declareProperty("ValidationMode", m_validationMode);
121  declareProperty("xAODTruthLinkVector", m_truthLinkVecName="xAODTruthLinks");
122  declareProperty("Z0Gap", m_Z0GapCut = 5.0, "maximum gap between the z0 of both muons (in mm)");
123  declareProperty("TrackSelectionTool", m_selTool );
124  declareProperty("UseTrackSelectionTool", m_useTrackSelectionTool = false);
125  declareProperty("TrackToVertexIPEstimator", m_trackToVertexIPEstimator);
126 
127 
128  declareProperty("commonTreeFolder", m_commonTreeFolder, "/ZmumuValidationUserSel/common" );
129  declareProperty("defaultTreeFolder", m_defaultTreeFolder );
130  declareProperty("IDTreeFolder", m_IDTreeFolder );
131  declareProperty("refit1TreeFolder", m_refit1TreeFolder );
132  declareProperty("refit2TreeFolder", m_refit2TreeFolder );
133  declareProperty("truthTreeFolder", m_truthTreeFolder );
134  declareProperty("combTreeFolder", m_combTreeFolder );
135  declareProperty("MSTreeFolder", m_MSTreeFolder, "/ZmumuValidationUserSel/ms" );
136 
137  declareProperty("UnbiasVertex", m_doRemoval);
138 
139  declareProperty("commonTree", m_commonTreeName, "CommonTree" );
140  declareProperty("DefaultTree", m_defaultTreeName );
141  declareProperty("IDTree", m_IDTreeName );
142  declareProperty("CBTree", m_combTreeName );
143  declareProperty("Refit1Tree", m_refit1TreeName );
144  declareProperty("Refit2Tree", m_refit2TreeName );
145  declareProperty("MSTree", m_MSTreeName );
146 
147  declareProperty("doFourMuAnalysis", m_doFourMuAnalysis = false);
148  declareProperty("FourMuTreeFolder", m_FourMuTreeFolder);
149 
150  declareProperty("StoreZmumuNtuple", m_storeZmumuNtuple = true);
151  declareProperty("doZmumuEventDebug", m_doDebug);
152  declareProperty("MuonQuality", m_MuonQualityName = "Medium");
153  declareProperty("skipMS", m_skipMS = false);
154  declareProperty("useCustomMuonSelector", m_useCustomMuonSelector = false );
155  declareProperty("MuonSelector", m_muonSelector );
156 
157  declareProperty( "MinLumiBlock", m_minGoodLumiBlock = 0, "minimum lumiblock number to be accepted");
158  declareProperty( "MaxLumiBlock", m_maxGoodLumiBlock = 0, "maximum lumiblock number to be accepted");
159 
160  return;
161 }
162 
163 
164 //==================================================================================
166 {}
167 
168 
169 //==================================================================================
171 {
172  ATH_MSG_DEBUG ("** IDPerfMonZmumu::Initialize ** START **");
173  // Setup the services
174 
175  // Retrieve Track fitter and track to vertex
176  if (m_doRefit) { // only if track refit is requested
177  if (m_TrackRefitter1.retrieve().isSuccess()) {
178  ATH_MSG_INFO("Retrieved tool m_TrackRefitter1: " << m_TrackRefitter1 << " SUCCESS ");
179  }
180  else {
181  ATH_MSG_FATAL("Unable to retrieve m_TrackRefitter1 " << m_TrackRefitter1 << " FAILURE ");
182  return StatusCode::FAILURE;
183  }
184 
185  // Retrieve the second fitter
186  if (m_TrackRefitter2.retrieve().isSuccess()) {
187  ATH_MSG_INFO("Retrieved tool m_TrackRefitter2: " << m_TrackRefitter2 << " SUCCESS ");
188  }
189  else {
190  ATH_MSG_FATAL("Unable to retrieve m_TrackRefitter2 " << m_TrackRefitter2 << " FAILURE ");
191  return StatusCode::FAILURE;
192  }
193 
194  if (m_trackToVertexTool.retrieve().isSuccess()) {
195  ATH_MSG_INFO("Retrieved tool m_trackToVertexTool " << m_trackToVertexTool << " SUCCESS ");
196  }
197  else {
198  ATH_MSG_FATAL("Unable to retrieve m_trackToVertexTool " << m_trackToVertexTool << " FAILURE ");
199  return StatusCode::FAILURE;
200  }
201  }
202 
204  // ATH_CHECK( m_selTool.retrieve() );
205  if (m_selTool.retrieve().isSuccess()){
206  ATH_MSG_INFO("Retrieved tool (track selection tool) m_selTool " << m_selTool << " SUCCESS ");
207  }
208  else {
209  ATH_MSG_FATAL("Unable to retrieve (track selection tool) m_selTool " << m_selTool << " FAILURE ");
210  return StatusCode::FAILURE;
211  }
212  }
213 
214  // initializing the eventInfo "accessor"
216 
217  if (m_doIP) {
218  ATH_MSG_DEBUG("Retrieving tool (trackToVertexIPEstimator)");
220  }
221 
222 
223  ATH_CHECK (m_EventInfoKey.initialize()); // initializing the eventInfo "accessor"
224 
225  if (m_isMC) ATH_CHECK (m_extrapolator.retrieve()); // this is only used for the truth particles
226 
227  ATH_CHECK (m_vertexKey.initialize());
228 
230 
231  ATH_MSG_INFO(" -- IDPerfMonZmumu::initialize() -- m_vertexKey: " << m_vertexKey);
232 
233  ATH_MSG_INFO(" -- IDPerfMonZmumu::initialize() -- init m_beamSpotKey ");
235 
236  // START new place for initilization of params
252 
255  }
256  // END new place for initialization of params
257 
258  if (m_doFourMuAnalysis) {
259  m_4mu.Init();
260  m_4mu.setDebugMode(true);
262  ATH_MSG_DEBUG(" IDPerfMonZmumu FourMuonAnalysis initialization completed " << m_Trk2VtxAssociationTool);
263  }
264 
265  // m_Trk2VtxAssociationTool = std::make_unique<CP::TrackVertexAssociationTool>("Loose");
266  if ( m_Trk2VtxAssociationTool.retrieve().isSuccess() ) {
267  ATH_MSG_DEBUG(" IDPerfMonZmumu Success retrieving tool " << m_Trk2VtxAssociationTool);
268  }
269  else { // is Failure
270  ATH_MSG_FATAL("IDPerfMonZmumu Failed to retrieve tool m_Trk2VtxAssociationTool " << m_Trk2VtxAssociationTool);
271  return StatusCode::FAILURE;
272  }
273 
274  ATH_CHECK ( this->bookTrees() );
275 
276  if (m_UseTrigger) { // load trigger decission and matching under user request
277  if (m_triggerDecision.retrieve().isFailure()) {
278  ATH_MSG_FATAL("Unable to retrieve " << m_triggerDecision << " turn it off");
279  return StatusCode::FAILURE;
280  }
281  else {
282  ATH_MSG_DEBUG("retrieved tool: " << m_triggerDecision );
283  }
284 
285  if(m_triggerMatching.retrieve().isFailure()) {
286  ATH_MSG_FATAL("Unable to retrieve " << m_triggerMatching << " turn it off");
287  return StatusCode::FAILURE;
288  }
289  else {
290  ATH_MSG_INFO("retrieved tool: " << m_triggerDecision );
291  }
292  }
293 
294  ATH_MSG_DEBUG("** IDPerfMonZmumu::Initialize ** Completed **");
295  return StatusCode::SUCCESS;
296 }
297 
298 
299 
300 //==================================================================================
302 {
303  m_h_cutflow = new TH1F("h_cutflow","cut flow histogram",11, -0.5, 9.5);
304 
305  ATH_MSG_DEBUG("initialize() ** bookTrees() ** m_commonTree name: " << m_commonTreeName.c_str());
306  ATH_MSG_DEBUG(" m_defaultTree name: " << m_defaultTreeName.c_str());
307  ATH_MSG_DEBUG(" m_IDTree name: " << m_IDTreeName.c_str());
308 
309  if (!m_commonTree) {
310  ATH_MSG_INFO("initialize() ** defining m_commonTree with name: " << m_commonTreeName.c_str());
311  m_commonTree = new TTree((m_commonTreeName).c_str(), m_ValidationTreeDescription.c_str());
312 
313  m_commonTree->Branch("runNumber" , &m_runNumber, "runNumber/I");
314  m_commonTree->Branch("eventNumber" , &m_evtNumber, "eventNumber/I");
315  m_commonTree->Branch("lumi_block" , &m_lumi_block, "lumi_block/I");
316  m_commonTree->Branch("mu" , &m_event_mu, "mu/I");
317  m_commonTree->Branch("preScale" , &m_triggerPrescale, "preScale/I");
318  m_commonTree->Branch("mcEventWeight" , &m_event_weight, "mcEventWeight/F");
319  m_commonTree->Branch("IDTrack_pt" , &m_IDTrack_pt);
320  m_commonTree->Branch("IDTrack_eta" , &m_IDTrack_eta);
321  m_commonTree->Branch("IDTrack_phi" , &m_IDTrack_phi);
322  m_commonTree->Branch("IDTrack_d0" , &m_IDTrack_d0);
323  m_commonTree->Branch("IDTrack_z0" , &m_IDTrack_z0);
324  m_commonTree->Branch("IDTrack_qoverp" , &m_IDTrack_qoverp);
325  m_commonTree->Branch("IDTrack_sigma_pt" , &m_IDTrack_sigma_pt);
326  m_commonTree->Branch("IDTrack_sigma_d0" , &m_IDTrack_sigma_d0);
327  m_commonTree->Branch("IDTrack_sigma_z0" , &m_IDTrack_sigma_z0);
328  m_commonTree->Branch("IDTrack_sigma_qoverp", &m_IDTrack_sigma_qoverp);
329  m_commonTree->Branch("CBTrack_pt" , &m_CBTrack_pt);
330  m_commonTree->Branch("CBTrack_eta" , &m_CBTrack_eta);
331  m_commonTree->Branch("CBTrack_phi" , &m_CBTrack_phi);
332  m_commonTree->Branch("CBTrack_d0" , &m_CBTrack_d0);
333  m_commonTree->Branch("CBTrack_z0" , &m_CBTrack_z0);
334  m_commonTree->Branch("CBTrack_qoverp" , &m_CBTrack_qoverp);
335  m_commonTree->Branch("CBTrack_sigma_pt" , &m_CBTrack_sigma_pt);
336  m_commonTree->Branch("CBTrack_sigma_d0" , &m_CBTrack_sigma_d0);
337  m_commonTree->Branch("CBTrack_sigma_z0" , &m_CBTrack_sigma_z0);
338  m_commonTree->Branch("CBTrack_sigma_qoverp", &m_CBTrack_sigma_qoverp);
339  m_commonTree->Branch("Refit1_pt" , &m_Refit1_pt);
340  m_commonTree->Branch("Refit1_eta" , &m_Refit1_eta);
341  m_commonTree->Branch("Refit1_phi" , &m_Refit1_phi);
342  m_commonTree->Branch("Refit1_d0" , &m_Refit1_d0);
343  m_commonTree->Branch("Refit1_z0" , &m_Refit1_z0);
344  m_commonTree->Branch("Refit1_qoverp" , &m_Refit1_qoverp);
345  m_commonTree->Branch("Refit1_sigma_pt" , &m_Refit1_sigma_pt);
346  m_commonTree->Branch("Refit1_sigma_d0" , &m_Refit1_sigma_d0);
347  m_commonTree->Branch("Refit1_sigma_z0" , &m_Refit1_sigma_z0);
348  m_commonTree->Branch("Refit1_sigma_qoverp" , &m_Refit1_sigma_qoverp);
349  m_commonTree->Branch("Refit2_pt" , &m_Refit2_pt);
350  m_commonTree->Branch("Refit2_eta" , &m_Refit2_eta);
351  m_commonTree->Branch("Refit2_phi" , &m_Refit2_phi);
352  m_commonTree->Branch("Refit2_d0" , &m_Refit2_d0);
353  m_commonTree->Branch("Refit2_z0" , &m_Refit2_z0);
354  m_commonTree->Branch("Refit2_qoverp" , &m_Refit2_qoverp);
355  m_commonTree->Branch("Refit2_sigma_pt" , &m_Refit2_sigma_pt);
356  m_commonTree->Branch("Refit2_sigma_d0" , &m_Refit2_sigma_d0);
357  m_commonTree->Branch("Refit2_sigma_z0" , &m_Refit2_sigma_z0);
358  m_commonTree->Branch("Refit2_sigma_qoverp" , &m_Refit2_sigma_qoverp);
359  m_commonTree->Branch("Truth_pt" , &m_Truth_pt);
360  m_commonTree->Branch("Truth_eta" , &m_Truth_eta);
361  m_commonTree->Branch("Truth_phi" , &m_Truth_phi);
362  m_commonTree->Branch("Truth_d0" , &m_Truth_d0);
363  m_commonTree->Branch("Truth_z0" , &m_Truth_z0);
364  m_commonTree->Branch("Truth_qoverp" , &m_Truth_qoverp);
365  m_commonTree->Branch("Truth_parent" , &m_Truth_parent);
366  m_commonTree->Branch("numberOfBLayerHits" , &m_nBLhits);
367  m_commonTree->Branch("numberOfPixelHits" , &m_nPIXhits);
368  m_commonTree->Branch("numberOfSCTHits" , &m_nSCThits);
369  m_commonTree->Branch("numberOfTRTHits" , &m_nTRThits);
370  }
371 
372  if ( !m_defaultTree){
373  ATH_MSG_INFO("initialize() ** defining m_defaultTree with name: " << m_defaultTreeName.c_str());
374  m_defaultTree = new TTree((m_defaultTreeName).c_str(), m_ValidationTreeDescription.c_str());
375 
376  m_defaultTree->Branch("runNumber" , &m_runNumber, "runNumber/I");
377  m_defaultTree->Branch("eventNumber" , &m_evtNumber, "eventNumber/I");
378  m_defaultTree->Branch("lumi_block" , &m_lumi_block, "lumi_block/I");
379  m_defaultTree->Branch("mu" , &m_event_mu, "mu/I");
380 
381  m_defaultTree->Branch("Negative_Px", &m_negative_px, "Negative_Px/D");
382  m_defaultTree->Branch("Negative_Py", &m_negative_py, "Negative_Py/D");
383  m_defaultTree->Branch("Negative_Pt", &m_negative_pt, "Negative_Pt/D");
384  m_defaultTree->Branch("Negative_Pz", &m_negative_pz, "Negative_Pz/D");
385  m_defaultTree->Branch("Negative_Phi", &m_negative_phi, "Negative_Phi/D");
386  m_defaultTree->Branch("Negative_eta", &m_negative_eta, "Negative_Eta/D");
387  m_defaultTree->Branch("Negative_z0", &m_negative_z0, "Negative_z0/D");
388  m_defaultTree->Branch("Negative_d0", &m_negative_d0, "Negative_d0/D");
389  m_defaultTree->Branch("Negative_z0_err", &m_negative_z0_err, "Negative_z0_err/D");
390  m_defaultTree->Branch("Negative_d0_err", &m_negative_d0_err, "Negative_d0_err/D");
391  m_defaultTree->Branch("Negative_sigma_pt", &m_negative_sigma_pt, "Negative_sigma_pt/D");
392 
393  m_defaultTree->Branch("Positive_Px", &m_positive_px, "Positive_Px/D");
394  m_defaultTree->Branch("Positive_Py", &m_positive_py, "Positive_Py/D");
395  m_defaultTree->Branch("Positive_Pt", &m_positive_pt, "Positive_Pt/D");
396  m_defaultTree->Branch("Positive_Pz", &m_positive_pz, "Positive_Pz/D");
397  m_defaultTree->Branch("Positive_Phi", &m_positive_phi, "Positive_Phi/D");
398  m_defaultTree->Branch("Positive_eta", &m_positive_eta, "Positive_Eta/D");
399  m_defaultTree->Branch("Positive_z0", &m_positive_z0, "Positive_z0/D");
400  m_defaultTree->Branch("Positive_d0", &m_positive_d0, "Positive_d0/D");
401  m_defaultTree->Branch("Positive_z0_err", &m_positive_z0_err, "Positive_z0_err/D");
402  m_defaultTree->Branch("Positive_d0_err", &m_positive_d0_err, "Positive_d0_err/D");
403  m_defaultTree->Branch("Positive_sigma_pt", &m_positive_sigma_pt, "Positive_sigma_pt/D");
404 
405  if (m_doIP) {
406  m_defaultTree->Branch("Negative_d0_PV", &m_negative_d0_PV , "Negative_d0_PV/D");
407  m_defaultTree->Branch("Negative_z0_PV", &m_negative_z0_PV , "Negative_z0_PV/D");
408  m_defaultTree->Branch("Positive_z0_PV", &m_positive_z0_PV, "Positive_z0_PV/D");
409  m_defaultTree->Branch("Positive_d0_PV", &m_positive_d0_PV, "Positive_d0_PV/D");
410 
411  m_defaultTree->Branch("Negative_d0_PVerr", &m_negative_d0_PVerr, "Negative_d0_PVerr/D");
412  m_defaultTree->Branch("Negative_z0_PVerr", &m_negative_z0_PVerr, "Negative_z0_PVerr/D");
413  m_defaultTree->Branch("Positive_z0_PVerr", &m_positive_z0_PVerr, "Positive_z0_PVerr/D");
414  m_defaultTree->Branch("Positive_d0_PVerr", &m_positive_d0_PVerr, "Positive_d0_PVerr/D");
415 
416  m_defaultTree->Branch("pv_x", &m_pv_x , "pv_x/D");
417  m_defaultTree->Branch("pv_y", &m_pv_y , "pv_y/D");
418  m_defaultTree->Branch("pv_z", &m_pv_z , "pv_z/D");
419  m_defaultTree->Branch("nTrkInVtx", &m_nTrkInVtx, "nTrkInVtx/I");
420  }
421  }
422 
423  bool isTreeNone = false;
424  if (m_IDTreeName.find("none") != std::string::npos) isTreeNone = true;
425  if ( !m_IDTree and !isTreeNone ){
426  ATH_MSG_INFO("initialize() ** defining IDPerfMonZmumu m_IDTree with name: " << m_IDTreeName.c_str());
427  m_IDTree = new TTree((m_IDTreeName).c_str(), m_ValidationTreeDescription.c_str());
428 
429  m_IDTree->Branch("runNumber" , &m_runNumber, "runNumber/I");
430  m_IDTree->Branch("eventNumber" , &m_evtNumber, "eventNumber/I");
431  m_IDTree->Branch("lumi_bLock" , &m_lumi_block, "lumi_block/I");
432  m_IDTree->Branch("mu" , &m_event_mu, "mu/I");
433 
434  m_IDTree->Branch("Negative_Px", &m_negative_px, "Negative_Px/D");
435  m_IDTree->Branch("Negative_Py", &m_negative_py, "Negative_Py/D");
436  m_IDTree->Branch("Negative_Pt", &m_negative_pt, "Negative_Pt/D");
437  m_IDTree->Branch("Negative_Pz", &m_negative_pz, "Negative_Pz/D");
438  m_IDTree->Branch("Negative_Phi", &m_negative_phi, "Negative_Phi/D");
439  m_IDTree->Branch("Negative_Eta", &m_negative_eta, "Negative_Eta/D");
440  m_IDTree->Branch("Negative_z0", &m_negative_z0, "Negative_z0/D");
441  m_IDTree->Branch("Negative_d0", &m_negative_d0, "Negative_d0/D");
442  m_IDTree->Branch("Negative_z0_err", &m_negative_z0_err, "Negative_z0_err/D");
443  m_IDTree->Branch("Negative_d0_err", &m_negative_d0_err, "Negative_d0_err/D");
444  m_IDTree->Branch("Negative_sigma_pt", &m_negative_sigma_pt, "Negative_sigma_pt/D");
445 
446  m_IDTree->Branch("Positive_Px", &m_positive_px, "Positive_Px/D");
447  m_IDTree->Branch("Positive_Py", &m_positive_py, "Positive_Py/D");
448  m_IDTree->Branch("Positive_Pt", &m_positive_pt, "Positive_Pt/D");
449  m_IDTree->Branch("Positive_Pz", &m_positive_pz, "Positive_Pz/D");
450  m_IDTree->Branch("Positive_Phi", &m_positive_phi, "Positive_Phi/D");
451  m_IDTree->Branch("Positive_Eta", &m_positive_eta, "Positive_Eta/D");
452  m_IDTree->Branch("Positive_z0", &m_positive_z0, "Positive_z0/D");
453  m_IDTree->Branch("Positive_d0", &m_positive_d0, "Positive_d0/D");
454  m_IDTree->Branch("Positive_z0_err", &m_positive_z0_err, "Positive_z0_err/D");
455  m_IDTree->Branch("Positive_d0_err", &m_positive_d0_err, "Positive_d0_err/D");
456  m_IDTree->Branch("Positive_sigma_pt", &m_positive_sigma_pt, "Positive_sigma_pt/D");
457 
458  if(m_doIP){
459  m_IDTree->Branch("Negative_d0_PV", &m_negative_d0_PV , "Negative_d0_PV/D");
460  m_IDTree->Branch("Negative_z0_PV", &m_negative_z0_PV , "Negative_z0_PV/D");
461  m_IDTree->Branch("Positive_z0_PV", &m_positive_z0_PV, "Positive_z0_PV/D");
462  m_IDTree->Branch("Positive_d0_PV", &m_positive_d0_PV, "Positive_d0_PV/D");
463 
464  m_IDTree->Branch("Negative_d0_PVerr", &m_negative_d0_PVerr, "Negative_d0_PVerr/D");
465  m_IDTree->Branch("Negative_z0_PVerr", &m_negative_z0_PVerr, "Negative_z0_PVerr/D");
466  m_IDTree->Branch("Positive_z0_PVerr", &m_positive_z0_PVerr, "Positive_z0_PVerr/D");
467  m_IDTree->Branch("Positive_d0_PVerr", &m_positive_d0_PVerr, "Positive_d0_PVerr/D");
468 
469  m_IDTree->Branch("pv_x", &m_pv_x , "pv_x/D");
470  m_IDTree->Branch("pv_y", &m_pv_y , "pv_y/D");
471  m_IDTree->Branch("pv_z", &m_pv_z , "pv_z/D");
472  m_IDTree->Branch("nTrkInVtx", &m_nTrkInVtx, "nTrkInVtx/I");
473  }
474  }
475 
476  // dealing with tree for Refit1 tracks
477  isTreeNone = false;
478  if (m_refit1TreeName.find("none") != std::string::npos) isTreeNone = true;
479  if ( m_doRefit && !m_refit1Tree && !isTreeNone ){
480  ATH_MSG_INFO("initialize() ** defining IDPerfMonZmumu m_refit1Tree with name: " << m_refit1TreeName.c_str());
481  m_refit1Tree = new TTree((m_refit1TreeName).c_str(), m_ValidationTreeDescription.c_str());
482 
483  m_refit1Tree->Branch("runNumber" , &m_runNumber, "runNumber/I");
484  m_refit1Tree->Branch("eventNumber" , &m_evtNumber, "eventNumber/I");
485  m_refit1Tree->Branch("lumi_block" , &m_lumi_block, "lumi_block/I");
486  m_refit1Tree->Branch("mu" , &m_event_mu, "mu/I");
487  m_refit1Tree->Branch("preScale" , &m_triggerPrescale, "preScale/I");
488 
489  m_refit1Tree->Branch("Negative_Px", &m_negative_px, "Negative_Px/D");
490  m_refit1Tree->Branch("Negative_Py", &m_negative_py, "Negative_Py/D");
491  m_refit1Tree->Branch("Negative_Pt", &m_negative_pt, "Negative_Pt/D");
492  m_refit1Tree->Branch("Negative_Pz", &m_negative_pz, "Negative_Pz/D");
493  m_refit1Tree->Branch("Negative_Phi", &m_negative_phi, "Negative_Phi/D");
494  m_refit1Tree->Branch("Negative_Eta", &m_negative_eta, "Negative_Eta/D");
495  m_refit1Tree->Branch("Negative_z0", &m_negative_z0, "Negative_z0/D");
496  m_refit1Tree->Branch("Negative_d0", &m_negative_d0, "Negative_d0/D");
497  m_refit1Tree->Branch("Negative_z0_manualBS", &m_positive_z0_manualBS, "Negative_z0_manualBS/D");
498  m_refit1Tree->Branch("Negative_d0_manualBS", &m_positive_d0_manualBS, "Negative_d0_manualBS/D");
499  m_refit1Tree->Branch("Negative_z0_err", &m_negative_z0_err, "Negative_z0_err/D");
500  m_refit1Tree->Branch("Negative_d0_err", &m_negative_d0_err, "Negative_d0_err/D");
501  m_refit1Tree->Branch("Negative_sigma_pt", &m_negative_sigma_pt, "Negative_sigma_pt/D");
502 
503  m_refit1Tree->Branch("Positive_Px", &m_positive_px, "Positive_Px/D");
504  m_refit1Tree->Branch("Positive_Py", &m_positive_py, "Positive_Py/D");
505  m_refit1Tree->Branch("Positive_Pt", &m_positive_pt, "Positive_Pt/D");
506  m_refit1Tree->Branch("Positive_Pz", &m_positive_pz, "Positive_Pz/D");
507  m_refit1Tree->Branch("Positive_Phi", &m_positive_phi, "Positive_Phi/D");
508  m_refit1Tree->Branch("Positive_eta", &m_positive_eta, "Positive_Eta/D");
509  m_refit1Tree->Branch("Positive_z0", &m_positive_z0, "Positive_z0/D");
510  m_refit1Tree->Branch("Positive_d0", &m_positive_d0, "Positive_d0/D");
511  m_refit1Tree->Branch("Positive_z0_manualBS", &m_positive_z0_manualBS, "Positive_z0_manualBS/D");
512  m_refit1Tree->Branch("Positive_d0_manualBS", &m_positive_d0_manualBS, "Positive_d0_manualBS/D");
513  m_refit1Tree->Branch("Positive_z0_err", &m_positive_z0_err, "Positive_z0_err/D");
514  m_refit1Tree->Branch("Positive_d0_err", &m_positive_d0_err, "Positive_d0_err/D");
515  m_refit1Tree->Branch("Positive_sigma_pt", &m_positive_sigma_pt, "Positive_sigma_pt/D");
516 
517  if(m_doIP){
518  m_refit1Tree->Branch("Negative_d0_PV", &m_negative_d0_PV , "Negative_d0_PV/D");
519  m_refit1Tree->Branch("Negative_z0_PV", &m_negative_z0_PV , "Negative_z0_PV/D");
520  m_refit1Tree->Branch("Positive_z0_PV", &m_positive_z0_PV, "Positive_z0_PV/D");
521  m_refit1Tree->Branch("Positive_d0_PV", &m_positive_d0_PV, "Positive_d0_PV/D");
522 
523  m_refit1Tree->Branch("Negative_d0_PVerr", &m_negative_d0_PVerr , "Negative_d0_PVerr/D");
524  m_refit1Tree->Branch("Negative_z0_PVerr", &m_negative_z0_PVerr , "Negative_z0_PVerr/D");
525  m_refit1Tree->Branch("Positive_z0_PVerr", &m_positive_z0_PVerr, "Positive_z0_PVerr/D");
526  m_refit1Tree->Branch("Positive_d0_PVerr", &m_positive_d0_PVerr, "Positive_d0_PVerr/D");
527 
528  m_refit1Tree->Branch("pv_x", &m_pv_x , "pv_x/D");
529  m_refit1Tree->Branch("pv_y", &m_pv_y , "pv_y/D");
530  m_refit1Tree->Branch("pv_z", &m_pv_z , "pv_z/D");
531  m_refit1Tree->Branch("nTrkInVtx", &m_nTrkInVtx, "nTrkInVtx/I");
532  }
533  }
534 
535  // dealing with tree for Refit2 tracks
536  isTreeNone = false;
537  if (m_refit2TreeName.find("none") != std::string::npos) isTreeNone = true;
538  if ( m_doRefit && !m_refit2Tree && !isTreeNone){
539  ATH_MSG_INFO("initialize() ** defining m_refit2Tree with name: " << m_refit2TreeName.c_str());
540  m_refit2Tree = new TTree((m_refit2TreeName).c_str(), m_ValidationTreeDescription.c_str());
541 
542  m_refit2Tree->Branch("runNumber" , &m_runNumber, "runNumber/I");
543  m_refit2Tree->Branch("eventNumber" , &m_evtNumber, "eventNumber/I");
544  m_refit2Tree->Branch("lumi_block" , &m_lumi_block, "lumi_block/I");
545  m_refit2Tree->Branch("mu" , &m_event_mu, "mu/I");
546  m_refit2Tree->Branch("preScale" , &m_triggerPrescale, "preScale/I");
547 
548  m_refit2Tree->Branch("Negative_Px", &m_negative_px, "Negative_Px/D");
549  m_refit2Tree->Branch("Negative_Py", &m_negative_py, "Negative_Py/D");
550  m_refit2Tree->Branch("Negative_Pt", &m_negative_pt, "Negative_Pt/D");
551  m_refit2Tree->Branch("Negative_Pz", &m_negative_pz, "Negative_Pz/D");
552  m_refit2Tree->Branch("Negative_Phi", &m_negative_phi, "Negative_Phi/D");
553  m_refit2Tree->Branch("Negative_Eta", &m_negative_eta, "Negative_Eta/D");
554  m_refit2Tree->Branch("Negative_z0", &m_negative_z0, "Negative_z0/D");
555  m_refit2Tree->Branch("Negative_d0", &m_negative_d0, "Negative_d0/D");
556  m_refit2Tree->Branch("Negative_z0_manualBS", &m_positive_z0_manualBS, "Negative_z0_manualBS/D");
557  m_refit2Tree->Branch("Negative_d0_manualBS", &m_positive_d0_manualBS, "Negative_d0_manualBS/D");
558  m_refit2Tree->Branch("Negative_z0_err", &m_negative_z0_err, "Negative_z0_err/D");
559  m_refit2Tree->Branch("Negative_d0_err", &m_negative_d0_err, "Negative_d0_err/D");
560  m_refit2Tree->Branch("Negative_sigma_pt", &m_negative_sigma_pt, "Negative_sigma_pt/D");
561 
562  m_refit2Tree->Branch("Positive_Px", &m_positive_px, "Positive_Px/D");
563  m_refit2Tree->Branch("Positive_Py", &m_positive_py, "Positive_Py/D");
564  m_refit2Tree->Branch("Positive_Pt", &m_positive_pt, "Positive_Pt/D");
565  m_refit2Tree->Branch("Positive_Pz", &m_positive_pz, "Positive_Pz/D");
566  m_refit2Tree->Branch("Positive_Phi", &m_positive_phi, "Positive_Phi/D");
567  m_refit2Tree->Branch("Positive_Eta", &m_positive_eta, "Positive_Eta/D");
568  m_refit2Tree->Branch("Positive_z0", &m_positive_z0, "Positive_z0/D");
569  m_refit2Tree->Branch("Positive_d0", &m_positive_d0, "Positive_d0/D");
570  m_refit2Tree->Branch("Positive_z0_manualBS", &m_positive_z0_manualBS, "Positive_z0_manualBS/D");
571  m_refit2Tree->Branch("Positive_d0_manualBS", &m_positive_d0_manualBS, "Positive_d0_manualBS/D");
572  m_refit2Tree->Branch("Positive_z0_err", &m_positive_z0_err, "Positive_z0_err/D");
573  m_refit2Tree->Branch("Positive_d0_err", &m_positive_d0_err, "Positive_d0_err/D");
574  m_refit2Tree->Branch("Positive_sigma_pt", &m_positive_sigma_pt, "Positive_sigma_pt/D");
575 
576 
577  if(m_doIP){
578  m_refit2Tree->Branch("Negative_d0_PV", &m_negative_d0_PV , "Negative_d0_PV/D");
579  m_refit2Tree->Branch("Negative_z0_PV", &m_negative_z0_PV , "Negative_z0_PV/D");
580  m_refit2Tree->Branch("Positive_d0_PV", &m_positive_d0_PV , "Positive_d0_PV/D");
581  m_refit2Tree->Branch("Positive_z0_PV", &m_positive_z0_PV , "Positive_z0_PV/D");
582 
583 
584  m_refit2Tree->Branch("Negative_z0_PVerr", &m_negative_z0_PVerr, "Negative_z0_PVerr/D");
585  m_refit2Tree->Branch("Negative_d0_PVerr", &m_negative_d0_PVerr, "Negative_d0_PVerr/D");
586  m_refit2Tree->Branch("Positive_z0_PVerr", &m_positive_z0_PVerr, "Positive_z0_PVerr/D");
587  m_refit2Tree->Branch("Positive_d0_PVerr", &m_positive_d0_PVerr, "Positive_d0_PVerr/D");
588 
589  m_refit2Tree->Branch("pv_x", &m_pv_x , "pv_x/D");
590  m_refit2Tree->Branch("pv_y", &m_pv_y , "pv_y/D");
591  m_refit2Tree->Branch("pv_z", &m_pv_z , "pv_z/D");
592 
593  m_refit2Tree->Branch("nTrkInVtx", &m_nTrkInVtx, "nTrkInVtx/I");
594  }
595  }
596 
597  isTreeNone = false;
598  if (m_combTreeName.find("none") != std::string::npos) isTreeNone = true;
599  if( !m_combTree && !m_skipMS && !isTreeNone){
600  ATH_MSG_INFO("initialize() ** defining IDPerfMonZmumu m_combTree with name: " << m_combTreeName.c_str());
601  m_combTree = new TTree((m_combTreeName).c_str(), m_ValidationTreeDescription.c_str());
602 
603  m_combTree->Branch("runNumber", &m_runNumber, "runNumber/I");
604  m_combTree->Branch("eventNumber", &m_evtNumber, "eventNumber/I");
605  m_combTree->Branch("lumi_block", &m_lumi_block, "lumi_block/I");
606  m_combTree->Branch("mu", &m_event_mu, "mu/I");
607  m_combTree->Branch("preScale", &m_triggerPrescale, "preScale/I");
608 
609  m_combTree->Branch("Negative_Px", &m_negative_px, "Negative_Px/D");
610  m_combTree->Branch("Negative_Py", &m_negative_py, "Negative_Py/D");
611  m_combTree->Branch("Negative_Pt", &m_negative_pt, "Negative_Pt/D");
612  m_combTree->Branch("Negative_Pz", &m_negative_pz, "Negative_Pz/D");
613  m_combTree->Branch("Negative_Phi", &m_negative_phi, "Negative_Phi/D");
614  m_combTree->Branch("Negative_eta", &m_negative_eta, "Negative_eta/D");
615  m_combTree->Branch("Negative_z0", &m_negative_z0, "Negative_z0/D");
616  m_combTree->Branch("Negative_d0", &m_negative_d0, "Negative_d0/D");
617  m_combTree->Branch("Negative_z0_err", &m_negative_z0_err, "Negative_z0_err/D");
618  m_combTree->Branch("Negative_d0_err", &m_negative_d0_err, "Negative_d0_err/D");
619  m_combTree->Branch("Negative_sigma_pt", &m_negative_sigma_pt, "Negative_sigma_pt/D");
620 
621  m_combTree->Branch("Positive_Px", &m_positive_px, "Positive_Px/D");
622  m_combTree->Branch("Positive_Py", &m_positive_py, "Positive_Py/D");
623  m_combTree->Branch("Positive_Pt", &m_positive_pt, "Positive_Pt/D");
624  m_combTree->Branch("Positive_Pz", &m_positive_pz, "Positive_Pz/D");
625  m_combTree->Branch("Positive_Phi", &m_positive_phi, "Positive_Phi/D");
626  m_combTree->Branch("Positive_eta", &m_positive_eta, "Positive_Eta/D");
627  m_combTree->Branch("Positive_z0", &m_positive_z0, "Positive_z0/D");
628  m_combTree->Branch("Positive_d0", &m_positive_d0, "Positive_d0/D");
629  m_combTree->Branch("Positive_z0_err", &m_positive_z0_err, "Positive_z0_err/D");
630  m_combTree->Branch("Positive_d0_err", &m_positive_d0_err, "Positive_d0_err/D");
631  m_combTree->Branch("Positive_sigma_pt", &m_positive_sigma_pt, "Positive_sigma_pt/D");
632 
633  if(m_doIP){
634  m_combTree->Branch("Negative_z0_PV", &m_negative_z0_PV, "Negative_z0_PV/D");
635  m_combTree->Branch("Negative_d0_PV", &m_negative_d0_PV, "Negative_d0_PV/D");
636  m_combTree->Branch("Positive_z0_PV", &m_positive_z0_PV, "Positive_z0_PV/D");
637  m_combTree->Branch("Positive_d0_PV", &m_positive_d0_PV, "Positive_d0_PV/D");
638 
639  m_combTree->Branch("Negative_z0_PVerr", &m_negative_z0_PVerr, "Negative_z0_PVerr/D");
640  m_combTree->Branch("Negative_d0_PVerr", &m_negative_d0_PVerr, "Negative_d0_PVerr/D");
641  m_combTree->Branch("Positive_z0_PVerr", &m_positive_z0_PVerr, "Positive_z0_PVerr/D");
642  m_combTree->Branch("Positive_d0_PVerr", &m_positive_d0_PVerr, "Positive_d0_PVerr/D");
643 
644  m_combTree->Branch("pv_x", &m_pv_x , "pv_x/D");
645  m_combTree->Branch("pv_y", &m_pv_y , "pv_y/D");
646  m_combTree->Branch("pv_z", &m_pv_z , "pv_z/D");
647 
648  m_combTree->Branch("nTrkInVtx", &m_nTrkInVtx, "nTrkInVtx/I");
649  }
650  }
651 
652 
653  isTreeNone = false;
654  if (m_MSTreeName.find("none") != std::string::npos) isTreeNone = true;
655  if( !m_MSTree && !m_skipMS && !isTreeNone){
656  ATH_MSG_INFO("initialize() ** defining IDPerfMon MSTree ");
657 
658  m_MSTree = new TTree(m_MSTreeName.c_str(), m_ValidationTreeDescription.c_str());
659 
660  m_MSTree->Branch("runNumber" , &m_runNumber, "runNumber/I");
661  m_MSTree->Branch("eventNumber" , &m_evtNumber, "eventNumber/I");
662  m_MSTree->Branch("lumi_block" , &m_lumi_block, "lumi_block/I");
663  m_MSTree->Branch("preScale" , &m_triggerPrescale, "preScale/I");
664 
665  m_MSTree->Branch("Negative_Px", &m_negative_px, "Negative_Px/D");
666  m_MSTree->Branch("Negative_Py", &m_negative_py, "Negative_Py/D");
667  m_MSTree->Branch("Negative_Pt", &m_negative_pt, "Negative_Pt/D");
668  m_MSTree->Branch("Negative_Pz", &m_negative_pz, "Negative_Pz/D");
669  m_MSTree->Branch("Negative_Phi", &m_negative_phi, "Negative_Phi/D");
670  m_MSTree->Branch("Negative_Eta", &m_negative_eta, "Negative_Eta/D");
671  m_MSTree->Branch("Negative_z0", &m_negative_z0, "Negative_z0/D");
672  m_MSTree->Branch("Negative_d0", &m_negative_d0, "Negative_d0/D");
673  m_MSTree->Branch("Negative_z0_err", &m_negative_z0_err, "Negative_z0_err/D");
674  m_MSTree->Branch("Negative_d0_err", &m_negative_d0_err, "Negative_d0_err/D");
675  m_MSTree->Branch("Negative_sigma_pt", &m_negative_sigma_pt, "Negative_sigma_pt/D");
676 
677  m_MSTree->Branch("Positive_Px", &m_positive_px, "Positive_Px/D");
678  m_MSTree->Branch("Positive_Py", &m_positive_py, "Positive_Py/D");
679  m_MSTree->Branch("Positive_Pt", &m_positive_pt, "Positive_Pt/D");
680  m_MSTree->Branch("Positive_Pz", &m_positive_pz, "Positive_Pz/D");
681  m_MSTree->Branch("Positive_Phi", &m_positive_phi, "Positive_Phi/D");
682  m_MSTree->Branch("Positive_Eta", &m_positive_eta, "Positive_Eta/D");
683  m_MSTree->Branch("Positive_z0", &m_positive_z0, "Positive_z0/D");
684  m_MSTree->Branch("Positive_d0", &m_positive_d0, "Positive_d0/D");
685  m_MSTree->Branch("Positive_z0_err", &m_positive_z0_err, "Positive_z0_err/D");
686  m_MSTree->Branch("Positive_d0_err", &m_positive_d0_err, "Positive_d0_err/D");
687  m_MSTree->Branch("Positive_sigma_pt", &m_positive_sigma_pt, "Positive_sigma_pt/D");
688  }
689 
690  if( m_isMC && !m_truthTree ){
691  m_truthTree = new TTree(m_truthTreeName.c_str(), m_ValidationTreeDescription.c_str());
692 
693  m_truthTree->Branch("runNumber" , &m_runNumber, "runNumber/I");
694  m_truthTree->Branch("eventNumber" , &m_evtNumber, "eventNumber/I");
695  m_truthTree->Branch("lumi_block" , &m_lumi_block, "lumi_block/I");
696  m_truthTree->Branch("preScale" , &m_triggerPrescale, "preScale/I");
697 
698  m_truthTree->Branch("Negative_Px", &m_negative_px, "Negative_Px/D");
699  m_truthTree->Branch("Negative_Py", &m_negative_py, "Negative_Py/D");
700  m_truthTree->Branch("Negative_Pt", &m_negative_pt, "Negative_Pt/D");
701  m_truthTree->Branch("Negative_Pz", &m_negative_pz, "Negative_Pz/D");
702  m_truthTree->Branch("Negative_Phi", &m_negative_phi, "Negative_Phi/D");
703  m_truthTree->Branch("Negative_Eta", &m_negative_eta, "Negative_Eta/D");
704  m_truthTree->Branch("Negative_z0", &m_negative_z0, "Negative_z0/D");
705  m_truthTree->Branch("Negative_d0", &m_negative_d0, "Negative_d0/D");
706  m_truthTree->Branch("Negative_z0_err", &m_negative_z0_err, "Negative_z0_err/D");
707  m_truthTree->Branch("Negative_d0_err", &m_negative_d0_err, "Negative_d0_err/D");
708  m_truthTree->Branch("Negative_parent", &m_negative_parent, "Negative_parent/I");
709 
710  m_truthTree->Branch("Positive_Px", &m_positive_px, "Positive_Px/D");
711  m_truthTree->Branch("Positive_Py", &m_positive_py, "Positive_Py/D");
712  m_truthTree->Branch("Positive_Pt", &m_positive_pt, "Positive_Pt/D");
713  m_truthTree->Branch("Positive_Pz", &m_positive_pz, "Positive_Pz/D");
714  m_truthTree->Branch("Positive_Phi", &m_positive_phi, "Positive_Phi/D");
715  m_truthTree->Branch("Positive_Eta", &m_positive_eta, "Positive_Eta/D");
716  m_truthTree->Branch("Positive_z0", &m_positive_z0, "Positive_z0/D");
717  m_truthTree->Branch("Positive_d0", &m_positive_d0, "Positive_d0/D");
718  m_truthTree->Branch("Positive_z0_err", &m_positive_z0_err, "Positive_z0_err/D");
719  m_truthTree->Branch("Positive_d0_err", &m_positive_d0_err, "Positive_d0_err/D");
720  m_truthTree->Branch("Positive_parent", &m_positive_parent, "Positive_parent/I");
721  }
722 
724  ATH_MSG_INFO("initialize() ** defining m_FourMuTree ");
725  m_FourMuTree = new TTree((m_FourMuTreeName).c_str(), "Four Muon monitoring");
726 
727  m_FourMuTree->Branch("runNumber" , &m_runNumber, "runNumber/I");
728  m_FourMuTree->Branch("eventNumber", &m_evtNumber, "eventNumber/I");
729  m_FourMuTree->Branch("lumi_block" , &m_lumi_block, "lumi_block/I");
730  m_FourMuTree->Branch("mu" , &m_event_mu, "mu/I");
731  m_FourMuTree->Branch("preScale" , &m_triggerPrescale, "preScale/I");
732  m_FourMuTree->Branch("nVertex" , &m_nVertex, "nVertex/I");
733 
734  m_FourMuTree->Branch("Negative_1_Px", &m_negative_px, "Negative_1_Px/D");
735  m_FourMuTree->Branch("Negative_1_Py", &m_negative_py, "Negative_1_Py/D");
736  m_FourMuTree->Branch("Negative_1_Pz", &m_negative_pz, "Negative_1_Pz/D");
737  m_FourMuTree->Branch("Negative_1_z0", &m_negative_z0, "Negative_1_z0/D");
738  m_FourMuTree->Branch("Negative_1_d0", &m_negative_d0, "Negative_1_d0/D");
739  m_FourMuTree->Branch("Negative_1_z0_err", &m_negative_z0_err, "Negative_1_z0_err/D");
740  m_FourMuTree->Branch("Negative_1_d0_err", &m_negative_d0_err, "Negative_1_d0_err/D");
741  m_FourMuTree->Branch("Negative_1_vtx", &m_negative_1_vtx, "Negative_1_vtx/I"); // vertex identifier
742 
743  m_FourMuTree->Branch("Negative_2_Px", &m_negative_2_px, "Negative_2_Px/D");
744  m_FourMuTree->Branch("Negative_2_Py", &m_negative_2_py, "Negative_2_Py/D");
745  m_FourMuTree->Branch("Negative_2_Pz", &m_negative_2_pz, "Negative_2_Pz/D");
746  m_FourMuTree->Branch("Negative_2_z0", &m_negative_2_z0, "Negative_2_z0/D");
747  m_FourMuTree->Branch("Negative_2_d0", &m_negative_2_d0, "Negative_2_d0/D");
748  m_FourMuTree->Branch("Negative_2_z0_err", &m_negative_2_z0_err, "Negative_2_z0_err/D");
749  m_FourMuTree->Branch("Negative_2_d0_err", &m_negative_2_d0_err, "Negative_2_d0_err/D");
750  m_FourMuTree->Branch("Negative_2_vtx", &m_negative_2_vtx, "Negative_2_vtx/I");
751 
752  m_FourMuTree->Branch("Positive_1_Px", &m_positive_px, "Positive_1_Px/D");
753  m_FourMuTree->Branch("Positive_1_Py", &m_positive_py, "Positive_1_Py/D");
754  m_FourMuTree->Branch("Positive_1_Pz", &m_positive_pz, "Positive_1_Pz/D");
755  m_FourMuTree->Branch("Positive_1_z0", &m_positive_z0, "Positive_1_z0/D");
756  m_FourMuTree->Branch("Positive_1_d0", &m_positive_d0, "Positive_1_d0/D");
757  m_FourMuTree->Branch("Positive_1_z0_err", &m_positive_z0_err, "Positive_1_z0_err/D");
758  m_FourMuTree->Branch("Positive_1_d0_err", &m_positive_d0_err, "Positive_1_d0_err/D");
759  m_FourMuTree->Branch("Positive_1_vtx", &m_positive_1_vtx, "Positive_1_vtx/I");
760 
761  m_FourMuTree->Branch("Positive_2_Px", &m_positive_2_px, "Positive_1_Px/D");
762  m_FourMuTree->Branch("Positive_2_Py", &m_positive_2_py, "Positive_1_Py/D");
763  m_FourMuTree->Branch("Positive_2_Pz", &m_positive_2_pz, "Positive_1_Pz/D");
764  m_FourMuTree->Branch("Positive_2_z0", &m_positive_2_z0, "Positive_1_z0/D");
765  m_FourMuTree->Branch("Positive_2_d0", &m_positive_2_d0, "Positive_1_d0/D");
766  m_FourMuTree->Branch("Positive_2_z0_err", &m_positive_2_z0_err,"Positive_1_z0_err/D");
767  m_FourMuTree->Branch("Positive_2_d0_err", &m_positive_2_d0_err,"Positive_1_d0_err/D");
768  m_FourMuTree->Branch("Positive_2_vtx", &m_positive_2_vtx, "Positive_2_vtx/I");
769 
770  // electrons
771  m_FourMuTree->Branch("ElNegative_1_Px", &m_el_negative1_px, "ElNegative_1_Px/D");
772  m_FourMuTree->Branch("ElNegative_1_Py", &m_el_negative1_py, "ElNegative_1_Py/D");
773  m_FourMuTree->Branch("ElNegative_1_Pz", &m_el_negative1_pz, "ElNegative_1_Pz/D");
774  m_FourMuTree->Branch("ElNegative_1_z0", &m_el_negative1_z0, "ElNegative_1_z0/D");
775  m_FourMuTree->Branch("ElNegative_1_d0", &m_el_negative1_d0, "ElNegative_1_d0/D");
776  m_FourMuTree->Branch("ElNegative_1_z0_err", &m_el_negative1_z0_err, "ElNegative_1_z0_err/D");
777  m_FourMuTree->Branch("ElNegative_1_d0_err", &m_el_negative1_d0_err, "ElNegative_1_d0_err/D");
778  m_FourMuTree->Branch("ElNegative_1_vtx", &m_el_negative1_vtx, "ElNegative_1_vtx/I"); // vertex identifier
779 
780  m_FourMuTree->Branch("ElNegative_2_Px", &m_el_negative2_px, "ElNegative_2_Px/D");
781  m_FourMuTree->Branch("ElNegative_2_Py", &m_el_negative2_py, "ElNegative_2_Py/D");
782  m_FourMuTree->Branch("ElNegative_2_Pz", &m_el_negative2_pz, "ElNegative_2_Pz/D");
783  m_FourMuTree->Branch("ElNegative_2_z0", &m_el_negative2_z0, "ElNegative_2_z0/D");
784  m_FourMuTree->Branch("ElNegative_2_d0", &m_el_negative2_d0, "ElNegative_2_d0/D");
785  m_FourMuTree->Branch("ElNegative_2_z0_err", &m_el_negative2_z0_err, "ElNegative_2_z0_err/D");
786  m_FourMuTree->Branch("ElNegative_2_d0_err", &m_el_negative2_d0_err, "ElNegative_2_d0_err/D");
787  m_FourMuTree->Branch("ElNegative_2_vtx", &m_el_negative2_vtx, "ElNegative_2_vtx/I"); // vertex identifier
788 
789  m_FourMuTree->Branch("ElPositive_1_Px", &m_el_positive1_px, "ElPositive_1_Px/D");
790  m_FourMuTree->Branch("ElPositive_1_Py", &m_el_positive1_py, "ElPositive_1_Py/D");
791  m_FourMuTree->Branch("ElPositive_1_Pz", &m_el_positive1_pz, "ElPositive_1_Pz/D");
792  m_FourMuTree->Branch("ElPositive_1_z0", &m_el_positive1_z0, "ElPositive_1_z0/D");
793  m_FourMuTree->Branch("ElPositive_1_d0", &m_el_positive1_d0, "ElPositive_1_d0/D");
794  m_FourMuTree->Branch("ElPositive_1_z0_err", &m_el_positive1_z0_err, "ElPositive_1_z0_err/D");
795  m_FourMuTree->Branch("ElPositive_1_d0_err", &m_el_positive1_d0_err, "ElPositive_1_d0_err/D");
796  m_FourMuTree->Branch("ElPositive_1_vtx", &m_el_positive1_vtx, "ElPositive_1_vtx/I"); // vertex identifier
797 
798  m_FourMuTree->Branch("ElPositive_2_Px", &m_el_positive2_px, "ElPositive_2_Px/D");
799  m_FourMuTree->Branch("ElPositive_2_Py", &m_el_positive2_py, "ElPositive_2_Py/D");
800  m_FourMuTree->Branch("ElPositive_2_Pz", &m_el_positive2_pz, "ElPositive_2_Pz/D");
801  m_FourMuTree->Branch("ElPositive_2_z0", &m_el_positive2_z0, "ElPositive_2_z0/D");
802  m_FourMuTree->Branch("ElPositive_2_d0", &m_el_positive2_d0, "ElPositive_2_d0/D");
803  m_FourMuTree->Branch("ElPositive_2_z0_err", &m_el_positive2_z0_err, "ElPositive_2_z0_err/D");
804  m_FourMuTree->Branch("ElPositive_2_d0_err", &m_el_positive2_d0_err, "ElPositive_2_d0_err/D");
805  m_FourMuTree->Branch("ElPositive_2_vtx", &m_el_positive2_vtx, "ElPositive_2_vtx/I"); // vertex identifier
806 
807  // other quantities
808  m_FourMuTree->Branch("minv4mu", &m_4mu_minv, "minv4mu/D");
809  m_FourMuTree->Branch("pv_x", &m_pv_x , "pv_x/D");
810  m_FourMuTree->Branch("pv_y", &m_pv_y , "pv_y/D");
811  m_FourMuTree->Branch("pv_z", &m_pv_z , "pv_z/D");
812  m_FourMuTree->Branch("nTrkInVtx", &m_nTrkInVtx, "nTrkInVtx/I");
813 
814  m_FourMuTree->Branch("met", &m_met, "met/D");
815  m_FourMuTree->Branch("metphi", &m_metphi, "metphi/D");
816  }
817 
818  // now register the Trees
819  ATH_MSG_INFO("initialize() Going to register the mu+mu- trees");
820  ServiceHandle<ITHistSvc> tHistSvc("THistSvc", name());
821  if (tHistSvc.retrieve().isFailure()){
822  ATH_MSG_ERROR("initialize() Could not find Hist Service -> Switching ValidationMode Off !");
823  m_validationMode = false;
824  }
825 
826  if (m_commonTree) {
827  if ((tHistSvc->regTree(m_commonTreeFolder, m_commonTree)).isSuccess() ) {
828  ATH_MSG_INFO("initialize() commonTree succesfully registered!");
829  }
830  else {
831  ATH_MSG_ERROR("initialize() Could not register the validation commonTree -> Switching ValidationMode Off !");
832  delete m_commonTree; m_commonTree = nullptr;
833  m_validationMode = false;
834  }
835  }
836 
837  if (m_IDTree) {
838  if ((tHistSvc->regTree(m_IDTreeFolder, m_IDTree)).isSuccess() ) {
839  ATH_MSG_INFO("initialize() IDTree succesfully registered!");
840  }
841  else {
842  ATH_MSG_ERROR("initialize() Could not register the validation IDTree -> Switching ValidationMode Off !");
843  delete m_IDTree; m_IDTree = nullptr;
844  m_validationMode = false;
845  }
846  }
847 
848  if ( m_skipMS ) {
849  ATH_MSG_INFO("CBtree has to be skipped: flag ON");
850  delete m_combTree; m_combTree = nullptr;
851  }
852  else {
853  if (m_combTree) {
854  if ((tHistSvc->regTree(m_combTreeFolder, m_combTree)).isSuccess() ) {
855  ATH_MSG_INFO("initialize() CBTree succesfully registered!");
856  }
857  else {
858  ATH_MSG_ERROR("initialize() Could not register the validation CBTree -> Switching ValidationMode Off !");
859  delete m_combTree; m_combTree = nullptr;
860  m_validationMode = false;
861  }
862  }
863  }
864 
865  if ( m_skipMS ) {
866  ATH_MSG_INFO("MStree has to be skipped: flag ON");
867  delete m_MSTree; m_MSTree = nullptr;
868  }
869  else {
870  if (m_MSTree) {
871  if ( (tHistSvc->regTree(m_MSTreeFolder, m_MSTree)).isSuccess() ){
872  ATH_MSG_INFO("initialize() MSTree succesfully registered!");
873  }
874  else {
875  ATH_MSG_ERROR("initialize() Could not register the validation MSTree -> Switching ValidationMode Off !");
876  delete m_MSTree; m_MSTree = nullptr;
877  m_validationMode = false;
878  }
879  }
880  }
881 
882  if( m_doRefit ){
883  if (m_refit1Tree) {
884  if ((tHistSvc->regTree(m_refit1TreeFolder, m_refit1Tree)).isSuccess() ) {
885  ATH_MSG_INFO("initialize() Refit1 Tree succesfully registered!");
886  }
887  else{
888  ATH_MSG_ERROR("initialize() Could not register the validation Tree -> Switching ValidationMode Off !");
889  delete m_refit1Tree; m_refit1Tree = nullptr;
890  m_validationMode = false;
891  }
892  }
893 
894  if (m_refit2Tree) {
895  if ((tHistSvc->regTree(m_refit2TreeFolder, m_refit2Tree)).isSuccess() ) {
896  ATH_MSG_INFO("initialize() Refit2 Tree succesfully registered!");
897  }
898  else {
899  ATH_MSG_ERROR("initialize() Could not register the validation Tree -> Switching ValidationMode Off !");
900  delete m_refit2Tree; m_refit2Tree = nullptr;
901  m_validationMode = false;
902  }
903  }
904  }
905 
906  if (m_isMC) {
907  if ((tHistSvc->regTree(m_truthTreeFolder, m_truthTree)).isSuccess() ) {
908  ATH_MSG_INFO("initialize() truthTree Tree succesfully registered!");
909  }
910  else {
911  ATH_MSG_ERROR("initialize() Could not register the validation truth Tree -> Switching ValidationMode Off !");
912  delete m_truthTree; m_truthTree = nullptr;
913  m_validationMode = false;
914  }
915  }
916 
917  if (m_doFourMuAnalysis) {
918  if ((tHistSvc->regTree(m_FourMuTreeFolder, m_FourMuTree)).isSuccess() ) {
919  ATH_MSG_INFO("initialize() FourMu Tree succesfully registered!");
920  }
921  else {
922  ATH_MSG_ERROR("initialize() Could not register the validation FourMu Tree -> Switching ValidationMode Off !");
923  delete m_FourMuTree; m_FourMuTree = nullptr;
924  m_validationMode = false;
925  }
926  }
927 
928  return StatusCode::SUCCESS;
929 }
930 
931 
932 //==================================================================================
934 {
935  return;
936 }
937 
938 
939 //==================================================================================
941 {
942  ATH_MSG_DEBUG("** IDPerfMonZmumu::execute ** START **");
943 
944  SG::ReadHandle<xAOD::EventInfo> eventInfo (m_EventInfoKey, getContext());
945  if(eventInfo.isValid()) {
946  m_runNumber = eventInfo->runNumber();
947  m_evtNumber = eventInfo->eventNumber();
948  m_lumi_block = eventInfo->lumiBlock();
950  if (eventInfo->mcEventWeights().size()>0) {
951  m_event_weight = eventInfo->mcEventWeights()[0];
952  }
953  else {
954  m_event_weight = 1.; // default
955  }
956  ATH_MSG_DEBUG(" Execute() starting on --> Run: " << m_runNumber << " event: " << m_evtNumber << " Lumiblock: " << m_lumi_block << " weight:" << m_event_weight);
957  }
958  else {
959  ATH_MSG_DEBUG(" IDPerfMonZmumu::execute evtStore->retrieve (eventInfo) failed .. trying another strategy.. ");
961  if (eventInfo2.isValid()) {
962  m_runNumber = eventInfo2->runNumber();
963  m_evtNumber = eventInfo2->eventNumber();
964  m_lumi_block = eventInfo2->lumiBlock();
966  if (eventInfo->mcEventWeights().size()>0) {
967  m_event_weight = eventInfo->mcEventWeights()[0];
968  }
969  else {
970  m_event_weight = 1.; // default
971  }
972  ATH_MSG_DEBUG(" Execute() starting on --> Run: " << m_runNumber << " event: " << m_evtNumber << " Lumiblock: " << m_lumi_block << " weight:" << m_event_weight);
973  }
974  else{
975  ATH_MSG_ERROR("** IDPerfMonZmumu::execute ** Could not retrieve event info.");
976  }
977  }
978 
980  if (m_doFourMuAnalysis) {
981  ATH_MSG_DEBUG(" ** IDPerfMonZmumu::execute ** calling FourLeptonAnalysis()...");
982  StatusCode fourLeptAnaStatus = this->RunFourLeptonAnalysis();
983  if (fourLeptAnaStatus.isSuccess()) ATH_MSG_INFO (" ** IDPerfMonZmumu::execute ** RunFourLeptonAnalysis() SUCCESS -> found a new event");
984  }
986 
987 
988  // check if the muon-pair passed the resonance selection cuts:
989  ATH_MSG_DEBUG(" ** IDPerfMonZmumu::execute ** calling dimuon analysis m_xZmm.Reco()...");
990  if( m_xZmm.Reco( m_lumi_block ) ){
991  ATH_MSG_INFO( " Run: " << m_runNumber
992  << " event: " << m_evtNumber
993  << " Lumiblock: " << m_lumi_block
994  << " Invariant mass = " << m_xZmm.GetInvMass() << " GeV "
995  << " weight: " << m_event_weight
996  << " ** SUCCESS **");
997  }
998  else {
999  ATH_MSG_DEBUG( " Run: " << m_runNumber
1000  << " event: " << m_evtNumber
1001  << " Lumiblock: " << m_lumi_block
1002  << " Failed dimuon reconstruction. m_xZmm.Reco() returned FALSE ");
1003  return StatusCode::SUCCESS;
1004  }
1005 
1006  //
1007  // If this point is reached -> there is a good mu+mu- pair that stisfies all selection cuts
1008  //
1009 
1010  if (m_UseTrigger) {
1011  StatusCode isTriggerPassed = CheckTriggerStatusAndPrescale ();
1012  if (isTriggerPassed == StatusCode::SUCCESS) {
1013  ATH_MSG_DEBUG("Trigger passed -> accept event");
1014  }
1015  else{
1016  ATH_MSG_DEBUG("Trigger Failed -> reject event --> leave event");
1017  return StatusCode::SUCCESS;
1018  }
1019  }
1020 
1021  // std::cout << " ** IDPerfMonZmumu ** extracting muon_pos and muon_neg... " << std::endl;
1024 
1025  const xAOD::TrackParticle* ppos_comb = nullptr; const xAOD::Vertex* ppos_comb_v = nullptr;
1026  const xAOD::TrackParticle* pneg_comb = nullptr; const xAOD::Vertex* pneg_comb_v = nullptr;
1027 
1028  //To protect against failures of the estimation
1029  StatusCode success_pos = StatusCode::FAILURE;
1030  StatusCode success_neg = StatusCode::FAILURE;
1031 
1032  if (muon_pos && muon_neg) { // if both combined muons exist and were sucessfully retrieved
1033  ATH_MSG_DEBUG("** IDPerfMonZmumu::execute ** combined muons exist ** retrieving their m_trackparticleName: " << m_trackParticleName.c_str());
1034 
1035  if (m_trackParticleName.find("InnerDetectorTrackParticles") != std::string::npos) {
1036  ATH_MSG_INFO("** IDPerfMonZmumu::execute ** Retrieving InnerDetectorTrackParticles of the accepted muons");
1037  ppos_comb = muon_pos->trackParticle(xAOD::Muon::InnerDetectorTrackParticle);
1038  pneg_comb = muon_neg->trackParticle(xAOD::Muon::InnerDetectorTrackParticle);
1039 
1040  if (!ppos_comb || !pneg_comb) {
1041  ATH_MSG_WARNING("** IDPerfMonZmumu::execute ** InnerDetectorTrackParticles are requested but they are not present. Exiting event.");
1042  return StatusCode::SUCCESS;
1043  }
1044  } // InnerDetectorTrackParticles
1045  if (m_trackParticleName.find("CombinedTrackParticle") != std::string::npos) {
1046  //
1047  ATH_MSG_DEBUG("** IDPerfMonZmumu::execute ** Retrieving CombinedTrackParticles of the accepted muons");
1048  ppos_comb = muon_pos->trackParticle(xAOD::Muon::CombinedTrackParticle);
1049  pneg_comb = muon_neg->trackParticle(xAOD::Muon::CombinedTrackParticle);
1050 
1051  if (!ppos_comb || !pneg_comb){
1052  ATH_MSG_WARNING( "** IDPerfMonZmumu::execute ** CombinedTrackParticles are requested but they are not present. Exiting event.");
1053  return StatusCode::SUCCESS;
1054  }
1055  } // combined tracks
1056 
1057 
1058  // double check
1059  if (ppos_comb && pneg_comb) {
1060  ATH_MSG_DEBUG("** IDPerfMonZmumu::execute ** successfull retrieval of muons as " << m_trackParticleName << ". ppos_comb & pneg_comb both exist");
1061  }
1062  else {
1063  ATH_MSG_WARNING("** IDPerfMonZmumu::execute ** problems retrieving muons as " << m_trackParticleName <<". ppos_comb or pneg_comb are not available");
1064  }
1065 
1066 
1067  // vertex
1068  const EventContext& ctx = Gaudi::Hive::currentContext();
1070  for (const auto V : *vertices) {
1071  if (V->vertexType() == xAOD::VxType::VertexType::PriVtx) {
1072  // primaryVertex =V;
1073  ppos_comb_v = V;
1074  pneg_comb_v = V;
1075  break;
1076  }
1077  } // vertex
1078 
1079  // before continuing check both particles have vertex
1080  if (!ppos_comb_v || !pneg_comb_v){
1081  ATH_MSG_WARNING( "Some or all of the requested particles have no vertex. Exiting event");
1082  return StatusCode::SUCCESS;
1083  }
1084  } // if (muon_pos && muon_neg)
1085  else { // this is the else of --> if (muon_pos && muon_neg)
1086  ATH_MSG_WARNING("** IDPerfMonZmumu::execute ** Could not find CombinedMuon pos/neg in event"
1087  << " Run: " << m_runNumber
1088  << " event: " << m_evtNumber
1089  << " Lumiblock: " << m_lumi_block );
1090  return StatusCode::SUCCESS;
1091  }
1092 
1093  //
1094  // If this point is reached -> there is a good mu+mu- pair and the muons have been associated to a vertex
1095  // So, ntuple can be filled
1096  //
1097  if ( m_xZmm.AcceptEvent() ) {
1098  ATH_MSG_DEBUG("** IDPerfMonZmumu::execute ** Going to fill ntuples for Run: " << m_runNumber
1099  << " event: " << m_evtNumber
1100  << " Lumiblock: " << m_lumi_block
1101  << " Invariant mass = " << m_xZmm.GetInvMass() << " GeV ** some preliminaries are due though...");
1102 
1104  // The track selection is applied to the InnerDetectorTrackParticle of the muons
1105  if ( !m_selTool->accept(muon_pos->trackParticle(xAOD::Muon::InnerDetectorTrackParticle)) ) {
1106  ATH_MSG_DEBUG("Exiting because the ID segment of muon_pos do not pass the TrackSelection");
1107  return StatusCode::SUCCESS;
1108  }
1109  if ( !m_selTool->accept(muon_neg->trackParticle(xAOD::Muon::InnerDetectorTrackParticle)) ) {
1110  ATH_MSG_DEBUG("Exiting because the ID segment of muon_neg do not pass the TrackSelection");
1111  return StatusCode::SUCCESS;
1112  }
1113  ATH_MSG_DEBUG("** IDPerfMonZmumu::execute ** Good news ** pos and neg muon->trackParticle(xAOD::Muon::InnerDetectorTrackParticle) pass the trackSelection :)");
1114  }
1115  else {
1116  ATH_MSG_DEBUG("** IDPerfMonZmumu::execute ** Track selection is not in use ");
1117  }
1118 
1119  ATH_MSG_DEBUG("** IDPerfMonZmumu::execute ** >> before fill rec with default: " << m_trackParticleName << " tracks << ");
1120 
1121  if (m_storeZmumuNtuple) {
1122  // reset vectors
1123  this->ResetCommonNtupleVectors();
1124 
1125  // Fill Inner Detector Tree
1126  ATH_MSG_DEBUG("-- >> going to fill ID muons params << --");
1127  success_pos = FillRecParametersTP (muon_pos->trackParticle(xAOD::Muon::InnerDetectorTrackParticle),
1128  muon_pos->trackParticle(xAOD::Muon::InnerDetectorTrackParticle),
1129  muon_pos->trackParticle(xAOD::Muon::InnerDetectorTrackParticle)->charge(),
1130  ppos_comb_v);
1131  success_neg = FillRecParametersTP (muon_neg->trackParticle(xAOD::Muon::InnerDetectorTrackParticle),
1132  muon_neg->trackParticle(xAOD::Muon::InnerDetectorTrackParticle),
1133  muon_neg->trackParticle(xAOD::Muon::InnerDetectorTrackParticle)->charge(),
1134  pneg_comb_v);
1135 
1136  if (success_pos && success_neg) {
1137  // before filling the ntuple, extract the hits information. This is filled once and it is used for all track collections
1138  this->ExtractIDHitsInformation(muon_pos, muon_neg);
1139 
1140  // Fill ntuple
1141  if (m_IDTree != nullptr) {
1142  ATH_MSG_DEBUG("-- Filling m_IDTree ntuple " << m_IDTree->GetName() << " entry " << m_IDTree->GetEntries()
1143  << " for run: " << m_runNumber
1144  << " event: " << m_evtNumber
1145  << " Lumiblock: " << m_lumi_block
1146  << " Invariant mass = " << m_xZmm.GetInvMass() << " GeV ");
1147  }
1148  ATH_MSG_DEBUG("mu+ --> pxyz " << m_positive_px
1149  << ", " << m_positive_py
1150  << ", " << m_positive_pz
1151  << " pt: " << muon_pos->trackParticle(xAOD::Muon::InnerDetectorTrackParticle)->pt()
1152  << " d0: " << m_positive_d0
1153  << " z0: " << m_positive_z0
1154  << " d0unc: " << m_positive_d0_err
1155  << " sigma_pt: " << m_positive_sigma_pt);
1156  ATH_MSG_DEBUG("mu- --> pxyz: " << m_negative_px
1157  << ", " << m_negative_py
1158  << ", " << m_negative_pz
1159  << " pt: " << muon_neg->trackParticle(xAOD::Muon::InnerDetectorTrackParticle)->pt()
1160  << " d0: " << m_negative_d0
1161  << " z0: " << m_negative_z0
1162  << " d0unc: " << m_negative_d0_err
1163  << " sigma_pt: " << m_negative_sigma_pt);
1164  // ntuple variables have been filled in FillRecParametersTP
1165  if (m_IDTree) m_IDTree->Fill();
1166 
1167  // Fill vectors for common ntuple
1168  m_IDTrack_pt.push_back(m_positive_pt);
1169  m_IDTrack_pt.push_back(m_negative_pt);
1170  m_IDTrack_eta.push_back(m_positive_eta);
1171  m_IDTrack_eta.push_back(m_negative_eta);
1172  m_IDTrack_phi.push_back(m_positive_phi);
1173  m_IDTrack_phi.push_back(m_negative_phi);
1174  m_IDTrack_d0.push_back(m_positive_d0);
1175  m_IDTrack_d0.push_back(m_negative_d0);
1176  m_IDTrack_z0.push_back(m_positive_z0);
1177  m_IDTrack_z0.push_back(m_negative_z0);
1180 
1189  }
1190  else {
1191  ATH_MSG_DEBUG("** IDPerfMonZmumu::execute ** not filling IDTracks in combTree due to problems with muon_xxx->trackParticle(xAOD::Muon::InnerDetectorTrackParticle)");
1192  }
1193  // End of fill ID Tree
1194 
1195  //
1196  // combined muons ntuple
1197  if ((!m_skipMS && m_combTree) || m_commonTree ) { // if skipMS -> no combined muons
1198  success_pos = FillRecParametersTP(muon_pos->trackParticle(xAOD::Muon::CombinedTrackParticle),
1199  muon_pos->trackParticle(xAOD::Muon::InnerDetectorTrackParticle),
1200  ppos_comb->charge(),
1201  ppos_comb_v);
1202  ATH_MSG_DEBUG("** IDPerfMonZmumu::execute ** success_pos TP pt: " << m_positive_pt << " GeV");
1203  success_neg = FillRecParametersTP(muon_neg->trackParticle(xAOD::Muon::CombinedTrackParticle),
1204  muon_neg->trackParticle(xAOD::Muon::InnerDetectorTrackParticle),
1205  pneg_comb->charge(),
1206  pneg_comb_v);
1207  ATH_MSG_DEBUG("** IDPerfMonZmumu::excute ** success_neg TP pt: " << m_negative_pt << " GeV");
1208 
1209  if (success_pos && success_neg) {
1210  if (m_combTree != nullptr) {
1211  ATH_MSG_DEBUG("-- Filling m_combTree ntuple " << m_combTree->GetName() << " entry " << m_combTree->GetEntries()
1212  << " run: " << m_runNumber
1213  << " event: " << m_evtNumber
1214  << " Lumiblock: " << m_lumi_block
1215  << " Invariant mass = " << m_xZmm.GetInvMass() << " GeV ");
1216  }
1217  ATH_MSG_DEBUG("mu+ --> pxyz " << m_positive_px
1218  << ", " << m_positive_py
1219  << ", " << m_positive_pz
1220  << " pt: " << m_positive_pt
1221  << " d0: " << m_positive_d0
1222  << " z0: " << m_positive_z0
1223  << " d0unc: " << m_positive_d0_err);
1224  ATH_MSG_DEBUG("mu- --> pxyz: " << m_negative_px
1225  << ", " << m_negative_py
1226  << ", " << m_negative_pz
1227  << " pt: " << m_negative_pt
1228  << " d0: " << m_negative_d0
1229  << " z0: " << m_negative_z0
1230  << " d0unc: " << m_negative_d0_err);
1231  // ntuple variables have been filled in FillRecParameters
1232  if (m_combTree) m_combTree->Fill();
1233  }
1234  // Fill vectors for common ntuple
1235  m_CBTrack_pt.push_back(m_positive_pt);
1236  m_CBTrack_pt.push_back(m_negative_pt);
1237  m_CBTrack_eta.push_back(m_positive_eta);
1238  m_CBTrack_eta.push_back(m_negative_eta);
1239  m_CBTrack_phi.push_back(m_positive_phi);
1240  m_CBTrack_phi.push_back(m_negative_phi);
1241  m_CBTrack_d0.push_back(m_positive_d0);
1242  m_CBTrack_d0.push_back(m_negative_d0);
1243  m_CBTrack_z0.push_back(m_positive_z0);
1244  m_CBTrack_z0.push_back(m_negative_z0);
1247 
1256  } // if skipMS -> no combined muons
1257 
1258 
1259 
1260  // MS ntuple
1261  if (!m_skipMS && m_MSTree) { // if skipMS -> no MS tracks
1262  ATH_MSG_DEBUG("-- >> going to fill MS muons params << --");
1264  muon_pos->trackParticle(xAOD::Muon::InnerDetectorTrackParticle),
1265  ppos_comb->charge(),
1266  ppos_comb_v);
1267 
1269  muon_neg->trackParticle(xAOD::Muon::InnerDetectorTrackParticle),
1270  pneg_comb->charge(),
1271  pneg_comb_v);
1272  if (success_pos && success_neg) {
1273  if (m_MSTree != nullptr) ATH_MSG_DEBUG("-- Filling m_MSTree " << m_MSTree->GetName() << " entry " << m_MSTree->GetEntries()
1274  << " run: " << m_runNumber
1275  << " event: " << m_evtNumber
1276  << " Lumiblock: " << m_lumi_block
1277  << " Invariant mass = " << m_xZmm.GetInvMass() << " GeV ");
1278  ATH_MSG_DEBUG("mu+ --> pxyz " << m_positive_px
1279  << ", " << m_positive_py
1280  << " pt: " << m_xZmm.getMSTrack(m_xZmm.getPosMuon(ZmumuEvent::CB))->pt()
1281  << " d0: " << m_positive_d0
1282  << " z0: " << m_positive_z0
1283  << " d0unc: " << m_positive_d0_err);
1284  ATH_MSG_DEBUG("mu- --> pxyz: " << m_negative_px
1285  << ", " << m_negative_py
1286  << " pt: " << m_xZmm.getMSTrack(m_xZmm.getNegMuon(ZmumuEvent::CB))->pt()
1287  << " d0: " << m_negative_d0
1288  << " z0: " << m_negative_z0
1289  << " d0unc: " << m_negative_d0_err);
1290  // ntuple variables have been filled in FillRecParametersTP
1291  if (m_MSTree) m_MSTree->Fill();
1292  }
1293  else {
1294  ATH_MSG_INFO("FAILED filling m_MSTree "
1295  << " for run: " << m_runNumber
1296  << " event: " << m_evtNumber
1297  << " Lumiblock: " << m_lumi_block);
1298  }
1299  // MS ntuple
1300  }
1301  } // if store Zmumu ntuple
1302 
1303  // changed refitting to combined particles since run II DESDM_ZMUMU did not store InDetTrackParticles
1304  if( m_doRefit ) {
1305  ATH_MSG_DEBUG("** IDPerfMonZmumu::execute ** Going to build TrackCollections: muonTrks, muonTrksRefit1 and muonTrksRefit2");
1307  TrackCollection* muonTrksRefit1 = new TrackCollection(SG::OWN_ELEMENTS);
1308  TrackCollection* muonTrksRefit2 = new TrackCollection(SG::OWN_ELEMENTS);
1309 
1310  ATH_MSG_DEBUG("** IDPerfMonZmumu::execute ** Going to refit and store the track parameters ");
1311  Trk::Track* defaultMuonTrk1{};
1312  Trk::Track* defaultMuonTrk2{};
1313  Trk::Track* refit1MuonTrk1{};
1314  Trk::Track* refit2MuonTrk1{};
1315  Trk::Track* refit1MuonTrk2{};
1316  Trk::Track* refit2MuonTrk2{};
1317 
1318  StatusCode fitStatus;
1319  //save default and refit track parameters
1320  const EventContext& ctx = Gaudi::Hive::currentContext();
1321  if( ppos_comb->track() ) {
1322  defaultMuonTrk1 = new Trk::Track(*ppos_comb->track());
1323 
1324  IegammaTrkRefitterTool::Cache fitResult{};
1325  fitStatus = m_TrackRefitter1->refitTrack( ctx, ppos_comb->track(), fitResult );
1326  if (fitStatus.isFailure()) {
1327  ATH_MSG_DEBUG("** IDPerfMonZmumu::execute ** Track Refit1 Failed for ppos_comb->track(). Skipping Event");
1328  return StatusCode::SUCCESS;
1329  } else {
1330  refit1MuonTrk1 = fitResult.refittedTrack.release();
1331  muonTrksRefit1->push_back(refit1MuonTrk1);
1332  ATH_MSG_DEBUG("** IDPerfMonZmumu::execute ** Track Refit1 Success of ppos_comb->track()."
1333  << " Original pt: " << ppos_comb->track()->perigeeParameters()->pT()
1334  << " track refit pt: " << refit1MuonTrk1->perigeeParameters()->pT() );
1335  }
1336 
1337 
1338  fitStatus = m_TrackRefitter2->refitTrack( ctx, ppos_comb->track(), fitResult );
1339  if (fitStatus.isFailure()) {
1340  ATH_MSG_DEBUG("** IDPerfMonZmumu::execute ** Track Refit2 Failed for ppos_comb->track(). Skipping Event");
1341  return StatusCode::SUCCESS;
1342  } else {
1343  refit2MuonTrk1 = fitResult.refittedTrack.release();
1344  muonTrksRefit2->push_back(refit2MuonTrk1);
1345  ATH_MSG_DEBUG("** IDPerfMonZmumu::execute ** Track Refit2 Success of ppos_comb->track()."
1346  << " Original pt: " << ppos_comb->track()->perigeeParameters()->pT()
1347  << " track refit pt: " << refit1MuonTrk1->perigeeParameters()->pT() );
1348  }
1349  }
1350 
1351  if( pneg_comb->track() ) {
1352  defaultMuonTrk2 = new Trk::Track(*pneg_comb->track());
1353 
1354  IegammaTrkRefitterTool::Cache fitResult {};
1355  fitStatus = m_TrackRefitter1->refitTrack( ctx, pneg_comb->track(), fitResult);
1356  if (fitStatus.isFailure()) {
1357  ATH_MSG_DEBUG("** IDPerfMonZmumu::execute ** Track Refit1 Failed. Skipping Event");
1358  return StatusCode::SUCCESS;
1359  } else {
1360  refit1MuonTrk2 = fitResult.refittedTrack.release();
1361  muonTrksRefit1->push_back(refit1MuonTrk2);
1362  ATH_MSG_DEBUG("** IDPerfMonZmumu::execute ** Track Refit1 Success of pneg_comb->track()."
1363  << " Original pt: " << pneg_comb->track()->perigeeParameters()->pT()
1364  << " track refit pt: " << refit1MuonTrk2->perigeeParameters()->pT() );
1365  }
1366 
1367 
1368  fitStatus = m_TrackRefitter2->refitTrack( ctx, pneg_comb->track(), fitResult );
1369  if (fitStatus.isFailure()) {
1370  ATH_MSG_DEBUG("Track Refit2 Failed. Skipping Event");
1371  return StatusCode::SUCCESS;
1372  } else {
1373  refit2MuonTrk2 = fitResult.refittedTrack.release();
1374  muonTrksRefit2->push_back(refit2MuonTrk2);
1375  ATH_MSG_DEBUG("** IDPerfMonZmumu::execute ** Track Refit2 Success of pneg_comb->track()."
1376  << " Original pt: " << pneg_comb->track()->perigeeParameters()->pT()
1377  << " track refit pt: " << refit2MuonTrk2->perigeeParameters()->pT() );
1378  }
1379 
1380  if (muonTrksRefit1->size() != 2) ATH_MSG_WARNING("** IDPerfMonZmumu::execute ** WARNING ** size of muonTrksRefit1: " << muonTrksRefit1->size());
1381  if (muonTrksRefit2->size() != 2) ATH_MSG_WARNING("** IDPerfMonZmumu::execute ** WARNING ** size of muonTrksRefit2: " << muonTrksRefit2->size());
1382  }
1383 
1384  //save tracks to storegrate, they can be used by InDetAlignmentMonitoring
1385  muonTrks->push_back(defaultMuonTrk1);
1386  muonTrks->push_back(defaultMuonTrk2);
1387 
1388  StatusCode sc = evtStore()->record(muonTrks, m_outputTracksName);
1389  if (sc.isSuccess()) {
1390  ATH_MSG_DEBUG ("Stored "<< muonTrks->size() << " " << m_outputTracksName <<" into StoreGate");
1391  }
1392  else{
1393  ATH_MSG_WARNING ("Failed storing " << m_outputTracksName);
1394  }
1395 
1396  if (muonTrksRefit1->size() > 1) { // keep track collection if at least 2 muons were found
1397  sc = evtStore()->record(muonTrksRefit1, m_outputTracksName + "Refit1");
1398  if (sc.isSuccess()) {
1399  ATH_MSG_DEBUG ("Stored "<< muonTrksRefit1->size() << " " << m_outputTracksName + "Refit1" << " into StoreGate");
1400  } else {
1401  ATH_MSG_WARNING ("Failed storing " << m_outputTracksName + "Refit1");
1402  }
1403  }
1404 
1405  if (muonTrksRefit2->size() > 1) { // keep track collection if at least 2 muons were found
1406  sc = evtStore()->record(muonTrksRefit2, m_outputTracksName + "Refit2");
1407  if (sc.isSuccess()) {
1408  ATH_MSG_DEBUG ("Stored "<< muonTrksRefit2->size() << " " << m_outputTracksName + "Refit2" << " into StoreGate");
1409  } else {
1410  ATH_MSG_WARNING ("Failed storing " << m_outputTracksName + "Refit2");
1411  }
1412  }
1413 
1414 
1415  //fill refit1 ID parameters
1416  if (muonTrksRefit1->size()<2) {
1417  ATH_MSG_WARNING("** IDPerfMonZmumu::execute ** Refit1 muon tracks are missing!");
1418  }
1419  else {
1420  ATH_MSG_DEBUG("** IDPerfMonZmumu::execute ** going to fill refit1tree ");
1421  success_pos = FillRecParametersSimple (refit1MuonTrk1, ppos_comb->charge(), ppos_comb_v);
1422  success_neg = FillRecParametersSimple (refit1MuonTrk2, pneg_comb->charge(), pneg_comb_v);
1423 
1424  if (m_storeZmumuNtuple) {
1425  if (success_pos && success_neg) {
1426  if (m_refit1Tree) {
1427  ATH_MSG_DEBUG("-- Filling ntuple " << m_refit1Tree->GetName() << " entry " << m_refit1Tree->GetEntries()
1428  << " for run: " << m_runNumber
1429  << " event: " << m_evtNumber
1430  << " Lumiblock: " << m_lumi_block
1431  << " Invariant mass = " << m_xZmm.GetInvMass() << " GeV ");
1432  }
1433  ATH_MSG_DEBUG("Negative p: (" << m_negative_px << ", "
1434  << m_negative_py << ", "
1435  << m_negative_pz << ") "
1436  << " d0: " << m_negative_d0
1437  << " z0: " << m_negative_z0
1438  << " sigma_pt: " << m_positive_sigma_pt);
1439  ATH_MSG_DEBUG("Positive p: (" << m_positive_px << ","
1440  << m_positive_py << ","
1441  << m_positive_pz << ") "
1442  << " d0: " << m_positive_d0
1443  << " z0: " << m_positive_z0
1444  << " sigma_pt: " << m_negative_sigma_pt);
1445  if (m_refit1Tree) {
1446  m_refit1Tree->Fill();
1447  }
1448  // Fill vectors for common ntuple
1449  m_Refit1_pt.push_back(m_positive_pt);
1450  m_Refit1_pt.push_back(m_negative_pt);
1451  m_Refit1_eta.push_back(m_positive_eta);
1452  m_Refit1_eta.push_back(m_negative_eta);
1453  m_Refit1_phi.push_back(m_positive_phi);
1454  m_Refit1_phi.push_back(m_negative_phi);
1455  m_Refit1_d0.push_back(m_positive_d0);
1456  m_Refit1_d0.push_back(m_negative_d0);
1457  m_Refit1_z0.push_back(m_positive_z0);
1458  m_Refit1_z0.push_back(m_negative_z0);
1459 
1466  } // if (success_pos && success_neg)
1467  } // if (m_storeZmumuNtuple)
1468  } // enough refit1 tracks
1469 
1470  //fill refit2 ID parameters
1471  if (muonTrksRefit2->size()<2) {
1472  ATH_MSG_WARNING("** IDPerfMonZmumu::execute ** Refit2 muon tracks are missing!");
1473  }
1474  else{
1475  ATH_MSG_DEBUG("-- >> going to fill refit2params << --");
1476  success_pos = FillRecParametersSimple (refit2MuonTrk1, ppos_comb->charge(), ppos_comb_v);
1477  success_neg = FillRecParametersSimple (refit2MuonTrk2, pneg_comb->charge(), pneg_comb_v);
1478 
1479  if (m_storeZmumuNtuple) {
1480  if (success_pos && success_neg) {
1481  if (m_refit2Tree) {
1482  ATH_MSG_DEBUG("-- Filling " << m_refit2Tree->GetName() << " entry " << m_refit2Tree->GetEntries()
1483  << " run: " << m_runNumber
1484  << " event: " << m_evtNumber
1485  << " Lumiblock: " << m_lumi_block
1486  << " Invariant mass = " << m_xZmm.GetInvMass() << " GeV ");
1487  }
1488  ATH_MSG_DEBUG("Negative p: (" << m_negative_px << ", "
1489  << m_negative_py << ", "
1490  << m_negative_pz << ") "
1491  << " d0: " << m_negative_d0
1492  << " z0: " << m_negative_z0
1493  << " sigma_pt: " << m_positive_sigma_pt);
1494  ATH_MSG_DEBUG("Positive p: (" << m_positive_px << ","
1495  << m_positive_py << ","
1496  << m_positive_pz << ") "
1497  << " d0: " << m_positive_d0
1498  << " z0: " << m_positive_z0
1499  << " sigma_pt: " << m_negative_sigma_pt);
1500  if (m_refit2Tree) {
1501  m_refit2Tree->Fill();
1502  }
1503  // Fill vectors for common ntuple
1504  m_Refit2_pt.push_back(m_positive_pt);
1505  m_Refit2_pt.push_back(m_negative_pt);
1506  m_Refit2_eta.push_back(m_positive_eta);
1507  m_Refit2_eta.push_back(m_negative_eta);
1508  m_Refit2_phi.push_back(m_positive_phi);
1509  m_Refit2_phi.push_back(m_negative_phi);
1510  m_Refit2_d0.push_back(m_positive_d0);
1511  m_Refit2_d0.push_back(m_negative_d0);
1512  m_Refit2_z0.push_back(m_positive_z0);
1513  m_Refit2_z0.push_back(m_negative_z0);
1514 
1521  } // if (success_pos && success_neg)
1522  } // if (m_storeZmumuNtuple)
1523  } // enough refit2 tracks
1524 
1525  ATH_MSG_DEBUG("Execute() All NTUPLES filled Run: " << m_runNumber << " event: " << m_evtNumber << " mass: " << m_xZmm.GetInvMass() << " GeV ");
1526  }
1527  } // closing -> if ( m_xZmm.AcceptEvent() )
1528 
1529  if ( !m_xZmm.AcceptEvent() ) {
1530  // no good muon pair found
1531  //failed cuts, continue to next event
1532  ATH_MSG_DEBUG ("** IDPerfMonZmumu::execute ** No good muon pair found. Leaving Execute(). Run: " << m_runNumber << " event: " << m_evtNumber);
1533  return StatusCode::SUCCESS;
1534  }
1535 
1536  //
1537  // fill truth event iformation even when the reco event has not passed
1538  //
1539  if (m_isMC) {
1540  bool truthStatusIsGood = true;
1541  if (FillTruthParameters(ppos_comb).isFailure()){
1542  truthStatusIsGood = false;
1543  ATH_MSG_WARNING("Failed to fill truth parameters - skipping event");
1544  }
1545  if (FillTruthParameters(pneg_comb).isFailure()){
1546  truthStatusIsGood = false;
1547  ATH_MSG_WARNING("Failed to fill truth parameters - skipping event");
1548  }
1549  if (truthStatusIsGood) {
1550  ATH_MSG_DEBUG ("-- Filling " << m_truthTree->GetName() << " entry " << m_truthTree->GetEntries()
1551  << " run: " << m_runNumber
1552  << " event: " << m_evtNumber
1553  << " Lumiblock: " << m_lumi_block
1554  << " Invariant mass = " << m_xZmm.GetInvMass() << " GeV ");
1555  ATH_MSG_DEBUG ("Negative p: (" << m_negative_px << ", "
1556  << m_negative_py << ", "
1557  << m_negative_pz << ") "
1558  << " d0: " << m_negative_d0
1559  << " z0: " << m_negative_z0
1560  << " parent: " << m_negative_parent);
1561  ATH_MSG_DEBUG ("Positive p: (" << m_positive_px << ","
1562  << m_positive_py << ","
1563  << m_positive_pz << ") "
1564  << " d0: " << m_positive_d0
1565  << " z0: " << m_positive_z0
1566  << " parent: " << m_positive_parent);
1567 
1568  if (m_storeZmumuNtuple && m_truthTree) m_truthTree->Fill();
1569  m_Truth_pt.push_back(m_positive_pt);
1570  m_Truth_pt.push_back(m_negative_pt);
1571  m_Truth_eta.push_back(m_positive_eta);
1572  m_Truth_eta.push_back(m_negative_eta);
1573  m_Truth_phi.push_back(m_positive_phi);
1574  m_Truth_phi.push_back(m_negative_phi);
1575  m_Truth_d0.push_back(m_positive_d0);
1576  m_Truth_d0.push_back(m_negative_d0);
1577  m_Truth_z0.push_back(m_positive_z0);
1578  m_Truth_z0.push_back(m_negative_z0);
1579  m_Truth_qoverp.push_back(m_positive_qoverp);
1580  m_Truth_qoverp.push_back(m_negative_qoverp);
1581  m_Truth_parent.push_back(m_positive_parent);
1582  m_Truth_parent.push_back(m_negative_parent);
1583 
1584  } // truth info properly filled
1585  else {
1586  ATH_MSG_DEBUG("FAILED filling m_truthTree "
1587  << " for run: " << m_runNumber
1588  << " event: " << m_evtNumber
1589  << " Lumiblock: " << m_lumi_block);
1590  }
1591  } // if (m_isMC)
1592 
1593  // fill common tree
1594  if (m_commonTree ) {
1595  // fill ntuple if some of the collections is filled
1596  bool dofill = false;
1597  if (m_IDTrack_pt.size() >= 2) dofill = true;
1598  if (m_CBTrack_pt.size() >= 2) dofill = true;
1599  if (m_Refit1_pt.size() >= 2) dofill = true;
1600  if (m_Refit2_pt.size() >= 2) dofill = true;
1601  if (m_Truth_pt.size() >= 2) dofill = true;
1602 
1603  if (dofill) {
1604  ATH_MSG_DEBUG("-- Filling m_commonTree " << m_commonTree->GetName() << " entry " << m_commonTree->GetEntries()
1605  << " run: " << m_runNumber
1606  << " event: " << m_evtNumber
1607  << " Lumiblock: " << m_lumi_block
1608  << " Invariant mass = " << m_xZmm.GetInvMass() << " GeV ");
1609  m_commonTree->Fill();
1610  }
1611  else {
1612  ATH_MSG_DEBUG("-- Filling m_commonTree " << m_commonTree->GetName() << " FAILED for "
1613  << " run: " << m_runNumber
1614  << " event: " << m_evtNumber
1615  << " Lumiblock: " << m_lumi_block);
1616  }
1617  }
1618 
1619  ATH_MSG_DEBUG(" --IDPerfMonZmumu::execute-- event completed -- Run: " << m_runNumber << " event: " << m_evtNumber);
1620 
1621  /* ***********************************************************
1622  * after all, let's make the collection for ALL MUON ID Tracks
1623  * ***********************************************************/
1624 
1625  ATH_MSG_DEBUG("IDTracks monitoring..");
1626  int nTracks = 0;
1628 
1629  // DIFFERENT RETRIEVAL
1630  const xAOD::MuonContainer* muons = PerfMonServices::getContainer<xAOD::MuonContainer>( PerfMonServices::MUON_COLLECTION );
1631  if(muons){
1632  for (auto muon : *muons) {
1633  const xAOD::TrackParticle* tp = muon->trackParticle(xAOD::Muon::InnerDetectorTrackParticle);
1634  if(!tp) {
1635  ATH_MSG_DEBUG(" - tpb = "<< tp << " -> is null? " << (!tp));
1636  continue;
1637  }
1638  const Trk::Track* t = tp->track();
1639  if ( !t ) {
1640  ATH_MSG_DEBUG(" - tpb does not have track ");
1641  continue;
1642  }
1643  const Trk::Perigee* tPerigee = t->perigeeParameters() ;
1644  if ( !tPerigee ) {
1645  ATH_MSG_DEBUG(" - t does not have perigree ");
1646  continue;
1647  }
1648  IDTracks->push_back ( new Trk::Track (*t));
1649  nTracks++;
1650  }
1651  }
1652  else ATH_MSG_WARNING ("Could not retrieve Muon container");
1653 
1654  ATH_MSG_DEBUG(" --> nTracks = " << nTracks);
1655 
1656  StatusCode scid = evtStore()->record(IDTracks, "IDTracks");
1657  if (scid.isSuccess()) {
1658  ATH_MSG_DEBUG ("Stored "<< IDTracks->size() << " IDTracks into StoreGate");
1659  }
1660  else{
1661  ATH_MSG_WARNING ("Failed storing IDTracks");
1662  }
1663 
1664  /*********************************************************
1665  * ..finish
1666  ********************************************************/
1667 
1668  return StatusCode::SUCCESS;
1669 }
1670 
1671 //==================================================================================
1673  const xAOD::TrackParticle* trackp_for_unbias,
1674  double charge,
1675  const xAOD::Vertex* vertex)
1676 {
1677  if (!trackp){
1678  //ATH_MSG_WARNING("Empty Trackparticle. Skipping.");
1679  return StatusCode::FAILURE;
1680  }
1681 
1682  if (m_doRemoval && !trackp_for_unbias && !m_skipMS){
1683  return StatusCode::FAILURE;
1684  }
1685 
1686  double px = 0;
1687  double py = 0;
1688  double pt = 0;
1689  double pz = 0;
1690  double phi= 0;
1691  double eta= 0;
1692  double d0 = 0;
1693  double z0 = 0;
1694  double d0res = 0;
1695  double z0res = 0;
1696  double PVd0res = 0;
1697  double PVz0res = 0;
1698  double PVd0 = 0;
1699  double PVz0 = 0;
1700  double sigma_pt = 0;
1701  double qoverp = 0;
1702  double sigma_qOverP = 1.; // use a large value by default as 0 is meaningless
1703 
1704 
1705  px = trackp->p4().Px();
1706  py = trackp->p4().Py();
1707  pt = trackp->p4().Pt();
1708  pz = trackp->p4().Pz();
1709  phi= trackp->p4().Phi();
1710  eta= trackp->p4().Eta();
1711  d0 = trackp->d0();
1712  z0 = trackp->z0();
1713  qoverp = trackp->qOverP();
1714 
1715  d0res = std::sqrt(trackp->definingParametersCovMatrix()(Trk::d0,Trk::d0));
1716  z0res = std::sqrt(trackp->definingParametersCovMatrix()(Trk::z0,Trk::z0));
1717  sigma_qOverP = std::sqrt(trackp->definingParametersCovMatrix()(Trk::qOverP,Trk::qOverP));
1718  double sigma_theta = std::sqrt(trackp->definingParametersCovMatrix()(Trk::theta,Trk::theta));
1719 
1720  // computing sigma_pt
1721  // pt = sin(theta) / qOverP --> sigma(pt) = (sin(theta)/ qOverP^2) x sigma(qOverP) // neglecting sigma(sin(theta))
1722  double sigma_pt_term1 = (sin(trackp->theta()) / pow(qoverp,2)) * sigma_qOverP;
1723  double sigma_pt_term2 = (1./qoverp) * cos(trackp->theta()) * sigma_theta;
1724  double sigma_pt_term3 = (cos(trackp->theta()) / pow(qoverp,2)) * sigma_theta * sigma_qOverP;
1725  sigma_pt = sqrt( pow(sigma_pt_term1,2) + pow(sigma_pt_term2,2) + 2 * sigma_pt_term3 * trackp->definingParametersCovMatrix()(Trk::qOverP,Trk::theta));
1726 
1727  //
1728  if (vertex == nullptr) {
1729  ATH_MSG_WARNING("in FillRecParametersTP. WARNING: Vertex is NULL");
1730  return StatusCode::FAILURE;
1731  }
1733  ATH_MSG_WARNING("in FillRecParametersTP. WARNING: m_trackToVertexIPEstimator is NULL");
1734  return StatusCode::FAILURE;
1735  }
1736 
1737  if (m_doIP && vertex != nullptr && m_trackToVertexIPEstimator){
1738  std::unique_ptr<Trk::ImpactParametersAndSigma> iPandSigma(nullptr);
1739  ATH_MSG_DEBUG("-- using the trackToVertexIPEstimator --");
1740 
1741  //Calling the estimate(trackp,newtrackp,vertex,doRemoval)
1742  //The first track is used to unbias the vertex, the second to get the extrapolation
1743  if (!m_skipMS) iPandSigma = m_trackToVertexIPEstimator->estimate(trackp_for_unbias, trackp, vertex, m_doRemoval);
1744  else iPandSigma = m_trackToVertexIPEstimator->estimate(trackp, vertex);
1745  ATH_MSG_DEBUG("return from the trackToVertexIPEstimator->estimate()");
1746 
1747  if( !iPandSigma ){
1748  ATH_MSG_WARNING ("FillRecParametersTP::trackToVertexIPEstimator failed !");
1749  return StatusCode::FAILURE;
1750  }
1751  else{
1752  ATH_MSG_DEBUG("FillRecParametersTP::trackToVertexIPEstimator success !");
1753  PVd0 = iPandSigma->IPd0;
1754  PVd0res = iPandSigma->PVsigmad0;
1755  d0res = iPandSigma->sigmad0;
1756  PVz0 = iPandSigma->IPz0;
1757  PVz0res = iPandSigma->PVsigmaz0;
1758  z0res = iPandSigma->sigmaz0;
1759  }
1760  }
1761 
1762  if (charge == 1) {
1763  m_positive_px = px;
1764  m_positive_py = py;
1765  m_positive_pt = pt;
1766  m_positive_pz = pz;
1769  m_positive_z0 = z0;
1770  m_positive_z0_err = z0res;
1771  m_positive_d0 = d0;
1772  m_positive_d0_err = d0res;
1773  m_positive_sigma_pt = sigma_pt;
1774  m_positive_qoverp = qoverp;
1775  m_positive_sigma_qoverp = sigma_qOverP;
1776  if(m_doIP){
1777  m_positive_z0_PV = PVz0;
1778  m_positive_d0_PV = PVd0;
1779  m_positive_z0_PVerr = PVz0res;
1780  m_positive_d0_PVerr = PVd0res;
1781  }
1782  ATH_MSG_DEBUG("(Filled charge == 1 ) (reco)-> px : "<< px <<" py: "<<py <<" pt: "<<pt <<" pz: "<<pz
1783  <<" d0: "<<m_positive_d0 << " d0res : "<< d0res << " PVd0res : "<< PVd0res <<" z0: "<< m_positive_z0 << " z0res : " << z0res << " PVz0res : "<< PVz0res );
1784 
1785  } else if (charge == -1) {
1786  m_negative_px = px;
1787  m_negative_py = py;
1788  m_negative_pt = pt;
1789  m_negative_pz = pz;
1792  m_negative_z0 = z0;
1793  m_negative_z0_err = z0res;
1794  m_negative_d0 = d0;
1795  m_negative_d0_err = d0res;
1796  m_negative_sigma_pt = sigma_pt;
1797  m_negative_qoverp = qoverp;
1798  m_negative_sigma_qoverp = sigma_qOverP;
1799  if(m_doIP){
1800  m_negative_z0_PV = PVz0;
1801  m_negative_d0_PV = PVd0;
1802  m_negative_z0_PVerr = PVz0res;
1803  m_negative_d0_PVerr = PVd0res;
1804  }
1805  ATH_MSG_DEBUG("(Filled charge == -1 ) (reco)-> px : "<< px <<" py: "<< py <<" pt: " << pt <<" pz: "<<pz
1806  <<" d0: "<<m_negative_d0 << " d0res : "<< d0res << " PVd0res : "<< PVd0res <<" z0: "<< m_negative_z0 << " z0res : " << z0res << " PVz0res : "<< PVz0res );
1807  }
1808 
1809  return StatusCode::SUCCESS;
1810 }
1811 
1812 
1813 //==================================================================================
1814 StatusCode IDPerfMonZmumu::FillRecParameters (const Trk::Track* track, const xAOD::TrackParticle* trackp_for_unbias, double charge,const xAOD::Vertex* vertex, const EventContext& ctx)
1815 {
1816  if (!track){
1817  ATH_MSG_DEBUG("* FillRecParameters * Empty Track: track. Skipping.");
1818  return StatusCode::FAILURE;
1819  }
1820 
1821  if (m_doRemoval && !trackp_for_unbias && !m_skipMS) {
1822  ATH_MSG_DEBUG("* FillRecParameters * Empty Track: trackp_for_unbias. Skipping.");
1823  return StatusCode::FAILURE;
1824  }
1825 
1826  const Trk::Perigee* trkPerigee = track->perigeeParameters();
1827  const Trk::Perigee* trk_for_unbiasPerigee = nullptr;
1828  if (!m_skipMS) trk_for_unbiasPerigee = &(trackp_for_unbias->perigeeParameters());
1829 
1830  double px = 0;
1831  double py = 0;
1832  double pt = 0;
1833  double pz = 0;
1834  double phi= 0;
1835  double eta= 0;
1836  double d0 = 0;
1837  double z0 = 0;
1838 
1839  double d0_err = 999.;
1840  double z0_err = 999.;
1841 
1842  double PVd0 = 0;
1843  double PVz0 = 0;
1844  double PVd0res = 0;
1845  double PVz0res = 0;
1846 
1847 
1848  if (trkPerigee != nullptr){
1849  double qOverP = trkPerigee->parameters()[Trk::qOverP];
1850  if (qOverP) {
1851  px = trkPerigee->momentum().x();
1852  py = trkPerigee->momentum().y();
1853  pt = std::abs(trkPerigee->pT());
1854  pz = trkPerigee->momentum().z();
1855  phi= trkPerigee->parameters()[Trk::phi];
1856  eta= trkPerigee->eta();
1857  d0 = trkPerigee->parameters()[Trk::d0];
1858  z0 = trkPerigee->parameters()[Trk::z0];
1859  d0_err = Amg::error(*trkPerigee->covariance(),Trk::d0);
1860  z0_err = Amg::error(*trkPerigee->covariance(),Trk::z0);
1861  }
1862  }
1863 
1864  // access beam spot and extrapolate track till there
1865  SG::ReadCondHandle<InDet::BeamSpotData> beamSpotHandleRec { m_beamSpotKey, ctx };
1866  auto beamline = m_trackToVertexTool->GetBeamLine(beamSpotHandleRec.cptr());
1867 
1868  auto trackBLtemp = m_trackToVertexTool->trackAtBeamline(ctx, *track , beamline.get() );
1869  const Trk::AtaStraightLine* atBL = dynamic_cast<const Trk::AtaStraightLine*>(trackBLtemp.get());
1870 
1871  if (atBL){
1872  double qOverP = atBL->parameters()[Trk::qOverP];
1873  if(qOverP){
1874  px = atBL->momentum().x();
1875  py = atBL->momentum().y();
1876  pt = std::abs(atBL->pT());
1877  pz = atBL->momentum().z();
1878  eta= trkPerigee->eta();
1879  phi= trkPerigee->parameters()[Trk::phi];
1880  d0 = atBL->parameters()[Trk::d0];
1881  z0 = atBL->parameters()[Trk::z0];
1882  // z0_err = Amg::error(*trkPerigee->covariance(),Trk::z0); //->Why not?
1883  // d0_err = Amg::error(*trkPerigee->covariance(),Trk::d0); //->Why not?
1884  }
1885  delete atBL;
1886  }
1887  else {
1888  ATH_MSG_WARNING("FillRecParameters::Failed extrapolation to the BeamLine");
1889  }
1890 
1891  Amg::Vector3D position = beamSpotHandleRec->beamPos();
1892  TLorentzVector vtrack = TLorentzVector (trkPerigee->momentum().x(),
1893  trkPerigee->momentum().y(),
1894  trkPerigee->momentum().z(),
1895  trkPerigee->momentum().mag());
1896  float trkd0 = trkPerigee->parameters()[Trk::d0];
1897  float trkz0 = trkPerigee->parameters()[Trk::z0];
1898  float bsX = position.x();
1899  float bsY = position.y();
1900  float bsZ = position.z();
1901  float btiltX = beamSpotHandleRec->beamTilt(0);
1902  float btiltY = beamSpotHandleRec->beamTilt(1);
1903  // correct the track parameters for the beamspot position
1904  float beamX = bsX + std::tan(btiltX) * (trkz0-bsZ);
1905  float beamY = bsY + std::tan(btiltY) * (trkz0-bsZ);
1906  float beamD0 = ( -std::sin(vtrack.Phi())*beamX + std::cos(vtrack.Phi())*beamY );
1907  float d0bscorr = trkd0 - beamD0;
1908  float z0bscorr = trkz0 - bsZ;
1909 
1910  if(m_doIP && vertex){ //I assume that the vertex is the same of the original track
1911  std::unique_ptr<Trk::ImpactParametersAndSigma> iPandSigma(nullptr);
1912  if (!m_skipMS) iPandSigma = m_trackToVertexIPEstimator->estimate(trk_for_unbiasPerigee,trkPerigee,vertex,m_doRemoval);
1913  else iPandSigma = m_trackToVertexIPEstimator->estimate(trkPerigee,vertex);
1914  if( iPandSigma==0 ){
1915  ATH_MSG_WARNING ("FillRecParameters::trackToVertexIPEstimator failed !");
1916  return StatusCode::FAILURE;
1917  }
1918  else{
1919  ATH_MSG_DEBUG("FillRecParameters::trackToVertexIPEstimator success !");
1920  PVd0 = iPandSigma->IPd0;
1921  PVd0res = iPandSigma->PVsigmad0;
1922  //d0res = iPandSigma->sigmad0; //-> ?
1923  PVz0 = iPandSigma->IPz0;
1924  PVz0res = iPandSigma->PVsigmaz0;
1925  //z0res = iPandSigma->sigmaz0; //-> ?
1926 
1927  if (vertex) {
1928  ATH_MSG_INFO(" FillRecParameters::trackToVertexIPEstimator vertex does exist ");
1929  m_pv_x = vertex->x();
1930  m_pv_y = vertex->y();
1931  m_pv_z = vertex->z();
1932  m_nTrkInVtx = vertex->nTrackParticles();
1933  }
1934 
1935  }
1936  }
1937 
1938  if (charge == 1) {
1939  m_positive_px = px;
1940  m_positive_py = py;
1941  m_positive_pt = pt;
1942  m_positive_pz = pz;
1945  m_positive_z0 = z0;
1946  m_positive_d0 = d0;
1947  m_positive_z0_manualBS = z0bscorr;
1948  m_positive_d0_manualBS = d0bscorr;
1949  m_positive_d0_err = d0_err;
1950  m_positive_z0_err = z0_err;
1951  if(m_doIP){
1952  m_positive_z0_PV = PVz0;
1953  m_positive_d0_PV = PVd0;
1954  m_positive_z0_PVerr = PVz0res;
1955  m_positive_d0_PVerr = PVd0res;
1956  }
1957  ATH_MSG_DEBUG("(Filled charge == 1 ) (reco)-> px : "<< px <<" py: "<<py <<" pz: "<<pz <<" d0: "<<d0<<" z0: "<< z0);
1958  }
1959  if (charge == -1) {
1960  m_negative_px = px;
1961  m_negative_py = py;
1962  m_negative_pt = pt;
1963  m_negative_pz = pz;
1966  m_negative_z0 = z0;
1967  m_negative_d0 = d0;
1968  m_negative_z0_manualBS = z0bscorr;
1969  m_negative_d0_manualBS = d0bscorr;
1970  m_negative_d0_err = d0_err;
1971  m_negative_z0_err = z0_err;
1972  if(m_doIP){
1973  m_negative_z0_PV = PVz0;
1974  m_negative_d0_PV = PVd0;
1975  m_negative_z0_PVerr = PVz0res;
1976  m_negative_d0_PVerr = PVd0res;
1977  }
1978  ATH_MSG_DEBUG("(Filled charge == -1 ) (reco)-> px : "<< px <<" py: "<<py <<" pz: "<<pz <<" d0: "<<d0<<" z0: "<<z0 );
1979  }
1980 
1981  return StatusCode::SUCCESS;
1982 }
1983 //==================================================================================
1985 {
1986  if (!track){
1987  ATH_MSG_DEBUG("* FillRecParametersSimple * Empty Track: track. Skipping.");
1988  return StatusCode::FAILURE;
1989  }
1990 
1991  const Trk::Perigee* trkPerigee = track->perigeeParameters();
1992  if (not trkPerigee) {
1993  ATH_MSG_ERROR("trkPerigee pointer is null in IDPerfMonZmumu::FillRecParametersSimple");
1994  return StatusCode::FAILURE;
1995  }
1996  double px = 0;
1997  double py = 0;
1998  double pt = 0;
1999  double pz = 0;
2000  double phi= 0;
2001  double eta= 0;
2002 
2003  double d0 = 0;
2004  double z0 = 0;
2005  double d0_err = 999.;
2006  double z0_err = 999.;
2007 
2008  //
2009  double qOverP = trkPerigee->parameters()[Trk::qOverP];
2010  if (qOverP) {
2011  px = trkPerigee->momentum().x();
2012  py = trkPerigee->momentum().y();
2013  pt = std::abs(trkPerigee->pT());
2014  pz = trkPerigee->momentum().z();
2015  phi= trkPerigee->parameters()[Trk::phi];
2016  eta= trkPerigee->eta();
2017  d0 = trkPerigee->parameters()[Trk::d0];
2018  z0 = trkPerigee->parameters()[Trk::z0];
2019  d0_err = Amg::error(*trkPerigee->covariance(),Trk::d0);
2020  z0_err = Amg::error(*trkPerigee->covariance(),Trk::z0);
2021  }
2022 
2023  SG::ReadHandle<xAOD::EventInfo> eventInfo (m_EventInfoKey, getContext());
2024  Amg::Vector3D position (eventInfo->beamPosX(), eventInfo->beamPosY(), eventInfo->beamPosZ());
2025  TLorentzVector vtrack = TLorentzVector (trkPerigee->momentum().x(),
2026  trkPerigee->momentum().y(),
2027  trkPerigee->momentum().z(),
2028  trkPerigee->momentum().mag());
2029  float trkd0 = trkPerigee->parameters()[Trk::d0];
2030  float trkz0 = trkPerigee->parameters()[Trk::z0];
2031  float bsX = position.x();
2032  float bsY = position.y();
2033  float bsZ = position.z();
2034  float btiltX = eventInfo->beamTiltXZ();
2035  float btiltY = eventInfo->beamTiltYZ();
2036  // correct the track parameters for the beamspot position
2037  float beamX = bsX + std::tan(btiltX) * (trkz0-bsZ);
2038  float beamY = bsY + std::tan(btiltY) * (trkz0-bsZ);
2039  float beamD0 = ( -std::sin(vtrack.Phi())*beamX + std::cos(vtrack.Phi())*beamY );
2040  float d0bscorr = trkd0 - beamD0;
2041  float z0bscorr = trkz0 - bsZ - vertex->z();
2042 
2043  if (charge == 1) {
2044  m_positive_px = px;
2045  m_positive_py = py;
2046  m_positive_pt = pt;
2047  m_positive_pz = pz;
2050  m_positive_z0 = z0bscorr;
2051  m_positive_d0 = d0bscorr;
2052  m_positive_z0_manualBS = z0bscorr;
2053  m_positive_d0_manualBS = d0bscorr;
2054  m_positive_d0_err = d0_err;
2055  m_positive_z0_err = z0_err;
2056  }
2057  if (charge == -1) {
2058  m_negative_px = px;
2059  m_negative_py = py;
2060  m_negative_pt = pt;
2061  m_negative_pz = pz;
2064  m_negative_z0 = z0bscorr;
2065  m_negative_d0 = d0bscorr;
2066  m_negative_z0_manualBS = z0bscorr;
2067  m_negative_d0_manualBS = d0bscorr;
2068  m_negative_d0_err = d0_err;
2069  m_negative_z0_err = z0_err;
2070  }
2071 
2072  ATH_MSG_DEBUG("-- FillRecParametersSimple -- charge " << charge << " pt: " << pt << " d0: " << d0 << " z0: " << z0);
2073 
2074  return StatusCode::SUCCESS;
2075 }
2076 
2077 //==================================================================================
2079 {
2080 
2081  if (!trackParticle ){//|| !trackParticle->vertex()){
2082  ATH_MSG_WARNING("-- FillTruthParameters -- Empty Trackparticle. Skipping.");
2083  return StatusCode::FAILURE;
2084  }
2085 
2086  const xAOD::TruthParticle* particle = getTruthParticle( *trackParticle );
2087  double charge = 0;
2088  if (!particle) {
2089  ATH_MSG_DEBUG(" -- FillTruthParameters -- Failure while retrieving the truth particle. Returning FAILURE.");
2090  return StatusCode::FAILURE;
2091  }
2092 
2093  if ( particle->pdgId() == 13) charge = -1.; // muon-
2094  if ( particle->pdgId() == -13) charge = 1.; // muon+
2095  if ( particle->isNeutral() ) {
2096  ATH_MSG_DEBUG(" -- FillTruthParameters -- reco muon associated to a truth neutral!! Returning FAILURE.");
2097  return StatusCode::FAILURE;
2098  }
2099  if ( charge == 0 ) {
2100  ATH_MSG_DEBUG(" -- FillTruthParameters -- reco muon associated to a non true muon!! Returning FAILURE.");
2101  return StatusCode::FAILURE;
2102  }
2103 
2104  const Amg::Vector3D momentum(particle->px(), particle->py(), particle->pz());
2105  const xAOD::TruthVertex * ptruthVertex(0);
2106  ptruthVertex=particle->prodVtx();
2107  if (!ptruthVertex){
2108  ATH_MSG_DEBUG("A production vertex pointer was retrieved, but it is NULL");
2109  return StatusCode::FAILURE;
2110  }
2111 
2112 
2113  if (particle->parent(0) != nullptr) {
2114  static const SG::ConstAccessor<int> truthTypeAcc("truthType");
2115  static const SG::ConstAccessor<int> truthOriginAcc("truthOrigin");
2116  if (truthTypeAcc.isAvailable(*particle)) {
2117  ATH_MSG_DEBUG(" -- FillTruthParameters -- truth particle is good. pdg: " << particle->pdgId()
2118  << " type: " << particle->type()
2119  << " nparents " << particle->nParents()
2120  << " parent->pdg: " << particle->parent(0)->pdgId()
2121  << " truthType: " << truthTypeAcc(*particle)
2122  << " truthOrigin: " << truthOriginAcc(*particle)
2123  );
2124 
2125  }
2126  else {
2127  ATH_MSG_DEBUG(" -- FillTruthParameters -- truth particle is good. pdg: " << particle->pdgId()
2128  << " type: " << particle->type()
2129  << " nparents " << particle->nParents()
2130  << " parent->pdg: " << particle->parent(0)->pdgId()
2131  << " truthType & truthOrigin: " << " NOT AVAILABLE "
2132  );
2133  }
2134  }
2135 
2136  const auto xPos=ptruthVertex->x();
2137  const auto yPos=ptruthVertex->y();
2138  const auto z_truth=ptruthVertex->z();
2139 
2140  const Amg::Vector3D position(xPos, yPos, z_truth);
2141  const Trk::CurvilinearParameters cParameters(position, momentum, charge);
2142 
2144  Trk::PerigeeSurface persf( beamSpotHandleTruth->beamPos() );
2145 
2146  const EventContext& ctx = Gaudi::Hive::currentContext();
2147  std::unique_ptr<const Trk::TrackParameters> tP = m_extrapolator->extrapolate(ctx, cParameters,persf, Trk::anyDirection, false);
2148 
2149  double px = 0;
2150  double py = 0;
2151  double pt = 0;
2152  double pz = 0;
2153  double phi= 0;
2154  double eta= 0;
2155  double d0 = 0;
2156  double d0res = 0;
2157  double PVd0res = 0;
2158  double z0 = 0;
2159  double z0res = 0;
2160  double PVz0res = 0;
2161 
2162  double d0recoPos = m_positive_d0;
2163  double z0recoPos = m_positive_z0;
2164  double d0recoNeg = m_negative_d0;
2165  double z0recoNeg = m_negative_z0;
2166 
2167  ATH_MSG_DEBUG("reco IPs (pos): > d0 : "<<d0recoPos << " z0: " << z0recoPos << " trackp z0 : " << trackParticle->z0() << " trackp d0 : " << trackParticle->d0());
2168  ATH_MSG_DEBUG("reco IPs (neg): > d0 : "<<d0recoNeg << " z0: " << z0recoNeg << " trackp z0 : " << trackParticle->z0() <<" trackp d0 : " << trackParticle->d0() );
2169 
2170  double qOverP_truth = 0.;
2171  if (tP){
2172  qOverP_truth = tP->parameters()[Trk::qOverP];
2173  if( qOverP_truth ){
2174 
2175  px = tP->momentum().x();
2176  py = tP->momentum().y();
2177  pt = tP->pT();
2178  pz = tP->momentum().z();
2179  phi= tP->parameters()[Trk::phi];
2180  eta= tP->eta();
2181  d0 = tP->parameters()[Trk::d0];
2182  z0 = tP->parameters()[Trk::z0];
2183 
2184  ATH_MSG_DEBUG("cand perig HEP particle (truth) px : "<< tP->momentum().x());
2185  ATH_MSG_DEBUG("cand perig HEP particle (truth) py : "<< tP->momentum().y());
2186  ATH_MSG_DEBUG("cand perig HEP particle (truth) pz : "<< tP->momentum().z());
2187  ATH_MSG_DEBUG("cand perig HEP particle (truth) d0 : "<< tP->parameters()[Trk::d0]);
2188  ATH_MSG_DEBUG("cand perig HEP particle (truth) z0 : "<< tP->parameters()[Trk::z0]);
2189 
2190  }
2191  }
2192 
2193 
2194  if (charge == 1) {
2195  m_positive_px = px;
2196  m_positive_py = py;
2197  m_positive_pt = pt;
2198  m_positive_pz = pz;
2201  m_positive_z0 = z0recoPos -z0;
2202  m_positive_z0_err = z0res;
2203  m_positive_z0_PVerr = PVz0res;
2204  m_positive_d0 = d0recoPos -d0;
2205  m_positive_d0_err = d0res;
2206  m_positive_d0_PVerr = PVd0res;
2207  m_positive_qoverp = qOverP_truth;
2208 
2209  bool parentfound = false;
2210  if (particle->nParents()>0) {
2211  if (particle->parent(0) != nullptr) {
2212  m_positive_parent = particle->parent(0)->pdgId();
2213  parentfound = true;
2214  }
2215  }
2216  if (!parentfound) m_positive_parent = 0;
2217 
2218  ATH_MSG_DEBUG(" -- FillTruthParameters -- charge = 1 (truth)-> px : "<< m_positive_px
2219  <<" py: "<<m_positive_py
2220  <<" pz: "<<m_positive_pz
2221  <<" d0: "<<m_positive_d0
2222  <<" z0: "<< m_positive_z0
2223  <<" qoverp: " << m_positive_qoverp
2224  << " parent: " << m_positive_parent);
2225 
2226  } else if (charge == -1) {
2227  m_negative_px = px;
2228  m_negative_py = py;
2229  m_negative_pt = pt;
2230  m_negative_pz = pz;
2233  m_negative_z0 = z0recoNeg-z0;
2234  m_negative_z0_err = z0res;
2235  m_negative_z0_PVerr = PVz0res;
2236  m_negative_d0 = d0recoNeg-d0;
2237  m_negative_d0_err = d0res;
2238  m_negative_d0_PVerr = PVd0res;
2239  m_negative_qoverp = qOverP_truth;
2240 
2241  bool parentfound = false;
2242  if (particle->nParents()>0) {
2243  if (particle->parent(0) != nullptr) {
2244  m_negative_parent = particle->parent(0)->pdgId();
2245  parentfound = true;
2246  }
2247  }
2248  if (!parentfound) m_negative_parent = 0;
2249 
2250  ATH_MSG_DEBUG(" -- FillTruthParameters-- charge = -1 (truth)-> px : "<< m_negative_px
2251  << " py: "<<m_negative_py
2252  << " pz: "<<m_negative_pz
2253  << " d0: "<<m_negative_d0
2254  << " z0: "<< m_negative_z0
2255  <<" qoverp: " << m_negative_qoverp
2256  << " parent:" << m_negative_parent);
2257  }
2258  return StatusCode::SUCCESS;
2259 }
2260 
2261 
2262 //==================================================================================
2267  static const SG::ConstAccessor< Link_t > acc( "truthParticleLink" );
2268  // Check if such a link exists on the object:
2269  if( ! acc.isAvailable( p ) ) {
2270  return nullptr;
2271  }
2272  // Get the link:
2273  const Link_t& link = acc( p );
2274  // Check if the link is valid:
2275  if( ! link.isValid() ) {
2276  return nullptr;
2277  }
2278  // Everything has passed, let's return the pointer:
2279  return *link;
2280 }
2281 
2282 //==================================================================================
2284 {
2285  m_xZmm.finalize();
2286  return StatusCode::SUCCESS;
2287 }
2288 
2289 //==================================================================================
2291 {
2292  m_triggerPrescale = 1; // default value
2293 
2294  // check trigger status
2295  if(m_triggerDecision.retrieve().isFailure()) {
2296  ATH_MSG_FATAL("CheckTriggerStatusAndPrescale -- Unable to retrieve " << m_triggerDecision << " turn it off");
2297  return StatusCode::FAILURE;
2298  }
2299  else {
2300  ATH_MSG_DEBUG("CheckTriggerStatusAndPrescale -- retrieved tool: " << m_triggerDecision );
2301  }
2302 
2303  float thisEventTriggerPrescale = 999999.9;
2304  float thisHLTTriggerPrescale = 999999.9;
2305  bool thisHLTIsPassed = false;
2306  std::string thisHLTTriggerName;
2307  std::string thisEventTriggerName;
2308 
2309  // HLT triggers
2310  const std::vector<std::string> myHLTtriglist = m_triggerDecision->getChainGroup("HLT_mu.*, HLT_2mu.*")->getListOfTriggers();
2311  for (int i=0; i < (int) myHLTtriglist.size(); i++) {
2312  if ( m_triggerDecision->isPassed(myHLTtriglist.at(i)) ) {
2313  ATH_MSG_DEBUG("HLT trigger = " << i << " out of " << myHLTtriglist.size() << " --> " << myHLTtriglist.at(i) << " isPassed? " << m_triggerDecision->isPassed(myHLTtriglist.at(i)) << " prescale: " << m_triggerDecision->getChainGroup(myHLTtriglist.at(i))->getPrescale() );
2314  }
2315  if ( m_triggerDecision->isPassed(myHLTtriglist.at(i)) ) { // trigger is passed
2316  thisHLTIsPassed = true;
2317  float thisprescale = m_triggerDecision->getChainGroup(myHLTtriglist.at(i))->getPrescale();
2318  if (thisprescale < thisHLTTriggerPrescale) {
2319  thisHLTTriggerPrescale = thisprescale;
2320  thisHLTTriggerName = myHLTtriglist.at(i);
2321  }
2322  }
2323  }
2324  if (thisHLTTriggerPrescale < 1) thisHLTTriggerPrescale = 1;
2325  ATH_MSG_DEBUG("Event HLT trigger prescale = " << thisHLTTriggerPrescale);
2326 
2327  //if (thisL1IsPassed && thisHLTIsPassed) {
2328  if (thisHLTIsPassed) {
2329  ATH_MSG_DEBUG("Trigger passed -> accept event");
2330  }
2331  else{
2332  ATH_MSG_DEBUG("Trigger Failed -> reject event");
2333  return StatusCode::FAILURE;
2334  }
2335 
2336  // event prescale
2337  thisEventTriggerPrescale = thisHLTTriggerPrescale;
2338  thisEventTriggerName = thisHLTTriggerName;
2339  ATH_MSG_DEBUG("CheckTriggerStatusAndPrescale -- Event trigger prescale = " << thisEventTriggerPrescale);
2340  ATH_MSG_DEBUG("CheckTriggerStatusAndPrescale -- Event trigger name = " << thisEventTriggerName);
2341 
2342  m_triggerPrescale = thisEventTriggerPrescale;
2343  m_triggerName = thisEventTriggerName;
2344 
2345 
2346  return StatusCode::SUCCESS;
2347 }
2348 
2349 
2350 //==================================================================================
2352 
2353  const xAOD::VertexContainer* vxContainer(0);
2354  const xAOD::Vertex* myVtx(0);
2355  vxContainer = PerfMonServices::getContainer<xAOD::VertexContainer> (PerfMonServices::VTX_COLLECTION);
2356  if (!vxContainer) {
2357  return myVtx;
2358  }
2359 
2360  for (int ivtx=0; ivtx< (int) vxContainer->size();ivtx++) {
2361  myVtx = (*vxContainer)[ivtx];
2362  if ((myVtx->vertexType() == xAOD::VxType::PriVtx)) {
2363  if (m_Trk2VtxAssociationTool->isCompatible(*muon1,*myVtx) && (m_Trk2VtxAssociationTool->isCompatible(*muon2,*myVtx)))
2364  return myVtx;
2365  }
2366  }
2367  return myVtx;
2368 }
2369 
2370 //==================================================================================
2372 {
2373  m_IDTrack_pt.clear();
2374  m_CBTrack_pt.clear();
2375  m_Refit1_pt.clear();
2376  m_Refit2_pt.clear();
2377  m_Truth_pt.clear();
2378 
2379  m_IDTrack_eta.clear();
2380  m_CBTrack_eta.clear();
2381  m_Refit1_eta.clear();
2382  m_Refit2_eta.clear();
2383  m_Truth_eta.clear();
2384 
2385  m_IDTrack_phi.clear();
2386  m_CBTrack_phi.clear();
2387  m_Refit1_phi.clear();
2388  m_Refit2_phi.clear();
2389  m_Truth_phi.clear();
2390 
2391  m_IDTrack_d0.clear();
2392  m_CBTrack_d0.clear();
2393  m_Refit1_d0.clear();
2394  m_Refit2_d0.clear();
2395  m_Truth_d0.clear();
2396 
2397  m_IDTrack_z0.clear();
2398  m_CBTrack_z0.clear();
2399  m_Refit1_z0.clear();
2400  m_Refit2_z0.clear();
2401  m_Truth_z0.clear();
2402 
2403  m_IDTrack_qoverp.clear();
2404  m_CBTrack_qoverp.clear();
2405  m_Refit1_qoverp.clear();
2406  m_Refit2_qoverp.clear();
2407  m_Truth_qoverp.clear();
2408 
2409  m_Truth_parent.clear();
2410 
2411  m_IDTrack_sigma_pt.clear();
2412  m_CBTrack_sigma_pt.clear();
2413  m_Refit1_sigma_pt.clear();
2414  m_Refit2_sigma_pt.clear();
2415 
2416  m_IDTrack_sigma_d0.clear();
2417  m_CBTrack_sigma_d0.clear();
2418  m_Refit1_sigma_d0.clear();
2419  m_Refit2_sigma_d0.clear();
2420 
2421  m_IDTrack_sigma_z0.clear();
2422  m_CBTrack_sigma_z0.clear();
2423  m_Refit1_sigma_z0.clear();
2424  m_Refit2_sigma_z0.clear();
2425 
2426  m_IDTrack_sigma_qoverp.clear();
2427  m_CBTrack_sigma_qoverp.clear();
2428  m_Refit1_sigma_qoverp.clear();
2429  m_Refit2_sigma_qoverp.clear();
2430 
2431  m_nBLhits.clear();
2432  m_nPIXhits.clear();
2433  m_nSCThits.clear();
2434  m_nTRThits.clear();
2435 
2436  return;
2437 }
2438 
2439 //==================================================================================
2441 {
2442  m_positive_px = 0.;
2443  m_positive_py = 0.;
2444  m_positive_pz = 0.;
2445  m_positive_d0 = 0.;
2446  m_positive_z0 = 0.;
2449  m_positive_d0_err = 0.;
2450  m_positive_z0_err = 0.;
2451  m_positive_sigma_pt = 0.;
2452  m_positive_1_vtx = 0;
2453  m_positive_parent = 0;
2454 
2455  m_negative_px = 0.;
2456  m_negative_py = 0.;
2457  m_negative_pz = 0.;
2458  m_negative_d0 = 0.;
2459  m_negative_z0 = 0.;
2462  m_negative_d0_err = 0.;
2463  m_negative_z0_err = 0.;
2464  m_negative_sigma_pt = 0.;
2465  m_negative_1_vtx = 0;
2466  m_negative_parent = 0;
2467 
2468  m_positive_2_px = 0.;
2469  m_positive_2_py = 0.;
2470  m_positive_2_pz = 0.;
2471  m_positive_2_d0 = 0.;
2472  m_positive_2_z0 = 0.;
2473  m_positive_2_d0_err = 0.;
2474  m_positive_2_z0_err = 0.;
2475  m_positive_2_vtx = 0;
2476 
2477  m_negative_2_px = 0.;
2478  m_negative_2_py = 0.;
2479  m_negative_2_pz = 0.;
2480  m_negative_2_d0 = 0.;
2481  m_negative_2_z0 = 0.;
2482  m_negative_2_d0_err = 0.;
2483  m_negative_2_z0_err = 0.;
2484  m_negative_2_vtx = 0;
2485 
2486  // electrons
2487  m_el_negative1_px = 0.;
2488  m_el_negative1_py = 0.;
2489  m_el_negative1_pz = 0.;
2490  m_el_negative1_d0 = 0.;
2491  m_el_negative1_z0 = 0.;
2492  m_el_negative1_d0_err = 0.;
2493  m_el_negative1_z0_err = 0.;
2494  m_el_negative1_vtx = 0;
2495 
2496  m_el_negative2_px = 0.;
2497  m_el_negative2_py = 0.;
2498  m_el_negative2_pz = 0.;
2499  m_el_negative2_d0 = 0.;
2500  m_el_negative2_z0 = 0.;
2501  m_el_negative2_d0_err = 0.;
2502  m_el_negative2_z0_err = 0.;
2503  m_el_negative2_vtx = 0;
2504 
2505  m_el_positive1_px = 0.;
2506  m_el_positive1_py = 0.;
2507  m_el_positive1_pz = 0.;
2508  m_el_positive1_d0 = 0.;
2509  m_el_positive1_z0 = 0.;
2510  m_el_positive1_d0_err = 0.;
2511  m_el_positive1_z0_err = 0.;
2512  m_el_positive1_vtx = 0;
2513 
2514  m_el_positive2_px = 0.;
2515  m_el_positive2_py = 0.;
2516  m_el_positive2_pz = 0.;
2517  m_el_positive2_d0 = 0.;
2518  m_el_positive2_z0 = 0.;
2519  m_el_positive2_d0_err = 0.;
2520  m_el_positive2_z0_err = 0.;
2521  m_el_positive2_vtx = 0;
2522 
2523  // other quantities
2524  m_nVertex = 0;
2525  m_pv_x = 0; m_pv_y = 0; m_pv_z = 0;
2526  m_4mu_minv = 0.;
2527 
2528  return;
2529 }
2530 //==================================================================================
2532 {
2533  StatusCode thisStatus = StatusCode::SUCCESS;
2534 
2535  if (m_doFourMuAnalysis) {
2536  ATH_MSG_DEBUG ("** RunFourLeptonAnalysis ** START ** run: " << m_runNumber << " event: " << m_evtNumber << " lumiblock:" << m_lumi_block);
2537 
2538  // Four lepton event
2550 
2551  // This is a report of the number of true electrons in the event
2552  if (false) {
2553  const xAOD::TruthParticleContainer* electronTruth = evtStore()->retrieve< const xAOD::TruthParticleContainer >( "egammaTruthParticles" );
2554  if( electronTruth) {
2555  ATH_MSG_DEBUG ( "retrieving electron Truth container with key: \"egammaTruthParticles\" SUCCESS ");
2556  // Check that the auxiliary store association was made successfully:
2557  if( electronTruth->hasStore() ) {
2558  ATH_MSG_DEBUG ( "Size of Truth gamma-electrons: " << electronTruth->size() );
2559  auto tr_itr = electronTruth->begin();
2560  auto tr_end = electronTruth->end();
2561  int electronCount = 0;
2562  for( int i = 0; tr_itr != tr_end; ++tr_itr, ++i ) {
2563  ATH_MSG_DEBUG( "Truth : Investigating truth electron #" << i << " pdgID= " << ( *tr_itr )->pdgId());
2564  if (fabs(( *tr_itr )->pdgId()) == 11) {
2565  if (( *tr_itr )->pt() > 10000 && fabs(( *tr_itr )->eta()) < 2.47) {
2566  ATH_MSG_INFO( " central electron found --> pt: " << ( *tr_itr )->charge()*( *tr_itr )->pt() << " eta " <<( *tr_itr )->eta() );
2567  electronCount++;
2568  }
2569  }
2570  }
2571  ATH_MSG_INFO( "#central electrons: " << electronCount );
2572  }
2573  else {
2574  ATH_MSG_WARNING ( "electronTruth container has no Store !!! FAILURE");
2575  }
2576  }
2577  else {
2578  ATH_MSG_WARNING ( "retrieve electron Truth container with key: \"egammaTruthParticles\" FAILURE");
2579  }
2580  }
2581 
2582  if (m_doDebug) std::cout << " ** RunFourLeptonAnalysis ** calling m_4mu.Reco() .... " << std::endl;
2583  bool statusOf4LeptReco = m_4mu.Reco();
2584 
2585  // print message
2586  if(statusOf4LeptReco) {
2587  thisStatus = StatusCode::SUCCESS;
2588  ATH_MSG_INFO ("4-lepton reconstruction SUCCESS. # accepted events " << m_4mu.getAcceptedEvents() << " Invariant mass = " << m_4mu.GetInvMass() << " GeV ");
2589  if (m_doDebug) std::cout << " ** RunFourLeptonAnalysis ** 4-lepton reconstruction SUCCESS. # accepted events " << m_4mu.getAcceptedEvents() << " Invariant mass = " << m_4mu.GetInvMass() << " GeV " << std::endl;
2590  }
2591  else {
2592  thisStatus = StatusCode::FAILURE;
2593  ATH_MSG_DEBUG ("4-lepton reconstruction FAILURE. m_4mu.Reco() returned FALSE --> event failed selection");
2594  if (m_doDebug) std::cout << " ** RunFourLeptonAnalysis ** 4-lepton reconstruction FAILURE. m_4mu.Reco() returned FALSE --> event failed selection" << std::endl;
2595  }
2596 
2597  if(statusOf4LeptReco) {
2598  if ( m_4mu.EventPassed() ) {
2599 
2600  this->Clear4MuNtupleVariables();
2601 
2602  const xAOD::TrackParticle* muon1_pos = m_4mu.getIDTrack(m_4mu.getPosMuon(1));
2603  const xAOD::TrackParticle* muon2_pos = m_4mu.getIDTrack(m_4mu.getPosMuon(2));
2604  const xAOD::TrackParticle* muon1_neg = m_4mu.getIDTrack(m_4mu.getNegMuon(1));
2605  const xAOD::TrackParticle* muon2_neg = m_4mu.getIDTrack(m_4mu.getNegMuon(2));
2606 
2607  // muons
2608  if (muon1_pos) {
2609  m_positive_px = muon1_pos->p4().Px();
2610  m_positive_py = muon1_pos->p4().Py();
2611  m_positive_pz = muon1_pos->p4().Pz();
2612  m_positive_d0 = muon1_pos->d0();
2613  m_positive_z0 = muon1_pos->z0();
2614  // m_positive_d0_err = muon1_pos->definingParametersCovMatrix()(0,0);
2616  m_positive_z0_err = muon1_pos->definingParametersCovMatrix()(1,1);
2617  }
2618  if (muon1_neg) {
2619  m_negative_px = muon1_neg->p4().Px();
2620  m_negative_py = muon1_neg->p4().Py();
2621  m_negative_pz = muon1_neg->p4().Pz();
2622  m_negative_d0 = muon1_neg->d0();
2623  m_negative_z0 = muon1_neg->z0();
2624  m_negative_d0_err = muon1_neg->definingParametersCovMatrix()(0,0);
2625  m_negative_z0_err = muon1_neg->definingParametersCovMatrix()(1,1);
2626  }
2627  if (muon2_pos) {
2628  m_positive_2_px = muon2_pos->p4().Px();
2629  m_positive_2_py = muon2_pos->p4().Py();
2630  m_positive_2_pz = muon2_pos->p4().Pz();
2631  m_positive_2_d0 = muon2_pos->d0();
2632  m_positive_2_z0 = muon2_pos->z0();
2635  }
2636  if (muon2_neg) {
2637  m_negative_2_px = muon2_neg->p4().Px();
2638  m_negative_2_py = muon2_neg->p4().Py();
2639  m_negative_2_pz = muon2_neg->p4().Pz();
2640  m_negative_2_d0 = muon2_neg->d0();
2641  m_negative_2_z0 = muon2_neg->z0();
2644  }
2645 
2646  // electrons
2647  const xAOD::TrackParticle* elec1_neg = m_4mu.getELTrack(0);
2648  const xAOD::TrackParticle* elec2_neg = m_4mu.getELTrack(1);
2649  const xAOD::TrackParticle* elec1_pos = m_4mu.getELTrack(2);
2650  const xAOD::TrackParticle* elec2_pos = m_4mu.getELTrack(3);
2651  if (elec1_neg) {
2652  m_el_negative1_px = elec1_neg->p4().Px();
2653  m_el_negative1_py = elec1_neg->p4().Py();
2654  m_el_negative1_pz = elec1_neg->p4().Pz();
2655  m_el_negative1_d0 = elec1_neg->d0();
2656  m_el_negative1_z0 = elec1_neg->z0();
2659  }
2660  if (elec2_neg) {
2661  m_el_negative2_px = elec2_neg->p4().Px();
2662  m_el_negative2_py = elec2_neg->p4().Py();
2663  m_el_negative2_pz = elec2_neg->p4().Pz();
2664  m_el_negative2_d0 = elec2_neg->d0();
2665  m_el_negative2_z0 = elec2_neg->z0();
2668  }
2669  if (elec1_pos) {
2670  m_el_positive1_px = elec1_pos->p4().Px();
2671  m_el_positive1_py = elec1_pos->p4().Py();
2672  m_el_positive1_pz = elec1_pos->p4().Pz();
2673  m_el_positive1_d0 = elec1_pos->d0();
2674  m_el_positive1_z0 = elec1_pos->z0();
2677  }
2678  if (elec2_pos) {
2679  m_el_positive2_px = elec2_pos->p4().Px();
2680  m_el_positive2_py = elec2_pos->p4().Py();
2681  m_el_positive2_pz = elec2_pos->p4().Pz();
2682  m_el_positive2_d0 = elec2_pos->d0();
2683  m_el_positive2_z0 = elec2_pos->z0();
2686  }
2687 
2688  // other quantities
2689  m_nVertex = m_4mu.GetNVertex ();
2694 
2699 
2700  m_pv_x = 0; m_pv_y = 0; m_pv_z = 0;
2701 
2703 
2704  // Obtain MET
2705  std::string metName = "MET_Reference_AntiKt4LCTopo";
2706  std::string metRefFinalName = "FinalClus";
2707  const xAOD::MissingETContainer* final_met = nullptr;
2708 
2709  m_met = -1; // default value
2710  m_metphi = -1;
2711 
2712  if (!evtStore()->contains<xAOD::MissingETContainer>(metName)) {
2713  ATH_MSG_WARNING ( "No Collection with name " << metName << " found in StoreGate");
2714  // return StatusCode::SUCCESS;
2715  }
2716  else {
2717  StatusCode sc = evtStore()->retrieve(final_met, metName);
2718  if (sc.isFailure()) {
2719  ATH_MSG_DEBUG ( "Could not retrieve Collection " << metName << " from StoreGate");
2720  // return StatusCode::SUCCESS;
2721  }
2722  }
2723  const xAOD::MissingET *met = nullptr;
2724  if (final_met) met = (*final_met)[metRefFinalName];
2725  if (met) { // load MET values
2726  m_met = met->met();
2727  m_metphi = met->phi();
2728  }
2729  ATH_MSG_DEBUG (" Zmumu event with MET = " << m_met);
2730 
2731  ATH_MSG_INFO (" -- IDPerfMonZmumu::execute -- Accepted event " << m_4mu.getAcceptedEvents() << " with m_4mu.GetInvMass= " << m_4mu_minv);
2732  ATH_MSG_DEBUG ("**** Filling m_FourMuTree ntuple " << m_FourMuTree->GetName() << " entry " << m_FourMuTree->GetEntries()
2733  << " for run: " << m_runNumber
2734  << " event: " << m_evtNumber
2735  << " Lumiblock: " << m_lumi_block
2736  << " Invariant mass = " << m_4mu_minv << " GeV ");
2737  if (muon1_pos != nullptr) ATH_MSG_DEBUG("mu1+ --> pxyz " << muon1_pos->p4().Px()
2738  << ", " << muon1_pos->p4().Py()
2739  << ", " << muon1_pos->p4().Pz()
2740  << " pt: " << muon1_pos->pt()
2741  << " d0: " << muon1_pos->d0()
2742  << " z0: " << muon1_pos->z0()
2743  << " d0unc: " << muon1_pos->definingParametersCovMatrixVec()[0]
2744  );
2745  if (muon1_neg != nullptr) ATH_MSG_DEBUG("mu1- --> pxyz " << muon1_neg->p4().Px()
2746  << ", " << muon1_neg->p4().Py()
2747  << ", " << muon1_neg->p4().Pz()
2748  << " pt: " << muon1_neg->pt()
2749  << " d0: " << muon1_neg->d0()
2750  << " z0: " << muon1_neg->z0()
2751  << " d0unc: " << muon1_neg->definingParametersCovMatrixVec()[0]
2752  );
2753  if (elec1_pos != nullptr) ATH_MSG_DEBUG("el1+ --> pxyz " << elec1_pos->p4().Px()
2754  << ", " << elec1_pos->p4().Py()
2755  << ", " << elec1_pos->p4().Pz()
2756  << " pt: " << elec1_pos->pt()
2757  << " d0: " << elec1_pos->d0()
2758  << " z0: " << elec1_pos->z0()
2759  << " d0unc: " << elec1_pos->definingParametersCovMatrixVec()[0]
2760  );
2761  // ntuple variables have been filled in FillRecParametersTP
2762  m_FourMuTree->Fill();
2763  }
2764  } // succesful 4mu reco
2765 
2766  } // end of fourMuon Analysis
2767 
2768  return thisStatus;
2769 }
2770 
2771 //==================================================================================
2773 {
2774  // hits info
2775  // positive Muon
2776  const xAOD::TrackParticle* IDTrkMuPos = muon_pos->trackParticle(xAOD::Muon::InnerDetectorTrackParticle);
2777  const xAOD::TrackParticle* IDTrkMuNeg = muon_neg->trackParticle(xAOD::Muon::InnerDetectorTrackParticle);
2778 
2779  int nBLhits, nhitsPIX, nhitsSCT, nhitsTRT, nContribPixLayers;
2780  int nPIXholes, nSCTholes;
2781  if (IDTrkMuPos && IDTrkMuNeg) { // make sure both summaries are available
2782  uint8_t dummy(-1);
2783  nBLhits = IDTrkMuPos->summaryValue( dummy, xAOD::numberOfBLayerHits ) ? dummy :-1;
2784  nhitsPIX = IDTrkMuPos->summaryValue( dummy, xAOD::numberOfPixelHits ) ? dummy :-1;
2785  nhitsSCT = IDTrkMuPos->summaryValue( dummy, xAOD::numberOfSCTHits ) ? dummy :-1;
2786  nhitsTRT = IDTrkMuPos->summaryValue( dummy, xAOD::numberOfTRTHits ) ? dummy :-1;
2787  nContribPixLayers = IDTrkMuPos->summaryValue( dummy, xAOD::numberOfContribPixelLayers )? dummy :-1;
2788 
2789  nPIXholes = IDTrkMuPos->summaryValue( dummy, xAOD::numberOfPixelHoles )? dummy :-1;
2790  nSCTholes = IDTrkMuPos->summaryValue( dummy, xAOD::numberOfSCTHoles )? dummy :-1;
2791 
2792 
2793  m_nBLhits.push_back(nBLhits);
2794  m_nPIXhits.push_back(nhitsPIX);
2795  m_nSCThits.push_back(nhitsSCT);
2796  m_nTRThits.push_back(nhitsTRT);
2797 
2798  ATH_MSG_DEBUG (" -- mu_pos -- HITS --"
2799  << " nBLhits: " << nBLhits
2800  << " nhitsPIX: " << nhitsPIX
2801  << " nPIXLayers: " << nContribPixLayers
2802  << " nhitsSCT: " << nhitsSCT
2803  << " Silicon holes: " << nPIXholes + nSCTholes
2804  << " nhitsTRT: " << nhitsTRT);
2805 
2806  nBLhits = IDTrkMuNeg->summaryValue( dummy, xAOD::numberOfBLayerHits ) ? dummy :-1;
2807  nhitsPIX = IDTrkMuNeg->summaryValue( dummy, xAOD::numberOfPixelHits ) ? dummy :-1;
2808  nhitsSCT = IDTrkMuNeg->summaryValue( dummy, xAOD::numberOfSCTHits ) ? dummy :-1;
2809  nhitsTRT = IDTrkMuNeg->summaryValue( dummy, xAOD::numberOfTRTHits ) ? dummy :-1;
2810  nContribPixLayers = IDTrkMuNeg->summaryValue( dummy, xAOD::numberOfContribPixelLayers )? dummy :-1;
2811  nPIXholes = IDTrkMuNeg->summaryValue( dummy, xAOD::numberOfPixelHoles )? dummy :-1;
2812  nSCTholes = IDTrkMuNeg->summaryValue( dummy, xAOD::numberOfSCTHoles )? dummy :-1;
2813 
2814  m_nBLhits.push_back(nBLhits);
2815  m_nPIXhits.push_back(nhitsPIX);
2816  m_nSCThits.push_back(nhitsSCT);
2817  m_nTRThits.push_back(nhitsTRT);
2818 
2819  ATH_MSG_DEBUG (" -- mu_neg -- HITS --"
2820  << " nBLhits: " << nBLhits
2821  << " nhitsPIX: " << nhitsPIX
2822  << " nPIXLayers: " << nContribPixLayers
2823  << " nhitsSCT: " << nhitsSCT
2824  << " Silicon holes: " << nPIXholes + nSCTholes
2825  << " nhitsTRT: " << nhitsTRT);
2826 
2827  }
2828  return;
2829 }
IDPerfMonZmumu::m_positive_sigma_qoverp
double m_positive_sigma_qoverp
Definition: IDPerfMonZmumu.h:252
IDPerfMonZmumu::m_doIP
bool m_doIP
Definition: IDPerfMonZmumu.h:122
IDPerfMonZmumu::m_negative_d0_manualBS
double m_negative_d0_manualBS
Definition: IDPerfMonZmumu.h:278
IDPerfMonZmumu::m_el_positive2_vtx
int m_el_positive2_vtx
Definition: IDPerfMonZmumu.h:355
IDPerfMonZmumu::m_negative_2_px
double m_negative_2_px
Definition: IDPerfMonZmumu.h:291
IDPerfMonZmumu::m_IDTrack_sigma_z0
std::vector< float > m_IDTrack_sigma_z0
Definition: IDPerfMonZmumu.h:417
IDPerfMonZmumu::m_doDebug
bool m_doDebug
Definition: IDPerfMonZmumu.h:207
IDPerfMonZmumu::m_selTool
ToolHandle< InDet::IInDetTrackSelectionTool > m_selTool
The track selection Tool.
Definition: IDPerfMonZmumu.h:148
Trk::anyDirection
@ anyDirection
Definition: PropDirection.h:22
xAOD::TrackParticle_v1::pt
virtual double pt() const override final
The transverse momentum ( ) of the particle.
Definition: TrackParticle_v1.cxx:73
xAOD::numberOfPixelHoles
@ numberOfPixelHoles
number of pixel layers on track with absence of hits [unit8_t].
Definition: TrackingPrimitives.h:261
IDPerfMonZmumu::m_positive_d0
double m_positive_d0
Definition: IDPerfMonZmumu.h:241
IDPerfMonZmumu::m_el_negative2_pz
double m_el_negative2_pz
Definition: IDPerfMonZmumu.h:320
IDPerfMonZmumu::m_el_positive1_z0_err
double m_el_positive1_z0_err
Definition: IDPerfMonZmumu.h:336
IDPerfMonZmumu::m_IDTreeFolder
std::string m_IDTreeFolder
Definition: IDPerfMonZmumu.h:184
IDPerfMonZmumu::m_defaultTreeName
std::string m_defaultTreeName
Definition: IDPerfMonZmumu.h:167
xAOD::muon
@ muon
Definition: TrackingPrimitives.h:195
IDPerfMonZmumu::m_event_weight
float m_event_weight
Definition: IDPerfMonZmumu.h:229
IDPerfMonZmumu::m_positive_z0
double m_positive_z0
Definition: IDPerfMonZmumu.h:240
IDPerfMonZmumu::m_combTreeName
std::string m_combTreeName
Definition: IDPerfMonZmumu.h:172
IDPerfMonZmumu::m_nSCThits
std::vector< int > m_nSCThits
Definition: IDPerfMonZmumu.h:429
IDPerfMonZmumu::m_el_negative1_vtx
int m_el_negative1_vtx
Definition: IDPerfMonZmumu.h:316
IDPerfMonZmumu::m_Refit1_qoverp
std::vector< float > m_Refit1_qoverp
Definition: IDPerfMonZmumu.h:401
FourMuonEvent::Init
void Init()
Definition: FourMuonEvent.cxx:65
IDPerfMonZmumu::m_el_negative2_vtx
int m_el_negative2_vtx
Definition: IDPerfMonZmumu.h:329
IDPerfMonZmumu::m_positive_1_vtx
int m_positive_1_vtx
Definition: IDPerfMonZmumu.h:253
ATH_MSG_FATAL
#define ATH_MSG_FATAL(x)
Definition: AthMsgStreamMacros.h:34
IDPerfMonZmumu::m_FourMuTree
TTree * m_FourMuTree
Definition: IDPerfMonZmumu.h:201
Trk::ParticleSwitcher::particle
constexpr ParticleHypothesis particle[PARTICLEHYPOTHESES]
the array of masses
Definition: ParticleHypothesis.h:76
IDPerfMonZmumu::m_trackToVertexTool
ToolHandle< Reco::ITrackToVertex > m_trackToVertexTool
tool to extrapolate tracks to BL
Definition: IDPerfMonZmumu.h:138
IDPerfMonZmumu::m_nBLhits
std::vector< int > m_nBLhits
Definition: IDPerfMonZmumu.h:427
IDPerfMonZmumu::m_truthTree
TTree * m_truthTree
Definition: IDPerfMonZmumu.h:198
IDPerfMonZmumu::m_triggerMatching
ToolHandle< Trig::IMatchingTool > m_triggerMatching
Definition: IDPerfMonZmumu.h:145
xAODConfigTool.h
IDPerfMonZmumu::m_4mu_minv
double m_4mu_minv
Definition: IDPerfMonZmumu.h:358
IDPerfMonZmumu::m_truthTreeFolder
std::string m_truthTreeFolder
Definition: IDPerfMonZmumu.h:187
IDPerfMonZmumu::m_negative_parent
int m_negative_parent
Definition: IDPerfMonZmumu.h:289
IDPerfMonZmumu::m_Refit1_phi
std::vector< float > m_Refit1_phi
Definition: IDPerfMonZmumu.h:383
IDPerfMonZmumu::m_truthLinkVecName
std::string m_truthLinkVecName
TrackParticle input name.
Definition: IDPerfMonZmumu.h:220
test_pyathena.px
px
Definition: test_pyathena.py:18
IDPerfMonZmumu::m_Trk2VtxAssociationTool
ToolHandle< CP::ITrackVertexAssociationTool > m_Trk2VtxAssociationTool
Definition: IDPerfMonZmumu.h:209
IDPerfMonZmumu::m_el_positive2_pz
double m_el_positive2_pz
Definition: IDPerfMonZmumu.h:346
FourMuonEvent::getELTrack
const xAOD::TrackParticle * getELTrack(unsigned int uPart)
Definition: FourMuonEvent.h:80
IDPerfMonZmumu::m_nPIXhits
std::vector< int > m_nPIXhits
Definition: IDPerfMonZmumu.h:428
phi
Scalar phi() const
phi method
Definition: AmgMatrixBasePlugin.h:67
SG::ReadCondHandle
Definition: ReadCondHandle.h:44
IDPerfMonZmumu::m_negative_2_vtx
int m_negative_2_vtx
Definition: IDPerfMonZmumu.h:302
ATH_MSG_INFO
#define ATH_MSG_INFO(x)
Definition: AthMsgStreamMacros.h:31
xAOD::uint8_t
uint8_t
Definition: Muon_v1.cxx:557
xAOD::EventInfo_v1::eventNumber
uint64_t eventNumber() const
The current event's event number.
FourMuonEvent::GetVertexMuPos2
int GetVertexMuPos2()
Definition: FourMuonEvent.h:100
xAOD::EventInfo_v1::beamTiltXZ
float beamTiltXZ() const
The beam's tilt in radians in XZ.
Trk::Track
The ATLAS Track class.
Definition: Tracking/TrkEvent/TrkTrack/TrkTrack/Track.h:73
IDPerfMonZmumu::m_el_negative1_py
double m_el_negative1_py
Definition: IDPerfMonZmumu.h:306
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
xAOD::Muon_v1::trackParticle
const TrackParticle * trackParticle(TrackParticleType type) const
Returns a pointer (which can be NULL) to the TrackParticle used in identification of this muon.
Definition: Muon_v1.cxx:486
IDPerfMonZmumu::m_positive_qoverp
double m_positive_qoverp
Definition: IDPerfMonZmumu.h:251
IDPerfMonZmumu::m_Refit1_sigma_pt
std::vector< float > m_Refit1_sigma_pt
Definition: IDPerfMonZmumu.h:409
FourMuonEvent::SetZ0GapCut
void SetZ0GapCut(double newvalue)
Definition: FourMuonEvent.h:116
IDPerfMonZmumu::m_Truth_d0
std::vector< float > m_Truth_d0
Definition: IDPerfMonZmumu.h:391
xAOD::EventInfo_v1::mcEventWeights
const std::vector< float > & mcEventWeights() const
The weights of all the MC events used in the simulation.
IDPerfMonZmumu::m_CBTrack_d0
std::vector< float > m_CBTrack_d0
Definition: IDPerfMonZmumu.h:388
xAOD::TrackParticle_v1::charge
float charge() const
Returns the charge.
Definition: TrackParticle_v1.cxx:150
FourMuonEvent::SetMuonSelectionTool
void SetMuonSelectionTool(ToolHandle< CP::IMuonSelectionTool > mst)
Definition: FourMuonEvent.h:113
IDPerfMonZmumu::m_Refit2_z0
std::vector< float > m_Refit2_z0
Definition: IDPerfMonZmumu.h:396
Trk::PerigeeSurface
Definition: PerigeeSurface.h:43
eta
Scalar eta() const
pseudorapidity method
Definition: AmgMatrixBasePlugin.h:83
IDPerfMonZmumu::m_defaultTree
TTree * m_defaultTree
Definition: IDPerfMonZmumu.h:194
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
AthCommonDataStore< AthCommonMsg< Algorithm > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
Definition: AthCommonDataStore.h:145
IDPerfMonZmumu::m_TrackRefitter2
ToolHandle< IegammaTrkRefitterTool > m_TrackRefitter2
The track refitter.
Definition: IDPerfMonZmumu.h:135
IDPerfMonZmumu::m_CBTrack_phi
std::vector< float > m_CBTrack_phi
Definition: IDPerfMonZmumu.h:382
Trk::ParametersT
Dummy class used to allow special convertors to be called for surfaces owned by a detector element.
Definition: EMErrorDetail.h:25
IDPerfMonZmumu::m_Truth_qoverp
std::vector< float > m_Truth_qoverp
Definition: IDPerfMonZmumu.h:403
IDPerfMonZmumu::m_doRemoval
bool m_doRemoval
Definition: IDPerfMonZmumu.h:206
IDPerfMonZmumu::m_EventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_EventInfoKey
Definition: IDPerfMonZmumu.h:438
Trk::ImpactParametersAndSigma::PVsigmaz0
double PVsigmaz0
Definition: ITrackToVertexIPEstimator.h:41
FourMuonEvent::Reco
bool Reco()
Definition: FourMuonEvent.cxx:85
xAOD::TrackParticle_v1::summaryValue
bool summaryValue(uint8_t &value, const SummaryType &information) const
Accessor for TrackSummary values.
Definition: TrackParticle_v1.cxx:736
IDPerfMonZmumu::m_FourMuTreeName
std::string m_FourMuTreeName
Definition: IDPerfMonZmumu.h:174
EventPrimitivesHelpers.h
IDPerfMonZmumu::m_IDTrack_sigma_qoverp
std::vector< float > m_IDTrack_sigma_qoverp
Definition: IDPerfMonZmumu.h:422
IDPerfMonZmumu::m_CBTrack_eta
std::vector< float > m_CBTrack_eta
Definition: IDPerfMonZmumu.h:376
FourMuonEvent::GetNVertex
int GetNVertex()
Definition: FourMuonEvent.h:88
xAOD::JetInput::Track
@ Track
Definition: JetContainerInfo.h:61
IDPerfMonZmumu::m_negative_2_pz
double m_negative_2_pz
Definition: IDPerfMonZmumu.h:293
ZmumuEvent::getMSTrack
const xAOD::TrackParticle * getMSTrack(unsigned int uPart)
Definition: ZmumuEvent.h:75
IDPerfMonZmumu::m_trackContainerName
SG::ReadHandleKey< xAOD::TrackParticleContainer > m_trackContainerName
IDTtacks.
Definition: IDPerfMonZmumu.h:215
test_pyathena.pt
pt
Definition: test_pyathena.py:11
IDPerfMonZmumu::m_met
double m_met
Definition: IDPerfMonZmumu.h:365
xAOD::EventInfo_v1::beamTiltYZ
float beamTiltYZ() const
The beam's tilt in radians in YZ.
IDPerfMonZmumu::m_positive_2_d0
double m_positive_2_d0
Definition: IDPerfMonZmumu.h:260
IDPerfMonZmumu::m_isMC
bool m_isMC
Definition: IDPerfMonZmumu.h:119
xAOD::TrackParticle_v1::z0
float z0() const
Returns the parameter.
ParticleTest.tp
tp
Definition: ParticleTest.py:25
Trk::z0
@ z0
Definition: ParamDefs.h:64
ZmumuEvent.h
xAOD::TrackParticle_v1::definingParametersCovMatrixVec
std::vector< float > definingParametersCovMatrixVec() const
Returns the length 6 vector containing the elements of defining parameters covariance matrix.
Definition: TrackParticle_v1.cxx:385
FourMuonEvent::SetMassWindowHigh
void SetMassWindowHigh(double newvalue)
Definition: FourMuonEvent.h:111
IDPerfMonZmumu::m_positive_py
double m_positive_py
Definition: IDPerfMonZmumu.h:235
TrigDecisionTool.h
IDPerfMonZmumu::CheckTriggerStatusAndPrescale
StatusCode CheckTriggerStatusAndPrescale()
Definition: IDPerfMonZmumu.cxx:2290
Trk::ImpactParametersAndSigma::IPd0
double IPd0
Definition: ITrackToVertexIPEstimator.h:34
xAOD::numberOfPixelHits
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
Definition: TrackingPrimitives.h:259
xAOD::numberOfTRTHits
@ numberOfTRTHits
number of TRT hits [unit8_t].
Definition: TrackingPrimitives.h:275
IDPerfMonZmumu::m_refit2Tree
TTree * m_refit2Tree
Definition: IDPerfMonZmumu.h:197
IDPerfMonZmumu::bookTrees
StatusCode bookTrees()
Definition: IDPerfMonZmumu.cxx:301
SG::ConstAccessor< int >
IDPerfMonZmumu::m_el_positive1_d0_err
double m_el_positive1_d0_err
Definition: IDPerfMonZmumu.h:337
ChainGroup.h
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
drawFromPickle.cos
cos
Definition: drawFromPickle.py:36
IDPerfMonZmumu::m_negative_2_py
double m_negative_2_py
Definition: IDPerfMonZmumu.h:292
IDPerfMonZmumu::m_CBTrack_sigma_qoverp
std::vector< float > m_CBTrack_sigma_qoverp
Definition: IDPerfMonZmumu.h:423
InDetAccessor::qOverP
@ qOverP
perigee
Definition: InDetAccessor.h:35
IDPerfMonZmumu::m_CBTrack_pt
std::vector< float > m_CBTrack_pt
Definition: IDPerfMonZmumu.h:370
IDPerfMonZmumu::m_negative_px
double m_negative_px
Definition: IDPerfMonZmumu.h:269
PerfMonServices.h
xAOD::IParticle
Class providing the definition of the 4-vector interface.
Definition: Event/xAOD/xAODBase/xAODBase/IParticle.h:41
ZmumuEvent::getNegMuon
unsigned int getNegMuon(ZTYPE eType)
Definition: ZmumuEvent.cxx:549
IDPerfMonZmumu::m_Truth_pt
std::vector< float > m_Truth_pt
Definition: IDPerfMonZmumu.h:373
IDPerfMonZmumu::m_positive_px
double m_positive_px
Definition: IDPerfMonZmumu.h:234
IDPerfMonZmumu::m_el_negative2_px
double m_el_negative2_px
Definition: IDPerfMonZmumu.h:318
xAOD::Vertex_v1::vertexType
VxType::VertexType vertexType() const
The type of the vertex.
xAOD::EventInfo_v1::beamPosX
float beamPosX() const
X coordinate of the beam spot position.
IDPerfMonZmumu::m_refit1TreeFolder
std::string m_refit1TreeFolder
Definition: IDPerfMonZmumu.h:185
TrackTruthKey.h
IDPerfMonZmumu::m_Refit2_eta
std::vector< float > m_Refit2_eta
Definition: IDPerfMonZmumu.h:378
IDPerfMonZmumu::m_truthName
std::string m_truthName
Definition: IDPerfMonZmumu.h:218
IDPerfMonZmumu::m_el_negative1_px
double m_el_negative1_px
Definition: IDPerfMonZmumu.h:305
FourMuonEvent::GetVertexMuNeg1
int GetVertexMuNeg1()
Definition: FourMuonEvent.h:97
IDPerfMonZmumu::m_LeadingMuonPtCut
double m_LeadingMuonPtCut
Definition: IDPerfMonZmumu.h:115
xAOD::numberOfBLayerHits
@ numberOfBLayerHits
these are the hits in the first pixel layer, i.e.
Definition: TrackingPrimitives.h:231
xAOD::TruthVertex_v1::y
float y() const
Vertex y displacement.
xAOD::Muon_v1
Class describing a Muon.
Definition: Muon_v1.h:38
IDPerfMonZmumu::m_beamSpotKey
SG::ReadCondHandleKey< InDet::BeamSpotData > m_beamSpotKey
used for truth parameters
Definition: IDPerfMonZmumu.h:155
IDPerfMonZmumu::m_positive_d0_manualBS
double m_positive_d0_manualBS
Definition: IDPerfMonZmumu.h:243
IDPerfMonZmumu::m_pv_z
double m_pv_z
Definition: IDPerfMonZmumu.h:362
xAOD::TrackParticle_v1::d0
float d0() const
Returns the parameter.
xAOD::EventInfo_v1::runNumber
uint32_t runNumber() const
The current event's run number.
IDPerfMonZmumu::m_nTrkInVtx
unsigned int m_nTrkInVtx
Definition: IDPerfMonZmumu.h:363
IDPerfMonZmumu::finalize
virtual StatusCode finalize()
Definition: IDPerfMonZmumu.cxx:2283
IDPerfMonZmumu::m_el_positive1_py
double m_el_positive1_py
Definition: IDPerfMonZmumu.h:332
IDPerfMonZmumu::m_positive_z0_manualBS
double m_positive_z0_manualBS
Definition: IDPerfMonZmumu.h:242
IDPerfMonZmumu::m_TrackRefitter1
ToolHandle< IegammaTrkRefitterTool > m_TrackRefitter1
The track refitter.
Definition: IDPerfMonZmumu.h:132
ZmumuEvent::SetMaxLumiBlock
void SetMaxLumiBlock(int newlumiblock)
Definition: ZmumuEvent.h:89
AthenaPoolTestRead.sc
sc
Definition: AthenaPoolTestRead.py:27
IDPerfMonZmumu::m_MSTreeName
std::string m_MSTreeName
Definition: IDPerfMonZmumu.h:173
IDPerfMonZmumu::m_maxGoodLumiBlock
int m_maxGoodLumiBlock
Definition: IDPerfMonZmumu.h:128
IDPerfMonZmumu::m_positive_z0_PV
double m_positive_z0_PV
Definition: IDPerfMonZmumu.h:247
FourMuonEvent::EventPassed
bool EventPassed()
Definition: FourMuonEvent.h:76
IDPerfMonZmumu::m_Refit1_z0
std::vector< float > m_Refit1_z0
Definition: IDPerfMonZmumu.h:395
IegammaTrkRefitterTool::Cache
Struct Holding the result to return and intermediate objects Things are owned by the EDM or the uniqu...
Definition: IegammaTrkRefitterTool.h:39
IDPerfMonZmumu::m_el_positive1_d0
double m_el_positive1_d0
Definition: IDPerfMonZmumu.h:335
IDPerfMonZmumu::m_xZmm
ZmumuEvent m_xZmm
Definition: IDPerfMonZmumu.h:107
IDPerfMonZmumu::m_negative_d0_PV
double m_negative_d0_PV
Definition: IDPerfMonZmumu.h:283
IMuonSelectionTool.h
IDPerfMonZmumu::m_positive_2_pz
double m_positive_2_pz
Definition: IDPerfMonZmumu.h:258
IDPerfMonZmumu::m_commonTree
TTree * m_commonTree
Definition: IDPerfMonZmumu.h:193
FourMuonEvent::doIPSelection
void doIPSelection(bool doIPsel)
Definition: FourMuonEvent.h:74
IDPerfMonZmumu::m_minGoodLumiBlock
int m_minGoodLumiBlock
Definition: IDPerfMonZmumu.h:127
IDPerfMonZmumu::m_IDTrack_d0
std::vector< float > m_IDTrack_d0
Definition: IDPerfMonZmumu.h:387
xAOD::TrackParticle_v1::p4
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
Definition: TrackParticle_v1.cxx:129
Trk::ImpactParametersAndSigma::PVsigmad0
double PVsigmad0
Definition: ITrackToVertexIPEstimator.h:40
IDPerfMonZmumu::m_validationMode
bool m_validationMode
< boolean to switch to validation mode
Definition: IDPerfMonZmumu.h:163
IDPerfMonZmumu::m_trackParticleName
std::string m_trackParticleName
Track(Particle)TruthCollection input name.
Definition: IDPerfMonZmumu.h:219
AthCommonDataStore< AthCommonMsg< Algorithm > >::evtStore
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Definition: AthCommonDataStore.h:85
IDPerfMonZmumu::m_positive_pz
double m_positive_pz
Definition: IDPerfMonZmumu.h:237
xAOD::EventInfo_v1::beamPosY
float beamPosY() const
Y coordinate of the beam spot position.
FourMuonEvent::getNegMuon
unsigned int getNegMuon(int eType)
Definition: FourMuonEvent.cxx:1278
IDPerfMonZmumu::m_doMCPSelection
bool m_doMCPSelection
Definition: IDPerfMonZmumu.h:112
xAOD::TrackParticle_v1::perigeeParameters
const Trk::Perigee & perigeeParameters() const
Returns the Trk::MeasuredPerigee track parameters.
Definition: TrackParticle_v1.cxx:485
IDPerfMonZmumu::m_ValidationTreeDescription
std::string m_ValidationTreeDescription
< validation tree description - second argument in TTree
Definition: IDPerfMonZmumu.h:179
met
Definition: IMETSignificance.h:24
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
IDPerfMonZmumu::m_refit2TreeFolder
std::string m_refit2TreeFolder
Definition: IDPerfMonZmumu.h:186
IDPerfMonZmumu::FillTruthParameters
StatusCode FillTruthParameters(const xAOD::TrackParticle *track)
Definition: IDPerfMonZmumu.cxx:2078
FourMuonEvent::GetInvMass
double GetInvMass()
Definition: FourMuonEvent.h:82
IDPerfMonZmumu::m_el_negative1_z0_err
double m_el_negative1_z0_err
Definition: IDPerfMonZmumu.h:310
IDPerfMonZmumu::m_Refit1_sigma_z0
std::vector< float > m_Refit1_sigma_z0
Definition: IDPerfMonZmumu.h:419
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
IDPerfMonZmumu::m_Refit2_qoverp
std::vector< float > m_Refit2_qoverp
Definition: IDPerfMonZmumu.h:402
ParticleGun_EoverP_Config.momentum
momentum
Definition: ParticleGun_EoverP_Config.py:63
IDPerfMonZmumu::m_skipMS
bool m_skipMS
Definition: IDPerfMonZmumu.h:125
IDPerfMonZmumu::m_CBTrack_sigma_pt
std::vector< float > m_CBTrack_sigma_pt
Definition: IDPerfMonZmumu.h:408
IDPerfMonZmumu::m_IDTree
TTree * m_IDTree
Definition: IDPerfMonZmumu.h:195
FourMuonEvent::getPosMuon
unsigned int getPosMuon(int eType)
Definition: FourMuonEvent.cxx:1267
IDPerfMonZmumu::m_positive_parent
int m_positive_parent
Definition: IDPerfMonZmumu.h:254
TrackTruthCollection.h
IDPerfMonZmumu::RegisterHistograms
void RegisterHistograms()
Definition: IDPerfMonZmumu.cxx:933
FourMuonEvent::GetVertexMuPos1
int GetVertexMuPos1()
Definition: FourMuonEvent.h:99
IDPerfMonZmumu::m_IDTrack_phi
std::vector< float > m_IDTrack_phi
Definition: IDPerfMonZmumu.h:381
lumiFormat.i
int i
Definition: lumiFormat.py:85
SG::OWN_ELEMENTS
@ OWN_ELEMENTS
this data object owns its elements
Definition: OwnershipPolicy.h:17
TrackCollection
DataVector< Trk::Track > TrackCollection
This typedef represents a collection of Trk::Track objects.
Definition: TrackCollection.h:19
IDPerfMonZmumu::m_positive_2_z0_err
double m_positive_2_z0_err
Definition: IDPerfMonZmumu.h:261
IDPerfMonZmumu::m_el_positive2_d0_err
double m_el_positive2_d0_err
Definition: IDPerfMonZmumu.h:350
IegammaTrkRefitterTool.h
IDPerfMonZmumu::m_CBTrack_sigma_z0
std::vector< float > m_CBTrack_sigma_z0
Definition: IDPerfMonZmumu.h:418
IDPerfMonZmumu::m_el_positive1_px
double m_el_positive1_px
Definition: IDPerfMonZmumu.h:331
IDPerfMonZmumu::m_runNumber
unsigned int m_runNumber
Definition: IDPerfMonZmumu.h:225
Trk::theta
@ theta
Definition: ParamDefs.h:66
IDPerfMonZmumu::m_combTreeFolder
std::string m_combTreeFolder
Definition: IDPerfMonZmumu.h:188
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
ATH_MSG_DEBUG
#define ATH_MSG_DEBUG(x)
Definition: AthMsgStreamMacros.h:29
xAOD::TruthParticle_v1
Class describing a truth particle in the MC record.
Definition: TruthParticle_v1.h:37
IDPerfMonZmumu::m_Refit1_sigma_qoverp
std::vector< float > m_Refit1_sigma_qoverp
Definition: IDPerfMonZmumu.h:424
IDPerfMonZmumu::m_doRefit
bool m_doRefit
Definition: IDPerfMonZmumu.h:120
IDPerfMonZmumu::m_el_negative1_z0
double m_el_negative1_z0
Definition: IDPerfMonZmumu.h:308
IDPerfMonZmumu::m_IDTrack_eta
std::vector< float > m_IDTrack_eta
Definition: IDPerfMonZmumu.h:375
xAOD::VxType::PriVtx
@ PriVtx
Primary vertex.
Definition: TrackingPrimitives.h:571
Trk::ImpactParametersAndSigma::IPz0
double IPz0
Definition: ITrackToVertexIPEstimator.h:35
TRT::Track::d0
@ d0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:62
IDPerfMonZmumu::m_positive_2_py
double m_positive_2_py
Definition: IDPerfMonZmumu.h:257
Amg::pz
@ pz
Definition: GeoPrimitives.h:40
xAOD::MissingET_v1
Principal data object for Missing ET.
Definition: MissingET_v1.h:25
FourMuonEvent::SetLeadingMuonPtCut
void SetLeadingMuonPtCut(double newvalue)
Definition: FourMuonEvent.cxx:1323
IDPerfMonZmumu::m_negative_pt
double m_negative_pt
Definition: IDPerfMonZmumu.h:271
IDPerfMonZmumu::m_IDTrack_z0
std::vector< float > m_IDTrack_z0
Definition: IDPerfMonZmumu.h:393
AthenaPoolTestRead.acc
acc
Definition: AthenaPoolTestRead.py:16
IDPerfMonZmumu::m_MuonQualityName
std::string m_MuonQualityName
Definition: IDPerfMonZmumu.h:435
python.xAODType.dummy
dummy
Definition: xAODType.py:4
IDPerfMonZmumu::m_positive_d0_err
double m_positive_d0_err
Definition: IDPerfMonZmumu.h:245
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
IDPerfMonZmumu::m_triggerPrescale
int m_triggerPrescale
Definition: IDPerfMonZmumu.h:230
IDPerfMonZmumu::m_Refit1_eta
std::vector< float > m_Refit1_eta
Definition: IDPerfMonZmumu.h:377
IDPerfMonZmumu::m_IDTrack_sigma_d0
std::vector< float > m_IDTrack_sigma_d0
Definition: IDPerfMonZmumu.h:412
ZmumuEvent::AcceptEvent
bool AcceptEvent()
Definition: ZmumuEvent.h:67
IDPerfMonZmumu::m_negative_d0_PVerr
double m_negative_d0_PVerr
Definition: IDPerfMonZmumu.h:285
IDPerfMonZmumu::m_IDTrack_sigma_pt
std::vector< float > m_IDTrack_sigma_pt
Definition: IDPerfMonZmumu.h:407
IDPerfMonZmumu::m_metphi
double m_metphi
Definition: IDPerfMonZmumu.h:366
IDPerfMonZmumu::m_CBTrack_sigma_d0
std::vector< float > m_CBTrack_sigma_d0
Definition: IDPerfMonZmumu.h:413
IDPerfMonZmumu::m_nTRThits
std::vector< int > m_nTRThits
Definition: IDPerfMonZmumu.h:430
IDPerfMonZmumu::m_lumi_block
unsigned int m_lumi_block
Definition: IDPerfMonZmumu.h:227
drawFromPickle.tan
tan
Definition: drawFromPickle.py:36
IDPerfMonZmumu::m_Refit1_pt
std::vector< float > m_Refit1_pt
Definition: IDPerfMonZmumu.h:371
Trk::ImpactParametersAndSigma::sigmad0
double sigmad0
Definition: ITrackToVertexIPEstimator.h:37
IDPerfMonZmumu::~IDPerfMonZmumu
~IDPerfMonZmumu()
Definition: IDPerfMonZmumu.cxx:165
SG::VarHandleKey::initialize
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Definition: AthToolSupport/AsgDataHandles/Root/VarHandleKey.cxx:103
IDPerfMonZmumu::m_UseTrigger
bool m_UseTrigger
Definition: IDPerfMonZmumu.h:109
Trk::CurvilinearParametersT
Definition: CurvilinearParametersT.h:48
TRT::Track::z0
@ z0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:63
PerfMonServices::VTX_COLLECTION
@ VTX_COLLECTION
Definition: PerfMonServices.h:46
xAOD::numberOfSCTHoles
@ numberOfSCTHoles
number of SCT holes [unit8_t].
Definition: TrackingPrimitives.h:270
IDPerfMonZmumu::m_outputTracksName
std::string m_outputTracksName
Definition: IDPerfMonZmumu.h:434
IDPerfMonZmumu::m_Refit2_phi
std::vector< float > m_Refit2_phi
Definition: IDPerfMonZmumu.h:384
IDPerfMonZmumu::m_combTree
TTree * m_combTree
Definition: IDPerfMonZmumu.h:199
IDPerfMonZmumu::m_el_positive1_vtx
int m_el_positive1_vtx
Definition: IDPerfMonZmumu.h:342
DataVector< Trk::Track >
ZmumuEvent::doMCPSelection
void doMCPSelection(bool doMCP)
Definition: ZmumuEvent.h:66
IInDetTrackSelectionTool.h
ZmumuEvent::getCombMuon
const xAOD::Muon * getCombMuon(unsigned int uPart)
Definition: ZmumuEvent.h:70
IDPerfMonZmumu::m_positive_2_vtx
int m_positive_2_vtx
Definition: IDPerfMonZmumu.h:267
IDPerfMonZmumu::m_negative_qoverp
double m_negative_qoverp
Definition: IDPerfMonZmumu.h:286
IDPerfMonZmumu::m_el_negative2_z0_err
double m_el_negative2_z0_err
Definition: IDPerfMonZmumu.h:323
IDPerfMonZmumu::m_el_positive2_py
double m_el_positive2_py
Definition: IDPerfMonZmumu.h:345
xAOD::EventInfo_v1::lumiBlock
uint32_t lumiBlock() const
The current event's luminosity block number.
IDPerfMonZmumu::m_negative_d0_err
double m_negative_d0_err
Definition: IDPerfMonZmumu.h:280
AthAlgorithm
Definition: AthAlgorithm.h:47
SG::ReadHandle::isValid
virtual bool isValid() override final
Can the handle be successfully dereferenced?
IDPerfMonZmumu::m_Refit2_d0
std::vector< float > m_Refit2_d0
Definition: IDPerfMonZmumu.h:390
IDPerfMonZmumu::m_positive_2_d0_err
double m_positive_2_d0_err
Definition: IDPerfMonZmumu.h:262
IDPerfMonZmumu::FillRecParametersSimple
StatusCode FillRecParametersSimple(const Trk::Track *track, float charge, const xAOD::Vertex *vertex)
Definition: IDPerfMonZmumu.cxx:1984
IDPerfMonZmumu::getTruthParticle
const xAOD::TruthParticle * getTruthParticle(const xAOD::IParticle &p)
Definition: IDPerfMonZmumu.cxx:2263
IDPerfMonZmumu::FillRecParameters
StatusCode FillRecParameters(const Trk::Track *track, const xAOD::TrackParticle *trackp_for_unbias, double charge, const xAOD::Vertex *vertex, const EventContext &ctx)
Definition: IDPerfMonZmumu.cxx:1814
IDPerfMonZmumu::m_OpeningAngleCut
double m_OpeningAngleCut
Definition: IDPerfMonZmumu.h:117
IDPerfMonZmumu::ResetCommonNtupleVectors
void ResetCommonNtupleVectors()
Definition: IDPerfMonZmumu.cxx:2371
IDPerfMonZmumu::m_negative_pz
double m_negative_pz
Definition: IDPerfMonZmumu.h:272
IDPerfMonZmumu::m_negative_2_d0_err
double m_negative_2_d0_err
Definition: IDPerfMonZmumu.h:297
IDPerfMonZmumu::m_negative_eta
double m_negative_eta
Definition: IDPerfMonZmumu.h:274
Trk::Track::perigeeParameters
const Perigee * perigeeParameters() const
return Perigee.
Definition: Tracking/TrkEvent/TrkTrack/src/Track.cxx:163
xAOD::TruthVertex_v1
Class describing a truth vertex in the MC record.
Definition: TruthVertex_v1.h:37
xAOD::MissingETContainer_v1
Container for xAOD::MissingET_v1 objects.
Definition: MissingETContainer_v1.h:21
ZmumuEvent::doIPSelection
void doIPSelection(bool doIPsel)
Definition: ZmumuEvent.h:65
Trk::ParametersBase::pT
double pT() const
Access method for transverse momentum.
FourMuonEvent::getAcceptedEvents
int getAcceptedEvents()
Definition: FourMuonEvent.h:78
IDPerfMonZmumu::m_Truth_z0
std::vector< float > m_Truth_z0
Definition: IDPerfMonZmumu.h:397
Amg::py
@ py
Definition: GeoPrimitives.h:39
MissingET.h
xAOD::EventInfo_v1::beamPosZ
float beamPosZ() const
Z coordinate of the beam spot position.
xAOD::TrackParticle_v1::qOverP
float qOverP() const
Returns the parameter.
IDPerfMonZmumu::m_negative_z0_PVerr
double m_negative_z0_PVerr
Definition: IDPerfMonZmumu.h:284
xAOD::TrackParticle_v1::definingParametersCovMatrix
const ParametersCovMatrix_t definingParametersCovMatrix() const
Returns the 5x5 symmetric matrix containing the defining parameters covariance matrix.
Definition: TrackParticle_v1.cxx:246
ZmumuEvent::setDebugMode
void setDebugMode(bool debug)
Definition: ZmumuEvent.h:88
IDPerfMonZmumu::m_negative_1_vtx
int m_negative_1_vtx
Definition: IDPerfMonZmumu.h:288
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:228
Trk::d0
@ d0
Definition: ParamDefs.h:63
IDPerfMonZmumu::m_useCustomMuonSelector
bool m_useCustomMuonSelector
Definition: IDPerfMonZmumu.h:126
MatchingTool.h
ZmumuEvent::SetMuonSelectionTool
void SetMuonSelectionTool(ToolHandle< CP::IMuonSelectionTool > mst)
Definition: ZmumuEvent.h:103
Amg::error
double error(const Amg::MatrixX &mat, int index)
return diagonal error of the matrix caller should ensure the matrix is symmetric and the index is in ...
Definition: EventPrimitivesHelpers.h:40
IDPerfMonZmumu::m_vertexKey
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexKey
Definition: IDPerfMonZmumu.h:212
IDPerfMonZmumu::m_el_positive2_d0
double m_el_positive2_d0
Definition: IDPerfMonZmumu.h:348
FourMuonEvent::setDebugMode
void setDebugMode(bool debug)
Definition: FourMuonEvent.h:108
ZmumuEvent::doIsoSelection
void doIsoSelection(bool doIso)
Definition: ZmumuEvent.h:64
IDPerfMonZmumu::m_Truth_phi
std::vector< float > m_Truth_phi
Definition: IDPerfMonZmumu.h:385
charge
double charge(const T &p)
Definition: AtlasPID.h:756
IDPerfMonZmumu::m_MSTreeFolder
std::string m_MSTreeFolder
Definition: IDPerfMonZmumu.h:189
IDPerfMonZmumu::m_Refit2_sigma_pt
std::vector< float > m_Refit2_sigma_pt
Definition: IDPerfMonZmumu.h:410
FourMuonEvent::setContainer
void setContainer(PerfMonServices::CONTAINERS container)
Definition: FourMuonEvent.h:107
DataVector::push_back
value_type push_back(value_type pElem)
Add an element to the end of the collection.
IDPerfMonZmumu::m_el_negative2_py
double m_el_negative2_py
Definition: IDPerfMonZmumu.h:319
SG::CondHandleKey::initialize
StatusCode initialize(bool used=true)
IDPerfMonZmumu::m_el_negative2_d0
double m_el_negative2_d0
Definition: IDPerfMonZmumu.h:322
IDPerfMonZmumu::m_positive_2_z0
double m_positive_2_z0
Definition: IDPerfMonZmumu.h:259
IDPerfMonZmumu::m_positive_phi
double m_positive_phi
Definition: IDPerfMonZmumu.h:238
IDPerfMonZmumu::m_MSTree
TTree * m_MSTree
Definition: IDPerfMonZmumu.h:200
IDPerfMonZmumu::m_Refit1_sigma_d0
std::vector< float > m_Refit1_sigma_d0
Definition: IDPerfMonZmumu.h:414
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
IDPerfMonZmumu::m_muonSelector
ToolHandle< CP::IMuonSelectionTool > m_muonSelector
used to pass a custom muon selector
Definition: IDPerfMonZmumu.h:159
IDPerfMonZmumu::m_negative_2_d0
double m_negative_2_d0
Definition: IDPerfMonZmumu.h:295
IDPerfMonZmumu::m_sTriggerChainName
std::string m_sTriggerChainName
Definition: IDPerfMonZmumu.h:433
IDPerfMonZmumu::m_negative_d0
double m_negative_d0
Definition: IDPerfMonZmumu.h:276
IDPerfMonZmumu::m_trackToVertexIPEstimator
ToolHandle< Trk::ITrackToVertexIPEstimator > m_trackToVertexIPEstimator
Needed for IP resolution studies.
Definition: IDPerfMonZmumu.h:152
IDPerfMonZmumu::m_refit1TreeName
std::string m_refit1TreeName
Definition: IDPerfMonZmumu.h:169
IDPerfMonZmumu::m_el_positive1_pz
double m_el_positive1_pz
Definition: IDPerfMonZmumu.h:333
ZmumuEvent::SetSecondMuonPtCut
void SetSecondMuonPtCut(double newvalue)
Definition: ZmumuEvent.cxx:617
ZmumuEvent::SetMuonQuality
void SetMuonQuality(const std::string &newname)
Definition: ZmumuEvent.h:92
xAOD::TruthVertex_v1::x
float x() const
Vertex x displacement.
IDPerfMonZmumu::initialize
virtual StatusCode initialize()
Definition: IDPerfMonZmumu.cxx:170
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
IDPerfMonZmumu::m_Z0GapCut
double m_Z0GapCut
Definition: IDPerfMonZmumu.h:118
IDPerfMonZmumu::m_nVertex
unsigned int m_nVertex
Definition: IDPerfMonZmumu.h:232
IDPerfMonZmumu::m_commonTreeFolder
std::string m_commonTreeFolder
Definition: IDPerfMonZmumu.h:182
ZmumuEvent::SetLeadingMuonPtCut
void SetLeadingMuonPtCut(double newvalue)
Definition: ZmumuEvent.cxx:600
Trk::ParametersBase::momentum
const Amg::Vector3D & momentum() const
Access method for the momentum.
IDPerfMonZmumu::m_positive_d0_PVerr
double m_positive_d0_PVerr
Definition: IDPerfMonZmumu.h:250
ZmumuEvent::SetMinLumiBlock
void SetMinLumiBlock(int newlumiblock)
Definition: ZmumuEvent.h:90
IDPerfMonZmumu::m_el_positive2_z0
double m_el_positive2_z0
Definition: IDPerfMonZmumu.h:347
Trk::vertex
@ vertex
Definition: MeasurementType.h:21
ZmumuEvent::GetInvMass
double GetInvMass()
Definition: ZmumuEvent.h:72
IDPerfMonZmumu::m_el_positive2_z0_err
double m_el_positive2_z0_err
Definition: IDPerfMonZmumu.h:349
IDPerfMonZmumu::m_positive_d0_PV
double m_positive_d0_PV
Definition: IDPerfMonZmumu.h:248
FourMuonEvent.h
IDPerfMonZmumu::FillRecParametersTP
StatusCode FillRecParametersTP(const xAOD::TrackParticle *trackp, const xAOD::TrackParticle *trackp_for_unbias, double charge, const xAOD::Vertex *vertex=nullptr)
Definition: IDPerfMonZmumu.cxx:1672
IDPerfMonZmumu::m_IDTreeName
std::string m_IDTreeName
Definition: IDPerfMonZmumu.h:168
IDPerfMonZmumu::Clear4MuNtupleVariables
void Clear4MuNtupleVariables()
Definition: IDPerfMonZmumu.cxx:2440
IDPerfMonZmumu::execute
virtual StatusCode execute()
Definition: IDPerfMonZmumu.cxx:940
IDPerfMonZmumu::m_useTrackSelectionTool
bool m_useTrackSelectionTool
Definition: IDPerfMonZmumu.h:121
IDPerfMonZmumu::m_el_negative1_pz
double m_el_negative1_pz
Definition: IDPerfMonZmumu.h:307
ZmumuEvent::CB
@ CB
Definition: ZmumuEvent.h:55
IDPerfMonZmumu::m_positive_z0_err
double m_positive_z0_err
Definition: IDPerfMonZmumu.h:244
IDPerfMonZmumu::m_positive_eta
double m_positive_eta
Definition: IDPerfMonZmumu.h:239
xAOD::Vertex_v1
Class describing a Vertex.
Definition: Vertex_v1.h:42
ZmumuEvent::finalize
void finalize()
Definition: ZmumuEvent.cxx:669
ATH_MSG_WARNING
#define ATH_MSG_WARNING(x)
Definition: AthMsgStreamMacros.h:32
IDPerfMonZmumu::m_el_negative1_d0_err
double m_el_negative1_d0_err
Definition: IDPerfMonZmumu.h:311
IDPerfMonZmumu::m_event_mu
unsigned int m_event_mu
Definition: IDPerfMonZmumu.h:228
IDPerfMonZmumu::m_CBTrack_z0
std::vector< float > m_CBTrack_z0
Definition: IDPerfMonZmumu.h:394
IDPerfMonZmumu::m_positive_pt
double m_positive_pt
Definition: IDPerfMonZmumu.h:236
IDPerfMonZmumu::RunFourLeptonAnalysis
StatusCode RunFourLeptonAnalysis()
Definition: IDPerfMonZmumu.cxx:2531
IDPerfMonZmumu::m_triggerName
std::string m_triggerName
Definition: IDPerfMonZmumu.h:231
IDPerfMonZmumu.h
IDPerfMonZmumu::m_negative_z0
double m_negative_z0
Definition: IDPerfMonZmumu.h:275
xAOD::TruthVertex_v1::z
float z() const
Vertex longitudinal distance along the beam line form the origin.
IDPerfMonZmumu::m_negative_py
double m_negative_py
Definition: IDPerfMonZmumu.h:270
Trk::ImpactParametersAndSigma::sigmaz0
double sigmaz0
Definition: ITrackToVertexIPEstimator.h:38
Trk::qOverP
@ qOverP
perigee
Definition: ParamDefs.h:67
IDPerfMonZmumu::m_negative_phi
double m_negative_phi
Definition: IDPerfMonZmumu.h:273
ZmumuEvent::SetOpeningAngleCut
void SetOpeningAngleCut(double newvalue)
Definition: ZmumuEvent.h:98
IDPerfMonZmumu::m_positive_2_px
double m_positive_2_px
Definition: IDPerfMonZmumu.h:256
IDPerfMonZmumu::m_el_positive1_z0
double m_el_positive1_z0
Definition: IDPerfMonZmumu.h:334
FourMuonEvent::doMCPSelection
void doMCPSelection(bool doMCP)
Definition: FourMuonEvent.h:75
IDPerfMonZmumu::m_negative_sigma_qoverp
double m_negative_sigma_qoverp
Definition: IDPerfMonZmumu.h:287
IDPerfMonZmumu::m_negative_z0_err
double m_negative_z0_err
Definition: IDPerfMonZmumu.h:279
FourMuonEvent::GetVertexElec
int GetVertexElec(unsigned int uPart)
Definition: FourMuonEvent.h:92
ITrackToVertexIPEstimator.h
IDPerfMonZmumu::m_Refit1_d0
std::vector< float > m_Refit1_d0
Definition: IDPerfMonZmumu.h:389
IDPerfMonZmumu::m_MassWindowHigh
double m_MassWindowHigh
Definition: IDPerfMonZmumu.h:114
IDPerfMonZmumu::m_refit1Tree
TTree * m_refit1Tree
Definition: IDPerfMonZmumu.h:196
xAOD::numberOfContribPixelLayers
@ numberOfContribPixelLayers
number of contributing layers of the pixel detector [unit8_t].
Definition: TrackingPrimitives.h:230
IDPerfMonZmumu::m_doIsoSelection
bool m_doIsoSelection
Definition: IDPerfMonZmumu.h:110
xAOD::numberOfSCTHits
@ numberOfSCTHits
number of hits in SCT [unit8_t].
Definition: TrackingPrimitives.h:268
IDPerfMonZmumu::m_Truth_eta
std::vector< float > m_Truth_eta
Definition: IDPerfMonZmumu.h:379
IDPerfMonZmumu::m_el_positive2_px
double m_el_positive2_px
Definition: IDPerfMonZmumu.h:344
IDPerfMonZmumu::m_Refit2_sigma_qoverp
std::vector< float > m_Refit2_sigma_qoverp
Definition: IDPerfMonZmumu.h:425
SG::ConstAccessor::isAvailable
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
Trk::ParametersBase::eta
double eta() const
Access method for pseudorapidity - from momentum.
IDPerfMonZmumu::m_extrapolator
ToolHandle< Trk::IExtrapolator > m_extrapolator
Definition: IDPerfMonZmumu.h:156
FourMuonEvent::SetMassWindowLow
void SetMassWindowLow(double newvalue)
Definition: FourMuonEvent.h:110
Trk::phi
@ phi
Definition: ParamDefs.h:75
IDPerfMonZmumu::m_doIPSelection
bool m_doIPSelection
Definition: IDPerfMonZmumu.h:111
IDPerfMonZmumu::m_el_negative1_d0
double m_el_negative1_d0
Definition: IDPerfMonZmumu.h:309
python.TrigEgammaMonitorHelper.TH1F
def TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
Definition: TrigEgammaMonitorHelper.py:24
xAOD::track
@ track
Definition: TrackingPrimitives.h:512
xAOD::TrackParticle_v1
Class describing a TrackParticle.
Definition: TrackParticle_v1.h:43
IDPerfMonZmumu::ExtractIDHitsInformation
void ExtractIDHitsInformation(const xAOD::Muon *muon_pos, const xAOD::Muon *muon_neg)
Definition: IDPerfMonZmumu.cxx:2772
xAOD::TrackParticle_v1::track
const Trk::Track * track() const
Returns a pointer (which can be NULL) to the Trk::Track which was used to make this TrackParticle.
Definition: TrackParticle_v1.cxx:805
ConstAccessor.h
Helper class to provide constant type-safe access to aux data.
IDPerfMonZmumu::m_evtNumber
unsigned int m_evtNumber
Definition: IDPerfMonZmumu.h:226
drawFromPickle.sin
sin
Definition: drawFromPickle.py:36
IDPerfMonZmumu::m_triggerDecision
ToolHandle< Trig::TrigDecisionTool > m_triggerDecision
Definition: IDPerfMonZmumu.h:141
IDPerfMonZmumu::m_h_cutflow
TH1F * m_h_cutflow
link vector to map HepMC onto xAOD truth
Definition: IDPerfMonZmumu.h:223
ZmumuEvent::SetSkipMSCheck
void SetSkipMSCheck(bool value)
Definition: ZmumuEvent.h:100
IDPerfMonZmumu::m_negative_2_z0_err
double m_negative_2_z0_err
Definition: IDPerfMonZmumu.h:296
IDPerfMonZmumu::m_pv_y
double m_pv_y
Definition: IDPerfMonZmumu.h:361
IDPerfMonZmumu::m_negative_z0_PV
double m_negative_z0_PV
Definition: IDPerfMonZmumu.h:282
IDPerfMonZmumu::m_positive_z0_PVerr
double m_positive_z0_PVerr
Definition: IDPerfMonZmumu.h:249
IDPerfMonZmumu::m_SecondMuonPtCut
double m_SecondMuonPtCut
Definition: IDPerfMonZmumu.h:116
IDPerfMonZmumu::m_negative_2_z0
double m_negative_2_z0
Definition: IDPerfMonZmumu.h:294
IDPerfMonZmumu::GetDiMuonVertex
const xAOD::Vertex * GetDiMuonVertex(const xAOD::TrackParticle *, const xAOD::TrackParticle *)
Definition: IDPerfMonZmumu.cxx:2351
IDPerfMonZmumu::m_4mu
FourMuonEvent m_4mu
Definition: IDPerfMonZmumu.h:108
FourMuonEvent::SetOpeningAngleCut
void SetOpeningAngleCut(double newvalue)
Definition: FourMuonEvent.h:115
ZmumuEvent::SetMassWindowHigh
void SetMassWindowHigh(double newvalue)
Definition: ZmumuEvent.h:95
IDPerfMonZmumu::m_Refit2_pt
std::vector< float > m_Refit2_pt
Definition: IDPerfMonZmumu.h:372
IDPerfMonZmumu::m_el_negative2_z0
double m_el_negative2_z0
Definition: IDPerfMonZmumu.h:321
pow
constexpr int pow(int base, int exp) noexcept
Definition: ap_fixedTest.cxx:15
IDPerfMonZmumu::m_Truth_parent
std::vector< int > m_Truth_parent
Definition: IDPerfMonZmumu.h:405
IDPerfMonZmumu::m_pv_x
double m_pv_x
Definition: IDPerfMonZmumu.h:360
IDPerfMonZmumu::m_Refit2_sigma_d0
std::vector< float > m_Refit2_sigma_d0
Definition: IDPerfMonZmumu.h:415
ZmumuEvent::SetZ0GapCut
void SetZ0GapCut(double newvalue)
Definition: ZmumuEvent.h:99
IDPerfMonZmumu::m_commonTreeName
std::string m_commonTreeName
Definition: IDPerfMonZmumu.h:166
xAOD::TrackParticle_v1::theta
float theta() const
Returns the parameter, which has range 0 to .
StoreGateSvc.h
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
IDPerfMonZmumu::m_truthTreeName
std::string m_truthTreeName
Definition: IDPerfMonZmumu.h:171
ZmumuEvent::getPosMuon
unsigned int getPosMuon(ZTYPE eType)
Definition: ZmumuEvent.cxx:516
IDPerfMonZmumu::m_Refit2_sigma_z0
std::vector< float > m_Refit2_sigma_z0
Definition: IDPerfMonZmumu.h:420
IDPerfMonZmumu::m_negative_z0_manualBS
double m_negative_z0_manualBS
Definition: IDPerfMonZmumu.h:277
IDPerfMonZmumu::m_IDTrack_qoverp
std::vector< float > m_IDTrack_qoverp
Definition: IDPerfMonZmumu.h:399
MissingETContainer.h
FourMuonEvent::GetVertexMuNeg2
int GetVertexMuNeg2()
Definition: FourMuonEvent.h:98
IDPerfMonZmumu::m_refit2TreeName
std::string m_refit2TreeName
Definition: IDPerfMonZmumu.h:170
FourMuonEvent::SetSecondMuonPtCut
void SetSecondMuonPtCut(double newvalue)
Definition: FourMuonEvent.cxx:1343
ZmumuEvent::setContainer
void setContainer(PerfMonServices::CONTAINERS container)
Definition: ZmumuEvent.h:102
ZmumuEvent::SetMassWindowLow
void SetMassWindowLow(double newvalue)
Definition: ZmumuEvent.h:94
IDPerfMonZmumu::m_CBTrack_qoverp
std::vector< float > m_CBTrack_qoverp
Definition: IDPerfMonZmumu.h:400
IDPerfMonZmumu::m_storeZmumuNtuple
bool m_storeZmumuNtuple
Definition: IDPerfMonZmumu.h:124
IDPerfMonZmumu::IDPerfMonZmumu
IDPerfMonZmumu(const std::string &name, ISvcLocator *pSvcLocator)
needed for IP resolution studies
Definition: IDPerfMonZmumu.cxx:47
PerfMonServices::MUON_COLLECTION
@ MUON_COLLECTION
Definition: PerfMonServices.h:26
FourMuonEvent::doIsoSelection
void doIsoSelection(bool doIso)
Definition: FourMuonEvent.h:73
IDPerfMonZmumu::m_MassWindowLow
double m_MassWindowLow
Definition: IDPerfMonZmumu.h:113
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
IDPerfMonZmumu::m_defaultTreeFolder
std::string m_defaultTreeFolder
Definition: IDPerfMonZmumu.h:183
FourMuonEvent::getIDTrack
const xAOD::TrackParticle * getIDTrack(unsigned int uPart)
Definition: FourMuonEvent.h:81
IDPerfMonZmumu::m_IDTrack_pt
std::vector< float > m_IDTrack_pt
Definition: IDPerfMonZmumu.h:369
xAOD::EventInfo_v1::actualInteractionsPerCrossing
float actualInteractionsPerCrossing() const
Average interactions per crossing for the current BCID - for in-time pile-up.
Definition: EventInfo_v1.cxx:380
ZmumuEvent::Reco
virtual bool Reco(int theLumiBlock=0)
Definition: ZmumuEvent.cxx:111
IDPerfMonZmumu::m_el_negative2_d0_err
double m_el_negative2_d0_err
Definition: IDPerfMonZmumu.h:324
IDPerfMonZmumu::m_negative_sigma_pt
double m_negative_sigma_pt
Definition: IDPerfMonZmumu.h:281
ServiceHandle< ITHistSvc >
IDPerfMonZmumu::m_doFourMuAnalysis
bool m_doFourMuAnalysis
Definition: IDPerfMonZmumu.h:123
IDPerfMonZmumu::m_FourMuTreeFolder
std::string m_FourMuTreeFolder
Root Validation Tree.
Definition: IDPerfMonZmumu.h:190
IDPerfMonZmumu::m_positive_sigma_pt
double m_positive_sigma_pt
Definition: IDPerfMonZmumu.h:246