11 #include "nuevdb/EventDisplayBase/View3D.h"
13 #include "art/Framework/Services/Registry/ServiceHandle.h"
14 #include "art/Utilities/ToolMacros.h"
15 #include "canvas/Persistency/Common/FindManyP.h"
18 #include "TPolyMarker3D.h"
35 const art::FindManyP<recob::Hit>*
40 const art::FindManyP<recob::Hit>* )
const;
72 const art::FindManyP<recob::Hit>* hitAssnVec)
const
75 if (hitsVec.empty() || !hitAssnVec)
return;
78 art::ServiceHandle<evd::ColorDrawingOptions const> cst;
80 using HitPosition = std::array<double,6>;
81 std::map<int,std::vector<HitPosition>> colorToHitMap;
83 float minHitCharge(std::numeric_limits<float>::max());
84 float maxHitCharge(std::numeric_limits<float>::lowest());
94 for(
const auto& spacePoint : hitsVec)
97 float hitCharge = spacePoint->ErrXYZ()[1];
99 minHitCharge = std::min(minHitCharge, hitCharge);
100 maxHitCharge = std::max(maxHitCharge, hitCharge);
105 if (maxHitCharge > minHitCharge)
109 for(
const auto& spacePoint : hitsVec)
115 float chgFactor = cst->fRecoQLow[
geo::kCollection] + hitChiSqScale * hitCharge;
117 const double* pos = spacePoint->XYZ();
118 const double*
err = spacePoint->ErrXYZ();
120 colorToHitMap[chargeColorIdx].push_back(HitPosition()={{pos[0],pos[1],pos[2],err[3],err[3],err[5]}});
124 for(
auto& hitPair : colorToHitMap)
126 TPolyMarker3D& pm = view->AddPolyMarker3D(hitPair.second.size(), hitPair.first, kFullDotLarge, 0.25);
127 for (
const auto&
hit : hitPair.second) pm.SetNextPoint(
hit[0],
hit[1],
hit[2]);
135 const art::FindManyP<recob::Hit>* hitAssnVec)
const
137 double totalCharge(0.);
140 const std::vector<art::Ptr<recob::Hit>>& hit2DVec(hitAssnVec->at(spacePoint.key()));
143 int lowIndex(std::numeric_limits<int>::min());
144 int hiIndex(std::numeric_limits<int>::max());
146 for(
const auto& hit2D : hit2DVec)
148 int hitStart = hit2D->PeakTime() - 2. * hit2D->RMS() - 0.5;
149 int hitStop = hit2D->PeakTime() + 2. * hit2D->RMS() + 0.5;
151 lowIndex = std::max(hitStart, lowIndex);
152 hiIndex = std::min(hitStop + 1, hiIndex);
154 hitCharge += hit2D->Integral();
157 if (!hit2DVec.empty()) hitCharge /=
float(hit2DVec.size());
161 if (hiIndex > lowIndex)
163 for(
const auto& hit2D : hit2DVec)
164 totalCharge +=
chargeIntegral(hit2D->PeakTime(),hit2D->PeakAmplitude(),hit2D->RMS(),1.,lowIndex,hiIndex);
166 totalCharge /= float(hit2DVec.size());
182 for(
int sigPos = low; sigPos < hi; sigPos++) integral += peakAmp * TMath::Gaus(
double(sigPos)+0.5,peakMean,peakWidth);
Declaration of signal hit object.
EResult err(const char *call)
std::size_t size(FixedBins< T, C > const &) noexcept
standard_dbscan3dalg useful for diagnostics hits not in a line will not be clustered on on only for track like only for track like on on the smaller the less shower like tracks low
The color scales used by the event display.
auto vector(Vector const &v)
Returns a manipulator which will print the specified array.
Signal from collection planes.