ATLAS Offline Software
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
MuonHitTestToolBase Class Reference

#include <MuonHitTestToolBase.h>

Inheritance diagram for MuonHitTestToolBase:
Collaboration diagram for MuonHitTestToolBase:

Public Member Functions

 MuonHitTestToolBase (const std::string &type, const std::string &name, const IInterface *parent)
 
virtual StatusCode initialize () override
 

Protected Member Functions

StatusCode executeCheckEventInfo ()
 
StatusCode executeFillHistos (const Amg::Vector3D &)
 
StatusCode executeFillHistosSectors_Wedge1 (const Amg::Vector3D &, std::string)
 
StatusCode executeFillHistosSectors_Wedge2 (const Amg::Vector3D &, std::string)
 
StatusCode executeFillHistos_sTGc (const Amg::Vector3D &, std::string)
 

Protected Attributes

std::string m_detname
 
const MuonGM::MuonDetectorManagerm_pMuonMgr
 
SG::ReadHandleKey< xAOD::EventInfom_eventInfoKey {this, "EventInfo", "EventInfo", "EventInfo name"}
 SG key for Event Info. More...
 
double m_BarrelEtaCut
 MDT barrel eta cut, applicable to the MDT 2D cross section plot. More...
 
TH1 * m_muonevnt
 
TH1 * m_muonrun
 
TH1 * m_muoneta
 
TH1 * m_muontheta
 
TH1 * m_muonphi
 
TH1 * m_muonzResid
 
TH1 * m_muonphiResid
 
TH2 * m_muondetBarrel
 
TH2 * m_muonlongView
 
TH1 * m_eta
 
TH1 * m_theta
 
TH1 * m_phi
 
TH1 * m_zResid
 
TH1 * m_phiResid
 
TH2 * m_detBarrel
 
TH2 * m_longView
 
Amg::Vector3D m_direction
 
std::string m_path {"/truth/"}
 
ServiceHandle< ITHistSvc > m_histSvc {"THistSvc", "SimTestHisto"}
 

structors and AlgTool implementation

std::string m_key
 The MC truth key. More...
 
HepMC::ConstGenParticlePtr getPrimary ()
 

Detailed Description

Definition at line 21 of file MuonHitTestToolBase.h.

Constructor & Destructor Documentation

◆ MuonHitTestToolBase()

MuonHitTestToolBase::MuonHitTestToolBase ( const std::string &  type,
const std::string &  name,
const IInterface *  parent 
)

Definition at line 17 of file MuonHitTestToolBase.cxx.

19  m_detname("MDT"),
20  m_pMuonMgr(0),
21  m_muonevnt(0),m_muonrun(0),
22  m_muoneta(0), m_muontheta(0), m_muonphi(0),
25  m_eta(0), m_theta(0), m_phi(0),
26  m_zResid(0),m_phiResid(0),
27  m_detBarrel(0), m_longView(0)
28 
29 {
30  declareProperty("BarrelEtaCut", m_BarrelEtaCut=99.);
31  declareProperty("DetectorName", m_detname="MDT");
32 
33 }

Member Function Documentation

◆ executeCheckEventInfo()

StatusCode MuonHitTestToolBase::executeCheckEventInfo ( )
protected

Definition at line 35 of file MuonHitTestToolBase.cxx.

36 {
37  SG::ReadHandle<xAOD::EventInfo> eventInfo (m_eventInfoKey,Gaudi::Hive::currentContext());
38  ATH_CHECK(eventInfo.isValid());
39  uint64_t evt = eventInfo->eventNumber();
40  int numrun = eventInfo->runNumber();
41  ATH_MSG_VERBOSE("Processing EventInfo event #"<< evt<< " run: " << numrun);
42  m_muonevnt->Fill(evt);
43  m_muonrun->Fill(numrun);
44  const McEventCollection* mcEvent;
45  CHECK(evtStore()->retrieve(mcEvent,m_key));
46 
47  // *AS* Why only if mcEvent ==1? when would there be more than one event?
48  if (mcEvent->size()!=1) {
49  m_direction=Amg::Vector3D(0.,0.,0.);
50  return StatusCode::SUCCESS;
51  }
52 
53  // *AS* Why this (double) loop, if only the last entry is preserved?
54  // changed it to take the gen particle
56  for (e=mcEvent->begin();e!=mcEvent->end(); ++e) {
57  for (auto p: (**e)) {
59  Amg::Vector3D temp_momentum(p->momentum().px(),
60  p->momentum().py(),
61  p->momentum().pz());
62  m_direction = temp_momentum.unit();
63  break;
64  }
65  }
66  }
67  return StatusCode::SUCCESS;
68 }

