Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:26:49

0001 #ifndef _TrackerLayer_H_
0002 #define _TrackerLayer_H_
0003 
0004 #include "DataFormats/GeometrySurface/interface/BoundSurface.h"
0005 #include "DataFormats/GeometrySurface/interface/BoundCylinder.h"
0006 #include "DataFormats/GeometrySurface/interface/BoundDisk.h"
0007 
0008 #include <vector>
0009 
0010 /** A class that gives some properties of the Tracker Layers in FAMOS
0011  */
0012 
0013 class TrackerLayer {
0014 public:
0015   /// constructor from private members
0016   TrackerLayer(BoundSurface* theSurface,
0017                bool isForward,
0018                unsigned int theLayerNumber,
0019                const std::vector<double>& theMinDim,
0020                const std::vector<double>& theMaxDim,
0021                const std::vector<double>& theFudge)
0022       : theSurface(theSurface),
0023         isForward(isForward),
0024         theLayerNumber(theLayerNumber),
0025         theDimensionMinValues(theMinDim),
0026         theDimensionMaxValues(theMaxDim),
0027         theFudgeFactors(theFudge),
0028         theNumberOfFudgeFactors(theFudgeFactors.size()) {
0029     isSensitive = (theLayerNumber < 100);
0030     if (isForward) {
0031       theDisk = dynamic_cast<BoundDisk*>(theSurface);
0032       theDiskInnerRadius = theDisk->innerRadius();
0033       theDiskOuterRadius = theDisk->outerRadius();
0034       theCylinder = nullptr;
0035     } else {
0036       theCylinder = dynamic_cast<BoundCylinder*>(theSurface);
0037       theDisk = nullptr;
0038       theDiskInnerRadius = 0.;
0039       theDiskOuterRadius = 0.;
0040     }
0041   }
0042 
0043   TrackerLayer(BoundSurface* theSurface,
0044                unsigned int theLayerNumber,
0045                const std::vector<double>& theMinDim,
0046                const std::vector<double>& theMaxDim,
0047                const std::vector<double>& theFudge)
0048       : theSurface(theSurface),
0049         theLayerNumber(theLayerNumber),
0050         theDimensionMinValues(theMinDim),
0051         theDimensionMaxValues(theMaxDim),
0052         theFudgeFactors(theFudge),
0053         theNumberOfFudgeFactors(theFudgeFactors.size()) {
0054     isSensitive = true;
0055     isForward = true;
0056     theDisk = dynamic_cast<BoundDisk*>(theSurface);
0057     theDiskInnerRadius = theDisk->innerRadius();
0058     theDiskOuterRadius = theDisk->outerRadius();
0059     theCylinder = nullptr;
0060   }
0061 
0062   /// Is the layer sensitive ?
0063   inline bool sensitive() const { return isSensitive; }
0064 
0065   /// Is the layer forward ?
0066   inline bool forward() const { return isForward; }
0067 
0068   /// Returns the surface
0069   inline const BoundSurface& surface() const { return *theSurface; }
0070 
0071   /// Returns the cylinder
0072   inline BoundCylinder const* cylinder() const { return theCylinder; }
0073 
0074   /// Returns the surface
0075   inline BoundDisk const* disk() const { return theDisk; }
0076 
0077   /// Returns the layer number
0078   inline unsigned int layerNumber() const { return theLayerNumber; }
0079 
0080   /// Returns the inner radius of a disk
0081   inline double diskInnerRadius() const { return theDiskInnerRadius; }
0082 
0083   /// Returns the outer radius of a disk
0084   inline double diskOuterRadius() const { return theDiskOuterRadius; }
0085 
0086   /// Set a fudge factor for material inhomogeneities in this layer
0087   /*
0088   void setFudgeFactor(double min, double max, double f) { 
0089     ++theNumberOfFudgeFactors;
0090     theDimensionMinValues.push_back(min);
0091     theDimensionMaxValues.push_back(max);
0092     theFudgeFactors.push_back(f);
0093   }
0094   */
0095 
0096   /// Get the fudge factors back
0097   inline unsigned int fudgeNumber() const { return theNumberOfFudgeFactors; }
0098   inline double fudgeMin(unsigned iFudge) const {
0099     return (iFudge < theNumberOfFudgeFactors) ? theDimensionMinValues[iFudge] : 999.;
0100   }
0101   inline double fudgeMax(unsigned iFudge) const {
0102     return (iFudge < theNumberOfFudgeFactors) ? theDimensionMaxValues[iFudge] : -999.;
0103   }
0104   inline double fudgeFactor(unsigned iFudge) const {
0105     return (iFudge < theNumberOfFudgeFactors) ? theFudgeFactors[iFudge] : 0.;
0106   }
0107 
0108 private:
0109   BoundSurface* theSurface;
0110   BoundDisk* theDisk;
0111   BoundCylinder* theCylinder;
0112   bool isForward;
0113   unsigned int theLayerNumber;
0114   bool isSensitive;
0115   double theDiskInnerRadius;
0116   double theDiskOuterRadius;
0117 
0118   /// These are fudges factors to account for the inhomogeneities of the material
0119   std::vector<double> theDimensionMinValues;
0120   std::vector<double> theDimensionMaxValues;
0121   std::vector<double> theFudgeFactors;
0122   unsigned int theNumberOfFudgeFactors;
0123 };
0124 #endif