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.size()))
continue;
215 if(!wireids.size())
continue;
222 unsigned int globalWire = wireid.
Wire;
223 unsigned int globalPlane = wireid.
Plane;
240 for(
auto iROI = ROIs.begin(); iROI != ROIs.end(); ++iROI){
242 auto tick = ROI.first;
246 double charge = 0.005*reco_wire->
Charge(
tick);
253 if (wireid.
TPC%6 == 0 or wireid.
TPC%6 == 5)
continue;
255 wireid.
Plane,wireid.
TPC,globalWire,globalPlane,globalTime);
259 wireid.
Plane,wireid.
TPC,globalWire,globalPlane,globalTime);
267 wire_0.push_back(globalWire);
268 twire_0.push_back((
double)
tick);
273 wire_1.push_back(globalWire);
274 twire_1.push_back((
double)
tick);
279 wire_2.push_back(globalWire);
280 twire_2.push_back((
double)
tick);
302 double tmean_0 = tsum_0/total_t0;
303 double tmean_1 = tsum_1/total_t1;
304 double tmean_2 = tsum_2/total_t2;
315 std::vector<int> bwire_0;
316 std::vector<int> bwire_1;
317 std::vector<int> bwire_2;
318 for(
int i = 0; i < (
int)wire_0.size(); i++){
319 double t = twire_0[i];
321 bwire_0.push_back(wire_0[i]);
323 for(
int i = 0; i < (
int)wire_1.size(); i++){
324 double t = twire_1[i];
325 if(
std::abs(t-tmean_1) < (double)fTRes)
326 bwire_1.push_back(wire_1[i]);
328 for(
int i = 0; i < (
int)wire_2.size(); i++){
329 double t = twire_2[i];
330 if(
std::abs(t-tmean_2) < (double)fTRes)
331 bwire_2.push_back(wire_2[i]);
334 std::cout <<
"Boundary wire vector sizes: " << bwire_0.size() <<
", " << bwire_1.size() <<
", " << bwire_2.size() <<
std::endl;
339 auto minwireelement_0 = std::min_element(bwire_0.begin(), bwire_0.end());
340 auto minwireelement_1 = std::min_element(bwire_1.begin(), bwire_1.end());
341 auto minwireelement_2 = std::min_element(bwire_2.begin(), bwire_2.end());
343 if(bwire_0.size() > 0) { minwire_0 = *minwireelement_0-1; std::cout<<
"minwire 0: "<<(*minwireelement_0) <<
std::endl;}
344 if(bwire_1.size() > 0) { minwire_1 = *minwireelement_1-1; std::cout<<
"minwire 1: "<<(*minwireelement_1) <<
std::endl;}
345 if(bwire_2.size() > 0) { minwire_2 = *minwireelement_2-1; std::cout<<
"minwire 2: "<<(*minwireelement_2) <<
std::endl;}
347 fTotHits = bwire_0.size() + bwire_1.size() + bwire_2.size();
349 Boundary bound(
fNWire,fTRes,minwire_0,minwire_1,minwire_2,tmean_0,tmean_1,tmean_2);
unsigned int fTotHits
How many ROIs above threshold?
Energy deposited on a readout channel by simulated tracks.
double fThreshold
charge threshold for each time tick, below which isn't added to pixel map
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
std::vector< geo::WireID > ChannelToWire(raw::ChannelID_t const channel) const
Returns a list of wires connected to the specified TPC channel.
WireID_t Wire
Index of the wire within its plane.
void GetDUNEVertDrift3ViewGlobalWire(unsigned int localWire, unsigned int plane, unsigned int tpc, unsigned int &globalWire, unsigned int &globalPlane) const
std::string DetectorName() const
Returns a string with the name of the detector, as configured.
double Charge(TDC_t tdc) const
Returns the total number of ionization electrons on this channel in the specified TDC...
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
tick_as<> tick
Tick number, represented by std::ptrdiff_t.
double fTRes
Timing resolution for pixel map.
PlaneID_t Plane
Index of the plane within its TPC.
raw::ChannelID_t Channel() const
Returns the readout channel this object describes.
unsigned int fNWire
Number of wires, length for pixel maps.
bool fProtoDUNE
Do we want to use this for particle extraction from protoDUNE?
unsigned short fUnwrapped
Use unwrapped pixel maps?
TDCIDEs_t const & TDCIDEMap() const
Returns all the deposited energy information as stored.
void GetProtoDUNEGlobalWire(unsigned int localWire, unsigned int plane, unsigned int tpc, unsigned int &globalWire, unsigned int &globalPlane) const
TPCID_t TPC
Index of the TPC within its cryostat.
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.
geo::GeometryCore const * fGeometry
QTextStream & endl(QTextStream &s)