Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef Alignment_TrackerAlignment_AlignableTracker_H
0002 #define Alignment_TrackerAlignment_AlignableTracker_H
0003 
0004 // Original Author:  ?
0005 //     Last Update:  Max Stark
0006 //            Date:  Mon, 15 Feb 2016 09:32:12 CET
0007 
0008 // alignment
0009 #include "Alignment/CommonAlignment/interface/AlignableMap.h"
0010 #include "Alignment/CommonAlignment/interface/AlignableComposite.h"
0011 #include "Alignment/CommonAlignment/interface/AlignableObjectId.h"
0012 #include "Alignment/TrackerAlignment/interface/TrackerNameSpace.h"
0013 
0014 class TrackerGeometry;
0015 class TrackerTopology;
0016 
0017 class AlignableTracker : public AlignableComposite {
0018   /// grant access for the tracker-alignables builder
0019   friend class AlignableTrackerBuilder;
0020 
0021 public:
0022   AlignableTracker(const TrackerGeometry*, const TrackerTopology*);
0023   ~AlignableTracker() override{/* TODO: delete all tracker-alignables? */};
0024 
0025   /// Return alignables of subdet and hierarchy level determined by name
0026   /// as defined in tracker part of Alignment/CommonAlignment/StructureType.h
0027   Alignables& subStructures(const std::string& subStructName) { return alignableMap_.find(subStructName); }
0028 
0029   /// Updater using TrackerGeometry and TrackerTopology.
0030   /// The given geometry and topology have to match the current ones.
0031   void update(const TrackerGeometry*, const TrackerTopology*);
0032 
0033   /// Return TOB half barrels
0034   Alignables& outerHalfBarrels() { return this->subStructures(alignableObjectId_.typeToName(align::TOBHalfBarrel)); }
0035   /// Return TIB half barrels
0036   Alignables& innerHalfBarrels() { return this->subStructures(alignableObjectId_.typeToName(align::TIBHalfBarrel)); }
0037   /// Return Pixel half barrels
0038   Alignables& pixelHalfBarrels() { return this->subStructures(alignableObjectId_.typeToName(align::TPBHalfBarrel)); }
0039   /// Return TECs
0040   Alignables& endCaps() { return this->subStructures(alignableObjectId_.typeToName(align::TECEndcap)); }
0041   /// Return TPEs
0042   Alignables& pixelEndCaps() { return this->subStructures(alignableObjectId_.typeToName(align::TPEEndcap)); }
0043   /// Return TIDs
0044   Alignables& TIDs() { return this->subStructures(alignableObjectId_.typeToName(align::TIDEndcap)); }
0045   /// Return pixel endcap half cylinders
0046   Alignables& pixelEndcapHalfCylinders() {
0047     return this->subStructures(alignableObjectId_.typeToName(align::TPEHalfCylinder));
0048   }
0049 
0050   /// Return inner and outer barrel GeomDets together
0051   Alignables barrelGeomDets() { return this->merge(this->innerBarrelGeomDets(), this->outerBarrelGeomDets()); }
0052   /// Return inner barrel and TID GeomDets together
0053   Alignables TIBTIDGeomDets() { return this->merge(this->innerBarrelGeomDets(), this->TIDGeomDets()); }
0054   /// Return inner barrel GeomDets
0055   Alignables& innerBarrelGeomDets() { return this->subStructures(alignableObjectId_.typeToName(align::TIBModule)); }
0056   /// Return outer barrel GeomDets
0057   Alignables& outerBarrelGeomDets() { return this->subStructures(alignableObjectId_.typeToName(align::TOBModule)); }
0058   /// Return pixel barrel GeomDets
0059   Alignables& pixelHalfBarrelGeomDets() { return this->subStructures(alignableObjectId_.typeToName(align::TPBModule)); }
0060   /// Return endcap  GeomDets
0061   Alignables& endcapGeomDets() { return this->subStructures(alignableObjectId_.typeToName(align::TECModule)); }
0062   /// Return TID  GeomDets
0063   Alignables& TIDGeomDets() { return this->subStructures(alignableObjectId_.typeToName(align::TIDModule)); }
0064   /// Return pixel endcap GeomDets
0065   Alignables& pixelEndcapGeomDets() { return this->subStructures(alignableObjectId_.typeToName(align::TPEModule)); }
0066 
0067   /// Return inner and outer barrel rods
0068   Alignables barrelRods() { return this->merge(this->innerBarrelRods(), this->outerBarrelRods()); }
0069   /// Return inner barrel rods
0070   Alignables& innerBarrelRods() { return this->subStructures(alignableObjectId_.typeToName(align::TIBString)); }
0071   /// Return outer barrel rods
0072   Alignables& outerBarrelRods() { return this->subStructures(alignableObjectId_.typeToName(align::TOBRod)); }
0073   /// Return pixel half barrel ladders (implemented as AlignableRods)
0074   Alignables& pixelHalfBarrelLadders() { return this->subStructures(alignableObjectId_.typeToName(align::TPBLadder)); }
0075   /// Return encap petals
0076   Alignables& endcapPetals() { return this->subStructures(alignableObjectId_.typeToName(align::TECPetal)); }
0077   /// Return TID rings
0078   Alignables& TIDRings() { return this->subStructures(alignableObjectId_.typeToName(align::TIDRing)); }
0079   /// Return pixel endcap petals
0080   Alignables& pixelEndcapPetals() { return this->subStructures(alignableObjectId_.typeToName(align::TPEPanel)); }
0081 
0082   /// Return inner and outer barrel layers
0083   Alignables barrelLayers() { return this->merge(this->innerBarrelLayers(), this->outerBarrelLayers()); }
0084   /// Return inner barrel layers
0085   Alignables& innerBarrelLayers() { return this->subStructures(alignableObjectId_.typeToName(align::TIBLayer)); }
0086   /// Return outer barrel layers
0087   Alignables& outerBarrelLayers() { return this->subStructures(alignableObjectId_.typeToName(align::TOBLayer)); }
0088   /// Return pixel half barrel layers
0089   Alignables& pixelHalfBarrelLayers() { return this->subStructures(alignableObjectId_.typeToName(align::TPBLayer)); }
0090   /// Return endcap layers
0091   Alignables& endcapLayers() { return this->subStructures(alignableObjectId_.typeToName(align::TECDisk)); }
0092   /// Return TID layers
0093   Alignables& TIDLayers() { return this->subStructures(alignableObjectId_.typeToName(align::TIDDisk)); }
0094   /// Return pixel endcap layers
0095   Alignables& pixelEndcapLayers() { return this->subStructures(alignableObjectId_.typeToName(align::TPEHalfDisk)); }
0096 
0097   /// Return alignments, sorted by DetId
0098   Alignments* alignments() const override;
0099 
0100   /// Return alignment errors, sorted by DetId
0101   AlignmentErrorsExtended* alignmentErrors() const override;
0102 
0103   /// Return tracker topology used to build AlignableTracker
0104   const TrackerTopology* trackerTopology() const { return tTopo_; }
0105 
0106   /// Return tracker name space derived from the tracker's topology
0107   const align::TrackerNameSpace& trackerNameSpace() const { return trackerNameSpace_; }
0108 
0109   /// Return tracker alignable object ID provider derived from the tracker's geometry
0110   const AlignableObjectId& objectIdProvider() const { return alignableObjectId_; }
0111 
0112 private:
0113   Alignables merge(const Alignables& list1, const Alignables& list2) const;
0114 
0115   const TrackerTopology* tTopo_;
0116   align::TrackerNameSpace trackerNameSpace_;
0117   AlignableObjectId alignableObjectId_;
0118   AlignableMap alignableMap_;
0119 };
0120 
0121 #endif  //AlignableTracker_H