ATLAS Offline Software
Loading...
Searching...
No Matches
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
12namespace FourMomUtils {
13
14using std::abs;
15using std::exp;
16
17double
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
Scalar eta() const
pseudorapidity method
#define z
INavigable4MomentumCollection::const_iterator I4MomIter_t
Definition ForwardTerm.h:16
double forwardTerm(const I4MomIter_t &iBeg, const I4MomIter_t &iEnd, double m_central, bool useThreeD=false)