#include <ClusterParamsAlg.h>
Public Member Functions | |
ClusterParamsAlg () | |
ClusterParamsAlg (const std::vector< util::PxHit > &) | |
void | Initialize () |
void | SetMinNHits (size_t nhit) |
size_t | MinNHits () const |
int | SetHits (const std::vector< util::PxHit > &) |
void | SetRefineDirectionQMin (double qmin) |
void | SetVerbose (bool yes=true) |
template<typename Stream > | |
void | TimeReport (Stream &stream) const |
void | GetFANNVector (std::vector< float > &data) |
void | PrintFANNVector () |
void | FillParams (util::GeometryUtilities const &gser, bool override_DoGetAverages=false, bool override_DoGetRoughAxis=false, bool override_DoGetProfileInfo=false, bool override_DoRefineStartPointsAndDirection=false, bool override_DoGetFinalSlope=false, bool override_DoTrackShowerSep=false, bool override_DoEndCharge=false) |
const cluster_params & | GetParams () const |
void | GetAverages (bool override=false) |
void | GetRoughAxis (bool override=false) |
void | GetProfileInfo (util::GeometryUtilities const &gser, bool override=false) |
void | RefineStartPoints (util::GeometryUtilities const &gser) |
void | GetFinalSlope (util::GeometryUtilities const &gser, bool override=false) |
void | GetEndCharges (util::GeometryUtilities const &gser, bool override_=false) |
void | RefineDirection (bool override=false) |
void | RefineStartPointAndDirection (util::GeometryUtilities const &gser, bool override=false) |
void | TrackShowerSeparation (bool override=false) |
void | setNeuralNetPath (std::string s) |
void | FillPolygon (util::GeometryUtilities const &gser) |
void | GetOpeningAngle () |
const util::PxPoint & | RoughStartPoint () |
const util::PxPoint & | RoughEndPoint () |
double | RoughSlope () |
double | RoughIntercept () |
double | StartCharge (util::GeometryUtilities const &gser, float length=1., unsigned int nbins=10) |
Returns the expected charge at the beginning of the cluster. More... | |
double | EndCharge (util::GeometryUtilities const &gser, float length=1., unsigned int nbins=10) |
Returns the expected charge at the end of the cluster. More... | |
float | MultipleHitWires () |
Returns the number of multiple hits per wire. More... | |
float | MultipleHitDensity (util::GeometryUtilities const &gser) |
Returns the number of multiple hits per wire. More... | |
void | EnableFANN () |
void | DisableFANN () |
size_t | GetNHits () const |
const std::vector< util::PxHit > & | GetHitVector () const |
int | Plane () const |
void | SetPlane (int p) |
Public Attributes | |
cluster::cluster_params | fParams |
std::string | fNeuralNetPath |
std::vector< std::string > | fTimeRecord_ProcName |
std::vector< double > | fTimeRecord_ProcTime |
Protected Member Functions | |
double | IntegrateFitCharge (util::GeometryUtilities const &gser, double from_length, double to_length, unsigned int fit_first_bin, unsigned int fit_end_bin) |
Integrates the charge between two positions in the cluster axis. More... | |
Static Protected Member Functions | |
static double | LinearIntegral (double m, double q, double x1, double x2) |
Returns the integral of f(x) = mx + q defined in [x1, x2]. More... | |
Protected Attributes | |
size_t | fMinNHits |
Cut value for # hits: below this value clusters are not evaluated. More... | |
std::vector< util::PxHit > | fHitVector |
bool | verbose |
std::vector< double > | fChargeCutoffThreshold |
int | fPlane |
double | fQMinRefDir |
std::vector< double > | fChargeProfile |
std::vector< double > | fCoarseChargeProfile |
std::vector< double > | fChargeProfileNew |
int | fCoarseNbins |
int | fProfileNbins |
int | fProfileMaximumBin |
double | fProfileIntegralForward |
double | fProfileIntegralBackward |
double | fProjectedLength |
double | fBeginIntercept |
double | fEndIntercept |
double | fInterHigh_side |
double | fInterLow_side |
bool | fFinishedGetAverages |
bool | fFinishedGetRoughAxis |
bool | fFinishedGetProfileInfo |
bool | fFinishedRefineStartPoints |
bool | fFinishedRefineDirection |
bool | fFinishedGetFinalSlope |
bool | fFinishedRefineStartPointAndDirection |
bool | fFinishedTrackShowerSep |
bool | fFinishedGetEndCharges |
double | fRough2DSlope |
double | fRough2DIntercept |
util::PxPoint | fRoughBeginPoint |
util::PxPoint | fRoughEndPoint |
bool | enableFANN |
Definition at line 24 of file ClusterParamsAlg.h.
cluster::ClusterParamsAlg::ClusterParamsAlg | ( | ) |
Definition at line 34 of file ClusterParamsAlg.cxx.
cluster::ClusterParamsAlg::ClusterParamsAlg | ( | const std::vector< util::PxHit > & | inhitlist | ) |
Definition at line 42 of file ClusterParamsAlg.cxx.
|
inline |
Definition at line 268 of file ClusterParamsAlg.h.
void cluster::ClusterParamsAlg::EnableFANN | ( | ) |
Definition at line 180 of file ClusterParamsAlg.cxx.
double cluster::ClusterParamsAlg::EndCharge | ( | util::GeometryUtilities const & | gser, |
float | length = 1. , |
||
unsigned int | nbins = 10 |
||
) |
Returns the expected charge at the end of the cluster.
nbins | use at least this number of charge bins from charge profile |
length | space before the end of cluster where to collect charge, in cm the expected charge at the end of the cluster |
This method returns the charge under the last length cm of the cluster. See StartCharge() for a detailed explanation. For even more details, see IntegrateFitCharge().
Definition at line 1487 of file ClusterParamsAlg.cxx.
void cluster::ClusterParamsAlg::FillParams | ( | util::GeometryUtilities const & | gser, |
bool | override_DoGetAverages = false , |
||
bool | override_DoGetRoughAxis = false , |
||
bool | override_DoGetProfileInfo = false , |
||
bool | override_DoRefineStartPointsAndDirection = false , |
||
bool | override_DoGetFinalSlope = false , |
||
bool | override_DoTrackShowerSep = false , |
||
bool | override_DoEndCharge = false |
||
) |
Runs all the functions which calculate cluster params and stashes the results in the private ClusterParams struct.
override_DoGetAverages | force re-execution of GetAverages() |
override_DoGetRoughAxis | force re-execution of GetRoughAxis() |
override_DoGetProfileInfo | force re-execution of GetProfileInfo() |
override_DoRefineStartPoints | force re-execution of RefineStartPoints() |
override_DoGetFinalSlope | force re-execution of GetFinalSlope() |
override_DoEndCharge | force re-execution of GetEndCharges() |
Definition at line 186 of file ClusterParamsAlg.cxx.
void cluster::ClusterParamsAlg::FillPolygon | ( | util::GeometryUtilities const & | gser | ) |
Definition at line 1270 of file ClusterParamsAlg.cxx.
void cluster::ClusterParamsAlg::GetAverages | ( | bool | override = false | ) |
Calculates the following variables: mean_charge mean_x mean_y charge_wgt_x charge_wgt_y eigenvalue_principal eigenvalue_secondary multi_hit_wires N_Wires
override | force recalculation of variables |
Definition at line 205 of file ClusterParamsAlg.cxx.
void cluster::ClusterParamsAlg::GetEndCharges | ( | util::GeometryUtilities const & | gser, |
bool | override_ = false |
||
) |
Calculates the following variables: start_charge end_charge
override_ | force recompute the variables |
Definition at line 1380 of file ClusterParamsAlg.cxx.
void cluster::ClusterParamsAlg::GetFANNVector | ( | std::vector< float > & | data | ) |
This function returns a feature vector suitable for a neural net This function uses the data from cluster_params but packages it up in a different way, and so is inappropriate to include in clusterParams.hh. That's why it's here.
data | takes a reference to a vector< float> |
Definition at line 89 of file ClusterParamsAlg.cxx.
void cluster::ClusterParamsAlg::GetFinalSlope | ( | util::GeometryUtilities const & | gser, |
bool | override = false |
||
) |
Calculates the following variables: hit_density_1D hit_density_2D angle_2d direction
override | [description] |
Calculates the following variables: angle_2d modified_hit_density
end testing
Definition at line 894 of file ClusterParamsAlg.cxx.
|
inline |
Definition at line 279 of file ClusterParamsAlg.h.
|
inline |
Definition at line 274 of file ClusterParamsAlg.h.
void cluster::ClusterParamsAlg::GetOpeningAngle | ( | ) |
|
inline |
Definition at line 99 of file ClusterParamsAlg.h.
void cluster::ClusterParamsAlg::GetProfileInfo | ( | util::GeometryUtilities const & | gser, |
bool | override = false |
||
) |
Calculates the following variables: opening_angle opening_angle_highcharge closing_angle closing_angle_highcharge offaxis_hits
override | [description] |
Definition at line 349 of file ClusterParamsAlg.cxx.
void cluster::ClusterParamsAlg::GetRoughAxis | ( | bool | override = false | ) |
Calculates the following variables: verticalness fRough2DSlope fRough2DIntercept
override | [description] |
Definition at line 279 of file ClusterParamsAlg.cxx.
void cluster::ClusterParamsAlg::Initialize | ( | void | ) |
Definition at line 133 of file ClusterParamsAlg.cxx.
|
protected |
Integrates the charge between two positions in the cluster axis.
from_length | position on the axis to start integration from, in cm |
to_length | position on the axis to end integration at, in cm |
fit_first_bin | first bin for the charge fit |
fit_end_bin | next-to-last bin for the charge fit |
This function provides an almost-punctual charge at a position in the axis. Since the effective punctual charge is 0 ADC counts by definition, the charge can be integrated for some length. The procedure is made of two steps:
The region at point 1. is from fit_first_bin
to fit_end_bin
. These are specified in bin units. The binning is the one of the charge profile. It is suggested that a few bins are always kept, say 5 to 10, to reduce statistical fluctuations but maintaining a decent hypothesis of linearity along the range. The linear fit weighs all the bins in the profile the same.
The region at point to is from from_length
to to_length
, and it is measured in cm along the cluster axis, starting at the start of the cluster.
Definition at line 1408 of file ClusterParamsAlg.cxx.
|
staticprotected |
Returns the integral of f(x) = mx + q defined in [x1, x2].
Definition at line 1401 of file ClusterParamsAlg.cxx.
|
inline |
Definition at line 38 of file ClusterParamsAlg.h.
float cluster::ClusterParamsAlg::MultipleHitDensity | ( | util::GeometryUtilities const & | gser | ) |
Returns the number of multiple hits per wire.
This returns the number of wires with mmore than one hit belonging to this cluster, divided by the cluster length in cm.
Definition at line 1529 of file ClusterParamsAlg.cxx.
float cluster::ClusterParamsAlg::MultipleHitWires | ( | ) |
Returns the number of multiple hits per wire.
This returns the fraction of wires that have more than one hit belonging to this cluster.
Definition at line 1516 of file ClusterParamsAlg.cxx.
|
inline |
Definition at line 284 of file ClusterParamsAlg.h.
void cluster::ClusterParamsAlg::PrintFANNVector | ( | ) |
For debugging purposes, prints the result of GetFANNVector in a nicely formatted form.
Definition at line 110 of file ClusterParamsAlg.cxx.
void cluster::ClusterParamsAlg::RefineDirection | ( | bool | override = false | ) |
This function calculates the opening/closing angles It also makes a decision on whether or not to flip the direction the cluster. Then the start point is refined later.
override | [description] |
Definition at line 1052 of file ClusterParamsAlg.cxx.
void cluster::ClusterParamsAlg::RefineStartPointAndDirection | ( | util::GeometryUtilities const & | gser, |
bool | override = false |
||
) |
Definition at line 1296 of file ClusterParamsAlg.cxx.
void cluster::ClusterParamsAlg::RefineStartPoints | ( | util::GeometryUtilities const & | gser | ) |
Calculates the following variables: length width
Calculates the following variables: length width hit_density_1D hit_density_2D direction
override | [description] |
Definition at line 699 of file ClusterParamsAlg.cxx.
|
inline |
Definition at line 187 of file ClusterParamsAlg.h.
|
inline |
Definition at line 198 of file ClusterParamsAlg.h.
|
inline |
Definition at line 193 of file ClusterParamsAlg.h.
|
inline |
Definition at line 182 of file ClusterParamsAlg.h.
int cluster::ClusterParamsAlg::SetHits | ( | const std::vector< util::PxHit > & | inhitlist | ) |
Definition at line 51 of file ClusterParamsAlg.cxx.
|
inline |
Definition at line 32 of file ClusterParamsAlg.h.
|
inline |
Definition at line 172 of file ClusterParamsAlg.h.
void cluster::ClusterParamsAlg::SetPlane | ( | int | p | ) |
Definition at line 79 of file ClusterParamsAlg.cxx.
|
inline |
Definition at line 46 of file ClusterParamsAlg.h.
|
inline |
Definition at line 52 of file ClusterParamsAlg.h.
double cluster::ClusterParamsAlg::StartCharge | ( | util::GeometryUtilities const & | gser, |
float | length = 1. , |
||
unsigned int | nbins = 10 |
||
) |
Returns the expected charge at the beginning of the cluster.
nbins | use at least this number of charge bins from charge profile |
length | space at the start of cluster where to collect charge, in cm the expected charge at the beginning of the cluster |
ClusterParamsAlg extracts a binned charge profile, parametrized versus the distance from the start of the cluster. All the charge on the plane orthogonal to cluster axis is collapsed into the point where that plane intersects the axis. The resulting 1D distribution is then binned.
This method returns the charge under the first length cm of the cluster.
This method considers the first nbins of this charge distribution and through a linear fit determines the expected charge at the first bin. Then, it scales the result to reflect how much charge would be deposited in a space of length centimetres, according to this linear fit.
Note that length may be 0 (charge will be 0) or negative (sort of extrapolation ahead of the cluster start).
For more details, see IntegrateFitCharge().
Definition at line 1468 of file ClusterParamsAlg.cxx.
void cluster::ClusterParamsAlg::TimeReport | ( | Stream & | stream | ) | const |
Definition at line 402 of file ClusterParamsAlg.h.
void cluster::ClusterParamsAlg::TrackShowerSeparation | ( | bool | override = false | ) |
Definition at line 1364 of file ClusterParamsAlg.cxx.
|
protected |
Definition at line 343 of file ClusterParamsAlg.h.
|
protected |
Definition at line 323 of file ClusterParamsAlg.h.
|
protected |
Definition at line 304 of file ClusterParamsAlg.h.
|
protected |
Definition at line 310 of file ClusterParamsAlg.h.
|
protected |
Definition at line 313 of file ClusterParamsAlg.h.
|
protected |
Definition at line 311 of file ClusterParamsAlg.h.
|
protected |
Definition at line 315 of file ClusterParamsAlg.h.
|
protected |
Definition at line 324 of file ClusterParamsAlg.h.
|
protected |
Definition at line 329 of file ClusterParamsAlg.h.
|
protected |
Definition at line 337 of file ClusterParamsAlg.h.
|
protected |
Definition at line 334 of file ClusterParamsAlg.h.
|
protected |
Definition at line 331 of file ClusterParamsAlg.h.
|
protected |
Definition at line 330 of file ClusterParamsAlg.h.
|
protected |
Definition at line 333 of file ClusterParamsAlg.h.
|
protected |
Definition at line 335 of file ClusterParamsAlg.h.
|
protected |
Definition at line 332 of file ClusterParamsAlg.h.
|
protected |
Definition at line 336 of file ClusterParamsAlg.h.
|
protected |
This vector holds the pointer to hits. This should be used for computation for speed.
Definition at line 298 of file ClusterParamsAlg.h.
|
protected |
Definition at line 325 of file ClusterParamsAlg.h.
|
protected |
Definition at line 326 of file ClusterParamsAlg.h.
|
protected |
Cut value for # hits: below this value clusters are not evaluated.
Definition at line 292 of file ClusterParamsAlg.h.
std::string cluster::ClusterParamsAlg::fNeuralNetPath |
Definition at line 385 of file ClusterParamsAlg.h.
cluster::cluster_params cluster::ClusterParamsAlg::fParams |
Definition at line 383 of file ClusterParamsAlg.h.
|
protected |
Definition at line 305 of file ClusterParamsAlg.h.
|
protected |
Definition at line 319 of file ClusterParamsAlg.h.
|
protected |
Definition at line 318 of file ClusterParamsAlg.h.
|
protected |
Definition at line 317 of file ClusterParamsAlg.h.
|
protected |
Definition at line 316 of file ClusterParamsAlg.h.
|
protected |
Definition at line 320 of file ClusterParamsAlg.h.
|
protected |
Definition at line 308 of file ClusterParamsAlg.h.
|
protected |
Definition at line 340 of file ClusterParamsAlg.h.
|
protected |
Definition at line 339 of file ClusterParamsAlg.h.
|
protected |
Definition at line 341 of file ClusterParamsAlg.h.
|
protected |
Definition at line 342 of file ClusterParamsAlg.h.
std::vector<std::string> cluster::ClusterParamsAlg::fTimeRecord_ProcName |
Definition at line 387 of file ClusterParamsAlg.h.
std::vector<double> cluster::ClusterParamsAlg::fTimeRecord_ProcTime |
Definition at line 388 of file ClusterParamsAlg.h.
|
protected |
Definition at line 301 of file ClusterParamsAlg.h.