All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
lar_content::ShowerHitsBaseTool Class Referenceabstract

ShowerHitsBaseTool class. More...

#include <ShowerHitsBaseTool.h>

Inheritance diagram for lar_content::ShowerHitsBaseTool:
lar_content::HitCreationBaseTool lar_content::ThreeViewShowerHitsTool lar_content::TwoViewShowerHitsTool

Public Member Functions

 ShowerHitsBaseTool ()
 Default constructor. More...
 
virtual void Run (ThreeDHitCreationAlgorithm *const pAlgorithm, const pandora::ParticleFlowObject *const pPfo, const pandora::CaloHitVector &inputTwoDHits, ProtoHitVector &protoHitVector)
 Run the algorithm tool. More...
 
- Public Member Functions inherited from lar_content::HitCreationBaseTool
 HitCreationBaseTool ()
 Default constructor. More...
 
virtual ~HitCreationBaseTool ()
 Destructor. More...
 

Protected Member Functions

virtual void GetShowerHit3D (const pandora::CaloHitVector &caloHitVector1, const pandora::CaloHitVector &caloHitVector2, ProtoHit &protoHit) const =0
 Get the three dimensional position for to a two dimensional calo hit, using the hit and a list of candidate matched hits in the other two views. More...
 
virtual void GetShowerHits3D (const pandora::CaloHitVector &inputTwoDHits, const pandora::CaloHitVector &caloHitVector1, const pandora::CaloHitVector &caloHitVector2, ProtoHitVector &protoHitVector) const
 Create three dimensional hits, using a list of input two dimensional hits and the hits (contained in the same particle) from the other two views. More...
 
pandora::StatusCode ReadSettings (const pandora::TiXmlHandle xmlHandle)
 
- Protected Member Functions inherited from lar_content::HitCreationBaseTool
virtual void GetBestPosition3D (const pandora::HitType hitType1, const pandora::HitType hitType2, const pandora::CartesianPointVector &fitPositionList1, const pandora::CartesianPointVector &fitPositionList2, ProtoHit &protoHit) const
 Get the three dimensional position using a provided two dimensional calo hit and candidate fit positions from the other two views. More...
 
virtual void GetBestPosition3D (const pandora::HitType hitType1, const pandora::HitType hitType2, const pandora::CartesianVector &fitPosition1, const pandora::CartesianVector &fitPosition2, ProtoHit &protoHit) const
 Get the three dimensional position using a provided two dimensional calo hit and candidate fit positions from the other two views. More...
 
virtual void GetBestPosition3D (const pandora::HitType hitType, const pandora::CartesianVector &fitPosition, ProtoHit &protoHit) const
 Get the three dimensional position using a provided two dimensional calo hit and a candidate fit position from another view. More...
 

Private Member Functions

void FilterCaloHits (const float x, const float xTolerance, const pandora::CaloHitVector &inputCaloHitVector, pandora::CaloHitVector &outputCaloHitVector) const
 Filter a list of calo hits to find those within a specified tolerance of a give x position. More...
 

Private Attributes

float m_xTolerance
 The x tolerance to use when looking for associated calo hits between views. More...
 

Additional Inherited Members

- Public Types inherited from lar_content::HitCreationBaseTool
typedef
ThreeDHitCreationAlgorithm::ProtoHit 
ProtoHit
 
typedef
ThreeDHitCreationAlgorithm::ProtoHitVector 
ProtoHitVector
 
typedef
ThreeDHitCreationAlgorithm::TrajectorySample 
TrajectorySample
 
- Protected Attributes inherited from lar_content::HitCreationBaseTool
double m_sigmaX2
 The sigmaX squared value, for calculation of chi2 deltaX term. More...
 
double m_chiSquaredCut
 The chi squared cut (accept only values below the cut value) More...
 

Detailed Description

ShowerHitsBaseTool class.

Definition at line 19 of file ShowerHitsBaseTool.h.

