ATLAS Offline Software
ForwardTerm.cxx
Go to the documentation of this file.
1 /*
2  Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
3 */
4 
5 #include <cmath>
7 
8 // AthAnalysisBase/ManaCore doesn't currently include the Trigger Service
9 #ifndef XAOD_ANALYSIS
10 
11 
12 namespace FourMomUtils {
13 
14 using std::abs;
15 using std::exp;
16 
17 double
18 forwardTerm( const I4MomIter_t& iBeg,
19  const I4MomIter_t& iEnd,
20  double central, bool useThreeD )
21 {
22  double Q = 0;
23  double suppressed = 0;
24  double eta = 0;
25 
26  // determine average eta for event
27  for ( I4MomIter_t itr = iBeg; itr != iEnd; ++itr )
28  {
29  if(abs((*itr)->eta())<central)
30  {
31  // default : standard definition of z component zero
32  double z=0;
33  if(useThreeD)
34  z=(*itr)->pz();
35 
36  CLHEP::Hep3Vector c( (*itr)->px(), (*itr)->py(), z );
37  Q += c.mag();
38  eta += (*itr)->eta() * c.mag();
39  }
40  }
41 
42  if (Q <= 0)
43  return 0;
44  const double inv_Q = 1. / Q;
45 
46  eta *= inv_Q;
47 
48  for ( I4MomIter_t itr = iBeg; itr != iEnd; ++itr )
49  {
50  if(abs((*itr)->eta())>central)
51  {
52  // default : standard definition of z component zero
53  double z=0;
54  if(useThreeD)
55  z=(*itr)->pz();
56 
57  CLHEP::Hep3Vector c( (*itr)->px(), (*itr)->py(), z );
58  suppressed += c.mag() * exp( -abs( eta - (*itr)->eta() ));
59  }
60  }
61 
62  return suppressed * inv_Q;
63 }
64 
65 } //> end namespace FourMomUtils
66 
67 
68 #endif
DataModel_detail::const_iterator
Const iterator class for DataVector/DataList.
Definition: DVLIterator.h:82
checkPlugins.suppressed
suppressed
Definition: checkPlugins.py:206
drawFromPickle.exp
exp
Definition: drawFromPickle.py:36
z
#define z
FourMomUtils::forwardTerm
double forwardTerm(const I4MomIter_t &iBeg, const I4MomIter_t &iEnd, double m_central, bool useThreeD=false)
Definition: ForwardTerm.cxx:18
python.compressB64.c
def c
Definition: compressB64.py:93
ForwardTerm.h
FourMomUtils
Definition: ForwardTerm.h:14