RegCNNBoundary.cxx
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 /// \file RegCNNBoundary.cxx
3 /// \brief RegCNNBoundary for RegCNN PixelMap modified from CVNBoundary.cxx
4 /// \author Ilsoo Seong - iseong@uci.edu
5 // Wenjie Wu - wenjieww@uci.edu
6 ////////////////////////////////////////////////////////////////////////
7 
8 #include <iostream>
9 #include <ostream>
10 #include <utility>
11 
13 
15 
16 namespace cnn
17 {
18 
19  RegCNNBoundary::RegCNNBoundary(const int& nWire, // # of wires of pixel map
20  const int& nTDC, // # of TDC of pixel map
21  const int& wRes, // # of Wire merging
22  const int& tRes, // # of TDC merging
23  const int& WireMeanX,
24  const int& WireMeanY,
25  const int& WireMeanZ,
26  const int& TDCMeanX,
27  const int& TDCMeanY,
28  const int& TDCMeanZ):
29  fFirstWire{WireMeanX-(nWire*wRes)/2,
30  WireMeanY-(nWire*wRes)/2,
31  WireMeanZ-(nWire*wRes)/2},
32  fLastWire{WireMeanX+(nWire*wRes)/2-wRes/2,
33  WireMeanY+(nWire*wRes)/2-wRes/2,
34  WireMeanZ+(nWire*wRes)/2-wRes/2},
35  fFirstTDC{TDCMeanX - (nTDC*tRes)/2,
36  TDCMeanY - (nTDC*tRes)/2,
37  TDCMeanZ - (nTDC*tRes)/2},
38  fLastTDC{TDCMeanX + (nTDC*tRes)/2-tRes/2,
39  TDCMeanY + (nTDC*tRes)/2-tRes/2,
40  TDCMeanZ + (nTDC*tRes)/2-tRes/2}
41 
42  {
43  if (fLastWire[0] - fFirstWire[0] != nWire*wRes - wRes/2)
44  mf::LogError("RegCNNBoundary::RegCNNBoundary") << "RegCNN 1st Map Boundary Wrong"<<std::endl;
45  if (fLastWire[1] - fFirstWire[1] != nWire*wRes - wRes/2)
46  mf::LogError("RegCNNBoundary::RegCNNBoundary") << "RegCNN 2nd Map Boundary Wrong"<<std::endl;
47  if (fLastWire[2] - fFirstWire[2] != nWire*wRes - wRes/2)
48  mf::LogError("RegCNNBoundary::RegCNNBoundary") << "RegCNN 3rd Map Boundary Wrong"<<std::endl;
49  }
50 
51  bool RegCNNBoundary::IsWithin(const int& wire, const int& tdc, const unsigned int& view)
52  {
53  bool inWireRcnne = (int) wire >= fFirstWire[view] && (int) wire < fLastWire[view];
54  bool inTDCRcnne = (int) tdc >= fFirstTDC[view] &&
55  (int) tdc < fLastTDC[view];
56  return inWireRcnne && inTDCRcnne;
57  }
58 
59 
60  std::ostream& operator<<(std::ostream& os, const RegCNNBoundary& b)
61  {
62  os<<"RegCNNBoundary with "
63  <<"(first,last) wire X: (" <<b.FirstWire(0)<<", "<<b.LastWire(0)
64  <<"), (first,last) wire Y: (" <<b.FirstWire(1)<<", "<<b.LastWire(1)
65  <<"), (first,last) wire Z: (" <<b.FirstWire(2)<<", "<<b.LastWire(2)
66  <<"), (first,last) tdc X: (" <<b.FirstTDC(0) <<", "<<b.LastTDC(0)
67  <<"), (first,last) tdc Y: (" <<b.FirstTDC(1) <<", "<<b.LastTDC(1)
68  <<"), (first,last) tdc Z: (" <<b.FirstTDC(2) <<", "<<b.LastTDC(2)
69  <<")";
70 
71  return os;
72  }
73 }
int FirstWire(const unsigned int &view) const
int fLastWire[3]
Maximum wire, inclusive.
int fFirstTDC[3]
Minimum TDC in each view, inclusive.
int fFirstWire[3]
Minimum wire, inclusive.
MaybeLogger_< ELseverityLevel::ELsev_error, false > LogError
bool IsWithin(const int &wire, const int &tdc, const unsigned int &view)
int fLastTDC[3]
Maximum TDC in each view, inclusive.
Defines an enumeration for cellhit classification.
int LastTDC(const unsigned int &view) const
RegCNNBoundary for RegCNN PixelMap modified from CVNBoundary.h.
int LastWire(const unsigned int &view) const
std::ostream & operator<<(std::ostream &os, const RegPixelMap3DProducer &p)
static bool * b
Definition: config.cpp:1043
int FirstTDC(const unsigned int &view) const
QTextStream & endl(QTextStream &s)