Functions
test_FixedDetPedestalService.cxx File Reference
#include "../FixedDetPedestalService.h"
#include "dunecore/ArtSupport/ArtServiceHelper.h"
#include "larcore/Geometry/Geometry.h"
#include <string>
#include <iostream>
#include <fstream>
#include <vector>
#include <iomanip>
#include <cassert>

Go to the source code of this file.

Functions

int test_FixedDetPedestalService ()
 
int main (int argc, char *argv[])
 

Function Documentation

int main ( int  argc,
char *  argv[] 
)

Definition at line 89 of file test_FixedDetPedestalService.cxx.

89  {
91 }
int test_FixedDetPedestalService()
int test_FixedDetPedestalService ( )

Definition at line 31 of file test_FixedDetPedestalService.cxx.

31  {
32  const string myname = "test_FixedDetPedestalService: ";
33 #ifdef NDEBUG
34  cout << myname << "NDEBUG must be off." << endl;
35  abort();
36 #endif
37  string line = "-----------------------------";
38 
39  cout << myname << line << endl;
40  cout << myname << "Create top-level FCL." << endl;
41  std::ostringstream oss;
42  oss << "#include \"pedestals_dune.fcl\"" << endl;
43  oss << "#include \"geometry_dune.fcl\"" << endl;
44  oss << "services.DetPedestalService: @local::dune_fixedpeds" << endl;
45  oss << "services.Geometry: @local::dune35t_geo" << endl;
46  oss << "services.ExptGeoHelperInterface: @local::dune_geometry_helper" << endl;
48 
49  cout << myname << line << endl;
50  cout << myname << "Fetch geometry service." << endl;
52  cout << myname << "Detector: " << hgeo->DetectorName() << endl;
53 
54  cout << myname << line << endl;
55  cout << myname << "Fetch pedestal service." << endl;
57  const DetPedestalProvider* pdpp = hdps->provider();
58  assert( pdpp != nullptr );
59 
60  cout << myname << line << endl;
61  cout << myname << "Checking pedestals for selected channels." << endl;
62  vector<int> chans = {0, 1, 200, 300, 400, 500, 600, 700, 800, 900};
63  int hchan = 10;
64  int hview = 10;
65  int hmean = 12;
66  cout << setw(hchan) << "Channel"
67  << setw(hview) << "View"
68  << setw(hmean) << "Mean"
69  << setw(hmean) << "RMS"
70  << endl;
71  for ( int chan : chans ) {
72  cout << setw(hchan) << chan
73  << setw(hview) << hgeo->View(chan)
74  << setw(hmean) << pdpp->PedMean(chan)
75  << setw(hmean) << pdpp->PedRms(chan)
76  << endl;
77  float meanExp = 1800;
78  if ( hgeo->View(chan) == geo::kZ ) {
79  meanExp = 500.0;
80  }
81  assert( pdpp->PedMean(chan) == meanExp );
82  }
83 
84  cout << myname << line << endl;
85  cout << myname << "Done." << endl;
86  return 0;
87 }
virtual float PedRms(raw::ChannelID_t ch) const =0
Planes which measure Z direction.
Definition: geo_types.h:132
static void load_services(std::string const &config)
std::string DetectorName() const
Returns a string with the name of the detector, as configured.
View_t View(geo::PlaneID const &pid) const
Returns the view (wire orientation) on the channels of specified TPC plane.
DetPedestalProvider const * provider() const
Q_EXPORT QTSManip setw(int w)
Definition: qtextstream.h:331
void line(double t, double *p, double &x, double &y, double &z)
virtual float PedMean(raw::ChannelID_t ch) const =0
Retrieve pedestal information.
QTextStream & endl(QTextStream &s)