Constructor & Destructor Documentation

lar_content::ShowerHitsBaseTool::ShowerHitsBaseTool ( )

Default constructor.

Definition at line 21 of file ShowerHitsBaseTool.cc.

21  : m_xTolerance(1.f)
22 {
23 }
float m_xTolerance
The x tolerance to use when looking for associated calo hits between views.

Member Function Documentation

void lar_content::ShowerHitsBaseTool::FilterCaloHits ( const float  x,
const float  xTolerance,
const pandora::CaloHitVector &  inputCaloHitVector,
pandora::CaloHitVector &  outputCaloHitVector 
) const
private

Filter a list of calo hits to find those within a specified tolerance of a give x position.

Parameters
xthe x position
xTolerancethe x tolerance
inputCaloHitVectorthe input calo hit vector
outputCaloHitVectorto receive the output calo hit vector

Definition at line 79 of file ShowerHitsBaseTool.cc.

80 {
81  for (const CaloHit *const pCaloHit : inputCaloHitVector)
82  {
83  const float deltaX(pCaloHit->GetPositionVector().GetX() - x);
84 
85  if (std::fabs(deltaX) < xTolerance)
86  outputCaloHitVector.push_back(pCaloHit);
87  }
88 }
process_name opflash particleana ie x
virtual void lar_content::ShowerHitsBaseTool::GetShowerHit3D ( const pandora::CaloHitVector &  caloHitVector1,
const pandora::CaloHitVector &  caloHitVector2,
ProtoHit protoHit 
) const
protectedpure virtual

Get the three dimensional position for to a two dimensional calo hit, using the hit and a list of candidate matched hits in the other two views.

Parameters
caloHitVector1the vector of candidate hits in view 1
caloHitVector2the vector of candidate hits in view 2
protoHitto receive the populated proto hit

Implemented in lar_content::ThreeViewShowerHitsTool, and lar_content::TwoViewShowerHitsTool.

void lar_content::ShowerHitsBaseTool::GetShowerHits3D ( const pandora::CaloHitVector &  inputTwoDHits,
const pandora::CaloHitVector &  caloHitVector1,
const pandora::CaloHitVector &  caloHitVector2,
ProtoHitVector protoHitVector 
) const
protectedvirtual

Create three dimensional hits, using a list of input two dimensional hits and the hits (contained in the same particle) from the other two views.

Parameters
inputTwoDHitsthe list of input two dimensional hits
caloHitVector1hits in the first alternate view
caloHitVector2hits in the second alternate view
protoHitVectorto receive the new three dimensional proto hits

Definition at line 54 of file ShowerHitsBaseTool.cc.

56 {
57  for (const CaloHit *const pCaloHit2D : inputTwoDHits)
58  {
59  try
60  {
61  CaloHitVector filteredHits1, filteredHits2;
62  this->FilterCaloHits(pCaloHit2D->GetPositionVector().GetX(), m_xTolerance, caloHitVector1, filteredHits1);
63  this->FilterCaloHits(pCaloHit2D->GetPositionVector().GetX(), m_xTolerance, caloHitVector2, filteredHits2);
64 
65  ProtoHit protoHit(pCaloHit2D);
66  this->GetShowerHit3D(filteredHits1, filteredHits2, protoHit);
67 
68  if (protoHit.IsPositionSet() && (protoHit.GetChi2() < m_chiSquaredCut))
69  protoHitVector.push_back(protoHit);
70  }
71  catch (StatusCodeException &)
72  {
73  }
74  }
75 }
ThreeDHitCreationAlgorithm::ProtoHit ProtoHit
float m_xTolerance
The x tolerance to use when looking for associated calo hits between views.
double m_chiSquaredCut
The chi squared cut (accept only values below the cut value)
void FilterCaloHits(const float x, const float xTolerance, const pandora::CaloHitVector &inputCaloHitVector, pandora::CaloHitVector &outputCaloHitVector) const
Filter a list of calo hits to find those within a specified tolerance of a give x position...
virtual void GetShowerHit3D(const pandora::CaloHitVector &caloHitVector1, const pandora::CaloHitVector &caloHitVector2, ProtoHit &protoHit) const =0
Get the three dimensional position for to a two dimensional calo hit, using the hit and a list of can...
StatusCode lar_content::ShowerHitsBaseTool::ReadSettings ( const pandora::TiXmlHandle  xmlHandle)
protectedvirtual