◆ executeFillHistos()

StatusCode MuonHitTestToolBase::executeFillHistos ( const Amg::Vector3D u)
protected

for MDTs that have barrel + endcap section, take only the barrel when plotting the xy-2d plot of the detector

Definition at line 70 of file MuonHitTestToolBase.cxx.

70  {
72 
73  if (m_direction.perp() > 0 && fabs(m_direction.eta())<m_BarrelEtaCut){
74  //mdtdet->Fill(u.x(),u.y());
75  m_muondetBarrel->Fill(u.x(),u.y());
76  m_detBarrel->Fill(u.x(),u.y());
77  }
78 
79  double rad=sqrt(u.x()*u.x()+u.y()*u.y());
80  m_muonlongView->Fill(u.z(),rad);
81  m_longView->Fill(u.z(),rad);
82 
83  // //m_direction vector is filled with truth above, so here it is wrong (no eta, theta, phi of the hit!!!)
84  // *AS* why not use "u"?
85  // theta->Fill(m_direction.theta());
86  // theta->Fill(m_direction.theta());
87  // eta->Fill(m_direction.eta());
88  // eta->Fill(m_direction.eta());
89  // phi->Fill(m_direction.phi());
90  // phi->Fill(m_direction.phi());
91 
92  if (m_direction.perp() > 0) {
93  m_muonzResid->Fill(u.cross(m_direction).dot(m_direction.cross(Amg::Vector3D(0,0,1)).unit()));
94  m_muonphiResid->Fill(u.cross(m_direction).z());
95 
96  m_zResid->Fill(u.cross(m_direction).dot(m_direction.cross(Amg::Vector3D(0,0,1)).unit()));
97  m_phiResid->Fill(u.cross(m_direction).z());
98  }
99  else {
100  m_muonzResid->Fill(0);
101  m_muonphiResid->Fill(0);
102  m_zResid->Fill(0);
103  m_phiResid->Fill(0);
104  }
105 
106  return StatusCode::SUCCESS;
107 }

◆ executeFillHistos_sTGc()

StatusCode MuonHitTestToolBase::executeFillHistos_sTGc ( const Amg::Vector3D ,
std::string   
)
protected

◆ executeFillHistosSectors_Wedge1()

StatusCode MuonHitTestToolBase::executeFillHistosSectors_Wedge1 ( const Amg::Vector3D ,
std::string   
)
protected

◆ executeFillHistosSectors_Wedge2()

StatusCode MuonHitTestToolBase::executeFillHistosSectors_Wedge2 ( const Amg::Vector3D ,
std::string   
)
protected

◆ getPrimary()

HepMC::ConstGenParticlePtr SimTestToolBase::getPrimary ( )
protectedinherited

Definition at line 20 of file SimTestToolBase.cxx.

21 {
22  const McEventCollection* mcCollection;
23  if (evtStore()->retrieve(mcCollection,m_key).isSuccess()) {
25  for (e=mcCollection->begin();e!=mcCollection->end(); ++e) {
26  for (auto p : (**e)) {
28  return p;
29  }
30  }
31  }
32  }
33  return 0;
34 }

◆ initialize()

StatusCode MuonHitTestToolBase::initialize ( )
overridevirtual

Generic Muon part, these histograms are filled from all subalgorithms (MDT,RPC,CSC,TGC) For detailed description look in the .cxx code

specific part, these histograms are filled from subalgorithm For detailed description look, e.g, in the CSCHitsTestAlg.cxx code

