ATLAS Offline Software
JetMasses.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
18 jetMasses( const I4MomIter_t& iBeg, const I4MomIter_t& iEnd,
19  double& heavyJetMass, double& lightJetMass,
20  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 = 1. / (Q*Q);
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
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
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
CalibCoolCompareRT.up
up
Definition: CalibCoolCompareRT.py:109
JetMasses.h
FourMomUtils::jetMasses
bool jetMasses(const I4MomIter_t &iBeg, const I4MomIter_t &iEnd, double &heavyJetMass, double &lightJetMass, CLHEP::Hep3Vector thrust)
Definition: JetMasses.cxx:18
python.compressB64.c
def c
Definition: compressB64.py:93
FourMomUtils
Definition: ForwardTerm.h:14