129 TH1D* hSimElect =
dynamic_cast<TH1D*
>(fsim.Get(
"daq/ElectronicsResponse"));
135 TH1D* hSimColField =
dynamic_cast<TH1D*
>(fsim.Get(
"daq/CollectionFieldResponse"));
141 TH1D* hSimIndField =
dynamic_cast<TH1D*
>(fsim.Get(
"daq/InductionFieldResponse"));
147 TH1D* hSimColConv =
dynamic_cast<TH1D*
>(fsim.Get(
"daq/ConvolutedCollection"));
153 TH1D* hSimIndConv =
dynamic_cast<TH1D*
>(fsim.Get(
"daq/ConvolutedInduction"));
168 TH2D* respRe =
dynamic_cast<TH2D*
>(fcal.Get(
"sim/RespRe"));
169 TH2D* respIm =
dynamic_cast<TH2D*
>(fcal.Get(
"sim/RespIm"));
170 int nx = respRe->GetNbinsX();
171 int ny = respRe->GetNbinsY();
172 assert(nx == respIm->GetNbinsX());
173 assert(ny == respIm->GetNbinsY());
179 for(
int i=0; i<ny; ++i) {
180 double ac = respRe->GetBinContent(2, i+1);
181 double bc = respIm->GetBinContent(2, i+1);
185 double ai = respRe->GetBinContent(1, i+1);
186 double bi = respIm->GetBinContent(1, i+1);
193 art::TFileDirectory dirc = tfs->mkdir(
"Collection",
"Collection");
198 std::vector<double> tinc(
fNTicks, 0.);
199 fill_delta(tinc, nhist/2);
200 TH1D* hinc = dirc.make<TH1D>(
"input",
"Collection Input", nhist+1, -0.5, nhist+0.5);
201 vector_to_hist(tinc, hinc);
205 std::vector<double> telectc(tinc);
207 TH1D* helectc = dirc.make<TH1D>(
"elect",
"Collection Electronics", nhist+1, -0.5, nhist+0.5);
208 vector_to_hist(telectc, helectc);
212 std::vector<double> tfieldc(tinc);
213 fill_delta(tfieldc, nhist/2);
215 TH1D* hfieldc = dirc.make<TH1D>(
"field",
"Collection Field", nhist+1, -0.5, nhist+0.5);
216 vector_to_hist(tfieldc, hfieldc);
220 std::vector<double> tbothc(tfieldc);
222 TH1D* hbothc = dirc.make<TH1D>(
"both",
"Collection Field+Electronics", nhist+1, -0.5, nhist+0.5);
223 vector_to_hist(tbothc, hbothc);
228 std::cout <<
"Collection shift = " << shift <<
std::endl;
229 std::vector<double> tshiftc(tbothc);
231 TH1D* hshiftc = dirc.make<TH1D>(
"shift",
"Collection Field+Electronics+Shift", nhist+1, -0.5, nhist+0.5);
232 vector_to_hist(tshiftc, hshiftc);
236 std::vector<double> tconvc(tinc);
238 TH1D* hconvc = dirc.make<TH1D>(
"conv",
"Collection Response", nhist+1, -0.5, nhist+0.5);
239 vector_to_hist(tconvc, hconvc);
243 std::vector<double> tdeconvc(tconvc);
245 TH1D* hdeconvc = dirc.make<TH1D>(
"deconv",
"Collection Deconvoluted", nhist+1, -0.5, nhist+0.5);
246 vector_to_hist(tdeconvc, hdeconvc);
250 art::TFileDirectory diri = tfs->mkdir(
"Induction",
"Induction");
254 std::vector<double> tini(
fNTicks, 0.);
255 fill_delta(tini, nhist/2);
256 TH1D* hini = diri.make<TH1D>(
"input",
"Induction Input", nhist+1, -0.5, nhist+0.5);
257 vector_to_hist(tini, hini);
261 std::vector<double> telecti(tini);
263 TH1D* helecti = diri.make<TH1D>(
"elect",
"Induction Electronics", nhist+1, -0.5, nhist+0.5);
264 vector_to_hist(telecti, helecti);
268 std::vector<double> tfieldi(tini);
270 TH1D* hfieldi = diri.make<TH1D>(
"field",
"Induction Field", nhist+1, -0.5, nhist+0.5);
271 vector_to_hist(tfieldi, hfieldi);
275 std::vector<double> tbothi(tfieldi);
277 TH1D* hbothi = diri.make<TH1D>(
"both",
"Induction Field+Electronics", nhist+1, -0.5, nhist+0.5);
278 vector_to_hist(tbothi, hbothi);
283 std::cout <<
"Induction shift = " << shift <<
std::endl;
284 std::vector<double> tshifti(tbothi);
286 TH1D* hshifti = diri.make<TH1D>(
"shift",
"Induction Field+Electronics+Shift", nhist+1, -0.5, nhist+0.5);
287 vector_to_hist(tshifti, hshifti);
291 std::vector<double> tconvi(tini);
293 TH1D* hconvi = diri.make<TH1D>(
"conv",
"Induction Response", nhist+1, -0.5, nhist+0.5);
294 vector_to_hist(tconvi, hconvi);
298 std::vector<double> tdeconvi(tconvi);
300 TH1D* hdeconvi = diri.make<TH1D>(
"deconv",
"Induction Deconvoluted", nhist+1, -0.5, nhist+0.5);
301 vector_to_hist(tdeconvi, hdeconvi);
std::vector< TComplex > fSimIndConvF
std::vector< TComplex > fSimElectF
void ShiftData(std::vector< TComplex > &input, double shift)
std::vector< TComplex > fIndDeconvF
std::vector< double > fSimColField
void DoFFT(std::vector< T > &input, std::vector< TComplex > &output)
EDAnalyzer(fhicl::ParameterSet const &pset)
T PeakCorrelation(std::vector< T > &shape1, std::vector< T > &shape2)
std::vector< TComplex > fColDeconvF
std::vector< double > fSimIndConv
std::vector< double > fSimElect
T get(std::string const &key) const
std::vector< double > fSimIndField
void Convolute(std::vector< T > &input, std::vector< T > &respFunc)
std::vector< TComplex > fSimColFieldF
std::vector< double > fSimColConv
std::vector< TComplex > fSimColConvF
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
std::vector< TComplex > fSimIndFieldF
QTextStream & endl(QTextStream &s)