Reimplemented from SimTestToolBase.

Reimplemented in MMHitsTestTool, sTGCHitsTestTool, MDTHitsTestTool, TGCHitsTestTool, RPCHitsTestTool, and CSCHitsTestTool.

Definition at line 111 of file MuonHitTestToolBase.cxx.

111  {
112 
115 
116  //MuonSpectrometer
122  m_path+="Muon/";
123  // will only create new if not already registered (uses m_path)
124  _TH1D(m_muonevnt,"event_num",100,0.,1000.);
125  _TH1D(m_muonrun,"run_num",100,-300.,300.);
126 
127  /*
128  TH1D *etamuon=new TH1D("muonhitpos_eta","muonhitpos_eta",50,-5.,5.);
129  registerHistogram("/truth/muonhitpos_eta",etamuon);
130 
131  TH1D *theta=new TH1D("muonhitpos_theta","muonhitpos_theta",50,-10.,10.);
132  registerHistogram("/truth/muonhitpos_theta",theta);
133 
134  TH1D *phimuon=new TH1D("muonhitpos_phi","muonhitpos_phi",50,-5.,5.);
135  registerHistogram("/truth/muonhitpos_phi",phimuon);
136  */
137 
138  _TH1D(m_muonzResid,"muonhitpos_zResid",50,-300.,300.);
139  _TH1D(m_muonphiResid,"muonhitpos_phiResid",50,-300.,300.);
140 
141  _TH2D(m_muondetBarrel,"muondet_barrel",200,-11000.,11000.,200,-11000.,11000.);
142  _TH2D(m_muonlongView,"muonlong_view",200,-24000.,24000.,200,0.,13000.);
143  // ================================================================================
144 
145  m_path+=m_detname+"/";
146  // book Histograms
150  /*
151  TH1D *eta=new TH1D("hitpos_eta","hitpos_eta",50,-5.,5.);
152  registerHistogram("/truth/hitpos_eta",eta);
153 
154  TH1D *theta=new TH1D("hitpos_theta","hitpos_theta",50,-10.,10.);
155  registerHistogram("/truth/hitpos_theta",theta);
156 
157  TH1D *phi=new TH1D("hitpos_phi","hitpos_phi",50,-5.,5.);
158  registerHistogram("/truth/hitpos_phi",phi);
159  */
160  _TH1D(m_zResid,(m_detname+"_hitpos_zResid").c_str(),50,-300.,300.);
161  _TH1D(m_phiResid,(m_detname+"_hitpos_phiResid").c_str(),50,-300.,300.);
162 
163  _TH2D(m_detBarrel,(m_detname+"_det_barrel").c_str(),200,-11000.,11000.,200,-11000.,11000.);
164  _TH2D(m_longView,(m_detname+"_long_view").c_str(),200,-24000.,24000.,200,0.,14000.);
165 
166  return StatusCode::SUCCESS;
167 
168 }

Member Data Documentation

◆ m_BarrelEtaCut

double MuonHitTestToolBase::m_BarrelEtaCut
protected

MDT barrel eta cut, applicable to the MDT 2D cross section plot.

Definition at line 44 of file MuonHitTestToolBase.h.

◆ m_detBarrel

TH2* MuonHitTestToolBase::m_detBarrel
protected

Definition at line 54 of file MuonHitTestToolBase.h.

◆ m_detname

std::string MuonHitTestToolBase::m_detname
protected

Definition at line 37 of file MuonHitTestToolBase.h.

◆ m_direction

Amg::Vector3D MuonHitTestToolBase::m_direction
protected

Definition at line 58 of file MuonHitTestToolBase.h.

◆ m_eta

TH1* MuonHitTestToolBase::m_eta
protected

Definition at line 52 of file MuonHitTestToolBase.h.

◆ m_eventInfoKey

SG::ReadHandleKey<xAOD::EventInfo> MuonHitTestToolBase::m_eventInfoKey {this, "EventInfo", "EventInfo", "EventInfo name"}
protected

SG key for Event Info.

Definition at line 41 of file MuonHitTestToolBase.h.

◆ m_histSvc

