Get boundaries for pixel map representation of cluster.
197 std::vector<int> wire_0;
198 std::vector<int> wire_1;
199 std::vector<int> wire_2;
201 std::vector<double> twire_0;
202 std::vector<double> twire_1;
203 std::vector<double> twire_2;
205 double tsum_0 = 0., tsum_1 = 0., tsum_2 = 0.;
206 int total_t0 = 0, total_t1 = 0, total_t2 = 0;
208 for(
size_t iHit = 0; iHit < cluster.size(); ++iHit)
212 if(!(ROIs.get_ranges().size()))
continue;
215 if(!wireids.size())
continue;
218 if(wireids.size() > 1){
219 for(
auto iwire : wireids)
220 if(iwire.Plane == reco_wire->
View()) wireid = iwire;
222 unsigned int globalWire = wireid.
Wire;
223 unsigned int globalPlane = wireid.
Plane;
242 for(
auto iROI = ROIs.begin_range(); iROI != ROIs.end_range(); ++iROI){
244 bool none_threshold =
true;
245 int min_tick = 20000;
246 for(
int tick = ROI.begin_index();
tick < (
int)ROI.end_index();
tick++){
251 if(
tick < min_tick) min_tick =
tick;
257 if (wireid.
TPC%6 == 0 or wireid.
TPC%6 == 5)
continue;
259 wireid.
Plane,wireid.
TPC,globalWire,globalPlane,globalTime);
263 wireid.
Plane,wireid.
TPC,globalWire,globalPlane,globalTime);
283 wire_0.push_back(globalWire);
284 twire_0.push_back((
double)min_tick);
287 wire_1.push_back(globalWire);
288 twire_1.push_back((
double)min_tick);
291 wire_2.push_back(globalWire);
292 twire_2.push_back((
double)min_tick);
313 double tmean_0 = tsum_0/total_t0;
314 double tmean_1 = tsum_1/total_t1;
315 double tmean_2 = tsum_2/total_t2;
326 std::vector<int> bwire_0;
327 std::vector<int> bwire_1;
328 std::vector<int> bwire_2;
329 for(
int i = 0; i < (
int)wire_0.size(); i++){
330 double t = twire_0[i];
332 bwire_0.push_back(wire_0[i]);
334 for(
int i = 0; i < (
int)wire_1.size(); i++){
335 double t = twire_1[i];
336 if(
std::abs(t-tmean_1) < (double)fTRes)
337 bwire_1.push_back(wire_1[i]);
339 for(
int i = 0; i < (
int)wire_2.size(); i++){
340 double t = twire_2[i];
341 if(
std::abs(t-tmean_2) < (double)fTRes)
342 bwire_2.push_back(wire_2[i]);
345 std::cout <<
"Boundary wire vector sizes: " << bwire_0.size() <<
", " << bwire_1.size() <<
", " << bwire_2.size() <<
std::endl;
350 auto minwireelement_0 = std::min_element(bwire_0.begin(), bwire_0.end());
351 auto minwireelement_1 = std::min_element(bwire_1.begin(), bwire_1.end());
352 auto minwireelement_2 = std::min_element(bwire_2.begin(), bwire_2.end());
354 if(bwire_0.size() > 0) { minwire_0 = *minwireelement_0-1; std::cout<<
"minwire 0: "<<(*minwireelement_0) <<
std::endl;}
355 if(bwire_1.size() > 0) { minwire_1 = *minwireelement_1-1; std::cout<<
"minwire 1: "<<(*minwireelement_1) <<
std::endl;}
356 if(bwire_2.size() > 0) { minwire_2 = *minwireelement_2-1; std::cout<<
"minwire 2: "<<(*minwireelement_2) <<
std::endl;}
358 fTotHits = bwire_0.size() + bwire_1.size() + bwire_2.size();
360 Boundary bound(
fNWire,fTRes,minwire_0,minwire_1,minwire_2,tmean_0,tmean_1,tmean_2);
void GetDUNE10ktGlobalWireTDC(detinfo::DetectorPropertiesData const &detProp, unsigned int localWire, double localTDC, unsigned int plane, unsigned int tpc, unsigned int &globalWire, unsigned int &globalPlane, double &globalTDC) const
unsigned short fUnwrapped
Use unwrapped pixel maps?
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
double fTRes
Timing resolution for pixel map.
WireID_t Wire
Index of the wire within its plane.
double fThreshold
charge threshold for each time tick, below which isn't added to pixel map
void GetDUNEVertDrift3ViewGlobalWire(unsigned int localWire, unsigned int plane, unsigned int tpc, unsigned int &globalWire, unsigned int &globalPlane) const
void GetProtoDUNEGlobalWire(unsigned int localWire, unsigned int plane, unsigned int tpc, unsigned int &globalWire, unsigned int &globalPlane) const
geo::View_t View() const
Returns the view the channel belongs to.
std::string DetectorName() const
Returns a string with the name of the detector, as configured.
void GetDUNEGlobalWire(unsigned int localWire, unsigned int plane, unsigned int tpc, unsigned int &globalWire, unsigned int &globalPlane) const
Function to convert to a global unwrapped wire number.
raw::ChannelID_t Channel() const
Returns the ID of the channel (or InvalidChannelID)
unsigned int fTotHits
How many ROIs above threshold?
unsigned int fNWire
Number of wires, length for pixel maps.
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
bool fProtoDUNE
Do we want to use this for particle extraction from protoDUNE?
const RegionsOfInterest_t & SignalROI() const
Returns the list of regions of interest.
PlaneID_t Plane
Index of the plane within its TPC.
geo::GeometryCore const * fGeometry
Class holding the regions of interest of signal from a channel.
void GetDUNEGlobalWireTDC(detinfo::DetectorPropertiesData const &detProp, unsigned int localWire, double localTDC, unsigned int plane, unsigned int tpc, unsigned int &globalWire, unsigned int &globalPlane, double &globalTDC) const
TPCID_t TPC
Index of the TPC within its cryostat.
QTextStream & endl(QTextStream &s)