9 #include "TGNumberEntry.h" 13 #include "TPolyMarker.h" 14 #include "TVirtualPadPainter.h" 15 #include "TVirtualX.h" 18 #include "cetlib_except/exception.h" 78 Pad()->SetBit(TPad::kCannotMove);
81 Pad()->SetLeftMargin(0.080);
82 Pad()->SetRightMargin(0.010);
83 Pad()->SetTopMargin(0.010);
84 Pad()->SetBottomMargin(0.10);
95 auto const world = tpc.GetCenter();
96 if (minx > world.X() - tpc.HalfWidth()) minx = world.X() - tpc.HalfWidth();
97 if (maxx < world.X() + tpc.HalfWidth()) maxx = world.X() + tpc.HalfWidth();
98 if (miny > world.Y() - tpc.HalfHeight()) miny = world.Y() - tpc.HalfHeight();
99 if (maxy < world.Y() + tpc.HalfHeight()) maxy = world.Y() + tpc.HalfHeight();
100 if (minz > world.Z() - tpc.Length() / 2.) minz = world.Z() - tpc.Length() / 2.;
101 if (maxz < world.Z() + tpc.Length() / 2.) maxz = world.Z() + tpc.Length() / 2.;
105 TPCBox.push_back(TBox(world.X() - tpc.HalfWidth(),
106 world.Y() - tpc.HalfHeight(),
107 world.X() + tpc.HalfWidth(),
108 world.Y() + tpc.HalfHeight()));
111 TPCBox.push_back(TBox(world.Z() - tpc.Length() / 2.,
112 world.X() - tpc.HalfWidth(),
113 world.Z() + tpc.Length() / 2.,
114 world.X() + tpc.HalfWidth()));
117 TPCBox.push_back(TBox(world.Z() - tpc.Length() / 2.,
118 world.Y() - tpc.HalfHeight(),
119 world.Z() + tpc.Length() / 2.,
120 world.Y() + tpc.HalfHeight()));
124 << __func__ <<
": unwknow projection " << ((int)proj) <<
"\n";
126 TPCBox.back().SetFillStyle(0);
127 TPCBox.back().SetLineStyle(2);
128 TPCBox.back().SetLineWidth(2);
129 TPCBox.back().SetLineColor(16);
153 << __func__ <<
": unwknow projection " << ((int)proj) <<
"\n";
159 fHisto->SetBit(kCannotPick);
160 fHisto->SetBit(TPad::kCannotMove);
161 fHisto->SetTitleOffset(1.,
"Y");
162 fHisto->SetTitleOffset(1.,
"X");
163 fHisto->GetXaxis()->SetLabelSize(0.04);
164 fHisto->GetXaxis()->SetTitleSize(0.04);
167 fHisto->GetXaxis()->SetTitle(
"x (cm)");
168 fHisto->GetYaxis()->SetTitle(
"y (cm)");
171 fHisto->GetXaxis()->SetTitle(
"z (cm)");
172 fHisto->GetYaxis()->SetTitle(
"x (cm)");
175 fHisto->GetXaxis()->SetTitle(
"z (cm)");
176 fHisto->GetYaxis()->SetTitle(
"y (cm)");
180 << __func__ <<
": unexpected flow (projection: " << ((int)proj) <<
")\n";
183 fHisto->GetXaxis()->CenterTitle();
184 fHisto->GetYaxis()->SetLabelSize(0.04);
185 fHisto->GetYaxis()->SetTitleSize(0.04);
186 fHisto->GetYaxis()->CenterTitle();
193 Pad()->SetFillColor(18);
194 Pad()->SetFrameFillColor(18);
195 Pad()->GetPainter()->SetFillColor(18);
201 std::ostringstream ostr;
202 ostr <<
"evd::Ortho3DPad::MouseEvent((evd::Ortho3DPad*)" <<
this <<
")";
203 fPad->AddExec(
"getmousezoom", ostr.str().c_str());
238 auto const&
evt = *evtPtr;
254 fPad->GetPainter()->SetFillColor(18);
258 latex.SetTextColor(16);
259 latex.SetTextSize(0.05);
260 for (
size_t i = 0; i <
TPCBox.size(); ++i) {
264 for (
size_t j = 0; j < i; ++j) {
270 latex.DrawLatex(x1, y1, Form(
"%lu", i));
282 fHisto->GetXaxis()->SetRangeUser(xlo, xhi);
283 fHisto->GetYaxis()->SetRangeUser(ylo, yhi);
317 if (
fMSize != size / 4.) {
330 TIter next(
fPad->GetListOfPrimitives());
331 while (TObject* obj = next()) {
332 if (obj->InheritsFrom(TPolyMarker::Class())) {
333 TPolyMarker* pm = (TPolyMarker*)obj;
334 pm->SetMarkerSize(
fMSize);
382 TObject* select = gPad->GetSelected();
384 if (!select->InheritsFrom(
"TBox"))
return;
385 ((TBox*)select)->SetBit(TBox::kCannotMove);
402 int event = gPad->GetEvent();
403 int px = gPad->GetEventX();
404 int py = gPad->GetEventY();
405 double x = gPad->AbsPixeltoX(px);
406 double y = gPad->AbsPixeltoY(py);
415 gPad->SetCursor(kCross);
425 gPad->SetCursor(kCross);
472 gPad->SetCursor(kCross);
483 gVirtualX->DrawBox(pxlo, pylo, pxhi, pyhi, TVirtualX::kHollow);
489 gVirtualX->SetLineColor(-1);
490 gVirtualX->SetLineStyle(0);
491 gVirtualX->SetLineWidth(1);
496 gPad->SetCursor(kCross);
513 gPad->SetCursor(kCross);
524 SetZoom(xlo, ylo, xhi, yhi,
true);
void SpacePointOrtho(const art::Event &evt, evd::OrthoProj_t proj, double msize, evdb::View2D *view)
details::range_type< T > Iterate() const
Initializes the specified ID with the ID of the first cryostat.
void SetZoom(double xlo, double ylo, double xhi, double yhi, bool update)
void PFParticleOrtho(const art::Event &evt, evd::OrthoProj_t proj, double msize, evdb::View2D *view)
int fPressPy
Poxel location where button 1 was pressed.
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.
constexpr auto abs(T v)
Returns the absolute value of the argument.
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]
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
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()
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.
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.
TPad * fPad
The ROOT graphics pad.
void OpFlashOrtho(const art::Event &evt, detinfo::DetectorClocksData const &clockData, detinfo::DetectorPropertiesData const &detProp, evd::OrthoProj_t proj, evdb::View2D *view)
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.
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.
The data type to uniquely identify a cryostat.