CMS 3D CMS Logo

AlignableNavigator.h
Go to the documentation of this file.
1 // $Revision: 1.15 $
2 // $Date: 2009/02/28 21:06:53 $
3 // (last update by $Author: flucke $)
4 
5 #ifndef Alignment_CommonAlignment_AlignableNavigator_h
6 #define Alignment_CommonAlignment_AlignableNavigator_h
7 
8 #include <map>
9 #include <vector>
10 
12 
15 
16 class Alignable;
17 class AlignableDet;
18 class AlignableExtras;
19 class GeomDet;
20 
24 
26 public:
28  explicit AlignableNavigator(Alignable* tracker, Alignable* muon = nullptr);
29 
31  explicit AlignableNavigator(AlignableExtras* extras, Alignable* tracker, Alignable* muon = nullptr);
32 
34  explicit AlignableNavigator(const align::Alignables&);
35 
36  typedef std::map<DetId, AlignableDetOrUnitPtr> MapType;
38 
41 
44 
46  std::vector<AlignableDetOrUnitPtr> alignablesFromHits(const std::vector<const TransientTrackingRecHit*>& hitvec);
47 
49  std::vector<AlignableDetOrUnitPtr> alignablesFromHits(const TransientTrackingRecHit::ConstRecHitContainer& hitVec);
50 
52  std::vector<AlignableDetOrUnitPtr> alignableDetOrUnits();
53 
55  int size(void) { return theMap.size(); }
56 
58  bool detAndSubdetInMap(const DetId& detid) const;
59 
60 private:
64  unsigned int recursiveGetId(Alignable* alignable);
65 
67  std::vector<std::pair<int, int> > theDetAndSubdet;
68 };
69 
70 #endif
AlignableDetOrUnitPtr alignableFromGeomDet(const GeomDet *geomDet)
Returns AlignableDetOrUnitPtr corresponding to given GeomDet.
bool detAndSubdetInMap(const DetId &detid) const
Given a DetId, returns true if DetIds with this detector and subdetector id are in the map (not neces...
AlignableNavigator(Alignable *tracker, Alignable *muon=nullptr)
Constructor from one or two Alignables.
unsigned int recursiveGetId(Alignable *alignable)
std::vector< std::pair< int, int > > theDetAndSubdet
std::vector< ConstRecHitPointer > ConstRecHitContainer
Definition: DetId.h:17
std::map< DetId, AlignableDetOrUnitPtr > MapType
std::vector< AlignableDetOrUnitPtr > alignableDetOrUnits()
return all AlignableDetOrUnitPtrs
std::vector< Alignable * > Alignables
Definition: Utilities.h:31
std::vector< AlignableDetOrUnitPtr > alignablesFromHits(const std::vector< const TransientTrackingRecHit *> &hitvec)
Returns vector AlignableDetOrUnitPtr for given vector of Hits.
int size(void)
Returns number of elements in map.
AlignableDetOrUnitPtr alignableFromDetId(const DetId &detid)
Returns AlignableDetOrUnitPtr corresponding to given DetId.
MapType::value_type PairType