58 auto const clock_data =
64 std::vector<geo::PlaneID> planeIDVec;
74 std::vector<float> opHitPEVec;
77 for (
size_t idx = 0; idx < recoOpt->
fOpFlashLabels.size(); idx++) {
80 event.getByLabel(opFlashProducer, opFlashHandle);
82 if (!opFlashHandle.
isValid())
continue;
83 if (opFlashHandle->size() == 0)
continue;
88 for (
size_t idx = 0; idx < opFlashHandle->size(); idx++)
94 if (opHitAssnVec.size() == 0)
continue;
97 for (
const auto& opFlashPtr : opFlashVec) {
98 std::cout <<
"--> opFlash PE: " << opFlashPtr->TotalPE() <<
", Time: " << opFlashPtr->Time()
99 <<
", width: " << opFlashPtr->TimeWidth() <<
", y/w: " << opFlashPtr->YCenter()
100 <<
"/" << opFlashPtr->YWidth() <<
", Z/w: " << opFlashPtr->ZCenter() <<
"/" 101 << opFlashPtr->ZWidth() << std::endl;
103 if (opFlashPtr->TotalPE() < recoOpt->
fFlashMinPE)
continue;
104 if (opFlashPtr->Time() < recoOpt->
fFlashTMin)
continue;
105 if (opFlashPtr->Time() > recoOpt->
fFlashTMax)
continue;
108 const std::vector<art::Ptr<recob::OpHit>>& opHitVec = opHitAssnVec.at(opFlashPtr.key());
110 for (
const auto& opHit : opHitVec)
111 opHitPEVec.push_back(opHit->PE());
116 if (!opHitPEVec.empty()) {
118 std::sort(opHitPEVec.begin(), opHitPEVec.end());
120 float minTotalPE = opHitPEVec.front();
121 float maxTotalPE = opHitPEVec[0.9 * opHitPEVec.size()];
125 (maxTotalPE - minTotalPE));
128 for (
size_t idx = 0; idx < recoOpt->
fOpFlashLabels.size(); idx++) {
131 event.getByLabel(opFlashProducer, opFlashHandle);
133 if (!opFlashHandle.
isValid())
continue;
134 if (opFlashHandle->size() == 0)
continue;
139 for (
size_t idx = 0; idx < opFlashHandle->size(); idx++)
145 if (opHitAssnVec.size() == 0)
continue;
148 for (
const auto& opFlashPtr : opFlashVec) {
150 if (opFlashPtr->TotalPE() < recoOpt->
fFlashMinPE)
continue;
151 if (opFlashPtr->Time() < recoOpt->
fFlashTMin)
continue;
152 if (opFlashPtr->Time() > recoOpt->
fFlashTMax)
continue;
155 const std::vector<art::Ptr<recob::OpHit>> opHitVec = opHitAssnVec.at(opFlashPtr.key());
159 float flashTick = opFlashPtr->Time() /
sampling_rate(clock_data) * 1e3 +
160 det_prop.GetXTicksOffset(planeIDVec[idx]);
161 float flashWidth = opFlashPtr->TimeWidth() /
sampling_rate(clock_data) * 1e3 +
162 det_prop.GetXTicksOffset(planeIDVec[idx]);
165 float flashXpos = det_prop.ConvertTicksToX(flashTick, planeIDVec[idx]);
166 float flashXWid = det_prop.ConvertTicksToX(flashWidth, planeIDVec[idx]);
169 for (
const auto& opHit : opHitVec) {
170 unsigned int opChannel = opHit->OpChannel();
173 float zWidth = opHitGeo.
HalfW();
174 float yWidth = opHitGeo.
HalfH();
176 Eigen::Vector3f opHitLo(
177 opHitPos.X() - flashXWid, opHitPos.Y() - yWidth, opHitPos.Z() - zWidth);
178 Eigen::Vector3f opHitHi(
179 opHitPos.X() + flashXWid, opHitPos.Y() + yWidth, opHitPos.Z() + zWidth);
182 flashXpos = opHitPos.X();
185 opHitPEScale * std::min(maxTotalPE,
float(opHit->PE()));
192 std::cout <<
" == flashtick: " << flashTick <<
", flashwidth: " << flashWidth
193 <<
", flashXpos: " << flashXpos <<
", wid: " << flashXWid
194 <<
", opHitPEScale: " << opHitPEScale << std::endl;
197 Eigen::Vector3f coordsLo(flashXpos - flashXWid,
198 opFlashPtr->YCenter() - opFlashPtr->YWidth(),
199 opFlashPtr->ZCenter() - opFlashPtr->ZWidth());
200 Eigen::Vector3f coordsHi(flashXpos + flashXWid,
201 opFlashPtr->YCenter() + opFlashPtr->YWidth(),
202 opFlashPtr->ZCenter() + opFlashPtr->ZWidth());
std::vector< art::InputTag > fOpFlashLabels
module labels that produced events
The data type to uniquely identify a Plane.
int GetColor(double x) const
double fFlashTMin
Minimal time for a flash to be displayed.
std::vector< double > fRecoQHigh
high edge of ADC values for drawing raw digits
double fFlashTMax
Maximum time for a flash to be displayed.
std::vector< double > fRecoQLow
low edge of ADC values for drawing raw digits
bool isValid() const noexcept
void push_back(Ptr< U > const &p)
const evdb::ColorScale & CalQ(geo::SigType_t st) const
double fFlashMinPE
Minimal PE for a flash to be displayed.
geo::Point_t const & GetCenter() const
ROOT::Math::PositionVector3D< ROOT::Math::Cartesian3D< double >, ROOT::Math::GlobalCoordinateSystemTag > Point_t
Type for representation of position in physical 3D space.
double sampling_rate(DetectorClocksData const &data)
Returns the period of the TPC readout electronics clock.
Namespace collecting geometry-related classes utilities.
OpDetGeo const & OpDetGeoFromOpChannel(unsigned int OpChannel) const
Returns the geo::OpDetGeo object for the given channel number.
Signal from collection planes.