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;
137 std::vector<int> hLocalHitIndex;
164 static const std::string defaultDrawOptions =
"HIST";
168 fRawHisto->Draw(defaultDrawOptions.c_str());
176 fRawHisto->Draw(defaultDrawOptions.c_str());
177 fRecoHisto->Draw((defaultDrawOptions +
" same").c_str());
184 if( hNMultiHit[i] > 1 && hLocalHitIndex[i] == 0)
190 for(
int j = 0; j<1001; ++j)
192 double x = hstartT[i]+j*(hendT[i+hNMultiHit[i]-1]-hstartT[i])/1000;
194 p2.SetPoint(j, x, y);
205 for(
int j = 0; j<1001; ++j){
206 double x = hstartT[i-hLocalHitIndex[i]]+j*(hendT[i+hNMultiHit[i]-hLocalHitIndex[i]-1]-hstartT[i-hLocalHitIndex[i]])/1000;
208 p1.SetPoint(j, x, y);
216 fRawHisto->Draw((defaultDrawOptions +
" same").c_str());
217 fRecoHisto->Draw((defaultDrawOptions +
" same").c_str());
249 std::vector<double> hstart;
250 std::vector<double> hend;
251 std::vector<double> hamplitudes;
252 std::vector<double> hpeaktimes;
272 static const std::string defaultDrawOptions =
"HIST";
276 fRawHisto->Draw(defaultDrawOptions.c_str());
284 fRawHisto->Draw(defaultDrawOptions.c_str());
285 fRecoHisto->Draw((defaultDrawOptions +
" same").c_str());
292 for(
const auto& roiHitParamsVec : hitParamsVec)
294 double roiStart = roiHitParamsVec.front().hitStart;
295 double roiStop = roiHitParamsVec.back().hitEnd;
296 double width = roiStop - roiStart;
298 std::string funcString =
"gaus(0)";
300 for(
size_t idx = 1; idx < roiHitParamsVec.size(); idx++) funcString +=
"+gaus(" +
std::to_string(3*idx) +
")";
302 TF1
f1(
"hitshape",funcString.c_str(),roiStart,roiStop);
305 for(
const auto& hitParams : roiHitParamsVec)
307 f1.SetParameter(idx + 0, hitParams.hitHeight);
308 f1.SetParameter(idx + 1, hitParams.hitCenter);
309 f1.SetParameter(idx + 2, hitParams.hitSigma);
313 hitHeight.SetPoint(0, hitParams.hitCenter, 0.);
314 hitHeight.SetPoint(1, hitParams.hitCenter, hitParams.hitHeight);
316 hitHeight.Draw(
"same");
320 hitSigma.SetPoint(0, hitParams.hitCenter - hitParams.hitSigma, 0.6 * hitParams.hitHeight);
321 hitSigma.SetPoint(1, hitParams.hitCenter + hitParams.hitSigma, 0.6 * hitParams.hitHeight);
323 hitSigma.Draw(
"same");
332 for(
int j = 0; j<1001; ++j)
334 double x = roiStart + j*width/1000;
335 double y =
f1.Eval(x);
336 p1.SetPoint(j, x, y);
356 fRawHisto->Draw((defaultDrawOptions +
" same").c_str());
357 fRecoHisto->Draw((defaultDrawOptions +
" same").c_str());
380 hist->SetMinimum(cst->
fRawQLow [(
size_t)sigType]);
381 hist->SetMaximum(cst->
fRawQHigh[(
size_t)sigType]);
382 ndiv = cst->
fRawDiv[(size_t)sigType];
386 hist->SetMinimum(cst->
fRecoQLow [(
size_t)sigType]);
387 hist->SetMaximum(cst->
fRecoQHigh[(
size_t)sigType]);
388 ndiv = cst->
fRecoDiv[(size_t)sigType];
391 hist->SetLabelSize(0,
"X");
392 hist->SetLabelSize(0,
"Y");
393 hist->SetTickLength(0,
"X");
394 hist->SetTickLength(0,
"Y");
404 for(
int i = 0; i < ndiv; ++i){
405 y1 = hist->GetMinimum() + i*(hist->GetMaximum()-hist->GetMinimum())/(1.*ndiv);
406 y2 = hist->GetMinimum() + (i + 1)*(hist->GetMaximum()-hist->GetMinimum())/(1.*ndiv);
417 b.SetFillStyle(1001);
456 double qxloraw = cst->
fRawQLow[(size_t)sigType];
457 double qxhiraw = cst->
fRawQHigh[(size_t)sigType];
458 double qxloreco = cst->
fRecoQLow[(size_t)sigType];
459 double qxhireco = cst->
fRecoQHigh[(size_t)sigType];
465 fRawHisto =
new TH1F(
"fRAWQHisto",
";;", 2,0.,1.);
469 fRecoHisto =
new TH1F(
"fCALQHisto",
";;", 1,0.,1.);
474 fRawHisto =
new TH1F(
"fRAWTQHisto",
";t [ticks];q [ADC]", (
int)tqxhi,tqxlo,tqxhi+tqxlo);
475 fRecoHisto =
new TH1F(
"fCALTQHisto",
";t [ticks];q [ADC]", (
int)tqxhi,tqxlo,tqxhi+tqxlo);
479 throw cet::exception(
"TQPad") << __func__ <<
": unexpected quantity #" <<
fTQ <<
"\n";
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.
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, std::vector< int > &hLocalHitIndex)
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