00001 #include "Geometry/EcalTestBeam/interface/EcalTBHodoscopeGeometry.h"
00002
00003 #include "SimDataFormats/EcalTestBeam/interface/HodoscopeDetId.h"
00004
00005 typedef CaloCellGeometry::CCGFloat CCGFloat ;
00006
00007 EcalTBHodoscopeGeometry::EcalTBHodoscopeGeometry() :
00008 m_cellVec( nPlanes_*nFibres_ )
00009 {
00010 }
00011
00012 EcalTBHodoscopeGeometry::~EcalTBHodoscopeGeometry()
00013 {
00014 }
00015
00016 float
00017 EcalTBHodoscopeGeometry::getFibreLp( int plane, int fibre )
00018 {
00019 if( plane < nPlanes_ &&
00020 fibre < nFibres_ )
00021 {
00022 return fibrePos_[ plane ][ fibre ].lp ;
00023 }
00024 else
00025 {
00026 return -99999. ;
00027 }
00028 }
00029
00030 float
00031 EcalTBHodoscopeGeometry::getFibreRp( int plane, int fibre )
00032 {
00033 if( plane < nPlanes_ &&
00034 fibre < nFibres_ )
00035 {
00036 return fibrePos_[ plane ][ fibre ].rp ;
00037 }
00038 else
00039 {
00040 return -99999.;
00041 }
00042 }
00043
00044 int
00045 EcalTBHodoscopeGeometry::getNPlanes()
00046 {
00047 return nPlanes_;
00048 }
00049
00050 int
00051 EcalTBHodoscopeGeometry::getNFibres()
00052 {
00053 return nFibres_;
00054 }
00055
00056 void
00057 EcalTBHodoscopeGeometry::newCell( const GlobalPoint& f1 ,
00058 const GlobalPoint& f2 ,
00059 const GlobalPoint& f3 ,
00060 const CCGFloat* parm ,
00061 const DetId& detId )
00062 {
00063 const HodoscopeDetId hid ( detId ) ;
00064
00065 const unsigned int cellIndex ( hid.denseIndex() ) ;
00066
00067 m_cellVec[ cellIndex ] = PreshowerStrip( f1, cornersMgr(), parm ) ;
00068 m_validIds.push_back( detId ) ;
00069 }
00070
00071 const EcalTBHodoscopeGeometry::fibre_pos
00072 EcalTBHodoscopeGeometry::fibrePos_[EcalTBHodoscopeGeometry::nPlanes_][EcalTBHodoscopeGeometry::nFibres_] =
00073 {
00074 {
00075
00076
00077
00078
00079
00080
00081 {-16.326,-15.367},
00082 {-15.849,-14.889},
00083 {-15.326,-14.368},
00084 {-14.845,-13.886},
00085 {-14.326,-13.367},
00086 {-13.843,-12.887},
00087 {-13.323,-12.366},
00088 {-12.845,-11.883},
00089 {-12.322,-11.361},
00090 {-11.841,-10.882},
00091 {-11.319,-10.359},
00092 {-10.836,-9.876},
00093 {-10.318,-9.359},
00094 {-9.831,-8.873},
00095 {-9.318,-8.357},
00096 {-8.83,-7.869},
00097 {-8.316,-7.359},
00098 {-7.826,-6.871},
00099 {-7.317,-6.359},
00100 {-6.822,-5.867},
00101 {-6.32,-5.356},
00102 {-5.824,-4.87},
00103 {-5.315,-4.357},
00104 {-4.824,-3.866},
00105 {-4.316,-3.361},
00106 {-3.821,-2.867},
00107 {-3.318,-2.362},
00108 {-2.826,-1.867},
00109 {-2.319,-1.354},
00110 {-1.825,-0.864},
00111 {-1.313,-0.351},
00112 {-0.825,0.136},
00113 {-0.31,0.653},
00114 {0.177,1.135},
00115 {0.696,1.653},
00116 {1.176,2.137},
00117 {1.695,2.652},
00118 {2.179,3.138},
00119 {2.694,3.651},
00120 {3.178,4.136},
00121 {3.692,4.648},
00122 {4.179,5.134},
00123 {4.689,5.651},
00124 {5.177,6.133},
00125 {5.697,6.649},
00126 {6.17,7.134},
00127 {6.69,7.651},
00128 {7.176,8.134},
00129 {7.688,8.652},
00130 {8.172,9.138},
00131 {8.691,9.654},
00132 {9.178,10.13},
00133 {9.693,10.655},
00134 {10.173,11.132},
00135 {10.697,11.66},
00136 {11.172,12.129},
00137 {11.701,12.653},
00138 {12.17,13.128},
00139 {12.691,13.658},
00140 {13.168,14.13},
00141 {13.7,14.656},
00142 {14.172,15.134},
00143 {14.697,15.649},
00144 {15.177,16.13}
00145 },
00146 {
00147
00148
00149
00150
00151
00152 {-16.175,-15.229},
00153 {-15.719,-14.772},
00154 {-15.185,-14.226},
00155 {-14.727,-13.77},
00156 {-14.184,-13.235},
00157 {-13.727,-12.777},
00158 {-13.192,-12.232},
00159 {-12.733,-11.77},
00160 {-12.191,-11.239},
00161 {-11.736,-10.773},
00162 {-11.195,-10.242},
00163 {-10.735,-9.782},
00164 {-10.198,-9.239},
00165 {-9.738,-8.783},
00166 {-9.206,-8.236},
00167 {-8.739,-7.788},
00168 {-8.211,-7.239},
00169 {-7.74,-6.783},
00170 {-7.215,-6.241},
00171 {-6.743,-5.781},
00172 {-6.207,-5.248},
00173 {-5.74,-4.782},
00174 {-5.207,-4.247},
00175 {-4.743,-3.78},
00176 {-4.217,-3.249},
00177 {-3.746,-2.78},
00178 {-3.214,-2.247},
00179 {-2.746,-1.781},
00180 {-2.214,-1.249},
00181 {-1.742,-0.786},
00182 {-1.209,-0.248},
00183 {-0.744,0.207},
00184 {-0.21,0.751},
00185 {0.245,1.208},
00186 {0.792,1.757},
00187 {1.248,2.207},
00188 {1.792,2.756},
00189 {2.25,3.208},
00190 {2.793,3.757},
00191 {3.247,4.209},
00192 {3.795,4.754},
00193 {4.244,5.208},
00194 {4.799,5.752},
00195 {5.246,6.209},
00196 {5.792,6.75},
00197 {6.245,7.215},
00198 {6.792,7.753},
00199 {7.253,8.212},
00200 {7.782,8.753},
00201 {8.253,9.217},
00202 {8.781,9.748},
00203 {9.257,10.22},
00204 {9.783,10.745},
00205 {10.255,11.218},
00206 {10.787,11.746},
00207 {11.255,12.219},
00208 {11.786,12.744},
00209 {12.252,13.222},
00210 {12.787,13.741},
00211 {13.248,14.21},
00212 {13.782,14.735},
00213 {14.251,15.218},
00214 {14.779,15.731},
00215 {15.25,16.209}
00216 },
00217 {
00218
00219
00220
00221
00222
00223 {-16.256,-15.305},
00224 {-15.774,-14.818},
00225 {-15.264,-14.306},
00226 {-14.776,-13.82},
00227 {-14.267,-13.32},
00228 {-13.779,-12.819},
00229 {-13.277,-12.323},
00230 {-12.778,-11.815},
00231 {-12.286,-11.324},
00232 {-11.776,-10.821},
00233 {-11.285,-10.324},
00234 {-10.779,-9.819},
00235 {-10.283,-9.33},
00236 {-9.778,-8.826},
00237 {-9.284,-8.329},
00238 {-8.779,-7.824},
00239 {-8.288,-7.329},
00240 {-7.785,-6.828},
00241 {-7.29,-6.329},
00242 {-6.785,-5.831},
00243 {-6.289,-5.329},
00244 {-5.789,-4.836},
00245 {-5.289,-4.332},
00246 {-4.791,-3.833},
00247 {-4.289,-3.335},
00248 {-3.791,-2.837},
00249 {-3.294,-2.334},
00250 {-2.796,-1.836},
00251 {-2.292,-1.34},
00252 {-1.792,-0.842},
00253 {-1.299,-0.344},
00254 {-0.8,0.158},
00255 {-0.306,0.655},
00256 {0.2,1.156},
00257 {0.691,1.655},
00258 {1.196,2.154},
00259 {1.696,2.653},
00260 {2.194,3.153},
00261 {2.694,3.646},
00262 {3.194,4.144},
00263 {3.692,4.649},
00264 {4.185,5.141},
00265 {4.687,5.647},
00266 {5.181,6.14},
00267 {5.691,6.646},
00268 {6.183,7.138},
00269 {6.686,7.647},
00270 {7.178,8.139},
00271 {7.689,8.649},
00272 {8.179,9.133},
00273 {8.687,9.643},
00274 {9.176,10.133},
00275 {9.683,10.643},
00276 {10.173,11.13},
00277 {10.681,11.637},
00278 {11.167,12.122},
00279 {11.678,12.639},
00280 {12.163,13.119},
00281 {12.676,13.637},
00282 {13.16,14.118},
00283 {13.677,14.636},
00284 {14.16,15.12},
00285 {14.675,15.635},
00286 {15.162,16.119}
00287 },
00288 {
00289
00290
00291
00292
00293
00294 {-16.225,-15.271},
00295 {-15.74,-14.782},
00296 {-15.227,-14.269},
00297 {-14.74,-13.779},
00298 {-14.227,-13.264},
00299 {-13.738,-12.776},
00300 {-13.223,-12.267},
00301 {-12.734,-11.77},
00302 {-12.234,-11.266},
00303 {-11.728,-10.769},
00304 {-11.226,-10.268},
00305 {-10.73,-9.766},
00306 {-10.228,-9.268},
00307 {-9.726,-8.762},
00308 {-9.228,-8.268},
00309 {-8.72,-7.758},
00310 {-8.227,-7.266},
00311 {-7.713,-6.75},
00312 {-7.224,-6.258},
00313 {-6.707,-5.747},
00314 {-6.22,-5.256},
00315 {-5.703,-4.742},
00316 {-5.217,-4.254},
00317 {-4.703,-3.736},
00318 {-4.211,-3.25},
00319 {-3.697,-2.735},
00320 {-3.208,-2.246},
00321 {-2.696,-1.736},
00322 {-2.205,-1.242},
00323 {-1.696,-0.735},
00324 {-1.201,-0.245},
00325 {-0.695,0.267},
00326 {-0.199,0.759},
00327 {0.303,1.266},
00328 {0.801,1.76},
00329 {1.308,2.27},
00330 {1.799,2.761},
00331 {2.312,3.268},
00332 {2.803,3.762},
00333 {3.31,4.263},
00334 {3.803,4.765},
00335 {4.308,5.267},
00336 {4.807,5.768},
00337 {5.308,6.269},
00338 {5.807,6.768},
00339 {6.311,7.272},
00340 {6.808,7.764},
00341 {7.315,8.275},
00342 {7.809,8.771},
00343 {8.315,9.277},
00344 {8.812,9.773},
00345 {9.32,10.279},
00346 {9.815,10.775},
00347 {10.323,11.278},
00348 {10.817,11.778},
00349 {11.322,12.277},
00350 {11.821,12.782},
00351 {12.324,13.276},
00352 {12.825,13.789},
00353 {13.321,14.274},
00354 {13.83,14.789},
00355 {14.318,15.271},
00356 {14.829,15.786},
00357 {15.315,16.264}
00358 }
00359 };
00360
00361 std::vector<int>
00362 EcalTBHodoscopeGeometry::getFiredFibresInPlane( float xtr,
00363 int plane )
00364 {
00365 std::vector<int> firedFibres;
00366
00367 if( plane > EcalTBHodoscopeGeometry::nPlanes_ ) return firedFibres;
00368
00369 for( int i ( 0 ) ; i != nFibres_ ; ++i )
00370 {
00371 if( ( xtr >= fibrePos_[plane][i].lp ) &&
00372 ( xtr <= fibrePos_[plane][i].rp ) ) firedFibres.push_back(i);
00373 }
00374 return firedFibres ;
00375 }
00376
00377 const CaloCellGeometry*
00378 EcalTBHodoscopeGeometry::cellGeomPtr( uint32_t index ) const
00379 {
00380 const CaloCellGeometry* cell ( &m_cellVec[ index ] ) ;
00381 return ( m_cellVec.size() > index &&
00382 0 != cell->param() ? cell : 0 ) ;
00383 }