Belle II Software  release-05-02-19
DATCONHoughCand.h
1 /**************************************************************************
2  * BASF2 (Belle Analysis Framework 2) *
3  * Copyright(C) 2013 - Belle II Collaboration *
4  * *
5  * Author: The Belle II Collaboration *
6  * Contributors: Michael Schnell, Christian Wessel *
7  * *
8  * This software is provided "as is" without any warranty. *
9  **************************************************************************/
10 
11 #pragma once
12 
13 #include <root/TVector2.h>
14 
15 namespace Belle2 {
24  typedef std::pair<TVector2, TVector2> coord2dPair;
25 
29  class DATCONHoughCand {
30 
31  public:
32 
41  DATCONHoughCand(std::vector<unsigned int>& list, coord2dPair coord): hitList(list), coordinatePair(coord)
42  {
43  hash = 0;
44  hitSize = 0;
45  for (unsigned int i = 0; i < hitList.size(); ++i) {
46  hash += hitList[i];
47  ++hitSize;
48  }
49  }
50 
52  std::vector<unsigned int> getIdList() { return hitList; }
53 
55  coord2dPair getCoord() { return coordinatePair; }
56 
58  unsigned int getHash() const { return hash; }
59 
61  unsigned int getHitSize() const { return hitSize; }
62 
64  inline bool operator<(const DATCONHoughCand& b)
65  {
66  return (this->getHash() > b.getHash());
67  }
68 
69  private:
71  std::vector<unsigned int> hitList;
75  unsigned int hash;
77  unsigned int hitSize;
78  }; // end class definition
80 }; // end namespace Belle2
Belle2::DATCONHoughCand::hitSize
unsigned int hitSize
Size of this DATCONHoughCand.
Definition: DATCONHoughCand.h:85
Belle2::DATCONHoughCand::getCoord
coord2dPair getCoord()
Get Index list.
Definition: DATCONHoughCand.h:63
Belle2::DATCONHoughCand::hash
unsigned int hash
Hash for id list.
Definition: DATCONHoughCand.h:83
Belle2::DATCONHoughCand::getHash
unsigned int getHash() const
Get Hash of hit list.
Definition: DATCONHoughCand.h:66
Belle2::DATCONHoughCand::getHitSize
unsigned int getHitSize() const
Get Size of hit list.
Definition: DATCONHoughCand.h:69
Belle2::DATCONHoughCand::operator<
bool operator<(const DATCONHoughCand &b)
Smaller-than operator for sorting functions.
Definition: DATCONHoughCand.h:72
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::coord2dPair
std::pair< TVector2, TVector2 > coord2dPair
Typedef for the coord2dPair, which represents the DATCONHoughCand.
Definition: DATCONHoughCand.h:32
Belle2::DATCONHoughCand::DATCONHoughCand
DATCONHoughCand(std::vector< unsigned int > &list, coord2dPair coord)
Constructor for Hough candidates.
Definition: DATCONHoughCand.h:49
Belle2::DATCONHoughCand::getIdList
std::vector< unsigned int > getIdList()
Get Index list.
Definition: DATCONHoughCand.h:60
Belle2::DATCONHoughCand::coordinatePair
coord2dPair coordinatePair
Coordinate of rectangle for this candidate.
Definition: DATCONHoughCand.h:81
Belle2::DATCONHoughCand::hitList
std::vector< unsigned int > hitList
List of IDs of hits that belong to this DATCONHoughCand.
Definition: DATCONHoughCand.h:79