CMS 3D CMS Logo

MTDClusterizerBase.h
Go to the documentation of this file.
1 #ifndef RecoLocalTracker_MTDClusterizer_MTDClusterizerBase_H
2 #define RecoLocalTracker_MTDClusterizer_MTDClusterizerBase_H
3 
6 
9 
12 
13 #include <vector>
14 #include <array>
15 
16 
21 public:
22 
25 
26  // Virtual destructor, this is a base class.
27  virtual ~MTDClusterizerBase() {}
28 
29  // Build clusters
30  virtual void clusterize( const FTLRecHitCollection & input,
31  const MTDGeometry* geom,
32  const MTDTopology* topo,
34 
35  protected:
37  typedef unsigned short UShort;
38  static constexpr UShort MAXSIZE = 256;
39 
40  std::array<float,MAXSIZE> energy;
41  std::array<float,MAXSIZE> time;
42  std::array<float,MAXSIZE> timeError;
43  std::array<UShort,MAXSIZE> x;
44  std::array<UShort,MAXSIZE> y;
45 
46  UShort xmin=16000;
47  UShort ymin=16000;
48  unsigned int isize=0;
49  unsigned int curr=0;
50 
51  // stack interface (unsafe ok for use below)
52  UShort top() const { return curr;}
53  void pop() { ++curr;}
54  bool empty() { return curr==isize;}
55 
56  bool add(FTLCluster::FTLHitPos const & p, float const ienergy, float const itime, float const itimeError) {
57  if (isize==MAXSIZE) return false;
58  xmin=std::min(xmin,(unsigned short)(p.row()));
59  ymin=std::min(ymin,(unsigned short)(p.col()));
60  energy[isize]=ienergy;
61  time[isize]=itime;
62  timeError[isize]=itimeError;
63  x[isize]=p.row();
64  y[isize]=p.col();
65  isize++;
66  return true;
67  }
68  };
69 
70 
71 };
72 
73 #endif
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
std::array< float, MAXSIZE > time
std::array< float, MAXSIZE > timeError
FTLRecHitCollection::const_iterator RecHitIterator
std::vector< T >::const_iterator const_iterator
bool add(FTLCluster::FTLHitPos const &p, float const ienergy, float const itime, float const itimeError)
std::array< UShort, MAXSIZE > y
static std::string const input
Definition: EdmProvDump.cc:48
constexpr int row() const
Definition: FTLCluster.h:61
FTLClusterCollection::const_iterator ClusterIterator
T min(T a, T b)
Definition: MathUtil.h:58
virtual void clusterize(const FTLRecHitCollection &input, const MTDGeometry *geom, const MTDTopology *topo, FTLClusterCollection &output)=0
std::array< float, MAXSIZE > energy
std::array< UShort, MAXSIZE > x
constexpr int col() const
Definition: FTLCluster.h:62
#define constexpr