CMS 3D CMS Logo

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   poszOddLayerGeometry = new CSCLayerGeometry( geom, iChamberType, bounds,
00067      nstrips, -stripOffset1, phiPitch, whereStripsMeet, extentOfStripPlane, yCentreOfStripPlane,
00068      wg, wireAngleInDegrees, yOfFirstWire );
00069 
00070   poszEvenLayerGeometry = new CSCLayerGeometry( geom, iChamberType, bounds,
00071      nstrips, -stripOffset2, phiPitch, whereStripsMeet, extentOfStripPlane, yCentreOfStripPlane,
00072      wg, wireAngleInDegrees, yOfFirstWire );
00073 
00074   negzOddLayerGeometry = new CSCLayerGeometry( geom, iChamberType, bounds,
00075      nstrips, -stripOffset1, phiPitch, whereStripsMeet, extentOfStripPlane, yCentreOfStripPlane,
00076      wg, -wireAngleInDegrees, yOfFirstWire );
00077 
00078   negzEvenLayerGeometry = new CSCLayerGeometry( geom, iChamberType, bounds,
00079      nstrips, -stripOffset2, phiPitch, whereStripsMeet, extentOfStripPlane, yCentreOfStripPlane,
00080      wg, -wireAngleInDegrees, yOfFirstWire );
00081 
00082 }
00083 
00084 
00085 CSCChamberSpecs::~CSCChamberSpecs()
00086 {
00087   LogTrace("CSCChamberSpecs|CSC") << myName << " destroying this=" << this;
00088 
00089   delete poszOddLayerGeometry;
00090   delete poszEvenLayerGeometry;
00091   delete negzOddLayerGeometry;
00092   delete negzEvenLayerGeometry;
00093 }
00094 
00095 
00096 bool CSCChamberSpecs::operator!=( const CSCChamberSpecs& specs ) const
00097 {
00098    if ( ( theChamberType != specs.theChamberType ) )
00099       return true;
00100     else
00101       return false;
00102 }
00103 
00104 bool CSCChamberSpecs::operator==( const CSCChamberSpecs& specs ) const
00105 {
00106    return !( operator!=(specs) );
00107 }
00108 
00109 const Topology& CSCChamberSpecs::topology() const {
00110   return *(poszOddLayerGeometry->topology());
00111 }
00112 
00113 
00114 int CSCChamberSpecs::chamberType() const {
00115   return theChamberType;
00116 }
00117 
00118 std::string CSCChamberSpecs::chamberTypeName() const {
00119   return theName[chamberType() - 1];
00120 }
00121 
00122 // Build theChamberType value for a (station, ring) pair
00123   //             an integer 1-10 corresponding to 
00124   //        1           for S = 1  and R=A=4 split strips in ME11
00125   //      2,3,4 =  R+1  for S = 1  and R = 1,2,3
00126   //      5-10  = 2*S+R for S = 2,3,4 and R = 1,2
00127 
00128 int CSCChamberSpecs::whatChamberType( int istation, int iring ) {
00129    int i = 2 * istation + iring; // i=2S+R
00130    if ( istation == 1 )
00131    {
00132       --i;             // ring 1R -> i=1+R (2S+R-1=1+R for S=1)
00133       if ( i > 4 )
00134       {
00135           i = 1;       // But ring 1A (R=4) -> i=1
00136       }
00137    }   
00138    return i;
00139 }
00140 
00141 float CSCChamberSpecs::wireSpacing() const { 
00142   return poszOddLayerGeometry->wirePitch(); 
00143 }
00144 
00145 float CSCChamberSpecs::stripNoise(float timeInterval) const {
00146   const float pF_cm = 0.75;
00147   return (constantNoise() + e_pF() * pF_cm * poszOddLayerGeometry->length() )
00148          / sqrt(timeInterval/100.);
00149 }
00150 
00151 float CSCChamberSpecs::gasGain() const {
00152   // ME1/1 makes up for its small gap by a big electronics gain
00153   // so use one gas gain value for all chambers (=300000)
00154   return 3.0e05;
00155 }
00156 
00157 float CSCChamberSpecs::chargePerCount() const {
00158   if(theChamberType <= 2) {
00159     return 0.25;
00160   } else {
00161     return 0.5;
00162   }
00163 }
00164 
00165 // STATICS
00166 
00167 // Define the name of each chamber type
00168 const std::string CSCChamberSpecs::theName[] =
00169   {"ME1/a", "ME1/b", "ME1/2", "ME1/3", "ME2/1", "ME2/2", "ME3/1", "ME3/2",
00170    "ME4/1", "ME4/2" };
00171 
00172 // Define name of this class
00173 const std::string CSCChamberSpecs::myName = "CSCChamberSpecs";
00174  

Generated on Tue Jun 9 17:37:18 2009 for CMSSW by  doxygen 1.5.4