Fork me on GitHub

source: svn/trunk/Utilities/CDFCones/interface/CalTower.h@ 11

Last change on this file since 11 was 2, checked in by Xavier Rouby, 16 years ago

first commit

File size: 1.4 KB
RevLine 
[2]1#ifndef _CAL_TOWER_HH_
2#define _CAL_TOWER_HH_
3
4#include <cmath>
5
6const double TOWER_THETA[23] = { 3.000, 5.700, 8.400, 11.100, 13.800, 16.500, 19.200, 21.900, 24.600, 27.300, 30.000, 33.524,
7 36.822, 40.261, 43.614, 47.436, 51.790, 56.735, 62.310, 68.516, 75.297, 82.526, 90.000 };
8
9class CalTower
10{
11 public:
12
13 double Et,eta,phi;
14 int iEta,iPhi;
15
16 CalTower(): Et(0), eta(0), phi(0), iEta(-1), iPhi(-1) {}
17 CalTower(double Et0, double eta0, double phi0): Et(Et0), eta(eta0), phi(phi0)
18 {
19 if(fabs(eta) < -log(tan(TOWER_THETA[0]*M_PI/180/2))){
20 if(eta <= 0){
21 for(int i = 0; i < 22; i++)
22 if(eta < -log(tan((180 - TOWER_THETA[i + 1])*M_PI/180/2))){
23 iEta = 4 + i;
24 break;
25 }
26 }
27 else{
28 for(int i = 0; i < 22; i++)
29 if(-eta < -log(tan((180 - TOWER_THETA[i + 1])*M_PI/180/2))){
30 iEta = 47 - i;
31 break;
32 }
33 }
34 if(iEta >= 8 && iEta < 14 || iEta >= 38 && iEta < 44)
35 iPhi = int(phi/2/M_PI*48)%48;
36 else
37 iPhi = int(phi/2/M_PI*24)%24;
38 }
39 else{
40 iEta = -1;
41 iPhi = -1;
42 }
43 }
44 CalTower(double Et0, double eta0, double phi0, int iEta0, int iPhi0): Et(Et0), eta(eta0), phi(phi0), iEta(iEta0), iPhi(iPhi0) {}
45 CalTower(const CalTower& c): Et(c.Et), eta(c.eta), phi(c.phi), iEta(c.iEta), iPhi(c.iPhi) {}
46 bool isEqual(CalTower c)
47 {
48 return Et == c.Et && eta == c.eta && phi == c.phi && iEta == c.iEta && iPhi == c.iPhi;
49 }
50};
51
52#endif
Note: See TracBrowser for help on using the repository browser.