Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

evd::TQPad Class Reference

#include <TQPad.h>

Inheritance diagram for evd::TQPad:

evd::DrawingPad List of all members.

Public Member Functions

 TQPad (const char *nm, const char *ti, double x1, double y1, double x2, double y2, const char *opt)
 ~TQPad ()
void Draw ()

Private Attributes

int fRawOrCalib
 Show raw data or calibrated hits.
int fWhich
 Which value from recobase::CellHit_t?
TH1F * fHisto
 1-D Histogram of time or charge
evdb::View2DfView
 Superimpose scale on 1D histo.

Constructor & Destructor Documentation

TQPad::TQPad const char *  nm,
const char *  ti,
double  x1,
double  y1,
double  x2,
double  y2,
const char *  opt
 

Definition at line 24 of file TQPad.cxx.

References fHisto, fRawOrCalib, fView, fWhich, and evd::DrawingPad::Pad().

00027                               :
00028   DrawingPad(nm, ti, x1, y1, x2, y2)
00029 {
00030   this->Pad()->cd();
00031   std::string opts(opt);
00032   // Sort through the options and book the histogram. Each option
00033   // implies its own histogram label and axis ranges
00034   if (opts=="rawt") {
00035     fRawOrCalib = kRAW;
00036     fWhich      = kTNS;
00037     fHisto = new TH1F("fRAWTHisto",";t [TDC];hits",100,0.0,1000.0);
00038   }
00039   if (opts=="rawq") {
00040     fRawOrCalib = kRAW;
00041     fWhich      = kPE;
00042     fHisto      = new TH1F("fRAWQHisto",";q [ADC];hits",100,0.0,2000.0);
00043   }
00044   
00045   // Fill in the blanks below eventually....
00046   if (opts=="caladc") {}
00047   if (opts=="calpe") {}
00048   if (opts=="calpeac") {}
00049   if (opts=="calmip") {}
00050   if (opts=="caltns") {}
00051   if (opts=="caltt0") {}
00052   if (opts=="calttrans") {}
00053 
00054   fHisto->SetLabelSize  (0.07,"X");
00055   fHisto->SetLabelOffset(0.00,"X");
00056   fHisto->SetTitleSize  (0.10,"X");
00057   fHisto->SetTitleOffset(0.50,"X");
00058 
00059   fHisto->SetLabelSize  (0.07,"Y");
00060   fHisto->SetLabelOffset(0.01,"Y");
00061   fHisto->SetTitleSize  (0.10,"Y");
00062   fHisto->SetTitleOffset(0.30,"Y");
00063   fView = new evdb::View2D();
00064 }

TQPad::~TQPad  ) 
 

Definition at line 68 of file TQPad.cxx.

References fHisto, and fView.

00069 {
00070   if (fView)  { delete fView;  fView  = 0; }
00071   if (fHisto) { delete fHisto; fHisto = 0; }
00072 }


Member Function Documentation

void TQPad::Draw  ) 
 

Definition at line 76 of file TQPad.cxx.

References evdb::View2D::AddBox(), evdb::View2D::Draw(), fHisto, evd::RawDataDrawer::FillTQHisto(), fRawOrCalib, fView, fWhich, evd::ColorScale::GetColor(), kRAW, evd::DrawingPad::RawDataDraw(), evd::ColorScaleTable::RawQ(), and evd::ColorScaleTable::RawT().

Referenced by evd::XZYZProjectionsView::Draw(), and evd::XZYZProjectionsView::XZYZProjectionsView().

00077 {
00078   fHisto->Reset();
00079   if (fRawOrCalib == kRAW) {
00080     if (fWhich == kTNS) {
00081       this->RawDataDraw()->FillTQHisto(this->EventHandle(),
00082                                        "./",
00083                                        fHisto,
00084                                        0);
00085     }
00086     if (fWhich == kPE) {
00087       this->RawDataDraw()->FillTQHisto(this->EventHandle(),
00088                                        "./",
00089                                        0,
00090                                        fHisto);
00091     }
00092   }
00093   // Eventually handle cell hits here...
00094 
00095   // Draw the histograms. Eventually it would be cool to show the time
00096   // and charge scales used on the rest of the display (eg. on the
00097   // X-Z/Y-Z projections)
00098   fPad->cd();
00099   fHisto->Draw();
00100 
00101   // Use this to fill the histogram with colors from the color scale
00102   // Currently only works for time histogram
00103   int fColorShowsTime   = 1;
00104   int fColorShowsCharge = 0;
00105   for (int i=1; i<=fHisto->GetNbinsX(); ++i) {
00106     double x1, x2, y1, y2;
00107     x1 = fHisto->GetBinLowEdge(i);
00108     x2 = x1 + fHisto->GetBinWidth(i);
00109     y1 = 0.0;
00110     y2 = fHisto->GetBinContent(i);
00111     if (y2==y1) y2 += 0.25;
00112     if (y2>y1) {
00113       int c=1;
00114       if (fColorShowsTime && fRawOrCalib==kRAW && fWhich==kTNS) {
00115         c = ColorScaleTable::RawT().GetColor(0.5*(x1+x2));
00116         TBox& b = fView->AddBox(x1,y1,x2,y2);
00117         b.SetFillStyle(1001);
00118         b.SetFillColor(c);      
00119         b.Draw();
00120       }
00121       if (fColorShowsCharge &&fRawOrCalib==kRAW && fWhich==kPE) {
00122         c = ColorScaleTable::RawQ().GetColor(0.5*(x1+x2));
00123         TBox& b = fView->AddBox(x1,y1,x2,y2);
00124         b.SetFillStyle(1001);
00125         b.SetFillColor(c);      
00126         b.Draw();
00127       }
00128     }
00129   }
00130   fHisto->Draw("same");
00131 }


Member Data Documentation

TH1F* evd::TQPad::fHisto [private]
 

1-D Histogram of time or charge

Definition at line 25 of file TQPad.h.

Referenced by Draw(), TQPad(), and ~TQPad().

int evd::TQPad::fRawOrCalib [private]
 

Show raw data or calibrated hits.

Definition at line 23 of file TQPad.h.

Referenced by Draw(), and TQPad().

evdb::View2D* evd::TQPad::fView [private]
 

Superimpose scale on 1D histo.

Definition at line 26 of file TQPad.h.

Referenced by Draw(), TQPad(), and ~TQPad().

int evd::TQPad::fWhich [private]
 

Which value from recobase::CellHit_t?

Definition at line 24 of file TQPad.h.

Referenced by Draw(), and TQPad().


The documentation for this class was generated from the following files:
Generated on Mon Nov 23 04:45:31 2009 for NOvA Offline by  doxygen 1.3.9.1