Fork me on GitHub

Ignore:
Timestamp:
Nov 18, 2008, 2:39:38 AM (16 years ago)
Author:
Xavier Rouby
Message:

new version

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Utilities/Fastjet/plugins/CDFCones/interface/CalTower.hh

    r35 r37  
    33
    44// Modified by X. Rouby for integration in Delphes
     5// !!! the numbering of the towers (iEta, iPhi) is **NOT** following any convention of the corresponding experiment
    56
    67#include <cmath>
     
    1213const double pi = acos(-1);
    1314
    14 // CDF data : 23 towers. step=2.7° at the beginning, and after, it changes
    15 //const unsigned int ntower = 23;
    16 //const double TOWER_THETA[ntower] = {  3.000,  5.700,  8.400, 11.100, 13.800, 16.500, 19.200, 21.900, 24.600, 27.300, 30.000,// step=2.7°
    17 //          33.524,  36.822, 40.261, 43.614, 47.436, 51.790, 56.735, 62.310, 68.516, 75.297, 82.526, 90.000 };
     15/* // CDF data : 22 towers. step=2.7° at the beginning, and after, it changes
     16const unsigned int ntower = 22;
     17const double TOWER_THETA[ntower+1] = {3.000,  5.700,  8.400, 11.100, 13.800, 16.500, 19.200, 21.900, 24.600, 27.300, 30.000,// step=2.7°
     18          33.524,  36.822, 40.261, 43.614, 47.436, 51.790, 56.735, 62.310, 68.516, 75.297, 82.526, 90.000 };
     19const couble tower_eta_edges[ntower+1] = {
     20    0.0,   0.130817437415,   0.259479460739,   0.384075299436,   0.503273260393,   0.616250691646,   0.72264587494,   0.822472442947,   
     21    0.916007799535,   1.00361552815,   1.10000635195,   1.19999982651,   1.31695789692,   1.41531379676,   1.52309848418, 1.64260787639, 
     22    1.77704423284,  1.93106912741,  2.1118548488,  2.33129451223,  2.61134904017,  3.00008274261,  3.64253335732 };
     23const int tower_dphi[ntower] = { // list of the tower size in phi (in degrees)
     24        7.5, 7.5, 7.5, 7.5, 7.5, 7.5, 7.5, 15,
     25        15,  15,  15,  15,  15,  7.5, 7.5  7.5,
     26        7.5, 7.5, 7.5, 7.5, 7.5, 7.5 };
     27*/
    1828
    19 // CMS HB: 0.087 x 0.087 = 0.087 x 5°
    20 // CMS HF: 0.175 x 0.175 = 0.175 x 10°
    2129// CMS data
    22 const unsigned int ntower = 40;
    23 //const double TOWER_ETA[ntower] = { 
    24 //    0.087, 0.174, 0.261, 0.348, 0.435, 0.522, 0.609, 0.696, 0.783, 0.870, 0.957, 1.044, 1.131, 1.218, 1.305, 1.392, 1.479, 1.566,
    25 //    1.653, 1.740, 1.830, 1.930, 2.043, 2.172, 2.322, 2.500, 2.650, 2.868, 2.950, 3.125, 3.300, 3.475, 3.650, 3.825, 4.000, 4.175,
    26 //    4.350, 4.525, 4.700}
    27 const double TOWER_THETA[ntower] = {
    28 1.04221324479 ,  1.24151823936 ,  1.4789296564 ,  1.76172836867 ,  2.09858297042 ,  2.49981191976 ,  2.97769357253 ,  3.54683172517 , 
    29 4.22458468545 ,  5.03156565222 ,  5.99222070913 ,  6.50323511476 ,  8.08260215014 ,  9.38520669791 ,  11.2029938559 ,  13.0015703243 , 
    30 14.7731659079 ,  16.5174067026 ,  18.2267592981 ,  19.9103474053 ,  21.6789816306 ,  23.5965023504 ,  25.6731077732 ,  27.9190341722 , 
    31 30.3443463769 ,  32.9586699802 ,  35.7708584993 ,  38.7885912317 ,  42.017901925 ,  45.4626450521 ,  49.1239157061 ,  52.9994507062 , 
    32 57.0830516071 ,  61.3640831827 ,  65.8271109013 ,  70.4517445074 ,  75.2127486134 ,  80.0804628398 ,  85.02154355, 90
    33 };
     30const unsigned int ntower = 41;
     31const double tower_eta_edges[ntower+1] = { // list of the edges of each tower, in eta, for eta>0, assuming a symmetric detector in eta<0
     32    0., // lower limit of the most central tower
     33    0.087, 0.174, 0.261, 0.348, 0.435, 0.522, 0.609, 0.696, 0.783, 0.870, 0.957, 1.044, 1.131, 1.218, 1.305, 1.392, 1.479, 1.566,
     34    1.653, 1.740, 1.830, 1.930, 2.043, 2.172, 2.322, 2.500, 2.650, 2.868, 2.950, 3.125, 3.300, 3.475, 3.650, 3.825, 4.000, 4.175,
     35    4.350, 4.525,
     36    4.700,  // lower limit of the most forward tower
     37    5.000}; // higher limit of the most forward tower
     38const double tower_dphi[ntower] = { // list of the tower size in phi (in degrees)
     39     5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
     40    10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,10,
     41    20,20 };
     42
    3443
    3544class CalTower
     
    4049
    4150  CalTower(): Et(0), eta(0), phi(0), iEta(-1), iPhi(-1) {}
     51
    4252  CalTower(const double Et0, const double eta0, const double phi0): Et(Et0), eta(eta0), phi(phi0)
    4353  {
    44     if(fabs(eta) < pseudorapidity(TOWER_THETA[0])) { // |eta| < 3.64
     54        if (fabs(eta) > tower_eta_edges[ntower]) {iEta = -1; iPhi = -1; } // outside the detector
     55        else { 
     56                const unsigned int nn = ntower*2;
     57                double all_towers[nn];
     58                unsigned int i =0;
     59                for(unsigned int j= ntower-1; j>=0; j++, i++) all_towers[i] = -tower_eta_edges[j];
     60                for(unsigned int j= 1; j <ntower+1; j++, i++) all_towers[i] =  tower_eta_edges[j];
     61                for(i = 0; i< nn; i++) if(eta < all_towers[i]) iEta=i;
     62
     63                for(unsigned int j=0; j<ntower; j++) {
     64                        int wedge = int(360./tower_dphi[i]);
     65                        iPhi = int(phi/(2.*pi)* wedge)%wedge;
     66                }
     67        }
     68
     69/*    if(fabs(eta) < pseudorapidity(TOWER_THETA[0])) { // |eta| < 3.64
    4570      if(eta <= 0){ // central particle, but negative eta
    4671        for(unsigned int i = 0; i < ntower-1; i++)
    4772          if(eta < pseudorapidity(180 - TOWER_THETA[i + 1])){ // eta < -3 ; -2.61 ; ... ; 0
    48             iEta = 4 + i;
     73            iEta = 4 + i;   // <-- pourquio on commence à  4 ????
    4974            break;
    5075          }
     
    5378        for(unsigned int i = 0; i < ntower-1; i++)
    5479          if(-eta < pseudorapidity(180 - TOWER_THETA[i + 1])){ // eta > 3 ; 2.61 ; ... ; 0
    55             iEta = 47 - i;
     80            iEta = 5+ 2*(ntower-2) - i;     //CDF iEta = 47 - i;
    5681            break;
    5782          }
     
    6691      iPhi = -1;
    6792    }
     93*/
    6894  }
     95
    6996  CalTower(const double Et0, const double eta0, const double phi0, const int iEta0, const int iPhi0): Et(Et0), eta(eta0), phi(phi0), iEta(iEta0), iPhi(iPhi0) {}
     97
    7098  CalTower(const CalTower& c): Et(c.Et), eta(c.eta), phi(c.phi), iEta(c.iEta), iPhi(c.iPhi) {}
    71   bool isEqual(const CalTower& c)
    72   {
     99
     100  bool isEqual(const CalTower& c) {
    73101    return Et == c.Et && eta == c.eta && phi == c.phi && iEta == c.iEta && iPhi == c.iPhi;
    74102  }
    75103
    76 // converts theta angle [degrees] into pseudorapidity
     104/* // converts theta angle [degrees] into pseudorapidity
    77105 double pseudorapidity(const double theta) {
    78106         return -log(tan( (theta/2.) * (pi/180.) ));
    79          }
     107 }*/
    80108
    81109};
    82110
    83111/*****
    84  e.g.
     112 e.g.  CDF
    85113  iEta==4  si -3.642 < eta < -3.000
    86114  iEta==47 si  3.000 < eta <  3.642
     
    115143 i   theta    pseudorapidity     iEta
    116144--------------------------------------
    117  0   3.0      -3.00008274261      47
    118  1   5.7      -2.61134904017      46
    119  2   8.4      -2.33129451223      45
    120  3   11.1     -2.1118548488       44
    121  4   13.8     -1.93106912741      43
    122  5   16.5     -1.77704423284      42
    123  6   19.2     -1.64260787639      41
    124  7   21.9     -1.52309848418      40
    125  8   24.6     -1.41531379676      39
    126  9   27.3     -1.31695789692      38
    127 10   30.0     -1.19999982651      37
    128 11   33.524   -1.10000635195      36
    129 12   36.822   -1.00361552815      35
    130 13   40.261   -0.916007799535     34
    131 14   43.614   -0.822472442947     33
    132 15   47.436   -0.72264587494      32
    133 16   51.79    -0.616250691646     31
    134 17   56.735   -0.503273260393     30
    135 18   62.31    -0.384075299436     29
    136 19   68.516   -0.259479460739     28
    137 20   75.297   -0.130817437415     27
    138 21   82.526   1.11022302463e-16   26
     145 0   3.0       3.00008274261      47
     146 1   5.7       2.61134904017      46
     147 2   8.4       2.33129451223      45
     148 3   11.1      2.1118548488       44
     149 4   13.8      1.93106912741      43
     150 5   16.5      1.77704423284      42
     151 6   19.2      1.64260787639      41
     152 7   21.9      1.52309848418      40
     153 8   24.6      1.41531379676      39
     154 9   27.3      1.31695789692      38
     15510   30.0      1.19999982651      37
     15611   33.524    1.10000635195      36
     15712   36.822    1.00361552815      35
     15813   40.261    0.916007799535     34
     15914   43.614    0.822472442947     33
     16015   47.436    0.72264587494      32
     16116   51.79     0.616250691646     31
     16217   56.735    0.503273260393     30
     16318   62.31     0.384075299436     29
     16419   68.516    0.259479460739     28
     16520   75.297    0.130817437415     27
     16621   82.526    1.1102230246e-16   26
    139167*****/
    140168
Note: See TracChangeset for help on using the changeset viewer.