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
00067 float hThickness = specsValue(32)/10./2.;
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
00126
00127
00128
00129
00130
00131 int CSCChamberSpecs::whatChamberType( int istation, int iring ) {
00132 int i = 2 * istation + iring;
00133 if ( istation == 1 )
00134 {
00135 --i;
00136 if ( i > 4 )
00137 {
00138 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
00156
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
00169
00170
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
00176 const std::string CSCChamberSpecs::myName = "CSCChamberSpecs";
00177