10 #include "TPadPainter.h" 13 #include "TPolyMarker.h" 14 #include "TGNumberEntry.h" 17 #include "cetlib_except/exception.h" 45 double x2,
double y2) :
73 Pad()->SetBit(TPad::kCannotMove);
76 Pad()->SetLeftMargin (0.080);
77 Pad()->SetRightMargin (0.010);
78 Pad()->SetTopMargin (0.010);
79 Pad()->SetBottomMargin (0.10);
89 for (
size_t i = 0; i<geo->
NTPC(); ++i){
90 double local[3] = {0.,0.,0.};
91 double world[3] = {0.,0.,0.};
128 << __func__ <<
": unwknow projection " << ((int) proj) <<
"\n";
130 TPCBox.back().SetFillStyle(0);
131 TPCBox.back().SetLineStyle(2);
132 TPCBox.back().SetLineWidth(2);
133 TPCBox.back().SetLineColor(16);
157 << __func__ <<
": unwknow projection " << ((int) proj) <<
"\n";
163 fHisto->SetBit(kCannotPick);
164 fHisto->SetBit(TPad::kCannotMove);
165 fHisto->SetTitleOffset(1.,
"Y");
166 fHisto->SetTitleOffset(1.,
"X");
167 fHisto->GetXaxis()->SetLabelSize(0.04);
168 fHisto->GetXaxis()->SetTitleSize(0.04);
171 fHisto->GetXaxis()->SetTitle(
"x (cm)");
172 fHisto->GetYaxis()->SetTitle(
"y (cm)");
175 fHisto->GetXaxis()->SetTitle(
"z (cm)");
176 fHisto->GetYaxis()->SetTitle(
"x (cm)");
179 fHisto->GetXaxis()->SetTitle(
"z (cm)");
180 fHisto->GetYaxis()->SetTitle(
"y (cm)");
184 << __func__ <<
": unexpected flow (projection: " << ((int) proj) <<
")\n";
187 fHisto->GetXaxis()->CenterTitle();
188 fHisto->GetYaxis()->SetLabelSize(0.04);
189 fHisto->GetYaxis()->SetTitleSize(0.04);
190 fHisto->GetYaxis()->CenterTitle();
197 Pad()->SetFillColor(18);
198 Pad()->SetFrameFillColor(18);
199 Pad()->GetPainter()->SetFillColor(18);
205 std::ostringstream ostr;
206 ostr <<
"evd::Ortho3DPad::MouseEvent((evd::Ortho3DPad*)" <<
this <<
")";
207 fPad->AddExec(
"getmousezoom", ostr.str().c_str());
250 fPad->GetPainter()->SetFillColor(18);
254 latex.SetTextColor(16);
255 latex.SetTextSize(0.05);
256 for (
size_t i = 0; i<
TPCBox.size(); ++i){
260 for (
size_t j = 0; j<i; ++j){
266 latex.DrawLatex(x1,y1,Form(
"%lu",i));
277 double xhi,
double yhi,
280 fHisto->GetXaxis()->SetRangeUser(xlo, xhi);
281 fHisto->GetYaxis()->SetRangeUser(ylo, yhi);
329 TIter next(
fPad->GetListOfPrimitives());
330 while(TObject* obj = next()) {
331 if(obj->InheritsFrom(TPolyMarker::Class())) {
332 TPolyMarker* pm = (TPolyMarker*)obj;
333 pm->SetMarkerSize(
fMSize);
368 throw cet::exception(
"Ortho3DPad") << __func__ <<
": no MSize entry\n";
383 TObject *select = gPad->GetSelected();
386 if(!select->InheritsFrom(
"TBox"))
388 ((TBox*)select)->SetBit(TBox::kCannotMove);
406 int event = gPad->GetEvent();
407 int px = gPad->GetEventX();
408 int py = gPad->GetEventY();
409 double x = gPad->AbsPixeltoX(px);
410 double y = gPad->AbsPixeltoY(py);
419 gPad->SetCursor(kCross);
429 gPad->SetCursor(kCross);
476 gPad->SetCursor(kCross);
487 gVirtualX->DrawBox(pxlo, pylo, pxhi, pyhi, TVirtualX::kHollow);
493 gVirtualX->SetLineColor(-1);
494 gVirtualX->SetLineStyle(0);
495 gVirtualX->SetLineWidth(1);
500 gPad->SetCursor(kCross);
517 gPad->SetCursor(kCross);
528 SetZoom(xlo, ylo, xhi, yhi,
true);
void OpFlashOrtho(const art::Event &evt, evd::OrthoProj_t proj, evdb::View2D *view)
void SpacePointOrtho(const art::Event &evt, evd::OrthoProj_t proj, double msize, evdb::View2D *view)
void SetZoom(double xlo, double ylo, double xhi, double yhi, bool update)
const art::Event * GetEvent() const
void PFParticleOrtho(const art::Event &evt, evd::OrthoProj_t proj, double msize, evdb::View2D *view)
int fPressPy
Poxel location where button 1 was pressed.
geo::Length_t DetHalfWidth(geo::TPCID const &tpcid) const
Returns the half width of the active volume of the specified TPC.
Float_t y1[n_points_granero]
double fReleaseX
User location where button 1 was released.
void SetMarkerSize(double size, bool update)
Float_t x1[n_points_granero]
void SetMSizeEntry(TGNumberEntry *p)
void SeedOrtho(const art::Event &evt, evd::OrthoProj_t proj, evdb::View2D *view)
Geometry information for a single TPC.
void ProngOrtho(const art::Event &evt, evd::OrthoProj_t proj, double msize, evdb::View2D *view)
A drawing pad showing an orthographic rendering of 3D objects.
int fCurrentPy
Current pixel location of mouse.
A collection of drawable 2-D objects.
int fPressPx
Pixel location where button 1 was pressed.
Singleton to hold the current art::Event for the event display.
Float_t y2[n_points_geant4]
geo::Length_t DetHalfHeight(geo::TPCID const &tpcid) const
Returns the half height of the active volume of the specified TPC.
double fReleaseY
User location where button 1 was released.
evd::OrthoProj_t fProj
Projection.
static EventHolder * Instance()
bool fBoxDrawn
Is selection box drawn?
Base class for event display drawing pads.
RecoBaseDrawer * RecoBaseDraw()
geo::Length_t DetLength(geo::TPCID const &tpcid) const
Returns the length of the active volume of the specified TPC.
SimulationDrawer * SimulationDraw()
Drawing pad showing an orthographic projection of 3D objects in the detector.
Ortho3DPad(const char *nm, const char *ti, evd::OrthoProj_t proj, double x1, double y1, double x2, double y2)
Class to aid in the rendering of RecoBase objects.
double fPressX
User location where button 1 was pressed.
double fPressY
User location where button 1 was pressed.
int fCurrentPx
Current pixel location of mouse.
unsigned int NTPC(unsigned int cstat=0) const
Returns the total number of TPCs in the specified cryostat.
std::vector< TBox > TPCBox
TPC box.
Render the objects from the Simulation package.
void MCTruthOrtho(const art::Event &evt, evd::OrthoProj_t proj, double msize, evdb::View2D *view)
TH1F * fHisto
Enclosing histogram.
TPCGeo const & TPC(unsigned int const tpc=0, unsigned int const cstat=0) const
Returns the specified TPC.
TPad * fPad
The ROOT graphics pad.
bool fPress
Is button 1 pressed?
Float_t x2[n_points_geant4]
static void MouseEvent(evd::Ortho3DPad *p)
Namespace collecting geometry-related classes utilities.
static Ortho3DPad * fMousePad
Selected pad for mouse action.
TGNumberEntry * fMSizeEntry
For changing marker size.
void LocalToWorld(const double *tpc, double *world) const
Transform point from local TPC frame to world frame.
evdb::View2D * fView
Collection of graphics objects to render.
art framework interface to geometry description
void Draw(const char *opt=0)
void VertexOrtho(const art::PtrVector< recob::Vertex > &vertex, evd::OrthoProj_t proj, evdb::View2D *view, int marker)
double fMSize
Marker size.
cet::coded_exception< error, detail::translate > exception
Event finding and building.
Encapsulate the construction of a single detector plane.