Segment.h
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 // \file Segment.h
3 // \version $Id: Segment.h,v 1.6 2012-10-30 23:33:09 bckhouse Exp $
4 // \author Christopher Backhouse - bckhouse@caltech.edu
5 ////////////////////////////////////////////////////////////////////////
6 
7 #ifndef DTSEGMENT_H
8 #define DTSEGMENT_H
9 
10 #include <ostream>
11 
12 #include "DiscreteTracker/Types.h"
13 
14 namespace dt
15 {
16  /// Just the upstream or downstream part, just coordinates
17  struct SubSeg
18  {
19  SubSeg(double a, double b, double c) : z(a), y0(b), y1(c) {}
20  double z, y0, y1;
21  };
22 
23  /// Window the line must pass through from (z,y0)-(z,y1)
24  struct Segment
25  {
26  Segment(){}
27  Segment(double a, double b, double c,
28  double d, double e, double f,
29  bool l, int p, int cl, int ch)
30  : zL(a), yL0(b), yL1(c),
31  zR(d), yR0(e), yR1(f),
32  left(l), plane(p), cellLo(cl), cellHi(ch)
33  {
34  }
35  bool operator==(const Segment& rhs) const;
36  bool operator!=(const Segment& rhs) const {return !(*this==rhs);}
37  bool operator<(const Segment& rhs) const {return zL < rhs.zL;}
38  SubSeg GetSubSeg(Direction dir) const;
39  double zL, yL0, yL1;
40  double zR, yR0, yR1;
41  bool left;
42  int plane, cellLo, cellHi;
43  };
44 
45  std::ostream& operator<<(std::ostream& os, const Segment& seg);
46 } // end namespace
47 
48 #endif // DTSEGMENT_H
Segment(double a, double b, double c, double d, double e, double f, bool l, int p, int cl, int ch)
Definition: Segment.h:27
double y0
Definition: Segment.h:20
const char * p
Definition: xmltok.h:285
bool operator<(const Segment &rhs) const
Definition: Segment.h:37
bool left
Definition: Segment.h:41
bool operator!=(const Segment &rhs) const
Definition: Segment.h:36
std::ostream & operator<<(std::ostream &os, const Segment &seg)
Definition: Segment.cxx:27
Definition: Cand.cxx:23
const double a
Float_t d
Definition: plot.C:236
bool operator==(FC &A, FC &B)
Direction
Definition: Types.h:5
SubSeg(double a, double b, double c)
Definition: Segment.h:19
double zR
Definition: Segment.h:40
Just the upstream or downstream part, just coordinates.
Definition: Segment.h:17
int plane
Definition: Segment.h:42
double zL
Definition: Segment.h:39
constexpr auto const & left(const_AssnsIter< L, R, D, Dir > const &a, const_AssnsIter< L, R, D, Dir > const &b)
Definition: AssnsIter.h:104
TDirectory * dir
Definition: macro.C:5
const hit & b
Definition: hits.cxx:21
Window the line must pass through from (z,y0)-(z,y1)
Definition: Segment.h:24
double z
Definition: Segment.h:20
Float_t e
Definition: plot.C:35
double y1
Definition: Segment.h:20