Functions | Variables
test_Dune35tChannelGroupService.cxx File Reference
#include "../Dune35tChannelGroupService.h"
#include <string>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include "dune/ArtSupport/ArtServiceHelper.h"
#include <cassert>

Go to the source code of this file.

Functions

int test_Dune35tChannelGroupService ()
 
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 81 of file test_Dune35tChannelGroupService.cxx.

81  {
83 }
int test_Dune35tChannelGroupService()
int test_Dune35tChannelGroupService ( )

Definition at line 29 of file test_Dune35tChannelGroupService.cxx.

29  {
30  const string myname = "test_Dune35tChannelGroupService: ";
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 << "services.ChannelMapService: {" << endl;
41  oss << " service_provider: \"ChannelMapService\"" << endl;
42  oss << " FileName: \"35tTPCChannelMap_v6.txt\"" << endl;
43  oss << " LogLevel: 1" << endl;
44  oss << "}" << endl;
45  oss << "services.ChannelGroupService: {" << endl;
46  oss << " service_provider: \"Dune35tChannelGroupService\"" << endl;
47  oss << " UseOffline: true" << endl;
48  oss << " Grouping: Regulator" << endl;
49  oss << " SplitByPlane: false" << endl;
50  oss << "}" << endl;
52 
53  cout << myname << line << endl;
54  cout << myname << "Fetch ChannelGroupService." << endl;
56  hcgs->print(cout, myname);
57 
58  cout << myname << line << endl;
59  unsigned int ngrp = hcgs->size();
60  cout << myname << "Check group count: " << ngrp << endl;
61  assert( ngrp == 32 );
62 
63  cout << myname << line << endl;
64  cout << myname << "Group names and channels:" << endl;
65  for ( unsigned int igrp=0; igrp<ngrp; ++igrp ) {
66  string name = hcgs->name(igrp);
67  const vector<ChannelGroupService::Index> chans = hcgs->channels(igrp);
68  cout << myname << " " << setw(10) << name << ": ["
69  << setw(6) << chans.front() << ", "
70  << setw(6) << chans.back() << "]" << endl;
71  assert( name.size() );
72  assert( name != "NoSuchGroup" );
73  assert( chans.size() );
74  }
75 
76  cout << myname << line << endl;
77  cout << myname << "Done." << endl;
78  return 0;
79 }
static QCString name
Definition: declinfo.cpp:673
def line(rflist, normalization=13700 *units.eplus)
Definition: __init__.py:701
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
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