#include <UndershootCorr.h>
|
void | crc (std::vector< double > &orig, std::vector< double > &corr, double pedi, double csi, size_t plane) const |
|
void | estimatepars (std::vector< double > &x, std::vector< double > &y, double &pedi, double &csi, size_t plane) const |
|
void | wlinfit (std::vector< double > x, std::vector< double > &y, std::vector< double > &e, double &slope, double &intercept) const |
|
virtual DataMap | updateTpcData (TpcData &) const |
|
virtual DataMap | viewTpcData (const TpcData &) const |
|
virtual int | forwardTpcData () const |
|
virtual | ~AdcChannelTool ()=default |
|
virtual DataMap | view (const AdcChannelData &acd) const |
|
virtual DataMap | updateMap (AdcChannelDataMap &acds) const |
|
virtual DataMap | viewMap (const AdcChannelDataMap &acds) const |
|
virtual bool | updateWithView () const |
|
virtual bool | viewWithUpdate () const |
|
virtual DataMap | beginEvent (const DuneEventInfo &) const |
|
virtual DataMap | endEvent (const DuneEventInfo &) const |
|
virtual DataMap | close (const DataMap *dmin=nullptr) |
|
Definition at line 35 of file UndershootCorr.h.
Definition at line 20 of file UndershootCorr_tool.cc.
28 ,
m_LCA(
ps.get<std::vector<double> >(
"LCA"))
29 ,
m_LCB(
ps.get<std::vector<double> >(
"LCB"))
30 ,
m_LCC(
ps.get<std::vector<double> >(
"LCC"))
31 ,
m_LCD(
ps.get<std::vector<double> >(
"LCD")) {
32 const string myname =
"UndershootCorr::ctor: ";
34 cout << myname <<
"Parameters:" <<
endl;
36 for (
unsigned int i=0; i<3; ++i ) {
37 cout << myname <<
" For view " << i <<
endl;
38 cout << myname <<
" CorrectFlag: " << (
m_CorrectFlag[i] ?
"true" :
"false" ) << endl;
41 cout << myname <<
" RestoreBaseline: " << (
m_RestoreBaseline[i] ?
"true" :
"false" ) << endl;
44 cout << myname <<
" LCA: " <<
m_LCA[i] <<
endl;
45 cout << myname <<
" LCB: " <<
m_LCB[i] <<
endl;
46 cout << myname <<
" LCC: " <<
m_LCC[i] <<
endl;
47 cout << myname <<
" LCD: " <<
m_LCD[i] <<
endl;
std::vector< double > m_TDecayConst
std::vector< double > m_SignalThreshold
std::vector< double > m_FSubConst
std::vector< double > m_LCD
std::vector< bool > m_RestoreBaseline
std::vector< double > m_LCA
static constexpr double ps
std::vector< double > m_LCC
std::vector< double > m_LCB
std::vector< bool > m_CorrectFlag
QTextStream & endl(QTextStream &s)
UndershootCorr::~UndershootCorr |
( |
| ) |
|
|
overridedefault |
void UndershootCorr::crc |
( |
std::vector< double > & |
orig, |
|
|
std::vector< double > & |
corr, |
|
|
double |
pedi, |
|
|
double |
csi, |
|
|
size_t |
plane |
|
) |
| const |
|
private |
Definition at line 163 of file UndershootCorr_tool.cc.
168 for (
int i=0;i<
nbinsx;++i) {
169 float bc = orig[i] - trueped;
170 float cv = bc - csum;
std::vector< double > m_TDecayConst
std::vector< double > m_FSubConst
nbinsx
New: trying to make a variation.
void UndershootCorr::estimatepars |
( |
std::vector< double > & |
x, |
|
|
std::vector< double > & |
y, |
|
|
double & |
pedi, |
|
|
double & |
csi, |
|
|
size_t |
plane |
|
) |
| const |
|
private |
Definition at line 121 of file UndershootCorr_tool.cc.
126 std::vector<double> corr1(nbinsx);
127 std::vector<double> corr1e(nbinsx);
128 crc(y,corr1,0,0,plane);
131 for (
int i=0;i<
nbinsx;++i) {
132 corr1e[i] = TMath::Max(1.0,TMath::Abs(corr1[i]));
136 wlinfit(x,corr1,corr1e,slope,intercept);
139 for (
int i=0;i<
nbinsx;++i) {
141 double yval = corr1[i];
142 float pred = intercept + slope*xcent;
150 wlinfit(x,corr1,corr1e,slope,intercept);
157 pedi =
m_LCA[plane]*slope +
m_LCB[plane]*intercept;
158 csi =
m_LCC[plane]*slope +
m_LCD[plane]*intercept;
std::vector< double > m_SignalThreshold
std::vector< double > m_LCD
std::vector< double > m_LCA
void crc(std::vector< double > &orig, std::vector< double > &corr, double pedi, double csi, size_t plane) const
std::vector< double > m_LCC
std::vector< double > m_LCB
nbinsx
New: trying to make a variation.
void wlinfit(std::vector< double > x, std::vector< double > &y, std::vector< double > &e, double &slope, double &intercept) const
Reimplemented from AdcChannelTool.
Definition at line 54 of file UndershootCorr_tool.cc.
55 const string myname =
"UndershootCorr::view: ";
56 if (
m_LogLevel >= 2 ) cout <<
"Processing run " << acd.
run() <<
" event " << acd.
event()
63 size_t nticks = samples.size();
65 cout << myname <<
"Data for channel " << acd.
channel() <<
" has " 66 << ( nticks==0 ?
"no" :
"too few" ) <<
" ticks." <<
endl;
73 cout << myname <<
"WARNING: Input data does not have a sample unit." <<
endl;
75 cout << myname <<
"WARNING: Unexpected input data unit: " << acd.
sampleUnit 81 size_t offlineChannel = acd.
channel();
88 double median = TMath::Median(nticks,samples.data());
90 std::vector<double>
x(nticks);
91 std::vector<double> yorig(nticks);
92 std::vector<double> ycorr(nticks);
95 for (
size_t i=0;i<nticks;++i) {
96 double bc = samples[i]-
median;
97 if (bc != 0) allempty=
false;
101 if (allempty)
return ret;
103 crc(yorig,ycorr,pedfit,csifit,plane);
105 for (
size_t i=0; i<nticks; ++i ) samples[i] = ycorr[i] + offset;
107 cout <<
" Median: " << median
109 cout <<
" Fit pedestal: " << pedfit <<
endl;
110 cout <<
" Fit offset: " << csifit <<
endl;
113 acd.
metadata[
"uscPedestal"] = pedfit;
114 acd.
metadata[
"uscPedestalOffset"] = csifit;
void estimatepars(std::vector< double > &x, std::vector< double > &y, double &pedi, double &csi, size_t plane) const
std::vector< bool > m_RestoreBaseline
unsigned int PlaneFromOfflineChannel(unsigned int offlineChannel) const
Returns plane.
void crc(std::vector< double > &orig, std::vector< double > &corr, double pedi, double csi, size_t plane) const
std::vector< AdcSignal > AdcSignalVector
std::vector< bool > m_CorrectFlag
double median(sqlite3 *db, std::string const &table_name, std::string const &column_name)
QTextStream & endl(QTextStream &s)
Definition at line 184 of file UndershootCorr_tool.cc.
194 size_t npts = x.size();
196 for (
size_t i=0; i<npts; ++i ) {
197 double ooe2 = 1.0/TMath::Sq(e[i]);
200 sumxy += x[i]*y[i]*ooe2;
201 sumxx += TMath::Sq(x[i])*ooe2;
205 double denom = TMath::Sq(sumx) - sumxx*sum;
207 slope = (sumx*sumy - sumxy*sum)/denom;
208 intercept = (sumx*sumxy - sumy*sumxx)/denom;
int UndershootCorr::m_LogLevel |
|
private |
The documentation for this class was generated from the following files: