GenericSimChannelExtractService_service.cc
Go to the documentation of this file.
1 // GenericSimChannelExtractService.cxx
2 
5 #include <string>
8 
9 using std::string;
10 
11 //**********************************************************************
12 
15 : m_ntick(m_pfft->FFTSize()) {
16  if ( m_ntick%2 != 0 )
17  throw cet::exception("GenericSimChannelExtractService")
18  << "FFT size is not a power of 2.";
19 }
20 
21 //**********************************************************************
22 
25  const sim::SimChannel* psc, AdcSignalVector& sigs) const {
26  sigs.clear();
27  sigs.resize(m_ntick, 0.0);
28  if ( psc == nullptr ) return 0;
29  for ( size_t itck=0; itck<sigs.size(); ++itck ) {
30  sigs[itck] = psc->Charge(itck);
31  }
32  unsigned int chan = psc->Channel();
33  m_psss->Convolute(clockData, chan, sigs);
34  return 0;
35 }
36 
37 //**********************************************************************
38 
40 print(std::ostream& out, std::string prefix) const {
41  out << prefix << "GenericSimChannelExtractService";
42  return out;
43 }
44 
45 //**********************************************************************
46 
48 
49 //**********************************************************************
Energy deposited on a readout channel by simulated tracks.
Definition: SimChannel.h:140
std::string string
Definition: nybbler.cc:12
GenericSimChannelExtractService(fhicl::ParameterSet const &pset, art::ActivityRegistry &)
art framework interface to geometry description
std::ostream & print(std::ostream &out=std::cout, std::string prefix="") const
double Charge(TDC_t tdc) const
Returns the total number of ionization electrons on this channel in the specified TDC...
Definition: SimChannel.cxx:134
raw::ChannelID_t Channel() const
Returns the readout channel this object describes.
Definition: SimChannel.h:329
void Convolute(detinfo::DetectorClocksData const &clockData, Channel channel, std::vector< T > &func) const
Contains all timing reference information for the detector.
int extract(detinfo::DetectorClocksData const &clockData, const sim::SimChannel *psc, AdcSignalVector &sig) const
art::ServiceHandle< util::SignalShapingServiceDUNE > m_psss
std::vector< AdcSignal > AdcSignalVector
Definition: AdcTypes.h:22
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
#define DEFINE_ART_SERVICE_INTERFACE_IMPL(svc, iface)