All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Typedefs | Functions | Variables

LArSoft libraries. More...

Classes

class  PedAlgoFixed
 Pedestal "algorithm" reading the pedestals from somewhere else. More...
 
class  FlashAlgoBase
 
class  FlashAlgoFactoryBase
 
class  FlashAlgoFactory
 Factory class for instantiating flash algorithm instance. More...
 
class  FlashFinderManager
 
struct  LiteOpHit_t
 
struct  LiteOpFlash_t
 
class  PECalib
 
class  SimpleFlashAlgo
 
class  SimpleFlashAlgoFactory
 A concrete factory class for pmtana::SimpleFlashAlgo. More...
 
class  AlgoCFD
 
class  AlgoFixedWindow
 
class  AlgoSiPM
 
class  AlgoSlidingWindow
 
class  AlgoThreshold
 
class  OpticalRecoException
 
class  PedAlgoEdges
 
class  PedAlgoRmsSlider
 
class  PedAlgoRollingMean
 
class  PedAlgoUB
 
class  PMTPedestalBase
 
struct  pulse_param
 
class  PMTPulseRecoBase
 
class  PulseRecoManager
 
class  RiseTimeCalculatorBase
 
class  RiseTimeThreshold
 
class  PMTAna
 

Typedefs

typedef fhicl::ParameterSet Config_t
 
typedef std::vector
< pmtana::LiteOpHit_t
LiteOpHitArray_t
 
typedef std::vector
< pmtana::LiteOpFlash_t
LiteOpFlashArray_t
 
typedef std::vector< short > Waveform_t
 
typedef std::vector< double > PedestalMean_t
 
typedef std::vector< double > PedestalSigma_t
 
typedef std::vector
< pmtana::pulse_param
pulse_param_array
 

Functions

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)
 

Variables

static const double kINVALID_TIME = std::numeric_limits<double>::max()
 
static const unsigned int kINVALID_CHANNEL = std::numeric_limits<unsigned int>::max()
 
static SimpleFlashAlgoFactory __SimpleFlashAlgoFactoryStaticObject__
 

Detailed Description

LArSoft libraries.

C/C++ standard libraries

Typedef Documentation

typedef fhicl::ParameterSet pmtana::Config_t
typedef std::vector< double > pmtana::PedestalMean_t

Definition at line 9 of file OpHitFinder/OpticalRecoTypes.h.

typedef std::vector< double > pmtana::PedestalSigma_t

Definition at line 10 of file OpHitFinder/OpticalRecoTypes.h.

Definition at line 53 of file PMTPulseRecoBase.h.

typedef std::vector< short > pmtana::Waveform_t

Definition at line 8 of file OpHitFinder/OpticalRecoTypes.h.

Function Documentation

double pmtana::BinnedMaxOccurrence ( const PedestalMean_t &  mean_v,
const size_t  nbins 
)

Definition at line 59 of file UtilFunc.cxx.

60  {
61  if(nbins<1) throw OpticalRecoException("Cannot have 0 binning");
62 
63  auto res = std::minmax_element(std::begin(mean_v),std::end(mean_v));
64 
65  double bin_width = ((*res.second) - (*res.first)) / ((double)nbins);
66 
67  if(nbins==1 || bin_width == 0) return ((*res.first) + bin_width /2.);
68 
69  //std::cout<<"Min: "<<(*res.first)<<" Max: "<<(*res.second)<<" Width: "<<bin_width<<std::endl;
70 
71  // Construct array of nbins
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) {
75 
76  size_t index = int((v - (*res.first))/bin_width);
77  //std::cout<<"adc = "<<v<<" width = "<<bin_width<< " ... "
78  //<<index<<" / "<<ctr_v.size()<<std::endl;
79 
80  ctr_v[index]++;
81 
82  }
83 
84  // Find max occurrence
85  auto max_it = std::max_element(std::begin(ctr_v),std::end(ctr_v));
86 
87  // Get the mean of max-occurrence bins
88  double mean_max_occurrence = 0;
89  double num_occurrence = 0;
90  for(size_t bin=0; bin<ctr_v.size(); ++bin) {
91 
92  if(ctr_v[bin] != (*max_it)) continue;
93 
94  mean_max_occurrence += ((*res.first) + bin_width / 2. + bin_width * bin);
95 
96  num_occurrence += 1.0;
97  }
98 
99  return (mean_max_occurrence / num_occurrence);
100  }
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
Definition: FixedBins.h:585
auto begin(FixedBins< T, C > const &) noexcept
Definition: FixedBins.h:573
double pmtana::BinnedMaxTH1D ( const std::vector< double > &  v,
int  bins 
)

Definition at line 112 of file UtilFunc.cxx.

112  {
113 
114  auto max_it = std::max_element(std::begin(v), std::end(v));
115  auto min_it = std::min_element(std::begin(v), std::end(v));
116 
117  TH1D th("th",";;",bins,*min_it,*max_it);
118 
119  for (const auto & m : v) th.Fill(m);
120 
121  return th.GetXaxis()->GetBinCenter(th.GetMaximumBin());
122  }
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
Definition: FixedBins.h:585
auto begin(FixedBins< T, C > const &) noexcept
Definition: FixedBins.h:573
bool pmtana::CheckIndex ( const std::vector< short > &  wf,
const size_t &  begin,
size_t &  end 
)

