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 
21 
25 
27 {
28 
29 public:
30 
32  explicit AlignableNavigator(Alignable* tracker, Alignable* muon = nullptr);
33 
35  explicit AlignableNavigator(AlignableExtras* extras, Alignable* tracker, Alignable* muon = nullptr);
36 
38  explicit AlignableNavigator(const align::Alignables&);
39 
40  typedef std::map<DetId, AlignableDetOrUnitPtr> MapType;
42 
45 
48 
50  std::vector<AlignableDetOrUnitPtr>
51  alignablesFromHits(const std::vector<const TransientTrackingRecHit*>& hitvec);
52 
54  std::vector<AlignableDetOrUnitPtr> alignablesFromHits
56 
58  std::vector<AlignableDetOrUnitPtr> alignableDetOrUnits();
59 
61  int size( void ) { return theMap.size(); }
62 
64  bool detAndSubdetInMap( const DetId& detid ) const;
65 
66 private:
70  unsigned int recursiveGetId(Alignable* alignable);
71 
72  MapType theMap;
73  std::vector<std::pair<int,int> > theDetAndSubdet;
74 };
75 
76 #endif
AlignableDetOrUnitPtr alignableFromGeomDet(const GeomDet *geomDet)
Returns AlignableDetOrUnitPtr corresponding to given GeomDet.
unsigned int recursiveGetId(Alignable *alignable)
std::vector< ConstRecHitPointer > ConstRecHitContainer
Definition: DetId.h:18
std::map< DetId, AlignableDetOrUnitPtr > MapType
std::vector< AlignableDetOrUnitPtr > alignableDetOrUnits()
return all AlignableDetOrUnitPtrs
AlignableNavigator(Alignable *tracker, Alignable *muon=0)
Constructor from one or two Alignables.
std::vector< Alignable * > Alignables
Definition: Utilities.h:32
std::vector< AlignableDetOrUnitPtr > alignablesFromHits(const std::vector< const TransientTrackingRecHit * > &hitvec)
Returns vector AlignableDetOrUnitPtr for given vector of Hits.
std::vector< std::pair< int, int > > theDetAndSubdet
int size(void)
Returns number of elements in map.
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...
AlignableDetOrUnitPtr alignableFromDetId(const DetId &detid)
Returns AlignableDetOrUnitPtr corresponding to given DetId.
MapType::value_type PairType