ATLAS Offline Software
Loading...
Searching...
No Matches
JetBroadening.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 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
12namespace FourMomUtils {
13
14using std::abs;
15using std::exp;
16
17bool 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 = Qu!=0 ? (1. / Qu) : 1;
57 const double inv_Qd = Qd!=0 ? (1. / Qd) : 1;
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 if (Qu+Qd != 0) {
91 Bu /= 2*(Qu+Qd);
92 Bd /= 2*(Qu+Qd);
93 }
94
95 totalJetBroadening=Bu+Bd;
96 wideJetBroadening=Bu;
97 if(Bd>Bu)
98 wideJetBroadening=Bd;
99
100 return true;
101}
102
103} //> end namespace FourMomUtils
104
105#endif
#define z
bool jetBroadening(const I4MomIter_t &iBeg, const I4MomIter_t &iEnd, double &wideJetBroadening, double &totalJetBroadening, CLHEP::Hep3Vector thrust, bool useThreeD=false)
CLHEP::Hep3Vector thrust(const I4MomIter_t &iBeg, const I4MomIter_t &iEnd, double &thrust_major, double &thrust_minor, bool useThreeD=false)
INavigable4MomentumCollection::const_iterator I4MomIter_t
Definition ForwardTerm.h:16