32 pm.
add(
"WireCellSigProc");
40 const std::string ncr_tn =
"NominalChannelResponse";
46 auto incrcfg = Factory::lookup<IConfigurable>(ncr_tn);
47 auto cfg = incrcfg->default_configuration();
48 cfg[
"nbins"] = binning.
nbins();
49 cfg[
"tmin"] = binning.
min();
50 cfg[
"tmax"] = binning.
max();
51 incrcfg->configure(cfg);
54 auto ncr = Factory::find<IChannelResponse>(ncr_tn);
56 const double GU =
mV/
fC;
58 const std::vector<double> gains{7.8*GU, 14*GU};
59 const std::vector<double> shapes{0.5*
us,1.0*
us,2.0*
us,3.0*
us};
61 std::vector<TGraph*> graphs;
63 for (
auto gain : gains) {
65 for (
auto shape : shapes) {
66 cfg[
"shaping"] = shape;
70 incrcfg->configure(cfg);
73 auto wave = ncr->channel_response(0);
74 const int nbins = wave.size();
75 cerr << nbins <<
" " << binning.
nbins() <<
endl;
77 TGraph*
g =
new TGraph(binning.
nbins());
78 for (
int ind=0; ind<binning.
nbins(); ++ind) {
79 g->SetPoint(ind, binning.
center(ind)/
us, wave[ind]/GU);
85 const int colors[] = {1,2,4,6};
86 TCanvas
c(
"c",
"c",500,500);
87 auto frame = c.DrawFrame(0.0, 0.0, 10.0, 15.0);
88 frame->SetTitle(
"Nominal Channel Response various gains/shaping");
89 frame->GetXaxis()->SetTitle(
"time [us]");
90 frame->GetYaxis()->SetTitle(
"gain [mV/fC]");
91 for (
size_t ind=0; ind<graphs.size(); ++ind) {
92 TGraph*
g = graphs[ind];
93 g->SetLineColor(colors[ind%4]);
94 g->SetMarkerColor(colors[ind%4]);
97 c.Print(Form(
"%s.pdf", argv[0]),
"pdf");
double center(int ind) const
static PluginManager & instance()
int main(int argc, char *argv[])
Plugin * add(const std::string &plugin_name, const std::string &libname="")
Add a plugin. If libname is not given, try to derive it.
QTextStream & endl(QTextStream &s)