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

Public Member Functions

 ShowerPCAEigenvalueLength (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

art::InputTag fPFParticleLabel
 
int fVerbose
 
std::string fShowerPCAInputLabel
 
std::string fShowerLengthOutputLabel
 
std::string fShowerOpeningAngleOutputLabel
 
float fNSigma
 

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 18 of file ShowerPCAEigenvalueLength_tool.cc.

Constructor & Destructor Documentation

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

Definition at line 37 of file ShowerPCAEigenvalueLength_tool.cc.

38  : IShowerTool(pset.get<fhicl::ParameterSet>("BaseTools"))
39  , fPFParticleLabel(pset.get<art::InputTag>("PFParticleLabel"))
40  , fVerbose(pset.get<int>("Verbose"))
41  , fShowerPCAInputLabel(pset.get<std::string>("ShowerPCAInputLabel"))
42  , fShowerLengthOutputLabel(pset.get<std::string>("ShowerLengthOutputLabel"))
43  , fShowerOpeningAngleOutputLabel(pset.get<std::string>("ShowerOpeningAngleOutputLabel"))
44  , fNSigma(pset.get<float>("NSigma"))
45  {}
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::ShowerPCAEigenvalueLength::CalculateElement ( const art::Ptr< recob::PFParticle > &  pfparticle,
art::Event Event,
reco::shower::ShowerElementHolder ShowerEleHolder 
)
overridevirtual

Implements ShowerRecoTools::IShowerTool.

Definition at line 48 of file ShowerPCAEigenvalueLength_tool.cc.

51  {
52 
53  if (!ShowerEleHolder.CheckElement(fShowerPCAInputLabel)) {
54  if (fVerbose)
55  mf::LogError("ShowerPCAEigenvalueLength") << "PCA not set, returning " << std::endl;
56  return 1;
57  }
58 
60  ShowerEleHolder.GetElement(fShowerPCAInputLabel, PCA);
61 
62  const double* eigenValues = PCA.getEigenValues();
63 
64  // The PCA eigenvalues give the deviance of space points around the center
65  // Take the sqrt to get std. dev and take fNSigma in each direction:
66  // Call the length fNSigma x 2 x std. dev. along primary eigenvalues
67  // Call the width fNSigma x 2 x std. dev. along secondary eigenvalues
68 
69  //TODO: Actually calculate the erros (Maybe fNSigma+-1Sigma?)
70 
71  //Find the length
72  double primaryEigenValue = (eigenValues)[0];
73  double ShowerLength = std::sqrt(primaryEigenValue) * 2 * fNSigma;
74  double ShowerLengthError = -999;
75 
76  //Find the width of the shower
77  double secondaryEigenValue = (eigenValues)[1];
78  double ShowerWidth = std::sqrt(secondaryEigenValue) * 2 * fNSigma;
79 
80  double ShowerAngle = std::atan(ShowerWidth / ShowerLength);
81  double ShowerAngleError = -999;
82 
83  // Fill the shower element holder
84  ShowerEleHolder.SetElement(ShowerLength, ShowerLengthError, fShowerLengthOutputLabel);
85  ShowerEleHolder.SetElement(ShowerAngle, ShowerAngleError, fShowerOpeningAngleOutputLabel);
86 
87  return 0;
88  }
const double * getEigenValues() const
Definition: PCAxis.h:65
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 GetElement(const std::string &Name, T &Element) const
QTextStream & endl(QTextStream &s)

Member Data Documentation

float ShowerRecoTools::ShowerPCAEigenvalueLength::fNSigma
private

Definition at line 34 of file ShowerPCAEigenvalueLength_tool.cc.

art::InputTag ShowerRecoTools::ShowerPCAEigenvalueLength::fPFParticleLabel
private

Definition at line 29 of file ShowerPCAEigenvalueLength_tool.cc.

std::string ShowerRecoTools::ShowerPCAEigenvalueLength::fShowerLengthOutputLabel
private

Definition at line 32 of file ShowerPCAEigenvalueLength_tool.cc.

std::string ShowerRecoTools::ShowerPCAEigenvalueLength::fShowerOpeningAngleOutputLabel
private

Definition at line 33 of file ShowerPCAEigenvalueLength_tool.cc.

std::string ShowerRecoTools::ShowerPCAEigenvalueLength::fShowerPCAInputLabel
private

Definition at line 31 of file ShowerPCAEigenvalueLength_tool.cc.

int ShowerRecoTools::ShowerPCAEigenvalueLength::fVerbose
private

Definition at line 30 of file ShowerPCAEigenvalueLength_tool.cc.


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