ATLAS Offline Software
PropResultRootWriterSvc.cxx
Go to the documentation of this file.
1 
2 /*
3  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
4 */
5 
7 
8 #include <vector>
9 #include <deque>
10 #include <mutex>
11 #include <thread>
12 
13 #include "TFile.h"
14 
16 : AthService(name, svc),
17  m_thistSvc("THistSvc", name),
18  m_tree(nullptr) {
19 }
20 
22 
24 {
26 
27  CHECK(m_thistSvc.retrieve());
28 
29  const std::string treeName = m_treeName;
30  m_tree = new TTree(treeName.data(), "MyStudies");
31 
32  std::string fullNtupleName = static_cast<std::string>(m_ntupleDirName) + m_treeName;
33  CHECK(m_thistSvc->regTree(fullNtupleName, m_tree));
34 
35  if(m_tree == nullptr) {
36  ATH_MSG_ERROR("Unable to create TTree");
37  return StatusCode::FAILURE;
38  }
39 
40  m_tree->Branch("event_nr" , &m_eventNum );
41 
42  m_tree->Branch("start_d0" , &m_start_d0 );
43  m_tree->Branch("start_z0" , &m_start_z0 );
44  m_tree->Branch("start_phi" , &m_start_phi );
45  m_tree->Branch("start_theta", &m_start_theta);
46  m_tree->Branch("start_qop" , &m_start_qop );
47 
48  m_tree->Branch("fwd_success" , &m_fwd_success );
49  m_tree->Branch("fwd_time" , &m_fwd_time );
50  m_tree->Branch("fwd_final_l0" , &m_fwd_final_l0 );
51  m_tree->Branch("fwd_final_l1" , &m_fwd_final_l1 );
52  m_tree->Branch("fwd_final_x" , &m_fwd_final_x );
53  m_tree->Branch("fwd_final_y" , &m_fwd_final_y );
54  m_tree->Branch("fwd_final_z" , &m_fwd_final_z );
55  m_tree->Branch("fwd_final_phi" , &m_fwd_final_phi );
56  m_tree->Branch("fwd_final_theta", &m_fwd_final_theta);
57  m_tree->Branch("fwd_final_qop" , &m_fwd_final_qop );
58  m_tree->Branch("fwd_final_sigma_l0" , &m_fwd_final_sigma_l0 );
59  m_tree->Branch("fwd_final_sigma_l1" , &m_fwd_final_sigma_l1 );
60  m_tree->Branch("fwd_final_sigma_phi" , &m_fwd_final_sigma_phi );
61  m_tree->Branch("fwd_final_sigma_theta", &m_fwd_final_sigma_theta);
62  m_tree->Branch("fwd_final_sigma_qop" , &m_fwd_final_sigma_qop );
63 
64  m_tree->Branch("bkw_success" , &m_bkw_success );
65  m_tree->Branch("bkw_time" , &m_bkw_time );
66  m_tree->Branch("bkw_final_d0" , &m_bkw_final_d0 );
67  m_tree->Branch("bkw_final_z0" , &m_bkw_final_z0 );
68  m_tree->Branch("bkw_final_phi" , &m_bkw_final_phi );
69  m_tree->Branch("bkw_final_theta", &m_bkw_final_theta);
70  m_tree->Branch("bkw_final_qop" , &m_bkw_final_qop );
71  m_tree->Branch("bkw_final_sigma_d0" , &m_bkw_final_sigma_d0 );
72  m_tree->Branch("bkw_final_sigma_z0" , &m_bkw_final_sigma_z0 );
73  m_tree->Branch("bkw_final_sigma_phi" , &m_bkw_final_sigma_phi );
74  m_tree->Branch("bkw_final_sigma_theta", &m_bkw_final_sigma_theta);
75  m_tree->Branch("bkw_final_sigma_qop" , &m_bkw_final_sigma_qop );
76 
77  return StatusCode::SUCCESS;
78 }
79 
81 {
82  return StatusCode::SUCCESS;
83 }
84 
Trk::PropResultRootWriterSvc::~PropResultRootWriterSvc
virtual ~PropResultRootWriterSvc()
destructor
initialize
void initialize()
Definition: run_EoverP.cxx:894
Trk::PropResultRootWriterSvc::finalize
virtual StatusCode finalize() override
Definition: PropResultRootWriterSvc.cxx:80
Trk::PropResultRootWriterSvc::PropResultRootWriterSvc
PropResultRootWriterSvc(const std::string &name, ISvcLocator *svcloc)
constructor
Definition: PropResultRootWriterSvc.cxx:15
Trk::PropResultRootWriterSvc::initialize
virtual StatusCode initialize() override
Definition: PropResultRootWriterSvc.cxx:23
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition: AthMsgStreamMacros.h:33
EL::StatusCode
::StatusCode StatusCode
StatusCode definition for legacy code.
Definition: PhysicsAnalysis/D3PDTools/EventLoop/EventLoop/StatusCode.h:22
AthService
Definition: AthService.h:32
dumpFileToPlots.treeName
string treeName
Definition: dumpFileToPlots.py:20
ATH_CHECK
#define ATH_CHECK
Definition: AthCheckMacros.h:40
CHECK
#define CHECK(...)
Evaluate an expression and check for errors.
Definition: Control/AthenaKernel/AthenaKernel/errorcheck.h:422
Handler::svc
AthROOTErrorHandlerSvc * svc
Definition: AthROOTErrorHandlerSvc.cxx:10
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:195
PropResultRootWriterSvc.h