169 std::vector<double> decayConsts;
170 std::vector<int> kernMap;
171 std::vector<std::vector<TComplex> > kernel;
188 std::unique_ptr<std::vector<recob::Wire> > wirecol(
new std::vector<recob::Wire>);
190 std::unique_ptr<art::Assns<raw::RawDigit,recob::Wire> > WireDigitAssn
197 if (!digitVecHandle->size())
return;
198 mf::LogInfo(
"CalWireT962") <<
"CalWireT962:: digitVecHandle size is " << digitVecHandle->size();
203 unsigned int dataSize = digitVec0->Samples();
205 int transformSize = fFFT->
FFTSize();
212 double decayConst = 0.;
213 double fitAmplitude = 0.;
214 std::vector<float> holder;
215 std::vector<TComplex> freqHolder(transformSize+1);
218 for(
unsigned int rdIter = 0; rdIter < digitVecHandle->size(); ++rdIter){
224 channel = digitVec->Channel();
227 if(!channelStatus.
IsBad(channel)) {
228 holder.resize(transformSize);
231 holder[
bin]=(rawadc[
bin]-digitVec->GetPedestal());
235 TH1D expTailData(
"expTailData",
"Tail data for fit",
237 TF1 expFit(
"expFit",
"[0]*exp([1]*x)");
241 decayConst = decayConsts[
channel];
243 expFit.FixParameter(1,decayConst);
244 expFit.SetParameter(0,fitAmplitude);
245 expTailData.Fit(&expFit,
"QWN",
"",dataSize-
fExpEndBins,dataSize);
246 expFit.SetRange(dataSize,transformSize);
248 holder[dataSize+
bin]= expFit.Eval(
bin+dataSize);
256 fFFT->
Convolute(holder,kernel[kernMap[channel]]);
259 holder.resize(dataSize,1
e-5);
265 for(
bin = 0;
bin < holder.size(); ++
bin) holder[
bin]-=average;
275 <<
"Can't associate wire #" << (wirecol->size() - 1)
276 <<
" with raw digit #" << digitVec.key();
280 if(wirecol->size() == 0)
virtual bool IsBad(raw::ChannelID_t channel) const =0
Returns whether the specified channel is bad in the current run.
MaybeLogger_< ELseverityLevel::ELsev_info, false > LogInfo
int fPostsample
number of postsample bins
std::vector< short > ADCvector_t
Type representing a (compressed) vector of ADC counts.
Class managing the creation of a new recob::Wire object.
std::vector< std::vector< TComplex > > fKernelR
std::vector< double > fDecayConstsS
bool getByLabel(std::string const &label, std::string const &instance, Handle< PROD > &result) const
constexpr ChannelID_t InvalidChannelID
ID of an invalid channel.
std::string fDigitModuleLabel
module that made digits
std::vector< int > fKernMapS
ProductID put(std::unique_ptr< PROD > &&edp, std::string const &instance={})
void Convolute(std::vector< T > &input, std::vector< T > &respFunc)
bool CreateAssn(PRODUCER const &prod, art::Event &evt, std::vector< T > const &a, art::Ptr< U > const &b, art::Assns< U, T > &assn, std::string a_instance, size_t indx=UINT_MAX)
Creates a single one-to-one association.
Class providing information about the quality of channels.
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
std::vector< double > fDecayConstsR
QTextStream & bin(QTextStream &s)
unsigned int ChannelID_t
Type representing the ID of a readout channel.
void Uncompress(const std::vector< short > &adc, std::vector< short > &uncompressed, raw::Compress_t compress)
Uncompresses a raw data buffer.
std::vector< std::vector< TComplex > > fKernelS
std::vector< int > fKernMapR
int fExpEndBins
number of end bins to consider for tail fit