ServiceHandle<ITHistSvc> SimTestHisto::m_histSvc {"THistSvc", "SimTestHisto"}
protectedinherited

Definition at line 35 of file SimTestHisto.h.

◆ m_key

std::string SimTestToolBase::m_key
protectedinherited

The MC truth key.

Definition at line 34 of file SimTestToolBase.h.

◆ m_longView

TH2 * MuonHitTestToolBase::m_longView
protected

Definition at line 54 of file MuonHitTestToolBase.h.

◆ m_muondetBarrel

TH2* MuonHitTestToolBase::m_muondetBarrel
protected

Definition at line 50 of file MuonHitTestToolBase.h.

◆ m_muoneta

TH1* MuonHitTestToolBase::m_muoneta
protected

Definition at line 48 of file MuonHitTestToolBase.h.

◆ m_muonevnt

TH1* MuonHitTestToolBase::m_muonevnt
protected

Definition at line 47 of file MuonHitTestToolBase.h.

◆ m_muonlongView

TH2 * MuonHitTestToolBase::m_muonlongView
protected

Definition at line 50 of file MuonHitTestToolBase.h.

◆ m_muonphi

TH1 * MuonHitTestToolBase::m_muonphi
protected

Definition at line 48 of file MuonHitTestToolBase.h.

◆ m_muonphiResid

TH1 * MuonHitTestToolBase::m_muonphiResid
protected

Definition at line 49 of file MuonHitTestToolBase.h.

◆ m_muonrun

TH1 * MuonHitTestToolBase::m_muonrun
protected

Definition at line 47 of file MuonHitTestToolBase.h.

◆ m_muontheta

TH1 * MuonHitTestToolBase::m_muontheta
protected

Definition at line 48 of file MuonHitTestToolBase.h.

◆ m_muonzResid

TH1* MuonHitTestToolBase::m_muonzResid
protected

Definition at line 49 of file MuonHitTestToolBase.h.

◆ m_path

std::string SimTestHisto::m_path {"/truth/"}
protectedinherited

Definition at line 34 of file SimTestHisto.h.

◆ m_phi

TH1 * MuonHitTestToolBase::m_phi
protected

Definition at line 52 of file MuonHitTestToolBase.h.

◆ m_phiResid

TH1 * MuonHitTestToolBase::m_phiResid
protected

Definition at line 53 of file MuonHitTestToolBase.h.

◆ m_pMuonMgr

const MuonGM::MuonDetectorManager* MuonHitTestToolBase::m_pMuonMgr
protected

Definition at line 38 of file MuonHitTestToolBase.h.

◆ m_theta

TH1 * MuonHitTestToolBase::m_theta
protected

Definition at line 52 of file MuonHitTestToolBase.h.

◆ m_zResid

TH1* MuonHitTestToolBase::m_zResid
protected

Definition at line 53 of file MuonHitTestToolBase.h.


