LArSoft libraries.
More...
|
std::vector< size_t > | ListOpChannels (int cryostat) |
|
std::vector< size_t > | ListOpDets (int cryostat) |
|
size_t | NOpDets (int cryostat) |
|
size_t | OpDetFromOpChannel (size_t opch) |
|
void | OpDetCenterFromOpChannel (size_t opch, double *xyz) |
|
bool | CheckIndex (const std::vector< short > &wf, const size_t &begin, size_t &end) |
|
double | mean (const std::vector< short > &wf, size_t start, size_t nsample) |
|
double | edge_aware_mean (const std::vector< short > &wf, int start, int end) |
|
double | std (const std::vector< short > &wf, const double ped_mean, size_t start, size_t nsample) |
|
double | BinnedMaxOccurrence (const PedestalMean_t &mean_v, const size_t nbins) |
|
int | sign (double val) |
|
double | BinnedMaxTH1D (const std::vector< double > &v, int bins) |
|
LArSoft libraries.
C/C++ standard libraries
double pmtana::BinnedMaxOccurrence |
( |
const PedestalMean_t & |
mean_v, |
|
|
const size_t |
nbins |
|
) |
| |
Definition at line 59 of file UtilFunc.cxx.
61 if(nbins<1)
throw OpticalRecoException(
"Cannot have 0 binning");
65 double bin_width = ((*res.second) - (*res.first)) / ((
double)nbins);
67 if(nbins==1 || bin_width == 0)
return ((*res.first) + bin_width /2.);
72 static std::vector<size_t> ctr_v(nbins,0);
73 for(
auto& v : ctr_v) v=0;
74 for(
auto const& v : mean_v) {
76 size_t index = int((v - (*res.first))/bin_width);
88 double mean_max_occurrence = 0;
89 double num_occurrence = 0;
90 for(
size_t bin=0;
bin<ctr_v.size(); ++
bin) {
92 if(ctr_v[
bin] != (*max_it))
continue;
94 mean_max_occurrence += ((*res.first) + bin_width / 2. + bin_width *
bin);
96 num_occurrence += 1.0;
99 return (mean_max_occurrence / num_occurrence);
constexpr details::BinObj< T > bin(T value)
Returns a wrapper to print the specified data in binary format.
auto end(FixedBins< T, C > const &) noexcept
auto begin(FixedBins< T, C > const &) noexcept
double pmtana::BinnedMaxTH1D |
( |
const std::vector< double > & |
v, |
|
|
int |
bins |
|
) |
| |
Definition at line 112 of file UtilFunc.cxx.
117 TH1D th(
"th",
";;",bins,*min_it,*max_it);
119 for (
const auto &
m : v) th.Fill(
m);
121 return th.GetXaxis()->GetBinCenter(th.GetMaximumBin());
tuple m
now if test mode generate materials, CRT shell, world, gdml header else just generate CRT shell for u...
auto end(FixedBins< T, C > const &) noexcept
auto begin(FixedBins< T, C > const &) noexcept
bool pmtana::CheckIndex |
( |
const std::vector< short > & |
wf, |
|
|
const size_t & |
begin, |
|
|
size_t & |
end |
|
) |
| |
Definition at line 41 of file PMTPulseRecoBase.cxx.
46 std::cerr <<
"Invalid arguments: waveform length = " << wf.size() <<
" begin = " <<
begin <<
" end = " <<
end << std::endl;
51 if(!
end)
end = wf.size() - 1;
BEGIN_PROLOG could also be cerr
auto end(FixedBins< T, C > const &) noexcept
auto begin(FixedBins< T, C > const &) noexcept
double pmtana::edge_aware_mean |
( |
const std::vector< short > & |
wf, |
|
|
int |
start, |
|
|
int |
end |
|
) |
| |
Definition at line 25 of file UtilFunc.cxx.
28 auto n_t =
unsigned{0};
30 for(
int k = start;
k <
end; ++
k) {
31 if (k < 0 or k > (
int)(wf.size()) - 1)
continue;
36 if( n_t > 0 )
m /= n_t;
tuple m
now if test mode generate materials, CRT shell, world, gdml header else just generate CRT shell for u...
auto end(FixedBins< T, C > const &) noexcept
std::vector< size_t > pmtana::ListOpChannels |
( |
int |
cryostat | ) |
|
Definition at line 21 of file icaruscode/icaruscode/PMT/OpReco/FlashFinder/FlashFinderFMWKInterface.cxx.
22 std::vector<size_t> res;
23 ::art::ServiceHandle<geo::Geometry> geo;
25 for(
size_t opch=0; opch<geo->MaxOpChannel(); ++opch) {
26 if(geo->IsValidOpChannel(opch))
continue;
30 auto const& bbox = geo->Cryostat(cryostat).Boundaries();
31 for(
size_t opch=0; opch<geo->MaxOpChannel(); ++opch) {
32 if(geo->IsValidOpChannel(opch))
continue;
33 auto const& pt = geo->OpDetGeoFromOpChannel(opch).GetCenter();
34 if(!bbox.ContainsPosition(pt))
continue;
std::vector< size_t > pmtana::ListOpDets |
( |
int |
cryostat | ) |
|
Definition at line 41 of file icaruscode/icaruscode/PMT/OpReco/FlashFinder/FlashFinderFMWKInterface.cxx.
42 std::vector<size_t> res;
43 ::art::ServiceHandle<geo::Geometry> geo;
45 for(
size_t opdet=0; opdet<geo->NOpDets(); ++opdet) {
49 auto const& bbox = geo->Cryostat(cryostat).Boundaries();
50 for(
size_t opdet=0; opdet<geo->NOpDets(); ++opdet) {
51 auto const& pt = geo->OpDetGeoFromOpDet(opdet).GetCenter();
52 if(!bbox.ContainsPosition(pt))
continue;
double pmtana::mean |
( |
const std::vector< short > & |
wf, |
|
|
size_t |
start, |
|
|
size_t |
nsample |
|
) |
| |
Definition at line 13 of file UtilFunc.cxx.
15 if(!nsample) nsample = wf.size();
16 if(start > wf.size() || (start+nsample) > wf.size())
17 throw OpticalRecoException(
"Invalid start/end index!");
19 double sum = std::accumulate(wf.begin()+start,wf.begin()+start+nsample,0.0) / ((double)nsample);
size_t pmtana::NOpDets |
( |
int |
cryostat | ) |
|
void pmtana::OpDetCenterFromOpChannel |
( |
size_t |
opch, |
|
|
double * |
xyz |
|
) |
| |
size_t pmtana::OpDetFromOpChannel |
( |
size_t |
opch | ) |
|
int pmtana::sign |
( |
double |
val | ) |
|
Definition at line 104 of file UtilFunc.cxx.
106 if (val > 0)
return 1;
107 if (val < 0)
return -1;
double pmtana::std |
( |
const std::vector< short > & |
wf, |
|
|
const double |
ped_mean, |
|
|
size_t |
start, |
|
|
size_t |
nsample |
|
) |
| |
Definition at line 42 of file UtilFunc.cxx.
44 if(!nsample) nsample = wf.size();
45 if(start > wf.size() || (start+nsample) > wf.size())
46 throw OpticalRecoException(
"Invalid start/end index!");
50 for(
size_t index=start; index < (start+nsample); ++index)
52 sigma += pow( (wf[index] - ped_mean), 2 );
54 sigma = sqrt(sigma/((
double)(nsample)));
const unsigned int pmtana::kINVALID_CHANNEL = std::numeric_limits<unsigned int>::max() |
|
static |
const double pmtana::kINVALID_TIME = std::numeric_limits<double>::max() |
|
static |