Reimplemented from lar_content::HitCreationBaseTool.

Reimplemented in lar_content::ThreeViewShowerHitsTool.

Definition at line 92 of file ShowerHitsBaseTool.cc.

93 {
94  PANDORA_RETURN_RESULT_IF_AND_IF(STATUS_CODE_SUCCESS, STATUS_CODE_NOT_FOUND, !=, XmlHelper::ReadValue(xmlHandle, "XTolerance", m_xTolerance));
95 
96  return HitCreationBaseTool::ReadSettings(xmlHandle);
97 }
float m_xTolerance
The x tolerance to use when looking for associated calo hits between views.
virtual pandora::StatusCode ReadSettings(const pandora::TiXmlHandle xmlHandle)
void lar_content::ShowerHitsBaseTool::Run ( ThreeDHitCreationAlgorithm *const  pAlgorithm,
const pandora::ParticleFlowObject *const  pPfo,
const pandora::CaloHitVector &  inputTwoDHits,
ProtoHitVector protoHitVector 
)
virtual

Run the algorithm tool.

Parameters
pAlgorithmaddress of the calling algorithm
pPfothe address of the pfo
inputTwoDHitsthe vector of input two dimensional hits
protoHitVectorto receive the new three dimensional proto hits

Implements lar_content::HitCreationBaseTool.

Definition at line 27 of file ShowerHitsBaseTool.cc.

29 {
30  if (PandoraContentApi::GetSettings(*pAlgorithm)->ShouldDisplayAlgorithmInfo())
31  std::cout << "----> Running Algorithm Tool: " << this->GetInstanceName() << ", " << this->GetType() << std::endl;
32 
33  try
34  {
35  if (!LArPfoHelper::IsShower(pPfo))
36  return;
37 
38  CaloHitVector caloHitVectorU, caloHitVectorV, caloHitVectorW;
39  pAlgorithm->FilterCaloHitsByType(inputTwoDHits, TPC_VIEW_U, caloHitVectorU);
40  pAlgorithm->FilterCaloHitsByType(inputTwoDHits, TPC_VIEW_V, caloHitVectorV);
41  pAlgorithm->FilterCaloHitsByType(inputTwoDHits, TPC_VIEW_W, caloHitVectorW);
42 
43  this->GetShowerHits3D(caloHitVectorU, caloHitVectorV, caloHitVectorW, protoHitVector);
44  this->GetShowerHits3D(caloHitVectorV, caloHitVectorU, caloHitVectorW, protoHitVector);
45  this->GetShowerHits3D(caloHitVectorW, caloHitVectorU, caloHitVectorV, protoHitVector);
46  }
47  catch (StatusCodeException &)
48  {
49  }
50 }
static bool IsShower(const pandora::ParticleFlowObject *const pPfo)
Return shower flag based on Pfo Particle ID.
virtual void GetShowerHits3D(const pandora::CaloHitVector &inputTwoDHits, const pandora::CaloHitVector &caloHitVector1, const pandora::CaloHitVector &caloHitVector2, ProtoHitVector &protoHitVector) const
Create three dimensional hits, using a list of input two dimensional hits and the hits (contained in ...
BEGIN_PROLOG could also be cout

Member Data Documentation

float lar_content::ShowerHitsBaseTool::m_xTolerance
private

The x tolerance to use when looking for associated calo hits between views.

Definition at line 67 of file ShowerHitsBaseTool.h.


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