Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:56:05

0001 #ifndef Alignment_CommonAlignment_Counters_H
0002 #define Alignment_CommonAlignment_Counters_H
0003 
0004 /** \class AlignableIndexer
0005  *
0006  *  Class to store a list of index functions.
0007  *
0008  *  A counter is a pointer to a function that returns the number of an
0009  *  alignable based on its id.
0010  *  The number of an alignable is given by its position within its parent.
0011  *  User gets a counter using its structure type via AlignableIndexer::get(type).
0012  *  Each sub-system has its own concrete counter class implementation.
0013  *  
0014  *  $Date: 2007/10/18 09:41:07 $
0015  *  $Revision: 1.2 $
0016  *  \author Chung Khim Lae
0017  *
0018  *  Last Update: Max Stark
0019  *         Date: Wed, 17 Feb 2016 15:39:06 CET
0020  */
0021 
0022 #include <map>
0023 #include <functional>
0024 
0025 #include "Alignment/CommonAlignment/interface/StructureType.h"
0026 #include "Alignment/CommonAlignment/interface/AlignableObjectId.h"
0027 #include "CondFormats/Alignment/interface/Definitions.h"
0028 
0029 class TrackerTopology;
0030 namespace align {
0031   using Counter = std::function<unsigned int(align::ID)>;
0032 }
0033 
0034 class AlignableIndexer {
0035 public:
0036   /// Build the counters map.
0037   AlignableIndexer() = default;
0038   AlignableIndexer(const AlignableIndexer&) = default;
0039   AlignableIndexer& operator=(const AlignableIndexer&) = default;
0040   AlignableIndexer(AlignableIndexer&&) = default;
0041   AlignableIndexer& operator=(AlignableIndexer&&) = default;
0042   virtual ~AlignableIndexer() = default;
0043 
0044   /// Get a counter based on its structure type.
0045   virtual align::Counter get(align::StructureType, const AlignableObjectId&) const;
0046 
0047 protected:
0048   std::map<align::StructureType, align::Counter> theCounters;
0049 };
0050 
0051 #endif