ATLAS Offline Software
JetBroadening.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
6 
7 // AthAnalysisBase/ManaCore doesn't currently include the Trigger Service
8 #ifndef XAOD_ANALYSIS
9 
10 #include <cmath>
11 
12 namespace FourMomUtils {
13 
14 using std::abs;
15 using std::exp;
16 
17 bool jetBroadening( const I4MomIter_t& iBeg, const I4MomIter_t& iEnd,
18  double& wideJetBroadening, double& totalJetBroadening,
19  CLHEP::Hep3Vector thrust, bool useThreeD )
20 {
21  if(abs(thrust.mag()-1)>0.01)
22  return false;
23 
24  double Qu=0;
25  double Qd=0;
26  double etau=0;
27  double etad=0;
28  double phiu=0;
29  double phid=0;
30 
31  // ensure z component is zero
32  if(!useThreeD)
33  thrust.setZ(0);
34 
35  // determine average eta/phi for each hemisphere
36  for ( I4MomIter_t itr = iBeg; itr != iEnd; ++itr )
37  {
38  // default : standard definition of z component zero
39  double z=0;
40  if(useThreeD)
41  z=(*itr)->pz();
42 
43  CLHEP::Hep3Vector c( (*itr)->px(), (*itr)->py(), z );
44  if(c.dot(thrust)>0)
45  {
46  Qu += c.mag();
47  etau += (*itr)->eta() * c.mag();
48  phiu += (*itr)->phi() * c.mag();
49  }else{
50  Qd += c.mag();
51  etad += (*itr)->eta() * c.mag();
52  phid += (*itr)->phi() * c.mag();
53  }
54  }
55 
56  const double inv_Qu = 1. / Qu;
57  const double inv_Qd = 1. / Qd;
58 
59  etau *= inv_Qu;
60  etad *= inv_Qd;
61 
62  phiu *= inv_Qu;
63  phid *= inv_Qd;
64 
65  double Bu=0;
66  double Bd=0;
67 
68  // now detemine JetBroadenings in each hemisphere
69  for ( I4MomIter_t itr = iBeg; itr != iEnd; ++itr )
70  {
71  // default : standard definition of z component zero
72  double z=0;
73  if(useThreeD)
74  z=(*itr)->pz();
75 
76  CLHEP::Hep3Vector c( (*itr)->px(), (*itr)->py(), z );
77 
78  if(c.dot(thrust)>0)
79  {
80  Bu += c.mag() *
81  sqrt((etau-(*itr)->eta())*(etau-(*itr)->eta())+
82  (phiu-(*itr)->phi())*(phiu-(*itr)->phi()));
83  }else{
84  Bd += c.mag() *
85  sqrt((etad-(*itr)->eta())*(etad-(*itr)->eta())+
86  (phid-(*itr)->phi())*(phid-(*itr)->phi()));
87  }
88  }
89 
90  Bu /= 2*(Qu+Qd);
91  Bd /= 2*(Qu+Qd);
92 
93  totalJetBroadening=Bu+Bd;
94  wideJetBroadening=Bu;
95  if(Bd>Bu)
96  wideJetBroadening=Bd;
97 
98  return true;
99 }
100 
101 } //> end namespace FourMomUtils
102 
103 #endif
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
FourMomUtils::jetBroadening
bool jetBroadening(const I4MomIter_t &iBeg, const I4MomIter_t &iEnd, double &wideJetBroadening, double &totalJetBroadening, CLHEP::Hep3Vector thrust, bool useThreeD=false)
Definition: JetBroadening.cxx:17
z
#define z
FourMomUtils::thrust
CLHEP::Hep3Vector thrust(const I4MomIter_t &iBeg, const I4MomIter_t &iEnd, double &thrust_major, double &thrust_minor, bool useThreeD=false)
Definition: Event/FourMomUtils/src/Thrust.cxx:19
JetBroadening.h
python.compressB64.c
def c
Definition: compressB64.py:93
FourMomUtils
Definition: ForwardTerm.h:14