Fork me on GitHub

Changeset 41 in svn


Ignore:
Timestamp:
Nov 18, 2008, 5:00:10 PM (16 years ago)
Author:
Xavier Rouby
Message:

bug removed. Now working ok with CMS towers

File:
1 edited

Legend:

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

    r37 r41  
    44// Modified by X. Rouby for integration in Delphes
    55// !!! the numbering of the towers (iEta, iPhi) is **NOT** following any convention of the corresponding experiment
     6// v3 -- not working
    67
    78#include <cmath>
     9#include <iostream>
    810
    911#ifndef M_PI
     
    1315const double pi = acos(-1);
    1416
    15 /* // CDF data : 22 towers. step=2.7° at the beginning, and after, it changes
     17static bool einmal=true;
     18/*
     19 // CDF data : 22 towers. step=2.7° at the beginning, and after, it changes
    1620const unsigned int ntower = 22;
    1721const 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°
    1822          33.524,  36.822, 40.261, 43.614, 47.436, 51.790, 56.735, 62.310, 68.516, 75.297, 82.526, 90.000 };
    19 const couble tower_eta_edges[ntower+1] = {
     23const double tower_eta_edges[ntower+1] = {
    2024    0.0,   0.130817437415,   0.259479460739,   0.384075299436,   0.503273260393,   0.616250691646,   0.72264587494,   0.822472442947,   
    2125    0.916007799535,   1.00361552815,   1.10000635195,   1.19999982651,   1.31695789692,   1.41531379676,   1.52309848418, 1.64260787639, 
    2226    1.77704423284,  1.93106912741,  2.1118548488,  2.33129451223,  2.61134904017,  3.00008274261,  3.64253335732 };
    23 const 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,
     27const double tower_dphi[ntower] = { // list of the tower size in phi (in degrees)
     28        7.5, 7.5, 7.5, 7.5, 7.5, 7.5, 7.5, 15.,
     29        15., 15., 15., 15., 15., 7.5, 7.5, 7.5,
    2630        7.5, 7.5, 7.5, 7.5, 7.5, 7.5 };
    2731*/
    2832
    2933// CMS data
    30 const unsigned int ntower = 41;
     34const unsigned int ntower = 40;
    3135const 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
    3236    0., // lower limit of the most central tower
     
    3640    4.700,  // lower limit of the most forward tower
    3741    5.000}; // higher limit of the most forward tower
     42
    3843const 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 };
     44     5, 5, 5, 5, 5,  5, 5, 5, 5, 5,  5, 5, 5, 5, 5,  5, 5, 5, 5, 10,
     45    10,10,10,10,10, 10,10,10,10,10, 10,10,10,10,10, 10,10,10,20, 20 };
    4246
    4347
     
    5256  CalTower(const double Et0, const double eta0, const double phi0): Et(Et0), eta(eta0), phi(phi0)
    5357  {
     58
    5459        if (fabs(eta) > tower_eta_edges[ntower]) {iEta = -1; iPhi = -1; } // outside the detector
    5560        else { 
     
    5762                double all_towers[nn];
    5863                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;
     64                for(unsigned int j= ntower-1; i<ntower; j--,i++) { all_towers[i] = -tower_eta_edges[j];}
     65                for(unsigned int j= 1; j <ntower+1; j++, i++) { all_towers[i] =  tower_eta_edges[j]; }
     66                for(i = 0; i< nn; i++) { if(eta < all_towers[i]) {iEta=i; break;} }
    6267
    6368                for(unsigned int j=0; j<ntower; j++) {
    64                         int wedge = int(360./tower_dphi[i]);
    65                         iPhi = int(phi/(2.*pi)* wedge)%wedge;
     69                        int wedge = int(360./tower_dphi[j]);
     70                        iPhi = 0; int(phi/(2.*pi)* wedge)%wedge;
    6671                }
    6772        }
    68 
    69 /*    if(fabs(eta) < pseudorapidity(TOWER_THETA[0])) { // |eta| < 3.64
    70       if(eta <= 0){ // central particle, but negative eta
    71         for(unsigned int i = 0; i < ntower-1; i++)
    72           if(eta < pseudorapidity(180 - TOWER_THETA[i + 1])){ // eta < -3 ; -2.61 ; ... ; 0
    73             iEta = 4 + i;   // <-- pourquio on commence à  4 ????
    74             break;
    75           }
    76       } // central particle but negative eta
    77       else{ // central particle but positive eta
    78         for(unsigned int i = 0; i < ntower-1; i++)
    79           if(-eta < pseudorapidity(180 - TOWER_THETA[i + 1])){ // eta > 3 ; 2.61 ; ... ; 0
    80             iEta = 5+ 2*(ntower-2) - i;     //CDF iEta = 47 - i;
    81             break;
    82           }
    83       } // central particle but positive eta 
    84       if( (iEta >= 8 && iEta < 14) || (iEta >= 38 && iEta < 44) )
    85         iPhi = int(phi/(2*pi)*48)%48;
    86       else
    87         iPhi = int(phi/(2*pi)*24)%24;
    88     }
    89     else{ // particle beyond detector reach :
    90       iEta = -1;
    91       iPhi = -1;
    92     }
    93 */
    9473  }
    9574
     
    10281  }
    10382
    104 /* // converts theta angle [degrees] into pseudorapidity
     83// converts theta angle [degrees] into pseudorapidity
    10584 double pseudorapidity(const double theta) {
    10685         return -log(tan( (theta/2.) * (pi/180.) ));
    107  }*/
     86 }
    10887
    10988};
Note: See TracChangeset for help on using the changeset viewer.