Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 11:57:25

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   void buildOuterTrackerDetectorAlignable(
0053       const GeomDet*, int subdetId, Alignables& aliDets, Alignables& aliDetUnits, bool update = false);
0054 
0055   /// Builds all composite Alignables for the tracker. The hierarchy and
0056   /// numbers of components are determined in TrackerAlignmentLevelBuilder.
0057   void buildAlignableComposites(bool update = false);
0058   /// Builds the PixelDetector by hand.
0059   void buildPixelDetector(AlignableTracker*);
0060   /// Builds the StripDetector by hand.
0061   void buildStripDetector(AlignableTracker*);
0062   /// Builds the Phase-2 Outer Tracker Detector by hand.
0063   void buildOuterTrackerDetector(AlignableTracker*);
0064 
0065   //========================== PRIVATE DATA ===================================
0066   //===========================================================================
0067 
0068   const TrackerGeometry* trackerGeometry_;
0069   const TrackerTopology* trackerTopology_;
0070   const AlignableObjectId alignableObjectId_;
0071 
0072   AlignableMap* alignableMap_;
0073 
0074   TrackerAlignmentLevelBuilder trackerAlignmentLevelBuilder_;
0075 
0076   int numDetUnits = 0;
0077 };
0078 
0079 #endif /* ALIGNMENT_TRACKERALIGNMENT_INTERFACE_ALIGNABLETRACKERBUILDER_H_ */