Functions | Variables
test_GeoRopChannelGroupService.cxx File Reference
#include "../GeoRopChannelGroupService.h"
#include <string>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include "dunecore/ArtSupport/ArtServiceHelper.h"
#include <cassert>

Go to the source code of this file.

Functions

int test_GeoRopChannelGroupService (string sgeo)
 
int main (int argc, char *argv[])
 

Variables

const std::string LArPropertiesServiceConfigurationString
 
const std::string DetectorPropertiesServiceConfigurationString
 

Function Documentation

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

Definition at line 86 of file test_GeoRopChannelGroupService.cxx.

86  {
87  string sgeo = "lartpcdetector";
88  if ( argc > 1 ) {
89  sgeo = argv[1];
90  if ( sgeo == "-h" ) {
91  cout << "Usage: " << argv[0] << endl;
92  cout << " " << argv[0] << " lartpcdetector";
93  cout << " " << argv[0] << " bo" << endl;
94  return 0;
95  }
96  }
97  return test_GeoRopChannelGroupService(sgeo);
98 }
int test_GeoRopChannelGroupService(string sgeo)
QTextStream & endl(QTextStream &s)
int test_GeoRopChannelGroupService ( string  sgeo)

Definition at line 29 of file test_GeoRopChannelGroupService.cxx.

29  {
30  const string myname = "test_GeoRopChannelGroupService: ";
31 #ifdef NDEBUG
32  cout << myname << "NDEBUG must be off." << endl;
33  abort();
34 #endif
35  const string line = "-----------------------------";
36 
37  cout << myname << line << endl;
38  cout << myname << "Create fcl file." << endl;
39 
40  std::ostringstream oss;
41  // Default geometries from larcore: lartpcdetector_geometry, bo_geo
42  oss << "#include \"geometry.fcl\"" << endl;
43  oss << "services: @local::" << sgeo << "_geometry_services" << endl;
44  oss << "services.ChannelGroupService: {" << endl;
45  oss << " service_provider: \"GeoRopChannelGroupService\"" << endl;
46  oss << "}" << endl;
48 
49  cout << myname << line << endl;
50  cout << myname << "Fetch ChannelGroupService." << endl;
52  hcgs->print(cout, myname);
53 
54  cout << myname << line << endl;
55  cout << myname << "Geometry: " << sgeo << endl;
56 
57  cout << myname << line << endl;
58  unsigned int nrop = hcgs->size();
59  cout << myname << "Check ROP count: " << nrop << endl;
60  if ( sgeo == "lartpcdetector" ) {
61  assert( nrop == 3 );
62  } else if ( sgeo == "bo" ) {
63  assert( nrop == 3 );
64  } else {
65  cout << myname << "Unknown geometry" << endl;
66  }
67 
68  cout << myname << line << endl;
69  cout << myname << "ROP names and channels:" << endl;
70  for ( unsigned int irop=0; irop<nrop; ++irop ) {
71  string name = hcgs->name(irop);
72  const vector<ChannelGroupService::Index> chans = hcgs->channels(irop);
73  cout << myname << " " << setw(10) << name << ": ["
74  << setw(6) << chans.front() << ", "
75  << setw(6) << chans.back() << "]" << endl;
76  assert( name.size() );
77  assert( name != "NoSuchRop" );
78  assert( chans.size() );
79  }
80 
81  cout << myname << line << endl;
82  cout << myname << "Done." << endl;
83  return 0;
84 }
static QCString name
Definition: declinfo.cpp:673
virtual Index size() const =0
static void load_services(std::string const &config)
virtual std::ostream & print(std::ostream &out=std::cout, std::string prefix="") const =0
virtual const ChannelVector & channels(Index igrp) const =0
Q_EXPORT QTSManip setw(int w)
Definition: qtextstream.h:331
virtual Name name(Index igrp) const =0
void line(double t, double *p, double &x, double &y, double &z)
QTextStream & endl(QTextStream &s)

Variable Documentation

const std::string DetectorPropertiesServiceConfigurationString
Initial value:
{ R"cfg(
service_provider: "DetectorPropertiesServiceStandard"
# Drift properties
SternheimerA: 0.1956 # Ar Sternheimer parameter a.
SternheimerK: 3.0000 # Ar Sternheimer parameter k.
SternheimerX0: 0.2000 # Ar Sternheimer parameter x0.
SternheimerX1: 3.0000 # Ar Sternheimer parameter x0.
SternheimerCbar: 5.2146 # Ar Sternheimer parameter Cbar.
Temperature: 87
Electronlifetime: 3.0e3
Efield: [0.5,0.666,0.8] #(predicted for microBooNE)
ElectronsToADC: 6.8906513e-3 # 1fC = 43.008 ADC counts for DUNE fd
NumberTimeSamples: 4492 # drift length/drift velocity*sampling rate = (359.4 cm)/(0.16 cm/us)*(2 MHz)
ReadOutWindowSize: 4492 # drift length/drift velocity*sampling rate = (359.4 cm)/(0.16 cm/us)*(2 MHz)
TimeOffsetU: 0.
TimeOffsetV: 0.
TimeOffsetZ: 0.
DriftVelFudgeFactor: 1.
SimpleBoundaryProcess: true #enable opticalBoundaryProcessSimple instead of G4 default
)cfg"}
const std::string LArPropertiesServiceConfigurationString