CMS 3D CMS Logo

CAGraph.h
Go to the documentation of this file.
1 #ifndef RecoPixelVertexing_PixelTriplets_src_CAGraph_h
2 #define RecoPixelVertexing_PixelTriplets_src_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 // RecoPixelVertexing_PixelTriplets_src_CAGraph_h
CALayer::operator==
bool operator==(const std::string &otherString) const
Definition: CAGraph.h:14
CALayerPair::theLayers
std::array< int, 2 > theLayers
Definition: CAGraph.h:46
CALayer::theName
std::string theName
Definition: CAGraph.h:30
CALayerPair::theFoundCells
std::array< unsigned int, 2 > theFoundCells
Definition: CAGraph.h:47
CAGraph::theRootLayers
std::vector< int > theRootLayers
Definition: CAGraph.h:61
CALayer::isOuterHitOfCell
std::vector< std::vector< unsigned int > > isOuterHitOfCell
Definition: CAGraph.h:27
CALayer::theInnerLayers
std::vector< int > theInnerLayers
Definition: CAGraph.h:26
CALayer::theSeqNum
int theSeqNum
Definition: CAGraph.h:31
CAGraph::theLayerPairs
std::vector< CALayerPair > theLayerPairs
Definition: CAGraph.h:60
CALayer::theOuterLayers
std::vector< int > theOuterLayers
Definition: CAGraph.h:25
CALayerPair::CALayerPair
CALayerPair(int a, int b)
Definition: CAGraph.h:35
CALayer::name
const std::string & name() const
Definition: CAGraph.h:18
b
double b
Definition: hdecay.h:118
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
a
double a
Definition: hdecay.h:119
CALayer
Definition: CAGraph.h:8
CALayer::operator==
bool operator==(const int otherSeqNum) const
Definition: CAGraph.h:16
CAGraph
Definition: CAGraph.h:50
CAGraph::getLayerId
int getLayerId(const std::string &layerName)
Definition: CAGraph.h:51
CALayerPair
Definition: CAGraph.h:34
CALayer::seqNum
const int seqNum() const
Definition: CAGraph.h:20
CAGraph::theLayers
std::vector< CALayer > theLayers
Definition: CAGraph.h:59
CALayerPair::operator==
bool operator==(const CALayerPair &otherLayerPair)
Definition: CAGraph.h:42
CALayer::theInnerLayerPairs
std::vector< int > theInnerLayerPairs
Definition: CAGraph.h:23
CALayer::CALayer
CALayer(const std::string &layerName, const int seqNum, std::size_t numberOfHits)
Definition: CAGraph.h:9
CALayer::theOuterLayerPairs
std::vector< int > theOuterLayerPairs
Definition: CAGraph.h:22