Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:46:14

0001 #ifndef ALIGNMENT_TRACKERALIGNMENT_INTERFACE_ALIGNABLETRACKERBUILDER_H_
0002 #define ALIGNMENT_TRACKERALIGNMENT_INTERFACE_ALIGNABLETRACKERBUILDER_H_
0003 
0004 // Original Author:  Max Stark
0005 //         Created:  Thu, 13 Jan 2016 10:22:57 CET
0006 
0007 // topology and geometry
0008 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0009 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0010 #include "Geometry/CommonDetUnit/interface/TrackingGeometry.h"
0011 
0012 // alignment
0013 #include "Alignment/CommonAlignment/interface/Utilities.h"
0014 #include "Alignment/TrackerAlignment/interface/AlignableTracker.h"
0015 #include "Alignment/TrackerAlignment/interface/TrackerAlignmentLevelBuilder.h"
0016 
0017 class AlignableTrackerBuilder {
0018   using Alignables = align::Alignables;
0019 
0020   //========================== PUBLIC METHODS =================================
0021 public:  //===================================================================
0022   AlignableTrackerBuilder(const TrackerGeometry*, const TrackerTopology*);
0023   virtual ~AlignableTrackerBuilder() = default;
0024 
0025   /// Builds all Alignables (units and composites) of the tracker, based on
0026   /// the given TrackerGeometry.
0027   void buildAlignables(AlignableTracker*, bool update = false);
0028 
0029   /// Return tracker name space derived from the tracker's topology
0030   const align::TrackerNameSpace& trackerNameSpace() const { return trackerAlignmentLevelBuilder_.trackerNameSpace(); }
0031 
0032   /// Return tracker alignable object ID provider  derived from the tracker's geometry
0033   const AlignableObjectId& objectIdProvider() const { return alignableObjectId_; }
0034 
0035   //========================= PRIVATE METHODS =================================
0036 private:  //==================================================================
0037   /// Builds Alignables on module-level for each part of the tracker.
0038   void buildAlignableDetUnits(bool update = false);
0039   /// Decides whether a GeomDet is from Pixel- or Strip-Detector and calls
0040   /// the according method to build the Alignable.
0041   void convertGeomDetsToAlignables(const TrackingGeometry::DetContainer&,
0042                                    const std::string& moduleName,
0043                                    bool update = false);
0044   /// Converts GeomDetUnits of PXB and PXE to AlignableDetUnits.
0045   void buildPixelDetectorAlignable(
0046       const GeomDet*, int subdetId, Alignables& aliDets, Alignables& aliDetUnits, bool update = false);
0047   /// Converts GeomDets of TIB, TID, TOB and TEC either to AlignableDetUnits
0048   /// or AlignableSiStripDet, depending on the module-type (2D or 1D).
0049   void buildStripDetectorAlignable(
0050       const GeomDet*, int subdetId, Alignables& aliDets, Alignables& aliDetUnits, bool update = false);
0051 
0052   /// Builds all composite Alignables for the tracker. The hierarchy and
0053   /// numbers of components are determined in TrackerAlignmentLevelBuilder.
0054   void buildAlignableComposites(bool update = false);
0055   /// Builds the PixelDetector by hand.
0056   void buildPixelDetector(AlignableTracker*);
0057   /// Builds the StripDetector by hand.
0058   void buildStripDetector(AlignableTracker*);
0059 
0060   //========================== PRIVATE DATA ===================================
0061   //===========================================================================
0062 
0063   const TrackerGeometry* trackerGeometry_;
0064   const TrackerTopology* trackerTopology_;
0065   const AlignableObjectId alignableObjectId_;
0066 
0067   AlignableMap* alignableMap_;
0068 
0069   TrackerAlignmentLevelBuilder trackerAlignmentLevelBuilder_;
0070 
0071   int numDetUnits = 0;
0072 };
0073 
0074 #endif /* ALIGNMENT_TRACKERALIGNMENT_INTERFACE_ALIGNABLETRACKERBUILDER_H_ */