Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
larpandora
larpandora
LArPandoraEventBuilding
LArPandoraShower
Tools
ShowerTrackStartPosition_tool.cc
Go to the documentation of this file.
1
//############################################################################
2
//### Name: ShowerTrackStartPosition ###
3
//### Author: Dom Barker ###
4
//### Date: 13.05.19 ###
5
//### Description: Tool for settung the shower start position to the ###
6
// start of the fitted track ###
7
//############################################################################
8
9
//Framework Includes
10
#include "
art/Utilities/ToolMacros.h
"
11
12
//LArSoft Includes
13
#include "
lardataobj/RecoBase/Track.h
"
14
#include "
larpandora/LArPandoraEventBuilding/LArPandoraShower/Tools/IShowerTool.h
"
15
16
namespace
ShowerRecoTools
{
17
18
class
ShowerTrackStartPosition
:
public
IShowerTool
{
19
20
public
:
21
ShowerTrackStartPosition
(
const
fhicl::ParameterSet
& pset);
22
23
//Generic Direction Finder
24
int
CalculateElement
(
const
art::Ptr<recob::PFParticle>
& pfparticle,
25
art::Event
&
Event
,
26
reco::shower::ShowerElementHolder
& ShowerEleHolder)
override
;
27
28
private
:
29
int
fVerbose
;
30
std::string
fInitialTrackInputLabel
;
31
std::string
fShowerStartPositionOutputLabel
;
32
};
33
34
ShowerTrackStartPosition::ShowerTrackStartPosition
(
const
fhicl::ParameterSet
& pset)
35
:
IShowerTool
(pset.
get
<
fhicl
::ParameterSet>(
"BaseTools"
))
36
,
fVerbose
(pset.
get
<
int
>(
"Verbose"
))
37
,
fInitialTrackInputLabel
(pset.
get
<
std
::
string
>(
"InitialTrackInputLabel"
))
38
,
fShowerStartPositionOutputLabel
(pset.
get
<
std
::
string
>(
"ShowerStartPositionOutputLabel"
))
39
{}
40
41
int
42
ShowerTrackStartPosition::CalculateElement
(
const
art::Ptr<recob::PFParticle>
& pfparticle,
43
art::Event
& Event,
44
reco::shower::ShowerElementHolder
& ShowerEleHolder)
45
{
46
47
//Check the Track has been defined
48
if
(!ShowerEleHolder.
CheckElement
(
"InitialTrack"
)) {
49
if
(
fVerbose
)
50
mf::LogError
(
"ShowerTrackStartPosition"
) <<
"Initial track not set"
<<
std::endl
;
51
return
1;
52
}
53
recob::Track
InitialTrack;
54
ShowerEleHolder.
GetElement
(
fInitialTrackInputLabel
, InitialTrack);
55
56
//Set the shower start position as the
57
TVector3 StartPositionErr = {-999, -999, -999};
58
59
geo::Point_t
TrajPosition_vec = InitialTrack.
LocationAtPoint
(0);
60
TVector3 TrajPosition = {TrajPosition_vec.X(), TrajPosition_vec.Y(), TrajPosition_vec.Z()};
61
ShowerEleHolder.
SetElement
(TrajPosition, StartPositionErr,
fShowerStartPositionOutputLabel
);
62
63
return
0;
64
}
65
}
66
67
DEFINE_ART_CLASS_TOOL
(
ShowerRecoTools::ShowerTrackStartPosition
)
DEFINE_ART_CLASS_TOOL
#define DEFINE_ART_CLASS_TOOL(tool)
Definition:
ToolMacros.h:42
IShowerTool.h
string
std::string string
Definition:
nybbler.cc:12
recob::Track::LocationAtPoint
Point_t const & LocationAtPoint(size_t i) const
Definition:
Track.h:126
ShowerRecoTools::ShowerTrackStartPosition::fShowerStartPositionOutputLabel
std::string fShowerStartPositionOutputLabel
Definition:
ShowerTrackStartPosition_tool.cc:31
reco::shower::ShowerElementHolder::SetElement
void SetElement(T &dataproduct, const std::string &Name, bool checktag=false)
Definition:
ShowerElementHolder.hh:360
std
STL namespace.
mf::LogError
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
Definition:
MessageLogger.h:211
ToolMacros.h
fhicl
Definition:
InputSourceFactory.h:7
reco::shower::ShowerElementHolder::CheckElement
bool CheckElement(const std::string &Name) const
Definition:
ShowerElementHolder.hh:415
reco::shower::ShowerElementHolder::GetElement
int GetElement(const std::string &Name, T &Element) const
Definition:
ShowerElementHolder.hh:219
ShowerRecoTools::ShowerTrackStartPosition::fInitialTrackInputLabel
std::string fInitialTrackInputLabel
Definition:
ShowerTrackStartPosition_tool.cc:30
keras_to_tensorflow.int
int
Definition:
keras_to_tensorflow.py:69
geo::Point_t
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
Definition:
geo_vectors.h:184
ShowerRecoTools::ShowerTrackStartPosition::ShowerTrackStartPosition
ShowerTrackStartPosition(const fhicl::ParameterSet &pset)
Definition:
ShowerTrackStartPosition_tool.cc:34
ShowerRecoTools
Definition:
ShowerDirectionCheater_tool.cc:16
art::Event
Definition:
Event.h:22
ShowerRecoTools::ShowerTrackStartPosition
Definition:
ShowerTrackStartPosition_tool.cc:18
Event
Definition:
types.h:32
reco::shower::ShowerElementHolder
Definition:
ShowerElementHolder.hh:213
Track.h
Provides recob::Track data product.
ShowerRecoTools::ShowerTrackStartPosition::CalculateElement
int CalculateElement(const art::Ptr< recob::PFParticle > &pfparticle, art::Event &Event, reco::shower::ShowerElementHolder &ShowerEleHolder) override
Definition:
ShowerTrackStartPosition_tool.cc:42
ShowerRecoTools::IShowerTool
Definition:
IShowerTool.h:25
art::get
auto const & get(AssnsNode< L, R, D > const &r)
Definition:
AssnsNode.h:115
ShowerRecoTools::ShowerTrackStartPosition::fVerbose
int fVerbose
Definition:
ShowerTrackStartPosition_tool.cc:29
art::Ptr< recob::PFParticle >
recob::Track
Track from a non-cascading particle.A recob::Track consists of a recob::TrackTrajectory, plus additional members relevant for a "fitted" track:
Definition:
Track.h:49
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
fhicl::ParameterSet
Definition:
ParameterSet.h:36
Generated by
1.8.11