Commit da27980b authored by Atlas-Software Librarian's avatar Atlas-Software Librarian Committed by Graeme Stewart
Browse files

'CMakeLists.txt' (FourMomUtils-00-00-35)

  * Tagging FourMomUtils-00-00-35.
  * src/Thrust.cxx: Avoid more redundant divisions.

2015-06-01  scott snyder  <snyder@bnl.gov>

  * Tagging FourMomUtils-00-00-34.
  * Avoid redundant divisions.

2015-05-20  scott snyder  <snyder@bnl.gov>

  * Tagging FourMomUtils-00-00-33.
  * src/Thrust.cxx: Const fix.

2015-03-15  Karsten Koeneke  <karsten.koeneke@cern.ch>

  * Add xAODHelpers: for python and pre-ROOT6.04 TFormula use
  * Add xAODP4Helpers: helper methods to calculate four-mom differences for xAOD::IParticles
  * tag FourMomUtils-00-00-32

...
(Long ChangeLog diff - truncated)
parent 834b4f42
################################################################################
# Package: FourMomUtils
################################################################################
# Declare the package name:
atlas_subdir( FourMomUtils )
# Declare the package's dependencies:
atlas_depends_on_subdirs( PUBLIC
Control/AthContainers
Control/CxxUtils
Event/EventKernel
Event/FourMom
Event/NavFourMom
Event/xAOD/xAODBase
Event/xAOD/xAODMissingET )
# External dependencies:
find_package( CLHEP )
find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread )
# Component(s) in the package:
atlas_add_library( FourMomUtils
src/*.cxx
Root/*.cxx
PUBLIC_HEADERS FourMomUtils
INCLUDE_DIRS ${CLHEP_INCLUDE_DIRS}
PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
DEFINITIONS ${CLHEP_DEFINITIONS}
LINK_LIBRARIES ${CLHEP_LIBRARIES} AthContainers CxxUtils EventKernel FourMom NavFourMom xAODBase xAODMissingET
PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} )
atlas_add_dictionary( FourMomUtilsDict
FourMomUtils/FourMomUtilsDict.h
FourMomUtils/selection.xml
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthContainers CxxUtils EventKernel FourMom NavFourMom xAODBase xAODMissingET FourMomUtils )
# Install files from the package:
atlas_install_python_modules( python/*.py )
......@@ -5,27 +5,31 @@
#ifndef FOURMOMUTILS_FORWARDTERM_H
#define FOURMOMUTILS_FORWARDTERM_H
// AthAnalysisBase/ManaCore doesn't currently include the Trigger Service
#ifndef XAOD_ANALYSIS
#include "NavFourMom/INavigable4MomentumCollection.h"
namespace FourMomUtils
{
typedef INavigable4MomentumCollection::const_iterator I4MomIter_t;
double forwardTerm( const I4MomIter_t iBeg,
const I4MomIter_t iEnd,
double m_central,
bool useThreeD = false );
const I4MomIter_t iEnd,
double m_central,
bool useThreeD = false );
inline
double forwardTerm( const INavigable4MomentumCollection* particles,
double central, bool useThreeD = false ) {
return forwardTerm( particles->begin(),
particles->end(),
central, useThreeD );
double central, bool useThreeD = false ) {
return forwardTerm( particles->begin(),
particles->end(),
central, useThreeD );
}
}
#endif // FOURMOMUTILS_FORWARDTERM_H
#endif
#endif // FOURMOMUTILS_FORWARDTERM_H
......@@ -4,13 +4,19 @@
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// FourMomUtilsDict.h
// FourMomUtilsDict.h
// Header for dict. 'bootstrapping'
// Author : Sebastien Binet
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
#ifndef FOURMOMUTILS_FOURMOMUTILSDICT_H
#define FOURMOMUTILS_FOURMOMUTILSDICT_H
#include "FourMomUtils/xAODP4Helpers.h"
#include "FourMomUtils/xAODHelpers.h"
// AthAnalysisBase/ManaCore doesn't currently include these
#ifndef XAOD_ANALYSIS
#include "FourMomUtils/P4Helpers.h"
#include "FourMomUtils/P4Sorters.h"
#include "FourMomUtils/Thrust.h"
......@@ -18,4 +24,6 @@
#include "FourMomUtils/JetBroadening.h"
#include "FourMomUtils/JetMasses.h"
#endif
#endif // FOURMOMUTILS_FOURMOMUTILSDICT_H
......@@ -5,26 +5,30 @@
#ifndef FOURMOMUTILS_FOXWOLFRAM_H
#define FOURMOMUTILS_FOXWOLFRAM_H
// AthAnalysisBase/ManaCore doesn't currently include the Trigger Service
#ifndef XAOD_ANALYSIS
#include <vector>
#include "EventKernel/INavigable4Momentum.h"
#include "NavFourMom/INavigable4MomentumCollection.h"
namespace FourMomUtils
{
typedef INavigable4MomentumCollection::const_iterator I4MomIter_t;
bool foxWolfram( const I4MomIter_t iBeg,
const I4MomIter_t iEnd,
const I4MomIter_t iEnd,
std::vector<double>& H, unsigned int order = 5 );
inline
bool foxWolfram( const INavigable4MomentumCollection* theParticles,
std::vector<double>& H, unsigned int order = 5 ) {
return foxWolfram( theParticles->begin(), theParticles->end(),
H, order );
H, order );
}
}
#endif // FOURMOMUTILS_FOXWOLFRAM_H
#endif
#endif // FOURMOMUTILS_FOXWOLFRAM_H
......@@ -5,6 +5,9 @@
#ifndef FOURMOMUTILS_JETBROADENING_H
#define FOURMOMUTILS_JETBROADENING_H
// AthAnalysisBase/ManaCore doesn't currently include the Trigger Service
#ifndef XAOD_ANALYSIS
#include "EventKernel/INavigable4Momentum.h"
#include "NavFourMom/INavigable4MomentumCollection.h"
......@@ -21,9 +24,11 @@ namespace FourMomUtils
double& wideJetBroadening, double& totalJetBroadening,
CLHEP::Hep3Vector thrust, bool useThreeD = false ) {
return jetBroadening( theParticles->begin(), theParticles->end(),
wideJetBroadening, totalJetBroadening,
thrust, useThreeD );
wideJetBroadening, totalJetBroadening,
thrust, useThreeD );
}
}
#endif
#endif // FOURMOMUTILS_JETBROADENING_H
......@@ -5,6 +5,9 @@
#ifndef FOURMOMUTILS_JETMASSES_H
#define FOURMOMUTILS_JETMASSES_H
// AthAnalysisBase/ManaCore doesn't currently include the Trigger Service
#ifndef XAOD_ANALYSIS
#include "EventKernel/INavigable4Momentum.h"
#include "NavFourMom/INavigable4MomentumCollection.h"
......@@ -13,16 +16,18 @@ namespace FourMomUtils
typedef INavigable4MomentumCollection::const_iterator I4MomIter_t;
bool jetMasses(const I4MomIter_t iBeg, const I4MomIter_t iEnd,
double& heavyJetMass, double& lightJetMass,
double& heavyJetMass, double& lightJetMass,
CLHEP::Hep3Vector thrust );
inline
bool jetMasses(const INavigable4MomentumCollection* theParticles,
double& heavyJetMass, double& lightJetMass,
double& heavyJetMass, double& lightJetMass,
CLHEP::Hep3Vector thrust ) {
return jetMasses( theParticles->begin(), theParticles->end(),
heavyJetMass, lightJetMass, thrust );
}
}
#endif
#endif // FOURMOMUTILS_JETMASSES_H
......@@ -4,12 +4,15 @@
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// P4AscendingSorters.h
// P4AscendingSorters.h
// Header file for 'ascending' Sorters
// Author: S.Binet<binet@cern.ch>
///////////////////////////////////////////////////////////////////
#ifndef FOURMOMUTILS_P4ASCENDINGSORTERS_H
#define FOURMOMUTILS_P4ASCENDINGSORTERS_H
///////////////////////////////////////////////////////////////////
#ifndef FOURMOMUTILS_P4ASCENDINGSORTERS_H
#define FOURMOMUTILS_P4ASCENDINGSORTERS_H
// AthAnalysisBase/ManaCore doesn't currently include the Trigger Service
#ifndef XAOD_ANALYSIS
// STL includes
#include <functional> // binary_function
......@@ -28,9 +31,9 @@
namespace P4Sorters {
typedef std::binary_function< const I4Momentum*,
const I4Momentum*,
bool
>
const I4Momentum*,
bool
>
I4MomPredicate_t;
namespace Ascending {
......@@ -39,15 +42,15 @@ class Px : public I4MomPredicate_t
{
public:
bool operator()( const I4Momentum* a, const I4Momentum* b ) {
return CxxUtils::fpcompare::less( a->px(), b->px() );
return CxxUtils::fpcompare::less( a->px(), b->px() );
}
};
class Py : public I4MomPredicate_t
{
public:
bool operator()( const I4Momentum* a, const I4Momentum* b ) {
return CxxUtils::fpcompare::less( a->py(), b->py() );
return CxxUtils::fpcompare::less( a->py(), b->py() );
}
};
......@@ -55,7 +58,7 @@ class Pz : public I4MomPredicate_t
{
public:
bool operator()( const I4Momentum* a, const I4Momentum* b ) {
return CxxUtils::fpcompare::less( a->pz(), b->pz() );
return CxxUtils::fpcompare::less( a->pz(), b->pz() );
}
};
......@@ -64,7 +67,7 @@ class Mass : public I4MomPredicate_t
{
public:
bool operator()( const I4Momentum* a, const I4Momentum* b ) {
return CxxUtils::fpcompare::less( a->m(), b->m() );
return CxxUtils::fpcompare::less( a->m(), b->m() );
}
};
......@@ -72,7 +75,7 @@ class MassSquared : public I4MomPredicate_t
{
public:
bool operator()( const I4Momentum* a, const I4Momentum* b ) {
return CxxUtils::fpcompare::less( a->m2(), b->m2() );
return CxxUtils::fpcompare::less( a->m2(), b->m2() );
}
};
......@@ -80,7 +83,7 @@ class Momentum : public I4MomPredicate_t
{
public:
bool operator()( const I4Momentum* a, const I4Momentum* b ) {
return CxxUtils::fpcompare::less( a->p(), b->p() );
return CxxUtils::fpcompare::less( a->p(), b->p() );
}
};
......@@ -88,7 +91,7 @@ class MomentumSquared : public I4MomPredicate_t
{
public:
bool operator()( const I4Momentum* a, const I4Momentum* b ) {
return CxxUtils::fpcompare::less( a->p2(), b->p2() );
return CxxUtils::fpcompare::less( a->p2(), b->p2() );
}
};
......@@ -96,7 +99,7 @@ class Eta : public I4MomPredicate_t
{
public:
bool operator()( const I4Momentum* a, const I4Momentum* b ) {
return CxxUtils::fpcompare::less( a->eta(), b->eta() );
return CxxUtils::fpcompare::less( a->eta(), b->eta() );
}
};
......@@ -105,7 +108,7 @@ class AbsEta : public I4MomPredicate_t
public:
bool operator()( const I4Momentum* a, const I4Momentum* b ) {
using std::abs;
return CxxUtils::fpcompare::less( abs(a->eta()), abs(b->eta()) );
return CxxUtils::fpcompare::less( abs(a->eta()), abs(b->eta()) );
}
};
......@@ -114,15 +117,15 @@ public:
// {
// public:
// bool operator()( const I4Momentum* a, const I4Momentum* b ) {
// return CxxUtils::fpcompare::less( a->phi(), b->phi() );
// return CxxUtils::fpcompare::less( a->phi(), b->phi() );
// }
// };
class Ene : public I4MomPredicate_t
{
public:
bool operator()( const I4Momentum* a, const I4Momentum* b ) {
return CxxUtils::fpcompare::less( a->e(), b->e() );
return CxxUtils::fpcompare::less( a->e(), b->e() );
}
};
......@@ -130,7 +133,7 @@ class Et : public I4MomPredicate_t
{
public:
bool operator()( const I4Momentum* a, const I4Momentum* b ) {
return CxxUtils::fpcompare::less( a->et(), b->et() );
return CxxUtils::fpcompare::less( a->et(), b->et() );
}
};
......@@ -138,7 +141,7 @@ class Pt : public I4MomPredicate_t
{
public:
bool operator()( const I4Momentum* a, const I4Momentum* b ) {
return CxxUtils::fpcompare::less( a->pt(), b->pt() );
return CxxUtils::fpcompare::less( a->pt(), b->pt() );
}
};
......@@ -146,7 +149,7 @@ class InvPt : public I4MomPredicate_t
{
public:
bool operator()( const I4Momentum* a, const I4Momentum* b ) {
return CxxUtils::fpcompare::less( a->iPt(), b->iPt() );
return CxxUtils::fpcompare::less( a->iPt(), b->iPt() );
}
};
......@@ -155,27 +158,29 @@ class CosTh : public I4MomPredicate_t
{
public:
bool operator()( const I4Momentum* a, const I4Momentum* b ) {
return CxxUtils::fpcompare::less( a->cosTh(), b->cosTh() );
return CxxUtils::fpcompare::less( a->cosTh(), b->cosTh() );
}
};
class SinTh : public I4MomPredicate_t
{
public:
bool operator()( const I4Momentum* a, const I4Momentum* b ) {
return CxxUtils::fpcompare::less( a->sinTh(), b->sinTh() );
return CxxUtils::fpcompare::less( a->sinTh(), b->sinTh() );
}
};
class CotTh : public I4MomPredicate_t
{
public:
bool operator()( const I4Momentum* a, const I4Momentum* b ) {
return CxxUtils::fpcompare::less( a->cotTh(), b->cotTh() );
return CxxUtils::fpcompare::less( a->cotTh(), b->cotTh() );
}
};
} // > end namespace Ascending
} // > end namespace P4Sorters
#endif
#endif //> FOURMOMUTILS_P4ASCENDINGSORTERS_H
......@@ -4,12 +4,15 @@
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// P4DescendingSorters.h
// P4DescendingSorters.h
// Header file for 'descending' Sorters
// Author: S.Binet<binet@cern.ch>
///////////////////////////////////////////////////////////////////
#ifndef FOURMOMUTILS_P4DESCENDINGSORTERS_H
#define FOURMOMUTILS_P4DESCENDINGSORTERS_H
///////////////////////////////////////////////////////////////////
#ifndef FOURMOMUTILS_P4DESCENDINGSORTERS_H
#define FOURMOMUTILS_P4DESCENDINGSORTERS_H
// AthAnalysisBase/ManaCore doesn't currently include the Trigger Service
#ifndef XAOD_ANALYSIS
// STL includes
#include <functional> // binary_function
......@@ -27,9 +30,9 @@
namespace P4Sorters {
typedef std::binary_function< const I4Momentum*,
const I4Momentum*,
bool
>
const I4Momentum*,
bool
>
I4MomPredicate_t;
namespace Descending {
......@@ -38,15 +41,15 @@ class Px : public I4MomPredicate_t
{
public:
bool operator()( const I4Momentum* a, const I4Momentum* b ) {
return CxxUtils::fpcompare::greater( a->px(), b->px() );
return CxxUtils::fpcompare::greater( a->px(), b->px() );
}
};
class Py : public I4MomPredicate_t
{
public:
bool operator()( const I4Momentum* a, const I4Momentum* b ) {
return CxxUtils::fpcompare::greater( a->py(), b->py() );
return CxxUtils::fpcompare::greater( a->py(), b->py() );
}
};
......@@ -54,7 +57,7 @@ class Pz : public I4MomPredicate_t
{
public:
bool operator()( const I4Momentum* a, const I4Momentum* b ) {
return CxxUtils::fpcompare::greater( a->pz(), b->pz() );
return CxxUtils::fpcompare::greater( a->pz(), b->pz() );
}
};
......@@ -63,7 +66,7 @@ class Mass : public I4MomPredicate_t
{
public:
bool operator()( const I4Momentum* a, const I4Momentum* b ) {
return CxxUtils::fpcompare::greater( a->m(), b->m() );
return CxxUtils::fpcompare::greater( a->m(), b->m() );
}
};
......@@ -71,7 +74,7 @@ class MassSquared : public I4MomPredicate_t
{
public:
bool operator()( const I4Momentum* a, const I4Momentum* b ) {
return CxxUtils::fpcompare::greater( a->m2(), b->m2() );
return CxxUtils::fpcompare::greater( a->m2(), b->m2() );
}
};
......@@ -79,7 +82,7 @@ class Momentum : public I4MomPredicate_t
{
public:
bool operator()( const I4Momentum* a, const I4Momentum* b ) {
return CxxUtils::fpcompare::greater( a->p(), b->p() );
return CxxUtils::fpcompare::greater( a->p(), b->p() );
}
};
......@@ -87,7 +90,7 @@ class MomentumSquared : public I4MomPredicate_t
{
public:
bool operator()( const I4Momentum* a, const I4Momentum* b ) {
return CxxUtils::fpcompare::greater( a->p2(), b->p2() );
return CxxUtils::fpcompare::greater( a->p2(), b->p2() );
}
};
......@@ -95,7 +98,7 @@ class Eta : public I4MomPredicate_t
{
public:
bool operator()( const I4Momentum* a, const I4Momentum* b ) {
return CxxUtils::fpcompare::greater( a->eta(), b->eta() );
return CxxUtils::fpcompare::greater( a->eta(), b->eta() );
}
};
......@@ -104,7 +107,7 @@ class AbsEta : public I4MomPredicate_t
public:
bool operator()( const I4Momentum* a, const I4Momentum* b ) {
using std::abs;
return CxxUtils::fpcompare::greater( abs(a->eta()), abs(b->eta()) );
return CxxUtils::fpcompare::greater( abs(a->eta()), abs(b->eta()) );
}
};
......@@ -113,15 +116,15 @@ public:
// {
// public:
// bool operator()( const I4Momentum* a, const I4Momentum* b ) {
// return CxxUtils::fpcompare::greater( a->phi(), b->phi() );
// return CxxUtils::fpcompare::greater( a->phi(), b->phi() );
// }
// };
class Ene : public I4MomPredicate_t
{
public:
bool operator()( const I4Momentum* a, const I4Momentum* b ) {
return CxxUtils::fpcompare::greater( a->e(), b->e() );
return CxxUtils::fpcompare::greater( a->e(), b->e() );
}
};
......@@ -129,7 +132,7 @@ class Et : public I4MomPredicate_t
{
public:
bool operator()( const I4Momentum* a, const I4Momentum* b ) {
return CxxUtils::fpcompare::greater( a->et(), b->et() );
return CxxUtils::fpcompare::greater( a->et(), b->et() );
}
};
......@@ -137,7 +140,7 @@ class Pt : public I4MomPredicate_t
{
public:
bool operator()( const I4Momentum* a, const I4Momentum* b ) {
return CxxUtils::fpcompare::greater( a->pt(), b->pt() );
return CxxUtils::fpcompare::greater( a->pt(), b->pt() );
}
};
......@@ -145,7 +148,7 @@ class InvPt : public I4MomPredicate_t
{
public:
bool operator()( const I4Momentum* a, const I4Momentum* b ) {
return CxxUtils::fpcompare::greater( a->iPt(), b->iPt() );
return CxxUtils::fpcompare::greater( a->iPt(), b->iPt() );
}
};
......@@ -154,27 +157,29 @@ class CosTh : public I4MomPredicate_t
{
public:
bool operator()( const I4Momentum* a, const I4Momentum* b ) {
return CxxUtils::fpcompare::greater( a->cosTh(), b->cosTh() );
return CxxUtils::fpcompare::greater( a->cosTh(), b->cosTh() );
}
};
class SinTh : public I4MomPredicate_t
{
public:
bool operator()( const I4Momentum* a, const I4Momentum* b ) {
return CxxUtils::fpcompare::greater( a->sinTh(), b->sinTh() );
return CxxUtils::fpcompare::greater( a->sinTh(), b->sinTh() );
}
};
class CotTh : public I4MomPredicate_t
{
public:
bool operator()( const I4Momentum* a, const I4Momentum* b ) {
return CxxUtils::fpcompare::greater( a->cotTh(), b->cotTh() );
return CxxUtils::fpcompare::greater( a->cotTh(), b->cotTh() );
}
};
} // > end namespace Descending
} // > end namespace P4Sorters
#endif
#endif //> FOURMOMUTILS_P4DESCENDINGSORTERS_H
......@@ -4,12 +4,12 @@
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// P4Dumper.h
// P4Dumper.h
// Header file for class P4Dumper
// Author: S.Binet<binet@cern.ch>
///////////////////////////////////////////////////////////////////
#ifndef FOURMOMUTILS_P4DUMPER_H
#define FOURMOMUTILS_P4DUMPER_H
///////////////////////////////////////////////////////////////////
#ifndef FOURMOMUTILS_P4DUMPER_H
#define FOURMOMUTILS_P4DUMPER_H
// STL includes
#include <iosfwd>
......@@ -17,12 +17,12 @@
// FourMomUtils includes
namespace FourMomUtils {
/// Helper to stream out a range of I4Momentum objects
template <class I4MomIter>
inline
std::ostream& dump( std::ostream& out,
const I4MomIter iBeg, const I4MomIter iEnd ) {
const I4MomIter iBeg, const I4MomIter