CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/Geometry/CSCGeometry/src/CSCChamberSpecs.cc

Go to the documentation of this file.
00001 #include <Geometry/CSCGeometry/interface/CSCChamberSpecs.h>
00002 #include <Geometry/CSCGeometry/interface/CSCLayerGeometry.h>
00003 #include <Geometry/CSCGeometry/src/CSCWireGroupPackage.h>
00004 #include <DataFormats/GeometrySurface/interface/TrapezoidalPlaneBounds.h>
00005 #include <FWCore/MessageLogger/interface/MessageLogger.h>
00006 
00007 using namespace GeomDetEnumerators;
00008 
00009 CSCChamberSpecs::CSCChamberSpecs( 
00010       const CSCGeometry* geom,
00011       int iChamberType, const TrapezoidalPlaneBounds& bounds,
00012       const CSCSpecsParcel& fupar,
00013       const CSCWireGroupPackage& wg )
00014   : GeomDetType( "CSC", CSC ), theChamberType( iChamberType ), theSpecsValues( fupar ),
00015     nstrips( static_cast<int>(specsValue(5)) ), stripDeltaPhi( specsValue(29) ), 
00016     centreToIntersectionOffset( specsValue(30) )
00017   {
00018    LogTrace("CSCChamberSpecs|CSC") << myName << ": constructing specs for chamber " << 
00019     theName[iChamberType - 1] << ", type=" << iChamberType << ", this =" << this;
00020  
00021   // Most wire info now comes from wire group section of DDD, but this doesn't...
00022   float wireAngleInDegrees = specsValue(12);
00023   
00024   // Related to strip geometry...
00025   float stripOffset1                       = specsValue(20);
00026   float stripOffset2                       = specsValue(21);
00027   float globalRadialPositionOfAlignmentPin = specsValue(24);
00028   float distanceFrameToAlignmentPin        = specsValue(25);
00029   float lengthOfChamber                    = specsValue(26);
00030   float distanceEndOfStripToAlignmentPin   = specsValue(27);
00031   float extentOfStripPlane                 = specsValue(28);
00032 
00033   // local y of alignment pin 
00034   float yAlignmentPin = -lengthOfChamber/2. + distanceFrameToAlignmentPin;
00035 
00036   // distance from alignment pin to symmetry centre of strip plane
00037   float alignmentPinToCentreOfStripPlane = distanceEndOfStripToAlignmentPin + extentOfStripPlane/2. ;
00038 
00039   // local y of symmetry centre of strip plane
00040   float yCentreOfStripPlane = yAlignmentPin  + alignmentPinToCentreOfStripPlane ;
00041 
00042   // distance from intersection of strips to symmetry centre of strip plane
00043   float whereStripsMeet = globalRadialPositionOfAlignmentPin + alignmentPinToCentreOfStripPlane ;
00044 
00045   // Possibly 'correct' distance to strip intersection
00046   //  if ( useCentreTIOffsets ) {
00047   //    float ctiOffset = this->ctiOffset();
00048   //    whereStripsMeet += ctiOffset; 
00049   //  }
00050   whereStripsMeet += centreToIntersectionOffset; // will have been reset to zero if not active
00051 
00052   // local y value of 1st wire in wire plane
00053   double yOfFirstWire = yAlignmentPin + wg.alignmentPinToFirstWire/10.; //@@ in cm
00054 
00055   // Build the unique LayerGeometry objects we require for each chamber type.
00056   // - There are 2 endcaps
00057   // - Alternate layers of strips are offset w.r.t. each other
00058   // - In ME11 the wire tilt angle needs to be a constant
00059   // global value; in the CMS local coordinates this is positive in +z
00060   // and negative in -z (magnitude 29 degrees as of 2002)
00061 
00062   // Thus we need 4 LGs differing in strip offset and wire angle
00063 
00064   float phiPitch = this->stripPhiPitch();
00065 
00066   // Layer thickness can come from specs too
00067   float hThickness = specsValue(32)/10./2.; // mm->cm, and then want half the thickness
00068 
00069   poszOddLayerGeometry = new CSCLayerGeometry( geom, iChamberType, bounds,
00070      nstrips, -stripOffset1, phiPitch, whereStripsMeet, extentOfStripPlane, yCentreOfStripPlane,
00071      wg, wireAngleInDegrees, yOfFirstWire, hThickness );
00072 
00073   poszEvenLayerGeometry = new CSCLayerGeometry( geom, iChamberType, bounds,
00074      nstrips, -stripOffset2, phiPitch, whereStripsMeet, extentOfStripPlane, yCentreOfStripPlane,
00075      wg, wireAngleInDegrees, yOfFirstWire, hThickness );
00076 
00077   negzOddLayerGeometry = new CSCLayerGeometry( geom, iChamberType, bounds,
00078      nstrips, -stripOffset1, phiPitch, whereStripsMeet, extentOfStripPlane, yCentreOfStripPlane,
00079      wg, -wireAngleInDegrees, yOfFirstWire, hThickness );
00080 
00081   negzEvenLayerGeometry = new CSCLayerGeometry( geom, iChamberType, bounds,
00082      nstrips, -stripOffset2, phiPitch, whereStripsMeet, extentOfStripPlane, yCentreOfStripPlane,
00083      wg, -wireAngleInDegrees, yOfFirstWire, hThickness );
00084 
00085 }
00086 
00087 
00088 CSCChamberSpecs::~CSCChamberSpecs()
00089 {
00090   LogTrace("CSCChamberSpecs|CSC") << myName << " destroying this=" << this;
00091 
00092   delete poszOddLayerGeometry;
00093   delete poszEvenLayerGeometry;
00094   delete negzOddLayerGeometry;
00095   delete negzEvenLayerGeometry;
00096 }
00097 
00098 
00099 bool CSCChamberSpecs::operator!=( const CSCChamberSpecs& specs ) const
00100 {
00101    if ( ( theChamberType != specs.theChamberType ) )
00102       return true;
00103     else
00104       return false;
00105 }
00106 
00107 bool CSCChamberSpecs::operator==( const CSCChamberSpecs& specs ) const
00108 {
00109    return !( operator!=(specs) );
00110 }
00111 
00112 const Topology& CSCChamberSpecs::topology() const {
00113   return *(poszOddLayerGeometry->topology());
00114 }
00115 
00116 
00117 int CSCChamberSpecs::chamberType() const {
00118   return theChamberType;
00119 }
00120 
00121 std::string CSCChamberSpecs::chamberTypeName() const {
00122   return theName[chamberType() - 1];
00123 }
00124 
00125 // Build theChamberType value for a (station, ring) pair
00126   //             an integer 1-10 corresponding to 
00127   //        1           for S = 1  and R=A=4 split strips in ME11
00128   //      2,3,4 =  R+1  for S = 1  and R = 1,2,3
00129   //      5-10  = 2*S+R for S = 2,3,4 and R = 1,2
00130 
00131 int CSCChamberSpecs::whatChamberType( int istation, int iring ) {
00132    int i = 2 * istation + iring; // i=2S+R
00133    if ( istation == 1 )
00134    {
00135       --i;             // ring 1R -> i=1+R (2S+R-1=1+R for S=1)
00136       if ( i > 4 )
00137       {
00138           i = 1;       // But ring 1A (R=4) -> i=1
00139       }
00140    }   
00141    return i;
00142 }
00143 
00144 float CSCChamberSpecs::wireSpacing() const { 
00145   return poszOddLayerGeometry->wirePitch(); 
00146 }
00147 
00148 float CSCChamberSpecs::stripNoise(float timeInterval) const {
00149   const float pF_cm = 0.75;
00150   return (constantNoise() + e_pF() * pF_cm * poszOddLayerGeometry->length() )
00151          / sqrt(timeInterval/100.);
00152 }
00153 
00154 float CSCChamberSpecs::gasGain() const {
00155   // ME1/1 makes up for its small gap by a big electronics gain
00156   // so use one gas gain value for all chambers (=300000)
00157   return 3.0e05;
00158 }
00159 
00160 float CSCChamberSpecs::chargePerCount() const {
00161   if(theChamberType <= 2) {
00162     return 0.25;
00163   } else {
00164     return 0.5;
00165   }
00166 }
00167 
00168 // STATICS
00169 
00170 // Define the name of each chamber type
00171 const std::string CSCChamberSpecs::theName[] =
00172   {"ME1/a", "ME1/b", "ME1/2", "ME1/3", "ME2/1", "ME2/2", "ME3/1", "ME3/2",
00173    "ME4/1", "ME4/2" };
00174 
00175 // Define name of this class
00176 const std::string CSCChamberSpecs::myName = "CSCChamberSpecs";
00177