54 auto const clock_data =
60 std::vector<geo::PlaneID> planeIDVec;
70 std::vector<float> opHitPEVec;
73 for (
size_t idx = 0; idx < recoOpt->
fOpFlashLabels.size(); idx++) {
76 event.getByLabel(opFlashProducer, opFlashHandle);
78 if (!opFlashHandle.
isValid())
continue;
79 if (opFlashHandle->size() == 0)
continue;
84 for (
size_t idx = 0; idx < opFlashHandle->size(); idx++)
90 if (opHitAssnVec.size() == 0)
continue;
93 for (
const auto& opFlashPtr : opFlashVec) {
94 std::cout <<
"--> opFlash PE: " << opFlashPtr->TotalPE() <<
", Time: " << opFlashPtr->Time()
95 <<
", width: " << opFlashPtr->TimeWidth() <<
", y/w: " << opFlashPtr->YCenter()
96 <<
"/" << opFlashPtr->YWidth() <<
", Z/w: " << opFlashPtr->ZCenter() <<
"/" 97 << opFlashPtr->ZWidth() << std::endl;
99 if (opFlashPtr->TotalPE() < recoOpt->
fFlashMinPE)
continue;
100 if (opFlashPtr->Time() < recoOpt->
fFlashTMin)
continue;
101 if (opFlashPtr->Time() > recoOpt->
fFlashTMax)
continue;
104 const std::vector<art::Ptr<recob::OpHit>>& opHitVec = opHitAssnVec.at(opFlashPtr.key());
106 for (
const auto& opHit : opHitVec)
107 opHitPEVec.push_back(opHit->PE());
112 if (!opHitPEVec.empty()) {
114 std::sort(opHitPEVec.begin(), opHitPEVec.end());
116 float minTotalPE = opHitPEVec.front();
117 float maxTotalPE = opHitPEVec[0.9 * opHitPEVec.size()];
121 (maxTotalPE - minTotalPE));
125 for (
size_t idx = 0; idx < recoOpt->
fOpFlashLabels.size(); idx++) {
128 event.getByLabel(opFlashProducer, opFlashHandle);
130 if (!opFlashHandle.
isValid())
continue;
131 if (opFlashHandle->size() == 0)
continue;
136 for (
size_t idx = 0; idx < opFlashHandle->size(); idx++)
142 if (opHitAssnVec.size() == 0)
continue;
145 for (
const auto& opFlashPtr : opFlashVec) {
147 if (opFlashPtr->TotalPE() < recoOpt->
fFlashMinPE)
continue;
148 if (opFlashPtr->Time() < recoOpt->
fFlashTMin)
continue;
149 if (opFlashPtr->Time() > recoOpt->
fFlashTMax)
continue;
152 const std::vector<art::Ptr<recob::OpHit>> opHitVec = opHitAssnVec.at(opFlashPtr.key());
156 float flashTick = opFlashPtr->Time() /
sampling_rate(clock_data) * 1e3 +
157 det_prop.GetXTicksOffset(planeIDVec[idx]);
158 float flashWidth = opFlashPtr->TimeWidth() /
sampling_rate(clock_data) * 1e3 +
159 det_prop.GetXTicksOffset(planeIDVec[idx]);
162 float flashXpos = det_prop.ConvertTicksToX(flashTick, planeIDVec[idx]);
163 float flashXWid = det_prop.ConvertTicksToX(flashWidth, planeIDVec[idx]);
166 for (
const auto& opHit : opHitVec) {
167 unsigned int opChannel = opHit->OpChannel();
168 const geo::OpDetGeo& opHitGeo = wireReadoutGeom.OpDetGeoFromOpChannel(opChannel);
170 float zWidth = opHitGeo.
HalfW();
171 float yWidth = opHitGeo.
HalfH();
173 Eigen::Vector3f opHitLo(
174 opHitPos.X() - flashXWid, opHitPos.Y() - yWidth, opHitPos.Z() - zWidth);
175 Eigen::Vector3f opHitHi(
176 opHitPos.X() + flashXWid, opHitPos.Y() + yWidth, opHitPos.Z() + zWidth);
179 flashXpos = opHitPos.X();
182 opHitPEScale * std::min(maxTotalPE,
float(opHit->PE()));
189 std::cout <<
" == flashtick: " << flashTick <<
", flashwidth: " << flashWidth
190 <<
", flashXpos: " << flashXpos <<
", wid: " << flashXWid
191 <<
", opHitPEScale: " << opHitPEScale << std::endl;
193 Eigen::Vector3f coordsLo(flashXpos - flashXWid,
194 opFlashPtr->YCenter() - opFlashPtr->YWidth(),
195 opFlashPtr->ZCenter() - opFlashPtr->ZWidth());
196 Eigen::Vector3f coordsHi(flashXpos + flashXWid,
197 opFlashPtr->YCenter() + opFlashPtr->YWidth(),
198 opFlashPtr->ZCenter() + opFlashPtr->ZWidth());
std::vector< art::InputTag > fOpFlashLabels
module labels that produced events
Point_t const & GetCenter() const
The data type to uniquely identify a Plane.
cout<< "Opened file "<< fin<< " ixs= "<< ixs<< endl;if(ixs==0) hhh=(TH1F *) fff-> Get("h1")
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.
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.
Signal from collection planes.