Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:07:53

0001 #ifndef Geometry_CSCGeometry_CSCChamberSpecs_H
0002 #define Geometry_CSCGeometry_CSCChamberSpecs_H
0003 
0004 /** \class CSCChamberSpecs
0005  *  Each endcap muon CSCChamberSpecs object is a set of parameters
0006  *  for one of several types of chamber. 
0007  * 
0008  * \author Tim Cox
0009  *
0010  * There are only a small finite number (9, or 10 incl. ME1A as separate) of distinct chamber types 
0011  * in the hardware, according to physical dimensions and properties. 
0012  * The individual types currently correspond to each (Station,Ring) pair.
0013  *
0014  * RESPONSIBILITIES: <br>
0015  * Supply chamber type-dependent parameters on demand.
0016  * Geometrical size is not a responsibility of the Specs class.
0017  *
0018  * COLLABORATORS: <br>
0019  * A Chamber knows its associated Specs.
0020  *
0021  * \warning Disclaimer:
0022  * The mess of methods was supposed to be a temporary hack until it was decided
0023  * how to handle such spec pars... but there's still nothing better. <BR>
0024  *
0025  */
0026 
0027 #include "Geometry/CommonDetUnit/interface/GeomDetType.h"
0028 
0029 #include <cmath>
0030 #include <string>
0031 #include <vector>
0032 
0033 class CSCGeometry;
0034 class CSCLayerGeometry;
0035 class CSCWireGroupPackage;
0036 class Topology;  //@@ Can go once GeomDetType has it removed.
0037 class TrapezoidalPlaneBounds;
0038 
0039 class CSCChamberSpecs : public GeomDetType {
0040 public:
0041   typedef std::vector<float> CSCSpecsParcel;
0042 
0043   /// Default ctor
0044   CSCChamberSpecs();
0045 
0046   /// Usual ctor from supplied params
0047   CSCChamberSpecs(const CSCGeometry* geom,
0048                   int iChamberType,
0049                   const TrapezoidalPlaneBounds& mediaShape,
0050                   const CSCSpecsParcel& fupar,
0051                   const CSCWireGroupPackage& wg);
0052 
0053   /// Destructor
0054   ~CSCChamberSpecs() override;
0055 
0056   /// Allow comparison of Specs objects
0057   bool operator!=(const CSCChamberSpecs& specs) const;
0058   bool operator==(const CSCChamberSpecs& specs) const;
0059 
0060   //@@ Topology() will be removed from GeomDetType interface (good, so we're no longer forced to pick something)
0061   //@@ But still there as of Aug-2007. So much for design.
0062 
0063   /// Returns StripTopology of the odd-layer, positive-z geometry
0064   const Topology& topology() const override;
0065 
0066   /// Accessors for LayerGeometry's
0067   const CSCLayerGeometry* oddLayerGeometry(int iendcap) const {
0068     return (iendcap == 1 ? poszOddLayerGeometry : negzOddLayerGeometry);
0069   }
0070   const CSCLayerGeometry* evenLayerGeometry(int iendcap) const {
0071     return (iendcap == 1 ? poszEvenLayerGeometry : negzEvenLayerGeometry);
0072   }
0073 
0074   /**
0075    *  The 'type' of the chamber associated with this ChamberSpecs. <br>
0076    *  The chamber type is a unique integer 1-10 for a station, ring pair
0077    *  MEs/r.
0078    *  The type value is defined as <br>
0079    *        1           for S = 1  and R=A=4 split strips in ME1/1 <br>
0080    *      2,3,4 =  R+1  for S = 1  and R = 1,2,3 <br>
0081    *      5-10  = 2*S+R for S = 2,3,4 and R = 1,2 <br>
0082    *   It is conventional usage in the Endcap Muon community/
0083    */
0084   int chamberType() const;
0085 
0086   /** The (hardware) name for the chamber type associated with
0087    * this ChamberSpecs. <BR>
0088    * It is a string "MEs/r" where integer s = station, r = ring.<BR>
0089    */
0090   std::string chamberTypeName() const;
0091 
0092   // CHAMBER 'PARAMETER' FUNCTIONS
0093   //@@ FIXME these must all be sorted out in a world of real conditions & calibration
0094 
0095   float stripResolution() const { return specsValue(0); }
0096   float wireResolution() const { return specsValue(1); }
0097   float efficiency() const { return specsValue(2); }
0098   float timeWindow() const { return specsValue(3); }
0099 
0100   /**
0101    * neutron hit rate per CSC layer per event.
0102    */
0103   float neutronRate() const { return specsValue(4); }
0104 
0105   /**
0106    * number of strips in one chamber.
0107    */
0108   int nStrips() const { return nstrips; }
0109 
0110   /**
0111    * number of strips 2*nnodes+1 around hit.
0112    */
0113   int nNodes() const { return int(specsValue(6)); }
0114   int nWiresPerGroup() const { return int(specsValue(7)); }
0115   int nFloatingStrips() const { return int(specsValue(8)); }
0116 
0117   /**
0118    * strip pitch in phi, in radians (the strips are fan-shaped)
0119    */
0120   float stripPhiPitch() const { return 1.E-03 * stripDeltaPhi; }
0121 
0122   /**
0123    * offset to centreToIntersection, in cm (the backed-out corrections 
0124    * for positioning the strips)
0125    */
0126   float ctiOffset() const { return centreToIntersectionOffset; }
0127 
0128   /**
0129    * wire spacing, in cm. All layers in a chamber have the same spacing.
0130    */
0131   float wireSpacing() const;
0132 
0133   /**
0134    * distance from anode to cathode, in cm.
0135    */
0136   float anodeCathodeSpacing() const { return specsValue(9); }
0137 
0138   float gasGain() const;
0139 
0140   float voltage() const { return specsValue(11); }
0141 
0142   float calibrationError() const { return specsValue(13); }
0143 
0144   float electronAttraction() const { return specsValue(14); }
0145 
0146   /**
0147   * the fraction of the charge that survives to reach the cathode.
0148   */
0149   float fractionQS() const { return specsValue(15); }
0150 
0151   /**
0152    * ADC calibration, in fC.
0153    */
0154   float chargePerCount() const;
0155 
0156   /**
0157    * anode wire radius, in cm.
0158    */
0159   float wireRadius() const { return specsValue(17); }
0160 
0161   /**
0162    * Fast shaper peaking time (ns).
0163    */
0164   float shaperPeakingTime() const { return specsValue(18); }
0165 
0166   /**
0167    * the constant term in the electronics noise, in # of electrons.
0168    */
0169   float constantNoise() const { return specsValue(22); }
0170 
0171   /**
0172    * the # of noise electrons per picofarad of capacitance.
0173    */
0174   float e_pF() const { return specsValue(23); }
0175 
0176   /**
0177    * the number of noise electrons.
0178    * the time interval is in ns
0179    *  we show the noise for 100 ns, then scale as 1/sqrt(time)
0180    */
0181   //@@ Why 1/sqrt(time)?!?
0182   float wireNoise(float timeInterval) const {
0183     const float WIRE_CAPACITANCE = 8.;  // in pF
0184     return (constantNoise() + nWiresPerGroup() * WIRE_CAPACITANCE) / sqrt(timeInterval / 100.);
0185   }
0186 
0187   float stripNoise(float timeInterval) const;
0188 
0189   //@@ The following is nonsense to be fixed at some stage
0190   //  float adcThreshold()        const {return 9.99;}
0191 
0192   /**
0193    * Are strips ganged?
0194    */
0195   bool gangedStrips() const { return gangedStrips_; }
0196 
0197   // STATIC FUNCTION
0198 
0199   /**
0200    * The usual integer label for 'chamber type' of this ring and station
0201    */
0202   static int whatChamberType(int istation, int iring);
0203 
0204 private:
0205   /// Accessor to chamber specs values
0206   float specsValue(int index) const { return theSpecsValues[index]; }
0207 
0208   // A ChamberSpecs has 4 associated LayerGeometry's
0209   CSCLayerGeometry* poszOddLayerGeometry;
0210   CSCLayerGeometry* poszEvenLayerGeometry;
0211   CSCLayerGeometry* negzOddLayerGeometry;
0212   CSCLayerGeometry* negzEvenLayerGeometry;
0213 
0214   //  theChamberType is a unique integer 1-10 for a station, ring pair.
0215 
0216   //  The type value is defined as <br>
0217   //        1           for S = 1  and R=A=4 split strips in ME11 <br>
0218   //      2,3,4 =  R+1  for S = 1  and R = 1,2,3 <br>
0219   //      5-10  = 2*S+R for S = 2,3,4 and R = 1,2 <br>
0220 
0221   int theChamberType;
0222 
0223   // Careful that the following order of data members is required to ensure
0224   // correct initialization in constructor initialization list!
0225 
0226   // Store for specs parameter values
0227   CSCSpecsParcel theSpecsValues;
0228 
0229   int nstrips;                       // no. of strips per layer
0230   float stripDeltaPhi;               // Delta-phi width of strip in this chamber type (in mrad)
0231   float centreToIntersectionOffset;  // Possible correction to whereStripsMeet
0232 
0233   bool gangedStrips_;
0234 
0235   // Names of chamber types
0236   static const std::string theName[10];
0237 
0238   // Name of this class
0239   static const std::string myName;
0240 };
0241 
0242 #endif  // Geometry_CSCGeometry_CSCChamberSpecs_H