CMS 3D CMS Logo

CAGraph.h
Go to the documentation of this file.
1 #ifndef RecoTracker_PixelSeeding_CAGraph_h
2 #define RecoTracker_PixelSeeding_CAGraph_h
3 
4 #include <array>
5 #include <string>
6 #include <vector>
7 
8 struct CALayer {
9  CALayer(const std::string &layerName, const int seqNum, std::size_t numberOfHits)
10  : theName(layerName), theSeqNum(seqNum) {
11  isOuterHitOfCell.resize(numberOfHits);
12  }
13 
14  bool operator==(const std::string &otherString) const { return otherString == theName; }
15 
16  bool operator==(const int otherSeqNum) const { return otherSeqNum == theSeqNum; }
17 
18  const std::string &name() const { return theName; }
19 
20  const int seqNum() const { return theSeqNum; }
21 
22  std::vector<int> theOuterLayerPairs;
23  std::vector<int> theInnerLayerPairs;
24 
25  std::vector<int> theOuterLayers;
26  std::vector<int> theInnerLayers;
27  std::vector<std::vector<unsigned int>> isOuterHitOfCell;
28 
29 private:
31  int theSeqNum;
32 };
33 
34 struct CALayerPair {
35  CALayerPair(int a, int b)
36 
37  {
38  theLayers[0] = a;
39  theLayers[1] = b;
40  }
41 
42  bool operator==(const CALayerPair &otherLayerPair) {
43  return (theLayers[0] == otherLayerPair.theLayers[0]) && (theLayers[1] == otherLayerPair.theLayers[1]);
44  }
45 
46  std::array<int, 2> theLayers;
47  std::array<unsigned int, 2> theFoundCells = {{0, 0}};
48 };
49 
50 struct CAGraph {
51  int getLayerId(const std::string &layerName) {
52  for (const auto &thisLayer : theLayers) {
53  if (thisLayer == layerName)
54  return thisLayer.seqNum();
55  }
56  return -1;
57  }
58 
59  std::vector<CALayer> theLayers;
60  std::vector<CALayerPair> theLayerPairs;
61  std::vector<int> theRootLayers;
62 };
63 
64 #endif // RecoTracker_PixelSeeding_CAGraph_h
CALayerPair(int a, int b)
Definition: CAGraph.h:35
bool operator==(const int otherSeqNum) const
Definition: CAGraph.h:16
std::array< int, 2 > theLayers
Definition: CAGraph.h:46
std::array< unsigned int, 2 > theFoundCells
Definition: CAGraph.h:47
std::vector< int > theOuterLayerPairs
Definition: CAGraph.h:22
const std::string & name() const
Definition: CAGraph.h:18
int getLayerId(const std::string &layerName)
Definition: CAGraph.h:51
std::string theName
Definition: CAGraph.h:30
bool operator==(const CALayerPair &otherLayerPair)
Definition: CAGraph.h:42
std::vector< CALayer > theLayers
Definition: CAGraph.h:59
CALayer(const std::string &layerName, const int seqNum, std::size_t numberOfHits)
Definition: CAGraph.h:9
std::vector< CALayerPair > theLayerPairs
Definition: CAGraph.h:60
Definition: CAGraph.h:8
double b
Definition: hdecay.h:118
const int seqNum() const
Definition: CAGraph.h:20
bool operator==(const std::string &otherString) const
Definition: CAGraph.h:14
std::vector< int > theInnerLayers
Definition: CAGraph.h:26
int theSeqNum
Definition: CAGraph.h:31
double a
Definition: hdecay.h:119
std::vector< int > theRootLayers
Definition: CAGraph.h:61
std::vector< int > theInnerLayerPairs
Definition: CAGraph.h:23
std::vector< std::vector< unsigned int > > isOuterHitOfCell
Definition: CAGraph.h:27
std::vector< int > theOuterLayers
Definition: CAGraph.h:25