Public Member Functions | Private Attributes | List of all members
ShowerRecoTools::ShowerDirectionTopologyDecisionTool Class Reference
Inheritance diagram for ShowerRecoTools::ShowerDirectionTopologyDecisionTool:
ShowerRecoTools::IShowerTool

Public Member Functions

 ShowerDirectionTopologyDecisionTool (const fhicl::ParameterSet &pset)
 
int CalculateElement (const art::Ptr< recob::PFParticle > &pfparticle, art::Event &Event, reco::shower::ShowerElementHolder &ShowerEleHolder) override
 
- Public Member Functions inherited from ShowerRecoTools::IShowerTool
 IShowerTool (const fhicl::ParameterSet &pset)
 
virtual ~IShowerTool () noexcept=default
 
int RunShowerTool (const art::Ptr< recob::PFParticle > &pfparticle, art::Event &Event, reco::shower::ShowerElementHolder &ShowerEleHolder, std::string evd_display_name_append="")
 
virtual void InitialiseProducers ()
 
void SetPtr (art::ProducesCollector *collector)
 
void InitaliseProducerPtr (reco::shower::ShowerProducedPtrsHolder &uniqueproducerPtrs)
 
virtual int AddAssociations (const art::Ptr< recob::PFParticle > &pfpPtr, art::Event &Event, reco::shower::ShowerElementHolder &ShowerEleHolder)
 

Private Attributes

int fVerbose
 
float fAngleCut
 
std::string fFirstDirectionInputLabel
 
std::string fSecondDirectionInputLabel
 
std::string fShowerDirectionOutputLabel
 

Additional Inherited Members

- Protected Member Functions inherited from ShowerRecoTools::IShowerTool
const shower::LArPandoraShowerAlgGetLArPandoraShowerAlg () const
 
template<class T >
art::Ptr< T > GetProducedElementPtr (std::string Name, reco::shower::ShowerElementHolder &ShowerEleHolder, int iter=-1)
 
template<class T >
void InitialiseProduct (std::string Name, std::string InstanceName="")
 
template<class T , class A , class B >
void AddSingle (A &a, B &b, std::string Name)
 
int GetVectorPtrSize (std::string Name)
 
void PrintPtrs ()
 
void PrintPtr (std::string Name)
 

Detailed Description

Definition at line 17 of file ShowerDirectionTopologyDecision_tool.cc.

Constructor & Destructor Documentation

ShowerRecoTools::ShowerDirectionTopologyDecisionTool::ShowerDirectionTopologyDecisionTool ( const fhicl::ParameterSet pset)

Definition at line 35 of file ShowerDirectionTopologyDecision_tool.cc.

37  : IShowerTool(pset.get<fhicl::ParameterSet>("BaseTools"))
38  , fVerbose(pset.get<int>("Verbose"))
39  , fAngleCut(pset.get<float>("AngleCut"))
40  , fFirstDirectionInputLabel(pset.get<std::string>("FirstDirectionInputLabel"))
41  , fSecondDirectionInputLabel(pset.get<std::string>("SecondDirectionInputLabel"))
42  , fShowerDirectionOutputLabel(pset.get<std::string>("ShowerDirectionOutputLabel"))
43  {}
std::string string
Definition: nybbler.cc:12
T get(std::string const &key) const
Definition: ParameterSet.h:271
IShowerTool(const fhicl::ParameterSet &pset)
Definition: IShowerTool.h:28

Member Function Documentation

int ShowerRecoTools::ShowerDirectionTopologyDecisionTool::CalculateElement ( const art::Ptr< recob::PFParticle > &  pfparticle,
art::Event Event,
reco::shower::ShowerElementHolder ShowerEleHolder 
)
overridevirtual

Implements ShowerRecoTools::IShowerTool.

Definition at line 46 of file ShowerDirectionTopologyDecision_tool.cc.

50  {
51 
52  //Check the relevent products
53  if (!ShowerEleHolder.CheckElement(fFirstDirectionInputLabel)) {
54  if (fVerbose)
55  mf::LogError("ShowerDirectionTopologyDecision")
56  << "fFirstDirectionInputLabel is is not set. Stopping.";
57  return 1;
58  }
59  if (!ShowerEleHolder.CheckElement(fSecondDirectionInputLabel)) {
60  if (fVerbose)
61  mf::LogError("ShowerDirectionTopologyDecision")
62  << "fSecondDirectionInputLabel is is not set. Stopping.";
63  return 1;
64  }
65 
66  //Get the relevent products
67  TVector3 FirstShowerDirection;
68  TVector3 FirstShowerDirectionError;
69  ShowerEleHolder.GetElementAndError(
70  fFirstDirectionInputLabel, FirstShowerDirection, FirstShowerDirectionError);
71 
72  TVector3 SecondShowerDirection;
73  TVector3 SecondShowerDirectionError;
74  ShowerEleHolder.GetElementAndError(
75  fSecondDirectionInputLabel, SecondShowerDirection, SecondShowerDirectionError);
76 
77  //Use the first tool if directions agree within the chosen angle
78  if (FirstShowerDirection.Angle(SecondShowerDirection) < fAngleCut) {
79  ShowerEleHolder.SetElement(
80  FirstShowerDirection, FirstShowerDirectionError, fShowerDirectionOutputLabel);
81  }
82  else {
83  ShowerEleHolder.SetElement(
84  SecondShowerDirection, SecondShowerDirectionError, fShowerDirectionOutputLabel);
85  }
86  return 0;
87  }
void SetElement(T &dataproduct, const std::string &Name, bool checktag=false)
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
bool CheckElement(const std::string &Name) const
int GetElementAndError(const std::string &Name, T &Element, T2 &ElementErr) const

Member Data Documentation

float ShowerRecoTools::ShowerDirectionTopologyDecisionTool::fAngleCut
private

Definition at line 29 of file ShowerDirectionTopologyDecision_tool.cc.

std::string ShowerRecoTools::ShowerDirectionTopologyDecisionTool::fFirstDirectionInputLabel
private

Definition at line 30 of file ShowerDirectionTopologyDecision_tool.cc.

std::string ShowerRecoTools::ShowerDirectionTopologyDecisionTool::fSecondDirectionInputLabel
private

Definition at line 31 of file ShowerDirectionTopologyDecision_tool.cc.

std::string ShowerRecoTools::ShowerDirectionTopologyDecisionTool::fShowerDirectionOutputLabel
private

Definition at line 32 of file ShowerDirectionTopologyDecision_tool.cc.

int ShowerRecoTools::ShowerDirectionTopologyDecisionTool::fVerbose
private

Definition at line 28 of file ShowerDirectionTopologyDecision_tool.cc.


The documentation for this class was generated from the following file: