12 #include "GaudiKernel/ISvcLocator.h"
13 #include "GaudiKernel/SmartDataPtr.h"
19 m_ntupleSvc(
"NTupleSvc",
n),
20 m_outputNtuplePath(
"/NTUPLES/FILE1/EnergyLossMonitor/SingleTrackEnergyLoss"),
21 m_outputNtupleDescription(
"Output of the Trk::EnergyLossMonitor AlgTool"),
24 declareInterface<IEnergyLossMonitor>(
this);
35 NTuplePtr ntr(m_ntupleSvc.get(), m_outputNtuplePath);
38 ntr = m_ntupleSvc->book(m_outputNtuplePath, CLID_ColumnWiseTuple, m_outputNtupleDescription);
41 sc = ntr->addItem(
"Steps", m_steps, 0, 5000);
43 sc = ntr->addItem(
"InitialP", m_initialP, 0., 1000000.);
44 sc = ntr->addItem(
"InitialE", m_initialE, 0., 1000000.);
45 sc = ntr->addItem(
"InitialEta", m_initialEta, -4., 4.);
46 sc = ntr->addItem(
"InitialPhi", m_initialPhi, -4., 4.);
48 sc = ntr->addItem(
"Eta", m_steps, m_eta);
49 sc = ntr->addItem(
"Phi", m_steps, m_phi);
51 sc = ntr->addItem(
"Energy", m_steps, m_E);
52 sc = ntr->addItem(
"Momentum", m_steps, m_p);
53 sc = ntr->addItem(
"Eta", m_steps, m_eta);
54 sc = ntr->addItem(
"Phi", m_steps, m_phi);
55 sc = ntr->addItem(
"MaterialHitX", m_steps, m_hitX);
56 sc = ntr->addItem(
"MaterialHitY", m_steps, m_hitY);
57 sc = ntr->addItem(
"MaterialHitZ", m_steps, m_hitZ);
58 sc = ntr->addItem(
"MaterialHitR", m_steps, m_hitR);
62 return StatusCode::FAILURE;
72 return StatusCode::SUCCESS;
94 if (
pos.mag() > 0.01 && m_currentStep < 5000){
97 m_p[m_currentStep] =
p;
98 m_eta[m_currentStep] =
mom.eta();
99 m_phi[m_currentStep] =
mom.phi();
100 m_hitX[m_currentStep] =
pos.x();
101 m_hitY[m_currentStep] =
pos.y();
102 m_hitZ[m_currentStep] =
pos.z();
103 m_hitR[m_currentStep] =
pos.perp();
110 m_steps = m_currentStep;
111 StatusCode sc = m_ntupleSvc->writeRecord(m_outputNtuplePath);