12 #include "TPolyLine.h" 15 #include "cetlib_except/exception.h" 39 static const int kQ = 0;
40 static const int kTQ = 1;
58 unsigned int planes = geo->
Nplanes();
62 this->
Pad()->SetLeftMargin (0.050);
63 this->
Pad()->SetRightMargin (0.050);
65 this->
Pad()->SetTopMargin (0.005);
66 this->
Pad()->SetBottomMargin(0.110);
70 if(planes == 2 &&
fPlane > 0){
71 this->
Pad()->SetTopMargin (0.110);
72 this->
Pad()->SetBottomMargin(0.010);
76 this->
Pad()->SetTopMargin (0.005);
77 this->
Pad()->SetBottomMargin(0.010);
80 this->
Pad()->SetTopMargin (0.110);
81 this->
Pad()->SetBottomMargin(0.010);
86 std::string opts(opt);
90 this->
Pad()->SetTopMargin (0);
91 this->
Pad()->SetBottomMargin(0.2);
130 std::vector<double> htau1;
131 std::vector<double> htau2;
132 std::vector<double> hamplitudes;
133 std::vector<double> hpeaktimes;
134 std::vector<int> hstartT;
135 std::vector<int> hendT;
136 std::vector<int> hNMultiHit;
162 static const std::string defaultDrawOptions =
"HIST";
166 fRawHisto->Draw(defaultDrawOptions.c_str());
174 fRawHisto->Draw(defaultDrawOptions.c_str());
175 fRecoHisto->Draw((defaultDrawOptions +
" same").c_str());
182 if( (i==0 && hNMultiHit[i]>1) || (i>0 && hNMultiHit[i]>1 && hstartT[i] != hstartT[i-1]) )
188 for(
int j = 0; j<1001; ++j)
190 double x = hstartT[i]+j*(hendT[i]-hstartT[i])/1000;
192 p2.SetPoint(j, x, y);
203 for(
int j = 0; j<1001; ++j){
204 double x = hstartT[i]+j*(hendT[i]-hstartT[i])/1000;
206 p1.SetPoint(j, x, y);
214 fRawHisto->Draw((defaultDrawOptions +
" same").c_str());
215 fRecoHisto->Draw((defaultDrawOptions +
" same").c_str());
247 std::vector<double> hstart;
248 std::vector<double> hend;
249 std::vector<double> hamplitudes;
250 std::vector<double> hpeaktimes;
270 static const std::string defaultDrawOptions =
"HIST";
274 fRawHisto->Draw(defaultDrawOptions.c_str());
282 fRawHisto->Draw(defaultDrawOptions.c_str());
283 fRecoHisto->Draw((defaultDrawOptions +
" same").c_str());
290 for(
const auto& roiHitParamsVec : hitParamsVec)
292 double roiStart = roiHitParamsVec.front().hitStart;
293 double roiStop = roiHitParamsVec.back().hitEnd;
294 double width = roiStop - roiStart;
296 std::string funcString =
"gaus(0)";
298 for(
size_t idx = 1; idx < roiHitParamsVec.size(); idx++) funcString +=
"+gaus(" +
std::to_string(3*idx) +
")";
300 TF1
f1(
"hitshape",funcString.c_str(),roiStart,roiStop);
303 for(
const auto& hitParams : roiHitParamsVec)
305 f1.SetParameter(idx + 0, hitParams.hitHeight);
306 f1.SetParameter(idx + 1, hitParams.hitCenter);
307 f1.SetParameter(idx + 2, hitParams.hitSigma);
311 hitHeight.SetPoint(0, hitParams.hitCenter, 0.);
312 hitHeight.SetPoint(1, hitParams.hitCenter, hitParams.hitHeight);
314 hitHeight.Draw(
"same");
318 hitSigma.SetPoint(0, hitParams.hitCenter - hitParams.hitSigma, 0.6 * hitParams.hitHeight);
319 hitSigma.SetPoint(1, hitParams.hitCenter + hitParams.hitSigma, 0.6 * hitParams.hitHeight);
321 hitSigma.Draw(
"same");
330 for(
int j = 0; j<1001; ++j)
332 double x = roiStart + j*width/1000;
333 double y =
f1.Eval(x);
334 p1.SetPoint(j, x, y);
354 fRawHisto->Draw((defaultDrawOptions +
" same").c_str());
355 fRecoHisto->Draw((defaultDrawOptions +
" same").c_str());
378 hist->SetMinimum(cst->
fRawQLow [(
size_t)sigType]);
379 hist->SetMaximum(cst->
fRawQHigh[(
size_t)sigType]);
380 ndiv = cst->
fRawDiv[(size_t)sigType];
384 hist->SetMinimum(cst->
fRecoQLow [(
size_t)sigType]);
385 hist->SetMaximum(cst->
fRecoQHigh[(
size_t)sigType]);
386 ndiv = cst->
fRecoDiv[(size_t)sigType];
389 hist->SetLabelSize(0,
"X");
390 hist->SetLabelSize(0,
"Y");
391 hist->SetTickLength(0,
"X");
392 hist->SetTickLength(0,
"Y");
402 for(
int i = 0; i < ndiv; ++i){
403 y1 = hist->GetMinimum() + i*(hist->GetMaximum()-hist->GetMinimum())/(1.*ndiv);
404 y2 = hist->GetMinimum() + (i + 1)*(hist->GetMaximum()-hist->GetMinimum())/(1.*ndiv);
415 b.SetFillStyle(1001);
454 double qxloraw = cst->
fRawQLow[(size_t)sigType];
455 double qxhiraw = cst->
fRawQHigh[(size_t)sigType];
456 double qxloreco = cst->
fRecoQLow[(size_t)sigType];
457 double qxhireco = cst->
fRecoQHigh[(size_t)sigType];
463 fRawHisto =
new TH1F(
"fRAWQHisto",
";;", 2,0.,1.);
467 fRecoHisto =
new TH1F(
"fCALQHisto",
";;", 1,0.,1.);
472 fRawHisto =
new TH1F(
"fRAWTQHisto",
";t [ticks];q [ADC]", (
int)tqxhi,tqxlo,tqxhi+tqxlo);
473 fRecoHisto =
new TH1F(
"fCALTQHisto",
";t [ticks];q [ADC]", (
int)tqxhi,tqxlo,tqxhi+tqxlo);
477 throw cet::exception(
"TQPad") << __func__ <<
": unexpected quantity #" <<
fTQ <<
"\n";
void FillTQHistoDP(const art::Event &evt, unsigned int plane, unsigned int wire, TH1F *histo, std::vector< double > &htau1, std::vector< double > &htau2, std::vector< double > &hitamplitudes, std::vector< double > &hpeaktimes, std::vector< int > &hstartT, std::vector< int > &hendT, std::vector< int > &hNMultiHit)
const art::Event * GetEvent() const
std::vector< double > fRawQLow
low edge of ADC values for drawing raw digits
unsigned int fPlane
Which plane in the detector.
void FillTQHisto(const art::Event &evt, unsigned int plane, unsigned int wire, TH1F *histo)
Encapsulate the construction of a single cyostat.
Float_t y1[n_points_granero]
TPolyLine & AddPolyLine(int n, int c, int w, int s)
std::vector< int > fRawDiv
number of divisions in raw
int fDrawRawDataOrCalibWires
0 for raw
Float_t x1[n_points_granero]
Declaration of signal hit object.
void FillTQHisto(const art::Event &evt, unsigned int plane, unsigned int wire, TH1F *histo, HitParamsVec &hitParamsVec)
The data type to uniquely identify a Plane.
Drawing pad for time or charge histograms.
static std::unique_ptr< FVectorReader > create(const art::Event &evt, const art::InputTag &tag)
A collection of drawable 2-D objects.
int GetColor(double x) const
std::vector< ROIHitParamsVec > HitParamsVec
Singleton to hold the current art::Event for the event display.
static const int kRAWCALIB
std::vector< double > fRecoQHigh
high edge of ADC values for drawing raw digits
Float_t y2[n_points_geant4]
std::vector< double > fRecoQLow
low edge of ADC values for drawing raw digits
The color scales used by the event display.
evdb::View2D * fView
Superimpose scale on 1D histo.
TBox & AddBox(double x1, double y1, double x2, double y2)
unsigned int Nplanes(unsigned int tpc=0, unsigned int cstat=0) const
Returns the total number of wire planes in the specified TPC.
RawDataDrawer * RawDataDraw()
const evdb::ColorScale & RawQ(geo::SigType_t st) const
enum geo::_plane_sigtype SigType_t
Enumerate the possible plane projections.
static EventHolder * Instance()
const evdb::ColorScale & CalQ(geo::SigType_t st) const
Base class for event display drawing pads.
RecoBaseDrawer * RecoBaseDraw()
TH1F * fRawHisto
1-D Histogram of charge or charge vs time
geo::TPCID CurrentTPC() const
Returns the current TPC as a TPCID.
double TotalClockTicks() const
Class to aid in the rendering of RecoBase objects.
Class to aid in the rendering of RawData objects.
double EvalExpoFit(double x, double tau1, double tau2, double amplitude, double peaktime)
std::vector< double > fRawQHigh
high edge of ADC values for drawing raw digits
int fTQ
0 = plot shows charge only, 1 = plot shows charge vs time for a wire
std::string to_string(Flag_t< Storage > const flag)
Convert a flag into a stream (shows its index).
Encapsulate the construction of a single detector plane.
double EvalMultiExpoFit(double x, int HitNumber, int NHits, std::vector< double > tau1, std::vector< double > tau2, std::vector< double > amplitude, std::vector< double > peaktime)
TPad * fPad
The ROOT graphics pad.
std::vector< int > fRecoDiv
number of divisions in raw
Float_t x2[n_points_geant4]
Namespace collecting geometry-related classes utilities.
TQPad(const char *nm, const char *ti, double x1, double y1, double x2, double y2, const char *opt, unsigned int plane, unsigned int wire)
art framework interface to geometry description
cet::coded_exception< error, detail::translate > exception
Encapsulate the construction of a single detector plane.
TH1F * fRecoHisto
1-D Histogram of charge or charge vs time