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
00022 float wireAngleInDegrees = specsValue(12);
00023
00024
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
00034 float yAlignmentPin = -lengthOfChamber/2. + distanceFrameToAlignmentPin;
00035
00036
00037 float alignmentPinToCentreOfStripPlane = distanceEndOfStripToAlignmentPin + extentOfStripPlane/2. ;
00038
00039
00040 float yCentreOfStripPlane = yAlignmentPin + alignmentPinToCentreOfStripPlane ;
00041
00042
00043 float whereStripsMeet = globalRadialPositionOfAlignmentPin + alignmentPinToCentreOfStripPlane ;
00044
00045
00046
00047
00048
00049
00050 whereStripsMeet += centreToIntersectionOffset;
00051
00052
00053 double yOfFirstWire = yAlignmentPin + wg.alignmentPinToFirstWire/10.;
00054
00055
00056
00057
00058
00059
00060
00061
00062
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
00123
00124
00125
00126
00127
00128 int CSCChamberSpecs::whatChamberType( int istation, int iring ) {
00129 int i = 2 * istation + iring;
00130 if ( istation == 1 )
00131 {
00132 --i;
00133 if ( i > 4 )
00134 {
00135 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
00153
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
00166
00167
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
00173 const std::string CSCChamberSpecs::myName = "CSCChamberSpecs";
00174