Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-08-05 11:11:44

0001 #include <Geometry/CSCGeometry/interface/CSCGeometry.h>
0002 #include <Geometry/CSCGeometry/interface/CSCChamberSpecs.h>
0003 #include <Geometry/CSCGeometry/interface/CSCLayerGeometry.h>
0004 #include <Geometry/CSCGeometry/interface/CSCWireGroupPackage.h>
0005 #include <DataFormats/GeometrySurface/interface/TrapezoidalPlaneBounds.h>
0006 #include <FWCore/MessageLogger/interface/MessageLogger.h>
0007 
0008 using namespace GeomDetEnumerators;
0009 
0010 CSCChamberSpecs::CSCChamberSpecs(const CSCGeometry* geom,
0011                                  int iChamberType,
0012                                  const TrapezoidalPlaneBounds& bounds,
0013                                  const CSCSpecsParcel& fupar,
0014                                  const CSCWireGroupPackage& wg)
0015     : GeomDetType("CSC", CSC),
0016       theChamberType(iChamberType),
0017       theSpecsValues(fupar),
0018       nstrips(static_cast<int>(specsValue(5))),
0019       stripDeltaPhi(specsValue(29)),
0020       centreToIntersectionOffset(specsValue(30)),
0021       gangedStrips_(false) {
0022   LogTrace("CSCChamberSpecs|CSC") << myName << ": constructing specs for chamber " << theName[iChamberType - 1]
0023                                   << ", type=" << iChamberType << ", this =" << this;
0024 
0025   // Reset gangedStrips_ for ME1A from config parameter
0026   if (iChamberType == 1)
0027     gangedStrips_ = geom->gangedStrips();
0028 
0029   // Most wire info now comes from wire group section of DDD, but this doesn't...
0030   float wireAngleInDegrees = specsValue(12);
0031 
0032   // Related to strip geometry...
0033   float stripOffset1 = specsValue(20);
0034   float stripOffset2 = specsValue(21);
0035   float globalRadialPositionOfAlignmentPin = specsValue(24);
0036   float distanceFrameToAlignmentPin = specsValue(25);
0037   float lengthOfChamber = specsValue(26);
0038   float distanceEndOfStripToAlignmentPin = specsValue(27);
0039   float extentOfStripPlane = specsValue(28);
0040 
0041   // local y of alignment pin
0042   float yAlignmentPin = -lengthOfChamber / 2. + distanceFrameToAlignmentPin;
0043 
0044   // distance from alignment pin to symmetry centre of strip plane
0045   float alignmentPinToCentreOfStripPlane = distanceEndOfStripToAlignmentPin + extentOfStripPlane / 2.;
0046 
0047   // local y of symmetry centre of strip plane
0048   float yCentreOfStripPlane = yAlignmentPin + alignmentPinToCentreOfStripPlane;
0049 
0050   // distance from intersection of strips to symmetry centre of strip plane
0051   float whereStripsMeet = globalRadialPositionOfAlignmentPin + alignmentPinToCentreOfStripPlane;
0052 
0053   // Possibly 'correct' distance to strip intersection
0054   //  if ( useCentreTIOffsets ) {
0055   //    float ctiOffset = this->ctiOffset();
0056   //    whereStripsMeet += ctiOffset;
0057   //  }
0058   whereStripsMeet += centreToIntersectionOffset;  // will have been reset to zero if not active
0059 
0060   // local y value of 1st wire in wire plane
0061   double yOfFirstWire = yAlignmentPin + wg.alignmentPinToFirstWire / 10.;  //@@ in cm
0062 
0063   // Build the unique LayerGeometry objects we require for each chamber type.
0064   // - There are 2 endcaps
0065   // - Alternate layers of strips are offset w.r.t. each other
0066   // - In ME11 the wire tilt angle needs to be a constant
0067   // global value; in the CMS local coordinates this is positive in +z
0068   // and negative in -z (magnitude 29 degrees as of 2002)
0069 
0070   // Thus we need 4 LGs differing in strip offset and wire angle
0071 
0072   float phiPitch = this->stripPhiPitch();
0073 
0074   // Layer thickness can come from specs too
0075   float hThickness = specsValue(32) / 10. / 2.;  // mm->cm, and then want half the thickness
0076 
0077   poszOddLayerGeometry = new CSCLayerGeometry(geom,
0078                                               iChamberType,
0079                                               bounds,
0080                                               nstrips,
0081                                               -stripOffset1,
0082                                               phiPitch,
0083                                               whereStripsMeet,
0084                                               extentOfStripPlane,
0085                                               yCentreOfStripPlane,
0086                                               wg,
0087                                               wireAngleInDegrees,
0088                                               yOfFirstWire,
0089                                               hThickness);
0090 
0091   poszEvenLayerGeometry = new CSCLayerGeometry(geom,
0092                                                iChamberType,
0093                                                bounds,
0094                                                nstrips,
0095                                                -stripOffset2,
0096                                                phiPitch,
0097                                                whereStripsMeet,
0098                                                extentOfStripPlane,
0099                                                yCentreOfStripPlane,
0100                                                wg,
0101                                                wireAngleInDegrees,
0102                                                yOfFirstWire,
0103                                                hThickness);
0104 
0105   negzOddLayerGeometry = new CSCLayerGeometry(geom,
0106                                               iChamberType,
0107                                               bounds,
0108                                               nstrips,
0109                                               -stripOffset1,
0110                                               phiPitch,
0111                                               whereStripsMeet,
0112                                               extentOfStripPlane,
0113                                               yCentreOfStripPlane,
0114                                               wg,
0115                                               -wireAngleInDegrees,
0116                                               yOfFirstWire,
0117                                               hThickness);
0118 
0119   negzEvenLayerGeometry = new CSCLayerGeometry(geom,
0120                                                iChamberType,
0121                                                bounds,
0122                                                nstrips,
0123                                                -stripOffset2,
0124                                                phiPitch,
0125                                                whereStripsMeet,
0126                                                extentOfStripPlane,
0127                                                yCentreOfStripPlane,
0128                                                wg,
0129                                                -wireAngleInDegrees,
0130                                                yOfFirstWire,
0131                                                hThickness);
0132 }
0133 
0134 CSCChamberSpecs::~CSCChamberSpecs() {
0135   LogTrace("CSCChamberSpecs|CSC") << myName << " destroying this=" << this;
0136 
0137   delete poszOddLayerGeometry;
0138   delete poszEvenLayerGeometry;
0139   delete negzOddLayerGeometry;
0140   delete negzEvenLayerGeometry;
0141 }
0142 
0143 bool CSCChamberSpecs::operator!=(const CSCChamberSpecs& specs) const {
0144   if ((theChamberType != specs.theChamberType))
0145     return true;
0146   else
0147     return false;
0148 }
0149 
0150 bool CSCChamberSpecs::operator==(const CSCChamberSpecs& specs) const { return !(operator!=(specs)); }
0151 
0152 const Topology& CSCChamberSpecs::topology() const { return *(poszOddLayerGeometry->topology()); }
0153 
0154 int CSCChamberSpecs::chamberType() const { return theChamberType; }
0155 
0156 std::string CSCChamberSpecs::chamberTypeName() const { return theName[chamberType() - 1]; }
0157 
0158 // Build theChamberType value for a (station, ring) pair
0159 //             an integer 1-10 corresponding to
0160 //        1           for S = 1  and R=A=4 split strips in ME11
0161 //      2,3,4 =  R+1  for S = 1  and R = 1,2,3
0162 //      5-10  = 2*S+R for S = 2,3,4 and R = 1,2
0163 
0164 int CSCChamberSpecs::whatChamberType(int istation, int iring) {
0165   int i = 2 * istation + iring;  // i=2S+R
0166   if (istation == 1) {
0167     --i;  // ring 1R -> i=1+R (2S+R-1=1+R for S=1)
0168     if (i > 4) {
0169       i = 1;  // But ring 1A (R=4) -> i=1
0170     }
0171   }
0172   return i;
0173 }
0174 
0175 float CSCChamberSpecs::wireSpacing() const { return poszOddLayerGeometry->wirePitch(); }
0176 
0177 float CSCChamberSpecs::stripNoise(float timeInterval) const {
0178   const float pF_cm = 0.75;
0179   return (constantNoise() + e_pF() * pF_cm * poszOddLayerGeometry->length()) / sqrt(timeInterval / 100.);
0180 }
0181 
0182 float CSCChamberSpecs::gasGain() const {
0183   // ME1/1 makes up for its small gap by a big electronics gain
0184   // so use one gas gain value for all chambers (=300000)
0185   return 3.0e05;
0186 }
0187 
0188 float CSCChamberSpecs::chargePerCount() const {
0189   if (theChamberType <= 2) {
0190     return 0.25;
0191   } else {
0192     return 0.5;
0193   }
0194 }
0195 
0196 // STATICS
0197 
0198 // Define the name of each chamber type
0199 const std::string CSCChamberSpecs::theName[] = {
0200     "ME1/a", "ME1/b", "ME1/2", "ME1/3", "ME2/1", "ME2/2", "ME3/1", "ME3/2", "ME4/1", "ME4/2"};
0201 
0202 // Define name of this class
0203 const std::string CSCChamberSpecs::myName = "CSCChamberSpecs";