CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_9/src/Geometry/EcalTestBeam/src/EcalTBHodoscopeGeometry.cc

Go to the documentation of this file.
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     // Position is in mm      
00076     // FIBRES POSITIONS 
00077     // 
00078     // - PLANE 0 -
00079     // transverse with respect beam axis
00080 
00081     {-16.326,-15.367}, // fibre33
00082     {-15.849,-14.889}, // fibre1
00083     {-15.326,-14.368}, // fibre34
00084     {-14.845,-13.886}, // fibre2
00085     {-14.326,-13.367}, // fibre35
00086     {-13.843,-12.887}, // fibre3
00087     {-13.323,-12.366}, // fibre36
00088     {-12.845,-11.883}, // fibre4
00089     {-12.322,-11.361}, // fibre37
00090     {-11.841,-10.882}, // fibre5
00091     {-11.319,-10.359}, // fibre38
00092     {-10.836,-9.876}, // fibre6
00093     {-10.318,-9.359}, // fibre39
00094     {-9.831,-8.873}, // fibre7
00095     {-9.318,-8.357}, // fibre40
00096     {-8.83,-7.869}, // fibre8
00097     {-8.316,-7.359}, // fibre41
00098     {-7.826,-6.871}, // fibre9
00099     {-7.317,-6.359}, // fibre42
00100     {-6.822,-5.867}, // fibre10
00101     {-6.32,-5.356}, // fibre43
00102     {-5.824,-4.87}, // fibre11
00103     {-5.315,-4.357}, // fibre44
00104     {-4.824,-3.866}, // fibre12
00105     {-4.316,-3.361}, // fibre45
00106     {-3.821,-2.867}, // fibre13
00107     {-3.318,-2.362}, // fibre46
00108     {-2.826,-1.867}, // fibre14
00109     {-2.319,-1.354}, // fibre47
00110     {-1.825,-0.864}, // fibre15
00111     {-1.313,-0.351}, // fibre48
00112     {-0.825,0.136}, // fibre16
00113     {-0.31,0.653}, // fibre49
00114     {0.177,1.135}, // fibre17
00115     {0.696,1.653}, // fibre50
00116     {1.176,2.137}, // fibre18
00117     {1.695,2.652}, // fibre51
00118     {2.179,3.138}, // fibre19
00119     {2.694,3.651}, // fibre52
00120     {3.178,4.136}, // fibre20
00121     {3.692,4.648}, // fibre53
00122     {4.179,5.134}, // fibre21
00123     {4.689,5.651}, // fibre54
00124     {5.177,6.133}, // fibre22
00125     {5.697,6.649}, // fibre55
00126     {6.17,7.134}, // fibre23
00127     {6.69,7.651}, // fibre56
00128     {7.176,8.134}, // fibre24
00129     {7.688,8.652}, // fibre57
00130     {8.172,9.138}, // fibre25
00131     {8.691,9.654}, // fibre58
00132     {9.178,10.13}, // fibre26
00133     {9.693,10.655}, // fibre59
00134     {10.173,11.132}, // fibre27
00135     {10.697,11.66}, // fibre60
00136     {11.172,12.129}, // fibre28
00137     {11.701,12.653}, // fibre61
00138     {12.17,13.128}, // fibre29
00139     {12.691,13.658}, // fibre62
00140     {13.168,14.13}, // fibre30
00141     {13.7,14.656}, // fibre63
00142     {14.172,15.134}, // fibre31
00143     {14.697,15.649}, // fibre64
00144     {15.177,16.13} // fibre32
00145   },
00146   {
00147     // FIBRES POSITIONS
00148     // 
00149     // - PLANE 1 -
00150     // transverse with respect beam axis
00151 
00152     {-16.175,-15.229}, // fibre33
00153     {-15.719,-14.772}, // fibre1
00154     {-15.185,-14.226}, // fibre34
00155     {-14.727,-13.77}, // fibre2
00156     {-14.184,-13.235}, // fibre35
00157     {-13.727,-12.777}, // fibre3
00158     {-13.192,-12.232}, // fibre36
00159     {-12.733,-11.77}, // fibre4
00160     {-12.191,-11.239}, // fibre37
00161     {-11.736,-10.773}, // fibre5
00162     {-11.195,-10.242}, // fibre38
00163     {-10.735,-9.782}, // fibre6
00164     {-10.198,-9.239}, // fibre39
00165     {-9.738,-8.783}, // fibre7
00166     {-9.206,-8.236}, // fibre40
00167     {-8.739,-7.788}, // fibre8
00168     {-8.211,-7.239}, // fibre41
00169     {-7.74,-6.783}, // fibre9
00170     {-7.215,-6.241}, // fibre42
00171     {-6.743,-5.781}, // fibre10
00172     {-6.207,-5.248}, // fibre43
00173     {-5.74,-4.782}, // fibre11
00174     {-5.207,-4.247}, // fibre44
00175     {-4.743,-3.78}, // fibre12
00176     {-4.217,-3.249}, // fibre45
00177     {-3.746,-2.78}, // fibre13
00178     {-3.214,-2.247}, // fibre46
00179     {-2.746,-1.781}, // fibre14
00180     {-2.214,-1.249}, // fibre47
00181     {-1.742,-0.786}, // fibre15
00182     {-1.209,-0.248}, // fibre48
00183     {-0.744,0.207}, // fibre16
00184     {-0.21,0.751}, // fibre49
00185     {0.245,1.208}, // fibre17
00186     {0.792,1.757}, // fibre50
00187     {1.248,2.207}, // fibre18
00188     {1.792,2.756}, // fibre51
00189     {2.25,3.208}, // fibre19
00190     {2.793,3.757}, // fibre52
00191     {3.247,4.209}, // fibre20
00192     {3.795,4.754}, // fibre53
00193     {4.244,5.208}, // fibre21
00194     {4.799,5.752}, // fibre54
00195     {5.246,6.209}, // fibre22
00196     {5.792,6.75}, // fibre55
00197     {6.245,7.215}, // fibre23
00198     {6.792,7.753}, // fibre56
00199     {7.253,8.212}, // fibre24
00200     {7.782,8.753}, // fibre57
00201     {8.253,9.217}, // fibre25
00202     {8.781,9.748}, // fibre58
00203     {9.257,10.22}, // fibre26
00204     {9.783,10.745}, // fibre59
00205     {10.255,11.218}, // fibre27
00206     {10.787,11.746}, // fibre60
00207     {11.255,12.219}, // fibre28
00208     {11.786,12.744}, // fibre61
00209     {12.252,13.222}, // fibre29
00210     {12.787,13.741}, // fibre62
00211     {13.248,14.21}, // fibre30
00212     {13.782,14.735}, // fibre63
00213     {14.251,15.218}, // fibre31
00214     {14.779,15.731}, // fibre64
00215     {15.25,16.209} // fibre32
00216   },
00217     {
00218       // FIBRES POSITIONS
00219       // 
00220       // - PLANE 2 -
00221       // transverse with respect beam axis
00222 
00223       {-16.256,-15.305}, // fibre33
00224       {-15.774,-14.818}, // fibre1
00225       {-15.264,-14.306}, // fibre34
00226       {-14.776,-13.82}, // fibre2
00227       {-14.267,-13.32}, // fibre35
00228       {-13.779,-12.819}, // fibre3
00229       {-13.277,-12.323}, // fibre36
00230       {-12.778,-11.815}, // fibre4
00231       {-12.286,-11.324}, // fibre37
00232       {-11.776,-10.821}, // fibre5
00233       {-11.285,-10.324}, // fibre38
00234       {-10.779,-9.819}, // fibre6
00235       {-10.283,-9.33}, // fibre39
00236       {-9.778,-8.826}, // fibre7
00237       {-9.284,-8.329}, // fibre40
00238       {-8.779,-7.824}, // fibre8
00239       {-8.288,-7.329}, // fibre41
00240       {-7.785,-6.828}, // fibre9
00241       {-7.29,-6.329}, // fibre42
00242       {-6.785,-5.831}, // fibre10
00243       {-6.289,-5.329}, // fibre43
00244       {-5.789,-4.836}, // fibre11
00245       {-5.289,-4.332}, // fibre44
00246       {-4.791,-3.833}, // fibre12
00247       {-4.289,-3.335}, // fibre45
00248       {-3.791,-2.837}, // fibre13
00249       {-3.294,-2.334}, // fibre46
00250       {-2.796,-1.836}, // fibre14
00251       {-2.292,-1.34}, // fibre47
00252       {-1.792,-0.842}, // fibre15
00253       {-1.299,-0.344}, // fibre48
00254       {-0.8,0.158}, // fibre16
00255       {-0.306,0.655}, // fibre49
00256       {0.2,1.156}, // fibre17
00257       {0.691,1.655}, // fibre50
00258       {1.196,2.154}, // fibre18
00259       {1.696,2.653}, // fibre51
00260       {2.194,3.153}, // fibre19
00261       {2.694,3.646}, // fibre52
00262       {3.194,4.144}, // fibre20
00263       {3.692,4.649}, // fibre53
00264       {4.185,5.141}, // fibre21
00265       {4.687,5.647}, // fibre54
00266       {5.181,6.14}, // fibre22
00267       {5.691,6.646}, // fibre55
00268       {6.183,7.138}, // fibre23
00269       {6.686,7.647}, // fibre56
00270       {7.178,8.139}, // fibre24
00271       {7.689,8.649}, // fibre57
00272       {8.179,9.133}, // fibre25
00273       {8.687,9.643}, // fibre58
00274       {9.176,10.133}, // fibre26
00275       {9.683,10.643}, // fibre59
00276       {10.173,11.13}, // fibre27
00277       {10.681,11.637}, // fibre60
00278       {11.167,12.122}, // fibre28
00279       {11.678,12.639}, // fibre61
00280       {12.163,13.119}, // fibre29
00281       {12.676,13.637}, // fibre62
00282       {13.16,14.118}, // fibre30
00283       {13.677,14.636}, // fibre63
00284       {14.16,15.12}, // fibre31
00285       {14.675,15.635}, // fibre64
00286       {15.162,16.119} // fibre32
00287     },
00288     {
00289       // FIBRES POSITIONS
00290       // 
00291       // - PLANE 3 -
00292       // transverse with respect beam axis
00293 
00294       {-16.225,-15.271}, // fibre33
00295       {-15.74,-14.782}, // fibre1
00296       {-15.227,-14.269}, // fibre34
00297       {-14.74,-13.779}, // fibre2
00298       {-14.227,-13.264}, // fibre35
00299       {-13.738,-12.776}, // fibre3
00300       {-13.223,-12.267}, // fibre36
00301       {-12.734,-11.77}, // fibre4
00302       {-12.234,-11.266}, // fibre37
00303       {-11.728,-10.769}, // fibre5
00304       {-11.226,-10.268}, // fibre38
00305       {-10.73,-9.766}, // fibre6
00306       {-10.228,-9.268}, // fibre39
00307       {-9.726,-8.762}, // fibre7
00308       {-9.228,-8.268}, // fibre40
00309       {-8.72,-7.758}, // fibre8
00310       {-8.227,-7.266}, // fibre41
00311       {-7.713,-6.75}, // fibre9
00312       {-7.224,-6.258}, // fibre42
00313       {-6.707,-5.747}, // fibre10
00314       {-6.22,-5.256}, // fibre43
00315       {-5.703,-4.742}, // fibre11
00316       {-5.217,-4.254}, // fibre44
00317       {-4.703,-3.736}, // fibre12
00318       {-4.211,-3.25}, // fibre45
00319       {-3.697,-2.735}, // fibre13
00320       {-3.208,-2.246}, // fibre46
00321       {-2.696,-1.736}, // fibre14
00322       {-2.205,-1.242}, // fibre47
00323       {-1.696,-0.735}, // fibre15
00324       {-1.201,-0.245}, // fibre48
00325       {-0.695,0.267}, // fibre16
00326       {-0.199,0.759}, // fibre49
00327       {0.303,1.266}, // fibre17
00328       {0.801,1.76}, // fibre50
00329       {1.308,2.27}, // fibre18
00330       {1.799,2.761}, // fibre51
00331       {2.312,3.268}, // fibre19
00332       {2.803,3.762}, // fibre52
00333       {3.31,4.263}, // fibre20
00334       {3.803,4.765}, // fibre53
00335       {4.308,5.267}, // fibre21
00336       {4.807,5.768}, // fibre54
00337       {5.308,6.269}, // fibre22
00338       {5.807,6.768}, // fibre55
00339       {6.311,7.272}, // fibre23
00340       {6.808,7.764}, // fibre56
00341       {7.315,8.275}, // fibre24
00342       {7.809,8.771}, // fibre57
00343       {8.315,9.277}, // fibre25
00344       {8.812,9.773}, // fibre58
00345       {9.32,10.279}, // fibre26
00346       {9.815,10.775}, // fibre59
00347       {10.323,11.278}, // fibre27
00348       {10.817,11.778}, // fibre60
00349       {11.322,12.277}, // fibre28
00350       {11.821,12.782}, // fibre61
00351       {12.324,13.276}, // fibre29
00352       {12.825,13.789}, // fibre62
00353       {13.321,14.274}, // fibre30
00354       {13.83,14.789}, // fibre63
00355       {14.318,15.271}, // fibre31
00356       {14.829,15.786}, // fibre64
00357       {15.315,16.264} // fibre32
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 }