18 #include "Utilities/func/MathUtil.h" 20 #include "TGeoManager.h" 35 mf::LogInfo(
"DeconvolveAlg") <<
" DeconvolveAlg::DeconvolveAlg()\n";
58 const std::vector< float > & totpe)
60 std::vector<rb::WeightedHit> wHits;
61 const int nPro = prongs.size();
68 std::map< uint32_t , std::map< int, int > > proIdx ;
70 for(
int iPro = 0; iPro < nPro; ++iPro){
73 for(
unsigned int iCell = 0; iCell < prongs[iPro].NCell(); ++iCell ){
79 for(
int jPro = iPro+1; jPro < nPro; ++jPro){
82 for(
unsigned int jCell = 0 ; jCell < prongs[jPro].NCell(); ++jCell){
86 proIdx[ ihit->
Channel() ][ iPro ] = iCell;
87 proIdx[ ihit->
Channel() ][ jPro ] = jCell;
96 for(
auto &
cmap : proIdx){
100 for(
auto & pmap :
cmap.second){
103 int iCell = pmap.second;
114 total += weights[
count];
120 for(
auto & pmap :
cmap.second){
122 if( weights[count] >= 0 )
123 prongs[pmap.first].SetWeight( pmap.second, weights[count]/total);
125 prongs[pmap.first].SetWeight( pmap.second, 0.0 );
142 double dist = 9999, di;
150 TVector3
dir = prong.
Dir();
154 const TVector3 dxyz = (cHit->
View() ==
geo::kX) ? TVector3(0, 1, 0): TVector3(1, 0, 0);
virtual geo::View_t View() const
kXorY for 3D clusters.
void reconfigure(const fhicl::ParameterSet &pset)
Preforms energy deconvolution for cells that may belong to multple clusters. It does so...
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
float DistanceToCore(art::Ptr< rb::CellHit > cHit, rb::Prong &prong)
unsigned short Plane() const
art::ServiceHandle< geo::Geometry > fGeom
DeconvolveAlg(fhicl::ParameterSet const &pset)
Vertical planes which measure X.
const PlaneGeo * Plane(unsigned int i) const
virtual TVector3 Start() const
unsigned short Cell() const
T get(std::string const &key) const
virtual TVector3 Dir() const
Unit vector describing prong direction.
fvar< T > exp(const fvar< T > &x)
Collect Geo headers and supply basic geometry functions.
float fExpConst
The constant length scale used in energy deconvolution.
void GetWeights(std::vector< rb::Prong > &prong, const std::vector< float > &totpe)
art::Ptr< rb::CellHit > Cell(geo::View_t view, unsigned int viewIdx) const
Get the ith cell from view view.
A Cluster with defined start position and direction.
double ClosestApproach(const double point[], const double intercept[], const double slopes[], double closest[])
Find the distance of closest approach between point and line.
cmap::CMap class source code
Build slid::LID objects to store electron ID, if asked for, otherwise, calculate LID info and make av...