Public Types | Public Member Functions | Public Attributes | List of all members
AdcChannelDataTester Class Reference

#include <AdcChannelDataTester.h>

Public Types

using Index = unsigned int
 

Public Member Functions

int fill (AdcChannelData &acd, Index icha, Index isam0)
 
int strumChannels (AdcChannelDataMap &acds, Index ncha=0)
 
int strumTpcWires (AdcChannelDataMap &acds, Index itpc, Index icry=0)
 
int strumCryoWires (AdcChannelDataMap &acds, Index icry=0)
 
int strumDetectorWires (AdcChannelDataMap &acds)
 

Public Attributes

Index run =1
 
Index subrun =0
 
Index event =0
 
Index channel = 0
 
float pedestal =700.0
 
Index nsam = 500
 
std::vector< short > rawwf ={1200}
 
std::vector< float > samwf ={50.0}
 

Detailed Description

Definition at line 16 of file AdcChannelDataTester.h.

Member Typedef Documentation

using AdcChannelDataTester::Index = unsigned int

Definition at line 20 of file AdcChannelDataTester.h.

Member Function Documentation

int AdcChannelDataTester::fill ( AdcChannelData acd,
Index  icha,
Index  isam0 
)

Definition at line 18 of file AdcChannelDataTester.cxx.

18  {
19  const string myname = "AdcChannelDataTester::fill: ";
21  acd.setChannelInfo(icha);
22  acd.pedestal = pedestal;
23  acd.sampleUnit = "ke";
24  if ( acd.raw.size() < nsam ) acd.raw.resize(nsam, 0);
25  if ( acd.samples.size() < nsam ) acd.samples.resize(nsam, 0.0);
26  for ( Index isam=0; isam<rawwf.size(); ++isam ) {
27  Index ksam = (isam+isam0)%nsam;
28  acd.raw[ksam] += rawwf[isam];
29  }
30  for ( Index isam=0; isam<samwf.size(); ++isam ) {
31  Index ksam = (isam+isam0)%nsam;
32  acd.samples[ksam] += samwf[isam];
33  }
34  return 0;
35 }
unsigned int Index
std::vector< float > samwf
void setChannelInfo(ChannelInfoPtr pchi)
void setEventInfo(EventInfoPtr pevi)
AdcCountVector raw
AdcSignal pedestal
AdcSignalVector samples
Event finding and building.
std::vector< short > rawwf
int AdcChannelDataTester::strumChannels ( AdcChannelDataMap acds,
Index  ncha = 0 
)

Definition at line 40 of file AdcChannelDataTester.cxx.

40  {
41  const string myname = "strumChannels: ";
42  Index ncha = a_ncha;
43  if ( ncha == 0 ) {
45  if ( pgeo->DetectorName() == "" ) {
46  cout << myname << "Geometry not found." << endl;
47  return 1;
48  }
49  ncha = pgeo->Nchannels();
50  }
51  for ( Index icha=0; icha<ncha; ++icha ) {
52  channel = icha;
53  fill(acds[icha], icha, icha);
54  }
55  return 0;
56 }
unsigned int Index
unsigned int Nchannels() const
Returns the number of TPC readout channels in the detector.
int fill(AdcChannelData &acd, Index icha, Index isam0)
std::string DetectorName() const
Returns a string with the name of the detector, as configured.
QTextStream & endl(QTextStream &s)
int AdcChannelDataTester::strumCryoWires ( AdcChannelDataMap acds,
Index  icry = 0 
)

Definition at line 101 of file AdcChannelDataTester.cxx.

101  {
102  const string myname = "strumCryoWires: ";
103 
105  if ( pgeo->DetectorName() == "" ) {
106  cout << myname << "Geometry not found." << endl;
107  return 1;
108  }
109 
110  const geo::CryostatGeo& gcry = pgeo->Cryostat(icry);
111  for ( Index itpc=0; itpc<gcry.NTPC(); ++itpc ) {
112  strumTpcWires(acds, itpc, icry);
113  }
114 
115  return 0;
116 }
unsigned int Index
Geometry information for a single cryostat.
Definition: CryostatGeo.h:43
std::string DetectorName() const
Returns a string with the name of the detector, as configured.
unsigned int NTPC() const
Number of TPCs in this cryostat.
Definition: CryostatGeo.h:181
CryostatGeo const & Cryostat(geo::CryostatID const &cryoid) const
Returns the specified cryostat.
int strumTpcWires(AdcChannelDataMap &acds, Index itpc, Index icry=0)
QTextStream & endl(QTextStream &s)
int AdcChannelDataTester::strumDetectorWires ( AdcChannelDataMap acds)

