18 double mysqr(
double x){
return x*
x;}
30 const double sigma = 5;
31 const double sigsq = mysqr(sigma);
35 std::sort(pts.begin(), pts.end());
37 std::vector<double> rhos(pts.size(), 0);
39 for(
unsigned int i = 0; i < pts.size(); ++i){
40 double&
rho = rhos[i];
42 const double ti = pts[i].first;
44 for(
unsigned int j = 0; j < pts.size(); ++j){
47 const double tj = pts[j].first;
48 const double qj = pts[j].second;
50 rho += qj*exp(-mysqr(ti-tj)/(2*sigsq));
56 for(
unsigned int i = 0; i < pts.size(); ++i){
57 if(rhos[i] > bestScore){
78 const double driftT = driftLen / dp.DriftVelocity();
83 std::vector<std::pair<double, double>> ophitTs;
90 if(ophit.PeakTime() < sliceMeanT &&
91 ophit.PeakTime() > sliceMeanT-driftT &&
92 fabs(xyz[2]-sliceMeanZ) < 600){
94 ophitTotQ += ophit.PE();
95 ophitTs.emplace_back(ophit.PeakTime(), ophit.PE());
108 return 128.734*exp(-0.000357316*dt);
113 const std::vector<recob::OpHit>& ophits)
117 const double dt = slice.
meanT -
t0;
code to link reconstructed objects back to the MC truth information
art framework interface to geometry description
double TimeCluster(std::vector< std::pair< double, double >> &pts, double &clustPE)
CryostatGeo const & Cryostat(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
Description of geometry of one entire detector.
double DriftDistance() const
const TPCGeo & TPC(unsigned int itpc) const
Return the itpc'th TPC in the cryostat.
Access the description of detector geometry.
double SliceEnergy(const sn::SNSlice &slice, const std::vector< recob::OpHit > &ophits)
double FindSliceTZero(const std::vector< recob::OpHit > &ophits, double sliceMeanT, double sliceMeanZ, double &flashPhots)
double AttenFactor(double dt)
OpDetGeo const & OpDetGeoFromOpChannel(unsigned int OpChannel) const
Returns the geo::OpDetGeo object for the given channel number.