CMS 3D CMS Logo

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

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