Commit fbcb4e14 authored by Justin Griffiths's avatar Justin Griffiths Committed by Graeme Stewart
Browse files

r21 tag (PanTauAlgs-01-00-03)

	* Tagging 01-00-03
	* Adapted to TauJet_v3
	* changed name of PanTauSeed/TauConstituent/TauFeature --> ""2 in order to protect against duplicat class conflicts with PanTauEvent

2016 April 27 Lara Schildgen <schildgen -at- physik.uni-bonn.de>
	* re-structured PanTau packages (merged packages PanTauEvent, PanTauInterfaces and
	PanTauAnalysis into PanTauAlgs and removed PanTau packages PanTauExample and PanTauUtils)
	* re-organization of PanTau tools (removed FourMomentumCalculator)
	* tools rewritten to be dual-use
	* replaced CLHEP by TLorentzVector
	* tools rewritten to use 2D instead of 3D impact parameter
	* merged interface classes in ITool_DetailsArranger.h, ITool_DecayModeDeterminator.h and
	ITool_FeatureExtractor.h into one file ITool_PanTauTools.h
parent fc678d2b
################################################################################
# Package: PanTauAlgs
################################################################################
# Declare the package name:
atlas_subdir( PanTauAlgs )
......@@ -11,9 +11,8 @@ atlas_depends_on_subdirs( PUBLIC
Event/NavFourMom
Event/xAOD/xAODPFlow
Event/xAOD/xAODTau
Event/xAOD/xAODParticleEvent
GaudiKernel
Reconstruction/PanTau/PanTauEvent
Reconstruction/PanTau/PanTauInterfaces
PRIVATE
Calorimeter/CaloEvent
Control/AthenaKernel
......@@ -26,6 +25,7 @@ atlas_depends_on_subdirs( PUBLIC
Reconstruction/Particle
Reconstruction/eflowEvent
Reconstruction/tauEvent
Reconstruction/tauRecTools
Tools/PathResolver
Tracking/TrkEvent/VxVertex
Tracking/TrkVertexFitter/TrkVertexFitterInterfaces )
......@@ -40,11 +40,13 @@ find_package( ROOT COMPONENTS MathCore MathMore Matrix TMVA Core Tree Hist RIO p
# Component(s) in the package:
atlas_add_component( PanTauAlgs
src/*.cxx
Root/*.cxx
src/components/*.cxx
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} ${EIGEN_LIBRARIES} AthenaBaseComps NavFourMom xAODPFlow xAODTau GaudiKernel PanTauEvent CaloEvent AthenaKernel DataModel StoreGateLib SGtests GeoPrimitives FourMom FourMomUtils xAODTracking Particle eflowEvent tauEvent PathResolver VxVertex TrkVertexFitterInterfaces )
LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} ${EIGEN_LIBRARIES} AthenaBaseComps NavFourMom xAODPFlow xAODTau xAODParticleEvent GaudiKernel CaloEvent AthenaKernel DataModel StoreGateLib SGtests GeoPrimitives FourMom FourMomUtils xAODTracking Particle eflowEvent tauEvent tauRecToolsLib PathResolver VxVertex TrkVertexFitterInterfaces )
# Install files from the package:
atlas_install_headers( PanTauAlgs )
atlas_install_runtime( data/weights/*.xml )
atlas_install_python_modules( python/*.py )
......@@ -5,64 +5,76 @@
#ifndef PANTAUALGS_TOOL_HELPERFUNCTIONS
#define PANTAUALGS_TOOL_HELPERFUNCTIONS
#include "AthenaBaseComps/AthAlgTool.h"
#include "NavFourMom/INavigable4MomentumCollection.h"
#include "PanTauInterfaces/ITool_HelperFunctions.h"
//#include "NavFourMom/INavigable4MomentumCollection.h"
#include <string>
#include <iostream>
#include "AsgTools/AsgMessaging.h"
#include "xAODTau/TauJet.h"
#include "xAODPFlow/PFO.h"
namespace CLHEP {
class HepLorentzVector;
class Hep3Vector;
}
class TLorentzVector;
class TVector3;
namespace PanTau {
class TauConstituent;
class TauConstituent2;
}
// namespace xAOD {
// class PFO;
// class TauJet;
// }
class TVector3;
class eflowObject;
namespace PanTau {
class Tool_HelperFunctions : public AthAlgTool, virtual public PanTau::ITool_HelperFunctions {
class HelperFunctions : public asg::AsgMessaging {
public:
Tool_HelperFunctions(const std::string&,const std::string&,const IInterface*);
virtual ~Tool_HelperFunctions ();
// from PhysicsAnalysis/TauID/TauDiscriminant/TauDiscriminant/MethodBase.h
HelperFunctions(const std::string& _name = ""):
AsgMessaging(_name),
name(_name)
{}
virtual ~HelperFunctions () {};
virtual void dumpFourMomentum(CLHEP::HepLorentzVector FourMom) const;
virtual void dumpTauConstituent(PanTau::TauConstituent* tauConstituent) const;
virtual void dumpFourMomentum(TLorentzVector FourMom) const;
virtual void dumpTauConstituent2(PanTau::TauConstituent2* tauConstituent) const;
TauConstituent* getNeutralConstWithLargestAngle(CLHEP::HepLorentzVector charged,
std::vector<PanTau::TauConstituent*> neutral);
TauConstituent2* getNeutralConstWithLargestAngle(TLorentzVector charged,
std::vector<PanTau::TauConstituent2*> neutral);
virtual std::string convertNumberToString(double x) const;
// virtual void vertexCorrection_eflowObjects(TVector3 vertexToCorrectTo, eflowObject* efo);
virtual void vertexCorrection_PFOs(const xAOD::TauJet* tauJet, xAOD::PFO* efo);
void vertexCorrection_PFOs(const xAOD::TauJet* tauJet, xAOD::PFO* efo) const;
virtual int getBinIndex(std::vector<double> binEdges, double value) const;
virtual double stddev(double sumOfSquares, double sumOfValues, int numConsts) const;
virtual double deltaRprime(const CLHEP::Hep3Vector& vec1, const CLHEP::Hep3Vector& vec2) const;
virtual double deltaRprime(const TVector3& vec1, const TVector3& vec2) const;
virtual int iPow(int man, int exp);
virtual double ulAngle(double x, double y);
virtual double sign(double a, double b);
virtual std::vector<double> calcThrust(std::vector<TauConstituent*>* tauConstituents, bool& calcIsValid);
virtual void ludbrb(TMatrix* mom, double the, double phi, double bx, double by, double bz);
virtual std::vector<double> calcFWMoments(std::vector<TauConstituent*>* tauConstituents, bool& calcIsValid);
virtual std::vector<double> calcSphericity(std::vector<TauConstituent*>* tauConstituents, bool& calcIsValid);
virtual int iPow(int man, int exp) const;
virtual double ulAngle(double x, double y) const;
virtual double sign(double a, double b) const;
virtual std::vector<double> calcThrust(std::vector<TauConstituent2*>* tauConstituents, bool& calcIsValid) const;
virtual void ludbrb(TMatrix* mom, double the, double phi, double bx, double by, double bz) const;
virtual std::vector<double> calcFWMoments(std::vector<TauConstituent2*>* tauConstituents, bool& calcIsValid) const;
virtual std::vector<double> calcSphericity(std::vector<TauConstituent2*>* tauConstituents, bool& calcIsValid) const;
std::string getName() const
{
return name;
}
private:
std::string name;
}; //end class Tool_HelperFunctions
......@@ -71,4 +83,4 @@ class Tool_HelperFunctions : public AthAlgTool, virtual public PanTau::ITool_Hel
#endif // PANTAUALGS_TOOL_HELPERFUNCTIONS
\ No newline at end of file
#endif // PANTAUALGS_TOOL_HELPERFUNCTIONS
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef PANTAUALGS_ITOOL_INFORMATIONSTORE_H
#define PANTAUALGS_ITOOL_INFORMATIONSTORE_H
// Gaudi
#include "AsgTools/IAsgTool.h"
#include <string>
//class eflowObjectContainer;
// namespace Analysis {
// class TauJetContainer;
// class TauDetailsContainer;
// }
//! xAOD EDM
/*
#include "xAODTau/TauJetContainer.h"
namespace Rec {
class TrackParticleContainer;
}
*/
namespace PanTau {
/** @class ITool_InformationStore
@brief Interface for Tool_InformationStore
@author Christian Limbach (limbach@physik.uni-bonn.de)
*/
class ITool_InformationStore : virtual public asg::IAsgTool {
ASG_TOOL_INTERFACE(ITool_InformationStore)
public:
//virtual StatusCode updateInformation(std::string inputAlg) = 0;
virtual StatusCode getInfo_Int(std::string varName, int& value) = 0;
virtual StatusCode getInfo_Double(std::string varName, double& value) = 0;
virtual StatusCode getInfo_VecDouble(std::string varName, std::vector<double>& value) = 0;
virtual StatusCode getInfo_String(std::string varName, std::string& value) = 0;
virtual StatusCode getInfo_VecString(std::string varName, std::vector<std::string>& value) = 0;
virtual StatusCode dumpMaps() const = 0;
/*
virtual const xAOD::TauJetContainer* getContainer_TauRec() const = 0;
virtual const Rec::TrackParticleContainer* getContainer_TrackParticle() const = 0;
*/
};
}
#endif //PANTAUALGS_ITOOL_INFORMATIONSTORE_H
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef PANTAUALGS_ITOOL_INPUTCONVERTER_H
#define PANTAUALGS_ITOOL_INPUTCONVERTER_H
// Gaudi
#include "AsgTools/IAsgTool.h"
#include <string>
//! xAOD EDM
#include "xAODPFlow/PFO.h"
#include "xAODTau/TauJet.h"
namespace PanTau{
class TauConstituent2;
}
//class eflowObject;
//namespace Analysis {
// class TauPi0Cluster;
// class TauJet;
//}
namespace Rec {
class TrackParticle;
}
namespace PanTau {
/** @class ITool_InputConverter
@brief Interface for Tool_InputConverter
@author Christian Limbach (limbach@physik.uni-bonn.de)
*/
class ITool_InputConverter : virtual public asg::IAsgTool {
ASG_TOOL_INTERFACE(ITool_InputConverter)
public:
//PFO Converter (r19+)
virtual StatusCode ConvertToTauConstituent2(xAOD::PFO* pfo,
PanTau::TauConstituent2* &tauConstituent,
const xAOD::TauJet* tauJet) const = 0;
// virtual bool passesPreselectionEnergy(double itsEnergy) const = 0;
//cluster based converter
// virtual StatusCode ConvertToTauConstituent2(eflowObject* efo, TauConstituent2* &tauConstituent) const;
};
}
#endif //PANTAUALGS_ITOOL_INPUTCONVERTER_H
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef PANTAUALGS_ITOOL_MODEDISCRIMINATOR_H
#define PANTAUALGS_ITOOL_MODEDISCRIMINATOR_H
#include "AsgTools/IAsgTool.h"
//class Jet;
namespace PanTau {
class PanTauSeed2;
}
namespace PanTau {
/** @class ITool_ModeDiscriminator
@brief Interface for PID from tau seeds.
@author Sebastian Fleischmann
@author Christian Limbach
*/
class ITool_ModeDiscriminator : virtual public asg::IAsgTool {
ASG_TOOL_INTERFACE(ITool_ModeDiscriminator)
public:
//virtual double getModeLikeliness(PanTau::PanTauSeed2* inSeed, bool& wasSuccessful) = 0;
virtual double getResponse(PanTau::PanTauSeed2* inSeed, bool& isOK) = 0;
};
}
#endif // PANTAUALGS_ITAUDISCRIMINANTTOOL_H
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef PANTAUALGS_ITOOL_PANTAUTOOLS_H
#define PANTAUALGS_ITOOL_PANTAUTOOLS_H
#include "AsgTools/IAsgTool.h"
#include <string>
#include <vector>
//! xAOD EDM
#include "xAODPFlow/PFO.h"
#include "xAODTau/TauJet.h"
#include "PanTauAlgs/TauConstituent.h"
namespace PanTau {
class TauFeature2;
class PanTauSeed2;
class TauConstituent2;
}
namespace Rec {
class TrackParticle;
}
namespace PanTau {
/** @class ITool_PanTauTools
@brief Interface for PID from tau seeds.
@author Sebastian Fleischmann
@author Christian Limbach
*/
class ITool_PanTauTools : virtual public asg::IAsgTool {
ASG_TOOL_INTERFACE(ITool_PanTauTools)
public:
// used in Tool_FeatureExtractor, Tool_DecayModeDeterminator and Tool_DetailsArranger:
virtual StatusCode execute(PanTau::PanTauSeed2* inSeed) = 0;
};
}
#endif // PANTAUALGS_ITAUDISCRIMINANTTOOL_H
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef PANTAUALGS_ITOOL_TAUCONSTITUENTGETTER_H
#define PANTAUALGS_ITOOL_TAUCONSTITUENTGETTER_H
// Gaudi
#include "AsgTools/IAsgTool.h"
#include <string>
namespace PanTau{
class TauConstituent2;
}
//namespace Analysis {
// class TauJet;
//}
#include "xAODTau/TauJet.h"
namespace PanTau {
/** @class ITool_TauConstituentGetter
@brief Interface for Tool_TauConstituentGetter
@author Christian Limbach (limbach@physik.uni-bonn.de)
*/
class ITool_TauConstituentGetter : virtual public asg::IAsgTool {
ASG_TOOL_INTERFACE(ITool_TauConstituentGetter)
public:
virtual StatusCode GetTauConstituents(//const Analysis::TauJet*,
const xAOD::TauJet* tauJet,
std::vector<TauConstituent2*>& outputList,
std::string algName) const = 0;
};
}
#endif //PANTAUALGS_ITOOL_TAUCONSTITUENTGETTER_H
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef PANTAUALGS_ITOOL_TAUCONSTITUENTSELECTOR_H
#define PANTAUALGS_ITOOL_TAUCONSTITUENTSELECTOR_H
// Gaudi
#include "AsgTools/IAsgTool.h"
#include <vector>
#include "PanTauAlgs/TauConstituent.h"
namespace PanTau {
/** @class ITool_TauConstituentSelector
@brief Interface for Tool_TauConstituentSelector
@author Christian Limbach (limbach@physik.uni-bonn.de)
*/
class ITool_TauConstituentSelector : virtual public asg::IAsgTool {
ASG_TOOL_INTERFACE(ITool_TauConstituentSelector)
public:
virtual StatusCode SelectTauConstituents(std::vector<TauConstituent2*> inputList,
std::vector<TauConstituent2*>& outputList) const = 0;
protected:
// virtual bool passesSelection_NeutralConstituent(TauConstituent2* tauConstituent) const = 0;
// virtual bool passesSelection_Pi0NeutConstituent(TauConstituent2* tauConstituent) const = 0;
// virtual bool passesSelection_ChargedConstituent(TauConstituent2* tauConstituent) const = 0;
// virtual bool passesSelection_OutNeutConstituent(TauConstituent2* TauConstituent) const = 0;
// virtual bool passesSelection_OutChrgConstituent(TauConstituent2* TauConstituent) const = 0;
// virtual bool passesSelection_NeutLowAConstituent(TauConstituent2* TauConstituent) const = 0;
// virtual bool passesSelection_NeutLowBConstituent(TauConstituent2* TauConstituent) const = 0;
// virtual double getEtCut(double eta, PanTau::TauConstituent2::Type constituentType) const = 0;
};
}
#endif //PANTAUALGS_ITOOL_TAUCONSTITUENTSELECTOR_H
......@@ -3,16 +3,16 @@
*/
///////////////////////////////////////////////////////////////////
// Alg_SeedBuilder.h, (c) ATLAS Detector software
// PanTauProcessor.h, (c) ATLAS Detector software
///////////////////////////////////////////////////////////////////
#ifndef PANTAU_ALG_SEEDBUILDER_H
#define PANTAU_ALG_SEEDBUILDER_H
#ifndef PANTAU_PANTAUPROCESSOR_H
#define PANTAU_PANTAUPROCESSOR_H
// Gaudi includes
#include "AthenaBaseComps/AthAlgorithm.h"
#include "GaudiKernel/MsgStream.h"
#include "GaudiKernel/ToolHandle.h"
#include "AsgTools/AsgTool.h"
#include "AsgTools/ToolHandle.h"
#include "tauRecTools/TauRecToolBase.h"
// C++ includes
#include <string>
......@@ -20,46 +20,53 @@
#include <vector>
// PanTau includes
#include "PanTauAlgs/Tool_InformationStore.h"
#include "PanTauAlgs/Tool_TauConstituentGetter.h"
#include "PanTauAlgs/Tool_TauConstituentSelector.h"
#include "PanTauAlgs/Tool_FeatureExtractor.h"
#include "PanTauAlgs/Tool_DecayModeDeterminator.h"
#include "PanTauAlgs/Tool_FourMomentumCalculator.h"
#include "PanTauAlgs/Tool_DetailsArranger.h"
#include "PanTauAlgs/ITool_InformationStore.h"
#include "PanTauAlgs/ITool_TauConstituentGetter.h"
#include "PanTauAlgs/ITool_TauConstituentSelector.h"
#include "PanTauAlgs/ITool_PanTauTools.h"
#include "PanTauEvent/PanTauSeedContainer.h"
//#include "PanTauAlgs/PanTauSeedContainer.h"
class StoreGateSvc;
//class StoreGateSvc;
namespace PanTau
{
/** @class Alg_SeedBuilder
/** @class PanTauProcessor
@author Peter Wienemann <peter.wienemann@cern.ch>
@author Sebastian Fleischmann <Sebastian.Fleischmann@cern.ch>
@author Robindra Prabhu <robindra.prabhu@cern.ch>
@author Christian Limbach <limbach@physik.uni-bonn.de>
@author Peter Wagner <peter.wagner@cern.ch>
@author Lara Schildgen <schildgen@physik.uni-bonn.de>
*/
class Alg_SeedBuilder : public AthAlgorithm
class PanTauProcessor : virtual public TauRecToolBase
{
public:
Alg_SeedBuilder(const std::string& name, ISvcLocator* pSvcLocator);
~Alg_SeedBuilder();
// as in https://svnweb.cern.ch/trac/atlasoff/browser/Reconstruction/tauRecTools/trunk/tauRecTools/TauCalibrateLC.h
ASG_TOOL_CLASS2( PanTauProcessor, TauRecToolBase, ITauToolBase )
StatusCode initialize();
StatusCode execute();
StatusCode finalize();
PanTauProcessor(const std::string& name);
~PanTauProcessor();
virtual StatusCode initialize();
virtual StatusCode finalize();
virtual StatusCode execute(xAOD::TauJet& pTau);
virtual StatusCode eventInitialize();
virtual StatusCode eventFinalize() { return StatusCode::SUCCESS; }
virtual void print() const { }
private:
mutable MsgStream m_log;
StoreGateSvc* m_sgSvc;
//mutable MsgStream m_log;
//StoreGateSvc* m_sgSvc;
std::string m_Name_InputAlg;
......@@ -67,12 +74,11 @@ namespace PanTau
ToolHandle<PanTau::ITool_InformationStore> m_Tool_InformationStore;
ToolHandle<PanTau::ITool_TauConstituentGetter> m_Tool_TauConstituentGetter;
ToolHandle<PanTau::ITool_TauConstituentSelector> m_Tool_TauConstituentSelector;
ToolHandle<PanTau::ITool_FeatureExtractor> m_Tool_FeatureExtractor;
ToolHandle<PanTau::ITool_PanTauTools> m_Tool_FeatureExtractor;
//Tools used in seed finalizing
ToolHandle<PanTau::ITool_DecayModeDeterminator> m_Tool_DecayModeDeterminator;
ToolHandle<PanTau::ITool_FourMomentumCalculator> m_Tool_FourMomentumCalculator;
ToolHandle<PanTau::ITool_DetailsArranger> m_Tool_DetailsArranger;
ToolHandle<PanTau::ITool_PanTauTools> m_Tool_DecayModeDeterminator;
ToolHandle<PanTau::ITool_PanTauTools> m_Tool_DetailsArranger;
std::vector<double> m_Config_PtBins;
double m_Config_MinPt;
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
#ifndef PANTAUALGS_PANTAUSEED_H
#define PANTAUALGS_PANTAUSEED_H
#include <vector>
#include <string>
#include "xAODBase/IParticle.h"
//CxxUtils for override final
#include "CxxUtils/final.h"
#include "CxxUtils/override.h"
#include "PanTauAlgs/TauConstituent.h"
#include "PanTauAlgs/TauFeature.h"
#include "xAODTau/TauJet.h"