Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:28:30

0001 #ifndef RecoTracker_PixelSeeding_CAGraph_h
0002 #define RecoTracker_PixelSeeding_CAGraph_h
0003 
0004 #include <array>
0005 #include <string>
0006 #include <vector>
0007 
0008 struct CALayer {
0009   CALayer(const std::string &layerName, const int seqNum, std::size_t numberOfHits)
0010       : theName(layerName), theSeqNum(seqNum) {
0011     isOuterHitOfCell.resize(numberOfHits);
0012   }
0013 
0014   bool operator==(const std::string &otherString) const { return otherString == theName; }
0015 
0016   bool operator==(const int otherSeqNum) const { return otherSeqNum == theSeqNum; }
0017 
0018   const std::string &name() const { return theName; }
0019 
0020   const int seqNum() const { return theSeqNum; }
0021 
0022   std::vector<int> theOuterLayerPairs;
0023   std::vector<int> theInnerLayerPairs;
0024 
0025   std::vector<int> theOuterLayers;
0026   std::vector<int> theInnerLayers;
0027   std::vector<std::vector<unsigned int>> isOuterHitOfCell;
0028 
0029 private:
0030   std::string theName;
0031   int theSeqNum;
0032 };
0033 
0034 struct CALayerPair {
0035   CALayerPair(int a, int b)
0036 
0037   {
0038     theLayers[0] = a;
0039     theLayers[1] = b;
0040   }
0041 
0042   bool operator==(const CALayerPair &otherLayerPair) {
0043     return (theLayers[0] == otherLayerPair.theLayers[0]) && (theLayers[1] == otherLayerPair.theLayers[1]);
0044   }
0045 
0046   std::array<int, 2> theLayers;
0047   std::array<unsigned int, 2> theFoundCells = {{0, 0}};
0048 };
0049 
0050 struct CAGraph {
0051   int getLayerId(const std::string &layerName) {
0052     for (const auto &thisLayer : theLayers) {
0053       if (thisLayer == layerName)
0054         return thisLayer.seqNum();
0055     }
0056     return -1;
0057   }
0058 
0059   std::vector<CALayer> theLayers;
0060   std::vector<CALayerPair> theLayerPairs;
0061   std::vector<int> theRootLayers;
0062 };
0063 
0064 #endif  // RecoTracker_PixelSeeding_CAGraph_h