138 pm.
add(
"WireCellGen");
139 pm.
add(
"WireCellSigProc");
151 string out_basename =
argv[0];
152 string response_file =
"ub-10-half.json.bz2";
154 response_file =
argv[1];
157 out_basename =
argv[2];
159 cerr <<
"Using response file: " << response_file <<
endl;
160 cerr <<
"Writing to " << out_basename <<
endl;
163 const std::string er_tn =
"ElecResponse", rc_tn =
"RCResponse";
166 auto icfg = Factory::lookup_tn<IConfigurable>(er_tn);
167 auto cfg = icfg->default_configuration();
169 cfg[
"shaping"] = shaping;
171 cerr <<
"Setting: " << cfg[
"nticks"].asInt() <<
" ticks\n";
174 icfg->configure(cfg);
177 auto icfg = Factory::lookup_tn<IConfigurable>(rc_tn);
178 auto cfg = icfg->default_configuration();
182 icfg->configure(cfg);
185 auto icfg = Factory::lookup<IConfigurable>(
"FieldResponse");
186 auto cfg = icfg->default_configuration();
187 cfg[
"filename"] = response_file;
188 icfg->configure(cfg);
191 std::vector<std::string> pir_tns{
"PlaneImpactResponse:frU",
"PlaneImpactResponse:frV",
"PlaneImpactResponse:frW"};
193 for (
int iplane=0; iplane<3; ++iplane) {
194 auto icfg = Factory::lookup_tn<IConfigurable>(pir_tns[iplane]);
195 auto cfg = icfg->default_configuration();
196 cfg[
"plane"] = iplane;
199 icfg->configure(cfg);
202 std::vector<std::string> pir_ele_tns{
"PlaneImpactResponse:frerU",
"PlaneImpactResponse:frerV",
"PlaneImpactResponse:frerW"};
204 for (
int iplane=0; iplane<3; ++iplane) {
205 auto icfg = Factory::lookup_tn<IConfigurable>(pir_ele_tns[iplane]);
206 auto cfg = icfg->default_configuration();
207 cfg[
"plane"] = iplane;
210 cfg[
"other_responses"][0] = er_tn;
211 cfg[
"other_responses"][1] = rc_tn;
212 cfg[
"other_responses"][2] = rc_tn;
213 icfg->configure(cfg);
220 TFile* rootfile = TFile::Open(Form(
"%s.root", out_basename.c_str()),
"recreate");
223 MultiPdf mpdf(out_basename.c_str());
224 for (
int iplane=0; iplane<3; ++iplane) {
225 auto pir = Factory::find_tn<IPlaneImpactResponse>(pir_tns[iplane]);
228 auto pir_ele = Factory::find_tn<IPlaneImpactResponse>(pir_ele_tns[iplane]);
229 plot_time(mpdf, pir_ele, iplane,
tbins,
"dr",
"Detector Response");
234 cerr <<
"Closing ROOT file: " << rootfile->GetName() <<
endl;
code to link reconstructed objects back to the MC truth information
const std::string instance
Binning tbins(nticks, t0, t0+readout_time)
Plugin * add(const std::string &plugin_name, const std::string &libname="")
Add a plugin. If libname is not given, try to derive it.
void plot_time(MultiPdf &mpdf, IPlaneImpactResponse::pointer pir, int iplane, Binning tbins, const std::string &name, const std::string &title)
QTextStream & endl(QTextStream &s)
const double readout_time