Definition at line 123 of file AdcChannelDataTester.cxx.

123  {
124  const string myname = "strumDetectorWires: ";
125 
127  if ( pgeo->DetectorName() == "" ) {
128  cout << myname << "Geometry not found." << endl;
129  return 1;
130  }
131 
132  Index ncry = pgeo->Ncryostats();
133  for ( Index icry=0; icry<ncry; ++icry ) {
134  strumCryoWires(acds, icry);
135  }
136 
137  return 0;
138 }
unsigned int Index
unsigned int Ncryostats() const
Returns the number of cryostats in the detector.
int strumCryoWires(AdcChannelDataMap &acds, Index icry=0)
std::string DetectorName() const
Returns a string with the name of the detector, as configured.
QTextStream & endl(QTextStream &s)
int AdcChannelDataTester::strumTpcWires ( AdcChannelDataMap acds,
Index  itpc,
Index  icry = 0 
)

Definition at line 63 of file AdcChannelDataTester.cxx.

63  {
64  const string myname = "strumTpcWires: ";
65 
67  if ( pgeo->DetectorName() == "" ) {
68  cout << myname << "Geometry not found." << endl;
69  return 1;
70  }
71 
72  geo::TPCID tid(icry, itpc);
73  if ( ! pgeo->HasTPC(tid) ) {
74  cout << myname << "TPC not found: " << tid << endl;
75  return 2;
76  }
77  const geo::TPCGeo& gtpc = pgeo->TPC(tid);
78  Index npla = gtpc.Nplanes();
79  Index nsam = 500;
80  Index isam = 0;
81  for ( Index ipla=0; ipla<npla; ++ipla ) {
82  geo::PlaneID pid(tid, ipla);
83  const geo::PlaneGeo& gpla = gtpc.Plane(ipla);
84  Index nwir = gpla.Nwires();
85  for ( Index iwir=0; iwir<nwir; ++iwir ) {
86  geo::WireID wid(pid, iwir);
87  Index icha = pgeo->PlaneWireToChannel(wid);
88  fill(acds[channel], icha, isam);
89  if ( ++isam >= nsam ) isam = 0;
90  }
91  }
92 
93  return 0;
94 }
unsigned int Nplanes() const
Number of planes in this tpc.
Definition: TPCGeo.h:165
The data type to uniquely identify a Plane.
Definition: geo_types.h:472
Geometry information for a single TPC.
Definition: TPCGeo.h:38
unsigned int Index
int fill(AdcChannelData &acd, Index icha, Index isam0)
std::string DetectorName() const
Returns a string with the name of the detector, as configured.
Geometry information for a single wire plane.The plane is represented in the geometry by a solid whic...
Definition: PlaneGeo.h:82
The data type to uniquely identify a TPC.
Definition: geo_types.h:386
bool HasTPC(geo::TPCID const &tpcid) const
Returns whether we have the specified TPC.
raw::ChannelID_t PlaneWireToChannel(WireID const &wireid) const
Returns the ID of the TPC channel connected to the specified wire.
unsigned int Nwires() const
Number of wires in this plane.
Definition: PlaneGeo.h:269
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
PlaneGeo const & Plane(geo::View_t view) const
Return the plane in the tpc with View_t view.
Definition: TPCGeo.cxx:263
QTextStream & endl(QTextStream &s)

Member Data Documentation

Index AdcChannelDataTester::channel = 0

Definition at line 26 of file AdcChannelDataTester.h.

Index AdcChannelDataTester::event =0

Definition at line 25 of file AdcChannelDataTester.h.

Index AdcChannelDataTester::nsam = 500

Definition at line 28 of file AdcChannelDataTester.h.

float AdcChannelDataTester::pedestal =700.0

Definition at line 27 of file AdcChannelDataTester.h.

std::vector<short> AdcChannelDataTester::rawwf ={1200}

Definition at line 29 of file AdcChannelDataTester.h.

Index AdcChannelDataTester::run =1

Definition at line 23 of file AdcChannelDataTester.h.

std::vector<float> AdcChannelDataTester::samwf ={50.0}

Definition at line 30 of file AdcChannelDataTester.h.

Index AdcChannelDataTester::subrun =0

Definition at line 24 of file AdcChannelDataTester.h.


The documentation for this class was generated from the following files: