Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
dunesim
dunesim
DetSim
Service
DPhaseSimChannelExtractService_service.cc
Go to the documentation of this file.
1
// DPhaseSimChannelExtractService.cxx
2
3
#include <iostream>
4
#include "
dunecore/ArtSupport/DuneToolManager.h
"
5
#include "
art/Framework/Services/Registry/ServiceDefinitionMacros.h
"
6
#include "
larcore/Geometry/Geometry.h
"
7
#include "
lardataobj/Simulation/SimChannel.h
"
8
#include "
messagefacility/MessageLogger/MessageLogger.h
"
9
#include "
DPhaseSimChannelExtractService.h
"
10
11
using
std::cout;
12
using
std::endl
;
13
using
std::string
;
14
15
//**********************************************************************
16
17
DPhaseSimChannelExtractService::
18
DPhaseSimChannelExtractService
(
const
fhicl::ParameterSet
& pset,
art::ActivityRegistry
&)
19
: m_ntick(m_pfft->FFTSize())
20
{
21
const
string
myname =
"DPhaseSimChannelExtractService::ctor: "
;
22
if
( !(
m_ntick
> 0 && !(
m_ntick
& (
m_ntick
-1))) )
23
{
24
throw
cet::exception
(
"DPhaseSimChannelExtractService"
)
25
<<
"FFT size is not a power of 2. "
;
26
}
27
28
/*
29
m_CrpGainToolName = pset.get<string>("CrpGainToolName");
30
DuneToolManager* ptm = DuneToolManager::instance("");
31
if ( ptm == nullptr )
32
{
33
throw cet::exception("DPhaseSimChannelExtractService")
34
<< "Unable to retrieve tool manaager.";
35
}
36
37
m_CrpGainTool = ptm->getPrivate<CrpGainSimTool>(m_CrpGainToolName);
38
39
if( !m_CrpGainTool )
40
{
41
throw cet::exception("DPhaseSimChannelExtractService")
42
<< "Unable to retrieve "<<m_CrpGainToolName<<".";
43
}
44
*/
45
//fDPGainPerView = pset.get<float> ("DPGainPerView");
46
//mf::LogInfo("DPhaseSimChannelExtractService")<<" Gain per view "<<fDPGainPerView;
47
}
48
49
//**********************************************************************
50
51
int
DPhaseSimChannelExtractService::
52
extract
(
detinfo::DetectorClocksData
const
& clockData,
53
const
sim::SimChannel
* psc,
AdcSignalVector
& sigs)
const
{
54
55
if
( psc ==
nullptr
)
return
0;
56
57
// get the channel number
58
unsigned
int
chan = psc->
Channel
();
59
60
// clear and resize temporary ADC buffer
61
sigs.clear();
62
sigs.resize(
m_ntick
, 0.0);
63
64
for
(
size_t
itck=0; itck<sigs.size(); ++itck ){
65
sigs[itck] =
m_crpgain
->
viewCharge
( psc, itck );
66
}
67
68
// perform convolution
69
m_psss
->
Convolute
(clockData, chan, sigs);
70
71
return
0;
72
}
73
74
//**********************************************************************
75
76
std::ostream&
DPhaseSimChannelExtractService::print
(std::ostream& out,
std::string
prefix
)
const
{
77
out << prefix <<
"DPhaseSimChannelExtractService"
;
78
return
out;
79
}
80
81
//**********************************************************************
82
83
DEFINE_ART_SERVICE_INTERFACE_IMPL
(
DPhaseSimChannelExtractService
,
SimChannelExtractService
)
84
85
//**********************************************************************
sim::SimChannel
Energy deposited on a readout channel by simulated tracks.
Definition:
SimChannel.h:140
DPhaseSimChannelExtractService::m_crpgain
art::ServiceHandle< util::CrpGainService > m_crpgain
Definition:
DPhaseSimChannelExtractService.h:52
submit_ppfxjobs.prefix
string prefix
Definition:
submit_ppfxjobs.py:128
string
std::string string
Definition:
nybbler.cc:12
DPhaseSimChannelExtractService::extract
int extract(detinfo::DetectorClocksData const &clockData, const sim::SimChannel *psc, AdcSignalVector &sig) const
Definition:
DPhaseSimChannelExtractService_service.cc:52
DPhaseSimChannelExtractService::DPhaseSimChannelExtractService
DPhaseSimChannelExtractService(fhicl::ParameterSet const &pset, art::ActivityRegistry &)
Definition:
DPhaseSimChannelExtractService_service.cc:18
DPhaseSimChannelExtractService.h
DPhaseSimChannelExtractService
Definition:
DPhaseSimChannelExtractService.h:30
Geometry.h
art framework interface to geometry description
MessageLogger.h
DuneToolManager.h
util::SignalShapingServiceDUNEDPhase::Convolute
void Convolute(unsigned int channel, std::vector< T > &func) const
Definition:
SignalShapingServiceDUNEDPhase.h:171
DPhaseSimChannelExtractService::m_psss
art::ServiceHandle< util::SignalShapingServiceDUNEDPhase > m_psss
Definition:
DPhaseSimChannelExtractService.h:49
DPhaseSimChannelExtractService::m_ntick
unsigned int m_ntick
Definition:
DPhaseSimChannelExtractService.h:57
util::CrpGainService::viewCharge
double viewCharge(const sim::SimChannel *psc, unsigned itck) const
Definition:
CrpGainService_service.cc:138
sim::SimChannel::Channel
raw::ChannelID_t Channel() const
Returns the readout channel this object describes.
Definition:
SimChannel.h:329
detinfo::DetectorClocksData
Contains all timing reference information for the detector.
Definition:
DetectorClocksData.h:283
art::ActivityRegistry
Definition:
ActivityRegistry.h:52
SimChannel.h
ServiceDefinitionMacros.h
AdcSignalVector
std::vector< AdcSignal > AdcSignalVector
Definition:
AdcTypes.h:22
DPhaseSimChannelExtractService::print
std::ostream & print(std::ostream &out=std::cout, std::string prefix="") const
Definition:
DPhaseSimChannelExtractService_service.cc:76
fhicl::exception
cet::coded_exception< error, detail::translate > exception
Definition:
exception.h:33
endl
QTextStream & endl(QTextStream &s)
Definition:
qtextstream.cpp:2030
SimChannelExtractService
Definition:
SimChannelExtractService.h:24
fhicl::ParameterSet
Definition:
ParameterSet.h:36
DEFINE_ART_SERVICE_INTERFACE_IMPL
#define DEFINE_ART_SERVICE_INTERFACE_IMPL(svc, iface)
Definition:
ServiceDefinitionMacros.h:42
Generated by
1.8.11