1 #ifndef OPT0FINDER_COMMONAMPS_CXX
2 #define OPT0FINDER_COMMONAMPS_CXX
22 _percent = pset.get<
double>(
"QFracThreshold");
23 _score = pset.get<
double>(
"ScoreThreshold");
41 std::multimap<double,int> ampToOpDet ;
43 for(
size_t k=0;
k<32;
k++)
44 ampToOpDet.emplace(1./(flash.
pe_v[
k]/integral_op),
k);
49 double opAmpTotal = 0;
50 std::vector<int> ids ;
53 for(
auto const &
e : ampToOpDet ){
54 opAmpTotal += 1/
e.first ;
55 ids.push_back(
e.second) ;
63 std::cout<<
"Not enough points!"<<std::endl;
73 for(
auto const& pt : pt_v) {
74 if(pt.x > x_max) x_max = pt.x;
75 if(pt.x < x_min) x_min = pt.x;
78 for(
double x_offset=0;
79 x_offset<(250.-(x_max-x_min));
94 double visAmpTotal = 0;
97 for(
size_t i=0; i<ids.size(); i++) {
103 if(opAmpTotal > visAmpTotal )
104 ratio = visAmpTotal/opAmpTotal ;
106 ratio = opAmpTotal/visAmpTotal ;
108 if(ratio > maxRatio) {
116 for(
size_t pmt_index=0; pmt_index<
NOpDets(); ++pmt_index) {
119 f.
tpc_point.
x += OpDetX(pmt_index) * pe / vis_pe_sum;
120 f.
tpc_point.
y += OpDetY(pmt_index) * pe / vis_pe_sum;
121 f.
tpc_point.
z += OpDetZ(pmt_index) * pe / vis_pe_sum;
std::vector< double > hypothesis
void _Configure_(const Config_t &pset)
CommonAmps(const std::string name="CommonAmps")
Default constructor.
FlashMatch_t Match(const QCluster_t &, const Flash_t &)
double score
floating point representing the "goodness" (algorithm dependent)
static CommonAmpsFactory __global_CommonAmpsFactory__
double z
Spatial position in [cm].
double TotalPE() const
Total PE calculation.
std::size_t size(FixedBins< T, C > const &) noexcept
fhicl::ParameterSet Config_t
Configuration object.
flashmatch::QCluster_t _tpc_qcluster
Struct to represent an optical flash.
std::vector< double > pe_v
PE distribution over photo-detectors.
Class def header for a class CommonAmps.
auto end(FixedBins< T, C > const &) noexcept
Collection of charge deposition 3D point (cluster)
QPoint_t tpc_point
estimated & matched 3D flash hypothesis point from TPC information
Class def header for exception classes in OpT0Finder package.
auto begin(FixedBins< T, C > const &) noexcept
flashmatch::Flash_t _vis_array
size_t NOpDets(int cryostat)
void FillEstimate(const QCluster_t &, Flash_t &) const
Method to simply fill provided reference of flashmatch::Flash_t.
BEGIN_PROLOG could also be cout