Definition at line 41 of file PMTPulseRecoBase.cxx.

43  {
44  if(begin >= wf.size() || end >= wf.size() || begin > end){
45 
46  std::cerr <<"Invalid arguments: waveform length = " << wf.size() << " begin = " << begin << " end = " << end << std::endl;
47 
48  return false;
49  }
50 
51  if(!end) end = wf.size() - 1;
52 
53  return true;
54  }
BEGIN_PROLOG could also be cerr
auto end(FixedBins< T, C > const &) noexcept
Definition: FixedBins.h:585
auto begin(FixedBins< T, C > const &) noexcept
Definition: FixedBins.h:573
double pmtana::edge_aware_mean ( const std::vector< short > &  wf,
int  start,
int  end 
)

Definition at line 25 of file UtilFunc.cxx.

25  {
26 
27  auto m = double{0.0};
28  auto n_t = unsigned{0};
29 
30  for(int k = start; k < end; ++k) {
31  if (k < 0 or k > (int)(wf.size()) - 1) continue;
32  m += wf.at(k);
33  ++n_t;
34  }
35 
36  if( n_t > 0 ) m /= n_t;
37  n_t = 0;
38 
39  return m;
40  }
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
Definition: FixedBins.h:585
pdgs k
Definition: selectors.fcl:22
std::vector< size_t > pmtana::ListOpChannels ( int  cryostat)

Definition at line 21 of file icaruscode/icaruscode/PMT/OpReco/FlashFinder/FlashFinderFMWKInterface.cxx.

21  {
22  std::vector<size_t> res;
23  ::art::ServiceHandle<geo::Geometry> geo;
24  if(cryostat<0) {
25  for(size_t opch=0; opch<geo->MaxOpChannel(); ++opch) {
26  if(geo->IsValidOpChannel(opch)) continue;
27  res.push_back(opch);
28  }
29  }else{
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;
35  res.push_back(opch);
36  }
37  }
38  return res;
39  }
std::vector< size_t > pmtana::ListOpDets ( int  cryostat)

Definition at line 41 of file icaruscode/icaruscode/PMT/OpReco/FlashFinder/FlashFinderFMWKInterface.cxx.

41  {
42  std::vector<size_t> res;
43  ::art::ServiceHandle<geo::Geometry> geo;
44  if(cryostat<0) {
45  for(size_t opdet=0; opdet<geo->NOpDets(); ++opdet) {
46  res.push_back(opdet);
47  }
48  }else{
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;
53  res.push_back(opdet);
54  }
55  }
56  return res;
57  }
double pmtana::mean ( const std::vector< short > &  wf,
size_t  start,
size_t  nsample 
)

Definition at line 13 of file UtilFunc.cxx.

14  {
15  if(!nsample) nsample = wf.size();
16  if(start > wf.size() || (start+nsample) > wf.size())
17  throw OpticalRecoException("Invalid start/end index!");
18 
19  double sum = std::accumulate(wf.begin()+start,wf.begin()+start+nsample,0.0) / ((double)nsample);
20 
21  return sum;
22  }
size_t pmtana::NOpDets ( int  cryostat)

Definition at line 59 of file icaruscode/icaruscode/PMT/OpReco/FlashFinder/FlashFinderFMWKInterface.cxx.

59  {
60  ::art::ServiceHandle<geo::Geometry> geo;
61  if(cryostat<0)
62  return geo->NOpDets();
63  else
64  return geo->Cryostat(cryostat).NOpDet();
65  }
void pmtana::OpDetCenterFromOpChannel ( size_t  opch,
double *  xyz 
)

Definition at line 72 of file icaruscode/icaruscode/PMT/OpReco/FlashFinder/FlashFinderFMWKInterface.cxx.

72  {
73  ::art::ServiceHandle<geo::Geometry> geo;
74  geo->OpDetGeoFromOpChannel(opch).GetCenter(xyz);
75  }
size_t pmtana::OpDetFromOpChannel ( size_t  opch)

Definition at line 67 of file icaruscode/icaruscode/PMT/OpReco/FlashFinder/FlashFinderFMWKInterface.cxx.

67  {
68  ::art::ServiceHandle<geo::Geometry> geo;
69  return geo->OpDetFromOpChannel(opch);
70  }
int pmtana::sign ( double  val)

Definition at line 104 of file UtilFunc.cxx.

104  {
105 
106  if (val > 0) return 1;
107  if (val < 0) return -1;
108  return 0;
109 
110  }
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.

43  {
44  if(!nsample) nsample = wf.size();
45  if(start > wf.size() || (start+nsample) > wf.size())
46  throw OpticalRecoException("Invalid start/end index!");
47 
48  double sigma = 0;
49 
50  for(size_t index=start; index < (start+nsample); ++index)
51 
52  sigma += pow( (wf[index] - ped_mean), 2 );
53 
54  sigma = sqrt(sigma/((double)(nsample)));
55 
56  return sigma;
57  }

Variable Documentation

SimpleFlashAlgoFactory pmtana::__SimpleFlashAlgoFactoryStaticObject__
static
const unsigned int pmtana::kINVALID_CHANNEL = std::numeric_limits<unsigned int>::max()
static
const double pmtana::kINVALID_TIME = std::numeric_limits<double>::max()
static