diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonEoverP.cxx b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonEoverP.cxx index e9188b04bae0f240d6bac1b84dd8457b34ffc4b3..fa6f3ea2859960019ff5b6afb756b61c8d3e24ff 100755 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonEoverP.cxx +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonEoverP.cxx @@ -704,7 +704,7 @@ void IDPerfMonEoverP::fillIsEM(const xAOD::Electron *eg) const m_isGoodOQ[m_electronCounter] = el_goodOQ; // check loose LH - bool val_loose=m_LHToolLoose2015->accept(eg); + bool val_loose = (bool) m_LHToolLoose2015->accept(eg); ATH_MSG_DEBUG( "Loose value : " << val_loose); //if(eg->passSelection(val_loose, "Loose")) { if(val_loose){ @@ -713,7 +713,7 @@ void IDPerfMonEoverP::fillIsEM(const xAOD::Electron *eg) const }//else{ATH_MSG_DEBUG("Loose electron not defined !");} // check medium LH - bool val_med=m_LHToolMedium2015->accept(eg); + bool val_med = (bool) m_LHToolMedium2015->accept(eg); ATH_MSG_DEBUG( "Medium value : " << val_med ); //if(eg->passSelection(val_med, "Medium")) { if(val_med){ @@ -722,7 +722,7 @@ void IDPerfMonEoverP::fillIsEM(const xAOD::Electron *eg) const }//else{ATH_MSG_DEBUG("Mediu, electron not defined !");} // check tight LH - bool val_tight=m_LHToolTight2015->accept(eg); + bool val_tight = (bool) m_LHToolTight2015->accept(eg); ATH_MSG_DEBUG( "Tight value : " << val_tight); //if(eg->passSelection(val_tight, "Tight")) { if(val_tight){ diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonWenu.cxx b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonWenu.cxx index 18e9c4df847f875617dd4100763c8ae248ace453..2d09601d770959ee26fa44ee3d851df647cc847d 100755 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonWenu.cxx +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonWenu.cxx @@ -638,7 +638,7 @@ const xAOD::CaloCluster* IDPerfMonWenu::getLeadingEMcluster(const xAOD::PhotonCo // check ID if(m_doIDCuts){ LHSel = false; - LHSel = m_LHTool2015->accept(em); + LHSel = (bool) m_LHTool2015->accept(em); if(!LHSel) continue; ATH_MSG_DEBUG("Electron passes " << m_electronIDLevel << " likelihood selection"); } diff --git a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonZee.cxx b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonZee.cxx index 4907bc8c09bb1c7e25350d1a0e4a2c60796010ff..5834cff4cd92693ab9b77771ba7bcc37ea43ed10 100755 --- a/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonZee.cxx +++ b/InnerDetector/InDetMonitoring/InDetPerformanceMonitoring/src/IDPerfMonZee.cxx @@ -730,7 +730,7 @@ const xAOD::CaloCluster* IDPerfMonZee::getLeadingEMcluster(const xAOD::PhotonCon // check ID if(m_doIDCuts){ LHSel = false; - LHSel = m_LHTool2015->accept(em); + LHSel = (bool) m_LHTool2015->accept(em); if(!LHSel) continue; ATH_MSG_DEBUG("Electron passes " << m_electronIDLevel << " likelihood selection"); } diff --git a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/src/EGSelectionToolWrapper.cxx b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/src/EGSelectionToolWrapper.cxx index 28be8e13df7d8af4b4d1ea92d6c480cf5d214362..1fda708116608a574fc7486b4e2cb587b50f0536 100644 --- a/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/src/EGSelectionToolWrapper.cxx +++ b/PhysicsAnalysis/DerivationFramework/DerivationFrameworkEGamma/src/EGSelectionToolWrapper.cxx @@ -10,7 +10,7 @@ #include "DerivationFrameworkEGamma/EGSelectionToolWrapper.h" #include "xAODBase/IParticleContainer.h" -#include "PATCore/TAccept.h" +#include "PATCore/AcceptData.h" #include "xAODEgamma/EgammaContainer.h" #include "xAODEgamma/Photon.h" #include "xAODEgamma/Electron.h" @@ -113,8 +113,9 @@ namespace DerivationFramework { } // compute the output of the selector - Root::TAccept theAccept(m_tool->accept(pCopy)); - unsigned int isEM = m_tool->IsemValue(); // this one should be done only for IsEM selectors.. + asg::AcceptData theAccept(m_tool->accept(pCopy)); + // this one should be done only for IsEM selectors.. + unsigned int isEM = theAccept.getCutResultInverted(); // decorate the original object if(m_cut==""){ diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronChargeIDSelectorTool.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronChargeIDSelectorTool.h index 9b8902c50215f23f7afe2f0acda0576270c44a71..7cb544d8a8c8d3c2f0f0b75646ba24ded5419af4 100644 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronChargeIDSelectorTool.h +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronChargeIDSelectorTool.h @@ -8,6 +8,7 @@ #define ELECTRONPHOTONSELECTORTOOLS_ASGELECTRONCHARGEIDSELECTORTOOL_H // Atlas includes #include "AsgTools/AsgTool.h" +#include "PATCore/AcceptData.h" #include "MVAUtils/BDT.h" #include "EgammaAnalysisInterfaces/IAsgElectronLikelihoodTool.h" #include "ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h" @@ -16,7 +17,7 @@ class AsgElectronChargeIDSelectorTool : public asg::AsgTool, virtual public IAsgElectronLikelihoodTool { - ASG_TOOL_CLASS2(AsgElectronChargeIDSelectorTool, IAsgElectronLikelihoodTool, IAsgSelectionTool) + ASG_TOOL_CLASS2(AsgElectronChargeIDSelectorTool, IAsgElectronLikelihoodTool, CP::ISelectionTool) public: /** Standard constructor */ @@ -32,61 +33,53 @@ public: /** Gaudi Service Interface method implementations */ virtual StatusCode finalize(); - // Main methods for IAsgSelectorTool interface + /** Method to get the plain AcceptInfo. + This is needed so that one can already get the AcceptInfo + and query what cuts are defined before the first object + is passed to the tool. */ + const asg::AcceptInfo& getAcceptInfo() const { return m_acceptInfo; } + + // Main methods for IAsgSelectorTool interface /** The main accept method: using the generic interface */ - const Root::TAccept& accept( const xAOD::IParticle* part ) const; + asg::AcceptData accept( const xAOD::IParticle* part ) const; /** The main accept method: the actual cuts are applied here */ - const Root::TAccept& accept( const xAOD::Electron* eg ) const { + asg::AcceptData accept( const xAOD::Electron* eg ) const { return accept (eg, -99); // mu = -99 as input will force accept to grab the pileup variable from the xAOD object } /** The main accept method: the actual cuts are applied here */ - const Root::TAccept& accept( const xAOD::Egamma* eg ) const { + asg::AcceptData accept( const xAOD::Egamma* eg ) const { return accept (eg, -99); // mu = -99 as input will force accept to grab the pileup variable from the xAOD object } /** The main accept method: in case mu not in EventInfo online */ - const Root::TAccept& accept( const xAOD::Electron* eg, double mu ) const; + asg::AcceptData accept( const xAOD::Electron* eg, double mu ) const; /** The main accept method: in case mu not in EventInfo online */ - const Root::TAccept& accept( const xAOD::Egamma* eg, double mu ) const; + asg::AcceptData accept( const xAOD::Egamma* eg, double mu ) const; // Main methods for IAsgCalculatorTool interface /** The main result method: the actual likelihood is calculated here */ - const Root::TResult& calculate( const xAOD::IParticle* part ) const; + double calculate( const xAOD::IParticle* part ) const; /** The main result method: the actual likelihood is calculated here */ - const Root::TResult& calculate( const xAOD::Electron* eg ) const { + double calculate( const xAOD::Electron* eg ) const { return calculate (eg, -99); // mu = -99 as input will force accept to grab the pileup variable from the xAOD object } /** The main result method: the actual likelihood is calculated here */ - const Root::TResult& calculate( const xAOD::Egamma* eg ) const { + double calculate( const xAOD::Egamma* eg ) const { return calculate (eg, -99); // mu = -99 as input will force accept to grab the pileup variable from the xAOD object } /** The main result method: the actual likelihood is calculated here */ - const Root::TResult& calculate( const xAOD::Electron* eg, double mu ) const; + double calculate( const xAOD::Electron* eg, double mu ) const; /** The main result method: the actual likelihood is calculated here */ - const Root::TResult& calculate( const xAOD::Egamma* eg, double mu ) const; - - /** Method to get the plain TAccept */ - inline virtual const Root::TAccept& getTAccept( ) const - { - // return m_rootTool->getTAccept(); - return m_acceptDummy; - } - + double calculate( const xAOD::Egamma* eg, double mu ) const; - /** Method to get the plain TResult */ - inline virtual const Root::TResult& getTResult( ) const - { - // return m_rootTool->getTResult(); - return m_resultDummy; - } /// Get the name of the current operating point inline virtual std::string getOperatingPointName( ) const @@ -106,22 +99,12 @@ private: TString m_pid_name; float m_cutOnBDT; + asg::AcceptInfo m_acceptInfo; int m_cutPosition_bdt; - int m_resultPosition_bdt; /** Working Point */ std::string m_WorkingPoint; - /** A dummy return TAccept object */ - Root::TAccept m_acceptDummy; - - /** A dummy return TResult object */ - Root::TResult m_resultDummy; - - /** A BDT to return TResult/TAccept object */ - mutable Root::TAccept m_acceptBDT; - mutable Root::TResult m_resultBDT; - /// Whether to use the PV (not available for trigger) bool m_usePVCont; diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronIsEMSelector.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronIsEMSelector.h index 4baeccc4324ac3348d3dc2dc00c04cd48e713e3f..3064874c47fe3c4a94a8bd6dec208815468dd6a5 100644 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronIsEMSelector.h +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronIsEMSelector.h @@ -26,8 +26,6 @@ // Include the interfaces #include "EgammaAnalysisInterfaces/IAsgElectronIsEMSelector.h" -#include "PATCore/TAccept.h" - #include <string> namespace Root{ @@ -40,7 +38,7 @@ class AsgElectronIsEMSelector : public asg::AsgTool, { ASG_TOOL_CLASS3(AsgElectronIsEMSelector, IAsgElectronIsEMSelector, - IAsgEGammaIsEMSelector,IAsgSelectionTool) + IAsgEGammaIsEMSelector, CP::ISelectionTool) public: /** Standard constructor */ @@ -52,31 +50,23 @@ class AsgElectronIsEMSelector : public asg::AsgTool, /** Gaudi Service Interface method implementations */ virtual StatusCode initialize(); - /** Gaudi Service Interface method implementations */ - virtual StatusCode finalize(); - /// @name Methods from the IAsgSelectionTool interface /// @{ - /** Method to get the plain TAccept */ - virtual const Root::TAccept& getTAccept( ) const; + /** Method to get the plain AcceptInfo. + This is needed so that one can already get the AcceptInfo + and query what cuts are defined before the first object + is passed to the tool. */ + virtual const asg::AcceptInfo& getAcceptInfo() const; + + /** Accept with generic interface */ - virtual const Root::TAccept& accept( const xAOD::IParticle* part ) const ; + virtual asg::AcceptData accept( const xAOD::IParticle* part ) const ; ///@} - /// @name Methods from the IAsgEGammaIsEMSelectorinterface - /// @{ - - /** Accept with Egamma objects */ - virtual const Root::TAccept& accept( const xAOD::Egamma* part) const ; /** Accept with Egamma objects */ - virtual const Root::TAccept& accept( const xAOD::Egamma& part) const { - return accept(&part); - } - - /** The value of the isem **/ - virtual unsigned int IsemValue() const; + virtual asg::AcceptData accept( const xAOD::Egamma* part) const ; /** Method to get the operating point */ virtual std::string getOperatingPointName( ) const; @@ -86,14 +76,14 @@ class AsgElectronIsEMSelector : public asg::AsgTool, /// @name Methods from the IAsgElectronIsEMSelectorinterface /// @{ /** Accept with Photon objects */ - virtual const Root::TAccept& accept( const xAOD::Photon* part ) const ; + virtual asg::AcceptData accept( const xAOD::Photon* part ) const ; /** Accept with Electron objects */ - virtual const Root::TAccept& accept( const xAOD::Electron* part ) const ; + virtual asg::AcceptData accept( const xAOD::Electron* part ) const ; //The main execute method - StatusCode execute(const xAOD::Egamma* eg) const; + StatusCode execute(const xAOD::Egamma* eg, unsigned int& isEM) const; /// @} // Private member variables @@ -120,14 +110,10 @@ private: /** @brief use f3core or f3 (default: use f3)*/ bool m_useF3core; - /** A dummy return TAccept object */ - Root::TAccept m_acceptDummy; - /// Flag for calo only cut-base bool m_caloOnly; float m_trigEtTh; - }; // End: class definition diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h index 09eea7cf5eec2e8bcf72e63433d41688fb502021..19348e040d3515ac4800f5f6b5312c73a46c7d5e 100644 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h @@ -12,8 +12,7 @@ #include "AsgTools/AsgTool.h" #include "EgammaAnalysisInterfaces/IAsgElectronLikelihoodTool.h" #include "xAODEgamma/ElectronFwd.h" -#include "PATCore/TAccept.h" // for TAccept -#include "PATCore/TResult.h" // for TResult +#include "PATCore/AcceptData.h" namespace Root{ class TElectronLikelihoodTool; @@ -23,7 +22,7 @@ namespace Root{ class AsgElectronLikelihoodTool : public asg::AsgTool, virtual public IAsgElectronLikelihoodTool { - ASG_TOOL_CLASS2(AsgElectronLikelihoodTool, IAsgElectronLikelihoodTool, IAsgSelectionTool) + ASG_TOOL_CLASS2(AsgElectronLikelihoodTool, IAsgElectronLikelihoodTool, CP::ISelectionTool) public: /** Standard constructor */ @@ -40,52 +39,52 @@ public: virtual StatusCode finalize(); // Main methods for IAsgSelectorTool interface -public: + + /** Method to get the plain AcceptInfo. + This is needed so that one can already get the AcceptInfo + and query what cuts are defined before the first object + is passed to the tool. */ + virtual const asg::AcceptInfo& getAcceptInfo() const; + /** The main accept method: using the generic interface */ - const Root::TAccept& accept( const xAOD::IParticle* part ) const; + asg::AcceptData accept( const xAOD::IParticle* part ) const; /** The main accept method: the actual cuts are applied here */ - const Root::TAccept& accept( const xAOD::Electron* eg ) const { + asg::AcceptData accept( const xAOD::Electron* eg ) const { return accept (eg, -99); // mu = -99 as input will force accept to grab the pileup variable from the xAOD object } /** The main accept method: the actual cuts are applied here */ - const Root::TAccept& accept( const xAOD::Egamma* eg ) const { + asg::AcceptData accept( const xAOD::Egamma* eg ) const { return accept (eg, -99); // mu = -99 as input will force accept to grab the pileup variable from the xAOD object } /** The main accept method: in case mu not in EventInfo online */ - const Root::TAccept& accept( const xAOD::Electron* eg, double mu ) const; + asg::AcceptData accept( const xAOD::Electron* eg, double mu ) const; /** The main accept method: in case mu not in EventInfo online */ - const Root::TAccept& accept( const xAOD::Egamma* eg, double mu ) const; + asg::AcceptData accept( const xAOD::Egamma* eg, double mu ) const; // Main methods for IAsgCalculatorTool interface public: /** The main result method: the actual likelihood is calculated here */ - const Root::TResult& calculate( const xAOD::IParticle* part ) const; + double calculate( const xAOD::IParticle* part ) const; /** The main result method: the actual likelihood is calculated here */ - const Root::TResult& calculate( const xAOD::Electron* eg ) const { + double calculate( const xAOD::Electron* eg ) const { return calculate (eg, -99); // mu = -99 as input will force accept to grab the pileup variable from the xAOD object } /** The main result method: the actual likelihood is calculated here */ - const Root::TResult& calculate( const xAOD::Egamma* eg ) const { + double calculate( const xAOD::Egamma* eg ) const { return calculate (eg, -99); // mu = -99 as input will force accept to grab the pileup variable from the xAOD object } /** The main result method: the actual likelihood is calculated here */ - const Root::TResult& calculate( const xAOD::Electron* eg, double mu ) const; + double calculate( const xAOD::Electron* eg, double mu ) const; /** The main result method: the actual likelihood is calculated here */ - const Root::TResult& calculate( const xAOD::Egamma* eg, double mu ) const; - - /** Method to get the plain TAccept */ - virtual const Root::TAccept& getTAccept( ) const; - - /** Method to get the plain TResult */ - virtual const Root::TResult& getTResult( ) const; + double calculate( const xAOD::Egamma* eg, double mu ) const; virtual std::string getOperatingPointName( ) const; @@ -114,13 +113,6 @@ private: /** Pointer to the underlying ROOT based tool */ Root::TElectronLikelihoodTool* m_rootTool; - /** A dummy return TAccept object */ - Root::TAccept m_acceptDummy; - - /** A dummy return TResult object */ - Root::TResult m_resultDummy; - - /// Whether to use the PV (not available for trigger) bool m_usePVCont; diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronMultiLeptonSelector.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronMultiLeptonSelector.h index d3f58d993554f4a54813c5da1ce0b3db53f050c1..78953b6577469010a065615a624583b065f60b7c 100644 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronMultiLeptonSelector.h +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgElectronMultiLeptonSelector.h @@ -22,9 +22,6 @@ #include "AsgTools/AsgTool.h" #include "EgammaAnalysisInterfaces/IAsgElectronMultiLeptonSelector.h" -// Include the return object and ROOT tool -#include "PATCore/TAccept.h" - namespace Root{ class TElectronMultiLeptonSelector; } @@ -34,7 +31,7 @@ class AsgElectronMultiLeptonSelector : public asg::AsgTool, virtual public IAsgElectronMultiLeptonSelector { ASG_TOOL_CLASS2(AsgElectronMultiLeptonSelector, IAsgElectronMultiLeptonSelector, - IAsgSelectionTool) + CP::ISelectionTool) public: /** Standard constructor */ @@ -54,14 +51,17 @@ public: // Main methods for IAsgSelectionTool interface - /** The main accept method: the actual cuts are applied here */ - const Root::TAccept& accept( const xAOD::IParticle* part ) const; + /** Method to get the plain AcceptInfo. + This is needed so that one can already get the AcceptInfo + and query what cuts are defined before the first object + is passed to the tool. */ + const asg::AcceptInfo& getAcceptInfo() const; /** The main accept method: the actual cuts are applied here */ - const Root::TAccept& accept( const xAOD::Electron* eg ) const; + asg::AcceptData accept( const xAOD::IParticle* part ) const; - /** Method to get the plain TAccept */ - virtual const Root::TAccept& getTAccept( ) const; + /** The main accept method: the actual cuts are applied here */ + asg::AcceptData accept( const xAOD::Electron* eg ) const; /** Method to get the operating point */ virtual std::string getOperatingPointName( ) const; @@ -72,9 +72,6 @@ private: /** Pointer to the underlying ROOT based tool */ Root::TElectronMultiLeptonSelector* m_rootTool; - /** A dummy return TAccept object */ - Root::TAccept m_acceptDummy; - }; // End: class definition diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgForwardElectronIsEMSelector.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgForwardElectronIsEMSelector.h index 37edfa3532c8c30ed9b6abacfda985934b0a5d08..8936ddd65398f64718484aaeabcbbf9ffa2f4785 100644 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgForwardElectronIsEMSelector.h +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgForwardElectronIsEMSelector.h @@ -26,8 +26,6 @@ // Include the interfaces #include "EgammaAnalysisInterfaces/IAsgForwardElectronIsEMSelector.h" -#include "PATCore/TAccept.h" - #include <string> namespace Root{ @@ -39,7 +37,7 @@ class AsgForwardElectronIsEMSelector : public asg::AsgTool, { ASG_TOOL_CLASS3(AsgForwardElectronIsEMSelector, IAsgForwardElectronIsEMSelector, - IAsgEGammaIsEMSelector,IAsgSelectionTool) + IAsgEGammaIsEMSelector, CP::ISelectionTool) public: /** Standard constructor */ @@ -56,35 +54,32 @@ class AsgForwardElectronIsEMSelector : public asg::AsgTool, // Main methods for IAsgSelectionTool interface + /** Method to get the plain AcceptInfo. + This is needed so that one can already get the AcceptInfo + and query what cuts are defined before the first object + is passed to the tool. */ + virtual const asg::AcceptInfo& getAcceptInfo() const; /** Accept with generic interface */ - virtual const Root::TAccept& accept( const xAOD::IParticle* part ) const ; + virtual asg::AcceptData accept( const xAOD::IParticle* part ) const ; /** Accept with Egamma objects */ - virtual const Root::TAccept& accept( const xAOD::Egamma* part) const ; + virtual asg::AcceptData accept( const xAOD::Egamma* part) const ; /** Accept with Photon objects */ - virtual const Root::TAccept& accept( const xAOD::Photon* part ) const ; + virtual asg::AcceptData accept( const xAOD::Photon* part ) const ; /** Accept with Electron objects */ - virtual const Root::TAccept& accept( const xAOD::Electron* part ) const ; - - - /** The value of the isem **/ - virtual unsigned int IsemValue() const ; + virtual asg::AcceptData accept( const xAOD::Electron* part ) const ; /** Method to get the operating point */ virtual std::string getOperatingPointName( ) const; //The main execute method - StatusCode execute(const xAOD::Egamma* eg) const; - - /** Method to get the plain TAccept */ - virtual const Root::TAccept& getTAccept( ) const; - + StatusCode execute(const xAOD::Egamma* eg, unsigned int& isEM) const; // Private member variables private: @@ -104,9 +99,6 @@ private: /** Pointer to the underlying ROOT based tool */ Root::TForwardElectronIsEMSelector* m_rootForwardTool; - /** A dummy return TAccept object */ - Root::TAccept m_acceptDummy; - bool m_usePVCont; // defualt nPV (when not using PVCont) diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgPhotonIsEMSelector.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgPhotonIsEMSelector.h index 6e2a7b5f836b07c73b5b850e31eb70c5526cbbac..16cbe04e061ac359b7469cfdf5b420320a71694f 100755 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgPhotonIsEMSelector.h +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/ElectronPhotonSelectorTools/AsgPhotonIsEMSelector.h @@ -29,9 +29,6 @@ #include "xAODEgamma/ElectronFwd.h" #include "xAODTracking/VertexFwd.h" -// Include the return object and the underlying ROOT tool -#include "PATCore/TAccept.h" - namespace Root{ class TPhotonIsEMSelector; } @@ -41,7 +38,7 @@ class AsgPhotonIsEMSelector : public asg::AsgTool, { ASG_TOOL_CLASS3(AsgPhotonIsEMSelector, IAsgPhotonIsEMSelector, - IAsgEGammaIsEMSelector,IAsgSelectionTool) + IAsgEGammaIsEMSelector, CP::ISelectionTool) public: @@ -52,34 +49,31 @@ class AsgPhotonIsEMSelector : public asg::AsgTool, ~AsgPhotonIsEMSelector(); /** @brief AlgTool initialize method*/ - StatusCode initialize(); - /** @brief AlgTool finalize method*/ - StatusCode finalize(); + virtual StatusCode initialize(); + + /** Method to get the plain AcceptInfo. + This is needed so that one can already get the AcceptInfo + and query what cuts are defined before the first object + is passed to the tool. */ + virtual const asg::AcceptInfo& getAcceptInfo() const; /** Accept with generic interface */ - virtual const Root::TAccept& accept( const xAOD::IParticle* part ) const ; + virtual asg::AcceptData accept( const xAOD::IParticle* part ) const ; /** Accept with Egamma objects */ - virtual const Root::TAccept& accept( const xAOD::Egamma* part) const ; + virtual asg::AcceptData accept( const xAOD::Egamma* part) const ; /** The main accept method: the actual cuts are applied here */ - virtual const Root::TAccept& accept( const xAOD::Photon* part ) const ; + virtual asg::AcceptData accept( const xAOD::Photon* part ) const ; /** The main accept method: the actual cuts are applied here */ - virtual const Root::TAccept& accept( const xAOD::Electron* part ) const ; - - /** The value of the isem **/ - virtual unsigned int IsemValue() const ; + virtual asg::AcceptData accept( const xAOD::Electron* part ) const ; /** Method to get the operating point */ virtual std::string getOperatingPointName( ) const; /** The basic isem */ - virtual StatusCode execute(const xAOD::Egamma* eg) const; - - /** Method to get the plain TAccept */ - virtual const Root::TAccept& getTAccept( ) const; - + virtual StatusCode execute(const xAOD::Egamma* eg, unsigned int& isEM) const; private: @@ -95,9 +89,6 @@ private: /** @brief use f3core or f3 (default: use f3)*/ bool m_useF3core; - /** A dummy return TAccept object */ - Root::TAccept m_acceptDummy; - /// Flag for calo only cut-base bool m_caloOnly; float m_trigEtTh; diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronChargeIDSelectorTool.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronChargeIDSelectorTool.cxx index b4194147ed8a6079a3a1b6cc90cf7741ed08736c..f28f54b3974b7b215c9d2e7b4570e7d38f8ca31f 100644 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronChargeIDSelectorTool.cxx +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronChargeIDSelectorTool.cxx @@ -43,8 +43,7 @@ //============================================================================= AsgElectronChargeIDSelectorTool::AsgElectronChargeIDSelectorTool(std::string myname) : AsgTool(myname) , - m_cutPosition_bdt(0), - m_resultPosition_bdt(0) + m_cutPosition_bdt(0) { // Declare the needed properties declareProperty("WorkingPoint",m_WorkingPoint="","The Working Point"); @@ -148,8 +147,7 @@ StatusCode AsgElectronChargeIDSelectorTool::initialize() // Get the name of the current operating point, and massage the other strings accordingly //ATH_MSG_VERBOSE( "Going to massage the labels based on the provided operating point..." ); - m_cutPosition_bdt = m_acceptBDT.addCut( "bdt", "pass bdt" ); - m_resultPosition_bdt = m_resultBDT.addResult( "bdt", "ECIDS bdt" ); + m_cutPosition_bdt = m_acceptInfo.addCut( "bdt", "pass bdt" ); return StatusCode::SUCCESS ; } @@ -163,64 +161,63 @@ StatusCode AsgElectronChargeIDSelectorTool::finalize() return StatusCode::SUCCESS; } - //============================================================================= // The main accept method: the actual cuts are applied here //============================================================================= -const Root::TAccept& AsgElectronChargeIDSelectorTool::accept( const xAOD::Electron* eg, double mu ) const +asg::AcceptData AsgElectronChargeIDSelectorTool::accept( const xAOD::Electron* eg, double mu ) const { - double bdt=calculate(eg,mu); + double bdt = calculate(eg,mu); ATH_MSG_VERBOSE("\t accept( const xAOD::Electron* eg, double mu ), bdt="<<bdt); - m_acceptBDT.clear(); + asg::AcceptData acceptData(&m_acceptInfo); - m_acceptBDT.setCutResult(m_cutPosition_bdt,bdt>m_cutOnBDT); + acceptData.setCutResult(m_cutPosition_bdt, bdt > m_cutOnBDT); - return m_acceptBDT; + return acceptData; } //============================================================================= // Accept method for EFCaloLH in the trigger; do full LH if !CaloCutsOnly //============================================================================= -const Root::TAccept& AsgElectronChargeIDSelectorTool::accept( const xAOD::Egamma* eg, double mu) const +asg::AcceptData AsgElectronChargeIDSelectorTool::accept( const xAOD::Egamma* eg, double mu) const { - double bdt=calculate(eg,mu); + double bdt = calculate(eg,mu); ATH_MSG_VERBOSE("\t accept( const xAOD::Egamma* eg, double mu ), bdt="<<bdt); - m_acceptBDT.clear(); + asg::AcceptData acceptData(&m_acceptInfo); - m_acceptBDT.setCutResult(m_cutPosition_bdt,bdt>m_cutOnBDT); + acceptData.setCutResult(m_cutPosition_bdt, bdt > m_cutOnBDT); - return m_acceptBDT; + return acceptData; } //============================================================================= // The main result method: the actual likelihood is calculated here //============================================================================= -const Root::TResult& AsgElectronChargeIDSelectorTool::calculate( const xAOD::Electron* eg, double mu ) const +double AsgElectronChargeIDSelectorTool::calculate( const xAOD::Electron* eg, double mu ) const { ATH_MSG_VERBOSE("\t AsgElectronChargeIDSelectorTool::calculate( const xAOD::Electron* eg, double mu= "<<mu<<" )"); if ( !eg ) { ATH_MSG_ERROR ("Failed, no egamma object."); - return m_resultDummy; + return -999; } const xAOD::CaloCluster* cluster = eg->caloCluster(); if ( !cluster ) { ATH_MSG_ERROR ("Failed, no cluster."); - return m_resultDummy; + return -999; } const double energy = cluster->e(); const float eta = cluster->etaBE(2); if ( fabs(eta) > 300.0 ) { ATH_MSG_ERROR ("Failed, eta range."); - return m_resultDummy; + return -999; } double et = 0.;// transverse energy of the electron (using the track eta) @@ -430,24 +427,22 @@ const Root::TResult& AsgElectronChargeIDSelectorTool::calculate( const xAOD::Ele double bdt_output = m_v_bdts.at(m_bdt_index)->GetGradBoostMVA(m_v_bdts.at(m_bdt_index)->GetPointers()); ATH_MSG_DEBUG("ECIDS-BDT= "<<bdt_output); - m_resultBDT.setResult(m_resultPosition_bdt,bdt_output); - return m_resultBDT; + return bdt_output; } //============================================================================= // Calculate method for EFCaloLH in the trigger; do full LH if !CaloCutsOnly //============================================================================= -const Root::TResult& AsgElectronChargeIDSelectorTool::calculate( const xAOD::Egamma* eg, double mu ) const +double AsgElectronChargeIDSelectorTool::calculate( const xAOD::Egamma* eg, double mu ) const { ATH_MSG_VERBOSE("AsgElectronChargeIDSelectorTool::calculate( const xAOD::Egamma* "<<eg<<", double mu= "<<mu<< " ) const"); ATH_MSG_WARNING("Method not implemented for egamma object! Reurning -1!!"); - m_resultBDT.setResult(m_resultPosition_bdt,-1); - return m_resultBDT; + return -999; } //============================================================================= -const Root::TAccept& AsgElectronChargeIDSelectorTool::accept(const xAOD::IParticle* part) const +asg::AcceptData AsgElectronChargeIDSelectorTool::accept(const xAOD::IParticle* part) const { ATH_MSG_VERBOSE("Entering accept( const IParticle* part )"); const xAOD::Electron* eg = dynamic_cast<const xAOD::Electron*>(part); @@ -457,11 +452,12 @@ const Root::TAccept& AsgElectronChargeIDSelectorTool::accept(const xAOD::IPartic } else{ ATH_MSG_ERROR("AsgElectronChargeIDSelectorTool::could not cast to const Electron"); - return m_acceptDummy; + asg::AcceptData acceptData(&m_acceptInfo); + return acceptData; } } -const Root::TResult& AsgElectronChargeIDSelectorTool::calculate(const xAOD::IParticle* part) const +double AsgElectronChargeIDSelectorTool::calculate(const xAOD::IParticle* part) const { const xAOD::Electron* eg = dynamic_cast<const xAOD::Electron*>(part); if (eg) @@ -471,7 +467,7 @@ const Root::TResult& AsgElectronChargeIDSelectorTool::calculate(const xAOD::IPar else { ATH_MSG_ERROR ( " Could not cast to const Electron " ); - return m_resultDummy; + return -999; } } diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronIsEMSelector.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronIsEMSelector.cxx index 06b26923f702322035b533a6306cc4a907f74823..79d538aff5d30603ba0a05747368662234f50639 100644 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronIsEMSelector.cxx +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronIsEMSelector.cxx @@ -45,118 +45,118 @@ AsgElectronIsEMSelector::AsgElectronIsEMSelector(std::string myname) : // Name of the quality to use declareProperty("isEMMask", - m_rootTool->isEMMask=egammaPID::EgPidUndefined, //All pass by default, if not specified + m_rootTool->m_isEMMask=egammaPID::EgPidUndefined, //All pass by default, if not specified "The mask to use"); // Boolean to use TRT outliers - declareProperty("useTRTOutliers",m_rootTool->useTRTOutliers=false, + declareProperty("useTRTOutliers",m_rootTool->m_useTRTOutliers=false, "Boolean to use TRT outliers"); // Boolean to use TRT Xenon Hits declareProperty("useTRTXenonHits", - m_rootTool->useTRTXenonHits = false, + m_rootTool->m_useTRTXenonHits = false, "Boolean to use TRT Xenon Hits"); // Eta binning - declareProperty("CutBinEta",m_rootTool->CutBinEta, + declareProperty("CutBinEta",m_rootTool->m_cutBinEta, "Eta binning"); // ET binning - declareProperty("CutBinET",m_rootTool->CutBinET, + declareProperty("CutBinET",m_rootTool->m_cutBinET, "ET binning"); // Cut on fraction of energy to use 1st sampling - declareProperty("CutF1",m_rootTool->CutF1, + declareProperty("CutF1",m_rootTool->m_cutF1, "Cut on fraction of energy to use 1st sampling"); // Cut on hadronic leakage - declareProperty("CutHadLeakage",m_rootTool->CutHadLeakage, + declareProperty("CutHadLeakage",m_rootTool->m_cutHadLeakage, "Cut on hadronic leakage"); // Cut on lateral shower shape in 2nd sampling - declareProperty("CutRphi33",m_rootTool->CutRphi33, + declareProperty("CutRphi33",m_rootTool->m_cutRphi33, "Cut on lateral shower shape in 2nd sampling"); // Cut on longitudinal shower shape in 2nd sampling - declareProperty("CutReta37",m_rootTool->CutReta37, + declareProperty("CutReta37",m_rootTool->m_cutReta37, "Cut on longitudinal shower shape in 2nd sampling"); // Cut on shower width in 2nd sampling - declareProperty("CutWeta2c",m_rootTool->CutWeta2c, + declareProperty("CutWeta2c",m_rootTool->m_cutWeta2c, "Cut on shower width in 2nd sampling"); // Cut on Demax 2 in 1st sampling - declareProperty("CutDeltaEmax2",m_rootTool->CutDeltaEmax2, + declareProperty("CutDeltaEmax2",m_rootTool->m_cutDeltaEmax2, "Cut on Demax 2 in 1st sampling"); // Cut on Delta E in 1st sampling - declareProperty("CutDeltaE",m_rootTool->CutDeltaE, + declareProperty("CutDeltaE",m_rootTool->m_cutDeltaE, "Cut on Delta E in 1st sampling"); // Cut on (Emax1-Emax2)/(Emax1+Emax2) in 1st sampling - declareProperty("CutDEmaxs1",m_rootTool->CutDEmaxs1, + declareProperty("CutDEmaxs1",m_rootTool->m_cutDEmaxs1, "Cut on (Emax1-Emax2)/(Emax1+Emax2) in 1st sampling"); // Cut on total shower width in 1st sampling - declareProperty("CutWtot",m_rootTool->CutWtot, + declareProperty("CutWtot",m_rootTool->m_cutWtot, "Cut on total shower width in 1st sampling"); // Cut on shower width in 3 strips - declareProperty("CutWeta1c",m_rootTool->CutWeta1c, + declareProperty("CutWeta1c",m_rootTool->m_cutWeta1c, "Cut on shower width in 3 strips"); // Cut on fraction of energy outside core in 1st sampling - declareProperty("CutFracm",m_rootTool->CutFracm, + declareProperty("CutFracm",m_rootTool->m_cutFracm, "Cut on fraction of energy outside core in 1st sampling"); declareProperty("useF3core",m_useF3core = false, "Cut on f3 or f3core?"); // Cut on fraction of energy to use 3rd sampling - declareProperty("CutF3",m_rootTool->CutF3 , + declareProperty("CutF3",m_rootTool->m_cutF3 , "Cut on fraction of energy to use 3rd sampling (f3 or f3core)"); // cut on b-layer - declareProperty("CutBL",m_rootTool->CutBL, + declareProperty("CutBL",m_rootTool->m_cutBL, "Cut on b-layer"); // cut on pixel hits - declareProperty("CutPi",m_rootTool->CutPi, + declareProperty("CutPi",m_rootTool->m_cutPi, "Cut on pixel hits"); // cut on precision hits - declareProperty("CutSi",m_rootTool->CutSi, + declareProperty("CutSi",m_rootTool->m_cutSi, "Cut on precision hits"); // cut on A0 - declareProperty("CutA0",m_rootTool->CutA0, + declareProperty("CutA0",m_rootTool->m_cutA0, "Cut on transverse impact parameter"); // cut on A0 for tight menu - declareProperty("CutA0Tight",m_rootTool->CutA0Tight, + declareProperty("CutA0Tight",m_rootTool->m_cutA0Tight, "Cut on transverse impact parameter for tight selection"); // cut on Delta eta - declareProperty("CutDeltaEta",m_rootTool->CutDeltaEta, + declareProperty("CutDeltaEta",m_rootTool->m_cutDeltaEta, "cut on Delta eta"); // cut on Delta eta for tight selection - declareProperty("CutDeltaEtaTight",m_rootTool->CutDeltaEtaTight, + declareProperty("CutDeltaEtaTight",m_rootTool->m_cutDeltaEtaTight, "cut on Delta eta for tight selection"); // cut min on Delta phi (negative) - declareProperty("CutminDeltaPhi",m_rootTool->CutminDeltaPhi, + declareProperty("CutminDeltaPhi",m_rootTool->m_cutminDeltaPhi, "cut min on Delta phi"); // cut max on Delta phi (negative) - declareProperty("CutmaxDeltaPhi",m_rootTool->CutmaxDeltaPhi, + declareProperty("CutmaxDeltaPhi",m_rootTool->m_cutmaxDeltaPhi, "cut max on Delta phi"); // cut min on E/p - declareProperty("CutminEp",m_rootTool->CutminEp, + declareProperty("CutminEp",m_rootTool->m_cutminEp, "Cut min on E/p"); // cut max on E/p - declareProperty("CutmaxEp",m_rootTool->CutmaxEp, + declareProperty("CutmaxEp",m_rootTool->m_cutmaxEp, "Cut max on E/p"); // cuts on TRT - declareProperty("CutBinEta_TRT",m_rootTool->CutBinEta_TRT, + declareProperty("CutBinEta_TRT",m_rootTool->m_cutBinEta_TRT, "Eta binning in TRT"); // cuts on TRT - declareProperty("CutBinET_TRT",m_rootTool->CutBinET_TRT, + declareProperty("CutBinET_TRT",m_rootTool->m_cutBinET_TRT, "ET binning in TRT"); // cut on Number of TRT hits - declareProperty("CutNumTRT",m_rootTool->CutNumTRT, + declareProperty("CutNumTRT",m_rootTool->m_cutNumTRT, "cut on Number of TRT hits"); // cut on Ratio of TR hits to Number of TRT hits - declareProperty("CutTRTRatio",m_rootTool->CutTRTRatio, + declareProperty("CutTRTRatio",m_rootTool->m_cutTRTRatio, "Cut on Ratio of TR hits to Number of TRT hits"); // cut on Ratio of TR hits to Number of TRT hits for 90% efficiency - declareProperty("CutTRTRatio90",m_rootTool->CutTRTRatio90, + declareProperty("CutTRTRatio90",m_rootTool->m_cutTRTRatio90, "cut on Ratio of TR hits to Number of TRT hits for 90% efficiency"); //cut on eProbabilityHT new TRT PID tool - declareProperty("CutEProbabilityHT",m_rootTool->CutEProbabilityHT, + declareProperty("CutEProbabilityHT",m_rootTool->m_cutEProbabilityHT, "Cut on eProabbiility new TRT PID Tool"); // for the trigger needs: @@ -202,66 +202,66 @@ StatusCode AsgElectronIsEMSelector::initialize() ///------- Read in the TEnv config ------/// //Override the mask via the config only if it is not set - if(m_rootTool->isEMMask==egammaPID::EgPidUndefined){ + if(m_rootTool->m_isEMMask==egammaPID::EgPidUndefined){ int default_mask = static_cast<int>(egammaPID::EgPidUndefined); int mask(env.GetValue("isEMMask",default_mask)); - m_rootTool->isEMMask=static_cast<unsigned int> (mask); + m_rootTool->m_isEMMask=static_cast<unsigned int> (mask); } // ATH_MSG_DEBUG("Read in the TEnv config "); //From here on the conf ovverides all other properties bool useTRTOutliers(env.GetValue("useTRTOutliers", true)); - m_rootTool->useTRTOutliers =useTRTOutliers; + m_rootTool->m_useTRTOutliers =useTRTOutliers; bool useTRTXenonHits(env.GetValue(" useTRTXenonHits", false)); - m_rootTool->useTRTXenonHits =useTRTXenonHits; + m_rootTool->m_useTRTXenonHits =useTRTXenonHits; ///------- Use helpers to read in the cut arrays ------/// - m_rootTool->CutBinEta =AsgConfigHelper::HelperFloat("CutBinEta",env); - m_rootTool->CutBinET = AsgConfigHelper::HelperFloat("CutBinET",env); - m_rootTool->CutF1 = AsgConfigHelper::HelperFloat("CutF1",env); - m_rootTool->CutHadLeakage = AsgConfigHelper::HelperFloat("CutHadLeakage",env); - m_rootTool->CutReta37 = AsgConfigHelper::HelperFloat("CutReta37",env); - m_rootTool->CutRphi33 = AsgConfigHelper::HelperFloat("CutRphi33",env); - m_rootTool->CutWeta2c = AsgConfigHelper::HelperFloat("CutWeta2c",env); - m_rootTool->CutDeltaEmax2 = AsgConfigHelper::HelperFloat("CutDeltaEmax2",env); - m_rootTool->CutDeltaE = AsgConfigHelper::HelperFloat("CutDeltaE",env); - m_rootTool->CutDEmaxs1 = AsgConfigHelper::HelperFloat("CutDEmaxs1",env); - m_rootTool->CutDeltaE = AsgConfigHelper::HelperFloat("CutDeltaE",env); - m_rootTool->CutWtot = AsgConfigHelper::HelperFloat("CutWtot",env); - m_rootTool->CutWeta1c = AsgConfigHelper::HelperFloat("CutWeta1c",env); - m_rootTool->CutFracm = AsgConfigHelper::HelperFloat("CutFracm",env); - m_rootTool->CutF3 = AsgConfigHelper::HelperFloat("CutF3",env); - m_rootTool->CutBL = AsgConfigHelper::HelperInt("CutBL",env); - m_rootTool->CutPi = AsgConfigHelper::HelperInt("CutPi",env); - m_rootTool->CutSi = AsgConfigHelper::HelperInt("CutSi",env); - m_rootTool->CutA0 = AsgConfigHelper::HelperFloat("CutA0",env); - m_rootTool->CutA0Tight = AsgConfigHelper::HelperFloat("CutA0Tight",env); - m_rootTool->CutDeltaEta = AsgConfigHelper::HelperFloat("CutDeltaEta",env); - m_rootTool->CutDeltaEtaTight = AsgConfigHelper::HelperFloat("CutDeltaEtaTight",env); - m_rootTool->CutminDeltaPhi = AsgConfigHelper::HelperFloat("CutminDeltaPhi",env); - m_rootTool->CutmaxDeltaPhi = AsgConfigHelper::HelperFloat("CutmaxDeltaPhi",env); - m_rootTool->CutminEp = AsgConfigHelper::HelperFloat("CutminEp",env); - m_rootTool->CutmaxEp = AsgConfigHelper::HelperFloat("CutmaxEp",env); - m_rootTool->CutBinEta_TRT = AsgConfigHelper::HelperFloat("CutBinEta_TRT",env); - m_rootTool->CutBinET_TRT = AsgConfigHelper::HelperFloat("CutBinET_TRT",env); - m_rootTool->CutNumTRT = AsgConfigHelper::HelperFloat("CutNumTRT",env); - m_rootTool->CutTRTRatio = AsgConfigHelper::HelperFloat("CutTRTRatio",env); - m_rootTool->CutTRTRatio90 = AsgConfigHelper::HelperFloat("CutTRTRatio90",env); - m_rootTool->CutEProbabilityHT = AsgConfigHelper::HelperFloat("CutEProbabilityHT",env); + m_rootTool->m_cutBinEta = AsgConfigHelper::HelperFloat("CutBinEta",env); + m_rootTool->m_cutBinET = AsgConfigHelper::HelperFloat("CutBinET",env); + m_rootTool->m_cutF1 = AsgConfigHelper::HelperFloat("CutF1",env); + m_rootTool->m_cutHadLeakage = AsgConfigHelper::HelperFloat("CutHadLeakage",env); + m_rootTool->m_cutReta37 = AsgConfigHelper::HelperFloat("CutReta37",env); + m_rootTool->m_cutRphi33 = AsgConfigHelper::HelperFloat("CutRphi33",env); + m_rootTool->m_cutWeta2c = AsgConfigHelper::HelperFloat("CutWeta2c",env); + m_rootTool->m_cutDeltaEmax2 = AsgConfigHelper::HelperFloat("CutDeltaEmax2",env); + m_rootTool->m_cutDeltaE = AsgConfigHelper::HelperFloat("CutDeltaE",env); + m_rootTool->m_cutDEmaxs1 = AsgConfigHelper::HelperFloat("CutDEmaxs1",env); + m_rootTool->m_cutDeltaE = AsgConfigHelper::HelperFloat("CutDeltaE",env); + m_rootTool->m_cutWtot = AsgConfigHelper::HelperFloat("CutWtot",env); + m_rootTool->m_cutWeta1c = AsgConfigHelper::HelperFloat("CutWeta1c",env); + m_rootTool->m_cutFracm = AsgConfigHelper::HelperFloat("CutFracm",env); + m_rootTool->m_cutF3 = AsgConfigHelper::HelperFloat("CutF3",env); + m_rootTool->m_cutBL = AsgConfigHelper::HelperInt("CutBL",env); + m_rootTool->m_cutPi = AsgConfigHelper::HelperInt("CutPi",env); + m_rootTool->m_cutSi = AsgConfigHelper::HelperInt("CutSi",env); + m_rootTool->m_cutA0 = AsgConfigHelper::HelperFloat("CutA0",env); + m_rootTool->m_cutA0Tight = AsgConfigHelper::HelperFloat("CutA0Tight",env); + m_rootTool->m_cutDeltaEta = AsgConfigHelper::HelperFloat("CutDeltaEta",env); + m_rootTool->m_cutDeltaEtaTight = AsgConfigHelper::HelperFloat("CutDeltaEtaTight",env); + m_rootTool->m_cutminDeltaPhi = AsgConfigHelper::HelperFloat("CutminDeltaPhi",env); + m_rootTool->m_cutmaxDeltaPhi = AsgConfigHelper::HelperFloat("CutmaxDeltaPhi",env); + m_rootTool->m_cutminEp = AsgConfigHelper::HelperFloat("CutminEp",env); + m_rootTool->m_cutmaxEp = AsgConfigHelper::HelperFloat("CutmaxEp",env); + m_rootTool->m_cutBinEta_TRT = AsgConfigHelper::HelperFloat("CutBinEta_TRT",env); + m_rootTool->m_cutBinET_TRT = AsgConfigHelper::HelperFloat("CutBinET_TRT",env); + m_rootTool->m_cutNumTRT = AsgConfigHelper::HelperFloat("CutNumTRT",env); + m_rootTool->m_cutTRTRatio = AsgConfigHelper::HelperFloat("CutTRTRatio", env); + m_rootTool->m_cutTRTRatio90 = AsgConfigHelper::HelperFloat("CutTRTRatio90", env); + m_rootTool->m_cutEProbabilityHT = AsgConfigHelper::HelperFloat("CutEProbabilityHT", env); } else { ATH_MSG_INFO("Conf file empty. Just user Input"); } - ATH_MSG_INFO("operating point : " << this->getOperatingPointName() << " with mask: "<< m_rootTool->isEMMask ); + ATH_MSG_INFO("operating point : " << this->getOperatingPointName() << " with mask: "<< m_rootTool->m_isEMMask ); // Get the message level and set the underlying ROOT tool message level accordingly m_rootTool->msg().setLevel(this->msg().level()); // We need to initialize the underlying ROOT TSelectorTool - if ( 0 == m_rootTool->initialize() ) + if ( m_rootTool->initialize().isFailure() ) { ATH_MSG_ERROR("Could not initialize the TElectronIsEMSelector!"); sc = StatusCode::FAILURE; @@ -273,26 +273,18 @@ StatusCode AsgElectronIsEMSelector::initialize() //============================================================================= -// finalize method (now called by destructor) +// return the accept info object //============================================================================= -StatusCode AsgElectronIsEMSelector::finalize() -{ - // The standard status code - StatusCode sc = StatusCode::SUCCESS ; - - if ( !(m_rootTool->finalize()) ) - { - ATH_MSG_ERROR("Something went wrong at finalize!"); - sc = StatusCode::FAILURE; - } - return sc ; +const asg::AcceptInfo& AsgElectronIsEMSelector::getAcceptInfo() const +{ + return m_rootTool->getAcceptInfo(); } //============================================================================= // The main accept method: the actual cuts are applied here //============================================================================= -const Root::TAccept& AsgElectronIsEMSelector::accept( const xAOD::IParticle* part ) const{ +asg::AcceptData AsgElectronIsEMSelector::accept( const xAOD::IParticle* part ) const{ ATH_MSG_DEBUG("Entering accept( const IParticle* part )"); if(part->type()==xAOD::Type::Electron || part->type()==xAOD::Type::Photon){ @@ -300,41 +292,38 @@ const Root::TAccept& AsgElectronIsEMSelector::accept( const xAOD::IParticle* par } else{ ATH_MSG_ERROR("AsgElectronIsEMSelector::could not convert argument to Electron/Photon"); - return m_acceptDummy; + return m_rootTool->accept(); } } -const Root::TAccept& AsgElectronIsEMSelector::accept( const xAOD::Egamma* eg ) const{ +asg::AcceptData AsgElectronIsEMSelector::accept( const xAOD::Egamma* eg ) const{ ATH_MSG_DEBUG("Entering accept( const Egamma* part )"); if ( eg ){ - StatusCode sc = execute(eg); + unsigned int isEM = ~0; + StatusCode sc = execute(eg, isEM); if (sc.isFailure()) { ATH_MSG_ERROR("could not calculate isEM"); - return m_acceptDummy; + return m_rootTool->accept(); } - return m_rootTool->fillAccept(); + return m_rootTool->fillAccept(isEM); } else{ ATH_MSG_ERROR("AsgElectronIsEMSelector::accept was given a bad argument"); - return m_acceptDummy; + return m_rootTool->accept(); } } -const Root::TAccept& AsgElectronIsEMSelector::accept( const xAOD::Electron* el) const{ +asg::AcceptData AsgElectronIsEMSelector::accept( const xAOD::Electron* el) const{ ATH_MSG_DEBUG("Entering accept( const Electron* part )"); return accept(static_cast<const xAOD::Egamma*> (el)); } -const Root::TAccept& AsgElectronIsEMSelector::accept( const xAOD::Photon* ph) const{ +asg::AcceptData AsgElectronIsEMSelector::accept( const xAOD::Photon* ph) const{ ATH_MSG_DEBUG("Entering accept( const Photon* part )"); return accept(static_cast<const xAOD::Egamma*> (ph)); } -unsigned int AsgElectronIsEMSelector::IsemValue() const { - return m_rootTool->isEM(); -} - //============================================================================= /// Get the name of the current operating point //============================================================================= @@ -343,18 +332,18 @@ std::string AsgElectronIsEMSelector::getOperatingPointName() const{ if(!m_WorkingPoint.empty()){ return m_WorkingPoint; } - else if (m_rootTool->isEMMask == egammaPID::ElectronLoosePP){ return "Loose"; } - else if (m_rootTool->isEMMask == egammaPID::ElectronMediumPP ){ return "Medium"; } - else if (m_rootTool->isEMMask == egammaPID::ElectronTightPP){ return "Tight"; } - else if (m_rootTool->isEMMask == egammaPID::ElectronLoose1){return "Loose1";} - else if (m_rootTool->isEMMask == egammaPID::ElectronMedium1){return "Medium1";} - else if (m_rootTool->isEMMask == egammaPID::ElectronTight1){return "Tight1";} - else if (m_rootTool->isEMMask == egammaPID::ElectronLooseHLT){return "LooseHLT";} - else if (m_rootTool->isEMMask == egammaPID::ElectronMediumHLT){return "MediumHLT";} - else if (m_rootTool->isEMMask == egammaPID::ElectronTightHLT){return "TightHLT";} - else if (m_rootTool->isEMMask == 0){ return "0 No cuts applied"; } + else if (m_rootTool->m_isEMMask == egammaPID::ElectronLoosePP){ return "Loose"; } + else if (m_rootTool->m_isEMMask == egammaPID::ElectronMediumPP ){ return "Medium"; } + else if (m_rootTool->m_isEMMask == egammaPID::ElectronTightPP){ return "Tight"; } + else if (m_rootTool->m_isEMMask == egammaPID::ElectronLoose1){return "Loose1";} + else if (m_rootTool->m_isEMMask == egammaPID::ElectronMedium1){return "Medium1";} + else if (m_rootTool->m_isEMMask == egammaPID::ElectronTight1){return "Tight1";} + else if (m_rootTool->m_isEMMask == egammaPID::ElectronLooseHLT){return "LooseHLT";} + else if (m_rootTool->m_isEMMask == egammaPID::ElectronMediumHLT){return "MediumHLT";} + else if (m_rootTool->m_isEMMask == egammaPID::ElectronTightHLT){return "TightHLT";} + else if (m_rootTool->m_isEMMask == 0){ return "0 No cuts applied"; } else{ - ATH_MSG_INFO( "Didn't recognize the given operating point with mask: " << m_rootTool->isEMMask ); + ATH_MSG_INFO( "Didn't recognize the given operating point with mask: " << m_rootTool->m_isEMMask ); return ""; } } @@ -362,19 +351,18 @@ std::string AsgElectronIsEMSelector::getOperatingPointName() const{ ///==========================================================================================// // ============================================================== -StatusCode AsgElectronIsEMSelector::execute(const xAOD::Egamma* eg ) const{ +StatusCode AsgElectronIsEMSelector::execute(const xAOD::Egamma* eg, unsigned int& isEM ) const{ // // Particle identification for electrons based on cuts // ATH_MSG_DEBUG("entering execute(const Egamma* eg...)"); // initialisation - unsigned int iflag = 0; + isEM = 0; // protection against null pointer if (eg==0) { // if object is bad then use the bit for "bad eta" ATH_MSG_ERROR("exiting because el is NULL"); - iflag = (0x1 << egammaPID::ClusterEtaRange_Electron); - m_rootTool->setIsEM(iflag); + isEM = (0x1 << egammaPID::ClusterEtaRange_Electron); return StatusCode::SUCCESS; } // retrieve associated cluster @@ -382,8 +370,7 @@ StatusCode AsgElectronIsEMSelector::execute(const xAOD::Egamma* eg ) const{ if ( cluster == 0 ) { // if object is bad then use the bit for "bad eta" ATH_MSG_ERROR("exiting because cluster is NULL"); - iflag = (0x1 << egammaPID::ClusterEtaRange_Electron); - m_rootTool->setIsEM(iflag); + isEM = (0x1 << egammaPID::ClusterEtaRange_Electron); return StatusCode::SUCCESS; } // eta position in second sampling @@ -404,14 +391,13 @@ StatusCode AsgElectronIsEMSelector::execute(const xAOD::Egamma* eg ) const{ } //Call the calocuts using the egamma object - iflag = calocuts_electrons(eg, eta2, et, m_trigEtTh, 0); + isEM = calocuts_electrons(eg, eta2, et, m_trigEtTh, 0); //Call the calo cuts using the el , if available and we want to apply them if(el && el->trackParticle() &&!m_caloOnly ){ - iflag = TrackCut(el, eta2, et, energy, iflag); + isEM = TrackCut(el, eta2, et, energy, isEM); } - m_rootTool->setIsEM(iflag); return StatusCode::SUCCESS; } @@ -578,8 +564,5 @@ unsigned int AsgElectronIsEMSelector::TrackCut(const xAOD::Electron* eg, iflag); } -const Root::TAccept& AsgElectronIsEMSelector::getTAccept( ) const{ - return m_rootTool->getTAccept(); -} // LocalWords: const el diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronLikelihoodTool.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronLikelihoodTool.cxx index 4899f34c6011bc3eea8af7912d048caf3fd23bcd..3aa416781311335782f36d39162584d3eb854ddb 100644 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronLikelihoodTool.cxx +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronLikelihoodTool.cxx @@ -66,71 +66,71 @@ AsgElectronLikelihoodTool::AsgElectronLikelihoodTool(std::string myname) : // pdf file name. Managed in the Asg tool. declareProperty("inputPDFFileName", m_pdfFileName="", "The input ROOT file name that holds the PDFs" ); // the variable names, if non-standard - nope, it's done above! - declareProperty("VariableNames",m_rootTool->VariableNames,"Variable names input to the LH"); + declareProperty("VariableNames",m_rootTool->m_variableNames,"Variable names input to the LH"); // The likelihood cut values - declareProperty("CutLikelihood",m_rootTool->CutLikelihood,"Cut on likelihood discriminant"); + declareProperty("CutLikelihood",m_rootTool->m_cutLikelihood,"Cut on likelihood discriminant"); // The pileup-correction part of the likelihood cut values - declareProperty("CutLikelihoodPileupCorrection",m_rootTool->CutLikelihoodPileupCorrection,"Pileup correction for LH discriminant"); + declareProperty("CutLikelihoodPileupCorrection",m_rootTool->m_cutLikelihoodPileupCorrection,"Pileup correction for LH discriminant"); // The likelihood cut values - 4 GeV - declareProperty("CutLikelihood4GeV",m_rootTool->CutLikelihood4GeV,"Cut on likelihood discriminant, 4 GeV special bin"); + declareProperty("CutLikelihood4GeV",m_rootTool->m_cutLikelihood4GeV,"Cut on likelihood discriminant, 4 GeV special bin"); // The pileup-correction part of the likelihood cut values - 4 GeV - declareProperty("CutLikelihoodPileupCorrection4GeV",m_rootTool->CutLikelihoodPileupCorrection4GeV,"Pileup correction for LH discriminant, 4 GeV special bin"); + declareProperty("CutLikelihoodPileupCorrection4GeV",m_rootTool->m_cutLikelihoodPileupCorrection4GeV,"Pileup correction for LH discriminant, 4 GeV special bin"); // do the conversion cut - declareProperty("doCutConversion",m_rootTool->doCutConversion,"Apply the conversion bit cut"); + declareProperty("doCutConversion",m_rootTool->m_doCutConversion,"Apply the conversion bit cut"); // do the ambiguity cut - declareProperty("CutAmbiguity" ,m_rootTool->CutAmbiguity ,"Apply a cut on the ambiguity bit"); + declareProperty("CutAmbiguity" ,m_rootTool->m_cutAmbiguity ,"Apply a cut on the ambiguity bit"); // cut on b-layer - declareProperty("CutBL",m_rootTool->CutBL,"Cut on b-layer"); + declareProperty("CutBL",m_rootTool->m_cutBL,"Cut on b-layer"); // cut on pixel hits - declareProperty("CutPi",m_rootTool->CutPi,"Cut on pixel hits"); + declareProperty("CutPi",m_rootTool->m_cutPi,"Cut on pixel hits"); // cut on d0 - declareProperty("CutA0",m_rootTool->CutA0,"Cut on d0"); + declareProperty("CutA0",m_rootTool->m_cutA0,"Cut on d0"); // cut on deltaEta - declareProperty("CutDeltaEta",m_rootTool->CutDeltaEta,"Cut on deltaEta"); + declareProperty("CutDeltaEta",m_rootTool->m_cutDeltaEta,"Cut on deltaEta"); // cut on deltaPhiRes - declareProperty("CutDeltaPhiRes",m_rootTool->CutDeltaPhiRes,"Cut on deltaPhiRes"); + declareProperty("CutDeltaPhiRes",m_rootTool->m_cutDeltaPhiRes,"Cut on deltaPhiRes"); // cut on precision hits - declareProperty("CutSi",m_rootTool->CutSi,"Cut on precision hits"); + declareProperty("CutSi",m_rootTool->m_cutSi,"Cut on precision hits"); // turn off f3 at high Et - declareProperty("doRemoveF3AtHighEt",m_rootTool->doRemoveF3AtHighEt,"Turn off f3 at high Et"); + declareProperty("doRemoveF3AtHighEt",m_rootTool->m_doRemoveF3AtHighEt,"Turn off f3 at high Et"); // turn off TRTPID at high Et - declareProperty("doRemoveTRTPIDAtHighEt",m_rootTool->doRemoveTRTPIDAtHighEt,"Turn off TRTPID at high Et"); + declareProperty("doRemoveTRTPIDAtHighEt",m_rootTool->m_doRemoveTRTPIDAtHighEt,"Turn off TRTPID at high Et"); // use smooth interpolation between LH bins - declareProperty("doSmoothBinInterpolation",m_rootTool->doSmoothBinInterpolation,"use smooth interpolation between LH bins"); + declareProperty("doSmoothBinInterpolation",m_rootTool->m_doSmoothBinInterpolation,"use smooth interpolation between LH bins"); // use binning for high ET LH - declareProperty("useHighETLHBinning",m_rootTool->useHighETLHBinning,"Use binning for high ET LH"); + declareProperty("useHighETLHBinning",m_rootTool->m_useHighETLHBinning,"Use binning for high ET LH"); // use one extra bin for high ET LH - declareProperty("useOneExtraHighETLHBin",m_rootTool->useOneExtraHighETLHBin,"Use one extra bin for high ET LH"); + declareProperty("useOneExtraHighETLHBin",m_rootTool->m_useOneExtraHighETLHBin,"Use one extra bin for high ET LH"); // cut on Wstot above HighETBinThreshold - declareProperty("CutWstotAtHighET",m_rootTool->CutWstotAtHighET,"Cut on Wstot above HighETBinThreshold"); + declareProperty("CutWstotAtHighET",m_rootTool->m_cutWstotAtHighET,"Cut on Wstot above HighETBinThreshold"); // cut on EoverP above HighETBinThreshold - declareProperty("CutEoverPAtHighET",m_rootTool->CutEoverPAtHighET,"Cut on EoverP above HighETBinThreshold"); + declareProperty("CutEoverPAtHighET",m_rootTool->m_cutEoverPAtHighET,"Cut on EoverP above HighETBinThreshold"); // ET threshold for using high ET cuts and bin - declareProperty("HighETBinThreshold",m_rootTool->HighETBinThreshold,"ET threshold for using high ET cuts and bin"); + declareProperty("HighETBinThreshold",m_rootTool->m_highETBinThreshold,"ET threshold for using high ET cuts and bin"); // do pileup-dependent transform on discriminant value - declareProperty("doPileupTransform",m_rootTool->doPileupTransform,"Do pileup-dependent transform on discriminant value"); + declareProperty("doPileupTransform",m_rootTool->m_doPileupTransform,"Do pileup-dependent transform on discriminant value"); // do centrality-dependent transform on discriminant value - declareProperty("doCentralityTransform",m_rootTool->doCentralityTransform,"Do centrality-dependent transform on discriminant value"); + declareProperty("doCentralityTransform",m_rootTool->m_doCentralityTransform,"Do centrality-dependent transform on discriminant value"); // reference disc for very hard cut; used by pileup transform - declareProperty("DiscHardCutForPileupTransform",m_rootTool->DiscHardCutForPileupTransform,"Reference disc for very hard cut; used by pileup transform"); + declareProperty("DiscHardCutForPileupTransform",m_rootTool->m_discHardCutForPileupTransform,"Reference disc for very hard cut; used by pileup transform"); // reference slope on disc for very hard cut; used by pileup transform - declareProperty("DiscHardCutSlopeForPileupTransform",m_rootTool->DiscHardCutSlopeForPileupTransform,"Reference slope on disc for very hard cut; used by pileup transform"); + declareProperty("DiscHardCutSlopeForPileupTransform",m_rootTool->m_discHardCutSlopeForPileupTransform,"Reference slope on disc for very hard cut; used by pileup transform"); // reference quadratic par on disc for very hard cut; used by centrality transform - declareProperty("DiscHardCutQuadForPileupTransform",m_rootTool->DiscHardCutQuadForPileupTransform,"Reference quadratic par on disc for very hard cut; used by centrality transform"); + declareProperty("DiscHardCutQuadForPileupTransform",m_rootTool->m_discHardCutQuadForPileupTransform,"Reference quadratic par on disc for very hard cut; used by centrality transform"); // reference disc for a pileup independent loose menu; used by pileup transform - declareProperty("DiscLooseForPileupTransform",m_rootTool->DiscLooseForPileupTransform,"Reference disc for pileup indepdendent loose menu; used by pileup transform"); + declareProperty("DiscLooseForPileupTransform",m_rootTool->m_discLooseForPileupTransform,"Reference disc for pileup indepdendent loose menu; used by pileup transform"); // reference disc for very hard cut; used by pileup transform - 4-7 GeV bin - declareProperty("DiscHardCutForPileupTransform4GeV",m_rootTool->DiscHardCutForPileupTransform4GeV,"Reference disc for very hard cut; used by pileup transform. 4-7 GeV bin"); + declareProperty("DiscHardCutForPileupTransform4GeV",m_rootTool->m_discHardCutForPileupTransform4GeV,"Reference disc for very hard cut; used by pileup transform. 4-7 GeV bin"); // reference slope on disc for very hard cut; used by pileup transform - 4-7 GeV bin - declareProperty("DiscHardCutSlopeForPileupTransform4GeV",m_rootTool->DiscHardCutSlopeForPileupTransform4GeV,"Reference slope on disc for very hard cut; used by pileup transform. 4-7 GeV bin"); + declareProperty("DiscHardCutSlopeForPileupTransform4GeV",m_rootTool->m_discHardCutSlopeForPileupTransform4GeV,"Reference slope on disc for very hard cut; used by pileup transform. 4-7 GeV bin"); // reference quadratic par on disc for very hard cut; used by centrality transform in 4-7 GeV bin - declareProperty("DiscHardCutQuadForPileupTransform4GeV",m_rootTool->DiscHardCutQuadForPileupTransform4GeV,"Reference quadratic par on disc for very hard cut; used by centrality transform in 4-7 GeV bin"); + declareProperty("DiscHardCutQuadForPileupTransform4GeV",m_rootTool->m_discHardCutQuadForPileupTransform4GeV,"Reference quadratic par on disc for very hard cut; used by centrality transform in 4-7 GeV bin"); // reference disc for a pileup independent loose menu; used by pileup transform - 4-7 GeV bin - declareProperty("DiscLooseForPileupTransform4GeV",m_rootTool->DiscLooseForPileupTransform4GeV,"Reference disc for pileup indepdendent loose menu; used by pileup transform. 4-7 GeV bin"); + declareProperty("DiscLooseForPileupTransform4GeV",m_rootTool->m_discLooseForPileupTransform4GeV,"Reference disc for pileup indepdendent loose menu; used by pileup transform. 4-7 GeV bin"); // max discriminant for which pileup transform is to be used - declareProperty("DiscMaxForPileupTransform",m_rootTool->DiscMaxForPileupTransform,"Max discriminant for which pileup transform is to be used"); + declareProperty("DiscMaxForPileupTransform",m_rootTool->m_discMaxForPileupTransform,"Max discriminant for which pileup transform is to be used"); // max nvtx or mu to be used in pileup transform - declareProperty("PileupMaxForPileupTransform",m_rootTool->PileupMaxForPileupTransform,"Max nvtx or mu to be used in pileup transform"); + declareProperty("PileupMaxForPileupTransform",m_rootTool->m_pileupMaxForPileupTransform,"Max nvtx or mu to be used in pileup transform"); // Flag to tell the tool if it is a calo-only LH declareProperty("caloOnly", m_caloOnly=false, "Flag to tell the tool if it is a calo-only LH"); } @@ -154,6 +154,8 @@ AsgElectronLikelihoodTool::~AsgElectronLikelihoodTool() StatusCode AsgElectronLikelihoodTool::initialize() { + ATH_MSG_INFO("initialize : WP " << m_WorkingPoint.size() << " " << m_configFile.size()); + std::string PDFfilename(""); //Default if(!m_WorkingPoint.empty()){ @@ -197,55 +199,55 @@ StatusCode AsgElectronLikelihoodTool::initialize() return StatusCode::FAILURE; } - m_rootTool->VariableNames = env.GetValue("VariableNames",""); - m_rootTool->CutLikelihood = AsgConfigHelper::HelperDouble("CutLikelihood",env); - m_rootTool->CutLikelihoodPileupCorrection = AsgConfigHelper::HelperDouble("CutLikelihoodPileupCorrection", env); - m_rootTool->CutLikelihood4GeV = AsgConfigHelper::HelperDouble("CutLikelihood4GeV",env); - m_rootTool->CutLikelihoodPileupCorrection4GeV = AsgConfigHelper::HelperDouble("CutLikelihoodPileupCorrection4GeV", env); + m_rootTool->m_variableNames = env.GetValue("VariableNames",""); + m_rootTool->m_cutLikelihood = AsgConfigHelper::HelperDouble("CutLikelihood",env); + m_rootTool->m_cutLikelihoodPileupCorrection = AsgConfigHelper::HelperDouble("CutLikelihoodPileupCorrection", env); + m_rootTool->m_cutLikelihood4GeV = AsgConfigHelper::HelperDouble("CutLikelihood4GeV",env); + m_rootTool->m_cutLikelihoodPileupCorrection4GeV = AsgConfigHelper::HelperDouble("CutLikelihoodPileupCorrection4GeV", env); // do the conversion cut - m_rootTool->doCutConversion = env.GetValue("doCutConversion", false); + m_rootTool->m_doCutConversion = env.GetValue("doCutConversion", false); // do the ambiguity cut - m_rootTool->CutAmbiguity = AsgConfigHelper::HelperInt("CutAmbiguity", env); + m_rootTool->m_cutAmbiguity = AsgConfigHelper::HelperInt("CutAmbiguity", env); // cut on b-layer - m_rootTool->CutBL = AsgConfigHelper::HelperInt("CutBL",env); + m_rootTool->m_cutBL = AsgConfigHelper::HelperInt("CutBL",env); // cut on pixel hits - m_rootTool->CutPi = AsgConfigHelper::HelperInt("CutPi", env); + m_rootTool->m_cutPi = AsgConfigHelper::HelperInt("CutPi", env); // cut on precision hits - m_rootTool->CutSi = AsgConfigHelper::HelperInt("CutSi", env); + m_rootTool->m_cutSi = AsgConfigHelper::HelperInt("CutSi", env); // cut on d0 - m_rootTool->CutA0 = AsgConfigHelper::HelperDouble("CutA0", env); + m_rootTool->m_cutA0 = AsgConfigHelper::HelperDouble("CutA0", env); // cut on deltaEta - m_rootTool->CutDeltaEta = AsgConfigHelper::HelperDouble("CutDeltaEta", env); + m_rootTool->m_cutDeltaEta = AsgConfigHelper::HelperDouble("CutDeltaEta", env); // cut on deltaPhiRes - m_rootTool->CutDeltaPhiRes = AsgConfigHelper::HelperDouble("CutDeltaPhiRes", env); + m_rootTool->m_cutDeltaPhiRes = AsgConfigHelper::HelperDouble("CutDeltaPhiRes", env); // turn off f3 at high Et - m_rootTool->doRemoveF3AtHighEt = env.GetValue("doRemoveF3AtHighEt", false); + m_rootTool->m_doRemoveF3AtHighEt = env.GetValue("doRemoveF3AtHighEt", false); // turn off TRTPID at high Et - m_rootTool->doRemoveTRTPIDAtHighEt = env.GetValue("doRemoveTRTPIDAtHighEt", false); + m_rootTool->m_doRemoveTRTPIDAtHighEt = env.GetValue("doRemoveTRTPIDAtHighEt", false); // do smooth interpolation between bins - m_rootTool->doSmoothBinInterpolation = env.GetValue("doSmoothBinInterpolation", false); + m_rootTool->m_doSmoothBinInterpolation = env.GetValue("doSmoothBinInterpolation", false); m_caloOnly = env.GetValue("caloOnly", false); - m_rootTool->useHighETLHBinning = env.GetValue("useHighETLHBinning", false); - m_rootTool->useOneExtraHighETLHBin = env.GetValue("useOneExtraHighETLHBin", false); + m_rootTool->m_useHighETLHBinning = env.GetValue("useHighETLHBinning", false); + m_rootTool->m_useOneExtraHighETLHBin = env.GetValue("useOneExtraHighETLHBin", false); // cut on Wstot above HighETBinThreshold - m_rootTool->CutWstotAtHighET = AsgConfigHelper::HelperDouble("CutWstotAtHighET", env); + m_rootTool->m_cutWstotAtHighET = AsgConfigHelper::HelperDouble("CutWstotAtHighET", env); // cut on EoverP above HighETBinThreshold - m_rootTool->CutEoverPAtHighET = AsgConfigHelper::HelperDouble("CutEoverPAtHighET", env); - m_rootTool->HighETBinThreshold = env.GetValue("HighETBinThreshold", 125); - - m_rootTool->doPileupTransform = env.GetValue("doPileupTransform", false); - m_rootTool->doCentralityTransform = env.GetValue("doCentralityTransform", false); - m_rootTool->DiscHardCutForPileupTransform = AsgConfigHelper::HelperDouble("DiscHardCutForPileupTransform",env); - m_rootTool->DiscHardCutSlopeForPileupTransform = AsgConfigHelper::HelperDouble("DiscHardCutSlopeForPileupTransform",env); - m_rootTool->DiscHardCutQuadForPileupTransform = AsgConfigHelper::HelperDouble("DiscHardCutQuadForPileupTransform",env); - m_rootTool->DiscLooseForPileupTransform = AsgConfigHelper::HelperDouble("DiscLooseForPileupTransform",env); - m_rootTool->DiscHardCutForPileupTransform4GeV = AsgConfigHelper::HelperDouble("DiscHardCutForPileupTransform4GeV",env); - m_rootTool->DiscHardCutSlopeForPileupTransform4GeV = AsgConfigHelper::HelperDouble("DiscHardCutSlopeForPileupTransform4GeV",env); - m_rootTool->DiscHardCutQuadForPileupTransform4GeV = AsgConfigHelper::HelperDouble("DiscHardCutQuadForPileupTransform4GeV",env); - m_rootTool->DiscLooseForPileupTransform4GeV = AsgConfigHelper::HelperDouble("DiscLooseForPileupTransform4GeV",env); - m_rootTool->DiscMaxForPileupTransform = env.GetValue("DiscMaxForPileupTransform", 2.0); - m_rootTool->PileupMaxForPileupTransform = env.GetValue("PileupMaxForPileupTransform", 50); + m_rootTool->m_cutEoverPAtHighET = AsgConfigHelper::HelperDouble("CutEoverPAtHighET", env); + m_rootTool->m_highETBinThreshold = env.GetValue("HighETBinThreshold", 125); + + m_rootTool->m_doPileupTransform = env.GetValue("doPileupTransform", false); + m_rootTool->m_doCentralityTransform = env.GetValue("doCentralityTransform", false); + m_rootTool->m_discHardCutForPileupTransform = AsgConfigHelper::HelperDouble("DiscHardCutForPileupTransform",env); + m_rootTool->m_discHardCutSlopeForPileupTransform = AsgConfigHelper::HelperDouble("DiscHardCutSlopeForPileupTransform",env); + m_rootTool->m_discHardCutQuadForPileupTransform = AsgConfigHelper::HelperDouble("DiscHardCutQuadForPileupTransform",env); + m_rootTool->m_discLooseForPileupTransform = AsgConfigHelper::HelperDouble("DiscLooseForPileupTransform",env); + m_rootTool->m_discHardCutForPileupTransform4GeV = AsgConfigHelper::HelperDouble("DiscHardCutForPileupTransform4GeV",env); + m_rootTool->m_discHardCutSlopeForPileupTransform4GeV = AsgConfigHelper::HelperDouble("DiscHardCutSlopeForPileupTransform4GeV",env); + m_rootTool->m_discHardCutQuadForPileupTransform4GeV = AsgConfigHelper::HelperDouble("DiscHardCutQuadForPileupTransform4GeV",env); + m_rootTool->m_discLooseForPileupTransform4GeV = AsgConfigHelper::HelperDouble("DiscLooseForPileupTransform4GeV",env); + m_rootTool->m_discMaxForPileupTransform = env.GetValue("DiscMaxForPileupTransform", 2.0); + m_rootTool->m_pileupMaxForPileupTransform = env.GetValue("PileupMaxForPileupTransform", 50); } else{ //Error if it cant find the conf @@ -262,16 +264,12 @@ StatusCode AsgElectronLikelihoodTool::initialize() m_rootTool->msg().setLevel(this->msg().level()); // We need to initialize the underlying ROOT TSelectorTool - if ( 0 == m_rootTool->initialize() ) + if ( m_rootTool->initialize().isFailure() ) { ATH_MSG_ERROR ( "ERROR! Could not initialize the TElectronLikelihoodTool!" ); return StatusCode::FAILURE; } - // Copy the now filled TAccept and TResult to the dummy - m_acceptDummy = m_rootTool->getTAccept(); - m_resultDummy = m_rootTool->getTResult(); - return StatusCode::SUCCESS ; } @@ -281,42 +279,45 @@ StatusCode AsgElectronLikelihoodTool::initialize() //============================================================================= StatusCode AsgElectronLikelihoodTool::finalize() { - if ( !(m_rootTool->finalize()) ) - { - ATH_MSG_ERROR ( "ERROR! Something went wrong at finalize!" ); - return StatusCode::FAILURE; - } - return StatusCode::SUCCESS; } +//============================================================================= +// return the accept info object +//============================================================================= + +const asg::AcceptInfo& AsgElectronLikelihoodTool::getAcceptInfo() const +{ + return m_rootTool->getAcceptInfo(); +} //============================================================================= // The main accept method: the actual cuts are applied here //============================================================================= -const Root::TAccept& AsgElectronLikelihoodTool::accept( const xAOD::Electron* eg, double mu ) const +asg::AcceptData AsgElectronLikelihoodTool::accept( const xAOD::Electron* eg, double mu ) const { if ( !eg ){ ATH_MSG_ERROR ("Failed, no egamma object."); - return m_acceptDummy; + return m_rootTool->accept(); } - const xAOD::CaloCluster* cluster = eg->caloCluster(); + const xAOD::CaloCluster* cluster = eg->caloCluster(); if ( !cluster ){ ATH_MSG_ERROR("exiting because cluster is NULL " << cluster); - return m_acceptDummy; + return m_rootTool->accept(); } if( !cluster->hasSampling(CaloSampling::CaloSample::EMB2) && !cluster->hasSampling(CaloSampling::CaloSample::EME2) ){ ATH_MSG_ERROR("Failed, cluster is missing samplings EMB2 and EME2"); - return m_acceptDummy; + return m_rootTool->accept(); } - const double energy = cluster->e(); - const float eta = (cluster->etaBE(2)); + const double energy = cluster->e(); + const float eta = (cluster->etaBE(2)); if( isForwardElectron(eg,eta) ){ - return m_acceptDummy; + ATH_MSG_WARNING("Failed, this is a forward electron! The AsgElectronLikelihoodTool is only suitable for central electrons!"); + return m_rootTool->accept(); } // transverse energy of the electron (using the track eta) @@ -348,7 +349,7 @@ const Root::TAccept& AsgElectronLikelihoodTool::accept( const xAOD::Electron* eg } // get the ambiguity type from the decoration - if ( m_rootTool->CutAmbiguity.size() ) { + if ( m_rootTool->m_cutAmbiguity.size() ) { if ( eg->isAvailable<uint8_t>("ambiguityType") ) { static const SG::AuxElement::Accessor<uint8_t> acc("ambiguityType"); ambiguityBit = acc(*eg); @@ -370,7 +371,7 @@ const Root::TAccept& AsgElectronLikelihoodTool::accept( const xAOD::Electron* eg } else { ATH_MSG_ERROR( "Failed, no track particle. et= " << et << "eta= " << eta ); - return m_acceptDummy; + return m_rootTool->accept(); } if( !eg->trackCaloMatchValue(deltaEta, xAOD::EgammaParameters::deltaEta1) ){ @@ -385,7 +386,7 @@ const Root::TAccept& AsgElectronLikelihoodTool::accept( const xAOD::Electron* eg } //if not calo ONly // Get the number of primary vertices or FCal ET in this event - bool doCentralityTransform = m_rootTool->doCentralityTransform; + bool doCentralityTransform = m_rootTool->m_doCentralityTransform; if( mu < 0 ){ // use npv if mu is negative (not given) if (doCentralityTransform) ip = static_cast<double>(m_useCaloSumsCont ? this->getFcalEt() : m_fcalEtDefault); else ip = static_cast<double>(m_usePVCont ? this->getNPrimVertices() : m_nPVdefault); @@ -406,7 +407,7 @@ const Root::TAccept& AsgElectronLikelihoodTool::accept( const xAOD::Electron* eg if (!allFound) { ATH_MSG_ERROR("Skipping LH rectangular cuts! The following variables are missing: " << notFoundList); - return m_acceptDummy; + return m_rootTool->accept(); } // Get the answer from the underlying ROOT tool @@ -430,11 +431,11 @@ const Root::TAccept& AsgElectronLikelihoodTool::accept( const xAOD::Electron* eg //============================================================================= // Accept method for EFCaloLH in the trigger; do full LH if !CaloCutsOnly //============================================================================= -const Root::TAccept& AsgElectronLikelihoodTool::accept( const xAOD::Egamma* eg, double mu) const +asg::AcceptData AsgElectronLikelihoodTool::accept( const xAOD::Egamma* eg, double mu) const { if ( !eg ){ ATH_MSG_ERROR ("Failed, no egamma object."); - return m_acceptDummy; + return m_rootTool->accept(); } // Call the main accept if this is not a calo-only LH @@ -443,22 +444,24 @@ const Root::TAccept& AsgElectronLikelihoodTool::accept( const xAOD::Egamma* eg, return accept(el, mu); } + const xAOD::CaloCluster* cluster = eg->caloCluster(); if ( !cluster ){ ATH_MSG_ERROR ("Failed, no cluster."); - return m_acceptDummy; + return m_rootTool->accept(); } if( !cluster->hasSampling(CaloSampling::CaloSample::EMB2) && !cluster->hasSampling(CaloSampling::CaloSample::EME2) ){ ATH_MSG_ERROR("Failed, cluster is missing samplings EMB2 and EME2"); - return m_acceptDummy; + return m_rootTool->accept(); } const double energy = cluster->e(); const float eta = (cluster->etaBE(2)); if( isForwardElectron(eg,eta) ){ - return m_acceptDummy; + ATH_MSG_WARNING("Failed, this is a forward electron! The AsgElectronLikelihoodTool is only suitable for central electrons!"); + return m_rootTool->accept(); } const double et = ( cosh(eta) != 0.) ? energy/cosh(eta) : 0.; @@ -473,7 +476,7 @@ const Root::TAccept& AsgElectronLikelihoodTool::accept( const xAOD::Egamma* eg, // Get the pileup or centrality information double ip(0); - bool doCentralityTransform = m_rootTool->doCentralityTransform; + bool doCentralityTransform = m_rootTool->m_doCentralityTransform; if( mu < 0 ){ // use npv if mu is negative (not given) if (doCentralityTransform) ip = static_cast<double>(m_useCaloSumsCont ? this->getFcalEt() : m_fcalEtDefault); else ip = static_cast<double>(m_usePVCont ? this->getNPrimVertices() : m_nPVdefault); @@ -506,7 +509,7 @@ const Root::TAccept& AsgElectronLikelihoodTool::accept( const xAOD::Egamma* eg, if (!allFound) { ATH_MSG_ERROR("Skipping LH rectangular cuts! The following variables are missing: " << notFoundList); - return m_acceptDummy; + return m_rootTool->accept(); } // Get the answer from the underlying ROOT tool @@ -534,29 +537,30 @@ const Root::TAccept& AsgElectronLikelihoodTool::accept( const xAOD::Egamma* eg, //============================================================================= // The main result method: the actual likelihood is calculated here //============================================================================= -const Root::TResult& AsgElectronLikelihoodTool::calculate( const xAOD::Electron* eg, double mu ) const +double AsgElectronLikelihoodTool::calculate( const xAOD::Electron* eg, double mu ) const { if ( !eg ){ ATH_MSG_ERROR ("Failed, no egamma object."); - return m_resultDummy; + return -999; } - const xAOD::CaloCluster* cluster = eg->caloCluster(); + const xAOD::CaloCluster* cluster = eg->caloCluster(); if ( !cluster ){ ATH_MSG_ERROR ("Failed, no cluster."); - return m_resultDummy; + return -999; } if( !cluster->hasSampling(CaloSampling::CaloSample::EMB2) && !cluster->hasSampling(CaloSampling::CaloSample::EME2) ){ ATH_MSG_ERROR("Failed, cluster is missing samplings EMB2 and EME2"); - return m_resultDummy; + return -999; } const double energy = cluster->e(); const float eta = cluster->etaBE(2); if( isForwardElectron(eg,eta) ){ - return m_resultDummy; + ATH_MSG_WARNING("Failed, this is a forward electron! The AsgElectronLikelihoodTool is only suitable for central electrons!"); + return -999; } //double et = cluster->e()/cosh(eta); @@ -625,7 +629,7 @@ const Root::TResult& AsgElectronLikelihoodTool::calculate( const xAOD::Electron* else { ATH_MSG_ERROR( "Failed, no track particle. et= " << et << "eta= " << eta ); - return m_resultDummy; + return -999; } } // if not calo Only @@ -689,7 +693,7 @@ const Root::TResult& AsgElectronLikelihoodTool::calculate( const xAOD::Electron* // Get the number of primary vertices or FCal ET in this event double ip = static_cast<double>(m_nPVdefault); - bool doCentralityTransform = m_rootTool->doCentralityTransform; + bool doCentralityTransform = m_rootTool->m_doCentralityTransform; if( mu < 0 ){ // use npv if mu is negative (not given) if (doCentralityTransform) ip = static_cast<double>(m_useCaloSumsCont ? this->getFcalEt() : m_fcalEtDefault); else ip = static_cast<double>(m_usePVCont ? this->getNPrimVertices() : m_nPVdefault); @@ -709,7 +713,7 @@ const Root::TResult& AsgElectronLikelihoodTool::calculate( const xAOD::Electron* if (!allFound) { ATH_MSG_ERROR("Skipping LH calculation! The following variables are missing: " << notFoundList); - return m_resultDummy; + return -999; } // Get the answer from the underlying ROOT tool @@ -736,11 +740,11 @@ const Root::TResult& AsgElectronLikelihoodTool::calculate( const xAOD::Electron* //============================================================================= // Calculate method for EFCaloLH in the trigger; do full LH if !CaloCutsOnly //============================================================================= -const Root::TResult& AsgElectronLikelihoodTool::calculate( const xAOD::Egamma* eg, double mu ) const +double AsgElectronLikelihoodTool::calculate( const xAOD::Egamma* eg, double mu ) const { if ( !eg ){ ATH_MSG_ERROR ("Failed, no egamma object."); - return m_resultDummy; + return -999; } if( !m_caloOnly ){ @@ -748,22 +752,23 @@ const Root::TResult& AsgElectronLikelihoodTool::calculate( const xAOD::Egamma* e return calculate(el, mu); } - const xAOD::CaloCluster* cluster = eg->caloCluster(); + const xAOD::CaloCluster* cluster = eg->caloCluster(); if ( !cluster ){ ATH_MSG_ERROR ("Failed, no cluster."); - return m_resultDummy; + return -999; } if( !cluster->hasSampling(CaloSampling::CaloSample::EMB2) && !cluster->hasSampling(CaloSampling::CaloSample::EME2) ){ ATH_MSG_ERROR("Failed, cluster is missing samplings EMB2 and EME2"); - return m_resultDummy; + return -999; } const double energy = cluster->e(); const float eta = cluster->etaBE(2); if( isForwardElectron(eg,eta) ){ - return m_resultDummy; + ATH_MSG_WARNING("Failed, this is a forward electron! The AsgElectronLikelihoodTool is only suitable for central electrons!"); + return -999; } const double et = ( cosh(eta) != 0.) ? energy/cosh(eta) : 0.; @@ -826,7 +831,7 @@ const Root::TResult& AsgElectronLikelihoodTool::calculate( const xAOD::Egamma* e // Get the pileup or centrality information double ip(0); - bool doCentralityTransform = m_rootTool->doCentralityTransform; + bool doCentralityTransform = m_rootTool->m_doCentralityTransform; if( mu < 0 ){ // use npv if mu is negative (not given) if (doCentralityTransform) ip = static_cast<double>(m_useCaloSumsCont ? this->getFcalEt() : m_fcalEtDefault); else ip = static_cast<double>(m_usePVCont ? this->getNPrimVertices() : m_nPVdefault); @@ -846,7 +851,7 @@ const Root::TResult& AsgElectronLikelihoodTool::calculate( const xAOD::Egamma* e if (!allFound) { ATH_MSG_ERROR("Skipping LH calculation! The following variables are missing: " << notFoundList); - return m_resultDummy; + return -999; } // Get the answer from the underlying ROOT tool @@ -870,16 +875,6 @@ const Root::TResult& AsgElectronLikelihoodTool::calculate( const xAOD::Egamma* e ); } -/** Method to get the plain TAccept */ -const Root::TAccept& AsgElectronLikelihoodTool::getTAccept( ) const{ - return m_rootTool->getTAccept(); -} - -/** Method to get the plain TResult */ -const Root::TResult& AsgElectronLikelihoodTool::getTResult( ) const{ - return m_rootTool->getTResult(); -} - //============================================================================= /// Get the name of the current operating point @@ -889,32 +884,29 @@ std::string AsgElectronLikelihoodTool::getOperatingPointName() const return m_WorkingPoint; } //============================================================================= -const Root::TAccept& AsgElectronLikelihoodTool::accept(const xAOD::IParticle* part) const +asg::AcceptData AsgElectronLikelihoodTool::accept(const xAOD::IParticle* part) const { ATH_MSG_DEBUG("Entering accept( const IParticle* part )"); const xAOD::Electron* eg = dynamic_cast<const xAOD::Electron*>(part); - if(eg) - { + if(eg) { return accept(eg); - } - else{ + } + else { ATH_MSG_ERROR("AsgElectronLikelihoodTool::could not cast to const Electron"); - return m_acceptDummy; + return m_rootTool->accept(); } } -const Root::TResult& AsgElectronLikelihoodTool::calculate(const xAOD::IParticle* part) const +double AsgElectronLikelihoodTool::calculate(const xAOD::IParticle* part) const { const xAOD::Electron* eg = dynamic_cast<const xAOD::Electron*>(part); - if (eg) - { + if (eg) { return calculate(eg); - } - else - { + } + else { ATH_MSG_ERROR ( " Could not cast to const Electron " ); - return m_resultDummy; - } + return -999; + } } diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronMultiLeptonSelector.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronMultiLeptonSelector.cxx index 7412ecc015884023fc57d902d6297903dfbd598c..7174322c0bfb954496cc2cd7950682919c619281 100644 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronMultiLeptonSelector.cxx +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgElectronMultiLeptonSelector.cxx @@ -54,62 +54,67 @@ AsgElectronMultiLeptonSelector::~AsgElectronMultiLeptonSelector() //============================================================================= StatusCode AsgElectronMultiLeptonSelector::initialize() { - // We need to initialize the underlying ROOT TSelectorTool + + ATH_MSG_INFO ("Initialize "); + + + // We need to initialize the underlying ROOT TSelectorTool m_rootTool->msg().setLevel(this->msg().level()); - if ( 0 == m_rootTool->initialize() ) + if ( m_rootTool->initialize().isFailure() ) { ATH_MSG_ERROR ( "ERROR! Could not initialize the TElectronMultiLeptonSelector!" ); return StatusCode::FAILURE; } - // Copy the now filled TAccept to the dummy - m_acceptDummy = m_rootTool->getTAccept(); - + ATH_MSG_INFO ("Initialize end "); + return StatusCode::SUCCESS ; } //============================================================================= -// Asgena finalize method (now called by destructor) +// finalize method (now called by destructor) //============================================================================= StatusCode AsgElectronMultiLeptonSelector::finalize() { - if ( !(m_rootTool->finalize()) ) - { - ATH_MSG_ERROR ( "ERROR! Something went wrong at finalize!" ); - return StatusCode::FAILURE; - } - return StatusCode::SUCCESS; } +//============================================================================= +// return the accept info object +//============================================================================= + +const asg::AcceptInfo& AsgElectronMultiLeptonSelector::getAcceptInfo() const +{ + return m_rootTool->getAcceptInfo(); +} //============================================================================= // The main accept method: the actual cuts are applied here //============================================================================= -const Root::TAccept& AsgElectronMultiLeptonSelector::accept( const xAOD::Electron* eg ) const +asg::AcceptData AsgElectronMultiLeptonSelector::accept( const xAOD::Electron* eg ) const { if ( !eg ) { ATH_MSG_DEBUG ("Failed, no egamma object."); - return m_acceptDummy; + return m_rootTool->accept(); } const xAOD::CaloCluster* cluster = eg->caloCluster(); if ( !cluster ) { ATH_MSG_DEBUG ("Failed, no cluster."); - return m_acceptDummy; + return m_rootTool->accept(); } float eta = fabsf(cluster->etaBE(2)); if ( eta > 100.0 ) { ATH_MSG_DEBUG ("Failed, eta range."); - return m_acceptDummy; + return m_rootTool->accept(); } // transverse energy of the electron (using the track eta) @@ -203,7 +208,7 @@ const Root::TAccept& AsgElectronMultiLeptonSelector::accept( const xAOD::Electro if (!allFound) { // if object is bad then use the bit for "bad eta" ATH_MSG_WARNING("Have some variables missing."); - return m_acceptDummy; + return m_rootTool->accept(); } // Get the answer from the underlying ROOT tool @@ -221,7 +226,7 @@ const Root::TAccept& AsgElectronMultiLeptonSelector::accept( const xAOD::Electro } -const Root::TAccept& AsgElectronMultiLeptonSelector::accept(const xAOD::IParticle* part) const +asg::AcceptData AsgElectronMultiLeptonSelector::accept(const xAOD::IParticle* part) const { ATH_MSG_DEBUG("Entering accept( const IParticle* part )"); if(part->type()==xAOD::Type::Electron){ @@ -230,7 +235,7 @@ const Root::TAccept& AsgElectronMultiLeptonSelector::accept(const xAOD::IParticl } else{ ATH_MSG_ERROR("AsgElectronMultiLeptonSelector::could not convert argument to accept"); - return m_acceptDummy; + return m_rootTool->accept(); } } @@ -240,7 +245,3 @@ const Root::TAccept& AsgElectronMultiLeptonSelector::accept(const xAOD::IParticl std::string AsgElectronMultiLeptonSelector::getOperatingPointName() const{ return "MultiLepton"; } - -const Root::TAccept& AsgElectronMultiLeptonSelector::getTAccept( ) const{ - return m_rootTool->getTAccept(); -} diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgForwardElectronIsEMSelector.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgForwardElectronIsEMSelector.cxx index 96516c7027c79a79ce396e2ab1d6c8a18ae2958b..07f6cfb9a5bf13935f45c3fa997adb734972c220 100644 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgForwardElectronIsEMSelector.cxx +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgForwardElectronIsEMSelector.cxx @@ -44,31 +44,31 @@ AsgForwardElectronIsEMSelector::AsgForwardElectronIsEMSelector(std::string mynam // Name of the quality to use declareProperty("isEMMask", - m_rootForwardTool->isEMMask=egammaPID::EgPidUndefined, //All pass by default, if not specified + m_rootForwardTool->m_isEMMask=egammaPID::EgPidUndefined, //All pass by default, if not specified "The mask to use"); // Eta binning - declareProperty("CutBinEta_ForwardElectron",m_rootForwardTool->CutBinEta_ForwardElectron, + declareProperty("CutBinEta_ForwardElectron", m_rootForwardTool->m_cutBinEta_ForwardElectron, "Eta binning"); // NPV binning - declareProperty("CutVxp_ForwardElectron",m_rootForwardTool->CutVxp_ForwardElectron, + declareProperty("CutVxp_ForwardElectron", m_rootForwardTool->m_cutVxp_ForwardElectron, "nvtx binning"); // Cut on lateral shower shape - declareProperty("CutLATERAL_ForwardElectron",m_rootForwardTool->CutLATERAL_ForwardElectron, + declareProperty("CutLATERAL_ForwardElectron", m_rootForwardTool->m_cutLATERAL_ForwardElectron, "Cut on lateral shower shape in 2nd sampling"); // Cut on secondLambda - declareProperty("CutSECONDLAMBDA_ForwardElectron",m_rootForwardTool->CutSECONDLAMBDA_ForwardElectron, + declareProperty("CutSECONDLAMBDA_ForwardElectron", m_rootForwardTool->m_cutSECONDLAMBDA_ForwardElectron, "Cut on secondLambda"); // Cut on longitudinal - declareProperty("CutLONGITUDINAL_ForwardElectron",m_rootForwardTool->CutLONGITUDINAL_ForwardElectron, + declareProperty("CutLONGITUDINAL_ForwardElectron", m_rootForwardTool->m_cutLONGITUDINAL_ForwardElectron, "Cut on longitudinal"); // Cut on fracMax - declareProperty("CutCELLMAXFRAC_ForwardElectron",m_rootForwardTool->CutCELLMAXFRAC_ForwardElectron, + declareProperty("CutCELLMAXFRAC_ForwardElectron", m_rootForwardTool->m_cutCELLMAXFRAC_ForwardElectron, "Cut on fracMax"); // Cut on centerlambda - declareProperty("CutCENTERLAMBDA_ForwardElectron",m_rootForwardTool->CutCENTERLAMBDA_ForwardElectron, + declareProperty("CutCENTERLAMBDA_ForwardElectron", m_rootForwardTool->m_cutCENTERLAMBDA_ForwardElectron, "Cut on centerlambda"); // Cut on secondR - declareProperty("CutSECONDR_ForwardElectron",m_rootForwardTool->CutSECONDR_ForwardElectron , + declareProperty("CutSECONDR_ForwardElectron", m_rootForwardTool->m_cutSECONDR_ForwardElectron , "Cut on secondR)"); } @@ -78,9 +78,6 @@ AsgForwardElectronIsEMSelector::AsgForwardElectronIsEMSelector(std::string mynam //============================================================================= AsgForwardElectronIsEMSelector::~AsgForwardElectronIsEMSelector() { - if(finalize().isFailure()){ - ATH_MSG_ERROR ( "Failure in AsgForwardElectronIsEMSelector finalize()"); - } delete m_rootForwardTool; } @@ -108,31 +105,31 @@ StatusCode AsgForwardElectronIsEMSelector::initialize() ///------- Read in the TEnv config ------/// //Override the mask via the config only if it is not set - if(m_rootForwardTool->isEMMask==egammaPID::EgPidUndefined){ + if(m_rootForwardTool->m_isEMMask==egammaPID::EgPidUndefined){ unsigned int mask(env.GetValue("isEMMask",static_cast<int>(egammaPID::EgPidUndefined))); - m_rootForwardTool->isEMMask=mask; + m_rootForwardTool->m_isEMMask=mask; } // ATH_MSG_DEBUG("Read in the TEnv config "); ///------- Use helpers to read in the cut arrays ------/// - m_rootForwardTool->CutBinEta_ForwardElectron =AsgConfigHelper::HelperFloat("CutBinEta_ForwardElectron",env); - m_rootForwardTool->CutVxp_ForwardElectron = AsgConfigHelper::HelperFloat("CutVxp_ForwardElectron",env); - m_rootForwardTool->CutSECONDLAMBDA_ForwardElectron = AsgConfigHelper::HelperFloat("CutSECONDLAMBDA_ForwardElectron",env); - m_rootForwardTool->CutLATERAL_ForwardElectron = AsgConfigHelper::HelperFloat("CutLATERAL_ForwardElectron",env); - m_rootForwardTool->CutLONGITUDINAL_ForwardElectron = AsgConfigHelper::HelperFloat("CutLONGITUDINAL_ForwardElectron",env); - m_rootForwardTool->CutCELLMAXFRAC_ForwardElectron = AsgConfigHelper::HelperFloat("CutCELLMAXFRAC_ForwardElectron",env); - m_rootForwardTool->CutCENTERLAMBDA_ForwardElectron = AsgConfigHelper::HelperFloat("CutCENTERLAMBDA_ForwardElectron",env); - m_rootForwardTool->CutSECONDR_ForwardElectron = AsgConfigHelper::HelperFloat("CutSECONDR_ForwardElectron",env); + m_rootForwardTool->m_cutBinEta_ForwardElectron = AsgConfigHelper::HelperFloat("CutBinEta_ForwardElectron",env); + m_rootForwardTool->m_cutVxp_ForwardElectron = AsgConfigHelper::HelperFloat("CutVxp_ForwardElectron",env); + m_rootForwardTool->m_cutSECONDLAMBDA_ForwardElectron = AsgConfigHelper::HelperFloat("CutSECONDLAMBDA_ForwardElectron",env); + m_rootForwardTool->m_cutLATERAL_ForwardElectron = AsgConfigHelper::HelperFloat("CutLATERAL_ForwardElectron",env); + m_rootForwardTool->m_cutLONGITUDINAL_ForwardElectron = AsgConfigHelper::HelperFloat("CutLONGITUDINAL_ForwardElectron",env); + m_rootForwardTool->m_cutCELLMAXFRAC_ForwardElectron = AsgConfigHelper::HelperFloat("CutCELLMAXFRAC_ForwardElectron",env); + m_rootForwardTool->m_cutCENTERLAMBDA_ForwardElectron = AsgConfigHelper::HelperFloat("CutCENTERLAMBDA_ForwardElectron",env); + m_rootForwardTool->m_cutSECONDR_ForwardElectron = AsgConfigHelper::HelperFloat("CutSECONDR_ForwardElectron", env); } else { ATH_MSG_INFO("Conf file empty. Just user Input"); } - ATH_MSG_INFO("operating point : " << this->getOperatingPointName() << " with mask: "<< m_rootForwardTool->isEMMask ); + ATH_MSG_INFO("operating point : " << this->getOperatingPointName() << " with mask: "<< m_rootForwardTool->m_isEMMask ); // Get the message level and set the underlying ROOT tool message level accordingly m_rootForwardTool->msg().setLevel(this->msg().level()); // We need to initialize the underlying ROOT TSelectorTool - if ( 0 == m_rootForwardTool->initialize() ) + if ( m_rootForwardTool->initialize().isFailure() ) { ATH_MSG_ERROR("Could not initialize the TForwardElectronIsEMSelector!"); sc = StatusCode::FAILURE; @@ -151,19 +148,23 @@ StatusCode AsgForwardElectronIsEMSelector::finalize() // The standard status code StatusCode sc = StatusCode::SUCCESS ; - if ( !(m_rootForwardTool->finalize()) ) - { - ATH_MSG_ERROR("Something went wrong at finalize!"); - sc = StatusCode::FAILURE; - } - return sc ; } +//============================================================================= +// return the accept info object +//============================================================================= + +const asg::AcceptInfo& AsgForwardElectronIsEMSelector::getAcceptInfo() const +{ + return m_rootForwardTool->getAcceptInfo(); +} + //============================================================================= // The main accept method: the actual cuts are applied here //============================================================================= -const Root::TAccept& AsgForwardElectronIsEMSelector::accept( const xAOD::IParticle* part ) const{ +asg::AcceptData +AsgForwardElectronIsEMSelector::accept( const xAOD::IParticle* part ) const{ ATH_MSG_DEBUG("Entering accept( const IParticle* part )"); if(part->type()==xAOD::Type::Electron || part->type()==xAOD::Type::Photon){ @@ -171,52 +172,50 @@ const Root::TAccept& AsgForwardElectronIsEMSelector::accept( const xAOD::IPartic } else{ ATH_MSG_ERROR("AsgForwardElectronIsEMSelector::could not convert argument to Electron/Photon"); - return m_acceptDummy; + return m_rootForwardTool->accept(); } } -const Root::TAccept& AsgForwardElectronIsEMSelector::accept( const xAOD::Egamma* eg ) const{ +asg::AcceptData +AsgForwardElectronIsEMSelector::accept( const xAOD::Egamma* eg ) const{ ATH_MSG_DEBUG("Entering accept( const Egamma* part )"); if ( eg ){ - StatusCode sc = execute(eg); + unsigned int isEM = ~0; + StatusCode sc = execute(eg, isEM); if (sc.isFailure()) { ATH_MSG_ERROR("could not calculate isEM"); - return m_acceptDummy; + return m_rootForwardTool->accept(); } - return m_rootForwardTool->fillAccept(); + return m_rootForwardTool->fillAccept(isEM); } else{ ATH_MSG_ERROR("AsgForwardElectronIsEMSelector::accept was given a bad argument"); - return m_acceptDummy; + return m_rootForwardTool->accept(); } } -const Root::TAccept& AsgForwardElectronIsEMSelector::accept( const xAOD::Electron* el) const{ +asg::AcceptData +AsgForwardElectronIsEMSelector::accept( const xAOD::Electron* el) const{ ATH_MSG_DEBUG("Entering accept( const Electron* part )"); - //ATH_MSG_DEBUG(" Resultado "<<accept(static_cast<const xAOD::Egamma*> (el))); return accept(static_cast<const xAOD::Egamma*> (el)); } -const Root::TAccept& AsgForwardElectronIsEMSelector::accept( const xAOD::Photon* ph) const{ +asg::AcceptData +AsgForwardElectronIsEMSelector::accept( const xAOD::Photon* ph) const{ ATH_MSG_DEBUG("Entering accept( const Photon* part )"); return accept(static_cast<const xAOD::Egamma*> (ph)); } -/** The value of the isem **/ -unsigned int AsgForwardElectronIsEMSelector::IsemValue() const { - return m_rootForwardTool->isEM(); -} - //============================================================================= /// Get the name of the current operating point //============================================================================= std::string AsgForwardElectronIsEMSelector::getOperatingPointName() const { - if (m_rootForwardTool->isEMMask == egammaPID::ID_ForwardElectron){ return "Forw Id"; } + if (m_rootForwardTool->m_isEMMask == egammaPID::ID_ForwardElectron){ return "Forw Id"; } else{ - ATH_MSG_INFO( "Didn't recognize the given operating point with mask: " << m_rootForwardTool->isEMMask ); + ATH_MSG_INFO( "Didn't recognize the given operating point with mask: " << m_rootForwardTool->m_isEMMask ); return ""; } } @@ -224,19 +223,18 @@ std::string AsgForwardElectronIsEMSelector::getOperatingPointName() const ///==========================================================================================// // ============================================================== -StatusCode AsgForwardElectronIsEMSelector::execute(const xAOD::Egamma* eg ) const{ +StatusCode AsgForwardElectronIsEMSelector::execute(const xAOD::Egamma* eg, unsigned int& isEM) const{ // // Particle identification for electrons based on cuts // ATH_MSG_DEBUG("entering execute(const Egamma* eg...)"); // initialisation - unsigned int iflag = 0; + isEM = 0; // protection against null pointer if (eg==0) { // if object is bad then use the bit for "bad eta" ATH_MSG_DEBUG("exiting because el is NULL"); - iflag = (0x1 << egammaPID::BinEta_ForwardElectron); - m_rootForwardTool->setIsEM(iflag); + isEM = (0x1 << egammaPID::BinEta_ForwardElectron); return StatusCode::SUCCESS; } @@ -245,8 +243,7 @@ StatusCode AsgForwardElectronIsEMSelector::execute(const xAOD::Egamma* eg ) cons if ( cluster == 0 ) { // if object is bad then use the bit for "bad eta" ATH_MSG_DEBUG("exiting because cluster is NULL"); - iflag = (0x1 << egammaPID::BinEta_ForwardElectron); - m_rootForwardTool->setIsEM(iflag); + isEM = (0x1 << egammaPID::BinEta_ForwardElectron); return StatusCode::SUCCESS; } @@ -264,10 +261,8 @@ StatusCode AsgForwardElectronIsEMSelector::execute(const xAOD::Egamma* eg ) cons eta = fabs(el->eta()); } //Call the calocuts using the egamma object - iflag = calocuts_electrons(eg, eta, nvtx, 0); + isEM = calocuts_electrons(eg, eta, nvtx, 0); - m_rootForwardTool->setIsEM(iflag); - //m_rootForwardTool->fillAccept(); return StatusCode::SUCCESS; } @@ -323,10 +318,6 @@ unsigned int AsgForwardElectronIsEMSelector::calocuts_electrons(const xAOD::Egam iflag); } -const Root::TAccept& AsgForwardElectronIsEMSelector::getTAccept( ) const{ - return m_rootForwardTool->getTAccept(); -} - //============================================================================= //// Helper method to get the number of primary vertices //// ( This is horrible! We don't want to iterate over all vertices in the event for each electron!!! diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgPhotonIsEMSelector.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgPhotonIsEMSelector.cxx index d85b91c791101ebbc312b417e08f952ca3f9daa8..e17388c21536a87c82d8cdccd34e69214236af46 100755 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgPhotonIsEMSelector.cxx +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/AsgPhotonIsEMSelector.cxx @@ -41,17 +41,17 @@ AsgPhotonIsEMSelector::AsgPhotonIsEMSelector(std::string myname) : // Name of the PID declareProperty("isEMMask", - m_rootTool->isEMMask=egammaPID::EgPidUndefined, //All pass by default, if not specified + m_rootTool->m_isEMMask=egammaPID::EgPidUndefined, //All pass by default, if not specified "The mask to use"); // boolean to force to test converted photon hypothesis declareProperty("ForceConvertedPhotonPID", - m_rootTool->forceConvertedPhotonPID=false, + m_rootTool->m_forceConvertedPhotonPID=false, "boolean to force to test converted photon hypothesis"); // boolean to force to test non converted photon hypothesis declareProperty("ForceNonConvertedPhotonPID", - m_rootTool->forceNonConvertedPhotonPID=false, + m_rootTool->m_forceNonConvertedPhotonPID=false, "boolean to force to test non converted photon hypothesis"); // new cuts on f3 @@ -59,78 +59,78 @@ AsgPhotonIsEMSelector::AsgPhotonIsEMSelector(std::string myname) : declareProperty("useF3core", m_useF3core = false, "Cut on f3 or f3core?"); // Cut on fraction of energy to use 3rd sampling - declareProperty("CutF3_photonsNonConverted",m_rootTool->CutF3_photonsNonConverted, + declareProperty("CutF3_photonsNonConverted",m_rootTool->m_cutF3_photonsNonConverted, "Cut on fraction of energy to use 3rd sampling (f3 or f3core) for unconverted"); // Cut on fraction of energy to use 3rd sampling - declareProperty("CutF3_photonsConverted",m_rootTool->CutF3_photonsConverted, + declareProperty("CutF3_photonsConverted",m_rootTool->m_cutF3_photonsConverted, "Cut on fraction of energy to use 3rd sampling (f3 or f3core) for converted"); // // selection for non-converted photons // // Eta binning declareProperty("CutBinEta_photonsNonConverted", - m_rootTool->CutBinEta_photonsNonConverted, + m_rootTool->m_cutBinEta_photonsNonConverted, "Eta binning for non converted photons"); // ET binning declareProperty("CutBinEnergy_photonsNonConverted", - m_rootTool->CutBinEnergy_photonsNonConverted, + m_rootTool->m_cutBinEnergy_photonsNonConverted, "E binning for photonsNonConverted"); // Cut on hadronic leakage declareProperty("CutHadLeakage_photonsNonConverted", - m_rootTool->CutHadLeakage_photonsNonConverted, + m_rootTool->m_cutHadLeakage_photonsNonConverted, "Cut on hadronic leakage for non converted photons"); // Cut on E277 declareProperty("e277_photonsNonConverted", - m_rootTool->e277_photonsNonConverted, + m_rootTool->m_e277_photonsNonConverted, "Cut on E277 for non converted photons"); // Cut on Reta37 declareProperty("Reta37_photonsNonConverted", - m_rootTool->Reta37_photonsNonConverted, + m_rootTool->m_Reta37_photonsNonConverted, "Cut on Reta37 for non converted photons"); // Cut on Rphi33 declareProperty("Rphi33_photonsNonConverted", - m_rootTool->Rphi33_photonsNonConverted, + m_rootTool->m_Rphi33_photonsNonConverted, "Cut on Rphi33 for non converted photons"); // Cut on Weta2 declareProperty("weta2_photonsNonConverted", - m_rootTool->weta2_photonsNonConverted, + m_rootTool->m_weta2_photonsNonConverted, "Cut on Weta2 for non converted photons"); // eta binning in strips declareProperty("CutBinEtaStrips_photonsNonConverted", - m_rootTool->CutBinEtaStrips_photonsNonConverted, + m_rootTool->m_cutBinEtaStrips_photonsNonConverted, "eta binning in strips for non converted photons"); // Cut on energy in strips declareProperty("CutBinEnergyStrips_photonsNonConverted", - m_rootTool->CutBinEnergyStrips_photonsNonConverted, + m_rootTool->m_cutBinEnergyStrips_photonsNonConverted, "Cut on energy in strips for non converted photons"); // Cut on fraction of energy to use 1st sampling declareProperty("f1_photonsNonConverted", - m_rootTool->f1_photonsNonConverted, + m_rootTool->m_f1_photonsNonConverted, "Cut on fraction of energy to use 1st sampling for non converted photons"); // Cut on Emax2 [NOT USED] // declareProperty("emax2r_photonsNonConverted", - // m_rootTool->emax2r_photonsNonConverted, + // m_rootTool->m_emax2r_photonsNonConverted, // "Cut on Emax2 for non converted photons"); // Cut on Delta E declareProperty("deltae_photonsNonConverted", - m_rootTool->deltae_photonsNonConverted, + m_rootTool->m_deltae_photonsNonConverted, "Cut on Delta E for non converted photons"); // Cut on (Emax1-Emax2)/(Emax1+Emax2) in 1st sampling declareProperty("DEmaxs1_photonsNonConverted", - m_rootTool->DEmaxs1_photonsNonConverted, + m_rootTool->m_DEmaxs1_photonsNonConverted, "Cut on (Emax1-Emax2)/(Emax1+Emax2) in 1st sampling for non converted photons"); // Cut on total shower width in strips declareProperty("wtot_photonsNonConverted", - m_rootTool->wtot_photonsNonConverted, + m_rootTool->m_wtot_photonsNonConverted, "Cut on total shower width in strips for non converted photons"); // Cut on fraction of energy outside core in strips declareProperty("fracm_photonsNonConverted", - m_rootTool->fracm_photonsNonConverted, + m_rootTool->m_fracm_photonsNonConverted, "Cut on fraction of energy outside core in strips for non converted photons"); // Cut on shower width in 3 strips declareProperty("w1_photonsNonConverted", - m_rootTool->w1_photonsNonConverted, + m_rootTool->m_w1_photonsNonConverted, "Cut on shower width in 3 strips for non converted photons"); //================================================ @@ -139,76 +139,76 @@ AsgPhotonIsEMSelector::AsgPhotonIsEMSelector(std::string myname) : // // Eta binning declareProperty("CutBinEta_photonsConverted", - m_rootTool->CutBinEta_photonsConverted, + m_rootTool->m_cutBinEta_photonsConverted, "Eta binning for converted photons"); // ET binning declareProperty("CutBinEnergy_photonsConverted", - m_rootTool->CutBinEnergy_photonsConverted, + m_rootTool->m_cutBinEnergy_photonsConverted, "E binning for converted photons"); // Cut on hadronic leakage declareProperty("CutHadLeakage_photonsConverted", - m_rootTool->CutHadLeakage_photonsConverted, + m_rootTool->m_cutHadLeakage_photonsConverted, "Cut on hadronic leakage for converted photons"); // Cut on E277 declareProperty("e277_photonsConverted", - m_rootTool->e277_photonsConverted, + m_rootTool->m_e277_photonsConverted, "Cut on E277 for converted photons"); // Cut on Reta37 declareProperty("Reta37_photonsConverted", - m_rootTool->Reta37_photonsConverted, + m_rootTool->m_Reta37_photonsConverted, "Cut on Reta37 for converted photons"); // Cut on Rphi33 declareProperty("Rphi33_photonsConverted", - m_rootTool->Rphi33_photonsConverted, + m_rootTool->m_Rphi33_photonsConverted, "Cut on Rphi33 for converted photons"); // Cut on Weta2 declareProperty("weta2_photonsConverted", - m_rootTool->weta2_photonsConverted, + m_rootTool->m_weta2_photonsConverted, "Cut on Weta2 for converted photons"); // eta binning in strips declareProperty("CutBinEtaStrips_photonsConverted", - m_rootTool->CutBinEtaStrips_photonsConverted, + m_rootTool->m_cutBinEtaStrips_photonsConverted, "eta binning in strips for converted photons"); // ET binning in strips declareProperty("CutBinEnergyStrips_photonsConverted", - m_rootTool->CutBinEnergyStrips_photonsConverted, + m_rootTool->m_cutBinEnergyStrips_photonsConverted, "Cut on energy in strips for converted photons"); // Cut on fraction of energy to use 1st sampling declareProperty("f1_photonsConverted", - m_rootTool->f1_photonsConverted, + m_rootTool->m_f1_photonsConverted, "Cut on fraction of energy to use 1st sampling for converted photons"); // Cut on Emax2 [NOT USED] //declareProperty("emax2r_photonsConverted", - // m_rootTool->emax2r_photonsConverted, + // m_rootTool->m_emax2r_photonsConverted, // "Cut on Emax2 for converted photons"); // Cut on Delta E declareProperty("deltae_photonsConverted", - m_rootTool->deltae_photonsConverted, + m_rootTool->m_deltae_photonsConverted, "Cut on Delta E for converted photons"); // Cut on (Emax1-Emax2)/(Emax1+Emax2) in 1st sampling declareProperty("DEmaxs1_photonsConverted", - m_rootTool->DEmaxs1_photonsConverted, + m_rootTool->m_DEmaxs1_photonsConverted, "Cut on (Emax1-Emax2)/(Emax1+Emax2) in 1st sampling for converted photons"); // Cut on total shower width in strips declareProperty("wtot_photonsConverted", - m_rootTool->wtot_photonsConverted, + m_rootTool->m_wtot_photonsConverted, "Cut on total shower width in strips for converted photons"); // Cut on fraction of energy outside core in strips declareProperty("fracm_photonsConverted", - m_rootTool->fracm_photonsConverted, + m_rootTool->m_fracm_photonsConverted, "Cut on fraction of energy outside core in strips for converted photons"); // Cut on shower width in 3 strips declareProperty("w1_photonsConverted", - m_rootTool->w1_photonsConverted, + m_rootTool->m_w1_photonsConverted, "Cut on shower width in 3 strips for converted photons"); // cut min on E/p declareProperty("CutminEp_photonsConverted", - m_rootTool->CutminEp_photonsConverted, + m_rootTool->m_cutminEp_photonsConverted, "Cut min on E/p for converted converted photons"); // cut max on E/p declareProperty("CutmaxEp_photonsConverted", - m_rootTool->CutmaxEp_photonsConverted, + m_rootTool->m_cutmaxEp_photonsConverted, "Cut max on E/p for converted photons"); // for the trigger needs: @@ -232,9 +232,11 @@ StatusCode AsgPhotonIsEMSelector::initialize() // The standard status code StatusCode sc = StatusCode::SUCCESS ; + ATH_MSG_INFO("initialize : WP " << m_WorkingPoint.size() << " " << m_configFile.size()); + if(!m_WorkingPoint.empty()){ m_configFile=AsgConfigHelper::findConfigFile(m_WorkingPoint,EgammaSelectors::PhotonCutPointToConfFile); - m_rootTool->isEMMask=AsgConfigHelper::findMask(m_WorkingPoint,EgammaSelectors::PhotonCutPointToMask); + m_rootTool->m_isEMMask=AsgConfigHelper::findMask(m_WorkingPoint,EgammaSelectors::PhotonCutPointToMask); } if(!m_configFile.empty()){ @@ -250,46 +252,46 @@ StatusCode AsgPhotonIsEMSelector::initialize() ///------- Read in the TEnv config ------/// ATH_MSG_DEBUG("Read in the TEnv config "); //Override the mask via the config only if it is not set - if(m_rootTool->isEMMask==egammaPID::EgPidUndefined){ + if(m_rootTool->m_isEMMask == egammaPID::EgPidUndefined){ unsigned int mask(env.GetValue("isEMMask",static_cast<int>(egammaPID::EgPidUndefined))); - m_rootTool->isEMMask=mask; + m_rootTool->m_isEMMask = mask; } ///------- Use helpers to read in the cut arrays ------/// - m_rootTool->CutBinEta_photonsNonConverted =AsgConfigHelper::HelperFloat("CutBinEta_photonsNonConverted",env); - m_rootTool->CutBinEnergy_photonsNonConverted =AsgConfigHelper::HelperFloat("CutBinEnergy_photonsNonConverted",env); - m_rootTool->e277_photonsNonConverted =AsgConfigHelper::HelperFloat("e277_photonsNonConverted",env); - m_rootTool->CutHadLeakage_photonsNonConverted =AsgConfigHelper::HelperFloat("CutHadLeakage_photonsNonConverted",env); - m_rootTool->Reta37_photonsNonConverted =AsgConfigHelper::HelperFloat("Reta37_photonsNonConverted",env); - m_rootTool->Rphi33_photonsNonConverted =AsgConfigHelper::HelperFloat("Rphi33_photonsNonConverted",env); - m_rootTool->weta2_photonsNonConverted =AsgConfigHelper::HelperFloat("weta2_photonsNonConverted",env); - m_rootTool->CutBinEtaStrips_photonsNonConverted =AsgConfigHelper::HelperFloat("CutBinEtaStrips_photonsNonConverted",env); - m_rootTool->CutBinEnergyStrips_photonsNonConverted =AsgConfigHelper::HelperFloat("CutBinEnergyStrips_photonsNonConverted",env); - m_rootTool->f1_photonsNonConverted =AsgConfigHelper::HelperFloat("f1_photonsNonConverted",env); - m_rootTool->deltae_photonsNonConverted =AsgConfigHelper::HelperFloat("deltae_photonsNonConverted",env); - m_rootTool->DEmaxs1_photonsNonConverted =AsgConfigHelper::HelperFloat("DEmaxs1_photonsNonConverted",env); - m_rootTool->wtot_photonsNonConverted =AsgConfigHelper::HelperFloat("wtot_photonsNonConverted",env); - m_rootTool->fracm_photonsNonConverted =AsgConfigHelper::HelperFloat("fracm_photonsNonConverted",env); - m_rootTool->w1_photonsNonConverted =AsgConfigHelper::HelperFloat("w1_photonsNonConverted",env); - m_rootTool->CutF3_photonsNonConverted =AsgConfigHelper::HelperFloat("CutF3_photonsNonConverted",env); - m_rootTool->CutBinEta_photonsConverted =AsgConfigHelper::HelperFloat("CutBinEta_photonsConverted",env); - m_rootTool->CutBinEnergy_photonsConverted =AsgConfigHelper::HelperFloat("CutBinEnergy_photonsConverted",env); - m_rootTool->e277_photonsConverted =AsgConfigHelper::HelperFloat("e277_photonsConverted",env); - m_rootTool->CutHadLeakage_photonsConverted =AsgConfigHelper::HelperFloat("CutHadLeakage_photonsConverted",env); - m_rootTool->Reta37_photonsConverted =AsgConfigHelper::HelperFloat("Reta37_photonsConverted",env); - m_rootTool->Rphi33_photonsConverted =AsgConfigHelper::HelperFloat("Rphi33_photonsConverted",env); - m_rootTool->weta2_photonsConverted =AsgConfigHelper::HelperFloat("weta2_photonsConverted",env); - m_rootTool->CutBinEtaStrips_photonsConverted =AsgConfigHelper::HelperFloat("CutBinEtaStrips_photonsConverted",env); - m_rootTool->CutBinEnergyStrips_photonsConverted =AsgConfigHelper::HelperFloat("CutBinEnergyStrips_photonsConverted",env); - m_rootTool->f1_photonsConverted =AsgConfigHelper::HelperFloat("f1_photonsConverted",env); - m_rootTool->deltae_photonsConverted =AsgConfigHelper::HelperFloat("deltae_photonsConverted",env); - m_rootTool->DEmaxs1_photonsConverted =AsgConfigHelper::HelperFloat("DEmaxs1_photonsConverted",env); - m_rootTool->wtot_photonsConverted =AsgConfigHelper::HelperFloat("wtot_photonsConverted",env); - m_rootTool->fracm_photonsConverted =AsgConfigHelper::HelperFloat("fracm_photonsConverted",env); - m_rootTool->w1_photonsConverted =AsgConfigHelper::HelperFloat("w1_photonsConverted",env); - m_rootTool->CutminEp_photonsConverted =AsgConfigHelper::HelperFloat("CutminEp_photonsConverted",env); - m_rootTool->CutmaxEp_photonsConverted =AsgConfigHelper::HelperFloat("CutmaxEp_photonsConverted",env); - m_rootTool->CutF3_photonsConverted =AsgConfigHelper::HelperFloat("CutF3_photonsConverted",env); + m_rootTool->m_cutBinEta_photonsNonConverted =AsgConfigHelper::HelperFloat("CutBinEta_photonsNonConverted",env); + m_rootTool->m_cutBinEnergy_photonsNonConverted =AsgConfigHelper::HelperFloat("CutBinEnergy_photonsNonConverted",env); + m_rootTool->m_e277_photonsNonConverted =AsgConfigHelper::HelperFloat("e277_photonsNonConverted",env); + m_rootTool->m_cutHadLeakage_photonsNonConverted =AsgConfigHelper::HelperFloat("CutHadLeakage_photonsNonConverted",env); + m_rootTool->m_Reta37_photonsNonConverted =AsgConfigHelper::HelperFloat("Reta37_photonsNonConverted",env); + m_rootTool->m_Rphi33_photonsNonConverted =AsgConfigHelper::HelperFloat("Rphi33_photonsNonConverted",env); + m_rootTool->m_weta2_photonsNonConverted =AsgConfigHelper::HelperFloat("weta2_photonsNonConverted",env); + m_rootTool->m_cutBinEtaStrips_photonsNonConverted =AsgConfigHelper::HelperFloat("CutBinEtaStrips_photonsNonConverted",env); + m_rootTool->m_cutBinEnergyStrips_photonsNonConverted =AsgConfigHelper::HelperFloat("CutBinEnergyStrips_photonsNonConverted",env); + m_rootTool->m_f1_photonsNonConverted =AsgConfigHelper::HelperFloat("f1_photonsNonConverted",env); + m_rootTool->m_deltae_photonsNonConverted =AsgConfigHelper::HelperFloat("deltae_photonsNonConverted",env); + m_rootTool->m_DEmaxs1_photonsNonConverted =AsgConfigHelper::HelperFloat("DEmaxs1_photonsNonConverted",env); + m_rootTool->m_wtot_photonsNonConverted =AsgConfigHelper::HelperFloat("wtot_photonsNonConverted",env); + m_rootTool->m_fracm_photonsNonConverted =AsgConfigHelper::HelperFloat("fracm_photonsNonConverted",env); + m_rootTool->m_w1_photonsNonConverted =AsgConfigHelper::HelperFloat("w1_photonsNonConverted",env); + m_rootTool->m_cutF3_photonsNonConverted =AsgConfigHelper::HelperFloat("CutF3_photonsNonConverted",env); + m_rootTool->m_cutBinEta_photonsConverted =AsgConfigHelper::HelperFloat("CutBinEta_photonsConverted",env); + m_rootTool->m_cutBinEnergy_photonsConverted =AsgConfigHelper::HelperFloat("CutBinEnergy_photonsConverted",env); + m_rootTool->m_e277_photonsConverted =AsgConfigHelper::HelperFloat("e277_photonsConverted",env); + m_rootTool->m_cutHadLeakage_photonsConverted =AsgConfigHelper::HelperFloat("CutHadLeakage_photonsConverted",env); + m_rootTool->m_Reta37_photonsConverted =AsgConfigHelper::HelperFloat("Reta37_photonsConverted",env); + m_rootTool->m_Rphi33_photonsConverted =AsgConfigHelper::HelperFloat("Rphi33_photonsConverted",env); + m_rootTool->m_weta2_photonsConverted =AsgConfigHelper::HelperFloat("weta2_photonsConverted",env); + m_rootTool->m_cutBinEtaStrips_photonsConverted =AsgConfigHelper::HelperFloat("CutBinEtaStrips_photonsConverted",env); + m_rootTool->m_cutBinEnergyStrips_photonsConverted =AsgConfigHelper::HelperFloat("CutBinEnergyStrips_photonsConverted",env); + m_rootTool->m_f1_photonsConverted =AsgConfigHelper::HelperFloat("f1_photonsConverted",env); + m_rootTool->m_deltae_photonsConverted =AsgConfigHelper::HelperFloat("deltae_photonsConverted",env); + m_rootTool->m_DEmaxs1_photonsConverted =AsgConfigHelper::HelperFloat("DEmaxs1_photonsConverted",env); + m_rootTool->m_wtot_photonsConverted =AsgConfigHelper::HelperFloat("wtot_photonsConverted",env); + m_rootTool->m_fracm_photonsConverted =AsgConfigHelper::HelperFloat("fracm_photonsConverted",env); + m_rootTool->m_w1_photonsConverted =AsgConfigHelper::HelperFloat("w1_photonsConverted",env); + m_rootTool->m_cutminEp_photonsConverted =AsgConfigHelper::HelperFloat("CutminEp_photonsConverted",env); + m_rootTool->m_cutmaxEp_photonsConverted =AsgConfigHelper::HelperFloat("CutmaxEp_photonsConverted",env); + m_rootTool->m_cutF3_photonsConverted =AsgConfigHelper::HelperFloat("CutF3_photonsConverted",env); } else { ATH_MSG_INFO("Conf file empty. Just user Input"); @@ -300,7 +302,7 @@ StatusCode AsgPhotonIsEMSelector::initialize() m_rootTool->msg().setLevel(this->msg().level()); // We need to initialize the underlying ROOT TSelectorTool - if ( 0 == m_rootTool->initialize() ) + if ( m_rootTool->initialize().isFailure() ) { ATH_MSG_ERROR("Could not initialize the TPhotonIsEMSelector!"); sc = StatusCode::FAILURE; @@ -310,26 +312,19 @@ StatusCode AsgPhotonIsEMSelector::initialize() return sc ; } -// =============================================================== -StatusCode AsgPhotonIsEMSelector::finalize() -{ - // The standard status code - StatusCode sc = StatusCode::SUCCESS ; - - if ( !(m_rootTool->finalize()) ) - { - ATH_MSG_ERROR("Something went wrong at finalize!"); - sc = StatusCode::FAILURE; - } +//============================================================================= +// return the accept info object +//============================================================================= - return sc ; +const asg::AcceptInfo& AsgPhotonIsEMSelector::getAcceptInfo() const +{ + return m_rootTool->getAcceptInfo(); } - //============================================================================= // The main accept method: the actual cuts are applied here //============================================================================= -const Root::TAccept& AsgPhotonIsEMSelector::accept( const xAOD::IParticle* part ) const{ +asg::AcceptData AsgPhotonIsEMSelector::accept( const xAOD::IParticle* part ) const{ ATH_MSG_DEBUG("Entering accept( const IParticle* part )"); if(part->type()==xAOD::Type::Photon || part->type()==xAOD::Type::Electron){ @@ -337,63 +332,59 @@ const Root::TAccept& AsgPhotonIsEMSelector::accept( const xAOD::IParticle* part } else{ ATH_MSG_ERROR("AsgElectronIsEMSelector::could not convert argument to Photon/Electron"); - return m_acceptDummy; + return m_rootTool->accept(); } } -const Root::TAccept& AsgPhotonIsEMSelector::accept( const xAOD::Egamma* eg ) const{ +asg::AcceptData AsgPhotonIsEMSelector::accept( const xAOD::Egamma* eg ) const{ ATH_MSG_DEBUG("Entering accept( const Egamma* part )"); if ( eg ){ - StatusCode sc = execute(eg); + unsigned int isEM = ~0; + StatusCode sc = execute(eg, isEM); if (sc.isFailure()) { ATH_MSG_ERROR("could not calculate isEM"); - return m_acceptDummy; + return m_rootTool->accept(); } - return m_rootTool->fillAccept(); + return m_rootTool->fillAccept(isEM); } else{ ATH_MSG_ERROR("AsgElectronIsEMSelector::accept was given a bad argument"); - return m_acceptDummy; + return m_rootTool->accept(); } } -const Root::TAccept& AsgPhotonIsEMSelector::accept( const xAOD::Photon* ph) const{ +asg::AcceptData AsgPhotonIsEMSelector::accept( const xAOD::Photon* ph) const{ ATH_MSG_DEBUG("Entering accept( const Photon* part )"); return accept(static_cast<const xAOD::Egamma*> (ph)); } -const Root::TAccept& AsgPhotonIsEMSelector::accept( const xAOD::Electron* el) const{ +asg::AcceptData AsgPhotonIsEMSelector::accept( const xAOD::Electron* el) const{ ATH_MSG_DEBUG("Entering accept( const Electron* part )"); return accept(static_cast<const xAOD::Egamma*> (el)); } - - /** The value of the isem **/ -unsigned int AsgPhotonIsEMSelector::IsemValue() const { - return m_rootTool->isEM(); -} - + //============================================================================= /// Get the name of the current operating point //============================================================================= std::string AsgPhotonIsEMSelector::getOperatingPointName() const{ - if (m_rootTool->isEMMask == egammaPID::PhotonLoose){ return "Loose"; } - else if (m_rootTool->isEMMask == egammaPID::PhotonMedium ){ return "Medium"; } - else if (m_rootTool->isEMMask == egammaPID::PhotonTight){ return "Tight"; } - else if (m_rootTool->isEMMask == egammaPID::PhotonLooseEF ){ return "LooseEF"; } - else if (m_rootTool->isEMMask == egammaPID::PhotonMediumEF){ return "MediumEF"; } - else if (m_rootTool->isEMMask == 0){ return "0 No cuts applied"; } + if (m_rootTool->m_isEMMask == egammaPID::PhotonLoose){ return "Loose"; } + else if (m_rootTool->m_isEMMask == egammaPID::PhotonMedium ){ return "Medium"; } + else if (m_rootTool->m_isEMMask == egammaPID::PhotonTight){ return "Tight"; } + else if (m_rootTool->m_isEMMask == egammaPID::PhotonLooseEF ){ return "LooseEF"; } + else if (m_rootTool->m_isEMMask == egammaPID::PhotonMediumEF){ return "MediumEF"; } + else if (m_rootTool->m_isEMMask == 0){ return "0 No cuts applied"; } else{ - ATH_MSG_ERROR( "Didn't recognize the given operating point with mask: " << m_rootTool->isEMMask ); + ATH_MSG_ERROR( "Didn't recognize the given operating point with mask: " << m_rootTool->m_isEMMask ); return ""; } } // A simple execute command wrapper // ============================================================== -StatusCode AsgPhotonIsEMSelector::execute(const xAOD::Egamma* eg) const +StatusCode AsgPhotonIsEMSelector::execute(const xAOD::Egamma* eg, unsigned int& isEM) const { // // Particle identification for photons based on cuts @@ -403,14 +394,13 @@ StatusCode AsgPhotonIsEMSelector::execute(const xAOD::Egamma* eg) const ATH_MSG_DEBUG("Executing AsgPhotonIsEMSelector"); // initialisation - unsigned int iflag = 0; + isEM = 0; // protection against null pointer if (eg==0) { ATH_MSG_ERROR("eg == 0"); // if object is bad then use the bit for "bad eta" - iflag = (0x1 << egammaPID::ClusterEtaRange_Photon); - m_rootTool->setIsEM(iflag); + isEM = (0x1 << egammaPID::ClusterEtaRange_Photon); return StatusCode::SUCCESS; } @@ -419,8 +409,7 @@ StatusCode AsgPhotonIsEMSelector::execute(const xAOD::Egamma* eg) const if ( cluster == 0 ) { ATH_MSG_ERROR("exiting because cluster is NULL " << cluster); // if object is bad then use the bit for "bad eta" - iflag = (0x1 << egammaPID::ClusterEtaRange_Photon); - m_rootTool->setIsEM(iflag); + isEM = (0x1 << egammaPID::ClusterEtaRange_Photon); return StatusCode::SUCCESS; } @@ -505,28 +494,24 @@ StatusCode AsgPhotonIsEMSelector::execute(const xAOD::Egamma* eg) const if(m_trigEtTh > 0) et = m_trigEtTh*1.01; // apply calorimeter selection for photons - iflag = m_rootTool->calcIsEm(eta2, - et, - Rhad1, - Rhad, - e277, - Reta, - Rphi, - weta2c, - //emax2, - f1, - Eratio, - DeltaE, - weta1c, - wtot, - fracm, - f3, - ep, - xAOD::EgammaHelpers::isConvertedPhoton(eg)); - m_rootTool->setIsEM(iflag); + isEM = m_rootTool->calcIsEm(eta2, + et, + Rhad1, + Rhad, + e277, + Reta, + Rphi, + weta2c, + //emax2, + f1, + Eratio, + DeltaE, + weta1c, + wtot, + fracm, + f3, + ep, + xAOD::EgammaHelpers::isConvertedPhoton(eg)); return StatusCode::SUCCESS; } -const Root::TAccept& AsgPhotonIsEMSelector::getTAccept( ) const { - return m_rootTool->getTAccept(); -} diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronIsEMSelector.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronIsEMSelector.cxx index 53751c4dcd9f0a6768f27832310196555e08dc7a..eaa3588433eb4adbb0c7447813d2c9b576d38b2c 100755 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronIsEMSelector.cxx +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronIsEMSelector.cxx @@ -17,12 +17,10 @@ namespace{ } Root::TElectronIsEMSelector::TElectronIsEMSelector(const char* name) : - TSelectorToolBase(name), asg::AsgMessaging(std::string(name)), - isEMMask(0), //All will pass if not specified - useTRTOutliers(true), - useTRTXenonHits(false), - m_isEM(~0), + m_isEMMask(0), //All will pass if not specified + m_useTRTOutliers(true), + m_useTRTXenonHits(false), /** @brief cluster eta range */ m_cutPositionClusterEtaRange_Electron(0), /** @brief matching to photon (not necessarily conversion--the name is historical) */ @@ -190,10 +188,10 @@ Root::TElectronIsEMSelector::~TElectronIsEMSelector() //============================================================================= // Initialize this selector tool //============================================================================= -int Root::TElectronIsEMSelector::initialize() +StatusCode Root::TElectronIsEMSelector::initialize() { - int sc(1); + StatusCode sc(StatusCode::SUCCESS); // -------------------------------------------------------------------------- // Register the cuts and check that the registration worked: @@ -201,277 +199,277 @@ int Root::TElectronIsEMSelector::initialize() /** @brief cluster eta range, bit 0 */ m_cutPositionClusterEtaRange_Electron = - m_accept.addCut(m_cutNameClusterEtaRange_Electron, "Electron within eta range"); - if (m_cutPositionClusterEtaRange_Electron < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameClusterEtaRange_Electron, "Electron within eta range"); + if (m_cutPositionClusterEtaRange_Electron < 0) sc = StatusCode::FAILURE; /** @brief matching to photon (not necessarily conversion--the name is historical), but 1 */ m_cutPositionConversionMatch_Electron = - m_accept.addCut(m_cutNameConversionMatch_Electron, "Electron matches a photon with AR > LOOSE"); - if (m_cutPositionConversionMatch_Electron < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameConversionMatch_Electron, "Electron matches a photon with AR > LOOSE"); + if (m_cutPositionConversionMatch_Electron < 0) sc = StatusCode::FAILURE; /** @brief cluster leakage into the hadronic calorimeter, bit 2 */ m_cutPositionClusterHadronicLeakage_Electron = - m_accept.addCut(m_cutNameClusterHadronicLeakage_Electron, "Had leakage < Cut"); - if (m_cutPositionClusterHadronicLeakage_Electron < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameClusterHadronicLeakage_Electron, "Had leakage < Cut"); + if (m_cutPositionClusterHadronicLeakage_Electron < 0) sc = StatusCode::FAILURE; /** @brief et < 0 bit 3 */ m_cutPositionClusterMiddleEnergy_Electron = - m_accept.addCut(m_cutNameClusterMiddleEnergy_Electron, "Et <0 Cut"); - if (m_cutPositionClusterMiddleEnergy_Electron < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameClusterMiddleEnergy_Electron, "Et <0 Cut"); + if (m_cutPositionClusterMiddleEnergy_Electron < 0) sc = StatusCode::FAILURE; /** @brief energy ratio in 2nd sampling (i.e. E237/E277), bit 4 */ m_cutPositionClusterMiddleEratio37_Electron = - m_accept.addCut(m_cutNameClusterMiddleEratio37_Electron, "E237/377 > Cut"); - if (m_cutPositionClusterMiddleEratio37_Electron < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameClusterMiddleEratio37_Electron, "E237/377 > Cut"); + if (m_cutPositionClusterMiddleEratio37_Electron < 0) sc = StatusCode::FAILURE; /** @brief energy ratio in 2nd sampling (i.e. E233/E237), bit 5 */ m_cutPositionClusterMiddleEratio33_Electron = - m_accept.addCut(m_cutNameClusterMiddleEratio33_Electron, "E233/E237 > Cut"); - if (m_cutPositionClusterMiddleEratio33_Electron < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameClusterMiddleEratio33_Electron, "E233/E237 > Cut"); + if (m_cutPositionClusterMiddleEratio33_Electron < 0) sc = StatusCode::FAILURE; /** @brief width in the second sampling (i.e. Weta2), bit 6 */ m_cutPositionClusterMiddleWidth_Electron = - m_accept.addCut(m_cutNameClusterMiddleWidth_Electron, "Weta2 < Cut"); - if (m_cutPositionClusterMiddleWidth_Electron < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameClusterMiddleWidth_Electron, "Weta2 < Cut"); + if (m_cutPositionClusterMiddleWidth_Electron < 0) sc = StatusCode::FAILURE; /** @brief energy fraction in the third layer, bit 7 */ m_cutPositionClusterBackEnergyFraction_Electron = - m_accept.addCut(m_cutNameClusterBackEnergyFraction_Electron, "f3 < Cut"); - if (m_cutPositionClusterBackEnergyFraction_Electron < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameClusterBackEnergyFraction_Electron, "f3 < Cut"); + if (m_cutPositionClusterBackEnergyFraction_Electron < 0) sc = StatusCode::FAILURE; /** @brief fraction of energy found in 1st sampling (NB: not used in fact for electrons), bit 8*/ m_cutPositionClusterStripsEratio_Electron = - m_accept.addCut(m_cutNameClusterStripsEratio_Electron, "No Cut"); - if (m_cutPositionClusterStripsEratio_Electron < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameClusterStripsEratio_Electron, "No Cut"); + if (m_cutPositionClusterStripsEratio_Electron < 0) sc = StatusCode::FAILURE; /** @brief energy of 2nd maximum in 1st sampling ~e2tsts1/(1000+const_lumi*et), bit 9 */ m_cutPositionClusterStripsDeltaEmax2_Electron = - m_accept.addCut(m_cutNameClusterStripsDeltaEmax2_Electron, "emax2/(1000.+0.009*et) < Cut, where emax2 is the energy of the second max"); - if (m_cutPositionClusterStripsDeltaEmax2_Electron < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameClusterStripsDeltaEmax2_Electron, "emax2/(1000.+0.009*et) < Cut, where emax2 is the energy of the second max"); + if (m_cutPositionClusterStripsDeltaEmax2_Electron < 0) sc = StatusCode::FAILURE; /** @brief difference between 2nd maximum and 1st minimum in strips (e2tsts1-emins1), bit 10 */ m_cutPositionClusterStripsDeltaE_Electron = - m_accept.addCut(m_cutNameClusterStripsDeltaE_Electron, "difference between 2nd maximium and first minimum < Cut"); - if (m_cutPositionClusterStripsDeltaE_Electron < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameClusterStripsDeltaE_Electron, "difference between 2nd maximium and first minimum < Cut"); + if (m_cutPositionClusterStripsDeltaE_Electron < 0) sc = StatusCode::FAILURE; /** @brief shower width in 1st sampling, bit 11 */ m_cutPositionClusterStripsWtot_Electron = - m_accept.addCut(m_cutNameClusterStripsWtot_Electron, "Total shower width in first sampling < Cut"); - if (m_cutPositionClusterStripsWtot_Electron < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameClusterStripsWtot_Electron, "Total shower width in first sampling < Cut"); + if (m_cutPositionClusterStripsWtot_Electron < 0) sc = StatusCode::FAILURE; /** @brief shower shape in shower core 1st sampling, bit 12 */ m_cutPositionClusterStripsFracm_Electron = - m_accept.addCut(m_cutNameClusterStripsFracm_Electron, "Fracm (aka Fside) < Cut"); - if (m_cutPositionClusterStripsFracm_Electron < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameClusterStripsFracm_Electron, "Fracm (aka Fside) < Cut"); + if (m_cutPositionClusterStripsFracm_Electron < 0) sc = StatusCode::FAILURE; /** @brief shower width weighted by distance from the maximum one, bit 13 */ m_cutPositionClusterStripsWeta1c_Electron = - m_accept.addCut(m_cutNameClusterStripsWeta1c_Electron, "Shower width in 3 strips in first sampling < Cut"); - if (m_cutPositionClusterStripsWeta1c_Electron < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameClusterStripsWeta1c_Electron, "Shower width in 3 strips in first sampling < Cut"); + if (m_cutPositionClusterStripsWeta1c_Electron < 0) sc = StatusCode::FAILURE; - int voidcutpos = m_accept.addCut("VOID1", "No Cut"); // bit 14 is not used - if (voidcutpos < 0) sc = 0; + int voidcutpos = m_acceptInfo.addCut("VOID1", "No Cut"); // bit 14 is not used + if (voidcutpos < 0) sc = StatusCode::FAILURE; /** @brief difference between max and 2nd max in strips, bit 15 */ m_cutPositionClusterStripsDEmaxs1_Electron = - m_accept.addCut(m_cutNameClusterStripsDEmaxs1_Electron, "Difference between first and second max > Cut"); - if (m_cutPositionClusterStripsDEmaxs1_Electron < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameClusterStripsDEmaxs1_Electron, "Difference between first and second max > Cut"); + if (m_cutPositionClusterStripsDEmaxs1_Electron < 0) sc = StatusCode::FAILURE; /** @brief B layer hit, bit 16 */ m_cutPositionTrackBlayer_Electron = - m_accept.addCut(m_cutNameTrackBlayer_Electron, "nBL > 0, maybe including outliers and using expectHitInBLayer"); - if (m_cutPositionTrackBlayer_Electron < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameTrackBlayer_Electron, "nBL > 0, maybe including outliers and using expectHitInBLayer"); + if (m_cutPositionTrackBlayer_Electron < 0) sc = StatusCode::FAILURE; /** @brief number of Pixel hits, bit 17 */ m_cutPositionTrackPixel_Electron = - m_accept.addCut(m_cutNameTrackPixel_Electron, "nPi > Cut, maybe including outliers"); - if (m_cutPositionTrackPixel_Electron < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameTrackPixel_Electron, "nPi > Cut, maybe including outliers"); + if (m_cutPositionTrackPixel_Electron < 0) sc = StatusCode::FAILURE; /** @brief number of Pixel and SCT hits, bit 18 */ m_cutPositionTrackSi_Electron = - m_accept.addCut(m_cutNameTrackSi_Electron, "nSi > Cut, maybe including outliers"); - if (m_cutPositionTrackSi_Electron < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameTrackSi_Electron, "nSi > Cut, maybe including outliers"); + if (m_cutPositionTrackSi_Electron < 0) sc = StatusCode::FAILURE; /** @brief distance of closet approach, bit 19 */ m_cutPositionTrackA0_Electron = - m_accept.addCut(m_cutNameTrackA0_Electron, "A0 (aka d0) wrt beam spot < Cut"); - if (m_cutPositionTrackA0_Electron < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameTrackA0_Electron, "A0 (aka d0) wrt beam spot < Cut"); + if (m_cutPositionTrackA0_Electron < 0) sc = StatusCode::FAILURE; /** @brief eta difference between cluster and extrapolated track in the 1st sampling, bit 20 */ m_cutPositionTrackMatchEta_Electron = - m_accept.addCut(m_cutNameTrackMatchEta_Electron, "Track match deta in 1st sampling < Cut"); - if (m_cutPositionTrackMatchEta_Electron < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameTrackMatchEta_Electron, "Track match deta in 1st sampling < Cut"); + if (m_cutPositionTrackMatchEta_Electron < 0) sc = StatusCode::FAILURE; /** @brief phi difference between cluster and extrapolated track in the 2nd sampling, bit 21 */ m_cutPositionTrackMatchPhi_Electron = - m_accept.addCut(m_cutNameTrackMatchPhi_Electron, "Track match dphi in 2nd sampling < Cut"); - if (m_cutPositionTrackMatchPhi_Electron < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameTrackMatchPhi_Electron, "Track match dphi in 2nd sampling < Cut"); + if (m_cutPositionTrackMatchPhi_Electron < 0) sc = StatusCode::FAILURE; /** @brief energy-momentum match, bit 22 */ m_cutPositionTrackMatchEoverP_Electron = - m_accept.addCut(m_cutNameTrackMatchEoverP_Electron, "E/p < Cut"); - if (m_cutPositionTrackMatchEoverP_Electron < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameTrackMatchEoverP_Electron, "E/p < Cut"); + if (m_cutPositionTrackMatchEoverP_Electron < 0) sc = StatusCode::FAILURE; - // voidcutpos = m_accept.addCut("VOID2", "No Cut"); // bit 23 is not used - //if (voidcutpos < 0) sc = 0; + // voidcutpos = m_acceptInfo.addCut("VOID2", "No Cut"); // bit 23 is not used + //if (voidcutpos < 0) sc = StatusCode::FAILURE; /** @brief cut on TRT eProbabilityHT, bit 23 */ m_cutPositionTrackTRTeProbabilityHT_Electron = - m_accept.addCut(m_cutNameTrackTRTeProbabilityHT_Electron, "eProbabilityHT TRT hits > Cut"); - if (m_cutPositionTrackTRTeProbabilityHT_Electron < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameTrackTRTeProbabilityHT_Electron, "eProbabilityHT TRT hits > Cut"); + if (m_cutPositionTrackTRTeProbabilityHT_Electron < 0) sc = StatusCode::FAILURE; /** @brief number of TRT hits, bit 24 */ m_cutPositionTrackTRThits_Electron = - m_accept.addCut(m_cutNameTrackTRThits_Electron, "number of TRT hits > Cut"); - if (m_cutPositionTrackTRThits_Electron < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameTrackTRThits_Electron, "number of TRT hits > Cut"); + if (m_cutPositionTrackTRThits_Electron < 0) sc = StatusCode::FAILURE; /** @brief ratio of high to all TRT hits for isolated electrons, bit 25 */ m_cutPositionTrackTRTratio_Electron = - m_accept.addCut(m_cutNameTrackTRTratio_Electron, "ration of high to all TRT hits > Cut"); - if (m_cutPositionTrackTRTratio_Electron < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameTrackTRTratio_Electron, "ration of high to all TRT hits > Cut"); + if (m_cutPositionTrackTRTratio_Electron < 0) sc = StatusCode::FAILURE; /** @brief ratio of high to all TRT hits for non-isolated electrons (not for new ++ menus), bit 26 */ m_cutPositionTrackTRTratio90_Electron = - m_accept.addCut(m_cutNameTrackTRTratio90_Electron, "ration of high to all TRT hits > Cut, 90% cut, (only for old tight menu)"); - if (m_cutPositionTrackTRTratio90_Electron < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameTrackTRTratio90_Electron, "ration of high to all TRT hits > Cut, 90% cut, (only for old tight menu)"); + if (m_cutPositionTrackTRTratio90_Electron < 0) sc = StatusCode::FAILURE; /** @brief distance of closet approach for tight selection (not to be used in new ++ menus), bit 27 */ m_cutPositionTrackA0Tight_Electron = - m_accept.addCut(m_cutNameTrackA0Tight_Electron, "tight cut on d0 for old tight menu (not used otherwis)"); - if (m_cutPositionTrackA0Tight_Electron < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameTrackA0Tight_Electron, "tight cut on d0 for old tight menu (not used otherwis)"); + if (m_cutPositionTrackA0Tight_Electron < 0) sc = StatusCode::FAILURE; /** @brief eta difference between cluster and extrapolated track in the 1st sampling for tight selection (not to be used in new ++ menus), bit 28*/ m_cutPositionTrackMatchEtaTight_Electron = - m_accept.addCut(m_cutNameTrackMatchEtaTight_Electron, "tight cut on deta only for old tight menu"); - if (m_cutPositionTrackMatchEtaTight_Electron < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameTrackMatchEtaTight_Electron, "tight cut on deta only for old tight menu"); + if (m_cutPositionTrackMatchEtaTight_Electron < 0) sc = StatusCode::FAILURE; /** @brief isolation, bit 29 */ m_cutPositionIsolation_Electron = - m_accept.addCut(m_cutNameIsolation_Electron, "Track and calorimetric isolation"); - if (m_cutPositionIsolation_Electron < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameIsolation_Electron, "Track and calorimetric isolation"); + if (m_cutPositionIsolation_Electron < 0) sc = StatusCode::FAILURE; /** @brief calorimetric isolation, bit 30 */ m_cutPositionClusterIsolation_Electron = - m_accept.addCut(m_cutNameClusterIsolation_Electron, "calorimetric isolation only"); - if (m_cutPositionClusterIsolation_Electron < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameClusterIsolation_Electron, "calorimetric isolation only"); + if (m_cutPositionClusterIsolation_Electron < 0) sc = StatusCode::FAILURE; /** @brief tracker isolation, bit 31 */ m_cutPositionTrackIsolation_Electron = - m_accept.addCut(m_cutNameTrackIsolation_Electron, "track isolation only"); - if (m_cutPositionTrackIsolation_Electron < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameTrackIsolation_Electron, "track isolation only"); + if (m_cutPositionTrackIsolation_Electron < 0) sc = StatusCode::FAILURE; - if (sc == 0) { + if (sc == StatusCode::FAILURE) { ATH_MSG_ERROR("Exceeded the number of allowed cuts in TElectronIsEMSelector"); } return sc; } -const Root::TAccept& Root::TElectronIsEMSelector::fillAccept() const +asg::AcceptData Root::TElectronIsEMSelector::fillAccept(unsigned int isEM) const { + asg::AcceptData acceptData(&m_acceptInfo); for (int i = 0; i < 32; i++) { - const unsigned int mask = (0x1 << i) & isEMMask; - m_accept.setCutResult(i, (m_isEM & mask) == 0); + const unsigned int mask = (0x1 << i) & m_isEMMask; + acceptData.setCutResult(i, (isEM & mask) == 0); } - return m_accept; + return acceptData; } //============================================================================= // Calculate the actual accept of each cut individually. //============================================================================= -const Root::TAccept& Root::TElectronIsEMSelector::accept( - // eta position in second sampling - float eta2, - // transverse energy in calorimeter (using eta position in second sampling) - double et, - //////////////// - calo - // E(3*3) in 2nd sampling e233 - float Reta, - // E(3*7) in 2nd sampling e237 - float Rphi, - // transverse energy in 1st scintillator of hadronic calorimeter - float Rhad1, - // transverse energy in hadronic calorimeter - float Rhad, - // E(7*7) in 2nd sampling - float e277, - // shower width in 3 strips in 1st sampling - float weta1c, - // shower width in 2nd sampling - float weta2c, - // fraction of energy reconstructed in the 1st sampling - float f1, - // E of 2nd max between max and min in strips - float emax2, - // E of 1st max in strips - float Eratio, - // E(min) in strips - float DeltaE, - // total shower width in 1st sampling - float wtot, - // E(+/-3)-E(+/-1)/E(+/-1) - float fracm, - // fraction of energy reconstructed in the 3rd sampling - float f3, - //////////////// - tracking - // is effective number of BL hits+outliers at least 1? - bool passBLayerRequirement, - // number of pixel hits + dead sensors - int nPixHitsPlusDeadSensors, - // number of silicon hits + dead sensors - int nSiHitsPlusDeadSensors, - // TRT hits - int nTRThigh, - int nTRThighOutliers, - int nTRT, - int nTRTOutliers, - int nTRTXenonHits, - float TRT_PID, - // transverse impact parameter - float trackd0, - // Delta eta,phi matching - float deltaeta, - float deltaphi, - // E/p - double ep) const +asg::AcceptData Root::TElectronIsEMSelector::accept( + // eta position in second sampling + float eta2, + // transverse energy in calorimeter (using eta position in second sampling) + double et, + //////////////// - calo + // E(3*3) in 2nd sampling e233 + float Reta, + // E(3*7) in 2nd sampling e237 + float Rphi, + // transverse energy in 1st scintillator of hadronic calorimeter + float Rhad1, + // transverse energy in hadronic calorimeter + float Rhad, + // E(7*7) in 2nd sampling + float e277, + // shower width in 3 strips in 1st sampling + float weta1c, + // shower width in 2nd sampling + float weta2c, + // fraction of energy reconstructed in the 1st sampling + float f1, + // E of 2nd max between max and min in strips + float emax2, + // E of 1st max in strips + float Eratio, + // E(min) in strips + float DeltaE, + // total shower width in 1st sampling + float wtot, + // E(+/-3)-E(+/-1)/E(+/-1) + float fracm, + // fraction of energy reconstructed in the 3rd sampling + float f3, + //////////////// - tracking + // is effective number of BL hits+outliers at least 1? + bool passBLayerRequirement, + // number of pixel hits + dead sensors + int nPixHitsPlusDeadSensors, + // number of silicon hits + dead sensors + int nSiHitsPlusDeadSensors, + // TRT hits + int nTRThigh, + int nTRThighOutliers, + int nTRT, + int nTRTOutliers, + int nTRTXenonHits, + float TRT_PID, + // transverse impact parameter + float trackd0, + // Delta eta,phi matching + float deltaeta, + float deltaphi, + // E/p + double ep) const { - // Reset the cut result bits to zero (= fail cut) - m_accept.clear(); + // ----------------------------------------------------------- // Do the actual selection - m_isEM = calcIsEm(eta2, - et, - Reta, // e233, - Rphi, //e237, - Rhad1, ///ethad1, - Rhad, //ethad, - e277, - weta1c, - weta2c, - f1, - emax2, - Eratio, //emax, - DeltaE, //emin, - wtot, - fracm, - f3, - passBLayerRequirement, - nPixHitsPlusDeadSensors, - nSiHitsPlusDeadSensors, - nTRThigh, - nTRThighOutliers, - nTRT, - nTRTOutliers, - nTRTXenonHits, - TRT_PID, - trackd0, - deltaeta, - deltaphi, - ep); - - return fillAccept(); + unsigned int isEM = calcIsEm(eta2, + et, + Reta, // e233, + Rphi, //e237, + Rhad1, ///ethad1, + Rhad, //ethad, + e277, + weta1c, + weta2c, + f1, + emax2, + Eratio, //emax, + DeltaE, //emin, + wtot, + fracm, + f3, + passBLayerRequirement, + nPixHitsPlusDeadSensors, + nSiHitsPlusDeadSensors, + nTRThigh, + nTRThighOutliers, + nTRT, + nTRTOutliers, + nTRTXenonHits, + TRT_PID, + trackd0, + deltaeta, + deltaphi, + ep); + + return fillAccept(isEM); } @@ -632,83 +630,83 @@ unsigned int Root::TElectronIsEMSelector::calocuts_electrons( if (ibin_eta>=0 && ibin_et>=0 && ibin_combined>=0) { // hadronic leakage - if (CheckVar(CutHadLeakage,4)) { + if (CheckVar(m_cutHadLeakage,4)) { if (eta2 < 0.8) { - if (Rhad1>CutHadLeakage[ibin_combined]) + if (Rhad1>m_cutHadLeakage[ibin_combined]) iflag |= ( 0x1 << egammaPID::ClusterHadronicLeakage_Electron); } else if (eta2 >= 0.8 && eta2 < 1.37) { - if (Rhad>CutHadLeakage[ibin_combined]) + if (Rhad>m_cutHadLeakage[ibin_combined]) iflag |= ( 0x1 << egammaPID::ClusterHadronicLeakage_Electron); } else { - if (Rhad1>CutHadLeakage[ibin_combined]) + if (Rhad1>m_cutHadLeakage[ibin_combined]) iflag |= ( 0x1 << egammaPID::ClusterHadronicLeakage_Electron); } } // cut on f3 - if (CheckVar(CutF3,4)) { - if (f3 > CutF3[ibin_combined]) { + if (CheckVar(m_cutF3,4)) { + if (f3 > m_cutF3[ibin_combined]) { iflag |= ( 0x1 << egammaPID::ClusterBackEnergyFraction_Electron); } } // cuts on 2nd sampling - if (CheckVar(CutReta37,4)) { - if (Reta<=CutReta37[ibin_combined]) + if (CheckVar(m_cutReta37,4)) { + if (Reta<=m_cutReta37[ibin_combined]) iflag |= ( 0x1 << egammaPID::ClusterMiddleEratio37_Electron); } // ------------------------------- - if (CheckVar(CutRphi33,4)) { - if (Rphi<=CutRphi33[ibin_combined]) + if (CheckVar(m_cutRphi33,4)) { + if (Rphi<=m_cutRphi33[ibin_combined]) iflag |= ( 0x1 << egammaPID::ClusterMiddleEratio33_Electron); } // ------------------------------- // check Weta2c - if (CheckVar(CutWeta2c,4)) { - if (weta2c>CutWeta2c[ibin_combined]) + if (CheckVar(m_cutWeta2c,4)) { + if (weta2c>m_cutWeta2c[ibin_combined]) iflag |= ( 0x1 << egammaPID::ClusterMiddleWidth_Electron); } // cuts on 1st sampling // we remove also crack - if (f1>CutF1[0] && + if (f1>m_cutF1[0] && eta2 < 2.37 && (eta2 < 1.37 || eta2 > 1.52)) { // check Rmax2 - if (CheckVar(CutDeltaEmax2,4)) { + if (CheckVar(m_cutDeltaEmax2,4)) { // parametrizatiion of emax2 double deltaemax2= emax2/(1000.+0.009*et); - if (emax2>0. && deltaemax2>=CutDeltaEmax2[ibin_combined] ) + if (emax2>0. && deltaemax2>=m_cutDeltaEmax2[ibin_combined] ) iflag |= ( 0x1 << egammaPID::ClusterStripsDeltaEmax2_Electron); } // check Delta E - if (CheckVar(CutDeltaE,4)) { - if (emax2>0. && DeltaE>=CutDeltaE[ibin_combined]) + if (CheckVar(m_cutDeltaE,4)) { + if (emax2>0. && DeltaE>=m_cutDeltaE[ibin_combined]) iflag |= ( 0x1 << egammaPID::ClusterStripsDeltaE_Electron); } // check DEmaxs1 - if (CheckVar(CutDEmaxs1,4)) { - if (Eratio<=CutDEmaxs1[ibin_combined]) + if (CheckVar(m_cutDEmaxs1,4)) { + if (Eratio<=m_cutDEmaxs1[ibin_combined]) iflag |= ( 0x1 << egammaPID::ClusterStripsDEmaxs1_Electron); } // check Wtot - if (CheckVar(CutWtot,4)) { - if (wtot>=CutWtot[ibin_combined] ) + if (CheckVar(m_cutWtot,4)) { + if (wtot>=m_cutWtot[ibin_combined] ) iflag |= ( 0x1 << egammaPID::ClusterStripsWtot_Electron); } // check Fside - if (CheckVar(CutFracm,4)) { - if ( fracm >= CutFracm[ibin_combined] ) + if (CheckVar(m_cutFracm,4)) { + if ( fracm >= m_cutFracm[ibin_combined] ) iflag |= ( 0x1 << egammaPID::ClusterStripsFracm_Electron); } // check Weta1c - if (CheckVar(CutWeta1c,4)) { - if ( weta1c >= CutWeta1c[ibin_combined]) + if (CheckVar(m_cutWeta1c,4)) { + if ( weta1c >= m_cutWeta1c[ibin_combined]) iflag |= ( 0x1 << egammaPID::ClusterStripsWeta1c_Electron); } } @@ -757,27 +755,27 @@ unsigned int Root::TElectronIsEMSelector::TrackCut( // Track quality cuts // cuts on number of b-layer hits - if(CheckVar(CutBL,1) && CutBL[ibin_eta] == 1 && !passBLayerRequirement){ + if(CheckVar(m_cutBL,1) && m_cutBL[ibin_eta] == 1 && !passBLayerRequirement){ iflag |= ( 0x1 << egammaPID::TrackBlayer_Electron); } // cuts on number of pixel hits - if (CheckVar(CutPi,1)) { - if (nPixHitsPlusDeadSensors<CutPi[ibin_eta]) + if (CheckVar(m_cutPi,1)) { + if (nPixHitsPlusDeadSensors<m_cutPi[ibin_eta]) iflag |= ( 0x1 << egammaPID::TrackPixel_Electron) ; } // cuts on number of precision hits - if (CheckVar(CutSi,1)) { - if (nSiHitsPlusDeadSensors<CutSi[ibin_eta]) + if (CheckVar(m_cutSi,1)) { + if (nSiHitsPlusDeadSensors<m_cutSi[ibin_eta]) iflag |= ( 0x1 << egammaPID::TrackSi_Electron) ; } // cuts on transverse impact parameter - if (CheckVar(CutA0,1)) { - if (trackd0>CutA0[ibin_eta]) + if (CheckVar(m_cutA0,1)) { + if (trackd0>m_cutA0[ibin_eta]) iflag |= ( 0x1 << egammaPID::TrackA0_Electron) ; } // cuts on transverse impact parameter for tight selection - if (CheckVar(CutA0Tight,1)) { - if (trackd0>CutA0Tight[ibin_eta]) + if (CheckVar(m_cutA0Tight,1)) { + if (trackd0>m_cutA0Tight[ibin_eta]) iflag |= ( 0x1 << egammaPID::TrackA0Tight_Electron) ; } @@ -788,29 +786,29 @@ unsigned int Root::TElectronIsEMSelector::TrackCut( deltaeta=fabsf(deltaeta); // use absolute value - if (CheckVar(CutDeltaEta,4)) { - if ( deltaeta > CutDeltaEta[ibin_combined] ) + if (CheckVar(m_cutDeltaEta,4)) { + if ( deltaeta > m_cutDeltaEta[ibin_combined] ) iflag |= ( 0x1 << egammaPID::TrackMatchEta_Electron); } - if (CheckVar(CutminDeltaPhi,4)) { - if ( deltaphi < CutminDeltaPhi[ibin_combined] ) + if (CheckVar(m_cutminDeltaPhi,4)) { + if ( deltaphi < m_cutminDeltaPhi[ibin_combined] ) iflag |= ( 0x1 << egammaPID::TrackMatchPhi_Electron); } - if (CheckVar(CutmaxDeltaPhi,4)) { - if ( deltaphi > CutmaxDeltaPhi[ibin_combined] ) + if (CheckVar(m_cutmaxDeltaPhi,4)) { + if ( deltaphi > m_cutmaxDeltaPhi[ibin_combined] ) iflag |= ( 0x1 << egammaPID::TrackMatchPhi_Electron); } // cut on Delta Eta for Tight selection - if (CheckVar(CutDeltaEtaTight,4)) { - if ( deltaeta > CutDeltaEtaTight[ibin_combined] ) + if (CheckVar(m_cutDeltaEtaTight,4)) { + if ( deltaeta > m_cutDeltaEtaTight[ibin_combined] ) iflag |= ( 0x1 << egammaPID::TrackMatchEtaTight_Electron); } // cut on E/p - if (CheckVar(CutminEp,4) && - CheckVar(CutmaxEp,4)) { - if ( ep < CutminEp[ibin_combined] || - ep > CutmaxEp[ibin_combined] ) + if (CheckVar(m_cutminEp,4) && + CheckVar(m_cutmaxEp,4)) { + if ( ep < m_cutminEp[ibin_combined] || + ep > m_cutmaxEp[ibin_combined] ) iflag |= ( 0x1 << egammaPID::TrackMatchEoverP_Electron); } } @@ -819,10 +817,10 @@ unsigned int Root::TElectronIsEMSelector::TrackCut( // use of Transition Radiation Tracker double rTRT = 0; int nTRTTotal = 0; - if (useTRTOutliers) { + if (m_useTRTOutliers) { ///**** UGLY, UGLY; ///**** can't actually use the constant define in TrackSummary - if (useTRTXenonHits && (nTRTXenonHits!=SummaryTypeNotSet)) nTRTTotal= nTRTXenonHits; + if (m_useTRTXenonHits && (nTRTXenonHits!=SummaryTypeNotSet)) nTRTTotal= nTRTXenonHits; else nTRTTotal = nTRT+nTRTOutliers; rTRT = (nTRTTotal) > 0 ? @@ -850,14 +848,14 @@ unsigned int Root::TElectronIsEMSelector::TrackCut( int ibin_eta_TRT = -1; // loop on eta range - for (unsigned int ibinEta=0;ibinEta<CutBinEta_TRT.size();ibinEta++) { + for (unsigned int ibinEta=0;ibinEta<m_cutBinEta_TRT.size();ibinEta++) { if ( ibinEta == 0 ){ - if ( eta2 < CutBinEta_TRT[ibinEta] ) { + if ( eta2 < m_cutBinEta_TRT[ibinEta] ) { ibin_eta_TRT = ibinEta; } } else { - if ( eta2 >= CutBinEta_TRT[ibinEta-1] && - eta2 < CutBinEta_TRT[ibinEta] ) { + if ( eta2 >= m_cutBinEta_TRT[ibinEta-1] && + eta2 < m_cutBinEta_TRT[ibinEta] ) { ibin_eta_TRT = ibinEta; } } @@ -889,29 +887,29 @@ unsigned int Root::TElectronIsEMSelector::TrackCut( DeltaNum = nTRTTotal - (a5 + b5*eta2); } - if (CheckVar(CutNumTRT,2)) { - if ( DeltaNum < CutNumTRT[ibin_eta_TRT]) { + if (CheckVar(m_cutNumTRT,2)) { + if ( DeltaNum < m_cutNumTRT[ibin_eta_TRT]) { iflag |= ( 0x1 << egammaPID::TrackTRThits_Electron); } } int ibin_et_TRT = -1; // loop on ET range - if(CutBinET_TRT.size()>0){ - for (unsigned int ibinET=0;ibinET<=CutBinET_TRT.size();++ibinET) { + if(m_cutBinET_TRT.size()>0){ + for (unsigned int ibinET=0;ibinET<=m_cutBinET_TRT.size();++ibinET) { if ( ibinET == 0 ) { - if (et < CutBinET_TRT[ibinET] ) { + if (et < m_cutBinET_TRT[ibinET] ) { ibin_et_TRT = ibinET; } } - else if ( ibinET > 0 && ibinET <CutBinET_TRT.size() ) { - if ( et >= CutBinET_TRT[ibinET-1] && - et < CutBinET_TRT[ibinET] ) { + else if ( ibinET > 0 && ibinET <m_cutBinET_TRT.size() ) { + if ( et >= m_cutBinET_TRT[ibinET-1] && + et < m_cutBinET_TRT[ibinET] ) { ibin_et_TRT = ibinET; } } - else if ( ibinET == CutBinET_TRT.size() ) { - if ( et >= CutBinET_TRT[ibinET-1] ) { + else if ( ibinET == m_cutBinET_TRT.size() ) { + if ( et >= m_cutBinET_TRT[ibinET-1] ) { ibin_et_TRT = ibinET; } } @@ -920,34 +918,34 @@ unsigned int Root::TElectronIsEMSelector::TrackCut( int ibin_combined_TRT =ibin_eta_TRT; if(ibin_et_TRT>0){ - ibin_combined_TRT =ibin_et_TRT*CutBinEta_TRT.size()+ibin_eta_TRT; + ibin_combined_TRT =ibin_et_TRT*m_cutBinEta_TRT.size()+ibin_eta_TRT; } - if ( CheckVar(CutTRTRatio,5) && CheckVar(CutEProbabilityHT,5) ) + if ( CheckVar(m_cutTRTRatio,5) && CheckVar(m_cutEProbabilityHT,5) ) { ATH_MSG_WARNING("We apply both: TRT ratio and eProbabilityHT cuts, are you sure you want that, if yes good luck") ; } - if (CheckVar(CutEProbabilityHT,5)) { + if (CheckVar(m_cutEProbabilityHT,5)) { - // ATH_MSG_DEBUG("We are readng CutEProbabilityHT: bin:: "<<ibin_combined_TRT <<" trt pid "<< TRT_PID << " cut value " << CutEProbabilityHT[ibin_combined_TRT] ) ; + // ATH_MSG_DEBUG("We are readng m_cutEProbabilityHT: bin:: "<<ibin_combined_TRT <<" trt pid "<< TRT_PID << " cut value " << m_cutEProbabilityHT[ibin_combined_TRT] ) ; - if ( TRT_PID < CutEProbabilityHT[ibin_combined_TRT] && nTRTTotal > 0) { + if ( TRT_PID < m_cutEProbabilityHT[ibin_combined_TRT] && nTRTTotal > 0) { iflag |= ( 0x1 << egammaPID::TrackTRTeProbabilityHT_Electron); } } - if (CheckVar(CutTRTRatio,5)) { + if (CheckVar(m_cutTRTRatio,5)) { - // ATH_MSG_DEBUG("We are readng cut CutTRTRatio: bin:: "<<ibin_combined_TRT <<" trt pid "<< rTRT << " cut value " << CutTRTRatio[ibin_combined_TRT] ) ; + // ATH_MSG_DEBUG("We are readng cut CutTRTRatio: bin:: "<<ibin_combined_TRT <<" trt pid "<< rTRT << " cut value " << m_cutTRTRatio[ibin_combined_TRT] ) ; - if ( rTRT < CutTRTRatio[ibin_combined_TRT] && nTRTTotal > 0) { + if ( rTRT < m_cutTRTRatio[ibin_combined_TRT] && nTRTTotal > 0) { iflag |= ( 0x1 << egammaPID::TrackTRTratio_Electron); } } - if (CheckVar(CutTRTRatio90,5)) { // not really used - if ( rTRT < CutTRTRatio90[ibin_combined_TRT] ) { + if (CheckVar(m_cutTRTRatio90,5)) { // not really used + if ( rTRT < m_cutTRTRatio90[ibin_combined_TRT] ) { iflag |= ( 0x1 << egammaPID::TrackTRTratio90_Electron); } } @@ -962,21 +960,21 @@ std::vector<int> Root::TElectronIsEMSelector::FindEtEtaBin(double et, double eta //Try to figure out in which bin we belong int ibin_et = -1; // loop on ET range - if(CutBinET.size()>0){ - for (unsigned int ibinET=0;ibinET<=CutBinET.size();++ibinET) { + if(m_cutBinET.size()>0){ + for (unsigned int ibinET=0;ibinET<=m_cutBinET.size();++ibinET) { if ( ibinET == 0 ) { - if (et < CutBinET[ibinET] ) { + if (et < m_cutBinET[ibinET] ) { ibin_et = ibinET; } } - else if ( ibinET > 0 && ibinET <CutBinET.size() ) { - if ( et >= CutBinET[ibinET-1] && - et < CutBinET[ibinET] ) { + else if ( ibinET > 0 && ibinET <m_cutBinET.size() ) { + if ( et >= m_cutBinET[ibinET-1] && + et < m_cutBinET[ibinET] ) { ibin_et = ibinET; } } - else if ( ibinET == CutBinET.size() ) { - if ( et >= CutBinET[ibinET-1] ) { + else if ( ibinET == m_cutBinET.size() ) { + if ( et >= m_cutBinET[ibinET-1] ) { ibin_et = ibinET; } } @@ -984,26 +982,26 @@ std::vector<int> Root::TElectronIsEMSelector::FindEtEtaBin(double et, double eta } int ibin_eta = -1; // loop on eta range - for (unsigned int ibinEta=0;ibinEta<CutBinEta.size();++ibinEta) { + for (unsigned int ibinEta=0;ibinEta<m_cutBinEta.size();++ibinEta) { if ( ibinEta == 0 ){ - if ( eta2 < CutBinEta[ibinEta] ) { + if ( eta2 < m_cutBinEta[ibinEta] ) { ibin_eta = ibinEta; } } - else if ( ibinEta > 0 && ibinEta <CutBinEta.size() ) { - if ( eta2 >= CutBinEta[ibinEta-1] && - eta2 < CutBinEta[ibinEta] ) { + else if ( ibinEta > 0 && ibinEta <m_cutBinEta.size() ) { + if ( eta2 >= m_cutBinEta[ibinEta-1] && + eta2 < m_cutBinEta[ibinEta] ) { ibin_eta = ibinEta; } } - else if ( ibinEta == CutBinEta.size() ) { - if ( eta2 >= CutBinEta[ibinEta-1] ) { + else if ( ibinEta == m_cutBinEta.size() ) { + if ( eta2 >= m_cutBinEta[ibinEta-1] ) { ibin_eta = ibinEta; } } } - int ibin_combined = ibin_et*CutBinEta.size()+ibin_eta; + int ibin_combined = ibin_et*m_cutBinEta.size()+ibin_eta; // check the bin number std::vector<int> bins{ibin_et, ibin_eta,ibin_combined}; return bins; @@ -1025,10 +1023,10 @@ bool Root::TElectronIsEMSelector::CheckVar(const std::vector<T>& vec, int choice // if size of vector is 0 it means cut is not defined if (vec.size() == 0) return false; - unsigned int etaNB = CutBinEta.size(); - unsigned int etaTRTNB = CutBinEta_TRT.size(); - unsigned int etNB = CutBinET.size(); - unsigned int etTRTNB = CutBinET_TRT.size(); + unsigned int etaNB = m_cutBinEta.size(); + unsigned int etaTRTNB = m_cutBinEta_TRT.size(); + unsigned int etNB = m_cutBinET.size(); + unsigned int etTRTNB = m_cutBinET_TRT.size(); unsigned int combinedNB = 0; unsigned int combinedTRTNB = 0; diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronIsEMSelector.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronIsEMSelector.h index 061f1f2401fa5365dd6e925a9f8f9db46c683b6a..eeb4de30338178c1ecb46ebcbee7f46f3b7cc723 100644 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronIsEMSelector.h +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronIsEMSelector.h @@ -17,19 +17,18 @@ based on egammaElectronCutIDTool from F. Derue */ -// ROOT includes -#include <TString.h> // Include the return object and the base class -#include "PATCore/TAccept.h" -#include "PATCore/TSelectorToolBase.h" +#include "PATCore/AcceptInfo.h" +#include "PATCore/AcceptData.h" #include "ElectronPhotonSelectorTools/egammaPIDdefs.h" #include "AsgTools/AsgMessaging.h" #include <vector> +#include <string> class AsgElectronIsEMSelector; namespace Root { - class TElectronIsEMSelector : public TSelectorToolBase, public asg::AsgMessaging + class TElectronIsEMSelector : public asg::AsgMessaging { friend class ::AsgElectronIsEMSelector; @@ -44,13 +43,10 @@ namespace Root { // Main methods /** Initialize this class */ - int initialize(); - - /** Finalize this class; everything that should be done after the event loop should go here */ - inline int finalize() { return 1 ;}; + StatusCode initialize(); /** The main accept method: the actual cuts are applied here */ - const Root::TAccept& accept( + asg::AcceptData accept( // eta position in second sampling float eta2, // transverse energy in calorimeter (using eta position in second sampling) @@ -106,7 +102,10 @@ namespace Root { // E/p double ep) const; - // calculate the isEM. (Used internally by accept) + /** Return dummy accept with only info */ + asg::AcceptData accept() const { return asg::AcceptData(&m_acceptInfo); } + + // calculate the isEM. (Used internally by accept) unsigned int calcIsEm( // eta position in second sampling float eta2, @@ -236,101 +235,100 @@ namespace Root { unsigned int iflag) const; - unsigned int isEM() const {return m_isEM; }; - //unsigned int isEMMask() const {return m_isEMMask; } // user should not need this - /////////////////////////////////// // Public members (the cut values) /////////////////////////////// /** @brief which subset of cuts to apply */ - unsigned int isEMMask; + unsigned int m_isEMMask; /** @brief use of TRT outliers*/ - bool useTRTOutliers; + bool m_useTRTOutliers; /** @brief use of TRT Xenon Hits*/ - bool useTRTXenonHits; + bool m_useTRTXenonHits; /** @brief range of eta bins for e-ID*/ - std::vector<float> CutBinEta; + std::vector<float> m_cutBinEta; /** @brief range of ET bins for e-ID*/ - std::vector<float> CutBinET; + std::vector<float> m_cutBinET; /** @brief cut on fraction of energy deposited in 1st sampling for e-ID*/ - std::vector<float> CutF1; + std::vector<float> m_cutF1; /** @brief cut on hadronic energy for e-ID */ - std::vector<float> CutHadLeakage; + std::vector<float> m_cutHadLeakage; /** @brief cut on ratio e237/e277 for e-ID*/ - std::vector<float> CutReta37; + std::vector<float> m_cutReta37; /** @brief cut on ratio e233/e277 for e-ID*/ - std::vector<float> CutRphi33; + std::vector<float> m_cutRphi33; /** @brief cut on shower width in 2nd sampling for e-ID*/ - std::vector<float> CutWeta2c; + std::vector<float> m_cutWeta2c; /** @brief cut on Delta Emax2 in 1st sampling for e-ID*/ - std::vector<float> CutDeltaEmax2; + std::vector<float> m_cutDeltaEmax2; /** @brief cut on Emax2 - Emin in 1st sampling for e-ID*/ - std::vector<float> CutDeltaE; + std::vector<float> m_cutDeltaE; /** @brief cut on (Emax1-Emax2)/(Emax1-Emax2) for e-ID*/ - std::vector<float> CutDEmaxs1; + std::vector<float> m_cutDEmaxs1; /** @brief cut on total width in 1st sampling for e-ID*/ - std::vector<float> CutWtot; + std::vector<float> m_cutWtot; /** @brief cut on width in 1st sampling for e-ID*/ - std::vector<float> CutWeta1c; + std::vector<float> m_cutWeta1c; /** @brief cut on Fside in 1st sampling for e-ID*/ - std::vector<float> CutFracm; + std::vector<float> m_cutFracm; /** @brief cut values for cut on f3 */ - std::vector<float> CutF3; + std::vector<float> m_cutF3; /** @brief cut min on b-layer hits for e-ID*/ - std::vector<int> CutBL; + std::vector<int> m_cutBL; /** @brief cut min on pixel hits for e-ID*/ - std::vector<int> CutPi; + std::vector<int> m_cutPi; /** @brief cut min on precision hits for e-ID*/ - std::vector<int> CutSi; + std::vector<int> m_cutSi; /** @brief cut min on transverse impact parameter for e-ID*/ - std::vector<float> CutA0; + std::vector<float> m_cutA0; /** @brief cut min on transverse impact parameter for Tight e-ID*/ - std::vector<float> CutA0Tight; + std::vector<float> m_cutA0Tight; /** @brief cut max on delta eta for e-ID*/ - std::vector<float> CutDeltaEta; + std::vector<float> m_cutDeltaEta; /** @brief cut max on delta eta for Tight e-ID*/ - std::vector<float> CutDeltaEtaTight; + std::vector<float> m_cutDeltaEtaTight; /** @brief cut min on delta phi for e-ID (this should be negative) */ - std::vector<float> CutminDeltaPhi; + std::vector<float> m_cutminDeltaPhi; /** @brief cut max on delta phi for e-ID*/ - std::vector<float> CutmaxDeltaPhi; + std::vector<float> m_cutmaxDeltaPhi; /** @brief cut min on E/p for e-ID*/ - std::vector<float> CutminEp; + std::vector<float> m_cutminEp; /** @brief cut max on E/p for e-ID*/ - std::vector<float> CutmaxEp; + std::vector<float> m_cutmaxEp; /** @brief Eta binning for cuts on TRT for e-ID*/ - std::vector<float> CutBinEta_TRT; + std::vector<float> m_cutBinEta_TRT; /** @brief Et binning for cuts on TRT for e-ID*/ - std::vector<float> CutBinET_TRT; + std::vector<float> m_cutBinET_TRT; /** @brief cut on Number of TRT hits for e-ID*/ - std::vector<float> CutNumTRT; + std::vector<float> m_cutNumTRT; /** @brief cut on Ratio of TR hits to Number of TRT hits for e-ID*/ - std::vector<float> CutTRTRatio; + std::vector<float> m_cutTRTRatio; /** @brief cut on Ratio of TR hits to Number of TRT hits for 10% loss due to TRT */ - std::vector<float> CutTRTRatio90; + std::vector<float> m_cutTRTRatio90; /** @brief cut on on eProbabilityHT new TRT PID tool */ - std::vector<float> CutEProbabilityHT; + std::vector<float> m_cutEProbabilityHT; + const asg::AcceptInfo& getAcceptInfo() const { return m_acceptInfo; } + // Private members private: // would ideally be protected: only to be used by ARASelector - void setIsEM(unsigned int isEM) { m_isEM = isEM; }; - const Root::TAccept& fillAccept() const; + asg::AcceptData fillAccept(unsigned int isEM) const; std::vector<int> FindEtEtaBin(double et, double eta2) const; template<typename T> bool CheckVar(const std::vector<T>& vec, int choice) const; - mutable unsigned int m_isEM; - + /// Accept info + asg::AcceptInfo m_acceptInfo; + // the cut positions /** @brief cluster eta range */ @@ -407,75 +405,75 @@ namespace Root { // the cut names /** @brief cluster eta range */ - const TString m_cutNameClusterEtaRange_Electron; + const std::string m_cutNameClusterEtaRange_Electron; /** @brief matching to photon (not necessarily conversion--the name is historical) */ - const TString m_cutNameConversionMatch_Electron; + const std::string m_cutNameConversionMatch_Electron; /** @brief cluster leakage into the hadronic calorimeter */ - const TString m_cutNameClusterHadronicLeakage_Electron; + const std::string m_cutNameClusterHadronicLeakage_Electron; /** @brief energy in 2nd sampling (e.g E277>0) */ - const TString m_cutNameClusterMiddleEnergy_Electron; + const std::string m_cutNameClusterMiddleEnergy_Electron; /** @brief energy ratio in 2nd sampling (e.g E237/E277) */ - const TString m_cutNameClusterMiddleEratio37_Electron; + const std::string m_cutNameClusterMiddleEratio37_Electron; /** @brief energy ratio in 2nd sampling (e.g E233/E237) */ - const TString m_cutNameClusterMiddleEratio33_Electron; + const std::string m_cutNameClusterMiddleEratio33_Electron; /** @brief width in the second sampling (e.g Weta2) */ - const TString m_cutNameClusterMiddleWidth_Electron; + const std::string m_cutNameClusterMiddleWidth_Electron; /** @brief energy fraction in the third layer */ - const TString m_cutNameClusterBackEnergyFraction_Electron; + const std::string m_cutNameClusterBackEnergyFraction_Electron; /** @brief fraction of energy found in 1st sampling (NB: not used in fact for electrons)*/ - const TString m_cutNameClusterStripsEratio_Electron; + const std::string m_cutNameClusterStripsEratio_Electron; /** @brief energy of 2nd maximum in 1st sampling ~e2tsts1/(1000+const_lumi*et) */ - const TString m_cutNameClusterStripsDeltaEmax2_Electron; + const std::string m_cutNameClusterStripsDeltaEmax2_Electron; /** @brief difference between 2nd maximum and 1st minimum in strips (e2tsts1-emins1) */ - const TString m_cutNameClusterStripsDeltaE_Electron; + const std::string m_cutNameClusterStripsDeltaE_Electron; /** @brief shower width in 1st sampling */ - const TString m_cutNameClusterStripsWtot_Electron; + const std::string m_cutNameClusterStripsWtot_Electron; /** @brief shower shape in shower core 1st sampling */ - const TString m_cutNameClusterStripsFracm_Electron; + const std::string m_cutNameClusterStripsFracm_Electron; /** @brief shower width weighted by distance from the maximum one */ - const TString m_cutNameClusterStripsWeta1c_Electron; + const std::string m_cutNameClusterStripsWeta1c_Electron; /** @brief difference between max and 2nd max in strips */ - const TString m_cutNameClusterStripsDEmaxs1_Electron; + const std::string m_cutNameClusterStripsDEmaxs1_Electron; /** @brief B layer hit */ - const TString m_cutNameTrackBlayer_Electron; + const std::string m_cutNameTrackBlayer_Electron; /** @brief number of Pixel hits */ - const TString m_cutNameTrackPixel_Electron; + const std::string m_cutNameTrackPixel_Electron; /** @brief number of Pixel and SCT hits */ - const TString m_cutNameTrackSi_Electron; + const std::string m_cutNameTrackSi_Electron; /** @brief distance of closet approach */ - const TString m_cutNameTrackA0_Electron; + const std::string m_cutNameTrackA0_Electron; /** @brief eta difference between cluster and extrapolated track in the 1st sampling */ - const TString m_cutNameTrackMatchEta_Electron; + const std::string m_cutNameTrackMatchEta_Electron; /** @brief phi difference between cluster and extrapolated track in the 2nd sampling */ - const TString m_cutNameTrackMatchPhi_Electron; + const std::string m_cutNameTrackMatchPhi_Electron; /** @brief energy-momentum match */ - const TString m_cutNameTrackMatchEoverP_Electron; + const std::string m_cutNameTrackMatchEoverP_Electron; /** @brief Cut on the TRT eProbabilityHT_Electron */ - const TString m_cutNameTrackTRTeProbabilityHT_Electron; + const std::string m_cutNameTrackTRTeProbabilityHT_Electron; /** @brief number of TRT hits */ - const TString m_cutNameTrackTRThits_Electron; + const std::string m_cutNameTrackTRThits_Electron; /** @brief ratio of high to all TRT hits for isolated electrons */ - const TString m_cutNameTrackTRTratio_Electron; + const std::string m_cutNameTrackTRTratio_Electron; /** @brief ratio of high to all TRT hits for non-isolated electrons (not for new ++ menus) */ - const TString m_cutNameTrackTRTratio90_Electron; + const std::string m_cutNameTrackTRTratio90_Electron; /** @brief distance of closet approach for tight selection (not to be used in new ++ menus) */ - const TString m_cutNameTrackA0Tight_Electron; + const std::string m_cutNameTrackA0Tight_Electron; /** @brief eta difference between cluster and extrapolated track in the 1st sampling for tight selection (not to be used in new ++ menus)*/ - const TString m_cutNameTrackMatchEtaTight_Electron; + const std::string m_cutNameTrackMatchEtaTight_Electron; /** @brief isolation */ - const TString m_cutNameIsolation_Electron; + const std::string m_cutNameIsolation_Electron; /** @brief calorimetric isolation */ - const TString m_cutNameClusterIsolation_Electron; + const std::string m_cutNameClusterIsolation_Electron; /** @brief tracker isolation */ - const TString m_cutNameTrackIsolation_Electron; + const std::string m_cutNameTrackIsolation_Electron; diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronLikelihoodTool.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronLikelihoodTool.cxx index 33ca02417a681a4c44ab57d944a873236ac0a4eb..e5083ff8a972e75ecc59e9ff2a000c01e5f81ab6 100644 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronLikelihoodTool.cxx +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronLikelihoodTool.cxx @@ -9,8 +9,6 @@ #include <stdio.h> // for sprintf #include <algorithm> // for min #include <fstream> // for char_traits -#include "PATCore/TAccept.h" // for TAccept -#include "PATCore/TResult.h" // for TResult #include "TFile.h" // for TFile #include "TH1.h" // for TH1F #include "TString.h" // for TString @@ -28,27 +26,24 @@ //---------------------------------------------------------------------------------------- Root::TElectronLikelihoodTool::TElectronLikelihoodTool(const char* name) : - TCalculatorToolBase(name), - TSelectorToolBase(name), asg::AsgMessaging(std::string(name)), - doCutConversion(false), - doRemoveF3AtHighEt(false), - doRemoveTRTPIDAtHighEt(false), - doSmoothBinInterpolation(false), - useHighETLHBinning(false), - useOneExtraHighETLHBin(false), - HighETBinThreshold(125), - doPileupTransform(false), - doCentralityTransform(false), - DiscMaxForPileupTransform(2.0), - PileupMaxForPileupTransform(50), - VariableNames(""), - PdfFileName(""), + m_doCutConversion(false), + m_doRemoveF3AtHighEt(false), + m_doRemoveTRTPIDAtHighEt(false), + m_doSmoothBinInterpolation(false), + m_useHighETLHBinning(false), + m_useOneExtraHighETLHBin(false), + m_highETBinThreshold(125), + m_doPileupTransform(false), + m_doCentralityTransform(false), + m_discMaxForPileupTransform(2.0), + m_pileupMaxForPileupTransform(50), + m_variableNames(""), + m_pdfFileName(""), + m_name(name), m_variableBitMask(0x0), m_ipBinning(""), m_pdfFile(0), - m_resultPrefix(""), - m_resultName("likelihood"), m_cutPosition_kinematic(-9), m_cutPosition_NSilicon(-9), m_cutPosition_NPixel(-9), @@ -60,8 +55,7 @@ Root::TElectronLikelihoodTool::TElectronLikelihoodTool(const char* name) : m_cutPositionTrackMatchEta(-9), m_cutPositionTrackMatchPhiRes(-9), m_cutPositionWstotAtHighET(-9), - m_cutPositionEoverPAtHighET(-9), - m_resultPosition_LH(-9) + m_cutPositionEoverPAtHighET(-9) { for(unsigned int varIndex = 0; varIndex < s_fnVariables; varIndex++){ for(unsigned int s_or_b = 0; s_or_b < 2; s_or_b++){ @@ -101,82 +95,82 @@ Root::TElectronLikelihoodTool::~TElectronLikelihoodTool() } -int Root::TElectronLikelihoodTool::initialize() +StatusCode Root::TElectronLikelihoodTool::initialize() { ATH_MSG_DEBUG( "TElectronLikelihoodTool initialize."); // use an int as a StatusCode - int sc(1); + StatusCode sc(StatusCode::SUCCESS); // Check that all needed variables are setup - if ( PdfFileName.empty() ) + if ( m_pdfFileName.empty() ) { ATH_MSG_WARNING("You need to specify the input PDF file name before you call initialize() with setPDFFileName('your/file/name.root') "); - sc = 0; + sc = StatusCode::FAILURE; } unsigned int number_of_expected_bin_combinedLH ; - if(useHighETLHBinning) number_of_expected_bin_combinedLH = s_fnDiscEtBins*s_fnEtaBins ; - else if(useOneExtraHighETLHBin) number_of_expected_bin_combinedLH = s_fnDiscEtBinsOneExtra*s_fnEtaBins ; + if(m_useHighETLHBinning) number_of_expected_bin_combinedLH = s_fnDiscEtBins*s_fnEtaBins ; + else if(m_useOneExtraHighETLHBin) number_of_expected_bin_combinedLH = s_fnDiscEtBinsOneExtra*s_fnEtaBins ; else number_of_expected_bin_combinedLH = s_fnDiscEtBinsOrig*s_fnEtaBins ; unsigned int number_of_expected_bin_combinedOther = s_fnDiscEtBinsOrig*s_fnEtaBins ; - if( CutLikelihood.size() != number_of_expected_bin_combinedLH){ - ATH_MSG_ERROR("Configuration issue : CutLikelihood expected size " << number_of_expected_bin_combinedLH << - " input size " << CutLikelihood.size()); - sc = 0; + if( m_cutLikelihood.size() != number_of_expected_bin_combinedLH){ + ATH_MSG_ERROR("Configuration issue : cutLikelihood expected size " << number_of_expected_bin_combinedLH << + " input size " << m_cutLikelihood.size()); + sc = StatusCode::FAILURE; } - if( DiscHardCutForPileupTransform.size() >0 ) { - if( DiscHardCutForPileupTransform.size() != number_of_expected_bin_combinedLH){ + if( m_discHardCutForPileupTransform.size() >0 ) { + if( m_discHardCutForPileupTransform.size() != number_of_expected_bin_combinedLH){ ATH_MSG_ERROR("Configuration issue : DiscHardCutForPileupTransform expected size " << number_of_expected_bin_combinedLH << - " input size " << DiscHardCutForPileupTransform.size()); - sc = 0; + " input size " << m_discHardCutForPileupTransform.size()); + sc = StatusCode::FAILURE; } } - if(DiscHardCutSlopeForPileupTransform.size() >0 ) { - if(DiscHardCutSlopeForPileupTransform.size() != number_of_expected_bin_combinedLH){ + if(m_discHardCutSlopeForPileupTransform.size() >0 ) { + if(m_discHardCutSlopeForPileupTransform.size() != number_of_expected_bin_combinedLH){ ATH_MSG_ERROR("Configuration issue : DiscHardCutSlopeForPileupTransform expected size " << number_of_expected_bin_combinedLH << - " input size " << DiscHardCutSlopeForPileupTransform.size()); - sc = 0; + " input size " << m_discHardCutSlopeForPileupTransform.size()); + sc = StatusCode::FAILURE; } } - if(DiscLooseForPileupTransform.size() >0) { - if( DiscLooseForPileupTransform.size() != number_of_expected_bin_combinedLH){ + if(m_discLooseForPileupTransform.size() >0) { + if( m_discLooseForPileupTransform.size() != number_of_expected_bin_combinedLH){ ATH_MSG_ERROR("Configuration issue : DiscLooseForPileupTransform expected size " << number_of_expected_bin_combinedLH << - " input size " << DiscLooseForPileupTransform.size()); - sc = 0; + " input size " << m_discLooseForPileupTransform.size()); + sc = StatusCode::FAILURE; } } // d0 cut - if (CutA0.size() >0){ - if (CutA0.size() != number_of_expected_bin_combinedOther){ + if (m_cutA0.size() >0){ + if (m_cutA0.size() != number_of_expected_bin_combinedOther){ ATH_MSG_ERROR("Configuration issue : CutA0 expected size " << number_of_expected_bin_combinedOther << - " input size " << CutA0.size()); - sc = 0; + " input size " << m_cutA0.size()); + sc = StatusCode::FAILURE; } } // deltaEta cut - if (CutDeltaEta.size() >0){ - if (CutDeltaEta.size() != number_of_expected_bin_combinedOther){ + if (m_cutDeltaEta.size() >0){ + if (m_cutDeltaEta.size() != number_of_expected_bin_combinedOther){ ATH_MSG_ERROR("Configuration issue : CutDeltaEta expected size " << number_of_expected_bin_combinedOther << - " input size " << CutDeltaEta.size()); - sc = 0; + " input size " << m_cutDeltaEta.size()); + sc = StatusCode::FAILURE; } } // deltaPhiRes cut - if (CutDeltaPhiRes.size() >0){ - if (CutDeltaPhiRes.size() != number_of_expected_bin_combinedOther ){ + if (m_cutDeltaPhiRes.size() >0){ + if (m_cutDeltaPhiRes.size() != number_of_expected_bin_combinedOther ){ ATH_MSG_ERROR("Configuration issue : CutDeltaPhiRes expected size " << number_of_expected_bin_combinedOther << - " input size " << CutDeltaPhiRes.size()); - sc = 0; + " input size " << m_cutDeltaPhiRes.size()); + sc = StatusCode::FAILURE; } } - if ( sc == 0 ){ + if ( sc == StatusCode::FAILURE ){ ATH_MSG_ERROR("Could NOT initialize! Please fix the errors mentioned above..."); return sc; } @@ -184,87 +178,78 @@ int Root::TElectronLikelihoodTool::initialize() // -------------------------------------------------------------------------- // Register the cuts and check that the registration worked: // NOTE: THE ORDER IS IMPORTANT!!! Cut0 corresponds to bit 0, Cut1 to bit 1,... - // if ( m_cutPosition_nSCTMin < 0 ) sc = 0; // Exceeded the number of allowed cuts (32) + // if ( m_cutPosition_nSCTMin < 0 ) sc == StatusCode::FAILURE; // Exceeded the number of allowed cuts (32) // Cut position for the kineatic pre-selection - m_cutPosition_kinematic = m_accept.addCut( "kinematic", "pass kinematic" ); - if ( m_cutPosition_kinematic < 0 ) {sc = 0;} + m_cutPosition_kinematic = m_acceptInfo.addCut( "kinematic", "pass kinematic" ); + if ( m_cutPosition_kinematic < 0 ) {sc = StatusCode::FAILURE;} // NSilicon - m_cutPosition_NSilicon = m_accept.addCut( "NSilicon", "pass NSilicon" ); - if ( m_cutPosition_NSilicon < 0 ) {sc = 0;} + m_cutPosition_NSilicon = m_acceptInfo.addCut( "NSilicon", "pass NSilicon" ); + if ( m_cutPosition_NSilicon < 0 ) {sc = StatusCode::FAILURE;} // NPixel - m_cutPosition_NPixel = m_accept.addCut( "NPixel", "pass NPixel" ); - if ( m_cutPosition_NPixel < 0 ) {sc = 0;} + m_cutPosition_NPixel = m_acceptInfo.addCut( "NPixel", "pass NPixel" ); + if ( m_cutPosition_NPixel < 0 ) {sc = StatusCode::FAILURE;} // NBlayer - m_cutPosition_NBlayer = m_accept.addCut( "NBlayer", "pass NBlayer" ); - if ( m_cutPosition_NBlayer < 0 ) {sc = 0;} + m_cutPosition_NBlayer = m_acceptInfo.addCut( "NBlayer", "pass NBlayer" ); + if ( m_cutPosition_NBlayer < 0 ) {sc = StatusCode::FAILURE;} // Conversion - m_cutPosition_conversion = m_accept.addCut( "conversion", "pass conversion" ); - if ( m_cutPosition_conversion < 0 ) {sc = 0;} + m_cutPosition_conversion = m_acceptInfo.addCut( "conversion", "pass conversion" ); + if ( m_cutPosition_conversion < 0 ) {sc = StatusCode::FAILURE;} // Ambiguity - m_cutPosition_ambiguity = m_accept.addCut( "ambiguity", "pass ambiguity" ); - if ( m_cutPosition_ambiguity < 0 ) {sc = 0;} + m_cutPosition_ambiguity = m_acceptInfo.addCut( "ambiguity", "pass ambiguity" ); + if ( m_cutPosition_ambiguity < 0 ) {sc = StatusCode::FAILURE;} // Cut position for the likelihood selection - DO NOT CHANGE ORDER! - m_cutPosition_LH = m_accept.addCut( "passLH", "pass Likelihood" ); - if ( m_cutPosition_LH < 0 ) {sc = 0;} + m_cutPosition_LH = m_acceptInfo.addCut( "passLH", "pass Likelihood" ); + if ( m_cutPosition_LH < 0 ) {sc = StatusCode::FAILURE;} // D0 - m_cutPositionTrackA0 = m_accept.addCut( "TrackA0", "A0 (aka d0) wrt beam spot < Cut" ); - if ( m_cutPositionTrackA0 < 0 ) {sc = 0;} + m_cutPositionTrackA0 = m_acceptInfo.addCut( "TrackA0", "A0 (aka d0) wrt beam spot < Cut" ); + if ( m_cutPositionTrackA0 < 0 ) {sc = StatusCode::FAILURE;} // deltaeta - m_cutPositionTrackMatchEta = m_accept.addCut("TrackMatchEta", "Track match deta in 1st sampling < Cut"); - if ( m_cutPositionTrackMatchEta < 0 ) {sc = 0;} + m_cutPositionTrackMatchEta = m_acceptInfo.addCut("TrackMatchEta", "Track match deta in 1st sampling < Cut"); + if ( m_cutPositionTrackMatchEta < 0 ) {sc = StatusCode::FAILURE;} // deltaphi - m_cutPositionTrackMatchPhiRes = m_accept.addCut( "TrackMatchPhiRes", "Track match dphi in 2nd sampling, rescaled < Cut" ); - if ( m_cutPositionTrackMatchPhiRes < 0 ) {sc = 0;} + m_cutPositionTrackMatchPhiRes = m_acceptInfo.addCut( "TrackMatchPhiRes", "Track match dphi in 2nd sampling, rescaled < Cut" ); + if ( m_cutPositionTrackMatchPhiRes < 0 ) {sc = StatusCode::FAILURE;} // Wstot - m_cutPositionWstotAtHighET = m_accept.addCut( "WstotAtHighET", "Above HighETBinThreshold, Wstot < Cut" ); - if ( m_cutPositionWstotAtHighET < 0 ) {sc = 0;} + m_cutPositionWstotAtHighET = m_acceptInfo.addCut( "WstotAtHighET", "Above HighETBinThreshold, Wstot < Cut" ); + if ( m_cutPositionWstotAtHighET < 0 ) {sc = StatusCode::FAILURE;} // EoverP - m_cutPositionEoverPAtHighET = m_accept.addCut( "EoverPAtHighET", "Above HighETBinThreshold, EoverP < Cut" ); - if ( m_cutPositionEoverPAtHighET < 0 ) {sc = 0;} - - // -------------------------------------------------------------------------- - // Register the cuts and check that the registration worked: - // NOTE: THE ORDER IS IMPORTANT!!! Cut0 corresponds to bit 0, Cut1 to bit 1,... - m_resultPosition_LH = m_result.addResult( (m_resultPrefix+m_resultName).c_str(), "electron likelihood" ); - if ( m_resultPosition_LH < 0 ) sc = 0; // Exceeded the number of allowed results - - // Set the result to a defaul value - m_result.setResult( m_resultPosition_LH, -9999.0 ); + m_cutPositionEoverPAtHighET = m_acceptInfo.addCut( "EoverPAtHighET", "Above HighETBinThreshold, EoverP < Cut" ); + if ( m_cutPositionEoverPAtHighET < 0 ) {sc = StatusCode::FAILURE;} // Check that we got everything OK - if ( sc == 0 ){ + if ( sc == StatusCode::FAILURE ){ ATH_MSG_ERROR("! Something went wrong with the setup of the decision objects..."); - return 0; + return sc; } // ---------------------------------- // Get the correct bit mask for the current likelihood operating point - m_variableBitMask = GetLikelihoodBitmask(VariableNames); + m_variableBitMask = getLikelihoodBitmask(m_variableNames); //----------File/Histo operation------------------------------------ // Load the ROOT file containing the PDFs - TString tmpString(PdfFileName); + TString tmpString(m_pdfFileName); gSystem->ExpandPathName(tmpString); std::string fname(tmpString.Data()); m_pdfFile = TFile::Open( fname.c_str(), "READ" ); // Check that we could load the ROOT file if ( !m_pdfFile ) { - ATH_MSG_ERROR(" No ROOT file found here: " << PdfFileName); - return 0; + ATH_MSG_ERROR(" No ROOT file found here: " << m_pdfFileName); + return StatusCode::FAILURE; } //Load the histograms @@ -272,10 +257,10 @@ int Root::TElectronLikelihoodTool::initialize() const std::string& vstr = fVariables[varIndex]; // Skip the loading of PDFs for variables we don't care about for this operating point. // If the string is empty (which is true in the default 2012 case), load all of them. - if(VariableNames.find(vstr) == std::string::npos && !VariableNames.empty()){ + if(m_variableNames.find(vstr) == std::string::npos && !m_variableNames.empty()){ continue; } - LoadVarHistograms(vstr,varIndex); + loadVarHistograms(vstr,varIndex); } //TFile close does not free the memory @@ -285,36 +270,35 @@ int Root::TElectronLikelihoodTool::initialize() //----------End File/Histo operation------------------------------------ ATH_MSG_DEBUG("Initialization complete for a LH tool with these specs:" - << "\n - PdfFileName : " << PdfFileName - << "\n - Result name : " << (m_resultPrefix+m_resultName).c_str() + << "\n - pdfFileName : " << m_pdfFileName << "\n - Variable bitmask : " << m_variableBitMask); - ATH_MSG_DEBUG("\n - VariableNames : " << VariableNames - << "\n - (bool)CutBL (yes/no) : " << (CutBL.size() ? "yes" : "no") - << "\n - (bool)CutPi (yes/no) : " << (CutPi.size() ? "yes" : "no") - << "\n - (bool)CutSi (yes/no) : " << (CutSi.size() ? "yes" : "no") - << "\n - (bool)doCutConversion (yes/no) : " << (doCutConversion ? "yes" : "no") - << "\n - (bool)CutAmbiguity (yes/no) : " << (CutAmbiguity.size() ? "yes" : "no") - << "\n - (bool)doRemoveF3AtHighEt (yes/no) : " << (doRemoveF3AtHighEt ? "yes" : "no") - << "\n - (bool)doRemoveTRTPIDAtHighEt (yes/no) : " << (doRemoveTRTPIDAtHighEt ? "yes" : "no") - << "\n - (bool)doSmoothBinInterpolation (yes/no) : " << (doSmoothBinInterpolation ? "yes" : "no") - << "\n - (bool)useHighETLHBinning (yes/no) : " << (useHighETLHBinning ? "yes" : "no") - << "\n - (bool)useOneExtraHighETLHBin(yes/no) : " << (useOneExtraHighETLHBin ? "yes" : "no") - << "\n - (double)HighETBinThreshold : " << HighETBinThreshold - << "\n - (bool)doPileupTransform (yes/no) : " << (doPileupTransform ? "yes" : "no") - << "\n - (bool)doCentralityTransform (yes/no) : " << (doCentralityTransform ? "yes" : "no") - << "\n - (bool)CutLikelihood (yes/no) : " << (CutLikelihood.size() ? "yes" : "no") - << "\n - (bool)CutLikelihoodPileupCorrection (yes/no) : " << (CutLikelihoodPileupCorrection.size() ? "yes" : "no") - << "\n - (bool)CutA0 (yes/no) : " << (CutA0.size() ? "yes" : "no") - << "\n - (bool)CutDeltaEta (yes/no) : " << (CutDeltaEta.size() ? "yes" : "no") - << "\n - (bool)CutDeltaPhiRes (yes/no) : " << (CutDeltaPhiRes.size() ? "yes" : "no") - << "\n - (bool)CutWstotAtHighET (yes/no) : " << (CutWstotAtHighET.size() ? "yes" : "no") - << "\n - (bool)CutEoverPAtHighET (yes/no) : " << (CutEoverPAtHighET.size() ? "yes" : "no") + ATH_MSG_DEBUG( "\n - VariableNames : " << m_variableNames + << "\n - (bool)CutBL (yes/no) : " << (m_cutBL.size() ? "yes" : "no") + << "\n - (bool)CutPi (yes/no) : " << (m_cutPi.size() ? "yes" : "no") + << "\n - (bool)CutSi (yes/no) : " << (m_cutSi.size() ? "yes" : "no") + << "\n - (bool)doCutConversion (yes/no) : " << (m_doCutConversion ? "yes" : "no") + << "\n - (bool)CutAmbiguity (yes/no) : " << (m_cutAmbiguity.size() ? "yes" : "no") + << "\n - (bool)doRemoveF3AtHighEt (yes/no) : " << (m_doRemoveF3AtHighEt ? "yes" : "no") + << "\n - (bool)doRemoveTRTPIDAtHighEt (yes/no) : " << (m_doRemoveTRTPIDAtHighEt ? "yes" : "no") + << "\n - (bool)doSmoothBinInterpolation (yes/no) : " << (m_doSmoothBinInterpolation ? "yes" : "no") + << "\n - (bool)useHighETLHBinning (yes/no) : " << (m_useHighETLHBinning ? "yes" : "no") + << "\n - (bool)useOneExtraHighETLHBin(yes/no) : " << (m_useOneExtraHighETLHBin ? "yes" : "no") + << "\n - (double)HighETBinThreshold : " << m_highETBinThreshold + << "\n - (bool)doPileupTransform (yes/no) : " << (m_doPileupTransform ? "yes" : "no") + << "\n - (bool)doCentralityTransform (yes/no) : " << (m_doCentralityTransform ? "yes" : "no") + << "\n - (bool)CutLikelihood (yes/no) : " << (m_cutLikelihood.size() ? "yes" : "no") + << "\n - (bool)CutLikelihoodPileupCorrection (yes/no) : " << (m_cutLikelihoodPileupCorrection.size() ? "yes" : "no") + << "\n - (bool)CutA0 (yes/no) : " << (m_cutA0.size() ? "yes" : "no") + << "\n - (bool)CutDeltaEta (yes/no) : " << (m_cutDeltaEta.size() ? "yes" : "no") + << "\n - (bool)CutDeltaPhiRes (yes/no) : " << (m_cutDeltaPhiRes.size() ? "yes" : "no") + << "\n - (bool)CutWstotAtHighET (yes/no) : " << (m_cutWstotAtHighET.size() ? "yes" : "no") + << "\n - (bool)CutEoverPAtHighET (yes/no) : " << (m_cutEoverPAtHighET.size() ? "yes" : "no") ); return sc; } -int Root::TElectronLikelihoodTool::LoadVarHistograms(std::string vstr,unsigned int varIndex){ +int Root::TElectronLikelihoodTool::loadVarHistograms(std::string vstr,unsigned int varIndex){ for(unsigned int s_or_b = 0; s_or_b < 2; s_or_b++){ for (unsigned int ip = 0; ip < IP_BINS; ip++){ for(unsigned int et = 0; et < s_fnEtBinsHist; et++){ @@ -343,7 +327,7 @@ int Root::TElectronLikelihoodTool::LoadVarHistograms(std::string vstr,unsigned i char pdf[500]; snprintf(pdf,500,"%s_%s_smoothed_hist_from_KDE_%s",vstr.c_str(),sig_bkg.c_str(),binname); char pdf_newname[500]; - snprintf(pdf_newname,500,"%s_%s_%s_LHtool_copy_%s",Root::TSelectorToolBase::getName(),vstr.c_str(),sig_bkg.c_str(),binname); + snprintf(pdf_newname,500,"%s_%s_%s_LHtool_copy_%s", m_name.c_str(),vstr.c_str(),sig_bkg.c_str(),binname); if (!m_pdfFile->GetListOfKeys()->Contains(vstr.c_str())){ ATH_MSG_INFO("Warning: skipping variable " << vstr << " because the folder does not exist."); @@ -357,7 +341,7 @@ int Root::TElectronLikelihoodTool::LoadVarHistograms(std::string vstr,unsigned i // For backwards compatibility: // If we are not using the high ET LH binning, we only need to load PDFs // up to a certain ET value (40 GeV) - if(!useHighETLHBinning && et > s_fnEtBinsHistOrig-1){ + if(!m_useHighETLHBinning && et > s_fnEtBinsHistOrig-1){ continue; } @@ -368,7 +352,7 @@ int Root::TElectronLikelihoodTool::LoadVarHistograms(std::string vstr,unsigned i //std::cout << "Info: using 7 GeV bin in place of 4 GeV bin." << std::endl; getBinName( binname, et_tmp+1, eta_tmp, ip, m_ipBinning ); snprintf(pdf,500,"%s_%s_smoothed_hist_from_KDE_%s",vstr.c_str(),sig_bkg.c_str(),binname); - snprintf(pdf_newname,500,"%s_%s_%s_LHtool_copy4GeV_%s",Root::TSelectorToolBase::getName(),vstr.c_str(),sig_bkg.c_str(),binname); + snprintf(pdf_newname,500,"%s_%s_%s_LHtool_copy4GeV_%s", m_name.c_str(),vstr.c_str(),sig_bkg.c_str(),binname); } if (((TDirectory*)m_pdfFile->Get(pdfdir))->GetListOfKeys()->Contains(pdf)) { TH1F* hist = (TH1F*)(((TDirectory*)m_pdfFile->Get(pdfdir))->Get(pdf)); @@ -387,13 +371,22 @@ int Root::TElectronLikelihoodTool::LoadVarHistograms(std::string vstr,unsigned i return 1; } -const Root::TAccept& Root::TElectronLikelihoodTool::accept( double likelihood, - double eta, double eT, - int nSiHitsPlusDeadSensors, int nPixHitsPlusDeadSensors, - bool passBLayerRequirement, - int convBit, uint8_t ambiguityBit, double d0, double deltaEta, double deltaphires, - double wstot, double EoverP, double ip - ) const +asg::AcceptData +Root::TElectronLikelihoodTool::accept( double likelihood, + double eta, + double eT, + int nSiHitsPlusDeadSensors, + int nPixHitsPlusDeadSensors, + bool passBLayerRequirement, + int convBit, + uint8_t ambiguityBit, + double d0, + double deltaEta, + double deltaphires, + double wstot, + double EoverP, + double ip + ) const { LikeEnum::LHAcceptVars_t vars; @@ -416,10 +409,11 @@ const Root::TAccept& Root::TElectronLikelihoodTool::accept( double likelihood, } // This method calculates if the current electron passes the requested likelihood cut -const Root::TAccept& Root::TElectronLikelihoodTool::accept( LikeEnum::LHAcceptVars_t& vars_struct ) const +asg::AcceptData +Root::TElectronLikelihoodTool::accept( LikeEnum::LHAcceptVars_t& vars_struct ) const { - // Reset the cut result bits to zero (= fail cut) - m_accept.clear(); + // Setup return accept with AcceptInfo + asg::AcceptData acceptData(&m_acceptInfo); // Set up the individual cuts bool passKine(true); @@ -458,19 +452,19 @@ const Root::TAccept& Root::TElectronLikelihoodTool::accept( LikeEnum::LHAcceptVa // Return if the kinematic requirements are not fulfilled - m_accept.setCutResult( m_cutPosition_kinematic, passKine ); - if ( !passKine ){ return m_accept; } + acceptData.setCutResult( m_cutPosition_kinematic, passKine ); + if ( !passKine ){ return acceptData; } // conversion bit - if (doCutConversion && vars_struct.convBit){ + if (m_doCutConversion && vars_struct.convBit){ ATH_MSG_DEBUG("Likelihood macro: Conversion Bit Failed." ); passConversion = false; } // ambiguity bit - if (CutAmbiguity.size()) { + if (m_cutAmbiguity.size()) { if ( !ElectronSelectorHelpers::passAmbiguity((xAOD::AmbiguityTool::AmbiguityType)vars_struct.ambiguityBit, - CutAmbiguity[etabin]) + m_cutAmbiguity[etabin]) ) { ATH_MSG_DEBUG("Likelihood macro: ambiguity Bit Failed." ); passAmbiguity = false; @@ -478,22 +472,22 @@ const Root::TAccept& Root::TElectronLikelihoodTool::accept( LikeEnum::LHAcceptVa } // blayer cut - if (CutBL.size() ) { - if(CutBL[etabin] == 1 && !vars_struct.passBLayerRequirement) { + if (m_cutBL.size() ) { + if(m_cutBL[etabin] == 1 && !vars_struct.passBLayerRequirement) { ATH_MSG_DEBUG("Likelihood macro: Blayer cut failed."); passNBlayer = false; } } // pixel cut - if (CutPi.size()){ - if (vars_struct.nPixHitsPlusDeadSensors < CutPi[etabin]){ + if (m_cutPi.size()){ + if (vars_struct.nPixHitsPlusDeadSensors < m_cutPi[etabin]){ ATH_MSG_DEBUG("Likelihood macro: Pixels Failed."); passNPixel = false; } } // silicon cut - if (CutSi.size()){ - if (vars_struct.nSiHitsPlusDeadSensors < CutSi[etabin]){ + if (m_cutSi.size()){ + if (vars_struct.nSiHitsPlusDeadSensors < m_cutSi[etabin]){ ATH_MSG_DEBUG( "Likelihood macro: Silicon Failed."); passNSilicon = false; } @@ -503,29 +497,29 @@ const Root::TAccept& Root::TElectronLikelihoodTool::accept( LikeEnum::LHAcceptVa unsigned int ibin_combinedLH = etbinLH*10+etabin; // Must change if number of eta bins changes!. Also starts from 7-10 GeV bin. unsigned int ibin_combinedOther = etbinOther*10+etabin; // Must change if number of eta bins changes!. Also starts from 7-10 GeV bin. - if(CutLikelihood.size()){ + if(m_cutLikelihood.size()){ // To protect against a binning mismatch, which should never happen - if(ibin_combinedLH>=CutLikelihood.size()){ + if(ibin_combinedLH>=m_cutLikelihood.size()){ ATH_MSG_ERROR("The desired eta/pt bin " << ibin_combinedLH - << " is outside of the range specified by the input" << CutLikelihood.size() << "This should never happen!"); - return m_accept; + << " is outside of the range specified by the input" << m_cutLikelihood.size() << "This should never happen!"); + return acceptData; } - if (doSmoothBinInterpolation){ - cutDiscriminant = InterpolateCuts(CutLikelihood,CutLikelihood4GeV,vars_struct.eT,vars_struct.eta); - if (!doPileupTransform && CutLikelihoodPileupCorrection.size() && CutLikelihoodPileupCorrection4GeV.size()) - cutDiscriminant += vars_struct.ip*InterpolateCuts(CutLikelihoodPileupCorrection,CutLikelihoodPileupCorrection4GeV,vars_struct.eT,vars_struct.eta); + if (m_doSmoothBinInterpolation){ + cutDiscriminant = InterpolateCuts(m_cutLikelihood,m_cutLikelihood4GeV,vars_struct.eT,vars_struct.eta); + if (!m_doPileupTransform && m_cutLikelihoodPileupCorrection.size() && m_cutLikelihoodPileupCorrection4GeV.size()) + cutDiscriminant += vars_struct.ip*InterpolateCuts(m_cutLikelihoodPileupCorrection,m_cutLikelihoodPileupCorrection4GeV,vars_struct.eT,vars_struct.eta); } else { - if (vars_struct.eT > 7000. || !CutLikelihood4GeV.size()){ - cutDiscriminant = CutLikelihood[ibin_combinedLH]; + if (vars_struct.eT > 7000. || !m_cutLikelihood4GeV.size()){ + cutDiscriminant = m_cutLikelihood[ibin_combinedLH]; // If doPileupTransform, then correct the discriminant itself instead of the cut value - if (!doPileupTransform && CutLikelihoodPileupCorrection.size()) - cutDiscriminant += vars_struct.ip*CutLikelihoodPileupCorrection[ibin_combinedLH]; + if (!m_doPileupTransform && m_cutLikelihoodPileupCorrection.size()) + cutDiscriminant += vars_struct.ip*m_cutLikelihoodPileupCorrection[ibin_combinedLH]; } else { - cutDiscriminant = CutLikelihood4GeV[etabin]; - if (!doPileupTransform && CutLikelihoodPileupCorrection4GeV.size()) - cutDiscriminant += vars_struct.ip*CutLikelihoodPileupCorrection4GeV[etabin]; + cutDiscriminant = m_cutLikelihood4GeV[etabin]; + if (!m_doPileupTransform && m_cutLikelihoodPileupCorrection4GeV.size()) + cutDiscriminant += vars_struct.ip*m_cutLikelihoodPileupCorrection4GeV[etabin]; } } @@ -539,42 +533,42 @@ const Root::TAccept& Root::TElectronLikelihoodTool::accept( LikeEnum::LHAcceptVa } // d0 cut - if (CutA0.size()){ - if (fabs(vars_struct.d0) > CutA0[ibin_combinedOther]){ + if (m_cutA0.size()){ + if (fabs(vars_struct.d0) > m_cutA0[ibin_combinedOther]){ ATH_MSG_DEBUG("Likelihood macro: D0 Failed."); passTrackA0 = false; } } // deltaEta cut - if (CutDeltaEta.size()){ - if ( fabs(vars_struct.deltaEta) > CutDeltaEta[ibin_combinedOther]){ + if (m_cutDeltaEta.size()){ + if ( fabs(vars_struct.deltaEta) > m_cutDeltaEta[ibin_combinedOther]){ ATH_MSG_DEBUG("Likelihood macro: deltaEta Failed."); passDeltaEta = false; } } // deltaPhiRes cut - if (CutDeltaPhiRes.size()){ - if ( fabs(vars_struct.deltaphires) > CutDeltaPhiRes[ibin_combinedOther]){ + if (m_cutDeltaPhiRes.size()){ + if ( fabs(vars_struct.deltaphires) > m_cutDeltaPhiRes[ibin_combinedOther]){ ATH_MSG_DEBUG("Likelihood macro: deltaphires Failed."); passDeltaPhiRes = false; } } // Only do this above HighETBinThreshold [in GeV] - if(vars_struct.eT > HighETBinThreshold*1000){ + if(vars_struct.eT > m_highETBinThreshold*1000){ // wstot cut - if (CutWstotAtHighET.size()){ - if ( fabs(vars_struct.wstot) > CutWstotAtHighET[etabin]){ + if (m_cutWstotAtHighET.size()){ + if ( fabs(vars_struct.wstot) > m_cutWstotAtHighET[etabin]){ ATH_MSG_DEBUG("Likelihood macro: wstot Failed."); passWstotAtHighET = false; } } // EoverP cut - if (CutEoverPAtHighET.size()){ - if ( fabs(vars_struct.EoverP) > CutEoverPAtHighET[etabin]){ + if (m_cutEoverPAtHighET.size()){ + if ( fabs(vars_struct.EoverP) > m_cutEoverPAtHighET[etabin]){ ATH_MSG_DEBUG("Likelihood macro: EoverP Failed."); passEoverPAtHighET = false; } @@ -582,25 +576,26 @@ const Root::TAccept& Root::TElectronLikelihoodTool::accept( LikeEnum::LHAcceptVa } // Set the individual cut bits in the return object - m_accept.setCutResult( m_cutPosition_NSilicon, passNSilicon ); - m_accept.setCutResult( m_cutPosition_NPixel, passNPixel ); - m_accept.setCutResult( m_cutPosition_NBlayer, passNBlayer ); - m_accept.setCutResult( m_cutPosition_conversion, passConversion ); - m_accept.setCutResult( m_cutPosition_ambiguity, passAmbiguity ); - m_accept.setCutResult( m_cutPosition_LH, passLH ); - m_accept.setCutResult( m_cutPositionTrackA0, passTrackA0 ); - m_accept.setCutResult( m_cutPositionTrackMatchEta, passDeltaEta ); - m_accept.setCutResult( m_cutPositionTrackMatchPhiRes, passDeltaPhiRes ); - m_accept.setCutResult( m_cutPositionWstotAtHighET, passWstotAtHighET ); - m_accept.setCutResult( m_cutPositionEoverPAtHighET, passEoverPAtHighET ); - return m_accept; + acceptData.setCutResult( m_cutPosition_NSilicon, passNSilicon ); + acceptData.setCutResult( m_cutPosition_NPixel, passNPixel ); + acceptData.setCutResult( m_cutPosition_NBlayer, passNBlayer ); + acceptData.setCutResult( m_cutPosition_conversion, passConversion ); + acceptData.setCutResult( m_cutPosition_ambiguity, passAmbiguity ); + acceptData.setCutResult( m_cutPosition_LH, passLH ); + acceptData.setCutResult( m_cutPositionTrackA0, passTrackA0 ); + acceptData.setCutResult( m_cutPositionTrackMatchEta, passDeltaEta ); + acceptData.setCutResult( m_cutPositionTrackMatchPhiRes, passDeltaPhiRes ); + acceptData.setCutResult( m_cutPositionWstotAtHighET, passWstotAtHighET ); + acceptData.setCutResult( m_cutPositionEoverPAtHighET, passEoverPAtHighET ); + return acceptData; } -const Root::TResult& Root::TElectronLikelihoodTool::calculate( double eta, double eT,double f3, double rHad, double rHad1, - double Reta, double w2, double f1, double eratio, - double deltaEta, double d0, double d0sigma, double rphi, - double deltaPoverP ,double deltaphires, double TRT_PID, - double ip ) const +double +Root::TElectronLikelihoodTool::calculate( double eta, double eT,double f3, double rHad, double rHad1, + double Reta, double w2, double f1, double eratio, + double deltaEta, double d0, double d0sigma, double rphi, + double deltaPoverP ,double deltaphires, double TRT_PID, + double ip ) const { LikeEnum::LHCalcVars_t vars; @@ -627,10 +622,11 @@ const Root::TResult& Root::TElectronLikelihoodTool::calculate( double eta, doubl } // The main public method to actually calculate the likelihood value -const Root::TResult& Root::TElectronLikelihoodTool::calculate(LikeEnum::LHCalcVars_t& vars_struct) const +double +Root::TElectronLikelihoodTool::calculate(LikeEnum::LHCalcVars_t& vars_struct) const { // Reset the results to defaul values - m_result.setResult( m_resultPosition_LH, -999.0 ); + double result = -999; unsigned int etabin = getLikelihoodEtaBin(vars_struct.eta); double rhad_corr; @@ -647,27 +643,26 @@ const Root::TResult& Root::TElectronLikelihoodTool::calculate(LikeEnum::LHCalcVa std::vector<double> vec (arr, arr + sizeof(arr) / sizeof(double) ); // Calculate the actual likelihood value and fill the return object - double lhVal = this->EvaluateLikelihood(vec,vars_struct.eT,vars_struct.eta,vars_struct.ip); - m_result.setResult( m_resultPosition_LH, lhVal ); + result = this->evaluateLikelihood(vec,vars_struct.eT,vars_struct.eta,vars_struct.ip); - return m_result; + return result; } -double Root::TElectronLikelihoodTool::EvaluateLikelihood(std::vector<float> varVector,double et,double eta,double ip) const +double Root::TElectronLikelihoodTool::evaluateLikelihood(std::vector<float> varVector,double et,double eta,double ip) const { std::vector<double> vec; for(unsigned int var = 0; var < s_fnVariables; var++){ vec.push_back(varVector[var]); } - return EvaluateLikelihood(vec,et,eta,ip);//,mask); + return evaluateLikelihood(vec,et,eta,ip);//,mask); } -double Root::TElectronLikelihoodTool::EvaluateLikelihood(std::vector<double> varVector,double et,double eta,double ip) const +double Root::TElectronLikelihoodTool::evaluateLikelihood(std::vector<double> varVector,double et,double eta,double ip) const { const double GeV = 1000; @@ -715,11 +710,11 @@ double Root::TElectronLikelihoodTool::EvaluateLikelihood(std::vector<double> var continue; } // Don't use f3 for high et (>80 GeV) - if (doRemoveF3AtHighEt && (et > 80*GeV) && (varstr.find(el_f3_string) != std::string::npos)){ + if (m_doRemoveF3AtHighEt && (et > 80*GeV) && (varstr.find(el_f3_string) != std::string::npos)){ continue; } // Don't use TRTPID for high et (>80 GeV) - if (doRemoveTRTPIDAtHighEt && (et > 80*GeV) && (varstr.find(el_TRT_PID_string) != std::string::npos)){ + if (m_doRemoveTRTPIDAtHighEt && (et > 80*GeV) && (varstr.find(el_TRT_PID_string) != std::string::npos)){ continue; } for (unsigned int s_or_b=0; s_or_b<2;s_or_b++) { @@ -727,7 +722,7 @@ double Root::TElectronLikelihoodTool::EvaluateLikelihood(std::vector<double> var int bin = fPDFbins[s_or_b][ipbin][etbin][etabin][var]->FindBin(varVector[var]); double prob = 0; - if (doSmoothBinInterpolation) { + if (m_doSmoothBinInterpolation) { prob = InterpolatePdfs(s_or_b,ipbin,et,eta,bin,var); } else { @@ -771,7 +766,7 @@ double Root::TElectronLikelihoodTool::TransformLikelihoodOutput(double ps,double // the old scheme of changing the cut value based on pileup. This is simpler for // the tuning, as well as ensuring subsets / making discriminants more transparent. // In the HI case, a quadratic centrality transform is applied instead. - if(doPileupTransform){ + if(m_doPileupTransform){ // The variables used by the transform: // @@ -783,12 +778,12 @@ double Root::TElectronLikelihoodTool::TransformLikelihoodOutput(double ps,double // - pileup_max = max nvtx or mu for calculating the transform. Any larger // pileup values will use this maximum value in the transform. - if( DiscHardCutForPileupTransform.size() == 0 || DiscHardCutSlopeForPileupTransform.size() == 0 || DiscLooseForPileupTransform.size() == 0){ + if( m_discHardCutForPileupTransform.size() == 0 || m_discHardCutSlopeForPileupTransform.size() == 0 || m_discLooseForPileupTransform.size() == 0){ ATH_MSG_WARNING("Vectors needed for pileup-dependent transform not correctly filled! Skipping the transform."); return disc; } - if(doCentralityTransform && DiscHardCutQuadForPileupTransform.size() == 0){ + if(m_doCentralityTransform && m_discHardCutQuadForPileupTransform.size() == 0){ ATH_MSG_WARNING("Vectors needed for centrality-dependent transform not correctly filled! Skipping the transform."); return disc; } @@ -799,36 +794,36 @@ double Root::TElectronLikelihoodTool::TransformLikelihoodOutput(double ps,double double disc_hard_cut_ref_slope = 0; double disc_hard_cut_ref_quad = 0; // only used for heavy ion implementation of the LH double disc_loose_ref = 0; - double disc_max = DiscMaxForPileupTransform; - double pileup_max = PileupMaxForPileupTransform; - - if (doSmoothBinInterpolation){ - disc_hard_cut_ref = InterpolateCuts(DiscHardCutForPileupTransform,DiscHardCutForPileupTransform4GeV,et,eta); - disc_hard_cut_ref_slope = InterpolateCuts(DiscHardCutSlopeForPileupTransform,DiscHardCutSlopeForPileupTransform4GeV,et,eta); - if (doCentralityTransform) disc_hard_cut_ref_quad = InterpolateCuts(DiscHardCutQuadForPileupTransform,DiscHardCutQuadForPileupTransform4GeV,et,eta); - disc_loose_ref = InterpolateCuts(DiscLooseForPileupTransform,DiscLooseForPileupTransform4GeV,et,eta); + double disc_max = m_discMaxForPileupTransform; + double pileup_max = m_pileupMaxForPileupTransform; + + if (m_doSmoothBinInterpolation){ + disc_hard_cut_ref = InterpolateCuts(m_discHardCutForPileupTransform,m_discHardCutForPileupTransform4GeV,et,eta); + disc_hard_cut_ref_slope = InterpolateCuts(m_discHardCutSlopeForPileupTransform,m_discHardCutSlopeForPileupTransform4GeV,et,eta); + if (m_doCentralityTransform) disc_hard_cut_ref_quad = InterpolateCuts(m_discHardCutQuadForPileupTransform,m_discHardCutQuadForPileupTransform4GeV,et,eta); + disc_loose_ref = InterpolateCuts(m_discLooseForPileupTransform,m_discLooseForPileupTransform4GeV,et,eta); } else { // default situation, in the case where 4-7 GeV bin is not defined - if (et > 7000. || !DiscHardCutForPileupTransform4GeV.size()){ + if (et > 7000. || !m_discHardCutForPileupTransform4GeV.size()){ unsigned int etfinebinLH = getLikelihoodEtDiscBin(et,true); unsigned int ibin_combined = etfinebinLH*10+etabin; - disc_hard_cut_ref = DiscHardCutForPileupTransform[ibin_combined]; - disc_hard_cut_ref_slope = DiscHardCutSlopeForPileupTransform[ibin_combined]; - if (doCentralityTransform) disc_hard_cut_ref_quad = DiscHardCutQuadForPileupTransform[ibin_combined]; - disc_loose_ref = DiscLooseForPileupTransform[ibin_combined]; + disc_hard_cut_ref = m_discHardCutForPileupTransform[ibin_combined]; + disc_hard_cut_ref_slope = m_discHardCutSlopeForPileupTransform[ibin_combined]; + if (m_doCentralityTransform) disc_hard_cut_ref_quad = m_discHardCutQuadForPileupTransform[ibin_combined]; + disc_loose_ref = m_discLooseForPileupTransform[ibin_combined]; } else { - if( DiscHardCutForPileupTransform4GeV.size() == 0 || DiscHardCutSlopeForPileupTransform4GeV.size() == 0 || DiscLooseForPileupTransform4GeV.size() == 0){ + if( m_discHardCutForPileupTransform4GeV.size() == 0 || m_discHardCutSlopeForPileupTransform4GeV.size() == 0 || m_discLooseForPileupTransform4GeV.size() == 0){ ATH_MSG_WARNING("Vectors needed for pileup-dependent transform not correctly filled for 4-7 GeV bin! Skipping the transform."); return disc; } - if(doCentralityTransform && DiscHardCutQuadForPileupTransform4GeV.size() == 0){ + if(m_doCentralityTransform && m_discHardCutQuadForPileupTransform4GeV.size() == 0){ ATH_MSG_WARNING("Vectors needed for centrality-dependent transform not correctly filled for 4-7 GeV bin! Skipping the transform."); return disc; } - disc_hard_cut_ref = DiscHardCutForPileupTransform4GeV[etabin]; - disc_hard_cut_ref_slope = DiscHardCutSlopeForPileupTransform4GeV[etabin]; - if (doCentralityTransform) disc_hard_cut_ref_quad = DiscHardCutQuadForPileupTransform4GeV[etabin]; - disc_loose_ref = DiscLooseForPileupTransform4GeV[etabin]; + disc_hard_cut_ref = m_discHardCutForPileupTransform4GeV[etabin]; + disc_hard_cut_ref_slope = m_discHardCutSlopeForPileupTransform4GeV[etabin]; + if (m_doCentralityTransform) disc_hard_cut_ref_quad = m_discHardCutQuadForPileupTransform4GeV[etabin]; + disc_loose_ref = m_discLooseForPileupTransform4GeV[etabin]; } } @@ -894,7 +889,7 @@ unsigned int Root::TElectronLikelihoodTool::getLikelihoodEtaBin(double eta) cons unsigned int Root::TElectronLikelihoodTool::getLikelihoodEtHistBin(double eT) const { const double GeV = 1000; - if(useHighETLHBinning){ + if(m_useHighETLHBinning){ const unsigned int nEtBins = s_fnEtBinsHist; const double eTBins[nEtBins] = {7*GeV,10*GeV,15*GeV,20*GeV,30*GeV,40*GeV,100*GeV,6000*GeV}; @@ -923,7 +918,7 @@ unsigned int Root::TElectronLikelihoodTool::getLikelihoodEtHistBin(double eT) co unsigned int Root::TElectronLikelihoodTool::getLikelihoodEtDiscBin(double eT, const bool isLHbinning) const{ const double GeV = 1000; - if(useHighETLHBinning && isLHbinning){ + if(m_useHighETLHBinning && isLHbinning){ const unsigned int nEtBins = s_fnDiscEtBins; const double eTBins[nEtBins] = {10*GeV,15*GeV,20*GeV,25*GeV,30*GeV,35*GeV,40*GeV,45*GeV ,100*GeV,150*GeV,200*GeV,250*GeV,300*GeV,350*GeV,400*GeV @@ -938,9 +933,9 @@ unsigned int Root::TElectronLikelihoodTool::getLikelihoodEtDiscBin(double eT, co return nEtBins-1; // Return the last bin if > the last bin. } - else if(useOneExtraHighETLHBin && isLHbinning){ + else if(m_useOneExtraHighETLHBin && isLHbinning){ const unsigned int nEtBins = s_fnDiscEtBinsOneExtra; - const double eTBins[nEtBins] = {10*GeV,15*GeV,20*GeV,25*GeV,30*GeV,35*GeV,40*GeV,45*GeV,HighETBinThreshold*GeV,6000*GeV}; + const double eTBins[nEtBins] = {10*GeV,15*GeV,20*GeV,25*GeV,30*GeV,35*GeV,40*GeV,45*GeV,m_highETBinThreshold*GeV,6000*GeV}; for(unsigned int eTBin = 0; eTBin < nEtBins; ++eTBin){ if(eT < eTBins[eTBin]) @@ -981,7 +976,7 @@ void Root::TElectronLikelihoodTool::getBinName(char* buffer, int etbin,int etabi //---------------------------------------------------------------------------------------- -unsigned int Root::TElectronLikelihoodTool::GetLikelihoodBitmask(std::string vars) const{ +unsigned int Root::TElectronLikelihoodTool::getLikelihoodBitmask(std::string vars) const{ unsigned int mask = 0x0; ATH_MSG_DEBUG ("Variables to be used: "); for(unsigned int var = 0; var < s_fnVariables; var++){ diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronLikelihoodTool.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronLikelihoodTool.h index af678b0a4eec99e40a482ca4cbe480fa33cb8dbd..b1b548c680c450118ee31cd618a51505f92f9eb3 100644 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronLikelihoodTool.h +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronLikelihoodTool.h @@ -89,317 +89,307 @@ #include <fstream> #include <iostream> // Include the return objects and the base class -#include "PATCore/TCalculatorToolBase.h" -#include "PATCore/TSelectorToolBase.h" #include "AsgTools/AsgMessaging.h" +#include "PATCore/AcceptInfo.h" +#include "PATCore/AcceptData.h" #include <string> // for string #include <vector> // for vector class TFile; class TH1F; -namespace Root { class TAccept; } -namespace Root { class TResult; } namespace{ - const unsigned int IP_BINS=1; + const unsigned int IP_BINS=1; } namespace LikeEnum { - struct LHAcceptVars_t{ - double likelihood; - double eta; - double eT; - int nSiHitsPlusDeadSensors; - int nPixHitsPlusDeadSensors; - bool passBLayerRequirement; - int convBit; - uint8_t ambiguityBit; - double d0; - double deltaEta; - double deltaphires; - double wstot; - double EoverP; - double ip; - }; - - struct LHCalcVars_t{ - double eta; - double eT; - double f3; - double rHad; - double rHad1; - double Reta; - double w2; - double f1; - double eratio; - double deltaEta; - double d0; - double d0sigma; - double rphi; - double deltaPoverP; - double deltaphires; - double TRT_PID; - double ip; - }; + struct LHAcceptVars_t{ + double likelihood; + double eta; + double eT; + int nSiHitsPlusDeadSensors; + int nPixHitsPlusDeadSensors; + bool passBLayerRequirement; + int convBit; + uint8_t ambiguityBit; + double d0; + double deltaEta; + double deltaphires; + double wstot; + double EoverP; + double ip; + }; + + struct LHCalcVars_t{ + double eta; + double eT; + double f3; + double rHad; + double rHad1; + double Reta; + double w2; + double f1; + double eratio; + double deltaEta; + double d0; + double d0sigma; + double rphi; + double deltaPoverP; + double deltaphires; + double TRT_PID; + double ip; + }; } namespace Root { - class TElectronLikelihoodTool : public TCalculatorToolBase, public TSelectorToolBase, public asg::AsgMessaging - { + class TElectronLikelihoodTool : public asg::AsgMessaging + { - public: - /// Standard constructor + public: + /// Standard constructor - TElectronLikelihoodTool(const char* name = "TElectronLikelihoodTool"); + TElectronLikelihoodTool(const char* name = "TElectronLikelihoodTool"); - /// Standard destructor - ~TElectronLikelihoodTool(); - - private: - class SafeTH1{ - public : - SafeTH1(TH1F* hist); - ~SafeTH1(); - int GetNbinsX(); - int FindBin(double); - double GetBinContent(int); - double GetBinLowEdge(int); - double Integral(); + /// Standard destructor + ~TElectronLikelihoodTool(); private: - std::vector<float> m_binContent; - double m_firstBinLowEdge; - double m_lastBinLowEdge; - double m_binWidth; - double m_integral; - }; - - // Main methods - public: - /// Initialize this class - int initialize(); - - /// Finalize this class; everything that should be done after the event loop should go here - int finalize() {return 1;} - - /// The main accept method: the actual cuts are applied here - const Root::TAccept& accept(LikeEnum::LHAcceptVars_t& vars_struct) const; - const Root::TAccept& accept( double likelihood, - double eta, double eT, - int nSiHitsPlusDeadSensors, int nPixHitsPlusDeadSensors, - bool passBLayerRequirement, - int convBit, uint8_t ambiguityBit, double d0, double deltaEta, double deltaphires, - double wstot, double EoverP, double ip ) const; - const Root::TResult& calculate(LikeEnum::LHCalcVars_t& vars_struct) const ; - const Root::TResult& calculate( double eta, double eT,double f3, double rHad, double rHad1, - double Reta, double w2, double f1, double eratio, - double deltaEta, double d0, double d0sigma, double rphi, - double deltaPoverP ,double deltaphires, double TRT_PID, - double ip) const; + class SafeTH1{ + public : + SafeTH1(TH1F* hist); + ~SafeTH1(); + int GetNbinsX(); + int FindBin(double); + double GetBinContent(int); + double GetBinLowEdge(int); + double Integral(); + + private: + std::vector<float> m_binContent; + double m_firstBinLowEdge; + double m_lastBinLowEdge; + double m_binWidth; + double m_integral; + }; + + // Main methods + public: + /// Initialize this class + StatusCode initialize(); + + /// accesss to the accept info object + const asg::AcceptInfo& getAcceptInfo() const { return m_acceptInfo; } + + /// The main accept method: the actual cuts are applied here + asg::AcceptData accept(LikeEnum::LHAcceptVars_t& vars_struct) const; + asg::AcceptData accept( double likelihood, + double eta, double eT, + int nSiHitsPlusDeadSensors, int nPixHitsPlusDeadSensors, + bool passBLayerRequirement, + int convBit, uint8_t ambiguityBit, double d0, double deltaEta, double deltaphires, + double wstot, double EoverP, double ip ) const; + /** Return dummy accept with only info */ + asg::AcceptData accept() const { return asg::AcceptData(&m_acceptInfo); } + + double calculate(LikeEnum::LHCalcVars_t& vars_struct) const ; + double calculate( double eta, double eT,double f3, double rHad, double rHad1, + double Reta, double w2, double f1, double eratio, + double deltaEta, double d0, double d0sigma, double rphi, + double deltaPoverP ,double deltaphires, double TRT_PID, + double ip) const; - /// Add an input file that holds the PDFs - inline void setPDFFileName ( const std::string& val ) { PdfFileName = val; } - - /// Define the variable names - inline void setVariableNames ( const std::string& val ) { - VariableNames = val; - m_variableBitMask = GetLikelihoodBitmask(val); - } + /// Add an input file that holds the PDFs + inline void setPDFFileName ( const std::string& val ) { m_pdfFileName = val; } - /// Load the variable histograms from the pdf file. - int LoadVarHistograms(std::string vstr, unsigned int varIndex); + /// Define the variable names + inline void setVariableNames ( const std::string& val ) { + m_variableNames = val; + m_variableBitMask = getLikelihoodBitmask(val); + } - /// Define the binning - inline void setBinning ( const std::string& val ) { m_ipBinning = val; } + /// Load the variable histograms from the pdf file. + int loadVarHistograms(std::string vstr, unsigned int varIndex); - /// Set the prefix of the result name - inline void setResultPrefix ( const std::string& val ) { m_resultPrefix = val; } - - /// The string for the result - inline void setResultName ( const std::string& val ) { m_resultName = val; } + /// Define the binning + inline void setBinning ( const std::string& val ) { m_ipBinning = val; } - unsigned int getBitmask(void) const { return m_variableBitMask;} - inline void setBitmask(unsigned int val) { m_variableBitMask = val; }; + unsigned int getBitmask(void) const { return m_variableBitMask;} + inline void setBitmask(unsigned int val) { m_variableBitMask = val; }; - // Private methods - private: + // Private methods + private: - // For every input "varVector", make sure elements of vector are - // in the same order as prescribed in fVariables + // For every input "varVector", make sure elements of vector are + // in the same order as prescribed in fVariables - /// Description??? - double EvaluateLikelihood(std::vector<double> varVector,double et,double eta,double ip=0) const; + /// Description??? + double evaluateLikelihood(std::vector<double> varVector,double et,double eta,double ip=0) const; - /// Description??? - double EvaluateLikelihood(std::vector<float> varVector,double et,double eta,double ip=0) const; + /// Description??? + double evaluateLikelihood(std::vector<float> varVector,double et,double eta,double ip=0) const; - // To concoct a bitmask on your own, use the - // variable names prescribed in fVariables. + // To concoct a bitmask on your own, use the + // variable names prescribed in fVariables. - /// Description??? - unsigned int GetLikelihoodBitmask(std::string vars) const; + /// Description??? + unsigned int getLikelihoodBitmask(std::string vars) const; - double InterpolateCuts(const std::vector<double>& cuts,const std::vector<double>& cuts_4gev,double et,double eta) const; - double InterpolatePdfs(unsigned int s_or_b,unsigned int ipbin,double et,double eta,int bin,unsigned int var) const; + double InterpolateCuts(const std::vector<double>& cuts,const std::vector<double>& cuts_4gev,double et,double eta) const; + double InterpolatePdfs(unsigned int s_or_b,unsigned int ipbin,double et,double eta,int bin,unsigned int var) const; - public: - /** @brief cut min on b-layer hits*/ - std::vector<int> CutBL; - /** @brief cut min on pixel hits*/ - std::vector<int> CutPi; - /** @brief cut min on precision hits*/ - std::vector<int> CutSi; - /** @brief cut max on track d0 bit*/ - std::vector<double> CutA0; - /** @brief do cut on delta eta bit*/ - std::vector<double> CutDeltaEta; - // /** @brief do cut on delta phi bit*/ - std::vector<double> CutDeltaPhiRes; - /** @brief do cut on conversion bit*/ - bool doCutConversion; - /** @brief do cut on ambiguity bit*/ - std::vector<int> CutAmbiguity; - /** @brief do remove f3 variable from likelihood at high Et (>80 GeV)*/ - bool doRemoveF3AtHighEt; - /** @brief do remove TRTPID variable from likelihood at high Et (>80 GeV)*/ - bool doRemoveTRTPIDAtHighEt; - /** @brief do smooth interpolation between bins */ - bool doSmoothBinInterpolation; - /** @brief use binning for high ET LH*/ - bool useHighETLHBinning; - /** @brief use one extra bin for high ET LH*/ - bool useOneExtraHighETLHBin; - /** @brief ET threshold for using high ET cuts and bin */ - double HighETBinThreshold; - // /** @brief do cut on wstot above HighETBinThreshold bit*/ - std::vector<double> CutWstotAtHighET; - // /** @brief do cut on EoverP above HighETBinThreshold bit*/ - std::vector<double> CutEoverPAtHighET; - /** @brief do pileup-dependent transform on discriminant value*/ - bool doPileupTransform; - /** @brief do centrality-dependent transform on discriminant value*/ - bool doCentralityTransform; - /** @brief cut on likelihood output*/ - std::vector<double> CutLikelihood; - /** @brief pileup correction factor for cut on likelihood output*/ - std::vector<double> CutLikelihoodPileupCorrection; - /** @brief cut on likelihood output, 4 GeV bin*/ - std::vector<double> CutLikelihood4GeV; - /** @brief pileup correction factor for cut on likelihood output, 4 GeV bin*/ - std::vector<double> CutLikelihoodPileupCorrection4GeV; - /** @brief reference disc for very hard cut; used by pileup transform */ - std::vector<double> DiscHardCutForPileupTransform; - /** @brief reference slope on disc for very hard cut; used by pileup transform */ - std::vector<double> DiscHardCutSlopeForPileupTransform; - /** @brief reference quadratic apr on disc for very hard cut; used by centrality transform */ - std::vector<double> DiscHardCutQuadForPileupTransform; - /** @brief reference disc for a pileup independent loose menu; used by pileup transform */ - std::vector<double> DiscLooseForPileupTransform; - /** @brief reference disc for very hard cut; used by pileup transform - 4-7 GeV */ - std::vector<double> DiscHardCutForPileupTransform4GeV; - /** @brief reference slope on disc for very hard cut; used by pileup transform - 4-7 GeV */ - std::vector<double> DiscHardCutSlopeForPileupTransform4GeV; - /** @brief reference quadratic par on disc for very hard cut; used by centrality transform - 4-7 GeV */ - std::vector<double> DiscHardCutQuadForPileupTransform4GeV; - /** @brief reference disc for a pileup independent loose menu; used by pileup transform - 4-7 GeV */ - std::vector<double> DiscLooseForPileupTransform4GeV; - /** @brief max discriminant for which pileup transform is to be used */ - double DiscMaxForPileupTransform; - /** @brief max nvtx or mu to be used in pileup transform */ - double PileupMaxForPileupTransform; - /** @brief variables to use in the LH*/ - std::string VariableNames; - /** Name of the pdf file*/ - std::string PdfFileName; - - - // Private methods - private: - /// Apply a transform to zoom into the LH output peaks. Optionally do pileup correction too - double TransformLikelihoodOutput(double ps,double pb, double ip, double et, double eta) const; - - /// Eta binning for pdfs and discriminant cuts. - unsigned int getLikelihoodEtaBin(double eta) const ; - - /// Coarse Et binning. Used for the likelihood pdfs. - unsigned int getLikelihoodEtHistBin(double eT) const ; - - /// Fine Et binning. Used for the likelihood discriminant cuts. - unsigned int getLikelihoodEtDiscBin(double eT , const bool isLHbinning) const; - - - // Private member variables - private: - - /// The bitmask corresponding to the variables in the likelihood. For internal use. - unsigned int m_variableBitMask; + public: + /** @brief cut min on b-layer hits*/ + std::vector<int> m_cutBL; + /** @brief cut min on pixel hits*/ + std::vector<int> m_cutPi; + /** @brief cut min on precision hits*/ + std::vector<int> m_cutSi; + /** @brief cut max on track d0 bit*/ + std::vector<double> m_cutA0; + /** @brief do cut on delta eta bit*/ + std::vector<double> m_cutDeltaEta; + // /** @brief do cut on delta phi bit*/ + std::vector<double> m_cutDeltaPhiRes; + /** @brief do cut on conversion bit*/ + bool m_doCutConversion; + /** @brief do cut on ambiguity bit*/ + std::vector<int> m_cutAmbiguity; + /** @brief do remove f3 variable from likelihood at high Et (>80 GeV)*/ + bool m_doRemoveF3AtHighEt; + /** @brief do remove TRTPID variable from likelihood at high Et (>80 GeV)*/ + bool m_doRemoveTRTPIDAtHighEt; + /** @brief do smooth interpolation between bins */ + bool m_doSmoothBinInterpolation; + /** @brief use binning for high ET LH*/ + bool m_useHighETLHBinning; + /** @brief use one extra bin for high ET LH*/ + bool m_useOneExtraHighETLHBin; + /** @brief ET threshold for using high ET cuts and bin */ + double m_highETBinThreshold; + // /** @brief do cut on wstot above HighETBinThreshold bit*/ + std::vector<double> m_cutWstotAtHighET; + // /** @brief do cut on EoverP above HighETBinThreshold bit*/ + std::vector<double> m_cutEoverPAtHighET; + /** @brief do pileup-dependent transform on discriminant value*/ + bool m_doPileupTransform; + /** @brief do centrality-dependent transform on discriminant value*/ + bool m_doCentralityTransform; + /** @brief cut on likelihood output*/ + std::vector<double> m_cutLikelihood; + /** @brief pileup correction factor for cut on likelihood output*/ + std::vector<double> m_cutLikelihoodPileupCorrection; + /** @brief cut on likelihood output, 4 GeV bin*/ + std::vector<double> m_cutLikelihood4GeV; + /** @brief pileup correction factor for cut on likelihood output, 4 GeV bin*/ + std::vector<double> m_cutLikelihoodPileupCorrection4GeV; + /** @brief reference disc for very hard cut; used by pileup transform */ + std::vector<double> m_discHardCutForPileupTransform; + /** @brief reference slope on disc for very hard cut; used by pileup transform */ + std::vector<double> m_discHardCutSlopeForPileupTransform; + /** @brief reference quadratic apr on disc for very hard cut; used by centrality transform */ + std::vector<double> m_discHardCutQuadForPileupTransform; + /** @brief reference disc for a pileup independent loose menu; used by pileup transform */ + std::vector<double> m_discLooseForPileupTransform; + /** @brief reference disc for very hard cut; used by pileup transform - 4-7 GeV */ + std::vector<double> m_discHardCutForPileupTransform4GeV; + /** @brief reference slope on disc for very hard cut; used by pileup transform - 4-7 GeV */ + std::vector<double> m_discHardCutSlopeForPileupTransform4GeV; + /** @brief reference quadratic par on disc for very hard cut; used by centrality transform - 4-7 GeV */ + std::vector<double> m_discHardCutQuadForPileupTransform4GeV; + /** @brief reference disc for a pileup independent loose menu; used by pileup transform - 4-7 GeV */ + std::vector<double> m_discLooseForPileupTransform4GeV; + /** @brief max discriminant for which pileup transform is to be used */ + double m_discMaxForPileupTransform; + /** @brief max nvtx or mu to be used in pileup transform */ + double m_pileupMaxForPileupTransform; + /** @brief variables to use in the LH*/ + std::string m_variableNames; + /** Name of the pdf file*/ + std::string m_pdfFileName; + + + // Private methods + private: + /// Apply a transform to zoom into the LH output peaks. Optionally do pileup correction too + double TransformLikelihoodOutput(double ps,double pb, double ip, double et, double eta) const; - /// Deprecated. - std::string m_ipBinning; + /// Eta binning for pdfs and discriminant cuts. + unsigned int getLikelihoodEtaBin(double eta) const ; - /// Pointer to the opened TFile that holds the PDFs - TFile* m_pdfFile; + /// Coarse Et binning. Used for the likelihood pdfs. + unsigned int getLikelihoodEtHistBin(double eT) const ; + + /// Fine Et binning. Used for the likelihood discriminant cuts. + unsigned int getLikelihoodEtDiscBin(double eT , const bool isLHbinning) const; - /// The prefix string for the result - std::string m_resultPrefix; + // Private member variables + private: + /// tool name + std::string m_name; + + /// Accept info + asg::AcceptInfo m_acceptInfo; + + /// The bitmask corresponding to the variables in the likelihood. For internal use. + unsigned int m_variableBitMask; - /// The string for the result - std::string m_resultName; + /// Deprecated. + std::string m_ipBinning; - /// The position of the kinematic cut bit in the TAccept return object - int m_cutPosition_kinematic; + /// Pointer to the opened TFile that holds the PDFs + TFile* m_pdfFile; - /// The position of the NSilicon cut bit in the TAccept return object - int m_cutPosition_NSilicon; + /// The position of the kinematic cut bit in the AcceptInfo return object + int m_cutPosition_kinematic; - /// The position of the NPixel cut bit in the TAccept return object - int m_cutPosition_NPixel; + /// The position of the NSilicon cut bit in the AcceptInfo return object + int m_cutPosition_NSilicon; - /// The position of the NBlayer cut bit in the TAccept return object - int m_cutPosition_NBlayer; + /// The position of the NPixel cut bit in the AcceptInfo return object + int m_cutPosition_NPixel; - /// The position of the conversion cut bit in the TAccept return object - int m_cutPosition_conversion; + /// The position of the NBlayer cut bit in the AcceptInfo return object + int m_cutPosition_NBlayer; - /// The position of the ambiguity cut bit in the TAccept return object - int m_cutPosition_ambiguity; + /// The position of the conversion cut bit in the AcceptInfo return object + int m_cutPosition_conversion; - /// The position of the likelihood cut bit in the TAccept return object - int m_cutPosition_LH; + /// The position of the ambiguity cut bit in the AcceptInfo return object + int m_cutPosition_ambiguity; - /// The position of the d0 cut bit in the TAccept return object - int m_cutPositionTrackA0; + /// The position of the likelihood cut bit in the AcceptInfo return object + int m_cutPosition_LH; - /// The position of the deltaeta cut bit in the TAccept return object - int m_cutPositionTrackMatchEta; + /// The position of the d0 cut bit in the AcceptInfo return object + int m_cutPositionTrackA0; - // /// The position of the deltaphi cut bit in the TAccept return object - int m_cutPositionTrackMatchPhiRes; + /// The position of the deltaeta cut bit in the AcceptInfo return object + int m_cutPositionTrackMatchEta; - // /// The position of the high ET wstot cut bit in the TAccept return object - int m_cutPositionWstotAtHighET; + // /// The position of the deltaphi cut bit in the AcceptInfo return object + int m_cutPositionTrackMatchPhiRes; - // /// The position of the high ET EoverP cut bit in the TAccept return object - int m_cutPositionEoverPAtHighET; + // /// The position of the high ET wstot cut bit in the AcceptInfo return object + int m_cutPositionWstotAtHighET; - /// The position of the likelihood value bit in the TResult return object - int m_resultPosition_LH; + // /// The position of the high ET EoverP cut bit in the AcceptInfo return object + int m_cutPositionEoverPAtHighET; - static const double fIpBounds[IP_BINS+1]; - static const unsigned int s_fnEtBinsHist = 8; // number of hists stored for LH with many high ET bins (useHighETLHBinning), including 4GeV bin - static const unsigned int s_fnDiscEtBins = 33; // number of discs stored for LH with many high ET bins (useHighETLHBinning), excluding 4GeV bin - static const unsigned int s_fnEtBinsHistOrig = 7; // number of hists stored for original LH, including 4GeV bin (for backwards compatibility) - static const unsigned int s_fnDiscEtBinsOrig = 9; // number of discs stored for original LH, excluding 4GeV bin (for backwards compatibility) - static const unsigned int s_fnDiscEtBinsOneExtra = 10; // number of discs stored for original LH plus one for HighETBinThreshold (useOneExtraHighETLHBin), excluding 4GeV bin - static const unsigned int s_fnEtaBins = 10; - static const unsigned int s_fnVariables = 13; - TElectronLikelihoodTool::SafeTH1* fPDFbins [2][IP_BINS][s_fnEtBinsHist][s_fnEtaBins][s_fnVariables]; // [sig(0)/bkg(1)][ip][et][eta][variable] - static const std::string fVariables [s_fnVariables]; + static const double fIpBounds[IP_BINS+1]; + static const unsigned int s_fnEtBinsHist = 8; // number of hists stored for LH with many high ET bins (useHighETLHBinning), including 4GeV bin + static const unsigned int s_fnDiscEtBins = 33; // number of discs stored for LH with many high ET bins (useHighETLHBinning), excluding 4GeV bin + static const unsigned int s_fnEtBinsHistOrig = 7; // number of hists stored for original LH, including 4GeV bin (for backwards compatibility) + static const unsigned int s_fnDiscEtBinsOrig = 9; // number of discs stored for original LH, excluding 4GeV bin (for backwards compatibility) + static const unsigned int s_fnDiscEtBinsOneExtra = 10; // number of discs stored for original LH plus one for HighETBinThreshold (useOneExtraHighETLHBin), excluding 4GeV bin + static const unsigned int s_fnEtaBins = 10; + static const unsigned int s_fnVariables = 13; + TElectronLikelihoodTool::SafeTH1* fPDFbins [2][IP_BINS][s_fnEtBinsHist][s_fnEtaBins][s_fnVariables]; // [sig(0)/bkg(1)][ip][et][eta][variable] + static const std::string fVariables [s_fnVariables]; - unsigned int getIpBin(double ip) const; - void getBinName(char* buffer, int etbin,int etabin, int ipbin, std::string iptype) const; - }; + unsigned int getIpBin(double ip) const; + void getBinName(char* buffer, int etbin,int etabin, int ipbin, std::string iptype) const; + }; } // End: namespace Root diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronMultiLeptonSelector.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronMultiLeptonSelector.cxx index 419c7eb1ef4acf17121b60210853a0beb928e81b..a8fafe6786e117abfe2057fd108363fabcc74c35 100644 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronMultiLeptonSelector.cxx +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronMultiLeptonSelector.cxx @@ -21,7 +21,6 @@ Description: Electron selector tool to select objects in pure ROOT using the mul // Constructor //============================================================================= Root::TElectronMultiLeptonSelector::TElectronMultiLeptonSelector(const char* name) : - TSelectorToolBase(name), asg::AsgMessaging(std::string(name)), GeV(1000.0), m_cutPosition_Coverage(-9), @@ -55,73 +54,73 @@ Root::TElectronMultiLeptonSelector::~TElectronMultiLeptonSelector() //============================================================================= // Initialize this selector tool //============================================================================= -int Root::TElectronMultiLeptonSelector::initialize() +StatusCode Root::TElectronMultiLeptonSelector::initialize() { - // use an int as a StatusCode - int sc(1); + + StatusCode sc(StatusCode::SUCCESS); // -------------------------------------------------------------------------- // Register the cuts and check that the registration worked: // NOTE: THE ORDER IS IMPORTANT!!! Cut0 corresponds to bit 0, Cut1 to bit 1,... - // if ( m_cutPosition_nSCTMin < 0 ) sc = 0; // Exceeded the number of allowed cuts (32) + // if ( m_cutPosition_nSCTMin < 0 ) sc = StatusCode::FAILURE; // Exceeded the number of allowed cuts (32) // RHad - m_cutPosition_Coverage = m_accept.addCut( "Coverage", "Coverage" ); - if ( m_cutPosition_Coverage < 0 ) sc = 0; + m_cutPosition_Coverage = m_acceptInfo.addCut( "Coverage", "Coverage" ); + if ( m_cutPosition_Coverage < 0 ) sc = StatusCode::FAILURE; // RHad - m_cutPosition_RHad = m_accept.addCut( "RHad", "RHad" ); - if ( m_cutPosition_RHad < 0 ) sc = 0; + m_cutPosition_RHad = m_acceptInfo.addCut( "RHad", "RHad" ); + if ( m_cutPosition_RHad < 0 ) sc = StatusCode::FAILURE; // f3 - m_cutPosition_F3 = m_accept.addCut( "F3", "F3" ); - if ( m_cutPosition_F3 < 0 ) sc = 0; + m_cutPosition_F3 = m_acceptInfo.addCut( "F3", "F3" ); + if ( m_cutPosition_F3 < 0 ) sc = StatusCode::FAILURE; // Reta - m_cutPosition_Reta = m_accept.addCut( "Reta", "Reta" ); - if ( m_cutPosition_Reta < 0 ) sc = 0; + m_cutPosition_Reta = m_acceptInfo.addCut( "Reta", "Reta" ); + if ( m_cutPosition_Reta < 0 ) sc = StatusCode::FAILURE; // w2 - m_cutPosition_W2 = m_accept.addCut( "W2", "W2" ); - if ( m_cutPosition_W2 < 0 ) sc = 0; + m_cutPosition_W2 = m_acceptInfo.addCut( "W2", "W2" ); + if ( m_cutPosition_W2 < 0 ) sc = StatusCode::FAILURE; // Check the energy in the strips before cutting on it - m_cutPosition_Wstot = m_accept.addCut( "Wstot", "Wstot" ); - if ( m_cutPosition_Wstot < 0 ) sc = 0; + m_cutPosition_Wstot = m_acceptInfo.addCut( "Wstot", "Wstot" ); + if ( m_cutPosition_Wstot < 0 ) sc = StatusCode::FAILURE; // Eratio - m_cutPosition_Eratio = m_accept.addCut( "Eratio", "Eratio" ); - if ( m_cutPosition_Eratio < 0 ) sc = 0; + m_cutPosition_Eratio = m_acceptInfo.addCut( "Eratio", "Eratio" ); + if ( m_cutPosition_Eratio < 0 ) sc = StatusCode::FAILURE; // Delta Eta - m_cutPosition_DeltaEta = m_accept.addCut( "DeltaEta", "DeltaEta" ); - if ( m_cutPosition_DeltaEta < 0 ) sc = 0; + m_cutPosition_DeltaEta = m_acceptInfo.addCut( "DeltaEta", "DeltaEta" ); + if ( m_cutPosition_DeltaEta < 0 ) sc = StatusCode::FAILURE; // Rescale deltaPhi - m_cutPosition_DeltaPhiRes = m_accept.addCut( "DeltaPhiRes", "DeltaPhiRes" ); - if ( m_cutPosition_DeltaPhiRes < 0 ) sc = 0; + m_cutPosition_DeltaPhiRes = m_acceptInfo.addCut( "DeltaPhiRes", "DeltaPhiRes" ); + if ( m_cutPosition_DeltaPhiRes < 0 ) sc = StatusCode::FAILURE; // Si - m_cutPosition_NSilicon = m_accept.addCut( "NSilicon", "NSilicon" ); - if ( m_cutPosition_NSilicon < 0 ) sc = 0; + m_cutPosition_NSilicon = m_acceptInfo.addCut( "NSilicon", "NSilicon" ); + if ( m_cutPosition_NSilicon < 0 ) sc = StatusCode::FAILURE; //Pix - m_cutPosition_NPixel = m_accept.addCut( "NPixel", "NPixel" ); - if ( m_cutPosition_NPixel < 0 ) sc = 0; + m_cutPosition_NPixel = m_acceptInfo.addCut( "NPixel", "NPixel" ); + if ( m_cutPosition_NPixel < 0 ) sc = StatusCode::FAILURE; //Blayer - m_cutPosition_NBlayer = m_accept.addCut( "NBLayer", "NBLayer" ); - if ( m_cutPosition_NBlayer < 0 ) sc = 0; + m_cutPosition_NBlayer = m_acceptInfo.addCut( "NBLayer", "NBLayer" ); + if ( m_cutPosition_NBlayer < 0 ) sc = StatusCode::FAILURE; //TRT Ratio in crack - m_cutPosition_TR = m_accept.addCut( "TR", "TR" ); - if ( m_cutPosition_TR < 0 ) sc = 0; + m_cutPosition_TR = m_acceptInfo.addCut( "TR", "TR" ); + if ( m_cutPosition_TR < 0 ) sc = StatusCode::FAILURE; //Tight deltaPhi - m_cutPosition_TightDeltaPhi = m_accept.addCut( "TightDeltaPhi", "TightDeltaPhi" ); - if ( m_cutPosition_TightDeltaPhi < 0 ) sc = 0; + m_cutPosition_TightDeltaPhi = m_acceptInfo.addCut( "TightDeltaPhi", "TightDeltaPhi" ); + if ( m_cutPosition_TightDeltaPhi < 0 ) sc = StatusCode::FAILURE; return sc; } @@ -130,33 +129,33 @@ int Root::TElectronMultiLeptonSelector::initialize() //============================================================================= // Calculate the actual accept of each cut individually. //============================================================================= -const Root::TAccept& Root::TElectronMultiLeptonSelector::accept( const double eta, - const double eT, - const double rHad, - const double rHad1, - const double Reta, - const double w2, - const double f1, - const double f3, - const double wstot, - const double DEmaxs1, - const double deltaEta, - const int nSi, - const int nSiDeadSensors, - const int nPix, - const int nPixDeadSensors, - const double deltaPhiRes, - const double dpOverp, - const double TRratio, - const int nTRTTotal, - const int nBlayerHits, - const bool expectBlayer - ) const +asg::AcceptData Root::TElectronMultiLeptonSelector::accept( const double eta, + const double eT, + const double rHad, + const double rHad1, + const double Reta, + const double w2, + const double f1, + const double f3, + const double wstot, + const double DEmaxs1, + const double deltaEta, + const int nSi, + const int nSiDeadSensors, + const int nPix, + const int nPixDeadSensors, + const double deltaPhiRes, + const double dpOverp, + const double TRratio, + const int nTRTTotal, + const int nBlayerHits, + const bool expectBlayer + ) const { - // Reset the cut result bits to zero (= fail cut) - m_accept.clear(); // ----------------------------------------------------------- + // Setup return accept with AcceptInfo + asg::AcceptData acceptData(&m_acceptInfo); //Get eta/et bins @@ -172,74 +171,74 @@ const Root::TAccept& Root::TElectronMultiLeptonSelector::accept( const double et // Coverage bool doPassCoverage = (fabs(eta)>2.47 ) ? false : true ; if( !doPassCoverage ){ ATH_MSG_DEBUG("Failed Coverage, et=" << eT << ", eta=" << eta);} - m_accept.setCutResult( m_cutPosition_Coverage, doPassCoverage ); + acceptData.setCutResult( m_cutPosition_Coverage, doPassCoverage ); // RHad bool doPassRHad = ( passRHad(rHad,rHad1,eTBin,etaBin) ) ? true : false ; if( !doPassRHad ){ ATH_MSG_DEBUG("Failed RHad, et=" << eT << ", eta=" << eta);} - m_accept.setCutResult( m_cutPosition_RHad, doPassRHad ); + acceptData.setCutResult( m_cutPosition_RHad, doPassRHad ); // f3 bool doPassF3 = ( eT>=90*GeV || passF3(f3,eTBin,etaBin) ) ? true : false ; if( !doPassF3 ){ ATH_MSG_DEBUG("Failed F3, et=" << eT << ", eta=" << eta);} - m_accept.setCutResult( m_cutPosition_F3, doPassF3 ); + acceptData.setCutResult( m_cutPosition_F3, doPassF3 ); // Reta bool doPassReta = ( passReta(Reta,eTBin,etaBin) ) ? true : false ; if( !doPassReta ){ ATH_MSG_DEBUG("Failed Reta, et=" << eT << ", eta=" << eta);} - m_accept.setCutResult( m_cutPosition_Reta, doPassReta ); + acceptData.setCutResult( m_cutPosition_Reta, doPassReta ); // w2 bool doPassW2 = ( passW2(w2,eTBin,etaBin) ) ? true : false ; if( !doPassW2 ){ ATH_MSG_DEBUG("Failed W2, et=" << eT << ", eta=" << eta);} - m_accept.setCutResult( m_cutPosition_W2, doPassW2 ); + acceptData.setCutResult( m_cutPosition_W2, doPassW2 ); // Check the energy in the strips before cutting on it bool doPassWstot = ( f1 <= 0.005 || passWstot(wstot,eTBin,etaBin) ) ? true : false ; if( !doPassWstot ){ ATH_MSG_DEBUG("Failed Wstot, et=" << eT << ", eta=" << eta );} - m_accept.setCutResult( m_cutPosition_Wstot, doPassWstot ); + acceptData.setCutResult( m_cutPosition_Wstot, doPassWstot ); // Eratio bool doPassEratio = ( f1 <= 0.005 || passEratio(DEmaxs1,eTBin,etaBin) ) ? true : false ; if( !doPassEratio ){ ATH_MSG_DEBUG("Failed Eratio, et=" << eT << ", eta=" << eta );} - m_accept.setCutResult( m_cutPosition_Eratio, doPassEratio ); + acceptData.setCutResult( m_cutPosition_Eratio, doPassEratio ); // Delta Eta bool doPassDeltaEta = ( passDeltaEta(deltaEta, eTBin, etaBin) ) ? true : false ; if( !doPassDeltaEta ){ ATH_MSG_DEBUG("Failed DeltaEta, et=" << eT << ", eta=" << eta );} - m_accept.setCutResult( m_cutPosition_DeltaEta, doPassDeltaEta ); + acceptData.setCutResult( m_cutPosition_DeltaEta, doPassDeltaEta ); // Rescale deltaPhi bool doPassDeltaPhiRes = ( passDeltaPhiRes(deltaPhiRes, isBrem, eTBin, etaBin) ) ? true : false ; if( !doPassDeltaPhiRes ){ ATH_MSG_DEBUG("Failed DeltaPhiRes, et=" << eT << ", eta=" << eta );} - m_accept.setCutResult( m_cutPosition_DeltaPhiRes, doPassDeltaPhiRes ); + acceptData.setCutResult( m_cutPosition_DeltaPhiRes, doPassDeltaPhiRes ); //Si bool doPassNSilicon = ( (nSi + nSiDeadSensors) < 7 ) ? false : true ; if( !doPassNSilicon ){ ATH_MSG_DEBUG("Failed NSilicon, et=" << eT << ", eta=" << eta );} - m_accept.setCutResult( m_cutPosition_NSilicon, doPassNSilicon ); + acceptData.setCutResult( m_cutPosition_NSilicon, doPassNSilicon ); //Pix bool doPassNPixel = ( (nPix+nPixDeadSensors) < 2 ) ? false : true ; if( !doPassNPixel ){ ATH_MSG_DEBUG("Failed NPixel, et=" << eT << ", eta=" << eta );} - m_accept.setCutResult( m_cutPosition_NPixel, doPassNPixel ); + acceptData.setCutResult( m_cutPosition_NPixel, doPassNPixel ); //BLayer bool doPassNBLayer = (expectBlayer && nBlayerHits < 1) ? false : true ; if( !doPassNBLayer ){ ATH_MSG_DEBUG("Failed NBLayer, et=" << eT << ", eta=" << eta );} - m_accept.setCutResult( m_cutPosition_NBlayer, doPassNBLayer ); + acceptData.setCutResult( m_cutPosition_NBlayer, doPassNBLayer ); //TRT Ratio in crack bool doPassTR = (passTR(TRratio,eta,nTRTTotal) ) ? true : false ; if( !doPassTR ){ ATH_MSG_DEBUG("Failed TR, et=" << eT << ", eta=" << eta );} - m_accept.setCutResult( m_cutPosition_TR, doPassTR ); + acceptData.setCutResult( m_cutPosition_TR, doPassTR ); //TightDeltaPhi cut bool doPassTightDeltaPhi = ( passTightDeltaPhi(deltaPhiRes, expectBlayer, nBlayerHits ,eTBin, etaBin) ) ? true : false ; if( !doPassTightDeltaPhi ){ ATH_MSG_DEBUG("Failed TightDeltaPhi, et=" << eT << ", eta=" << eta );} - m_accept.setCutResult( m_cutPosition_TightDeltaPhi, doPassTightDeltaPhi ); + acceptData.setCutResult( m_cutPosition_TightDeltaPhi, doPassTightDeltaPhi ); - return m_accept; + return acceptData; } diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronMultiLeptonSelector.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronMultiLeptonSelector.h index d5d8783468332fde85ceb77225ad32b3cc705885..d6d877b7066718373c5fa1b1209d9fd5f22f464e 100644 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronMultiLeptonSelector.h +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TElectronMultiLeptonSelector.h @@ -14,100 +14,102 @@ */ -// ROOT includes -#include <TString.h> // Include the return object and the base class -#include "PATCore/TAccept.h" -#include "PATCore/TSelectorToolBase.h" #include "AsgTools/AsgMessaging.h" +#include "PATCore/AcceptInfo.h" +#include "PATCore/AcceptData.h" namespace Root { - class TElectronMultiLeptonSelector : public TSelectorToolBase,public asg::AsgMessaging - { - - public: - /** Standard constructor */ - TElectronMultiLeptonSelector(const char* name="TElectronMultiLeptonSelector"); - - /** Standard destructor */ - ~TElectronMultiLeptonSelector(); - - - // Main methods - public: - /** Initialize this class */ - int initialize(); - - /** Finalize this class; everything that should be done after the event loop should go here */ - inline int finalize() { return 1; }; - - /** The main accept method: the actual cuts are applied here */ - const Root::TAccept& accept( const double eta, - const double eT, - const double rHad, - const double rHad1, - const double Reta, - const double w2, - const double f1, - const double f3, - const double wstot, - const double DEmaxs1, - const double deltaEta, - const int nSi, - const int nSiDeadSensors, - const int nPix, - const int nPixDeadSensors, - const double deltaPhiRes, - const double dpOverp, - const double TRratio, - const int nTRTTotal, - const int nBlayerHits, - const bool expectBlayer - ) const; - - - // Private helper methods - private: - bool passRHad(double rhad, double rhad1, unsigned int etbin, unsigned int etabin) const; - bool passF3(double f3, unsigned int etbin, unsigned int etabin) const; - bool passReta(double reta, unsigned int etbin, unsigned int etabin)const ; - bool passW2(double w2, unsigned int etbin, unsigned int etabin) const ; - bool passWstot(double wstot, unsigned int etbin, unsigned int etabin) const ; - bool passEratio(double demaxs1, unsigned int etbin, unsigned int etabin) const ; - bool passDeltaEta(double deltaEta, unsigned int etbin, unsigned int etabin) const ; - bool passDeltaPhiRes(double deltaPhiRes, bool isBrem, unsigned int etbin, unsigned int etabin) const ; - bool passTR(double TRratio, double eta, unsigned int nTRTTotal ) const ; - bool passTightDeltaPhi(double deltaPhiRes, - bool expectBlayer, int nBlayerHits, - unsigned int eTBin, unsigned int etaBin) const ; - - // Helper Fuctions - unsigned int getEtaBinH4l(double eta) const ; - unsigned int getEtBinH4l(double eT) const ; - bool getBremCategoryH4l( double dpOverp, unsigned int etbin, unsigned int etabin) const ; - - - - private: - const double GeV; + class TElectronMultiLeptonSelector : public asg::AsgMessaging + { + + public: + /** Standard constructor */ + TElectronMultiLeptonSelector(const char* name="TElectronMultiLeptonSelector"); + + /** Standard destructor */ + ~TElectronMultiLeptonSelector(); + + + // Main methods + public: + /** Initialize this class */ + StatusCode initialize(); + + /// accesss to the accept info object + const asg::AcceptInfo& getAcceptInfo() const { return m_acceptInfo; } + + /** The main accept method: the actual cuts are applied here */ + asg::AcceptData accept( const double eta, + const double eT, + const double rHad, + const double rHad1, + const double Reta, + const double w2, + const double f1, + const double f3, + const double wstot, + const double DEmaxs1, + const double deltaEta, + const int nSi, + const int nSiDeadSensors, + const int nPix, + const int nPixDeadSensors, + const double deltaPhiRes, + const double dpOverp, + const double TRratio, + const int nTRTTotal, + const int nBlayerHits, + const bool expectBlayer + ) const; + + + /** Return dummy accept with only info */ + asg::AcceptData accept() const { return asg::AcceptData(&m_acceptInfo); } + + private: + // Private helper methods + bool passRHad(double rhad, double rhad1, unsigned int etbin, unsigned int etabin) const; + bool passF3(double f3, unsigned int etbin, unsigned int etabin) const; + bool passReta(double reta, unsigned int etbin, unsigned int etabin)const ; + bool passW2(double w2, unsigned int etbin, unsigned int etabin) const ; + bool passWstot(double wstot, unsigned int etbin, unsigned int etabin) const ; + bool passEratio(double demaxs1, unsigned int etbin, unsigned int etabin) const ; + bool passDeltaEta(double deltaEta, unsigned int etbin, unsigned int etabin) const ; + bool passDeltaPhiRes(double deltaPhiRes, bool isBrem, unsigned int etbin, unsigned int etabin) const ; + bool passTR(double TRratio, double eta, unsigned int nTRTTotal ) const ; + bool passTightDeltaPhi(double deltaPhiRes, + bool expectBlayer, int nBlayerHits, + unsigned int eTBin, unsigned int etaBin) const ; + + // Helper Fuctions + unsigned int getEtaBinH4l(double eta) const ; + unsigned int getEtBinH4l(double eT) const ; + bool getBremCategoryH4l( double dpOverp, unsigned int etbin, unsigned int etabin) const ; + + private: + /// Accept info + asg::AcceptInfo m_acceptInfo; + + const double GeV; - int m_cutPosition_Coverage; - int m_cutPosition_RHad; - int m_cutPosition_F3; - int m_cutPosition_Reta; - int m_cutPosition_W2; - int m_cutPosition_Wstot; - int m_cutPosition_Eratio; - int m_cutPosition_DeltaEta; - int m_cutPosition_DeltaPhiRes; - int m_cutPosition_NSilicon; - int m_cutPosition_NPixel; - int m_cutPosition_NBlayer; - int m_cutPosition_TR; - int m_cutPosition_TightDeltaPhi; + int m_cutPosition_Coverage; + int m_cutPosition_RHad; + int m_cutPosition_F3; + int m_cutPosition_Reta; + int m_cutPosition_W2; + int m_cutPosition_Wstot; + int m_cutPosition_Eratio; + int m_cutPosition_DeltaEta; + int m_cutPosition_DeltaPhiRes; + int m_cutPosition_NSilicon; + int m_cutPosition_NPixel; + int m_cutPosition_NBlayer; + int m_cutPosition_TR; + int m_cutPosition_TightDeltaPhi; - }; // End: class definition + }; // End: class definition } // End: namespace Root diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TForwardElectronIsEMSelector.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TForwardElectronIsEMSelector.cxx index 5e3f6efca6292b863556a39f351c98e9de178c4d..e0202380041c5ef44736ce1fcdbf60a9eb2fba30 100755 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TForwardElectronIsEMSelector.cxx +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TForwardElectronIsEMSelector.cxx @@ -7,450 +7,447 @@ NAME: TForwardElectronIsEMSelector.cxx PACKAGE: PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools - *********************************************************************/ +*********************************************************************/ #include "TForwardElectronIsEMSelector.h" #include <cmath> Root::TForwardElectronIsEMSelector::TForwardElectronIsEMSelector(const char* name) : - TSelectorToolBase(name), - asg::AsgMessaging(std::string(name)), - isEMMask(0), //All will pass if not specified - m_isEM(~0), - /** @brief cluster eta range */ - m_cutPositionBinEta_ForwardElectron(0), - /** @brief matching to photon (not necessarily conversion--the name is historical) */ - //m_cutPositionVxp_ForwardElectron(0), - /** @brief cluster leakage o the hadronic calorimeter */ - m_cutPositionSECONDLAMBDA_ForwardElectron(0), - /** @brief Et <0 */ - m_cutPositionLATERAL_ForwardElectron(0), - /** @brief energy ratio in 2nd sampling (e.g E237/E277) */ - m_cutPositionLONGITUDINAL_ForwardElectron(0), - /** @brief energy ratio in 2nd sampling (e.g E233/E237) */ - m_cutPositionCELLMAXFRAC_ForwardElectron(0), - /** @brief width in the second sampling (e.g Weta2) */ - m_cutPositionSECONDR_ForwardElectron(0), - /** @brief energy fraction in the third layer */ - m_cutPositionCENTERLAMBDA_ForwardElectron(0), - /** @brief cluster eta range */ - m_cutNameBinEta_ForwardElectron("BinEta_ForwardElectron"), - /** @brief matching to photon (not necessarily conversion--the name is historical) */ - //m_cutNameVxp_ForwardElectron("Vxp_ForwardElectron"), - /** @brief cluster leakage into the hadronic calorimeter */ - m_cutNameSECONDLAMBDA_ForwardElectron("SECONDLAMBDA_ForwardElectron"), - /** @brief shower width weighted by distance from the maximum one */ - m_cutNameLATERAL_ForwardElectron("LATERAL_ForwardElectron"), - /** @brief difference between max and 2nd max in strips */ - m_cutNameLONGITUDINAL_ForwardElectron("LONGITUDINAL_ForwardElectron"), - /** @brief B layer hit */ - m_cutNameCELLMAXFRAC_ForwardElectron("CELLMAXFRAC_ForwardElectron"), - /** @brief number of Pixel hits */ - m_cutNameSECONDR_ForwardElectron("SECONDR_ForwardElectron"), - /** @brief number of Pixel and SCT hits */ - m_cutNameCENTERLAMBDA_ForwardElectron("CENTERLAMBDA_ForwardElectron") + asg::AsgMessaging(std::string(name)), + m_isEMMask(0), //All will pass if not specified + // @brief cluster eta range */ + m_cutPositionBinEta_ForwardElectron(0), + // @brief matching to photon (not necessarily conversion--the name is historical) */ + //m_cutPositionVxp_ForwardElectron(0), + // @brief cluster leakage o the hadronic calorimeter */ + m_cutPositionSECONDLAMBDA_ForwardElectron(0), + // @brief Et <0 */ + m_cutPositionLATERAL_ForwardElectron(0), + // @brief energy ratio in 2nd sampling (e.g E237/E277) */ + m_cutPositionLONGITUDINAL_ForwardElectron(0), + // @brief energy ratio in 2nd sampling (e.g E233/E237) */ + m_cutPositionCELLMAXFRAC_ForwardElectron(0), + // @brief width in the second sampling (e.g Weta2) */ + m_cutPositionSECONDR_ForwardElectron(0), + // @brief energy fraction in the third layer */ + m_cutPositionCENTERLAMBDA_ForwardElectron(0), + // @brief cluster eta range */ + m_cutNameBinEta_ForwardElectron("BinEta_ForwardElectron"), + // @brief matching to photon (not necessarily conversion--the name is historical) */ + //m_cutNameVxp_ForwardElectron("Vxp_ForwardElectron"), + // @brief cluster leakage into the hadronic calorimeter */ + m_cutNameSECONDLAMBDA_ForwardElectron("SECONDLAMBDA_ForwardElectron"), + // @brief shower width weighted by distance from the maximum one */ + m_cutNameLATERAL_ForwardElectron("LATERAL_ForwardElectron"), + // @brief difference between max and 2nd max in strips */ + m_cutNameLONGITUDINAL_ForwardElectron("LONGITUDINAL_ForwardElectron"), + // @brief B layer hit */ + m_cutNameCELLMAXFRAC_ForwardElectron("CELLMAXFRAC_ForwardElectron"), + // @brief number of Pixel hits */ + m_cutNameSECONDR_ForwardElectron("SECONDR_ForwardElectron"), + // @brief number of Pixel and SCT hits */ + m_cutNameCENTERLAMBDA_ForwardElectron("CENTERLAMBDA_ForwardElectron") { - m_cutPositionSECONDLAMBDA_ForwardElectron = 0; - m_cutPositionLATERAL_ForwardElectron = 0; - m_cutPositionLONGITUDINAL_ForwardElectron= 0; - m_cutPositionCELLMAXFRAC_ForwardElectron = 0; - m_cutPositionSECONDR_ForwardElectron = 0; - m_cutPositionCENTERLAMBDA_ForwardElectron = 0; + m_cutPositionSECONDLAMBDA_ForwardElectron = 0; + m_cutPositionLATERAL_ForwardElectron = 0; + m_cutPositionLONGITUDINAL_ForwardElectron= 0; + m_cutPositionCELLMAXFRAC_ForwardElectron = 0; + m_cutPositionSECONDR_ForwardElectron = 0; + m_cutPositionCENTERLAMBDA_ForwardElectron = 0; } // ==================================================================== Root::TForwardElectronIsEMSelector::~TForwardElectronIsEMSelector() { - // - // destructor - // + // + // destructor + // } //============================================================================= // Initialize this selector tool //============================================================================= -int Root::TForwardElectronIsEMSelector::initialize() +StatusCode Root::TForwardElectronIsEMSelector::initialize() { - int sc(1); - - // -------------------------------------------------------------------------- - // Register the cuts and check that the registration worked: - // NOTE: THE ORDER IS IMPORTANT!!! Cut0 corresponds to bit 0, Cut1 to bit 1,... - - /** @brief cluster eta range, bit 0 */ - m_cutPositionBinEta_ForwardElectron = - m_accept.addCut(m_cutNameBinEta_ForwardElectron, "Electron within eta range"); - if (m_cutPositionBinEta_ForwardElectron < 0) sc = 0; - - /** @brief matching to photon (not necessarily conversion--the name is historical), but 1 */ - // m_cutPositionVxp_ForwardElectron = - // m_accept.addCut(m_cutNameVxp_ForwardElectron, "Electron matches a photon with AR > LOOSE"); - // if (m_cutPositionVxp_ForwardElectron < 0) sc = 0; - - /** @brief cluster leakage into the hadronic calorimeter, bit 2 */ - m_cutPositionSECONDLAMBDA_ForwardElectron = - m_accept.addCut(m_cutNameSECONDLAMBDA_ForwardElectron, "secondLambda < Cut"); - if (m_cutPositionSECONDLAMBDA_ForwardElectron < 0) sc = 0; - - /** @brief et < 0 bit 3 */ - m_cutPositionLATERAL_ForwardElectron = - m_accept.addCut(m_cutNameLATERAL_ForwardElectron, "lateral <0 Cut"); - if (m_cutPositionLATERAL_ForwardElectron < 0) sc = 0; - - /** @brief energy ratio in 2nd sampling (i.e. E237/E277), bit 4 */ - m_cutPositionLONGITUDINAL_ForwardElectron = - m_accept.addCut(m_cutNameLONGITUDINAL_ForwardElectron, "longitudinal <Cut"); - if (m_cutPositionLONGITUDINAL_ForwardElectron < 0) sc = 0; - - /** @brief energy ratio in 2nd sampling (i.e. E233/E237), bit 5 */ - m_cutPositionCELLMAXFRAC_ForwardElectron = - m_accept.addCut(m_cutNameCELLMAXFRAC_ForwardElectron, "fracMax > Cut"); - if (m_cutPositionCELLMAXFRAC_ForwardElectron < 0) sc = 0; - - /** @brief width in the second sampling (i.e. Weta2), bit 6 */ - m_cutPositionSECONDR_ForwardElectron = - m_accept.addCut(m_cutNameSECONDR_ForwardElectron, "SecondR < Cut"); - if (m_cutPositionSECONDR_ForwardElectron < 0) sc = 0; - - /** @brief energy fraction in the third layer, bit 7 */ - m_cutPositionCENTERLAMBDA_ForwardElectron = - m_accept.addCut(m_cutNameCENTERLAMBDA_ForwardElectron, "CenterLambda < Cut"); - if (m_cutPositionCENTERLAMBDA_ForwardElectron < 0) sc = 0; - - if (sc == 0) { - ATH_MSG_ERROR("Exceeded the number of allowed cuts in TForwardElectronIsEMSelector"); - } - - return sc; + StatusCode sc(StatusCode::SUCCESS); + + // -------------------------------------------------------------------------- + // Register the cuts and check that the registration worked: + // NOTE: THE ORDER IS IMPORTANT!!! Cut0 corresponds to bit 0, Cut1 to bit 1,... + + // @brief cluster eta range, bit 0 */ + m_cutPositionBinEta_ForwardElectron = + m_acceptInfo.addCut(m_cutNameBinEta_ForwardElectron, "Electron within eta range"); + if (m_cutPositionBinEta_ForwardElectron < 0) sc = StatusCode::FAILURE; + + // @brief matching to photon (not necessarily conversion--the name is historical), but 1 */ + // m_cutPositionVxp_ForwardElectron = + // m_acceptInfo.addCut(m_cutNameVxp_ForwardElectron, "Electron matches a photon with AR > LOOSE"); + // if (m_cutPositionVxp_ForwardElectron < 0) sc = StatusCode::FAILURE; + + // @brief cluster leakage into the hadronic calorimeter, bit 2 */ + m_cutPositionSECONDLAMBDA_ForwardElectron = + m_acceptInfo.addCut(m_cutNameSECONDLAMBDA_ForwardElectron, "secondLambda < Cut"); + if (m_cutPositionSECONDLAMBDA_ForwardElectron < 0) sc = StatusCode::FAILURE; + + // @brief et < 0 bit 3 */ + m_cutPositionLATERAL_ForwardElectron = + m_acceptInfo.addCut(m_cutNameLATERAL_ForwardElectron, "lateral <0 Cut"); + if (m_cutPositionLATERAL_ForwardElectron < 0) sc = StatusCode::FAILURE; + + // @brief energy ratio in 2nd sampling (i.e. E237/E277), bit 4 */ + m_cutPositionLONGITUDINAL_ForwardElectron = + m_acceptInfo.addCut(m_cutNameLONGITUDINAL_ForwardElectron, "longitudinal <Cut"); + if (m_cutPositionLONGITUDINAL_ForwardElectron < 0) sc = StatusCode::FAILURE; + + // @brief energy ratio in 2nd sampling (i.e. E233/E237), bit 5 */ + m_cutPositionCELLMAXFRAC_ForwardElectron = + m_acceptInfo.addCut(m_cutNameCELLMAXFRAC_ForwardElectron, "fracMax > Cut"); + if (m_cutPositionCELLMAXFRAC_ForwardElectron < 0) sc = StatusCode::FAILURE; + + // @brief width in the second sampling (i.e. Weta2), bit 6 */ + m_cutPositionSECONDR_ForwardElectron = + m_acceptInfo.addCut(m_cutNameSECONDR_ForwardElectron, "SecondR < Cut"); + if (m_cutPositionSECONDR_ForwardElectron < 0) sc = StatusCode::FAILURE; + + // @brief energy fraction in the third layer, bit 7 */ + m_cutPositionCENTERLAMBDA_ForwardElectron = + m_acceptInfo.addCut(m_cutNameCENTERLAMBDA_ForwardElectron, "CenterLambda < Cut"); + if (m_cutPositionCENTERLAMBDA_ForwardElectron < 0) sc = StatusCode::FAILURE; + + if (sc == StatusCode::FAILURE) { + ATH_MSG_ERROR("Exceeded the number of allowed cuts in TForwardElectronIsEMSelector"); + } + + return sc; } -const Root::TAccept& Root::TForwardElectronIsEMSelector::fillAccept() const +asg::AcceptData Root::TForwardElectronIsEMSelector::fillAccept(unsigned int isEM) const { - for (int i = 0; i < 7; i++) { - const unsigned int mask = (0x1 << i) & isEMMask; - m_accept.setCutResult(i, (m_isEM & mask) == 0); - } - ATH_MSG_DEBUG("m_accept "<<m_accept); - return m_accept; + asg::AcceptData acceptData(&m_acceptInfo); + for (int i = 0; i < 7; i++) { + const unsigned int mask = (0x1 << i) & m_isEMMask; + acceptData.setCutResult(i, (isEM & mask) == 0); + } + ATH_MSG_DEBUG("acceptData "<< (bool)acceptData); + return acceptData; } //============================================================================= // Calculate the actual accept of each cut individually. //============================================================================= -const Root::TAccept& Root::TForwardElectronIsEMSelector::accept( - // eta position in second sampling - float eta, - // transverse energy in calorimeter (using eta position in second sampling) - float nvtx, - //////////////// - calo - // E(3*3) in 2nd sampling e233 - float secondLambda, - // E(3*7) in 2nd sampling e237 - float lateral, - // transverse energy in 1st scintillator of hadronic calorimeter - float longitudinal, - // E(min) in strips - float fracMax, - // total shower width in 1st sampling - float centerLambda, - // fraction of energy reconstructed in the 3rd sampling - float secondR) const +asg::AcceptData Root::TForwardElectronIsEMSelector::accept( + // eta position in second sampling + float eta, + // transverse energy in calorimeter (using eta position in second sampling) + float nvtx, + //////////////// - calo + // E(3*3) in 2nd sampling e233 + float secondLambda, + // E(3*7) in 2nd sampling e237 + float lateral, + // transverse energy in 1st scintillator of hadronic calorimeter + float longitudinal, + // E(min) in strips + float fracMax, + // total shower width in 1st sampling + float centerLambda, + // fraction of energy reconstructed in the 3rd sampling + float secondR) const { - // Reset the cut result bits to zero (= fail cut) - m_accept.clear(); - // ----------------------------------------------------------- - // Do the actual selection - - m_isEM = calcIsEm(eta, - nvtx, - secondLambda, // e233, - lateral, //e237, - longitudinal, ///ethad1, - fracMax, //emin, - centerLambda, - secondR); - - return fillAccept(); + // ----------------------------------------------------------- + // Do the actual selection + + unsigned int isEM = calcIsEm(eta, + nvtx, + secondLambda, // e233, + lateral, //e237, + longitudinal, ///ethad1, + fracMax, //emin, + centerLambda, + secondR); + + return fillAccept(isEM); } // return the isem // unsigned int Root::TForwardElectronIsEMSelector::calcIsEm( - // eta position in second sampling - float eta, - // transverse energy in calorimeter (using eta position in second sampling) - float nvtx, - //////////////// - calo - // E(3*3) in 2nd sampling e233 - float secondLambda, - // E(3*7) in 2nd sampling e237 - float lateral, - // transverse energy in 1st scintillator of hadronic calorimeter - float longitudinal, - // E(min) in strips - float fracMax, //emin, - // total shower width in 1st sampling - float centerLambda, - // fraction of energy reconstructed in the 3rd sampling - float secondR) const + // eta position in second sampling + float eta, + // transverse energy in calorimeter (using eta position in second sampling) + float nvtx, + //////////////// - calo + // E(3*3) in 2nd sampling e233 + float secondLambda, + // E(3*7) in 2nd sampling e237 + float lateral, + // transverse energy in 1st scintillator of hadronic calorimeter + float longitudinal, + // E(min) in strips + float fracMax, //emin, + // total shower width in 1st sampling + float centerLambda, + // fraction of energy reconstructed in the 3rd sampling + float secondR) const { - unsigned int iflag = calocuts_electrons(eta, - nvtx, - secondLambda, //e233, - lateral, //e237, - longitudinal, //ethad1, - fracMax, //emin, - centerLambda, - secondR, - 0); - - return iflag; + unsigned int iflag = calocuts_electrons(eta, + nvtx, + secondLambda, //e233, + lateral, //e237, + longitudinal, //ethad1, + fracMax, //emin, + centerLambda, + secondR, + 0); + + return iflag; } // ====================================================================== unsigned int Root::TForwardElectronIsEMSelector::calocuts_electrons( - // eta position in second sampling - float eta, - // transverse energy in calorimeter (using eta position in second sampling) - float nvtx, - // E(3*3) in 2nd sampling 233 - float secondLambda, - // E(3*7) in 2nd sampling - float lateral, - // transverse energy in 1st scintillator of hadronic calorimeter - float longitudinal, - // E(min) in strips (emin) - float fracMax, - // total shower width in 1st sampling - float centerLambda, - // fraction of energy reconstructed in the 3rd sampling - float secondR, - // the starting isEM (should be 0 if new) - unsigned int iflag - ) const + // eta position in second sampling + float eta, + // transverse energy in calorimeter (using eta position in second sampling) + float nvtx, + // E(3*3) in 2nd sampling 233 + float secondLambda, + // E(3*7) in 2nd sampling + float lateral, + // transverse energy in 1st scintillator of hadronic calorimeter + float longitudinal, + // E(min) in strips (emin) + float fracMax, + // total shower width in 1st sampling + float centerLambda, + // fraction of energy reconstructed in the 3rd sampling + float secondR, + // the starting isEM (should be 0 if new) + unsigned int iflag + ) const { - // modifiy et when dealing with trigger - // to be sure that it will take the correct bin (VD) - std::vector<int> bins =FindNvtxEtaBin(nvtx,eta); - int ibin_nvtx= bins.at(0); - int ibin_eta= bins.at(1); - int ibin_combined= bins.at(2); - - // check eta range - if (eta < 2.5) { - iflag |= (0x1 << egammaPID::BinEta_ForwardElectron); - ATH_MSG_DEBUG("Fail eta"); - } - - // check if index is defined - if (ibin_eta>=0 && ibin_nvtx>=0 && ibin_combined>=0) { - - // check secondR - if (CheckVar(CutSECONDR_ForwardElectron,4)) { - if (secondR >= CutSECONDR_ForwardElectron[ibin_combined]){ - iflag |= ( 0x1 << egammaPID::SECONDR_ForwardElectron); - ATH_MSG_DEBUG("Fail SecondR "<<secondR<<" > "<<CutSECONDR_ForwardElectron[ibin_combined]); - } - } - // check secondlambda - if (CheckVar(CutSECONDLAMBDA_ForwardElectron,4)) { - if (secondLambda >= CutSECONDLAMBDA_ForwardElectron[ibin_combined]){ - iflag |= ( 0x1 << egammaPID::SECONDLAMBDA_ForwardElectron); - ATH_MSG_DEBUG("Fail SecondLambda "<<secondLambda<<" > "<<CutSECONDLAMBDA_ForwardElectron[ibin_combined]); - } - } - // --------- - // check lateral - if (CheckVar(CutLATERAL_ForwardElectron,4)) { - if (lateral >= CutLATERAL_ForwardElectron[ibin_combined]){ - iflag |= ( 0x1 << egammaPID::LATERAL_ForwardElectron); - ATH_MSG_DEBUG("Fail LATERAL "<<lateral<<" > "<<CutLATERAL_ForwardElectron[ibin_combined]); - } - } - // check longitudinal - if (CheckVar(CutLONGITUDINAL_ForwardElectron,4)) { - if (longitudinal >= CutLONGITUDINAL_ForwardElectron[ibin_combined]){ - iflag |= ( 0x1 << egammaPID::LONGITUDINAL_ForwardElectron); - ATH_MSG_DEBUG("Fail Longitudinal "<<longitudinal<<" > "<<CutLONGITUDINAL_ForwardElectron[ibin_combined]); - } - } - // check fracMax - if (CheckVar(CutCELLMAXFRAC_ForwardElectron,4)) { - if (fracMax < CutCELLMAXFRAC_ForwardElectron[ibin_combined]){ - iflag |= ( 0x1 << egammaPID::CELLMAXFRAC_ForwardElectron); - ATH_MSG_DEBUG("Fail fracMax "<<fracMax<<" < "<<CutCELLMAXFRAC_ForwardElectron[ibin_combined]); - } - } - // check CENTERLAMBDA - if (CheckVar(CutCENTERLAMBDA_ForwardElectron,4)) { - if (centerLambda >= CutCENTERLAMBDA_ForwardElectron[ibin_combined] ){ - iflag |= ( 0x1 << egammaPID::CENTERLAMBDA_ForwardElectron); - ATH_MSG_DEBUG("Fail CENTERLAMBDA "<<centerLambda<<" > "<<CutCENTERLAMBDA_ForwardElectron[ibin_combined]); - } - } - } - - return iflag; + // modifiy et when dealing with trigger + // to be sure that it will take the correct bin (VD) + std::vector<int> bins = findNvtxEtaBin(nvtx,eta); + int ibin_nvtx= bins.at(0); + int ibin_eta= bins.at(1); + int ibin_combined= bins.at(2); + + // check eta range + if (eta < 2.5) { + iflag |= (0x1 << egammaPID::BinEta_ForwardElectron); + ATH_MSG_DEBUG("Fail eta"); + } + + // check if index is defined + if (ibin_eta>=0 && ibin_nvtx>=0 && ibin_combined>=0) { + + // check secondR + if (checkVar(m_cutSECONDR_ForwardElectron,4)) { + if (secondR >= m_cutSECONDR_ForwardElectron[ibin_combined]){ + iflag |= ( 0x1 << egammaPID::SECONDR_ForwardElectron); + ATH_MSG_DEBUG("Fail SecondR "<<secondR<<" > "<<m_cutSECONDR_ForwardElectron[ibin_combined]); + } + } + // check secondlambda + if (checkVar(m_cutSECONDLAMBDA_ForwardElectron,4)) { + if (secondLambda >= m_cutSECONDLAMBDA_ForwardElectron[ibin_combined]){ + iflag |= ( 0x1 << egammaPID::SECONDLAMBDA_ForwardElectron); + ATH_MSG_DEBUG("Fail SecondLambda "<<secondLambda<<" > "<<m_cutSECONDLAMBDA_ForwardElectron[ibin_combined]); + } + } + // --------- + // check lateral + if (checkVar(m_cutLATERAL_ForwardElectron,4)) { + if (lateral >= m_cutLATERAL_ForwardElectron[ibin_combined]){ + iflag |= ( 0x1 << egammaPID::LATERAL_ForwardElectron); + ATH_MSG_DEBUG("Fail LATERAL "<<lateral<<" > "<<m_cutLATERAL_ForwardElectron[ibin_combined]); + } + } + // check longitudinal + if (checkVar(m_cutLONGITUDINAL_ForwardElectron,4)) { + if (longitudinal >= m_cutLONGITUDINAL_ForwardElectron[ibin_combined]){ + iflag |= ( 0x1 << egammaPID::LONGITUDINAL_ForwardElectron); + ATH_MSG_DEBUG("Fail Longitudinal "<<longitudinal<<" > "<<m_cutLONGITUDINAL_ForwardElectron[ibin_combined]); + } + } + // check fracMax + if (checkVar(m_cutCELLMAXFRAC_ForwardElectron,4)) { + if (fracMax < m_cutCELLMAXFRAC_ForwardElectron[ibin_combined]){ + iflag |= ( 0x1 << egammaPID::CELLMAXFRAC_ForwardElectron); + ATH_MSG_DEBUG("Fail fracMax "<<fracMax<<" < "<<m_cutCELLMAXFRAC_ForwardElectron[ibin_combined]); + } + } + // check CENTERLAMBDA + if (checkVar(m_cutCENTERLAMBDA_ForwardElectron,4)) { + if (centerLambda >= m_cutCENTERLAMBDA_ForwardElectron[ibin_combined] ){ + iflag |= ( 0x1 << egammaPID::CENTERLAMBDA_ForwardElectron); + ATH_MSG_DEBUG("Fail CENTERLAMBDA "<<centerLambda<<" > "<<m_cutCENTERLAMBDA_ForwardElectron[ibin_combined]); + } + } + } + + return iflag; } -std::vector<int> Root::TForwardElectronIsEMSelector::FindNvtxEtaBin(float nvtx, double eta) const +std::vector<int> Root::TForwardElectronIsEMSelector::findNvtxEtaBin(float nvtx, double eta) const { - //Try to figure out in which bin we belong - int ibin_nvtx = -1; - // loop on nvtx range - if(CutVxp_ForwardElectron.size()>0){ - for (unsigned int ibinNVTX=0;ibinNVTX<CutVxp_ForwardElectron.size();++ibinNVTX) { - if ( ibinNVTX == 0 ) { - if (nvtx < CutVxp_ForwardElectron[ibinNVTX] ) { - ibin_nvtx = ibinNVTX; - } - } - else if ( ibinNVTX > 0 && ibinNVTX <CutVxp_ForwardElectron.size() ) { - if ( nvtx >= CutVxp_ForwardElectron[ibinNVTX-1] && - nvtx < CutVxp_ForwardElectron[ibinNVTX] ) { - ibin_nvtx = ibinNVTX; - } - } - else if ( ibinNVTX == CutVxp_ForwardElectron.size() ) { - if ( nvtx >= CutVxp_ForwardElectron[ibinNVTX-1] ) { - ibin_nvtx = ibinNVTX; - } - } - } - } - int ibin_eta = -1; - // loop on eta range - for (unsigned int ibinEta=0;ibinEta<CutBinEta_ForwardElectron.size();++ibinEta) { - if ( ibinEta == 0 ){ - if ( eta < CutBinEta_ForwardElectron[ibinEta] ) { - ibin_eta = ibinEta; - } - } - else if ( ibinEta > 0 && ibinEta <CutBinEta_ForwardElectron.size() ) { - if ( eta >= CutBinEta_ForwardElectron[ibinEta-1] && - eta < CutBinEta_ForwardElectron[ibinEta] ) { - ibin_eta = ibinEta; - } - } - else if ( ibinEta == CutBinEta_ForwardElectron.size() ) { - if ( eta >= CutBinEta_ForwardElectron[ibinEta-1] ) { - ibin_eta = ibinEta; - } - } - } + //Try to figure out in which bin we belong + int ibin_nvtx = -1; + // loop on nvtx range + if(m_cutVxp_ForwardElectron.size()>0){ + for (unsigned int ibinNVTX=0;ibinNVTX<m_cutVxp_ForwardElectron.size();++ibinNVTX) { + if ( ibinNVTX == 0 ) { + if (nvtx < m_cutVxp_ForwardElectron[ibinNVTX] ) { + ibin_nvtx = ibinNVTX; + } + } + else if ( ibinNVTX > 0 && ibinNVTX <m_cutVxp_ForwardElectron.size() ) { + if ( nvtx >= m_cutVxp_ForwardElectron[ibinNVTX-1] && + nvtx < m_cutVxp_ForwardElectron[ibinNVTX] ) { + ibin_nvtx = ibinNVTX; + } + } + else if ( ibinNVTX == m_cutVxp_ForwardElectron.size() ) { + if ( nvtx >= m_cutVxp_ForwardElectron[ibinNVTX-1] ) { + ibin_nvtx = ibinNVTX; + } + } + } + } + int ibin_eta = -1; + // loop on eta range + for (unsigned int ibinEta=0;ibinEta<m_cutBinEta_ForwardElectron.size();++ibinEta) { + if ( ibinEta == 0 ){ + if ( eta < m_cutBinEta_ForwardElectron[ibinEta] ) { + ibin_eta = ibinEta; + } + } + else if ( ibinEta > 0 && ibinEta <m_cutBinEta_ForwardElectron.size() ) { + if ( eta >= m_cutBinEta_ForwardElectron[ibinEta-1] && + eta < m_cutBinEta_ForwardElectron[ibinEta] ) { + ibin_eta = ibinEta; + } + } + else if ( ibinEta == m_cutBinEta_ForwardElectron.size() ) { + if ( eta >= m_cutBinEta_ForwardElectron[ibinEta-1] ) { + ibin_eta = ibinEta; + } + } + } - //int ibin_combined = ibin_nvtx*CutBinEta_ForwardElectron.size()+ibin_eta; - int ibin_combined = -1; - if(ibin_eta == 2 ){ - ibin_combined = ibin_nvtx*ibin_eta-1; - } - else if(ibin_eta == 1 ){ - ibin_combined = 2*(ibin_nvtx*ibin_eta-1); - } - else{ - ATH_MSG_INFO(" Not posible "); - } - //int ibin_combined = ibin_nvtx*ibin_eta-1; - // check the bin number - std::vector<int> bins{ibin_nvtx, ibin_eta,ibin_combined}; - return bins; + //int ibin_combined = ibin_nvtx*m_cutBinEta_ForwardElectron.size()+ibin_eta; + int ibin_combined = -1; + if(ibin_eta == 2 ){ + ibin_combined = ibin_nvtx*ibin_eta-1; + } + else if(ibin_eta == 1 ){ + ibin_combined = 2*(ibin_nvtx*ibin_eta-1); + } + else{ + ATH_MSG_INFO(" Not posible "); + } + //int ibin_combined = ibin_nvtx*ibin_eta-1; + // check the bin number + std::vector<int> bins{ibin_nvtx, ibin_eta,ibin_combined}; + return bins; } // ============================================================== template<typename T> -bool Root::TForwardElectronIsEMSelector::CheckVar(const std::vector<T>& vec, int choice) const +bool Root::TForwardElectronIsEMSelector::checkVar(const std::vector<T>& vec, int choice) const { - // check vector size - // 0 : size should be 1 - // 1 : vs etaNB - // 2 : vs etaTRTNB - // 3 : vs etNB - // 4 : vs combinedNB - // 5 : vs combinedTRTNB - - // if size of vector is 0 it means cut is not defined - if (vec.size() == 0) return false; - - unsigned int etaNB = CutBinEta_ForwardElectron.size(); - unsigned int etaTRTNB = 1; - unsigned int etNB = CutVxp_ForwardElectron.size(); - //unsigned int etTRTNB = 1; - unsigned int combinedNB = 0; - unsigned int combinedTRTNB = 0; - - if (etNB>1) { - //combinedNB = etaNB * (etNB+1); - combinedNB = (etaNB-1) * (etNB-1); - } - else { - combinedNB = etaNB; - } - - combinedTRTNB = etaTRTNB; + // check vector size + // 0 : size should be 1 + // 1 : vs etaNB + // 2 : vs etaTRTNB + // 3 : vs etNB + // 4 : vs combinedNB + // 5 : vs combinedTRTNB + + // if size of vector is 0 it means cut is not defined + if (vec.size() == 0) return false; + + unsigned int etaNB = m_cutBinEta_ForwardElectron.size(); + unsigned int etaTRTNB = 1; + unsigned int etNB = m_cutVxp_ForwardElectron.size(); + //unsigned int etTRTNB = 1; + unsigned int combinedNB = 0; + unsigned int combinedTRTNB = 0; + + if (etNB>1) { + //combinedNB = etaNB * (etNB+1); + combinedNB = (etaNB-1) * (etNB-1); + } + else { + combinedNB = etaNB; + } + + combinedTRTNB = etaTRTNB; - // check if size is 1 (give choice 0) - if (choice==0) { - if ( vec.size() != 1) { - ATH_MSG_ERROR("choice 0 vector size is " - << vec.size() << " but needs 1"); - return false; - } - } - - // check if size is etaNB - if (choice==1) { - if (vec.size() != etaNB ) { - ATH_MSG_ERROR("choice 1 vector size is " - << vec.size() << " but needs " - << etaNB); - return false; - } - } - // check if size is etaTRTNB - if (choice==2) { - if ( vec.size() != etaTRTNB ) { - ATH_MSG_ERROR("choice 2 vector size is " - << vec.size() << " but needs " - << etaTRTNB); - return false; - } - } - - // check if size is etNB - if (choice==3) { - if ( vec.size() != etNB ) { - ATH_MSG_ERROR("choice 3 vector size is " - << vec.size() << " but needs " - << etNB); - return false; - } - } - - // check if size is combinedNB - if (choice==4) { - if ( vec.size() != combinedNB ) { - ATH_MSG_ERROR("choice 4 vector size is " - << vec.size() << " but needs " - << combinedNB); - return false; - } - } - - // check if size is etaTRTNB - if (choice==5) { - if ( vec.size() != combinedTRTNB ) { - ATH_MSG_ERROR("choice 5 vector size is " - << vec.size() << " but needs " - << combinedTRTNB); - return false; - } - } - return true; + // check if size is 1 (give choice 0) + if (choice==0) { + if ( vec.size() != 1) { + ATH_MSG_ERROR("choice 0 vector size is " + << vec.size() << " but needs 1"); + return false; + } + } + + // check if size is etaNB + if (choice==1) { + if (vec.size() != etaNB ) { + ATH_MSG_ERROR("choice 1 vector size is " + << vec.size() << " but needs " + << etaNB); + return false; + } + } + // check if size is etaTRTNB + if (choice==2) { + if ( vec.size() != etaTRTNB ) { + ATH_MSG_ERROR("choice 2 vector size is " + << vec.size() << " but needs " + << etaTRTNB); + return false; + } + } + + // check if size is etNB + if (choice==3) { + if ( vec.size() != etNB ) { + ATH_MSG_ERROR("choice 3 vector size is " + << vec.size() << " but needs " + << etNB); + return false; + } + } + + // check if size is combinedNB + if (choice==4) { + if ( vec.size() != combinedNB ) { + ATH_MSG_ERROR("choice 4 vector size is " + << vec.size() << " but needs " + << combinedNB); + return false; + } + } + + // check if size is etaTRTNB + if (choice==5) { + if ( vec.size() != combinedTRTNB ) { + ATH_MSG_ERROR("choice 5 vector size is " + << vec.size() << " but needs " + << combinedTRTNB); + return false; + } + } + return true; } -template bool Root::TForwardElectronIsEMSelector::CheckVar<float> (const std::vector<float>& vec, int choice) const; -template bool Root::TForwardElectronIsEMSelector::CheckVar<int> (const std::vector<int>& vec, int choice) const; +template bool Root::TForwardElectronIsEMSelector::checkVar<float> (const std::vector<float>& vec, int choice) const; +template bool Root::TForwardElectronIsEMSelector::checkVar<int> (const std::vector<int>& vec, int choice) const; diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TForwardElectronIsEMSelector.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TForwardElectronIsEMSelector.h index cab6885a91f094a5fd6c636710a249ff914ee179..1ee2cb9f585c75953497a4d8069a16376f3b88fb 100644 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TForwardElectronIsEMSelector.h +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TForwardElectronIsEMSelector.h @@ -8,182 +8,182 @@ #define __TFORWARDELECTRONISEMSELECTOR__ /** - @class TForwardElectronIsEMSelector - @brief Example tool to select objects in pure ROOT + @class TForwardElectronIsEMSelector + @brief Example tool to select objects in pure ROOT - @author Karsten Koeneke (CERN), Jovan Mitrevski (UCSC) - @date April 2011 - Feb 2012 + @author Karsten Koeneke (CERN), Jovan Mitrevski (UCSC) + @date April 2011 - Feb 2012 - based on egammaElectronCutIDTool from F. Derue + based on egammaElectronCutIDTool from F. Derue */ // ROOT includes -#include <TString.h> // Include the return object and the base class -#include "PATCore/TAccept.h" -#include "PATCore/TSelectorToolBase.h" #include "ElectronPhotonSelectorTools/egammaPIDdefs.h" #include "AsgTools/AsgMessaging.h" +#include "PATCore/AcceptInfo.h" +#include "PATCore/AcceptData.h" #include <vector> +#include <string> class AsgForwardElectronIsEMSelector; namespace Root { - class TForwardElectronIsEMSelector : public TSelectorToolBase, public asg::AsgMessaging - { - - friend class ::AsgForwardElectronIsEMSelector; - - public: - /** Standard constructor */ - TForwardElectronIsEMSelector(const char* name="TForwardElectronIsEMSelector"); - - /** Standard destructor */ - ~TForwardElectronIsEMSelector(); - - - // Main methods - /** Initialize this class */ - int initialize(); - - /** Finalize this class; everything that should be done after the event loop should go here */ - inline int finalize() { return 1 ;}; - - /** The main accept method: the actual cuts are applied here */ - const Root::TAccept& accept( - // eta - float eta, - // NVP - float nvtx, - // secondlambda - float secondLambda, - // lateral - float lateral, - // longitudinal - float longitudinal, - // fracMax - float fracMax, - // centerlambda - float centerLambda, - // secondR - float secondR) const; - - // calculate the isEM. (Used internally by accept) - unsigned int calcIsEm( - // eta - float eta, - // NPV - float nvtx, - // secondlambda - float secondLambda, - // lateral - float lateral, - // lateral - float longitudinal, - // longitudinal - float centerLambda, - // fracMax - float fracMax, - // secondR - float secondR) const; - - // used internally by calcIsEm, but left public because it can be useful for users. Note that - // it doesn't necessarily zero all the values that pass, so make sure that the input iflag - // bits that you are concerned with start out with 0. - unsigned int calocuts_electrons( - // eta - float eta, - // NPV - float nvtx, - // secondlambda - float secondLambda, - // lateral - float lateral, - // lateral - float longitudinal, - // longitudinal - float centerLambda, - // fracMax - float fracMax, - // secondR - float secondR, - // the starting isEM (should be 0 if new) - unsigned int iflag - ) const; - - // used internally by calcIsEm, but left public because it can be useful for users. Note that - // it doesn't necessarily zero all the values that pass, so make sure that the input iflag - // bits that you are concerned with start out with 0. - - unsigned int isEM() const {return m_isEM; }; - //unsigned int isEMMask() const {return m_isEMMask; } // user should not need this - - /////////////////////////////////// - // Public members (the cut values) - /////////////////////////////// - - /** @brief which subset of cuts to apply */ - unsigned int isEMMask; - - /** @brief range of eta bins for e-ID*/ - std::vector<float> CutBinEta_ForwardElectron; - /** @brief range of NPV bins for e-ID*/ - std::vector<float> CutVxp_ForwardElectron; - /** @brief cut on secondlambda*/ - std::vector<float> CutSECONDLAMBDA_ForwardElectron; - /** @brief cut on lateral*/ - std::vector<float> CutLATERAL_ForwardElectron; - /** @brief cut on longitudinal*/ - std::vector<float> CutLONGITUDINAL_ForwardElectron; - /** @brief cut on maxFrac*/ - std::vector<float> CutCELLMAXFRAC_ForwardElectron; - /** @brief cut values for cut on secondR */ - std::vector<float> CutSECONDR_ForwardElectron; - /** @brief cut on centerlambda*/ - std::vector<float> CutCENTERLAMBDA_ForwardElectron; - - // Private members - private: - - // would ideally be protected: only to be used by ARASelector - void setIsEM(unsigned int isEM) { m_isEM = isEM; }; - const Root::TAccept& fillAccept() const; - - std::vector<int> FindNvtxEtaBin(float nvtx, double eta) const; - - template<typename T> - bool CheckVar(const std::vector<T>& vec, int choice) const; - - mutable unsigned int m_isEM; - - // the cut positions - - /** @brief cluster eta range */ - int m_cutPositionBinEta_ForwardElectron; - - // int m_cutPositionVxp_ForwardElectron; - - int m_cutPositionSECONDLAMBDA_ForwardElectron; - int m_cutPositionLATERAL_ForwardElectron; - int m_cutPositionLONGITUDINAL_ForwardElectron; - int m_cutPositionCELLMAXFRAC_ForwardElectron; - int m_cutPositionSECONDR_ForwardElectron; - int m_cutPositionCENTERLAMBDA_ForwardElectron; + class TForwardElectronIsEMSelector : public asg::AsgMessaging + { + + friend class ::AsgForwardElectronIsEMSelector; + + public: + /** Standard constructor */ + TForwardElectronIsEMSelector(const char* name="TForwardElectronIsEMSelector"); + + /** Standard destructor */ + ~TForwardElectronIsEMSelector(); + + + // Main methods + /** Initialize this class */ + StatusCode initialize(); + + /** The main accept method: the actual cuts are applied here */ + asg::AcceptData accept( + // eta + float eta, + // NVP + float nvtx, + // secondlambda + float secondLambda, + // lateral + float lateral, + // longitudinal + float longitudinal, + // fracMax + float fracMax, + // centerlambda + float centerLambda, + // secondR + float secondR) const; + + /** Return dummy accept with only info */ + asg::AcceptData accept() const { return asg::AcceptData(&m_acceptInfo); } + + // calculate the isEM. (Used internally by accept) + unsigned int calcIsEm( + // eta + float eta, + // NPV + float nvtx, + // secondlambda + float secondLambda, + // lateral + float lateral, + // lateral + float longitudinal, + // longitudinal + float centerLambda, + // fracMax + float fracMax, + // secondR + float secondR) const; + + // used internally by calcIsEm, but left public because it can be useful for users. Note that + // it doesn't necessarily zero all the values that pass, so make sure that the input iflag + // bits that you are concerned with start out with 0. + unsigned int calocuts_electrons( + // eta + float eta, + // NPV + float nvtx, + // secondlambda + float secondLambda, + // lateral + float lateral, + // lateral + float longitudinal, + // longitudinal + float centerLambda, + // fracMax + float fracMax, + // secondR + float secondR, + // the starting isEM (should be 0 if new) + unsigned int iflag) const; + + // used internally by calcIsEm, but left public because it can be useful for users. Note that + // it doesn't necessarily zero all the values that pass, so make sure that the input iflag + // bits that you are concerned with start out with 0. + + /////////////////////////////////// + // Public members (the cut values) + /////////////////////////////// + + /** @brief which subset of cuts to apply */ + unsigned int m_isEMMask; + + /** @brief range of eta bins for e-ID*/ + std::vector<float> m_cutBinEta_ForwardElectron; + /** @brief range of NPV bins for e-ID*/ + std::vector<float> m_cutVxp_ForwardElectron; + /** @brief cut on secondlambda*/ + std::vector<float> m_cutSECONDLAMBDA_ForwardElectron; + /** @brief cut on lateral*/ + std::vector<float> m_cutLATERAL_ForwardElectron; + /** @brief cut on longitudinal*/ + std::vector<float> m_cutLONGITUDINAL_ForwardElectron; + /** @brief cut on maxFrac*/ + std::vector<float> m_cutCELLMAXFRAC_ForwardElectron; + /** @brief cut values for cut on secondR */ + std::vector<float> m_cutSECONDR_ForwardElectron; + /** @brief cut on centerlambda*/ + std::vector<float> m_cutCENTERLAMBDA_ForwardElectron; + + /// accesss to the accept info object + const asg::AcceptInfo& getAcceptInfo() const { return m_acceptInfo; } + + private: + + // Private members + + // would ideally be protected: only to be used by ARASelector + asg::AcceptData fillAccept(unsigned int isEM) const; + + std::vector<int> findNvtxEtaBin(float nvtx, double eta) const; + + template<typename T> + bool checkVar(const std::vector<T>& vec, int choice) const; + + /// Accept info + asg::AcceptInfo m_acceptInfo; + + // the cut positions + + /** @brief cluster eta range */ + int m_cutPositionBinEta_ForwardElectron; + + // int m_cutPositionVxp_ForwardElectron; + + int m_cutPositionSECONDLAMBDA_ForwardElectron; + int m_cutPositionLATERAL_ForwardElectron; + int m_cutPositionLONGITUDINAL_ForwardElectron; + int m_cutPositionCELLMAXFRAC_ForwardElectron; + int m_cutPositionSECONDR_ForwardElectron; + int m_cutPositionCENTERLAMBDA_ForwardElectron; - // the cut names + // the cut names - const TString m_cutNameBinEta_ForwardElectron; - const TString m_cutNameVxp_ForwardElectron; - const TString m_cutNameSECONDLAMBDA_ForwardElectron; - const TString m_cutNameLATERAL_ForwardElectron; - const TString m_cutNameLONGITUDINAL_ForwardElectron; - const TString m_cutNameCELLMAXFRAC_ForwardElectron; - const TString m_cutNameSECONDR_ForwardElectron; - const TString m_cutNameCENTERLAMBDA_ForwardElectron; + const std::string m_cutNameBinEta_ForwardElectron; + const std::string m_cutNameVxp_ForwardElectron; + const std::string m_cutNameSECONDLAMBDA_ForwardElectron; + const std::string m_cutNameLATERAL_ForwardElectron; + const std::string m_cutNameLONGITUDINAL_ForwardElectron; + const std::string m_cutNameCELLMAXFRAC_ForwardElectron; + const std::string m_cutNameSECONDR_ForwardElectron; + const std::string m_cutNameCENTERLAMBDA_ForwardElectron; - }; // End: class definition + }; // End: class definition } // End: namespace Root diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TPhotonIsEMSelector.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TPhotonIsEMSelector.cxx index 5e4573fe2de4b270e3c410c07c04ad66a99286f7..a8f8167481b7153c8491d85ac141111679bd4da1 100755 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TPhotonIsEMSelector.cxx +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TPhotonIsEMSelector.cxx @@ -22,12 +22,10 @@ UPDATED: #include <cmath> Root::TPhotonIsEMSelector::TPhotonIsEMSelector(const char* name) : - TSelectorToolBase(name), asg::AsgMessaging(std::string(name)), - isEMMask(0),//All will pass if not defined - forceConvertedPhotonPID(false), - forceNonConvertedPhotonPID(false), - m_isEM(~0), + m_isEMMask(0),//All will pass if not defined + m_forceConvertedPhotonPID(false), + m_forceNonConvertedPhotonPID(false), /** @brief cluster eta range */ m_cutPositionClusterEtaRange_Photon(0), /** @brief energy fraction in the third layer */ @@ -110,26 +108,25 @@ Root::TPhotonIsEMSelector::TPhotonIsEMSelector(const char* name) : /** @brief tracker isolation for photon selection */ m_cutNameTrackIsolation_Photon("TrackIsolation_Photon") { - m_isEM = 0; - m_cutPositionClusterEtaRange_Photon = 0; + m_cutPositionClusterEtaRange_Photon = 0; m_cutPositionClusterBackEnergyFraction_Photon = 0; - m_cutPositionClusterHadronicLeakage_Photon = 0; - m_cutPositionClusterMiddleEnergy_Photon = 0; - m_cutPositionClusterMiddleEratio37_Photon = 0; - m_cutPositionClusterMiddleEratio33_Photon = 0; - m_cutPositionClusterMiddleWidth_Photon = 0; - m_cutPositionClusterStripsEratio_Photon = 0; + m_cutPositionClusterHadronicLeakage_Photon = 0; + m_cutPositionClusterMiddleEnergy_Photon = 0; + m_cutPositionClusterMiddleEratio37_Photon = 0; + m_cutPositionClusterMiddleEratio33_Photon = 0; + m_cutPositionClusterMiddleWidth_Photon = 0; + m_cutPositionClusterStripsEratio_Photon = 0; //m_cutPositionClusterStripsDeltaEmax2_Photon = 0; - m_cutPositionClusterStripsDeltaE_Photon = 0; - m_cutPositionClusterStripsWtot_Photon = 0; - m_cutPositionClusterStripsFracm_Photon = 0; - m_cutPositionClusterStripsWeta1c_Photon = 0; - m_cutPositionClusterStripsDEmaxs1_Photon = 0; - m_cutPositionTrackMatchEoverP_Photon = 0; - m_cutPositionAmbiguityResolution_Photon = 0; - m_cutPositionIsolation_Photon = 0; - m_cutPositionClusterIsolation_Photon = 0; - m_cutPositionTrackIsolation_Photon = 0; + m_cutPositionClusterStripsDeltaE_Photon = 0; + m_cutPositionClusterStripsWtot_Photon = 0; + m_cutPositionClusterStripsFracm_Photon = 0; + m_cutPositionClusterStripsWeta1c_Photon = 0; + m_cutPositionClusterStripsDEmaxs1_Photon = 0; + m_cutPositionTrackMatchEoverP_Photon = 0; + m_cutPositionAmbiguityResolution_Photon = 0; + m_cutPositionIsolation_Photon = 0; + m_cutPositionClusterIsolation_Photon = 0; + m_cutPositionTrackIsolation_Photon = 0; } // ================================================================= Root::TPhotonIsEMSelector::~TPhotonIsEMSelector() @@ -137,10 +134,10 @@ Root::TPhotonIsEMSelector::~TPhotonIsEMSelector() } // ================================================================= -int Root::TPhotonIsEMSelector::initialize() +StatusCode Root::TPhotonIsEMSelector::initialize() { - int sc(1); + StatusCode sc(StatusCode::SUCCESS); // -------------------------------------------------------------------------- // Register the cuts and check that the registration worked: @@ -148,227 +145,227 @@ int Root::TPhotonIsEMSelector::initialize() /** @brief cluster eta range, bit 0*/ m_cutPositionClusterEtaRange_Photon = - m_accept.addCut(m_cutNameClusterEtaRange_Photon, "Photon within eta range"); - if (m_cutPositionClusterEtaRange_Photon < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameClusterEtaRange_Photon, "Photon within eta range"); + if (m_cutPositionClusterEtaRange_Photon < 0) sc = StatusCode::FAILURE; - int voidcutpos = m_accept.addCut("VOID1", "No Cut"); // bit 1 is not used - if (voidcutpos < 0) sc = 0; + int voidcutpos = m_acceptInfo.addCut("VOID1", "No Cut"); // bit 1 is not used + if (voidcutpos < 0) sc = StatusCode::FAILURE; - voidcutpos = m_accept.addCut("VOID2", "No Cut"); // bit 2 is not used - if (voidcutpos < 0) sc = 0; + voidcutpos = m_acceptInfo.addCut("VOID2", "No Cut"); // bit 2 is not used + if (voidcutpos < 0) sc = StatusCode::FAILURE; - voidcutpos = m_accept.addCut("VOID3", "No Cut"); // bit 3 is not used - if (voidcutpos < 0) sc = 0; + voidcutpos = m_acceptInfo.addCut("VOID3", "No Cut"); // bit 3 is not used + if (voidcutpos < 0) sc = StatusCode::FAILURE; - voidcutpos = m_accept.addCut("VOID4", "No Cut"); // bit 4 is not used - if (voidcutpos < 0) sc = 0; + voidcutpos = m_acceptInfo.addCut("VOID4", "No Cut"); // bit 4 is not used + if (voidcutpos < 0) sc = StatusCode::FAILURE; - voidcutpos = m_accept.addCut("VOID5", "No Cut"); // bit 5 is not used - if (voidcutpos < 0) sc = 0; + voidcutpos = m_acceptInfo.addCut("VOID5", "No Cut"); // bit 5 is not used + if (voidcutpos < 0) sc = StatusCode::FAILURE; - voidcutpos = m_accept.addCut("VOID6", "No Cut"); // bit 6 is not used - if (voidcutpos < 0) sc = 0; + voidcutpos = m_acceptInfo.addCut("VOID6", "No Cut"); // bit 6 is not used + if (voidcutpos < 0) sc = StatusCode::FAILURE; /** @brief energy fraction in the third layer (f3), bit 7 */ m_cutPositionClusterBackEnergyFraction_Photon = - m_accept.addCut(m_cutNameClusterBackEnergyFraction_Photon, "f3 < Cut"); - if (m_cutPositionClusterBackEnergyFraction_Photon < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameClusterBackEnergyFraction_Photon, "f3 < Cut"); + if (m_cutPositionClusterBackEnergyFraction_Photon < 0) sc = StatusCode::FAILURE; - voidcutpos = m_accept.addCut("VOID7", "No Cut"); // bit 8 is not used - if (voidcutpos < 0) sc = 0; + voidcutpos = m_acceptInfo.addCut("VOID7", "No Cut"); // bit 8 is not used + if (voidcutpos < 0) sc = StatusCode::FAILURE; - voidcutpos = m_accept.addCut("VOID8", "No Cut"); // bit 9 is not used - if (voidcutpos < 0) sc = 0; + voidcutpos = m_acceptInfo.addCut("VOID8", "No Cut"); // bit 9 is not used + if (voidcutpos < 0) sc = StatusCode::FAILURE; /** @brief cluster leakage into the hadronic calorimeter, bit 10 */ m_cutPositionClusterHadronicLeakage_Photon = - m_accept.addCut(m_cutNameClusterHadronicLeakage_Photon, "Had leakage < Cut"); - if (m_cutPositionClusterHadronicLeakage_Photon < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameClusterHadronicLeakage_Photon, "Had leakage < Cut"); + if (m_cutPositionClusterHadronicLeakage_Photon < 0) sc = StatusCode::FAILURE; /** @brief energy in 2nd sampling (e277), bit 11 */ m_cutPositionClusterMiddleEnergy_Photon = - m_accept.addCut(m_cutNameClusterMiddleEnergy_Photon, "Energy in second sampling (E277) > Cut"); - if (m_cutPositionClusterMiddleEnergy_Photon < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameClusterMiddleEnergy_Photon, "Energy in second sampling (E277) > Cut"); + if (m_cutPositionClusterMiddleEnergy_Photon < 0) sc = StatusCode::FAILURE; /** @brief energy ratio in 2nd sampling, bit 12 */ m_cutPositionClusterMiddleEratio37_Photon = - m_accept.addCut(m_cutNameClusterMiddleEratio37_Photon, "E237/E277 > Cut"); - if (m_cutPositionClusterMiddleEratio37_Photon < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameClusterMiddleEratio37_Photon, "E237/E277 > Cut"); + if (m_cutPositionClusterMiddleEratio37_Photon < 0) sc = StatusCode::FAILURE; /** @brief energy ratio in 2nd sampling for photons, bit 13 */ m_cutPositionClusterMiddleEratio33_Photon = - m_accept.addCut(m_cutNameClusterMiddleEratio33_Photon, "E233/E237 > Cut"); - if (m_cutPositionClusterMiddleEratio33_Photon < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameClusterMiddleEratio33_Photon, "E233/E237 > Cut"); + if (m_cutPositionClusterMiddleEratio33_Photon < 0) sc = StatusCode::FAILURE; /** @brief width in the second sampling, bit 14 */ m_cutPositionClusterMiddleWidth_Photon = - m_accept.addCut(m_cutNameClusterMiddleWidth_Photon, "Weta2 < Cut"); - if (m_cutPositionClusterMiddleWidth_Photon < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameClusterMiddleWidth_Photon, "Weta2 < Cut"); + if (m_cutPositionClusterMiddleWidth_Photon < 0) sc = StatusCode::FAILURE; /** @brief fraction of energy found in 1st sampling, bit 15 */ m_cutPositionClusterStripsEratio_Photon = - m_accept.addCut(m_cutNameClusterStripsEratio_Photon, "f1 > Cut"); - if (m_cutPositionClusterStripsEratio_Photon < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameClusterStripsEratio_Photon, "f1 > Cut"); + if (m_cutPositionClusterStripsEratio_Photon < 0) sc = StatusCode::FAILURE; /** @brief energy of 2nd maximum in 1st sampling ~e2tsts1/(1000+const_lumi*et), bit 16 */ //m_cutPositionClusterStripsDeltaEmax2_Photon = - // m_accept.addCut(m_cutNameClusterStripsDeltaEmax2_Photon, "DeltaEmax2 < Cut"); - //if (m_cutPositionClusterStripsDeltaEmax2_Photon < 0) sc = 0; - voidcutpos = m_accept.addCut("VOID9", "No Cut"); // bit 16 is not used - if (voidcutpos < 0) sc = 0; + // m_acceptInfo.addCut(m_cutNameClusterStripsDeltaEmax2_Photon, "DeltaEmax2 < Cut"); + //if (m_cutPositionClusterStripsDeltaEmax2_Photon < 0) sc = StatusCode::FAILURE; + voidcutpos = m_acceptInfo.addCut("VOID9", "No Cut"); // bit 16 is not used + if (voidcutpos < 0) sc = StatusCode::FAILURE; /** @brief difference between 2nd maximum and 1st minimum in strips (e2tsts1-emins1), bit 17 */ m_cutPositionClusterStripsDeltaE_Photon = - m_accept.addCut(m_cutNameClusterStripsDeltaE_Photon, + m_acceptInfo.addCut(m_cutNameClusterStripsDeltaE_Photon, "difference between 2nd maximum and 1st minimum in strips < Cut"); - if (m_cutPositionClusterStripsDeltaE_Photon < 0) sc = 0; + if (m_cutPositionClusterStripsDeltaE_Photon < 0) sc = StatusCode::FAILURE; /** @brief shower width in 1st sampling, bit 18 */ m_cutPositionClusterStripsWtot_Photon = - m_accept.addCut(m_cutNameClusterStripsWtot_Photon, "Wtot < Cut"); - if (m_cutPositionClusterStripsWtot_Photon < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameClusterStripsWtot_Photon, "Wtot < Cut"); + if (m_cutPositionClusterStripsWtot_Photon < 0) sc = StatusCode::FAILURE; /** @brief shower shape in shower core 1st sampling, bit 19 */ m_cutPositionClusterStripsFracm_Photon = - m_accept.addCut(m_cutNameClusterStripsFracm_Photon, "Fracm < Cut"); - if (m_cutPositionClusterStripsFracm_Photon < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameClusterStripsFracm_Photon, "Fracm < Cut"); + if (m_cutPositionClusterStripsFracm_Photon < 0) sc = StatusCode::FAILURE; /** @brief shower width weighted by distance from the maximum one, bit 20 */ m_cutPositionClusterStripsWeta1c_Photon = - m_accept.addCut(m_cutNameClusterStripsWeta1c_Photon, "Weta1c < Cut"); - if (m_cutPositionClusterStripsWeta1c_Photon < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameClusterStripsWeta1c_Photon, "Weta1c < Cut"); + if (m_cutPositionClusterStripsWeta1c_Photon < 0) sc = StatusCode::FAILURE; /** @brief difference between max and 2nd max in strips, bit 21 */ m_cutPositionClusterStripsDEmaxs1_Photon = - m_accept.addCut(m_cutNameClusterStripsDEmaxs1_Photon, + m_acceptInfo.addCut(m_cutNameClusterStripsDEmaxs1_Photon, "difference between max and 2nd max in strips > Cut"); - if (m_cutPositionClusterStripsDEmaxs1_Photon < 0) sc = 0; + if (m_cutPositionClusterStripsDEmaxs1_Photon < 0) sc = StatusCode::FAILURE; /** @brief energy-momentum match for photon selection, bit 22 */ m_cutPositionTrackMatchEoverP_Photon = - m_accept.addCut(m_cutNameTrackMatchEoverP_Photon, "E/p within allowed range (conversions only)"); - if (m_cutPositionTrackMatchEoverP_Photon < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameTrackMatchEoverP_Photon, "E/p within allowed range (conversions only)"); + if (m_cutPositionTrackMatchEoverP_Photon < 0) sc = StatusCode::FAILURE; /** @brief ambiguity resolution for photon (vs electron), bit 23 */ m_cutPositionAmbiguityResolution_Photon = - m_accept.addCut(m_cutNameAmbiguityResolution_Photon, + m_acceptInfo.addCut(m_cutNameAmbiguityResolution_Photon, "Passes tighter ambiguity resolution vs electron"); - if (m_cutPositionAmbiguityResolution_Photon < 0) sc = 0; + if (m_cutPositionAmbiguityResolution_Photon < 0) sc = StatusCode::FAILURE; - voidcutpos = m_accept.addCut("VOID10", "No Cut"); // bit 24 is not used - if (voidcutpos < 0) sc = 0; + voidcutpos = m_acceptInfo.addCut("VOID10", "No Cut"); // bit 24 is not used + if (voidcutpos < 0) sc = StatusCode::FAILURE; - voidcutpos = m_accept.addCut("VOID11", "No Cut"); // bit 25 is not used - if (voidcutpos < 0) sc = 0; + voidcutpos = m_acceptInfo.addCut("VOID11", "No Cut"); // bit 25 is not used + if (voidcutpos < 0) sc = StatusCode::FAILURE; - voidcutpos = m_accept.addCut("VOID12", "No Cut"); // bit 26 is not used - if (voidcutpos < 0) sc = 0; + voidcutpos = m_acceptInfo.addCut("VOID12", "No Cut"); // bit 26 is not used + if (voidcutpos < 0) sc = StatusCode::FAILURE; - voidcutpos = m_accept.addCut("VOID13", "No Cut"); // bit 27 is not used - if (voidcutpos < 0) sc = 0; + voidcutpos = m_acceptInfo.addCut("VOID13", "No Cut"); // bit 27 is not used + if (voidcutpos < 0) sc = StatusCode::FAILURE; - voidcutpos = m_accept.addCut("VOID14", "No Cut"); // bit 28 is not used - if (voidcutpos < 0) sc = 0; + voidcutpos = m_acceptInfo.addCut("VOID14", "No Cut"); // bit 28 is not used + if (voidcutpos < 0) sc = StatusCode::FAILURE; /** @brief isolation, bit 29 */ m_cutPositionIsolation_Photon = - m_accept.addCut(m_cutNameIsolation_Photon, "Track and calorimetric isolation"); - if (m_cutPositionIsolation_Photon < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameIsolation_Photon, "Track and calorimetric isolation"); + if (m_cutPositionIsolation_Photon < 0) sc = StatusCode::FAILURE; /** @brief calorimetric isolation for photon selection, bit 30 */ m_cutPositionClusterIsolation_Photon = - m_accept.addCut(m_cutNameClusterIsolation_Photon, "calorimetric isolation only"); - if (m_cutPositionClusterIsolation_Photon < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameClusterIsolation_Photon, "calorimetric isolation only"); + if (m_cutPositionClusterIsolation_Photon < 0) sc = StatusCode::FAILURE; /** @brief tracker isolation for photon selection, bit 31 */ m_cutPositionTrackIsolation_Photon = - m_accept.addCut(m_cutNameTrackIsolation_Photon, "track isolation only"); - if (m_cutPositionTrackIsolation_Photon < 0) sc = 0; + m_acceptInfo.addCut(m_cutNameTrackIsolation_Photon, "track isolation only"); + if (m_cutPositionTrackIsolation_Photon < 0) sc = StatusCode::FAILURE; - if (sc == 0) { + if (sc == StatusCode::FAILURE) { ATH_MSG_ERROR("Exceeded the number of allowed cuts in TPhotonIsEMSelector"); } return sc; } -const Root::TAccept& Root::TPhotonIsEMSelector::fillAccept() +asg::AcceptData Root::TPhotonIsEMSelector::fillAccept(unsigned int isEM) { + asg::AcceptData acceptData(&m_acceptInfo); for (int i = 0; i < 32; i++) { - const unsigned int mask = (0x1 << i) & isEMMask; - m_accept.setCutResult(i, (m_isEM & mask) == 0); + const unsigned int mask = (0x1 << i) & m_isEMMask; + acceptData.setCutResult(i, (isEM & mask) == 0); } - return m_accept; + return acceptData; } //============================================================================= // Calculate the actual accept of each cut individually. //============================================================================= -const Root::TAccept& Root::TPhotonIsEMSelector::accept( - // eta position in second sampling - float eta2, - // transverse energy in calorimeter (using eta position in second sampling) - double et, - // transverse energy in 1st scintillator of hadronic calorimeter/ET - float Rhad1, - // transverse energy in hadronic calorimeter/ET - float Rhad, - // E(7*7) in 2nd sampling - float e277, - // E(3*7)/E(7*7) in 2nd sampling - float Reta, - // E(3*3)/E(3*7) in 2nd sampling - float Rphi, - // shower width in 2nd sampling - float weta2c, - // fraction of energy reconstructed in strips - float f1, - // (E of 1st max in strips-E of 2nd max)/(E of 1st max+E of 2nd max) - float Eratio, - // E(2nd max)-E(min) in strips - float DeltaE, - // E of 2nd max between max and min in strips - // float emax2, - // shower width in 3 strips in 1st sampling - float weta1c, - // total shower width in strips - float wtot, - // E(+/-3)-E(+/-1)/E(+/-1) - float fracm, - // fraction of energy reconstructed in the 3rd sampling - float f3, - // E/p - double ep, - // is it a conversion - bool isConversion) +asg::AcceptData +Root::TPhotonIsEMSelector::accept( + // eta position in second sampling + float eta2, + // transverse energy in calorimeter (using eta position in second sampling) + double et, + // transverse energy in 1st scintillator of hadronic calorimeter/ET + float Rhad1, + // transverse energy in hadronic calorimeter/ET + float Rhad, + // E(7*7) in 2nd sampling + float e277, + // E(3*7)/E(7*7) in 2nd sampling + float Reta, + // E(3*3)/E(3*7) in 2nd sampling + float Rphi, + // shower width in 2nd sampling + float weta2c, + // fraction of energy reconstructed in strips + float f1, + // (E of 1st max in strips-E of 2nd max)/(E of 1st max+E of 2nd max) + float Eratio, + // E(2nd max)-E(min) in strips + float DeltaE, + // E of 2nd max between max and min in strips + // float emax2, + // shower width in 3 strips in 1st sampling + float weta1c, + // total shower width in strips + float wtot, + // E(+/-3)-E(+/-1)/E(+/-1) + float fracm, + // fraction of energy reconstructed in the 3rd sampling + float f3, + // E/p + double ep, + // is it a conversion + bool isConversion) { - // Reset the cut result bits to zero (= pass cut) - m_accept.clear(); // ----------------------------------------------------------- // Do the actual selection - m_isEM = calcIsEm(eta2, - et, - Rhad1, - Rhad, - e277, - Reta, - Rphi, - weta2c, - f1, - Eratio, - DeltaE, - //emax2, - weta1c, - wtot, - fracm, - f3, - ep, - isConversion); - - return fillAccept(); + unsigned int isEM = calcIsEm(eta2, + et, + Rhad1, + Rhad, + e277, + Reta, + Rphi, + weta2c, + f1, + Eratio, + DeltaE, + //emax2, + weta1c, + wtot, + fracm, + f3, + ep, + isConversion); + + return fillAccept(isEM); } @@ -416,7 +413,7 @@ unsigned int Root::TPhotonIsEMSelector::calcIsEm( unsigned int iflag = 0; // apply calorimeter selection for photons - if (forceConvertedPhotonPID) { + if (m_forceConvertedPhotonPID) { // force to test converted photon hypothesis iflag = calocuts_photonsConverted(eta2, et, @@ -437,7 +434,7 @@ unsigned int Root::TPhotonIsEMSelector::calcIsEm( ep, iflag); - } else if (forceNonConvertedPhotonPID || !isConversion) { + } else if (m_forceNonConvertedPhotonPID || !isConversion) { iflag = calocuts_photonsNonConverted(eta2, et, Rhad1, @@ -522,15 +519,15 @@ unsigned int Root::TPhotonIsEMSelector::calocuts_photonsNonConverted( int ibine = 0; // loop on ET range - for (unsigned int ibe=1;ibe<=CutBinEnergy_photonsNonConverted.size();ibe++) { - if ( ibe <CutBinEnergy_photonsNonConverted.size() ) { - if ( et >= CutBinEnergy_photonsNonConverted[ibe-1] && - et < CutBinEnergy_photonsNonConverted[ibe] ) { + for (unsigned int ibe=1;ibe<=m_cutBinEnergy_photonsNonConverted.size();ibe++) { + if ( ibe <m_cutBinEnergy_photonsNonConverted.size() ) { + if ( et >= m_cutBinEnergy_photonsNonConverted[ibe-1] && + et < m_cutBinEnergy_photonsNonConverted[ibe] ) { ibine = ibe; } } - else if ( ibe == CutBinEnergy_photonsNonConverted.size() ) { - if ( et >= CutBinEnergy_photonsNonConverted[ibe-1] ) { + else if ( ibe == m_cutBinEnergy_photonsNonConverted.size() ) { + if ( et >= m_cutBinEnergy_photonsNonConverted[ibe-1] ) { ibine = ibe; } } @@ -538,30 +535,30 @@ unsigned int Root::TPhotonIsEMSelector::calocuts_photonsNonConverted( int ibinEta = -1; // loop on eta range - for (unsigned int ibin=0;ibin<CutBinEta_photonsNonConverted.size();ibin++) { + for (unsigned int ibin=0;ibin<m_cutBinEta_photonsNonConverted.size();ibin++) { if ( ibin == 0 ){ - if ( eta2 < CutBinEta_photonsNonConverted[0] ) { + if ( eta2 < m_cutBinEta_photonsNonConverted[0] ) { ibinEta = 0; } } else { - if ( eta2 >= CutBinEta_photonsNonConverted[ibin-1] && - eta2 < CutBinEta_photonsNonConverted[ibin] ) { + if ( eta2 >= m_cutBinEta_photonsNonConverted[ibin-1] && + eta2 < m_cutBinEta_photonsNonConverted[ibin] ) { ibinEta = ibin; } } } // check the bin number - const int ibin_combined = ibine*CutBinEta_photonsNonConverted.size()+ibinEta; + const int ibin_combined = ibine*m_cutBinEta_photonsNonConverted.size()+ibinEta; // // second sampling cuts // - if ((e277_photonsNonConverted.size()==0 ) ) { + if ((m_e277_photonsNonConverted.size()==0 ) ) { ATH_MSG_WARNING("e277 needs to be set "); } - if (e277_photonsNonConverted.size()>0 && e277 >= e277_photonsNonConverted[0] ) { + if (m_e277_photonsNonConverted.size() > 0 && e277 >= m_e277_photonsNonConverted[0] ) { if (ibinEta==-1) { //std::cout << " pb with eta range = " << eta2 << std::endl; iflag |= ( 0x1 << egammaPID::ClusterEtaRange_Photon); @@ -569,43 +566,43 @@ unsigned int Root::TPhotonIsEMSelector::calocuts_photonsNonConverted( } // hadronic leakage - if (CheckVar(CutHadLeakage_photonsNonConverted,23)) { + if (checkVar(m_cutHadLeakage_photonsNonConverted,23)) { if (eta2 < 0.8) { - if (Rhad1>CutHadLeakage_photonsNonConverted[ibin_combined]) + if (Rhad1 > m_cutHadLeakage_photonsNonConverted[ibin_combined]) iflag |= ( 0x1 << egammaPID::ClusterHadronicLeakage_Photon); } else if (eta2 >= 0.8 && eta2 < 1.37) { - if (Rhad>CutHadLeakage_photonsNonConverted[ibin_combined]) + if (Rhad > m_cutHadLeakage_photonsNonConverted[ibin_combined]) iflag |= ( 0x1 << egammaPID::ClusterHadronicLeakage_Photon); } else { - if (Rhad1>CutHadLeakage_photonsNonConverted[ibin_combined]) + if (Rhad1 > m_cutHadLeakage_photonsNonConverted[ibin_combined]) iflag |= ( 0x1 << egammaPID::ClusterHadronicLeakage_Photon); } } // F3 - if (CheckVar(CutF3_photonsNonConverted,23)) { - if (f3 > CutF3_photonsNonConverted[ibin_combined] ) { + if (checkVar(m_cutF3_photonsNonConverted,23)) { + if (f3 > m_cutF3_photonsNonConverted[ibin_combined] ) { iflag |= ( 0x1 << egammaPID::ClusterBackEnergyFraction_Photon); } } // E237/E277 - if (CheckVar(Reta37_photonsNonConverted,23)) { - if (Reta < Reta37_photonsNonConverted[ibin_combined] ) { + if (checkVar(m_Reta37_photonsNonConverted,23)) { + if (Reta < m_Reta37_photonsNonConverted[ibin_combined] ) { iflag |= ( 0x1 << egammaPID::ClusterMiddleEratio37_Photon); } } // E233/E237 - if (CheckVar(Rphi33_photonsNonConverted,23)) { - if (Rphi < Rphi33_photonsNonConverted[ibin_combined] ) { + if (checkVar(m_Rphi33_photonsNonConverted,23)) { + if (Rphi < m_Rphi33_photonsNonConverted[ibin_combined] ) { iflag |= ( 0x1 << egammaPID::ClusterMiddleEratio33_Photon); } } // width in 2n sampling - if (CheckVar(weta2_photonsNonConverted,23)) { - if (weta2c > weta2_photonsNonConverted[ibin_combined] ) { + if (checkVar(m_weta2_photonsNonConverted,23)) { + if (weta2c > m_weta2_photonsNonConverted[ibin_combined] ) { iflag |= ( 0x1 << egammaPID::ClusterMiddleWidth_Photon); } } @@ -617,19 +614,19 @@ unsigned int Root::TPhotonIsEMSelector::calocuts_photonsNonConverted( // // first sampling cuts // - if (CutBinEtaStrips_photonsNonConverted.size()>0) { + if (m_cutBinEtaStrips_photonsNonConverted.size() > 0) { int ibineStrips = 0; // loop on ET range - for (unsigned int ibe=1;ibe<=CutBinEnergyStrips_photonsNonConverted.size();ibe++) { - if ( ibe <CutBinEnergyStrips_photonsNonConverted.size() ) { - if ( et >= CutBinEnergyStrips_photonsNonConverted[ibe-1] && - et < CutBinEnergyStrips_photonsNonConverted[ibe] ) { + for (unsigned int ibe=1;ibe<=m_cutBinEnergyStrips_photonsNonConverted.size();ibe++) { + if ( ibe <m_cutBinEnergyStrips_photonsNonConverted.size() ) { + if ( et >= m_cutBinEnergyStrips_photonsNonConverted[ibe-1] && + et < m_cutBinEnergyStrips_photonsNonConverted[ibe] ) { ibineStrips = ibe; } } - else if ( ibe == CutBinEnergyStrips_photonsNonConverted.size() ) { - if ( et >= CutBinEnergyStrips_photonsNonConverted[ibe-1] ) { + else if ( ibe == m_cutBinEnergyStrips_photonsNonConverted.size() ) { + if ( et >= m_cutBinEnergyStrips_photonsNonConverted[ibe-1] ) { ibineStrips = ibe; } } @@ -637,15 +634,15 @@ unsigned int Root::TPhotonIsEMSelector::calocuts_photonsNonConverted( int ibinEtaStrips = -1; // loop on eta range - for (unsigned int ibin=0;ibin<CutBinEtaStrips_photonsNonConverted.size();ibin++) { + for (unsigned int ibin=0;ibin<m_cutBinEtaStrips_photonsNonConverted.size();ibin++) { if ( ibin == 0 ){ - if ( eta2 < CutBinEtaStrips_photonsNonConverted[0] ) { + if ( eta2 < m_cutBinEtaStrips_photonsNonConverted[0] ) { ibinEtaStrips = 0; } } else { - if ( eta2 >= CutBinEtaStrips_photonsNonConverted[ibin-1] && - eta2 < CutBinEtaStrips_photonsNonConverted[ibin] ) { + if ( eta2 >= m_cutBinEtaStrips_photonsNonConverted[ibin-1] && + eta2 < m_cutBinEtaStrips_photonsNonConverted[ibin] ) { ibinEtaStrips = ibin; } } @@ -657,51 +654,51 @@ unsigned int Root::TPhotonIsEMSelector::calocuts_photonsNonConverted( return iflag; } - const int ibin_combinedStrips = ibineStrips*CutBinEtaStrips_photonsNonConverted.size()+ibinEtaStrips; + const int ibin_combinedStrips = ibineStrips*m_cutBinEtaStrips_photonsNonConverted.size()+ibinEtaStrips; - if (CheckVar(f1_photonsNonConverted,0)) { - if (f1<f1_photonsNonConverted[0] ) { + if (checkVar(m_f1_photonsNonConverted,0)) { + if (f1 < m_f1_photonsNonConverted[0] ) { iflag |= ( 0x1 << egammaPID::ClusterStripsEratio_Photon); } } // Rmax2 - // if (CheckVar(emax2r_photonsNonConverted,26)) { + // if (checkVar(emax2r_photonsNonConverted,26)) { // if (deltaemax2 > emax2r_photonsNonConverted[ibin_combinedStrips] ) { // iflag |= ( 0x1 << egammaPID::ClusterStripsDeltaEmax2_Photon); // } // } // Delta E - if (CheckVar(deltae_photonsNonConverted,26)) { - if (DeltaE > deltae_photonsNonConverted[ibin_combinedStrips]) { + if (checkVar(m_deltae_photonsNonConverted,26)) { + if (DeltaE > m_deltae_photonsNonConverted[ibin_combinedStrips]) { iflag |= ( 0x1 << egammaPID::ClusterStripsDeltaE_Photon); } } // Eratio - if (CheckVar(DEmaxs1_photonsNonConverted,26)) { - if (Eratio<=DEmaxs1_photonsNonConverted[ibin_combinedStrips]) + if (checkVar(m_DEmaxs1_photonsNonConverted,26)) { + if (Eratio<=m_DEmaxs1_photonsNonConverted[ibin_combinedStrips]) iflag |= ( 0x1 << egammaPID::ClusterStripsDEmaxs1_Photon); } // total width in strips - if (CheckVar(wtot_photonsNonConverted,26)) { - if (wtot > wtot_photonsNonConverted[ibin_combinedStrips] ) { + if (checkVar(m_wtot_photonsNonConverted,26)) { + if (wtot > m_wtot_photonsNonConverted[ibin_combinedStrips] ) { iflag |= ( 0x1 << egammaPID::ClusterStripsWtot_Photon); } } // (E(+/-3)-E(+/-1))/E(+/-1) - if (CheckVar(fracm_photonsNonConverted,26)) { - if (fracm > fracm_photonsNonConverted[ibin_combinedStrips] ) { + if (checkVar(m_fracm_photonsNonConverted,26)) { + if (fracm > m_fracm_photonsNonConverted[ibin_combinedStrips] ) { iflag |= ( 0x1 << egammaPID::ClusterStripsFracm_Photon); } } // width in 3 strips - if (CheckVar(w1_photonsNonConverted,26)) { - if (weta1c > w1_photonsNonConverted[ibin_combinedStrips]) { + if (checkVar(m_w1_photonsNonConverted,26)) { + if (weta1c > m_w1_photonsNonConverted[ibin_combinedStrips]) { iflag |= ( 0x1 << egammaPID::ClusterStripsWeta1c_Photon); } } @@ -751,15 +748,15 @@ unsigned int Root::TPhotonIsEMSelector::calocuts_photonsConverted( { int ibine = 0; // loop on ET range - for (unsigned int ibe=1;ibe<=CutBinEnergy_photonsConverted.size();ibe++) { - if ( ibe <CutBinEnergy_photonsConverted.size() ) { - if ( et >= CutBinEnergy_photonsConverted[ibe-1] && - et < CutBinEnergy_photonsConverted[ibe] ) { + for (unsigned int ibe=1;ibe<=m_cutBinEnergy_photonsConverted.size();ibe++) { + if ( ibe <m_cutBinEnergy_photonsConverted.size() ) { + if ( et >= m_cutBinEnergy_photonsConverted[ibe-1] && + et < m_cutBinEnergy_photonsConverted[ibe] ) { ibine = ibe; } } - else if ( ibe == CutBinEnergy_photonsConverted.size() ) { - if ( et >= CutBinEnergy_photonsConverted[ibe-1] ) { + else if ( ibe == m_cutBinEnergy_photonsConverted.size() ) { + if ( et >= m_cutBinEnergy_photonsConverted[ibe-1] ) { ibine = ibe; } } @@ -767,30 +764,30 @@ unsigned int Root::TPhotonIsEMSelector::calocuts_photonsConverted( int ibinEta = -1; // loop on eta range - for (unsigned int ibin=0;ibin<CutBinEta_photonsConverted.size();ibin++) { + for (unsigned int ibin=0;ibin<m_cutBinEta_photonsConverted.size();ibin++) { if ( ibin == 0 ){ - if ( eta2 < CutBinEta_photonsConverted[0] ) { + if ( eta2 < m_cutBinEta_photonsConverted[0] ) { ibinEta = 0; } } else { - if ( eta2 >= CutBinEta_photonsConverted[ibin-1] && - eta2 < CutBinEta_photonsConverted[ibin] ) { + if ( eta2 >= m_cutBinEta_photonsConverted[ibin-1] && + eta2 < m_cutBinEta_photonsConverted[ibin] ) { ibinEta = ibin; } } } // check the bin number - const int ibin_combined = ibine*CutBinEta_photonsConverted.size()+ibinEta; + const int ibin_combined = ibine*m_cutBinEta_photonsConverted.size()+ibinEta; // // second sampling cuts // - if ( (e277_photonsConverted.size()==0) ) { + if ( (m_e277_photonsConverted.size()==0) ) { ATH_MSG_WARNING("e277 needs to be set "); } - if (e277_photonsConverted.size()>0 && e277 >= e277_photonsConverted[0] ) { + if (m_e277_photonsConverted.size() > 0 && e277 >= m_e277_photonsConverted[0] ) { if (ibinEta==-1) { iflag |= ( 0x1 << egammaPID::ClusterEtaRange_Photon); @@ -798,43 +795,43 @@ unsigned int Root::TPhotonIsEMSelector::calocuts_photonsConverted( } // hadronic leakage - if (CheckVar(CutHadLeakage_photonsConverted,13)) { + if (checkVar(m_cutHadLeakage_photonsConverted,13)) { if (eta2 < 0.8) { - if (Rhad1>CutHadLeakage_photonsConverted[ibin_combined]) + if (Rhad1 > m_cutHadLeakage_photonsConverted[ibin_combined]) iflag |= ( 0x1 << egammaPID::ClusterHadronicLeakage_Photon); } else if (eta2 >= 0.8 && eta2 < 1.37) { - if (Rhad>CutHadLeakage_photonsConverted[ibin_combined]) + if (Rhad > m_cutHadLeakage_photonsConverted[ibin_combined]) iflag |= ( 0x1 << egammaPID::ClusterHadronicLeakage_Photon); } else { - if (Rhad1>CutHadLeakage_photonsConverted[ibin_combined]) + if (Rhad1 > m_cutHadLeakage_photonsConverted[ibin_combined]) iflag |= ( 0x1 << egammaPID::ClusterHadronicLeakage_Photon); } } // F3 - if (CheckVar(CutF3_photonsConverted,13)) { - if (f3 > CutF3_photonsConverted[ibin_combined] ) { + if (checkVar(m_cutF3_photonsConverted,13)) { + if (f3 > m_cutF3_photonsConverted[ibin_combined] ) { iflag |= ( 0x1 << egammaPID::ClusterBackEnergyFraction_Photon); } } // E237/E277 - if (CheckVar(Reta37_photonsConverted,13)) { - if (Reta < Reta37_photonsConverted[ibin_combined] ) { + if (checkVar(m_Reta37_photonsConverted,13)) { + if (Reta < m_Reta37_photonsConverted[ibin_combined] ) { iflag |= ( 0x1 << egammaPID::ClusterMiddleEratio37_Photon); } } // E233/E237 - if (CheckVar(Rphi33_photonsConverted,13)) { - if (Rphi < Rphi33_photonsConverted[ibin_combined] ) { + if (checkVar(m_Rphi33_photonsConverted,13)) { + if (Rphi < m_Rphi33_photonsConverted[ibin_combined] ) { iflag |= ( 0x1 << egammaPID::ClusterMiddleEratio33_Photon); } } // width in 2n sampling - if (CheckVar(weta2_photonsConverted,13)) { - if (weta2c > weta2_photonsConverted[ibin_combined] ) { + if (checkVar(m_weta2_photonsConverted,13)) { + if (weta2c > m_weta2_photonsConverted[ibin_combined] ) { iflag |= ( 0x1 << egammaPID::ClusterMiddleWidth_Photon); } } @@ -846,19 +843,19 @@ unsigned int Root::TPhotonIsEMSelector::calocuts_photonsConverted( // // first sampling cuts // - if (CutBinEtaStrips_photonsConverted.size()>0) { + if (m_cutBinEtaStrips_photonsConverted.size() > 0) { int ibineStrips = 0; // loop on ET range - for (unsigned int ibe=1;ibe<=CutBinEnergyStrips_photonsConverted.size();ibe++) { - if ( ibe <CutBinEnergyStrips_photonsConverted.size() ) { - if ( et >= CutBinEnergyStrips_photonsConverted[ibe-1] && - et < CutBinEnergyStrips_photonsConverted[ibe] ) { + for (unsigned int ibe=1;ibe<=m_cutBinEnergyStrips_photonsConverted.size();ibe++) { + if ( ibe <m_cutBinEnergyStrips_photonsConverted.size() ) { + if ( et >= m_cutBinEnergyStrips_photonsConverted[ibe-1] && + et < m_cutBinEnergyStrips_photonsConverted[ibe] ) { ibineStrips = ibe; } } - else if ( ibe == CutBinEnergyStrips_photonsConverted.size() ) { - if ( et >= CutBinEnergyStrips_photonsConverted[ibe-1] ) { + else if ( ibe == m_cutBinEnergyStrips_photonsConverted.size() ) { + if ( et >= m_cutBinEnergyStrips_photonsConverted[ibe-1] ) { ibineStrips = ibe; } } @@ -866,15 +863,15 @@ unsigned int Root::TPhotonIsEMSelector::calocuts_photonsConverted( int ibinEtaStrips = -1; // loop on eta range - for (unsigned int ibin=0;ibin<CutBinEtaStrips_photonsConverted.size();ibin++) { + for (unsigned int ibin=0;ibin<m_cutBinEtaStrips_photonsConverted.size();ibin++) { if ( ibin == 0 ){ - if ( eta2 < CutBinEtaStrips_photonsConverted[0] ) { + if ( eta2 < m_cutBinEtaStrips_photonsConverted[0] ) { ibinEtaStrips = 0; } } else { - if ( eta2 >= CutBinEtaStrips_photonsConverted[ibin-1] && - eta2 < CutBinEtaStrips_photonsConverted[ibin] ) { + if ( eta2 >= m_cutBinEtaStrips_photonsConverted[ibin-1] && + eta2 < m_cutBinEtaStrips_photonsConverted[ibin] ) { ibinEtaStrips = ibin; } } @@ -886,51 +883,51 @@ unsigned int Root::TPhotonIsEMSelector::calocuts_photonsConverted( return iflag; } - const int ibin_combinedStrips = ibineStrips*CutBinEtaStrips_photonsConverted.size()+ibinEtaStrips; + const int ibin_combinedStrips = ibineStrips*m_cutBinEtaStrips_photonsConverted.size()+ibinEtaStrips; - if (CheckVar(f1_photonsConverted,0)) { - if (f1<f1_photonsConverted[0] ) { + if (checkVar(m_f1_photonsConverted,0)) { + if (f1 < m_f1_photonsConverted[0] ) { iflag |= ( 0x1 << egammaPID::ClusterStripsEratio_Photon); } } // Rmax2 - // if (CheckVar(emax2r_photonsConverted,16)) { + // if (checkVar(emax2r_photonsConverted,16)) { // if (deltaemax2 > emax2r_photonsConverted[ibin_combinedStrips] ) { // iflag |= ( 0x1 << egammaPID::ClusterStripsDeltaEmax2_Photon); // } // } // Delta E - if (CheckVar(deltae_photonsConverted,16)) { - if (DeltaE > deltae_photonsConverted[ibin_combinedStrips]) { + if (checkVar(m_deltae_photonsConverted,16)) { + if (DeltaE > m_deltae_photonsConverted[ibin_combinedStrips]) { iflag |= ( 0x1 << egammaPID::ClusterStripsDeltaE_Photon); } } // Eratio - if (CheckVar(DEmaxs1_photonsConverted,16)) { - if (Eratio<=DEmaxs1_photonsConverted[ibin_combinedStrips]) + if (checkVar(m_DEmaxs1_photonsConverted,16)) { + if (Eratio <= m_DEmaxs1_photonsConverted[ibin_combinedStrips]) iflag |= ( 0x1 << egammaPID::ClusterStripsDEmaxs1_Photon); } // total width in strips - if (CheckVar(wtot_photonsConverted,16)) { - if (wtot > wtot_photonsConverted[ibin_combinedStrips] ) { + if (checkVar(m_wtot_photonsConverted,16)) { + if (wtot > m_wtot_photonsConverted[ibin_combinedStrips] ) { iflag |= ( 0x1 << egammaPID::ClusterStripsWtot_Photon); } } // (E(+/-3)-E(+/-1))/E(+/-1) - if (CheckVar(fracm_photonsConverted,16)) { - if (fracm > fracm_photonsConverted[ibin_combinedStrips] ) { + if (checkVar(m_fracm_photonsConverted,16)) { + if (fracm > m_fracm_photonsConverted[ibin_combinedStrips] ) { iflag |= ( 0x1 << egammaPID::ClusterStripsFracm_Photon); } } // width in 3 strips - if (CheckVar(w1_photonsConverted,16)) { - if (weta1c > w1_photonsConverted[ibin_combinedStrips]) { + if (checkVar(m_w1_photonsConverted,16)) { + if (weta1c > m_w1_photonsConverted[ibin_combinedStrips]) { iflag |= ( 0x1 << egammaPID::ClusterStripsWeta1c_Photon); } } @@ -938,10 +935,10 @@ unsigned int Root::TPhotonIsEMSelector::calocuts_photonsConverted( // cut on E/p // - if (CheckVar(CutminEp_photonsConverted,13) && - CheckVar(CutmaxEp_photonsConverted,13)) { - if ( ep < CutminEp_photonsConverted[ibin_combined] || - ep > CutmaxEp_photonsConverted[ibin_combined] ) + if (checkVar(m_cutminEp_photonsConverted,13) && + checkVar(m_cutmaxEp_photonsConverted,13)) { + if ( ep < m_cutminEp_photonsConverted[ibin_combined] || + ep > m_cutmaxEp_photonsConverted[ibin_combined] ) iflag |= ( 0x1 << egammaPID::TrackMatchEoverP_Photon); } @@ -949,7 +946,7 @@ unsigned int Root::TPhotonIsEMSelector::calocuts_photonsConverted( } // ============================================================== -bool Root::TPhotonIsEMSelector::CheckVar(std::vector<float> vec, int choice) const +bool Root::TPhotonIsEMSelector::checkVar(std::vector<float> vec, int choice) const { // // check vector size @@ -972,9 +969,9 @@ bool Root::TPhotonIsEMSelector::CheckVar(std::vector<float> vec, int choice) con // selection of non converted objects unsigned int etaNB_photonsNonConv = - CutBinEta_photonsNonConverted.size(); + m_cutBinEta_photonsNonConverted.size(); unsigned int etNB_photonsNonConv = - CutBinEnergy_photonsNonConverted.size(); + m_cutBinEnergy_photonsNonConverted.size(); unsigned int combinedNB_photonsNonConv = 0; if (etNB_photonsNonConv>0) combinedNB_photonsNonConv = @@ -988,9 +985,9 @@ bool Root::TPhotonIsEMSelector::CheckVar(std::vector<float> vec, int choice) con // << std::endl; unsigned int etaStripsNB_photonsNonConv = - CutBinEtaStrips_photonsNonConverted.size(); + m_cutBinEtaStrips_photonsNonConverted.size(); unsigned int etStripsNB_photonsNonConv = - CutBinEnergyStrips_photonsNonConverted.size(); + m_cutBinEnergyStrips_photonsNonConverted.size(); unsigned int combinedStripsNB_photonsNonConv = 0; if (etStripsNB_photonsNonConv>0) combinedStripsNB_photonsNonConv = @@ -1006,9 +1003,9 @@ bool Root::TPhotonIsEMSelector::CheckVar(std::vector<float> vec, int choice) con // selection of converted objects unsigned int etaNB_photonsConv = - CutBinEta_photonsConverted.size(); + m_cutBinEta_photonsConverted.size(); unsigned int etNB_photonsConv = - CutBinEnergy_photonsConverted.size(); + m_cutBinEnergy_photonsConverted.size(); unsigned int combinedNB_photonsConv = 0; if (etNB_photonsConv>0) combinedNB_photonsConv = @@ -1023,9 +1020,9 @@ bool Root::TPhotonIsEMSelector::CheckVar(std::vector<float> vec, int choice) con // << std::endl; unsigned int etaStripsNB_photonsConv = - CutBinEtaStrips_photonsConverted.size(); + m_cutBinEtaStrips_photonsConverted.size(); unsigned int etStripsNB_photonsConv = - CutBinEnergyStrips_photonsConverted.size(); + m_cutBinEnergyStrips_photonsConverted.size(); unsigned int combinedStripsNB_photonsConv = 0; if (etStripsNB_photonsConv>0) combinedStripsNB_photonsConv = @@ -1175,7 +1172,7 @@ bool Root::TPhotonIsEMSelector::CheckVar(std::vector<float> vec, int choice) con } // ============================================================== -bool Root::TPhotonIsEMSelector::CheckVar(std::vector<int> vec, int choice) const +bool Root::TPhotonIsEMSelector::checkVar(std::vector<int> vec, int choice) const { // // check vector size @@ -1215,7 +1212,7 @@ bool Root::TPhotonIsEMSelector::CheckVar(std::vector<int> vec, int choice) const case 11: { const unsigned int etaNB_photonsConv = - CutBinEta_photonsConverted.size(); + m_cutBinEta_photonsConverted.size(); if ( vec.size() != etaNB_photonsConv ) { ATH_MSG_ERROR("vector size is " << vec.size() << " but needs etaNB_photonsConv " @@ -1230,7 +1227,7 @@ bool Root::TPhotonIsEMSelector::CheckVar(std::vector<int> vec, int choice) const case 12: { const unsigned int etNB_photonsConv = - CutBinEnergy_photonsConverted.size(); + m_cutBinEnergy_photonsConverted.size(); if ( vec.size() != etNB_photonsConv ) { ATH_MSG_ERROR("vector size is " << vec.size() << " but needs etNB_photonsConv=" @@ -1245,9 +1242,9 @@ bool Root::TPhotonIsEMSelector::CheckVar(std::vector<int> vec, int choice) const case 13: { const unsigned int etaNB_photonsConv = - CutBinEta_photonsConverted.size(); + m_cutBinEta_photonsConverted.size(); const unsigned int etNB_photonsConv = - CutBinEnergy_photonsConverted.size(); + m_cutBinEnergy_photonsConverted.size(); unsigned int combinedNB_photonsConv = 0; if (etNB_photonsConv>0) combinedNB_photonsConv = @@ -1269,7 +1266,7 @@ bool Root::TPhotonIsEMSelector::CheckVar(std::vector<int> vec, int choice) const case 14: { const unsigned int etaStripsNB_photonsConv = - CutBinEtaStrips_photonsConverted.size(); + m_cutBinEtaStrips_photonsConverted.size(); if ( vec.size() != etaStripsNB_photonsConv ) { ATH_MSG_ERROR("vector size is " << vec.size() << " but needs etaStripsNB_photonsConv=" @@ -1284,7 +1281,7 @@ bool Root::TPhotonIsEMSelector::CheckVar(std::vector<int> vec, int choice) const case 15: { const unsigned int etStripsNB_photonsConv = - CutBinEnergyStrips_photonsConverted.size(); + m_cutBinEnergyStrips_photonsConverted.size(); if ( vec.size() != etStripsNB_photonsConv ) { ATH_MSG_ERROR("vector size is " << vec.size() << " but needs etStripsNB_photonsConv=" @@ -1299,9 +1296,9 @@ bool Root::TPhotonIsEMSelector::CheckVar(std::vector<int> vec, int choice) const case 16: { const unsigned int etaStripsNB_photonsConv = - CutBinEtaStrips_photonsConverted.size(); + m_cutBinEtaStrips_photonsConverted.size(); const unsigned int etStripsNB_photonsConv = - CutBinEnergyStrips_photonsConverted.size(); + m_cutBinEnergyStrips_photonsConverted.size(); unsigned int combinedStripsNB_photonsConv = 0; if (etStripsNB_photonsConv>0) combinedStripsNB_photonsConv = @@ -1323,7 +1320,7 @@ bool Root::TPhotonIsEMSelector::CheckVar(std::vector<int> vec, int choice) const case 21: { const unsigned int etaNB_photonsNonConv = - CutBinEta_photonsNonConverted.size(); + m_cutBinEta_photonsNonConverted.size(); if ( vec.size() != etaNB_photonsNonConv ) { ATH_MSG_ERROR("vector size is " << vec.size() << " but needs etaNB_photonsNonConv " @@ -1338,7 +1335,7 @@ bool Root::TPhotonIsEMSelector::CheckVar(std::vector<int> vec, int choice) const case 22: { const unsigned int etNB_photonsNonConv = - CutBinEnergy_photonsNonConverted.size(); + m_cutBinEnergy_photonsNonConverted.size(); if ( vec.size() != etNB_photonsNonConv ) { ATH_MSG_ERROR("vector size is " << vec.size() << " but needs etNB_photonsNonConv=" @@ -1352,9 +1349,9 @@ bool Root::TPhotonIsEMSelector::CheckVar(std::vector<int> vec, int choice) const case 23: { const unsigned int etaNB_photonsNonConv = - CutBinEta_photonsNonConverted.size(); + m_cutBinEta_photonsNonConverted.size(); const unsigned int etNB_photonsNonConv = - CutBinEnergy_photonsNonConverted.size(); + m_cutBinEnergy_photonsNonConverted.size(); unsigned int combinedNB_photonsNonConv = 0; if (etNB_photonsNonConv>0) combinedNB_photonsNonConv = @@ -1376,7 +1373,7 @@ bool Root::TPhotonIsEMSelector::CheckVar(std::vector<int> vec, int choice) const case 24: { const unsigned int etaStripsNB_photonsNonConv = - CutBinEtaStrips_photonsNonConverted.size(); + m_cutBinEtaStrips_photonsNonConverted.size(); if ( vec.size() != etaStripsNB_photonsNonConv ) { ATH_MSG_ERROR("vector size is " << vec.size() << " but needs etaStripsNB_photonsNonConv=" @@ -1391,7 +1388,7 @@ bool Root::TPhotonIsEMSelector::CheckVar(std::vector<int> vec, int choice) const case 25: { const unsigned int etStripsNB_photonsNonConv = - CutBinEnergyStrips_photonsNonConverted.size(); + m_cutBinEnergyStrips_photonsNonConverted.size(); if ( vec.size() != etStripsNB_photonsNonConv ) { ATH_MSG_ERROR("vector size is " << vec.size() << " but needs etStripsNB_photonsNonConv=" @@ -1406,9 +1403,9 @@ bool Root::TPhotonIsEMSelector::CheckVar(std::vector<int> vec, int choice) const case 26: { const unsigned int etaStripsNB_photonsNonConv = - CutBinEtaStrips_photonsNonConverted.size(); + m_cutBinEtaStrips_photonsNonConverted.size(); const unsigned int etStripsNB_photonsNonConv = - CutBinEnergyStrips_photonsNonConverted.size(); + m_cutBinEnergyStrips_photonsNonConverted.size(); unsigned int combinedStripsNB_photonsNonConv = 0; if (etStripsNB_photonsNonConv>0) combinedStripsNB_photonsNonConv = diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TPhotonIsEMSelector.h b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TPhotonIsEMSelector.h index b938fc87d35b4b004d1b5191936b9848a67453d3..8ff19f5d148e9c46508c7636a74e62966433459c 100755 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TPhotonIsEMSelector.h +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools/Root/TPhotonIsEMSelector.h @@ -20,22 +20,20 @@ */ -// ROOT includes -#include <TString.h> - // Include the return object and the base class -#include "PATCore/TAccept.h" -#include "PATCore/TSelectorToolBase.h" +#include "PATCore/AcceptInfo.h" +#include "PATCore/AcceptData.h" #include "ElectronPhotonSelectorTools/egammaPIDdefs.h" #include "AsgTools/AsgMessaging.h" #include <vector> +#include <string> class AsgPhotonIsEMSelector; namespace Root { - class TPhotonIsEMSelector : public TSelectorToolBase,public asg::AsgMessaging + class TPhotonIsEMSelector : public asg::AsgMessaging { friend class ::AsgPhotonIsEMSelector; @@ -50,14 +48,10 @@ namespace Root { // Main methods /** Initialize this class */ - int initialize(); - - /** Finalize this class; everything that should be done after the event loop should go here */ - inline int finalize() { return 1; }; - + StatusCode initialize(); /** The main accept method: the actual cuts are applied here */ - const Root::TAccept& accept( + asg::AcceptData accept( // eta position in second sampling float eta2, // transverse energy in calorimeter (using eta position in second sampling) @@ -95,6 +89,9 @@ namespace Root { // is it a conversion bool isConversion) ; + /** Return dummy accept with only info */ + asg::AcceptData accept() const { return asg::AcceptData(&m_acceptInfo); } + // calculate the isEM. (Used internally by accept) unsigned int calcIsEm( // eta position in second sampling @@ -204,120 +201,116 @@ namespace Root { float f3, unsigned int iflag) const; - - unsigned int isEM() const {return m_isEM; }; - //unsigned int isEMMask() const {return m_isEMMask; } // user should not need this - - /////////////////////////////////// // Public members (the cut values) /////////////////////////////// /** @brief which subset of cuts to apply */ - unsigned int isEMMask; + unsigned int m_isEMMask; /** @brief boolean to force to test converted photon hypothesis */ - bool forceConvertedPhotonPID; + bool m_forceConvertedPhotonPID; /** @brief boolean to force to test non converted photon hypothesis */ - bool forceNonConvertedPhotonPID; + bool m_forceNonConvertedPhotonPID; // // selection for non-converted photons // /** @brief range of eta bins for photon-ID*/ - std::vector<float> CutBinEta_photonsNonConverted; + std::vector<float> m_cutBinEta_photonsNonConverted; /** @brief range of ET bins for photon-ID*/ - std::vector<float> CutBinEnergy_photonsNonConverted; + std::vector<float> m_cutBinEnergy_photonsNonConverted; /** @brief Cut in E277 for photons*/ - std::vector<float> e277_photonsNonConverted; + std::vector<float> m_e277_photonsNonConverted; /** @brief Cut on hadronic leakage for photons*/ - std::vector<float> CutHadLeakage_photonsNonConverted; + std::vector<float> m_cutHadLeakage_photonsNonConverted; /** @brief ratio E237/E277*/ - std::vector<float> Reta37_photonsNonConverted; + std::vector<float> m_Reta37_photonsNonConverted; /** @brief ratio E233/E237*/ - std::vector<float> Rphi33_photonsNonConverted; + std::vector<float> m_Rphi33_photonsNonConverted; /** @brief Cut on width in 2nd sampling for photons*/ - std::vector<float> weta2_photonsNonConverted; + std::vector<float> m_weta2_photonsNonConverted; /** @brief binning in eta in strips for photons*/ - std::vector<float> CutBinEtaStrips_photonsNonConverted; + std::vector<float> m_cutBinEtaStrips_photonsNonConverted; /** @brief */ - std::vector<float> CutBinEnergyStrips_photonsNonConverted; + std::vector<float> m_cutBinEnergyStrips_photonsNonConverted; /** @brief Cut on fraction of energy rec. in 1st sampling for photons*/ - std::vector<float> f1_photonsNonConverted; + std::vector<float> m_f1_photonsNonConverted; /** @brief Cut on Demax2 for photons*/ // std::vector<float> emax2r_photonsNonConverted; /** @brief Cut on Emax2-Emin for photons*/ - std::vector<float> deltae_photonsNonConverted; + std::vector<float> m_deltae_photonsNonConverted; /** @brief cut on (Emax1-Emax2)/(Emax1-Emax2) for photons*/ - std::vector<float> DEmaxs1_photonsNonConverted; + std::vector<float> m_DEmaxs1_photonsNonConverted; /** @brief Cut on total width in strips for photons*/ - std::vector<float> wtot_photonsNonConverted; + std::vector<float> m_wtot_photonsNonConverted; /** @brief Cut on fraction of energy outside core for photons*/ - std::vector<float> fracm_photonsNonConverted; + std::vector<float> m_fracm_photonsNonConverted; /** @brief Cut on width in 3 strips for photons*/ - std::vector<float> w1_photonsNonConverted; + std::vector<float> m_w1_photonsNonConverted; /** @brief cut values for cut on f3 or f3core*/ - std::vector<float> CutF3_photonsNonConverted; + std::vector<float> m_cutF3_photonsNonConverted; // // selection for converted photons // /** @brief range of eta bins for photon-ID*/ - std::vector<float> CutBinEta_photonsConverted; + std::vector<float> m_cutBinEta_photonsConverted; /** @brief range of ET bins for photon-ID*/ - std::vector<float> CutBinEnergy_photonsConverted; + std::vector<float> m_cutBinEnergy_photonsConverted; /** @brief Cut in E277 for photons*/ - std::vector<float> e277_photonsConverted; + std::vector<float> m_e277_photonsConverted; /** @brief Cut on hadronic leakage for photons*/ - std::vector<float> CutHadLeakage_photonsConverted; + std::vector<float> m_cutHadLeakage_photonsConverted; /** @brief ratio E237/E277*/ - std::vector<float> Reta37_photonsConverted; + std::vector<float> m_Reta37_photonsConverted; /** @brief ratio E233/E237*/ - std::vector<float> Rphi33_photonsConverted; + std::vector<float> m_Rphi33_photonsConverted; /** @brief Cut on width in 2nd sampling for photons*/ - std::vector<float> weta2_photonsConverted; + std::vector<float> m_weta2_photonsConverted; /** @brief binning in eta in strips for photons*/ - std::vector<float> CutBinEtaStrips_photonsConverted; + std::vector<float> m_cutBinEtaStrips_photonsConverted; /** @brief */ - std::vector<float> CutBinEnergyStrips_photonsConverted; + std::vector<float> m_cutBinEnergyStrips_photonsConverted; /** @brief Cut on fraction of energy rec. in 1st sampling for photons*/ - std::vector<float> f1_photonsConverted; + std::vector<float> m_f1_photonsConverted; /** @brief Cut on Demax2 for photons*/ // std::vector<float> emax2r_photonsConverted; /** @brief Cut on Emax2-Emin for photons*/ - std::vector<float> deltae_photonsConverted; + std::vector<float> m_deltae_photonsConverted; /** @brief cut on (Emax1-Emax2)/(Emax1-Emax2) for photons*/ - std::vector<float> DEmaxs1_photonsConverted; + std::vector<float> m_DEmaxs1_photonsConverted; /** @brief Cut on total width in strips for photons*/ - std::vector<float> wtot_photonsConverted; + std::vector<float> m_wtot_photonsConverted; /** @brief Cut on fraction of energy outside core for photons*/ - std::vector<float> fracm_photonsConverted; + std::vector<float> m_fracm_photonsConverted; /** @brief Cut on width in 3 strips for photons*/ - std::vector<float> w1_photonsConverted; + std::vector<float> m_w1_photonsConverted; /** @brief cut min on E/p for e-ID*/ - std::vector<float> CutminEp_photonsConverted; + std::vector<float> m_cutminEp_photonsConverted; /** @brief cut max on E/p for e-ID*/ - std::vector<float> CutmaxEp_photonsConverted; + std::vector<float> m_cutmaxEp_photonsConverted; /** @brief cut values for cut on f3 or f3core*/ - std::vector<float> CutF3_photonsConverted; - + std::vector<float> m_cutF3_photonsConverted; + /// accesss to the accept info object + const asg::AcceptInfo& getAcceptInfo() const { return m_acceptInfo; } // Private members private: // would ideally be protected: only to be used by ARASelector - void setIsEM(unsigned int isEM) { m_isEM = isEM; }; - const Root::TAccept& fillAccept(); + asg::AcceptData fillAccept(unsigned int isEM); - bool CheckVar(std::vector<float> vec, int choice) const; - bool CheckVar(std::vector<int> vec, int choice) const; + bool checkVar(std::vector<float> vec, int choice) const; + bool checkVar(std::vector<int> vec, int choice) const; - unsigned int m_isEM; + /// Accept info + asg::AcceptInfo m_acceptInfo; // the cut positions @@ -363,43 +356,43 @@ namespace Root { // the cut names /** @brief cluster eta range */ - const TString m_cutNameClusterEtaRange_Photon; + const std::string m_cutNameClusterEtaRange_Photon; /** @brief energy fraction in the third layer */ - const TString m_cutNameClusterBackEnergyFraction_Photon; + const std::string m_cutNameClusterBackEnergyFraction_Photon; /** @brief cluster leakage into the hadronic calorimeter */ - const TString m_cutNameClusterHadronicLeakage_Photon; + const std::string m_cutNameClusterHadronicLeakage_Photon; /** @brief energy in 2nd sampling (e277) */ - const TString m_cutNameClusterMiddleEnergy_Photon; + const std::string m_cutNameClusterMiddleEnergy_Photon; /** @brief energy ratio in 2nd sampling */ - const TString m_cutNameClusterMiddleEratio37_Photon; + const std::string m_cutNameClusterMiddleEratio37_Photon; /** @brief energy ratio in 2nd sampling for photons */ - const TString m_cutNameClusterMiddleEratio33_Photon; + const std::string m_cutNameClusterMiddleEratio33_Photon; /** @brief width in the second sampling */ - const TString m_cutNameClusterMiddleWidth_Photon; + const std::string m_cutNameClusterMiddleWidth_Photon; /** @brief fraction of energy found in 1st sampling */ - const TString m_cutNameClusterStripsEratio_Photon; + const std::string m_cutNameClusterStripsEratio_Photon; /** @brief energy of 2nd maximum in 1st sampling ~e2tsts1/(1000+const_lumi*et) */ - // const TString m_cutNameClusterStripsDeltaEmax2_Photon; + // const std::string m_cutNameClusterStripsDeltaEmax2_Photon; /** @brief difference between 2nd maximum and 1st minimum in strips (e2tsts1-emins1) */ - const TString m_cutNameClusterStripsDeltaE_Photon; + const std::string m_cutNameClusterStripsDeltaE_Photon; /** @brief shower width in 1st sampling */ - const TString m_cutNameClusterStripsWtot_Photon; + const std::string m_cutNameClusterStripsWtot_Photon; /** @brief shower shape in shower core 1st sampling */ - const TString m_cutNameClusterStripsFracm_Photon; + const std::string m_cutNameClusterStripsFracm_Photon; /** @brief shower width weighted by distance from the maximum one */ - const TString m_cutNameClusterStripsWeta1c_Photon; + const std::string m_cutNameClusterStripsWeta1c_Photon; /** @brief difference between max and 2nd max in strips */ - const TString m_cutNameClusterStripsDEmaxs1_Photon; + const std::string m_cutNameClusterStripsDEmaxs1_Photon; /** @brief energy-momentum match for photon selection*/ - const TString m_cutNameTrackMatchEoverP_Photon; + const std::string m_cutNameTrackMatchEoverP_Photon; /** @brief ambiguity resolution for photon (vs electron) */ - const TString m_cutNameAmbiguityResolution_Photon; + const std::string m_cutNameAmbiguityResolution_Photon; /** @brief isolation */ - const TString m_cutNameIsolation_Photon; + const std::string m_cutNameIsolation_Photon; /** @brief calorimetric isolation for photon selection */ - const TString m_cutNameClusterIsolation_Photon; + const std::string m_cutNameClusterIsolation_Photon; /** @brief tracker isolation for photon selection */ - const TString m_cutNameTrackIsolation_Photon; + const std::string m_cutNameTrackIsolation_Photon; }; // End: class definition diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/src/ElectronTagTool.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/src/ElectronTagTool.cxx index d9bfb7c3572019c917ec18a713346d306f4a2869..6dd3a124adee829bfb4a2a6901bd8b52eee5a388 100755 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/src/ElectronTagTool.cxx +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/src/ElectronTagTool.cxx @@ -29,6 +29,7 @@ Purpose : create a collection of ElectronTag #include "xAODTracking/TrackParticle.h" #include "xAODTracking/TrackParticleContainer.h" #include "xAODTracking/TrackParticlexAODHelpers.h" +#include "PATCore/AcceptData.h" //#include "ElectronPhotonFourMomentumCorrection/EgammaCalibrationAndSmearingTool.h" #include <sstream> diff --git a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/src/PhotonTagTool.cxx b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/src/PhotonTagTool.cxx index f7d79e59bc865daea393a4e8d43281994867eaa2..f5c3057945ecc98bcce4546d411862f1b5aad12d 100755 --- a/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/src/PhotonTagTool.cxx +++ b/PhysicsAnalysis/ElectronPhotonID/ElectronPhotonTagTools/src/PhotonTagTool.cxx @@ -25,6 +25,7 @@ Purpose : create a collection of PhotonTag #include "TagEvent/PhotonAttributeNames.h" #include "AnalysisUtils/AnalysisMisc.h" #include "AthContainers/ConstDataVector.h" +#include "PATCore/AcceptData.h" // #include "ElectronPhotonFourMomentumCorrection/EgammaCalibrationAndSmearingTool.h" #include <sstream> @@ -252,7 +253,7 @@ StatusCode PhotonTagTool::execute(TagFragmentCollection& pTagColl, const int& ma /** apply Et cut*/ bool passPtCut = (*photItr)->pt() > m_cut_Et; /** apply loose PID cut*/ - bool isLoose = m_loose_cut_based->accept(*photItr); + bool isLoose = static_cast<bool>(m_loose_cut_based->accept(*photItr)); /** apply author cut*/ bool goodAuthor = ( (*photItr)->author() & xAOD::EgammaParameters::AuthorPhoton ) > 0 || ( (*photItr)->author() & xAOD::EgammaParameters::AuthorAmbiguous ) > 0; @@ -292,10 +293,10 @@ StatusCode PhotonTagTool::execute(TagFragmentCollection& pTagColl, const int& ma /** Retrieving tightness info from xAOD */ unsigned int tightness = 0x0; - bool isLoose = m_loose_cut_based->accept(*photonItr); + bool isLoose = static_cast<bool>(m_loose_cut_based->accept(*photonItr)); if (isLoose) tightness |= (1<<0);//loose - bool isTight = m_tight_cut_based->accept(*photonItr); + bool isTight = static_cast<bool>(m_tight_cut_based->accept(*photonItr)); if (isTight) tightness |= (1<<1);//tight /** Photon Object Quality*/ diff --git a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/CMakeLists.txt b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/CMakeLists.txt index d584bbc81cf9f9ada8be0bcde4bd1340614572fc..a3eaaf9e43eb1d04c245b47d8e641485a41e5920 100644 --- a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/CMakeLists.txt +++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/CMakeLists.txt @@ -6,6 +6,7 @@ atlas_depends_on_subdirs( PUBLIC Control/AthToolSupport/AsgTools Event/xAOD/xAODEgamma + PhysicsAnalysis/Interfaces/AsgAnalysisInterfaces PhysicsAnalysis/AnalysisCommon/PATInterfaces PhysicsAnalysis/AnalysisCommon/PATCore ) diff --git a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgEGammaIsEMSelector.h b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgEGammaIsEMSelector.h index a97bead9e8a4793ba9ef1a24978621569012b649..5fa0d99d52128791df55f100e50b784d58f2ca67 100644 --- a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgEGammaIsEMSelector.h +++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgEGammaIsEMSelector.h @@ -18,43 +18,36 @@ */ // Include the interfaces -#include "PATCore/IAsgSelectionTool.h" -// Forward declarations -namespace Root{ - class TAccept; -} +#include "AsgAnalysisInterfaces/ISelectionTool.h" #include "xAODEgamma/EgammaFwd.h" #include "xAODEgamma/PhotonFwd.h" #include "xAODEgamma/ElectronFwd.h" -class IAsgEGammaIsEMSelector : virtual public IAsgSelectionTool +class IAsgEGammaIsEMSelector : virtual public CP::ISelectionTool { ASG_TOOL_INTERFACE(IAsgEGammaIsEMSelector) public: - /// @name IAsgEGammaIsEMSelector methods in Addition to the IAsgSelectionTool + /// @name IAsgEGammaIsEMSelector methods in Addition to the ISelectionTool /// @{ - /// accept with pointer to IParticle so as to not hide the IAsgSelectionTool one - virtual const Root::TAccept& accept( const xAOD::IParticle* part ) const = 0; + /// accept with pointer to IParticle so as to not hide the ISelectionTool one + virtual asg::AcceptData accept( const xAOD::IParticle* part ) const = 0; /// accept with pointer to Egamma object - virtual const Root::TAccept& accept( const xAOD::Egamma* part) const = 0; + virtual asg::AcceptData accept( const xAOD::Egamma* part) const = 0; /// accept with Photon pointer - virtual const Root::TAccept& accept( const xAOD::Photon* part ) const = 0; + virtual asg::AcceptData accept( const xAOD::Photon* part ) const = 0; /// accept with Electron reference - virtual const Root::TAccept& accept( const xAOD::Electron* part ) const = 0; + virtual asg::AcceptData accept( const xAOD::Electron* part ) const = 0; - ///Add a legacy execute method - virtual StatusCode execute(const xAOD::Egamma* eg) const =0; - - ///Return the egamma IsEM decision as unsigned int - virtual unsigned int IsemValue() const =0; + ///Add a legacy execute method - return isEM value + virtual StatusCode execute(const xAOD::Egamma* eg, unsigned int& isEM) const =0; /// Report the current operating point virtual std::string getOperatingPointName( ) const =0; diff --git a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronIsEMSelector.h b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronIsEMSelector.h index 6eb90a2e9918270504a0ef02b58f7119525e395e..f79b9364245b83ebfbcde3837f5b6aad0768bcf9 100644 --- a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronIsEMSelector.h +++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronIsEMSelector.h @@ -18,12 +18,8 @@ */ // Include the interfaces -#include "PATCore/IAsgSelectionTool.h" #include "EgammaAnalysisInterfaces/IAsgEGammaIsEMSelector.h" // Forward declarations -namespace Root{ - class TAccept; -} #include "xAODEgamma/ElectronFwd.h" #include "xAODEgamma/PhotonFwd.h" #include "xAODEgamma/EgammaFwd.h" diff --git a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronLikelihoodTool.h b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronLikelihoodTool.h index f011cb070485ca969ef5c0c311714fc0e40787bd..160251a376b1866057cfc8febaf06786c085aef4 100644 --- a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronLikelihoodTool.h +++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronLikelihoodTool.h @@ -15,58 +15,50 @@ */ // Include the interfaces -#include "PATCore/IAsgSelectionTool.h" -// Forward declarations -namespace Root{ - class TAccept; - class TResult; -} +#include "AsgAnalysisInterfaces/ISelectionTool.h" #include "xAODEgamma/ElectronFwd.h" #include "xAODEgamma/EgammaFwd.h" -class IAsgElectronLikelihoodTool : virtual public IAsgSelectionTool +class IAsgElectronLikelihoodTool : virtual public CP::ISelectionTool { ASG_TOOL_INTERFACE(IAsgElectronLikelihoodTool) public: - /// @name IAsgElectronLikelihoodTool methods in Addition to the IAsgSelectionTool ones + /// @name IAsgElectronLikelihoodTool methods in Addition to the ISelectionTool ones /// Some are there to mainly support the calls done from the online/Trigger side /// @{ - /// accept with pointer to IParticle so as to not hide the IAsgSelectionTool one - virtual const Root::TAccept& accept( const xAOD::IParticle* part ) const = 0; + /// accept with pointer to IParticle so as to not hide the ISelectionTool one + virtual asg::AcceptData accept( const xAOD::IParticle* part ) const = 0; /// accept method with pointer to electron - virtual const Root::TAccept& accept( const xAOD::Electron* part ) const = 0; + virtual asg::AcceptData accept( const xAOD::Electron* part ) const = 0; /// accept method with pointer to electron when mu not in EventInfo for online - virtual const Root::TAccept& accept( const xAOD::Electron* part, double mu ) const = 0; + virtual asg::AcceptData accept( const xAOD::Electron* part, double mu ) const = 0; /// accept method with pointer to egamma - virtual const Root::TAccept& accept( const xAOD::Egamma* part ) const = 0; + virtual asg::AcceptData accept( const xAOD::Egamma* part ) const = 0; /// accept method with pointer to egammma when mu not in EventInfo for online - virtual const Root::TAccept& accept( const xAOD::Egamma* part, double mu ) const = 0; + virtual asg::AcceptData accept( const xAOD::Egamma* part, double mu ) const = 0; - /// TResult method: for pointer to IParticle - virtual const Root::TResult& calculate( const xAOD::IParticle* part ) const = 0; + /// calculate method: for pointer to IParticle + virtual double calculate( const xAOD::IParticle* part ) const = 0; - /// TResult method: for pointer to electron - virtual const Root::TResult& calculate( const xAOD::Electron* eg ) const = 0; + /// calculate method: for pointer to electron + virtual double calculate( const xAOD::Electron* eg ) const = 0; - /// TResult method: for pointer to egamma - virtual const Root::TResult& calculate( const xAOD::Egamma* eg ) const = 0; + /// calculate method: for pointer to egamma + virtual double calculate( const xAOD::Egamma* eg ) const = 0; - /// TResult method: for pointer to electron when mu not in EventInfo for online - virtual const Root::TResult& calculate( const xAOD::Electron* eg, double mu ) const = 0; + /// calculate method: for pointer to electron when mu not in EventInfo for online + virtual double calculate( const xAOD::Electron* eg, double mu ) const = 0; - /// TResult method: for pointer to egamma when mu not in EventInfo for online - virtual const Root::TResult& calculate( const xAOD::Egamma* eg, double mu ) const = 0; - - // Just return the TResult - virtual const Root::TResult& getTResult( ) const=0; + /// calculate method: for pointer to egamma when mu not in EventInfo for online + virtual double calculate( const xAOD::Egamma* eg, double mu ) const = 0; ///Method to get the operating point virtual std::string getOperatingPointName( ) const =0; diff --git a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronMultiLeptonSelector.h b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronMultiLeptonSelector.h index bd4914c649cbcb49489605eeaffb803f05318c51..2cf4643eaa5b23081aae5ed85d2d1ca7ce2fa9ae 100644 --- a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronMultiLeptonSelector.h +++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgElectronMultiLeptonSelector.h @@ -13,28 +13,24 @@ */ // Include the interfaces -#include "PATCore/IAsgSelectionTool.h" -// Forward declarations -namespace Root{ - class TAccept; -} +#include "AsgAnalysisInterfaces/ISelectionTool.h" #include "xAODEgamma/ElectronFwd.h" -class IAsgElectronMultiLeptonSelector : virtual public IAsgSelectionTool +class IAsgElectronMultiLeptonSelector : virtual public CP::ISelectionTool { ASG_TOOL_INTERFACE(IAsgElectronMultiLeptonSelector) public: - /// @name IAsgElectronMultiLeptonSelector methods in addition to the IAsgSelectionTool ones + /// @name IAsgElectronMultiLeptonSelector methods in addition to the ISelectionTool ones ///{@ - /// accept with pointer to IParticle so as to not hide the IAsgSelectionTool one - virtual const Root::TAccept& accept( const xAOD::IParticle* part ) const = 0; + /// accept with pointer to IParticle so as to not hide the ISelectionTool one + virtual asg::AcceptData accept( const xAOD::IParticle* part ) const = 0; /// accept method with pointer to electron */ - virtual const Root::TAccept& accept( const xAOD::Electron* part ) const = 0; + virtual asg::AcceptData accept( const xAOD::Electron* part ) const = 0; ///Method to get the operating point */ virtual std::string getOperatingPointName( ) const=0; diff --git a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgForwardElectronIsEMSelector.h b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgForwardElectronIsEMSelector.h index e34ea5e6518c5483cc035c5bce976ef6bbf4bad4..61736b7a7c4a32a9ea8dddf73962d9fb8f4abe52 100644 --- a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgForwardElectronIsEMSelector.h +++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgForwardElectronIsEMSelector.h @@ -16,13 +16,8 @@ */ // Include the interfaces -#include "PATCore/IAsgSelectionTool.h" #include "EgammaAnalysisInterfaces/IAsgEGammaIsEMSelector.h" -// Forward declarations -namespace Root{ - class TAccept; -} #include "xAODEgamma/ElectronFwd.h" #include "xAODEgamma/PhotonFwd.h" #include "xAODEgamma/EgammaFwd.h" diff --git a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgPhotonIsEMSelector.h b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgPhotonIsEMSelector.h index 1d80bae90987fa0577252a210490e90929fc3fb3..9f799b6ecf933912816e506d21841e867854c21e 100644 --- a/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgPhotonIsEMSelector.h +++ b/PhysicsAnalysis/Interfaces/EgammaAnalysisInterfaces/EgammaAnalysisInterfaces/IAsgPhotonIsEMSelector.h @@ -16,13 +16,7 @@ */ // Include the interfaces -#include "PATCore/IAsgSelectionTool.h" #include "EgammaAnalysisInterfaces/IAsgEGammaIsEMSelector.h" - -// Forward declarations -namespace Root{ - class TAccept; -} #include "xAODEgamma/EgammaFwd.h" #include "xAODEgamma/PhotonFwd.h" #include "xAODEgamma/ElectronFwd.h" diff --git a/PhysicsAnalysis/JetMissingEtID/MissingEtDQA/src/PhysValMET.cxx b/PhysicsAnalysis/JetMissingEtID/MissingEtDQA/src/PhysValMET.cxx index 96c23d4445c8ee04b410a04121b973092eeea708..d5982379b354303dd6f95989f53a7a425579b3be 100644 --- a/PhysicsAnalysis/JetMissingEtID/MissingEtDQA/src/PhysValMET.cxx +++ b/PhysicsAnalysis/JetMissingEtID/MissingEtDQA/src/PhysValMET.cxx @@ -37,6 +37,7 @@ #include "xAODTracking/Vertex.h" #include "xAODTracking/VertexContainer.h" #include "xAODTracking/TrackParticle.h" +#include "PATCore/AcceptData.h" using namespace xAOD; @@ -1410,13 +1411,13 @@ namespace MissingEtDQA { bool PhysValMET::Accept(const xAOD::Electron* el) { if( fabs(el->eta())>2.47 || el->pt()<10e3 ) return false; - return m_elecSelLHTool->accept(el); + return static_cast<bool> (m_elecSelLHTool->accept(el)); } bool PhysValMET::Accept(const xAOD::Photon* ph) { if( !(ph->author()&20) || fabs(ph->eta())>2.47 || ph->pt()<10e3 ) return false; - return m_photonSelIsEMTool->accept(ph); + return static_cast<bool>(m_photonSelIsEMTool->accept(ph)); } bool PhysValMET::Accept(const xAOD::TauJet* tau) diff --git a/PhysicsAnalysis/RingerSelectorTools/Root/AsgElectronRingerSelector.cxx b/PhysicsAnalysis/RingerSelectorTools/Root/AsgElectronRingerSelector.cxx index d785987c7a3b75642ae6acd2ddb54669a87b1b01..c04fee2780f29efe0bf08ea05fd6ce772a78aad8 100644 --- a/PhysicsAnalysis/RingerSelectorTools/Root/AsgElectronRingerSelector.cxx +++ b/PhysicsAnalysis/RingerSelectorTools/Root/AsgElectronRingerSelector.cxx @@ -38,6 +38,7 @@ #include "RingerSelectorTools/tools/IRedirectMsgStream.h" #include "RingerSelectorTools/tools/cxx/RingerUseNewCppFeatures.h" #include "RingerSelectorTools/tools/cxx/errorcheck.h" +#include "PATCore/AcceptData.h" // Root framework includes: #include <TFile.h> diff --git a/PhysicsAnalysis/TauID/TauAnalysisTools/Root/TauOverlappingElectronLLHDecorator.cxx b/PhysicsAnalysis/TauID/TauAnalysisTools/Root/TauOverlappingElectronLLHDecorator.cxx index 9c2f47ab9cb81e7311f2576cc230a39b4ddc474f..7a6af18143e8453cf111362a99922124965416db 100644 --- a/PhysicsAnalysis/TauID/TauAnalysisTools/Root/TauOverlappingElectronLLHDecorator.cxx +++ b/PhysicsAnalysis/TauID/TauAnalysisTools/Root/TauOverlappingElectronLLHDecorator.cxx @@ -134,7 +134,7 @@ StatusCode TauOverlappingElectronLLHDecorator::decorate(const xAOD::TauJet& xTau // compute the LH score if there is a match if(xEleMatch!=0) - fLHScore = (m_tEMLHTool->calculate(xEleMatch)).getMVAResponse (); + fLHScore = m_tEMLHTool->calculate(xEleMatch); // static SG::AuxElement::Decorator< ElementLink< xAOD::ElectronContainer > > decElectronLink("electronLink"); // // create link to the matched electron diff --git a/Reconstruction/HeavyIonRec/HIMonitoring/HIMonitoring/HIMonitoringPhotonsTool.h b/Reconstruction/HeavyIonRec/HIMonitoring/HIMonitoring/HIMonitoringPhotonsTool.h index 1205cf1670fe5dc4e6e30fb735e2025b28eecafa..ffba9567c1e0d1c56ab0def500ae4533474ef298 100755 --- a/Reconstruction/HeavyIonRec/HIMonitoring/HIMonitoring/HIMonitoringPhotonsTool.h +++ b/Reconstruction/HeavyIonRec/HIMonitoring/HIMonitoring/HIMonitoringPhotonsTool.h @@ -2,238 +2,238 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -#ifndef HIMONITORINGPHOTONSTOOL_H -#define HIMONITORINGPHOTONSTOOL_H - -#include <vector> -#include <string> - -#include "AthenaMonitoring/ManagedMonitorToolBase.h" -#include "TRandom3.h" - -#include <xAODHIEvent/HIEventShape.h> -#include <xAODHIEvent/HIEventShapeContainer.h> - -#include <xAODEgamma/Photon.h> -#include <xAODEgamma/PhotonContainer.h> - -#include "ElectronPhotonSelectorTools/AsgPhotonIsEMSelector.h" +#ifndef HIMONITORINGPHOTONSTOOL_H +#define HIMONITORINGPHOTONSTOOL_H + +#include <vector> +#include <string> + +#include "AthenaMonitoring/ManagedMonitorToolBase.h" +#include "TRandom3.h" + +#include <xAODHIEvent/HIEventShape.h> +#include <xAODHIEvent/HIEventShapeContainer.h> + +#include <xAODEgamma/Photon.h> +#include <xAODEgamma/PhotonContainer.h> + +#include "ElectronPhotonSelectorTools/AsgPhotonIsEMSelector.h" #include "ElectronPhotonSelectorTools/egammaPIDdefs.h" - -class TH1; -class TGraph; -class TTree; -class TH1D; -//class TH1D_LW; -class TH2D_LW; -class TProfile_LW; - -class HIMonitoringPhotonsTool : public ManagedMonitorToolBase -{ - public: - - HIMonitoringPhotonsTool( const std::string & type, const std::string & name, - const IInterface* parent ); - - virtual ~HIMonitoringPhotonsTool(); - - virtual StatusCode bookHistogramsRecurrent(); - virtual StatusCode bookHistograms(); - virtual StatusCode fillHistograms(); - virtual StatusCode procHistograms(); - - void book_hist(); - - - private: - - - AsgPhotonIsEMSelector* m_photonTightIsEMSelector; - AsgPhotonIsEMSelector* m_photonLooseIsEMSelector; - - double m_FCalEt; - - int m_FCalEt_nbins; - float m_FCalEt_low; - float m_FCalEt_high; - - int m_PhotonPt_nbins; - float m_PhotonPt_low; - float m_PhotonPt_high; - - int m_PhotonEta_nbins; - float m_PhotonEta_low; - float m_PhotonEta_high; - - int m_PhotonPhi_nbins; - float m_PhotonPhi_low; - float m_PhotonPhi_high; - - int m_reta_nbins; - float m_reta_low; - float m_reta_high; - - int m_rphi_nbins; - float m_rphi_low; - float m_rphi_high; - - int m_weta2_nbins; - float m_weta2_low; - float m_weta2_high; - - int m_rhad_nbins; - float m_rhad_low; - float m_rhad_high; - - int m_wtots1_nbins; - float m_wtots1_low; - float m_wtots1_high; - - int m_fracs1_nbins; - float m_fracs1_low; - float m_fracs1_high; - - int m_deltae_nbins; - float m_deltae_low; - float m_deltae_high; - - int m_eratio_nbins; - float m_eratio_low; - float m_eratio_high; - - int m_f1_nbins; - float m_f1_low; - float m_f1_high; - - int m_IsoWide_nbins; - float m_IsoWide_low; - float m_IsoWide_high; - - int m_IsoNarrow_nbins; - float m_IsoNarrow_low; - float m_IsoNarrow_high; - - /// histograms - - // basics - TH2D_LW* m_h_photon_pt_eta; - TH2D_LW* m_h_photon_pt_phi; - TH2D_LW* m_h_photon_pt_fcal; - TH2D_LW* m_h_photon_eta_phi_ptCut; - - TH2D_LW* m_h_photon_pt_eta_tight; - TH2D_LW* m_h_photon_pt_phi_tight; - TH2D_LW* m_h_photon_pt_fcal_tight; - TH2D_LW* m_h_photon_eta_phi_ptCut_tight; - - // shower shapes - - - TH1D* m_h_photon_reta_ptCut_all; - TH1D* m_h_photon_rphi_ptCut_all; - TH1D* m_h_photon_weta2_ptCut_all; - - TH1D* m_h_photon_rhad_ptCut_all; - TH1D* m_h_photon_wtots1_ptCut_all; - TH1D* m_h_photon_fracs1_ptCut_all; - - TH1D* m_h_photon_deltae_ptCut_all; - TH1D* m_h_photon_eratio_ptCut_all; - TH1D* m_h_photon_f1_ptCut_all; - - // - TH1D* m_h_photon_reta_ptCut_loose; - TH1D* m_h_photon_rphi_ptCut_loose; - TH1D* m_h_photon_weta2_ptCut_loose; - - TH1D* m_h_photon_rhad_ptCut_loose; - TH1D* m_h_photon_wtots1_ptCut_loose; - TH1D* m_h_photon_fracs1_ptCut_loose; - - TH1D* m_h_photon_deltae_ptCut_loose; - TH1D* m_h_photon_eratio_ptCut_loose; - TH1D* m_h_photon_f1_ptCut_loose; - - // - TH1D* m_h_photon_reta_ptCut_tight; - TH1D* m_h_photon_rphi_ptCut_tight; - TH1D* m_h_photon_weta2_ptCut_tight; - - TH1D* m_h_photon_rhad_ptCut_tight; - TH1D* m_h_photon_wtots1_ptCut_tight; - TH1D* m_h_photon_fracs1_ptCut_tight; - - TH1D* m_h_photon_deltae_ptCut_tight; - TH1D* m_h_photon_eratio_ptCut_tight; - TH1D* m_h_photon_f1_ptCut_tight; - - - - TH2D_LW* m_h_photon_reta_eta_ptCut; - TH2D_LW* m_h_photon_rphi_eta_ptCut; - TH2D_LW* m_h_photon_weta2_eta_ptCut; - - TH2D_LW* m_h_photon_rhad_eta_ptCut; - TH2D_LW* m_h_photon_wtots1_eta_ptCut; - TH2D_LW* m_h_photon_fracs1_eta_ptCut; - - TH2D_LW* m_h_photon_deltae_eta_ptCut; - TH2D_LW* m_h_photon_eratio_eta_ptCut; - TH2D_LW* m_h_photon_f1_eta_ptCut; - - TH2D_LW* m_h_photon_reta_fcal_ptCut_eta0; - TH2D_LW* m_h_photon_reta_fcal_ptCut_eta1; - TH2D_LW* m_h_photon_rphi_fcal_ptCut_eta0; - TH2D_LW* m_h_photon_rphi_fcal_ptCut_eta1; - TH2D_LW* m_h_photon_weta2_fcal_ptCut_eta0; - TH2D_LW* m_h_photon_weta2_fcal_ptCut_eta1; - TH2D_LW* m_h_photon_rhad_fcal_ptCut_eta0; - TH2D_LW* m_h_photon_rhad_fcal_ptCut_eta1; - TH2D_LW* m_h_photon_wtots1_fcal_ptCut_eta0; - TH2D_LW* m_h_photon_wtots1_fcal_ptCut_eta1; - TH2D_LW* m_h_photon_fracs1_fcal_ptCut_eta0; - TH2D_LW* m_h_photon_fracs1_fcal_ptCut_eta1; - TH2D_LW* m_h_photon_deltae_fcal_ptCut_eta0; - TH2D_LW* m_h_photon_deltae_fcal_ptCut_eta1; - TH2D_LW* m_h_photon_eratio_fcal_ptCut_eta0; - TH2D_LW* m_h_photon_eratio_fcal_ptCut_eta1; - TH2D_LW* m_h_photon_f1_fcal_ptCut_eta0; - TH2D_LW* m_h_photon_f1_fcal_ptCut_eta1; - - - // isolation - TH2D_LW* m_h_photon_fcal_etcone20_ptCut; - TH2D_LW* m_h_photon_fcal_etcone30_ptCut; - TH2D_LW* m_h_photon_fcal_etcone40_ptCut; - - TH2D_LW* m_h_photon_pt_etcone40_fcal0; - TH2D_LW* m_h_photon_pt_etcone40_fcal1; - TH2D_LW* m_h_photon_pt_etcone40_fcal2; - - TH1D* m_h_photon_etcone20_ptCut_fcal0; - TH1D* m_h_photon_etcone20_ptCut_fcal1; - TH1D* m_h_photon_etcone20_ptCut_fcal2; - - TH1D* m_h_photon_etcone30_ptCut_fcal0; - TH1D* m_h_photon_etcone30_ptCut_fcal1; - TH1D* m_h_photon_etcone30_ptCut_fcal2; - - TH1D* m_h_photon_etcone40_ptCut_fcal0; - TH1D* m_h_photon_etcone40_ptCut_fcal1; - TH1D* m_h_photon_etcone40_ptCut_fcal2; - - TH1D* m_h_photon_etcone30_ptCut_fcal0_all; - TH1D* m_h_photon_etcone30_ptCut_fcal0_loose; - TH1D* m_h_photon_etcone30_ptCut_fcal0_tight; - - TH1D* m_h_photon_etcone30_ptCut_fcal1_all; - TH1D* m_h_photon_etcone30_ptCut_fcal1_loose; - TH1D* m_h_photon_etcone30_ptCut_fcal1_tight; - - TH1D* m_h_photon_etcone30_ptCut_fcal2_all; - TH1D* m_h_photon_etcone30_ptCut_fcal2_loose; - TH1D* m_h_photon_etcone30_ptCut_fcal2_tight; - -}; - -#endif + +class TH1; +class TGraph; +class TTree; +class TH1D; +//class TH1D_LW; +class TH2D_LW; +class TProfile_LW; + +class HIMonitoringPhotonsTool : public ManagedMonitorToolBase +{ + public: + + HIMonitoringPhotonsTool( const std::string & type, const std::string & name, + const IInterface* parent ); + + virtual ~HIMonitoringPhotonsTool(); + + virtual StatusCode bookHistogramsRecurrent(); + virtual StatusCode bookHistograms(); + virtual StatusCode fillHistograms(); + virtual StatusCode procHistograms(); + + void book_hist(); + + + private: + + + AsgPhotonIsEMSelector* m_photonTightIsEMSelector; + AsgPhotonIsEMSelector* m_photonLooseIsEMSelector; + + double m_FCalEt; + + int m_FCalEt_nbins; + float m_FCalEt_low; + float m_FCalEt_high; + + int m_PhotonPt_nbins; + float m_PhotonPt_low; + float m_PhotonPt_high; + + int m_PhotonEta_nbins; + float m_PhotonEta_low; + float m_PhotonEta_high; + + int m_PhotonPhi_nbins; + float m_PhotonPhi_low; + float m_PhotonPhi_high; + + int m_reta_nbins; + float m_reta_low; + float m_reta_high; + + int m_rphi_nbins; + float m_rphi_low; + float m_rphi_high; + + int m_weta2_nbins; + float m_weta2_low; + float m_weta2_high; + + int m_rhad_nbins; + float m_rhad_low; + float m_rhad_high; + + int m_wtots1_nbins; + float m_wtots1_low; + float m_wtots1_high; + + int m_fracs1_nbins; + float m_fracs1_low; + float m_fracs1_high; + + int m_deltae_nbins; + float m_deltae_low; + float m_deltae_high; + + int m_eratio_nbins; + float m_eratio_low; + float m_eratio_high; + + int m_f1_nbins; + float m_f1_low; + float m_f1_high; + + int m_IsoWide_nbins; + float m_IsoWide_low; + float m_IsoWide_high; + + int m_IsoNarrow_nbins; + float m_IsoNarrow_low; + float m_IsoNarrow_high; + + /// histograms + + // basics + TH2D_LW* m_h_photon_pt_eta; + TH2D_LW* m_h_photon_pt_phi; + TH2D_LW* m_h_photon_pt_fcal; + TH2D_LW* m_h_photon_eta_phi_ptCut; + + TH2D_LW* m_h_photon_pt_eta_tight; + TH2D_LW* m_h_photon_pt_phi_tight; + TH2D_LW* m_h_photon_pt_fcal_tight; + TH2D_LW* m_h_photon_eta_phi_ptCut_tight; + + // shower shapes + + + TH1D* m_h_photon_reta_ptCut_all; + TH1D* m_h_photon_rphi_ptCut_all; + TH1D* m_h_photon_weta2_ptCut_all; + + TH1D* m_h_photon_rhad_ptCut_all; + TH1D* m_h_photon_wtots1_ptCut_all; + TH1D* m_h_photon_fracs1_ptCut_all; + + TH1D* m_h_photon_deltae_ptCut_all; + TH1D* m_h_photon_eratio_ptCut_all; + TH1D* m_h_photon_f1_ptCut_all; + + // + TH1D* m_h_photon_reta_ptCut_loose; + TH1D* m_h_photon_rphi_ptCut_loose; + TH1D* m_h_photon_weta2_ptCut_loose; + + TH1D* m_h_photon_rhad_ptCut_loose; + TH1D* m_h_photon_wtots1_ptCut_loose; + TH1D* m_h_photon_fracs1_ptCut_loose; + + TH1D* m_h_photon_deltae_ptCut_loose; + TH1D* m_h_photon_eratio_ptCut_loose; + TH1D* m_h_photon_f1_ptCut_loose; + + // + TH1D* m_h_photon_reta_ptCut_tight; + TH1D* m_h_photon_rphi_ptCut_tight; + TH1D* m_h_photon_weta2_ptCut_tight; + + TH1D* m_h_photon_rhad_ptCut_tight; + TH1D* m_h_photon_wtots1_ptCut_tight; + TH1D* m_h_photon_fracs1_ptCut_tight; + + TH1D* m_h_photon_deltae_ptCut_tight; + TH1D* m_h_photon_eratio_ptCut_tight; + TH1D* m_h_photon_f1_ptCut_tight; + + + + TH2D_LW* m_h_photon_reta_eta_ptCut; + TH2D_LW* m_h_photon_rphi_eta_ptCut; + TH2D_LW* m_h_photon_weta2_eta_ptCut; + + TH2D_LW* m_h_photon_rhad_eta_ptCut; + TH2D_LW* m_h_photon_wtots1_eta_ptCut; + TH2D_LW* m_h_photon_fracs1_eta_ptCut; + + TH2D_LW* m_h_photon_deltae_eta_ptCut; + TH2D_LW* m_h_photon_eratio_eta_ptCut; + TH2D_LW* m_h_photon_f1_eta_ptCut; + + TH2D_LW* m_h_photon_reta_fcal_ptCut_eta0; + TH2D_LW* m_h_photon_reta_fcal_ptCut_eta1; + TH2D_LW* m_h_photon_rphi_fcal_ptCut_eta0; + TH2D_LW* m_h_photon_rphi_fcal_ptCut_eta1; + TH2D_LW* m_h_photon_weta2_fcal_ptCut_eta0; + TH2D_LW* m_h_photon_weta2_fcal_ptCut_eta1; + TH2D_LW* m_h_photon_rhad_fcal_ptCut_eta0; + TH2D_LW* m_h_photon_rhad_fcal_ptCut_eta1; + TH2D_LW* m_h_photon_wtots1_fcal_ptCut_eta0; + TH2D_LW* m_h_photon_wtots1_fcal_ptCut_eta1; + TH2D_LW* m_h_photon_fracs1_fcal_ptCut_eta0; + TH2D_LW* m_h_photon_fracs1_fcal_ptCut_eta1; + TH2D_LW* m_h_photon_deltae_fcal_ptCut_eta0; + TH2D_LW* m_h_photon_deltae_fcal_ptCut_eta1; + TH2D_LW* m_h_photon_eratio_fcal_ptCut_eta0; + TH2D_LW* m_h_photon_eratio_fcal_ptCut_eta1; + TH2D_LW* m_h_photon_f1_fcal_ptCut_eta0; + TH2D_LW* m_h_photon_f1_fcal_ptCut_eta1; + + + // isolation + TH2D_LW* m_h_photon_fcal_etcone20_ptCut; + TH2D_LW* m_h_photon_fcal_etcone30_ptCut; + TH2D_LW* m_h_photon_fcal_etcone40_ptCut; + + TH2D_LW* m_h_photon_pt_etcone40_fcal0; + TH2D_LW* m_h_photon_pt_etcone40_fcal1; + TH2D_LW* m_h_photon_pt_etcone40_fcal2; + + TH1D* m_h_photon_etcone20_ptCut_fcal0; + TH1D* m_h_photon_etcone20_ptCut_fcal1; + TH1D* m_h_photon_etcone20_ptCut_fcal2; + + TH1D* m_h_photon_etcone30_ptCut_fcal0; + TH1D* m_h_photon_etcone30_ptCut_fcal1; + TH1D* m_h_photon_etcone30_ptCut_fcal2; + + TH1D* m_h_photon_etcone40_ptCut_fcal0; + TH1D* m_h_photon_etcone40_ptCut_fcal1; + TH1D* m_h_photon_etcone40_ptCut_fcal2; + + TH1D* m_h_photon_etcone30_ptCut_fcal0_all; + TH1D* m_h_photon_etcone30_ptCut_fcal0_loose; + TH1D* m_h_photon_etcone30_ptCut_fcal0_tight; + + TH1D* m_h_photon_etcone30_ptCut_fcal1_all; + TH1D* m_h_photon_etcone30_ptCut_fcal1_loose; + TH1D* m_h_photon_etcone30_ptCut_fcal1_tight; + + TH1D* m_h_photon_etcone30_ptCut_fcal2_all; + TH1D* m_h_photon_etcone30_ptCut_fcal2_loose; + TH1D* m_h_photon_etcone30_ptCut_fcal2_tight; + +}; + +#endif diff --git a/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringElectronsTool.cxx b/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringElectronsTool.cxx index 473e5b1893c26900abc37537a48ef53b7fe34a5d..aba5a0e71d4ec6bd8184c5c6a3af2b29819979e2 100755 --- a/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringElectronsTool.cxx +++ b/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringElectronsTool.cxx @@ -2,700 +2,700 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -#include <sstream> - -#include "GaudiKernel/IJobOptionsSvc.h" -#include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/StatusCode.h" - -#include "AthenaMonitoring/AthenaMonManager.h" -#include "HIMonitoring/HIMonitoringElectronsTool.h" - -#include "LWHists/TH1D_LW.h" -#include "LWHists/TH2D_LW.h" -#include "LWHists/TProfile_LW.h" - -HIMonitoringElectronsTool:: -HIMonitoringElectronsTool( const std::string & type, const std::string & name, -const IInterface* parent ): ManagedMonitorToolBase( type, name, parent ) -{ - m_FCalEt=0; - m_FCalEt_A=0; - m_FCalEt_C=0; - - m_FCalEt_nbins=95; - m_low_FCalEt=-0.15; - m_high_FCalEt=0.8; - - m_FCalEt_oneSide_nbins=50; - m_low_FCalEt_oneSide=-0.1; - m_high_FCalEt_oneSide=0.4; - - m_eta_nbins = 60; - m_low_eta = -3.0; - m_high_eta = 3.0; - - m_phi_nbins = 64; - m_low_phi = -3.14159; - m_high_phi = 3.14159; - - m_z0sintheta_nbins = 50; - m_low_z0sintheta = -10.0; - m_high_z0sintheta = 10.0; - - m_iso_nbins = 60; - m_low_iso = -30.0; - m_high_iso = 30.0; - - m_reta_nbins = 40; - m_low_reta = 0.7; - m_high_reta = 1.1; - - m_rphi_nbins = 50; - m_low_rphi = 0.6; - m_high_rphi = 1.1; - - m_weta2_nbins = 50; - m_low_weta2 = 0.005; - m_high_weta2 = 0.015; - - m_rhad_nbins = 60; - m_low_rhad = -0.3; - m_high_rhad = 0.3; - - m_eratio_nbins = 60; - m_low_eratio = -0.1; - m_high_eratio = 1.1; - - m_f1_nbins = 65; - m_low_f1 = -0.05; - m_high_f1 = 0.6; - - m_f3_nbins = 80; - m_low_f3 = -0.05; - m_high_f3 = 0.15; - - m_deltaeta1_nbins = 50; - m_low_deltaeta1 = -0.05; - m_high_deltaeta1 = 0.05; - - m_deltaphires_nbins = 50; - m_low_deltaphires = -0.05; - m_high_deltaphires = 0.05; - - m_eprobabilityht_nbins = 60; - m_low_eprobabilityht = -0.1; - m_high_eprobabilityht = 1.1; - - //LH-based selection tools - m_electronLooseLHTool = new AsgElectronLikelihoodTool ( "ElectronLooseLHTool" ); - m_electronLooseLHTool->setProperty("ConfigFile","ElectronPhotonSelectorTools/offline/mc15_20160512/ElectronLikelihoodLooseOfflineConfig2016_Smooth.conf"); - if (!m_electronLooseLHTool->initialize().isSuccess()) { - Fatal("MyFunction", "Failed to initialize ElectronLooseLHTool "); - } - - m_electronMediumLHTool = new AsgElectronLikelihoodTool ( "ElectronMediumLHTool" ); - m_electronMediumLHTool->setProperty("ConfigFile","ElectronPhotonSelectorTools/offline/mc15_20160512/ElectronLikelihoodMediumOfflineConfig2016_Smooth.conf"); - if (!m_electronMediumLHTool->initialize().isSuccess()) { - Fatal("MyFunction", "Failed to initialize ElectronMediumLHTool "); - } - - m_electronTightLHTool = new AsgElectronLikelihoodTool ( "ElectronTightLHTool" ); - m_electronTightLHTool->setProperty("ConfigFile","ElectronPhotonSelectorTools/offline/mc15_20160512/ElectronLikelihoodTightOfflineConfig2016_Smooth.conf"); - if (!m_electronTightLHTool->initialize().isSuccess()) { - Fatal("MyFunction", "Failed to initialize ElectronTightLHTool "); - } -} - - -HIMonitoringElectronsTool::~HIMonitoringElectronsTool() -{ -} - -// Description: Used for rebooking unmanaged histograms -StatusCode HIMonitoringElectronsTool::bookHistogramsRecurrent( ) -{ - return StatusCode::SUCCESS; -} - - -// Description: Used for re-booking managed histograms -StatusCode HIMonitoringElectronsTool::bookHistograms( ) -{ - if( m_environment == AthenaMonManager::online ) { - // book histograms that are only made in the online environment... - } - - if( m_dataType == AthenaMonManager::cosmics ) { - // book histograms that are only relevant for cosmics data... - } - - book_hist(); - - - return StatusCode::SUCCESS; -} - - -StatusCode HIMonitoringElectronsTool::fillHistograms() -{ - StatusCode sc; - - /// HI event shape - const xAOD::HIEventShapeContainer* evtShape; - sc = evtStore()->retrieve(evtShape, "HIEventShape"); - if (sc.isFailure()) - { - ATH_MSG_ERROR("Could not find HIEventShape"); - return StatusCode::FAILURE; - } - else - { - ATH_MSG_INFO("HIEventShape retrieved from StoreGate"); - } - - int size=evtShape->size(); - for(int i=0;i<size;i++) - { - const xAOD::HIEventShape *sh=evtShape->at(i); - if(sh->layer()==21 || sh->layer()==22 || sh->layer()==23) - { - m_FCalEt += sh->et(); - if((sh->etaMax()) > 0) m_FCalEt_A += sh->et(); - else m_FCalEt_C += sh->et(); - } - } - m_FCalEt = m_FCalEt*1.e-6; - m_FCalEt_A = m_FCalEt_A*1.e-6; - m_FCalEt_C = m_FCalEt_C*1.e-6; - - - const xAOD::ElectronContainer* electrons = 0; - sc = evtStore()->retrieve( electrons, "Electrons" ); - if (sc.isFailure()) { - ATH_MSG_ERROR("Could not find Electrons"); - return StatusCode::FAILURE; - } - else { - ATH_MSG_INFO("Electrons retrieved from StoreGate"); - } - - xAOD::ElectronContainer::const_iterator electrons_itr = electrons->begin(); - xAOD::ElectronContainer::const_iterator electrons_end = electrons->end(); - - int n_loose_LH = 0; - int n_medium_LH = 0; - int n_tight_LH = 0; - - for( ; electrons_itr != electrons_end; ++electrons_itr ) { - float pt = (*electrons_itr)->pt() * 1.e-3; - float eta = (*electrons_itr)->caloCluster()->etaBE(2); - - if (pt < 15 || fabs(eta) > 2.47) continue; - - float phi = (*electrons_itr)->phi(); - m_h_electron_eta_phi->Fill(eta,phi); - - float z0 = (*electrons_itr)->trackParticle()->z0(); - m_h_electron_z0sintheta->Fill(z0*sin(2*TMath::ATan(exp(-eta)))); - - bool loose_LH = m_electronLooseLHTool->accept(*electrons_itr); - bool medium_LH = m_electronMediumLHTool->accept(*electrons_itr); - bool tight_LH = m_electronTightLHTool->accept(*electrons_itr); - - float etcone20 = (*electrons_itr)->auxdata<float>("etcone20") * 1.e-3; - - float reta = (*electrons_itr)->auxdata<float>("Reta"); - float rphi = (*electrons_itr)->auxdata<float>("Rphi"); - float weta2 = (*electrons_itr)->auxdata< float >("weta2"); - - float rhad = (*electrons_itr)->auxdata<float>("Rhad"); - - float eratio = (*electrons_itr)->auxdata<float>("Eratio"); - float f1 = (*electrons_itr)->auxdata<float>("f1"); - float f3 = (*electrons_itr)->auxdata<float>("f3"); - - float deltaeta1; - (*electrons_itr)->trackCaloMatchValue(deltaeta1, xAOD::EgammaParameters::deltaEta1); - float deltaphires; - (*electrons_itr)->trackCaloMatchValue(deltaphires, xAOD::EgammaParameters::deltaPhiRescaled2); - float TRT_PID; - (*electrons_itr)->trackParticle()->summaryValue(TRT_PID, xAOD::eProbabilityHT); - - if (loose_LH){ - n_loose_LH++; - - m_h_electron_fcal_etcone20_looseLH->Fill(m_FCalEt, etcone20); - m_h_electron_fcalA_etcone20_looseLH->Fill(m_FCalEt_A, etcone20); - m_h_electron_fcalC_etcone20_looseLH->Fill(m_FCalEt_C, etcone20); - - m_h_electron_fcal_reta_looseLH->Fill(m_FCalEt, reta); - m_h_electron_fcalA_reta_looseLH->Fill(m_FCalEt_A, reta); - m_h_electron_fcalC_reta_looseLH->Fill(m_FCalEt_C, reta); - m_h_electron_fcal_rphi_looseLH->Fill(m_FCalEt, rphi); - m_h_electron_fcalA_rphi_looseLH->Fill(m_FCalEt_A, rphi); - m_h_electron_fcalC_rphi_looseLH->Fill(m_FCalEt_C, rphi); - m_h_electron_fcal_weta2_looseLH->Fill(m_FCalEt, weta2); - m_h_electron_fcalA_weta2_looseLH->Fill(m_FCalEt_A, weta2); - m_h_electron_fcalC_weta2_looseLH->Fill(m_FCalEt_C, weta2); - - m_h_electron_fcal_rhad_looseLH->Fill(m_FCalEt, rhad); - m_h_electron_fcalA_rhad_looseLH->Fill(m_FCalEt_A, rhad); - m_h_electron_fcalC_rhad_looseLH->Fill(m_FCalEt_C, rhad); - - m_h_electron_fcal_eratio_looseLH->Fill(m_FCalEt, eratio); - m_h_electron_fcalA_eratio_looseLH->Fill(m_FCalEt_A, eratio); - m_h_electron_fcalC_eratio_looseLH->Fill(m_FCalEt_C, eratio); - m_h_electron_fcal_f1_looseLH->Fill(m_FCalEt, f1); - m_h_electron_fcalA_f1_looseLH->Fill(m_FCalEt_A, f1); - m_h_electron_fcalC_f1_looseLH->Fill(m_FCalEt_C, f1); - m_h_electron_fcal_f3_looseLH->Fill(m_FCalEt, f3); - m_h_electron_fcalA_f3_looseLH->Fill(m_FCalEt_A, f3); - m_h_electron_fcalC_f3_looseLH->Fill(m_FCalEt_C, f3); - - m_h_electron_fcal_deltaeta1_looseLH->Fill(m_FCalEt, deltaeta1); - m_h_electron_fcalA_deltaeta1_looseLH->Fill(m_FCalEt_A, deltaeta1); - m_h_electron_fcalC_deltaeta1_looseLH->Fill(m_FCalEt_C, deltaeta1); - m_h_electron_fcal_deltaphires_looseLH->Fill(m_FCalEt, deltaphires); - m_h_electron_fcalA_deltaphires_looseLH->Fill(m_FCalEt_A, deltaphires); - m_h_electron_fcalC_deltaphires_looseLH->Fill(m_FCalEt_C, deltaphires); - if (fabs(eta) < 2.01){ - m_h_electron_fcal_eprobabilityht_looseLH->Fill(m_FCalEt, TRT_PID); - m_h_electron_fcalA_eprobabilityht_looseLH->Fill(m_FCalEt_A, TRT_PID); - m_h_electron_fcalC_eprobabilityht_looseLH->Fill(m_FCalEt_C, TRT_PID); - } - } - - if (medium_LH){ - n_medium_LH++; - - m_h_electron_fcal_etcone20_mediumLH->Fill(m_FCalEt, etcone20); - m_h_electron_fcalA_etcone20_mediumLH->Fill(m_FCalEt_A, etcone20); - m_h_electron_fcalC_etcone20_mediumLH->Fill(m_FCalEt_C, etcone20); - - m_h_electron_fcal_reta_mediumLH->Fill(m_FCalEt, reta); - m_h_electron_fcalA_reta_mediumLH->Fill(m_FCalEt_A, reta); - m_h_electron_fcalC_reta_mediumLH->Fill(m_FCalEt_C, reta); - m_h_electron_fcal_rphi_mediumLH->Fill(m_FCalEt, rphi); - m_h_electron_fcalA_rphi_mediumLH->Fill(m_FCalEt_A, rphi); - m_h_electron_fcalC_rphi_mediumLH->Fill(m_FCalEt_C, rphi); - m_h_electron_fcal_weta2_mediumLH->Fill(m_FCalEt, weta2); - m_h_electron_fcalA_weta2_mediumLH->Fill(m_FCalEt_A, weta2); - m_h_electron_fcalC_weta2_mediumLH->Fill(m_FCalEt_C, weta2); - - m_h_electron_fcal_rhad_mediumLH->Fill(m_FCalEt, rhad); - m_h_electron_fcalA_rhad_mediumLH->Fill(m_FCalEt_A, rhad); - m_h_electron_fcalC_rhad_mediumLH->Fill(m_FCalEt_C, rhad); - - m_h_electron_fcal_eratio_mediumLH->Fill(m_FCalEt, eratio); - m_h_electron_fcalA_eratio_mediumLH->Fill(m_FCalEt_A, eratio); - m_h_electron_fcalC_eratio_mediumLH->Fill(m_FCalEt_C, eratio); - m_h_electron_fcal_f1_mediumLH->Fill(m_FCalEt, f1); - m_h_electron_fcalA_f1_mediumLH->Fill(m_FCalEt_A, f1); - m_h_electron_fcalC_f1_mediumLH->Fill(m_FCalEt_C, f1); - m_h_electron_fcal_f3_mediumLH->Fill(m_FCalEt, f3); - m_h_electron_fcalA_f3_mediumLH->Fill(m_FCalEt_A, f3); - m_h_electron_fcalC_f3_mediumLH->Fill(m_FCalEt_C, f3); - - m_h_electron_fcal_deltaeta1_mediumLH->Fill(m_FCalEt, deltaeta1); - m_h_electron_fcalA_deltaeta1_mediumLH->Fill(m_FCalEt_A, deltaeta1); - m_h_electron_fcalC_deltaeta1_mediumLH->Fill(m_FCalEt_C, deltaeta1); - m_h_electron_fcal_deltaphires_mediumLH->Fill(m_FCalEt, deltaphires); - m_h_electron_fcalA_deltaphires_mediumLH->Fill(m_FCalEt_A, deltaphires); - m_h_electron_fcalC_deltaphires_mediumLH->Fill(m_FCalEt_C, deltaphires); - if (fabs(eta) < 2.01){ - m_h_electron_fcal_eprobabilityht_mediumLH->Fill(m_FCalEt, TRT_PID); - m_h_electron_fcalA_eprobabilityht_mediumLH->Fill(m_FCalEt_A, TRT_PID); - m_h_electron_fcalC_eprobabilityht_mediumLH->Fill(m_FCalEt_C, TRT_PID); - } - } - - if (tight_LH){ - n_tight_LH++; - - m_h_electron_fcal_etcone20_tightLH->Fill(m_FCalEt, etcone20); - m_h_electron_fcalA_etcone20_tightLH->Fill(m_FCalEt_A, etcone20); - m_h_electron_fcalC_etcone20_tightLH->Fill(m_FCalEt_C, etcone20); - - m_h_electron_fcal_reta_tightLH->Fill(m_FCalEt, reta); - m_h_electron_fcalA_reta_tightLH->Fill(m_FCalEt_A, reta); - m_h_electron_fcalC_reta_tightLH->Fill(m_FCalEt_C, reta); - m_h_electron_fcal_rphi_tightLH->Fill(m_FCalEt, rphi); - m_h_electron_fcalA_rphi_tightLH->Fill(m_FCalEt_A, rphi); - m_h_electron_fcalC_rphi_tightLH->Fill(m_FCalEt_C, rphi); - m_h_electron_fcal_weta2_tightLH->Fill(m_FCalEt, weta2); - m_h_electron_fcalA_weta2_tightLH->Fill(m_FCalEt_A, weta2); - m_h_electron_fcalC_weta2_tightLH->Fill(m_FCalEt_C, weta2); - - m_h_electron_fcal_rhad_tightLH->Fill(m_FCalEt, rhad); - m_h_electron_fcalA_rhad_tightLH->Fill(m_FCalEt_A, rhad); - m_h_electron_fcalC_rhad_tightLH->Fill(m_FCalEt_C, rhad); - - m_h_electron_fcal_eratio_tightLH->Fill(m_FCalEt, eratio); - m_h_electron_fcalA_eratio_tightLH->Fill(m_FCalEt_A, eratio); - m_h_electron_fcalC_eratio_tightLH->Fill(m_FCalEt_C, eratio); - m_h_electron_fcal_f1_tightLH->Fill(m_FCalEt, f1); - m_h_electron_fcalA_f1_tightLH->Fill(m_FCalEt_A, f1); - m_h_electron_fcalC_f1_tightLH->Fill(m_FCalEt_C, f1); - m_h_electron_fcal_f3_tightLH->Fill(m_FCalEt, f3); - m_h_electron_fcalA_f3_tightLH->Fill(m_FCalEt_A, f3); - m_h_electron_fcalC_f3_tightLH->Fill(m_FCalEt_C, f3); - - m_h_electron_fcal_deltaeta1_tightLH->Fill(m_FCalEt, deltaeta1); - m_h_electron_fcalA_deltaeta1_tightLH->Fill(m_FCalEt_A, deltaeta1); - m_h_electron_fcalC_deltaeta1_tightLH->Fill(m_FCalEt_C, deltaeta1); - m_h_electron_fcal_deltaphires_tightLH->Fill(m_FCalEt, deltaphires); - m_h_electron_fcalA_deltaphires_tightLH->Fill(m_FCalEt_A, deltaphires); - m_h_electron_fcalC_deltaphires_tightLH->Fill(m_FCalEt_C, deltaphires); - if (fabs(eta) < 2.01){ - m_h_electron_fcal_eprobabilityht_tightLH->Fill(m_FCalEt, TRT_PID); - m_h_electron_fcalA_eprobabilityht_tightLH->Fill(m_FCalEt_A, TRT_PID); - m_h_electron_fcalC_eprobabilityht_tightLH->Fill(m_FCalEt_C, TRT_PID); - } - } - } - - if (n_loose_LH){ - m_h_FCalEt_looseLH->Fill(m_FCalEt); - m_h_FCalEt_A_looseLH->Fill(m_FCalEt_A); - m_h_FCalEt_C_looseLH->Fill(m_FCalEt_C); - } - if (n_medium_LH){ - m_h_FCalEt_mediumLH->Fill(m_FCalEt); - m_h_FCalEt_A_mediumLH->Fill(m_FCalEt_A); - m_h_FCalEt_C_mediumLH->Fill(m_FCalEt_C); - } - if (n_tight_LH){ - m_h_FCalEt_tightLH->Fill(m_FCalEt); - m_h_FCalEt_A_tightLH->Fill(m_FCalEt_A); - m_h_FCalEt_C_tightLH->Fill(m_FCalEt_C); - } - - return StatusCode::SUCCESS; -} - - -StatusCode HIMonitoringElectronsTool::procHistograms( ) -{ - - //if( endOfLowStatFlag() || endOfLumiBlockFlag() ) { } - - - if( endOfRunFlag() ) - { - if(m_h_FCalEt_looseLH->GetEntries() > 0) m_h_FCalEt_looseLH->Scale(1./m_h_FCalEt_looseLH->GetEntries()); - if(m_h_FCalEt_mediumLH->GetEntries() > 0) m_h_FCalEt_mediumLH->Scale(1./m_h_FCalEt_mediumLH->GetEntries()); - if(m_h_FCalEt_tightLH->GetEntries() > 0) m_h_FCalEt_tightLH->Scale(1./m_h_FCalEt_tightLH->GetEntries()); - if(m_h_FCalEt_A_looseLH->GetEntries() > 0) m_h_FCalEt_A_looseLH->Scale(1./m_h_FCalEt_A_looseLH->GetEntries()); - if(m_h_FCalEt_A_mediumLH->GetEntries() > 0) m_h_FCalEt_A_mediumLH->Scale(1./m_h_FCalEt_A_mediumLH->GetEntries()); - if(m_h_FCalEt_A_tightLH->GetEntries() > 0) m_h_FCalEt_A_tightLH->Scale(1./m_h_FCalEt_A_tightLH->GetEntries()); - if(m_h_FCalEt_C_looseLH->GetEntries() > 0) m_h_FCalEt_C_looseLH->Scale(1./m_h_FCalEt_C_looseLH->GetEntries()); - if(m_h_FCalEt_C_mediumLH->GetEntries() > 0) m_h_FCalEt_C_mediumLH->Scale(1./m_h_FCalEt_C_mediumLH->GetEntries()); - if(m_h_FCalEt_C_tightLH->GetEntries() > 0) m_h_FCalEt_C_tightLH->Scale(1./m_h_FCalEt_C_tightLH->GetEntries()); - if(m_h_electron_z0sintheta->GetEntries() > 0) m_h_electron_z0sintheta->Scale(1./m_h_electron_z0sintheta->GetEntries()); - } - - return StatusCode::SUCCESS; -} - - -void HIMonitoringElectronsTool::book_hist() -{ - std::string path = "HeavyIon/Electrons"; - - //FCal sum Et - m_h_FCalEt_looseLH= new TH1D( "h_FCalEt_looseLH", "; FCal #Sigma E_{T} [TeV]; entries", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt); - regHist(m_h_FCalEt_looseLH, path, run).ignore(); - m_h_FCalEt_mediumLH= new TH1D( "h_FCalEt_mediumLH", "; FCal #Sigma E_{T} [TeV]; entries", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt); - regHist(m_h_FCalEt_mediumLH, path, run).ignore(); - m_h_FCalEt_tightLH= new TH1D( "h_FCalEt_tightLH", "; FCal #Sigma E_{T} [TeV]; entries", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt); - regHist(m_h_FCalEt_tightLH, path, run).ignore(); - - //FCal sum Et, side A - m_h_FCalEt_A_looseLH = new TH1D( "h_FCalEt_A_looseLH", "; FCal A #Sigma E_{T} [TeV]; entries", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide); - regHist(m_h_FCalEt_A_looseLH, path, run).ignore(); - m_h_FCalEt_A_mediumLH = new TH1D( "h_FCalEt_A_mediumLH", "; FCal A #Sigma E_{T} [TeV]; entries", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide); - regHist(m_h_FCalEt_A_mediumLH, path, run).ignore(); - m_h_FCalEt_A_tightLH = new TH1D( "h_FCalEt_A_tightLH", "; FCal A #Sigma E_{T} [TeV]; entries", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide); - regHist(m_h_FCalEt_A_tightLH, path, run).ignore(); - - //FCal sum Et, side C - m_h_FCalEt_C_looseLH = new TH1D( "h_FCalEt_C_looseLH", "; FCal C #Sigma E_{T} [TeV]; entries", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide); - regHist(m_h_FCalEt_C_looseLH, path, run).ignore(); - m_h_FCalEt_C_mediumLH = new TH1D( "h_FCalEt_C_mediumLH", "; FCal C #Sigma E_{T} [TeV]; entries", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide); - regHist(m_h_FCalEt_C_mediumLH, path, run).ignore(); - m_h_FCalEt_C_tightLH = new TH1D( "h_FCalEt_C_tightLH", "; FCal C #Sigma E_{T} [TeV]; entries", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide); - regHist(m_h_FCalEt_C_tightLH, path, run).ignore(); - - //eta vs phi - m_h_electron_eta_phi = TH2D_LW::create( "h_electron_eta_phi", "; #eta; #phi", m_eta_nbins, m_low_eta, m_high_eta, m_phi_nbins, m_low_phi, m_high_phi); - regHist(m_h_electron_eta_phi, path, run).ignore(); - - //GSF track z0*sin(theta) - m_h_electron_z0sintheta = new TH1D( "h_electron_z0sintheta", "; z0 sin#theta [mm]; entries", m_z0sintheta_nbins, m_low_z0sintheta, m_high_z0sintheta); - regHist(m_h_electron_z0sintheta, path, run).ignore(); - - //isolation vs centrality - m_h_electron_fcal_etcone20_looseLH = TH2D_LW::create( "h_electron_fcal_etcone20_looseLH", "; FCal #Sigma E_{T} [TeV]; electron etcone20 [GeV]", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_iso_nbins, m_low_iso, m_high_iso ); - regHist(m_h_electron_fcal_etcone20_looseLH, path, run).ignore(); - m_h_electron_fcal_etcone20_mediumLH = TH2D_LW::create( "h_electron_fcal_etcone20_mediumLH", "; FCal #Sigma E_{T} [TeV]; electron etcone20 [GeV]", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_iso_nbins, m_low_iso, m_high_iso ); - regHist(m_h_electron_fcal_etcone20_mediumLH, path, run).ignore(); - m_h_electron_fcal_etcone20_tightLH = TH2D_LW::create( "h_electron_fcal_etcone20_tightLH", "; FCal #Sigma E_{T} [TeV]; electron etcone20 [GeV]", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_iso_nbins, m_low_iso, m_high_iso ); - regHist(m_h_electron_fcal_etcone20_tightLH, path, run).ignore(); - - //isolation vs centrality, side A - m_h_electron_fcalA_etcone20_looseLH = TH2D_LW::create( "h_electron_fcalA_etcone20_looseLH", "; FCal A #Sigma E_{T} [TeV]; electron etcone20 [GeV]", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_iso_nbins, m_low_iso, m_high_iso ); - regHist(m_h_electron_fcalA_etcone20_looseLH, path, run).ignore(); - m_h_electron_fcalA_etcone20_mediumLH = TH2D_LW::create( "h_electron_fcalA_etcone20_mediumLH", "; FCal A #Sigma E_{T} [TeV]; electron etcone20 [GeV]", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_iso_nbins, m_low_iso, m_high_iso ); - regHist(m_h_electron_fcalA_etcone20_mediumLH, path, run).ignore(); - m_h_electron_fcalA_etcone20_tightLH = TH2D_LW::create( "h_electron_fcalA_etcone20_tightLH", "; FCal A #Sigma E_{T} [TeV]; electron etcone20 [GeV]", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_iso_nbins, m_low_iso, m_high_iso ); - regHist(m_h_electron_fcalA_etcone20_tightLH, path, run).ignore(); - - //isolation vs centrality, side C - m_h_electron_fcalC_etcone20_looseLH = TH2D_LW::create( "h_electron_fcalC_etcone20_looseLH", "; FCal C #Sigma E_{T} [TeV]; electron etcone20 [GeV]", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_iso_nbins, m_low_iso, m_high_iso ); - regHist(m_h_electron_fcalC_etcone20_looseLH, path, run).ignore(); - m_h_electron_fcalC_etcone20_mediumLH = TH2D_LW::create( "h_electron_fcalC_etcone20_mediumLH", "; FCal C #Sigma E_{T} [TeV]; electron etcone20 [GeV]", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_iso_nbins, m_low_iso, m_high_iso ); - regHist(m_h_electron_fcalC_etcone20_mediumLH, path, run).ignore(); - m_h_electron_fcalC_etcone20_tightLH = TH2D_LW::create( "h_electron_fcalC_etcone20_tightLH", "; FCal C #Sigma E_{T} [TeV]; electron etcone20 [GeV]", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_iso_nbins, m_low_iso, m_high_iso ); - regHist(m_h_electron_fcalC_etcone20_tightLH, path, run).ignore(); - - //R_eta - m_h_electron_fcal_reta_looseLH = TH2D_LW::create( "h_electron_fcal_reta_looseLH", "; FCal #Sigma E_{T} [TeV]; R_{#eta}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_reta_nbins, m_low_reta, m_high_reta ); - regHist(m_h_electron_fcal_reta_looseLH, path, run).ignore(); - m_h_electron_fcal_reta_mediumLH = TH2D_LW::create( "h_electron_fcal_reta_mediumLH", "; FCal #Sigma E_{T} [TeV]; R_{#eta}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_reta_nbins, m_low_reta, m_high_reta ); - regHist(m_h_electron_fcal_reta_mediumLH, path, run).ignore(); - m_h_electron_fcal_reta_tightLH = TH2D_LW::create( "h_electron_fcal_reta_tightLH", "; FCal #Sigma E_{T} [TeV]; R_{#eta}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_reta_nbins, m_low_reta, m_high_reta ); - regHist(m_h_electron_fcal_reta_tightLH, path, run).ignore(); - - //R_eta, side A centrality - m_h_electron_fcalA_reta_looseLH = TH2D_LW::create( "h_electron_fcalA_reta_looseLH", "; FCal A #Sigma E_{T} [TeV]; R_{#eta}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_reta_nbins, m_low_reta, m_high_reta ); - regHist(m_h_electron_fcalA_reta_looseLH, path, run).ignore(); - m_h_electron_fcalA_reta_mediumLH = TH2D_LW::create( "h_electron_fcalA_reta_mediumLH", "; FCal A #Sigma E_{T} [TeV]; R_{#eta}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_reta_nbins, m_low_reta, m_high_reta ); - regHist(m_h_electron_fcalA_reta_mediumLH, path, run).ignore(); - m_h_electron_fcalA_reta_tightLH = TH2D_LW::create( "h_electron_fcalA_reta_tightLH", "; FCal A #Sigma E_{T} [TeV]; R_{#eta}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_reta_nbins, m_low_reta, m_high_reta ); - regHist(m_h_electron_fcalA_reta_tightLH, path, run).ignore(); - - //R_eta, side C centrality - m_h_electron_fcalC_reta_looseLH = TH2D_LW::create( "h_electron_fcalC_reta_looseLH", "; FCal C #Sigma E_{T} [TeV]; R_{#eta}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_reta_nbins, m_low_reta, m_high_reta ); - regHist(m_h_electron_fcalC_reta_looseLH, path, run).ignore(); - m_h_electron_fcalC_reta_mediumLH = TH2D_LW::create( "h_electron_fcalC_reta_mediumLH", "; FCal C #Sigma E_{T} [TeV]; R_{#eta}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_reta_nbins, m_low_reta, m_high_reta ); - regHist(m_h_electron_fcalC_reta_mediumLH, path, run).ignore(); - m_h_electron_fcalC_reta_tightLH = TH2D_LW::create( "h_electron_fcalC_reta_tightLH", "; FCal C #Sigma E_{T} [TeV]; R_{#eta}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_reta_nbins, m_low_reta, m_high_reta ); - regHist(m_h_electron_fcalC_reta_tightLH, path, run).ignore(); - - //R_phi - m_h_electron_fcal_rphi_looseLH = TH2D_LW::create( "h_electron_fcal_rphi_looseLH", "; FCal #Sigma E_{T} [TeV]; R_{#phi}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_rphi_nbins, m_low_rphi, m_high_rphi ); - regHist(m_h_electron_fcal_rphi_looseLH, path, run).ignore(); - m_h_electron_fcal_rphi_mediumLH = TH2D_LW::create( "h_electron_fcal_rphi_mediumLH", "; FCal #Sigma E_{T} [TeV]; R_{#phi}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_rphi_nbins, m_low_rphi, m_high_rphi ); - regHist(m_h_electron_fcal_rphi_mediumLH, path, run).ignore(); - m_h_electron_fcal_rphi_tightLH = TH2D_LW::create( "h_electron_fcal_rphi_tightLH", "; FCal #Sigma E_{T} [TeV]; R_{#phi}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_rphi_nbins, m_low_rphi, m_high_rphi ); - regHist(m_h_electron_fcal_rphi_tightLH, path, run).ignore(); - - //R_phi, side A centrality - m_h_electron_fcalA_rphi_looseLH = TH2D_LW::create( "h_electron_fcalA_rphi_looseLH", "; FCal A #Sigma E_{T} [TeV]; R_{#phi}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_rphi_nbins, m_low_rphi, m_high_rphi ); - regHist(m_h_electron_fcalA_rphi_looseLH, path, run).ignore(); - m_h_electron_fcalA_rphi_mediumLH = TH2D_LW::create( "h_electron_fcalA_rphi_mediumLH", "; FCal A #Sigma E_{T} [TeV]; R_{#phi}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_rphi_nbins, m_low_rphi, m_high_rphi ); - regHist(m_h_electron_fcalA_rphi_mediumLH, path, run).ignore(); - m_h_electron_fcalA_rphi_tightLH = TH2D_LW::create( "h_electron_fcalA_rphi_tightLH", "; FCal A #Sigma E_{T} [TeV]; R_{#phi}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_rphi_nbins, m_low_rphi, m_high_rphi ); - regHist(m_h_electron_fcalA_rphi_tightLH, path, run).ignore(); - - //R_phi, side C centrality - m_h_electron_fcalC_rphi_looseLH = TH2D_LW::create( "h_electron_fcalC_rphi_looseLH", "; FCal C #Sigma E_{T} [TeV]; R_{#phi}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_rphi_nbins, m_low_rphi, m_high_rphi ); - regHist(m_h_electron_fcalC_rphi_looseLH, path, run).ignore(); - m_h_electron_fcalC_rphi_mediumLH = TH2D_LW::create( "h_electron_fcalC_rphi_mediumLH", "; FCal C #Sigma E_{T} [TeV]; R_{#phi}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_rphi_nbins, m_low_rphi, m_high_rphi ); - regHist(m_h_electron_fcalC_rphi_mediumLH, path, run).ignore(); - m_h_electron_fcalC_rphi_tightLH = TH2D_LW::create( "h_electron_fcalC_rphi_tightLH", "; FCal C #Sigma E_{T} [TeV]; R_{#phi}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_rphi_nbins, m_low_rphi, m_high_rphi ); - regHist(m_h_electron_fcalC_rphi_tightLH, path, run).ignore(); - - //W_eta2 - m_h_electron_fcal_weta2_looseLH = TH2D_LW::create( "h_electron_fcal_weta2_looseLH", "; FCal #Sigma E_{T} [TeV]; W_{#eta^{2}}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_weta2_nbins, m_low_weta2, m_high_weta2 ); - regHist(m_h_electron_fcal_weta2_looseLH, path, run).ignore(); - m_h_electron_fcal_weta2_mediumLH = TH2D_LW::create( "h_electron_fcal_weta2_mediumLH", "; FCal #Sigma E_{T} [TeV]; W_{#eta^{2}}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_weta2_nbins, m_low_weta2, m_high_weta2 ); - regHist(m_h_electron_fcal_weta2_mediumLH, path, run).ignore(); - m_h_electron_fcal_weta2_tightLH = TH2D_LW::create( "h_electron_fcal_weta2_tightLH", "; FCal #Sigma E_{T} [TeV]; W_{#eta^{2}}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_weta2_nbins, m_low_weta2, m_high_weta2 ); - regHist(m_h_electron_fcal_weta2_tightLH, path, run).ignore(); - - //W_eta2, side A centrality - m_h_electron_fcalA_weta2_looseLH = TH2D_LW::create( "h_electron_fcalA_weta2_looseLH", "; FCal A #Sigma E_{T} [TeV]; W_{#eta^{2}}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_weta2_nbins, m_low_weta2, m_high_weta2 ); - regHist(m_h_electron_fcalA_weta2_looseLH, path, run).ignore(); - m_h_electron_fcalA_weta2_mediumLH = TH2D_LW::create( "h_electron_fcalA_weta2_mediumLH", "; FCal A #Sigma E_{T} [TeV]; W_{#eta^{2}}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_weta2_nbins, m_low_weta2, m_high_weta2 ); - regHist(m_h_electron_fcalA_weta2_mediumLH, path, run).ignore(); - m_h_electron_fcalA_weta2_tightLH = TH2D_LW::create( "h_electron_fcalA_weta2_tightLH", "; FCal A #Sigma E_{T} [TeV]; W_{#eta^{2}}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_weta2_nbins, m_low_weta2, m_high_weta2 ); - regHist(m_h_electron_fcalA_weta2_tightLH, path, run).ignore(); - - //W_eta2, side C centrality - m_h_electron_fcalC_weta2_looseLH = TH2D_LW::create( "h_electron_fcalC_weta2_looseLH", "; FCal C #Sigma E_{T} [TeV]; W_{#eta^{2}}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_weta2_nbins, m_low_weta2, m_high_weta2 ); - regHist(m_h_electron_fcalC_weta2_looseLH, path, run).ignore(); - m_h_electron_fcalC_weta2_mediumLH = TH2D_LW::create( "h_electron_fcalC_weta2_mediumLH", "; FCal C #Sigma E_{T} [TeV]; W_{#eta^{2}}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_weta2_nbins, m_low_weta2, m_high_weta2 ); - regHist(m_h_electron_fcalC_weta2_mediumLH, path, run).ignore(); - m_h_electron_fcalC_weta2_tightLH = TH2D_LW::create( "h_electron_fcalC_weta2_tightLH", "; FCal C #Sigma E_{T} [TeV]; W_{#eta^{2}}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_weta2_nbins, m_low_weta2, m_high_weta2 ); - regHist(m_h_electron_fcalC_weta2_tightLH, path, run).ignore(); - - //R_had - m_h_electron_fcal_rhad_looseLH = TH2D_LW::create( "h_electron_fcal_rhad_looseLH", "; FCal #Sigma E_{T} [TeV]; R_{had}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_rhad_nbins, m_low_rhad, m_high_rhad ); - regHist(m_h_electron_fcal_rhad_looseLH, path, run).ignore(); - m_h_electron_fcal_rhad_mediumLH = TH2D_LW::create( "h_electron_fcal_rhad_mediumLH", "; FCal #Sigma E_{T} [TeV]; R_{had}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_rhad_nbins, m_low_rhad, m_high_rhad ); - regHist(m_h_electron_fcal_rhad_mediumLH, path, run).ignore(); - m_h_electron_fcal_rhad_tightLH = TH2D_LW::create( "h_electron_fcal_rhad_tightLH", "; FCal #Sigma E_{T} [TeV]; R_{had}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_rhad_nbins, m_low_rhad, m_high_rhad ); - regHist(m_h_electron_fcal_rhad_tightLH, path, run).ignore(); - - //R_had, side A centrality - m_h_electron_fcalA_rhad_looseLH = TH2D_LW::create( "h_electron_fcalA_rhad_looseLH", "; FCal A #Sigma E_{T} [TeV]; R_{had}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_rhad_nbins, m_low_rhad, m_high_rhad ); - regHist(m_h_electron_fcalA_rhad_looseLH, path, run).ignore(); - m_h_electron_fcalA_rhad_mediumLH = TH2D_LW::create( "h_electron_fcalA_rhad_mediumLH", "; FCal A #Sigma E_{T} [TeV]; R_{had}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_rhad_nbins, m_low_rhad, m_high_rhad ); - regHist(m_h_electron_fcalA_rhad_mediumLH, path, run).ignore(); - m_h_electron_fcalA_rhad_tightLH = TH2D_LW::create( "h_electron_fcalA_rhad_tightLH", "; FCal A #Sigma E_{T} [TeV]; R_{had}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_rhad_nbins, m_low_rhad, m_high_rhad ); - regHist(m_h_electron_fcalA_rhad_tightLH, path, run).ignore(); - - //R_had, side C centrality - m_h_electron_fcalC_rhad_looseLH = TH2D_LW::create( "h_electron_fcalC_rhad_looseLH", "; FCal C #Sigma E_{T} [TeV]; R_{had}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_rhad_nbins, m_low_rhad, m_high_rhad ); - regHist(m_h_electron_fcalC_rhad_looseLH, path, run).ignore(); - m_h_electron_fcalC_rhad_mediumLH = TH2D_LW::create( "h_electron_fcalC_rhad_mediumLH", "; FCal C #Sigma E_{T} [TeV]; R_{had}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_rhad_nbins, m_low_rhad, m_high_rhad ); - regHist(m_h_electron_fcalC_rhad_mediumLH, path, run).ignore(); - m_h_electron_fcalC_rhad_tightLH = TH2D_LW::create( "h_electron_fcalC_rhad_tightLH", "; FCal C #Sigma E_{T} [TeV]; R_{had}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_rhad_nbins, m_low_rhad, m_high_rhad ); - regHist(m_h_electron_fcalC_rhad_tightLH, path, run).ignore(); - - //E_ratio - m_h_electron_fcal_eratio_looseLH = TH2D_LW::create( "h_electron_fcal_eratio_looseLH", "; FCal #Sigma E_{T} [TeV]; E_{ratio}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_eratio_nbins, m_low_eratio, m_high_eratio ); - regHist(m_h_electron_fcal_eratio_looseLH, path, run).ignore(); - m_h_electron_fcal_eratio_mediumLH = TH2D_LW::create( "h_electron_fcal_eratio_mediumLH", "; FCal #Sigma E_{T} [TeV]; E_{ratio}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_eratio_nbins, m_low_eratio, m_high_eratio ); - regHist(m_h_electron_fcal_eratio_mediumLH, path, run).ignore(); - m_h_electron_fcal_eratio_tightLH = TH2D_LW::create( "h_electron_fcal_eratio_tightLH", "; FCal #Sigma E_{T} [TeV]; E_{ratio}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_eratio_nbins, m_low_eratio, m_high_eratio ); - regHist(m_h_electron_fcal_eratio_tightLH, path, run).ignore(); - - //E_ratio, side A centrality - m_h_electron_fcalA_eratio_looseLH = TH2D_LW::create( "h_electron_fcalA_eratio_looseLH", "; FCal A #Sigma E_{T} [TeV]; E_{ratio}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_eratio_nbins, m_low_eratio, m_high_eratio ); - regHist(m_h_electron_fcalA_eratio_looseLH, path, run).ignore(); - m_h_electron_fcalA_eratio_mediumLH = TH2D_LW::create( "h_electron_fcalA_eratio_mediumLH", "; FCal A #Sigma E_{T} [TeV]; E_{ratio}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_eratio_nbins, m_low_eratio, m_high_eratio ); - regHist(m_h_electron_fcalA_eratio_mediumLH, path, run).ignore(); - m_h_electron_fcalA_eratio_tightLH = TH2D_LW::create( "h_electron_fcalA_eratio_tightLH", "; FCal A #Sigma E_{T} [TeV]; E_{ratio}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_eratio_nbins, m_low_eratio, m_high_eratio ); - regHist(m_h_electron_fcalA_eratio_tightLH, path, run).ignore(); - - //E_ratio, side C centrality - m_h_electron_fcalC_eratio_looseLH = TH2D_LW::create( "h_electron_fcalC_eratio_looseLH", "; FCal C #Sigma E_{T} [TeV]; E_{ratio}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_eratio_nbins, m_low_eratio, m_high_eratio ); - regHist(m_h_electron_fcalC_eratio_looseLH, path, run).ignore(); - m_h_electron_fcalC_eratio_mediumLH = TH2D_LW::create( "h_electron_fcalC_eratio_mediumLH", "; FCal C #Sigma E_{T} [TeV]; E_{ratio}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_eratio_nbins, m_low_eratio, m_high_eratio ); - regHist(m_h_electron_fcalC_eratio_mediumLH, path, run).ignore(); - m_h_electron_fcalC_eratio_tightLH = TH2D_LW::create( "h_electron_fcalC_eratio_tightLH", "; FCal C #Sigma E_{T} [TeV]; E_{ratio}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_eratio_nbins, m_low_eratio, m_high_eratio ); - regHist(m_h_electron_fcalC_eratio_tightLH, path, run).ignore(); - - //f_1 - m_h_electron_fcal_f1_looseLH = TH2D_LW::create( "h_electron_fcal_f1_looseLH", "; FCal #Sigma E_{T} [TeV]; f_{1}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_f1_nbins, m_low_f1, m_high_f1 ); - regHist(m_h_electron_fcal_f1_looseLH, path, run).ignore(); - m_h_electron_fcal_f1_mediumLH = TH2D_LW::create( "h_electron_fcal_f1_mediumLH", "; FCal #Sigma E_{T} [TeV]; f_{1}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_f1_nbins, m_low_f1, m_high_f1 ); - regHist(m_h_electron_fcal_f1_mediumLH, path, run).ignore(); - m_h_electron_fcal_f1_tightLH = TH2D_LW::create( "h_electron_fcal_f1_tightLH", "; FCal #Sigma E_{T} [TeV]; f_{1}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_f1_nbins, m_low_f1, m_high_f1 ); - regHist(m_h_electron_fcal_f1_tightLH, path, run).ignore(); - - //f_1, side A centrality - m_h_electron_fcalA_f1_looseLH = TH2D_LW::create( "h_electron_fcalA_f1_looseLH", "; FCal A #Sigma E_{T} [TeV]; f_{1}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_f1_nbins, m_low_f1, m_high_f1 ); - regHist(m_h_electron_fcalA_f1_looseLH, path, run).ignore(); - m_h_electron_fcalA_f1_mediumLH = TH2D_LW::create( "h_electron_fcalA_f1_mediumLH", "; FCal A #Sigma E_{T} [TeV]; f_{1}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_f1_nbins, m_low_f1, m_high_f1 ); - regHist(m_h_electron_fcalA_f1_mediumLH, path, run).ignore(); - m_h_electron_fcalA_f1_tightLH = TH2D_LW::create( "h_electron_fcalA_f1_tightLH", "; FCal A #Sigma E_{T} [TeV]; f_{1}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_f1_nbins, m_low_f1, m_high_f1 ); - regHist(m_h_electron_fcalA_f1_tightLH, path, run).ignore(); - - //f_1, side C centrality - m_h_electron_fcalC_f1_looseLH = TH2D_LW::create( "h_electron_fcalC_f1_looseLH", "; FCal C #Sigma E_{T} [TeV]; f_{1}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_f1_nbins, m_low_f1, m_high_f1 ); - regHist(m_h_electron_fcalC_f1_looseLH, path, run).ignore(); - m_h_electron_fcalC_f1_mediumLH = TH2D_LW::create( "h_electron_fcalC_f1_mediumLH", "; FCal C #Sigma E_{T} [TeV]; f_{1}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_f1_nbins, m_low_f1, m_high_f1 ); - regHist(m_h_electron_fcalC_f1_mediumLH, path, run).ignore(); - m_h_electron_fcalC_f1_tightLH = TH2D_LW::create( "h_electron_fcalC_f1_tightLH", "; FCal C #Sigma E_{T} [TeV]; f_{1}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_f1_nbins, m_low_f1, m_high_f1 ); - regHist(m_h_electron_fcalC_f1_tightLH, path, run).ignore(); - - //f_3 - m_h_electron_fcal_f3_looseLH = TH2D_LW::create( "h_electron_fcal_f3_looseLH", "; FCal #Sigma E_{T} [TeV]; f_{3}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_f3_nbins, m_low_f3, m_high_f3 ); - regHist(m_h_electron_fcal_f3_looseLH, path, run).ignore(); - m_h_electron_fcal_f3_mediumLH = TH2D_LW::create( "h_electron_fcal_f3_mediumLH", "; FCal #Sigma E_{T} [TeV]; f_{3}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_f3_nbins, m_low_f3, m_high_f3 ); - regHist(m_h_electron_fcal_f3_mediumLH, path, run).ignore(); - m_h_electron_fcal_f3_tightLH = TH2D_LW::create( "h_electron_fcal_f3_tightLH", "; FCal #Sigma E_{T} [TeV]; f_{3}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_f3_nbins, m_low_f3, m_high_f3 ); - regHist(m_h_electron_fcal_f3_tightLH, path, run).ignore(); - - //f_3, side A centrality - m_h_electron_fcalA_f3_looseLH = TH2D_LW::create( "h_electron_fcalA_f3_looseLH", "; FCal A #Sigma E_{T} [TeV]; f_{3}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_f3_nbins, m_low_f3, m_high_f3 ); - regHist(m_h_electron_fcalA_f3_looseLH, path, run).ignore(); - m_h_electron_fcalA_f3_mediumLH = TH2D_LW::create( "h_electron_fcalA_f3_mediumLH", "; FCal A #Sigma E_{T} [TeV]; f_{3}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_f3_nbins, m_low_f3, m_high_f3 ); - regHist(m_h_electron_fcalA_f3_mediumLH, path, run).ignore(); - m_h_electron_fcalA_f3_tightLH = TH2D_LW::create( "h_electron_fcalA_f3_tightLH", "; FCal A #Sigma E_{T} [TeV]; f_{3}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_f3_nbins, m_low_f3, m_high_f3 ); - regHist(m_h_electron_fcalA_f3_tightLH, path, run).ignore(); - - //f_3, side C centrality - m_h_electron_fcalC_f3_looseLH = TH2D_LW::create( "h_electron_fcalC_f3_looseLH", "; FCal C #Sigma E_{T} [TeV]; f_{3}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_f3_nbins, m_low_f3, m_high_f3 ); - regHist(m_h_electron_fcalC_f3_looseLH, path, run).ignore(); - m_h_electron_fcalC_f3_mediumLH = TH2D_LW::create( "h_electron_fcalC_f3_mediumLH", "; FCal C #Sigma E_{T} [TeV]; f_{3}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_f3_nbins, m_low_f3, m_high_f3 ); - regHist(m_h_electron_fcalC_f3_mediumLH, path, run).ignore(); - m_h_electron_fcalC_f3_tightLH = TH2D_LW::create( "h_electron_fcalC_f3_tightLH", "; FCal C #Sigma E_{T} [TeV]; f_{3}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_f3_nbins, m_low_f3, m_high_f3 ); - regHist(m_h_electron_fcalC_f3_tightLH, path, run).ignore(); - - //delta_eta1 - m_h_electron_fcal_deltaeta1_looseLH = TH2D_LW::create( "h_electron_fcal_deltaeta1_looseLH", "; FCal #Sigma E_{T} [TeV]; #Delta#eta", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_deltaeta1_nbins, m_low_deltaeta1, m_high_deltaeta1 ); - regHist(m_h_electron_fcal_deltaeta1_looseLH, path, run).ignore(); - m_h_electron_fcal_deltaeta1_mediumLH = TH2D_LW::create( "h_electron_fcal_deltaeta1_mediumLH", "; FCal #Sigma E_{T} [TeV]; #Delta#eta", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_deltaeta1_nbins, m_low_deltaeta1, m_high_deltaeta1 ); - regHist(m_h_electron_fcal_deltaeta1_mediumLH, path, run).ignore(); - m_h_electron_fcal_deltaeta1_tightLH = TH2D_LW::create( "h_electron_fcal_deltaeta1_tightLH", "; FCal #Sigma E_{T} [TeV]; #Delta#eta", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_deltaeta1_nbins, m_low_deltaeta1, m_high_deltaeta1 ); - regHist(m_h_electron_fcal_deltaeta1_tightLH, path, run).ignore(); - - //delta_eta1, side A centrality - m_h_electron_fcalA_deltaeta1_looseLH = TH2D_LW::create( "h_electron_fcalA_deltaeta1_looseLH", "; FCal A #Sigma E_{T} [TeV]; #Delta#eta", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_deltaeta1_nbins, m_low_deltaeta1, m_high_deltaeta1 ); - regHist(m_h_electron_fcalA_deltaeta1_looseLH, path, run).ignore(); - m_h_electron_fcalA_deltaeta1_mediumLH = TH2D_LW::create( "h_electron_fcalA_deltaeta1_mediumLH", "; FCal A #Sigma E_{T} [TeV]; #Delta#eta", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_deltaeta1_nbins, m_low_deltaeta1, m_high_deltaeta1 ); - regHist(m_h_electron_fcalA_deltaeta1_mediumLH, path, run).ignore(); - m_h_electron_fcalA_deltaeta1_tightLH = TH2D_LW::create( "h_electron_fcalA_deltaeta1_tightLH", "; FCal A #Sigma E_{T} [TeV]; #Delta#eta", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_deltaeta1_nbins, m_low_deltaeta1, m_high_deltaeta1 ); - regHist(m_h_electron_fcalA_deltaeta1_tightLH, path, run).ignore(); - - //delta_eta1, side C centrality - m_h_electron_fcalC_deltaeta1_looseLH = TH2D_LW::create( "h_electron_fcalC_deltaeta1_looseLH", "; FCal C #Sigma E_{T} [TeV]; #Delta#eta", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_deltaeta1_nbins, m_low_deltaeta1, m_high_deltaeta1 ); - regHist(m_h_electron_fcalC_deltaeta1_looseLH, path, run).ignore(); - m_h_electron_fcalC_deltaeta1_mediumLH = TH2D_LW::create( "h_electron_fcalC_deltaeta1_mediumLH", "; FCal C #Sigma E_{T} [TeV]; #Delta#eta", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_deltaeta1_nbins, m_low_deltaeta1, m_high_deltaeta1 ); - regHist(m_h_electron_fcalC_deltaeta1_mediumLH, path, run).ignore(); - m_h_electron_fcalC_deltaeta1_tightLH = TH2D_LW::create( "h_electron_fcalC_deltaeta1_tightLH", "; FCal C #Sigma E_{T} [TeV]; #Delta#eta", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_deltaeta1_nbins, m_low_deltaeta1, m_high_deltaeta1 ); - regHist(m_h_electron_fcalC_deltaeta1_tightLH, path, run).ignore(); - - //delta_phi_rescaled - m_h_electron_fcal_deltaphires_looseLH = TH2D_LW::create( "h_electron_fcal_deltaphires_looseLH", "; FCal #Sigma E_{T} [TeV]; #Delta#phi rescaled", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_deltaphires_nbins, m_low_deltaphires, m_high_deltaphires ); - regHist(m_h_electron_fcal_deltaphires_looseLH, path, run).ignore(); - m_h_electron_fcal_deltaphires_mediumLH = TH2D_LW::create( "h_electron_fcal_deltaphires_mediumLH", "; FCal #Sigma E_{T} [TeV]; #Delta#phi rescaled", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_deltaphires_nbins, m_low_deltaphires, m_high_deltaphires ); - regHist(m_h_electron_fcal_deltaphires_mediumLH, path, run).ignore(); - m_h_electron_fcal_deltaphires_tightLH = TH2D_LW::create( "h_electron_fcal_deltaphires_tightLH", "; FCal #Sigma E_{T} [TeV]; #Delta#phi rescaled", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_deltaphires_nbins, m_low_deltaphires, m_high_deltaphires ); - regHist(m_h_electron_fcal_deltaphires_tightLH, path, run).ignore(); - - //delta_phi_rescaled, side A centrality - m_h_electron_fcalA_deltaphires_looseLH = TH2D_LW::create( "h_electron_fcalA_deltaphires_looseLH", "; FCal A #Sigma E_{T} [TeV]; #Delta#phi rescaled", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_deltaphires_nbins, m_low_deltaphires, m_high_deltaphires ); - regHist(m_h_electron_fcalA_deltaphires_looseLH, path, run).ignore(); - m_h_electron_fcalA_deltaphires_mediumLH = TH2D_LW::create( "h_electron_fcalA_deltaphires_mediumLH", "; FCal A #Sigma E_{T} [TeV]; #Delta#phi rescaled", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_deltaphires_nbins, m_low_deltaphires, m_high_deltaphires ); - regHist(m_h_electron_fcalA_deltaphires_mediumLH, path, run).ignore(); - m_h_electron_fcalA_deltaphires_tightLH = TH2D_LW::create( "h_electron_fcalA_deltaphires_tightLH", "; FCal A #Sigma E_{T} [TeV]; #Delta#phi rescaled", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_deltaphires_nbins, m_low_deltaphires, m_high_deltaphires ); - regHist(m_h_electron_fcalA_deltaphires_tightLH, path, run).ignore(); - - //delta_phi_rescaled, side C centrality - m_h_electron_fcalC_deltaphires_looseLH = TH2D_LW::create( "h_electron_fcalC_deltaphires_looseLH", "; FCal C #Sigma E_{T} [TeV]; #Delta#phi rescaled", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_deltaphires_nbins, m_low_deltaphires, m_high_deltaphires ); - regHist(m_h_electron_fcalC_deltaphires_looseLH, path, run).ignore(); - m_h_electron_fcalC_deltaphires_mediumLH = TH2D_LW::create( "h_electron_fcalC_deltaphires_mediumLH", "; FCal C #Sigma E_{T} [TeV]; #Delta#phi rescaled", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_deltaphires_nbins, m_low_deltaphires, m_high_deltaphires ); - regHist(m_h_electron_fcalC_deltaphires_mediumLH, path, run).ignore(); - m_h_electron_fcalC_deltaphires_tightLH = TH2D_LW::create( "h_electron_fcalC_deltaphires_tightLH", "; FCal C #Sigma E_{T} [TeV]; #Delta#phi rescaled", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_deltaphires_nbins, m_low_deltaphires, m_high_deltaphires ); - regHist(m_h_electron_fcalC_deltaphires_tightLH, path, run).ignore(); - - //e_probability_HT - m_h_electron_fcal_eprobabilityht_looseLH = TH2D_LW::create( "h_electron_fcal_eprobabilityht_looseLH", "; FCal #Sigma E_{T} [TeV]; eProbabilityHT", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_eprobabilityht_nbins, m_low_eprobabilityht, m_high_eprobabilityht ); - regHist(m_h_electron_fcal_eprobabilityht_looseLH, path, run).ignore(); - m_h_electron_fcal_eprobabilityht_mediumLH = TH2D_LW::create( "h_electron_fcal_eprobabilityht_mediumLH", "; FCal #Sigma E_{T} [TeV]; eProbabilityHT", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_eprobabilityht_nbins, m_low_eprobabilityht, m_high_eprobabilityht ); - regHist(m_h_electron_fcal_eprobabilityht_mediumLH, path, run).ignore(); - m_h_electron_fcal_eprobabilityht_tightLH = TH2D_LW::create( "h_electron_fcal_eprobabilityht_tightLH", "; FCal #Sigma E_{T} [TeV]; eProbabilityHT", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_eprobabilityht_nbins, m_low_eprobabilityht, m_high_eprobabilityht ); - regHist(m_h_electron_fcal_eprobabilityht_tightLH, path, run).ignore(); - - //e_probability_HT, side A centrality - m_h_electron_fcalA_eprobabilityht_looseLH = TH2D_LW::create( "h_electron_fcalA_eprobabilityht_looseLH", "; FCal A #Sigma E_{T} [TeV]; eProbabilityHT", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_eprobabilityht_nbins, m_low_eprobabilityht, m_high_eprobabilityht ); - regHist(m_h_electron_fcalA_eprobabilityht_looseLH, path, run).ignore(); - m_h_electron_fcalA_eprobabilityht_mediumLH = TH2D_LW::create( "h_electron_fcalA_eprobabilityht_mediumLH", "; FCal A #Sigma E_{T} [TeV]; eProbabilityHT", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_eprobabilityht_nbins, m_low_eprobabilityht, m_high_eprobabilityht ); - regHist(m_h_electron_fcalA_eprobabilityht_mediumLH, path, run).ignore(); - m_h_electron_fcalA_eprobabilityht_tightLH = TH2D_LW::create( "h_electron_fcalA_eprobabilityht_tightLH", "; FCal A #Sigma E_{T} [TeV]; eProbabilityHT", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_eprobabilityht_nbins, m_low_eprobabilityht, m_high_eprobabilityht ); - regHist(m_h_electron_fcalA_eprobabilityht_tightLH, path, run).ignore(); - - //e_probability_HT, side C centrality - m_h_electron_fcalC_eprobabilityht_looseLH = TH2D_LW::create( "h_electron_fcalC_eprobabilityht_looseLH", "; FCal C #Sigma E_{T} [TeV]; eProbabilityHT", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_eprobabilityht_nbins, m_low_eprobabilityht, m_high_eprobabilityht ); - regHist(m_h_electron_fcalC_eprobabilityht_looseLH, path, run).ignore(); - m_h_electron_fcalC_eprobabilityht_mediumLH = TH2D_LW::create( "h_electron_fcalC_eprobabilityht_mediumLH", "; FCal C #Sigma E_{T} [TeV]; eProbabilityHT", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_eprobabilityht_nbins, m_low_eprobabilityht, m_high_eprobabilityht ); - regHist(m_h_electron_fcalC_eprobabilityht_mediumLH, path, run).ignore(); - m_h_electron_fcalC_eprobabilityht_tightLH = TH2D_LW::create( "h_electron_fcalC_eprobabilityht_tightLH", "; FCal C #Sigma E_{T} [TeV]; eProbabilityHT", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_eprobabilityht_nbins, m_low_eprobabilityht, m_high_eprobabilityht ); - regHist(m_h_electron_fcalC_eprobabilityht_tightLH, path, run).ignore(); -} +#include <sstream> + +#include "GaudiKernel/IJobOptionsSvc.h" +#include "GaudiKernel/MsgStream.h" +#include "GaudiKernel/StatusCode.h" + +#include "AthenaMonitoring/AthenaMonManager.h" +#include "HIMonitoring/HIMonitoringElectronsTool.h" + +#include "LWHists/TH1D_LW.h" +#include "LWHists/TH2D_LW.h" +#include "LWHists/TProfile_LW.h" + +HIMonitoringElectronsTool:: +HIMonitoringElectronsTool( const std::string & type, const std::string & name, +const IInterface* parent ): ManagedMonitorToolBase( type, name, parent ) +{ + m_FCalEt=0; + m_FCalEt_A=0; + m_FCalEt_C=0; + + m_FCalEt_nbins=95; + m_low_FCalEt=-0.15; + m_high_FCalEt=0.8; + + m_FCalEt_oneSide_nbins=50; + m_low_FCalEt_oneSide=-0.1; + m_high_FCalEt_oneSide=0.4; + + m_eta_nbins = 60; + m_low_eta = -3.0; + m_high_eta = 3.0; + + m_phi_nbins = 64; + m_low_phi = -3.14159; + m_high_phi = 3.14159; + + m_z0sintheta_nbins = 50; + m_low_z0sintheta = -10.0; + m_high_z0sintheta = 10.0; + + m_iso_nbins = 60; + m_low_iso = -30.0; + m_high_iso = 30.0; + + m_reta_nbins = 40; + m_low_reta = 0.7; + m_high_reta = 1.1; + + m_rphi_nbins = 50; + m_low_rphi = 0.6; + m_high_rphi = 1.1; + + m_weta2_nbins = 50; + m_low_weta2 = 0.005; + m_high_weta2 = 0.015; + + m_rhad_nbins = 60; + m_low_rhad = -0.3; + m_high_rhad = 0.3; + + m_eratio_nbins = 60; + m_low_eratio = -0.1; + m_high_eratio = 1.1; + + m_f1_nbins = 65; + m_low_f1 = -0.05; + m_high_f1 = 0.6; + + m_f3_nbins = 80; + m_low_f3 = -0.05; + m_high_f3 = 0.15; + + m_deltaeta1_nbins = 50; + m_low_deltaeta1 = -0.05; + m_high_deltaeta1 = 0.05; + + m_deltaphires_nbins = 50; + m_low_deltaphires = -0.05; + m_high_deltaphires = 0.05; + + m_eprobabilityht_nbins = 60; + m_low_eprobabilityht = -0.1; + m_high_eprobabilityht = 1.1; + + //LH-based selection tools + m_electronLooseLHTool = new AsgElectronLikelihoodTool ( "ElectronLooseLHTool" ); + m_electronLooseLHTool->setProperty("ConfigFile","ElectronPhotonSelectorTools/offline/mc15_20160512/ElectronLikelihoodLooseOfflineConfig2016_Smooth.conf"); + if (!m_electronLooseLHTool->initialize().isSuccess()) { + Fatal("MyFunction", "Failed to initialize ElectronLooseLHTool "); + } + + m_electronMediumLHTool = new AsgElectronLikelihoodTool ( "ElectronMediumLHTool" ); + m_electronMediumLHTool->setProperty("ConfigFile","ElectronPhotonSelectorTools/offline/mc15_20160512/ElectronLikelihoodMediumOfflineConfig2016_Smooth.conf"); + if (!m_electronMediumLHTool->initialize().isSuccess()) { + Fatal("MyFunction", "Failed to initialize ElectronMediumLHTool "); + } + + m_electronTightLHTool = new AsgElectronLikelihoodTool ( "ElectronTightLHTool" ); + m_electronTightLHTool->setProperty("ConfigFile","ElectronPhotonSelectorTools/offline/mc15_20160512/ElectronLikelihoodTightOfflineConfig2016_Smooth.conf"); + if (!m_electronTightLHTool->initialize().isSuccess()) { + Fatal("MyFunction", "Failed to initialize ElectronTightLHTool "); + } +} + + +HIMonitoringElectronsTool::~HIMonitoringElectronsTool() +{ +} + +// Description: Used for rebooking unmanaged histograms +StatusCode HIMonitoringElectronsTool::bookHistogramsRecurrent( ) +{ + return StatusCode::SUCCESS; +} + + +// Description: Used for re-booking managed histograms +StatusCode HIMonitoringElectronsTool::bookHistograms( ) +{ + if( m_environment == AthenaMonManager::online ) { + // book histograms that are only made in the online environment... + } + + if( m_dataType == AthenaMonManager::cosmics ) { + // book histograms that are only relevant for cosmics data... + } + + book_hist(); + + + return StatusCode::SUCCESS; +} + + +StatusCode HIMonitoringElectronsTool::fillHistograms() +{ + StatusCode sc; + + /// HI event shape + const xAOD::HIEventShapeContainer* evtShape; + sc = evtStore()->retrieve(evtShape, "HIEventShape"); + if (sc.isFailure()) + { + ATH_MSG_ERROR("Could not find HIEventShape"); + return StatusCode::FAILURE; + } + else + { + ATH_MSG_INFO("HIEventShape retrieved from StoreGate"); + } + + int size=evtShape->size(); + for(int i=0;i<size;i++) + { + const xAOD::HIEventShape *sh=evtShape->at(i); + if(sh->layer()==21 || sh->layer()==22 || sh->layer()==23) + { + m_FCalEt += sh->et(); + if((sh->etaMax()) > 0) m_FCalEt_A += sh->et(); + else m_FCalEt_C += sh->et(); + } + } + m_FCalEt = m_FCalEt*1.e-6; + m_FCalEt_A = m_FCalEt_A*1.e-6; + m_FCalEt_C = m_FCalEt_C*1.e-6; + + + const xAOD::ElectronContainer* electrons = 0; + sc = evtStore()->retrieve( electrons, "Electrons" ); + if (sc.isFailure()) { + ATH_MSG_ERROR("Could not find Electrons"); + return StatusCode::FAILURE; + } + else { + ATH_MSG_INFO("Electrons retrieved from StoreGate"); + } + + xAOD::ElectronContainer::const_iterator electrons_itr = electrons->begin(); + xAOD::ElectronContainer::const_iterator electrons_end = electrons->end(); + + int n_loose_LH = 0; + int n_medium_LH = 0; + int n_tight_LH = 0; + + for( ; electrons_itr != electrons_end; ++electrons_itr ) { + float pt = (*electrons_itr)->pt() * 1.e-3; + float eta = (*electrons_itr)->caloCluster()->etaBE(2); + + if (pt < 15 || fabs(eta) > 2.47) continue; + + float phi = (*electrons_itr)->phi(); + m_h_electron_eta_phi->Fill(eta,phi); + + float z0 = (*electrons_itr)->trackParticle()->z0(); + m_h_electron_z0sintheta->Fill(z0*sin(2*TMath::ATan(exp(-eta)))); + + bool loose_LH = (bool) m_electronLooseLHTool->accept(*electrons_itr); + bool medium_LH = (bool) m_electronMediumLHTool->accept(*electrons_itr); + bool tight_LH = (bool) m_electronTightLHTool->accept(*electrons_itr); + + float etcone20 = (*electrons_itr)->auxdata<float>("etcone20") * 1.e-3; + + float reta = (*electrons_itr)->auxdata<float>("Reta"); + float rphi = (*electrons_itr)->auxdata<float>("Rphi"); + float weta2 = (*electrons_itr)->auxdata< float >("weta2"); + + float rhad = (*electrons_itr)->auxdata<float>("Rhad"); + + float eratio = (*electrons_itr)->auxdata<float>("Eratio"); + float f1 = (*electrons_itr)->auxdata<float>("f1"); + float f3 = (*electrons_itr)->auxdata<float>("f3"); + + float deltaeta1; + (*electrons_itr)->trackCaloMatchValue(deltaeta1, xAOD::EgammaParameters::deltaEta1); + float deltaphires; + (*electrons_itr)->trackCaloMatchValue(deltaphires, xAOD::EgammaParameters::deltaPhiRescaled2); + float TRT_PID; + (*electrons_itr)->trackParticle()->summaryValue(TRT_PID, xAOD::eProbabilityHT); + + if (loose_LH){ + n_loose_LH++; + + m_h_electron_fcal_etcone20_looseLH->Fill(m_FCalEt, etcone20); + m_h_electron_fcalA_etcone20_looseLH->Fill(m_FCalEt_A, etcone20); + m_h_electron_fcalC_etcone20_looseLH->Fill(m_FCalEt_C, etcone20); + + m_h_electron_fcal_reta_looseLH->Fill(m_FCalEt, reta); + m_h_electron_fcalA_reta_looseLH->Fill(m_FCalEt_A, reta); + m_h_electron_fcalC_reta_looseLH->Fill(m_FCalEt_C, reta); + m_h_electron_fcal_rphi_looseLH->Fill(m_FCalEt, rphi); + m_h_electron_fcalA_rphi_looseLH->Fill(m_FCalEt_A, rphi); + m_h_electron_fcalC_rphi_looseLH->Fill(m_FCalEt_C, rphi); + m_h_electron_fcal_weta2_looseLH->Fill(m_FCalEt, weta2); + m_h_electron_fcalA_weta2_looseLH->Fill(m_FCalEt_A, weta2); + m_h_electron_fcalC_weta2_looseLH->Fill(m_FCalEt_C, weta2); + + m_h_electron_fcal_rhad_looseLH->Fill(m_FCalEt, rhad); + m_h_electron_fcalA_rhad_looseLH->Fill(m_FCalEt_A, rhad); + m_h_electron_fcalC_rhad_looseLH->Fill(m_FCalEt_C, rhad); + + m_h_electron_fcal_eratio_looseLH->Fill(m_FCalEt, eratio); + m_h_electron_fcalA_eratio_looseLH->Fill(m_FCalEt_A, eratio); + m_h_electron_fcalC_eratio_looseLH->Fill(m_FCalEt_C, eratio); + m_h_electron_fcal_f1_looseLH->Fill(m_FCalEt, f1); + m_h_electron_fcalA_f1_looseLH->Fill(m_FCalEt_A, f1); + m_h_electron_fcalC_f1_looseLH->Fill(m_FCalEt_C, f1); + m_h_electron_fcal_f3_looseLH->Fill(m_FCalEt, f3); + m_h_electron_fcalA_f3_looseLH->Fill(m_FCalEt_A, f3); + m_h_electron_fcalC_f3_looseLH->Fill(m_FCalEt_C, f3); + + m_h_electron_fcal_deltaeta1_looseLH->Fill(m_FCalEt, deltaeta1); + m_h_electron_fcalA_deltaeta1_looseLH->Fill(m_FCalEt_A, deltaeta1); + m_h_electron_fcalC_deltaeta1_looseLH->Fill(m_FCalEt_C, deltaeta1); + m_h_electron_fcal_deltaphires_looseLH->Fill(m_FCalEt, deltaphires); + m_h_electron_fcalA_deltaphires_looseLH->Fill(m_FCalEt_A, deltaphires); + m_h_electron_fcalC_deltaphires_looseLH->Fill(m_FCalEt_C, deltaphires); + if (fabs(eta) < 2.01){ + m_h_electron_fcal_eprobabilityht_looseLH->Fill(m_FCalEt, TRT_PID); + m_h_electron_fcalA_eprobabilityht_looseLH->Fill(m_FCalEt_A, TRT_PID); + m_h_electron_fcalC_eprobabilityht_looseLH->Fill(m_FCalEt_C, TRT_PID); + } + } + + if (medium_LH){ + n_medium_LH++; + + m_h_electron_fcal_etcone20_mediumLH->Fill(m_FCalEt, etcone20); + m_h_electron_fcalA_etcone20_mediumLH->Fill(m_FCalEt_A, etcone20); + m_h_electron_fcalC_etcone20_mediumLH->Fill(m_FCalEt_C, etcone20); + + m_h_electron_fcal_reta_mediumLH->Fill(m_FCalEt, reta); + m_h_electron_fcalA_reta_mediumLH->Fill(m_FCalEt_A, reta); + m_h_electron_fcalC_reta_mediumLH->Fill(m_FCalEt_C, reta); + m_h_electron_fcal_rphi_mediumLH->Fill(m_FCalEt, rphi); + m_h_electron_fcalA_rphi_mediumLH->Fill(m_FCalEt_A, rphi); + m_h_electron_fcalC_rphi_mediumLH->Fill(m_FCalEt_C, rphi); + m_h_electron_fcal_weta2_mediumLH->Fill(m_FCalEt, weta2); + m_h_electron_fcalA_weta2_mediumLH->Fill(m_FCalEt_A, weta2); + m_h_electron_fcalC_weta2_mediumLH->Fill(m_FCalEt_C, weta2); + + m_h_electron_fcal_rhad_mediumLH->Fill(m_FCalEt, rhad); + m_h_electron_fcalA_rhad_mediumLH->Fill(m_FCalEt_A, rhad); + m_h_electron_fcalC_rhad_mediumLH->Fill(m_FCalEt_C, rhad); + + m_h_electron_fcal_eratio_mediumLH->Fill(m_FCalEt, eratio); + m_h_electron_fcalA_eratio_mediumLH->Fill(m_FCalEt_A, eratio); + m_h_electron_fcalC_eratio_mediumLH->Fill(m_FCalEt_C, eratio); + m_h_electron_fcal_f1_mediumLH->Fill(m_FCalEt, f1); + m_h_electron_fcalA_f1_mediumLH->Fill(m_FCalEt_A, f1); + m_h_electron_fcalC_f1_mediumLH->Fill(m_FCalEt_C, f1); + m_h_electron_fcal_f3_mediumLH->Fill(m_FCalEt, f3); + m_h_electron_fcalA_f3_mediumLH->Fill(m_FCalEt_A, f3); + m_h_electron_fcalC_f3_mediumLH->Fill(m_FCalEt_C, f3); + + m_h_electron_fcal_deltaeta1_mediumLH->Fill(m_FCalEt, deltaeta1); + m_h_electron_fcalA_deltaeta1_mediumLH->Fill(m_FCalEt_A, deltaeta1); + m_h_electron_fcalC_deltaeta1_mediumLH->Fill(m_FCalEt_C, deltaeta1); + m_h_electron_fcal_deltaphires_mediumLH->Fill(m_FCalEt, deltaphires); + m_h_electron_fcalA_deltaphires_mediumLH->Fill(m_FCalEt_A, deltaphires); + m_h_electron_fcalC_deltaphires_mediumLH->Fill(m_FCalEt_C, deltaphires); + if (fabs(eta) < 2.01){ + m_h_electron_fcal_eprobabilityht_mediumLH->Fill(m_FCalEt, TRT_PID); + m_h_electron_fcalA_eprobabilityht_mediumLH->Fill(m_FCalEt_A, TRT_PID); + m_h_electron_fcalC_eprobabilityht_mediumLH->Fill(m_FCalEt_C, TRT_PID); + } + } + + if (tight_LH){ + n_tight_LH++; + + m_h_electron_fcal_etcone20_tightLH->Fill(m_FCalEt, etcone20); + m_h_electron_fcalA_etcone20_tightLH->Fill(m_FCalEt_A, etcone20); + m_h_electron_fcalC_etcone20_tightLH->Fill(m_FCalEt_C, etcone20); + + m_h_electron_fcal_reta_tightLH->Fill(m_FCalEt, reta); + m_h_electron_fcalA_reta_tightLH->Fill(m_FCalEt_A, reta); + m_h_electron_fcalC_reta_tightLH->Fill(m_FCalEt_C, reta); + m_h_electron_fcal_rphi_tightLH->Fill(m_FCalEt, rphi); + m_h_electron_fcalA_rphi_tightLH->Fill(m_FCalEt_A, rphi); + m_h_electron_fcalC_rphi_tightLH->Fill(m_FCalEt_C, rphi); + m_h_electron_fcal_weta2_tightLH->Fill(m_FCalEt, weta2); + m_h_electron_fcalA_weta2_tightLH->Fill(m_FCalEt_A, weta2); + m_h_electron_fcalC_weta2_tightLH->Fill(m_FCalEt_C, weta2); + + m_h_electron_fcal_rhad_tightLH->Fill(m_FCalEt, rhad); + m_h_electron_fcalA_rhad_tightLH->Fill(m_FCalEt_A, rhad); + m_h_electron_fcalC_rhad_tightLH->Fill(m_FCalEt_C, rhad); + + m_h_electron_fcal_eratio_tightLH->Fill(m_FCalEt, eratio); + m_h_electron_fcalA_eratio_tightLH->Fill(m_FCalEt_A, eratio); + m_h_electron_fcalC_eratio_tightLH->Fill(m_FCalEt_C, eratio); + m_h_electron_fcal_f1_tightLH->Fill(m_FCalEt, f1); + m_h_electron_fcalA_f1_tightLH->Fill(m_FCalEt_A, f1); + m_h_electron_fcalC_f1_tightLH->Fill(m_FCalEt_C, f1); + m_h_electron_fcal_f3_tightLH->Fill(m_FCalEt, f3); + m_h_electron_fcalA_f3_tightLH->Fill(m_FCalEt_A, f3); + m_h_electron_fcalC_f3_tightLH->Fill(m_FCalEt_C, f3); + + m_h_electron_fcal_deltaeta1_tightLH->Fill(m_FCalEt, deltaeta1); + m_h_electron_fcalA_deltaeta1_tightLH->Fill(m_FCalEt_A, deltaeta1); + m_h_electron_fcalC_deltaeta1_tightLH->Fill(m_FCalEt_C, deltaeta1); + m_h_electron_fcal_deltaphires_tightLH->Fill(m_FCalEt, deltaphires); + m_h_electron_fcalA_deltaphires_tightLH->Fill(m_FCalEt_A, deltaphires); + m_h_electron_fcalC_deltaphires_tightLH->Fill(m_FCalEt_C, deltaphires); + if (fabs(eta) < 2.01){ + m_h_electron_fcal_eprobabilityht_tightLH->Fill(m_FCalEt, TRT_PID); + m_h_electron_fcalA_eprobabilityht_tightLH->Fill(m_FCalEt_A, TRT_PID); + m_h_electron_fcalC_eprobabilityht_tightLH->Fill(m_FCalEt_C, TRT_PID); + } + } + } + + if (n_loose_LH){ + m_h_FCalEt_looseLH->Fill(m_FCalEt); + m_h_FCalEt_A_looseLH->Fill(m_FCalEt_A); + m_h_FCalEt_C_looseLH->Fill(m_FCalEt_C); + } + if (n_medium_LH){ + m_h_FCalEt_mediumLH->Fill(m_FCalEt); + m_h_FCalEt_A_mediumLH->Fill(m_FCalEt_A); + m_h_FCalEt_C_mediumLH->Fill(m_FCalEt_C); + } + if (n_tight_LH){ + m_h_FCalEt_tightLH->Fill(m_FCalEt); + m_h_FCalEt_A_tightLH->Fill(m_FCalEt_A); + m_h_FCalEt_C_tightLH->Fill(m_FCalEt_C); + } + + return StatusCode::SUCCESS; +} + + +StatusCode HIMonitoringElectronsTool::procHistograms( ) +{ + + //if( endOfLowStatFlag() || endOfLumiBlockFlag() ) { } + + + if( endOfRunFlag() ) + { + if(m_h_FCalEt_looseLH->GetEntries() > 0) m_h_FCalEt_looseLH->Scale(1./m_h_FCalEt_looseLH->GetEntries()); + if(m_h_FCalEt_mediumLH->GetEntries() > 0) m_h_FCalEt_mediumLH->Scale(1./m_h_FCalEt_mediumLH->GetEntries()); + if(m_h_FCalEt_tightLH->GetEntries() > 0) m_h_FCalEt_tightLH->Scale(1./m_h_FCalEt_tightLH->GetEntries()); + if(m_h_FCalEt_A_looseLH->GetEntries() > 0) m_h_FCalEt_A_looseLH->Scale(1./m_h_FCalEt_A_looseLH->GetEntries()); + if(m_h_FCalEt_A_mediumLH->GetEntries() > 0) m_h_FCalEt_A_mediumLH->Scale(1./m_h_FCalEt_A_mediumLH->GetEntries()); + if(m_h_FCalEt_A_tightLH->GetEntries() > 0) m_h_FCalEt_A_tightLH->Scale(1./m_h_FCalEt_A_tightLH->GetEntries()); + if(m_h_FCalEt_C_looseLH->GetEntries() > 0) m_h_FCalEt_C_looseLH->Scale(1./m_h_FCalEt_C_looseLH->GetEntries()); + if(m_h_FCalEt_C_mediumLH->GetEntries() > 0) m_h_FCalEt_C_mediumLH->Scale(1./m_h_FCalEt_C_mediumLH->GetEntries()); + if(m_h_FCalEt_C_tightLH->GetEntries() > 0) m_h_FCalEt_C_tightLH->Scale(1./m_h_FCalEt_C_tightLH->GetEntries()); + if(m_h_electron_z0sintheta->GetEntries() > 0) m_h_electron_z0sintheta->Scale(1./m_h_electron_z0sintheta->GetEntries()); + } + + return StatusCode::SUCCESS; +} + + +void HIMonitoringElectronsTool::book_hist() +{ + std::string path = "HeavyIon/Electrons"; + + //FCal sum Et + m_h_FCalEt_looseLH= new TH1D( "h_FCalEt_looseLH", "; FCal #Sigma E_{T} [TeV]; entries", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt); + regHist(m_h_FCalEt_looseLH, path, run).ignore(); + m_h_FCalEt_mediumLH= new TH1D( "h_FCalEt_mediumLH", "; FCal #Sigma E_{T} [TeV]; entries", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt); + regHist(m_h_FCalEt_mediumLH, path, run).ignore(); + m_h_FCalEt_tightLH= new TH1D( "h_FCalEt_tightLH", "; FCal #Sigma E_{T} [TeV]; entries", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt); + regHist(m_h_FCalEt_tightLH, path, run).ignore(); + + //FCal sum Et, side A + m_h_FCalEt_A_looseLH = new TH1D( "h_FCalEt_A_looseLH", "; FCal A #Sigma E_{T} [TeV]; entries", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide); + regHist(m_h_FCalEt_A_looseLH, path, run).ignore(); + m_h_FCalEt_A_mediumLH = new TH1D( "h_FCalEt_A_mediumLH", "; FCal A #Sigma E_{T} [TeV]; entries", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide); + regHist(m_h_FCalEt_A_mediumLH, path, run).ignore(); + m_h_FCalEt_A_tightLH = new TH1D( "h_FCalEt_A_tightLH", "; FCal A #Sigma E_{T} [TeV]; entries", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide); + regHist(m_h_FCalEt_A_tightLH, path, run).ignore(); + + //FCal sum Et, side C + m_h_FCalEt_C_looseLH = new TH1D( "h_FCalEt_C_looseLH", "; FCal C #Sigma E_{T} [TeV]; entries", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide); + regHist(m_h_FCalEt_C_looseLH, path, run).ignore(); + m_h_FCalEt_C_mediumLH = new TH1D( "h_FCalEt_C_mediumLH", "; FCal C #Sigma E_{T} [TeV]; entries", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide); + regHist(m_h_FCalEt_C_mediumLH, path, run).ignore(); + m_h_FCalEt_C_tightLH = new TH1D( "h_FCalEt_C_tightLH", "; FCal C #Sigma E_{T} [TeV]; entries", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide); + regHist(m_h_FCalEt_C_tightLH, path, run).ignore(); + + //eta vs phi + m_h_electron_eta_phi = TH2D_LW::create( "h_electron_eta_phi", "; #eta; #phi", m_eta_nbins, m_low_eta, m_high_eta, m_phi_nbins, m_low_phi, m_high_phi); + regHist(m_h_electron_eta_phi, path, run).ignore(); + + //GSF track z0*sin(theta) + m_h_electron_z0sintheta = new TH1D( "h_electron_z0sintheta", "; z0 sin#theta [mm]; entries", m_z0sintheta_nbins, m_low_z0sintheta, m_high_z0sintheta); + regHist(m_h_electron_z0sintheta, path, run).ignore(); + + //isolation vs centrality + m_h_electron_fcal_etcone20_looseLH = TH2D_LW::create( "h_electron_fcal_etcone20_looseLH", "; FCal #Sigma E_{T} [TeV]; electron etcone20 [GeV]", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_iso_nbins, m_low_iso, m_high_iso ); + regHist(m_h_electron_fcal_etcone20_looseLH, path, run).ignore(); + m_h_electron_fcal_etcone20_mediumLH = TH2D_LW::create( "h_electron_fcal_etcone20_mediumLH", "; FCal #Sigma E_{T} [TeV]; electron etcone20 [GeV]", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_iso_nbins, m_low_iso, m_high_iso ); + regHist(m_h_electron_fcal_etcone20_mediumLH, path, run).ignore(); + m_h_electron_fcal_etcone20_tightLH = TH2D_LW::create( "h_electron_fcal_etcone20_tightLH", "; FCal #Sigma E_{T} [TeV]; electron etcone20 [GeV]", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_iso_nbins, m_low_iso, m_high_iso ); + regHist(m_h_electron_fcal_etcone20_tightLH, path, run).ignore(); + + //isolation vs centrality, side A + m_h_electron_fcalA_etcone20_looseLH = TH2D_LW::create( "h_electron_fcalA_etcone20_looseLH", "; FCal A #Sigma E_{T} [TeV]; electron etcone20 [GeV]", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_iso_nbins, m_low_iso, m_high_iso ); + regHist(m_h_electron_fcalA_etcone20_looseLH, path, run).ignore(); + m_h_electron_fcalA_etcone20_mediumLH = TH2D_LW::create( "h_electron_fcalA_etcone20_mediumLH", "; FCal A #Sigma E_{T} [TeV]; electron etcone20 [GeV]", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_iso_nbins, m_low_iso, m_high_iso ); + regHist(m_h_electron_fcalA_etcone20_mediumLH, path, run).ignore(); + m_h_electron_fcalA_etcone20_tightLH = TH2D_LW::create( "h_electron_fcalA_etcone20_tightLH", "; FCal A #Sigma E_{T} [TeV]; electron etcone20 [GeV]", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_iso_nbins, m_low_iso, m_high_iso ); + regHist(m_h_electron_fcalA_etcone20_tightLH, path, run).ignore(); + + //isolation vs centrality, side C + m_h_electron_fcalC_etcone20_looseLH = TH2D_LW::create( "h_electron_fcalC_etcone20_looseLH", "; FCal C #Sigma E_{T} [TeV]; electron etcone20 [GeV]", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_iso_nbins, m_low_iso, m_high_iso ); + regHist(m_h_electron_fcalC_etcone20_looseLH, path, run).ignore(); + m_h_electron_fcalC_etcone20_mediumLH = TH2D_LW::create( "h_electron_fcalC_etcone20_mediumLH", "; FCal C #Sigma E_{T} [TeV]; electron etcone20 [GeV]", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_iso_nbins, m_low_iso, m_high_iso ); + regHist(m_h_electron_fcalC_etcone20_mediumLH, path, run).ignore(); + m_h_electron_fcalC_etcone20_tightLH = TH2D_LW::create( "h_electron_fcalC_etcone20_tightLH", "; FCal C #Sigma E_{T} [TeV]; electron etcone20 [GeV]", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_iso_nbins, m_low_iso, m_high_iso ); + regHist(m_h_electron_fcalC_etcone20_tightLH, path, run).ignore(); + + //R_eta + m_h_electron_fcal_reta_looseLH = TH2D_LW::create( "h_electron_fcal_reta_looseLH", "; FCal #Sigma E_{T} [TeV]; R_{#eta}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_reta_nbins, m_low_reta, m_high_reta ); + regHist(m_h_electron_fcal_reta_looseLH, path, run).ignore(); + m_h_electron_fcal_reta_mediumLH = TH2D_LW::create( "h_electron_fcal_reta_mediumLH", "; FCal #Sigma E_{T} [TeV]; R_{#eta}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_reta_nbins, m_low_reta, m_high_reta ); + regHist(m_h_electron_fcal_reta_mediumLH, path, run).ignore(); + m_h_electron_fcal_reta_tightLH = TH2D_LW::create( "h_electron_fcal_reta_tightLH", "; FCal #Sigma E_{T} [TeV]; R_{#eta}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_reta_nbins, m_low_reta, m_high_reta ); + regHist(m_h_electron_fcal_reta_tightLH, path, run).ignore(); + + //R_eta, side A centrality + m_h_electron_fcalA_reta_looseLH = TH2D_LW::create( "h_electron_fcalA_reta_looseLH", "; FCal A #Sigma E_{T} [TeV]; R_{#eta}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_reta_nbins, m_low_reta, m_high_reta ); + regHist(m_h_electron_fcalA_reta_looseLH, path, run).ignore(); + m_h_electron_fcalA_reta_mediumLH = TH2D_LW::create( "h_electron_fcalA_reta_mediumLH", "; FCal A #Sigma E_{T} [TeV]; R_{#eta}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_reta_nbins, m_low_reta, m_high_reta ); + regHist(m_h_electron_fcalA_reta_mediumLH, path, run).ignore(); + m_h_electron_fcalA_reta_tightLH = TH2D_LW::create( "h_electron_fcalA_reta_tightLH", "; FCal A #Sigma E_{T} [TeV]; R_{#eta}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_reta_nbins, m_low_reta, m_high_reta ); + regHist(m_h_electron_fcalA_reta_tightLH, path, run).ignore(); + + //R_eta, side C centrality + m_h_electron_fcalC_reta_looseLH = TH2D_LW::create( "h_electron_fcalC_reta_looseLH", "; FCal C #Sigma E_{T} [TeV]; R_{#eta}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_reta_nbins, m_low_reta, m_high_reta ); + regHist(m_h_electron_fcalC_reta_looseLH, path, run).ignore(); + m_h_electron_fcalC_reta_mediumLH = TH2D_LW::create( "h_electron_fcalC_reta_mediumLH", "; FCal C #Sigma E_{T} [TeV]; R_{#eta}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_reta_nbins, m_low_reta, m_high_reta ); + regHist(m_h_electron_fcalC_reta_mediumLH, path, run).ignore(); + m_h_electron_fcalC_reta_tightLH = TH2D_LW::create( "h_electron_fcalC_reta_tightLH", "; FCal C #Sigma E_{T} [TeV]; R_{#eta}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_reta_nbins, m_low_reta, m_high_reta ); + regHist(m_h_electron_fcalC_reta_tightLH, path, run).ignore(); + + //R_phi + m_h_electron_fcal_rphi_looseLH = TH2D_LW::create( "h_electron_fcal_rphi_looseLH", "; FCal #Sigma E_{T} [TeV]; R_{#phi}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_rphi_nbins, m_low_rphi, m_high_rphi ); + regHist(m_h_electron_fcal_rphi_looseLH, path, run).ignore(); + m_h_electron_fcal_rphi_mediumLH = TH2D_LW::create( "h_electron_fcal_rphi_mediumLH", "; FCal #Sigma E_{T} [TeV]; R_{#phi}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_rphi_nbins, m_low_rphi, m_high_rphi ); + regHist(m_h_electron_fcal_rphi_mediumLH, path, run).ignore(); + m_h_electron_fcal_rphi_tightLH = TH2D_LW::create( "h_electron_fcal_rphi_tightLH", "; FCal #Sigma E_{T} [TeV]; R_{#phi}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_rphi_nbins, m_low_rphi, m_high_rphi ); + regHist(m_h_electron_fcal_rphi_tightLH, path, run).ignore(); + + //R_phi, side A centrality + m_h_electron_fcalA_rphi_looseLH = TH2D_LW::create( "h_electron_fcalA_rphi_looseLH", "; FCal A #Sigma E_{T} [TeV]; R_{#phi}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_rphi_nbins, m_low_rphi, m_high_rphi ); + regHist(m_h_electron_fcalA_rphi_looseLH, path, run).ignore(); + m_h_electron_fcalA_rphi_mediumLH = TH2D_LW::create( "h_electron_fcalA_rphi_mediumLH", "; FCal A #Sigma E_{T} [TeV]; R_{#phi}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_rphi_nbins, m_low_rphi, m_high_rphi ); + regHist(m_h_electron_fcalA_rphi_mediumLH, path, run).ignore(); + m_h_electron_fcalA_rphi_tightLH = TH2D_LW::create( "h_electron_fcalA_rphi_tightLH", "; FCal A #Sigma E_{T} [TeV]; R_{#phi}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_rphi_nbins, m_low_rphi, m_high_rphi ); + regHist(m_h_electron_fcalA_rphi_tightLH, path, run).ignore(); + + //R_phi, side C centrality + m_h_electron_fcalC_rphi_looseLH = TH2D_LW::create( "h_electron_fcalC_rphi_looseLH", "; FCal C #Sigma E_{T} [TeV]; R_{#phi}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_rphi_nbins, m_low_rphi, m_high_rphi ); + regHist(m_h_electron_fcalC_rphi_looseLH, path, run).ignore(); + m_h_electron_fcalC_rphi_mediumLH = TH2D_LW::create( "h_electron_fcalC_rphi_mediumLH", "; FCal C #Sigma E_{T} [TeV]; R_{#phi}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_rphi_nbins, m_low_rphi, m_high_rphi ); + regHist(m_h_electron_fcalC_rphi_mediumLH, path, run).ignore(); + m_h_electron_fcalC_rphi_tightLH = TH2D_LW::create( "h_electron_fcalC_rphi_tightLH", "; FCal C #Sigma E_{T} [TeV]; R_{#phi}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_rphi_nbins, m_low_rphi, m_high_rphi ); + regHist(m_h_electron_fcalC_rphi_tightLH, path, run).ignore(); + + //W_eta2 + m_h_electron_fcal_weta2_looseLH = TH2D_LW::create( "h_electron_fcal_weta2_looseLH", "; FCal #Sigma E_{T} [TeV]; W_{#eta^{2}}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_weta2_nbins, m_low_weta2, m_high_weta2 ); + regHist(m_h_electron_fcal_weta2_looseLH, path, run).ignore(); + m_h_electron_fcal_weta2_mediumLH = TH2D_LW::create( "h_electron_fcal_weta2_mediumLH", "; FCal #Sigma E_{T} [TeV]; W_{#eta^{2}}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_weta2_nbins, m_low_weta2, m_high_weta2 ); + regHist(m_h_electron_fcal_weta2_mediumLH, path, run).ignore(); + m_h_electron_fcal_weta2_tightLH = TH2D_LW::create( "h_electron_fcal_weta2_tightLH", "; FCal #Sigma E_{T} [TeV]; W_{#eta^{2}}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_weta2_nbins, m_low_weta2, m_high_weta2 ); + regHist(m_h_electron_fcal_weta2_tightLH, path, run).ignore(); + + //W_eta2, side A centrality + m_h_electron_fcalA_weta2_looseLH = TH2D_LW::create( "h_electron_fcalA_weta2_looseLH", "; FCal A #Sigma E_{T} [TeV]; W_{#eta^{2}}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_weta2_nbins, m_low_weta2, m_high_weta2 ); + regHist(m_h_electron_fcalA_weta2_looseLH, path, run).ignore(); + m_h_electron_fcalA_weta2_mediumLH = TH2D_LW::create( "h_electron_fcalA_weta2_mediumLH", "; FCal A #Sigma E_{T} [TeV]; W_{#eta^{2}}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_weta2_nbins, m_low_weta2, m_high_weta2 ); + regHist(m_h_electron_fcalA_weta2_mediumLH, path, run).ignore(); + m_h_electron_fcalA_weta2_tightLH = TH2D_LW::create( "h_electron_fcalA_weta2_tightLH", "; FCal A #Sigma E_{T} [TeV]; W_{#eta^{2}}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_weta2_nbins, m_low_weta2, m_high_weta2 ); + regHist(m_h_electron_fcalA_weta2_tightLH, path, run).ignore(); + + //W_eta2, side C centrality + m_h_electron_fcalC_weta2_looseLH = TH2D_LW::create( "h_electron_fcalC_weta2_looseLH", "; FCal C #Sigma E_{T} [TeV]; W_{#eta^{2}}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_weta2_nbins, m_low_weta2, m_high_weta2 ); + regHist(m_h_electron_fcalC_weta2_looseLH, path, run).ignore(); + m_h_electron_fcalC_weta2_mediumLH = TH2D_LW::create( "h_electron_fcalC_weta2_mediumLH", "; FCal C #Sigma E_{T} [TeV]; W_{#eta^{2}}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_weta2_nbins, m_low_weta2, m_high_weta2 ); + regHist(m_h_electron_fcalC_weta2_mediumLH, path, run).ignore(); + m_h_electron_fcalC_weta2_tightLH = TH2D_LW::create( "h_electron_fcalC_weta2_tightLH", "; FCal C #Sigma E_{T} [TeV]; W_{#eta^{2}}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_weta2_nbins, m_low_weta2, m_high_weta2 ); + regHist(m_h_electron_fcalC_weta2_tightLH, path, run).ignore(); + + //R_had + m_h_electron_fcal_rhad_looseLH = TH2D_LW::create( "h_electron_fcal_rhad_looseLH", "; FCal #Sigma E_{T} [TeV]; R_{had}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_rhad_nbins, m_low_rhad, m_high_rhad ); + regHist(m_h_electron_fcal_rhad_looseLH, path, run).ignore(); + m_h_electron_fcal_rhad_mediumLH = TH2D_LW::create( "h_electron_fcal_rhad_mediumLH", "; FCal #Sigma E_{T} [TeV]; R_{had}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_rhad_nbins, m_low_rhad, m_high_rhad ); + regHist(m_h_electron_fcal_rhad_mediumLH, path, run).ignore(); + m_h_electron_fcal_rhad_tightLH = TH2D_LW::create( "h_electron_fcal_rhad_tightLH", "; FCal #Sigma E_{T} [TeV]; R_{had}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_rhad_nbins, m_low_rhad, m_high_rhad ); + regHist(m_h_electron_fcal_rhad_tightLH, path, run).ignore(); + + //R_had, side A centrality + m_h_electron_fcalA_rhad_looseLH = TH2D_LW::create( "h_electron_fcalA_rhad_looseLH", "; FCal A #Sigma E_{T} [TeV]; R_{had}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_rhad_nbins, m_low_rhad, m_high_rhad ); + regHist(m_h_electron_fcalA_rhad_looseLH, path, run).ignore(); + m_h_electron_fcalA_rhad_mediumLH = TH2D_LW::create( "h_electron_fcalA_rhad_mediumLH", "; FCal A #Sigma E_{T} [TeV]; R_{had}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_rhad_nbins, m_low_rhad, m_high_rhad ); + regHist(m_h_electron_fcalA_rhad_mediumLH, path, run).ignore(); + m_h_electron_fcalA_rhad_tightLH = TH2D_LW::create( "h_electron_fcalA_rhad_tightLH", "; FCal A #Sigma E_{T} [TeV]; R_{had}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_rhad_nbins, m_low_rhad, m_high_rhad ); + regHist(m_h_electron_fcalA_rhad_tightLH, path, run).ignore(); + + //R_had, side C centrality + m_h_electron_fcalC_rhad_looseLH = TH2D_LW::create( "h_electron_fcalC_rhad_looseLH", "; FCal C #Sigma E_{T} [TeV]; R_{had}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_rhad_nbins, m_low_rhad, m_high_rhad ); + regHist(m_h_electron_fcalC_rhad_looseLH, path, run).ignore(); + m_h_electron_fcalC_rhad_mediumLH = TH2D_LW::create( "h_electron_fcalC_rhad_mediumLH", "; FCal C #Sigma E_{T} [TeV]; R_{had}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_rhad_nbins, m_low_rhad, m_high_rhad ); + regHist(m_h_electron_fcalC_rhad_mediumLH, path, run).ignore(); + m_h_electron_fcalC_rhad_tightLH = TH2D_LW::create( "h_electron_fcalC_rhad_tightLH", "; FCal C #Sigma E_{T} [TeV]; R_{had}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_rhad_nbins, m_low_rhad, m_high_rhad ); + regHist(m_h_electron_fcalC_rhad_tightLH, path, run).ignore(); + + //E_ratio + m_h_electron_fcal_eratio_looseLH = TH2D_LW::create( "h_electron_fcal_eratio_looseLH", "; FCal #Sigma E_{T} [TeV]; E_{ratio}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_eratio_nbins, m_low_eratio, m_high_eratio ); + regHist(m_h_electron_fcal_eratio_looseLH, path, run).ignore(); + m_h_electron_fcal_eratio_mediumLH = TH2D_LW::create( "h_electron_fcal_eratio_mediumLH", "; FCal #Sigma E_{T} [TeV]; E_{ratio}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_eratio_nbins, m_low_eratio, m_high_eratio ); + regHist(m_h_electron_fcal_eratio_mediumLH, path, run).ignore(); + m_h_electron_fcal_eratio_tightLH = TH2D_LW::create( "h_electron_fcal_eratio_tightLH", "; FCal #Sigma E_{T} [TeV]; E_{ratio}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_eratio_nbins, m_low_eratio, m_high_eratio ); + regHist(m_h_electron_fcal_eratio_tightLH, path, run).ignore(); + + //E_ratio, side A centrality + m_h_electron_fcalA_eratio_looseLH = TH2D_LW::create( "h_electron_fcalA_eratio_looseLH", "; FCal A #Sigma E_{T} [TeV]; E_{ratio}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_eratio_nbins, m_low_eratio, m_high_eratio ); + regHist(m_h_electron_fcalA_eratio_looseLH, path, run).ignore(); + m_h_electron_fcalA_eratio_mediumLH = TH2D_LW::create( "h_electron_fcalA_eratio_mediumLH", "; FCal A #Sigma E_{T} [TeV]; E_{ratio}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_eratio_nbins, m_low_eratio, m_high_eratio ); + regHist(m_h_electron_fcalA_eratio_mediumLH, path, run).ignore(); + m_h_electron_fcalA_eratio_tightLH = TH2D_LW::create( "h_electron_fcalA_eratio_tightLH", "; FCal A #Sigma E_{T} [TeV]; E_{ratio}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_eratio_nbins, m_low_eratio, m_high_eratio ); + regHist(m_h_electron_fcalA_eratio_tightLH, path, run).ignore(); + + //E_ratio, side C centrality + m_h_electron_fcalC_eratio_looseLH = TH2D_LW::create( "h_electron_fcalC_eratio_looseLH", "; FCal C #Sigma E_{T} [TeV]; E_{ratio}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_eratio_nbins, m_low_eratio, m_high_eratio ); + regHist(m_h_electron_fcalC_eratio_looseLH, path, run).ignore(); + m_h_electron_fcalC_eratio_mediumLH = TH2D_LW::create( "h_electron_fcalC_eratio_mediumLH", "; FCal C #Sigma E_{T} [TeV]; E_{ratio}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_eratio_nbins, m_low_eratio, m_high_eratio ); + regHist(m_h_electron_fcalC_eratio_mediumLH, path, run).ignore(); + m_h_electron_fcalC_eratio_tightLH = TH2D_LW::create( "h_electron_fcalC_eratio_tightLH", "; FCal C #Sigma E_{T} [TeV]; E_{ratio}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_eratio_nbins, m_low_eratio, m_high_eratio ); + regHist(m_h_electron_fcalC_eratio_tightLH, path, run).ignore(); + + //f_1 + m_h_electron_fcal_f1_looseLH = TH2D_LW::create( "h_electron_fcal_f1_looseLH", "; FCal #Sigma E_{T} [TeV]; f_{1}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_f1_nbins, m_low_f1, m_high_f1 ); + regHist(m_h_electron_fcal_f1_looseLH, path, run).ignore(); + m_h_electron_fcal_f1_mediumLH = TH2D_LW::create( "h_electron_fcal_f1_mediumLH", "; FCal #Sigma E_{T} [TeV]; f_{1}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_f1_nbins, m_low_f1, m_high_f1 ); + regHist(m_h_electron_fcal_f1_mediumLH, path, run).ignore(); + m_h_electron_fcal_f1_tightLH = TH2D_LW::create( "h_electron_fcal_f1_tightLH", "; FCal #Sigma E_{T} [TeV]; f_{1}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_f1_nbins, m_low_f1, m_high_f1 ); + regHist(m_h_electron_fcal_f1_tightLH, path, run).ignore(); + + //f_1, side A centrality + m_h_electron_fcalA_f1_looseLH = TH2D_LW::create( "h_electron_fcalA_f1_looseLH", "; FCal A #Sigma E_{T} [TeV]; f_{1}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_f1_nbins, m_low_f1, m_high_f1 ); + regHist(m_h_electron_fcalA_f1_looseLH, path, run).ignore(); + m_h_electron_fcalA_f1_mediumLH = TH2D_LW::create( "h_electron_fcalA_f1_mediumLH", "; FCal A #Sigma E_{T} [TeV]; f_{1}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_f1_nbins, m_low_f1, m_high_f1 ); + regHist(m_h_electron_fcalA_f1_mediumLH, path, run).ignore(); + m_h_electron_fcalA_f1_tightLH = TH2D_LW::create( "h_electron_fcalA_f1_tightLH", "; FCal A #Sigma E_{T} [TeV]; f_{1}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_f1_nbins, m_low_f1, m_high_f1 ); + regHist(m_h_electron_fcalA_f1_tightLH, path, run).ignore(); + + //f_1, side C centrality + m_h_electron_fcalC_f1_looseLH = TH2D_LW::create( "h_electron_fcalC_f1_looseLH", "; FCal C #Sigma E_{T} [TeV]; f_{1}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_f1_nbins, m_low_f1, m_high_f1 ); + regHist(m_h_electron_fcalC_f1_looseLH, path, run).ignore(); + m_h_electron_fcalC_f1_mediumLH = TH2D_LW::create( "h_electron_fcalC_f1_mediumLH", "; FCal C #Sigma E_{T} [TeV]; f_{1}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_f1_nbins, m_low_f1, m_high_f1 ); + regHist(m_h_electron_fcalC_f1_mediumLH, path, run).ignore(); + m_h_electron_fcalC_f1_tightLH = TH2D_LW::create( "h_electron_fcalC_f1_tightLH", "; FCal C #Sigma E_{T} [TeV]; f_{1}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_f1_nbins, m_low_f1, m_high_f1 ); + regHist(m_h_electron_fcalC_f1_tightLH, path, run).ignore(); + + //f_3 + m_h_electron_fcal_f3_looseLH = TH2D_LW::create( "h_electron_fcal_f3_looseLH", "; FCal #Sigma E_{T} [TeV]; f_{3}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_f3_nbins, m_low_f3, m_high_f3 ); + regHist(m_h_electron_fcal_f3_looseLH, path, run).ignore(); + m_h_electron_fcal_f3_mediumLH = TH2D_LW::create( "h_electron_fcal_f3_mediumLH", "; FCal #Sigma E_{T} [TeV]; f_{3}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_f3_nbins, m_low_f3, m_high_f3 ); + regHist(m_h_electron_fcal_f3_mediumLH, path, run).ignore(); + m_h_electron_fcal_f3_tightLH = TH2D_LW::create( "h_electron_fcal_f3_tightLH", "; FCal #Sigma E_{T} [TeV]; f_{3}", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_f3_nbins, m_low_f3, m_high_f3 ); + regHist(m_h_electron_fcal_f3_tightLH, path, run).ignore(); + + //f_3, side A centrality + m_h_electron_fcalA_f3_looseLH = TH2D_LW::create( "h_electron_fcalA_f3_looseLH", "; FCal A #Sigma E_{T} [TeV]; f_{3}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_f3_nbins, m_low_f3, m_high_f3 ); + regHist(m_h_electron_fcalA_f3_looseLH, path, run).ignore(); + m_h_electron_fcalA_f3_mediumLH = TH2D_LW::create( "h_electron_fcalA_f3_mediumLH", "; FCal A #Sigma E_{T} [TeV]; f_{3}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_f3_nbins, m_low_f3, m_high_f3 ); + regHist(m_h_electron_fcalA_f3_mediumLH, path, run).ignore(); + m_h_electron_fcalA_f3_tightLH = TH2D_LW::create( "h_electron_fcalA_f3_tightLH", "; FCal A #Sigma E_{T} [TeV]; f_{3}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_f3_nbins, m_low_f3, m_high_f3 ); + regHist(m_h_electron_fcalA_f3_tightLH, path, run).ignore(); + + //f_3, side C centrality + m_h_electron_fcalC_f3_looseLH = TH2D_LW::create( "h_electron_fcalC_f3_looseLH", "; FCal C #Sigma E_{T} [TeV]; f_{3}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_f3_nbins, m_low_f3, m_high_f3 ); + regHist(m_h_electron_fcalC_f3_looseLH, path, run).ignore(); + m_h_electron_fcalC_f3_mediumLH = TH2D_LW::create( "h_electron_fcalC_f3_mediumLH", "; FCal C #Sigma E_{T} [TeV]; f_{3}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_f3_nbins, m_low_f3, m_high_f3 ); + regHist(m_h_electron_fcalC_f3_mediumLH, path, run).ignore(); + m_h_electron_fcalC_f3_tightLH = TH2D_LW::create( "h_electron_fcalC_f3_tightLH", "; FCal C #Sigma E_{T} [TeV]; f_{3}", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_f3_nbins, m_low_f3, m_high_f3 ); + regHist(m_h_electron_fcalC_f3_tightLH, path, run).ignore(); + + //delta_eta1 + m_h_electron_fcal_deltaeta1_looseLH = TH2D_LW::create( "h_electron_fcal_deltaeta1_looseLH", "; FCal #Sigma E_{T} [TeV]; #Delta#eta", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_deltaeta1_nbins, m_low_deltaeta1, m_high_deltaeta1 ); + regHist(m_h_electron_fcal_deltaeta1_looseLH, path, run).ignore(); + m_h_electron_fcal_deltaeta1_mediumLH = TH2D_LW::create( "h_electron_fcal_deltaeta1_mediumLH", "; FCal #Sigma E_{T} [TeV]; #Delta#eta", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_deltaeta1_nbins, m_low_deltaeta1, m_high_deltaeta1 ); + regHist(m_h_electron_fcal_deltaeta1_mediumLH, path, run).ignore(); + m_h_electron_fcal_deltaeta1_tightLH = TH2D_LW::create( "h_electron_fcal_deltaeta1_tightLH", "; FCal #Sigma E_{T} [TeV]; #Delta#eta", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_deltaeta1_nbins, m_low_deltaeta1, m_high_deltaeta1 ); + regHist(m_h_electron_fcal_deltaeta1_tightLH, path, run).ignore(); + + //delta_eta1, side A centrality + m_h_electron_fcalA_deltaeta1_looseLH = TH2D_LW::create( "h_electron_fcalA_deltaeta1_looseLH", "; FCal A #Sigma E_{T} [TeV]; #Delta#eta", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_deltaeta1_nbins, m_low_deltaeta1, m_high_deltaeta1 ); + regHist(m_h_electron_fcalA_deltaeta1_looseLH, path, run).ignore(); + m_h_electron_fcalA_deltaeta1_mediumLH = TH2D_LW::create( "h_electron_fcalA_deltaeta1_mediumLH", "; FCal A #Sigma E_{T} [TeV]; #Delta#eta", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_deltaeta1_nbins, m_low_deltaeta1, m_high_deltaeta1 ); + regHist(m_h_electron_fcalA_deltaeta1_mediumLH, path, run).ignore(); + m_h_electron_fcalA_deltaeta1_tightLH = TH2D_LW::create( "h_electron_fcalA_deltaeta1_tightLH", "; FCal A #Sigma E_{T} [TeV]; #Delta#eta", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_deltaeta1_nbins, m_low_deltaeta1, m_high_deltaeta1 ); + regHist(m_h_electron_fcalA_deltaeta1_tightLH, path, run).ignore(); + + //delta_eta1, side C centrality + m_h_electron_fcalC_deltaeta1_looseLH = TH2D_LW::create( "h_electron_fcalC_deltaeta1_looseLH", "; FCal C #Sigma E_{T} [TeV]; #Delta#eta", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_deltaeta1_nbins, m_low_deltaeta1, m_high_deltaeta1 ); + regHist(m_h_electron_fcalC_deltaeta1_looseLH, path, run).ignore(); + m_h_electron_fcalC_deltaeta1_mediumLH = TH2D_LW::create( "h_electron_fcalC_deltaeta1_mediumLH", "; FCal C #Sigma E_{T} [TeV]; #Delta#eta", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_deltaeta1_nbins, m_low_deltaeta1, m_high_deltaeta1 ); + regHist(m_h_electron_fcalC_deltaeta1_mediumLH, path, run).ignore(); + m_h_electron_fcalC_deltaeta1_tightLH = TH2D_LW::create( "h_electron_fcalC_deltaeta1_tightLH", "; FCal C #Sigma E_{T} [TeV]; #Delta#eta", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_deltaeta1_nbins, m_low_deltaeta1, m_high_deltaeta1 ); + regHist(m_h_electron_fcalC_deltaeta1_tightLH, path, run).ignore(); + + //delta_phi_rescaled + m_h_electron_fcal_deltaphires_looseLH = TH2D_LW::create( "h_electron_fcal_deltaphires_looseLH", "; FCal #Sigma E_{T} [TeV]; #Delta#phi rescaled", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_deltaphires_nbins, m_low_deltaphires, m_high_deltaphires ); + regHist(m_h_electron_fcal_deltaphires_looseLH, path, run).ignore(); + m_h_electron_fcal_deltaphires_mediumLH = TH2D_LW::create( "h_electron_fcal_deltaphires_mediumLH", "; FCal #Sigma E_{T} [TeV]; #Delta#phi rescaled", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_deltaphires_nbins, m_low_deltaphires, m_high_deltaphires ); + regHist(m_h_electron_fcal_deltaphires_mediumLH, path, run).ignore(); + m_h_electron_fcal_deltaphires_tightLH = TH2D_LW::create( "h_electron_fcal_deltaphires_tightLH", "; FCal #Sigma E_{T} [TeV]; #Delta#phi rescaled", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_deltaphires_nbins, m_low_deltaphires, m_high_deltaphires ); + regHist(m_h_electron_fcal_deltaphires_tightLH, path, run).ignore(); + + //delta_phi_rescaled, side A centrality + m_h_electron_fcalA_deltaphires_looseLH = TH2D_LW::create( "h_electron_fcalA_deltaphires_looseLH", "; FCal A #Sigma E_{T} [TeV]; #Delta#phi rescaled", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_deltaphires_nbins, m_low_deltaphires, m_high_deltaphires ); + regHist(m_h_electron_fcalA_deltaphires_looseLH, path, run).ignore(); + m_h_electron_fcalA_deltaphires_mediumLH = TH2D_LW::create( "h_electron_fcalA_deltaphires_mediumLH", "; FCal A #Sigma E_{T} [TeV]; #Delta#phi rescaled", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_deltaphires_nbins, m_low_deltaphires, m_high_deltaphires ); + regHist(m_h_electron_fcalA_deltaphires_mediumLH, path, run).ignore(); + m_h_electron_fcalA_deltaphires_tightLH = TH2D_LW::create( "h_electron_fcalA_deltaphires_tightLH", "; FCal A #Sigma E_{T} [TeV]; #Delta#phi rescaled", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_deltaphires_nbins, m_low_deltaphires, m_high_deltaphires ); + regHist(m_h_electron_fcalA_deltaphires_tightLH, path, run).ignore(); + + //delta_phi_rescaled, side C centrality + m_h_electron_fcalC_deltaphires_looseLH = TH2D_LW::create( "h_electron_fcalC_deltaphires_looseLH", "; FCal C #Sigma E_{T} [TeV]; #Delta#phi rescaled", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_deltaphires_nbins, m_low_deltaphires, m_high_deltaphires ); + regHist(m_h_electron_fcalC_deltaphires_looseLH, path, run).ignore(); + m_h_electron_fcalC_deltaphires_mediumLH = TH2D_LW::create( "h_electron_fcalC_deltaphires_mediumLH", "; FCal C #Sigma E_{T} [TeV]; #Delta#phi rescaled", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_deltaphires_nbins, m_low_deltaphires, m_high_deltaphires ); + regHist(m_h_electron_fcalC_deltaphires_mediumLH, path, run).ignore(); + m_h_electron_fcalC_deltaphires_tightLH = TH2D_LW::create( "h_electron_fcalC_deltaphires_tightLH", "; FCal C #Sigma E_{T} [TeV]; #Delta#phi rescaled", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_deltaphires_nbins, m_low_deltaphires, m_high_deltaphires ); + regHist(m_h_electron_fcalC_deltaphires_tightLH, path, run).ignore(); + + //e_probability_HT + m_h_electron_fcal_eprobabilityht_looseLH = TH2D_LW::create( "h_electron_fcal_eprobabilityht_looseLH", "; FCal #Sigma E_{T} [TeV]; eProbabilityHT", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_eprobabilityht_nbins, m_low_eprobabilityht, m_high_eprobabilityht ); + regHist(m_h_electron_fcal_eprobabilityht_looseLH, path, run).ignore(); + m_h_electron_fcal_eprobabilityht_mediumLH = TH2D_LW::create( "h_electron_fcal_eprobabilityht_mediumLH", "; FCal #Sigma E_{T} [TeV]; eProbabilityHT", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_eprobabilityht_nbins, m_low_eprobabilityht, m_high_eprobabilityht ); + regHist(m_h_electron_fcal_eprobabilityht_mediumLH, path, run).ignore(); + m_h_electron_fcal_eprobabilityht_tightLH = TH2D_LW::create( "h_electron_fcal_eprobabilityht_tightLH", "; FCal #Sigma E_{T} [TeV]; eProbabilityHT", m_FCalEt_nbins, m_low_FCalEt, m_high_FCalEt, m_eprobabilityht_nbins, m_low_eprobabilityht, m_high_eprobabilityht ); + regHist(m_h_electron_fcal_eprobabilityht_tightLH, path, run).ignore(); + + //e_probability_HT, side A centrality + m_h_electron_fcalA_eprobabilityht_looseLH = TH2D_LW::create( "h_electron_fcalA_eprobabilityht_looseLH", "; FCal A #Sigma E_{T} [TeV]; eProbabilityHT", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_eprobabilityht_nbins, m_low_eprobabilityht, m_high_eprobabilityht ); + regHist(m_h_electron_fcalA_eprobabilityht_looseLH, path, run).ignore(); + m_h_electron_fcalA_eprobabilityht_mediumLH = TH2D_LW::create( "h_electron_fcalA_eprobabilityht_mediumLH", "; FCal A #Sigma E_{T} [TeV]; eProbabilityHT", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_eprobabilityht_nbins, m_low_eprobabilityht, m_high_eprobabilityht ); + regHist(m_h_electron_fcalA_eprobabilityht_mediumLH, path, run).ignore(); + m_h_electron_fcalA_eprobabilityht_tightLH = TH2D_LW::create( "h_electron_fcalA_eprobabilityht_tightLH", "; FCal A #Sigma E_{T} [TeV]; eProbabilityHT", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_eprobabilityht_nbins, m_low_eprobabilityht, m_high_eprobabilityht ); + regHist(m_h_electron_fcalA_eprobabilityht_tightLH, path, run).ignore(); + + //e_probability_HT, side C centrality + m_h_electron_fcalC_eprobabilityht_looseLH = TH2D_LW::create( "h_electron_fcalC_eprobabilityht_looseLH", "; FCal C #Sigma E_{T} [TeV]; eProbabilityHT", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_eprobabilityht_nbins, m_low_eprobabilityht, m_high_eprobabilityht ); + regHist(m_h_electron_fcalC_eprobabilityht_looseLH, path, run).ignore(); + m_h_electron_fcalC_eprobabilityht_mediumLH = TH2D_LW::create( "h_electron_fcalC_eprobabilityht_mediumLH", "; FCal C #Sigma E_{T} [TeV]; eProbabilityHT", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_eprobabilityht_nbins, m_low_eprobabilityht, m_high_eprobabilityht ); + regHist(m_h_electron_fcalC_eprobabilityht_mediumLH, path, run).ignore(); + m_h_electron_fcalC_eprobabilityht_tightLH = TH2D_LW::create( "h_electron_fcalC_eprobabilityht_tightLH", "; FCal C #Sigma E_{T} [TeV]; eProbabilityHT", m_FCalEt_oneSide_nbins, m_low_FCalEt_oneSide, m_high_FCalEt_oneSide, m_eprobabilityht_nbins, m_low_eprobabilityht, m_high_eprobabilityht ); + regHist(m_h_electron_fcalC_eprobabilityht_tightLH, path, run).ignore(); +} diff --git a/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringPhotonsTool.cxx b/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringPhotonsTool.cxx index 43df01ede1a4a7c9dd6ec9b12312a8da494db33c..d625cc899cceccd52fee2f79f25fc777a9b70ffa 100755 --- a/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringPhotonsTool.cxx +++ b/Reconstruction/HeavyIonRec/HIMonitoring/src/HIMonitoringPhotonsTool.cxx @@ -2,631 +2,632 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -#include <sstream> - -#include "GaudiKernel/IJobOptionsSvc.h" -#include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/StatusCode.h" - -#include "AthenaMonitoring/AthenaMonManager.h" -#include "HIMonitoring/HIMonitoringPhotonsTool.h" - -//#include "LWHists/TH1D_LW.h" -#include "LWHists/TH2D_LW.h" -#include "LWHists/TProfile_LW.h" - -HIMonitoringPhotonsTool:: -HIMonitoringPhotonsTool( const std::string & type, const std::string & name, -const IInterface* parent ): ManagedMonitorToolBase( type, name, parent ) -{ - m_FCalEt=0; - - m_FCalEt_nbins = 50; - m_FCalEt_low = -50; - m_FCalEt_high = 200; - - m_PhotonPt_nbins = 50; - m_PhotonPt_low = 0; - m_PhotonPt_high = 500; - - m_PhotonEta_nbins = 60; - m_PhotonEta_low = -3; - m_PhotonEta_high = +3; - - m_PhotonPhi_nbins = 64; - m_PhotonPhi_low = -3.14159; - m_PhotonPhi_high = +3.14159; - - m_IsoWide_nbins = 100; - m_IsoWide_low = -50.0; - m_IsoWide_high = 50.0; - - m_IsoNarrow_nbins = 60; - m_IsoNarrow_low = -30.0; - m_IsoNarrow_high = 30.0; - - m_reta_nbins = 50; - m_reta_low = 0.70; - m_reta_high = 1.1; - - m_rphi_nbins = 50; - m_rphi_low = 0.60; - m_rphi_high = 1.1; - - m_weta2_nbins = 50; - m_weta2_low = 0.005; - m_weta2_high = 0.015; - - m_rhad_nbins = 50; - m_rhad_low = -0.3; - m_rhad_high = +0.3; - - m_wtots1_nbins = 50; - m_wtots1_low = 0; - m_wtots1_high = 6; - - m_fracs1_nbins = 50; - m_fracs1_low = -0.1; - m_fracs1_high = 1.2; - - m_deltae_nbins = 50; - m_deltae_low = -0.1; - m_deltae_high = 1.5; - - m_eratio_nbins = 50; - m_eratio_low = -0.1; - m_eratio_high = 1.1; - - m_f1_nbins = 50; - m_f1_low = -0.05; - m_f1_high = 0.60; - - m_photonLooseIsEMSelector = new AsgPhotonIsEMSelector ( "PhotonLooseIsEMSelector" ); - m_photonLooseIsEMSelector->setProperty("isEMMask",egammaPID::PhotonLoose); - m_photonLooseIsEMSelector->setProperty("ConfigFile","ElectronPhotonSelectorTools/offline/mc15_20150712/PhotonIsEMLooseSelectorCutDefs.conf"); - if (!m_photonLooseIsEMSelector->initialize().isSuccess()) { - Fatal("MyFunction", "Failed to initialize PhotonLooseIsEMSelector "); - } - - m_photonTightIsEMSelector = new AsgPhotonIsEMSelector ( "PhotonTightIsEMSelector" ); - m_photonTightIsEMSelector->setProperty("isEMMask",egammaPID::PhotonTight); - m_photonTightIsEMSelector->setProperty("ConfigFile","ElectronPhotonSelectorTools/offline/mc15_20150712/PhotonIsEMTightSelectorCutDefs.conf"); - if (!m_photonTightIsEMSelector->initialize().isSuccess()) { - Fatal("MyFunction", "Failed to initialize PhotonTightIsEMSelector "); - } - -} - - -HIMonitoringPhotonsTool::~HIMonitoringPhotonsTool() -{ -} - -// Description: Used for rebooking unmanaged histograms -StatusCode HIMonitoringPhotonsTool::bookHistogramsRecurrent( ) -{ - return StatusCode::SUCCESS; -} - - -// Description: Used for re-booking managed histograms -StatusCode HIMonitoringPhotonsTool::bookHistograms( ) -{ - if( m_environment == AthenaMonManager::online ) { - // book histograms that are only made in the online environment... - } - - if( m_dataType == AthenaMonManager::cosmics ) { - // book histograms that are only relevant for cosmics data... - } - - book_hist(); - - - return StatusCode::SUCCESS; -} - - -StatusCode HIMonitoringPhotonsTool::fillHistograms() -{ - StatusCode sc; - - /// HI event shape - const xAOD::HIEventShapeContainer* evtShape; - sc = evtStore()->retrieve(evtShape, "HIEventShape"); - if (sc.isFailure()) - { - ATH_MSG_ERROR("Could not find HIEventShape"); - return StatusCode::FAILURE; - } - else - { - ATH_MSG_INFO("HIEventShape retrieved from StoreGate"); - } - - int size=evtShape->size(); - for(int i=0;i<size;i++) - { - const xAOD::HIEventShape *sh=evtShape->at(i); - if(sh->layer()==21 || sh->layer()==22 || sh->layer()==23) - { - m_FCalEt += sh->et(); - } - } - - m_FCalEt = m_FCalEt * 1e-3; - - - const xAOD::PhotonContainer* photons = 0; - sc = evtStore()->retrieve( photons, "Photons" ); - if (sc.isFailure()) { - ATH_MSG_ERROR("Could not find Photons"); - return StatusCode::FAILURE; - } - else { - ATH_MSG_INFO("Photons retrieved from StoreGate"); - } - - xAOD::PhotonContainer::const_iterator photons_itr = photons->begin(); - xAOD::PhotonContainer::const_iterator photons_end = photons->end(); - - for( ; photons_itr != photons_end; ++photons_itr ) - { - - float pt = (*photons_itr)->pt() * 1e-3; - float eta = (*photons_itr)->caloCluster()->etaBE(2); - float phi = (*photons_itr)->phi(); - - m_h_photon_pt_eta->Fill( pt, eta ); - m_h_photon_pt_phi->Fill( pt, phi ); - m_h_photon_pt_fcal->Fill( pt, phi ); - - bool loose_MC15 = m_photonLooseIsEMSelector->accept(*photons_itr); - bool tight_MC15 = m_photonTightIsEMSelector->accept(*photons_itr); - - if (tight_MC15) { - - m_h_photon_pt_eta_tight->Fill( pt, eta ); - m_h_photon_pt_phi_tight->Fill( pt, phi ); - m_h_photon_pt_fcal_tight->Fill( pt, phi ); - - } - - if (pt < 20) continue; - - m_h_photon_eta_phi_ptCut->Fill( eta, phi ); - - if (tight_MC15) { - - m_h_photon_eta_phi_ptCut_tight->Fill( eta, phi ); - - } - - float etcone20 = (*photons_itr)->auxdata< float >("etcone20") * 1e-3; - float etcone30 = (*photons_itr)->auxdata< float >("etcone30") * 1e-3; - float etcone40 = (*photons_itr)->auxdata< float >("etcone40") * 1e-3; - - m_h_photon_fcal_etcone20_ptCut->Fill( m_FCalEt, etcone20 ); - m_h_photon_fcal_etcone30_ptCut->Fill( m_FCalEt, etcone30 ); - m_h_photon_fcal_etcone40_ptCut->Fill( m_FCalEt, etcone40 ); - - if (m_FCalEt < 20) { - m_h_photon_pt_etcone40_fcal0->Fill( pt, etcone40 ); - - m_h_photon_etcone20_ptCut_fcal0->Fill( etcone20 ); - m_h_photon_etcone30_ptCut_fcal0->Fill( etcone30 ); - m_h_photon_etcone40_ptCut_fcal0->Fill( etcone40 ); - - m_h_photon_etcone30_ptCut_fcal0_all->Fill( etcone30 ); - if (loose_MC15) m_h_photon_etcone30_ptCut_fcal0_loose->Fill( etcone30 ); - if (tight_MC15) m_h_photon_etcone30_ptCut_fcal0_tight->Fill( etcone30 ); - } - if (m_FCalEt > 20 && m_FCalEt < 50) { - m_h_photon_pt_etcone40_fcal1->Fill( pt, etcone40 ); - - m_h_photon_etcone20_ptCut_fcal1->Fill( etcone20 ); - m_h_photon_etcone30_ptCut_fcal1->Fill( etcone30 ); - m_h_photon_etcone40_ptCut_fcal1->Fill( etcone40 ); - - m_h_photon_etcone30_ptCut_fcal1_all->Fill( etcone30 ); - if (loose_MC15) m_h_photon_etcone30_ptCut_fcal1_loose->Fill( etcone30 ); - if (tight_MC15) m_h_photon_etcone30_ptCut_fcal1_tight->Fill( etcone30 ); - } - if (m_FCalEt > 50) { - m_h_photon_pt_etcone40_fcal2->Fill( pt, etcone40 ); - - m_h_photon_etcone20_ptCut_fcal2->Fill( etcone20 ); - m_h_photon_etcone30_ptCut_fcal2->Fill( etcone30 ); - m_h_photon_etcone40_ptCut_fcal2->Fill( etcone40 ); - - m_h_photon_etcone30_ptCut_fcal2_all->Fill( etcone30 ); - if (loose_MC15) m_h_photon_etcone30_ptCut_fcal2_loose->Fill( etcone30 ); - if (tight_MC15) m_h_photon_etcone30_ptCut_fcal2_tight->Fill( etcone30 ); - } - - float reta = (*photons_itr)->auxdata< float >("Reta"); - float rphi = (*photons_itr)->auxdata< float >("Rphi"); - float weta2 = (*photons_itr)->auxdata< float >("weta2"); - - float rhad = (*photons_itr)->auxdata< float >("Rhad"); - float rhad1 = (*photons_itr)->auxdata< float >("Rhad1"); - float wtots1 = (*photons_itr)->auxdata< float >("wtots1"); - float fracs1 = (*photons_itr)->auxdata< float >("fracs1"); - - float deltae = (*photons_itr)->auxdata< float >("DeltaE") * 1e-3; - float eratio = (*photons_itr)->auxdata< float >("Eratio"); - float f1 = (*photons_itr)->auxdata< float >("f1"); - - if (fabs(eta) < 1.37) { - m_h_photon_reta_fcal_ptCut_eta0->Fill( m_FCalEt, reta ); - m_h_photon_rphi_fcal_ptCut_eta0->Fill( m_FCalEt, rphi ); - m_h_photon_weta2_fcal_ptCut_eta0->Fill( m_FCalEt, weta2 ); - m_h_photon_rhad_fcal_ptCut_eta0->Fill( m_FCalEt, rhad ); - m_h_photon_wtots1_fcal_ptCut_eta0->Fill( m_FCalEt, wtots1 ); - m_h_photon_fracs1_fcal_ptCut_eta0->Fill( m_FCalEt, fracs1 ); - m_h_photon_deltae_fcal_ptCut_eta0->Fill( m_FCalEt, deltae ); - m_h_photon_eratio_fcal_ptCut_eta0->Fill( m_FCalEt, eratio ); - m_h_photon_f1_fcal_ptCut_eta0->Fill( m_FCalEt, f1 ); - } - if (fabs(eta) > 1.52) { - m_h_photon_reta_fcal_ptCut_eta1->Fill( m_FCalEt, reta ); - m_h_photon_rphi_fcal_ptCut_eta1->Fill( m_FCalEt, rphi ); - m_h_photon_weta2_fcal_ptCut_eta1->Fill( m_FCalEt, weta2 ); - m_h_photon_rhad_fcal_ptCut_eta1->Fill( m_FCalEt, rhad1 ); - m_h_photon_wtots1_fcal_ptCut_eta1->Fill( m_FCalEt, wtots1 ); - m_h_photon_fracs1_fcal_ptCut_eta1->Fill( m_FCalEt, fracs1 ); - m_h_photon_deltae_fcal_ptCut_eta1->Fill( m_FCalEt, deltae ); - m_h_photon_eratio_fcal_ptCut_eta1->Fill( m_FCalEt, eratio ); - m_h_photon_f1_fcal_ptCut_eta1->Fill( m_FCalEt, f1 ); - } - - m_h_photon_reta_ptCut_all->Fill( reta ); - m_h_photon_rphi_ptCut_all->Fill( rphi ); - m_h_photon_weta2_ptCut_all->Fill( weta2 ); - m_h_photon_rhad_ptCut_all->Fill( rhad ); - m_h_photon_wtots1_ptCut_all->Fill( wtots1 ); - m_h_photon_fracs1_ptCut_all->Fill( fracs1 ); - m_h_photon_deltae_ptCut_all->Fill( deltae ); - m_h_photon_eratio_ptCut_all->Fill( eratio ); - m_h_photon_f1_ptCut_all->Fill( f1 ); - if (loose_MC15) { - m_h_photon_reta_ptCut_loose->Fill( reta ); - m_h_photon_rphi_ptCut_loose->Fill( rphi ); - m_h_photon_weta2_ptCut_loose->Fill( weta2 ); - m_h_photon_rhad_ptCut_loose->Fill( rhad ); - m_h_photon_wtots1_ptCut_loose->Fill( wtots1 ); - m_h_photon_fracs1_ptCut_loose->Fill( fracs1 ); - m_h_photon_deltae_ptCut_loose->Fill( deltae ); - m_h_photon_eratio_ptCut_loose->Fill( eratio ); - m_h_photon_f1_ptCut_loose->Fill( f1 ); - } - if (tight_MC15) { - m_h_photon_reta_ptCut_tight->Fill( reta ); - m_h_photon_rphi_ptCut_tight->Fill( rphi ); - m_h_photon_weta2_ptCut_tight->Fill( weta2 ); - m_h_photon_rhad_ptCut_tight->Fill( rhad ); - m_h_photon_wtots1_ptCut_tight->Fill( wtots1 ); - m_h_photon_fracs1_ptCut_tight->Fill( fracs1 ); - m_h_photon_deltae_ptCut_tight->Fill( deltae ); - m_h_photon_eratio_ptCut_tight->Fill( eratio ); - m_h_photon_f1_ptCut_tight->Fill( f1 ); - } - - m_h_photon_reta_eta_ptCut->Fill( eta, reta ); - m_h_photon_rphi_eta_ptCut->Fill( eta, rphi ); - m_h_photon_weta2_eta_ptCut->Fill( eta, weta2 ); - - if ( fabs(eta) < 1.52) m_h_photon_rhad_eta_ptCut->Fill( eta, rhad ); - else m_h_photon_rhad_eta_ptCut->Fill( eta, rhad1 ); - m_h_photon_wtots1_eta_ptCut->Fill( eta, wtots1 ); - m_h_photon_fracs1_eta_ptCut->Fill( eta, fracs1 ); - - m_h_photon_deltae_eta_ptCut->Fill( eta, deltae ); - m_h_photon_eratio_eta_ptCut->Fill( eta, eratio ); - m_h_photon_f1_eta_ptCut->Fill( eta, f1 ); - } - - return StatusCode::SUCCESS; -} - - -StatusCode HIMonitoringPhotonsTool::procHistograms( ) -{ - - //if( endOfLowStatFlag() || endOfLumiBlockFlag() ) { } - - - if( endOfRunFlag() ) - { - if(m_h_photon_reta_ptCut_all->GetEntries() > 0) m_h_photon_reta_ptCut_all->Scale(1./m_h_photon_reta_ptCut_all->GetEntries()); - if(m_h_photon_reta_ptCut_loose->GetEntries() > 0) m_h_photon_reta_ptCut_loose->Scale(1./m_h_photon_reta_ptCut_loose->GetEntries()); - if(m_h_photon_reta_ptCut_tight->GetEntries() > 0) m_h_photon_reta_ptCut_tight->Scale(1./m_h_photon_reta_ptCut_tight->GetEntries()); - if(m_h_photon_rphi_ptCut_all->GetEntries() > 0) m_h_photon_rphi_ptCut_all->Scale(1./m_h_photon_rphi_ptCut_all->GetEntries()); - if(m_h_photon_rphi_ptCut_loose->GetEntries() > 0) m_h_photon_rphi_ptCut_loose->Scale(1./m_h_photon_rphi_ptCut_loose->GetEntries()); - if(m_h_photon_rphi_ptCut_tight->GetEntries() > 0) m_h_photon_rphi_ptCut_tight->Scale(1./m_h_photon_rphi_ptCut_tight->GetEntries()); - if(m_h_photon_weta2_ptCut_all->GetEntries() > 0) m_h_photon_weta2_ptCut_all->Scale(1./m_h_photon_weta2_ptCut_all->GetEntries()); - if(m_h_photon_weta2_ptCut_loose->GetEntries() > 0) m_h_photon_weta2_ptCut_loose->Scale(1./m_h_photon_weta2_ptCut_loose->GetEntries()); - if(m_h_photon_weta2_ptCut_tight->GetEntries() > 0) m_h_photon_weta2_ptCut_tight->Scale(1./m_h_photon_weta2_ptCut_tight->GetEntries()); - if(m_h_photon_rhad_ptCut_all->GetEntries() > 0) m_h_photon_rhad_ptCut_all->Scale(1./m_h_photon_rhad_ptCut_all->GetEntries()); - if(m_h_photon_rhad_ptCut_loose->GetEntries() > 0) m_h_photon_rhad_ptCut_loose->Scale(1./m_h_photon_rhad_ptCut_loose->GetEntries()); - if(m_h_photon_rhad_ptCut_tight->GetEntries() > 0) m_h_photon_rhad_ptCut_tight->Scale(1./m_h_photon_rhad_ptCut_tight->GetEntries()); - if(m_h_photon_wtots1_ptCut_all->GetEntries() > 0) m_h_photon_wtots1_ptCut_all->Scale(1./m_h_photon_wtots1_ptCut_all->GetEntries()); - if(m_h_photon_wtots1_ptCut_loose->GetEntries() > 0) m_h_photon_wtots1_ptCut_loose->Scale(1./m_h_photon_wtots1_ptCut_loose->GetEntries()); - if(m_h_photon_wtots1_ptCut_tight->GetEntries() > 0) m_h_photon_wtots1_ptCut_tight->Scale(1./m_h_photon_wtots1_ptCut_tight->GetEntries()); - if(m_h_photon_fracs1_ptCut_all->GetEntries() > 0) m_h_photon_fracs1_ptCut_all->Scale(1./m_h_photon_fracs1_ptCut_all->GetEntries()); - if(m_h_photon_fracs1_ptCut_loose->GetEntries() > 0) m_h_photon_fracs1_ptCut_loose->Scale(1./m_h_photon_fracs1_ptCut_loose->GetEntries()); - if(m_h_photon_fracs1_ptCut_tight->GetEntries() > 0) m_h_photon_fracs1_ptCut_tight->Scale(1./m_h_photon_fracs1_ptCut_tight->GetEntries()); - if(m_h_photon_deltae_ptCut_all->GetEntries() > 0) m_h_photon_deltae_ptCut_all->Scale(1./m_h_photon_deltae_ptCut_all->GetEntries()); - if(m_h_photon_deltae_ptCut_loose->GetEntries() > 0) m_h_photon_deltae_ptCut_loose->Scale(1./m_h_photon_deltae_ptCut_loose->GetEntries()); - if(m_h_photon_deltae_ptCut_tight->GetEntries() > 0) m_h_photon_deltae_ptCut_tight->Scale(1./m_h_photon_deltae_ptCut_tight->GetEntries()); - if(m_h_photon_eratio_ptCut_all->GetEntries() > 0) m_h_photon_eratio_ptCut_all->Scale(1./m_h_photon_eratio_ptCut_all->GetEntries()); - if(m_h_photon_eratio_ptCut_loose->GetEntries() > 0) m_h_photon_eratio_ptCut_loose->Scale(1./m_h_photon_eratio_ptCut_loose->GetEntries()); - if(m_h_photon_eratio_ptCut_tight->GetEntries() > 0) m_h_photon_eratio_ptCut_tight->Scale(1./m_h_photon_eratio_ptCut_tight->GetEntries()); - if(m_h_photon_f1_ptCut_all->GetEntries() > 0) m_h_photon_f1_ptCut_all->Scale(1./m_h_photon_f1_ptCut_all->GetEntries()); - if(m_h_photon_f1_ptCut_loose->GetEntries() > 0) m_h_photon_f1_ptCut_loose->Scale(1./m_h_photon_f1_ptCut_loose->GetEntries()); - if(m_h_photon_f1_ptCut_tight->GetEntries() > 0) m_h_photon_f1_ptCut_tight->Scale(1./m_h_photon_f1_ptCut_tight->GetEntries()); - if(m_h_photon_etcone20_ptCut_fcal0->GetEntries() > 0) m_h_photon_etcone20_ptCut_fcal0->Scale(1./m_h_photon_etcone20_ptCut_fcal0->GetEntries()); - if(m_h_photon_etcone20_ptCut_fcal1->GetEntries() > 0) m_h_photon_etcone20_ptCut_fcal1->Scale(1./m_h_photon_etcone20_ptCut_fcal1->GetEntries()); - if(m_h_photon_etcone20_ptCut_fcal2->GetEntries() > 0) m_h_photon_etcone20_ptCut_fcal2->Scale(1./m_h_photon_etcone20_ptCut_fcal2->GetEntries()); - if(m_h_photon_etcone30_ptCut_fcal0->GetEntries() > 0) m_h_photon_etcone30_ptCut_fcal0->Scale(1./m_h_photon_etcone30_ptCut_fcal0->GetEntries()); - if(m_h_photon_etcone30_ptCut_fcal1->GetEntries() > 0) m_h_photon_etcone30_ptCut_fcal1->Scale(1./m_h_photon_etcone30_ptCut_fcal1->GetEntries()); - if(m_h_photon_etcone30_ptCut_fcal2->GetEntries() > 0) m_h_photon_etcone30_ptCut_fcal2->Scale(1./m_h_photon_etcone30_ptCut_fcal2->GetEntries()); - if(m_h_photon_etcone40_ptCut_fcal0->GetEntries() > 0) m_h_photon_etcone40_ptCut_fcal0->Scale(1./m_h_photon_etcone40_ptCut_fcal0->GetEntries()); - if(m_h_photon_etcone40_ptCut_fcal1->GetEntries() > 0) m_h_photon_etcone40_ptCut_fcal1->Scale(1./m_h_photon_etcone40_ptCut_fcal1->GetEntries()); - if(m_h_photon_etcone40_ptCut_fcal2->GetEntries() > 0) m_h_photon_etcone40_ptCut_fcal2->Scale(1./m_h_photon_etcone40_ptCut_fcal2->GetEntries()); - if(m_h_photon_etcone30_ptCut_fcal0_all->GetEntries() > 0) m_h_photon_etcone30_ptCut_fcal0_all->Scale(1./m_h_photon_etcone30_ptCut_fcal0_all->GetEntries()); - if(m_h_photon_etcone30_ptCut_fcal0_loose->GetEntries() > 0) m_h_photon_etcone30_ptCut_fcal0_loose->Scale(1./m_h_photon_etcone30_ptCut_fcal0_loose->GetEntries()); - if(m_h_photon_etcone30_ptCut_fcal0_tight->GetEntries() > 0) m_h_photon_etcone30_ptCut_fcal0_tight->Scale(1./m_h_photon_etcone30_ptCut_fcal0_tight->GetEntries()); - if(m_h_photon_etcone30_ptCut_fcal1_all->GetEntries() > 0) m_h_photon_etcone30_ptCut_fcal1_all->Scale(1./m_h_photon_etcone30_ptCut_fcal1_all->GetEntries()); - if(m_h_photon_etcone30_ptCut_fcal1_loose->GetEntries() > 0) m_h_photon_etcone30_ptCut_fcal1_loose->Scale(1./m_h_photon_etcone30_ptCut_fcal1_loose->GetEntries()); - if(m_h_photon_etcone30_ptCut_fcal1_tight->GetEntries() > 0) m_h_photon_etcone30_ptCut_fcal1_tight->Scale(1./m_h_photon_etcone30_ptCut_fcal1_tight->GetEntries()); - if(m_h_photon_etcone30_ptCut_fcal2_all->GetEntries() > 0) m_h_photon_etcone30_ptCut_fcal2_all->Scale(1./m_h_photon_etcone30_ptCut_fcal2_all->GetEntries()); - if(m_h_photon_etcone30_ptCut_fcal2_loose->GetEntries() > 0) m_h_photon_etcone30_ptCut_fcal2_loose->Scale(1./m_h_photon_etcone30_ptCut_fcal2_loose->GetEntries()); - if(m_h_photon_etcone30_ptCut_fcal2_tight->GetEntries() > 0) m_h_photon_etcone30_ptCut_fcal2_tight->Scale(1./m_h_photon_etcone30_ptCut_fcal2_tight->GetEntries()); - } - - return StatusCode::SUCCESS; -} - - -/// *** FCal sum Et *** /// -void HIMonitoringPhotonsTool::book_hist() -{ - std::string path0 = "HeavyIon/Photons/Basic"; - - m_h_photon_pt_eta = TH2D_LW::create( "h_photon_pt_eta", "; photon pT; photon eta", m_PhotonPt_nbins, m_PhotonPt_low, m_PhotonPt_high, m_PhotonEta_nbins, m_PhotonEta_low, m_PhotonEta_high ); - regHist(m_h_photon_pt_eta, path0, run).ignore(); - - m_h_photon_pt_phi = TH2D_LW::create( "h_photon_pt_phi", "; photon pT; photon phi", m_PhotonPt_nbins, m_PhotonPt_low, m_PhotonPt_high, m_PhotonPhi_nbins, m_PhotonPhi_low, m_PhotonPhi_high ); - regHist(m_h_photon_pt_phi, path0, run).ignore(); - - m_h_photon_pt_fcal = TH2D_LW::create( "h_photon_pt_fcal", "; photon pT; FCal SumET", m_PhotonPt_nbins, m_PhotonPt_low, m_PhotonPt_high, m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high ); - regHist(m_h_photon_pt_fcal, path0, run).ignore(); - - m_h_photon_eta_phi_ptCut = TH2D_LW::create( "h_photon_eta_phi_ptCut", "; photon eta; photon phi", m_PhotonEta_nbins, m_PhotonEta_low, m_PhotonEta_high, m_PhotonPhi_nbins, m_PhotonPhi_low, m_PhotonPhi_high ); - regHist(m_h_photon_eta_phi_ptCut, path0, run).ignore(); - - // tight versions - m_h_photon_pt_eta_tight = TH2D_LW::create( "h_photon_pt_eta_tight", "; photon pT; photon eta", m_PhotonPt_nbins, m_PhotonPt_low, m_PhotonPt_high, m_PhotonEta_nbins, m_PhotonEta_low, m_PhotonEta_high ); - regHist(m_h_photon_pt_eta_tight, path0, run).ignore(); - - m_h_photon_pt_phi_tight = TH2D_LW::create( "h_photon_pt_phi_tight", "; photon pT; photon phi", m_PhotonPt_nbins, m_PhotonPt_low, m_PhotonPt_high, m_PhotonPhi_nbins, m_PhotonPhi_low, m_PhotonPhi_high ); - regHist(m_h_photon_pt_phi_tight, path0, run).ignore(); - - m_h_photon_pt_fcal_tight = TH2D_LW::create( "h_photon_pt_fcal_tight", "; photon pT; FCal SumET", m_PhotonPt_nbins, m_PhotonPt_low, m_PhotonPt_high, m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high ); - regHist(m_h_photon_pt_fcal_tight, path0, run).ignore(); - - m_h_photon_eta_phi_ptCut_tight = TH2D_LW::create( "h_photon_eta_phi_ptCut_tight", "; photon eta; photon phi", m_PhotonEta_nbins, m_PhotonEta_low, m_PhotonEta_high, m_PhotonPhi_nbins, m_PhotonPhi_low, m_PhotonPhi_high ); - regHist(m_h_photon_eta_phi_ptCut_tight, path0, run).ignore(); - - std::string path1 = "HeavyIon/Photons/ShowerShapes"; - - // 1-D vs. ID cuts - - m_h_photon_reta_ptCut_all = new TH1D( "h_photon_reta_ptCut_all", "; photon reta ; ", m_reta_nbins, m_reta_low, m_reta_high ); - regHist( m_h_photon_reta_ptCut_all, path1, run).ignore(); - m_h_photon_reta_ptCut_loose = new TH1D( "h_photon_reta_ptCut_loose", "; photon reta ; ", m_reta_nbins, m_reta_low, m_reta_high ); - regHist( m_h_photon_reta_ptCut_loose, path1, run).ignore(); - m_h_photon_reta_ptCut_tight = new TH1D( "h_photon_reta_ptCut_tight", "; photon reta ; ", m_reta_nbins, m_reta_low, m_reta_high ); - regHist( m_h_photon_reta_ptCut_tight, path1, run).ignore(); - - m_h_photon_rphi_ptCut_all = new TH1D( "h_photon_rphi_ptCut_all", "; photon rphi ; ", m_rphi_nbins, m_rphi_low, m_rphi_high ); - regHist( m_h_photon_rphi_ptCut_all, path1, run).ignore(); - m_h_photon_rphi_ptCut_loose = new TH1D( "h_photon_rphi_ptCut_loose", "; photon rphi ; ", m_rphi_nbins, m_rphi_low, m_rphi_high ); - regHist( m_h_photon_rphi_ptCut_loose, path1, run).ignore(); - m_h_photon_rphi_ptCut_tight = new TH1D( "h_photon_rphi_ptCut_tight", "; photon rphi ; ", m_rphi_nbins, m_rphi_low, m_rphi_high ); - regHist( m_h_photon_rphi_ptCut_tight, path1, run).ignore(); - - m_h_photon_weta2_ptCut_all = new TH1D( "h_photon_weta2_ptCut_all", "; photon weta2 ; ", m_weta2_nbins, m_weta2_low, m_weta2_high ); - regHist( m_h_photon_weta2_ptCut_all, path1, run).ignore(); - m_h_photon_weta2_ptCut_loose = new TH1D( "h_photon_weta2_ptCut_loose", "; photon weta2 ; ", m_weta2_nbins, m_weta2_low, m_weta2_high ); - regHist( m_h_photon_weta2_ptCut_loose, path1, run).ignore(); - m_h_photon_weta2_ptCut_tight = new TH1D( "h_photon_weta2_ptCut_tight", "; photon weta2 ; ", m_weta2_nbins, m_weta2_low, m_weta2_high ); - regHist( m_h_photon_weta2_ptCut_tight, path1, run).ignore(); - - m_h_photon_rhad_ptCut_all = new TH1D( "h_photon_rhad_ptCut_all", "; photon rhad ; ", m_rhad_nbins, m_rhad_low, m_rhad_high ); - regHist( m_h_photon_rhad_ptCut_all, path1, run).ignore(); - m_h_photon_rhad_ptCut_loose = new TH1D( "h_photon_rhad_ptCut_loose", "; photon rhad ; ", m_rhad_nbins, m_rhad_low, m_rhad_high ); - regHist( m_h_photon_rhad_ptCut_loose, path1, run).ignore(); - m_h_photon_rhad_ptCut_tight = new TH1D( "h_photon_rhad_ptCut_tight", "; photon rhad ; ", m_rhad_nbins, m_rhad_low, m_rhad_high ); - regHist( m_h_photon_rhad_ptCut_tight, path1, run).ignore(); - - m_h_photon_wtots1_ptCut_all = new TH1D( "h_photon_wtots1_ptCut_all", "; photon wtots1 ; ", m_wtots1_nbins, m_wtots1_low, m_wtots1_high ); - regHist( m_h_photon_wtots1_ptCut_all, path1, run).ignore(); - m_h_photon_wtots1_ptCut_loose = new TH1D( "h_photon_wtots1_ptCut_loose", "; photon wtots1 ; ", m_wtots1_nbins, m_wtots1_low, m_wtots1_high ); - regHist( m_h_photon_wtots1_ptCut_loose, path1, run).ignore(); - m_h_photon_wtots1_ptCut_tight = new TH1D( "h_photon_wtots1_ptCut_tight", "; photon wtots1 ; ", m_wtots1_nbins, m_wtots1_low, m_wtots1_high ); - regHist( m_h_photon_wtots1_ptCut_tight, path1, run).ignore(); - - m_h_photon_fracs1_ptCut_all = new TH1D( "h_photon_fracs1_ptCut_all", "; photon fracs1 ; ", m_fracs1_nbins, m_fracs1_low, m_fracs1_high ); - regHist( m_h_photon_fracs1_ptCut_all, path1, run).ignore(); - m_h_photon_fracs1_ptCut_loose = new TH1D( "h_photon_fracs1_ptCut_loose", "; photon fracs1 ; ", m_fracs1_nbins, m_fracs1_low, m_fracs1_high ); - regHist( m_h_photon_fracs1_ptCut_loose, path1, run).ignore(); - m_h_photon_fracs1_ptCut_tight = new TH1D( "h_photon_fracs1_ptCut_tight", "; photon fracs1 ; ", m_fracs1_nbins, m_fracs1_low, m_fracs1_high ); - regHist( m_h_photon_fracs1_ptCut_tight, path1, run).ignore(); - - m_h_photon_deltae_ptCut_all = new TH1D( "h_photon_deltae_ptCut_all", "; photon deltae ; ", m_deltae_nbins, m_deltae_low, m_deltae_high ); - regHist( m_h_photon_deltae_ptCut_all, path1, run).ignore(); - m_h_photon_deltae_ptCut_loose = new TH1D( "h_photon_deltae_ptCut_loose", "; photon deltae ; ", m_deltae_nbins, m_deltae_low, m_deltae_high ); - regHist( m_h_photon_deltae_ptCut_loose, path1, run).ignore(); - m_h_photon_deltae_ptCut_tight = new TH1D( "h_photon_deltae_ptCut_tight", "; photon deltae ; ", m_deltae_nbins, m_deltae_low, m_deltae_high ); - regHist( m_h_photon_deltae_ptCut_tight, path1, run).ignore(); - - m_h_photon_eratio_ptCut_all = new TH1D( "h_photon_eratio_ptCut_all", "; photon eratio ; ", m_eratio_nbins, m_eratio_low, m_eratio_high ); - regHist( m_h_photon_eratio_ptCut_all, path1, run).ignore(); - m_h_photon_eratio_ptCut_loose = new TH1D( "h_photon_eratio_ptCut_loose", "; photon eratio ; ", m_eratio_nbins, m_eratio_low, m_eratio_high ); - regHist( m_h_photon_eratio_ptCut_loose, path1, run).ignore(); - m_h_photon_eratio_ptCut_tight = new TH1D( "h_photon_eratio_ptCut_tight", "; photon eratio ; ", m_eratio_nbins, m_eratio_low, m_eratio_high ); - regHist( m_h_photon_eratio_ptCut_tight, path1, run).ignore(); - - m_h_photon_f1_ptCut_all = new TH1D( "h_photon_f1_ptCut_all", "; photon f1 ; ", m_f1_nbins, m_f1_low, m_f1_high ); - regHist( m_h_photon_f1_ptCut_all, path1, run).ignore(); - m_h_photon_f1_ptCut_loose = new TH1D( "h_photon_f1_ptCut_loose", "; photon f1 ; ", m_f1_nbins, m_f1_low, m_f1_high ); - regHist( m_h_photon_f1_ptCut_loose, path1, run).ignore(); - m_h_photon_f1_ptCut_tight = new TH1D( "h_photon_f1_ptCut_tight", "; photon f1 ; ", m_f1_nbins, m_f1_low, m_f1_high ); - regHist( m_h_photon_f1_ptCut_tight, path1, run).ignore(); - - // vs. eta - m_h_photon_reta_eta_ptCut = TH2D_LW::create( "h_photon_reta_eta_ptCut","; photon eta; photon reta", m_PhotonEta_nbins, m_PhotonEta_low, m_PhotonEta_high, m_reta_nbins, m_reta_low, m_reta_high ); - regHist( m_h_photon_reta_eta_ptCut, path1, run).ignore(); - m_h_photon_rphi_eta_ptCut = TH2D_LW::create( "h_photon_rphi_eta_ptCut","; photon eta; photon rphi", m_PhotonEta_nbins, m_PhotonEta_low, m_PhotonEta_high, m_rphi_nbins, m_rphi_low, m_rphi_high ); - regHist( m_h_photon_rphi_eta_ptCut, path1, run).ignore(); - m_h_photon_weta2_eta_ptCut = TH2D_LW::create( "h_photon_weta2_eta_ptCut","; photon eta; photon weta2", m_PhotonEta_nbins, m_PhotonEta_low, m_PhotonEta_high, m_weta2_nbins, m_weta2_low, m_weta2_high ); - regHist( m_h_photon_weta2_eta_ptCut, path1, run).ignore(); - - m_h_photon_rhad_eta_ptCut = TH2D_LW::create( "h_photon_rhad_eta_ptCut","; photon eta; photon rhad", m_PhotonEta_nbins, m_PhotonEta_low, m_PhotonEta_high, m_rhad_nbins, m_rhad_low, m_rhad_high ); - regHist( m_h_photon_rhad_eta_ptCut, path1, run).ignore(); - m_h_photon_wtots1_eta_ptCut = TH2D_LW::create( "h_photon_wtots1_eta_ptCut","; photon eta; photon wtots1", m_PhotonEta_nbins, m_PhotonEta_low, m_PhotonEta_high, m_wtots1_nbins, m_wtots1_low, m_wtots1_high ); - regHist( m_h_photon_wtots1_eta_ptCut, path1, run).ignore(); - m_h_photon_fracs1_eta_ptCut = TH2D_LW::create( "h_photon_fracs1_eta_ptCut","; photon eta; photon fracs1", m_PhotonEta_nbins, m_PhotonEta_low, m_PhotonEta_high, m_fracs1_nbins, m_fracs1_low, m_fracs1_high ); - regHist( m_h_photon_fracs1_eta_ptCut, path1, run).ignore(); - - m_h_photon_deltae_eta_ptCut = TH2D_LW::create( "h_photon_deltae_eta_ptCut","; photon eta; photon deltae", m_PhotonEta_nbins, m_PhotonEta_low, m_PhotonEta_high, m_deltae_nbins, m_deltae_low, m_deltae_high ); - regHist( m_h_photon_deltae_eta_ptCut, path1, run).ignore(); - m_h_photon_eratio_eta_ptCut = TH2D_LW::create( "h_photon_eratio_eta_ptCut","; photon eta; photon eratio", m_PhotonEta_nbins, m_PhotonEta_low, m_PhotonEta_high, m_eratio_nbins, m_eratio_low, m_eratio_high ); - regHist( m_h_photon_eratio_eta_ptCut, path1, run).ignore(); - m_h_photon_f1_eta_ptCut = TH2D_LW::create( "h_photon_f1_eta_ptCut","; photon eta; photon f1", m_PhotonEta_nbins, m_PhotonEta_low, m_PhotonEta_high, m_f1_nbins, m_f1_low, m_f1_high ); - regHist( m_h_photon_f1_eta_ptCut, path1, run).ignore(); - - - // vs. FCal ET - - m_h_photon_reta_fcal_ptCut_eta0 = TH2D_LW::create( "h_photon_reta_fcal_ptCut_eta0","; FCal Sum ET; photon reta", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_reta_nbins, m_reta_low, m_reta_high ); - regHist( m_h_photon_reta_fcal_ptCut_eta0, path1, run).ignore(); - m_h_photon_reta_fcal_ptCut_eta1 = TH2D_LW::create( "h_photon_reta_fcal_ptCut_eta1","; FCal Sum ET; photon reta", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_reta_nbins, m_reta_low, m_reta_high ); - regHist( m_h_photon_reta_fcal_ptCut_eta1, path1, run).ignore(); - - m_h_photon_rphi_fcal_ptCut_eta0 = TH2D_LW::create( "h_photon_rphi_fcal_ptCut_eta0","; FCal Sum ET; photon rphi", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_rphi_nbins, m_rphi_low, m_rphi_high ); - regHist( m_h_photon_rphi_fcal_ptCut_eta0, path1, run).ignore(); - m_h_photon_rphi_fcal_ptCut_eta1 = TH2D_LW::create( "h_photon_rphi_fcal_ptCut_eta1","; FCal Sum ET; photon rphi", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_rphi_nbins, m_rphi_low, m_rphi_high ); - regHist( m_h_photon_rphi_fcal_ptCut_eta1, path1, run).ignore(); - - m_h_photon_weta2_fcal_ptCut_eta0 = TH2D_LW::create( "h_photon_weta2_fcal_ptCut_eta0","; FCal Sum ET; photon weta2", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_weta2_nbins, m_weta2_low, m_weta2_high ); - regHist( m_h_photon_weta2_fcal_ptCut_eta0, path1, run).ignore(); - m_h_photon_weta2_fcal_ptCut_eta1 = TH2D_LW::create( "h_photon_weta2_fcal_ptCut_eta1","; FCal Sum ET; photon weta2", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_weta2_nbins, m_weta2_low, m_weta2_high ); - regHist( m_h_photon_weta2_fcal_ptCut_eta1, path1, run).ignore(); - - - m_h_photon_rhad_fcal_ptCut_eta0 = TH2D_LW::create( "h_photon_rhad_fcal_ptCut_eta0","; FCal Sum ET; photon rhad", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_rhad_nbins, m_rhad_low, m_rhad_high ); - regHist( m_h_photon_rhad_fcal_ptCut_eta0, path1, run).ignore(); - m_h_photon_rhad_fcal_ptCut_eta1 = TH2D_LW::create( "h_photon_rhad_fcal_ptCut_eta1","; FCal Sum ET; photon rhad", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_rhad_nbins, m_rhad_low, m_rhad_high ); - regHist( m_h_photon_rhad_fcal_ptCut_eta1, path1, run).ignore(); - - m_h_photon_wtots1_fcal_ptCut_eta0 = TH2D_LW::create( "h_photon_wtots1_fcal_ptCut_eta0","; FCal Sum ET; photon wtots1", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_wtots1_nbins, m_wtots1_low, m_wtots1_high ); - regHist( m_h_photon_wtots1_fcal_ptCut_eta0, path1, run).ignore(); - m_h_photon_wtots1_fcal_ptCut_eta1 = TH2D_LW::create( "h_photon_wtots1_fcal_ptCut_eta1","; FCal Sum ET; photon wtots1", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_wtots1_nbins, m_wtots1_low, m_wtots1_high ); - regHist( m_h_photon_wtots1_fcal_ptCut_eta1, path1, run).ignore(); - - m_h_photon_fracs1_fcal_ptCut_eta0 = TH2D_LW::create( "h_photon_fracs1_fcal_ptCut_eta0","; FCal Sum ET; photon fracs1", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_fracs1_nbins, m_fracs1_low, m_fracs1_high ); - regHist( m_h_photon_fracs1_fcal_ptCut_eta0, path1, run).ignore(); - m_h_photon_fracs1_fcal_ptCut_eta1 = TH2D_LW::create( "h_photon_fracs1_fcal_ptCut_eta1","; FCal Sum ET; photon fracs1", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_fracs1_nbins, m_fracs1_low, m_fracs1_high ); - regHist( m_h_photon_fracs1_fcal_ptCut_eta1, path1, run).ignore(); - - - m_h_photon_deltae_fcal_ptCut_eta0 = TH2D_LW::create( "h_photon_deltae_fcal_ptCut_eta0","; FCal Sum ET; photon deltae", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_deltae_nbins, m_deltae_low, m_deltae_high ); - regHist( m_h_photon_deltae_fcal_ptCut_eta0, path1, run).ignore(); - m_h_photon_deltae_fcal_ptCut_eta1 = TH2D_LW::create( "h_photon_deltae_fcal_ptCut_eta1","; FCal Sum ET; photon deltae", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_deltae_nbins, m_deltae_low, m_deltae_high ); - regHist( m_h_photon_deltae_fcal_ptCut_eta1, path1, run).ignore(); - - m_h_photon_eratio_fcal_ptCut_eta0 = TH2D_LW::create( "h_photon_eratio_fcal_ptCut_eta0","; FCal Sum ET; photon eratio", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_eratio_nbins, m_eratio_low, m_eratio_high ); - regHist( m_h_photon_eratio_fcal_ptCut_eta0, path1, run).ignore(); - m_h_photon_eratio_fcal_ptCut_eta1 = TH2D_LW::create( "h_photon_eratio_fcal_ptCut_eta1","; FCal Sum ET; photon eratio", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_eratio_nbins, m_eratio_low, m_eratio_high ); - regHist( m_h_photon_eratio_fcal_ptCut_eta1, path1, run).ignore(); - - m_h_photon_f1_fcal_ptCut_eta0 = TH2D_LW::create( "h_photon_f1_fcal_ptCut_eta0","; FCal Sum ET; photon f1", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_f1_nbins, m_f1_low, m_f1_high ); - regHist( m_h_photon_f1_fcal_ptCut_eta0, path1, run).ignore(); - m_h_photon_f1_fcal_ptCut_eta1 = TH2D_LW::create( "h_photon_f1_fcal_ptCut_eta1","; FCal Sum ET; photon f1", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_f1_nbins, m_f1_low, m_f1_high ); - regHist( m_h_photon_f1_fcal_ptCut_eta1, path1, run).ignore(); - - std::string path2 = "HeavyIon/Photons/Isolation"; - - m_h_photon_fcal_etcone20_ptCut = TH2D_LW::create( "h_photon_fcal_etcone20_ptCut", "; FCal Sum ET; photon etcone20", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_IsoWide_nbins, m_IsoWide_low, m_IsoWide_high ); - regHist(m_h_photon_fcal_etcone20_ptCut, path2, run).ignore(); - - m_h_photon_fcal_etcone30_ptCut = TH2D_LW::create( "h_photon_fcal_etcone30_ptCut", "; FCal Sum ET; photon etcone30", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_IsoWide_nbins, m_IsoWide_low, m_IsoWide_high ); - regHist(m_h_photon_fcal_etcone30_ptCut, path2, run).ignore(); - - m_h_photon_fcal_etcone40_ptCut = TH2D_LW::create( "h_photon_fcal_etcone40_ptCut", "; FCal Sum ET; photon etcone40", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_IsoWide_nbins, m_IsoWide_low, m_IsoWide_high ); - regHist(m_h_photon_fcal_etcone40_ptCut, path2, run).ignore(); - - m_h_photon_pt_etcone40_fcal0 = TH2D_LW::create( "h_photon_pt_etcone40_fcal0", "; photon pT; photon etcone40", m_PhotonPt_nbins,m_PhotonPt_low,m_PhotonPt_high, m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); - regHist(m_h_photon_pt_etcone40_fcal0, path2, run).ignore(); - - m_h_photon_pt_etcone40_fcal1 = TH2D_LW::create( "h_photon_pt_etcone40_fcal1", "; photon pT; photon etcone40", m_PhotonPt_nbins,m_PhotonPt_low,m_PhotonPt_high, m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); - regHist(m_h_photon_pt_etcone40_fcal1, path2, run).ignore(); - - m_h_photon_pt_etcone40_fcal2 = TH2D_LW::create( "h_photon_pt_etcone40_fcal2", "; photon pT; photon etcone40", m_PhotonPt_nbins,m_PhotonPt_low,m_PhotonPt_high, m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); - regHist(m_h_photon_pt_etcone40_fcal2, path2, run).ignore(); - - // 1-D vs. FCal ET - m_h_photon_etcone20_ptCut_fcal0 = new TH1D( "h_photon_etcone20_ptCut_fcal0", "; photon etcone20", m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); - regHist(m_h_photon_etcone20_ptCut_fcal0, path2, run).ignore(); - - m_h_photon_etcone20_ptCut_fcal1 = new TH1D( "h_photon_etcone20_ptCut_fcal1", "; photon etcone20", m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); - regHist(m_h_photon_etcone20_ptCut_fcal1, path2, run).ignore(); - - m_h_photon_etcone20_ptCut_fcal2 = new TH1D( "h_photon_etcone20_ptCut_fcal2", "; photon etcone20", m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); - regHist(m_h_photon_etcone20_ptCut_fcal2, path2, run).ignore(); - - m_h_photon_etcone30_ptCut_fcal0 = new TH1D( "h_photon_etcone30_ptCut_fcal0", "; photon etcone30", m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); - regHist(m_h_photon_etcone30_ptCut_fcal0, path2, run).ignore(); - - m_h_photon_etcone30_ptCut_fcal1 = new TH1D( "h_photon_etcone30_ptCut_fcal1", "; photon etcone30", m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); - regHist(m_h_photon_etcone30_ptCut_fcal1, path2, run).ignore(); - - m_h_photon_etcone30_ptCut_fcal2 = new TH1D( "h_photon_etcone30_ptCut_fcal2", "; photon etcone30", m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); - regHist(m_h_photon_etcone30_ptCut_fcal2, path2, run).ignore(); - - m_h_photon_etcone40_ptCut_fcal0 = new TH1D( "h_photon_etcone40_ptCut_fcal0", "; photon etcone40", m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); - regHist(m_h_photon_etcone40_ptCut_fcal0, path2, run).ignore(); - - m_h_photon_etcone40_ptCut_fcal1 = new TH1D( "h_photon_etcone40_ptCut_fcal1", "; photon etcone40", m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); - regHist(m_h_photon_etcone40_ptCut_fcal1, path2, run).ignore(); - - m_h_photon_etcone40_ptCut_fcal2 = new TH1D( "h_photon_etcone40_ptCut_fcal2", "; photon etcone40", m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); - regHist(m_h_photon_etcone40_ptCut_fcal2, path2, run).ignore(); - - // 1-D vs. ID - - m_h_photon_etcone30_ptCut_fcal0_all = new TH1D( "h_photon_etcone30_ptCut_fcal0_all", "; photon etcone30", m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); - regHist(m_h_photon_etcone30_ptCut_fcal0_all, path2, run).ignore(); - m_h_photon_etcone30_ptCut_fcal0_loose = new TH1D( "h_photon_etcone30_ptCut_fcal0_loose", "; photon etcone30", m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); - regHist(m_h_photon_etcone30_ptCut_fcal0_loose, path2, run).ignore(); - m_h_photon_etcone30_ptCut_fcal0_tight = new TH1D( "h_photon_etcone30_ptCut_fcal0_tight", "; photon etcone30", m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); - regHist(m_h_photon_etcone30_ptCut_fcal0_tight, path2, run).ignore(); - - m_h_photon_etcone30_ptCut_fcal1_all = new TH1D( "h_photon_etcone30_ptCut_fcal1_all", "; photon etcone30", m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); - regHist(m_h_photon_etcone30_ptCut_fcal1_all, path2, run).ignore(); - m_h_photon_etcone30_ptCut_fcal1_loose = new TH1D( "h_photon_etcone30_ptCut_fcal1_loose", "; photon etcone30", m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); - regHist(m_h_photon_etcone30_ptCut_fcal1_loose, path2, run).ignore(); - m_h_photon_etcone30_ptCut_fcal1_tight = new TH1D( "h_photon_etcone30_ptCut_fcal1_tight", "; photon etcone30", m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); - regHist(m_h_photon_etcone30_ptCut_fcal1_tight, path2, run).ignore(); - - m_h_photon_etcone30_ptCut_fcal2_all = new TH1D( "h_photon_etcone30_ptCut_fcal2_all", "; photon etcone30", m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); - regHist(m_h_photon_etcone30_ptCut_fcal2_all, path2, run).ignore(); - m_h_photon_etcone30_ptCut_fcal2_loose = new TH1D( "h_photon_etcone30_ptCut_fcal2_loose", "; photon etcone30", m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); - regHist(m_h_photon_etcone30_ptCut_fcal2_loose, path2, run).ignore(); - m_h_photon_etcone30_ptCut_fcal2_tight = new TH1D( "h_photon_etcone30_ptCut_fcal2_tight", "; photon etcone30", m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); - regHist(m_h_photon_etcone30_ptCut_fcal2_tight, path2, run).ignore(); - -} +#include <sstream> + +#include "GaudiKernel/IJobOptionsSvc.h" +#include "GaudiKernel/MsgStream.h" +#include "GaudiKernel/StatusCode.h" +#include "PATCore/AcceptData.h" + +#include "AthenaMonitoring/AthenaMonManager.h" +#include "HIMonitoring/HIMonitoringPhotonsTool.h" + +//#include "LWHists/TH1D_LW.h" +#include "LWHists/TH2D_LW.h" +#include "LWHists/TProfile_LW.h" + +HIMonitoringPhotonsTool:: +HIMonitoringPhotonsTool( const std::string & type, const std::string & name, +const IInterface* parent ): ManagedMonitorToolBase( type, name, parent ) +{ + m_FCalEt=0; + + m_FCalEt_nbins = 50; + m_FCalEt_low = -50; + m_FCalEt_high = 200; + + m_PhotonPt_nbins = 50; + m_PhotonPt_low = 0; + m_PhotonPt_high = 500; + + m_PhotonEta_nbins = 60; + m_PhotonEta_low = -3; + m_PhotonEta_high = +3; + + m_PhotonPhi_nbins = 64; + m_PhotonPhi_low = -3.14159; + m_PhotonPhi_high = +3.14159; + + m_IsoWide_nbins = 100; + m_IsoWide_low = -50.0; + m_IsoWide_high = 50.0; + + m_IsoNarrow_nbins = 60; + m_IsoNarrow_low = -30.0; + m_IsoNarrow_high = 30.0; + + m_reta_nbins = 50; + m_reta_low = 0.70; + m_reta_high = 1.1; + + m_rphi_nbins = 50; + m_rphi_low = 0.60; + m_rphi_high = 1.1; + + m_weta2_nbins = 50; + m_weta2_low = 0.005; + m_weta2_high = 0.015; + + m_rhad_nbins = 50; + m_rhad_low = -0.3; + m_rhad_high = +0.3; + + m_wtots1_nbins = 50; + m_wtots1_low = 0; + m_wtots1_high = 6; + + m_fracs1_nbins = 50; + m_fracs1_low = -0.1; + m_fracs1_high = 1.2; + + m_deltae_nbins = 50; + m_deltae_low = -0.1; + m_deltae_high = 1.5; + + m_eratio_nbins = 50; + m_eratio_low = -0.1; + m_eratio_high = 1.1; + + m_f1_nbins = 50; + m_f1_low = -0.05; + m_f1_high = 0.60; + + m_photonLooseIsEMSelector = new AsgPhotonIsEMSelector ( "PhotonLooseIsEMSelector" ); + m_photonLooseIsEMSelector->setProperty("isEMMask",egammaPID::PhotonLoose); + m_photonLooseIsEMSelector->setProperty("ConfigFile","ElectronPhotonSelectorTools/offline/mc15_20150712/PhotonIsEMLooseSelectorCutDefs.conf"); + if (!m_photonLooseIsEMSelector->initialize().isSuccess()) { + Fatal("MyFunction", "Failed to initialize PhotonLooseIsEMSelector "); + } + + m_photonTightIsEMSelector = new AsgPhotonIsEMSelector ( "PhotonTightIsEMSelector" ); + m_photonTightIsEMSelector->setProperty("isEMMask",egammaPID::PhotonTight); + m_photonTightIsEMSelector->setProperty("ConfigFile","ElectronPhotonSelectorTools/offline/mc15_20150712/PhotonIsEMTightSelectorCutDefs.conf"); + if (!m_photonTightIsEMSelector->initialize().isSuccess()) { + Fatal("MyFunction", "Failed to initialize PhotonTightIsEMSelector "); + } + +} + + +HIMonitoringPhotonsTool::~HIMonitoringPhotonsTool() +{ +} + +// Description: Used for rebooking unmanaged histograms +StatusCode HIMonitoringPhotonsTool::bookHistogramsRecurrent( ) +{ + return StatusCode::SUCCESS; +} + + +// Description: Used for re-booking managed histograms +StatusCode HIMonitoringPhotonsTool::bookHistograms( ) +{ + if( m_environment == AthenaMonManager::online ) { + // book histograms that are only made in the online environment... + } + + if( m_dataType == AthenaMonManager::cosmics ) { + // book histograms that are only relevant for cosmics data... + } + + book_hist(); + + + return StatusCode::SUCCESS; +} + + +StatusCode HIMonitoringPhotonsTool::fillHistograms() +{ + StatusCode sc; + + /// HI event shape + const xAOD::HIEventShapeContainer* evtShape; + sc = evtStore()->retrieve(evtShape, "HIEventShape"); + if (sc.isFailure()) + { + ATH_MSG_ERROR("Could not find HIEventShape"); + return StatusCode::FAILURE; + } + else + { + ATH_MSG_INFO("HIEventShape retrieved from StoreGate"); + } + + int size=evtShape->size(); + for(int i=0;i<size;i++) + { + const xAOD::HIEventShape *sh=evtShape->at(i); + if(sh->layer()==21 || sh->layer()==22 || sh->layer()==23) + { + m_FCalEt += sh->et(); + } + } + + m_FCalEt = m_FCalEt * 1e-3; + + + const xAOD::PhotonContainer* photons = 0; + sc = evtStore()->retrieve( photons, "Photons" ); + if (sc.isFailure()) { + ATH_MSG_ERROR("Could not find Photons"); + return StatusCode::FAILURE; + } + else { + ATH_MSG_INFO("Photons retrieved from StoreGate"); + } + + xAOD::PhotonContainer::const_iterator photons_itr = photons->begin(); + xAOD::PhotonContainer::const_iterator photons_end = photons->end(); + + for( ; photons_itr != photons_end; ++photons_itr ) + { + + float pt = (*photons_itr)->pt() * 1e-3; + float eta = (*photons_itr)->caloCluster()->etaBE(2); + float phi = (*photons_itr)->phi(); + + m_h_photon_pt_eta->Fill( pt, eta ); + m_h_photon_pt_phi->Fill( pt, phi ); + m_h_photon_pt_fcal->Fill( pt, phi ); + + bool loose_MC15 = (bool) m_photonLooseIsEMSelector->accept(*photons_itr); + bool tight_MC15 = (bool) m_photonTightIsEMSelector->accept(*photons_itr); + + if (tight_MC15) { + + m_h_photon_pt_eta_tight->Fill( pt, eta ); + m_h_photon_pt_phi_tight->Fill( pt, phi ); + m_h_photon_pt_fcal_tight->Fill( pt, phi ); + + } + + if (pt < 20) continue; + + m_h_photon_eta_phi_ptCut->Fill( eta, phi ); + + if (tight_MC15) { + + m_h_photon_eta_phi_ptCut_tight->Fill( eta, phi ); + + } + + float etcone20 = (*photons_itr)->auxdata< float >("etcone20") * 1e-3; + float etcone30 = (*photons_itr)->auxdata< float >("etcone30") * 1e-3; + float etcone40 = (*photons_itr)->auxdata< float >("etcone40") * 1e-3; + + m_h_photon_fcal_etcone20_ptCut->Fill( m_FCalEt, etcone20 ); + m_h_photon_fcal_etcone30_ptCut->Fill( m_FCalEt, etcone30 ); + m_h_photon_fcal_etcone40_ptCut->Fill( m_FCalEt, etcone40 ); + + if (m_FCalEt < 20) { + m_h_photon_pt_etcone40_fcal0->Fill( pt, etcone40 ); + + m_h_photon_etcone20_ptCut_fcal0->Fill( etcone20 ); + m_h_photon_etcone30_ptCut_fcal0->Fill( etcone30 ); + m_h_photon_etcone40_ptCut_fcal0->Fill( etcone40 ); + + m_h_photon_etcone30_ptCut_fcal0_all->Fill( etcone30 ); + if (loose_MC15) m_h_photon_etcone30_ptCut_fcal0_loose->Fill( etcone30 ); + if (tight_MC15) m_h_photon_etcone30_ptCut_fcal0_tight->Fill( etcone30 ); + } + if (m_FCalEt > 20 && m_FCalEt < 50) { + m_h_photon_pt_etcone40_fcal1->Fill( pt, etcone40 ); + + m_h_photon_etcone20_ptCut_fcal1->Fill( etcone20 ); + m_h_photon_etcone30_ptCut_fcal1->Fill( etcone30 ); + m_h_photon_etcone40_ptCut_fcal1->Fill( etcone40 ); + + m_h_photon_etcone30_ptCut_fcal1_all->Fill( etcone30 ); + if (loose_MC15) m_h_photon_etcone30_ptCut_fcal1_loose->Fill( etcone30 ); + if (tight_MC15) m_h_photon_etcone30_ptCut_fcal1_tight->Fill( etcone30 ); + } + if (m_FCalEt > 50) { + m_h_photon_pt_etcone40_fcal2->Fill( pt, etcone40 ); + + m_h_photon_etcone20_ptCut_fcal2->Fill( etcone20 ); + m_h_photon_etcone30_ptCut_fcal2->Fill( etcone30 ); + m_h_photon_etcone40_ptCut_fcal2->Fill( etcone40 ); + + m_h_photon_etcone30_ptCut_fcal2_all->Fill( etcone30 ); + if (loose_MC15) m_h_photon_etcone30_ptCut_fcal2_loose->Fill( etcone30 ); + if (tight_MC15) m_h_photon_etcone30_ptCut_fcal2_tight->Fill( etcone30 ); + } + + float reta = (*photons_itr)->auxdata< float >("Reta"); + float rphi = (*photons_itr)->auxdata< float >("Rphi"); + float weta2 = (*photons_itr)->auxdata< float >("weta2"); + + float rhad = (*photons_itr)->auxdata< float >("Rhad"); + float rhad1 = (*photons_itr)->auxdata< float >("Rhad1"); + float wtots1 = (*photons_itr)->auxdata< float >("wtots1"); + float fracs1 = (*photons_itr)->auxdata< float >("fracs1"); + + float deltae = (*photons_itr)->auxdata< float >("DeltaE") * 1e-3; + float eratio = (*photons_itr)->auxdata< float >("Eratio"); + float f1 = (*photons_itr)->auxdata< float >("f1"); + + if (fabs(eta) < 1.37) { + m_h_photon_reta_fcal_ptCut_eta0->Fill( m_FCalEt, reta ); + m_h_photon_rphi_fcal_ptCut_eta0->Fill( m_FCalEt, rphi ); + m_h_photon_weta2_fcal_ptCut_eta0->Fill( m_FCalEt, weta2 ); + m_h_photon_rhad_fcal_ptCut_eta0->Fill( m_FCalEt, rhad ); + m_h_photon_wtots1_fcal_ptCut_eta0->Fill( m_FCalEt, wtots1 ); + m_h_photon_fracs1_fcal_ptCut_eta0->Fill( m_FCalEt, fracs1 ); + m_h_photon_deltae_fcal_ptCut_eta0->Fill( m_FCalEt, deltae ); + m_h_photon_eratio_fcal_ptCut_eta0->Fill( m_FCalEt, eratio ); + m_h_photon_f1_fcal_ptCut_eta0->Fill( m_FCalEt, f1 ); + } + if (fabs(eta) > 1.52) { + m_h_photon_reta_fcal_ptCut_eta1->Fill( m_FCalEt, reta ); + m_h_photon_rphi_fcal_ptCut_eta1->Fill( m_FCalEt, rphi ); + m_h_photon_weta2_fcal_ptCut_eta1->Fill( m_FCalEt, weta2 ); + m_h_photon_rhad_fcal_ptCut_eta1->Fill( m_FCalEt, rhad1 ); + m_h_photon_wtots1_fcal_ptCut_eta1->Fill( m_FCalEt, wtots1 ); + m_h_photon_fracs1_fcal_ptCut_eta1->Fill( m_FCalEt, fracs1 ); + m_h_photon_deltae_fcal_ptCut_eta1->Fill( m_FCalEt, deltae ); + m_h_photon_eratio_fcal_ptCut_eta1->Fill( m_FCalEt, eratio ); + m_h_photon_f1_fcal_ptCut_eta1->Fill( m_FCalEt, f1 ); + } + + m_h_photon_reta_ptCut_all->Fill( reta ); + m_h_photon_rphi_ptCut_all->Fill( rphi ); + m_h_photon_weta2_ptCut_all->Fill( weta2 ); + m_h_photon_rhad_ptCut_all->Fill( rhad ); + m_h_photon_wtots1_ptCut_all->Fill( wtots1 ); + m_h_photon_fracs1_ptCut_all->Fill( fracs1 ); + m_h_photon_deltae_ptCut_all->Fill( deltae ); + m_h_photon_eratio_ptCut_all->Fill( eratio ); + m_h_photon_f1_ptCut_all->Fill( f1 ); + if (loose_MC15) { + m_h_photon_reta_ptCut_loose->Fill( reta ); + m_h_photon_rphi_ptCut_loose->Fill( rphi ); + m_h_photon_weta2_ptCut_loose->Fill( weta2 ); + m_h_photon_rhad_ptCut_loose->Fill( rhad ); + m_h_photon_wtots1_ptCut_loose->Fill( wtots1 ); + m_h_photon_fracs1_ptCut_loose->Fill( fracs1 ); + m_h_photon_deltae_ptCut_loose->Fill( deltae ); + m_h_photon_eratio_ptCut_loose->Fill( eratio ); + m_h_photon_f1_ptCut_loose->Fill( f1 ); + } + if (tight_MC15) { + m_h_photon_reta_ptCut_tight->Fill( reta ); + m_h_photon_rphi_ptCut_tight->Fill( rphi ); + m_h_photon_weta2_ptCut_tight->Fill( weta2 ); + m_h_photon_rhad_ptCut_tight->Fill( rhad ); + m_h_photon_wtots1_ptCut_tight->Fill( wtots1 ); + m_h_photon_fracs1_ptCut_tight->Fill( fracs1 ); + m_h_photon_deltae_ptCut_tight->Fill( deltae ); + m_h_photon_eratio_ptCut_tight->Fill( eratio ); + m_h_photon_f1_ptCut_tight->Fill( f1 ); + } + + m_h_photon_reta_eta_ptCut->Fill( eta, reta ); + m_h_photon_rphi_eta_ptCut->Fill( eta, rphi ); + m_h_photon_weta2_eta_ptCut->Fill( eta, weta2 ); + + if ( fabs(eta) < 1.52) m_h_photon_rhad_eta_ptCut->Fill( eta, rhad ); + else m_h_photon_rhad_eta_ptCut->Fill( eta, rhad1 ); + m_h_photon_wtots1_eta_ptCut->Fill( eta, wtots1 ); + m_h_photon_fracs1_eta_ptCut->Fill( eta, fracs1 ); + + m_h_photon_deltae_eta_ptCut->Fill( eta, deltae ); + m_h_photon_eratio_eta_ptCut->Fill( eta, eratio ); + m_h_photon_f1_eta_ptCut->Fill( eta, f1 ); + } + + return StatusCode::SUCCESS; +} + + +StatusCode HIMonitoringPhotonsTool::procHistograms( ) +{ + + //if( endOfLowStatFlag() || endOfLumiBlockFlag() ) { } + + + if( endOfRunFlag() ) + { + if(m_h_photon_reta_ptCut_all->GetEntries() > 0) m_h_photon_reta_ptCut_all->Scale(1./m_h_photon_reta_ptCut_all->GetEntries()); + if(m_h_photon_reta_ptCut_loose->GetEntries() > 0) m_h_photon_reta_ptCut_loose->Scale(1./m_h_photon_reta_ptCut_loose->GetEntries()); + if(m_h_photon_reta_ptCut_tight->GetEntries() > 0) m_h_photon_reta_ptCut_tight->Scale(1./m_h_photon_reta_ptCut_tight->GetEntries()); + if(m_h_photon_rphi_ptCut_all->GetEntries() > 0) m_h_photon_rphi_ptCut_all->Scale(1./m_h_photon_rphi_ptCut_all->GetEntries()); + if(m_h_photon_rphi_ptCut_loose->GetEntries() > 0) m_h_photon_rphi_ptCut_loose->Scale(1./m_h_photon_rphi_ptCut_loose->GetEntries()); + if(m_h_photon_rphi_ptCut_tight->GetEntries() > 0) m_h_photon_rphi_ptCut_tight->Scale(1./m_h_photon_rphi_ptCut_tight->GetEntries()); + if(m_h_photon_weta2_ptCut_all->GetEntries() > 0) m_h_photon_weta2_ptCut_all->Scale(1./m_h_photon_weta2_ptCut_all->GetEntries()); + if(m_h_photon_weta2_ptCut_loose->GetEntries() > 0) m_h_photon_weta2_ptCut_loose->Scale(1./m_h_photon_weta2_ptCut_loose->GetEntries()); + if(m_h_photon_weta2_ptCut_tight->GetEntries() > 0) m_h_photon_weta2_ptCut_tight->Scale(1./m_h_photon_weta2_ptCut_tight->GetEntries()); + if(m_h_photon_rhad_ptCut_all->GetEntries() > 0) m_h_photon_rhad_ptCut_all->Scale(1./m_h_photon_rhad_ptCut_all->GetEntries()); + if(m_h_photon_rhad_ptCut_loose->GetEntries() > 0) m_h_photon_rhad_ptCut_loose->Scale(1./m_h_photon_rhad_ptCut_loose->GetEntries()); + if(m_h_photon_rhad_ptCut_tight->GetEntries() > 0) m_h_photon_rhad_ptCut_tight->Scale(1./m_h_photon_rhad_ptCut_tight->GetEntries()); + if(m_h_photon_wtots1_ptCut_all->GetEntries() > 0) m_h_photon_wtots1_ptCut_all->Scale(1./m_h_photon_wtots1_ptCut_all->GetEntries()); + if(m_h_photon_wtots1_ptCut_loose->GetEntries() > 0) m_h_photon_wtots1_ptCut_loose->Scale(1./m_h_photon_wtots1_ptCut_loose->GetEntries()); + if(m_h_photon_wtots1_ptCut_tight->GetEntries() > 0) m_h_photon_wtots1_ptCut_tight->Scale(1./m_h_photon_wtots1_ptCut_tight->GetEntries()); + if(m_h_photon_fracs1_ptCut_all->GetEntries() > 0) m_h_photon_fracs1_ptCut_all->Scale(1./m_h_photon_fracs1_ptCut_all->GetEntries()); + if(m_h_photon_fracs1_ptCut_loose->GetEntries() > 0) m_h_photon_fracs1_ptCut_loose->Scale(1./m_h_photon_fracs1_ptCut_loose->GetEntries()); + if(m_h_photon_fracs1_ptCut_tight->GetEntries() > 0) m_h_photon_fracs1_ptCut_tight->Scale(1./m_h_photon_fracs1_ptCut_tight->GetEntries()); + if(m_h_photon_deltae_ptCut_all->GetEntries() > 0) m_h_photon_deltae_ptCut_all->Scale(1./m_h_photon_deltae_ptCut_all->GetEntries()); + if(m_h_photon_deltae_ptCut_loose->GetEntries() > 0) m_h_photon_deltae_ptCut_loose->Scale(1./m_h_photon_deltae_ptCut_loose->GetEntries()); + if(m_h_photon_deltae_ptCut_tight->GetEntries() > 0) m_h_photon_deltae_ptCut_tight->Scale(1./m_h_photon_deltae_ptCut_tight->GetEntries()); + if(m_h_photon_eratio_ptCut_all->GetEntries() > 0) m_h_photon_eratio_ptCut_all->Scale(1./m_h_photon_eratio_ptCut_all->GetEntries()); + if(m_h_photon_eratio_ptCut_loose->GetEntries() > 0) m_h_photon_eratio_ptCut_loose->Scale(1./m_h_photon_eratio_ptCut_loose->GetEntries()); + if(m_h_photon_eratio_ptCut_tight->GetEntries() > 0) m_h_photon_eratio_ptCut_tight->Scale(1./m_h_photon_eratio_ptCut_tight->GetEntries()); + if(m_h_photon_f1_ptCut_all->GetEntries() > 0) m_h_photon_f1_ptCut_all->Scale(1./m_h_photon_f1_ptCut_all->GetEntries()); + if(m_h_photon_f1_ptCut_loose->GetEntries() > 0) m_h_photon_f1_ptCut_loose->Scale(1./m_h_photon_f1_ptCut_loose->GetEntries()); + if(m_h_photon_f1_ptCut_tight->GetEntries() > 0) m_h_photon_f1_ptCut_tight->Scale(1./m_h_photon_f1_ptCut_tight->GetEntries()); + if(m_h_photon_etcone20_ptCut_fcal0->GetEntries() > 0) m_h_photon_etcone20_ptCut_fcal0->Scale(1./m_h_photon_etcone20_ptCut_fcal0->GetEntries()); + if(m_h_photon_etcone20_ptCut_fcal1->GetEntries() > 0) m_h_photon_etcone20_ptCut_fcal1->Scale(1./m_h_photon_etcone20_ptCut_fcal1->GetEntries()); + if(m_h_photon_etcone20_ptCut_fcal2->GetEntries() > 0) m_h_photon_etcone20_ptCut_fcal2->Scale(1./m_h_photon_etcone20_ptCut_fcal2->GetEntries()); + if(m_h_photon_etcone30_ptCut_fcal0->GetEntries() > 0) m_h_photon_etcone30_ptCut_fcal0->Scale(1./m_h_photon_etcone30_ptCut_fcal0->GetEntries()); + if(m_h_photon_etcone30_ptCut_fcal1->GetEntries() > 0) m_h_photon_etcone30_ptCut_fcal1->Scale(1./m_h_photon_etcone30_ptCut_fcal1->GetEntries()); + if(m_h_photon_etcone30_ptCut_fcal2->GetEntries() > 0) m_h_photon_etcone30_ptCut_fcal2->Scale(1./m_h_photon_etcone30_ptCut_fcal2->GetEntries()); + if(m_h_photon_etcone40_ptCut_fcal0->GetEntries() > 0) m_h_photon_etcone40_ptCut_fcal0->Scale(1./m_h_photon_etcone40_ptCut_fcal0->GetEntries()); + if(m_h_photon_etcone40_ptCut_fcal1->GetEntries() > 0) m_h_photon_etcone40_ptCut_fcal1->Scale(1./m_h_photon_etcone40_ptCut_fcal1->GetEntries()); + if(m_h_photon_etcone40_ptCut_fcal2->GetEntries() > 0) m_h_photon_etcone40_ptCut_fcal2->Scale(1./m_h_photon_etcone40_ptCut_fcal2->GetEntries()); + if(m_h_photon_etcone30_ptCut_fcal0_all->GetEntries() > 0) m_h_photon_etcone30_ptCut_fcal0_all->Scale(1./m_h_photon_etcone30_ptCut_fcal0_all->GetEntries()); + if(m_h_photon_etcone30_ptCut_fcal0_loose->GetEntries() > 0) m_h_photon_etcone30_ptCut_fcal0_loose->Scale(1./m_h_photon_etcone30_ptCut_fcal0_loose->GetEntries()); + if(m_h_photon_etcone30_ptCut_fcal0_tight->GetEntries() > 0) m_h_photon_etcone30_ptCut_fcal0_tight->Scale(1./m_h_photon_etcone30_ptCut_fcal0_tight->GetEntries()); + if(m_h_photon_etcone30_ptCut_fcal1_all->GetEntries() > 0) m_h_photon_etcone30_ptCut_fcal1_all->Scale(1./m_h_photon_etcone30_ptCut_fcal1_all->GetEntries()); + if(m_h_photon_etcone30_ptCut_fcal1_loose->GetEntries() > 0) m_h_photon_etcone30_ptCut_fcal1_loose->Scale(1./m_h_photon_etcone30_ptCut_fcal1_loose->GetEntries()); + if(m_h_photon_etcone30_ptCut_fcal1_tight->GetEntries() > 0) m_h_photon_etcone30_ptCut_fcal1_tight->Scale(1./m_h_photon_etcone30_ptCut_fcal1_tight->GetEntries()); + if(m_h_photon_etcone30_ptCut_fcal2_all->GetEntries() > 0) m_h_photon_etcone30_ptCut_fcal2_all->Scale(1./m_h_photon_etcone30_ptCut_fcal2_all->GetEntries()); + if(m_h_photon_etcone30_ptCut_fcal2_loose->GetEntries() > 0) m_h_photon_etcone30_ptCut_fcal2_loose->Scale(1./m_h_photon_etcone30_ptCut_fcal2_loose->GetEntries()); + if(m_h_photon_etcone30_ptCut_fcal2_tight->GetEntries() > 0) m_h_photon_etcone30_ptCut_fcal2_tight->Scale(1./m_h_photon_etcone30_ptCut_fcal2_tight->GetEntries()); + } + + return StatusCode::SUCCESS; +} + + +/// *** FCal sum Et *** /// +void HIMonitoringPhotonsTool::book_hist() +{ + std::string path0 = "HeavyIon/Photons/Basic"; + + m_h_photon_pt_eta = TH2D_LW::create( "h_photon_pt_eta", "; photon pT; photon eta", m_PhotonPt_nbins, m_PhotonPt_low, m_PhotonPt_high, m_PhotonEta_nbins, m_PhotonEta_low, m_PhotonEta_high ); + regHist(m_h_photon_pt_eta, path0, run).ignore(); + + m_h_photon_pt_phi = TH2D_LW::create( "h_photon_pt_phi", "; photon pT; photon phi", m_PhotonPt_nbins, m_PhotonPt_low, m_PhotonPt_high, m_PhotonPhi_nbins, m_PhotonPhi_low, m_PhotonPhi_high ); + regHist(m_h_photon_pt_phi, path0, run).ignore(); + + m_h_photon_pt_fcal = TH2D_LW::create( "h_photon_pt_fcal", "; photon pT; FCal SumET", m_PhotonPt_nbins, m_PhotonPt_low, m_PhotonPt_high, m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high ); + regHist(m_h_photon_pt_fcal, path0, run).ignore(); + + m_h_photon_eta_phi_ptCut = TH2D_LW::create( "h_photon_eta_phi_ptCut", "; photon eta; photon phi", m_PhotonEta_nbins, m_PhotonEta_low, m_PhotonEta_high, m_PhotonPhi_nbins, m_PhotonPhi_low, m_PhotonPhi_high ); + regHist(m_h_photon_eta_phi_ptCut, path0, run).ignore(); + + // tight versions + m_h_photon_pt_eta_tight = TH2D_LW::create( "h_photon_pt_eta_tight", "; photon pT; photon eta", m_PhotonPt_nbins, m_PhotonPt_low, m_PhotonPt_high, m_PhotonEta_nbins, m_PhotonEta_low, m_PhotonEta_high ); + regHist(m_h_photon_pt_eta_tight, path0, run).ignore(); + + m_h_photon_pt_phi_tight = TH2D_LW::create( "h_photon_pt_phi_tight", "; photon pT; photon phi", m_PhotonPt_nbins, m_PhotonPt_low, m_PhotonPt_high, m_PhotonPhi_nbins, m_PhotonPhi_low, m_PhotonPhi_high ); + regHist(m_h_photon_pt_phi_tight, path0, run).ignore(); + + m_h_photon_pt_fcal_tight = TH2D_LW::create( "h_photon_pt_fcal_tight", "; photon pT; FCal SumET", m_PhotonPt_nbins, m_PhotonPt_low, m_PhotonPt_high, m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high ); + regHist(m_h_photon_pt_fcal_tight, path0, run).ignore(); + + m_h_photon_eta_phi_ptCut_tight = TH2D_LW::create( "h_photon_eta_phi_ptCut_tight", "; photon eta; photon phi", m_PhotonEta_nbins, m_PhotonEta_low, m_PhotonEta_high, m_PhotonPhi_nbins, m_PhotonPhi_low, m_PhotonPhi_high ); + regHist(m_h_photon_eta_phi_ptCut_tight, path0, run).ignore(); + + std::string path1 = "HeavyIon/Photons/ShowerShapes"; + + // 1-D vs. ID cuts + + m_h_photon_reta_ptCut_all = new TH1D( "h_photon_reta_ptCut_all", "; photon reta ; ", m_reta_nbins, m_reta_low, m_reta_high ); + regHist( m_h_photon_reta_ptCut_all, path1, run).ignore(); + m_h_photon_reta_ptCut_loose = new TH1D( "h_photon_reta_ptCut_loose", "; photon reta ; ", m_reta_nbins, m_reta_low, m_reta_high ); + regHist( m_h_photon_reta_ptCut_loose, path1, run).ignore(); + m_h_photon_reta_ptCut_tight = new TH1D( "h_photon_reta_ptCut_tight", "; photon reta ; ", m_reta_nbins, m_reta_low, m_reta_high ); + regHist( m_h_photon_reta_ptCut_tight, path1, run).ignore(); + + m_h_photon_rphi_ptCut_all = new TH1D( "h_photon_rphi_ptCut_all", "; photon rphi ; ", m_rphi_nbins, m_rphi_low, m_rphi_high ); + regHist( m_h_photon_rphi_ptCut_all, path1, run).ignore(); + m_h_photon_rphi_ptCut_loose = new TH1D( "h_photon_rphi_ptCut_loose", "; photon rphi ; ", m_rphi_nbins, m_rphi_low, m_rphi_high ); + regHist( m_h_photon_rphi_ptCut_loose, path1, run).ignore(); + m_h_photon_rphi_ptCut_tight = new TH1D( "h_photon_rphi_ptCut_tight", "; photon rphi ; ", m_rphi_nbins, m_rphi_low, m_rphi_high ); + regHist( m_h_photon_rphi_ptCut_tight, path1, run).ignore(); + + m_h_photon_weta2_ptCut_all = new TH1D( "h_photon_weta2_ptCut_all", "; photon weta2 ; ", m_weta2_nbins, m_weta2_low, m_weta2_high ); + regHist( m_h_photon_weta2_ptCut_all, path1, run).ignore(); + m_h_photon_weta2_ptCut_loose = new TH1D( "h_photon_weta2_ptCut_loose", "; photon weta2 ; ", m_weta2_nbins, m_weta2_low, m_weta2_high ); + regHist( m_h_photon_weta2_ptCut_loose, path1, run).ignore(); + m_h_photon_weta2_ptCut_tight = new TH1D( "h_photon_weta2_ptCut_tight", "; photon weta2 ; ", m_weta2_nbins, m_weta2_low, m_weta2_high ); + regHist( m_h_photon_weta2_ptCut_tight, path1, run).ignore(); + + m_h_photon_rhad_ptCut_all = new TH1D( "h_photon_rhad_ptCut_all", "; photon rhad ; ", m_rhad_nbins, m_rhad_low, m_rhad_high ); + regHist( m_h_photon_rhad_ptCut_all, path1, run).ignore(); + m_h_photon_rhad_ptCut_loose = new TH1D( "h_photon_rhad_ptCut_loose", "; photon rhad ; ", m_rhad_nbins, m_rhad_low, m_rhad_high ); + regHist( m_h_photon_rhad_ptCut_loose, path1, run).ignore(); + m_h_photon_rhad_ptCut_tight = new TH1D( "h_photon_rhad_ptCut_tight", "; photon rhad ; ", m_rhad_nbins, m_rhad_low, m_rhad_high ); + regHist( m_h_photon_rhad_ptCut_tight, path1, run).ignore(); + + m_h_photon_wtots1_ptCut_all = new TH1D( "h_photon_wtots1_ptCut_all", "; photon wtots1 ; ", m_wtots1_nbins, m_wtots1_low, m_wtots1_high ); + regHist( m_h_photon_wtots1_ptCut_all, path1, run).ignore(); + m_h_photon_wtots1_ptCut_loose = new TH1D( "h_photon_wtots1_ptCut_loose", "; photon wtots1 ; ", m_wtots1_nbins, m_wtots1_low, m_wtots1_high ); + regHist( m_h_photon_wtots1_ptCut_loose, path1, run).ignore(); + m_h_photon_wtots1_ptCut_tight = new TH1D( "h_photon_wtots1_ptCut_tight", "; photon wtots1 ; ", m_wtots1_nbins, m_wtots1_low, m_wtots1_high ); + regHist( m_h_photon_wtots1_ptCut_tight, path1, run).ignore(); + + m_h_photon_fracs1_ptCut_all = new TH1D( "h_photon_fracs1_ptCut_all", "; photon fracs1 ; ", m_fracs1_nbins, m_fracs1_low, m_fracs1_high ); + regHist( m_h_photon_fracs1_ptCut_all, path1, run).ignore(); + m_h_photon_fracs1_ptCut_loose = new TH1D( "h_photon_fracs1_ptCut_loose", "; photon fracs1 ; ", m_fracs1_nbins, m_fracs1_low, m_fracs1_high ); + regHist( m_h_photon_fracs1_ptCut_loose, path1, run).ignore(); + m_h_photon_fracs1_ptCut_tight = new TH1D( "h_photon_fracs1_ptCut_tight", "; photon fracs1 ; ", m_fracs1_nbins, m_fracs1_low, m_fracs1_high ); + regHist( m_h_photon_fracs1_ptCut_tight, path1, run).ignore(); + + m_h_photon_deltae_ptCut_all = new TH1D( "h_photon_deltae_ptCut_all", "; photon deltae ; ", m_deltae_nbins, m_deltae_low, m_deltae_high ); + regHist( m_h_photon_deltae_ptCut_all, path1, run).ignore(); + m_h_photon_deltae_ptCut_loose = new TH1D( "h_photon_deltae_ptCut_loose", "; photon deltae ; ", m_deltae_nbins, m_deltae_low, m_deltae_high ); + regHist( m_h_photon_deltae_ptCut_loose, path1, run).ignore(); + m_h_photon_deltae_ptCut_tight = new TH1D( "h_photon_deltae_ptCut_tight", "; photon deltae ; ", m_deltae_nbins, m_deltae_low, m_deltae_high ); + regHist( m_h_photon_deltae_ptCut_tight, path1, run).ignore(); + + m_h_photon_eratio_ptCut_all = new TH1D( "h_photon_eratio_ptCut_all", "; photon eratio ; ", m_eratio_nbins, m_eratio_low, m_eratio_high ); + regHist( m_h_photon_eratio_ptCut_all, path1, run).ignore(); + m_h_photon_eratio_ptCut_loose = new TH1D( "h_photon_eratio_ptCut_loose", "; photon eratio ; ", m_eratio_nbins, m_eratio_low, m_eratio_high ); + regHist( m_h_photon_eratio_ptCut_loose, path1, run).ignore(); + m_h_photon_eratio_ptCut_tight = new TH1D( "h_photon_eratio_ptCut_tight", "; photon eratio ; ", m_eratio_nbins, m_eratio_low, m_eratio_high ); + regHist( m_h_photon_eratio_ptCut_tight, path1, run).ignore(); + + m_h_photon_f1_ptCut_all = new TH1D( "h_photon_f1_ptCut_all", "; photon f1 ; ", m_f1_nbins, m_f1_low, m_f1_high ); + regHist( m_h_photon_f1_ptCut_all, path1, run).ignore(); + m_h_photon_f1_ptCut_loose = new TH1D( "h_photon_f1_ptCut_loose", "; photon f1 ; ", m_f1_nbins, m_f1_low, m_f1_high ); + regHist( m_h_photon_f1_ptCut_loose, path1, run).ignore(); + m_h_photon_f1_ptCut_tight = new TH1D( "h_photon_f1_ptCut_tight", "; photon f1 ; ", m_f1_nbins, m_f1_low, m_f1_high ); + regHist( m_h_photon_f1_ptCut_tight, path1, run).ignore(); + + // vs. eta + m_h_photon_reta_eta_ptCut = TH2D_LW::create( "h_photon_reta_eta_ptCut","; photon eta; photon reta", m_PhotonEta_nbins, m_PhotonEta_low, m_PhotonEta_high, m_reta_nbins, m_reta_low, m_reta_high ); + regHist( m_h_photon_reta_eta_ptCut, path1, run).ignore(); + m_h_photon_rphi_eta_ptCut = TH2D_LW::create( "h_photon_rphi_eta_ptCut","; photon eta; photon rphi", m_PhotonEta_nbins, m_PhotonEta_low, m_PhotonEta_high, m_rphi_nbins, m_rphi_low, m_rphi_high ); + regHist( m_h_photon_rphi_eta_ptCut, path1, run).ignore(); + m_h_photon_weta2_eta_ptCut = TH2D_LW::create( "h_photon_weta2_eta_ptCut","; photon eta; photon weta2", m_PhotonEta_nbins, m_PhotonEta_low, m_PhotonEta_high, m_weta2_nbins, m_weta2_low, m_weta2_high ); + regHist( m_h_photon_weta2_eta_ptCut, path1, run).ignore(); + + m_h_photon_rhad_eta_ptCut = TH2D_LW::create( "h_photon_rhad_eta_ptCut","; photon eta; photon rhad", m_PhotonEta_nbins, m_PhotonEta_low, m_PhotonEta_high, m_rhad_nbins, m_rhad_low, m_rhad_high ); + regHist( m_h_photon_rhad_eta_ptCut, path1, run).ignore(); + m_h_photon_wtots1_eta_ptCut = TH2D_LW::create( "h_photon_wtots1_eta_ptCut","; photon eta; photon wtots1", m_PhotonEta_nbins, m_PhotonEta_low, m_PhotonEta_high, m_wtots1_nbins, m_wtots1_low, m_wtots1_high ); + regHist( m_h_photon_wtots1_eta_ptCut, path1, run).ignore(); + m_h_photon_fracs1_eta_ptCut = TH2D_LW::create( "h_photon_fracs1_eta_ptCut","; photon eta; photon fracs1", m_PhotonEta_nbins, m_PhotonEta_low, m_PhotonEta_high, m_fracs1_nbins, m_fracs1_low, m_fracs1_high ); + regHist( m_h_photon_fracs1_eta_ptCut, path1, run).ignore(); + + m_h_photon_deltae_eta_ptCut = TH2D_LW::create( "h_photon_deltae_eta_ptCut","; photon eta; photon deltae", m_PhotonEta_nbins, m_PhotonEta_low, m_PhotonEta_high, m_deltae_nbins, m_deltae_low, m_deltae_high ); + regHist( m_h_photon_deltae_eta_ptCut, path1, run).ignore(); + m_h_photon_eratio_eta_ptCut = TH2D_LW::create( "h_photon_eratio_eta_ptCut","; photon eta; photon eratio", m_PhotonEta_nbins, m_PhotonEta_low, m_PhotonEta_high, m_eratio_nbins, m_eratio_low, m_eratio_high ); + regHist( m_h_photon_eratio_eta_ptCut, path1, run).ignore(); + m_h_photon_f1_eta_ptCut = TH2D_LW::create( "h_photon_f1_eta_ptCut","; photon eta; photon f1", m_PhotonEta_nbins, m_PhotonEta_low, m_PhotonEta_high, m_f1_nbins, m_f1_low, m_f1_high ); + regHist( m_h_photon_f1_eta_ptCut, path1, run).ignore(); + + + // vs. FCal ET + + m_h_photon_reta_fcal_ptCut_eta0 = TH2D_LW::create( "h_photon_reta_fcal_ptCut_eta0","; FCal Sum ET; photon reta", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_reta_nbins, m_reta_low, m_reta_high ); + regHist( m_h_photon_reta_fcal_ptCut_eta0, path1, run).ignore(); + m_h_photon_reta_fcal_ptCut_eta1 = TH2D_LW::create( "h_photon_reta_fcal_ptCut_eta1","; FCal Sum ET; photon reta", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_reta_nbins, m_reta_low, m_reta_high ); + regHist( m_h_photon_reta_fcal_ptCut_eta1, path1, run).ignore(); + + m_h_photon_rphi_fcal_ptCut_eta0 = TH2D_LW::create( "h_photon_rphi_fcal_ptCut_eta0","; FCal Sum ET; photon rphi", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_rphi_nbins, m_rphi_low, m_rphi_high ); + regHist( m_h_photon_rphi_fcal_ptCut_eta0, path1, run).ignore(); + m_h_photon_rphi_fcal_ptCut_eta1 = TH2D_LW::create( "h_photon_rphi_fcal_ptCut_eta1","; FCal Sum ET; photon rphi", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_rphi_nbins, m_rphi_low, m_rphi_high ); + regHist( m_h_photon_rphi_fcal_ptCut_eta1, path1, run).ignore(); + + m_h_photon_weta2_fcal_ptCut_eta0 = TH2D_LW::create( "h_photon_weta2_fcal_ptCut_eta0","; FCal Sum ET; photon weta2", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_weta2_nbins, m_weta2_low, m_weta2_high ); + regHist( m_h_photon_weta2_fcal_ptCut_eta0, path1, run).ignore(); + m_h_photon_weta2_fcal_ptCut_eta1 = TH2D_LW::create( "h_photon_weta2_fcal_ptCut_eta1","; FCal Sum ET; photon weta2", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_weta2_nbins, m_weta2_low, m_weta2_high ); + regHist( m_h_photon_weta2_fcal_ptCut_eta1, path1, run).ignore(); + + + m_h_photon_rhad_fcal_ptCut_eta0 = TH2D_LW::create( "h_photon_rhad_fcal_ptCut_eta0","; FCal Sum ET; photon rhad", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_rhad_nbins, m_rhad_low, m_rhad_high ); + regHist( m_h_photon_rhad_fcal_ptCut_eta0, path1, run).ignore(); + m_h_photon_rhad_fcal_ptCut_eta1 = TH2D_LW::create( "h_photon_rhad_fcal_ptCut_eta1","; FCal Sum ET; photon rhad", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_rhad_nbins, m_rhad_low, m_rhad_high ); + regHist( m_h_photon_rhad_fcal_ptCut_eta1, path1, run).ignore(); + + m_h_photon_wtots1_fcal_ptCut_eta0 = TH2D_LW::create( "h_photon_wtots1_fcal_ptCut_eta0","; FCal Sum ET; photon wtots1", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_wtots1_nbins, m_wtots1_low, m_wtots1_high ); + regHist( m_h_photon_wtots1_fcal_ptCut_eta0, path1, run).ignore(); + m_h_photon_wtots1_fcal_ptCut_eta1 = TH2D_LW::create( "h_photon_wtots1_fcal_ptCut_eta1","; FCal Sum ET; photon wtots1", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_wtots1_nbins, m_wtots1_low, m_wtots1_high ); + regHist( m_h_photon_wtots1_fcal_ptCut_eta1, path1, run).ignore(); + + m_h_photon_fracs1_fcal_ptCut_eta0 = TH2D_LW::create( "h_photon_fracs1_fcal_ptCut_eta0","; FCal Sum ET; photon fracs1", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_fracs1_nbins, m_fracs1_low, m_fracs1_high ); + regHist( m_h_photon_fracs1_fcal_ptCut_eta0, path1, run).ignore(); + m_h_photon_fracs1_fcal_ptCut_eta1 = TH2D_LW::create( "h_photon_fracs1_fcal_ptCut_eta1","; FCal Sum ET; photon fracs1", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_fracs1_nbins, m_fracs1_low, m_fracs1_high ); + regHist( m_h_photon_fracs1_fcal_ptCut_eta1, path1, run).ignore(); + + + m_h_photon_deltae_fcal_ptCut_eta0 = TH2D_LW::create( "h_photon_deltae_fcal_ptCut_eta0","; FCal Sum ET; photon deltae", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_deltae_nbins, m_deltae_low, m_deltae_high ); + regHist( m_h_photon_deltae_fcal_ptCut_eta0, path1, run).ignore(); + m_h_photon_deltae_fcal_ptCut_eta1 = TH2D_LW::create( "h_photon_deltae_fcal_ptCut_eta1","; FCal Sum ET; photon deltae", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_deltae_nbins, m_deltae_low, m_deltae_high ); + regHist( m_h_photon_deltae_fcal_ptCut_eta1, path1, run).ignore(); + + m_h_photon_eratio_fcal_ptCut_eta0 = TH2D_LW::create( "h_photon_eratio_fcal_ptCut_eta0","; FCal Sum ET; photon eratio", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_eratio_nbins, m_eratio_low, m_eratio_high ); + regHist( m_h_photon_eratio_fcal_ptCut_eta0, path1, run).ignore(); + m_h_photon_eratio_fcal_ptCut_eta1 = TH2D_LW::create( "h_photon_eratio_fcal_ptCut_eta1","; FCal Sum ET; photon eratio", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_eratio_nbins, m_eratio_low, m_eratio_high ); + regHist( m_h_photon_eratio_fcal_ptCut_eta1, path1, run).ignore(); + + m_h_photon_f1_fcal_ptCut_eta0 = TH2D_LW::create( "h_photon_f1_fcal_ptCut_eta0","; FCal Sum ET; photon f1", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_f1_nbins, m_f1_low, m_f1_high ); + regHist( m_h_photon_f1_fcal_ptCut_eta0, path1, run).ignore(); + m_h_photon_f1_fcal_ptCut_eta1 = TH2D_LW::create( "h_photon_f1_fcal_ptCut_eta1","; FCal Sum ET; photon f1", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_f1_nbins, m_f1_low, m_f1_high ); + regHist( m_h_photon_f1_fcal_ptCut_eta1, path1, run).ignore(); + + std::string path2 = "HeavyIon/Photons/Isolation"; + + m_h_photon_fcal_etcone20_ptCut = TH2D_LW::create( "h_photon_fcal_etcone20_ptCut", "; FCal Sum ET; photon etcone20", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_IsoWide_nbins, m_IsoWide_low, m_IsoWide_high ); + regHist(m_h_photon_fcal_etcone20_ptCut, path2, run).ignore(); + + m_h_photon_fcal_etcone30_ptCut = TH2D_LW::create( "h_photon_fcal_etcone30_ptCut", "; FCal Sum ET; photon etcone30", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_IsoWide_nbins, m_IsoWide_low, m_IsoWide_high ); + regHist(m_h_photon_fcal_etcone30_ptCut, path2, run).ignore(); + + m_h_photon_fcal_etcone40_ptCut = TH2D_LW::create( "h_photon_fcal_etcone40_ptCut", "; FCal Sum ET; photon etcone40", m_FCalEt_nbins, m_FCalEt_low, m_FCalEt_high, m_IsoWide_nbins, m_IsoWide_low, m_IsoWide_high ); + regHist(m_h_photon_fcal_etcone40_ptCut, path2, run).ignore(); + + m_h_photon_pt_etcone40_fcal0 = TH2D_LW::create( "h_photon_pt_etcone40_fcal0", "; photon pT; photon etcone40", m_PhotonPt_nbins,m_PhotonPt_low,m_PhotonPt_high, m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); + regHist(m_h_photon_pt_etcone40_fcal0, path2, run).ignore(); + + m_h_photon_pt_etcone40_fcal1 = TH2D_LW::create( "h_photon_pt_etcone40_fcal1", "; photon pT; photon etcone40", m_PhotonPt_nbins,m_PhotonPt_low,m_PhotonPt_high, m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); + regHist(m_h_photon_pt_etcone40_fcal1, path2, run).ignore(); + + m_h_photon_pt_etcone40_fcal2 = TH2D_LW::create( "h_photon_pt_etcone40_fcal2", "; photon pT; photon etcone40", m_PhotonPt_nbins,m_PhotonPt_low,m_PhotonPt_high, m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); + regHist(m_h_photon_pt_etcone40_fcal2, path2, run).ignore(); + + // 1-D vs. FCal ET + m_h_photon_etcone20_ptCut_fcal0 = new TH1D( "h_photon_etcone20_ptCut_fcal0", "; photon etcone20", m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); + regHist(m_h_photon_etcone20_ptCut_fcal0, path2, run).ignore(); + + m_h_photon_etcone20_ptCut_fcal1 = new TH1D( "h_photon_etcone20_ptCut_fcal1", "; photon etcone20", m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); + regHist(m_h_photon_etcone20_ptCut_fcal1, path2, run).ignore(); + + m_h_photon_etcone20_ptCut_fcal2 = new TH1D( "h_photon_etcone20_ptCut_fcal2", "; photon etcone20", m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); + regHist(m_h_photon_etcone20_ptCut_fcal2, path2, run).ignore(); + + m_h_photon_etcone30_ptCut_fcal0 = new TH1D( "h_photon_etcone30_ptCut_fcal0", "; photon etcone30", m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); + regHist(m_h_photon_etcone30_ptCut_fcal0, path2, run).ignore(); + + m_h_photon_etcone30_ptCut_fcal1 = new TH1D( "h_photon_etcone30_ptCut_fcal1", "; photon etcone30", m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); + regHist(m_h_photon_etcone30_ptCut_fcal1, path2, run).ignore(); + + m_h_photon_etcone30_ptCut_fcal2 = new TH1D( "h_photon_etcone30_ptCut_fcal2", "; photon etcone30", m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); + regHist(m_h_photon_etcone30_ptCut_fcal2, path2, run).ignore(); + + m_h_photon_etcone40_ptCut_fcal0 = new TH1D( "h_photon_etcone40_ptCut_fcal0", "; photon etcone40", m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); + regHist(m_h_photon_etcone40_ptCut_fcal0, path2, run).ignore(); + + m_h_photon_etcone40_ptCut_fcal1 = new TH1D( "h_photon_etcone40_ptCut_fcal1", "; photon etcone40", m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); + regHist(m_h_photon_etcone40_ptCut_fcal1, path2, run).ignore(); + + m_h_photon_etcone40_ptCut_fcal2 = new TH1D( "h_photon_etcone40_ptCut_fcal2", "; photon etcone40", m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); + regHist(m_h_photon_etcone40_ptCut_fcal2, path2, run).ignore(); + + // 1-D vs. ID + + m_h_photon_etcone30_ptCut_fcal0_all = new TH1D( "h_photon_etcone30_ptCut_fcal0_all", "; photon etcone30", m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); + regHist(m_h_photon_etcone30_ptCut_fcal0_all, path2, run).ignore(); + m_h_photon_etcone30_ptCut_fcal0_loose = new TH1D( "h_photon_etcone30_ptCut_fcal0_loose", "; photon etcone30", m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); + regHist(m_h_photon_etcone30_ptCut_fcal0_loose, path2, run).ignore(); + m_h_photon_etcone30_ptCut_fcal0_tight = new TH1D( "h_photon_etcone30_ptCut_fcal0_tight", "; photon etcone30", m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); + regHist(m_h_photon_etcone30_ptCut_fcal0_tight, path2, run).ignore(); + + m_h_photon_etcone30_ptCut_fcal1_all = new TH1D( "h_photon_etcone30_ptCut_fcal1_all", "; photon etcone30", m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); + regHist(m_h_photon_etcone30_ptCut_fcal1_all, path2, run).ignore(); + m_h_photon_etcone30_ptCut_fcal1_loose = new TH1D( "h_photon_etcone30_ptCut_fcal1_loose", "; photon etcone30", m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); + regHist(m_h_photon_etcone30_ptCut_fcal1_loose, path2, run).ignore(); + m_h_photon_etcone30_ptCut_fcal1_tight = new TH1D( "h_photon_etcone30_ptCut_fcal1_tight", "; photon etcone30", m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); + regHist(m_h_photon_etcone30_ptCut_fcal1_tight, path2, run).ignore(); + + m_h_photon_etcone30_ptCut_fcal2_all = new TH1D( "h_photon_etcone30_ptCut_fcal2_all", "; photon etcone30", m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); + regHist(m_h_photon_etcone30_ptCut_fcal2_all, path2, run).ignore(); + m_h_photon_etcone30_ptCut_fcal2_loose = new TH1D( "h_photon_etcone30_ptCut_fcal2_loose", "; photon etcone30", m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); + regHist(m_h_photon_etcone30_ptCut_fcal2_loose, path2, run).ignore(); + m_h_photon_etcone30_ptCut_fcal2_tight = new TH1D( "h_photon_etcone30_ptCut_fcal2_tight", "; photon etcone30", m_IsoNarrow_nbins, m_IsoNarrow_low, m_IsoNarrow_high ); + regHist(m_h_photon_etcone30_ptCut_fcal2_tight, path2, run).ignore(); + +} diff --git a/Reconstruction/MET/METUtilities/src/METMakerAlg.cxx b/Reconstruction/MET/METUtilities/src/METMakerAlg.cxx index 00225495003331e3dd9410be39dcf5cd187bb85d..41df6e13b06010e0a6b9c2b5b26fc2ef41023eb7 100644 --- a/Reconstruction/MET/METUtilities/src/METMakerAlg.cxx +++ b/Reconstruction/MET/METUtilities/src/METMakerAlg.cxx @@ -21,6 +21,7 @@ #include "MuonSelectorTools/IMuonSelectionTool.h" #include "EgammaAnalysisInterfaces/IAsgElectronLikelihoodTool.h" #include "EgammaAnalysisInterfaces/IAsgPhotonIsEMSelector.h" +#include "PATCore/AcceptData.h" #include "TauAnalysisTools/ITauSelectionTool.h" using std::string; @@ -299,13 +300,13 @@ namespace met { bool METMakerAlg::accept(const xAOD::Electron* el) { if( fabs(el->eta())>2.47 || el->pt()<10e3 ) return false; - return m_elecSelLHTool->accept(el); + return static_cast<bool> (m_elecSelLHTool->accept(el)); } bool METMakerAlg::accept(const xAOD::Photon* ph) { if( !(ph->author()&20) || fabs(ph->eta())>2.47 || ph->pt()<10e3 ) return false; - return m_photonSelIsEMTool->accept(ph); + return static_cast<bool> (m_photonSelIsEMTool->accept(ph)); } bool METMakerAlg::accept(const xAOD::TauJet* tau) diff --git a/Reconstruction/egamma/egammaAlgs/src/egammaForwardBuilder.cxx b/Reconstruction/egamma/egammaAlgs/src/egammaForwardBuilder.cxx index c58ec8e5c926f2ae62f6af239fb4b33177e28bf7..4dfa273663e6a519553503ab49fa69bfa3e32362 100644 --- a/Reconstruction/egamma/egammaAlgs/src/egammaForwardBuilder.cxx +++ b/Reconstruction/egamma/egammaAlgs/src/egammaForwardBuilder.cxx @@ -18,6 +18,7 @@ #include "xAODEgamma/Electron.h" #include "EgammaAnalysisInterfaces/IAsgForwardElectronIsEMSelector.h" +#include "PATCore/AcceptData.h" #include <algorithm> #include <math.h> @@ -217,11 +218,11 @@ StatusCode egammaForwardBuilder::execute() size_t size = m_forwardelectronIsEMselectors.size(); for (size_t i = 0; i<size;++i) { - const Root::TAccept& accept = m_forwardelectronIsEMselectors[i]->accept(el); + asg::AcceptData accept = m_forwardelectronIsEMselectors[i]->accept(el); //save the bool result el->setPassSelection(static_cast<bool>(accept), m_forwardelectronIsEMselectorResultNames[i]); //save the isem - el->setSelectionisEM(m_forwardelectronIsEMselectors[i]->IsemValue(), "isEM"+m_forwardelectronIsEMselectorResultNames[i]); + el->setSelectionisEM(accept.getCutResultInverted(), "isEM"+m_forwardelectronIsEMselectorResultNames[i]); } } diff --git a/Reconstruction/egamma/egammaTools/src/EMPIDBuilder.cxx b/Reconstruction/egamma/egammaTools/src/EMPIDBuilder.cxx index b62eada374cd80b7163cd7a34b25633ef12345a1..58963e5e822b6209da886ab2c15bbf00723018fd 100644 --- a/Reconstruction/egamma/egammaTools/src/EMPIDBuilder.cxx +++ b/Reconstruction/egamma/egammaTools/src/EMPIDBuilder.cxx @@ -8,8 +8,7 @@ #include "EMPIDBuilder.h" #include "xAODEgamma/Egamma.h" //#include "LumiBlockComps/LumiBlockMuTool.h" -#include "PATCore/TAccept.h" // for TAccept -#include "PATCore/TResult.h" // for TResult +#include "PATCore/AcceptData.h" // =========================================================================== EMPIDBuilder::EMPIDBuilder(const std::string& type, @@ -42,7 +41,7 @@ StatusCode EMPIDBuilder::initialize() // ATH_MSG_DEBUG(" Initializing EMPIDBuilder"); - + for (const auto& selector : m_electronIsEMselectors) { CHECK(selector.retrieve()); } @@ -61,7 +60,6 @@ StatusCode EMPIDBuilder::initialize() return StatusCode::FAILURE; } - for (const auto& selector : m_genericIsEMselectors) { CHECK(selector.retrieve()); } @@ -70,8 +68,6 @@ StatusCode EMPIDBuilder::initialize() ATH_MSG_ERROR("The number of selectors does not match the number of given generic selector names"); return StatusCode::FAILURE; } - - for (const auto& selector : m_photonIsEMselectors) { CHECK(selector.retrieve()); } @@ -121,22 +117,32 @@ StatusCode EMPIDBuilder::execute(xAOD::Egamma* eg) size_t size = m_electronIsEMselectors.size(); for (size_t i = 0; i<size;++i) { - const Root::TAccept& accept = m_electronIsEMselectors[i]->accept(eg); + asg::AcceptData accept = m_electronIsEMselectors[i]->accept(eg); //save the bool result eg->setPassSelection(static_cast<bool>(accept), m_electronIsEMselectorResultNames[i]); //save the isem - eg->setSelectionisEM(m_electronIsEMselectors[i]->IsemValue(), "isEM"+m_electronIsEMselectorResultNames[i]); + unsigned int isEM = (~0); + if ( m_electronIsEMselectors[i]->execute(eg, isEM).isFailure() ) { + ATH_MSG_ERROR("problem to get isEM for " << m_electronIsEMselectorResultNames[i]); + return StatusCode::FAILURE; + } + eg->setSelectionisEM(isEM, "isEM"+m_electronIsEMselectorResultNames[i]); } size_t sizePh = m_photonIsEMselectors.size(); for (size_t i = 0; i<sizePh;++i) { - const Root::TAccept& accept = m_photonIsEMselectors[i]->accept(eg); + asg::AcceptData accept = m_photonIsEMselectors[i]->accept(eg); //save the bool result eg->setPassSelection(static_cast<bool>(accept), m_photonIsEMselectorResultNames[i]); //save the isem - eg->setSelectionisEM(m_photonIsEMselectors[i]->IsemValue(), "isEM"+m_photonIsEMselectorResultNames[i]); + unsigned int isEM = ~0; + if ( m_photonIsEMselectors[i]->execute(eg, isEM).isFailure() ) { + ATH_MSG_ERROR("problem to get isEM for " << m_photonIsEMselectorResultNames[i]); + return StatusCode::FAILURE; + } + eg->setSelectionisEM(isEM, "isEM"+m_photonIsEMselectorResultNames[i]); } size_t sizeLH = m_electronLHselectors.size(); @@ -153,7 +159,7 @@ StatusCode EMPIDBuilder::execute(xAOD::Egamma* eg) for (size_t i = 0; i<sizeLH; ++i) { - const Root::TAccept& accept = m_electronLHselectors[i]->accept(eg,avg_mu); + asg::AcceptData accept = m_electronLHselectors[i]->accept(eg,avg_mu); //save the bool result eg->setPassSelection(static_cast<bool>(accept), m_electronLHselectorResultNames[i]); //save the isem @@ -161,13 +167,13 @@ StatusCode EMPIDBuilder::execute(xAOD::Egamma* eg) //save the LHValue only once if(i==0){ - eg->setLikelihoodValue(static_cast<float>(m_electronLHselectors[i]->getTResult().getResult(0)),m_LHValueName); + eg->setLikelihoodValue(static_cast<float>(m_electronLHselectors[i]->calculate(eg,avg_mu)), m_LHValueName); } } size_t sizeGen = m_genericIsEMselectors.size(); for (size_t i = 0; i<sizeGen;++i) { - const Root::TAccept& accept = m_genericIsEMselectors[i]->accept(eg); + asg::AcceptData accept = m_genericIsEMselectors[i]->accept(eg); //save the bool result eg->setPassSelection(static_cast<bool>(accept), m_genericIsEMselectorResultNames[i]); //save the isem diff --git a/Reconstruction/egamma/egammaTools/src/EMPIDBuilder.h b/Reconstruction/egamma/egammaTools/src/EMPIDBuilder.h index 5e8047e8cf4d1cddaf514b91b8b7a58f7b8df58a..7a960395f7e984073b66cf220bedf7a300a8caff 100644 --- a/Reconstruction/egamma/egammaTools/src/EMPIDBuilder.h +++ b/Reconstruction/egamma/egammaTools/src/EMPIDBuilder.h @@ -59,7 +59,7 @@ protected: Gaudi::Property<std::vector<std::string> > m_electronLHselectorResultNames {this, "electronLHselectorResultNames", {}, "The selector result names"}; - ToolHandleArray<IAsgSelectionTool> m_genericIsEMselectors {this, + ToolHandleArray<CP::ISelectionTool> m_genericIsEMselectors {this, "genericIsEMselectors", {}, "The selectors that we need to apply to the generic object"}; Gaudi::Property<std::vector<std::string> > m_genericIsEMselectorResultNames {this, diff --git a/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.cxx b/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.cxx index 5761c91aeb75410a219f3df58791a7912b9b6591..34af23d9528bc7f35c1dd633a58bc84307d2962c 100644 --- a/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.cxx +++ b/Reconstruction/egamma/egammaValidation/src/EgammaMonitoring.cxx @@ -20,6 +20,7 @@ #include "xAODEgamma/EgammaxAODHelpers.h" #include <AsgTools/AnaToolHandle.h> #include "EgammaAnalysisInterfaces/IAsgElectronLikelihoodTool.h" +#include "PATCore/AcceptData.h" #include <vector> #include <cmath> diff --git a/Reconstruction/tauRecTools/Root/TauEleOLRDecorator.cxx b/Reconstruction/tauRecTools/Root/TauEleOLRDecorator.cxx index 53b442ae891c2cb896d5e67bc5adac74e0b739ee..2b039a85668f849bd306c3c7343c12fb9ec29714 100644 --- a/Reconstruction/tauRecTools/Root/TauEleOLRDecorator.cxx +++ b/Reconstruction/tauRecTools/Root/TauEleOLRDecorator.cxx @@ -110,7 +110,7 @@ StatusCode TauEleOLRDecorator::execute(xAOD::TauJet& tau) // compute the LH score if there is a match if(xEleMatch!=0) - fLHScore = (m_tEMLHTool->calculate(xEleMatch)).getMVAResponse (); + fLHScore = m_tEMLHTool->calculate(xEleMatch); // create link to the matched electron if (xEleMatch) diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavBaseTool.cxx b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavBaseTool.cxx index bd885310cefba86ec3e87ff0e2957239b53a2caa..9622c8247eba8408dca1fd18d98047a6bfe380eb 100644 --- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavBaseTool.cxx +++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavBaseTool.cxx @@ -16,6 +16,7 @@ #include "egammaMVACalib/IegammaMVATool.h" #include "TrigEgammaAnalysisTools/TrigEgammaNavBaseTool.h" #include "TrigConfxAOD/xAODConfigTool.h" +#include "PATCore/AcceptData.h" #include "string" #include <algorithm> @@ -154,27 +155,27 @@ StatusCode TrigEgammaNavBaseTool::executeNavigation( const TrigInfo info ){ bool TrigEgammaNavBaseTool::ApplyElectronPid(const xAOD::Electron *eg, const std::string pidname){ if (pidname == "Tight"){ - const Root::TAccept& accept=m_electronIsEMTool[0]->accept(eg); + bool accept = (bool) m_electronIsEMTool[0]->accept(eg); return static_cast<bool>(accept); } else if (pidname == "Medium"){ - const Root::TAccept& accept=m_electronIsEMTool[1]->accept(eg); + bool accept = (bool) m_electronIsEMTool[1]->accept(eg); return static_cast<bool>(accept); } else if (pidname == "Loose"){ - const Root::TAccept& accept=m_electronIsEMTool[2]->accept(eg); + bool accept = (bool) m_electronIsEMTool[2]->accept(eg); return static_cast<bool>(accept); } else if (pidname == "LHTight"){ - const Root::TAccept& accept=m_electronLHTool[0]->accept(eg); + bool accept = (bool) m_electronLHTool[0]->accept(eg); return static_cast<bool>(accept); } else if (pidname == "LHMedium"){ - const Root::TAccept& accept=m_electronLHTool[1]->accept(eg); + bool accept = (bool) m_electronLHTool[1]->accept(eg); return static_cast<bool>(accept); } else if (pidname == "LHLoose"){ - const Root::TAccept& accept=m_electronLHTool[2]->accept(eg); + bool accept = (bool) m_electronLHTool[2]->accept(eg); return static_cast<bool>(accept); } else ATH_MSG_DEBUG("No Pid tool, continue without PID"); diff --git a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavTPBaseTool.cxx b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavTPBaseTool.cxx index 19570ccafe36e54bce4634a0fb02ae3b3ef24ba0..c9fbed9af6456a99556ea08ab5ef296ada0e7d94 100644 --- a/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavTPBaseTool.cxx +++ b/Trigger/TrigAnalysis/TrigEgammaAnalysisTools/Root/TrigEgammaNavTPBaseTool.cxx @@ -23,6 +23,7 @@ #include "TrigEgammaAnalysisTools/TrigEgammaNavTPBaseTool.h" #include "TrigConfxAOD/xAODConfigTool.h" #include "xAODEventInfo/EventInfo.h" +#include "PATCore/AcceptData.h" #include "string" #include <algorithm> #include "boost/algorithm/string.hpp" @@ -375,12 +376,12 @@ bool TrigEgammaNavTPBaseTool::isTagElectron(const xAOD::Electron *el){ void TrigEgammaNavTPBaseTool::DressPid(const xAOD::Electron *eg){ for(int ipid=0;ipid<3;ipid++){ - const Root::TAccept& accept=m_electronIsEMTool[ipid]->accept(eg); + bool accept = (bool) m_electronIsEMTool[ipid]->accept(eg); const std::string pidname="is"+m_isemname[ipid]; eg->auxdecor<bool>(pidname)=static_cast<bool>(accept); } for(int ipid=0;ipid<3;ipid++){ - const Root::TAccept& accept=m_electronLHTool[ipid]->accept(eg); + bool accept = (bool) m_electronLHTool[ipid]->accept(eg); const std::string pidname="is"+m_lhname[ipid]; eg->auxdecor<bool>(pidname)=static_cast<bool>(accept); } @@ -390,27 +391,27 @@ void TrigEgammaNavTPBaseTool::DressPid(const xAOD::Electron *eg){ bool TrigEgammaNavTPBaseTool::ApplyElectronPid(const xAOD::Electron *eg, const std::string pidname){ if (pidname == "Tight"){ - const Root::TAccept& accept=m_electronIsEMTool[0]->accept(eg); + bool accept = (bool) m_electronIsEMTool[0]->accept(eg); return static_cast<bool>(accept); } else if (pidname == "Medium"){ - const Root::TAccept& accept=m_electronIsEMTool[1]->accept(eg); + bool accept = (bool) m_electronIsEMTool[1]->accept(eg); return static_cast<bool>(accept); } else if (pidname == "Loose"){ - const Root::TAccept& accept=m_electronIsEMTool[2]->accept(eg); + bool accept = (bool) m_electronIsEMTool[2]->accept(eg); return static_cast<bool>(accept); } else if (pidname == "LHTight"){ - const Root::TAccept& accept=m_electronLHTool[0]->accept(eg); + bool accept = (bool) m_electronLHTool[0]->accept(eg); return static_cast<bool>(accept); } else if (pidname == "LHMedium"){ - const Root::TAccept& accept=m_electronLHTool[1]->accept(eg); + bool accept = (bool) m_electronLHTool[1]->accept(eg); return static_cast<bool>(accept); } else if (pidname == "LHLoose"){ - const Root::TAccept& accept=m_electronLHTool[2]->accept(eg); + bool accept = (bool) m_electronLHTool[2]->accept(eg); return static_cast<bool>(accept); } else ATH_MSG_DEBUG("No Pid tool, continue without PID"); diff --git a/Trigger/TrigAnalysis/TrigEgammaEmulationTool/Root/TrigEgammaEFCaloSelectorTool.cxx b/Trigger/TrigAnalysis/TrigEgammaEmulationTool/Root/TrigEgammaEFCaloSelectorTool.cxx index c57485fe58fe4741b24557942296948f28025b97..c4337a24a1fa6d212680b7c8d8f7ddb975f6b850 100755 --- a/Trigger/TrigAnalysis/TrigEgammaEmulationTool/Root/TrigEgammaEFCaloSelectorTool.cxx +++ b/Trigger/TrigAnalysis/TrigEgammaEmulationTool/Root/TrigEgammaEFCaloSelectorTool.cxx @@ -12,6 +12,7 @@ * **********************************************************************/ #include "TrigEgammaEmulationTool/TrigEgammaEFCaloSelectorTool.h" +#include "PATCore/AcceptData.h" #include <boost/foreach.hpp> #include <boost/tokenizer.hpp> #include "boost/algorithm/string.hpp" @@ -106,31 +107,31 @@ bool TrigEgammaEFCaloSelectorTool::ApplyCaloPid(const xAOD::Egamma *eg, const st //float lhValue=0.0; //eg->passSelection(passSel,pidname); if (pidname == "Tight") { - passTool = m_electronCaloIsEMTool[0]->accept(eg); + passTool = (bool) m_electronCaloIsEMTool[0]->accept(eg); } else if (pidname == "Medium") { - passTool = m_electronCaloIsEMTool[1]->accept(eg); + passTool = (bool) m_electronCaloIsEMTool[1]->accept(eg); } else if (pidname == "Loose") { - passTool = m_electronCaloIsEMTool[2]->accept(eg); + passTool = (bool) m_electronCaloIsEMTool[2]->accept(eg); } else if (pidname == "VLoose") { - passTool = m_electronCaloIsEMTool[3]->accept(eg); + passTool = (bool) m_electronCaloIsEMTool[3]->accept(eg); } else if (pidname == "LHTight") { - passTool = m_electronCaloLHTool[0]->accept(eg,avg_mu); + passTool = (bool) m_electronCaloLHTool[0]->accept(eg,avg_mu); //lhValue = m_electronCaloLHTool[0]->getTResult().getResult(0); } else if (pidname == "LHMedium") { - passTool = m_electronCaloLHTool[1]->accept(eg,avg_mu); + passTool = (bool) m_electronCaloLHTool[1]->accept(eg,avg_mu); //lhValue = m_electronCaloLHTool[1]->getTResult().getResult(0); } else if (pidname == "LHLoose") { - passTool = m_electronCaloLHTool[2]->accept(eg,avg_mu); + passTool = (bool) m_electronCaloLHTool[2]->accept(eg,avg_mu); //lhValue = m_electronCaloLHTool[2]->getTResult().getResult(0); } else if (pidname == "LHVLoose") { - passTool = m_electronCaloLHTool[3]->accept(eg,avg_mu); + passTool = (bool) m_electronCaloLHTool[3]->accept(eg,avg_mu); //lhValue = m_electronCaloLHTool[3]->getTResult().getResult(0); } else { diff --git a/Trigger/TrigAnalysis/TrigEgammaEmulationTool/Root/TrigEgammaEFElectronSelectorTool.cxx b/Trigger/TrigAnalysis/TrigEgammaEmulationTool/Root/TrigEgammaEFElectronSelectorTool.cxx index b3fc6ccef60fb25202eb9bec87c326628cb421b1..61fd96350d209f73330fc53bfa3a1f8e5ae43135 100755 --- a/Trigger/TrigAnalysis/TrigEgammaEmulationTool/Root/TrigEgammaEFElectronSelectorTool.cxx +++ b/Trigger/TrigAnalysis/TrigEgammaEmulationTool/Root/TrigEgammaEFElectronSelectorTool.cxx @@ -12,6 +12,7 @@ * **********************************************************************/ #include "TrigEgammaEmulationTool/TrigEgammaEFElectronSelectorTool.h" +#include "PATCore/AcceptData.h" #include <boost/foreach.hpp> #include <boost/tokenizer.hpp> #include "boost/algorithm/string.hpp" @@ -166,28 +167,28 @@ bool TrigEgammaEFElectronSelectorTool::ApplyElectronPid(const xAOD::Electron *eg bool passSel=false; eg->passSelection(passSel,pidname); if (pidname == "Tight") { - passTool = m_electronOnlIsEMTool[0]->accept(eg); + passTool = (bool) m_electronOnlIsEMTool[0]->accept(eg); } else if (pidname == "Medium") { - passTool = m_electronOnlIsEMTool[1]->accept(eg); + passTool = (bool) m_electronOnlIsEMTool[1]->accept(eg); } else if (pidname == "Loose") { - passTool = m_electronOnlIsEMTool[2]->accept(eg); + passTool = (bool) m_electronOnlIsEMTool[2]->accept(eg); } else if (pidname == "VLoose") { - passTool = m_electronOnlIsEMTool[3]->accept(eg); + passTool = (bool) m_electronOnlIsEMTool[3]->accept(eg); } else if (pidname == "LHTight") { - passTool = m_electronOnlLHTool[0]->accept(eg,avgmu); + passTool = (bool) m_electronOnlLHTool[0]->accept(eg,avgmu); }// Tight else if (pidname == "LHMedium") { - passTool = m_electronOnlLHTool[1]->accept(eg,avgmu); + passTool = (bool) m_electronOnlLHTool[1]->accept(eg,avgmu); }// Medium else if (pidname == "LHLoose") { - passTool = m_electronOnlLHTool[2]->accept(eg,avgmu); + passTool = (bool) m_electronOnlLHTool[2]->accept(eg,avgmu); }// Loose else if (pidname == "LHVLoose") { - passTool = m_electronOnlLHTool[3]->accept(eg,avgmu); + passTool = (bool) m_electronOnlLHTool[3]->accept(eg,avgmu); }// VeryLoose else { ATH_MSG_DEBUG("No Pid tool, continue without PID"); diff --git a/Trigger/TrigAnalysis/TrigEgammaEmulationTool/Root/TrigEgammaEFPhotonSelectorTool.cxx b/Trigger/TrigAnalysis/TrigEgammaEmulationTool/Root/TrigEgammaEFPhotonSelectorTool.cxx index 00edab472b083b69306722128a5890db59baf2f0..4975acb28ccc16966dc7556d6bd4721677c75e33 100755 --- a/Trigger/TrigAnalysis/TrigEgammaEmulationTool/Root/TrigEgammaEFPhotonSelectorTool.cxx +++ b/Trigger/TrigAnalysis/TrigEgammaEmulationTool/Root/TrigEgammaEFPhotonSelectorTool.cxx @@ -12,6 +12,7 @@ * **********************************************************************/ #include "TrigEgammaEmulationTool/TrigEgammaEFPhotonSelectorTool.h" +#include "PATCore/AcceptData.h" #include <boost/foreach.hpp> #include <boost/tokenizer.hpp> #include "boost/algorithm/string.hpp" @@ -81,13 +82,13 @@ bool TrigEgammaEFPhotonSelectorTool::ApplyPhotonPid(const xAOD::Photon *eg, cons bool passSel=false; eg->passSelection(passSel,pidname); if (pidname == "Tight") { - passTool = m_photonOnlIsEMTool[0]->accept(eg); + passTool = (bool) m_photonOnlIsEMTool[0]->accept(eg); } else if (pidname == "Medium") { - passTool = m_photonOnlIsEMTool[1]->accept(eg); + passTool = (bool) m_photonOnlIsEMTool[1]->accept(eg); } else if (pidname == "Loose") { - passTool = m_photonOnlIsEMTool[2]->accept(eg); + passTool = (bool) m_photonOnlIsEMTool[2]->accept(eg); } else { ATH_MSG_DEBUG("No Pid tool, continue without PID"); diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFCaloHypo.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFCaloHypo.cxx index 114716d9a21d24d39260dd5becda30ec92cfb687..8545d2a06f35720dd6beaa5a23d78c33aea5bb95 100755 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFCaloHypo.cxx +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFCaloHypo.cxx @@ -33,8 +33,7 @@ #include "CaloEvent/CaloCellContainer.h" #include "CLHEP/Units/SystemOfUnits.h" #include "xAODTrigger/TrigPassBits.h" -#include "PATCore/TAccept.h" // for TAccept -#include "PATCore/TResult.h" // for TResult +#include "PATCore/AcceptData.h" class ISvcLocator; @@ -356,28 +355,30 @@ HLT::ErrorCode TrigEFCaloHypo::hltExecute(const HLT::TriggerElement* outputTE, // Apply selection if(m_applyIsEM){ ATH_MSG_DEBUG("REGTEST: Check Object, eta2 = " << fabsf(eg.caloCluster()->etaBE(2)) << " e = " << eg.caloCluster()->e()); - if(m_SelectorTool->execute(&eg).isFailure()) + unsigned int isEM = 0; + if(m_SelectorTool->execute(&eg, isEM).isFailure()) ATH_MSG_DEBUG("REGTEST:: Problem in isEM Selector"); - else isEMTrig = m_SelectorTool->IsemValue(); + else isEMTrig = isEM; } else if(m_applyPhotonIsEM){ ATH_MSG_DEBUG("REGTEST: Check Object, eta2 = " << fabsf(eg.caloCluster()->etaBE(2)) << " e = " << eg.caloCluster()->e()); - if(m_PhSelectorTool->execute(&eg).isFailure()) + unsigned int isEM = 0; + if(m_PhSelectorTool->execute(&eg, isEM).isFailure()) ATH_MSG_DEBUG("REGTEST:: Problem in isEM Selector"); - else isEMTrig = m_PhSelectorTool->IsemValue(); + else isEMTrig = isEM; } else if(m_applyLH){ if(useLumiTool){ - const Root::TAccept& acc = m_LHSelectorTool->accept(&eg,avg_mu); - lhval=m_LHSelectorTool->getTResult().getResult(0); + asg::AcceptData acc = m_LHSelectorTool->accept(&eg,avg_mu); + lhval = m_LHSelectorTool->calculate(&eg); ATH_MSG_DEBUG("LHValue with mu " << lhval); m_lhval.push_back(lhval); isLHAcceptTrig = (bool) (acc); } else { ATH_MSG_DEBUG("Lumi tool returns mu = 0, do not pass mu"); - const Root::TAccept& lhacc = m_LHSelectorTool->accept(&eg); // use method for calo-only - lhval=m_LHSelectorTool->getTResult().getResult(0); + asg::AcceptData lhacc = m_LHSelectorTool->accept(&eg); // use method for calo-only + lhval = m_LHSelectorTool->calculate(&eg); ATH_MSG_DEBUG("LHValue without mu " << lhval); m_lhval.push_back(lhval); isLHAcceptTrig = (bool) (lhacc); diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFElectronHypo.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFElectronHypo.cxx index c7b333dd4c08c332cb3602e4d6174653cad1dd67..3358b887fb2d4c36042b1dc5b79962b9928d2333 100755 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFElectronHypo.cxx +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFElectronHypo.cxx @@ -36,8 +36,7 @@ #include "VxVertex/RecVertex.h" #include "ITrackToVertex/ITrackToVertex.h" #include "TrigTimeAlgs/TrigTimerSvc.h" -#include "PATCore/TAccept.h" // for TAccept -#include "PATCore/TResult.h" // for TResult +#include "PATCore/AcceptData.h" #include "xAODTrigger/TrigPassBits.h" using std::string; @@ -484,16 +483,16 @@ HLT::ErrorCode TrigEFElectronHypo::hltExecute(const HLT::TriggerElement* outputT }else{ if (timerSvc()) m_timerPIDTool->start(); //timer if(useLumiTool){ - const Root::TAccept& acc = m_athElectronLHIDSelectorTool->accept(egIt,avg_mu); - lhval=m_athElectronLHIDSelectorTool->getTResult().getResult(0); + asg::AcceptData acc = m_athElectronLHIDSelectorTool->accept(egIt,avg_mu); + lhval = m_athElectronLHIDSelectorTool->calculate(egIt,avg_mu); ATH_MSG_DEBUG("LHValue with mu " << lhval); m_lhval.push_back(lhval); isLHAcceptTrig = (bool) (acc); } else { ATH_MSG_DEBUG("Lumi tool returns mu = 0, do not pass mu"); - const Root::TAccept& acc = m_athElectronLHIDSelectorTool->accept(egIt); - lhval=m_athElectronLHIDSelectorTool->getTResult().getResult(0); + asg::AcceptData acc = m_athElectronLHIDSelectorTool->accept(egIt); + lhval = m_athElectronLHIDSelectorTool->calculate(egIt); ATH_MSG_DEBUG("LHValue without mu " << lhval); m_lhval.push_back(lhval); isLHAcceptTrig = (bool) (acc); @@ -511,9 +510,10 @@ HLT::ErrorCode TrigEFElectronHypo::hltExecute(const HLT::TriggerElement* outputT ATH_MSG_ERROR(m_egammaElectronCutIDTool << " null, hypo continues but no isEM cut applied"); }else{ if (timerSvc()) m_timerPIDTool->start(); //timer - if ( m_egammaElectronCutIDTool->execute(egIt).isFailure() ) + unsigned int isEM = 0; + if ( m_egammaElectronCutIDTool->execute(egIt, isEM).isFailure() ) ATH_MSG_DEBUG("problem with egammaElectronCutIDTool, egamma object not stored"); - isEMTrig = m_egammaElectronCutIDTool->IsemValue(); + isEMTrig = isEM; if(msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG <<" isEMTrig = " << std::hex << isEMTrig diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFPhotonHypo.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFPhotonHypo.cxx index 6e1c7972eba298e4bafac4dd41712a722bc741ec..eb7615e0efd1bc9cb8c8273ad53c5238281bb88a 100755 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFPhotonHypo.cxx +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFPhotonHypo.cxx @@ -45,8 +45,7 @@ #include "xAODEgamma/Electron.h" #include "xAODEgamma/Photon.h" #include "xAODEgammaCnv/xAODPhotonMonFuncs.h" -#include "PATCore/TAccept.h" // for TAccept -#include "PATCore/TResult.h" // for TResult +#include "PATCore/AcceptData.h" // to add TrigPassBits #include "xAODTrigger/TrigPassBits.h" using std::string; @@ -356,18 +355,15 @@ HLT::ErrorCode TrigEFPhotonHypo::hltExecute(const HLT::TriggerElement* outputTE, msg() << MSG::ERROR << m_egammaPhotonCutIDTool << " null, hypo continues but no isEM cut applied" << endmsg; }else{ if (timerSvc()) m_timerPIDTool_Pho->start(); //timer - if ( m_egammaPhotonCutIDTool->accept(egIt) ) { + if ( (bool) m_egammaPhotonCutIDTool->accept(egIt) ) { if(msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << "passes PID egammaPhotonCutIDTool with TAccept" << endmsg; } // Get isEM value from m_egammaPhotonCutIDTool->IsemValue(), not from (*egIt)->isem() - if(msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG <<" IsemValue() = "<< m_egammaPhotonCutIDTool->IsemValue()<< endmsg; - isEMTrig = m_egammaPhotonCutIDTool->IsemValue(); - if(msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG - <<" isEMTrig = " - << std::hex << isEMTrig - << endmsg; + if (m_egammaPhotonCutIDTool->execute(egIt, isEMTrig).isFailure()) + ATH_MSG_DEBUG("REGTEST Could not get isEM value "); + ATH_MSG_DEBUG(" isEMTrig = " << std::hex << isEMTrig); if (timerSvc()) m_timerPIDTool_Pho->stop(); //timer } //-------------------------------------------------------------