Fork me on GitHub

source: git/external/fastjet/plugins/CDFCones/CalTower.hh@ c6321ad

ImprovedOutputFile Timing dual_readout llp
Last change on this file since c6321ad was d7d2da3, checked in by pavel <pavel@…>, 12 years ago

move branches/ModularDelphes to trunk

  • Property mode set to 100644
File size: 2.6 KB
RevLine 
[d7d2da3]1#ifndef _CAL_TOWER_HH_
2#define _CAL_TOWER_HH_
3
4//----------------------------------------------------------------------
5// This file distributed with FastJet has been obtained from
6// http://www.pa.msu.edu/~huston/Les_Houches_2005/JetClu+Midpoint-StandAlone.tgz
7//
8// Permission to distribute it with FastJet has been granted by Joey
9// Huston (see the COPYING file in the main FastJet directory for
10// details).
11// Changes from the original file are listed below.
12//----------------------------------------------------------------------
13
14// History of changes compared to the original CalTower.hh file
15//
16// 2011-11-14 Gregory Soyez <soyez@fastjet.fr>
17//
18// * added a few parentheses suggested by the -Wparentheses gcc option
19//
20// 2009-01-17 Gregory Soyez <soyez@fastjet.fr>
21//
22// * put the code in the fastjet::cdf namespace
23//
24// 2008-01-15 Gregory Soyez <soyez@fastjet.fr>
25//
26// * fixed issues with compilation under VC (definition of M_PI)
27//
28// 2006-09-24 Gavin Salam <salam@lpthe.jussieu.fr>
29//
30// * added JetClu+MidPoint to FastJet
31
32#include <cmath>
33
34#ifndef M_PI
35#define M_PI 3.141592653589793238462643383279502884197
36#endif
37
38#include <fastjet/internal/base.hh>
39
40FASTJET_BEGIN_NAMESPACE
41
42namespace cdf{
43
44const 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,
45 36.822, 40.261, 43.614, 47.436, 51.790, 56.735, 62.310, 68.516, 75.297, 82.526, 90.000 };
46
47class CalTower
48{
49 public:
50
51 double Et,eta,phi;
52 int iEta,iPhi;
53
54 CalTower(): Et(0), eta(0), phi(0), iEta(-1), iPhi(-1) {}
55 CalTower(double Et0, double eta0, double phi0): Et(Et0), eta(eta0), phi(phi0)
56 {
57 if(fabs(eta) < -log(tan(TOWER_THETA[0]*M_PI/180/2))){
58 if(eta <= 0){
59 for(int i = 0; i < 22; i++)
60 if(eta < -log(tan((180 - TOWER_THETA[i + 1])*M_PI/180/2))){
61 iEta = 4 + i;
62 break;
63 }
64 }
65 else{
66 for(int i = 0; i < 22; i++)
67 if(-eta < -log(tan((180 - TOWER_THETA[i + 1])*M_PI/180/2))){
68 iEta = 47 - i;
69 break;
70 }
71 }
72 if ((iEta >= 8 && iEta < 14) || (iEta >= 38 && iEta < 44))
73 iPhi = int(phi/2/M_PI*48)%48;
74 else
75 iPhi = int(phi/2/M_PI*24)%24;
76 }
77 else{
78 iEta = -1;
79 iPhi = -1;
80 }
81 }
82 CalTower(double Et0, double eta0, double phi0, int iEta0, int iPhi0): Et(Et0), eta(eta0), phi(phi0), iEta(iEta0), iPhi(iPhi0) {}
83 CalTower(const CalTower& c): Et(c.Et), eta(c.eta), phi(c.phi), iEta(c.iEta), iPhi(c.iPhi) {}
84 bool isEqual(CalTower c)
85 {
86 return Et == c.Et && eta == c.eta && phi == c.phi && iEta == c.iEta && iPhi == c.iPhi;
87 }
88};
89
90} // namespace cdf
91
92FASTJET_END_NAMESPACE
93
94#endif
Note: See TracBrowser for help on using the repository browser.