223 <<
"StripSplitterAlg::getVirtualHits()";
229 int layer = hit->
Layer();
242 <<
" StripSplitterAlg::getVirtualHits()" 243 <<
" Strip splitted in " <<
fnVirtual <<
" virtual cells";
247 TVector3 stripDir = stripEnds.first - stripEnds.second;
252 ppp[0] = stripEnds.first.X();
253 ppp[1] = stripEnds.first.Y();
254 ppp[2] = stripEnds.first.Z();
259 ppp[0] = stripEnds.second.X();
260 ppp[1] = stripEnds.second.Y();
261 ppp[2] = stripEnds.second.Z();
268 int splitterOrientation;
269 std::vector <const gar::rec::CaloHit*> *splitterVec;
282 std::map <int, float> virtEnergy;
287 for (
int jj = 0; jj < 2; jj++)
289 std::vector <const gar::rec::CaloHit*> *splitter = splitterVec;
291 for (
uint i = 0; i < splitter->size(); i++)
296 int layer2 = hit2->
Layer();
300 int ddetid =
std::abs(detid2 - detid);
301 int dlayer =
std::abs(layer2 - layer);
302 int dstave =
std::abs(stave2 - stave);
303 int dmodule =
std::abs(module2 - module);
308 if(ddetid != 0)
continue;
313 if (dmodule == 0 && dstave == 0 && dlayer > 1)
continue;
318 if ( dstave == 0 && dmodule > 1 )
continue;
319 if ( dmodule == 0 && dstave > 1 )
continue;
320 if ( dstave == 0 && dlayer > 1)
continue;
328 dstave =
std::min( dstave, 4 - dstave);
329 if (dmodule != 0)
continue;
330 if (dstave > 1)
continue;
331 if (dlayer > 1)
continue;
335 <<
" Getting hit2 " << i
336 <<
" pointing at " << hit2
337 <<
" orientation " << (splitterOrientation ==
LONGITUDINAL ?
"LONGITUDINAL" :
"TRANSVERSE")
338 <<
" dtave " << dstave
339 <<
" dmodule " << dmodule
340 <<
" dlayer " << dlayer;
347 <<
" Distance between hit1 and hit2 " << dist
353 TVector3 stripDir2(0, 0, 0);
358 stripDir2 = stripEnds2.first - stripEnds2.second;
362 TVector3 intercept =
stripIntersect(hit, stripDir, hit2, stripDir2);
364 if (intercept.Mag() > 0)
368 for (
int ii = 0; ii < 3; ii++) {
369 float dx = stripEnds.second[ii] - stripEnds.first[ii];
370 if (std::fabs(dx) > 0.1) {
371 frac = ( intercept[ii] - stripEnds.first[ii] ) / dx;
376 if (frac >= 0.0 && frac <= 1.0)
381 if (virtEnergy.find(segment) != virtEnergy.end())
383 virtEnergy[segment] += hit2->
Energy();
385 virtEnergy[segment] = hit2->
Energy();
391 pos[0] = intercept.X();
392 pos[1] = intercept.Y();
393 pos[2] = intercept.Z();
401 <<
"strange segment " << segment
402 <<
" frac = " << frac
407 <<
"strange frac " << frac;
414 <<
" Number of splitters " << nSplitters;
419 totenergy += it->second;
426 TVector3 virtualCentre = stripEnds.second - stripEnds.first;
427 virtualCentre *= (it->first + 0.5) /
fnVirtual;
428 virtualCentre += stripEnds.first;
431 pos[0] = virtualCentre.X();
432 pos[1] = virtualCentre.Y();
433 pos[2] = virtualCentre.Z();
439 <<
" Creating new virtual hit pointing at " << newhit
440 <<
" Energy " << energy
441 <<
" Position " << pos[0] <<
" " << pos[1] <<
" " << pos[2];
443 virtualhits.emplace_back(newhit);
gar::geo::GeometryCore const * fGeo
geometry information
std::pair< TVector3, TVector3 > GetStripEnds(const std::array< double, 3 > &point, const gar::raw::CellID_t &cID) const
raw::CellID_t CellID() const
TVector3 stripIntersect(const gar::rec::CaloHit *hit0, const TVector3 &dir0, const gar::rec::CaloHit *hit1, const TVector3 &dir1)
std::vector< const gar::rec::CaloHit * > m_CaloHitVecEven
std::vector< const gar::rec::CaloHit * > m_CaloHitVecOdd
double getStripWidth(const std::array< double, 3 > &point) const
std::pair< float, float > Time() const
double getStripLength(const std::array< double, 3 > &point, const gar::raw::CellID_t &cID) const
std::vector< const gar::rec::CaloHit * > fIntersectionHits
unsigned int Layer() const
gar::geo::BitFieldCoder const * fFieldDecoder
std::vector< const gar::rec::CaloHit * > fStripEndsHits
long64 get(long64 bitfield, size_t index) const
const float * Position() const
T min(sqlite3 *const db, std::string const &table_name, std::string const &column_name)
constexpr double dist(const TReal *x, const TReal *y, const unsigned int dimension)