[11] | 1 | #ifndef _CAL_TOWER_HH_
|
---|
| 2 | #define _CAL_TOWER_HH_
|
---|
| 3 |
|
---|
[35] | 4 | // Modified by X. Rouby for integration in Delphes
|
---|
[37] | 5 | // !!! the numbering of the towers (iEta, iPhi) is **NOT** following any convention of the corresponding experiment
|
---|
[35] | 6 |
|
---|
[42] | 7 |
|
---|
[11] | 8 | #include <cmath>
|
---|
[100] | 9 | #include <iostream>
|
---|
[11] | 10 |
|
---|
[100] | 11 | /* // CDF data : 22 towers. step=2.7° at the beginning, and after, it changes
|
---|
| 12 | const unsigned int ntower = 0;
|
---|
| 13 | const double TOWER_THETA[ntower+1] = {0},// step=2.7°
|
---|
| 14 | //const 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°
|
---|
| 15 | // 33.524, 36.822, 40.261, 43.614, 47.436, 51.790, 56.735, 62.310, 68.516, 75.297, 82.526, 90.000 };
|
---|
[41] | 16 | const double tower_eta_edges[ntower+1] = {
|
---|
[37] | 17 | 0.0, 0.130817437415, 0.259479460739, 0.384075299436, 0.503273260393, 0.616250691646, 0.72264587494, 0.822472442947,
|
---|
| 18 | 0.916007799535, 1.00361552815, 1.10000635195, 1.19999982651, 1.31695789692, 1.41531379676, 1.52309848418, 1.64260787639,
|
---|
| 19 | 1.77704423284, 1.93106912741, 2.1118548488, 2.33129451223, 2.61134904017, 3.00008274261, 3.64253335732 };
|
---|
[41] | 20 | const double tower_dphi[ntower] = { // list of the tower size in phi (in degrees)
|
---|
| 21 | 7.5, 7.5, 7.5, 7.5, 7.5, 7.5, 7.5, 15.,
|
---|
| 22 | 15., 15., 15., 15., 15., 7.5, 7.5, 7.5,
|
---|
[37] | 23 | 7.5, 7.5, 7.5, 7.5, 7.5, 7.5 };
|
---|
| 24 | */
|
---|
[35] | 25 |
|
---|
[100] | 26 |
|
---|
[35] | 27 | // CMS data
|
---|
[41] | 28 | const unsigned int ntower = 40;
|
---|
[100] | 29 | //const double tower_eta_edges[ntower+1] = {0}; // list of the edges of each tower, in eta, for eta>0, assuming a symmetric detector in eta<0
|
---|
[37] | 30 | const 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
|
---|
| 31 | 0., // lower limit of the most central tower
|
---|
| 32 | 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,
|
---|
| 33 | 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,
|
---|
| 34 | 4.350, 4.525,
|
---|
| 35 | 4.700, // lower limit of the most forward tower
|
---|
| 36 | 5.000}; // higher limit of the most forward tower
|
---|
[41] | 37 |
|
---|
[100] | 38 | //const double tower_dphi[ntower] = {}; // list of the tower size in phi (in degrees)
|
---|
[37] | 39 | const double tower_dphi[ntower] = { // list of the tower size in phi (in degrees)
|
---|
[41] | 40 | 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 10,
|
---|
| 41 | 10,10,10,10,10, 10,10,10,10,10, 10,10,10,10,10, 10,10,10,20, 20 };
|
---|
[35] | 42 |
|
---|
[37] | 43 |
|
---|
[244] | 44 | #ifndef __PI__
|
---|
| 45 | #define __PI__
|
---|
| 46 | const float pi = 3.14159265358979312;
|
---|
| 47 | #endif
|
---|
| 48 |
|
---|
[11] | 49 | class CalTower
|
---|
| 50 | {
|
---|
| 51 | public:
|
---|
| 52 | double Et,eta,phi;
|
---|
| 53 | int iEta,iPhi;
|
---|
| 54 |
|
---|
| 55 | CalTower(): Et(0), eta(0), phi(0), iEta(-1), iPhi(-1) {}
|
---|
[37] | 56 |
|
---|
[35] | 57 | CalTower(const double Et0, const double eta0, const double phi0): Et(Et0), eta(eta0), phi(phi0)
|
---|
[11] | 58 | {
|
---|
[41] | 59 |
|
---|
[37] | 60 | if (fabs(eta) > tower_eta_edges[ntower]) {iEta = -1; iPhi = -1; } // outside the detector
|
---|
| 61 | else {
|
---|
| 62 | const unsigned int nn = ntower*2;
|
---|
| 63 | double all_towers[nn];
|
---|
| 64 | unsigned int i =0;
|
---|
[41] | 65 | for(unsigned int j= ntower-1; i<ntower; j--,i++) { all_towers[i] = -tower_eta_edges[j];}
|
---|
| 66 | for(unsigned int j= 1; j <ntower+1; j++, i++) { all_towers[i] = tower_eta_edges[j]; }
|
---|
| 67 | for(i = 0; i< nn; i++) { if(eta < all_towers[i]) {iEta=i; break;} }
|
---|
[37] | 68 |
|
---|
| 69 | for(unsigned int j=0; j<ntower; j++) {
|
---|
[41] | 70 | int wedge = int(360./tower_dphi[j]);
|
---|
[42] | 71 | iPhi = int(phi/(2.*pi)* wedge)%wedge;
|
---|
[37] | 72 | }
|
---|
| 73 | }
|
---|
[11] | 74 | }
|
---|
[37] | 75 |
|
---|
[35] | 76 | 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) {}
|
---|
[37] | 77 |
|
---|
[11] | 78 | CalTower(const CalTower& c): Et(c.Et), eta(c.eta), phi(c.phi), iEta(c.iEta), iPhi(c.iPhi) {}
|
---|
[37] | 79 |
|
---|
| 80 | bool isEqual(const CalTower& c) {
|
---|
[11] | 81 | return Et == c.Et && eta == c.eta && phi == c.phi && iEta == c.iEta && iPhi == c.iPhi;
|
---|
| 82 | }
|
---|
[35] | 83 |
|
---|
[41] | 84 | // converts theta angle [degrees] into pseudorapidity
|
---|
[35] | 85 | double pseudorapidity(const double theta) {
|
---|
| 86 | return -log(tan( (theta/2.) * (pi/180.) ));
|
---|
[41] | 87 | }
|
---|
[35] | 88 |
|
---|
[11] | 89 | };
|
---|
| 90 |
|
---|
[35] | 91 | /*****
|
---|
[37] | 92 | e.g. CDF
|
---|
[35] | 93 | iEta==4 si -3.642 < eta < -3.000
|
---|
| 94 | iEta==47 si 3.000 < eta < 3.642
|
---|
| 95 | iEta==-1 si eta < -3.642 ou si eta > 3.642
|
---|
| 96 |
|
---|
| 97 | i theta pseudorapidity iEta
|
---|
| 98 | --------------------------------------
|
---|
| 99 | 0 3.0 -3.00008274261 4
|
---|
| 100 | 1 5.7 -2.61134904017 5
|
---|
| 101 | 2 8.4 -2.33129451223 6
|
---|
| 102 | 3 11.1 -2.1118548488 7
|
---|
| 103 | 4 13.8 -1.93106912741 8
|
---|
| 104 | 5 16.5 -1.77704423284 9
|
---|
| 105 | 6 19.2 -1.64260787639 10
|
---|
| 106 | 7 21.9 -1.52309848418 11
|
---|
| 107 | 8 24.6 -1.41531379676 12
|
---|
| 108 | 9 27.3 -1.31695789692 13
|
---|
| 109 | 10 30.0 -1.19999982651 14
|
---|
| 110 | 11 33.524 -1.10000635195 15
|
---|
| 111 | 12 36.822 -1.00361552815 16
|
---|
| 112 | 13 40.261 -0.916007799535 17
|
---|
| 113 | 14 43.614 -0.822472442947 18
|
---|
| 114 | 15 47.436 -0.72264587494 19
|
---|
| 115 | 16 51.79 -0.616250691646 20
|
---|
| 116 | 17 56.735 -0.503273260393 21
|
---|
| 117 | 18 62.31 -0.384075299436 22
|
---|
| 118 | 19 68.516 -0.259479460739 23
|
---|
| 119 | 20 75.297 -0.130817437415 24
|
---|
| 120 | 21 82.526 1.11022302463e-16 25
|
---|
| 121 |
|
---|
| 122 |
|
---|
| 123 | i theta pseudorapidity iEta
|
---|
| 124 | --------------------------------------
|
---|
[37] | 125 | 0 3.0 3.00008274261 47
|
---|
| 126 | 1 5.7 2.61134904017 46
|
---|
| 127 | 2 8.4 2.33129451223 45
|
---|
| 128 | 3 11.1 2.1118548488 44
|
---|
| 129 | 4 13.8 1.93106912741 43
|
---|
| 130 | 5 16.5 1.77704423284 42
|
---|
| 131 | 6 19.2 1.64260787639 41
|
---|
| 132 | 7 21.9 1.52309848418 40
|
---|
| 133 | 8 24.6 1.41531379676 39
|
---|
| 134 | 9 27.3 1.31695789692 38
|
---|
| 135 | 10 30.0 1.19999982651 37
|
---|
| 136 | 11 33.524 1.10000635195 36
|
---|
| 137 | 12 36.822 1.00361552815 35
|
---|
| 138 | 13 40.261 0.916007799535 34
|
---|
| 139 | 14 43.614 0.822472442947 33
|
---|
| 140 | 15 47.436 0.72264587494 32
|
---|
| 141 | 16 51.79 0.616250691646 31
|
---|
| 142 | 17 56.735 0.503273260393 30
|
---|
| 143 | 18 62.31 0.384075299436 29
|
---|
| 144 | 19 68.516 0.259479460739 28
|
---|
| 145 | 20 75.297 0.130817437415 27
|
---|
| 146 | 21 82.526 1.1102230246e-16 26
|
---|
[35] | 147 | *****/
|
---|
| 148 |
|
---|
[11] | 149 | #endif
|
---|
[35] | 150 |
|
---|