The documentation for this class was generated from the following files:
python.PyKernel.retrieve
def retrieve(aClass, aKey=None)
Definition: PyKernel.py:110
MuonHitTestToolBase::m_detBarrel
TH2 * m_detBarrel
Definition: MuonHitTestToolBase.h:54
AllowedVariables::e
e
Definition: AsgElectronSelectorTool.cxx:37
MuonHitTestToolBase::m_theta
TH1 * m_theta
Definition: MuonHitTestToolBase.h:52
MuonHitTestToolBase::m_muonphiResid
TH1 * m_muonphiResid
Definition: MuonHitTestToolBase.h:49
MuonHitTestToolBase::m_muonevnt
TH1 * m_muonevnt
Definition: MuonHitTestToolBase.h:47
SG::ReadHandle
Definition: StoreGate/StoreGate/ReadHandle.h:70
LArG4FSStartPointFilter.evt
evt
Definition: LArG4FSStartPointFilter.py:42
MuonHitTestToolBase::m_BarrelEtaCut
double m_BarrelEtaCut
MDT barrel eta cut, applicable to the MDT 2D cross section plot.
Definition: MuonHitTestToolBase.h:44
MuonHitTestToolBase::m_longView
TH2 * m_longView
Definition: MuonHitTestToolBase.h:54
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition: AthMsgStreamMacros.h:28
SimTestToolBase::SimTestToolBase
SimTestToolBase(const std::string &type, const std::string &name, const IInterface *parent)
Definition: SimTestToolBase.cxx:11
Trk::u
@ u
Enums for curvilinear frames.
Definition: ParamDefs.h:77
MuonHitTestToolBase::m_detname
std::string m_detname
Definition: MuonHitTestToolBase.h:37
_TH1D
#define _TH1D(var, name, nbin, xmin, xmax)
Definition: SimTestHisto.h:47
MuonHitTestToolBase::m_muonzResid
TH1 * m_muonzResid
Definition: MuonHitTestToolBase.h:49
MuonHitTestToolBase::m_phi
TH1 * m_phi
Definition: MuonHitTestToolBase.h:52
python.utils.AtlRunQueryDQUtils.p
p
Definition: AtlRunQueryDQUtils.py:210
HepMC::is_simulation_particle
bool is_simulation_particle(const T &p)
Method to establish if a particle (or barcode) was created during the simulation (TODO update to be s...
Definition: MagicNumbers.h:342
MuonHitTestToolBase::m_muonlongView
TH2 * m_muonlongView
Definition: MuonHitTestToolBase.h:50
test_pyathena.parent
parent
Definition: test_pyathena.py:15
_TH2D
#define _TH2D(var, name, nbinx, xmin, xmax, nbiny, ymin, ymax)
Definition: SimTestHisto.h:81
xAOD::uint64_t
uint64_t
Definition: EventInfo_v1.cxx:123
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
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
McEventCollection
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
Definition: McEventCollection.h:33
MuonHitTestToolBase::m_direction
Amg::Vector3D m_direction
Definition: MuonHitTestToolBase.h:58
DataVector
Derived DataVector<T>.
Definition: DataVector.h:581
MuonHitTestToolBase::m_muontheta
TH1 * m_muontheta
Definition: MuonHitTestToolBase.h:48
MuonHitTestToolBase::m_eventInfoKey
SG::ReadHandleKey< xAOD::EventInfo > m_eventInfoKey
SG key for Event Info.
Definition: MuonHitTestToolBase.h:41
python.PyKernel.detStore
detStore
Definition: PyKernel.py:41
MuonHitTestToolBase::m_phiResid
TH1 * m_phiResid
Definition: MuonHitTestToolBase.h:53
name
std::string name
Definition: Control/AthContainers/Root/debug.cxx:221
Amg::Vector3D
Eigen::Matrix< double, 3, 1 > Vector3D
Definition: GeoPrimitives.h:47
DataVector::end
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
MuonHitTestToolBase::m_pMuonMgr
const MuonGM::MuonDetectorManager * m_pMuonMgr
Definition: MuonHitTestToolBase.h:38
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
MuonHitTestToolBase::m_muonrun
TH1 * m_muonrun
Definition: MuonHitTestToolBase.h:47
MuonHitTestToolBase::m_muoneta
TH1 * m_muoneta
Definition: MuonHitTestToolBase.h:48
MuonHitTestToolBase::m_zResid
TH1 * m_zResid
Definition: MuonHitTestToolBase.h:53
MuonHitTestToolBase::m_muonphi
TH1 * m_muonphi
Definition: MuonHitTestToolBase.h:48
MuonHitTestToolBase::m_eta
TH1 * m_eta
Definition: MuonHitTestToolBase.h:52
SimTestHisto::m_path
std::string m_path
Definition: SimTestHisto.h:34
MuonHitTestToolBase::m_muondetBarrel
TH2 * m_muondetBarrel
Definition: MuonHitTestToolBase.h:50
SimTestToolBase::m_key
std::string m_key
The MC truth key.
Definition: SimTestToolBase.h:34
DataVector::size
size_type size() const noexcept
Returns the number of elements in the collection.
python.SystemOfUnits.rad
int rad
Definition: SystemOfUnits.py:111
DataVector::begin
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.