Functions | Variables
test_GeoApaChannelGroupService.cxx File Reference
#include "../GeoApaChannelGroupService.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_GeoApaChannelGroupService (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 87 of file test_GeoApaChannelGroupService.cxx.

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

Definition at line 29 of file test_GeoApaChannelGroupService.cxx.

29  {
30  const string myname = "test_GeoApaChannelGroupService: ";
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  std::ostringstream oss;
40  oss << "#include \"geometry.fcl\"" << endl;
41  oss << "services: @local::" << sgeo << "_geometry_services" << endl;
42  oss << "services.ChannelGroupService: {" << endl;
43  oss << " service_provider: \"GeoApaChannelGroupService\"" << endl;
44  oss << " LogLevel: 1" << endl;
45  oss << " ApaRops: []" << 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 
58  cout << myname << line << endl;
59  unsigned int napa = hcgs->size();
60  cout << myname << "Check APA count: " << napa << endl;
61  if ( sgeo == "lartpcdetector" ) {
62  assert( napa == 1 );
63  } else if ( sgeo == "bo" ) {
64  assert( napa == 1 );
65  } else {
66  cout << myname << "Unknown geometry" << endl;
67  }
68 
69  cout << myname << line << endl;
70  cout << myname << "APA names and channels:" << endl;
71  for ( unsigned int iapa=0; iapa<napa; ++iapa ) {
72  string name = hcgs->name(iapa);
73  const vector<ChannelGroupService::Index> chans = hcgs->channels(iapa);
74  cout << myname << " " << setw(10) << name << ": ["
75  << setw(6) << chans.front() << ", "
76  << setw(6) << chans.back() << "]" << endl;
77  assert( name.size() );
78  assert( name != "NoSuchApa" );
79  assert( chans.size() );
80  }
81 
82  cout << myname << line << endl;
83  cout << myname << "Done." << endl;
84  return 0;
85 }
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