Main Page
Related Pages
Modules
Namespaces
Classes
Files
Examples
File List
File Members
dunecore
dunecore
Utilities
SignalShapingServiceDUNEDPhase.h
Go to the documentation of this file.
1
///////////////////////////////////////////////////////////////////////
2
///
3
/// \file SignalShapingServiceDUNEDPhase.h
4
///
5
/// \brief Service to provide DUNE dual-phase signal shaping for
6
/// simulation (convolution) and reconstruction (deconvolution).
7
///
8
/// \author V. Galymov vgalymov@ipnl.in2p3.fr
9
///
10
/// This service inherits from SignalShaping and supplies
11
/// DUNE dual-phase specific configuration.
12
/// It is intended that SimWire and CalWire modules will access this service.
13
///
14
/// The general philosophy to follow is to split fC -> ADC conversion
15
/// in two parts
16
/// - area normalization factor (typicaly in units ADC x us / fC)
17
/// - pulse shaping
18
/// Since the hit charge should be calculated from the integral, the norm
19
/// factor should be an area normalization constant. The shape function
20
/// should then be area-normalized in order to eventually achive a proper
21
/// normalization of the hit integral. Note that in this case even if the
22
/// simulated pulse shape may not be exact, if correctly normalized the
23
/// resulting simulated hit charge should be correct.
24
/// The charge loss due to, for example, the detector capacitance should
25
/// not be included in the calibration constant here but treated elsewhere
26
/// to avoid lumping many effiiciency factors into one ambiguous number
27
///
28
/// changes:
29
/// 11.20.2019, vgalymov
30
/// Changed pulse normalization to integral instead of amplitude.
31
/// For 3x1x1 the parameters specified in fcl were computed based
32
/// on what was originally put there for 3x1x1. Namely the pulse
33
/// function was calculated with original parameters and its integral
34
/// was then used to specify the area normalization in the service fcl.
35
/// Make the parameters for 1 m view optional, since this corresponds to
36
/// to a rather particular CRP configuration
37
///
38
/// 02.17.2020, vgalymov
39
/// Updated filter function to sample up-to correct 1.25 MHz
40
/// This service now inherits from SignalShapingService
41
///
42
///
43
////////////////////////////////////////////////////////////////////////
44
45
#ifndef __SIGNALSHAPINGSERVICEDUNEDPHASE_H__
46
#define __SIGNALSHAPINGSERVICEDUNEDPHASE_H__
47
48
#include "
dunecore/DuneInterface/Service/SignalShapingService.h
"
49
50
#include <vector>
51
#include "
fhiclcpp/ParameterSet.h
"
52
#include "
art/Framework/Services/Registry/ActivityRegistry.h
"
53
#include "
art/Framework/Services/Registry/ServiceMacros.h
"
54
#include "
lardata/Utilities/SignalShaping.h
"
55
#include "TF1.h"
56
57
namespace
detinfo
{
58
class
DetectorClocksData;
59
}
60
61
using
DoubleVec
= std::vector<double>;
62
63
namespace
util
{
64
65
class
SignalShapingServiceDUNEDPhase
:
public
SignalShapingService
{
66
public
:
67
68
// Constructor, destructor.
69
SignalShapingServiceDUNEDPhase
(
const
fhicl::ParameterSet
& pset,
70
art::ActivityRegistry
&
reg
);
71
~
SignalShapingServiceDUNEDPhase
();
72
73
// Update configuration parameters.
74
void
reconfigure
(
const
fhicl::ParameterSet
& pset);
75
76
double
GetAreaNorm(
unsigned
int
const
channel
)
const
;
77
78
std::vector<DoubleVec> GetNoiseFactVec()
const override
;
79
double
GetASICGain(
Channel
channel)
const override
;
80
double
GetShapingTime(
Channel
channel)
const override
;
81
double
GetRawNoise(
Channel
channel)
const override
;
82
double
GetDeconNoise(
Channel
channel)
const override
;
83
double
GetDeconNorm()
const override
;
84
unsigned
int
GetSignalSize()
const override
;
85
86
//double GetDeconNorm() const {return fDeconNorm;};
87
88
// Accessors.
89
int
FieldResponseTOffset(
detinfo::DetectorClocksData
const
& clockData,
90
unsigned
int
const
channel)
const override
;
91
const
util::SignalShaping
&
SignalShaping
(
unsigned
int
channel)
const override
;
92
93
// Do convolution calcution (for simulation).
94
template
<
class
T>
void
Convolute(
unsigned
int
channel, std::vector<T>&
func
)
const
;
95
void
Convolute(
detinfo::DetectorClocksData
const
& clockData,
Channel
channel,
FloatVector
& func)
const override
;
96
void
Convolute(
detinfo::DetectorClocksData
const
& clockData,
Channel
channel,
DoubleVector
& func)
const override
;
97
98
// Do deconvolution calcution (for reconstruction).
99
template
<
class
T>
void
Deconvolute(
unsigned
int
channel, std::vector<T>& func)
const
;
100
void
Deconvolute(
detinfo::DetectorClocksData
const
& clockData,
Channel
channel,
DoubleVector
& func)
const override
;
101
void
Deconvolute(
detinfo::DetectorClocksData
const
& clockData,
Channel
channel,
FloatVector
& func)
const override
;
102
103
private
:
104
105
// Private configuration methods.
106
107
// Post-constructor initialization.
108
void
init
()
const
{
const_cast<
SignalShapingServiceDUNEDPhase
*
>
(
this
)->
init
();}
109
void
init
();
110
111
112
// Calculate response functions.
113
double
SetElectResponse(
const
TF1* fshape,
util::SignalShaping
&sig,
double
areanorm );
114
void
SetFieldResponse(std::vector<double> &fresp);
//<- could be added later
115
double
FieldResponse(
double
tval_us);
//harcoded function to calcuate the field response
116
117
// Calculate filter functions.
118
void
SetFilters(
detinfo::DetectorClocksData
const
& clockData);
119
120
// Sample the response function, including a configurable drift velocity of electrons
121
void
SetResponseSampling(
detinfo::DetectorClocksData
const
& clockData,
122
util::SignalShaping
&sig );
123
124
// Attributes.
125
bool
fInit
;
///< Initialization flag.
126
127
// Fcl parameters.
128
double
fDeconNorm
;
129
double
fRespSamplingPeriod
;
///< Sampling period for response in ns
130
double
fAreaNorm
;
///< in units (ADC x us) / fC
131
double
fPulseHeight
;
///< pulse height in mV per fC
132
std::string
fShapeFunc
;
133
134
double
fADCpermV
;
///< Digitizer scale
135
double
fAmpENC
;
///< noise in num of electrons used where???
136
double
fAmpENCADC
;
///< noise rescaled to ADC
137
138
139
// the 3x1x1 stuff
140
bool
fHave1mView
;
141
double
fAreaNorm1m
;
///< in units (ADC x us) / fC for 1m strips
142
double
fPulseHeight1m
;
///< pulse amtplitide in mV per fC
143
std::string
fShapeFunc1m
;
144
145
146
///
147
TF1*
fColShapeFunc
;
// Parameterized collection shaping function
148
TF1*
fColShapeFunc1m
;
// Parameterized collection shaping function for 1m 3x1x1 strips
149
150
// Field response
151
bool
fAddFieldFunction
;
///< Enable the filed function
152
TF1*
fColFieldFunc
;
///< Parameterized collection field function.
153
double
fColFieldRespAmp
;
///< amplitude of response to field
154
155
//
156
// Following attributes hold the convolution and deconvolution kernels
157
util::SignalShaping
fColSignalShaping
;
158
159
//
160
util::SignalShaping
fColSignalShaping1m
;
/// for 3x1x1 1m strips
161
162
// Filters.
163
TF1*
fColFilterFunc
;
///< Parameterized collection filter function.
164
std::vector<TComplex>
fColFilter
;
165
std::vector<double>
fParArray
;
166
};
167
}
168
169
//----------------------------------------------------------------------
170
// Do convolution.
171
template
<
class
T>
inline
void
util::SignalShapingServiceDUNEDPhase::Convolute
(
unsigned
int
channel
, std::vector<T>&
func
)
const
172
{
173
SignalShaping
(channel).
Convolute
(func);
174
}
175
176
177
178
//----------------------------------------------------------------------
179
// Do deconvolution.
180
template
<
class
T>
inline
void
util::SignalShapingServiceDUNEDPhase::Deconvolute
(
unsigned
int
channel
,
181
std::vector<T>&
func
)
const
182
{
183
SignalShaping
(channel).
Deconvolute
(func);
184
}
185
186
187
DECLARE_ART_SERVICE
(
util::SignalShapingServiceDUNEDPhase
, LEGACY)
188
#endif
util::SignalShapingServiceDUNEDPhase::fInit
bool fInit
Initialization flag.
Definition:
SignalShapingServiceDUNEDPhase.h:125
util::SignalShaping::Deconvolute
void Deconvolute(std::vector< T > &func) const
Definition:
SignalShaping.h:184
util
Namespace for general, non-LArSoft-specific utilities.
Definition:
SignalShapingService.h:21
util::SignalShapingServiceDUNEDPhase::fParArray
std::vector< double > fParArray
Definition:
SignalShapingServiceDUNEDPhase.h:165
util::SignalShapingServiceDUNEDPhase::fADCpermV
double fADCpermV
Digitizer scale.
Definition:
SignalShapingServiceDUNEDPhase.h:134
util::SignalShapingServiceDUNEDPhase::fShapeFunc
std::string fShapeFunc
Definition:
SignalShapingServiceDUNEDPhase.h:132
string
std::string string
Definition:
nybbler.cc:12
util::SignalShapingServiceDUNEDPhase::fShapeFunc1m
std::string fShapeFunc1m
Definition:
SignalShapingServiceDUNEDPhase.h:143
SignalShapingService::FloatVector
std::vector< float > FloatVector
Definition:
SignalShapingService.h:29
util::SignalShapingServiceDUNEDPhase::fColSignalShaping1m
util::SignalShaping fColSignalShaping1m
Definition:
SignalShapingServiceDUNEDPhase.h:160
util::SignalShapingServiceDUNEDPhase::fAmpENC
double fAmpENC
noise in num of electrons used where???
Definition:
SignalShapingServiceDUNEDPhase.h:135
util::SignalShapingServiceDUNEDPhase::fAmpENCADC
double fAmpENCADC
noise rescaled to ADC
Definition:
SignalShapingServiceDUNEDPhase.h:136
util::SignalShapingServiceDUNEDPhase::fColFilterFunc
TF1 * fColFilterFunc
for 3x1x1 1m strips
Definition:
SignalShapingServiceDUNEDPhase.h:163
util::SignalShapingServiceDUNEDPhase::fRespSamplingPeriod
double fRespSamplingPeriod
Sampling period for response in ns.
Definition:
SignalShapingServiceDUNEDPhase.h:129
channel
uint8_t channel
Definition:
CRTFragment.hh:201
util::SignalShapingServiceDUNEDPhase::fColShapeFunc
TF1 * fColShapeFunc
Definition:
SignalShapingServiceDUNEDPhase.h:147
train.init
init
Definition:
train.py:42
util::SignalShaping
Definition:
SignalShaping.h:69
ParameterSet.h
util::SignalShaping::Convolute
void Convolute(std::vector< T > &func) const
Definition:
SignalShaping.h:167
util::SignalShapingServiceDUNEDPhase::init
void init() const
Definition:
SignalShapingServiceDUNEDPhase.h:108
util::SignalShapingServiceDUNEDPhase::fPulseHeight1m
double fPulseHeight1m
pulse amtplitide in mV per fC
Definition:
SignalShapingServiceDUNEDPhase.h:142
util::SignalShapingServiceDUNEDPhase::fColSignalShaping
util::SignalShaping fColSignalShaping
Definition:
SignalShapingServiceDUNEDPhase.h:157
SignalShaping.h
Generic class for shaping signals on wires.
util::SignalShapingServiceDUNEDPhase::fHave1mView
bool fHave1mView
Definition:
SignalShapingServiceDUNEDPhase.h:140
SignalShapingService.h
util::SignalShapingServiceDUNEDPhase
Definition:
SignalShapingServiceDUNEDPhase.h:65
RunHistoryService::reconfigure
virtual void reconfigure(fhicl::ParameterSet const &pset)
util::SignalShapingServiceDUNEDPhase::fColShapeFunc1m
TF1 * fColShapeFunc1m
Definition:
SignalShapingServiceDUNEDPhase.h:148
util::SignalShapingServiceDUNEDPhase::fAddFieldFunction
bool fAddFieldFunction
Enable the filed function.
Definition:
SignalShapingServiceDUNEDPhase.h:151
DECLARE_ART_SERVICE
#define DECLARE_ART_SERVICE(svc, scope)
Definition:
ServiceDeclarationMacros.h:77
util::SignalShapingServiceDUNEDPhase::fDeconNorm
double fDeconNorm
Definition:
SignalShapingServiceDUNEDPhase.h:128
util::SignalShapingServiceDUNEDPhase::fAreaNorm
double fAreaNorm
in units (ADC x us) / fC
Definition:
SignalShapingServiceDUNEDPhase.h:130
util::SignalShapingServiceDUNEDPhase::Convolute
void Convolute(unsigned int channel, std::vector< T > &func) const
Definition:
SignalShapingServiceDUNEDPhase.h:171
util::SignalShapingServiceDUNEDPhase::fPulseHeight
double fPulseHeight
pulse height in mV per fC
Definition:
SignalShapingServiceDUNEDPhase.h:131
detinfo
General LArSoft Utilities.
Definition:
CalibrationTreeBuilder.h:23
SignalShapingService::Channel
unsigned int Channel
Definition:
SignalShapingService.h:28
ServiceMacros.h
SignalShapingService
Definition:
SignalShapingService.h:25
util::SignalShapingServiceDUNEDPhase::fColFieldFunc
TF1 * fColFieldFunc
Parameterized collection field function.
Definition:
SignalShapingServiceDUNEDPhase.h:152
SignalShapingService::DoubleVector
std::vector< double > DoubleVector
Definition:
SignalShapingService.h:30
detinfo::DetectorClocksData
Contains all timing reference information for the detector.
Definition:
DetectorClocksData.h:283
art::ActivityRegistry
Definition:
ActivityRegistry.h:52
ActivityRegistry.h
docstring.func
def func()
Definition:
docstring.py:7
util::SignalShapingServiceDUNEDPhase::fColFieldRespAmp
double fColFieldRespAmp
amplitude of response to field
Definition:
SignalShapingServiceDUNEDPhase.h:153
util::SignalShapingServiceDUNEDPhase::fColFilter
std::vector< TComplex > fColFilter
Definition:
SignalShapingServiceDUNEDPhase.h:164
cet::registry_via_id
Definition:
registry_via_id.h:19
util::SignalShapingServiceDUNEDPhase::fAreaNorm1m
double fAreaNorm1m
in units (ADC x us) / fC for 1m strips
Definition:
SignalShapingServiceDUNEDPhase.h:141
DoubleVec
std::vector< double > DoubleVec
Definition:
SignalShapingServiceDUNE.h:46
util::SignalShapingServiceDUNEDPhase::Deconvolute
void Deconvolute(unsigned int channel, std::vector< T > &func) const
Definition:
SignalShapingServiceDUNEDPhase.h:180
fhicl::ParameterSet
Definition:
ParameterSet.h:36
Generated by
1.8.11