12 #include "canvas/Persistency/Common/FindManyP.h" 15 #include "TPolyMarker3D.h" 32 const art::FindManyP<recob::Hit>*
37 const art::FindManyP<recob::Hit>* )
const;
69 const art::FindManyP<recob::Hit>* hitAssnVec)
const 72 if (hitsVec.empty() || !hitAssnVec)
return;
77 using HitPosition = std::array<double,6>;
78 std::map<int,std::vector<HitPosition>> colorToHitMap;
81 float maxHitCharge(std::numeric_limits<float>::lowest());
91 for(
const auto& spacePoint : hitsVec)
94 float hitCharge = spacePoint->ErrXYZ()[1];
96 minHitCharge =
std::min(minHitCharge, hitCharge);
97 maxHitCharge =
std::max(maxHitCharge, hitCharge);
102 if (maxHitCharge > minHitCharge)
106 for(
const auto& spacePoint : hitsVec)
114 const double*
pos = spacePoint->XYZ();
115 const double*
err = spacePoint->ErrXYZ();
117 colorToHitMap[chargeColorIdx].push_back(HitPosition()={{pos[0],pos[1],pos[2],err[3],err[3],err[5]}});
121 for(
auto& hitPair : colorToHitMap)
123 TPolyMarker3D&
pm = view->AddPolyMarker3D(hitPair.second.size(), hitPair.first, kFullDotLarge, 0.25);
124 for (
const auto&
hit : hitPair.second) pm.SetNextPoint(
hit[0],
hit[1],
hit[2]);
132 const art::FindManyP<recob::Hit>* hitAssnVec)
const 134 double totalCharge(0.);
137 const std::vector<art::Ptr<recob::Hit>>& hit2DVec(hitAssnVec->at(spacePoint.
key()));
143 for(
const auto& hit2D : hit2DVec)
145 int hitStart = hit2D->PeakTime() - 2. * hit2D->RMS() - 0.5;
146 int hitStop = hit2D->PeakTime() + 2. * hit2D->RMS() + 0.5;
148 lowIndex =
std::max(hitStart, lowIndex);
149 hiIndex =
std::min(hitStop + 1, hiIndex);
151 hitCharge += hit2D->Integral();
154 if (!hit2DVec.empty()) hitCharge /=
float(hit2DVec.size());
158 if (hiIndex > lowIndex)
160 for(
const auto& hit2D : hit2DVec)
161 totalCharge +=
chargeIntegral(hit2D->PeakTime(),hit2D->PeakAmplitude(),hit2D->RMS(),1.,lowIndex,hiIndex);
163 totalCharge /=
float(hit2DVec.size());
179 for(
int sigPos = low; sigPos < hi; sigPos++) integral += peakAmp * TMath::Gaus(
double(sigPos)+0.5,peakMean,peakWidth);
std::vector< double > fRecoQHigh
high edge of ADC values for drawing raw digits
std::vector< double > fRecoQLow
low edge of ADC values for drawing raw digits
decltype(auto) constexpr size(T &&obj)
ADL-aware version of std::size.
key_type key() const noexcept
T get(std::string const &key) const
const evdb::ColorScale & CalQ(geo::SigType_t st) const
static int max(int a, int b)
void err(const char *fmt,...)
Detector simulation of raw signals on wires.
std::size_t color(std::string const &procname)
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
Signal from collection planes.