43 fUpstream = TH2D((
"upstream"+name).c_str(), (
"Upstream;cartoon x;cartoon y;"+zTitle).c_str(), binLimit, 0, binLimit, binLimit, 0, binLimit);
46 fDownstream = TH2D((
"downstream"+name).c_str(), (
"Downstream;cartoon x;cartoon y;"+zTitle).c_str(), binLimit, 0, binLimit, binLimit, 0, binLimit);
55 std::cout <<
"binLimit is " << binLimit <<
" = 4*" <<
ChannelsPerModule <<
"*2\n";
56 fUpstream = TH2D((
"upstream"+name).c_str(), (
"Upstream;cartoon x;cartoon y;"+zTitle).c_str(), binLimit, 0, binLimit, binLimit, 0, binLimit);
57 fDownstream = TH2D((
"downstream"+name).c_str(), (
"Downstream;cartoon x;cartoon y;"+zTitle).c_str(), binLimit, 0, binLimit, binLimit, 0, binLimit);
80 [&weight](
auto&
hist,
const auto x,
const auto y) {
hist.Fill(
x,
y, weight); });
87 const size_t local = module%16;
88 const int nXBins = hist.GetXaxis()->GetNbins(), nYBins = hist.GetYaxis()->GetNbins(), endOfFrame = 2
l*
ChannelsPerModule*2
l;
90 const bool secondLayer = (channel > 32);
92 std::cout <<
"module is " << module <<
", channel is " << channel <<
", local is " << local <<
".\n";
96 std::cout <<
"Filling beam-left with subtraction at xbin=" << xbin <<
"\n";
97 for(
int ybin = endOfFrame; ybin < nYBins; ++ybin)
100 func(hist, xbin, ybin);
101 func(hist, xbin-1, ybin);
107 std::cout <<
"Filling beam-right with subtraction at xbin=" << xbin <<
"\n";
108 for(
int ybin = endOfFrame; ybin < nYBins; ++ybin)
111 func(hist, xbin, ybin);
112 func(hist, xbin-1, ybin);
115 else if(local > 5 && local < 10)
118 std::cout <<
"Filling at xbin=" << xbin <<
"\n";
119 for(
int ybin = 0; ybin < endOfFrame; ++ybin)
122 func(hist, xbin, ybin);
123 func(hist, xbin+1, ybin);
129 std::cout <<
"Filling at ybin=" << ybin <<
"\n";
130 for(
int xbin = 0; xbin < endOfFrame; ++xbin)
133 func(hist, xbin, ybin);
134 func(hist, xbin, ybin-1);
140 std::cout <<
"Filling at ybin=" << ybin <<
"\n";
141 for(
int xbin = endOfFrame; xbin < nXBins; ++xbin)
144 func(hist, xbin, ybin);
145 func(hist, xbin, ybin+1);
153 [&value](
auto&
hist,
const auto x,
const auto y) {
hist.SetBinContent(
x,
y, value); });
160 gStyle->SetOptStat(0);
void ConfigHistogram(TH2 &hist)
virtual void doFill(const size_t module, const size_t channel, const double weight) override
virtual void doDraw(const char *option) override
static constexpr size_t ChannelsPerModule
static constexpr size_t NModules
void doSomething(TH2 &hist, const size_t channel, const size_t module, FUNC &&func)
SpaceView(const std::string &name="CRTEvd", const std::string &title="CRT Event Display", const std::string &zTitle="Hits")
virtual void doReset(const char *option) override
virtual void doSetValue(const size_t module, const size_t channel, const double value) override