Public Member Functions | Public Attributes | List of all members
Wirebounds Struct Reference

Public Member Functions

 Wirebounds (const std::vector< const Pimpos * > &p, Json::Value jargs)
 
bool operator() (IDepo::pointer depo)
 

Public Attributes

std::vector< const Pimpos * > pimpos
 
Json::Value jargs
 

Detailed Description

Definition at line 72 of file MultiDuctor.cxx.

Constructor & Destructor Documentation

Wirebounds::Wirebounds ( const std::vector< const Pimpos * > &  p,
Json::Value  jargs 
)
inline

Definition at line 75 of file MultiDuctor.cxx.

75 : pimpos(p), jargs(jargs) { }
std::vector< const Pimpos * > pimpos
Definition: MultiDuctor.cxx:73
Json::Value jargs
Definition: MultiDuctor.cxx:74

Member Function Documentation

bool Wirebounds::operator() ( IDepo::pointer  depo)
inline

Definition at line 77 of file MultiDuctor.cxx.

77  {
78 
79  if (!depo) {
80  std::cerr << "Gen::MultiDuctor::Wirebounds: error: no depo given\n";
81  return false;
82  }
83 
84  // fixme: it's possibly really slow to do all this Json::Value
85  // access deep inside this loop. If so, the Json::Values
86  // should be run through once in configure() and stored into
87  // some faster data structure.
88 
89  // return true if depo is "in" ANY region.
90  for (auto jregion : jargs) {
91  bool inregion = true;
92 
93  // depo must be in ALL ranges of a region
94  for (auto jrange: jregion) {
95  int iplane = jrange["plane"].asInt();
96  int imin = jrange["min"].asInt();
97  int imax = jrange["max"].asInt();
98 
99  //double drift = pimpos[iplane]->distance(depo->pos(), 0);
100  double pitch = pimpos[iplane]->distance(depo->pos(), 2);
101  int iwire = pimpos[iplane]->region_binning().bin(pitch); // fixme: warning: round off error?
102  inregion = inregion && (imin <= iwire && iwire <= imax);
103  if (!inregion) {
104  // std::cerr << "Wirebounds: wire: "<<iwire<<" of plane " << iplane << " not in [" << imin << "," << imax << "]\n";
105  break; // not in this view's region, no reason to keep checking.
106  }
107  }
108  if (inregion) { // only need one region
109  return true;
110  }
111  }
112  return false;
113  }
std::vector< const Pimpos * > pimpos
Definition: MultiDuctor.cxx:73
Json::Value jargs
Definition: MultiDuctor.cxx:74

Member Data Documentation

Json::Value Wirebounds::jargs

Definition at line 74 of file MultiDuctor.cxx.

std::vector<const Pimpos*> Wirebounds::pimpos

Definition at line 73 of file MultiDuctor.cxx.


The documentation for this struct was generated from the following file: