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
00023 if ( iChamberType == 1 ) gangedStrips_ = geom->gangedStrips();
00024
00025
00026 float wireAngleInDegrees = specsValue(12);
00027
00028
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
00038 float yAlignmentPin = -lengthOfChamber/2. + distanceFrameToAlignmentPin;
00039
00040
00041 float alignmentPinToCentreOfStripPlane = distanceEndOfStripToAlignmentPin + extentOfStripPlane/2. ;
00042
00043
00044 float yCentreOfStripPlane = yAlignmentPin + alignmentPinToCentreOfStripPlane ;
00045
00046
00047 float whereStripsMeet = globalRadialPositionOfAlignmentPin + alignmentPinToCentreOfStripPlane ;
00048
00049
00050
00051
00052
00053
00054 whereStripsMeet += centreToIntersectionOffset;
00055
00056
00057 double yOfFirstWire = yAlignmentPin + wg.alignmentPinToFirstWire/10.;
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068 float phiPitch = this->stripPhiPitch();
00069
00070
00071 float hThickness = specsValue(32)/10./2.;
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
00130
00131
00132
00133
00134
00135 int CSCChamberSpecs::whatChamberType( int istation, int iring ) {
00136 int i = 2 * istation + iring;
00137 if ( istation == 1 )
00138 {
00139 --i;
00140 if ( i > 4 )
00141 {
00142 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
00160
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
00173
00174
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
00180 const std::string CSCChamberSpecs::myName = "CSCChamberSpecs";
00181