12 #include "nuevdb/EventDisplayBase/View3D.h"
14 #include "art/Framework/Principal/Event.h"
15 #include "art/Framework/Services/Registry/ServiceHandle.h"
16 #include "art/Utilities/ToolMacros.h"
18 #include "TPolyLine3D.h"
33 void Draw(
const art::Event&, evdb::View3D*)
const override;
36 void DrawRectangularBox(evdb::View3D*,
const Eigen::Vector3f&,
const Eigen::Vector3f&,
int,
int,
int)
const;
52 art::ServiceHandle<evd::RecoDrawingOptions> recoOpt;
54 if (recoOpt->fDrawOpHits == 0)
return;
57 art::ServiceHandle<geo::Geometry> geo;
58 art::ServiceHandle<evd::ColorDrawingOptions> cst;
60 art::Handle<std::vector<recob::OpHit>> opHitHandle;
63 std::vector<float> opHitPEVec;
67 for(
size_t idx = 0; idx < recoOpt->fOpHitLabels.size(); idx++)
69 art::InputTag opHitProducer = recoOpt->fOpHitLabels[idx];
71 event.getByLabel(opHitProducer, opHitHandle);
73 if (!opHitHandle.isValid() )
continue;
74 if ( opHitHandle->size() == 0)
continue;
77 for(
const auto& opHit : *opHitHandle)
80 if (opHit.PE() < recoOpt->fFlashMinPE)
continue;
81 if (opHit.PeakTime() < recoOpt->fFlashTMin)
continue;
82 if (opHit.PeakTime() > recoOpt->fFlashTMax)
continue;
84 opHitPEVec.push_back(opHit.PE());
89 if (!opHitPEVec.empty())
92 std::sort(opHitPEVec.begin(),opHitPEVec.end());
94 float minTotalPE = opHitPEVec.front();
95 float maxTotalPE = opHitPEVec[0.9 * opHitPEVec.size()];
101 for(
size_t idx = 0; idx < recoOpt->fOpHitLabels.size(); idx++)
103 art::InputTag opHitProducer = recoOpt->fOpHitLabels[idx];
105 event.getByLabel(opHitProducer, opHitHandle);
107 if (!opHitHandle.isValid() )
continue;
108 if ( opHitHandle->size() == 0)
continue;
111 for(
const auto& opHit : *opHitHandle)
114 if (opHit.PE() < recoOpt->fFlashMinPE)
continue;
115 if (opHit.PeakTime() < recoOpt->fFlashTMin)
continue;
116 if (opHit.PeakTime() > recoOpt->fFlashTMax)
continue;
118 unsigned int opChannel = opHit.OpChannel();
119 const geo::OpDetGeo& opHitGeo = geo->OpDetGeoFromOpChannel(opChannel);
121 float xWidth = opHit.Width();
122 float zWidth = opHitGeo.
HalfW();
123 float yWidth = opHitGeo.
HalfH();
125 Eigen::Vector3f opHitLo(opHitPos.X() - xWidth, opHitPos.Y() - yWidth, opHitPos.Z() - zWidth);
126 Eigen::Vector3f opHitHi(opHitPos.X() + xWidth, opHitPos.Y() + yWidth, opHitPos.Z() + zWidth);
128 float peFactor = cst->fRecoQLow[
geo::kCollection] + opHitPEScale * std::min(maxTotalPE,
float(opHit.PE()));
142 TPolyLine3D&
top = view->AddPolyLine3D(5, color, width, style);
143 top.SetPoint(0, coordsLo[0], coordsHi[1], coordsLo[2]);
144 top.SetPoint(1, coordsHi[0], coordsHi[1], coordsLo[2]);
145 top.SetPoint(2, coordsHi[0], coordsHi[1], coordsHi[2]);
146 top.SetPoint(3, coordsLo[0], coordsHi[1], coordsHi[2]);
147 top.SetPoint(4, coordsLo[0], coordsHi[1], coordsLo[2]);
149 TPolyLine3D& side = view->AddPolyLine3D(5, color, width, style);
150 side.SetPoint(0, coordsHi[0], coordsHi[1], coordsLo[2]);
151 side.SetPoint(1, coordsHi[0], coordsLo[1], coordsLo[2]);
152 side.SetPoint(2, coordsHi[0], coordsLo[1], coordsHi[2]);
153 side.SetPoint(3, coordsHi[0], coordsHi[1], coordsHi[2]);
154 side.SetPoint(4, coordsHi[0], coordsHi[1], coordsLo[2]);
156 TPolyLine3D& side2 = view->AddPolyLine3D(5, color, width, style);
157 side2.SetPoint(0, coordsLo[0], coordsHi[1], coordsLo[2]);
158 side2.SetPoint(1, coordsLo[0], coordsLo[1], coordsLo[2]);
159 side2.SetPoint(2, coordsLo[0], coordsLo[1], coordsHi[2]);
160 side2.SetPoint(3, coordsLo[0], coordsHi[1], coordsHi[2]);
161 side2.SetPoint(4, coordsLo[0], coordsHi[1], coordsLo[2]);
163 TPolyLine3D&
bottom = view->AddPolyLine3D(5, color, width, style);
164 bottom.SetPoint(0, coordsLo[0], coordsLo[1], coordsLo[2]);
165 bottom.SetPoint(1, coordsHi[0], coordsLo[1], coordsLo[2]);
166 bottom.SetPoint(2, coordsHi[0], coordsLo[1], coordsHi[2]);
167 bottom.SetPoint(3, coordsLo[0], coordsLo[1], coordsHi[2]);
168 bottom.SetPoint(4, coordsLo[0], coordsLo[1], coordsLo[2]);
void GetCenter(double *xyz, double localz=0.0) const
The color scales used by the event display.
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
art framework interface to geometry description
Signal from collection planes.