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 
20 public:
23 
24  // Virtual destructor, this is a base class.
25  virtual ~MTDClusterizerBase() {}
26 
27  // Build clusters
28  virtual void clusterize(const FTLRecHitCollection& input,
29  const MTDGeometry* geom,
30  const MTDTopology* topo,
32 
33 protected:
35  typedef unsigned short UShort;
36  static constexpr UShort MAXSIZE = 256;
37 
38  std::array<float, MAXSIZE> energy;
39  std::array<float, MAXSIZE> time;
40  std::array<float, MAXSIZE> timeError;
41  std::array<UShort, MAXSIZE> x;
42  std::array<UShort, MAXSIZE> y;
43 
44  UShort xmin = 16000;
45  UShort ymin = 16000;
46  unsigned int isize = 0;
47  unsigned int curr = 0;
48 
49  // stack interface (unsafe ok for use below)
50  UShort top() const { return curr; }
51  void pop() { ++curr; }
52  bool empty() { return curr == isize; }
53 
54  bool add(FTLCluster::FTLHitPos const& p, float const ienergy, float const itime, float const itimeError) {
55  if (isize == MAXSIZE)
56  return false;
57  xmin = std::min(xmin, (unsigned short)(p.row()));
58  ymin = std::min(ymin, (unsigned short)(p.col()));
59  energy[isize] = ienergy;
60  time[isize] = itime;
61  timeError[isize] = itimeError;
62  x[isize] = p.row();
63  y[isize] = p.col();
64  isize++;
65  return true;
66  }
67  };
68 };
69 
70 #endif
MTDClusterizerBase::AccretionCluster::MAXSIZE
static constexpr UShort MAXSIZE
Definition: MTDClusterizerBase.h:36
edm::SortedCollection::const_iterator
std::vector< T >::const_iterator const_iterator
Definition: SortedCollection.h:80
input
static const std::string input
Definition: EdmProvDump.cc:48
MTDClusterizerBase::RecHitIterator
FTLRecHitCollection::const_iterator RecHitIterator
Definition: MTDClusterizerBase.h:21
MTDClusterizerBase::ClusterIterator
FTLClusterCollection::const_iterator ClusterIterator
Definition: MTDClusterizerBase.h:22
convertSQLitetoXML_cfg.output
output
Definition: convertSQLitetoXML_cfg.py:72
MTDClusterizerBase::AccretionCluster::xmin
UShort xmin
Definition: MTDClusterizerBase.h:44
min
T min(T a, T b)
Definition: MathUtil.h:58
MTDClusterizerBase::clusterize
virtual void clusterize(const FTLRecHitCollection &input, const MTDGeometry *geom, const MTDTopology *topo, FTLClusterCollection &output)=0
MTDClusterizerBase::AccretionCluster::x
std::array< UShort, MAXSIZE > x
Definition: MTDClusterizerBase.h:41
MTDClusterizerBase::AccretionCluster::add
bool add(FTLCluster::FTLHitPos const &p, float const ienergy, float const itime, float const itimeError)
Definition: MTDClusterizerBase.h:54
MTDGeometry.h
MTDClusterizerBase::AccretionCluster::y
std::array< UShort, MAXSIZE > y
Definition: MTDClusterizerBase.h:42
edmNew::DetSetVector::const_iterator
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
Definition: DetSetVectorNew.h:197
edm::SortedCollection
Definition: SortedCollection.h:49
FTLCluster::FTLHitPos
Definition: FTLCluster.h:57
MTDClusterizerBase::AccretionCluster::timeError
std::array< float, MAXSIZE > timeError
Definition: MTDClusterizerBase.h:40
MTDClusterizerBase::AccretionCluster::UShort
unsigned short UShort
Definition: MTDClusterizerBase.h:35
MTDClusterizerBase::AccretionCluster::top
UShort top() const
Definition: MTDClusterizerBase.h:50
MTDClusterizerBase::AccretionCluster::time
std::array< float, MAXSIZE > time
Definition: MTDClusterizerBase.h:39
MTDClusterizerBase
Definition: MTDClusterizerBase.h:19
MTDClusterizerBase::AccretionCluster::ymin
UShort ymin
Definition: MTDClusterizerBase.h:45
relativeConstraints.geom
geom
Definition: relativeConstraints.py:72
MTDClusterizerBase::AccretionCluster::pop
void pop()
Definition: MTDClusterizerBase.h:51
MTDClusterizerBase::AccretionCluster::energy
std::array< float, MAXSIZE > energy
Definition: MTDClusterizerBase.h:38
MTDTopology
Definition: MTDTopology.h:13
AlCaHLTBitMon_ParallelJobs.p
def p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
MTDClusterizerBase::AccretionCluster::empty
bool empty()
Definition: MTDClusterizerBase.h:52
MTDClusterizerBase::AccretionCluster::curr
unsigned int curr
Definition: MTDClusterizerBase.h:47
MTDClusterizerBase::~MTDClusterizerBase
virtual ~MTDClusterizerBase()
Definition: MTDClusterizerBase.h:25
DetSetVector.h
FTLRecHitCollections.h
MTDClusterizerBase::AccretionCluster
Definition: MTDClusterizerBase.h:34
MTDGeometry
Definition: MTDGeometry.h:14
edmNew::DetSetVector
Definition: DetSetNew.h:13
MTDClusterizerBase::AccretionCluster::isize
unsigned int isize
Definition: MTDClusterizerBase.h:46
FTLClusterCollections.h
DetSetVectorNew.h
MTDTopology.h