ATLAS Offline Software
Loading...
Searching...
No Matches
JetMasses.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
18jetMasses( const I4MomIter_t& iBeg, const I4MomIter_t& iEnd,
19 double& heavyJetMass, double& lightJetMass,
20 const CLHEP::Hep3Vector& thrust )
21{
22 if(abs(thrust.mag()-1)>0.01)
23 return false;
24
25 // split event into upper and lower hemisphere
26 CLHEP::Hep3Vector up(0,0,0);
27 CLHEP::Hep3Vector down(0,0,0);
28
29 double Q=0;
30
31 for ( I4MomIter_t itr = iBeg; itr != iEnd; ++itr )
32 {
33 CLHEP::Hep3Vector c( (*itr)->px(), (*itr)->py(), (*itr)->pz() );
34 Q += sqrt( (*itr)->px()*(*itr)->px()+(*itr)->py()*(*itr)->py() );
35
36 if(c.dot(thrust)>0)
37 {
38 up += c;
39 }else{
40 down += c;
41 }
42 }
43
44 const double inv_Q2 = Q!=0 ? (1. / (Q*Q)) : 0;
45 lightJetMass=down.mag2()*inv_Q2;
46 heavyJetMass=up.mag2()*inv_Q2;
47 if ( lightJetMass > heavyJetMass )
48 {
49 lightJetMass=up.mag2()*inv_Q2;
50 heavyJetMass=down.mag2()*inv_Q2;
51 }
52
53 return true;
54}
55
56} //> end namespace FourMomUtils
57
58#endif
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
bool jetMasses(const I4MomIter_t &iBeg, const I4MomIter_t &iEnd, double &heavyJetMass, double &lightJetMass, const CLHEP::Hep3Vector &thrust)
Definition JetMasses.cxx:18