From bb9b779842ebb620f6d0fef942b2f43cc76027e7 Mon Sep 17 00:00:00 2001 From: Ryan Mackenzie White <ryan.white@cern.ch> Date: Mon, 8 Sep 2014 15:50:35 +0200 Subject: [PATCH] bug fix in photon tool name (TrigEgammaHypo-01-00-44) --- .../TrigEgammaHypo/TrigEFCaloHypo.h | 110 + .../TrigEgammaHypo/TrigEFDielectronMassFex.h | 88 + .../TrigEgammaHypo/TrigEFDielectronMassHypo.h | 87 + .../TrigEgammaHypo/TrigEFElectronHypo.h | 375 +++ .../TrigEgammaHypo/TrigEFHadronicRecoil.h | 32 + .../TrigEgammaHypo/TrigEFPhotonHypo.h | 212 ++ .../TrigEgammaHypo/TrigEFTrackHypo.h | 113 + .../TrigEgammaHypo/TrigL2CaloHypo.h | 95 + .../TrigEgammaHypo/TrigL2CaloLayersHypo.h | 71 + .../TrigEgammaHypo/TrigL2DielectronMassFex.h | 127 + .../TrigEgammaHypo/TrigL2DielectronMassHypo.h | 86 + .../TrigEgammaHypo/TrigL2ElectronFex.h | 145 + .../TrigEgammaHypo/TrigL2ElectronHypo.h | 140 + .../TrigEgammaHypo/TrigL2ElectronHypoMoni.h | 126 + .../TrigEgammaHypo/TrigL2PhotonFex.h | 75 + .../TrigEgammaHypo/TrigL2PhotonHypo.h | 123 + .../TrigEgammaHypo/cmt/requirements | 57 + .../TrigEgammaHypo/doc/Doxyfile | 231 ++ .../TrigEgammaHypo/doc/EgammaPlots.kumac | 44 + .../TrigEgammaHypo/doc/mainpage.h | 33 + .../TrigEgammaHypo/doc/used_packages.html | 28 + .../TrigEgammaHypo/python/Cosmic.temp.py | 2737 +++++++++++++++++ .../TrigEgammaHypo/python/ElectronDef.temp.py | 1089 +++++++ .../TrigEgammaHypo/python/PhotonDef.temp.py | 350 +++ .../python/TrigEFDielectronMassHypoConfig.py | 149 + .../TrigEFDielectronMassHypoMonitoring.py | 70 + .../python/TrigEFElectronHypoConfig.py | 677 ++++ .../python/TrigEFElectronHypoMonitoring.py | 476 +++ .../python/TrigEFHadronicRecoilConfig.py | 10 + .../python/TrigEFPhotonHypoConfig.py | 138 + .../python/TrigEFPhotonHypoMonitoring.py | 225 ++ .../python/TrigEFTrackHypoConfig.py | 100 + .../python/TrigEGammaPIDdefs.py | 591 ++++ .../python/TrigEGammaPIDdefsDC14.py | 237 ++ .../TrigEgammaElectronIsEMSelectorMapping.py | 73 + .../python/TrigL2CaloHypoConfig.py | 239 ++ .../python/TrigL2CaloHypoCutDefs.py | 173 ++ .../python/TrigL2CaloHypoMonitoring.py | 141 + .../python/TrigL2DielectronMassHypoConfig.py | 176 ++ .../TrigL2DielectronMassHypoMonitoring.py | 48 + .../python/TrigL2ElectronFexConfig.py | 204 ++ .../python/TrigL2ElectronHypoConfig.py | 134 + .../python/TrigL2ElectronHypoMonitoring.py | 72 + .../python/TrigL2PhotonFexConfig.py | 14 + .../python/TrigL2PhotonHypoConfig.py | 1152 +++++++ .../python/TrigL2PhotonHypoMonitoring.py | 127 + .../python/UnseededEgamma.temp.py | 373 +++ .../TrigEgammaHypo/python/__init__.py | 23 + .../TrigEgammaHypo/src/TrigEFCaloHypo.cxx | 221 ++ .../src/TrigEFDielectronMassFex.cxx | 344 +++ .../src/TrigEFDielectronMassHypo.cxx | 155 + .../TrigEgammaHypo/src/TrigEFElectronHypo.cxx | 854 +++++ .../src/TrigEFHadronicRecoil.cxx | 126 + .../TrigEgammaHypo/src/TrigEFPhotonHypo.cxx | 466 +++ .../TrigEgammaHypo/src/TrigEFTrackHypo.cxx | 248 ++ .../TrigEgammaHypo/src/TrigL2CaloHypo.cxx | 408 +++ .../src/TrigL2CaloLayersHypo.cxx | 192 ++ .../src/TrigL2DielectronMassFex.cxx | 531 ++++ .../src/TrigL2DielectronMassHypo.cxx | 150 + .../TrigEgammaHypo/src/TrigL2ElectronFex.cxx | 519 ++++ .../TrigEgammaHypo/src/TrigL2ElectronHypo.cxx | 353 +++ .../src/TrigL2ElectronHypoMoni.cxx | 277 ++ .../TrigEgammaHypo/src/TrigL2PhotonFex.cxx | 200 ++ .../TrigEgammaHypo/src/TrigL2PhotonHypo.cxx | 391 +++ .../src/components/TrigEgammaHypo_entries.cxx | 57 + .../src/components/TrigEgammaHypo_load.cxx | 4 + 66 files changed, 17692 insertions(+) create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigEFCaloHypo.h create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigEFDielectronMassFex.h create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigEFDielectronMassHypo.h create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigEFElectronHypo.h create mode 100644 Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigEFHadronicRecoil.h create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigEFPhotonHypo.h create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigEFTrackHypo.h create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2CaloHypo.h create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2CaloLayersHypo.h create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2DielectronMassFex.h create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2DielectronMassHypo.h create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2ElectronFex.h create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2ElectronHypo.h create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2ElectronHypoMoni.h create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2PhotonFex.h create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2PhotonHypo.h create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/cmt/requirements create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/doc/Doxyfile create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/doc/EgammaPlots.kumac create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/doc/mainpage.h create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/doc/used_packages.html create mode 100644 Trigger/TrigHypothesis/TrigEgammaHypo/python/Cosmic.temp.py create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/python/ElectronDef.temp.py create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/python/PhotonDef.temp.py create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFDielectronMassHypoConfig.py create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFDielectronMassHypoMonitoring.py create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFElectronHypoConfig.py create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFElectronHypoMonitoring.py create mode 100644 Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFHadronicRecoilConfig.py create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFPhotonHypoConfig.py create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFPhotonHypoMonitoring.py create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFTrackHypoConfig.py create mode 100644 Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEGammaPIDdefs.py create mode 100644 Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEGammaPIDdefsDC14.py create mode 100644 Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEgammaElectronIsEMSelectorMapping.py create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2CaloHypoConfig.py create mode 100644 Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2CaloHypoCutDefs.py create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2CaloHypoMonitoring.py create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2DielectronMassHypoConfig.py create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2DielectronMassHypoMonitoring.py create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2ElectronFexConfig.py create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2ElectronHypoConfig.py create mode 100644 Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2ElectronHypoMonitoring.py create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2PhotonFexConfig.py create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2PhotonHypoConfig.py create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2PhotonHypoMonitoring.py create mode 100644 Trigger/TrigHypothesis/TrigEgammaHypo/python/UnseededEgamma.temp.py create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/python/__init__.py create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFCaloHypo.cxx create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFDielectronMassFex.cxx create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFDielectronMassHypo.cxx create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFElectronHypo.cxx create mode 100644 Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFHadronicRecoil.cxx create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFPhotonHypo.cxx create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFTrackHypo.cxx create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2CaloHypo.cxx create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2CaloLayersHypo.cxx create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2DielectronMassFex.cxx create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2DielectronMassHypo.cxx create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronFex.cxx create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronHypo.cxx create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronHypoMoni.cxx create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2PhotonFex.cxx create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2PhotonHypo.cxx create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/src/components/TrigEgammaHypo_entries.cxx create mode 100755 Trigger/TrigHypothesis/TrigEgammaHypo/src/components/TrigEgammaHypo_load.cxx diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigEFCaloHypo.h b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigEFCaloHypo.h new file mode 100755 index 00000000000..5a221a65e94 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigEFCaloHypo.h @@ -0,0 +1,110 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/******************************************************************** + * + * NAME: TrigEFCaloHypo.h + * PACKAGE: Trigger/TrigHypothesis/TrigEgammaHypo + * + * AUTHOR: P. Conde Muino + * CREATED: Nov 25, 2004 + * MODIFIED: V. Perez Reale migration to new Steering 1/12/06 + * + *********************************************************************/ +#ifndef TRIGEFCALOHYPO_H +#define TRIGEFCALOHYPO_H + +#include <string> +#include <cmath> +//#include <map.h> + +// athena stuff stuff +#include "GaudiKernel/MsgStream.h" +#include "GaudiKernel/IToolSvc.h" +#include "GaudiKernel/StatusCode.h" +#include "StoreGate/StoreGateSvc.h" +#include "CLHEP/Units/SystemOfUnits.h" + +// core trigger stuff +#include "TrigT1Interfaces/RecEmTauRoI.h" +#include "TrigInterfaces/HypoAlgo.h" + + +//#include <string +#include "TrigTimeAlgs/TrigTimerSvc.h" + +#include "GaudiKernel/IHistogramSvc.h" +#include "AIDA/IHistogram1D.h" + + +class StoreGateSvc; +class TriggerElement; + + + +/** + * \class TrigEFCaloHypo + * \brief TrigEFCaloHypo is a Trigger Hypo Algorithm that retrieves the EF CaloCluster + * container created by TrigCaloRec + * Apply calorimeter selction cuts like ET + * + */ + + +class TrigEFCaloHypo : public HLT::HypoAlgo { + + public: + + TrigEFCaloHypo(const std::string& name, ISvcLocator* pSvcLocator); + ~TrigEFCaloHypo(); + + HLT::ErrorCode hltInitialize(); + HLT::ErrorCode hltFinalize(); + HLT::ErrorCode hltExecute(const HLT::TriggerElement* outputTE, bool& pass); + + private: + + // define the properties: + //---------------------------- + + // Cuts to be applied: + + double m_EtCut; + double m_deltaPhiCut; + double m_deltaEtaCut; + double m_energySecondSampling; + double m_isEM; + double m_etCalibFactor; + + + // Switch on Monitoring: + + bool m_doMonitoring; + + // Histograms: + + /* IHistogram1D* m_efOrigEt; */ +/* IHistogram1D* m_efDeltaPhi; */ +/* IHistogram1D* m_efDeltaEta; */ +/* IHistogram1D* m_efege277; */ +/* IHistogram1D* m_efisEM; */ + + + // path for the histograms: + + std::string m_path; + + // Histogram Service: + IHistogramSvc* m_histsvc; + + + // Timing: + + ITrigTimerSvc* m_timersvc; + std::vector<TrigTimer*> m_timers; + TrigTimer* m_totalTimer; + +}; +#endif + diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigEFDielectronMassFex.h b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigEFDielectronMassFex.h new file mode 100755 index 00000000000..54e654dd330 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigEFDielectronMassFex.h @@ -0,0 +1,88 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/************************************************************************** + ** + ** File: Trigger/TrigHypothesis/TrigEgammaHypo/TrigEFDielectronMassFex.h + ** + ** Description: - Hypothesis algorithm: searc for electron pairs with + ** invariant mass in some interval; intended for Z->ee + ** - Modified from TrigL2DielectronMassHypo by R Goncalo + ** + ** Author: Tetiana Hrynova <thrynova@mail.cern.ch> + ** + ** Created: Nov 10, 2009 + ** + ** Author(xAOD): Ryan Mackenzie White + ** Modified: April 2014 + **************************************************************************/ + +#ifndef TRIGEGAMMAHYPO_TRIGEFDIELECTRONMASSFEX_H +#define TRIGEGAMMAHYPO_TRIGEFDIELECTRONMASSFEX_H + +// standard stuff +#include <string> +#include <map> +#include <cmath> +// general athena stuff +#include "GaudiKernel/MsgStream.h" +#include "GaudiKernel/IToolSvc.h" +#include "GaudiKernel/StatusCode.h" +#include "StoreGate/StoreGateSvc.h" +// trigger includes +#include "TrigInterfaces/ComboAlgo.h" + +// trigger EDM +//#include "egammaEvent/egammaContainer.h" +#include "xAODEgamma/ElectronContainer.h" + +/* class StoreGateSvc; */ +/* class TriggerElement; */ + +/** + * \class TrigEFDielectronMassFex + * \brief TrigEFDielectronMassFex is a Trigger Fex Algorithm that retrieves the trig egamma + * container + * apply loose inv mass cuts (upper and lower cut) to the two electrons + * + */ + +class TrigEFDielectronMassFex: public HLT::ComboAlgo { + +public: + TrigEFDielectronMassFex(const std::string & name, ISvcLocator* pSvcLocator); + ~TrigEFDielectronMassFex(); + + HLT::ErrorCode hltInitialize(); + HLT::ErrorCode hltFinalize(); + HLT::ErrorCode acceptInputs(HLT::TEConstVec& inputTE, bool& pass ); + HLT::ErrorCode hltExecute(HLT::TEConstVec& inputTE, HLT::TriggerElement* outputTE); + +private: + void processElectronElectron(HLT::TEConstVec& inputTE, std::vector<float>& masses); + void processElectronCluster(HLT::TEConstVec& inputTE, std::vector<float>& masses); + +private: + // cuts + bool m_useElectronElectron; + bool m_useElectronCluster; + float m_lowerMassCut; //!< lower inv mass cut (e-e pair) + float m_upperMassCut; //!< upper inv mass cut (e-e pair) + + // output data + std::vector<float> m_massElectronElectron; + std::vector<float> m_massElectronCluster; + + // to set Accept-All mode: should be done with force-accept when possible + bool m_acceptAll; //!< true will accept all events + + // monitoring + double m_monMassAccepted; + int m_monCut; +}; + + + + +#endif diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigEFDielectronMassHypo.h b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigEFDielectronMassHypo.h new file mode 100755 index 00000000000..3e75a2f30a7 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigEFDielectronMassHypo.h @@ -0,0 +1,87 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/************************************************************************** + ** + ** File: Trigger/TrigHypothesis/TrigEgammaHypo/TrigEFDielectronMassHypo.h + ** + ** Description: - Hypothesis algorithm: searc for electron pairs with + ** invariant mass in some interval; intended for Z->ee + ** - Modified from TrigL2DielectronMassHypo by R. Goncalo + ** + ** Author: T. Hrynova <thrynova@mail.cern.ch> + ** + ** Created: Nov 13 2009 + ** + **************************************************************************/ + +#ifndef TRIG_TrigEFDielectronMassHypo_H +#define TRIG_TrigEFDielectronMassHypo_H + +// standard stuff +#include <string> +#include <map> +#include <cmath> +// general athena stuff +#include "GaudiKernel/MsgStream.h" +#include "GaudiKernel/IToolSvc.h" +#include "GaudiKernel/StatusCode.h" +#include "StoreGate/StoreGateSvc.h" +// trigger includes +#include "TrigInterfaces/HypoAlgo.h" +#include "TrigSteeringEvent/TrigRoiDescriptor.h" +// trigger EDM +//#include "TrigInDetEvent/TrigInDetTrack.h" +//#include "TrigInDetEvent/TrigInDetTrackCollection.h" +//#include "TrigInDetEvent/TrigInDetTrackHelper.h" +//#include "TrigParticle/TrigElectron.h" +#include "xAODTracking/TrackParticleContainer.h" +#include "xAODTrigEgamma/TrigElectron.h" +#include "xAODTrigEgamma/TrigElectronContainer.h" + +/* class StoreGateSvc; */ +/* class TriggerElement; */ + + +/** + * \class TrigEFDielectronMassHypo + * \brief TrigEFDielectronMassHypo is a Trigger Hypo Algorithm that retrieves the coomon vertex and + * inv mass calculated by TrigEFDielectronFex + * Apply inv mass cuts (upper and lower cut) to the two electrons and activates TE if condition is + * satisfied + * + */ + +class TrigEFDielectronMassHypo: public HLT::HypoAlgo { + +public: + TrigEFDielectronMassHypo(const std::string & name, ISvcLocator* pSvcLocator); + ~TrigEFDielectronMassHypo(); + + HLT::ErrorCode hltInitialize(); + HLT::ErrorCode hltFinalize(); + HLT::ErrorCode hltExecute(const HLT::TriggerElement* outputTE, bool& pass); + +private: + bool checkAllMasses(const TrigOperationalInfo* masses, + float mass_min, float mass_max); + +private: + bool m_useElectronElectron; + bool m_useElectronCluster; + + // cuts + float m_lowerMassCut; //!< lower inv mass cut + float m_upperMassCut; //!< upper inv mass cut + float m_lowerMassElectronClusterCut; //!< lower inv mass cut (e,cluster) + float m_upperMassElectronClusterCut; //!< upper inv mass cut (e,cluster) + + // to set Accept-All mode: should be done with force-accept when possible + bool m_acceptAll; //!< true will accept all events + // monitoring + double m_monMassAccepted; + int m_monCut; +}; + +#endif diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigEFElectronHypo.h b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigEFElectronHypo.h new file mode 100755 index 00000000000..8ed55fe867e --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigEFElectronHypo.h @@ -0,0 +1,375 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/******************************************************************** + * + * NAME: TrigEFElectronHypo.h + * PACKAGE: Trigger/TrigHypothesis/TrigEgammaHypo + * + * MAINTAINED BY: Ryan M. White, Alessandro Tricoli + * + *********************************************************************/ +#ifndef TRIGEFEGAMMAHYPO_H +#define TRIGEFEGAMMAHYPO_H + + +#include <string> +#include <cmath> + +// athena stuff stuff +#include "GaudiKernel/IToolSvc.h" +#include "GaudiKernel/ToolHandle.h" +#include "GaudiKernel/IHistogramSvc.h" +#include "StoreGate/StoreGateSvc.h" +#include "CLHEP/Units/SystemOfUnits.h" +#include "AIDA/IHistogram1D.h" + +// core trigger stuff +#include "TrigT1Interfaces/RecEmTauRoI.h" +#include "TrigInterfaces/HypoAlgo.h" +#include "TrigTimeAlgs/TrigTimerSvc.h" + +//xAOD +#include "xAODEgamma/ElectronFwd.h" +#include "xAODEgamma/EgammaFwd.h" +#include "xAODEgamma/ElectronContainer.h" +#include "xAODEgamma/EgammaContainer.h" + +// Asg SelectorTools +#include "ElectronPhotonSelectorTools/IAsgElectronIsEMSelector.h" +#include "ElectronPhotonSelectorTools/IAsgElectronLikelihoodTool.h" + +#include "TrkSurfaces/PerigeeSurface.h" +#include "VxVertex/RecVertex.h" + +/** + * \class TrigEFElectronHypo + * \brief TrigEFElectronHypo is a Trigger Hypothesis Algorithm that retrieves the EF EgammaContainer + * container created by the EF algorithm TrigEgammaRec + * It can apply the isem offline cut for electrons: loose, tight or medium + * or it can apply ET, shower shape selection, TRT hits and E/p cuts to select a good electron at the EF + * an event will be accepted if all electron selection variables are satisfied + * + */ + + +class StoreGateSvc; +class TriggerElement; + +namespace Trk +{ + class Vertex; +} + +namespace Reco { class ITrackToVertex; }//AT Jan 2010:added + +class TrigEFElectronHypo : public HLT::HypoAlgo { + + public: + + TrigEFElectronHypo(const std::string& name, ISvcLocator* pSvcLocator); + ~TrigEFElectronHypo(); + + HLT::ErrorCode hltInitialize(); + HLT::ErrorCode hltFinalize(); + HLT::ErrorCode hltExecute(const HLT::TriggerElement* outputTE, bool& pass); + HLT::ErrorCode hltBeginRun(); + + /** Find the impact parameter by extrapolating to either the beam spot or (0,0) **/ + double findImpact(const xAOD::TrackParticle* track) const;//AT: copied from Offline + + private: + + // define the properties: + //---------------------------- + + // m_acceptAll = true, all events are taken, not selection cuts applied + // m_acceptAll = false, selection cuts applied + + bool m_acceptAll; //!< true all events are taken + + bool m_caloCutsOnly; + + // Cuts to be applied: + + + + + //AT Jan2010: + std::string m_egammaElectronCutIDToolName; + std::string m_athElectronLHIDSelectorToolName; + ToolHandle<IAsgElectronIsEMSelector> m_egammaElectronCutIDTool; + ToolHandle<IAsgElectronLikelihoodTool> m_athElectronLHIDSelectorTool; + bool m_useAthElectronLHIDSelector; + //Offline isEM bit cut + unsigned int m_IsEMrequiredBits; //!< isem flag bits required + bool m_applyIsEM; //!< true if isem flag required + double m_emEt; //!< ET cut + + //Isolation + bool m_applyIsolation; + unsigned int m_EtConeSizes; + unsigned int m_PtConeSizes; + bool m_useClusETforCaloIso; + bool m_useClusETforTrackIso; + std::vector<float> m_RelEtConeCut; + std::vector<float> m_EtConeCut; + std::vector<float> m_RelPtConeCut; + std::vector<float> m_PtConeCut; + std::map<int, string> m_mapEtCone,m_mapPtCone; + std::map<int, string> m_mapRelEtCone,m_mapRelPtCone; + + int m_NofPassedCuts; + int m_NofPassedCutsIsEM; + int m_NofPassedCutsIsEMTrig; + + //AT: variables for isEM monitoring + //std::vector<unsigned int> m_isEMTrig; //AT Aug2011: variable not needed: deactivate histogram egIsEM - outdated + std::vector<unsigned int> m_NcandIsEM; + std::vector<unsigned int> m_NcandIsEMAfterCut; + std::vector<unsigned int> m_IsEMRequiredBits; + std::vector<unsigned int> m_IsEMRequiredBitsAfterCut; + /// + std::string m_path; + + //Impact parameter monitoring + std::vector<double> m_a0; + + // egamma container + const xAOD::ElectronContainer* m_EgammaContainer; //!< pointer to EgammaContainer + + // Timing: + + ITrigTimerSvc* m_timersvc; + TrigTimer* m_totalTimer; + TrigTimer* m_timerPIDTool; + + /** The extrapolator tool */ + //AT Jan 2010: ToolHandle<Trk::IExtrapolator> m_extrapolator; //Extrapolator tool + /** The Beam Service **/ + //AT Jan 2010: IBeamCondSvc* m_iBeamCondSvc; //pointer to the beam condition service + + + Amg::Vector3D m_primaryVertex; //AT Jan 2010 + /** @brief Tool handle for track extrapolation to vertex */ + ToolHandle< Reco::ITrackToVertex > m_trackToVertexTool; //AT Jan 2010 + + void prepareMonitoringVars(); + + /** + * \brief implements histograms for monitoring + */ + //////////// + + // Calo and ShowerShape Monitoring accesible via xAOD::Egamma + static inline float getF1 (const xAOD::Egamma* eg) { + float val_float=-99; + eg->showerShapeValue(val_float,xAOD::EgammaParameters::f1); + return val_float; + } + static inline float getF3 (const xAOD::Egamma* eg) { + float val_float=-99; + eg->showerShapeValue(val_float,xAOD::EgammaParameters::f3); + return val_float; + } + static inline double getE237 (const xAOD::Egamma* eg) { + float val_float=-99; + eg->showerShapeValue(val_float,xAOD::EgammaParameters::e237); + return val_float; + } + static inline double getE277 (const xAOD::Egamma* eg) { + float val_float=-99; + eg->showerShapeValue(val_float,xAOD::EgammaParameters::e277); + return val_float; + } + static inline double getEthad1 (const xAOD::Egamma* eg) { + float val_float=-99; + eg->showerShapeValue(val_float,xAOD::EgammaParameters::ethad1); + return val_float; + } + static inline double getWeta1 (const xAOD::Egamma* eg) { + float val_float=-99; + eg->showerShapeValue(val_float,xAOD::EgammaParameters::weta1); + return val_float; + } + static inline double getWeta2 (const xAOD::Egamma* eg) { + float val_float=-99; + eg->showerShapeValue(val_float,xAOD::EgammaParameters::weta2); + return val_float; + } + static inline double getWtots1 (const xAOD::Egamma* eg) { + float val_float=-99; + eg->showerShapeValue(val_float,xAOD::EgammaParameters::wtots1); + return val_float; + } + static inline double getE2tsts1 (const xAOD::Egamma* eg) { + float val_float=-99; + eg->showerShapeValue(val_float,xAOD::EgammaParameters::e2tsts1); + return val_float; + } + static inline double getEmins1 (const xAOD::Egamma* eg) { + float val_float=-99; + eg->showerShapeValue(val_float,xAOD::EgammaParameters::emins1); + return val_float; + } + static inline double getfracs1 (const xAOD::Egamma* eg) { + float val_float=-99; + eg->showerShapeValue(val_float,xAOD::EgammaParameters::fracs1); + return val_float; + } + static inline double EtCluster(const xAOD::Egamma* eg){ + if(eg && (eg->caloCluster())){ + return eg->caloCluster()->et(); + } + else return -99.; + } + static inline double EtCluster37(const xAOD::Egamma* eg){ + if(eg && (eg->caloCluster())){ + const xAOD::CaloCluster* cluster = eg->caloCluster(); + double eta2 = fabs(cluster->etaBE(2)); + return cluster->e()/cosh(eta2); + } + else return -99.; + } + static inline float getEratio(const xAOD::Egamma* eg) { + if(eg) { + // E of 2nd max between max and min in strips + float emax2 = -99; + eg->showerShapeValue(emax2,xAOD::EgammaParameters::e2tsts1); + // E of 1st max in strips + float emax = -99; + eg->showerShapeValue(emax2,xAOD::EgammaParameters::emaxs1); + // E(min) in strips + float _demaxs1 = fabs(emax+emax2)>0. ? (emax-emax2)/(emax+emax2) : 0.; + return _demaxs1; + } + else {return -99.;} + } + + // Track releated Monitoring accesible via xAOD::Electron + static inline double getNbLayer (const xAOD::Electron* eg) { + uint8_t val_uint8=0; + if(eg && eg->trackParticle()) { + eg->trackParticleSummaryValue(val_uint8,xAOD::numberOfBLayerHits); + return val_uint8; + } + else return -99.; + } + + static inline double getNPixel (const xAOD::Electron* eg) { + uint8_t val_uint8=0; + if(eg && eg->trackParticle()) { + eg->trackParticleSummaryValue(val_uint8,xAOD::numberOfPixelHits); + return val_uint8; + } + else return -99.; + } + + static inline double getNSCT (const xAOD::Electron* eg) { + uint8_t val_uint8=0; + if(eg && eg->trackParticle()) { + eg->trackParticleSummaryValue(val_uint8,xAOD::numberOfSCTHits); + return val_uint8; + } + else return -99.; + } + + static inline double getNTRT (const xAOD::Electron* eg) { + uint8_t val_uint8=0; + if(eg && eg->trackParticle()) { + eg->trackParticleSummaryValue(val_uint8,xAOD::numberOfTRTHits); + return val_uint8; + } + else return -99.; + } + + static inline double getNTRThighTh (const xAOD::Electron* eg) { + uint8_t val_uint8=0; + if(eg && eg->trackParticle()) { + eg->trackParticleSummaryValue(val_uint8,xAOD::numberOfTRTHighThresholdHits); + return val_uint8; + } + else return -99.; + } + + static inline double getNTRThighThOutliers (const xAOD::Electron* eg) { + uint8_t val_uint8=0; + if(eg && eg->trackParticle()) { + eg->trackParticleSummaryValue(val_uint8,xAOD::numberOfTRTHighThresholdOutliers); + return val_uint8; + } + else return -99.; + } + + static inline double getNTRTOutliers (const xAOD::Electron* eg) { + uint8_t val_uint8=0; + if(eg && eg->trackParticle()) { + eg->trackParticleSummaryValue(val_uint8,xAOD::numberOfTRTOutliers); + return val_uint8; + } + else return -99.; + } + static inline double PtTrack (const xAOD::Electron* eg) { + if(eg && (eg->trackParticle())) + return eg->trackParticle()->pt(); + else return -99.; + } + static inline double dEta (const xAOD::Electron* eg) { + float val_float = -99; + if(eg) + eg->trackCaloMatchValue(val_float,xAOD::EgammaParameters::deltaEta1); + return val_float; + } + static inline double dPhi (const xAOD::Electron* eg) { + float val_float = -99; + if(eg) + eg->trackCaloMatchValue(val_float,xAOD::EgammaParameters::deltaPhi2); + return val_float; + } + static inline double Eoverp(const xAOD::Electron* eg) { + if(eg && (eg->trackParticle()) && (eg->caloCluster())){ + return eg->caloCluster()->et()/ eg->trackParticle()->pt(); + } + else return -99.; + } + static inline double rTRT (const xAOD::Electron* eg) { + if(eg && eg->trackParticle()){ + uint8_t trtHits = 0; + eg->trackParticleSummaryValue(trtHits,xAOD::numberOfTRTHits); + uint8_t trtHTHits = 0; + eg->trackParticleSummaryValue(trtHTHits,xAOD::numberOfTRTHighThresholdHits); + if(trtHits!=0) { + return ( (double)trtHTHits / (double)trtHits ); + } + else return -99.; + } + else return -99.; + } + + + static inline double getEtconeIso(const xAOD::Egamma* eg){ + if(eg && eg->caloCluster() ){ + const xAOD::CaloCluster* cluster = eg->caloCluster(); + float eta2 = fabs(cluster->etaBE(2)); + float et_37 = cluster->e()/cosh(eta2); + float val_float = -99; + eg->isolationValue(val_float,xAOD::EgammaParameters::etcone20); + return et_37!=0. ? val_float/et_37 : -99.; + } + else return -99.; + } + static inline double getPtconeIso(const xAOD::Electron* eg){ + if(eg && eg->trackParticle() ){ + float val_float = -99; + eg->isolationValue(val_float,xAOD::EgammaParameters::ptcone20); + return val_float; + } + else return -99.; + } + + + +}; +#endif + diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigEFHadronicRecoil.h b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigEFHadronicRecoil.h new file mode 100644 index 00000000000..bdd1b8cf964 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigEFHadronicRecoil.h @@ -0,0 +1,32 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef __TrigEFHadronicRecoil_h__ +#define __TrigEFHadronicRecoil_h__ +/* + TrigEFHadronicRecoil.h +*/ +#include <string> +#include <vector> +#include "TrigInterfaces/AllTEAlgo.h" + +class TrigEFHadronicRecoil : public HLT::AllTEAlgo { +public: + TrigEFHadronicRecoil(const std::string& name, ISvcLocator* svcloc); + ~TrigEFHadronicRecoil(); + + HLT::ErrorCode hltInitialize(); + HLT::ErrorCode hltExecute(std::vector<HLT::TEVec>& inputs, + unsigned int type_out); + HLT::ErrorCode hltFinalize(); + + HLT::TriggerElement* makeOutputTE(std::vector<HLT::TEVec>& inputs, + unsigned int output); + +private: + float mRecoilCut; + +}; + +#endif // __TrigEFHadronicRecoil_h__ diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigEFPhotonHypo.h b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigEFPhotonHypo.h new file mode 100755 index 00000000000..f5691e9a5a8 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigEFPhotonHypo.h @@ -0,0 +1,212 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/******************************************************************** + * + * NAME: TrigEFPhotonHypo.h + * PACKAGE: Trigger/TrigHypothesis/TrigEFPhotonHypo + * + * AUTHOR: Valeria Perez Reale + * MAINTAINED BY: R.M. White + * CREATED: Nov 12, 2006 + * MODIFIED: V. Perez Reale added doxygen comments 25/6/07 + * A.Tricoli: added extra variables to monitor isEM flag (Jan 2010) + * MODIFIED: R.M. White: xAOD migration (April 2014) + *********************************************************************/ +#ifndef TRIGEFPHOTONHYPO_H +#define TRIGEFPHOTONHYPO_H + +#include <string> +#include <cmath> +//#include <map.h> + +// athena stuff stuff +//#include "GaudiKernel/MsgStream.h" +#include "GaudiKernel/IToolSvc.h" +//#include "GaudiKernel/StatusCode.h" +#include "StoreGate/StoreGateSvc.h" +//#include "CLHEP/Units/SystemOfUnits.h" + +// core trigger stuff +#include "TrigT1Interfaces/RecEmTauRoI.h" +#include "TrigInterfaces/HypoAlgo.h" + +//xAOD +#include "xAODEgamma/ElectronFwd.h" +#include "xAODEgamma/PhotonFwd.h" +#include "xAODEgamma/EgammaFwd.h" +#include "xAODEgamma/ElectronContainer.h" +#include "xAODEgamma/PhotonContainer.h" +#include "xAODEgamma/EgammaContainer.h" + +//RMW Sept 2013 +#include "PATCore/IAthSelectorTool.h" +#include "ElectronPhotonSelectorTools/IAsgElectronIsEMSelector.h" +#include "ElectronPhotonSelectorTools/IAsgPhotonIsEMSelector.h" + +//#include <string +#include "TrigTimeAlgs/TrigTimerSvc.h" + +#include "GaudiKernel/IHistogramSvc.h" +#include "AIDA/IHistogram1D.h" + +class StoreGateSvc; +class TriggerElement; +class TH1F; + + +/** + * \class TrigEFPhotonHypo + * \brief TrigEFPhotonHypo is a Trigger Hypothesis Algorithm that retrieves the EF EgammaContainer + * container created by the EF algorithm TrigEgammaRec + * Applies a selection on ET, shower shape selection to select a good photon at the EF + * an event will be accepted if all photon selection variables are satisfied + * + */ + + +class TrigEFPhotonHypo : public HLT::HypoAlgo { + + public: + TrigEFPhotonHypo(const std::string& name, ISvcLocator* pSvcLocator); + ~TrigEFPhotonHypo(); + + HLT::ErrorCode hltInitialize(); + HLT::ErrorCode hltFinalize(); + HLT::ErrorCode hltExecute(const HLT::TriggerElement* outputTE, bool& pass); + HLT::ErrorCode hltBeginRun(); + + private: + + // define the properties: + //---------------------------- + + // m_acceptAll = true, all events are taken, not selection cuts applied + // m_acceptAll = false, selection cuts applied + + bool m_acceptAll; //!< true all events are taken + bool m_acceptLOOSE; //!< true only events that satisfy ET > ETcut are taken + + //Calocuts offline + + /** @brief Luminosity level */ + // std::string m_LumiLevel; replaced with usePhotonCuts + bool m_usePhotonCuts; + + std::string m_egammaElectronCutIDToolName; + ToolHandle<IAsgElectronIsEMSelector> m_egammaElectronCutIDTool; + + std::string m_egammaPhotonCutIDToolName; + ToolHandle<IAsgPhotonIsEMSelector> m_egammaPhotonCutIDTool; + + //Offline isEM bit cut + unsigned int m_IsEMrequiredBits; //!< isem flag bits required + bool m_applyIsEM; //!< true if isem flag required + double m_emEt; //!< ET cut + int m_NofPassedCuts; + int m_NofPassedCutsIsEM; + int m_NofPassedCutsIsEMTrig; + + //AT: variables for isEM monitoring + //std::vector<unsigned int> m_isEMTrig; //AT Aug2011: variable not needed - deactivate histogram egIsEM - outdated + std::vector<unsigned int> m_NcandIsEM; + std::vector<unsigned int> m_NcandIsEMAfterCut; + std::vector<unsigned int> m_IsEMRequiredBits; + std::vector<unsigned int> m_IsEMRequiredBitsAfterCut; + + const xAOD::PhotonContainer* m_EgammaContainer; //!< pointer to EgammaContainer + + + std::vector<IHistogram1D*> nCandHistVector; + + // path for the histograms: + + std::string m_path; + + // Histogram Service: + IHistogramSvc* m_histsvc; + + + // Timing: + + TrigTimer* m_totalTimer, *m_timerPIDTool_Ele, *m_timerPIDTool_Pho; + ITrigTimerSvc* m_timersvc; //!< pointer to TimerSvc + + void prepareMonitoringVars(); + + /** + * \brief implements histograms for monitoring + */ + + static inline double Et (const xAOD::Egamma* eg) {if(eg && (eg->caloCluster())) return eg->caloCluster()->et(); else return -99.;} + static inline double Eta (const xAOD::Egamma* eg) {if(eg && (eg->caloCluster())) return eg->eta(); else return -99.;} + static inline double Phi (const xAOD::Egamma* eg) {if(eg && (eg->caloCluster())) return eg->phi(); else return -99.;} + + static inline double EtCluster37(const xAOD::Egamma* eg){ + if(eg && (eg->caloCluster())){ + const xAOD::CaloCluster* cluster = eg->caloCluster(); + double eta2 = fabs(cluster->etaBE(2)); + return cluster->e()/cosh(eta2); + } + else return -99.; + } + static inline float rE37E77 (const xAOD::Egamma* eg) { + float e277=-99; + float e237=-99; + eg->showerShapeValue(e237,xAOD::EgammaParameters::e237); + eg->showerShapeValue(e277,xAOD::EgammaParameters::e277); + float _rE37E77 = (e277 != 0.) ? ( e237 / e277 ) : -99. ; + return _rE37E77; + } + static inline float rE33E77 (const xAOD::Egamma* eg) { + float e277=-99; + float e233=-99; + eg->showerShapeValue(e233,xAOD::EgammaParameters::e233); + eg->showerShapeValue(e277,xAOD::EgammaParameters::e277); + float _rE33E77 = (e277 != 0.) ? ( e233 / e277 ) : -99. ; + return _rE33E77; + } + + static inline float Eratio(const xAOD::Egamma* eg) { + if(eg) { + // E of 2nd max between max and min in strips + float emax2 = -99; + eg->showerShapeValue(emax2,xAOD::EgammaParameters::e2tsts1); + // E of 1st max in strips + float emax = -99; + eg->showerShapeValue(emax2,xAOD::EgammaParameters::emaxs1); + // E(min) in strips + float _demaxs1 = fabs(emax+emax2)>0. ? (emax-emax2)/(emax+emax2) : 0.; + return _demaxs1; + } + else {return -99.;} + } + + + //xAOD, what is in EDM + //TBD + /*static inline int monIsEM(const egamma* eg){ + if(eg && eg->isem() ) { + int pass = 0; + if ((eg->isem() & 0xFD) ==0) pass = 1; //AT 16 March 0xFF -> 0xFD (remove ConversionMatch) //loose + if ((eg->isem() & 0x1E8EFD) ==0) pass = 2; //AT 16 March 0x1E8EFF -> 0x1E8EFD (remove ConversionMatch) //medium //AT jan 2010: 0x1E8FFF ->0x1E8EFF (no difference) + if ((eg->isem() & 0x3FFFFFF) ==0) pass = 3; //tight + return pass; + } else { + return 0; + } + } + + static inline unsigned int monIsEMTrig(unsigned int isem){ + int pass = 0; + if ((isem & 0xFF) ==0) pass = 1; //loose + if ((isem & 0x1E8EFF) ==0) pass = 2; //medium //AT jan 2010: 0x1E8FFF ->0x1E8EFF (no difference) + if ((isem & 0x3FFFFFF) ==0) pass = 3; //tight + return pass; + } */ + + +}; +#endif + diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigEFTrackHypo.h b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigEFTrackHypo.h new file mode 100755 index 00000000000..e6a6971abe8 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigEFTrackHypo.h @@ -0,0 +1,113 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/******************************************************************** + * + * NAME: TrigEFTrackHypo.h + * PACKAGE: Trigger/TrigHypothesis/TrigEgammaHypo + * + * AUTHOR: P. Conde Muino + * I. Grabowska-Bold, update Sept 2006 + * CREATED: April 29, 2004 + * MODIFIED: V. Perez Reale added doxygen comments 25/6/07 + * + *********************************************************************/ +#ifndef TRIGEFTRACKHYPO_H +#define TRIGEFTRACKHYPO_H + +//#include <string +#include "TrigInterfaces/HypoAlgo.h" +#include "TrigTimeAlgs/TrigTimerSvc.h" + +#include "GaudiKernel/IHistogramSvc.h" +#include "AIDA/IHistogram1D.h" +#include "Particle/TrackParticleContainer.h" + +class StoreGateSvc; +class TriggerElement; + + +/** + * \class TrigEFTrackHypo + * \brief TrigEFTrackHypo is a Trigger Hypothesis Algorithm that retrieves the EF TrackParticle + * container created by the EF ID algorithms + * Applies a pT cut on the track and the event is accepted if this is satisfied + * + */ + +class TrigEFTrackHypo : public HLT::HypoAlgo { + + public: + + TrigEFTrackHypo(const std::string& name, ISvcLocator* pSvcLocator); + ~TrigEFTrackHypo(); + + HLT::ErrorCode hltInitialize(); + HLT::ErrorCode hltBeginRun(); + HLT::ErrorCode hltExecute(const HLT::TriggerElement* outputTE, bool& pass); + HLT::ErrorCode hltFinalize(); + + + private: + + // define the properties: + //---------------------------- + int m_numBLayerHits; + int m_numPixelHits; + int m_numSCTHits; + int m_numTRTHits; + float m_TRTRatio; + float m_chi2; + float m_d0; + float m_pt; + int m_numTracks; + + // Cuts to be applied: + bool m_acceptAll; //!< true all events are taken + bool m_applyTrackCut; + + // functions to retrieve monitored quantities + + const Rec::TrackParticleContainer* TrkParticleCont; //!< pointer to TrackParticle container + int m_numTrkPart; + + +/** + * \brief implements histograms for monitoring + */ + + static inline double monPt(const Rec::TrackParticle * t) + { + const Trk::Perigee* aMeasPer = t->measuredPerigee(); + double ptSquare=pow(aMeasPer->momentum()[Trk::px],2.) + pow(aMeasPer->momentum()[Trk::py],2.); + return (ptSquare>0.)?sqrt(ptSquare)/1000.:-sqrt(fabs(ptSquare))/1000.; + } + + static inline double monPhi(const Rec::TrackParticle * t) + { + const Trk::Perigee* aMeasPer = t->measuredPerigee(); + return (aMeasPer->parameters()[Trk::phi]); + } + + static inline double monEta(const Rec::TrackParticle * t) + { + const Trk::Perigee* aMeasPer = t->measuredPerigee(); + return (-std::log(tan(aMeasPer->parameters()[Trk::theta]/2.))); + } + + static inline double mond0(const Rec::TrackParticle * t) + { + const Trk::Perigee* aMeasPer = t->measuredPerigee(); + return (aMeasPer->parameters()[Trk::d0]); + } + + static inline double monz0(const Rec::TrackParticle * t) + { + const Trk::Perigee* aMeasPer = t->measuredPerigee(); + return (aMeasPer->parameters()[Trk::z0]); + } + +}; +#endif + diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2CaloHypo.h b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2CaloHypo.h new file mode 100755 index 00000000000..aa65c4a28ad --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2CaloHypo.h @@ -0,0 +1,95 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/************************************************************************** + ** + ** + ** Author: R.Goncalo + ** + ** File: Trigger/TrigHypothesis/TrigEgammaHypo/TrigL2CaloHypo.h + ** + ** Description: Hypothesis algorithms to be run at Level 2 after T2Calo + ** + ** Authour: R.Goncalo - Thu Jan 20 22:02:43 BST 2005 + ** + ** Created: Sat Mar 1 19:55:56 GMT 2005 + ** Modified: + * V. Perez Reale added doxygen comments 26/6/07 + * Eduardo J. Ortega <ortegaue@uregina.ca> Mon Mar 3 14:27:57 CST 2008 + * Added counter for candidates passing each cut + ** + **************************************************************************/ + +#ifndef TRIG_TrigL2CaloHypo_H +#define TRIG_TrigL2CaloHypo_H + +#include <cmath> +#include <vector> + +// athena stuff stuff +#include "GaudiKernel/IToolSvc.h" + +// core trigger stuff +#include "TrigT1Interfaces/RecEmTauRoI.h" +#include "CLHEP/Units/SystemOfUnits.h" +#include "TrigInterfaces/HypoAlgo.h" + +/** + * \class TrigL2CaloHypo + * \brief TrigL2CaloHypo is a Trigger Hypo Algorithm that retrieves the L2 TrigEmCluster Container + * created by TrigT2Calo and then applies a subset of calorimeter selection cuts: ET and shower shapes + * . A TE will be set active if the selection cuts are fullfilled. + * + * + */ + + +class TrigL2CaloHypo: public HLT::HypoAlgo { + + public: + TrigL2CaloHypo(const std::string & name, ISvcLocator* pSvcLocator); + ~TrigL2CaloHypo(); + + HLT::ErrorCode hltInitialize(); + HLT::ErrorCode hltFinalize(); + HLT::ErrorCode hltExecute(const HLT::TriggerElement* outputTE, bool& pass); + + private: + + //Calorimeter electron ID cuts + std::vector<float> m_etabin; //!< selection variable for L2 calo selection:eta bins + std::vector<float> m_eTthr; + std::vector<float> m_eT2thr; + std::vector<float> m_hadeTthr; + std::vector<float> m_hadeT2thr; + std::vector<float> m_carcorethr; + std::vector<float> m_caeratiothr; + std::vector<float> m_F1thr; + std::vector<float> m_WETA2thr; + std::vector<float> m_WSTOTthr; + std::vector<float> m_F3thr; + float m_detacluster; + float m_dphicluster; + + bool m_acceptAll; + + // cut variables + float dPhi; //!< selection variable dphi between phi of L2 cluster and L1 RoI + float dEta; //!< selection variable dphi between eta of L2 cluster and L1 RoI + float eT_T2Calo; //!< selection variable for L2 calo selection: ET (EM) + float hadET_T2Calo; //!< selection variable for L2 calo selection: ET (Had) + float rCore; //!< selection variable for L2 calo selection: RCore + float energyRatio; //!< selection variable for L2 calo selection: Eratio + float Weta2; //!< selection variable for L2 calo selection: Weta2 + float Wstot; //!< selection variable for L2 calo selection: Wstot + float F3; //!< selection variable for L2 calo selection: F3 + int etaBin; //!< selection cuts are eta-dependent + int PassedCuts; //!< counter for candidates passing each cut + float F1;// cut on fraction of energy deposited in 1st sampling + int GetCounterValue(int nCand[7]); //<!< Method to use preexisting variable nCand for determining PassCut + float monEta; // Monitor cluster eta + float monPhi; // Monitor cluster phi!! +}; + +#endif diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2CaloLayersHypo.h b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2CaloLayersHypo.h new file mode 100755 index 00000000000..1a22d8830d2 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2CaloLayersHypo.h @@ -0,0 +1,71 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/************************************************************************** + ** + ** + ** Author: Denis Damazio + ** + ** File: Trigger/TrigHypothesis/TrigEgammaHypo/TrigL2CaloLayersHypo.h + ** + ** Description: Hypothesis algorithms to be run at Level 2 after T2Calo + ** + ** Authour: R.Goncalo - Thu Jan 20 22:02:43 BST 2005 + ** + ** Created: Sept 7 2010 + ** Modified: + ** + **************************************************************************/ + +#ifndef TRIG_TrigL2CaloLayersHypo_H +#define TRIG_TrigL2CaloLayersHypo_H + +#include <cmath> +#include <vector> + +// athena stuff stuff +#include "GaudiKernel/IToolSvc.h" + +// core trigger stuff +#include "TrigT1Interfaces/RecEmTauRoI.h" +#include "CLHEP/Units/SystemOfUnits.h" +#include "TrigInterfaces/HypoAlgo.h" + +/** + * \class TrigL2CaloLayersHypo + * \brief TrigL2CaloLayersHypo is a Trigger Hypo Algorithm that retrieves the L2 TrigEmCluster Container + * created by TrigT2Calo and then applies a subset of calorimeter selection cuts: ET and shower shapes + * . A TE will be set active if the selection cuts are fullfilled. + * + * + */ + + +class TrigL2CaloLayersHypo: public HLT::HypoAlgo { + + public: + TrigL2CaloLayersHypo(const std::string & name, ISvcLocator* pSvcLocator); + ~TrigL2CaloLayersHypo(); + + HLT::ErrorCode hltInitialize(); + HLT::ErrorCode hltFinalize(); + HLT::ErrorCode hltExecute(const HLT::TriggerElement* outputTE, bool& pass); + + private: + + //Calorimeter Layer cuts + std::vector<float> m_EnergyFracCut; + std::vector<float> m_EnergyAbsCut; + + bool m_acceptAll; + + int PassedCuts; //!< counter for candidates passing each cut + float monEta; // Monitor cluster eta + float monPhi; // Monitor cluster phi!! + float m_Energy; // Monitor total RoI energy + float m_preSamp; // Presampler Energy + float m_preSampFrac; // Presampler Energy Fraction +}; + +#endif diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2DielectronMassFex.h b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2DielectronMassFex.h new file mode 100755 index 00000000000..4b92c5ad8f0 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2DielectronMassFex.h @@ -0,0 +1,127 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/************************************************************************** + ** + ** File: Trigger/TrigHypothesis/TrigEgammaHypo/TrigL2DielectronMassFex.h + ** + ** Description: - Hypothesis algorithm: searc for electron pairs with + ** invariant mass in some interval; intended for Z->ee + ** - Modified from TrigL2DimuonMassHypo by C.Schiavi + ** + ** Author: R.Goncalo <r.goncalo@rhul.ac.uk> + ** + ** Created: Aug 13 2006 + ** Modified: Jan 19 2007 Valeria Perez Reale Adapted to New Steering + ** Modified: Apr 28 2007 Tomasz Bold major changes to run with new steering + ** V. Perez Reale added doxygen comments 26/6/07 + ** + **************************************************************************/ + +#ifndef TRIGEGAMMAHYPO_TRIGL2DIELECTRONMASSFEX_H +#define TRIGEGAMMAHYPO_TRIGL2DIELECTRONMASSFEX_H + +// standard stuff +#include <string> +#include <map> +#include <cmath> +// general athena stuff +#include "GaudiKernel/MsgStream.h" +#include "GaudiKernel/IToolSvc.h" +#include "GaudiKernel/StatusCode.h" +#include "StoreGate/StoreGateSvc.h" +// trigger includes +#include "TrigInterfaces/ComboAlgo.h" + +// trigger EDM +//#include "TrigInDetEvent/TrigInDetTrack.h" +//#include "TrigInDetEvent/TrigInDetTrackCollection.h" +//#include "TrigInDetEvent/TrigInDetTrackHelper.h" + +#include "xAODTracking/TrackParticleContainer.h" +//#include "TrigParticle/TrigElectron.h" +//#include "TrigParticle/TrigElectronContainer.h" +#include "xAODTrigEgamma/TrigElectron.h" +#include "xAODTrigEgamma/TrigElectronContainer.h" +//#include "TrigCaloEvent/TrigEMCluster.h" +#include "xAODTrigCalo/TrigEMCluster.h" + +/* class StoreGateSvc; */ +/* class TriggerElement; */ + +/** + * \class TrigL2DielectronMassFex + * \brief TrigL2DielectronMassFex is a Trigger Fex Algorithm that retrieves the L2 TrigElectron + * container + * check charge: track pT is signed according to charge but not electron pT + * check vertex position: two electrons should come from common + * reject combination of electrons if distance squared between perigee of tracks is greater than a value + * (should accept 99% of good combinations) + * apply loose inv mass cuts (upper and lower cut) to the two electrons + * + * (May 2011) + * Add use cluster mode for chains to collect J/psi sample for Tag & Probe Analysis + * Change to attach the calculated invariant mass to outputTE as TrigOperationalInfo + */ + +namespace TrigL2DielectronMassHelpers { + + + bool validElectrons(const xAOD::TrigElectron* electron1, const xAOD::TrigElectron* electron2); + + + enum Vertex { Common, NotCommon, Unapplicable }; + Vertex commonVertex(const xAOD::TrigElectron* electron1, const xAOD::TrigElectron* electron2); + + bool opositeCharge(const xAOD::TrigElectron* electron1, const xAOD::TrigElectron* electron2); + + double invariantMass(const xAOD::TrigElectron* electron1, const xAOD::TrigElectron* electron2, const double electronMass); + double invariantMass(const xAOD::TrigElectron* electron, const xAOD::TrigEMCluster* cluster, const double electromMass); + +} + + +class TrigL2DielectronMassFex: public HLT::ComboAlgo { + +public: + TrigL2DielectronMassFex(const std::string & name, ISvcLocator* pSvcLocator); + ~TrigL2DielectronMassFex(); + + HLT::ErrorCode hltInitialize(); + HLT::ErrorCode hltFinalize(); + HLT::ErrorCode acceptInputs(HLT::TEConstVec& inputTE, bool& pass ); + HLT::ErrorCode hltExecute(HLT::TEConstVec& inputTE, HLT::TriggerElement* outputTE); + +private: + // use cluster mode: Calculate inv. mass from TrigElectron and TrigEMCluster + // This mode will be used in chains to collect sample for Tag & Probe + // In such chains no cut will be apply to probe RoI object therfore + // TrigElectron is not necessary + bool m_useClusterAsProbe; //!< true will use TrigEMCluster as probe object + // Electron mass(use in calculation Mee) + float m_electronMass; //! in MeV + + // container to hold the calculated inariant mass + std::vector<float> m_massCont; + + // cuts (not used in use cluster mode) + bool m_electronValid; //!< true if electrons have different RoI positions + bool m_sameTrackAlgo; //!< true if tracks come from same track algo + bool m_oppositeCharge; //!< true if electtons have opposite charge + bool m_commonVertex; //!< true if electrons tracks have common vertex + float m_lowerMassCut; //!< lower inv mass cut + float m_upperMassCut; //!< upper inv mass cut + + // to set Accept-All mode: should be done with force-accept when possible + bool m_acceptAll; //!< true will accept all events + + // monitoring + double m_monMassAccepted; + int m_monCut; +}; + + + + +#endif diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2DielectronMassHypo.h b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2DielectronMassHypo.h new file mode 100755 index 00000000000..177aa37680a --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2DielectronMassHypo.h @@ -0,0 +1,86 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/************************************************************************** + ** + ** File: Trigger/TrigHypothesis/TrigEgammaHypo/TrigL2DielectronMassHypo.h + ** + ** Description: - Hypothesis algorithm: searc for electron pairs with + ** invariant mass in some interval; intended for Z->ee + ** - Modified from TrigL2DimuonMassHypo by C.Schiavi + ** + ** Author: R.Goncalo <r.goncalo@rhul.ac.uk> + ** + ** Created: Aug 13 2006 + ** Modified: Jan 19 2007 Valeria Perez Reale Adapted to New Steering + ** Modified: Apr 28 2007 Tomasz Bold major changes to run with new steering + ** V. Perez Reale added doxygen comments 26/6/07 + ** + **************************************************************************/ + +#ifndef TRIG_TrigL2DielectronMassHypo_H +#define TRIG_TrigL2DielectronMassHypo_H + +// standard stuff +#include <string> +#include <map> +#include <cmath> +// general athena stuff +#include "GaudiKernel/MsgStream.h" +#include "GaudiKernel/IToolSvc.h" +#include "GaudiKernel/StatusCode.h" +#include "StoreGate/StoreGateSvc.h" +// trigger includes +#include "TrigInterfaces/HypoAlgo.h" +#include "TrigSteeringEvent/TrigRoiDescriptor.h" + +// trigger EDM +//#include "TrigInDetEvent/TrigInDetTrack.h" +//#include "TrigInDetEvent/TrigInDetTrackCollection.h" +//#include "TrigInDetEvent/TrigInDetTrackHelper.h" +#include "xAODTracking/TrackParticleContainer.h" +#include "xAODTrigEgamma/TrigElectron.h" +#include "xAODTrigEgamma/TrigElectronContainer.h" + +/* class StoreGateSvc; */ +/* class TriggerElement; */ + + +/** + * \class TrigL2DielectronMassHypo + * \brief TrigL2DielectronMassHypo is a Trigger Hypo Algorithm that retrieves the coomon vertex and + * inv mass calculated by TrigL2DielectronFex + * Apply inv mass cuts (upper and lower cut) to the two electrons and activates TE if condition is + * satisfied + * + */ + +class TrigL2DielectronMassHypo: public HLT::HypoAlgo { + + public: + TrigL2DielectronMassHypo(const std::string & name, ISvcLocator* pSvcLocator); + ~TrigL2DielectronMassHypo(); + + HLT::ErrorCode hltInitialize(); + HLT::ErrorCode hltFinalize(); + HLT::ErrorCode hltExecute(const HLT::TriggerElement* outputTE, bool& pass); + + private: + + // cuts + bool m_sameTrackAlgo; //!< true if tracks come from same track algo + bool m_oppositeCharge; //!< true if electtons have opposite charge + bool m_commonVertex; //!< true if electrons tracks have common vertex + bool m_electronValid; + float m_lowerMassCut; //!< lower inv mass cut + float m_upperMassCut; //!< upper inv mass cut + + // to set Accept-All mode: should be done with force-accept when possible + bool m_acceptAll; //!< true will accept all events + // monitoring + double m_monMassAccepted; + int m_monCut; +}; + +#endif diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2ElectronFex.h b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2ElectronFex.h new file mode 100755 index 00000000000..03ae579cf8e --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2ElectronFex.h @@ -0,0 +1,145 @@ +// -*- C++ -*- + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/************************************************************************** + ** + ** File: Trigger/TrigHypothesis/TrigEgammaHypo/TrigL2ElectronFex.h + ** + ** Description: Fex algo to be run before TrigL2ElectronHypo + ** + ** Authors: R. Goncalo <r.goncalo@rhul.ac.uk> + ** V. Perez-Reale <perezr@mail.cern.ch> + ** N. Berger <Nicolas.Berger@cern.ch> Tue Nov 28 0:56:50 CET 2006 + ** P. Urquijo <Phillip.Urquijo@cern.ch> + ** + ** Created: Tue Nov 28 0:56:50 CET 2006 + ** Modified: V. Perez Reale added doxygen comments 26/6/07 + ** + **************************************************************************/ + +#ifndef TRIG_TrigL2ElectronFex_H +#define TRIG_TrigL2ElectronFex_H + +// standard stuff +#include <vector> +#include <cmath> + +// general athena stuff +#include "GaudiKernel/IToolSvc.h" + +// trigger includes +#include "TrigInterfaces/FexAlgo.h" + +#include "TrigT1Interfaces/RecEmTauRoI.h" +#include "TrigSteeringEvent/TrigRoiDescriptor.h" + +// trigger EDM +//#include "TrigInDetEvent/TrigInDetTrack.h" +//#include "TrigInDetEvent/TrigInDetTrackCollection.h" +#include "xAODTracking/TrackParticleContainer.h" + +//#include "TrigCaloEvent/TrigEMCluster.h" +//#include "TrigParticle/TrigElectron.h" +//#include "TrigParticle/TrigElectronContainer.h" + +#include "xAODTrigCalo/TrigEMCluster.h" +#include "xAODTrigEgamma/TrigElectron.h" +#include "xAODTrigEgamma/TrigElectronContainer.h" + +//#include "TrigCaloEvent/RingerEvent.h" // will be moved to TrigEvent +//#include "TrigCaloEvent/RingerEventContainer.h" // will be moved to TrigEvent + +//class ITrigInDetTrackExtrapolator; +class IExtrapolateToCaloTool; + +/** + * \class TrigL2ElectronFex + * \brief TrigL2ElectronFex is a Trigger Fex Algorithm that retrieves the L2 TrigEMCluster + * container and the L2 TrackCollection containers and then creates a TrigElectron Container + * with a subset of calorimeter-ID selection variables that are calculated (eg. E/p) + * TrigL2ElectronFex will apply some very loose selection cuts to the TrigElectronContainer created + * which is of TrigParticle type TrigElectron + * The TrigElectron conatiner will then be retrieved by the hypothesis algorithm TrigL2ElectronHypo + * that will perform the corresponding L2 electron selection + * + */ + +class TrigL2ElectronFex : public HLT::FexAlgo { + + public: + + TrigL2ElectronFex(const std::string & name, ISvcLocator* pSvcLocator); + ~TrigL2ElectronFex(); + + HLT::ErrorCode hltInitialize(); + HLT::ErrorCode hltFinalize(); + HLT::ErrorCode hltExecute(const HLT::TriggerElement* inputTE, + HLT::TriggerElement* outputTE); + + //HLT::ErrorCode acceptInput(const HLT::TriggerElement* inputTE, bool& pass); + + private: + + // Properties: + unsigned int m_trackalgoID; // used to select algorithm producing tracks, 0: all, 1: SiTrack, 2: IDScan, 4: TRTxK, 5: SiTrack+IDScan + unsigned int m_calo_algoID; // used to run from either TrigEMCluster or RingerEvent + + //L1-L2 matching variables + float m_detacluster; + float m_dphicluster; + + //tracking cut + float m_trackPtthr; + float m_trackPtthrTRT; //Track pt cut on TRT tracks + + //calo-tracking cuts + std::vector<float> m_etabin; + std::vector<float> m_calotrackdeta; //!< deta between calo and track + std::vector<float> m_calotrackdphi; //!< dphi between calo and track + std::vector<float> m_calotrackdeoverp_low; //!< E/p lower cut between calo and track + std::vector<float> m_calotrackdeoverp_high; //!< E/p upper cut between calo and track + + //TRTSegFinder specific calo-track cuts + std::vector<float> m_calotrackdetaTRT; //!< deta between calo and track + std::vector<float> m_calotrackdphiTRT; //!< dphi between calo and track + + + //radius and Z of calorimeter face + float m_RCAL; //!< radious of calorimeter face + float m_ZCAL; //!< Z of calorimeter face + + // to set Accept-All mode and to be able + // to avoid generating TrigElectrons + bool m_acceptAll; + // bool m_saveTrigEl; // now needed to transfer information to hypo + + // for extrapolating TrigInDetTracks to calorimeter surface +// ITrigInDetTrackExtrapolator* m_trackExtrapolator; //!< pointer for extrapolating TrigInDetTracks to calorimeter surface + ToolHandle<IExtrapolateToCaloTool> m_trackExtrapolator; +// std::string m_trackExtrapolatorName; + + xAOD::TrigElectronContainer* m_trigElecColl; //!< pointer to TrigElectron container + + // track-extrapolation error counter + unsigned long m_extrapolator_failed; + + ///Static getter methods for monitoring of TrigElectron container + static inline double getCaloPt(const xAOD::TrigElectron* aElectron){ + + if(!aElectron) return -999.0; + return aElectron->pt(); + } + + static inline double getTkPt(const xAOD::TrigElectron* aElectron){ + + if(!aElectron) return -999.0; + return (aElectron->trackParticle() ? aElectron->trackParticle()->pt() : -999); +} + + +}; + +#endif diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2ElectronHypo.h b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2ElectronHypo.h new file mode 100755 index 00000000000..05816fb22ea --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2ElectronHypo.h @@ -0,0 +1,140 @@ +// -*- C++ -*- + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/************************************************************************** + ** + ** File: Trigger/TrigHypothesis/TrigEgammaHypo/TrigL2ElectronHypo.h + ** + ** Description: Hypothesis algorithms to be run at Level 2 after + ** tracking algorithms: creates TrigElectrons + ** + ** Authour: R.Goncalo <r.goncalo@rhul.ac.uk> Thu Jan 20 22:02:43 BST 2005 + ** + ** Created: Sat Mar 1 19:55:56 GMT 2005 + ** Modified: V. Perez Reale added doxygen comments 26/6/07 + ** + **************************************************************************/ + +#ifndef TRIG_TrigL2ElectronHypo_H +#define TRIG_TrigL2ElectronHypo_H + +// standard stuff +#include <map> +#include <cmath> + +// general athena stuff +#include "GaudiKernel/IToolSvc.h" + +// trigger includes +#include "TrigInterfaces/HypoAlgo.h" +#include "TrigT1Interfaces/RecEmTauRoI.h" +#include "TrigSteeringEvent/TrigRoiDescriptor.h" + +// trigger EDM +//#include "TrigInDetEvent/TrigInDetTrack.h" +//#include "TrigInDetEvent/TrigInDetTrackCollection.h" +#include "xAODTracking/TrackParticleContainer.h" + +//#include "TrigCaloEvent/TrigEMCluster.h" +//#include "TrigParticle/TrigElectron.h" +//#include "TrigParticle/TrigElectronContainer.h" + +#include "xAODTrigCalo/TrigEMCluster.h" +#include "xAODTrigEgamma/TrigElectron.h" +#include "xAODTrigEgamma/TrigElectronContainer.h" + + +//class ITrigInDetTrackExtrapolator; + + +/** + * \class TrigL2ElectronHypo + * \brief TrigL2ElectronHypo is a Trigger Hypo Algorithm that retrieves the L2 TrigElectronContainer + * created by TrigL2ElectronFex and then apply a subset of electron selection cuts. A TE will be + * set active if the selection cuts are fullfilled. + * + * + */ + +class TrigL2ElectronHypo: public HLT::HypoAlgo { + + public: + + TrigL2ElectronHypo(const std::string & name, ISvcLocator* pSvcLocator); + ~TrigL2ElectronHypo(); + + HLT::ErrorCode hltInitialize(); + HLT::ErrorCode hltFinalize(); + HLT::ErrorCode hltExecute(const HLT::TriggerElement* outputTE, bool& pass); + + private: + + // Properties: + unsigned int m_trackalgoID; //!< integer that assigns the tracking algorihtm used + + //L1-L2 matching variables + float m_detacluster; //!< deta between track and L1 roI + float m_dphicluster; //!< dphi between track and L1 roI + + //tracking cut + float m_trackPtthr; //!< pT cut on track + int m_NPixelSpacePoints; + int m_NSCT_SpacePoints; + int m_NStrawHits; + + //calo-tracking cuts + std::vector<float> m_etabin; + std::vector<float> m_calotrackdeta; //!< deta between calo and track + std::vector<float> m_calotrackdphi; //!< dphi between calo and track + std::vector<float> m_calotrackdeoverp_low; //!< E/p lower cut between calo and track + std::vector<float> m_calotrackdeoverp_high; //!< E/p upper cut between calo and track + + //radius and Z of calorimeter face + float m_RCAL; //!< radious of calorimeter face + float m_ZCAL; //!< Z of calorimeter face + + //TRT cuts + std::vector<float> m_trtratio; //!< cut on ratio of NTRHits/NTRStrawHits for IDScan and SiTrack tracks + + //TRTSegFinder cuts + float m_trackPtthrTRT; //!< pT cut on track + std::vector<float> m_etabinTRT; //!< eta bins for TRT cuts + std::vector<float> m_trtratioTRT; //!< cut on ratio of NTRHits/NTRStrawHits for TRTSegFinder tracks + std::vector<float> m_calotrackdetaTRT; //!< deta between calo and track + std::vector<float> m_calotrackdphiTRT; //!< dphi between calo and track + std::vector<float> m_calotrackdeoverp_lowTRT; //!< E/p lower cut between calo and track + std::vector<float> m_calotrackdeoverp_highTRT; //!< E/p upper cut between calo and track + + + // to set Accept-All mode + bool m_acceptAll; //!< accept all events if true + + // monitoring variables + int m_cutCounter; + float m_dEta, m_dPhi, m_EoverP, m_TRTRatio; + + //needed for monitoring to work + const xAOD::TrigElectronContainer* m_egamma_container; + + ///Static getter methods for monitoring of TrigElectron container + static inline double getCaloPt(const xAOD::TrigElectron* aElectron){ + + if(!aElectron) return -999.0; + return aElectron->pt(); + } + + static inline double getTkPt(const xAOD::TrigElectron* aElectron){ + + if(!aElectron) return -999.0; + return (aElectron->trackParticle() ? aElectron->trackParticle()->pt() : -999); +} + + // for extrapolating TrigInDetTracks to calorimeter surface +// ITrigInDetTrackExtrapolator* m_trackExtrapolator; +// std::string m_trackExtrapolatorName; +}; + +#endif diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2ElectronHypoMoni.h b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2ElectronHypoMoni.h new file mode 100755 index 00000000000..02971080b8c --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2ElectronHypoMoni.h @@ -0,0 +1,126 @@ +// -*- C++ -*- + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/************************************************************************** + ** + ** File: Trigger/TrigHypothesis/TrigEgammaHypo/TrigL2ElectronHypoMoni.h + ** + ** Description: Hypothesis algorithms to be run at Level 2 after + ** tracking algorithms: creates TrigElectrons. with + ** montoring histograms added. + ** + ** Authour: R.Goncalo <r.goncalo@rhul.ac.uk> Thu Jan 20 22:02:43 BST 2005 + ** + ** Created: Sat Mar 1 19:55:56 GMT 2005 + ** Modified: Tue Oct 17 James Keates added monitoring. + ** Jan 29 2007 Valeria Perez Reale-migration to new steering + ** V. Perez Reale added doxygen comments 26/6/07 + ** + **************************************************************************/ + +#ifndef TRIG_TrigL2ElectronHypoMoni_H +#define TRIG_TrigL2ElectronHypoMoni_H + +// standard stuff +#include <string> +#include <map> +#include <cmath> +// general athena stuff +#include "GaudiKernel/MsgStream.h" +#include "GaudiKernel/IToolSvc.h" +#include "GaudiKernel/StatusCode.h" +#include "GaudiKernel/ITHistSvc.h" +#include "StoreGate/StoreGateSvc.h" +//#include "TrigSteeringEvent/key2keyStore.h" +// trigger includes +#include "TrigInterfaces/HypoAlgo.h" +#include "TrigT1Interfaces/TrigT1Interfaces_ClassDEF.h" +#include "TrigT1Interfaces/RecEmTauRoI.h" +#include "TrigSteeringEvent/TrigRoiDescriptor.h" +// trigger EDM +///#include "TrigInDetEvent/TrigInDetTrack.h" +//#include "TrigInDetEvent/TrigInDetTrackCollection.h" +#include "xAODTracking/TrackParticleContainer.h" + +//#include "TrigCaloEvent/TrigEMCluster.h" +//#include "TrigParticle/TrigElectron.h" +//#include "TrigParticle/TrigElectronContainer.h" +#include "xAODTrigCalo/TrigEMCluster.h" +#include "xAODTrigEgamma/TrigElectron.h" +#include "xAODTrigEgamma/TrigElectronContainer.h" +#include "TH1F.h" + + +class StoreGateSvc; +class TriggerElement; +//class ITrigInDetTrackExtrapolator; +class IExtrapolateToCaloTool; +class TH1F; + + +/** + * \class TrigL2ElectronHypoMoni + * \brief TrigL2ElectronHypoMoni is a Trigger Hypo Algorithm that does the same selection as + * TrigL2ElectronHypo but then also adds monitoring histograms + * + * + */ + +class TrigL2ElectronHypoMoni: public HLT::HypoAlgo { + + public: + TrigL2ElectronHypoMoni(const std::string & name, ISvcLocator* pSvcLocator); + ~TrigL2ElectronHypoMoni(); + + HLT::ErrorCode hltInitialize(); + HLT::ErrorCode hltFinalize(); + HLT::ErrorCode hltExecute(const HLT::TriggerElement* outputTE, bool& pass); + + private: + + // Properties: + + TH1F* m_trackPtHist; + TH1F* m_CaloTrackdETAHist; + TH1F* m_CaloTrackdPHIHist; + TH1F* m_CaloTrackdEoverPHist; + TH1F* m_trackAlgoIDHist; + TH1F* m_dETACLUSTERHist; + TH1F* m_dPHICLUSTERHist; + + StoreGateSvc* m_storeGate; + + unsigned int m_trackalgoID; + + //L1-L2 matching variables + float m_detacluster; + float m_dphicluster; + + //tracking cut + float m_trackPtthr; + + //calo-tracking cuts + std::vector<float> m_etabin; + std::vector<float> m_calotrackdeta; //!< deta between calo and track + std::vector<float> m_calotrackdphi; //!< dphi between calo and track + std::vector<float> m_calotrackdeoverp_low; //!< E/p lower cut between calo and track + std::vector<float> m_calotrackdeoverp_high; //!< E/p upper cut between calo and track + + //radius and Z of calorimeter face + float m_RCAL; //!< radious of calorimeter face + float m_ZCAL; //!< Z of calorimeter face + + // to set Accept-All mode: should be done with force-accept when possible + bool m_acceptAll; //!< accept all events if true + + + + //ITrigInDetTrackExtrapolator* m_trackExtrapolator; + ToolHandle<IExtrapolateToCaloTool> m_trackExtrapolator; + +}; + +#endif diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2PhotonFex.h b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2PhotonFex.h new file mode 100755 index 00000000000..c2f6843ee4b --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2PhotonFex.h @@ -0,0 +1,75 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + + +/************************************************************************** + ** + ** Original Author: R.Goncalo + ** + ** File: Trigger/TrigHypothesis/TrigEgammaHypo/TrigL2PhotonFex.h + ** + ** Class Description: Fex algo for TrigPhotons + ** + ** Authors: R. Goncalo + ** V. Perez-Reale + ** N. Berger + ** A. Hamilton + ** + ** Created: Tue Nov 28 16:01:12 CET 2006 + ** + **************************************************************************/ + +#ifndef TRIG_PHOTON_FEX_H +#define TRIG_PHOTON_FEX_H + +// athena stuff +#include "GaudiKernel/IToolSvc.h" +#include "CLHEP/Units/SystemOfUnits.h" +#include "DataModel/ElementLink.h" + +// core trigger stuff +#include "TrigT1Interfaces/RecEmTauRoI.h" +#include "TrigInterfaces/FexAlgo.h" + +// trigger EDM +//#include "TrigCaloEvent/TrigEMClusterContainer.h" +//#include "TrigParticle/TrigPhoton.h" +//#include "TrigParticle/TrigPhotonContainer.h" +#include "xAODTrigCalo/TrigEMClusterContainer.h" +#include "xAODTrigEgamma/TrigPhoton.h" +#include "xAODTrigEgamma/TrigPhotonContainer.h" +#include "TrigSteeringEvent/TrigRoiDescriptor.h" + + + +/** + * \class TrigL2PhotonFex + * \brief TrigL2PhotonFex is an HLT Fex Algorithm that creates TrigPhotons + * from the the L2 TrigEMClusters that passed the TrigL2CaloHypo. + * The TrigPhotons will then be retrieved by the hypothesis algorithm TrigL2PhotonHypo + * that will perform the corresponding L2 photon selection + * + */ + + + +class TrigL2PhotonFex : public HLT::FexAlgo { + + public: + + TrigL2PhotonFex(const std::string & name, ISvcLocator* pSvcLocator); + ~TrigL2PhotonFex(); + + HLT::ErrorCode hltInitialize(); + HLT::ErrorCode hltFinalize(); + HLT::ErrorCode hltExecute(const HLT::TriggerElement* inputTE, + HLT::TriggerElement* outputTE); + + private: + + xAOD::TrigPhotonContainer* m_trigPhotonContainer; + +}; + +#endif diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2PhotonHypo.h b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2PhotonHypo.h new file mode 100755 index 00000000000..739ecbb87b2 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2PhotonHypo.h @@ -0,0 +1,123 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + + +/************************************************************************** + ** + ** Author: R.Goncalo + ** + ** File: Trigger/TrigHypothesis/TrigEgammaHypo/TrigL2PhotonHypo.h + ** + ** Description: Hypothesis algorithms to be run for Photon + ** signatures at Level 2 after T2Calo + ** + ** Authour: R.Goncalo + ** + ** Created: Thu Jun 06 16:01:12 BST 2006 + ** Modified: V. Perez Reale adapted to New Steering Nov 06 + ** V. Perez Reale added doxygen comments 26/6/07 + ** V. Dao cleaned up accesor for monitoring 13/10/2009 + **************************************************************************/ + +#ifndef TRIG_PHOTON_HYPO_H +#define TRIG_PHOTON_HYPO_H + +#include <vector> + +// athena stuff stuff +#include "GaudiKernel/IToolSvc.h" +#include "CLHEP/Units/SystemOfUnits.h" + +// core trigger stuff +#include "TrigT1Interfaces/RecEmTauRoI.h" +#include "TrigInterfaces/HypoAlgo.h" + +// trigger EDM +//#include "TrigCaloEvent/TrigEMCluster.h" +//#include "TrigParticle/TrigPhoton.h" +//#include "TrigParticle/TrigPhotonContainer.h" +#include "xAODTrigCalo/TrigEMCluster.h" +#include "xAODTrigEgamma/TrigPhoton.h" +#include "xAODTrigEgamma/TrigPhotonContainer.h" + +#include "TrigTimeAlgs/TrigTimerSvc.h" + + +/** + * \class TrigL2PhotonHypo + * \brief TrigL2PhotonHypo is a Trigger Hypo Algorithm that retrieves the L2 TrigPhotonContainer + * created by TrigL2PhotonFex and then apply a subset of calorimeter selection cuts. A TE will be + * set active if the selection cuts are fullfilled. + * + * + */ + +class TrigL2PhotonHypo : public HLT::HypoAlgo { + + public: + TrigL2PhotonHypo(const std::string & name, ISvcLocator* pSvcLocator); + ~TrigL2PhotonHypo(); + + HLT::ErrorCode hltInitialize(); + HLT::ErrorCode hltFinalize(); + HLT::ErrorCode hltExecute(const HLT::TriggerElement* outputTE, bool& pass); + + private: + + //Calorimeter electron ID cuts + std::vector<float> m_etabin; //!< selection variable for L2 calo selection:eta bins + std::vector<float> m_eTthr; //!< selection variable for L2 calo selection + std::vector<float> m_eT2thr; //!< selection variable for L2 calo selection: ET + std::vector<float> m_hadeTthr; //!< selection variable for L2 calo selection + std::vector<float> m_hadeT2thr; //!< selection variable for L2 calo selection: ET (Had) + std::vector<float> m_carcorethr; //!< selection variable for L2 calo selection:Rcore + std::vector<float> m_caeratiothr; //!< selection variable for L2 calo selection: Eratio + std::vector<float> m_F1thr; //!< selection variable for L2 calo: fraction of energy deposited in 1st sampling + + float m_detacluster; + float m_dphicluster; + std::vector<float> m_calib; + + bool m_acceptAll; //!< accept all events bool property if true + bool m_etCutOnly; + bool m_acceptLOOSE; + bool m_saveTrigPh; //!< save TrigPhoton container bool property if true + + int PassedCuts; //!< counter for candidates passing each cut + + // functions to retrieve monitored quantities + + const xAOD::TrigPhotonContainer* m_PhotonContainer; //!< TrigPhotonConainer pointer + + //cut varaibles (these are monitored) + float Eta; // cluster eta + float Phi; // cluster phi + float dEta; // diff between cluster and RoI eta + float dPhi; // diff between cluster and RoI phi + float Eratio; // (emaxs1-e2tsts1)/(emaxs1+e2tsts1) + float Reta; // e237/e277 (used to be called rCore) + float EmET; // cluster electromagnetic ET + float HadET; // cluster hadronic ET + float f1; // fraction of energy deposited in 1st sampling + float HadEmRatio; // we now use the ratio (not the absolute HadEt) but this is not yet persistified in the TrigPhoton + + /** + * \brief implements histograms for monitoring + */ + static inline double PhEt (const xAOD::TrigPhoton* ph) {if(ph && (ph->emCluster()->et())) return ph->emCluster()->et(); else return -99.;} + static inline double PhEta (const xAOD::TrigPhoton* ph) {if(ph && (ph->eta())) return ph->eta(); else return -99.;} + + static inline double PhPhi (const xAOD::TrigPhoton* ph) {if(ph && (ph->phi())) return ph->phi(); else return -99.;} + static inline double PhRcore (const xAOD::TrigPhoton* ph) {if(ph && (ph->rcore())) return ph->rcore(); else return -99.;} + static inline double PhEratio(const xAOD::TrigPhoton* ph) {if(ph && (ph->eratio())) return ph->eratio(); else return -99.;} + + static inline double F1 (const xAOD::TrigPhoton* ph) { + if( ph && (ph->f1()) ) + return ph->f1(); + else return -99.; + } + +}; + +#endif diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/cmt/requirements b/Trigger/TrigHypothesis/TrigEgammaHypo/cmt/requirements new file mode 100755 index 00000000000..07199006251 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/cmt/requirements @@ -0,0 +1,57 @@ +package TrigEgammaHypo + +# General +use AtlasPolicy AtlasPolicy-* +use AtlasAIDA AtlasAIDA-* External +use GaudiInterface GaudiInterface-* External +use StoreGate StoreGate-* Control +use DataModel DataModel-* Control +use AtlasROOT AtlasROOT-* External + +# Trigger +use TrigTimeAlgs TrigTimeAlgs-* Trigger/TrigTools +use TrigT1Interfaces TrigT1Interfaces-* Trigger/TrigT1 +use TrigInterfaces TrigInterfaces-* Trigger/TrigSteer +use TrigSteeringEvent TrigSteeringEvent-* Trigger/TrigEvent + +# Egamma +use xAODEgamma xAODEgamma-* Event/xAOD +use PATCore PATCore-* PhysicsAnalysis/AnalysisCommon +use ElectronPhotonSelectorTools ElectronPhotonSelectorTools-* PhysicsAnalysis/ElectronPhotonID + +# Tracking +use VxVertex VxVertex-* Tracking/TrkEvent +use TrkSurfaces TrkSurfaces-* Tracking/TrkDetDescr + +private +apply_tag ROOTMathLibs + +use egammaEvent egammaEvent-* Reconstruction/egamma +use CaloEvent CaloEvent-* Calorimeter +use CxxUtils CxxUtils-* Control +use ITrackToVertex ITrackToVertex-* Reconstruction/RecoTools +#use TrigInDetToolInterfaces TrigInDetToolInterfaces-* Trigger/TrigTools +use RecoToolInterfaces RecoToolInterfaces-* Reconstruction/RecoTools + +use TrigMissingEtEvent TrigMissingEtEvent-* Trigger/TrigEvent +use TrigNavigation TrigNavigation-* Trigger/TrigEvent + +#need to import egammaPID +use AtlasROOT AtlasROOT-* External + +public +# To produce TrigElectrons +use TrigCaloEvent TrigCaloEvent-* Trigger/TrigEvent +use TrigInDetEvent TrigInDetEvent-* Trigger/TrigEvent +use TrigParticle TrigParticle-* Trigger/TrigEvent +use xAODTrigCalo xAODTrigCalo-* Event/xAOD +use xAODTracking xAODTracking-* Event/xAOD +use xAODTrigEgamma xAODTrigEgamma-* Event/xAOD +use AtlasCLHEP AtlasCLHEP-* External +use Particle Particle-* Reconstruction + +library TrigEgammaHypo *.cxx components/*.cxx + +apply_pattern component_library +apply_pattern declare_python_modules files="*.py" +#apply_pattern declare_joboptions files="TriggerConfig_*.py jobOfragment_*.py" diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/doc/Doxyfile b/Trigger/TrigHypothesis/TrigEgammaHypo/doc/Doxyfile new file mode 100755 index 00000000000..56007db0a58 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/doc/Doxyfile @@ -0,0 +1,231 @@ +# Doxyfile 1.5.3 + +#--------------------------------------------------------------------------- +#Project related configuration options +#--------------------------------------------------------------------------- +DOXYFILE_ENCODING = UTF-8 +PROJECT_NAME = TrigEgammaHypo +PROJECT_NUMBER = TrigEgammaHypo-00-07-66 +OUTPUT_DIRECTORY = /afs/cern.ch/user/a/ahamil/trigger/test/InstallArea/doc/TrigEgammaHypo +CREATE_SUBDIRS = NO +OUTPUT_LANGUAGE = English +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES +ABBREVIATE_BRIEF = +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = YES +FULL_PATH_NAMES = YES +STRIP_FROM_PATH = +STRIP_FROM_INC_PATH = +SHORT_NAMES = NO +JAVADOC_AUTOBRIEF = YES +QT_AUTOBRIEF = YES +MULTILINE_CPP_IS_BRIEF = NO +DETAILS_AT_TOP = NO +INHERIT_DOCS = YES +SEPARATE_MEMBER_PAGES = NO +TAB_SIZE = 8 +ALIASES = +OPTIMIZE_OUTPUT_FOR_C = NO +OPTIMIZE_OUTPUT_JAVA = NO +BUILTIN_STL_SUPPORT = NO +CPP_CLI_SUPPORT = NO +DISTRIBUTE_GROUP_DOC = NO +SUBGROUPING = YES +#--------------------------------------------------------------------------- +#Build related configuration options +#--------------------------------------------------------------------------- +EXTRACT_ALL = YES +EXTRACT_PRIVATE = YES +EXTRACT_STATIC = YES +EXTRACT_LOCAL_CLASSES = YES +EXTRACT_LOCAL_METHODS = NO +EXTRACT_ANON_NSPACES = NO +HIDE_UNDOC_MEMBERS = NO +HIDE_UNDOC_CLASSES = NO +HIDE_FRIEND_COMPOUNDS = NO +HIDE_IN_BODY_DOCS = NO +INTERNAL_DOCS = NO +CASE_SENSE_NAMES = YES +HIDE_SCOPE_NAMES = NO +SHOW_INCLUDE_FILES = YES +INLINE_INFO = YES +SORT_MEMBER_DOCS = NO +SORT_BRIEF_DOCS = NO +SORT_BY_SCOPE_NAME = NO +GENERATE_TODOLIST = YES +GENERATE_TESTLIST = YES +GENERATE_BUGLIST = YES +GENERATE_DEPRECATEDLIST= YES +ENABLED_SECTIONS = +MAX_INITIALIZER_LINES = 30 +SHOW_USED_FILES = YES +SHOW_DIRECTORIES = YES +FILE_VERSION_FILTER = +#--------------------------------------------------------------------------- +#configuration options related to warning and progress messages +#--------------------------------------------------------------------------- +QUIET = NO +WARNINGS = YES +WARN_IF_UNDOCUMENTED = YES +WARN_IF_DOC_ERROR = YES +WARN_NO_PARAMDOC = NO +WARN_FORMAT = "$file:$line: $text " +WARN_LOGFILE = +#--------------------------------------------------------------------------- +#configuration options related to the input files +#--------------------------------------------------------------------------- +INPUT = ../src ../TrigEgammaHypo ../doc ../share ../python +INPUT_ENCODING = UTF-8 +FILE_PATTERNS = *.cxx *.h *.py *.mk *.icc +RECURSIVE = YES +EXCLUDE = +EXCLUDE_SYMLINKS = NO +EXCLUDE_PATTERNS = +EXCLUDE_SYMBOLS = +EXAMPLE_PATH = ../doc ../cmt ../share +EXAMPLE_PATTERNS = *.cxx *.html requirements *.py +EXAMPLE_RECURSIVE = YES +IMAGE_PATH = +INPUT_FILTER = +FILTER_PATTERNS = +FILTER_SOURCE_FILES = NO +#--------------------------------------------------------------------------- +#configuration options related to source browsing +#--------------------------------------------------------------------------- +SOURCE_BROWSER = YES +INLINE_SOURCES = YES +STRIP_CODE_COMMENTS = YES +REFERENCED_BY_RELATION = NO +REFERENCES_RELATION = NO +REFERENCES_LINK_SOURCE = YES +USE_HTAGS = NO +VERBATIM_HEADERS = NO +#--------------------------------------------------------------------------- +#configuration options related to the alphabetical class index +#--------------------------------------------------------------------------- +ALPHABETICAL_INDEX = NO +COLS_IN_ALPHA_INDEX = 5 +IGNORE_PREFIX = +#--------------------------------------------------------------------------- +#configuration options related to the HTML output +#--------------------------------------------------------------------------- +GENERATE_HTML = YES +HTML_OUTPUT = html +HTML_FILE_EXTENSION = .html +HTML_HEADER = +HTML_FOOTER = +HTML_STYLESHEET = +HTML_ALIGN_MEMBERS = YES +GENERATE_HTMLHELP = NO +HTML_DYNAMIC_SECTIONS = NO +CHM_FILE = +HHC_LOCATION = +GENERATE_CHI = NO +BINARY_TOC = NO +TOC_EXPAND = NO +DISABLE_INDEX = NO +ENUM_VALUES_PER_LINE = 4 +GENERATE_TREEVIEW = NO +TREEVIEW_WIDTH = 250 +#--------------------------------------------------------------------------- +#configuration options related to the LaTeX output +#--------------------------------------------------------------------------- +GENERATE_LATEX = NO +LATEX_OUTPUT = latex +LATEX_CMD_NAME = latex +MAKEINDEX_CMD_NAME = makeindex +COMPACT_LATEX = NO +PAPER_TYPE = a4wide +EXTRA_PACKAGES = +LATEX_HEADER = +PDF_HYPERLINKS = NO +USE_PDFLATEX = NO +LATEX_BATCHMODE = YES +LATEX_HIDE_INDICES = NO +#--------------------------------------------------------------------------- +#configuration options related to the RTF output +#--------------------------------------------------------------------------- +GENERATE_RTF = NO +RTF_OUTPUT = rtf +COMPACT_RTF = NO +RTF_HYPERLINKS = NO +RTF_STYLESHEET_FILE = +RTF_EXTENSIONS_FILE = +#--------------------------------------------------------------------------- +#configuration options related to the man page output +#--------------------------------------------------------------------------- +GENERATE_MAN = NO +MAN_OUTPUT = man +MAN_EXTENSION = .3 +MAN_LINKS = NO +#--------------------------------------------------------------------------- +#configuration options related to the XML output +#--------------------------------------------------------------------------- +GENERATE_XML = NO +XML_OUTPUT = xml +XML_SCHEMA = +XML_DTD = +XML_PROGRAMLISTING = YES +#--------------------------------------------------------------------------- +#configuration options for the AutoGen Definitions output +#--------------------------------------------------------------------------- +GENERATE_AUTOGEN_DEF = NO +#--------------------------------------------------------------------------- +#configuration options related to the Perl module output +#--------------------------------------------------------------------------- +GENERATE_PERLMOD = NO +PERLMOD_LATEX = NO +PERLMOD_PRETTY = YES +PERLMOD_MAKEVAR_PREFIX = +#--------------------------------------------------------------------------- +#Configuration options related to the preprocessor +#--------------------------------------------------------------------------- +ENABLE_PREPROCESSING = YES +MACRO_EXPANSION = NO +EXPAND_ONLY_PREDEF = NO +SEARCH_INCLUDES = YES +INCLUDE_PATH = +INCLUDE_FILE_PATTERNS = +PREDEFINED = +EXPAND_AS_DEFINED = +SKIP_FUNCTION_MACROS = YES +#--------------------------------------------------------------------------- +#Configuration::additions related to external references +#--------------------------------------------------------------------------- +TAGFILES = +GENERATE_TAGFILE = /afs/cern.ch/user/a/ahamil/trigger/test/InstallArea/doc/TrigEgammaHypo.tag +ALLEXTERNALS = NO +EXTERNAL_GROUPS = YES +PERL_PATH = /usr/bin/perl +#--------------------------------------------------------------------------- +#Configuration options related to the dot tool +#--------------------------------------------------------------------------- +CLASS_DIAGRAMS = YES +MSCGEN_PATH = +HIDE_UNDOC_RELATIONS = YES +HAVE_DOT = YES +CLASS_GRAPH = YES +COLLABORATION_GRAPH = YES +GROUP_GRAPHS = YES +UML_LOOK = YES +TEMPLATE_RELATIONS = YES +INCLUDE_GRAPH = YES +INCLUDED_BY_GRAPH = YES +CALL_GRAPH = NO +CALLER_GRAPH = NO +GRAPHICAL_HIERARCHY = YES +DIRECTORY_GRAPH = YES +DOT_IMAGE_FORMAT = gif +DOT_PATH = +DOTFILE_DIRS = +DOT_GRAPH_MAX_NODES = 50 +MAX_DOT_GRAPH_DEPTH = 0 +DOT_TRANSPARENT = NO +DOT_MULTI_TARGETS = NO +GENERATE_LEGEND = YES +DOT_CLEANUP = YES +#--------------------------------------------------------------------------- +#Configuration::additions related to the search engine +#--------------------------------------------------------------------------- +SEARCHENGINE = YES diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/doc/EgammaPlots.kumac b/Trigger/TrigHypothesis/TrigEgammaHypo/doc/EgammaPlots.kumac new file mode 100755 index 00000000000..f67f86bc3fc --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/doc/EgammaPlots.kumac @@ -0,0 +1,44 @@ +Macro EgammaPlots offset=0 +opt stat +set stat 111111 +v/z 1 2 +id=[offset]+15 +h/pl [id] +id=[offset]+16 +h/pl [id] +wait +v/z 2 3 +for algo in 1 2 4 + if [algo]=1 then + title SiTrack + endif + if [algo]=2 then + title IDSCAN + endif + if [algo]=3 then + title TrtLUT + endif + if [algo]=4 then + title TRTxK + endif + + id=[offset]+100*[algo]+7 + h/pl [id] + + id=[offset]+100*[algo]+2 + h/pl [id] + + id=[offset]+100*[algo]+3 + h/pl [id] + + id=[offset]+100*[algo]+4 + h/pl [id] + + id=[offset]+100*[algo]+5 + h/pl [id] + + id=[offset]+100*[algo]+6 + h/pl [id] + +wait +endfor \ No newline at end of file diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/doc/mainpage.h b/Trigger/TrigHypothesis/TrigEgammaHypo/doc/mainpage.h new file mode 100755 index 00000000000..91d0faa9805 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/doc/mainpage.h @@ -0,0 +1,33 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + + +/** + +@mainpage +@author R. Goncalo +@author J. Baines +@author I. Graboska-Bold +@author T. Fonseca-Martin +@author D. Damazio +@author V. Perez-Reale +@author C. SantaMarina +@author P. Urquijo + +@section MyPackageOverview Overview +This package contains the fex and hypo trigger algorithms for the Electron and Photon Slice +It contains 2 algorithm classes: <br/> +Fex - which create a feature extraction object <br/> +Hypo - performs a selection on a feature extraction object created by a fex and creates timing +and monitoring histograms <br/> + +The package also contains the configuration files for the Electron and Photon Slice for all +electron and photon trigger menus. + + +@htmlinclude used_packages.html + + +*/ + diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/doc/used_packages.html b/Trigger/TrigHypothesis/TrigEgammaHypo/doc/used_packages.html new file mode 100755 index 00000000000..a1db74f420b --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/doc/used_packages.html @@ -0,0 +1,28 @@ +<center><table border="1"><tr><td><center><i><b>Used packages</b></i></center></td></tr> +<tr><td>GaudiKernel</td></tr> +<tr><td>GaudiSvc</td></tr> +<tr><td>External/AtlasROOT</td></tr> +<tr><td>External/AtlasCLHEP</td></tr> +<tr><td>External/GaudiInterface</td></tr> +<tr><td>External/AtlasAIDA</td></tr> +<tr><td>AtlasPolicy</td></tr> +<tr><td>Control/CLIDComps</td></tr> +<tr><td>Control/DataModel</td></tr> +<tr><td>Tracking/TrkDetDescr/TrkSurfaces</td></tr> +<tr><td>Tracking/TrkEvent/TrkParameters</td></tr> +<tr><td>Tracking/TrkExtrapolation/TrkExInterfaces</td></tr> +<tr><td>Tracking/TrkEvent/VxVertex</td></tr> +<tr><td>Reconstruction/Particle</td></tr> +<tr><td>Trigger/TrigT1/TrigT1Interfaces</td></tr> +<tr><td>Trigger/TrigTools/TrigTimeAlgs</td></tr> +<tr><td>Control/StoreGate</td></tr> +<tr><td>InnerDetector/InDetConditions/InDetBeamSpotService</td></tr> +<tr><td>Calorimeter/CaloEvent</td></tr> +<tr><td>Reconstruction/egamma/egammaEvent</td></tr> +<tr><td>Trigger/TrigEvent/TrigCaloEvent</td></tr> +<tr><td>Trigger/TrigEvent/TrigInDetEvent</td></tr> +<tr><td>Trigger/TrigEvent/TrigParticle</td></tr> +<tr><td>Trigger/TrigTools/TrigInDetToolInterfaces</td></tr> +<tr><td>Trigger/TrigEvent/TrigSteeringEvent</td></tr> +<tr><td>Trigger/TrigSteer/TrigInterfaces</td></tr> +</table></center> diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/Cosmic.temp.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/Cosmic.temp.py new file mode 100644 index 00000000000..87db0f65516 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/Cosmic.temp.py @@ -0,0 +1,2737 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +from string import atoi +from AthenaCommon.Include import include +from AthenaCommon.Logging import logging +from AthenaCommon.SystemOfUnits import GeV +from TriggerJobOpts.TriggerFlags import TriggerFlags +from TriggerMenuPython.TriggerPythonConfig import * +from TriggerJobOpts.TriggerFlags import TriggerFlags + +log = logging.getLogger( 'Cosmic.py' ) + + +def StreamTagName(TEName): + return 'Cosmics_'+TEName + + + +class LocalFlags: + DontWriteOutAllTEStream=True + UseSingleBeam7BitL1Menu=True + UseSingleBeam3BitL1Menu=False + UseStartup2009L1Menu=False + Use3Streams=False + T2CaloFakeLVL1InLVL2=False + doIDHitsHypo=False + doEFIDCosmics=False + useUniqueMuonEFInstance=True + doM3Data=True + useUniqueMuFastInstance=True + useUniqueMuonEFInstance=True + doMuonCalibrationStream=False + + + +L2SequencesList= {} +MuFastInstances = {} +TriggerTypes = {} +TriggerTypeMasks = {} + +#MBTSThresholdList=['NIM11','NIM12','NIM13','NIM14','NIM15','NIM16','NIM17','NIM18'] +MBTSThresholdList_SideA=[ + 'MBTS_A0', + 'MBTS_A1', + 'MBTS_A2', + 'MBTS_A3', + 'MBTS_A4', + 'MBTS_A5', + 'MBTS_A6', + 'MBTS_A7', + 'MBTS_A8', + 'MBTS_A9', + 'MBTS_A10', + 'MBTS_A11', + 'MBTS_A12', + 'MBTS_A13', + 'MBTS_A14', + 'MBTS_A15', + ] + +MBTSThresholdList_SideC=[ + 'MBTS_C0', + 'MBTS_C1', + 'MBTS_C2', + 'MBTS_C3', + 'MBTS_C4', + 'MBTS_C5', + 'MBTS_C6', + 'MBTS_C7', + 'MBTS_C8', + 'MBTS_C9', + 'MBTS_C10', + 'MBTS_C11', + 'MBTS_C12', + 'MBTS_C13', + 'MBTS_C14', + 'MBTS_C15', + ] + + +MBTSItemList_SideA=[ + 'L1_MBTSA0', + 'L1_MBTSA1', + 'L1_MBTSA2', + 'L1_MBTSA3', + 'L1_MBTSA4', + 'L1_MBTSA5', + 'L1_MBTSA6', + 'L1_MBTSA7', + 'L1_MBTSA8', + 'L1_MBTSA9', + 'L1_MBTSA10', + 'L1_MBTSA11', + 'L1_MBTSA12', + 'L1_MBTSA13', + 'L1_MBTSA14', + 'L1_MBTSA15', + ] + +MBTSItemList_SideC=[ + 'L1_MBTSC0', + 'L1_MBTSC1', + 'L1_MBTSC2', + 'L1_MBTSC3', + 'L1_MBTSC4', + 'L1_MBTSC5', + 'L1_MBTSC6', + 'L1_MBTSC7', + 'L1_MBTSC8', + 'L1_MBTSC9', + 'L1_MBTSC10', + 'L1_MBTSC11', + 'L1_MBTSC12', + 'L1_MBTSC13', + 'L1_MBTSC14', + 'L1_MBTSC15', + ] + +MBTSThresholdList = MBTSThresholdList_SideC + MBTSThresholdList_SideA + + +MBTSItemList_SideA_V2=['L1_MBTS_A_EMPTY'] +MBTSItemList_SideC_V2=['L1_MBTS_C_EMPTY'] + +MBTSThresholdList_SideA_V2=[ + 'MBTS_A0' + ] + +MBTSThresholdList_SideC_V2=[ + 'MBTS_C' + ] + +MBTSThresholdList_V2 = MBTSThresholdList_SideC_V2 + MBTSThresholdList_SideA_V2 + +#L1CaloThresholdList=['J1','J2','J3','J4','J5','J6','J7','J8',\ +# 'EM1','EM2','EM3','EM4','EM5','EM6','EM7',\ +# 'EM8','TAU1','TAU2','TAU3','TAU4','TAU5','TAU6','TAU7','TAU8',\ +# 'JE1','JE2','JE3','JE4',\ +# 'JF1','JF2','JF3','JF4',\ +# 'JE','TE','XE' +# ] + + +#L1CaloThresholdList_J=['J5','J10','J15','J20','J30','J40','J50','J100'] +#L1CaloThresholdList_EM=['EM5','EM10','EM15','EM20','EM30','EM40','EM50','EM100'] +#L1CaloThresholdList_TAU=['TAU5','TAU10','TAU15','TAU20','TAU30','TAU40','TAU50','TAU100'] +#L1CaloThresholdList_JB=['JB5','JB10','JB15','JB20'] +#L1CaloThresholdList_JF=['JF5','JF10','JF15','JF20'] +#L1CaloThresholdList_TE=['TE1','TE2','TE3','TE4'] +#L1CaloThresholdList_XE=['XE1','XE2','XE3','XE4','XE5','XE6','XE7','XE8'] + +L1CaloThresholdList_J=['J5','J10','J10_win6','J18', 'J20', 'J23', 'J40', 'J35','J42','J70', 'J100', 'J130' ] +L1CaloThresholdList_EM=['EM3','EM4','EM7','EM10','EM13','EM13I','EM18','EM7I'] +L1CaloThresholdList_TAU=['TAU5','TAU6','TAU9','TAU9I','TAU16','TAU16I','TAU40','TAU25'] +L1CaloThresholdList_JB=['JB18','JB3'] +L1CaloThresholdList_JF=['JF18','JF3'] +L1CaloThresholdList_TE=['TE150','TE360','TE650'] +L1CaloThresholdList_XE=['XE15', 'XE20','XE25','XE30','XE35','XE50','XE80'] +L1CaloThresholdList_JE=['JE120','JE280','JE340'] + + +L1CaloThresholdList=L1CaloThresholdList_J+L1CaloThresholdList_EM+L1CaloThresholdList_TAU+L1CaloThresholdList_JB+L1CaloThresholdList_JF+L1CaloThresholdList_TE+L1CaloThresholdList_XE+L1CaloThresholdList_JE + +L1CaloThresholdList_NoXE=L1CaloThresholdList_J+L1CaloThresholdList_EM+L1CaloThresholdList_TAU+L1CaloThresholdList_JB+L1CaloThresholdList_JF+L1CaloThresholdList_TE+L1CaloThresholdList_JE + + +L1CaloItemList_J =['L1_J5','L1_J10','L1_J10_win6','L1_J18', 'L1_J20', 'L1_J23', 'L1_J40', 'L1_J35','L1_J42','L1_J70', 'L1_J100', 'L1_J130' ] +L1CaloItemList_EM =['L1_EM3','L1_EM4','L1_EM7','L1_EM10','L1_EM13','L1_EM13I','L1_EM18','L1_EM7I'] +L1CaloItemList_TAU=['L1_TAU5','L1_TAU6','L1_TAU9','L1_TAU9I','L1_TAU16','L1_TAU16I','L1_TAU40','L1_TAU25'] +L1CaloItemList_JB =['L1_JB18','L1_JB3'] +L1CaloItemList_JF =['L1_JF18','L1_JF3'] +L1CaloItemList_TE =['L1_TE150','L1_TE360','L1_TE650'] +L1CaloItemList_XE =['L1_XE15', 'L1_XE20','L1_XE25','L1_XE30','L1_XE35','L1_XE50','L1_XE80'] +L1CaloItemList_JE =['L1_JE120','L1_JE280','L1_JE340'] + + +L1CaloItemList=L1CaloItemList_J+L1CaloItemList_EM+L1CaloItemList_TAU+L1CaloItemList_JB+L1CaloItemList_JF+L1CaloItemList_TE+L1CaloItemList_XE+L1CaloItemList_JE + +L1CaloItemList_NoXE=L1CaloItemList_J+L1CaloItemList_EM+L1CaloItemList_TAU+L1CaloItemList_JB+L1CaloItemList_JF+L1CaloItemList_TE+L1CaloItemList_JE + +L1CaloItemList_J_V2=['L1_J5_EMPTY', 'L1_J10_EMPTY', 'L1_J10_win6_EMPTY', + 'L1_J20_EMPTY', 'L1_J40_EMPTY', 'L1_J70_EMPTY', + 'L1_J100_EMPTY'] +L1CaloItemList_EM_V2 =['L1_EM3_EMPTY', 'L1_EM4_EMPTY', 'L1_EM7_EMPTY', + 'L1_EM7I_EMPTY', 'L1_EM10_EMPTY', 'L1_EM13_EMPTY', + 'L1_EM13I_EMPTY', 'L1_EM18_EMPTY', 'L1_2EM3_EMPTY', + 'L1_2EM4_EMPTY', 'L1_2EM7_EMPTY', 'L1_2EM7I_EMPTY', + 'L1_2EM10_EMPTY'] +L1CaloItemList_TAU_V2 =['L1_TAU5_EMPTY', 'L1_TAU6_EMPTY', 'L1_TAU9_EMPTY', + 'L1_TAU9I_EMPTY', 'L1_TAU16_EMPTY', 'L1_TAU16I_EMPTY', 'L1_TAU25_EMPTY', + 'L1_2TAU9_EMPTY', 'L1_2TAU9I_EMPTY', 'L1_2TAU16_EMPTY', + 'L1_2TAU16I_EMPTY'] +L1CaloItemList_JF_V2 =['L1_FJ3_EMPTY', 'L1_FJ18_EMPTY'] +L1CaloItemList_TE_V2 =['L1_TE150_EMPTY', 'L1_TE360_EMPTY'] +L1CaloItemList_XE_V2 =['L1_XE15_EMPTY', 'L1_XE25_EMPTY', 'L1_XE35_EMPTY', + 'L1_XE50_EMPTY'] +L1CaloItemList_JE_V2 =['L1_JE120_EMPTY', 'L1_JE280_EMPTY'] + +L1CaloItemList_NoXE_V2=L1CaloItemList_J_V2+L1CaloItemList_EM_V2+L1CaloItemList_TAU_V2+L1CaloItemList_JF_V2+L1CaloItemList_TE_V2+L1CaloItemList_JE_V2 + +#This hack is here to enable athena run combined from xml and python +defaultSignatures = { + 'Signature' : 'L1_MU6_RPC',# L1_MU6_EMPTY + 'StandaloneSignature' : 'L1_EM3', # L1_EM3_EMPTY + 'CaloSignature' : 'L1_J5', # L1_J5_EMPTY + 'RPCSignature' : 'L1_MU6_RPC',# L1_MU6_EMPTY / L1_MU0_HIGH_RPC_EMPTY + 'TGCSignature' : 'L1_MU0_TGC',# L1_MU0_EMPTY + 'TrackingSignature' : 'L1_EM3', # L1_EM3_EMPTY + 'WidePatternRPCSignature' : 'L1_MU0_LOW_RPC',# L1_MU0_EMPTY + 'CalibrationSignature' : 'L1_EM3', # L1_EM#_EMPTY + 'Signature_V2' : 'L1_MU6_EMPTY', + 'StandaloneSignature_V2' : 'L1_EM3_EMPTY', + 'CaloSignature_V2' : 'L1_J5_EMPTY', + 'MuonSignature_V2' : 'L1_MU0_EMPTY', + 'TrackingSignature_V2' : 'L1_EM3_EMPTY', + 'CalibrationSignature_V2' : 'L1_EM3_EMPTY' + } + +defaultThresholds = { + 'Threshold' : 'MU6_RPC', # MU6 + 'StandaloneThreshold' : 'EM3', + 'CaloThreshold' : 'J5', + 'RPCThreshold' : 'MU6_RPC', # MU6 + 'TGCThreshold' : 'MU0_TGC', # MU0 + 'TrackingThreshold' : 'EM3', + 'WidePatternRPCThreshold' : 'MU0_LOW_RPC', # MU0 + 'CalibrationThreshold' : 'EM3', + 'Threshold_V2' : 'MU6', + 'StandaloneThreshold_V2' : 'EM3', + 'CaloThreshold_V2' : 'J5', + 'MuonThreshold_V2' : 'MU0', + 'TrackingThreshold_V2' : 'EM3', + 'CalibrationThreshold_V2' : 'EM3' + } + + +def LastFreeCounter(CID): + if (CID!='-1'): + globals()['LFC']=int(CID) + if (TriggerFlags.CosmicSlice.testCosmic()==True): + log.info('setting LFC') + else: + globals()['LFC']=globals()['LFC']+1 + return str(globals()['LFC']) + +class CosmicTemplate: + def __init__(self, sig_id, l1item, l1threshold, counterId,StreamName,streamtype='physics',L2prescale=1.0,EFprescale=1.0,groupNames=["Cosmic"],myExpressStreamPrescale=-1): + + counterId=LastFreeCounter(counterId) + + mlog = logging.getLogger( 'Cosmic.py:CosmicTemplate' ) + self.groupNames=groupNames + self.sig_id = sig_id + self.l1threshold = l1threshold + self.TriggerTypeBit=int(counterId) + + + self.L2prescale='%f' % L2prescale + self.EFprescale='%f' % EFprescale + + if (TriggerFlags.CosmicSlice.testCosmic()==True): + mlog.info("prescales for chain %s " % sig_id) + mlog.info(self.L2prescale) + mlog.info(self.EFprescale) + + self.L2SequenceList = [] + self.EFSequenceList = [] + + self.L2SequenceHash = {} + self.EFSequenceHash = {} + + #self.configLVL2=TriggerFlags.doLVL2() #WTF commenting this out since it was overwritten anyway + self.configLVL2=True + + #self.configEF=TriggerFlags.doEF() + self.configEF=True + + if (StreamName==''): + if (type(l1threshold)==type([])): + StreamName='HLT_Cosmics' + for th in l1threshold: + StreamName+='_'+th + else: + StreamName='HLT_Cosmics_'+l1threshold + + if (l1threshold==TriggerFlags.CosmicSlice.CaloThreshold() and streamtype=='physics'): + StreamName = "HLT_Cosmic_L1Calo" + + if (sig_id=="L1CaloFilter"): + StreamName = "HLT_Cosmic_L1Calo" + if (sig_id=="L1CaloEMFilter"): + StreamName = "HLT_Cosmic_L1Calo" + if (sig_id=="L1CaloTauFilter"): + StreamName = "HLT_Cosmic_L1Calo" + if (sig_id=="L1CaloJetFilter"): + StreamName = "HLT_Cosmic_L1Calo" + + if (sig_id=="L1CaloPassthrough"): + StreamName = "HLT_Cosmic_L1Calo" + + if (sig_id=="PhysicsPassthrough"): + StreamName = "HLT_Cosmic_Physics" + streamtype='physics' + + if (sig_id=="CalibrationPassthrough"): + StreamName = "HLT_Cosmic_Calibration" + streamtype='calibration' + + if (sig_id=="L2CalibrationPassthrough"): + StreamName = "HLT_Cosmic_L2_Calibration" + streamtype='calibration' + + for i in [3,4,5,7,10,13,15,18,20,30,40,50,100]: + if ((sig_id=='EM%i' % i+'Passthrough') or \ + (sig_id=='EM%iI' % i+'Passthrough')): + StreamName = "HLT_Cosmic_EM_L1Calo" + + for i in [3,4,5,7,10,13,15,18,20,30,40,50,100]: + if ((sig_id=='EM%i' % i+'Dummy') or \ + (sig_id=='EM%iI' % i+'Dummy')): + StreamName = "HLT_Cosmic_EM_L1Calo" + + for i in [5,9,10,15,16,20,25,30,40,50,100]: + if ((sig_id=='JET%i' % i+'Dummy') or \ + (sig_id=='TAU%i' % i+'Dummy') or \ + (sig_id=='JET%iI' % i+'Dummy') or \ + (sig_id=='TAU%iI' % i+'Dummy')): + StreamName = "HLT_Cosmic_L1Calo" + for i in [3,5,10,15,18,20,35]: + if ((sig_id=='JB%i' % i+'Dummy') or \ + (sig_id=='JF%i' % i+'Dummy') or \ + (sig_id=='JB%iI' % i+'Dummy') or \ + (sig_id=='JF%iI' % i+'Dummy')): + StreamName = "HLT_Cosmic_L1Calo" + + if (sig_id=="MBTSPassthrough"): + StreamName = "HLT_Cosmic_MBTS" + + self.L2streamtype=streamtype + self.EFstreamtype=streamtype + + if (sig_id=="EFCalibrationPassthrough"): + StreamName = "HLT_Cosmic_EF_Calibration" + self.L2streamtype='physics' + self.EFstreamtype='calibration' + + L2StreamName=StreamName + EFStreamName=StreamName + + if (sig_id.count("AllTe") and not sig_id.count("CosmicsAllTe")): + StreamName = "HLT_Cosmic_AllTe" + L2StreamName=StreamName + if (LocalFlags.DontWriteOutAllTEStream): + EFStreamName = "" + else: + EFStreamName=StreamName + + if (sig_id=="AllTeTRTxK_TRTTrkHypo"): + StreamName = StreamName + "IDSelected" + L2StreamName=StreamName + EFStreamName=StreamName + + if (sig_id=="AllTeTRTxK_TRTTrkHypo_Pixel"): + StreamName = StreamName + "Pixel" + L2StreamName=StreamName + EFStreamName=StreamName + + if (sig_id in ["CosmicsAllTeTRTxK", + "CosmicsAllTeTRTxK_TRTTrkHypo", + "CosmicsAllTeTRTxK_TRTTrkHypo_Pixel", + "CosmicsAllTeTRTxK_TRTTrkHypo_AllPhysics", + "CosmicsAllTeTRTxK_TRTTrkHypo_AllPhysics_NoField", + "CosmicsAllTeTRTxK_TRTTrkHypo_AllPhysics_PEB", + 'CosmicsAllTeIDSCAN', + 'CosmicsAllTeSiTrack', + 'CosmicsAllTeIDSCAN_TrkHypo', + 'CosmicsAllTeSiTrack_TrkHypo', + 'CosmicsAllTeIDSCAN_AllPhysics_TrkHypo', + 'CosmicsAllTeSiTrack_AllPhysics_TrkHypo', + 'CosmicsAllTeIDSCAN_AllPhysics_4Hits_TrkHypo', + 'CosmicsAllTeSiTrack_AllPhysics_4Hits_TrkHypo', + 'CosmicsAllTeIDSCANCombined', + 'CosmicsAllTeSiTrackCombined', + 'CosmicsAllTeEFID']): + StreamName = "IDSelected" + L2StreamName=StreamName + EFStreamName='' + if (sig_id.count("Hypo")==1 or sig_id=='CosmicsAllTeEFID'): + EFStreamName=StreamName + + if (sig_id=="TRTPassthrough" ): + StreamName = "IDCosmic" + L2StreamName=StreamName + EFStreamName=StreamName + + if (sig_id=="TilePassthrough" ): + StreamName = "CosmicMuons" + L2StreamName=StreamName + EFStreamName=StreamName + + if (sig_id=="Cosmic_pixelnoise" ): + StreamName = "pixelnoise" + L2StreamName=StreamName + EFStreamName=StreamName + streamtype='calibration' + + if (sig_id=="Cosmic_rateanalysis" ): + StreamName = "rateanalysis" + L2StreamName=StreamName + EFStreamName=StreamName + streamtype='calibration' + + + + ######################################## This part is the same for all sequences (begin) ############################################################ + # defining the L2 chain for signatures + if self.configLVL2: + if (sig_id.count("AllTe")): + from TrigEFIDCosmic.TrigEFIDCosmicConf import Cosmic__DummyUnseededAllTEAlgo + self.AllTEDummyFakeROI = Cosmic__DummyUnseededAllTEAlgo("Cosmic"+sig_id+"AllTEDummy") + from TrigEFIDCosmic.TrigEFIDCosmicConf import L1InfoHypo + + self.L1InfoHypo = L1InfoHypo("L1InfoHypo"+sig_id) # here we created an instance + self.L1InfoHypoRNDMReject = L1InfoHypo("L1InfoHypoRNDMReject"+sig_id) # here we created an instance + + self.L1InfoHypoRNDMReject.InvertSelection=True + self.L1InfoHypoRNDMReject.TriggerTypeBit = 0x81 + self.L1InfoHypoRNDMReject.TriggerTypeBitMask=0xff + self.L2SequenceHash[self.AllTEDummyFakeROI.name()]=[self.AllTEDummyFakeROI,self.L1InfoHypo,self.L1InfoHypoRNDMReject] + self.L2SequenceList+=[self.AllTEDummyFakeROI.name()] + + if (TriggerFlags.CosmicSlice.testCosmic()==True): + mlog.info("Creating new HLTchain L2_"+sig_id+" with lower chain name:"+str(l1item)) + self.l2chain = HLTChain( chain_name="L2_"+sig_id,chain_counter=counterId,lower_chain_name=l1item,level="L2",prescale=self.L2prescale,pass_through='0') + self.l2chain.addStreamTag(L2StreamName, type=self.L2streamtype, obeyLB='yes', prescale='1') + self.l2chain.addTriggerTypeBit(self.TriggerTypeBit) + self.l2chain.addGroup(self.groupNames) + + if sig_id.find('passHLT') >= 0: self.l2chain.pass_through='1' + if sig_id.find('passL2' ) >= 0: self.l2chain.pass_through='1' + + # defining the EF chain for signatures + if self.configEF: + self.efchain = HLTChain( chain_name="EF_"+sig_id,chain_counter=counterId,lower_chain_name="L2_"+sig_id,level="EF",prescale=self.EFprescale,pass_through='0') + if (EFStreamName!=""): + self.efchain.addStreamTag(EFStreamName, type=self.EFstreamtype, obeyLB='yes', prescale='1') + else: + self.efchain.addStreamTag("DISCARD", type=self.EFstreamtype, obeyLB='yes', prescale='1') + from TrigGenericAlgs.TrigGenericAlgsConf import DummyFEX + self.Reject_Dummy = DummyFEX("Cosmic_RejectAllDummy_%s" % sig_id) + from TrigEFIDCosmic.TrigEFIDCosmicConf import L1InfoHypo + self.RejectAll = L1InfoHypo("RejectAll"+sig_id) + self.RejectAll.TriggerTypeBitMask=0x0 + self.RejectAll.TriggerTypeBit =0x0 + self.RejectAll.InvertSelection =True + self.EFSequenceHash[self.RejectAll.name()]=[self.Reject_Dummy,self.RejectAll] + self.EFSequenceList+=[self.RejectAll.name()] + + if (myExpressStreamPrescale>0): + self.efchain.addStreamTag('express', 'reserved', 'yes', '%i' % myExpressStreamPrescale) + + self.efchain.addTriggerTypeBit(self.TriggerTypeBit) + self.efchain.addGroup(self.groupNames) + if sig_id.find('passHLT') >= 0: self.efchain.pass_through='1' + if sig_id.find('passEF' ) >= 0: self.efchain.pass_through='1' + + def generateMenu(self, triggerPythonConfig): + mlog = logging.getLogger( 'Cosmic.py:CosmicTemplate' ) + + TE = self.l1threshold + if self.configLVL2: + if eval(self.Flag): + if (TriggerFlags.CosmicSlice.testCosmic()==True): + mlog.info("Generating L2 sequence for %s" % self.sig_id) + for x in self.L2SequenceList: + if (TriggerFlags.CosmicSlice.testCosmic()==True): + mlog.info(self.sig_id+", "+x+", "+str(self.L2SequenceHash[x])) + if (x not in L2SequencesList): + if (TriggerFlags.CosmicSlice.testCosmic()==True): + mlog.info("Creating new sequence "+str(self.L2SequenceHash[x])+", input, "+str(TE)+", output, "+x) + L2SequencesList[x]=[TE,self.L2SequenceHash[x]] + TE = triggerPythonConfig.addSequence(TE,self.L2SequenceHash[x],x) + self.l2chain.addHLTSignature(TE) + else: + TE=x + self.l2chain.addHLTSignature(TE) + if (TriggerFlags.CosmicSlice.testCosmic()==True): + mlog.info( "Assuming sequence "+str(self.L2SequenceHash[x])+" already exists, setting input TE for next chain to: "+str(TE)) + triggerPythonConfig.registerHLTChain(self.sig_id,self.l2chain) + if (TriggerFlags.CosmicSlice.testCosmic()==True): + mlog.info("Registered chain %s:" % self.sig_id) + mlog.info( self.l2chain) + else: + if (TriggerFlags.CosmicSlice.testCosmic()==True): + mlog.info("L2 sequence for %s not enabled" % self.sig_id) + else: + if (TriggerFlags.CosmicSlice.testCosmic()==True): + mlog.info("configLVL2 for %s not enabled" % self.sig_id) + + if self.configEF: + if eval(self.Flag): + for x in self.EFSequenceList: + TE = triggerPythonConfig.addSequence(TE, self.EFSequenceHash[x],x) + self.efchain.addHLTSignature(TE) + else: + if (TriggerFlags.CosmicSlice.testCosmic()==True): + mlog.info("EF sequence for %s not enabled" % self.sig_id) + triggerPythonConfig.registerHLTChain(self.sig_id, self.efchain) + else: + if (TriggerFlags.CosmicSlice.testCosmic()==True): + mlog.info("configEF for %s not enabled" % self.sig_id) + ######################################## This part is the same for all sequences (end) ############################################################### + + + + +######################################## Dummy slice ############################################################### +class CosmicStandalone(CosmicTemplate): + def __init__(self, sig_id, l1item, l1threshold, counterId,StreamName,streamtype='physics',L2prescale=1,EFprescale=1): + CosmicTemplate.__init__(self, sig_id, l1item, l1threshold, counterId,StreamName,streamtype,L2prescale,EFprescale,groupNames=["Cosmic","Cosmic_Dummies"]) + mlog = logging.getLogger( 'Cosmic.py:CosmicStandalone' ) + + if l1threshold not in TriggerFlags.CosmicSlice.UsedLVL1Thresholds.StoredValue: + TriggerFlags.CosmicSlice.UsedLVL1Thresholds.StoredValue += [l1threshold] + if l1item not in TriggerFlags.CosmicSlice.UsedLVL1Signatures.StoredValue: + TriggerFlags.CosmicSlice.UsedLVL1Signatures.StoredValue += [l1item] + + self.__supported = ["StandaloneDummy","CaloDummy","RPCDummy","TGCDummy","Dummy","MU1Dummy","MU2Dummy","MU3Dummy","MU11Dummy"] + + for i in range(1,9): + self.__supported += ['JET%iDummy' % i] + self.__supported += ['TAU%iDummy' % i] + self.__supported += ['EM%iDummy' % i] + TriggerTypes['JET%i' % i]=0x90 + TriggerTypes['TAU%i' % i]=0x90 + TriggerTypes['EM%i' % i]=0x90 + for i in range(1,5): + self.__supported += ['JB%iDummy' % i] + self.__supported += ['JF%iDummy' % i] + TriggerTypes['JB%i' % i]=0x90 + TriggerTypes['JF%i' % i]=0x90 + + if sig_id not in self.__supported: + raise Exception("ERROR: "+sig_id+" not supprted"+str(self.__supported) ) + + self.Flag='TriggerFlags.CosmicSlice.do%s()' % sig_id + if self.configLVL2: + if eval(self.Flag): + from TrigGenericAlgs.TrigGenericAlgsConf import DummyFEX + self.L2_Dummy = DummyFEX("Cosmic_L2_%s" % sig_id) + self.L2SequenceHash[self.L2_Dummy.name()]=[self.L2_Dummy] + self.L2SequenceList += [self.L2_Dummy.name()] + + if self.configEF: + if eval(self.Flag): + from TrigGenericAlgs.TrigGenericAlgsConf import DummyFEX + self.EF_Dummy = DummyFEX("Cosmic_EF_%s" % sig_id) + self.EFSequenceHash[self.EF_Dummy.name()]=[self.EF_Dummy] + self.EFSequenceList += [self.EF_Dummy.name()] + +######################################## Passthrough slice ############################################################### +class CosmicCalibration(CosmicTemplate): + def __init__(self, sig_id, l1item, l1threshold, counterId,StreamName,streamtype='physics',L2prescale=1,EFprescale=1,ExpressStreamPrescale=-1): + if (sig_id.count('Passthrough') or sig_id.count('SingleBeam')): + streamtype='physics' + else: + streamtype='calibration' + + + if (LocalFlags.UseSingleBeam7BitL1Menu or LocalFlags.UseStartup2009L1Menu): + if (sig_id=="SingleBeamTriggerType0" ): + StreamName='ERROR_TriggerType0_ERROR' + if (sig_id=="SingleBeamRNDM" ): + StreamName='RNDM' + if (sig_id=="SingleBeamBPTX" ): + StreamName='BPTX' + if (sig_id=="SingleBeamL1Calo" ): + StreamName='L1Calo' + if (sig_id=="SingleBeamL1CaloEMFilter" ): + StreamName='L1CaloEM' + if (sig_id=="SingleBeamL1CaloEMFilter_V2" ): + StreamName='L1CaloEM' + if (sig_id=="SingleBeamTGCwBeam" ): + StreamName='TGCwBeam' + if (sig_id=="SingleBeamRPCwBeam" ): + StreamName='RPCwBeam' + if (sig_id=="SingleBeamMBTS" ): + StreamName='MBTS_BCM_LUCID' + if (sig_id=="SingleBeamMBTSFilter" ): + StreamName='MBTS_BCM_LUCID' + if (sig_id=="SingleBeamBCM" ): + StreamName='MBTS_BCM_LUCID' + if (sig_id=="SingleBeamLUCID" ): + StreamName='MBTS_BCM_LUCID' + if (sig_id=="SingleBeamCosmicMuons"): + StreamName='CosmicMuons' + + if (LocalFlags.UseSingleBeam3BitL1Menu or LocalFlags.Use3Streams): + if (sig_id=="SingleBeamTriggerType0" ): + StreamName='ERROR_TriggerType0_ERROR' + if (sig_id=="SingleBeamRNDM" ): + StreamName='RNDM' + if (sig_id=="SingleBeamBPTX" ): + StreamName='BPTX' + if (sig_id=="SingleBeamL1Calo" ): + StreamName='DetectorActivity' + if (sig_id=="SingleBeamL1CaloEMFilter" ): + StreamName='DetectorActivity' + if (sig_id=="SingleBeamTGCwBeam" ): + StreamName='DetectorActivity' + if (sig_id=="SingleBeamRPCwBeam" ): + StreamName='DetectorActivity' + if (sig_id=="SingleBeamMBTS" ): + StreamName='DetectorActivity' + if (sig_id=="SingleBeamMBTSFilter" ): + StreamName='DetectorActivity' + if (sig_id=="SingleBeamBCM" ): + StreamName='DetectorActivity' + if (sig_id=="SingleBeamLUCID" ): + StreamName='DetectorActivity' + if (sig_id=="SingleBeamCosmicMuons"): + StreamName='DetectorActivity' + + + + CosmicTemplate.__init__(self, sig_id, l1item, l1threshold, counterId,StreamName,streamtype,L2prescale,EFprescale,groupNames=["Cosmic","Cosmic_Passthroughs"],myExpressStreamPrescale=ExpressStreamPrescale) + mlog = logging.getLogger( 'Cosmic.py:CosmicEmpty' ) + + self.__supported = ["StandaloneCalibration","CaloCalibration", + "RPCCalibration","TGCCalibration","Calibration", + "L1CaloPassthrough","MBTSPassthrough", + "NIM0Passthrough","NIM4Passthrough","TRTPassthrough", "TilePassthrough", + "CALREQ0Calibration","CALREQ1Calibration","CALREQ2Calibration", + "PhysicsPassthrough","CalibrationPassthrough","L2CalibrationPassthrough", + "EFCalibrationPassthrough","RNDM0Passthrough","RNDM1Passthrough","BCMPassthrough","LUCIDPassthrough", + "SingleBeamTriggerType0", + "SingleBeamRNDM", + "SingleBeamBPTX", + "SingleBeamL1Calo", + "SingleBeamL1CaloEMFilter", + "SingleBeamL1CaloEMFilter_V2", + "SingleBeamTGCwBeam", + "SingleBeamRPCwBeam", + "SingleBeamMBTS", + "SingleBeamMBTSFilter", + "SingleBeamBCM", + "SingleBeamLUCID", + "SingleBeamCosmicMuons", + ] + for i in [5,10,15,20,30,40,50,100]: + self.__supported += ['JET%iPassthrough' % i] + self.__supported += ['TAU%iPassthrough' % i] + self.__supported += ['EM%iPassthrough' % i] + TriggerTypes['JET%i' % i]=0x90 + TriggerTypes['TAU%i' % i]=0x90 + TriggerTypes['EM%i' % i]=0x90 + for i in [5,10,15,20]: + self.__supported += ['JB%iPassthrough' % i] + self.__supported += ['JF%iPassthrough' % i] + TriggerTypes['JB%i' % i]=0x90 + TriggerTypes['JF%i' % i]=0x90 + + TriggerTypes['RNDMPassthrough']=0x88 + TriggerTypes['MBTSPassthrough']=0xc0 + + TriggerTypes['BCMPassthrough'] =0xc1 + TriggerTypes['LUCIDPassthrough']=0xc2 + + TriggerTypes['NIM0Passthrough']=0x81 + TriggerTypes['NIM4Passthrough']=0xa0 + TriggerTypes['TRTPassthrough']=0xc0 + TriggerTypeMasks['TRTPassthrough']=0xc0 + + TriggerTypes['TilePassthrough']=0xc0 + TriggerTypeMasks['TilePassthrough']=0xc0 + + TriggerTypes['CALREQ0Calibration']=0x31 + TriggerTypes['CALREQ1Calibration']=0x32 + TriggerTypes['CALREQ2Calibration']=0x34 + + + if (LocalFlags.UseSingleBeam7BitL1Menu or LocalFlags.UseStartup2009L1Menu): + TriggerTypes['SingleBeamTriggerType0' ] =0x00 + TriggerTypeMasks['SingleBeamTriggerType0' ] =0x7f + TriggerTypes['SingleBeamRNDM' ] =0x81 + TriggerTypes['SingleBeamBPTX' ] =0x82 + TriggerTypes['SingleBeamL1Calo'] =0x84 + TriggerTypes['SingleBeamL1CaloEMFilter'] =0x84 + TriggerTypes['SingleBeamL1CaloEMFilter_V2'] =0x84 + TriggerTypes['SingleBeamTGCwBeam'] =0x88 + TriggerTypes['SingleBeamRPCwBeam'] =0x90 + TriggerTypes['SingleBeamMBTS'] =0xa0 + TriggerTypes['SingleBeamMBTSFilter'] =0xa0 + TriggerTypes['SingleBeamBCM'] =0xa0 + TriggerTypes['SingleBeamLUCID'] =0xa0 + TriggerTypes['SingleBeamCosmicMuons']=0xc0 + + + TriggerTypeMasks['SingleBeamRNDM' ] =0x81 + TriggerTypeMasks['SingleBeamBPTX' ] =0x82 + TriggerTypeMasks['SingleBeamL1Calo'] =0x84 + TriggerTypeMasks['SingleBeamL1CaloEMFilter'] =0x84 + TriggerTypeMasks['SingleBeamTGCwBeam'] =0x88 + TriggerTypeMasks['SingleBeamRPCwBeam'] =0x90 + TriggerTypeMasks['SingleBeamMBTS'] =0xa0 + TriggerTypeMasks['SingleBeamMBTSFilter'] =0xa0 + TriggerTypeMasks['SingleBeamBCM'] =0xa0 + TriggerTypeMasks['SingleBeamLUCID'] =0xa0 + TriggerTypeMasks['SingleBeamCosmicMuons']=0xc0 + + + if (LocalFlags.UseSingleBeam3BitL1Menu): + TriggerTypes['SingleBeamTriggerType0' ] =0x00 + TriggerTypeMasks['SingleBeamTriggerType0' ] =0x7f + + TriggerTypes['SingleBeamRNDM' ] =0x81 + TriggerTypes['SingleBeamBPTX' ] =0x82 + TriggerTypes['SingleBeamL1Calo'] =0x84 + TriggerTypes['SingleBeamL1CaloEMFilter'] =0x84 + TriggerTypes['SingleBeamTGCwBeam'] =0x84 + TriggerTypes['SingleBeamRPCwBeam'] =0x84 + TriggerTypes['SingleBeamMBTS'] =0x84 + TriggerTypes['SingleBeamMBTSFilter'] =0x84 + TriggerTypes['SingleBeamBCM'] =0x84 + TriggerTypes['SingleBeamLUCID'] =0x84 + TriggerTypes['SingleBeamCosmicMuons']=0x84 + + TriggerTypeMasks['SingleBeamRNDM' ] =0x81 + TriggerTypeMasks['SingleBeamBPTX' ] =0x82 + TriggerTypeMasks['SingleBeamL1Calo'] =0x84 + TriggerTypeMasks['SingleBeamL1CaloEMFilter'] =0x84 + TriggerTypeMasks['SingleBeamTGCwBeam'] =0x84 + TriggerTypeMasks['SingleBeamRPCwBeam'] =0x84 + TriggerTypeMasks['SingleBeamMBTS'] =0x84 + TriggerTypeMasks['SingleBeamMBTSFilter'] =0x84 + TriggerTypeMasks['SingleBeamBCM'] =0x84 + TriggerTypeMasks['SingleBeamLUCID'] =0x84 + TriggerTypeMasks['SingleBeamCosmicMuons']=0x84 + + + + if sig_id not in self.__supported: + raise Exception("ERROR: "+sig_id+" not supprted"+str(self.__supported) ) + + self.Flag='TriggerFlags.CosmicSlice.do%s()' % sig_id + + if self.configLVL2: + if eval(self.Flag): + from TrigEFIDCosmic.TrigEFIDCosmicConf import Cosmic__DummyUnseededAllTEAlgo + self.AllTEDummyFakeROI = Cosmic__DummyUnseededAllTEAlgo("Cosmic"+sig_id+"AllTEDummy") + from TrigEFIDCosmic.TrigEFIDCosmicConf import L1InfoHypo + self.L1InfoHypo = L1InfoHypo("L1InfoHypo"+sig_id) # here we created an instance + if (sig_id=='SingleBeamMBTSFilter'): + self.SecondL1InfoHypo = L1InfoHypo("L1InfoHypo_2"+sig_id) # here we created an instance + self.SecondL1InfoHypo.TriggerTypeBitMask=0x5f + self.SecondL1InfoHypo.TriggerTypeBit =0x00 + self.SecondL1InfoHypo.InvertSelection =True + + #self.SecondL1InfoHypo.OutputLevel =4 + #self.L1InfoHypo.OutputLevel =4 + + self.L2SequenceHash[self.AllTEDummyFakeROI.name()]=[self.AllTEDummyFakeROI,self.L1InfoHypo,self.SecondL1InfoHypo] + else: + self.L2SequenceHash[self.AllTEDummyFakeROI.name()]=[self.AllTEDummyFakeROI,self.L1InfoHypo] + + self.L2SequenceList+=[self.AllTEDummyFakeROI.name()] + + self.AllTEDummyFakeROI.FakeROIEta=0.0 + self.AllTEDummyFakeROI.FakeROIPhi=0.0 + # sig_id.count("MBTS") or + if (sig_id=="RNDM0Passthrough" or + sig_id=="RNDM4Passthrough" or + sig_id=="BCMPassthrough" or + sig_id=="LUCIDPassthrough" or + sig_id=="L1CaloPassthrough" or + sig_id=="CALREQ0Calibration" or + sig_id=="CALREQ1Calibration" or + sig_id=="CALREQ2Calibration" or + sig_id=="TRTPassthrough" or + sig_id=="TilePassthrough" + ): + self.L1InfoHypo.L1ItemNames += self.l1threshold + + if (sig_id=="SingleBeamRNDM" ): + self.L1InfoHypo.L1ItemNames=[] + if (sig_id=="SingleBeamBPTX" ): + self.L1InfoHypo.L1ItemNames=[] + if (sig_id=="SingleBeamL1Calo" ): + self.L1InfoHypo.L1ItemNames=[] + if (sig_id=="SingleBeamTGCwBeam" ): + self.L1InfoHypo.L1ItemNames=[] + if (sig_id=="SingleBeamRPCwBeam" ): + self.L1InfoHypo.L1ItemNames=[] + if (sig_id=="SingleBeamMBTS" ): + self.L1InfoHypo.L1ItemNames=[] + if (sig_id=="SingleBeamMBTSFilter" ): + self.L1InfoHypo.L1ItemNames=[] + if (sig_id=="SingleBeamBCM" ): + self.L1InfoHypo.L1ItemNames=[] + if (sig_id=="SingleBeamLUCID" ): + self.L1InfoHypo.L1ItemNames=[] + if (sig_id=="SingleBeamCosmicMuons"): + self.L1InfoHypo.L1ItemNames=[] + + if (sig_id=="SingleBeamRNDM" or sig_id=="SingleBeamBPTX" or sig_id=="SingleBeamL1Calo" or sig_id=="SingleBeamTGCwBeam" or sig_id=="SingleBeamRPCwBeam" or sig_id=="SingleBeamMBTS" or sig_id=="SingleBeamBCM" or sig_id=="SingleBeamLUCID" or sig_id=="SingleBeamCosmicMuons"): + self.L1InfoHypo.L1ItemNames=[] + #if (sig_id=='SingleBeamL1CaloEMFilter'): + # self.L1InfoHypo.L1ItemNames += self.l1threshold + + #self.AllTEDummyFakeROI.FakeROIEta=1.7 + #self.AllTEDummyFakeROI.FakeROIPhi=1.5 + + + for x in TriggerTypes: + if (sig_id.count(x)): + self.L1InfoHypo.TriggerTypeBitMask=0xff + self.L1InfoHypo.TriggerTypeBit =TriggerTypes[x] + + for x in TriggerTypeMasks: + if (sig_id.count(x)): + self.L1InfoHypo.TriggerTypeBitMask=TriggerTypeMasks[x] + + if (sig_id=="L1CaloPassthrough"): + self.L1InfoHypo.TriggerTypeBitMask=0xff + self.L1InfoHypo.TriggerTypeBit =0x90 + + self.L1InfoHypo.L1TriggerBitMask=0x0 + self.L1InfoHypo.L1TriggerBit =0x01 + + if (sig_id=="CalibrationPassthrough"): + self.L1InfoHypo.TriggerTypeBitMask=0x80 + self.L1InfoHypo.TriggerTypeBit =0x00 + + if (sig_id=="PhysicsPassthrough"): + self.L1InfoHypo.TriggerTypeBitMask=0x80 + self.L1InfoHypo.TriggerTypeBit =0x80 + + if (sig_id=="L2CalibrationPassthrough"): + self.L1InfoHypo.TriggerTypeBitMask=0x80 + self.L1InfoHypo.TriggerTypeBit =0x80 + + if (sig_id=="EFCalibrationPassthrough"): + self.L1InfoHypo.TriggerTypeBitMask=0x80 + self.L1InfoHypo.TriggerTypeBit =0x80 + + +######################################## Empty slice ############################################################### +class CosmicEmpty(CosmicTemplate): + def __init__(self, sig_id, l1item, l1threshold, counterId,StreamName): + CosmicTemplate.__init__(self, sig_id, l1item, l1threshold, counterId,StreamName,groupNames=["Cosmic","Cosmic_EmptyChains"]) + mlog = logging.getLogger( 'Cosmic.py:CosmicEmpty' ) + + self.__supported = ["StandaloneEmpty","CaloEmpty","RPCEmpty","TGCEmpty","Empty","MU3Empty","MU11Empty"] + if sig_id not in self.__supported: + raise Exception("ERROR: "+sig_id+" not supprted"+str(self.__supported) ) + + self.Flag='TriggerFlags.CosmicSlice.do%s()' % sig_id + + ######################################## Tile Calibration slice ############################################################### + +class CosmicTileCalibration(CosmicTemplate): + def __init__(self, sig_id, l1item, l1threshold, counterId, StreamName): + CosmicTemplate.__init__(self, sig_id, l1item, l1threshold, counterId,StreamName,streamtype='calibration',groupNames=["Cosmic","Cosmic_TileCalibration"]) + mlog = logging.getLogger( 'Cosmic.py:CosmicTileCalibration' ) + + self.__supported = ["TileCalib_ped","TileCalib_laser","TileCalib_cis"] + if sig_id not in self.__supported: + raise Exception("ERROR: "+sig_id+" not supprted"+str(self.__supported) ) + + self.Flag='TriggerFlags.CosmicSlice.do%s()' % sig_id + + if self.configLVL2: + if eval(self.Flag): +# if (sig_id.count("AllTe")): +# self.L1InfoHypo.InvertSelection =True +# self.L1InfoHypo.TriggerTypeBitMask=0xff +# self.L1InfoHypo.TriggerTypeBit =0x88 +# self.AllTEDummyFakeROI.FakeROIEta=0.0 +# self.AllTEDummyFakeROI.FakeROIPhi=0.0 + from TrigDetCalib.TrigDetCalibConfig import TileSubDetListWriter + self.l2_tileSubDetListWriter = TileSubDetListWriter("Cosmic"+sig_id+"TileSubDetListWriter") + self.l2_tileSubDetListWriter.Subdetectors = "Tile" + self.l2_tileSubDetListWriter.MaxRoIsPerEvent = 1 + self.L2SequenceHash[self.l2_tileSubDetListWriter.name()] = [self.l2_tileSubDetListWriter] + self.L2SequenceList+=[self.l2_tileSubDetListWriter.name()] + + if self.configEF: + if eval(self.Flag): + from TrigGenericAlgs.TrigGenericAlgsConf import DummyFEX + self.EF_Dummy = DummyFEX("EF_%s" % sig_id) + self.EFSequenceHash[self.EF_Dummy.name()]=[self.EF_Dummy] + self.EFSequenceList+=[self.EF_Dummy.name()] + + def generateMenu(self,triggerPythonConfig): + CosmicTemplate.generateMenu(self,triggerPythonConfig) + +######################################## LArCalib slice ############################################################### +class CosmicLArCalib(CosmicTemplate): + def __init__(self, sig_id, l1item, l1threshold, counterId,StreamName,streamtype='calibration',L2prescale=1,EFprescale=1): + CosmicTemplate.__init__(self, sig_id, l1item, l1threshold, counterId,StreamName,streamtype,L2prescale,EFprescale,groupNames=["Cosmic","Cosmic_LArCalibration"]) + mlog = logging.getLogger( 'Cosmic.py:CosmicLArCalib' ) + + self.__supported = ["LArCalib","LArCalib_V2"] + if sig_id not in self.__supported: + raise Exception("ERROR: "+sig_id+" not supported"+str(self.__supported) ) + + self.Flag='TriggerFlags.CosmicSlice.do%s()' % sig_id + + if self.configLVL2: + if eval(self.Flag): + from TrigT2CaloEgamma.TrigT2CaloEgammaConfig import T2CaloEgamma_eGamma + self.l2_T2CaloEgamma = T2CaloEgamma_eGamma("Cosmic"+sig_id+"T2CaloEgamma_eGamma") + + if (LocalFlags.T2CaloFakeLVL1InLVL2): + self.l2_T2CaloEgamma.L1ForcePhi=-1.5 + self.l2_T2CaloEgamma.L1ForceEta=1.7 + from TrigEgammaHypo.TrigL2CaloHypoConfig import L2CaloHypo_g7 + from TrigEgammaHypo.TrigL2PhotonFexConfig import L2PhotonFex_1 + from TrigEgammaHypo.TrigL2PhotonHypoConfig import L2PhotonHypo_g10_loose + self.l2_L2PhotonHypo_g10_loose = L2PhotonHypo_g10_loose("Cosmic"+sig_id+"L2PhotonHypo_g10_loose") + self.l2_L2PhotonFex_1 = L2PhotonFex_1("Cosmic"+sig_id+"L2PhotonFex_1") + self.l2_L2CaloHypo_g7 = L2CaloHypo_g7("Cosmic"+sig_id+"L2CaloHypo_g7") + + self.l2_L2PhotonHypo_g10_loose.ETthr = [-7.*GeV,-7.*GeV,-7.*GeV,-7.*GeV,-7.*GeV,-7.*GeV,-7.*GeV,-7.*GeV,-7.*GeV] + self.l2_L2PhotonHypo_g10_loose.AcceptAll=False + self.l2_L2CaloHypo_g7.ETthr = [-7.*GeV,-7.*GeV,-7.*GeV,-7.*GeV,-7.*GeV,-7.*GeV,-7.*GeV,-7.*GeV,-7.*GeV] + self.l2_L2CaloHypo_g7.AcceptAll=False + + # from TrigDetCalib.TrigDetCalibConfig import L2PhotonROBListWriter + from TrigDetCalib.TrigDetCalibConfig import LArL2ROBListWriter + self.L2PhotonROBListWriter = LArL2ROBListWriter("Cosmic"+sig_id+"LArL2ROBListWriter") + + self.L2SequenceHash[self.l2_T2CaloEgamma.name()]=[self.l2_T2CaloEgamma,self.l2_L2CaloHypo_g7] + self.L2SequenceList+=[self.l2_T2CaloEgamma.name()] + self.L2SequenceHash["Cosmic"+sig_id+"L2PhotonHypo"]=[self.l2_L2PhotonFex_1,self.l2_L2PhotonHypo_g10_loose] + self.L2SequenceList+=["Cosmic"+sig_id+"L2PhotonHypo"] + self.L2SequenceHash["Cosmic"+sig_id+"L2Photon"]=[self.L2PhotonROBListWriter] + self.L2SequenceList+=["Cosmic"+sig_id+"L2Photon"] + + include("TrigT2CaloCommon/LArCellBuilding.py") + + if self.configEF: + from TrigGenericAlgs.TrigGenericAlgsConf import DummyFEX + self.EF_Dummy = DummyFEX("Cosmic_EF_%s" % sig_id) + self.EFSequenceHash[self.EF_Dummy.name()]=[self.EF_Dummy] + self.EFSequenceList+=[self.EF_Dummy.name()] + + + def generateMenu(self,triggerPythonConfig): + CosmicTemplate.generateMenu(self,triggerPythonConfig) +# if (eval(self.Flag)): +# include("TrigT2CaloCommon/LArCellBuilding.py") + +######################################## Pixel noise Calibration slice ############################################################### + +class CosmicPixelCalibration(CosmicTemplate): + def __init__(self, sig_id, l1item, l1threshold, counterId, StreamName): + CosmicTemplate.__init__(self, sig_id, l1item, l1threshold, counterId,StreamName,streamtype='calibration',groupNames=["Cosmic","Cosmic_PixelCalibration"]) + mlog = logging.getLogger( 'Cosmic.py:CosmicPixelCalibration' ) + + self.__supported = ["Cosmic_pixelnoise","Cosmic_pixelnoise_V2"] + if sig_id not in self.__supported: + raise Exception("ERROR: "+sig_id+" not supprted"+str(self.__supported) ) + + self.Flag='TriggerFlags.CosmicSlice.do%s()' % sig_id + + + if self.configLVL2: + if eval(self.Flag): + + from TrigDetCalib.TrigDetCalibConfig import TrigSubDetListWriter + self.l2_pixelSubDetListWriter = TrigSubDetListWriter("Cosmic"+sig_id+"PixelSubDetListWriter") + self.l2_pixelSubDetListWriter.Subdetectors = "Pixel" + self.l2_pixelSubDetListWriter.extraROBs = [] + #self.l2_pixelSubDetListWriter.MaxRoIsPerEvent = 1 + self.L2SequenceHash[self.l2_pixelSubDetListWriter.name()] = [self.l2_pixelSubDetListWriter] + self.L2SequenceList+=[self.l2_pixelSubDetListWriter.name()] + + if self.configEF: + if eval(self.Flag): + from TrigGenericAlgs.TrigGenericAlgsConf import DummyFEX + self.EF_Dummy = DummyFEX("EF_%s" % sig_id) + self.EFSequenceHash[self.EF_Dummy.name()]=[self.EF_Dummy] + self.EFSequenceList+=[self.EF_Dummy.name()] + + def generateMenu(self,triggerPythonConfig): + CosmicTemplate.generateMenu(self,triggerPythonConfig) + +######################################## rate slice ############################################################### + +class CosmicRateAnalysis(CosmicTemplate): + def __init__(self, sig_id, l1item, l1threshold, counterId, StreamName): + CosmicTemplate.__init__(self, sig_id, l1item, l1threshold, counterId,StreamName,streamtype='calibration',groupNames=["Cosmic","Cosmic_RateAnalysis"]) + mlog = logging.getLogger( 'Cosmic.py:RateAnalysis' ) + + self.__supported = ["Cosmic_rateanalysis"] + if sig_id not in self.__supported: + raise Exception("ERROR: "+sig_id+" not supprted"+str(self.__supported) ) + + self.Flag='TriggerFlags.CosmicSlice.do%s()' % sig_id + + if self.configLVL2: + if eval(self.Flag): + + from TrigDetCalib.TrigDetCalibConfig import TrigSubDetListWriter + self.l2_rateListWriter = TrigSubDetListWriter("Cosmic"+sig_id+"RateListWriter") + self.l2_rateListWriter.Subdetectors = "" + self.l2_rateListWriter.extraROBs = [ 7798784 ] + #self.l2_pixelSubDetListWriter.MaxRoIsPerEvent = 1 + self.L2SequenceHash[self.l2_rateListWriter.name()] = [self.l2_rateListWriter] + self.L2SequenceList+=[self.l2_rateListWriter.name()] + + if self.configEF: + if eval(self.Flag): + from TrigGenericAlgs.TrigGenericAlgsConf import DummyFEX + self.EF_Dummy = DummyFEX("EF_%s" % sig_id) + self.EFSequenceHash[self.EF_Dummy.name()]=[self.EF_Dummy] + self.EFSequenceList+=[self.EF_Dummy.name()] + + def generateMenu(self,triggerPythonConfig): + CosmicTemplate.generateMenu(self,triggerPythonConfig) + + ######################################## IDSCAN slice ############################################################### +class CosmicIDSCAN(CosmicTemplate): + def __init__(self, sig_id, l1item, l1threshold, counterId,StreamName): + CosmicTemplate.__init__(self, sig_id, l1item, l1threshold, counterId,StreamName,groupNames=["Cosmic","Cosmic_Tracking"]) + mlog = logging.getLogger( 'Cosmic.py:CosmicIDSCAN' ) + + self.__supported = ["AllTeIDSCAN", + "AllTeIDSCANCombined", + "CosmicsAllTeIDSCAN", + "CosmicsAllTeIDSCAN_TrkHypo", + "CosmicsAllTeIDSCAN_AllPhysics_TrkHypo", + "CosmicsAllTeIDSCAN_AllPhysics_4Hits_TrkHypo", + "CosmicsAllTeIDSCANCombined" + ] + if sig_id not in self.__supported: + raise Exception("ERROR: "+sig_id+" not supprted"+str(self.__supported) ) + + self.Flag='TriggerFlags.CosmicSlice.do%s()' % sig_id + + if self.configLVL2: + if eval(self.Flag): + if (sig_id.count("AllTe")): + if (0): + #(StreamName=='CosmicMuons' or StreamName=='IDSelected'): + self.L1InfoHypo.TriggerTypeBitMask=0xc0 + self.L1InfoHypo.TriggerTypeBit =0xc0 + else: + self.L1InfoHypo.InvertSelection =False + self.L1InfoHypo.TriggerTypeBitMask=0x80 + self.L1InfoHypo.TriggerTypeBit =0x80 + + self.AllTEDummyFakeROI.FakeROIEta=0.0 + self.AllTEDummyFakeROI.FakeROIPhi=0.0 + #self.AllTEDummyFakeROI.FakeROIEta=1.7 + #self.AllTEDummyFakeROI.FakeROIPhi=1.5 + + if (sig_id.count('AllPhysics')): + # Run on every physics trigger + self.L1InfoHypo.TriggerTypeBitMask=0x80 + self.L1InfoHypo.TriggerTypeBit =0x80 + self.L1InfoHypo.InvertSelection =False + + from TrigIDSCAN.TrigIDSCAN_Config import TrigIDSCAN_Cosmics + self.idscanCosmics = TrigIDSCAN_Cosmics("CosmicIDSCANSequence"+sig_id) # here we created an instance + self.idscanCosmics.doTRTpropagation = True + if (sig_id.count('4Hits')): + self.idscanCosmics.MinHits = 4 + self.idscanCosmics.TrigHitFilter.LayerThreshold = 3.5 + else: + self.idscanCosmics.MinHits = 3 + self.idscanCosmics.TrigHitFilter.LayerThreshold = 2.5 + + self.L2SequenceHash[self.idscanCosmics.name()]=[self.idscanCosmics] + self.L2SequenceList += [self.idscanCosmics.name()] + + if (sig_id.count('TrkHypo')): + from TrigL2CosmicMuonHypo.TrigL2CosmicMuonHypo_Config import CosmicTrtHypo_Cosmic + self.trkhypoCosmics = CosmicTrtHypo_Cosmic("Cosmic"+sig_id+"TrkHypo") + self.trkhypoCosmics.NTrthitsCut = -1 + self.L2SequenceHash[self.idscanCosmics.name()]+=[self.trkhypoCosmics] + + if (sig_id.count("Combined")): + from TrigL2CosmicCombined.TrigL2CosmicCombined_Config import CombinedIDHalfTracks_Cosmic + self.htcombinedCosmics = CombinedIDHalfTracks_Cosmic("Cosmic"+sig_id+"CombinedIDHalfTracks") # here we created an instance + from TrigL2CosmicMuonHypo.TrigL2CosmicMuonHypo_Config import CombinedIDHalfTracksHypo_Cosmic + self.htcombinedCosmicsHypo = CombinedIDHalfTracksHypo_Cosmic("Cosmic"+sig_id+"CombinedIDHalfTracksHypo") # here we created an instance + self.L2SequenceHash[self.htcombinedCosmics.name()]=[self.htcombinedCosmics,self.htcombinedCosmicsHypo] + self.L2SequenceList += [self.htcombinedCosmics.name()] + + if (LocalFlags.doIDHitsHypo): + from TrigEFIDCosmic.IDHitsHypo_Config import IDHitsHypo_IDSCAN_L2 + self.IDHitsHypo_L2=IDHitsHypo_IDSCAN_L2(sig_id+"CosmicIDSCANIDHitsHypoL2") + self.L2Sequencehash[self.IDHitsHypo_L2.name()]=[self.IDHitsHypo_L2] + self.L2SequenceList+=[self.IDHitsHypo_L2.name()] + + if self.configEF: + if eval(self.Flag): + if (LocalFlags.doEFIDCosmics): + from TrigEFIDCosmic.TrigEFIDCosmic_Config import TrigEFIDCosmicAlgo_IDSCAN_EF + self.TrigEFIDCosmicAlgo_IDSCAN_EF=TrigEFIDCosmicAlgo_IDSCAN_EF(sig_id+"TrigEFIDCosmicAlgo_IDSCAN") + self.EFSequencehash[self.TrigEFIDCosmicAlgo_IDSCAN_EF.name()]=[self.TrigEFIDCosmicAlgo_IDSCAN_EF] + self.EFSequenceList+=[self.TrigEFIDCosmicAlgo_IDSCAN_EF.name()] + if (LocalFlags.doIDHitsHypo): + from TrigEFIDCosmic.IDHitsHypo_Config import IDHitsHypo_IDSCAN_EF + self.IDHitsHypo_EF=IDHitsHypo_IDSCAN_EF(sig_id+"IDHitsHypo_IDSCAN_EF") + self.EFSequenceHash[self.IDHitsHypo_EF.name()]=[self.IDHitsHypo_EF] + self.EFSequenceList+=[self.IDHitsHypo_EF.name()] + +######################################## SiTrack slice ############################################################### +class CosmicSiTrack(CosmicTemplate): + def __init__(self, sig_id, l1item, l1threshold, counterId,StreamName): + CosmicTemplate.__init__(self, sig_id, l1item, l1threshold, counterId,StreamName,groupNames=["Cosmic","Cosmic_Tracking"]) + mlog = logging.getLogger( 'Cosmic.py:CosmicSiTrack' ) + + self.__supported = ["AllTeSiTrack", + "AllTeSiTrackCombined", + "CosmicsAllTeSiTrack", + "CosmicsAllTeSiTrack_TrkHypo", + "CosmicsAllTeSiTrack_AllPhysics_TrkHypo", + "CosmicsAllTeSiTrack_AllPhysics_4Hits_TrkHypo", + "CosmicsAllTeSiTrackCombined" + ] + if sig_id not in self.__supported: + raise Exception("ERROR: "+sig_id+" not supprted"+str(self.__supported) ) + + self.Flag='TriggerFlags.CosmicSlice.do%s()' % sig_id + + if self.configLVL2: + if eval(self.Flag): + if (sig_id.count("AllTe")): + if (0): + #(StreamName=='CosmicMuons' or StreamName=='IDSelected'): + self.L1InfoHypo.TriggerTypeBitMask=0xc0 + self.L1InfoHypo.TriggerTypeBit =0xc0 + else: + self.L1InfoHypo.InvertSelection =False + self.L1InfoHypo.TriggerTypeBitMask=0x80 + self.L1InfoHypo.TriggerTypeBit =0x80 + + + self.AllTEDummyFakeROI.FakeROIEta=0.0 + self.AllTEDummyFakeROI.FakeROIPhi=0.0 + #self.AllTEDummyFakeROI.FakeROIEta=1.7 + #self.AllTEDummyFakeROI.FakeROIPhi=1.5 + + if (sig_id.count('AllPhysics')): + # Run on every physics trigger + self.L1InfoHypo.TriggerTypeBitMask=0x80 + self.L1InfoHypo.TriggerTypeBit =0x80 + self.L1InfoHypo.InvertSelection =False + + #from TrigIDSCAN.TrigIDSCAN_Config import TrigIDSCAN_Cosmics + #self.idscanCosmics = TrigIDSCAN_Cosmics("CosmicIDSCANSequence") # here we created an instance + #self.idscanCosmics.doTRTpropagation = True + #self.L2SequenceHash[self.idscanCosmics.name()]=[self.idscanCosmics] + #self.L2SequenceList+=[self.idscanCosmics.name()] + + from TrigSiTrack.TrigSiTrack_Config import TrigSiTrack_Cosmics + self.sitrackCosmics = TrigSiTrack_Cosmics("Cosmic"+sig_id+"TrigSiTrack") # here we created an instance + #self.sitrackCosmics.OutputLevel=DEBUG + #self.sitrackCosmics.Map_UsePixel = False + self.L2SequenceHash[self.sitrackCosmics.name()]=[self.sitrackCosmics] + self.L2SequenceList+=[self.sitrackCosmics.name()] + + if (sig_id.count('4Hits')): + self.sitrackCosmics.Extension_SpacePoints = 4 + else: + self.sitrackCosmics.Extension_SpacePoints = 3 + + if (sig_id.count('TrkHypo')): + from TrigL2CosmicMuonHypo.TrigL2CosmicMuonHypo_Config import CosmicTrtHypo_Cosmic + self.trkhypoCosmics = CosmicTrtHypo_Cosmic("Cosmic"+sig_id+"TrkHypo") + self.trkhypoCosmics.NTrthitsCut = -1 + self.L2SequenceHash[self.sitrackCosmics.name()]+=[self.trkhypoCosmics] + + if (sig_id.count("Combined")): + from TrigL2CosmicCombined.TrigL2CosmicCombined_Config import CombinedIDHalfTracks_Cosmic + self.htcombinedCosmics = CombinedIDHalfTracks_Cosmic("Cosmic"+sig_id+"CombinedIDHalfTracks") # here we created an instance + from TrigL2CosmicMuonHypo.TrigL2CosmicMuonHypo_Config import CombinedIDHalfTracksHypo_Cosmic + self.htcombinedCosmicsHypo = CombinedIDHalfTracksHypo_Cosmic("Cosmic"+sig_id+"CombinedIDHalfTracksHypo") # here we created an instance + self.L2SequenceHash[self.htcombinedCosmics.name()]=[self.htcombinedCosmics,self.htcombinedCosmicsHypo] + self.L2SequenceList += [self.htcombinedCosmics.name()] + + if (LocalFlags.doIDHitsHypo): + from TrigEFIDCosmic.IDHitsHypo_Config import IDHitsHypo_SiTrack_L2 + self.IDHitsHypo_L2=IDHitsHypo_SiTrack_L2("Cosmic"+sig_id+"IDHitsHypoL2") + self.L2SequenceHash[self.sitrackCosmics.name()]+=[self.IDHitsHypo_L2] + + if self.configEF: + if eval(self.Flag): + if (LocalFlags.doEFIDCosmics): + from TrigEFIDCosmic.TrigEFIDCosmic_Config import TrigEFIDCosmicAlgo_SiTrack_EF + self.TrigEFIDCosmicAlgo_EF=TrigEFIDCosmicAlgo_SiTrack_EF("Cosmic"+sig_id+"TrigEFIDCosmicAlgo") + self.EFSequenceHash[self.TrigEFIDCosmicAlgo_EF.name()]=[self.TrigEFIDCosmicAlgo_EF] + self.EFSequenceList+=[self.TrigEFIDCosmicAlgo_EF.name()] + if (LocalFlags.doIDHitsHypo): + from TrigEFIDCosmic.IDHitsHypo_Config import IDHitsHypo_SiTrack_EF + self.IDHitsHypo_EF=IDHitsHypo_SiTrack_EF("Cosmic"+sig_id+"IDHitsHypoEF") + self.EFSequenceHash[self.IDHitsHypo_EF.name()]=[self.IDHitsHypo_EF] + self.EFSequenceList+=[self.IDHitsHypo_EF.name()] + +######################################## EFID slice ############################################################### +class CosmicEFID(CosmicTemplate): + def __init__(self, sig_id, l1item, l1threshold, counterId,StreamName,L2prescale=1,EFprescale=1): + CosmicTemplate.__init__(self, sig_id, l1item, l1threshold, counterId,StreamName,L2prescale,EFprescale,groupNames=["Cosmic","Cosmic_Tracking"]) + mlog = logging.getLogger( 'Cosmic.py:CosmicTracking' ) + + self.__supported = ["CosmicsAllTeEFID"] + if sig_id not in self.__supported: + raise Exception("ERROR: "+sig_id+" not supprted"+str(self.__supported) ) + + self.Flag='TriggerFlags.CosmicSlice.do%s()' % sig_id + + if self.configLVL2: + if eval(self.Flag): + if (sig_id.count('AllTe')): + self.L1InfoHypo.InvertSelection =False + # self.L1InfoHypo.TriggerTypeBitMask=0x80 + self.L1InfoHypo.TriggerTypeBitMask=0x80 + self.L1InfoHypo.TriggerTypeBit =0x80 # Select physics triggers + self.AllTEDummyFakeROI.FakeROIEta=-0.5 + self.AllTEDummyFakeROI.FakeROIPhi=1.5 + + if self.configEF: + if eval(self.Flag): + from InDetTrigRecExample.EFInDetConfig import TrigEFIDInsideOut_CosmicsN + self.EFIDTracking=TrigEFIDInsideOut_CosmicsN() + self.EFIDSequence=self.EFIDTracking.getSequence() + mlog.info(str(self.EFIDSequence)) + + + from TrigMinBias.TrigMinBiasConfig import MbTrkFex_1,MbTrkHypo_1 + self.trackcnt = MbTrkFex_1("MbTrkFex_"+sig_id) + self.EFIDSequence += [self.trackcnt] + + self.efidcosmhypo = MbTrkHypo_1("MbTrkHypo_"+sig_id) + self.efidcosmhypo.AcceptAll_EF=False + self.efidcosmhypo.Required_ntrks=1 + self.efidcosmhypo.Max_z0=1000.0 + self.EFIDSequence += [self.efidcosmhypo] + + self.EFSequenceHash["TrigEFIDInsideOut_CosmicsN"]=self.EFIDSequence + self.EFSequenceList+=["TrigEFIDInsideOut_CosmicsN"] + +######################################## TRTxK slices ############################################################### +class CosmicTRTxK(CosmicTemplate): + def __init__(self, sig_id, l1item, l1threshold, counterId,StreamName): + if (sig_id.count('PEB')): + CosmicTemplate.__init__(self, sig_id, l1item, l1threshold, counterId,StreamName,groupNames=["Cosmic","Cosmic_Tracking"],streamtype='calibration') + else: + CosmicTemplate.__init__(self, sig_id, l1item, l1threshold, counterId,StreamName,groupNames=["Cosmic","Cosmic_Tracking"]) + mlog = logging.getLogger( 'Cosmic.py:CosmicTRTxK' ) + + self.__supported = ["AllTeTRTxK","AllTeTRTxK_TRTTrkHypo","AllTeTRTxK_TRTTrkHypo_Pixel", + "CosmicsAllTeTRTxK", + "CosmicsAllTeTRTxK_TRTTrkHypo", + "CosmicsAllTeTRTxK_TRTTrkHypo_Pixel", + "CosmicsAllTeTRTxK_TRTTrkHypo_AllPhysics", + "CosmicsAllTeTRTxK_TRTTrkHypo_AllPhysics_NoField", + "CosmicsAllTeTRTxK_TRTTrkHypo_AllPhysics_PEB"] + if sig_id not in self.__supported: + raise Exception("ERROR: "+sig_id+" not supprted"+str(self.__supported) ) + + self.Flag='TriggerFlags.CosmicSlice.do%s()' % sig_id + + if self.configLVL2: + if eval(self.Flag): + if (sig_id.count("AllTe")): + if (0): + #(StreamName=='CosmicMuons' or StreamName=='IDSelected'): + self.L1InfoHypo.TriggerTypeBitMask=0xc0 + self.L1InfoHypo.TriggerTypeBit =0xc0 + else: + self.L1InfoHypo.InvertSelection =False + self.L1InfoHypo.TriggerTypeBitMask=0x80 + self.L1InfoHypo.TriggerTypeBit =0x80 + + self.AllTEDummyFakeROI.FakeROIEta=0.0 + self.AllTEDummyFakeROI.FakeROIPhi=0.0 + #self.AllTEDummyFakeROI.FakeROIEta=1.7 + #self.AllTEDummyFakeROI.FakeROIPhi=1.5 + + #from TrigTRTxK.TrigTRTxK_Config import TrigTRTxK_Cosmics + #self.trtxk = TrigTRTxK_Cosmics("Cosmic"+sig_id+"TrigTRTxK") + + if (sig_id.count('oldAlgo')): + from TrigL2TRTSegFinder.TrigTRTSegFinder_Config import TrigTRTSegFinder_Cosmics + self.trtsegm = TrigTRTSegFinder_Cosmics("Cosmic"+sig_id+"TrigTRTSegFinder") + else: + if (sig_id.count('NoField')): + from TrigL2TRTSegFinder.TrigTRTSegFinder_Config import TrigTRTSegFinder_Cosmics_NewAlgo_NoField + self.trtsegm = TrigTRTSegFinder_Cosmics_NewAlgo_NoField("Cosmic"+sig_id+"TrigTRTSegFinder") + self.trtsegm.SegmentsMakerTool.IsMagneticFieldOn = False + else: + from TrigL2TRTSegFinder.TrigTRTSegFinder_Config import TrigTRTSegFinder_Cosmics_NewAlgo + self.trtsegm = TrigTRTSegFinder_Cosmics_NewAlgo("Cosmic"+sig_id+"TrigTRTSegFinder") + self.trtsegm.SegmentsMakerTool.IsMagneticFieldOn = True + + self.trtsegm.RoIhalfWidthDeltaPhi = 3.14 + self.trtsegm.RoIhalfWidthDeltaEta = 3. + self.L2SequenceHash[self.trtsegm.name()]=[self.trtsegm] + self.L2SequenceList+=[self.trtsegm.name()] + + #ToolSvc.InDetL2_TRT_TrackSegmentsMaker.OutputLevel=4 + #ToolSvc.InDetL2_TRT_TrackSegmentsMaker_BarrelCosmics.OutputLevel=4 + + if (sig_id.count('TRTTrkHypo')): + from TrigL2CosmicMuonHypo.TrigL2CosmicMuonHypo_Config import CosmicTrtHypo_Cosmic + self.trthypoCosmics = CosmicTrtHypo_Cosmic("Cosmic"+sig_id+"TrtHypo") + self.trthypoCosmics.NTrthitsCut = 15 + self.trtsegm.SegmentsMakerTool.MinimalNumberOfTRTHits = 15 + self.trtsegm.pTmin = 100.0 + + self.L2SequenceHash[self.trtsegm.name()]+=[self.trthypoCosmics] + if (sig_id.count('Pixel')): + self.trthypoCosmics.TrtSegD0Cut=250.0 + + if (LocalFlags.doIDHitsHypo): + from TrigEFIDCosmic.IDHitsHypo_Config import IDHitsHypo_TRTXK_L2 + self.IDHitsHypo_L2=IDHitsHypo_TRTXK_L2("Cosmic"+sig_id+"IDHitsHypo_TRTXK_L2") + self.L2SequenceHash[self.trtsegm.name()]+=[self.IDHitsHypo_L2] + + if (sig_id.count('AllPhysics')): + # Run on every physics trigger + self.L1InfoHypo.TriggerTypeBitMask=0x80 + self.L1InfoHypo.TriggerTypeBit =0x80 + self.L1InfoHypo.InvertSelection =False + + if (sig_id.count('PEB')): + from TrigDetCalib.TrigDetCalibConfig import TrkROBListWriter + self.robListWriter = TrkROBListWriter('TrkROBListWriter') + self.robListWriter.RoIDescriptorLabels = [""] + self.L2SequenceHash[self.trtsegm.name()]+=[self.robListWriter] + mlog.info(self.trtsegm) + if self.configEF: + if eval(self.Flag): + if (LocalFlags.doEFIDCosmics): + from TrigEFIDCosmic.TrigEFIDCosmic_Config import TrigEFIDCosmicAlgo_TRTXK_EF + self.TrigEFIDCosmicAlgo_EF=TrigEFIDCosmicAlgo_TRTXK_EF("Cosmic"+sig_id+"TrigEFIDCosmicAlgo_TRTXK_EF") + self.EFSequenceHash[self.TrigEFIDCosmicAlgo_EF.name()]=[self.TrigEFIDCosmicAlgo_EF] + self.EFSequenceList+=[self.TrigEFIDCosmicAlgo_EF.name()] + if (LocalFlags.doIDHitsHypo): + from TrigEFIDCosmic.IDHitsHypo_Config import IDHitsHypo_TRTXK_EF + self.IDHitsHypo_EF=IDHitsHypo_TRTXK_EF("COsmic"+sig_id+"IDHitsHypoEF") + self.EFSequenceHash[self.IDHitsHypo_EF.name()]=[self.IDHitsHypo_EF] + self.EFSequenceList+=[self.IDHitsHypo_EF.name()] + +######################################## tileRODMu slice ############################################################### +class CosmicTileRODMu(CosmicTemplate): + def __init__(self, sig_id, l1item, l1threshold, counterId,StreamName): + CosmicTemplate.__init__(self, sig_id, l1item, l1threshold, counterId,StreamName,groupNames=["Cosmic","Cosmic_TileAlgos"]) + mlog = logging.getLogger( 'Cosmic.py:CosmicTileRODMu' ) + + self.__supported = ["TileRODMu","StandaloneTileRODMu","CaloTileRODMu","CaloTileRODMu_V2","AllTeTileRODMu"] + if sig_id not in self.__supported: + raise Exception("ERROR: "+sig_id+" not supprted"+str(self.__supported) ) + + self.Flag='TriggerFlags.CosmicSlice.do%s()' % sig_id + if self.configLVL2: + if eval(self.Flag): + if (sig_id.count("AllTe")): + self.L1InfoHypo.InvertSelection =False + self.L1InfoHypo.TriggerTypeBitMask=0x80 + self.L1InfoHypo.TriggerTypeBit =0x80 + self.AllTEDummyFakeROI.FakeROIEta=0.0 + self.AllTEDummyFakeROI.FakeROIPhi=0.0 + #self.AllTEDummyFakeROI.FakeROIEta=1.7 + #self.AllTEDummyFakeROI.FakeROIPhi=1.5 + + from TrigTileMuId.TrigTileRODMuAlgConfig import TrigTileRODMuAlg_L2 + self.TrigTileRODMuAlg = TrigTileRODMuAlg_L2("Cosmic"+sig_id+"TileRODMuAlg") + self.L2SequenceHash[self.TrigTileRODMuAlg.name()]=[self.TrigTileRODMuAlg] + self.L2SequenceList+=[self.TrigTileRODMuAlg.name()] + + if self.configEF: + if eval(self.Flag): + from TrigGenericAlgs.TrigGenericAlgsConf import DummyFEX + self.EF_Dummy = DummyFEX("EF_%s" % sig_id) + self.EFSequenceHash[self.EF_Dummy.name()]=[self.EF_Dummy] + self.EFSequenceList+=[self.EF_Dummy.name()] + +######################################## tilelookForMu slice ############################################################ +class CosmicTileLookForMu(CosmicTemplate): + def __init__(self, sig_id, l1item, l1threshold, counterId,StreamName): + CosmicTemplate.__init__(self, sig_id, l1item, l1threshold, counterId,StreamName,groupNames=["Cosmic","Cosmic_TileAlgos"]) + mlog = logging.getLogger( 'Cosmic.py:CosmicTileLookForMu' ) + + self.__supported = ["TileLookForMu","StandaloneTileLookForMu","CaloTileLookForMu","CaloTileLookForMu_V2","AllTeTileLookForMu"] + if sig_id not in self.__supported: + raise Exception("ERROR: "+sig_id+" not supprted"+str(self.__supported) ) + + self.Flag='TriggerFlags.CosmicSlice.do%s()' % sig_id + if self.configLVL2: + if eval(self.Flag): + if (sig_id.count('AllTe')): + self.L1InfoHypo.InvertSelection =False + self.L1InfoHypo.TriggerTypeBitMask=0x80 + self.L1InfoHypo.TriggerTypeBit =0x80 + self.AllTEDummyFakeROI.FakeROIEta=0.0 + self.AllTEDummyFakeROI.FakeROIPhi=0.0 + #self.AllTEDummyFakeROI.FakeROIEta=1.7 + #self.AllTEDummyFakeROI.FakeROIPhi=1.5 + + from TrigTileMuId.TrigTileLookForMuAlgConfig import TrigTileLookForMuAlg_L2 + self.TrigTileLookForMuAlg = TrigTileLookForMuAlg_L2("Cosmic"+sig_id+"TileLookForMuAlg") + self.L2SequenceHash[self.TrigTileLookForMuAlg.name()]=[self.TrigTileLookForMuAlg] + self.L2SequenceList+=[self.TrigTileLookForMuAlg.name()] + + if self.configEF: + if eval(self.Flag): + from TrigGenericAlgs.TrigGenericAlgsConf import DummyFEX + self.EF_Dummy = DummyFEX("EF_%s" % sig_id) + self.EFSequenceHash[self.EF_Dummy.name()]=[self.EF_Dummy] + self.EFSequenceList+=[self.EF_Dummy.name()] + +######################################## Egamma slice ############################################################### +class CosmicEgamma(CosmicTemplate): + def __init__(self, sig_id, l1item, l1threshold, counterId,StreamName): + CosmicTemplate.__init__(self, sig_id, l1item, l1threshold, counterId,StreamName,groupNames=["Cosmic","Cosmic_Calo"]) + mlog = logging.getLogger( 'Cosmic.py:CosmicEgamma' ) + + self.__supported = ["Egamma","Egamma_V2","Egamma_noHad","AllTeEgamma"] + if sig_id not in self.__supported: + raise Exception("ERROR: "+sig_id+" not supprted"+str(self.__supported) ) + + self.Flag='TriggerFlags.CosmicSlice.do%s()' % sig_id + + if self.configLVL2: + if eval(self.Flag): + if (sig_id.count('AllTe')): + self.L1InfoHypo.InvertSelection =False + self.L1InfoHypo.TriggerTypeBitMask=0x80 + self.L1InfoHypo.TriggerTypeBit =0x80 + #self.AllTEDummyFakeROI.FakeROIEta=0.0 + #self.AllTEDummyFakeROI.FakeROIPhi=0.0 + self.AllTEDummyFakeROI.FakeROIEta=-0.5 + self.AllTEDummyFakeROI.FakeROIPhi=1.5 + + if (sig_id.count('noHad')): + from TrigT2CaloEgamma.TrigT2CaloEgammaConfig import T2CaloEgamma_eGamma_NoHad + self.l2_T2CaloEgamma = T2CaloEgamma_eGamma_NoHad("Cosmic"+sig_id+"T2CaloEgamma_eGamma_noHad") + else: + from TrigT2CaloEgamma.TrigT2CaloEgammaConfig import T2CaloEgamma_eGamma + self.l2_T2CaloEgamma = T2CaloEgamma_eGamma("Cosmic"+sig_id+"T2CaloEgamma_eGamma") + + if (LocalFlags.T2CaloFakeLVL1InLVL2): + self.l2_T2CaloEgamma.L1ForcePhi=-1.5 + self.l2_T2CaloEgamma.L1ForceEta=1.7 + + from TrigEgammaHypo.TrigL2CaloHypoConfig import L2CaloHypo_g7 + from TrigEgammaHypo.TrigL2PhotonFexConfig import L2PhotonFex_1 + from TrigEgammaHypo.TrigL2PhotonHypoConfig import L2PhotonHypo_g10_loose + self.l2_L2PhotonHypo_g10_loose = L2PhotonHypo_g10_loose("Cosmic"+sig_id+"L2PhotonHypo_g10_loose") + self.l2_L2PhotonFex_1 = L2PhotonFex_1("Cosmic"+sig_id+"L2PhotonFex_1") + self.l2_L2CaloHypo_g7 = L2CaloHypo_g7("Cosmic"+sig_id+"L2CaloHypo_g7") + + self.l2_L2PhotonHypo_g10_loose.ETthr = [-7.*GeV,-7.*GeV,-7.*GeV,-7.*GeV,-7.*GeV,-7.*GeV,-7.*GeV,-7.*GeV,-7.*GeV] + self.l2_L2PhotonHypo_g10_loose.AcceptAll=False + self.l2_L2CaloHypo_g7.ETthr = [-7.*GeV,-7.*GeV,-7.*GeV,-7.*GeV,-7.*GeV,-7.*GeV,-7.*GeV,-7.*GeV,-7.*GeV] + self.l2_L2CaloHypo_g7.AcceptAll=False + + + self.L2SequenceHash[self.l2_T2CaloEgamma.name()]=[self.l2_T2CaloEgamma,self.l2_L2CaloHypo_g7] + self.L2SequenceList+=[self.l2_T2CaloEgamma.name()] + self.L2SequenceHash["Cosmic"+sig_id+"L2Photon"]=[self.l2_L2PhotonFex_1,self.l2_L2PhotonHypo_g10_loose] + self.L2SequenceList+=["Cosmic"+sig_id+"L2Photon"] + + include("TrigT2CaloCommon/LArCellBuilding.py") + + if self.configEF: + if eval(self.Flag): + if (sig_id.count('noHad')): + from TrigGenericAlgs.TrigGenericAlgsConf import DummyFEX + self.EF_Dummy = DummyFEX("Cosmic_EF_%s" % sig_id) + self.EFSequenceHash[self.EF_Dummy.name()]=[self.EF_Dummy] + self.EFSequenceList+=[self.EF_Dummy.name()] + else: + #from TrigEgammaHypo.TrigEFEgammaHypoConfig import * + + from TrigEgammaRec.TrigEgammaRecConfig import TrigEgammaRec_eGamma ,TrigEgammaRec_NoIDEF_eGamma + self.TrigEgammaRec_NoIDEF_eGamma=TrigEgammaRec_NoIDEF_eGamma("Cosmic"+sig_id+"TrigEgammaRec_NoIDEF_eGamma") + + from TrigEgammaHypo.TrigEFPhotonHypoConfig import EFPhotonHypo_g10_loose + self.EFPhotonHypo_g10_loose=EFPhotonHypo_g10_loose("Cosmic"+sig_id+"EFPhotonHypo_g10_loose") + self.EFPhotonHypo_g10_loose.etCut = [-7.*GeV, -7.*GeV, -7.*GeV, -7.*GeV, -7.*GeV] + self.EFPhotonHypo_g10_loose.AcceptAll=False + + from TrigCaloRec.TrigCaloRecConfig import TrigCaloCellMaker_eGamma, TrigCaloTowerMaker_eGamma, TrigCaloClusterMaker_slw + self.TrigCaloCellMaker_eGamma =TrigCaloCellMaker_eGamma("Cosmic"+sig_id+"TrigCaloCellMaker_eGamma") + self.TrigCaloTowerMaker_eGamma=TrigCaloTowerMaker_eGamma("Cosmic"+sig_id+"TrigCaloTowerMaker_eGamma") + self.TrigCaloClusterMaker_slw=TrigCaloClusterMaker_slw("Cosmic"+sig_id+"TrigCaloClusterMaker_slw") + + #from CaloRec.CaloRecConf import CaloClusterBuilderSW + #self.CaloClusterBuilderSW = CaloClusterBuilderSW("trigslw"+sig_id) + #self.CaloClusterBuilderSW.e_threshold=-1.*GeV + # + #self.TrigCaloClusterMaker_slw.ClusterMakerTools=[self.CaloClusterBuilderSW.getFullName()] + #self.TrigCaloClusterMaker_slw+=self.CaloClusterBuilderSW + self.TrigCaloClusterMaker_slw.trigslw.e_threshold=-1.*GeV + + self.EFSequenceHash["Cosmic_"+sig_id+"EF_g10calo"]=[self.TrigCaloCellMaker_eGamma,self.TrigCaloTowerMaker_eGamma,self.TrigCaloClusterMaker_slw] + self.EFSequenceList+=["Cosmic_"+sig_id+"EF_g10calo"] + + self.EFSequenceHash["Cosmic_"+sig_id+"EF_g10"]=[self.TrigEgammaRec_NoIDEF_eGamma,self.EFPhotonHypo_g10_loose] + self.EFSequenceList+=["Cosmic_"+sig_id+"EF_g10"] + + + + if self.configEF: + if eval(self.Flag): + from TrigGenericAlgs.TrigGenericAlgsConf import DummyFEX + self.EF_Dummy = DummyFEX("EF_%s" % sig_id) + self.EFSequenceHash[self.EF_Dummy.name()]=[self.EF_Dummy] + self.EFSequenceList+=[self.EF_Dummy.name()] + + def generateMenu(self,triggerPythonConfig): + CosmicTemplate.generateMenu(self,triggerPythonConfig) +# if (eval(self.Flag)): +# include("TrigT2CaloCommon/LArCellBuilding.py") + +######################################## Jet slice ############################################################### +class CosmicJet(CosmicTemplate): + def __init__(self, sig_id, l1item, l1threshold, counterId,StreamName): + CosmicTemplate.__init__(self, sig_id, l1item, l1threshold, counterId,StreamName,groupNames=["Cosmic","Cosmic_Jet"]) + mlog = logging.getLogger( 'Cosmic.py:CosmicJet' ) + + self.__supported = ["Jet","Jet_V2","AllTeJet"] + if sig_id not in self.__supported: + raise Exception("ERROR: "+sig_id+" not supprted"+str(self.__supported) ) + + self.Flag='TriggerFlags.CosmicSlice.do%s()' % sig_id + + if self.configLVL2: + if eval(self.Flag): + if (sig_id.count('AllTe')): + self.L1InfoHypo.InvertSelection =False + self.L1InfoHypo.TriggerTypeBitMask=0x80 + self.L1InfoHypo.TriggerTypeBit =0x80 + #self.AllTEDummyFakeROI.FakeROIEta=0.0 + #self.AllTEDummyFakeROI.FakeROIPhi=0.0 + self.AllTEDummyFakeROI.FakeROIEta=-0.5 + self.AllTEDummyFakeROI.FakeROIPhi=1.5 + from TrigT2CaloJet.TrigT2CaloJetConfig import T2CaloJet_Jet + self.l2_T2CaloJet_Jet = T2CaloJet_Jet("Cosmic"+sig_id+"T2CaloJet_Jet") + #self.l2_T2CaloJet_Jet.OutputLevel=DEBUG + from TrigJetHypo.TrigJetHypoConfig import L2JetHypo + self.l2_TrigL2JetHypo_Jet = L2JetHypo("Cosmic"+sig_id+"L2JetHypo") + self.l2_TrigL2JetHypo_Jet.Etcut_L2 = -1*GeV + #self.TrigCaloTauHypo_tau10.AcceptAll=True + self.L2SequenceHash[self.l2_T2CaloJet_Jet.name()]=[self.l2_T2CaloJet_Jet,self.l2_TrigL2JetHypo_Jet] + self.L2SequenceList+=[self.l2_T2CaloJet_Jet.name()] + + include("TrigT2CaloCommon/LArCellBuilding.py") + + if self.configEF: + if eval(self.Flag): + from TrigJetRec.TrigJetRecConfig import TrigJetRec_Cone + from TrigJetHypo.TrigJetHypoConfig import EFJetHypo + from TrigCaloRec.TrigCaloRecConfig import TrigCaloCellMaker_jet, TrigCaloTowerMaker_jet, TrigCaloClusterMaker_slw + self.TrigCaloCellMaker_jet =TrigCaloCellMaker_jet("Cosmic"+sig_id+"TrigCaloCellMaker_jet") + self.TrigCaloTowerMaker_jet=TrigCaloTowerMaker_jet("Cosmic"+sig_id+"TrigCaloTowerMaker_jet") + self.TrigJetRec_Cone=TrigJetRec_Cone() + #self.JetRecFinalEtCutTool=self.TrigJetRec_Cone.FinalEtCut + #self.JetRecFinalEtCutTool.MinimumSignal=0.*GeV + self.EFJetHypo = EFJetHypo("Cosmic"+sig_id+"EFJetHypo_j10",ef_thr=-1*GeV) + + self.EFSequenceHash["Cosmic_"+sig_id+"j10"]=[self.TrigCaloCellMaker_jet,self.TrigCaloTowerMaker_jet,self.TrigJetRec_Cone,self.EFJetHypo] + self.EFSequenceList+=["Cosmic_"+sig_id+"j10"] + # from TrigGenericAlgs.TrigGenericAlgsConf import DummyFEX + # self.EF_Dummy = DummyFEX("Cosmic_EF_%s" % sig_id) + # self.EFSequenceHash[self.EF_Dummy.name()]=[self.EF_Dummy] + # self.EFSequenceList+=[self.EF_Dummy.name()] + + def generateMenu(self,triggerPythonConfig): + CosmicTemplate.generateMenu(self,triggerPythonConfig) +# if (eval(self.Flag)): +# include("TrigT2CaloCommon/LArCellBuilding.py") + +######################################## Tau slice ############################################################### +class CosmicTau(CosmicTemplate): + def __init__(self, sig_id, l1item, l1threshold, counterId,StreamName): + CosmicTemplate.__init__(self, sig_id, l1item, l1threshold, counterId,StreamName,groupNames=["Cosmic","Cosmic_Tau"]) + mlog = logging.getLogger( 'Cosmic.py:CosmicTau' ) + + self.__supported = ["Tau","Tau_V2","AllTeTau"] + if sig_id not in self.__supported: + raise Exception("ERROR: "+sig_id+" not supprted"+str(self.__supported) ) + + self.Flag='TriggerFlags.CosmicSlice.do%s()' % sig_id + + if self.configLVL2: + if eval(self.Flag): + if (sig_id.count('AllTe')): + self.L1InfoHypo.InvertSelection =False + self.L1InfoHypo.TriggerTypeBitMask=0x80 + self.L1InfoHypo.TriggerTypeBit =0x80 + #self.AllTEDummyFakeROI.FakeROIEta=0.0 + #self.AllTEDummyFakeROI.FakeROIPhi=0.0 + self.AllTEDummyFakeROI.FakeROIEta=-0.5 + self.AllTEDummyFakeROI.FakeROIPhi=1.5 + from TrigT2CaloTau.TrigT2CaloTauConfig import T2CaloTau_Tau + self.l2_T2CaloTau_Tau = T2CaloTau_Tau("Cosmic"+sig_id+"T2CaloTau_Tau") + #self.l2_T2CaloTau_Tau.OutputLevel=DEBUG + from TrigTauHypo.TrigTauHypoConfig_tauNoCut import T2CaloTauHypo_tauNoCut + self.l2_T2CaloTauHypo_tauNoCut=T2CaloTauHypo_tauNoCut("Cosmic"+sig_id+"T2CaloTauHypo_tauNoCut") + #TrigCaloTauHypo_tau10.AcceptAll=True + self.L2SequenceHash[self.l2_T2CaloTau_Tau.name()]=[self.l2_T2CaloTau_Tau,self.l2_T2CaloTauHypo_tauNoCut] + self.L2SequenceList+=[self.l2_T2CaloTau_Tau.name()] + + include("TrigT2CaloCommon/LArCellBuilding.py") + + if self.configEF: + if eval(self.Flag): + from TrigGenericAlgs.TrigGenericAlgsConf import DummyFEX + self.EF_Dummy = DummyFEX("Cosmic_EF_%s" % sig_id) + self.EFSequenceHash[self.EF_Dummy.name()]=[self.EF_Dummy] + self.EFSequenceList+=[self.EF_Dummy.name()] + + def generateMenu(self,triggerPythonConfig): + CosmicTemplate.generateMenu(self,triggerPythonConfig) +# if (eval(self.Flag)): +# include("TrigT2CaloCommon/LArCellBuilding.py") + +######################################## Calo slice ############################################################### +class CosmicCalo(CosmicTemplate): + def __init__(self, sig_id, l1item, l1threshold, counterId,StreamName): + CosmicTemplate.__init__(self, sig_id, l1item, l1threshold, counterId,StreamName,groupNames=["Cosmic","Cosmic_Calo"]) + mlog = logging.getLogger( 'Cosmic.py:CosmicCalo' ) + + self.__supported = ["Calo","AllTeCalo"] + if sig_id not in self.__supported: + raise Exception("ERROR: "+sig_id+" not supprted"+str(self.__supported) ) + + self.Flag='TriggerFlags.CosmicSlice.do%s()' % sig_id + + if self.configLVL2: + if eval(self.Flag): + if (sig_id.count('AllTe')): + self.L1InfoHypo.InvertSelection =False + self.L1InfoHypo.TriggerTypeBitMask=0x80 + self.L1InfoHypo.TriggerTypeBit =0x80 + #self.AllTEDummyFakeROI.FakeROIEta=0.0 + #self.AllTEDummyFakeROI.FakeROIPhi=0.0 + self.AllTEDummyFakeROI.FakeROIEta=1.7 + self.AllTEDummyFakeROI.FakeROIPhi=1.5 + self.AllTEDummyFakeROI.CheckForInputTE=True + from TrigT2CaloCosmic.TrigT2CaloCosmicConfig import T2CaloCosmic_Cosmic + self.l2_T2CaloCosmic_Cosmic = T2CaloCosmic_Cosmic("Cosmic"+sig_id+"T2CaloCosmic_Cosmic") + self.l2_T2CaloCosmic_Cosmic.EtaMin=[-1.0, -1.0, -1.0, -1.0] + self.l2_T2CaloCosmic_Cosmic.EtaMax=[1.0, 1.0, 1.0, 1.0 ] + self.l2_T2CaloCosmic_Cosmic.PhiMin=[1.3, -1.8, 1.3, -1.8] + self.l2_T2CaloCosmic_Cosmic.PhiMax=[1.8, -1.3, 1.8, -1.3] + self.l2_T2CaloCosmic_Cosmic.EtaWidth = 0.5 + self.l2_T2CaloCosmic_Cosmic.PhiWidth = 0.5 + #self.l2_T2CaloCosmic_Cosmic.OutputLevel=DEBUG + self.L2SequenceHash[self.l2_T2CaloCosmic_Cosmic.name()]=[self.l2_T2CaloCosmic_Cosmic] + self.L2SequenceList+=[self.l2_T2CaloCosmic_Cosmic.name()] + + include("TrigT2CaloCommon/LArCellBuilding.py") + + if self.configEF: + if eval(self.Flag): + from TrigGenericAlgs.TrigGenericAlgsConf import DummyFEX + self.EF_Dummy = DummyFEX("Cosmic_EF_%s" % sig_id) + self.EFSequenceHash[self.EF_Dummy.name()]=[self.EF_Dummy] + self.EFSequenceList+=[self.EF_Dummy.name()] + + def generateMenu(self,triggerPythonConfig): + CosmicTemplate.generateMenu(self,triggerPythonConfig) +# if (eval(self.Flag)): +# include("TrigT2CaloCommon/LArCellBuilding.py") + + +######################################## cosmicmuon slice ############################################################ +class CosmicMuon(CosmicTemplate): + def __init__(self, sig_id, l1item, l1threshold, counterId,StreamName): + CosmicTemplate.__init__(self, sig_id, l1item, l1threshold, counterId,StreamName,groupNames=["Cosmic","Cosmic_Muon"]) + mlog = logging.getLogger( 'Cosmic.py:CosmicMuon' ) + + + #MooreRoI is deprecated. +# self.__supported = ["MuonOnly","Muon","MuonOnly_TGC","Muon_Moore","Muon_Moore_TGC","Muon_MuonEF","Muon_MuonEF_TGC"] + self.__supported = ["MuonOnly","Muon","MuonOnly_TGC","Muon_MuonEF","Muon_MuonEF_TGC","MuonOnly_V2","Muon_V2","Muon_MuonEF_V2",] + + if sig_id not in self.__supported: + raise Exception("ERROR: "+sig_id+" not supprted"+str(self.__supported) ) + + self.Flag='TriggerFlags.CosmicSlice.do%s()' % sig_id + + + + if self.configLVL2: + if eval(self.Flag): + if (TriggerFlags.CosmicSlice.testCosmic()==True): + mlog.info( "Now initializing L2 %s" % sig_id) + + from TrigL2CosmicMuon.TrigL2CosmicMuon_Config import TrigL2CosmicMuon_Cosmic + from TrigL2CosmicMuonHypo.TrigL2CosmicMuonHypo_Config import CosmicMuonHypo_Cosmic + + self.l2_TrigL2CosmicMuon = TrigL2CosmicMuon_Cosmic("Cosmic"+sig_id+"TrigL2CosmicMuon") + self.l2_CosmicMuonHypo = CosmicMuonHypo_Cosmic("Cosmic"+sig_id+"CosmicMuonHypo") + self.L2SequenceHash[self.l2_TrigL2CosmicMuon.name()]=[self.l2_TrigL2CosmicMuon,self.l2_CosmicMuonHypo] + self.L2SequenceList+=[self.l2_TrigL2CosmicMuon.name()] + + if (sig_id.count('TGC')): + + self.l2_TrigL2CosmicMuon.UseTgcSeed = True + self.l2_TrigL2CosmicMuon.UseMdtTimingCut = False + #from TrigMonitorBase.TrigGenericMonitoringToolConfig import defineHistogram + #self.l2_TrigL2CosmicMuon.AthenaMonTools[0].Histograms[6] = defineHistogram('MdtT0', 'TH1F', 'EXPERT', 'MDT T0 (ns)', 250, 0, 1000) + self.l2_CosmicMuonHypo.NRpcHits = 1 + self.l2_CosmicMuonHypo.NMuons = 1 + else: + + self.l2_TrigL2CosmicMuon.UseTgcSeed = False + self.l2_TrigL2CosmicMuon.UseMdtTimingCut = False + #from TrigMonitorBase.TrigGenericMonitoringToolConfig import defineHistogram + #self.l2_TrigL2CosmicMuon.AthenaMonTools[0].Histograms[6] = defineHistogram('MdtT0', 'TH1F', 'EXPERT', 'MDT T0 (ns)', 250, 0, 1000) + self.l2_CosmicMuonHypo.NRpcHits = 1 + self.l2_CosmicMuonHypo.NMuons = 1 + + if (sig_id.count('muonOnly')==0): + + if (LocalFlags.doIDHitsHypo): + + from TrigEFIDCosmic.IDHitsHypo_Config import IDHitsHypo_muon_L2 + self.IDHitsHypo_L2=IDHitsHypo_muon_L2(sig_id+"IDHitsHypo_muon_L2") + self.L2SequenceHash[self.IDHitsHypo_L2.name()]=[self.IDHitsHypo_L2] + self.L2SequenceList+=[self.IDHitsHypo_L2.name()] + + from AthenaCommon.AppMgr import ToolSvc + ToolSvc.L2MdtTool.FitMethod = 2 + if (LocalFlags.doM3Data): + + ToolSvc.L2MdtTool.AddOneToCsmId = True + else: + ToolSvc.L2MdtTool.AddOneToCsmId = False + + #ToolSvc.L2DataLoader.MdtRobMapperFile = 'RoiROBmap_P03.data' + ToolSvc.L2DataLoader.MdtRobMapperFile = 'RoiROBmap.data' + ToolSvc.MdtTimingTool.NominalT0 = 624 + ToolSvc.MdtTimingTool.RoadCut = 0.5 + ToolSvc.MdtTimingTool.SegmentChi2 = 0.2 + ToolSvc.MdtTimingTool.HitMaxChi2 = 0.2 + ToolSvc.L2RpcTool.AllowOnePairTrack = True + + + if self.configEF: + + if eval(self.Flag): + + if (TriggerFlags.CosmicSlice.testCosmic()==True): + mlog.info( "Now initializing EF %s" % sig_id) + if (sig_id.count('muonOnly')): + + from TrigGenericAlgs.TrigGenericAlgsConf import DummyFEX + self.EF_Dummy = DummyFEX("EF_%s" % sig_id) + self.EFSequenceHash[self.EF_Dummy.name()]=[self.EF_Dummy] + self.EFSequenceList+=[self.EF_Dummy.name()] + else: + +#TrigMoore is deprecated +# if (sig_id.count('Moore')): + +# from TrigMoore.TrigMooreConfig import TrigMooreConfig_CS + +# if (TriggerFlags.CosmicSlice.useUniqueMooreInstance()): +# self.ef_TrigMooreConfig_CS = TrigMooreConfig_CS('Cosmic'+'TrigMooreConfig_CS') +# else: +# self.ef_TrigMooreConfig_CS = TrigMooreConfig_CS('Cosmic'+sig_id+'TrigMooreConfig_CS') + + #include("TrigMoore/jobOfragment_TrigMoore.py") +# self.EFSequenceHash[self.ef_TrigMooreConfig_CS.name()+"_"+l1item+"_"+self.sig_id]=[self.ef_TrigMooreConfig_CS] +# self.EFSequenceList+=[self.ef_TrigMooreConfig_CS.name()+"_"+l1item+"_"+self.sig_id] + + if (sig_id.count('MuonEF')): + from TrigMuonEF.TrigMuonEFConfig import TrigMuonEFSegmentFinderConfig,TrigMuonEFTrackBuilderConfig + if (LocalFlags.useUniqueMuonEFInstance): + self.ef_TrigMuonEFSegmentFinderConfig = TrigMuonEFSegmentFinderConfig('Cosmic'+'TrigMuonEFSegmentFinderConfig') + self.ef_TrigMuonEFTrackBuilderConfig = TrigMuonEFTrackBuilderConfig('Cosmic'+'TrigMuonEFTrackBuilderConfig') + else: + self.ef_TrigMuonEFSegmentFinderConfig = TrigMuonEFSegmentFinderConfig('Cosmic'+sig_id+'TrigMuonEFSegmentFinderConfig') + self.ef_TrigMuonEFTrackBuilderConfig = TrigMuonEFTrackBuilderConfig('Cosmic'+sig_id+'TrigMuonEFTrackBuilderConfig') + self.EFSequenceHash[self.ef_TrigMuonEFSegmentFinderConfig.name()+"_"+l1item+"_"+self.sig_id]=[self.ef_TrigMuonEFSegmentFinderConfig,self.ef_TrigMuonEFTrackBuilderConfig] + self.EFSequenceList+=[self.ef_TrigMuonEFSegmentFinderConfig.name()+"_"+l1item+"_"+self.sig_id] + #self.EFSequenceHash[self.ef_TrigMuonEFTrackBuilderConfig.name()+"_"+l1item+"_"+self.sig_id]=[self.ef_TrigMuonEFTrackBuilderConfig] + #self.EFSequenceList+=[self.ef_TrigMuonEFTrackBuilderConfig.name()+"_"+l1item+"_"+self.sig_id] + + + else: + if (LocalFlags.doEFIDCosmics): + from TrigEFIDCosmic.TrigEFIDCosmic_Config import TrigEFIDCosmicAlgo_muon_EF + self.TrigEFIDCosmicAlgo_EF=TrigEFIDCosmicAlgo_muon_EF(sig_id+"TrigEFIDCosmicAlgo_muon_EF") + self.EFSequenceHash[self.TrigEFIDCosmicAlgo_EF.name()]=[self.TrigEFIDCosmicAlgo_EF] + self.EFSequenceList+=[self.TrigEFIDCosmicAlgo_EF.name()] + + if (LocalFlags.doIDHitsHypo): + from TrigEFIDCosmic.IDHitsHypo_Config import IDHitsHypo_muon_EF + self.IDHitsHypo_EF=IDHitsHypo_muon_EF(sig_id+"IDHitsHypo_muon_EF") + self.EFSequenceHash[self.IDHitsHypo_EF.name()]=[self.IDHitsHypo_EF] + self.EFSequenceList+=[self.IDHitsHypo_EF.name()] + else: + from TrigGenericAlgs.TrigGenericAlgsConf import DummyFEX + self.EF_Dummy = DummyFEX("EF_%s" % sig_id) + self.EFSequenceHash[self.EF_Dummy.name()]=[self.EF_Dummy] + self.EFSequenceList+=[self.EF_Dummy.name()] + + + + def generateMenu(self,triggerPythonConfig): + + if eval(self.Flag): + + CosmicTemplate.generateMenu(self,triggerPythonConfig) +# from AthenaCommon.AppMgr import ToolSvc +# ToolSvc.L2MdtTool.FitMethod = 2 +# if (LocalFlags.doM3Data): +# +# ToolSvc.L2MdtTool.AddOneToCsmId = True +# else: +# ToolSvc.L2MdtTool.AddOneToCsmId = False +# +# #ToolSvc.L2DataLoader.MdtRobMapperFile = 'RoiROBmap_P03.data' +# ToolSvc.L2DataLoader.MdtRobMapperFile = 'RoiROBmap.data' +# ToolSvc.MdtTimingTool.NominalT0 = 624 +# ToolSvc.MdtTimingTool.RoadCut = 0.5 +# ToolSvc.MdtTimingTool.SegmentChi2 = 0.2 +# ToolSvc.MdtTimingTool.HitMaxChi2 = 0.2 +# ToolSvc.L2RpcTool.AllowOnePairTrack = True + +######################################## cosmicmufast slice ############################################################ +class CosmicMufast(CosmicTemplate): + def __init__(self, sig_id, l1item, l1threshold, counterId,StreamName): + CosmicTemplate.__init__(self, sig_id, l1item, l1threshold, counterId,StreamName,groupNames=["Cosmic","Cosmic_Muon"]) + mlog = logging.getLogger( 'Cosmic.py:CosmicMufast' ) + +# TrigMoore is deprecated +# self.__supported = ["Mufast","Mufast_TGC","Mufast_Moore","Mufast_Moore_TGC","Mufast_MuIso","Mufast_MuonEF", +# "Mufast_MuonEF_TGC","Mufast_WideRPC","Mufast_Moore_WideRPC","Mufast_MuonEF_WideRPC"] + self.__supported = ["Mufast","Mufast_TGC","Mufast_MuIso","Mufast_MuonEF", + "Mufast_MuonEF_TGC","Mufast_WideRPC","Mufast_MuonEF_WideRPC", + "Mufast_V2","Mufast_MuIso_V2","Mufast_MuonEF_V2"] + if sig_id not in self.__supported: + raise Exception("ERROR: "+sig_id+" not supprted"+str(self.__supported) ) + + self.Flag='TriggerFlags.CosmicSlice.do%s()' % sig_id + if self.configLVL2: + if eval(self.Flag): + from TrigMuonHypo.TrigMuonHypoConfig import MufastHypoConfig + from TrigmuFast.TrigmuFastConfig import TrigmuFastConfig + + if (l1item not in MuFastInstances): + if (TriggerFlags.CosmicSlice.testCosmic()==True): + mlog.info( "creating mufast instance based on item "+str(l1item)) + if (LocalFlags.useUniqueMuFastInstance): + self.TrigmuFastConfig = TrigmuFastConfig("Cosmic_TrigmuFastConfig_900GeV") + self.MufastHypoConfig = MufastHypoConfig("Cosmic_MufastHypoConfig_900Gev",'2GeV') + sequencename=l1item+self.TrigmuFastConfig.name()+self.sig_id + else: + self.TrigmuFastConfig = TrigmuFastConfig("Cosmic"+sig_id+"TrigmuFastConfig_900GeV") + self.MufastHypoConfig = MufastHypoConfig("Cosmic"+sig_id+"MufastHypoConfig_900Gev",'2GeV') + sequencename=self.TrigmuFastConfig.name() + + self.L2SequenceHash[sequencename]=[self.TrigmuFastConfig,self.MufastHypoConfig] + self.L2SequenceList+=[sequencename] + MuFastInstances[l1item]=[self.TrigmuFastConfig,self.MufastHypoConfig] + self.ownMufast=True + else: + if (TriggerFlags.CosmicSlice.testCosmic()==True): + mlog.info( "mufast instance based on item "+str(l1item)+" already existing") + self.L2SequenceHash[l1item+MuFastInstances[l1item][0].name()+self.sig_id]=MuFastInstances[l1item] + self.L2SequenceList+=[l1item+MuFastInstances[l1item][0].name()+self.sig_id] + self.ownMufast=False + + if (sig_id.count('MuIso')): + from TrigMuonHypo.TrigMuonHypoConfig import MuisoHypoConfig + from TrigmuIso.TrigmuIsoConfig import muIsoConfig + self.muIsoConfig=muIsoConfig("Cosmic"+sig_id+"muIsoConfig") + self.muIsoConfig.UseCombinedMuon = False + self.MuisoHypoConfig=MuisoHypoConfig("Cosmic"+sig_id+"MuisoHypoConfig") + self.L2SequenceHash[self.muIsoConfig.name()]=[self.muIsoConfig,self.MuisoHypoConfig] + self.L2SequenceList+=[self.muIsoConfig.name()] + + if (self.ownMufast): + muFast=self.TrigmuFastConfig + muFast.OnlineRun=LocalFlags.doMuonCalibrationStream + + muFast.UseCalibration=True + muFast.MaskUncCMAch = False + muFast.CosmicRun = True + muFast.Timing = False + #if (self.sig_id.count('TGC')): + # muFast.RemoveTgcTriggers=False + #else: + # muFast.RemoveTgcTriggers=True + + + if (self.sig_id.count('MuIso')): + include("TrigT2CaloCommon/LArCellBuilding.py") + #if (sig_id.count('TGC')): + #else: + + + if self.configEF: + if eval(self.Flag): + if (sig_id=='Mufast' or sig_id.count('MuIso')): + from TrigGenericAlgs.TrigGenericAlgsConf import DummyFEX + self.EF_Dummy = DummyFEX("EF_%s" % sig_id) + self.EFSequenceHash[self.EF_Dummy.name()]=[self.EF_Dummy] + self.EFSequenceList+=[self.EF_Dummy.name()] + elif (sig_id.count('MuonEF')): + if (TriggerFlags.CosmicSlice.testCosmic()==True): + mlog.info( "creating MuonEF instance based on item "+self.sig_id) + from TrigMuonEF.TrigMuonEFConfig import TrigMuonEFSegmentFinderConfig,TrigMuonEFTrackBuilderConfig + if (LocalFlags.useUniqueMuonEFInstance): + self.ef_TrigMuonEFSegmentFinderConfig = TrigMuonEFSegmentFinderConfig('Cosmic'+'TrigMuonEFSegmentFinderConfig') + self.ef_TrigMuonEFTrackBuilderConfig = TrigMuonEFTrackBuilderConfig('Cosmic'+'TrigMuonEFTrackBuilderConfig') + else: + self.ef_TrigMuonEFSegmentFinderConfig = TrigMuonEFSegmentFinderConfig('Cosmic'+sig_id+'TrigMuonEFSegmentFinderConfig') + self.ef_TrigMuonEFTrackBuilderConfig = TrigMuonEFTrackBuilderConfig('Cosmic'+sig_id+'TrigMuonEFTrackBuilderConfig') + + self.EFSequenceHash[self.ef_TrigMuonEFSegmentFinderConfig.name()+"_"+l1item+"_"+self.sig_id]=[self.ef_TrigMuonEFSegmentFinderConfig] + self.EFSequenceList+=[self.ef_TrigMuonEFSegmentFinderConfig.name()+"_"+l1item+"_"+self.sig_id] + + self.EFSequenceHash[self.ef_TrigMuonEFTrackBuilderConfig.name()+"_"+l1item+"_"+self.sig_id]=[self.ef_TrigMuonEFTrackBuilderConfig] + self.EFSequenceList+=[self.ef_TrigMuonEFTrackBuilderConfig.name()+"_"+l1item+"_"+self.sig_id] + +# TrigMoore is deprecated. +# else: +# if (sig_id.count('Moore')): +# from TrigMoore.TrigMooreConfig import TrigMooreConfig_MS +# if (TriggerFlags.CosmicSlice.useUniqueMooreInstance()): +# self.ef_TrigMooreConfig_MS = TrigMooreConfig_MS('Cosmic'+'TrigMooreConfig_MS') +# else: +# self.ef_TrigMooreConfig_MS = TrigMooreConfig_MS('Cosmic'+sig_id+'TrigMooreConfig_MS') +# #self.ef_TrigMooreConfig_MS.cosmic_moore=True +# self.EFSequenceHash[self.ef_TrigMooreConfig_MS.name()+"_"+l1item+"_"+self.sig_id]=[self.ef_TrigMooreConfig_MS] +# self.EFSequenceList+=[self.ef_TrigMooreConfig_MS.name()+"_"+l1item+"_"+self.sig_id] + + + def generateMenu(self,triggerPythonConfig): + if eval(self.Flag): + CosmicTemplate.generateMenu(self,triggerPythonConfig) + #from AthenaCommon.AppMgr import ToolSvc + #ToolSvc.L2MdtTool.FitMethod = 2 + #if (TriggerFlags.CosmicSlice.doM3Data()): + # ToolSvc.L2MdtTool.AddOneToCsmId = True + #else: + # ToolSvc.L2MdtTool.AddOneToCsmId = False + #ToolSvc.L2DataLoader.MdtRobMapperFile = 'RoiROBmap_P03.data' + #ToolSvc.L2DataLoader.MdtRobMapperFile = 'RoiROBmap.data' + #ToolSvc.MdtTimingTool.NominalT0 = 624 + #ToolSvc.MdtTimingTool.RoadCut = 0.5 + #ToolSvc.MdtTimingTool.SegmentChi2 = 0.2 + #ToolSvc.MdtTimingTool.HitMaxChi2 = 0.2 + #ToolSvc.L2RpcTool.AllowOnePairTrack = True + +# if (self.ownMufast): +# muFast=self.TrigmuFastConfig +# muFast.OnlineRun=LocalFlags.doMuonCalibrationStream +# +# muFast.UseCalibration=True +# muFast.MaskUncCMAch = False +# muFast.CosmicRun = True +# muFast.Timing = False +# #if (self.sig_id.count('TGC')): +# # muFast.RemoveTgcTriggers=False +# #else: +# # muFast.RemoveTgcTriggers=True +# +# +# if (self.sig_id.count('MuIso')): +# include("TrigT2CaloCommon/LArCellBuilding.py") + +######################################## MEt slice ############################################################### +class CosmicMEt(CosmicTemplate): + def __init__(self, sig_id, l1item, l1threshold, counterId,StreamName): + CosmicTemplate.__init__(self, sig_id, l1item, l1threshold, counterId,StreamName,groupNames=["Cosmic","Cosmic_MEt"]) + mlog = logging.getLogger( 'Cosmic.py:CosmicMEt' ) + + self.__supported = ["AllTeMEt","AllTeMEt_EFOnly", + "MEt","MEt_EFOnly","MEt_EFOnly_Mufast","MEt_Mufast","MEt_EFOnly_Mufast_MuonEF","MEt_Mufast_MuonEF", + "MEt_V2","MEt_EFOnly_V2","MEt_EFOnly_Mufast_V2","MEt_Mufast_V2","MEt_EFOnly_Mufast_MuonEF_V2","MEt_Mufast_MuonEF_V2", + "AllTe_MEt_EFOnly_Mufast_MuonEF", "AllTe_MEt_Mufast_MuonEF","AllTe_MEt_EFOnly_MuonEF", "AllTe_MEt_MuonEF"] + if sig_id not in self.__supported: + raise Exception("ERROR: "+sig_id+" not supprted"+str(self.__supported) ) + + self.Flag='TriggerFlags.CosmicSlice.do%s()' % sig_id + if self.configLVL2: + if eval(self.Flag): + if (sig_id.count("AllTe")): + self.L1InfoHypo.InvertSelection =False + self.L1InfoHypo.TriggerTypeBitMask=0x80 + self.L1InfoHypo.TriggerTypeBit =0x80 + self.AllTEDummyFakeROI.FakeROIEta=0.0 + self.AllTEDummyFakeROI.FakeROIPhi=0.0 + #self.AllTEDummyFakeROI.FakeROIEta=1.7 + #self.AllTEDummyFakeROI.FakeROIPhi=1.5 + + if (sig_id.count('Mufast')): + if (l1item not in MuFastInstances): + if (TriggerFlags.CosmicSlice.testCosmic()==True): + mlog.info( "creating mufast instance based on item "+str(l1item)) + from TrigMuonHypo.TrigMuonHypoConfig import MufastHypoConfig + from TrigmuFast.TrigmuFastConfig import TrigmuFastConfig + self.TrigmuFastConfig = TrigmuFastConfig("Cosmic"+sig_id+"TrigmuFastConfig_900GeV") + self.MufastHypoConfig = MufastHypoConfig("Cosmic"+sig_id+"MufastHypoConfig_900Gev",'2GeV') + #self.L2SequenceHash[self.TrigmuFastConfig.name()]=[self.TrigmuFastConfig,self.MufastHypoConfig] + self.L2SequenceHash[self.TrigmuFastConfig.name()]=[self.TrigmuFastConfig] + self.L2SequenceList+=[self.TrigmuFastConfig.name()] + MuFastInstances[l1item]=[self.TrigmuFastConfig,self.MufastHypoConfig] + self.ownMufast=True + else: + if (TriggerFlags.CosmicSlice.testCosmic()==True): + mlog.info("mufast instance based on item "+str(l1item)+" already existing") + self.L2SequenceHash[l1item+MuFastInstances[l1item][0].name()+self.sig_id]=MuFastInstances[l1item] + self.L2SequenceList+=[l1item+MuFastInstances[l1item][0].name()+self.sig_id] + self.ownMufast=False + + if (sig_id.count('EFOnly')): + from TrigGenericAlgs.TrigGenericAlgsConf import DummyFEX + self.L2_Dummy = DummyFEX("Cosmic_L2_%s" % sig_id) + self.L2SequenceHash[self.L2_Dummy.name()]=[self.L2_Dummy] + self.L2SequenceList+=[self.L2_Dummy.name()] + else: + from TrigL2MissingET.TrigL2MissingETConfig import L2MissingET_Fex + from TrigMissingETHypo.TrigMissingETHypoConfig import EFMissingETHypoBase + + self.l2Fex = L2MissingET_Fex('Cosmic'+sig_id+'L2METfex') + from AthenaCommon.SystemOfUnits import GeV + self.l2Hypo = EFMissingETHypoBase('Cosmic'+sig_id+'L2METhypo') + self.l2Hypo.MissingETCut=1*GeV + self.l2Hypo.SumETCut=1*GeV + self.l2Hypo.CutType=-2.0 + self.L2SequenceHash[self.l2Fex.name()]=[self.l2Fex, self.l2Hypo] + self.L2SequenceList+=[self.l2Fex.name()] + + include("TrigT2CaloCommon/LArCellBuilding.py") + + if self.configEF: + # diego would like to run this on every event coming through from l2 + if eval(self.Flag): + + from TrigEFMissingET.TrigEFMissingETConfig import EFMissingET_Fex + from TrigMissingETHypo.TrigMissingETHypoConfig import EFMissingETHypoBase + self.efcaloMET = EFMissingET_Fex('Cosmic'+sig_id+'EFMETfex') + + self.EFSequenceHash[self.efcaloMET.name()]=[] + self.EFSequenceList=[] + + if (sig_id.count('MuonEF')): + if (TriggerFlags.CosmicSlice.testCosmic()==True): + mlog.info( "creating MuonEF instance based on item "+self.sig_id) + from TrigMuonEF.TrigMuonEFConfig import TrigMuonEFSegmentFinderConfig,TrigMuonEFTrackBuilderConfig + if (LocalFlags.useUniqueMuonEFInstance): + self.ef_TrigMuonEFSegmentFinderConfig = TrigMuonEFSegmentFinderConfig('Cosmic'+'TrigMuonEFSegmentFinderConfig') + self.ef_TrigMuonEFTrackBuilderConfig = TrigMuonEFTrackBuilderConfig('Cosmic'+'TrigMuonEFTrackBuilderConfig') + else: + self.ef_TrigMuonEFSegmentFinderConfig = TrigMuonEFSegmentFinderConfig('Cosmic'+sig_id+'TrigMuonEFSegmentFinderConfig') + self.ef_TrigMuonEFTrackBuilderConfig = TrigMuonEFTrackBuilderConfig('Cosmic'+sig_id+'TrigMuonEFTrackBuilderConfig') + + self.EFSequenceHash[self.ef_TrigMuonEFSegmentFinderConfig.name()+"_"+l1item+"_"+self.sig_id]=[self.ef_TrigMuonEFSegmentFinderConfig] + self.EFSequenceList+=[self.ef_TrigMuonEFSegmentFinderConfig.name()+"_"+l1item+"_"+self.sig_id] + + self.EFSequenceHash[self.ef_TrigMuonEFTrackBuilderConfig.name()+"_"+l1item+"_"+self.sig_id]=[self.ef_TrigMuonEFTrackBuilderConfig] + self.EFSequenceList+=[self.ef_TrigMuonEFTrackBuilderConfig.name()+"_"+l1item+"_"+self.sig_id] + + + + from AthenaCommon.SystemOfUnits import GeV + self.efcaloMEThypo = EFMissingETHypoBase('Cosmic'+sig_id+'EFMEThypo') + self.efcaloMEThypo.MissingETCut=15*GeV + self.efcaloMEThypo.SumETCut=150*GeV + self.efcaloMEThypo.CutType=-1.0 # AND of both thresholds + + self.EFSequenceHash[self.efcaloMET.name()]+=[self.efcaloMET, self.efcaloMEThypo ] + self.EFSequenceList+=[self.efcaloMET.name()] + +## if (sig_id.count("AllTe")): +## from TrigEFIDCosmic.TrigEFIDCosmicConf import L1InfoHypo +## self.RejectAll = L1InfoHypo("RejectAll"+sig_id) +## self.RejectAll.TriggerTypeBitMask=0x0 +## self.RejectAll.TriggerTypeBit =0x0 +## self.RejectAll.InvertSelection =True +## self.EFSequenceHash[self.RejectAll.name()]=[self.Reject_Dummy,self.RejectAll] +## self.EFSequenceList+=[self.RejectAll.name()] +## + + + def generateMenu(self,triggerPythonConfig): + if (eval(self.Flag)): + CosmicTemplate.generateMenu(self,triggerPythonConfig) + if (self.sig_id.count('Mufast') and self.ownMufast): + muFast=self.TrigmuFastConfig + muFast.OnlineRun=LocalFlags.doMuonCalibrationStream + + muFast.UseCalibration=True + muFast.MaskUncCMAch = False + muFast.CosmicRun = True + muFast.Timing = False + #if (self.sig_id.count('TGC')): + # muFast.RemoveTgcTriggers=False + #else: + # muFast.RemoveTgcTriggers=True + +# include("TrigT2CaloCommon/LArCellBuilding.py") + +######################################## MBiasCalo slice ############################################################### +class CosmicMBiasCalo(CosmicTemplate): + def __init__(self, sig_id, l1item, l1threshold, counterId,StreamName): + CosmicTemplate.__init__(self, sig_id, l1item, l1threshold, counterId,StreamName,groupNames=["Cosmic","Cosmic_MBiasCalo"]) + mlog = logging.getLogger( 'Cosmic.py:CosmicMBiasCalo' ) + + self.__supported = ["AllTeMBiasCalo_EndCapA","AllTeMBiasCalo_EndCapC","MBiasCalo_EndCapA_V2","MBiasCalo_EndCapC_V2"] + if sig_id not in self.__supported: + raise Exception("ERROR: "+sig_id+" not suported"+str(self.__supported) ) + + self.Flag='TriggerFlags.CosmicSlice.do%s()' % sig_id + + if self.configLVL2: + if eval(self.Flag): + if (sig_id.count("AllTe")): + self.L1InfoHypo.TriggerTypeBitMask=0xff + self.L1InfoHypo.TriggerTypeBit =0xc0 #MBTS + + if (sig_id.count("EndCapA")): + self.L1InfoHypo.L1ItemNames +=MBTSItemList_SideA + + if (sig_id.count("EndCapC")): + self.L1InfoHypo.L1ItemNames +=MBTSItemList_SideC + + self.AllTEDummyFakeROI.FakeROIPhi=-1.5 + self.AllTEDummyFakeROI.CheckForInputTE=False + if sig_id.count('EndCapA'): + self.AllTEDummyFakeROI.FakeROIEta=1.6 + else: + self.AllTEDummyFakeROI.FakeROIEta=-1.6 + + from TrigT2CaloEgamma.TrigT2CaloEgammaConfig import T2CaloEgamma_eGamma + self.l2_T2CaloEgamma_eGamma = T2CaloEgamma_eGamma("Cosmic"+sig_id+"T2CaloEgama_eGamma") + self.l2_T2CaloEgamma_eGamma.EtaWidth = 0.2 + self.l2_T2CaloEgamma_eGamma.PhiWidth = 1.6 + + from TrigEgammaHypo.TrigL2CaloHypoConfig import L2CaloHypo_g7 + from TrigEgammaHypo.TrigL2PhotonFexConfig import L2PhotonFex_1 + from TrigEgammaHypo.TrigL2PhotonHypoConfig import L2PhotonHypo_g10_loose + self.l2_L2PhotonHypo_g10_loose = L2PhotonHypo_g10_loose("Cosmic"+sig_id+"L2PhotonHypo_g10_loose") + self.l2_L2PhotonFex_1 = L2PhotonFex_1("Cosmic"+sig_id+"L2PhotonFex_1") + self.l2_L2CaloHypo_g7 = L2CaloHypo_g7("Cosmic"+sig_id+"L2CaloHypo_g7") + + self.l2_L2PhotonHypo_g10_loose.ETthr = [-7.*GeV,-7.*GeV,-7.*GeV,-7.*GeV,-7.*GeV,-7.*GeV,-7.*GeV,-7.*GeV,-7.*GeV] + self.l2_L2PhotonHypo_g10_loose.AcceptAll=False + self.l2_L2CaloHypo_g7.ETthr = [-7.*GeV,-7.*GeV,-7.*GeV,-7.*GeV,-7.*GeV,-7.*GeV,-7.*GeV,-7.*GeV,-7.*GeV] + self.l2_L2CaloHypo_g7.AcceptAll=False + + self.L2SequenceHash[self.l2_T2CaloEgamma_eGamma.name()]=[self.l2_T2CaloEgamma_eGamma,self.l2_L2CaloHypo_g7] + self.L2SequenceList+=[self.l2_T2CaloEgamma_eGamma.name()] + self.L2SequenceHash["Cosmic"+sig_id+"L2Photon"]=[self.l2_L2PhotonFex_1,self.l2_L2PhotonHypo_g10_loose] + self.L2SequenceList+=["Cosmic"+sig_id+"L2Photon"] + + + include("TrigT2CaloCommon/LArCellBuilding.py") + + if self.configEF: + if eval(self.Flag): + from TrigGenericAlgs.TrigGenericAlgsConf import DummyFEX + self.EF_Dummy = DummyFEX("Cosmic_EF_%s" % sig_id) + self.EFSequenceHash[self.EF_Dummy.name()]=[self.EF_Dummy] + self.EFSequenceList+=[self.EF_Dummy.name()] + + def generateMenu(self,triggerPythonConfig): + CosmicTemplate.generateMenu(self,triggerPythonConfig) +# if (eval(self.Flag)): +# include("TrigT2CaloCommon/LArCellBuilding.py") + +######################################## minBias slice ############################################################### + +class CosmicMinBias(CosmicTemplate): + def __init__(self, sig_id, l1item, l1threshold, counterId,StreamName): + CosmicTemplate.__init__(self, sig_id, l1item, l1threshold, counterId,StreamName,groupNames=["Cosmic","Cosmic_MinBias"]) + mlog = logging.getLogger( 'Cosmic.py:MinBias' ) + + self.__supported = ["AllTeMBSpacePoints","AllTeMBSpacePoints_V2","AllTeMBStandaloneSpacePoints"] + if sig_id not in self.__supported: + raise Exception("ERROR: "+sig_id+" not supprted"+str(self.__supported) ) + + self.Flag='TriggerFlags.CosmicSlice.do%s()' % sig_id + if self.configLVL2: + if eval(self.Flag): + if (TriggerFlags.CosmicSlice.testCosmic()==True): + mlog.info( "Now initializing L2 %s" % sig_id) + + if (sig_id.count("AllTe")): + self.L1InfoHypo.InvertSelection =False + self.L1InfoHypo.TriggerTypeBitMask=0x80 + self.L1InfoHypo.TriggerTypeBit =0x80 + self.AllTEDummyFakeROI.FakeROIEta=0.0 + self.AllTEDummyFakeROI.FakeROIPhi=0.0 + self.AllTEDummyFakeROI.CheckForInputTE=True + #self.AllTEDummyFakeROI.FakeROIEta=1.7 + #self.AllTEDummyFakeROI.FakeROIPhi=1.5 + + + from TrigT2MinBias.TrigT2MinBiasConfig import MbSpFex_1, MbSpHypo_1 + + self.l2_mbSpFex_DM = MbSpFex_1("MbSpFex_"+sig_id) + self.l2_mbSpFex_DM.PixelModuleThreshold = 50 + self.l2_mbSpFex_DM.SCTModuleThreshold = 100 + self.l2_mbSpFex_DM.MaxNModIdentifier = 100 + + + self.l2_minbiashypo = MbSpHypo_1("MbSpHypo_"+sig_id) + + self.l2_minbiashypo.AcceptAll = False + self.l2_minbiashypo.PixelCLToTCut = 20. + self.l2_minbiashypo.TriggerTypeAND = True + self.l2_minbiashypo.TotalPixelClus = -1. + self.l2_minbiashypo.PixelClusRatioA = -1. + self.l2_minbiashypo.PixelClusRatioB = -1. + self.l2_minbiashypo.PixelClusEndcapC = -1. + self.l2_minbiashypo.PixelClusBarrel = -1. + self.l2_minbiashypo.PixelClusEndcapA = -1. + self.l2_minbiashypo.PixelClusEndcapC_max = -1. + self.l2_minbiashypo.PixelClusBarrel_max = -1. + self.l2_minbiashypo.PixelClusEndcapA_max = -1. + self.l2_minbiashypo.TotalSctSp = -1. + self.l2_minbiashypo.SctSpEndcapC = -1. + self.l2_minbiashypo.SctSpBarrel = -1. + self.l2_minbiashypo.SctSpEndcapA = -1. + self.l2_minbiashypo.SctSpEndcapC_max = -1. + self.l2_minbiashypo.SctSpBarrel_max = -1. + self.l2_minbiashypo.SctSpEndcapA_max = -1. + + + self.L2SequenceHash[self.l2_mbSpFex_DM.name()]=[self.l2_mbSpFex_DM, self.l2_minbiashypo] + self.L2SequenceList+=[self.l2_mbSpFex_DM.name()] + + if self.configEF: + if eval(self.Flag): + if (TriggerFlags.CosmicSlice.testCosmic()==True): + mlog.info( "Now initializing EF %s" % sig_id) + from TrigGenericAlgs.TrigGenericAlgsConf import DummyFEX + self.EF_Dummy = DummyFEX("EF_%s" % sig_id) + self.EFSequenceHash[self.EF_Dummy.name()]=[self.EF_Dummy] + self.EFSequenceList+=[self.EF_Dummy.name()] + + def generateMenu(self,triggerPythonConfig): + if eval(self.Flag): + CosmicTemplate.generateMenu(self,triggerPythonConfig) + from AthenaCommon.AppMgr import ToolSvc + +######################################## ROI filter slice ############################################################### + +class CosmicROIFilter(CosmicTemplate): + def __init__(self, sig_id, l1item, l1threshold, counterId,StreamName): + CosmicTemplate.__init__(self, sig_id, l1item, l1threshold, counterId,StreamName,groupNames=["Cosmic","Cosmic_ROI"]) + mlog = logging.getLogger( 'Cosmic.py:CosmicROIFilter' ) + + self.__supported = ["CosmicDownwardMuonRPCROI","CosmicDownwardMuonTGCROI"] + if sig_id not in self.__supported: + raise Exception("ERROR: "+sig_id+" not supprted"+str(self.__supported) ) + + self.Flag='TriggerFlags.CosmicSlice.do%s()' % sig_id + if self.configLVL2: + if eval(self.Flag): + if (TriggerFlags.CosmicSlice.testCosmic()==True): + mlog.info( "Now initializing L2 %s" % sig_id) + from TrigEFIDCosmic.L1CaloROIAlgo_Config import L1CaloROIAlgo_Instance + self.ROIAlgo=L1CaloROIAlgo_Instance("CosmicROIFilter_"+sig_id) + self.ROIAlgo.MinimumDeltaEta=-100.0 + self.ROIAlgo.MinimumDeltaPhi=-100.0 + self.ROIAlgo.MinimumDeltaR =0.5 + + self.ROIAlgo.NROI = 1 + self.ROIAlgo.MinimumEta=-1.1 + self.ROIAlgo.MaximumEta= 1.1 + + # 225 to 292.5 degrees + self.ROIAlgo.MinimumPhi=3.925 + self.ROIAlgo.MaximumPhi=5.105 + + #self.ROIAlgo.OutputLevel=2 + + from TrigEFIDCosmic.TrigEFIDCosmicConf import L1InfoHypo + self.L1InfoHypo_ROIFilter = L1InfoHypo("L1InfoHypo"+sig_id) # here we created an instance + self.L1InfoHypo_ROIFilter.TriggerTypeBitMask=0x80 + self.L1InfoHypo_ROIFilter.TriggerTypeBit =0x80 + self.L1InfoHypo_ROIFilter.L1TriggerBitMask=0x0 + self.L1InfoHypo_ROIFilter.L1TriggerBit =0x0 + self.L1InfoHypo_ROIFilter.L1ItemNames += self.l1threshold + + self.L1InfoHypoRNDMReject = L1InfoHypo("L1InfoHypoRNDMReject"+sig_id) # here we created an instance + self.L1InfoHypoRNDMReject.TriggerTypeBitMask=0xff # ignore RNDM stream + self.L1InfoHypoRNDMReject.TriggerTypeBit =0x81 + self.L1InfoHypoRNDMReject.InvertSelection =True + + self.L2SequenceHash[self.ROIAlgo.name()]=[self.ROIAlgo,self.L1InfoHypo_ROIFilter,self.L1InfoHypoRNDMReject] + self.L2SequenceList+=[self.ROIAlgo.name()] + + if self.configEF: + if eval(self.Flag): + if (TriggerFlags.CosmicSlice.testCosmic()==True): + mlog.info( "Now initializing EF %s" % sig_id) + from TrigGenericAlgs.TrigGenericAlgsConf import DummyFEX + self.EF_Dummy = DummyFEX("EF_%s" % sig_id) + self.EFSequenceHash[self.EF_Dummy.name()]=[self.EF_Dummy] + self.EFSequenceList+=[self.EF_Dummy.name()] + + def generateMenu(self,triggerPythonConfig): + if eval(self.Flag): + CosmicTemplate.generateMenu(self,triggerPythonConfig) + from AthenaCommon.AppMgr import ToolSvc + +######################################## L1Calo filter slice ############################################################### + +class CosmicL1CaloFilter(CosmicTemplate): + def __init__(self, sig_id, l1item, l1threshold, counterId,StreamName): + CosmicTemplate.__init__(self, sig_id, l1item, l1threshold, counterId,StreamName,groupNames=["Cosmic","Cosmic_L1Calo"]) + mlog = logging.getLogger( 'Cosmic.py:L1CaloFilter' ) + + self.__supported = ["L1CaloFilter","L1CaloEMFilter","L1CaloTauFilter","L1CaloJetFilter", + "L1CaloFilter_V2","L1CaloEMFilter_V2","L1CaloTauFilter_V2","L1CaloJetFilter_V2"] + if sig_id not in self.__supported: + raise Exception("ERROR: "+sig_id+" not supprted"+str(self.__supported) ) + + self.Flag='TriggerFlags.CosmicSlice.do%s()' % sig_id + if self.configLVL2: + if eval(self.Flag): + if (TriggerFlags.CosmicSlice.testCosmic()==True): + mlog.info( "Now initializing L2 %s" % sig_id) + from TrigEFIDCosmic.L1CaloROIAlgo_Config import L1CaloROIAlgo_Instance + self.L1CaloROIAlgo=L1CaloROIAlgo_Instance("L1CaloROIAlgo_"+sig_id) + self.L1CaloROIAlgo.MinimumDeltaEta=-100.0 + self.L1CaloROIAlgo.MinimumDeltaPhi=-100.0 + self.L1CaloROIAlgo.MinimumDeltaR =0.5 + #self.L1CaloROIAlgo.OutputLevel=2 + + #from TrigEFIDCosmic.TrigEFIDCosmicConf import L1InfoHypo + #self.L1InfoHypo_L1Calo = L1InfoHypo("L1InfoHypo"+sig_id) # here we created an instance + #self.L1InfoHypo_L1Calo.TriggerTypeBitMask=0x84 + #self.L1InfoHypo_L1Calo.TriggerTypeBit =0x84 + + #self.L1InfoHypo_L1Calo.L1TriggerBitMask=0x0 + #self.L1InfoHypo_L1Calo.L1TriggerBit =0x0 + #self.L1InfoHypo_L1Calo.L1ItemNames += self.l1threshold + + #self.L2SequenceHash[self.L1CaloROIAlgo.name()]=[self.L1CaloROIAlgo,self.L1InfoHypo_L1Calo] + self.L2SequenceHash[self.L1CaloROIAlgo.name()]=[self.L1CaloROIAlgo] + self.L2SequenceList+=[self.L1CaloROIAlgo.name()] + + if self.configEF: + if eval(self.Flag): + if (TriggerFlags.CosmicSlice.testCosmic()==True): + mlog.info("Now initializing EF %s" % sig_id) + from TrigGenericAlgs.TrigGenericAlgsConf import DummyFEX + self.EF_Dummy = DummyFEX("EF_%s" % sig_id) + self.EFSequenceHash[self.EF_Dummy.name()]=[self.EF_Dummy] + self.EFSequenceList+=[self.EF_Dummy.name()] + + def generateMenu(self,triggerPythonConfig): + if eval(self.Flag): + CosmicTemplate.generateMenu(self,triggerPythonConfig) + from AthenaCommon.AppMgr import ToolSvc + +######################################## HLTBeamLineFitterTest slice ############################################################### + +class HLTBeamLineFitterTest(CosmicTemplate): + def __init__(self, sig_id, l1item, l1threshold, counterId,StreamName): + CosmicTemplate.__init__(self, sig_id, l1item, l1threshold, counterId,StreamName,groupNames=["Cosmic","Cosmic_Test"]) + mlog = logging.getLogger( 'Cosmic.py:HLTBeamLineFittertest' ) + + self.__supported = ["HLTBeamLineFitterTestFake","HLTBeamLineFitterTest"] + if sig_id not in self.__supported: + raise Exception("ERROR: "+sig_id+" not supprted"+str(self.__supported) ) + + self.Flag='TriggerFlags.CosmicSlice.do%s()' % sig_id + if self.configLVL2: + if eval(self.Flag): + if (TriggerFlags.CosmicSlice.testCosmic()==True): + mlog.info( "Now initializing L2 %s" % sig_id) + + if (sig_id.count("Fake")): + from TrigEFIDCosmic.HLTBeamLineFitterFex_Config import Cosmic__HLTBeamLineFitterFex_Instance + self.HLTBeamLineFitter=Cosmic__HLTBeamLineFitterFex_Instance("HLTBeamLineFitterFex_"+sig_id) + #self.HLTBeamLineFitter.???=-1.0 + + from TrigEFIDCosmic.FakeHLTTracks_Config import FakeHLTTracks_Instance + self.FakeHLTTracks=FakeHLTTracks_Instance("FakeHLTTracks_"+sig_id) + self.FakeHLTTracks.x0=-1.0 + self.FakeHLTTracks.y0=-1.0 + self.FakeHLTTracks.z0=0.5 + self.FakeHLTTracks.dxdz= 0.001 + self.FakeHLTTracks.dydz=-0.01 + self.L2SequenceHash[self.FakeHLTTracks.name()]=[self.FakeHLTTracks] + self.L2SequenceList+=[self.FakeHLTTracks.name()] + self.L2SequenceHash[self.HLTBeamLineFitter.name()]=[self.HLTBeamLineFitter] + self.L2SequenceList+=[self.HLTBeamLineFitter.name()] + else: + from TrigEFIDCosmic.HLTBeamLineFitter_Config import Cosmic__HLTBeamLineFitter_Instance + self.HLTBeamLineFitter=Cosmic__HLTBeamLineFitter_Instance("HLTBeamLineFitter_"+sig_id) + #self.HLTBeamLineFitter.???=-1.0 + self.L2SequenceHash[self.HLTBeamLineFitter.name()]=[self.HLTBeamLineFitter] + self.L2SequenceList+=[self.HLTBeamLineFitter.name()] + + + if self.configEF: + if eval(self.Flag): + if (TriggerFlags.CosmicSlice.testCosmic()==True): + mlog.info( "Now initializing EF %s" % sig_id) + from TrigGenericAlgs.TrigGenericAlgsConf import DummyFEX + self.EF_Dummy = DummyFEX("EF_%s" % sig_id) + self.EFSequenceHash[self.EF_Dummy.name()]=[self.EF_Dummy] + self.EFSequenceList+=[self.EF_Dummy.name()] + + def generateMenu(self,triggerPythonConfig): + if eval(self.Flag): + CosmicTemplate.generateMenu(self,triggerPythonConfig) + from AthenaCommon.AppMgr import ToolSvc + +######################################## slice ############################################################### + + +# name item thr counter stream +Cosmics = [ + CosmicStandalone ('MU1Dummy' , 'L1_MU1', ['MU1'], '3000' ,''), + #CosmicStandalone ('MU1Dummy' , 'L1_MU1', ['MU1'], '-1' ,''), + CosmicStandalone ('MU2Dummy' , 'L1_MU2', ['MU2'], '-1' ,''), + CosmicStandalone ('MU3Dummy' , 'L1_MU3', ['MU3'], '-1' ,''), + CosmicStandalone ('MU11Dummy' , 'L1_MU11', ['MU11'], '-1' ,''), + CosmicEmpty ('MU3Empty' , 'L1_MU3' ,['MU3'] ,'-1' ,''), + CosmicEmpty ('MU11Empty' , 'L1_MU11',['MU11'],'-1' ,''), + CosmicStandalone ('Dummy' , TriggerFlags.CosmicSlice.Signature() or defaultSignatures['Signature'] , TriggerFlags.CosmicSlice.Threshold() or defaultThresholds['Threshold'], '-1' ,''), + CosmicEmpty ('Empty' , TriggerFlags.CosmicSlice.Signature() or defaultSignatures['Signature'], TriggerFlags.CosmicSlice.Threshold() or defaultThresholds['Threshold'], '-1' ,''), + CosmicStandalone ('StandaloneDummy' , TriggerFlags.CosmicSlice.StandaloneSignature() or defaultSignatures['StandaloneSignature'], TriggerFlags.CosmicSlice.StandaloneThreshold() or defaultThresholds['StandaloneThreshold'], '-1' ,''), + CosmicEmpty ('StandaloneEmpty' , TriggerFlags.CosmicSlice.StandaloneSignature() or defaultSignatures['StandaloneSignature'], TriggerFlags.CosmicSlice.StandaloneThreshold() or defaultThresholds['StandaloneThreshold'], '-1' ,''), + CosmicStandalone ('CaloDummy' , TriggerFlags.CosmicSlice.CaloSignature() or defaultSignatures['CaloSignature'], TriggerFlags.CosmicSlice.CaloThreshold() or defaultThresholds['CaloThreshold'], '-1' ,''), + CosmicEmpty ('CaloEmpty' , TriggerFlags.CosmicSlice.CaloSignature() or defaultSignatures['CaloSignature'], TriggerFlags.CosmicSlice.CaloThreshold() or defaultThresholds['CaloThreshold'], '-1' ,''), + CosmicStandalone ('RPCDummy' , TriggerFlags.CosmicSlice.RPCSignature() or defaultSignatures['RPCSignature'], TriggerFlags.CosmicSlice.RPCThreshold() or defaultThresholds['RPCThreshold'], '-1' ,''), + CosmicEmpty ('RPCEmpty' , TriggerFlags.CosmicSlice.RPCSignature() or defaultSignatures['RPCSignature'], TriggerFlags.CosmicSlice.RPCThreshold() or defaultThresholds['RPCThreshold'], '-1' ,''), + CosmicStandalone ('TGCDummy' , TriggerFlags.CosmicSlice.TGCSignature() or defaultSignatures['TGCSignature'], TriggerFlags.CosmicSlice.TGCThreshold() or defaultThresholds['TGCThreshold'], '-1' ,''), + CosmicEmpty ('TGCEmpty' , TriggerFlags.CosmicSlice.TGCSignature() or defaultSignatures['TGCSignature'], TriggerFlags.CosmicSlice.TGCThreshold() or defaultThresholds['TGCThreshold'], '-1' ,''), + + CosmicIDSCAN ('AllTeIDSCAN' , '', TriggerFlags.CosmicSlice.TrackingThreshold() or defaultThresholds['TrackingThreshold'], '-1' ,'s'), + CosmicSiTrack ('AllTeSiTrack' , '', TriggerFlags.CosmicSlice.TrackingThreshold() or defaultThresholds['TrackingThreshold'], '-1' ,'s'), + + CosmicIDSCAN ('AllTeIDSCANCombined' , '', TriggerFlags.CosmicSlice.TrackingThreshold() or defaultThresholds['TrackingThreshold'], '-1' ,''), + CosmicSiTrack ('AllTeSiTrackCombined' , '', TriggerFlags.CosmicSlice.TrackingThreshold() or defaultThresholds['TrackingThreshold'], '-1' ,''), + + CosmicIDSCAN ('CosmicsAllTeIDSCAN' , '', '', '-1' ,'CosmicMuons'), + CosmicSiTrack ('CosmicsAllTeSiTrack' , '', '', '-1' ,'CosmicMuons'), + + CosmicIDSCAN ('CosmicsAllTeIDSCAN_TrkHypo' , '', '', '-1' ,'IDSelected'), + CosmicSiTrack ('CosmicsAllTeSiTrack_TrkHypo' , '', '', '-1' ,'IDSelected'), + CosmicIDSCAN ('CosmicsAllTeIDSCAN_AllPhysics_TrkHypo' , '', '', '-1' ,'IDSelected'), + CosmicSiTrack ('CosmicsAllTeSiTrack_AllPhysics_TrkHypo' , '', '', '-1' ,'IDSelected'), + + CosmicIDSCAN ('CosmicsAllTeIDSCAN_AllPhysics_4Hits_TrkHypo' , '', '', '-1' ,'IDSelected'), + CosmicSiTrack ('CosmicsAllTeSiTrack_AllPhysics_4Hits_TrkHypo' , '', '', '-1' ,'IDSelected'), + + CosmicIDSCAN ('CosmicsAllTeIDSCANCombined' , '', '', '-1' ,'IDSelected'), + CosmicSiTrack ('CosmicsAllTeSiTrackCombined' , '', '', '-1' ,'IDSelected'), + + CosmicEFID ('CosmicsAllTeEFID' , '', '', '-1' ,'IDSelected',L2prescale=1,EFprescale=1), + + #CosmicTRTxK ('AllTeTRTxK' , TriggerFlags.CosmicSlice.TrackingSignature() or defaultSignatures['TrackingSignature'], TriggerFlags.CosmicSlice.TrackingThreshold() or defaultThresholds['TrackingThreshold'], '-1' ,''), + #CosmicTRTxK ('AllTeTRTxK_TRTTrkHypo' , TriggerFlags.CosmicSlice.TrackingSignature() or defaultSignatures['TrackingSignature'], TriggerFlags.CosmicSlice.TrackingThreshold() or defaultThresholds['TrackingThreshold'], '-1' ,''), + CosmicTRTxK ('AllTeTRTxK' , TriggerFlags.CosmicSlice.TrackingSignature() or defaultSignatures['TrackingSignature'], TriggerFlags.CosmicSlice.TrackingThreshold() or defaultThresholds['TrackingThreshold'], '-1' ,''), + CosmicTRTxK ('AllTeTRTxK_TRTTrkHypo' , TriggerFlags.CosmicSlice.TrackingSignature() or defaultSignatures['TrackingSignature'], TriggerFlags.CosmicSlice.TrackingThreshold() or defaultThresholds['TrackingThreshold'], '-1' ,''), + CosmicTRTxK ('AllTeTRTxK_TRTTrkHypo_Pixel', TriggerFlags.CosmicSlice.TrackingSignature() or defaultSignatures['TrackingSignature'], TriggerFlags.CosmicSlice.TrackingThreshold() or defaultThresholds['TrackingThreshold'], '-1' ,''), + + CosmicTRTxK ('CosmicsAllTeTRTxK' , '', '', '-1' ,'CosmicMuons'), + CosmicTRTxK ('CosmicsAllTeTRTxK_TRTTrkHypo' , '', '', '-1' ,'CosmicMuons'), + CosmicTRTxK ('CosmicsAllTeTRTxK_TRTTrkHypo_Pixel', '', '', '-1' ,'CosmicMuons'), + CosmicTRTxK ('CosmicsAllTeTRTxK_TRTTrkHypo_AllPhysics' , '', '', '-1' ,'CosmicMuons'), + CosmicTRTxK ('CosmicsAllTeTRTxK_TRTTrkHypo_AllPhysics_NoField' , '', '', '-1' ,'CosmicMuons'), + CosmicTRTxK ('CosmicsAllTeTRTxK_TRTTrkHypo_AllPhysics_PEB' , '', '', '-1' ,'CosmicMuons'), + + CosmicTileRODMu ('AllTeTileRODMu' , '', 'J50', '-1' ,''), + CosmicTileRODMu ('TileRODMu' , TriggerFlags.CosmicSlice.RPCSignature() or defaultSignatures['RPCSignature'], TriggerFlags.CosmicSlice.RPCThreshold() or defaultThresholds['RPCThreshold'], '-1' ,''), + CosmicTileRODMu ('CaloTileRODMu' , TriggerFlags.CosmicSlice.CaloSignature() or defaultSignatures['CaloSignature'], TriggerFlags.CosmicSlice.CaloThreshold() or defaultThresholds['CaloThreshold'], '-1' ,'L1Calo'), + CosmicTileRODMu ('CaloTileRODMu_V2' , TriggerFlags.CosmicSlice.CaloSignature_V2() or defaultSignatures['CaloSignature_V2'], TriggerFlags.CosmicSlice.CaloThreshold_V2() or defaultThresholds['CaloThreshold_V2'], '-1' ,'L1Calo'), + CosmicTileRODMu ('StandaloneTileRODMu' , TriggerFlags.CosmicSlice.StandaloneSignature() or defaultSignatures['StandaloneSignature'], TriggerFlags.CosmicSlice.StandaloneThreshold() or defaultThresholds['StandaloneThreshold'], '-1' ,''), + # + CosmicTileLookForMu ('AllTeTileLookForMu' , '', ['J50'], '-1' ,''), + CosmicTileLookForMu ('TileLookForMu' , TriggerFlags.CosmicSlice.RPCSignature() or defaultSignatures['RPCSignature'], TriggerFlags.CosmicSlice.RPCThreshold() or defaultThresholds['RPCThreshold'], '-1' ,''), + CosmicTileLookForMu ('CaloTileLookForMu' , TriggerFlags.CosmicSlice.CaloSignature() or defaultSignatures['CaloSignature'], TriggerFlags.CosmicSlice.CaloThreshold() or defaultThresholds['CaloThreshold'], '-1' ,'L1Calo'), + CosmicTileLookForMu ('CaloTileLookForMu_V2' , TriggerFlags.CosmicSlice.CaloSignature_V2() or defaultSignatures['CaloSignature_V2'], TriggerFlags.CosmicSlice.CaloThreshold_V2() or defaultThresholds['CaloThreshold_V2'], '-1' ,'L1Calo'), + CosmicTileLookForMu ('StandaloneTileLookForMu' , TriggerFlags.CosmicSlice.StandaloneSignature() or defaultSignatures['StandaloneSignature'], TriggerFlags.CosmicSlice.StandaloneThreshold() or defaultThresholds['StandaloneThreshold'], '-1' ,''), + # + CosmicEgamma ('AllTeEgamma' , '', ['J50'], '-1' ,''), + CosmicEgamma ('Egamma' , TriggerFlags.CosmicSlice.CaloSignature() or defaultSignatures['CaloSignature'], TriggerFlags.CosmicSlice.CaloThreshold() or defaultThresholds['CaloThreshold'], '-1' ,'L1Calo'), + CosmicEgamma ('Egamma_V2' , TriggerFlags.CosmicSlice.CaloSignature_V2() or defaultSignatures['CaloSignature_V2'], TriggerFlags.CosmicSlice.CaloThreshold_V2() or defaultThresholds['CaloThreshold_V2'], '-1' ,'L1Calo'), + CosmicEgamma ('Egamma_noHad' , TriggerFlags.CosmicSlice.CaloSignature() or defaultSignatures['CaloSignature'], TriggerFlags.CosmicSlice.CaloThreshold() or defaultThresholds['CaloThreshold'], '-1' ,''), + # + CosmicJet ('AllTeJet' , '', TriggerFlags.CosmicSlice.Threshold() or defaultThresholds['Threshold'], '-1' ,''), + CosmicTau ('AllTeTau' , '', TriggerFlags.CosmicSlice.Threshold() or defaultThresholds['Threshold'], '-1' ,''), + CosmicCalo ('AllTeCalo' , '', TriggerFlags.CosmicSlice.Threshold() or defaultThresholds['Threshold'], '-1' ,''), + # + CosmicJet ('Jet' , TriggerFlags.CosmicSlice.CaloSignature() or defaultSignatures['CaloSignature'], TriggerFlags.CosmicSlice.CaloThreshold() or defaultThresholds['CaloThreshold'], '-1' ,'L1Calo'), + CosmicJet ('Jet_V2' , TriggerFlags.CosmicSlice.CaloSignature_V2() or defaultSignatures['CaloSignature_V2'], TriggerFlags.CosmicSlice.CaloThreshold_V2() or defaultThresholds['CaloThreshold_V2'], '-1' ,'L1Calo'), + CosmicTau ('Tau' , TriggerFlags.CosmicSlice.CaloSignature() or defaultSignatures['CaloSignature'], TriggerFlags.CosmicSlice.CaloThreshold() or defaultThresholds['CaloThreshold'], '-1' ,'L1Calo'), + CosmicTau ('Tau_V2' , TriggerFlags.CosmicSlice.CaloSignature_V2() or defaultSignatures['CaloSignature_V2'], TriggerFlags.CosmicSlice.CaloThreshold_V2() or defaultThresholds['CaloThreshold_V2'], '-1' ,'L1Calo'), + CosmicCalo ('Calo' , TriggerFlags.CosmicSlice.CaloSignature() or defaultSignatures['CaloSignature'], TriggerFlags.CosmicSlice.CaloThreshold() or defaultThresholds['CaloThreshold'], '-1' ,''), + + CosmicMuon ('MuonOnly' , TriggerFlags.CosmicSlice.WidePatternRPCSignature() or defaultSignatures['WidePatternRPCSignature'], TriggerFlags.CosmicSlice.WidePatternRPCThreshold() or defaultThresholds['WidePatternRPCThreshold'], '-1' ,''), + CosmicMuon ('MuonOnly_V2' , TriggerFlags.CosmicSlice.MuonSignature_V2() or defaultSignatures['MuonSignature_V2'], TriggerFlags.CosmicSlice.MuonThreshold_V2() or defaultThresholds['MuonThreshold_V2'], '-1' ,''), + CosmicMuon ('MuonOnly_TGC' , TriggerFlags.CosmicSlice.TGCSignature() or defaultSignatures['TGCSignature'], TriggerFlags.CosmicSlice.TGCThreshold() or defaultThresholds['TGCThreshold'], '-1' ,''), + CosmicMuon ('Muon' , TriggerFlags.CosmicSlice.WidePatternRPCSignature() or defaultSignatures['WidePatternRPCSignature'], TriggerFlags.CosmicSlice.WidePatternRPCThreshold() or defaultThresholds['WidePatternRPCThreshold'], '-1' ,''), + CosmicMuon ('Muon_V2' , TriggerFlags.CosmicSlice.MuonSignature_V2() or defaultSignatures['MuonSignature_V2'], TriggerFlags.CosmicSlice.MuonThreshold_V2() or defaultThresholds['MuonThreshold_V2'], '-1' ,''), + +# CosmicMuon ('Muon_Moore' , TriggerFlags.CosmicSlice.WidePatternRPCSignature() or defaultSignatures['WidePatternRPCSignature'], TriggerFlags.CosmicSlice.WidePatternRPCThreshold() or defaultThresholds['WidePatternRPCThreshold'], '-1' ,''), +# CosmicMuon ('Muon_Moore_TGC' , TriggerFlags.CosmicSlice.TGCSignature() or defaultSignatures['TGCSignature'], TriggerFlags.CosmicSlice.TGCThreshold() or defaultThresholds['TGCThreshold'], '-1' ,''), + + CosmicMuon ('Muon_MuonEF' , TriggerFlags.CosmicSlice.WidePatternRPCSignature() or defaultSignatures['WidePatternRPCSignature'], TriggerFlags.CosmicSlice.WidePatternRPCThreshold() or defaultThresholds['WidePatternRPCThreshold'], '-1' ,''), + CosmicMuon ('Muon_MuonEF_V2' , TriggerFlags.CosmicSlice.MuonSignature_V2() or defaultSignatures['MuonSignature_V2'], TriggerFlags.CosmicSlice.MuonThreshold_V2() or defaultThresholds['MuonThreshold_V2'], '-1' ,''), + + CosmicMuon ('Muon_MuonEF_TGC' , TriggerFlags.CosmicSlice.TGCSignature() or defaultSignatures['TGCSignature'], TriggerFlags.CosmicSlice.TGCThreshold() or defaultThresholds['TGCThreshold'], '-1' ,''), + + CosmicMufast ('Mufast_WideRPC' , TriggerFlags.CosmicSlice.WidePatternRPCSignature() or defaultSignatures['WidePatternRPCSignature'], TriggerFlags.CosmicSlice.WidePatternRPCThreshold() or defaultThresholds['WidePatternRPCThreshold'], '-1' ,''), + + CosmicMufast ('Mufast' , TriggerFlags.CosmicSlice.RPCSignature() or defaultSignatures['RPCSignature'], TriggerFlags.CosmicSlice.RPCThreshold() or defaultThresholds['RPCThreshold'], '-1' ,''), + CosmicMufast ('Mufast_V2' , TriggerFlags.CosmicSlice.MuonSignature_V2() or defaultSignatures['MuonSignature_V2'], TriggerFlags.CosmicSlice.MuonThreshold_V2() or defaultThresholds['MuonThreshold_V2'], '-1' ,''), + + CosmicMufast ('Mufast_TGC' , TriggerFlags.CosmicSlice.TGCSignature() or defaultSignatures['TGCSignature'], TriggerFlags.CosmicSlice.TGCThreshold() or defaultThresholds['TGCThreshold'], '-1' ,''), + CosmicMufast ('Mufast_MuIso' , TriggerFlags.CosmicSlice.RPCSignature() or defaultSignatures['RPCSignature'], TriggerFlags.CosmicSlice.RPCThreshold() or defaultThresholds['RPCThreshold'], '-1' ,''), + CosmicMufast ('Mufast_MuIso_V2' , TriggerFlags.CosmicSlice.MuonSignature_V2() or defaultSignatures['MuonSignature_V2'], TriggerFlags.CosmicSlice.MuonThreshold_V2() or defaultThresholds['MuonThreshold_V2'], '-1' ,''), + +# CosmicMufast ('Mufast_Moore_TGC' , TriggerFlags.CosmicSlice.TGCSignature() or defaultSignatures['TGCSignature'], TriggerFlags.CosmicSlice.TGCThreshold() or defaultThresholds['TGCThreshold'], '-1' ,''), +# CosmicMufast ('Mufast_Moore' , TriggerFlags.CosmicSlice.RPCSignature() or defaultSignatures['RPCSignature'], TriggerFlags.CosmicSlice.RPCThreshold() or defaultThresholds['RPCThreshold'], '-1' ,''), + + CosmicMufast ('Mufast_MuonEF_TGC' , TriggerFlags.CosmicSlice.TGCSignature() or defaultSignatures['TGCSignature'], TriggerFlags.CosmicSlice.TGCThreshold() or defaultThresholds['TGCThreshold'], '-1' ,''), + CosmicMufast ('Mufast_MuonEF' , TriggerFlags.CosmicSlice.RPCSignature() or defaultSignatures['RPCSignature'], TriggerFlags.CosmicSlice.RPCThreshold() or defaultThresholds['RPCThreshold'], '-1' ,''), + CosmicMufast ('Mufast_MuonEF_V2' , TriggerFlags.CosmicSlice.MuonSignature_V2() or defaultSignatures['MuonSignature_V2'], TriggerFlags.CosmicSlice.MuonThreshold_V2() or defaultThresholds['MuonThreshold_V2'], '-1' ,''), +# CosmicMufast ('Mufast_Moore_WideRPC' , TriggerFlags.CosmicSlice.WidePatternRPCSignature() or defaultSignatures['WidePatternRPCSignature'], TriggerFlags.CosmicSlice.WidePatternRPCThreshold() or defaultThresholds['WidePatternRPCThreshold'], '-1' ,''), + CosmicMufast ('Mufast_MuonEF_WideRPC' , TriggerFlags.CosmicSlice.WidePatternRPCSignature() or defaultSignatures['WidePatternRPCSignature'], TriggerFlags.CosmicSlice.WidePatternRPCThreshold() or defaultThresholds['WidePatternRPCThreshold'], '-1' ,''), + + CosmicMBiasCalo ('AllTeMBiasCalo_EndCapA' , '' , MBTSThresholdList_SideA, '-1' ,'MBTS_BCM_LUCID'), + CosmicMBiasCalo ('AllTeMBiasCalo_EndCapC' , '' , MBTSThresholdList_SideA, '-1' ,'MBTS_BCM_LUCID'), + + CosmicMBiasCalo ('MBiasCalo_EndCapA_V2' , ','.join(MBTSItemList_SideA_V2), MBTSThresholdList_SideA_V2, '-1' ,'MBTS_BCM_LUCID'), + CosmicMBiasCalo ('MBiasCalo_EndCapC_V2' , ','.join(MBTSItemList_SideC_V2), MBTSThresholdList_SideC_V2, '-1' ,'MBTS_BCM_LUCID'), + # +# # CosmicMinBias ('AllTeMBStandaloneSpacePoints' , TriggerFlags.CosmicSlice.StandaloneSignature() or defaultSignatures['StandaloneSignature'], TriggerFlags.CosmicSlice.StandaloneThreshold() or defaultThresholds['StandaloneThreshold'], '-1' ,''), + CosmicMinBias ('AllTeMBSpacePoints' , TriggerFlags.CosmicSlice.Signature() or defaultSignatures['Signature'], TriggerFlags.CosmicSlice.Threshold() or defaultThresholds['Threshold'], '-1' ,''), + CosmicMinBias ('AllTeMBSpacePoints_V2' , TriggerFlags.CosmicSlice.Signature_V2() or defaultSignatures['Signature_V2'], TriggerFlags.CosmicSlice.Threshold_V2() or defaultThresholds['Threshold_V2'], '-1' ,''), + # +# # CosmicMinBias ('AllTeMBStandaloneSpacePoints' , '', '', '-1' ,''), + CosmicCalibration ("SingleBeamTriggerType0" , '', '', '-1' ,'',ExpressStreamPrescale=10000000), + CosmicCalibration ("SingleBeamRNDM" , '', '', '-1' ,'',ExpressStreamPrescale=10000000), + CosmicCalibration ("SingleBeamBPTX" , '', '', '-1' ,'',ExpressStreamPrescale=10000000), + CosmicCalibration ("SingleBeamL1Calo" , '', '', '-1' ,'',ExpressStreamPrescale=10000000), + CosmicCalibration ("SingleBeamL1CaloEMFilter" , ','.join(L1CaloItemList_EM), '', '-1' ,'',ExpressStreamPrescale=10000000), + CosmicCalibration ("SingleBeamL1CaloEMFilter_V2" , ','.join(L1CaloItemList_EM_V2), '', '-1' ,'',ExpressStreamPrescale=10000000), + CosmicCalibration ("SingleBeamTGCwBeam" , '', '', '-1' ,'',ExpressStreamPrescale=10000000), + CosmicCalibration ("SingleBeamRPCwBeam" , '', '', '-1' ,'',ExpressStreamPrescale=10000000), + CosmicCalibration ("SingleBeamMBTS" , '', '', '-1' ,'',ExpressStreamPrescale=10000000), + CosmicCalibration ("SingleBeamMBTSFilter" , '', '', '-1' ,'',ExpressStreamPrescale=10000000), + CosmicCalibration ("SingleBeamBCM" , '', '', '-1' ,'',ExpressStreamPrescale=10000000), + CosmicCalibration ("SingleBeamLUCID" , '', '', '-1' ,'',ExpressStreamPrescale=10000000), + CosmicCalibration ("SingleBeamCosmicMuons" , '', '', '-1' ,'',ExpressStreamPrescale=10000000), + # + # + # + CosmicCalibration ('StandaloneCalibration' , TriggerFlags.CosmicSlice.CalibrationSignature() or defaultSignatures['CalibrationSignature'], TriggerFlags.CosmicSlice.CalibrationThreshold() or defaultThresholds['CalibrationThreshold'], '-1' ,''), + CosmicCalibration ('Calibration' , TriggerFlags.CosmicSlice.Signature() or defaultSignatures['Signature'], TriggerFlags.CosmicSlice.Threshold() or defaultThresholds['Threshold'] , '-1' ,''), + + CosmicCalibration ('NIM0Passthrough' , '', ['NIM0'], '-1' ,''), + CosmicCalibration ('NIM4Passthrough' , '', ['NIM4'], '-1' ,''), + CosmicCalibration ('TRTPassthrough' , '', ['TRT'], '-1' ,'IDCosmic'), + + CosmicCalibration ('TilePassthrough' , '', ['Tile'], '-1' ,'CosmicMuons'), + + CosmicCalibration ('CALREQ0Calibration' , '', ['CALREQ0'], '-1' ,''), + CosmicCalibration ('CALREQ1Calibration' , '', ['CALREQ1'], '-1' ,''), + CosmicCalibration ('CALREQ2Calibration' , '', ['CALREQ2'], '-1' ,''), + + CosmicCalibration ('EM5Passthrough' , 'L1_EM5' , ['EM5'] , '-1' ,''), + CosmicCalibration ('EM10Passthrough' , 'L1_EM10' , ['EM10'] , '-1' ,''), + CosmicCalibration ('EM15Passthrough' , 'L1_EM15' , ['EM15'] , '-1' ,''), + CosmicCalibration ('EM20Passthrough' , 'L1_EM20' , ['EM20'] , '-1' ,''), + CosmicCalibration ('EM30Passthrough' , 'L1_EM30' , ['EM30'] , '-1' ,''), + CosmicCalibration ('EM40Passthrough' , 'L1_EM40' , ['EM40'] , '-1' ,''), + CosmicCalibration ('EM50Passthrough' , 'L1_EM50' , ['EM50'] , '-1' ,''), + CosmicCalibration ('EM100Passthrough' , 'L1_EM100', ['EM100'], '-1' ,''), + + CosmicCalibration ('JET5Passthrough' , 'L1_J5' , ['J5'] , '-1' ,''), + CosmicCalibration ('JET10Passthrough' , 'L1_J10' , ['J10'] , '-1' ,''), + CosmicCalibration ('JET15Passthrough' , 'L1_J15' , ['J15'] , '-1' ,''), + CosmicCalibration ('JET20Passthrough' , 'L1_J20' , ['J20'] , '-1' ,''), + CosmicCalibration ('JET30Passthrough' , 'L1_J30' , ['J30'] , '-1' ,''), + CosmicCalibration ('JET40Passthrough' , 'L1_J40' , ['J40'] , '-1' ,''), + CosmicCalibration ('JET50Passthrough' , 'L1_J50' , ['J50'] , '-1' ,''), + CosmicCalibration ('JET100Passthrough' , 'L1_J100', ['J100'], '-1' ,''), + + CosmicCalibration ('TAU5Passthrough' , 'L1_TAU5' , ['TAU5'] , '-1' ,''), + CosmicCalibration ('TAU10Passthrough' , 'L1_TAU10' , ['TAU10'] , '-1' ,''), + CosmicCalibration ('TAU15Passthrough' , 'L1_TAU15' , ['TAU15'] , '-1' ,''), + CosmicCalibration ('TAU20Passthrough' , 'L1_TAU20' , ['TAU20'] , '-1' ,''), + CosmicCalibration ('TAU30Passthrough' , 'L1_TAU30' , ['TAU30'] , '-1' ,''), + CosmicCalibration ('TAU40Passthrough' , 'L1_TAU40' , ['TAU40'] , '-1' ,''), + CosmicCalibration ('TAU50Passthrough' , 'L1_TAU50' , ['TAU50'] , '-1' ,''), + CosmicCalibration ('TAU100Passthrough' , 'L1_TAU100', ['TAU100'], '-1' ,''), + + CosmicCalibration ('JF5Passthrough' , 'L1_JF5' , ['JF5'] , '-1' ,''), + CosmicCalibration ('JF10Passthrough' , 'L1_JF10' , ['JF10'] , '-1' ,''), + CosmicCalibration ('JF15Passthrough' , 'L1_JF15' , ['JF15'] , '-1' ,''), + CosmicCalibration ('JF20Passthrough' , 'L1_JF20' , ['JF20'] , '-1' ,''), + + CosmicCalibration ('JB5Passthrough' , 'L1_JB5' , ['JB5'] , '-1' ,''), + CosmicCalibration ('JB10Passthrough' , 'L1_JB10' , ['JB10'] , '-1' ,''), + CosmicCalibration ('JB15Passthrough' , 'L1_JB15' , ['JB15'] , '-1' ,''), + CosmicCalibration ('JB20Passthrough' , 'L1_JB20' , ['JB20'] , '-1' ,''), + + CosmicCalibration ('MBTSPassthrough' , '',MBTSThresholdList, '-1' ,''), + CosmicCalibration ('L1CaloPassthrough' , '',L1CaloThresholdList, '-1' ,''), + + CosmicCalibration ('BCMPassthrough' , '',['BCM_Halo','BCM_Wide','BCM_Ideal'], '-1' ,'','',1,1), + CosmicCalibration ('LUCIDPassthrough' , '',['LUCID_A','LUCID_C','LUCID_A_C'], '-1' ,'','',1,1), + + CosmicCalibration ('RNDM0Passthrough' , '','RNDM0', '-1' ,'','',-1,1), + CosmicCalibration ('RNDM1Passthrough' , '','RNDM1', '-1' ,'','',-1,1), + CosmicCalibration ('PhysicsPassthrough' , '','', '-1' ,'','',1,1), + CosmicCalibration ('CalibrationPassthrough' , '','', '-1' ,'','',1,1), + CosmicCalibration ('L2CalibrationPassthrough' , '','', '-1' ,'','',1,1), + CosmicCalibration ('EFCalibrationPassthrough' , '','', '-1' ,'','',1,1), + # + CosmicROIFilter ('CosmicDownwardMuonRPCROI' , '',["MU0_LOW_RPC","MU0_LOW_RPC_SPARE","MU0_LOW_RPC_EMPTY","MU0_LOW_RPC_BPTX","MU0_HIGH_RPC","MU0_HIGH_RPC_EMPTY","MU0_HIGH_RPC_BPTX","MU6_RPC","MU6_RPC_BPTX"],'-1','CosmicDownwardMuon'), + CosmicROIFilter ('CosmicDownwardMuonTGCROI' , '',["MU0_TGC_HALO","MU0_TGC_HALO_SPARE","MU0_TGC_EMPTY","MU0_TGC_HALO_EMPTY","MU0_TGC_HALO_BPTX","MU0_TGC","MU0_TGC_BPTX","MU6_TGC","MU6_TGC_BPTX"],'-1','CosmicDownwardMuon'), + # + CosmicL1CaloFilter ('L1CaloFilter' , ','.join(L1CaloItemList_NoXE) , '' ,'-1',''), + CosmicL1CaloFilter ('L1CaloEMFilter' , ','.join(L1CaloItemList_EM), '' ,'-1',''), + CosmicL1CaloFilter ('L1CaloTauFilter' , ','.join(L1CaloItemList_TAU), '' ,'-1',''), + CosmicL1CaloFilter ('L1CaloJetFilter' , ','.join(L1CaloItemList_J), '' ,'-1',''), + # + CosmicL1CaloFilter ('L1CaloFilter_V2' , ','.join(L1CaloItemList_NoXE_V2), '' ,'-1',''), + CosmicL1CaloFilter ('L1CaloEMFilter_V2' , ','.join(L1CaloItemList_EM_V2), '' ,'-1',''), + CosmicL1CaloFilter ('L1CaloTauFilter_V2' , ','.join(L1CaloItemList_TAU_V2), '' ,'-1',''), + CosmicL1CaloFilter ('L1CaloJetFilter_V2' , ','.join(L1CaloItemList_J_V2), '' ,'-1',''), + # + CosmicTileCalibration ('TileCalib_ped' , 'L1_CALREQ0', 'CALREQ0', '-1' ,'tilecalib'), + CosmicTileCalibration ('TileCalib_cis' , 'L1_CALREQ1', 'CALREQ1', '-1' ,'tilecalib'), + CosmicTileCalibration ('TileCalib_laser' ,'L1_CALREQ2', 'CALREQ2', '-1' ,'tilecalib'), + + CosmicPixelCalibration ('Cosmic_pixelnoise' ,'L1_RD0_FILLED','RNDM0', '-1' ,'pixelnoise'), + CosmicPixelCalibration ('Cosmic_pixelnoise_V2' ,'L1_RD0_EMPTY','RNDM0', '-1' ,'pixelnoise'), + CosmicRateAnalysis ('Cosmic_rateanalysis' ,'','', '-1' ,'rateanalysis'), + CosmicLArCalib ('LArCalib' , TriggerFlags.CosmicSlice.CaloSignature() or defaultSignatures['CaloSignature'], TriggerFlags.CosmicSlice.CaloThreshold() or defaultThresholds['CaloThreshold'], '-1' ,'LAr_calibration','calibration',10000,1), + CosmicLArCalib ('LArCalib_V2' , TriggerFlags.CosmicSlice.CaloSignature_V2() or defaultSignatures['CaloSignature_V2'], TriggerFlags.CosmicSlice.CaloThreshold_V2() or defaultThresholds['CaloThreshold_V2'], '-1' ,'LAr_calibration','calibration',10000,1), + + CosmicMEt ('AllTeMEt' , '', '', '-1' ,''), + CosmicMEt ('AllTeMEt_EFOnly' , '', '', '-1' ,''), + CosmicMEt ('MEt' , TriggerFlags.CosmicSlice.RPCSignature() or defaultSignatures['RPCSignature'], TriggerFlags.CosmicSlice.RPCThreshold() or defaultThresholds['RPCThreshold'], '-1' ,''), + CosmicMEt ('MEt_EFOnly' , TriggerFlags.CosmicSlice.RPCSignature() or defaultSignatures['RPCSignature'], TriggerFlags.CosmicSlice.RPCThreshold() or defaultThresholds['RPCThreshold'], '-1' ,''), + CosmicMEt ('MEt_EFOnly_Mufast' , TriggerFlags.CosmicSlice.RPCSignature() or defaultSignatures['RPCSignature'], TriggerFlags.CosmicSlice.RPCThreshold() or defaultThresholds['RPCThreshold'], '-1' ,''), + CosmicMEt ('MEt_Mufast' , TriggerFlags.CosmicSlice.RPCSignature() or defaultSignatures['RPCSignature'], TriggerFlags.CosmicSlice.RPCThreshold() or defaultThresholds['RPCThreshold'], '-1' ,''), + CosmicMEt ('MEt_EFOnly_Mufast_MuonEF' , TriggerFlags.CosmicSlice.RPCSignature() or defaultSignatures['RPCSignature'], TriggerFlags.CosmicSlice.RPCThreshold() or defaultThresholds['RPCThreshold'], '-1' ,''), + CosmicMEt ('MEt_Mufast_MuonEF' , TriggerFlags.CosmicSlice.RPCSignature() or defaultSignatures['RPCSignature'], TriggerFlags.CosmicSlice.RPCThreshold() or defaultThresholds['RPCThreshold'], '-1' ,''), + # + CosmicMEt ('MEt_V2' , TriggerFlags.CosmicSlice.MuonSignature_V2() or defaultSignatures['MuonSignature_V2'], TriggerFlags.CosmicSlice.MuonThreshold_V2() or defaultThresholds['MuonThreshold_V2'], '-1' ,''), + CosmicMEt ('MEt_EFOnly_V2' , TriggerFlags.CosmicSlice.MuonSignature_V2() or defaultSignatures['MuonSignature_V2'], TriggerFlags.CosmicSlice.MuonThreshold_V2() or defaultThresholds['MuonThreshold_V2'], '-1' ,''), + CosmicMEt ('MEt_EFOnly_Mufast_V2' , TriggerFlags.CosmicSlice.MuonSignature_V2() or defaultSignatures['MuonSignature_V2'], TriggerFlags.CosmicSlice.MuonThreshold_V2() or defaultThresholds['MuonThreshold_V2'], '-1' ,''), + CosmicMEt ('MEt_Mufast_V2' , TriggerFlags.CosmicSlice.MuonSignature_V2() or defaultSignatures['MuonSignature_V2'], TriggerFlags.CosmicSlice.MuonThreshold_V2() or defaultThresholds['MuonThreshold_V2'], '-1' ,''), + CosmicMEt ('MEt_EFOnly_Mufast_MuonEF_V2' , TriggerFlags.CosmicSlice.MuonSignature_V2() or defaultSignatures['MuonSignature_V2'], TriggerFlags.CosmicSlice.MuonThreshold_V2() or defaultThresholds['MuonThreshold_V2'], '-1' ,''), + CosmicMEt ('MEt_Mufast_MuonEF_V2' , TriggerFlags.CosmicSlice.MuonSignature_V2() or defaultSignatures['MuonSignature_V2'], TriggerFlags.CosmicSlice.MuonThreshold_V2() or defaultThresholds['MuonThreshold_V2'], '-1' ,''), + # + CosmicMEt ('AllTe_MEt_EFOnly_Mufast_MuonEF' , '', '', '-1' ,''), + CosmicMEt ('AllTe_MEt_Mufast_MuonEF' , '', '', '-1' ,''), + CosmicMEt ('AllTe_MEt_EFOnly_MuonEF' , '', '', '-1' ,''), + CosmicMEt ('AllTe_MEt_MuonEF' , '', '', '-1' ,''), + # + # + HLTBeamLineFitterTest ('HLTBeamLineFitterTest' , '', '', '-1',''), + HLTBeamLineFitterTest ('HLTBeamLineFitterTestFake' , '', '', '-1',''), +] + +CosmicSlices=[] +for slice in Cosmics: CosmicSlices += [ slice.sig_id ] + +################################################################################# +### Chech that Cosmic flags are up to date with respect to what's implemented ### +################################################################################# + +sortedSliceNames=CosmicSlices +sortedSliceNames.sort() + +sortedSliceNamesFromFlags=TriggerFlags.CosmicSlice.SliceList.StoredValue +sortedSliceNamesFromFlags.sort() + +if (sortedSliceNames!=sortedSliceNamesFromFlags): + if (TriggerFlags.CosmicSlice.testCosmic()==True): + log.info("Something is wrong: you most likely added") + log.info("a new slice to Cosmic.py but forgot to uupdate") + log.info("the list in Trigger/TriggerCommon/TriggerMenuPython/python/CosmicSliceFlags.py") + log.info(str(sortedSliceNames)) + log.info(str(sortedSliceNamesFromFlags)) + log.info("missing from sortedSliceNamesFromFlags") + for x in sortedSliceNames: + if (x not in sortedSliceNamesFromFlags): + log.info(x) + log.info("missing from sortedSliceNames") + for x in sortedSliceNamesFromFlags: + if (x not in sortedSliceNames): + log.info(x) + +def setupCosmics(): + from TriggerMenuPython.Lvl1 import Lvl1 + from TriggerMenuPython.Lvl1Flags import Lvl1Flags + from TriggerMenuPython.TriggerPythonConfig import TriggerPythonConfig + from TriggerJobOpts.TriggerFlags import TriggerFlags + from AthenaCommon.Logging import logging + + #TriggerFlags.Slices_all_setOff() + #lvl1Flags.thresholds.allowedValues = TriggerFlags.CosmicSlice.UsedLVL1Thresholds.StoredValue + if (TriggerFlags.CosmicSlice.testCosmic()==True): + log.info(str( Lvl1Flags.thresholds.allowedValues )) + Lvl1Flags.thresholds.StoredValue = TriggerFlags.CosmicSlice.UsedLVL1Thresholds.StoredValue + + Lvl1FlagList=[ "L1_%s" % x for x in TriggerFlags.CosmicSlice.UsedLVL1Signatures.StoredValue] + + Lvl1Flags.items.StoredValue=[] + for x in Lvl1FlagList: + if (x!="L1_"): + Lvl1Flags.items.StoredValue += [ x ] + #else: + # Lvl1Flags.items.StoredValue += [''] + + StreamConfig = {'physics' : [] } + for x in Cosmics: + StreamConfig['physics'] += [ x.sig_id ] + + if (TriggerFlags.CosmicSlice.testCosmic()==True): + log.info( "used Items") + log.info(str( Lvl1Flags.thresholds())) + log.info(str(Lvl1Flags.items())) + log.info(str(StreamConfig)) diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/ElectronDef.temp.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/ElectronDef.temp.py new file mode 100755 index 00000000000..d9653713337 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/ElectronDef.temp.py @@ -0,0 +1,1089 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +""" Electron trigger slice signatures """ + +__author__ = 'P.Urquijo' +__version__="" +__doc__="Implementation of Electron Slice single electron signatures" + +from AthenaCommon.Logging import logging +from TriggerMenuPython.HltConfig import L2EFChainDef, mergeRemovingOverlap +from TriggerMenuPython.EgammaSliceFlags import getEM_ItemFromChain, getEM_InTEFromItem + +########################################################################################## +# +# Import and create fexes and hypos +# +########################################################################################## +from TrigT2CaloEgamma.TrigT2CaloEgammaConfig import T2CaloEgamma_eGamma, T2CaloEgamma_SwSeed, T2CaloEgamma_SwSeed_NoCut +from TrigT2CaloEgamma.TrigT2CaloEgammaConfig import T2CaloEgamma_SwCluster, T2CaloEgamma_Ringer, T2CaloEgamma_cells + +theT2CaloEgamma_eGamma = T2CaloEgamma_eGamma() +theT2CaloEgamma_SwSeed = T2CaloEgamma_SwSeed() +theT2CaloEgamma_SwSeed_NoCut = T2CaloEgamma_SwSeed_NoCut() +theT2CaloEgamma_SwCluster = T2CaloEgamma_SwCluster() +theT2CaloEgamma_Ringer = T2CaloEgamma_Ringer() +theT2CaloEgamma_cells_e = T2CaloEgamma_cells("T2CaloEgamma_cells") + +from TrigIDSCAN.TrigIDSCAN_Config import TrigIDSCAN_eGamma +from TrigSiTrack.TrigSiTrack_Config import TrigSiTrack_eGamma, TrigSiTrack_eGamma_robust +from TrigL2TRTSegFinder.TrigTRTSegFinder_Config import TrigTRTSegFinder_eGamma + +theTrigIDSCAN_eGamma = TrigIDSCAN_eGamma() +theTrigSiTrack_eGamma = TrigSiTrack_eGamma() +theTrigSiTrack_eGamma_robust = TrigSiTrack_eGamma_robust() +theTrigTRTSegFinder_eGamma = TrigTRTSegFinder_eGamma() + + +from TrigEgammaHypo.TrigL2CaloHypoConfig import * +from TrigEgammaHypo.TrigL2ElectronFexConfig import * +from TrigEgammaHypo.TrigL2ElectronHypoConfig import * +from TrigMultiVarHypo.TrigMultiVarHypoConfig import TrigRingerNeuralHypoConfig_e10 +from TrigMultiVarHypo.TrigMultiVarHypoConfig import TrigRingerNeuralHypoConfig_e5 +from TrigMultiVarHypo.TrigMultiVarHypoConfig import TrigRingerNeuralFexConfig_e5 +from TrigMultiVarHypo.TrigMultiVarHypoConfig import TrigRingerNeuralFexConfig_e10 + +from TrigCaloRec.TrigCaloRecConfig import TrigCaloCellMaker_eGamma, TrigCaloCellMaker_eGamma_cells, TrigCaloTowerMaker_eGamma, TrigCaloClusterMaker_slw +theTrigCaloCellMaker_eGamma = TrigCaloCellMaker_eGamma() +theTrigCaloTowerMaker_eGamma = TrigCaloTowerMaker_eGamma() +theTrigCaloClusterMaker_slw = TrigCaloClusterMaker_slw() + +from InDetTrigRecExample.EFInDetConfig import * +theTrigEFIDInsideOut_Electron = TrigEFIDInsideOut_Electron("Electron").getSequence() +theTrigEFIDOutsideInTRTOnly_Electron = TrigEFIDOutsideInTRTOnly_Electron().getSequence() +theTrigEFIDCombined_Electron = TrigEFIDCombined_Electron().getSequence() + +from TrigEgammaHypo.TrigEFTrackHypoConfig import * +from TrigEgammaHypo.TrigEFElectronHypoConfig import * +from TrigEgammaRec.TrigEgammaRecConfig import * +theTrigEgammaRec_eGamma = TrigEgammaRec_eGamma() + +########################################################################################## +# +# L2 & EF Chain configuration helper classes +# +########################################################################################## +class L2EFChain_e(L2EFChainDef): + class L2Config: + def __init__(self, suffix, + TrigL2CaloHypo_1=None, TrigL2ElectronFex_1=None, TrigL2ElectronHypo_1=None): + self.suffix = suffix + self.TrigL2CaloHypo_1 = TrigL2CaloHypo_1 or TrigL2CaloHypo('TrigL2CaloHypo_'+suffix) + self.TrigL2ElectronFex_1 = TrigL2ElectronFex_1 or TrigL2ElectronFex('TrigL2ElectronFex_'+suffix) + self.TrigL2ElectronHypo_1 = TrigL2ElectronHypo_1 or TrigL2ElectronHypo('TrigL2ElectronHypo_'+suffix) + pass + + class EFConfig: + def __init__(self, suffix, + TrigEFTrackHypo_1=None, TrigEFEGammaHypo_1=None): + self.suffix = suffix + self.TrigEFTrackHypo_1 = TrigEFTrackHypo_1 or TrigEFTrackHypo('TrigEFTrackHypo_'+suffix) + self.TrigEFEGammaHypo_1 = TrigEFEGammaHypo_1 or TrigEFElectronHypo('TrigEFElectronHypo_'+suffix) + pass + + class Config: + def __init__(self, l2config, efconfig): + self.suffix = '' + self.L2Config = l2config + self.EFConfig = efconfig + pass + + # New simplified constructor for electron chains + def __init__(self, sig_id, chain_counter, config): + + l1_item_name = getEM_ItemFromChain(sig_id) + l2_input_tes = getEM_InTEFromItem(l1_item_name) + + l2_name = 'L2_'+sig_id + ef_name = 'EF_'+sig_id + + L2EFChainDef.__init__(self, sig_id, + l2_name, chain_counter, l1_item_name, ef_name, chain_counter, l2_input_tes, config) + + def defineSequences(self, config): + ###### L2 ###### + # Step 1: Calo Fex and Hypo + self.addL2Sequence(self.inputTEs, + [theT2CaloEgamma_eGamma, config.L2Config.TrigL2CaloHypo_1], + 'L2_e_step1') + # Step 2: ID Fex + self.addL2Sequence(['L2_e_step1'], + [theTrigIDSCAN_eGamma, theTrigSiTrack_eGamma], + 'L2_e_step2') + # Step 3: ID-Calo Fex and Hypo + self.addL2Sequence(['L2_e_step2'], + [config.L2Config.TrigL2ElectronFex_1, config.L2Config.TrigL2ElectronHypo_1], + 'L2_e_step3') + + + ###### EF ###### + # Step 1: Calo Fex + self.addEFSequence('L2_e_step3', + [theTrigCaloCellMaker_eGamma, theTrigCaloTowerMaker_eGamma, theTrigCaloClusterMaker_slw], + 'EF_e_step1') + # Step 2: ID Fex and Hypo + self.addEFSequence('EF_e_step1', + theTrigEFIDInsideOut_Electron + [config.EFConfig.TrigEFTrackHypo_1], + 'EF_e_step2') + # Step 3: ID-Calo Fex and Hypo + self.addEFSequence('EF_e_step2', + [theTrigEgammaRec_eGamma, config.EFConfig.TrigEFEGammaHypo_1], + 'EF_e_step3') + + def defineSignatures(self): + self.addL2Signature(['L2_e_step1']) + self.addL2Signature(['L2_e_step2']) + self.addL2Signature(['L2_e_step3']) + self.addEFSignature(['EF_e_step1']) + self.addEFSignature(['EF_e_step2']) + self.addEFSignature(['EF_e_step3']) + + def defineStreamGroupTriggerType(self): + self.physics_streams = ['egamma'] + self.calib_streams = [] + self.groups = ['Exclusive_Electrons', 'Inclusive_Electrons'] + self.trigger_type = [] + + def defineTErenaming(self): + self.TErenamingMap = { + 'L2_e_step1': mergeRemovingOverlap('L2_', self.sig_id+'cl'), + 'L2_e_step2': mergeRemovingOverlap('L2_', self.sig_id+'id'), + 'L2_e_step3': mergeRemovingOverlap('L2_', self.sig_id), + 'EF_e_step1': mergeRemovingOverlap('EF_', self.sig_id+'calo'), + 'EF_e_step2': mergeRemovingOverlap('EF_', self.sig_id+'id'), + 'EF_e_step3': mergeRemovingOverlap('EF_', self.sig_id), + } + +class L2EFChain_e_robust(L2EFChain_e): + + def defineSequences(self, config): + ###### L2 ###### + # Step 1: Calo Fex and Hypo + self.addL2Sequence(self.inputTEs, + [theT2CaloEgamma_eGamma, config.L2Config.TrigL2CaloHypo_1], + 'L2_e_step1') + # Step 2: ID Fex + self.addL2Sequence(['L2_e_step1'], + [theTrigIDSCAN_eGamma, theTrigSiTrack_eGamma_robust], + 'L2_e_step2') + # Step 3: ID-Calo Fex and Hypo + self.addL2Sequence(['L2_e_step2'], + [config.L2Config.TrigL2ElectronFex_1, config.L2Config.TrigL2ElectronHypo_1], + 'L2_e_step3') + + + ###### EF ###### + # Step 1: Calo Fex + self.addEFSequence('L2_e_step3', + [theTrigCaloCellMaker_eGamma, theTrigCaloTowerMaker_eGamma, theTrigCaloClusterMaker_slw], + 'EF_e_step1') + # Step 2: ID Fex and Hypo + self.addEFSequence('EF_e_step1', + theTrigEFIDInsideOut_Electron + [config.EFConfig.TrigEFTrackHypo_1], + 'EF_e_step2') + # Step 3: ID-Calo Fex and Hypo + self.addEFSequence('EF_e_step2', + [theTrigEgammaRec_eGamma, config.EFConfig.TrigEFEGammaHypo_1], + 'EF_e_step3') + +class L2EFChain_e_cells(L2EFChain_e): + + def defineSequences(self, config): + ###### L2 ###### + # Step 1: Calo Fex and Hypo + self.addL2Sequence(self.inputTEs, + [theT2CaloEgamma_cells_e, config.L2Config.TrigL2CaloHypo_1], + 'L2_e_step1') + # Step 2: ID Fex + self.addL2Sequence(['L2_e_step1'], + [theTrigIDSCAN_eGamma, theTrigSiTrack_eGamma_robust], + 'L2_e_step2') + # Step 3: ID-Calo Fex and Hypo + self.addL2Sequence(['L2_e_step2'], + [config.L2Config.TrigL2ElectronFex_1, config.L2Config.TrigL2ElectronHypo_1], + 'L2_e_step3') + + + ###### EF ###### + # Step 1: Calo Fex + self.addEFSequence('L2_e_step3', + [theTrigCaloCellMaker_eGamma_cells, theTrigCaloTowerMaker_eGamma, theTrigCaloClusterMaker_slw], + 'EF_e_step1') + # Step 2: ID Fex and Hypo + self.addEFSequence('EF_e_step1', + theTrigEFIDInsideOut_Electron + [config.EFConfig.TrigEFTrackHypo_1], + 'EF_e_step2') + # Step 3: ID-Calo Fex and Hypo + self.addEFSequence('EF_e_step2', + [theTrigEgammaRec_eGamma, config.EFConfig.TrigEFEGammaHypo_1], + 'EF_e_step3') + + + + +class L2EFChain_e_TRT(L2EFChain_e): + + def defineSequences(self, config): + ###### L2 ###### + # Step 1: Calo Fex and Hypo + self.addL2Sequence(self.inputTEs, + [theT2CaloEgamma_eGamma, config.L2Config.TrigL2CaloHypo_1], + 'L2_e_step1') + # Step 2: ID Fex + self.addL2Sequence(['L2_e_step1'], + [theTrigTRTSegFinder_eGamma ], + 'L2_e_step2') + # Step 3: ID-Calo Fex and Hypo + self.addL2Sequence(['L2_e_step2'], + [config.L2Config.TrigL2ElectronFex_1, config.L2Config.TrigL2ElectronHypo_1], + 'L2_e_step3') + + ###### EF ###### + # Step 1: Calo Fex + self.addEFSequence('L2_e_step3', + [theTrigCaloCellMaker_eGamma, theTrigCaloTowerMaker_eGamma, theTrigCaloClusterMaker_slw], + 'EF_e_step1') + # Step 2: ID Fex and Hypo + self.addEFSequence('EF_e_step1', + theTrigEFIDOutsideInTRTOnly_Electron + [config.EFConfig.TrigEFTrackHypo_1], + 'EF_e_step2') + # Step 3: ID-Calo Fex and Hypo + self.addEFSequence('EF_e_step2', + [theTrigEgammaRec_eGamma, config.EFConfig.TrigEFEGammaHypo_1], + 'EF_e_step3') + + +class L2EFChain_e_IdScan(L2EFChain_e): + + def defineSequences(self, config): + ###### L2 ###### + # Step 1: Calo Fex and Hypo + self.addL2Sequence(self.inputTEs, + [theT2CaloEgamma_eGamma, config.L2Config.TrigL2CaloHypo_1], + 'L2_e_step1') + # Step 2: ID Fex + self.addL2Sequence(['L2_e_step1'], + [theTrigIDSCAN_eGamma], + 'L2_e_step2') + # Step 3: ID-Calo Fex and Hypo + self.addL2Sequence(['L2_e_step2'], + [config.L2Config.TrigL2ElectronFex_1, config.L2Config.TrigL2ElectronHypo_1], + 'L2_e_step3') + + ###### EF ###### + # Step 1: Calo Fex + self.addEFSequence('L2_e_step3', + [theTrigCaloCellMaker_eGamma, theTrigCaloTowerMaker_eGamma, theTrigCaloClusterMaker_slw], + 'EF_e_step1') + # Step 2: ID Fex and Hypo + self.addEFSequence('EF_e_step1', + theTrigEFIDInsideOut_Electron + [config.EFConfig.TrigEFTrackHypo_1], + 'EF_e_step2') + # Step 3: ID-Calo Fex and Hypo + self.addEFSequence('EF_e_step2', + [theTrigEgammaRec_eGamma, config.EFConfig.TrigEFEGammaHypo_1], + 'EF_e_step3') + +class L2EFChain_e_IdScanFex(L2EFChain_e): + + def defineSequences(self, config): + ###### L2 ###### + # Step 1: Calo Fex and Hypo + self.addL2Sequence(self.inputTEs, + [theT2CaloEgamma_eGamma, config.L2Config.TrigL2CaloHypo_1], + 'L2_e_step1') + # Step 2: ID Fex + self.addL2Sequence(['L2_e_step1'], + [theTrigIDSCAN_eGamma, theTrigSiTrack_eGamma], + 'L2_e_step2') + # Step 3: ID-Calo Fex and Hypo + self.addL2Sequence(['L2_e_step2'], + [config.L2Config.TrigL2ElectronFex_1, config.L2Config.TrigL2ElectronHypo_1], + 'L2_e_step3') + + ###### EF ###### + # Step 1: Calo Fex + self.addEFSequence('L2_e_step3', + [theTrigCaloCellMaker_eGamma, theTrigCaloTowerMaker_eGamma, theTrigCaloClusterMaker_slw], + 'EF_e_step1') + # Step 2: ID Fex and Hypo + self.addEFSequence('EF_e_step1', + theTrigEFIDInsideOut_Electron + [config.EFConfig.TrigEFTrackHypo_1], + 'EF_e_step2') + # Step 3: ID-Calo Fex and Hypo + self.addEFSequence('EF_e_step2', + [theTrigEgammaRec_eGamma, config.EFConfig.TrigEFEGammaHypo_1], + 'EF_e_step3') + + +class L2EFChain_e_SiTrack(L2EFChain_e): + + def defineSequences(self, config): + ###### L2 ###### + # Step 1: Calo Fex and Hypo + self.addL2Sequence(self.inputTEs, + [theT2CaloEgamma_eGamma, config.L2Config.TrigL2CaloHypo_1], + 'L2_e_step1') + # Step 2: ID Fex + self.addL2Sequence(['L2_e_step1'], + [theTrigSiTrack_eGamma], + 'L2_e_step2') + # Step 3: ID-Calo Fex and Hypo + self.addL2Sequence(['L2_e_step2'], + [config.L2Config.TrigL2ElectronFex_1, config.L2Config.TrigL2ElectronHypo_1], + 'L2_e_step3') + + ###### EF ###### + # Step 1: Calo Fex + self.addEFSequence('L2_e_step3', + [theTrigCaloCellMaker_eGamma, theTrigCaloTowerMaker_eGamma, theTrigCaloClusterMaker_slw], + 'EF_e_step1') + # Step 2: ID Fex and Hypo + self.addEFSequence('EF_e_step1', + theTrigEFIDInsideOut_Electron + [config.EFConfig.TrigEFTrackHypo_1], + 'EF_e_step2') + # Step 3: ID-Calo Fex and Hypo + self.addEFSequence('EF_e_step2', + [theTrigEgammaRec_eGamma, config.EFConfig.TrigEFEGammaHypo_1], + 'EF_e_step3') + +class L2EFChain_e_SiTrack_robust(L2EFChain_e): + + def defineSequences(self, config): + ###### L2 ###### + # Step 1: Calo Fex and Hypo + self.addL2Sequence(self.inputTEs, + [theT2CaloEgamma_eGamma, config.L2Config.TrigL2CaloHypo_1], + 'L2_e_step1') + # Step 2: ID Fex + self.addL2Sequence(['L2_e_step1'], + [theTrigSiTrack_eGamma], + 'L2_e_step2') + # Step 3: ID-Calo Fex and Hypo + self.addL2Sequence(['L2_e_step2'], + [config.L2Config.TrigL2ElectronFex_1, config.L2Config.TrigL2ElectronHypo_1], + 'L2_e_step3') + + ###### EF ###### + # Step 1: Calo Fex + self.addEFSequence('L2_e_step3', + [theTrigCaloCellMaker_eGamma, theTrigCaloTowerMaker_eGamma, theTrigCaloClusterMaker_slw], + 'EF_e_step1') + # Step 2: ID Fex and Hypo + self.addEFSequence('EF_e_step1', + theTrigEFIDInsideOut_Electron + [config.EFConfig.TrigEFTrackHypo_1], + 'EF_e_step2') + # Step 3: ID-Calo Fex and Hypo + self.addEFSequence('EF_e_step2', + [theTrigEgammaRec_eGamma, config.EFConfig.TrigEFEGammaHypo_1], + 'EF_e_step3') + + +class L2EFChain_e_fwdBackTrk(L2EFChain_e): + + def defineSequences(self, config): + ###### L2 ###### + # Step 1: Calo Fex and Hypo + self.addL2Sequence(self.inputTEs, + [theT2CaloEgamma_eGamma, config.L2Config.TrigL2CaloHypo_1], + 'L2_e_step1') + # Step 2: ID Fex + self.addL2Sequence(['L2_e_step1'], + [theTrigIDSCAN_eGamma, theTrigSiTrack_eGamma, theTrigTRTSegFinder_eGamma], + 'L2_e_step2') + # Step 3: ID-Calo Fex and Hypo + self.addL2Sequence(['L2_e_step2'], + [config.L2Config.TrigL2ElectronFex_1, config.L2Config.TrigL2ElectronHypo_1], + 'L2_e_step3') + + + ###### EF ###### + # Step 1: Calo Fex + self.addEFSequence('L2_e_step3', + [theTrigCaloCellMaker_eGamma, theTrigCaloTowerMaker_eGamma, theTrigCaloClusterMaker_slw], + 'EF_e_step1') + # Step 2: ID Fex and Hypo + self.addEFSequence('EF_e_step1', + theTrigEFIDCombined_Electron + [config.EFConfig.TrigEFTrackHypo_1], + 'EF_e_step2') + # Step 3: ID-Calo Fex and Hypo + self.addEFSequence('EF_e_step2', + [theTrigEgammaRec_eGamma, config.EFConfig.TrigEFEGammaHypo_1], + 'EF_e_step3') + +class L2EFChain_e_nocut(L2EFChain_e): + + def defineSequences(self, config): + ###### L2 ###### + # Step 1: Calo Fex and Hypo + self.addL2Sequence(self.inputTEs, + [theT2CaloEgamma_eGamma, config.L2Config.TrigL2CaloHypo_1], + 'L2_e_step1') + # Step 2: ID Fex + self.addL2Sequence(['L2_e_step1'], + [theTrigIDSCAN_eGamma, theTrigSiTrack_eGamma], + 'L2_e_step2') + # Step 3: ID-Calo Fex and Hypo + self.addL2Sequence(['L2_e_step2'], + [config.L2Config.TrigL2ElectronFex_1, config.L2Config.TrigL2ElectronHypo_1], + 'L2_e_step3') + + + ###### EF ###### + # Step 1: Calo Fex + self.addEFSequence('L2_e_step3', + [theTrigCaloCellMaker_eGamma, theTrigCaloTowerMaker_eGamma, theTrigCaloClusterMaker_slw], + 'EF_e_step1') + # Step 2: ID Fex and Hypo + self.addEFSequence('EF_e_step1', + theTrigEFIDInsideOut_Electron + [config.EFConfig.TrigEFTrackHypo_1], + 'EF_e_step2') + # Step 3: ID-Calo Fex and Hypo + self.addEFSequence('EF_e_step2', + [theTrigEgammaRec_eGamma, config.EFConfig.TrigEFEGammaHypo_1], + 'EF_e_step3') + +class L2EFChain_e_Ringer(L2EFChain_e): + + class L2Config: + def __init__(self, suffix, + TrigL2CaloHypo_1=None, TrigL2CaloHypo_2=None, TrigL2ElectronFex_1=None, TrigL2ElectronHypo_1=None): + self.suffix = suffix + self.TrigL2CaloHypo_1 = TrigL2CaloHypo_1 or TrigL2CaloHypo('TrigL2CaloHypo_1_'+suffix) + self.TrigL2CaloHypo_2 = TrigL2CaloHypo_2 or TrigL2CaloHypo('TrigL2CaloHypo_2_'+suffix) + self.TrigL2ElectronFex_1 = TrigL2ElectronFex_1 or TrigL2ElectronFex('TrigL2ElectronFex_'+suffix) + self.TrigL2ElectronHypo_1 = TrigL2ElectronHypo_1 or TrigL2ElectronHypo('TrigL2ElectronHypo_'+suffix) + pass + + def defineSequences(self, config): + ###### L2 ###### + # Step 1: Calo Fex and Hypo + self.addL2Sequence(self.inputTEs, + [theT2CaloEgamma_Ringer, config.L2Config.TrigL2CaloHypo_1, config.L2Config.TrigL2CaloHypo_2], + 'L2_e_step1') + # Step 2: ID Fex + self.addL2Sequence(['L2_e_step1'], + [theTrigIDSCAN_eGamma, theTrigSiTrack_eGamma], + 'L2_e_step2') + # Step 3: ID-Calo Fex and Hypo + self.addL2Sequence(['L2_e_step2'], + [config.L2Config.TrigL2ElectronFex_1, config.L2Config.TrigL2ElectronHypo_1], + 'L2_e_step3') + + + ###### EF ###### + # Step 1: Calo Fex + self.addEFSequence('L2_e_step3', + [theTrigCaloCellMaker_eGamma, theTrigCaloTowerMaker_eGamma, theTrigCaloClusterMaker_slw], + 'EF_e_step1') + # Step 2: ID Fex and Hypo + self.addEFSequence('EF_e_step1', + theTrigEFIDInsideOut_Electron + [config.EFConfig.TrigEFTrackHypo_1], + 'EF_e_step2') + # Step 3: ID-Calo Fex and Hypo + self.addEFSequence('EF_e_step2', + [theTrigEgammaRec_eGamma, config.EFConfig.TrigEFEGammaHypo_1], + 'EF_e_step3') + +class L2EFChain_e_L2SW(L2EFChain_e): + + def defineSequences(self, config): + ###### L2 ###### + # Step 1a: Calo Fex part 1 + self.addL2Sequence(self.inputTEs, + [theT2CaloEgamma_SwSeed], + 'L2_e_step1a') + # Step 1b: Calo Fex part 2 and Hypo + self.addL2Sequence(['L2_e_step1a'], + [theT2CaloEgamma_SwCluster, config.L2Config.TrigL2CaloHypo_1], + 'L2_e_step1b') + # Step 2: ID Fex + self.addL2Sequence(['L2_e_step1b'], + [theTrigIDSCAN_eGamma, theTrigSiTrack_eGamma], + 'L2_e_step2') + # Step 3: ID-Calo Fex and Hypo + self.addL2Sequence(['L2_e_step2'], + [config.L2Config.TrigL2ElectronFex_1, config.L2Config.TrigL2ElectronHypo_1], + 'L2_e_step3') + + + ###### EF ###### + # Step 1: Calo Fex + self.addEFSequence('L2_e_step3', + [theTrigCaloCellMaker_eGamma, theTrigCaloTowerMaker_eGamma, theTrigCaloClusterMaker_slw], + 'EF_e_step1') + # Step 2: ID Fex and Hypo + self.addEFSequence('EF_e_step1', + theTrigEFIDInsideOut_Electron + [config.EFConfig.TrigEFTrackHypo_1], + 'EF_e_step2') + # Step 3: ID-Calo Fex and Hypo + self.addEFSequence('EF_e_step2', + [theTrigEgammaRec_eGamma, config.EFConfig.TrigEFEGammaHypo_1], + 'EF_e_step3') + + def defineSignatures(self): + self.addL2Signature(['L2_e_step1a']) + self.addL2Signature(['L2_e_step1b']) + self.addL2Signature(['L2_e_step2']) + self.addL2Signature(['L2_e_step3']) + self.addEFSignature(['EF_e_step1']) + self.addEFSignature(['EF_e_step2']) + self.addEFSignature(['EF_e_step3']) + + def defineTErenaming(self): + self.TErenamingMap = { + 'L2_e_step1a': mergeRemovingOverlap('L2_', self.sig_id+'cla'), + 'L2_e_step1b': mergeRemovingOverlap('L2_', self.sig_id+'clb'), + 'L2_e_step2': mergeRemovingOverlap('L2_', self.sig_id+'id'), + 'L2_e_step3': mergeRemovingOverlap('L2_', self.sig_id), + 'EF_e_step1': mergeRemovingOverlap('EF_', self.sig_id+'calo'), + 'EF_e_step2': mergeRemovingOverlap('EF_', self.sig_id+'id'), + 'EF_e_step3': mergeRemovingOverlap('EF_', self.sig_id), + } + + +class L2EFChain_e_L2SW_NoCut(L2EFChain_e_L2SW): + + def defineSequences(self, config): + ###### L2 ###### + # Step 1a: Calo Fex part 1 + self.addL2Sequence(self.inputTEs, + [theT2CaloEgamma_SwSeed_NoCut], + 'L2_e_step1a') + # Step 1b: Calo Fex part 2 and Hypo + self.addL2Sequence(['L2_e_step1a'], + [theT2CaloEgamma_SwCluster, config.L2Config.TrigL2CaloHypo_1], + 'L2_e_step1b') + # Step 2: ID Fex + self.addL2Sequence(['L2_e_step1b'], + [theTrigIDSCAN_eGamma, theTrigSiTrack_eGamma_robust], + 'L2_e_step2') + # Step 3: ID-Calo Fex and Hypo + self.addL2Sequence(['L2_e_step2'], + [config.L2Config.TrigL2ElectronFex_1, config.L2Config.TrigL2ElectronHypo_1], + 'L2_e_step3') + + + ###### EF ###### + # Step 1: Calo Fex + self.addEFSequence('L2_e_step3', + [theTrigCaloCellMaker_eGamma, theTrigCaloTowerMaker_eGamma, theTrigCaloClusterMaker_slw], + 'EF_e_step1') + # Step 2: ID Fex and Hypo + self.addEFSequence('EF_e_step1', + theTrigEFIDInsideOut_Electron + [config.EFConfig.TrigEFTrackHypo_1], + 'EF_e_step2') + # Step 3: ID-Calo Fex and Hypo + self.addEFSequence('EF_e_step2', + [theTrigEgammaRec_eGamma, config.EFConfig.TrigEFEGammaHypo_1], + 'EF_e_step3') + + +########################################################################################## +# +# Create chain objects for all configured chains +# +########################################################################################## + +Electrons = [ +## ################################## +## # Chains using all ID Fex Algos +## ################################## + L2EFChain_e_robust('e5_NoCut', 484, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e5_NoCut(), L2ElectronFex_1(), L2ElectronHypo_e5_NoCut()), + L2EFChain_e.EFConfig('',EFTrackHypo_e5_NoCut(), TrigEFElectronHypo_e5_NoCut() ))), + + L2EFChain_e_robust('e5_NoCut_cosmic', 719, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e5_NoCut(), L2ElectronFex_1(), L2ElectronHypo_e5_NoCut()), + L2EFChain_e.EFConfig('',EFTrackHypo_e5_NoCut(), TrigEFElectronHypo_e5_NoCut() ))), + + + L2EFChain_e_robust('e10_NoCut', 998, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e10_NoCut(), L2ElectronFex_1(), L2ElectronHypo_e10_NoCut()), + L2EFChain_e.EFConfig('',EFTrackHypo_e10_NoCut(), TrigEFElectronHypo_e10_NoCut() ))), + + L2EFChain_e_cells('e5_NoCut_cells', 489, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e5_NoCut(), L2ElectronFex_all(), L2ElectronHypo_e5_NoCut()), + L2EFChain_e.EFConfig('',EFTrackHypo_e5_NoCut(), TrigEFElectronHypo_e5_NoCut() ))), + + L2EFChain_e_cells('e5_NoCut_cells_cosmic', 455, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e5_NoCut(), L2ElectronFex_all(), L2ElectronHypo_e5_NoCut()), + L2EFChain_e.EFConfig('',EFTrackHypo_e5_NoCut(), TrigEFElectronHypo_e5_NoCut() ))), + + L2EFChain_e('e5_medium1', 473, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e5_medium1(), L2ElectronFex_all(), L2ElectronHypo_e5_medium1()), + L2EFChain_e.EFConfig('',EFTrackHypo_e5_medium1(), TrigEFElectronHypo_e5_medium1() ))), + + L2EFChain_e('e6_medium1', 475, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e6_medium1(), L2ElectronFex_all(), L2ElectronHypo_e6_medium1()), + L2EFChain_e.EFConfig('',EFTrackHypo_e6_medium1(), TrigEFElectronHypo_e6_medium1() ))), + + L2EFChain_e('e7_medium', 29, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e7_medium(), L2ElectronFex_all(), L2ElectronHypo_e7_medium()), + L2EFChain_e.EFConfig('',EFTrackHypo_e7_medium(), TrigEFElectronHypo_e7_medium() ))), + + L2EFChain_e('e10_loose', 1, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e10_loose(), L2ElectronFex_all(), L2ElectronHypo_e10_loose()), + L2EFChain_e.EFConfig('',EFTrackHypo_e10_loose(), TrigEFElectronHypo_e10_loose() ))), + + L2EFChain_e('e10_loose_cosmic', 725, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e10_loose(), L2ElectronFex_all(), L2ElectronHypo_e10_loose()), + L2EFChain_e.EFConfig('',EFTrackHypo_e10_loose(), TrigEFElectronHypo_e10_loose() ))), + + L2EFChain_e('e10_medium_cosmic', 728, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e10_medium(), L2ElectronFex_IdScan(), L2ElectronHypo_e10_medium()), + L2EFChain_e.EFConfig('',EFTrackHypo_e10_medium(), TrigEFElectronHypo_e10_medium() ))), + + L2EFChain_e('e10i_loose', 2, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e10i_loose(), L2ElectronFex_all(), L2ElectronHypo_e10i_loose()), + L2EFChain_e.EFConfig('',EFTrackHypo_e10i_loose(), TrigEFElectronHypo_e10i_loose() ))), + + L2EFChain_e('e10i_medium', 378, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e10i_medium(), L2ElectronFex_all(), L2ElectronHypo_e10i_medium()), + L2EFChain_e.EFConfig('',EFTrackHypo_e10i_medium(), TrigEFElectronHypo_e10i_medium() ))), + + L2EFChain_e('e15_loose', 4, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e15_loose(), L2ElectronFex_all(), L2ElectronHypo_e15_loose()), + L2EFChain_e.EFConfig('',EFTrackHypo_e15_loose(), TrigEFElectronHypo_e15_loose() ))), + + L2EFChain_e('e15i_loose', 6, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e15i_loose(), L2ElectronFex_all(), L2ElectronHypo_e15i_loose()), + L2EFChain_e.EFConfig('',EFTrackHypo_e15i_loose(), TrigEFElectronHypo_e15i_loose() ))), + + L2EFChain_e('e20i_loose', 8, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e20i_loose(), L2ElectronFex_all(), L2ElectronHypo_e20i_loose()), + L2EFChain_e.EFConfig('',EFTrackHypo_e20i_loose(), TrigEFElectronHypo_e20i_loose() ))), + + L2EFChain_e('e22i_tight', 12, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e22i_tight(), L2ElectronFex_all(), L2ElectronHypo_e22i_tight()), + L2EFChain_e.EFConfig('',EFTrackHypo_e22i_tight(), TrigEFElectronHypo_e22i_tight() ))), + + L2EFChain_e('e25i_loose', 9, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e25i_loose(), L2ElectronFex_all(), L2ElectronHypo_e25i_loose()), + L2EFChain_e.EFConfig('',EFTrackHypo_e25i_loose(), TrigEFElectronHypo_e25i_loose() ))), + + ##################################################### + # Same Chains, with L2 and EF Hypos set to Accept All + ##################################################### + + L2EFChain_e('e10_loose_passL2', 14, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e10_loose_passL2(), L2ElectronFex_all(), L2ElectronHypo_e10_loose_passL2()), + L2EFChain_e.EFConfig('',EFTrackHypo_e10_loose_passL2(), TrigEFElectronHypo_e10_loose_passL2() ))), + + L2EFChain_e('e10_loose_passL2_cosmic', 726, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e10_loose_passL2(), L2ElectronFex_all(), L2ElectronHypo_e10_loose_passL2()), + L2EFChain_e.EFConfig('',EFTrackHypo_e10_loose_passL2(), TrigEFElectronHypo_e10_loose_passL2() ))), + + L2EFChain_e('e15_loose_passL2', 18, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e15_loose_passL2(), L2ElectronFex_all(), L2ElectronHypo_e15_loose_passL2()), + L2EFChain_e.EFConfig('',EFTrackHypo_e15_loose_passL2(), TrigEFElectronHypo_e15_loose_passL2() ))), + + L2EFChain_e('e20i_loose_passL2', 24, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e20i_loose_passL2(), L2ElectronFex_all(), L2ElectronHypo_e20i_loose_passL2()), + L2EFChain_e.EFConfig('',EFTrackHypo_e20i_loose_passL2(), TrigEFElectronHypo_e20i_loose_passL2() ))), + + L2EFChain_e('e25i_loose_passL2', 26, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e25i_loose_passL2(), L2ElectronFex_all(), L2ElectronHypo_e25i_loose_passL2()), + L2EFChain_e.EFConfig('',EFTrackHypo_e25i_loose_passL2(), TrigEFElectronHypo_e25i_loose_passL2() ))), + + L2EFChain_e('e10_loose_passEF', 15, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e10_loose_passEF(), L2ElectronFex_all(), L2ElectronHypo_e10_loose_passEF()), + L2EFChain_e.EFConfig('',EFTrackHypo_e10_loose_passEF(), TrigEFElectronHypo_e10_loose_passEF() ))), + + L2EFChain_e('e10_loose_passEF_cosmic', 727, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e10_loose_passEF(), L2ElectronFex_all(), L2ElectronHypo_e10_loose_passEF()), + L2EFChain_e.EFConfig('',EFTrackHypo_e10_loose_passEF(), TrigEFElectronHypo_e10_loose_passEF() ))), + + L2EFChain_e('e15_loose_passEF', 19, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e15_loose(), L2ElectronFex_all(), L2ElectronHypo_e15_loose()), + L2EFChain_e.EFConfig('',EFTrackHypo_e15_loose_passEF(), TrigEFElectronHypo_e15_loose_passEF() ))), + + + L2EFChain_e('e20i_loose_passEF', 25, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e20i_loose(), L2ElectronFex_all(), L2ElectronHypo_e20i_loose()), + L2EFChain_e.EFConfig('',EFTrackHypo_e20i_loose_passEF(), TrigEFElectronHypo_e20i_loose_passEF() ))), + + L2EFChain_e('e25i_loose_passEF', 27, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e25i_loose(), L2ElectronFex_all(), L2ElectronHypo_e25i_loose()), + L2EFChain_e.EFConfig('',EFTrackHypo_e25i_loose_passEF(), TrigEFElectronHypo_e25i_loose_passEF() ))), + + +## ################################## +## # Chains using IDSCAN +## ################################## + + L2EFChain_e_IdScan('e5_NoCut_IdScan', 485, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e5_NoCut_IdScan(), L2ElectronFex_IdScan_NoCut(), L2ElectronHypo_e5_NoCut_IdScan()), + L2EFChain_e.EFConfig('',EFTrackHypo_e5_NoCut_IdScan(), TrigEFElectronHypo_e5_NoCut_IdScan() ))), + + L2EFChain_e_IdScan('e5_NoCut_IdScan_cosmic', 721, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e5_NoCut_IdScan(), L2ElectronFex_IdScan_NoCut(), L2ElectronHypo_e5_NoCut_IdScan()), + L2EFChain_e.EFConfig('',EFTrackHypo_e5_NoCut_IdScan(), TrigEFElectronHypo_e5_NoCut_IdScan() ))), + + L2EFChain_e_IdScan('e5_medium_IdScan', 999, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e5_medium(), L2ElectronFex_IdScan(), L2ElectronHypo_e5_medium_IDScan()), + L2EFChain_e.EFConfig('',EFTrackHypo_e5_medium_IDScan(), TrigEFElectronHypo_e5_medium_IDScan() ))), + + L2EFChain_e_IdScan('e6_medium_IdScan', 999, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e6_medium(), L2ElectronFex_IdScan(), L2ElectronHypo_e6_medium_IDScan()), + L2EFChain_e.EFConfig('',EFTrackHypo_e6_medium_IDScan(), TrigEFElectronHypo_e6_medium_IDScan() ))), + + L2EFChain_e_IdScan('e10_loose_IdScan', 556, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e10_loose_IDScan(), L2ElectronFex_IdScan(), L2ElectronHypo_e10_loose_IDScan()), + L2EFChain_e.EFConfig('',EFTrackHypo_e10_loose_IDScan(), TrigEFElectronHypo_e10_loose_IDScan() ))), + + L2EFChain_e_IdScan('e12_medium_IdScan', 999, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e12_medium(), L2ElectronFex_IdScan(), L2ElectronHypo_e12_medium_IDScan()), + L2EFChain_e.EFConfig('',EFTrackHypo_e12_medium_IDScan(), TrigEFElectronHypo_e12_medium_IDScan() ))), + + L2EFChain_e_IdScan('e15_medium_IdScan', 999, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e15_medium(), L2ElectronFex_IdScan(), L2ElectronHypo_e15_medium_IDScan()), + L2EFChain_e.EFConfig('',EFTrackHypo_e15_medium_IDScan(), TrigEFElectronHypo_e15_medium_IDScan() ))), + + L2EFChain_e_IdScan('e20_loose_IdScan', 888, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e20_loose(), L2ElectronFex_IdScan(), L2ElectronHypo_e20_loose_IDScan()), + L2EFChain_e.EFConfig('',EFTrackHypo_e20_loose_IDScan(), TrigEFElectronHypo_e20_loose_IDScan() ))), + + L2EFChain_e_IdScan('e25_loose_IdScan', 999, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e25_loose(), L2ElectronFex_IdScan(), L2ElectronHypo_e25_loose_IDScan()), + L2EFChain_e.EFConfig('',EFTrackHypo_e25_loose_IDScan(), TrigEFElectronHypo_e25_loose_IDScan() ))), + + L2EFChain_e_IdScanFex('e12_tight', 11, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e12_tight(), L2ElectronFex_IdScan(), L2ElectronHypo_e12_tight()), + L2EFChain_e.EFConfig('',EFTrackHypo_e12_tight(), TrigEFElectronHypo_e12_tight() ))), + + L2EFChain_e_IdScanFex('e15i_medium', 5, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e15i_medium(), L2ElectronFex_IdScan(), L2ElectronHypo_e15i_medium()), + L2EFChain_e.EFConfig('',EFTrackHypo_e15i_medium(), TrigEFElectronHypo_e15i_medium() ))), + + L2EFChain_e_IdScanFex('e17i_medium', 452, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e17i_medium(), L2ElectronFex_IdScan(), L2ElectronHypo_e17i_medium()), + L2EFChain_e.EFConfig('',EFTrackHypo_e17i_medium(), TrigEFElectronHypo_e17i_medium() ))), + + L2EFChain_e_IdScanFex('e20i_medium', 298, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e20i_medium(), L2ElectronFex_IdScan(), L2ElectronHypo_e20i_medium()), + L2EFChain_e.EFConfig('',EFTrackHypo_e20i_medium(), TrigEFElectronHypo_e20i_medium() ))), + + L2EFChain_e_IdScanFex('e25_medium', 299, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e25_medium(), L2ElectronFex_IdScan(), L2ElectronHypo_e25_medium()), + L2EFChain_e.EFConfig('',EFTrackHypo_e25_medium(), TrigEFElectronHypo_e25_medium() ))), + + L2EFChain_e_IdScanFex('e25i_medium', 300, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e25i_medium(), L2ElectronFex_IdScan(), L2ElectronHypo_e25i_medium()), + L2EFChain_e.EFConfig('',EFTrackHypo_e25i_medium(), TrigEFElectronHypo_e25i_medium() ))), + + L2EFChain_e_IdScanFex('e24_medium', 299, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e24_medium(), L2ElectronFex_IdScan(), L2ElectronHypo_e24_medium()), + L2EFChain_e.EFConfig('',EFTrackHypo_e24_medium(), TrigEFElectronHypo_e24_medium() ))), + + L2EFChain_e_IdScanFex('e40_loose1', 453, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e40_loose1(), L2ElectronFex_IdScan(), L2ElectronHypo_e40_loose1()), + L2EFChain_e.EFConfig('',EFTrackHypo_e40_loose1(), TrigEFElectronHypo_e40_loose1() ))), + + L2EFChain_e_IdScanFex('e55_loose1', 456, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e55_loose1(), L2ElectronFex_IdScan(), L2ElectronHypo_e55_loose1()), + L2EFChain_e.EFConfig('',EFTrackHypo_e55_loose1(), TrigEFElectronHypo_e55_loose1() ))), + + L2EFChain_e_IdScanFex('e55_medium2', 13, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e55_medium2(), L2ElectronFex_IdScan(), L2ElectronHypo_e55_medium2()), + L2EFChain_e.EFConfig('',EFTrackHypo_e55_medium2(), TrigEFElectronHypo_e55_medium2() ))), + + L2EFChain_e_IdScanFex('e105_loose1', 10, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e105_loose1(), L2ElectronFex_IdScan(), L2ElectronHypo_e105_loose1()), + L2EFChain_e.EFConfig('',EFTrackHypo_e105_loose1(), TrigEFElectronHypo_e105_loose1() ))), + + L2EFChain_e_IdScanFex('e140_loose1', 454, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e140_loose1(), L2ElectronFex_IdScan(), L2ElectronHypo_e140_loose1()), + L2EFChain_e.EFConfig('',EFTrackHypo_e140_loose1(), TrigEFElectronHypo_e140_loose1() ))), + + ##################################################### + # Same Chains, with L2 and EF Hypos set to Accept All + ##################################################### + + L2EFChain_e_IdScanFex('e15i_medium_passL2', 20, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e15i_medium_passL2(), L2ElectronFex_IdScan(), L2ElectronHypo_e15i_medium_passL2()), + L2EFChain_e.EFConfig('',EFTrackHypo_e15i_medium_passL2(), TrigEFElectronHypo_e15i_medium_passL2() ))), + + + L2EFChain_e_IdScanFex('e20i_medium_passL2', 303, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e20i_medium_passL2(), L2ElectronFex_IdScan(), L2ElectronHypo_e20i_medium_passL2()), + L2EFChain_e.EFConfig('',EFTrackHypo_e20i_medium_passL2(), TrigEFElectronHypo_e20i_medium_passL2() ))), + + L2EFChain_e_IdScanFex('e25i_medium_passL2', 305, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e25i_medium_passL2(), L2ElectronFex_IdScan(), L2ElectronHypo_e25i_medium_passL2()), + L2EFChain_e.EFConfig('',EFTrackHypo_e25i_medium_passL2(), TrigEFElectronHypo_e25i_medium_passL2() ))), + + L2EFChain_e_IdScanFex('e15i_medium_passEF', 21, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e15i_medium(), L2ElectronFex_IdScan(), L2ElectronHypo_e15i_medium()), + L2EFChain_e.EFConfig('',EFTrackHypo_e15i_medium_passEF(), TrigEFElectronHypo_e15i_medium_passEF() ))), + + L2EFChain_e_IdScanFex('e20_medium_passEF', 302, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e20_medium(), L2ElectronFex_IdScan(), L2ElectronHypo_e20_medium()), + L2EFChain_e.EFConfig('',EFTrackHypo_e20_medium_passEF(), TrigEFElectronHypo_e20_medium_passEF() ))), + + + L2EFChain_e_IdScanFex('e25i_medium_passEF', 306, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e25i_medium(), L2ElectronFex_IdScan(), L2ElectronHypo_e25i_medium()), + L2EFChain_e.EFConfig('',EFTrackHypo_e25i_medium_passEF(), TrigEFElectronHypo_e25i_medium_passEF() ))), + +## ################################## +## # Chains using TRTSegFinder +## ################################## + + L2EFChain_e_TRT('e5_NoCut_TRT', 486, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e5_NoCut_TRT(), L2ElectronFex_TRTSegFinder_NoCut(), L2ElectronHypo_e5_NoCut_TRT()), + L2EFChain_e.EFConfig('',EFTrackHypo_e5_NoCut_TRT(), TrigEFElectronHypo_e5_NoCut_TRT() ))), + + L2EFChain_e_TRT('e5_NoCut_TRT_cosmic', 722, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e5_NoCut_TRT(), L2ElectronFex_TRTSegFinder_NoCut(), L2ElectronHypo_e5_NoCut_TRT()), + L2EFChain_e.EFConfig('',EFTrackHypo_e5_NoCut_TRT(), TrigEFElectronHypo_e5_NoCut_TRT() ))), + + L2EFChain_e_TRT('e5_medium_TRT', 999, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e5_medium(), L2ElectronFex_TRTSegFinder(), L2ElectronHypo_e5_medium_TRT()), + L2EFChain_e.EFConfig('',EFTrackHypo_e5_medium_TRT(), TrigEFElectronHypo_e5_medium_TRT() ))), + + L2EFChain_e_TRT('e6_medium_TRT', 999, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e6_medium(), L2ElectronFex_TRTSegFinder(), L2ElectronHypo_e6_medium_TRT()), + L2EFChain_e.EFConfig('',EFTrackHypo_e6_medium_TRT(), TrigEFElectronHypo_e6_medium_TRT() ))), + + L2EFChain_e_TRT('e10_loose_TRT', 557, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e10_loose_TRT(), L2ElectronFex_TRTSegFinder(), L2ElectronHypo_e10_loose_TRT()), + L2EFChain_e.EFConfig('',EFTrackHypo_e10_loose_TRT(), TrigEFElectronHypo_e10_loose_TRT() ))), + + L2EFChain_e_TRT('e10_medium_TRT', 999, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e10_medium(), L2ElectronFex_TRTSegFinder(), L2ElectronHypo_e10_medium_TRT()), + L2EFChain_e.EFConfig('',EFTrackHypo_e10_medium_TRT(), TrigEFElectronHypo_e10_medium_TRT() ))), + + L2EFChain_e_TRT('e12_medium_TRT', 999, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e12_medium(), L2ElectronFex_TRTSegFinder(), L2ElectronHypo_e12_medium_TRT()), + L2EFChain_e.EFConfig('',EFTrackHypo_e12_medium_TRT(), TrigEFElectronHypo_e12_medium_TRT() ))), + + L2EFChain_e_TRT('e15_medium_TRT', 999, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e15_medium(), L2ElectronFex_TRTSegFinder(), L2ElectronHypo_e15_medium_TRT()), + L2EFChain_e.EFConfig('',EFTrackHypo_e15_medium_TRT(), TrigEFElectronHypo_e15_medium_TRT() ))), + + L2EFChain_e_TRT('e20_loose_TRT', 579, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e20_loose(), L2ElectronFex_TRTSegFinder(), L2ElectronHypo_e20_loose_TRT()), + L2EFChain_e.EFConfig('',EFTrackHypo_e20_loose_TRT(), TrigEFElectronHypo_e20_loose_TRT() ))), + + L2EFChain_e_TRT('e25_loose_TRT', 999, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e25_loose(), L2ElectronFex_TRTSegFinder(), L2ElectronHypo_e25_loose_TRT()), + L2EFChain_e.EFConfig('',EFTrackHypo_e25_loose_TRT(), TrigEFElectronHypo_e25_loose_TRT() ))), + + ## ################################## + ## # Chains using SiTrack + ## ################################## + + L2EFChain_e_SiTrack_robust('e5_NoCut_SiTrk', 487, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e5_NoCut_SiTrk(), L2ElectronFex_SiTrack_NoCut(), L2ElectronHypo_e5_NoCut_SiTrk()), + L2EFChain_e.EFConfig('',EFTrackHypo_e5_NoCut_SiTrk(), TrigEFElectronHypo_e5_NoCut_SiTrk() ))), + + L2EFChain_e_SiTrack_robust('e5_NoCut_SiTrk_cosmic', 720, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e5_NoCut_SiTrk(), L2ElectronFex_SiTrack_NoCut(), L2ElectronHypo_e5_NoCut_SiTrk()), + L2EFChain_e.EFConfig('',EFTrackHypo_e5_NoCut_SiTrk(), TrigEFElectronHypo_e5_NoCut_SiTrk() ))), + + L2EFChain_e_SiTrack_robust('e10_loose_SiTrk', 558, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e10_loose_SiTrk(), L2ElectronFex_SiTrack(), L2ElectronHypo_e10_loose_SiTrk()), + L2EFChain_e.EFConfig('',EFTrackHypo_e10_loose_SiTrk(), TrigEFElectronHypo_e10_loose_SiTrk() ))), + + L2EFChain_e_SiTrack_robust('e10_medium_SiTrk_robust', 580, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e10_medium_SiTrk_robust(), L2ElectronFex_SiTrack(), L2ElectronHypo_e10_medium_SiTrk_robust()), + L2EFChain_e.EFConfig('',EFTrackHypo_e10_medium_SiTrk_robust(), TrigEFElectronHypo_e10_medium_SiTrk_robust() ))), + + L2EFChain_e_SiTrack_robust('e20_loose_SiTrk_robust', 582, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e20_loose_SiTrk_robust(), L2ElectronFex_SiTrack(), L2ElectronHypo_e20_loose_SiTrk_robust()), + L2EFChain_e.EFConfig('',EFTrackHypo_e20_loose_SiTrk_robust(), TrigEFElectronHypo_e20_loose_SiTrk_robust() ))), + + + L2EFChain_e_SiTrack('e5_medium', 28, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e5_medium(), L2ElectronFex_SiTrack(), L2ElectronHypo_e5_medium()), + L2EFChain_e.EFConfig('',EFTrackHypo_e5_medium(), TrigEFElectronHypo_e5_medium() ))), + + L2EFChain_e_SiTrack('e6_medium', 474, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e6_medium(), L2ElectronFex_SiTrack(), L2ElectronHypo_e6_medium()), + L2EFChain_e.EFConfig('',EFTrackHypo_e6_medium(), TrigEFElectronHypo_e6_medium() ))), + + L2EFChain_e_SiTrack('e10_medium', 30, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e10_medium(), L2ElectronFex_SiTrack(), L2ElectronHypo_e10_medium()), + L2EFChain_e.EFConfig('',EFTrackHypo_e10_medium(), TrigEFElectronHypo_e10_medium() ))), + + L2EFChain_e_SiTrack('e12_medium', 31, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e12_medium(), L2ElectronFex_SiTrack(), L2ElectronHypo_e12_medium()), + L2EFChain_e.EFConfig('',EFTrackHypo_e12_medium(), TrigEFElectronHypo_e12_medium() ))), + + L2EFChain_e_SiTrack('e15_medium', 3, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e15_medium(), L2ElectronFex_SiTrack(), L2ElectronHypo_e15_medium()), + L2EFChain_e.EFConfig('',EFTrackHypo_e15_medium(), TrigEFElectronHypo_e15_medium() ))), + + L2EFChain_e_SiTrack('e20_loose', 7, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e20_loose(), L2ElectronFex_SiTrack(), L2ElectronHypo_e20_loose()), + L2EFChain_e.EFConfig('',EFTrackHypo_e20_loose(), TrigEFElectronHypo_e20_loose() ))), + + L2EFChain_e_SiTrack('e20_medium', 297, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e20_medium(), L2ElectronFex_SiTrack(), L2ElectronHypo_e20_medium()), + L2EFChain_e.EFConfig('',EFTrackHypo_e20_medium(), TrigEFElectronHypo_e20_medium() ))), + + L2EFChain_e_SiTrack('e25_loose', 32, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e25_loose(), L2ElectronFex_SiTrack(), L2ElectronHypo_e25_loose()), + L2EFChain_e.EFConfig('',EFTrackHypo_e25_loose(), TrigEFElectronHypo_e25_loose() ))), + + L2EFChain_e_SiTrack('e10_medium_SiTrk', 581, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e10_medium_SiTrk(), L2ElectronFex_SiTrack(), L2ElectronHypo_e10_medium_SiTrk()), + L2EFChain_e.EFConfig('',EFTrackHypo_e10_medium_SiTrk(), TrigEFElectronHypo_e10_medium_SiTrk() ))), + + L2EFChain_e_SiTrack('e20_loose_SiTrk', 583, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e20_loose_SiTrk(), L2ElectronFex_SiTrack(), L2ElectronHypo_e20_loose_SiTrk()), + L2EFChain_e.EFConfig('',EFTrackHypo_e20_loose_SiTrk(), TrigEFElectronHypo_e20_loose_SiTrk() ))), + + ##################################################### + # Same Chains, with L2 and EF Hypos set to Accept All + ##################################################### + + L2EFChain_e_SiTrack('e15_medium_passL2', 16, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e15_medium_passL2(), L2ElectronFex_SiTrack(), L2ElectronHypo_e15_medium_passL2()), + L2EFChain_e.EFConfig('',EFTrackHypo_e15_medium_passL2(), TrigEFElectronHypo_e15_medium_passL2() ))), + + L2EFChain_e_SiTrack('e15_medium_passEF', 17, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e15_medium(), L2ElectronFex_SiTrack(), L2ElectronHypo_e15_medium()), + L2EFChain_e.EFConfig('',EFTrackHypo_e15_medium_passEF(), TrigEFElectronHypo_e15_medium_passEF() ))), + + L2EFChain_e_SiTrack('e20_loose_passL2', 22, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e20_loose_passL2(), L2ElectronFex_SiTrack(), L2ElectronHypo_e20_loose_passL2()), + L2EFChain_e.EFConfig('',EFTrackHypo_e20_loose_passL2(), TrigEFElectronHypo_e20_loose_passL2() ))), + + L2EFChain_e_SiTrack('e20_loose_passEF', 23, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e20_loose(), L2ElectronFex_SiTrack(), L2ElectronHypo_e20_loose()), + L2EFChain_e.EFConfig('',EFTrackHypo_e20_loose_passEF(), TrigEFElectronHypo_e20_loose_passEF() ))), + + L2EFChain_e_SiTrack('e20_medium_passL2', 301, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e20_medium_passL2(), L2ElectronFex_SiTrack(), L2ElectronHypo_e20_medium_passL2()), + L2EFChain_e.EFConfig('',EFTrackHypo_e20_medium_passL2(), TrigEFElectronHypo_e20_medium_passL2() ))), + + L2EFChain_e_SiTrack('e20i_medium_passEF', 304, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e20i_medium(), L2ElectronFex_SiTrack(), L2ElectronHypo_e20i_medium()), + L2EFChain_e.EFConfig('',EFTrackHypo_e20i_medium_passEF(), TrigEFElectronHypo_e20i_medium_passEF() ))), + + + ## ################################## + ## # Chains using Forward then Back Tracking + ## ################################## + + L2EFChain_e_fwdBackTrk('e5_NoCut_FwdBackTrk', 488, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e5_NoCut_FwdBackTrk(), L2ElectronFex_FwdBackTracking_NoCut(), L2ElectronHypo_e5_NoCut_FwdBackTrk()), + L2EFChain_e.EFConfig('',EFTrackHypo_e5_NoCut_FwdBackTrk(), TrigEFElectronHypo_e5_NoCut_FwdBackTrk() ))), + + L2EFChain_e_fwdBackTrk('e5_NoCut_FwdBackTrk_cosmic', 723, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e5_NoCut_FwdBackTrk(), L2ElectronFex_FwdBackTracking_NoCut(), L2ElectronHypo_e5_NoCut_FwdBackTrk()), + L2EFChain_e.EFConfig('',EFTrackHypo_e5_NoCut_FwdBackTrk(), TrigEFElectronHypo_e5_NoCut_FwdBackTrk() ))), + + L2EFChain_e_fwdBackTrk('e10_loose_FwdBackTrk', 559, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e10_loose_FwdBackTrk(), L2ElectronFex_FwdBackTracking(), L2ElectronHypo_e10_loose_FwdBackTrk()), + L2EFChain_e.EFConfig('',EFTrackHypo_e10_loose_FwdBackTrk(), TrigEFElectronHypo_e10_loose_FwdBackTrk() ))), + + ## ########################################### + ## # Chains using No track info in hypo algos + ## ########################################## + + L2EFChain_e_fwdBackTrk('e20_loose_NoIDTrkCut', 997, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e20_loose_NoTrk(), L2ElectronFex_all_NoCut(), L2ElectronHypo_e20_loose_NoTrk()), + L2EFChain_e.EFConfig('',EFTrackHypo_e20_loose_NoTrk(), TrigEFElectronHypo_e20_loose_NoTrk() ))), + + ## ################################## + ## # Chains with "NoCut" + ## ################################## + + L2EFChain_e_nocut('eNoCut', 275, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_1(), L2ElectronFex_1(), L2ElectronHypo_1()), + L2EFChain_e.EFConfig('',EFTrackHypo_1(), TrigEFElectronHypo_1() ))), + + ## ################################## + ## # Chains with Ringer Algorithm + ## ################################## + + L2EFChain_e_Ringer('e5_NoCut_Ringer', 290, + L2EFChain_e.Config( L2EFChain_e_Ringer.L2Config('',TrigRingerNeuralFexConfig_e5(),TrigRingerNeuralHypoConfig_e5(), L2ElectronFex_all_Ringer_NoCut(), L2ElectronHypo_e5_NoCut_Ringer()), + L2EFChain_e.EFConfig('',EFTrackHypo_e5_NoCut_Ringer(), TrigEFElectronHypo_e5_NoCut_Ringer() ))), + + L2EFChain_e_Ringer('e5_NoCut_Ringer_cosmic', 291, + L2EFChain_e.Config( L2EFChain_e_Ringer.L2Config('',TrigRingerNeuralFexConfig_e5(),TrigRingerNeuralHypoConfig_e5(), L2ElectronFex_all_Ringer_NoCut(), L2ElectronHypo_e5_NoCut_Ringer()), + L2EFChain_e.EFConfig('',EFTrackHypo_e5_NoCut_Ringer(), TrigEFElectronHypo_e5_NoCut_Ringer() ))), + + L2EFChain_e_Ringer('e5_medium_Ringer', 991, + L2EFChain_e.Config( L2EFChain_e_Ringer.L2Config('',TrigRingerNeuralFexConfig_e5(),TrigRingerNeuralHypoConfig_e5(), L2ElectronFex_Ringer(), L2ElectronHypo_e5_medium_Ringer()), + L2EFChain_e.EFConfig('',EFTrackHypo_e5_medium_Ringer(), TrigEFElectronHypo_e5_medium_Ringer() ))), + + L2EFChain_e_Ringer('e10_medium_Ringer', 286, + L2EFChain_e.Config( L2EFChain_e_Ringer.L2Config('',TrigRingerNeuralFexConfig_e10(),TrigRingerNeuralHypoConfig_e10(), L2ElectronFex_Ringer(), L2ElectronHypo_e10_medium_Ringer()), + L2EFChain_e.EFConfig('',EFTrackHypo_e10_medium_Ringer(), TrigEFElectronHypo_e10_medium_Ringer() ))), + + ## ################################################ + ## # Chains with Sliding window cluster finder @ L2 + ## ############################################### + + L2EFChain_e_L2SW_NoCut('e5_NoCut_L2SW', 514, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e5_NoCut_L2SW(), L2ElectronFex_all_L2SW_NoCut(), L2ElectronHypo_e5_NoCut_L2SW()), + L2EFChain_e.EFConfig('',EFTrackHypo_e5_NoCut_L2SW(), TrigEFElectronHypo_e5_NoCut_L2SW() ))), + + L2EFChain_e_L2SW_NoCut('e5_NoCut_L2SW_cosmic', 724, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e5_NoCut_L2SW(), L2ElectronFex_all_L2SW_NoCut(), L2ElectronHypo_e5_NoCut_L2SW()), + L2EFChain_e.EFConfig('',EFTrackHypo_e5_NoCut_L2SW(), TrigEFElectronHypo_e5_NoCut_L2SW() ))), + + L2EFChain_e_L2SW('e5_medium_L2SW', 800, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e5_medium_L2SW(), L2ElectronFex_all_L2SW(), L2ElectronHypo_e5_medium_L2SW()), + L2EFChain_e.EFConfig('',EFTrackHypo_e5_medium_L2SW(), TrigEFElectronHypo_e5_medium_L2SW() ))), + + L2EFChain_e_L2SW('e10_medium_L2SW', 801, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e10_medium_L2SW(), L2ElectronFex_all_L2SW(), L2ElectronHypo_e10_medium_L2SW()), + L2EFChain_e.EFConfig('',EFTrackHypo_e10_medium_L2SW(), TrigEFElectronHypo_e10_medium_L2SW() ))), + + L2EFChain_e_L2SW('e20_loose_L2SW', 802, + L2EFChain_e.Config( L2EFChain_e.L2Config('',L2CaloHypo_e20_loose_L2SW(), L2ElectronFex_all_L2SW(), L2ElectronHypo_e20_loose_L2SW()), + L2EFChain_e.EFConfig('',EFTrackHypo_e20_loose_L2SW(), TrigEFElectronHypo_e20_loose_L2SW() ))), +] + +########################################################################################## +# +# Helper class for writing python code, eg HLT to L1 maps +# +########################################################################################## +class ElectronCodeHelper: + def __init__(self): + print 'Running ElectronCodeHelper:' + + global Electrons + + iwidth = int(0) + for echain in Electrons: + if iwidth < len(echain.l2chain.sig_id): + iwidth = len(echain.l2chain.sig_id) + + print 'Printing chain to item map:' + for echain in Electrons: + l2name = '\''+echain.l2chain.sig_id.rstrip()+'\'' + l1name = '\''+echain.l2chain.lower_chain_name.rstrip()+'\'' + lempty = '' + for istep in range(len(echain.l2chain.sig_id), iwidth): + lempty += ' ' + + print l2name+lempty+':'+l1name+',' + + print 'Printing item to theshold map:' + l1map = {} + for echain in Electrons: + if echain.l2chain.lower_chain_name not in l1map: + l1map[echain.l2chain.lower_chain_name] = echain.l2chain.inputTEs + print '\''+echain.l2chain.lower_chain_name+'\':',echain.l2chain.inputTEs,'\',' + + print 'Comparing L2 and EF counters:' + l1map = {} + for echain in Electrons: + if echain.l2chain.chain_counter != echain.efchain.chain_counter: + print echain.l2chain.sig_id+':',echain.l2chain.chain_counter,'!=',echain.efchain.chain_counter + + print 'Comparing L2 and EF names:' + l1map = {} + for echain in Electrons: + if echain.l2chain.chain_name != 'L2_'+echain.sig_id: + print echain.l2chain.sig_id+':',echain.l2chain.chain_name + if echain.efchain.chain_name != 'EF_'+echain.sig_id: + print echain.efchain.sig_id+':',echain.efchain.chain_name diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/PhotonDef.temp.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/PhotonDef.temp.py new file mode 100755 index 00000000000..9c6898efd69 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/PhotonDef.temp.py @@ -0,0 +1,350 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +""" Photon trigger slice signatures """ + +__author__ = 'Vu Anh Tuan, P. Urquijo' +__version__="" +__doc__="Implementation of Photon Slice single photon signatures" + +from string import atoi +from AthenaCommon.Logging import logging + +from TriggerJobOpts.TriggerFlags import TriggerFlags +from TriggerMenuPython.TriggerPythonConfig import * +from TriggerMenuPython.HltConfig import * + +if TriggerFlags.doLVL2() or True: + if TriggerFlags.doCalo or True: + from TrigT2CaloEgamma.TrigT2CaloEgammaConfig import T2CaloEgamma_eGamma + theT2CaloEgamma_eGamma = T2CaloEgamma_eGamma() + + from TrigEgammaHypo.TrigL2CaloHypoConfig import * + from TrigEgammaHypo.TrigL2PhotonFexConfig import * + from TrigEgammaHypo.TrigL2PhotonHypoConfig import * + from TrigDetCalib.TrigDetCalibConfig import * + theLArL2ROBListWriter = LArL2ROBListWriter() + + +if TriggerFlags.doEF() or True: + if TriggerFlags.doCalo or True: + from TrigCaloRec.TrigCaloRecConfig import TrigCaloCellMaker_eGamma, TrigCaloTowerMaker_eGamma, TrigCaloClusterMaker_slw + theTrigCaloCellMaker_eGamma = TrigCaloCellMaker_eGamma() + theTrigCaloTowerMaker_eGamma = TrigCaloTowerMaker_eGamma() + theTrigCaloClusterMaker_slw = TrigCaloClusterMaker_slw() + + if TriggerFlags.doID or True: + from InDetTrigRecExample.EFInDetConfig import * + + from TrigEgammaRec.TrigEgammaRecConfig import * + theTrigEgammaRec_PhotonConversions = TrigEgammaRec_PhotonConversions() + theTrigEgammaRec_NoIDEF_eGamma = TrigEgammaRec_NoIDEF_eGamma() + theTrigEFIDCombined_Photon = TrigEFIDCombined_Photon().getSequence() + + from TrigEgammaHypo.TrigEFPhotonHypoConfig import * + +################## +# +# L2 & EF Chain configuration +# +################## + +# default class, no ID at EF level + +#----------------------------------- +class L2EFChain_g(L2EFChainDef): +#----------------------------------- + + class L2Config: + def __init__(self, suffix, + TrigL2CaloHypo_1=None, TrigL2PhotonFex_1=None, TrigL2PhotonHypo_1=None): + self.suffix = suffix + self.TrigL2CaloHypo_1 = TrigL2CaloHypo_1 or TrigL2CaloHypo('TrigL2CaloHypo_'+suffix) + self.TrigL2PhotonFex_1 = TrigL2PhotonFex_1 or TrigL2PhotonFex('TrigL2PhotonFex_' + suffix) + self.TrigL2PhotonHypo_1 = TrigL2PhotonHypo_1 or TrigL2PhotonHypo('TrigL2PhotonHypo_' + suffix) + pass + + class EFConfig: + def __init__(self, suffix, TrigEFPhotonHypo_1=None): + self.suffix = suffix + self.TrigEFPhotonHypo_1 = TrigEFPhotonHypo_1 or TrigEFPhotonHypo('EFPhotonHypo_' + suffix) + pass + + class Config: + def __init__(self, l2config, efconfig): + self.suffix = '' + self.L2Config = l2config + self.EFConfig = efconfig + pass + + def __init__(self, sig_id, + l2_chain_name, l2_chain_counter, l2_lower_chain_name, + ef_chain_name, ef_chain_counter, + l2_inputTEs, config): + L2EFChainDef.__init__(self, sig_id, + l2_chain_name, l2_chain_counter, l2_lower_chain_name, + ef_chain_name, ef_chain_counter, + l2_inputTEs, config) + + def defineSequences(self, config): + ###### L2 ###### + # Step 1: Calo Hypo + self.addL2Sequence(self.inputTEs, + [theT2CaloEgamma_eGamma, config.L2Config.TrigL2CaloHypo_1], + 'L2_g_step1') + + # Step 2: Photon Fex and Hypo + self.addL2Sequence('L2_g_step1', + [config.L2Config.TrigL2PhotonFex_1, config.L2Config.TrigL2PhotonHypo_1], + 'L2_g_step2') + + ###### EF ###### + # Step 1: Calo cluster + self.addEFSequence('L2_g_step2', + [theTrigCaloCellMaker_eGamma, theTrigCaloTowerMaker_eGamma, theTrigCaloClusterMaker_slw], + 'EF_g_step1') + + # Step 3: Calo cluster and Hypo + self.addEFSequence('EF_g_step1', + [theTrigEgammaRec_NoIDEF_eGamma, config.EFConfig.TrigEFPhotonHypo_1], + 'EF_g_step2') + + def defineSignatures(self): + self.addL2Signature(['L2_g_step1']) + self.addL2Signature(['L2_g_step2']) + self.addEFSignature(['EF_g_step1']) + self.addEFSignature(['EF_g_step2']) + + def defineStreamGroupTriggerType(self): + self.physics_streams = ['egamma'] + self.calib_streams = [] + self.groups = ['Exclusive_Photons', 'Inclusive_Photons'] + self.trigger_type = [] + + def defineTErenaming(self): + self.TErenamingMap = { + 'L2_g_step1': mergeRemovingOverlap('L2_', self.sig_id+'_calo'), + 'L2_g_step2': mergeRemovingOverlap('L2_', self.sig_id), + 'EF_g_step1': mergeRemovingOverlap('EF_', self.sig_id+'_calo'), + 'EF_g_step2': mergeRemovingOverlap('EF_', self.sig_id), + } + + +# derived class, ID algos run at EF level + +#----------------------------------- +class L2EFChain_g_EFID(L2EFChain_g): +#----------------------------------- + + def defineSequences(self, config): + ###### L2 ###### + # Step 1: Calo Hypo + self.addL2Sequence(self.inputTEs, + [theT2CaloEgamma_eGamma, config.L2Config.TrigL2CaloHypo_1], + 'L2_g_step1') + + # Step 2: Photon Fex and Hypo + self.addL2Sequence('L2_g_step1', + [config.L2Config.TrigL2PhotonFex_1, config.L2Config.TrigL2PhotonHypo_1], + 'L2_g_step2') + + ###### EF ###### + # Step 1: Calo cluster + self.addEFSequence('L2_g_step2', + [theTrigCaloCellMaker_eGamma, theTrigCaloTowerMaker_eGamma, theTrigCaloClusterMaker_slw], + 'EF_g_step1') + + # Step 2: ID + self.addEFSequence('EF_g_step1', + theTrigEFIDCombined_Photon, + 'EF_g_step2') + + # Step 3: Calo cluster and Hypo + self.addEFSequence('EF_g_step2', + [theTrigEgammaRec_PhotonConversions, config.EFConfig.TrigEFPhotonHypo_1], + 'EF_g_step3') + + def defineSignatures(self): + self.addL2Signature(['L2_g_step1']) + self.addL2Signature(['L2_g_step2']) + self.addEFSignature(['EF_g_step1']) + self.addEFSignature(['EF_g_step2']) + self.addEFSignature(['EF_g_step3']) + + def defineTErenaming(self): + self.TErenamingMap = { + 'L2_g_step1': mergeRemovingOverlap('L2_', self.sig_id+'_calo'), + 'L2_g_step2': mergeRemovingOverlap('L2_', self.sig_id), + 'EF_g_step1': mergeRemovingOverlap('EF_', self.sig_id+'_calo'), + 'EF_g_step2': mergeRemovingOverlap('EF_', self.sig_id+'_id'), + 'EF_g_step3': mergeRemovingOverlap('EF_', self.sig_id), + } + + +# derived class, ID algos run at EF level and L2 calorimeter calibration + +#----------------------------------- +class L2EFChain_g_L2calib(L2EFChain_g): +#----------------------------------- + + def defineSequences(self, config): + ###### L2 ###### + # Step 1: Calo Hypo + self.addL2Sequence(self.inputTEs, + [theT2CaloEgamma_eGamma, config.L2Config.TrigL2CaloHypo_1], + 'L2_g_step1') + + # Step 2: Photon Fex and Hypo + self.addL2Sequence('L2_g_step1', + [config.L2Config.TrigL2PhotonFex_1, config.L2Config.TrigL2PhotonHypo_1], + 'L2_g_step2') + + # Step 3: Calo calibration + self.addL2Sequence('L2_g_step2', + [theLArL2ROBListWriter], + 'L2_g_step3') + + ###### EF ###### + # Step 1: Calo cluster + self.addEFSequence('L2_g_step3', + [theTrigCaloCellMaker_eGamma, theTrigCaloTowerMaker_eGamma, theTrigCaloClusterMaker_slw], + 'EF_g_step1') + + # Step 2: e/gamma reconstruction and Hypo + self.addEFSequence('EF_g_step1', + [theTrigEgammaRec_NoIDEF_eGamma, config.EFConfig.TrigEFPhotonHypo_1], + 'EF_g_step2') + + def defineStreamGroupTriggerType(self): + self.physics_streams = [] + self.calib_streams = [] + self.L2physics_streams = ['egamma'] + self.L2calib_streams = [] + self.EFphysics_streams = [] + self.EFcalib_streams = ['LArCells'] + self.groups = ['Exclusive_Photons', 'Inclusive_Photons'] + self.trigger_type = [] + + def defineTErenaming(self): + self.TErenamingMap = { + 'L2_g_step1': mergeRemovingOverlap('L2_', self.sig_id+'_calo'), + 'L2_g_step2': mergeRemovingOverlap('L2_', self.sig_id), + 'L2_g_step3': mergeRemovingOverlap('L2_', self.sig_id+'_calib'), + 'EF_g_step1': mergeRemovingOverlap('EF_', self.sig_id+'_calo'), + 'EF_g_step2': mergeRemovingOverlap('EF_', self.sig_id), + } + + + +Photons = [ + L2EFChain_g('g3_nocut', 'L2_g3_nocut', 609, 'L1_EM3', 'EF_g53nocut', 609, ['EM3'], + L2EFChain_g.Config(L2EFChain_g.L2Config('', L2CaloHypo_g4(), L2PhotonFex_1(), L2PhotonHypo_g3_nocut()), + L2EFChain_g.EFConfig('', EFPhotonHypo_g3_nocut()))), + + L2EFChain_g('g5_nocut', 'L2_g5_nocut', 572, 'L1_EM3', 'EF_g5_nocut', 572, ['EM3'], + L2EFChain_g.Config(L2EFChain_g.L2Config('', L2CaloHypo_g4(), L2PhotonFex_1(), L2PhotonHypo_g5_nocut()), + L2EFChain_g.EFConfig('', EFPhotonHypo_g5_nocut()))), + + L2EFChain_g('g5_nocut_cosmic', 'L2_g5_nocut_cosmic', 729, 'L1_EM3_EMPTY', 'EF_g5_nocut_cosmic', 729, ['EM3'], + L2EFChain_g.Config(L2EFChain_g.L2Config('', L2CaloHypo_g4(), L2PhotonFex_1(), L2PhotonHypo_g5_nocut()), + L2EFChain_g.EFConfig('', EFPhotonHypo_g5_nocut()))), + + L2EFChain_g('g10_nocut', 'L2_g10_nocut', 994, 'L1_EM7', 'EF_g10_nocut', 994, ['EM7'], + L2EFChain_g.Config(L2EFChain_g.L2Config('', L2CaloHypo_g7(), L2PhotonFex_1(), L2PhotonHypo_g10_nocut()), + L2EFChain_g.EFConfig('', EFPhotonHypo_g10_nocut()))), + + L2EFChain_g('g5', 'L2_g5', 577, 'L1_EM3', 'EF_g5', 577, ['EM3'], + L2EFChain_g.Config(L2EFChain_g.L2Config('', L2CaloHypo_g4(), L2PhotonFex_1(), L2PhotonHypo_g5()), + L2EFChain_g.EFConfig('', EFPhotonHypo_g5()))), + + L2EFChain_g('g10_loose', 'L2_g10_loose', 36, 'L1_EM7', 'EF_g10_loose', 36, ['EM7'], + L2EFChain_g.Config(L2EFChain_g.L2Config('', L2CaloHypo_g7(), L2PhotonFex_1(), L2PhotonHypo_g10_loose()), + L2EFChain_g.EFConfig('', EFPhotonHypo_g10_loose()))), # validated + + L2EFChain_g('g10_loose_cosmic', 'L2_g10_loose_cosmic', 731, 'L1_EM7_EMPTY', 'EF_g10_loose_cosmic', 731, ['EM7'], + L2EFChain_g.Config(L2EFChain_g.L2Config('', L2CaloHypo_g7(), L2PhotonFex_1(), L2PhotonHypo_g10_loose()), + L2EFChain_g.EFConfig('', EFPhotonHypo_g10_loose()))), + + L2EFChain_g('g15_loose', 'L2_g15_loose', 37, 'L1_EM13', 'EF_g15_loose', 37, ['EM13'], + L2EFChain_g.Config(L2EFChain_g.L2Config('', L2CaloHypo_g7(), L2PhotonFex_1(), L2PhotonHypo_g15_loose()), + L2EFChain_g.EFConfig('', EFPhotonHypo_g15_loose()))), # validated + + L2EFChain_g('g15i_loose', 'L2_g15i_loose', 38, 'L1_EM13I', 'EF_g15i_loose', 38, ['EM13I'], + L2EFChain_g.Config(L2EFChain_g.L2Config('', L2CaloHypo_g7(), L2PhotonFex_1(), L2PhotonHypo_g15i_loose()), + L2EFChain_g.EFConfig('', EFPhotonHypo_g15i_loose()))), # validated + + L2EFChain_g('g17i_tight', 'L2_g17i_tight', 34, 'L1_EM13I', 'EF_g17i_tight', 34, ['EM13I'], + L2EFChain_g.Config(L2EFChain_g.L2Config('', L2CaloHypo_g7(), L2PhotonFex_1(), L2PhotonHypo_g17i_tight()), + L2EFChain_g.EFConfig('', EFPhotonHypo_g17i_tight()))), + + L2EFChain_g('g20_loose', 'L2_g20_loose', 39, 'L1_EM18', 'EF_g20_loose', 39, ['EM18'], + L2EFChain_g.Config(L2EFChain_g.L2Config('', L2CaloHypo_g7(), L2PhotonFex_1(), L2PhotonHypo_g20_loose()), + L2EFChain_g.EFConfig('', EFPhotonHypo_g20_loose()))), # validated + + L2EFChain_g('g20i_loose', 'L2_g20i_loose', 40, 'L1_EM18I', 'EF_g20i_loose', 40, ['EM18I'], + L2EFChain_g.Config(L2EFChain_g.L2Config('', L2CaloHypo_g7(), L2PhotonFex_1(), L2PhotonHypo_g20i_loose()), + L2EFChain_g.EFConfig('', EFPhotonHypo_g20i_loose()))), # validated + + L2EFChain_g('g25_loose', 'L2_g25_loose', 42, 'L1_EM18', 'EF_g25_loose', 42, ['EM18'], + L2EFChain_g.Config(L2EFChain_g.L2Config('', L2CaloHypo_g7(), L2PhotonFex_1(), L2PhotonHypo_g25_loose()), + L2EFChain_g.EFConfig('', EFPhotonHypo_g25_loose()))), # validated + + L2EFChain_g('g25i_loose', 'L2_g25i_loose', 41, 'L1_EM18I', 'EF_g25i_loose', 41, ['EM18I'], + L2EFChain_g.Config(L2EFChain_g.L2Config('', L2CaloHypo_g7(), L2PhotonFex_1(), L2PhotonHypo_g25i_loose()), + L2EFChain_g.EFConfig('', EFPhotonHypo_g25i_loose()))), # validated + + L2EFChain_g('g25_tight', 'L2_g25_tight', 294, 'L1_EM18', 'EF_g25_tight', 294, ['EM18'], + L2EFChain_g.Config(L2EFChain_g.L2Config('', L2CaloHypo_g7(), L2PhotonFex_1(), L2PhotonHypo_g25_tight()), + L2EFChain_g.EFConfig('', EFPhotonHypo_g25_tight()))), # validated + + L2EFChain_g('g25i_tight', 'L2_g25i_tight', 293, 'L1_EM18I', 'EF_g25i_tight', 293, ['EM18I'], + L2EFChain_g.Config(L2EFChain_g.L2Config('', L2CaloHypo_g7(), L2PhotonFex_1(), L2PhotonHypo_g25i_tight()), + L2EFChain_g.EFConfig('', EFPhotonHypo_g25i_tight()))), # validated + + + L2EFChain_g('g40_medium', 'L2_g40_medium', 993, 'L1_EM18', 'EF_g40_medium', 993, ['EM18'], + L2EFChain_g.Config(L2EFChain_g.L2Config('', L2CaloHypo_g7(), L2PhotonFex_1(), L2PhotonHypo_g40_medium()), + L2EFChain_g.EFConfig('', EFPhotonHypo_g40_medium()))), + + + L2EFChain_g('g55_tight', 'L2_g55_tight', 35, 'L1_EM18', 'EF_g55_tight', 35, ['EM18'], + L2EFChain_g.Config(L2EFChain_g.L2Config('', L2CaloHypo_g7(), L2PhotonFex_1(), L2PhotonHypo_g55_tight()), + L2EFChain_g.EFConfig('', EFPhotonHypo_g55_tight()))), # validated + + L2EFChain_g('g105', 'L2_g105', 43, 'L1_EM100', 'EF_g105', 43, ['EM100'], + L2EFChain_g.Config(L2EFChain_g.L2Config('', L2CaloHypo_g7(), L2PhotonFex_1(), L2PhotonHypo_g105()), + L2EFChain_g.EFConfig('', EFPhotonHypo_g105()))), # validated + + L2EFChain_g('g150', 'L2_g150', 295, 'L1_EM100', 'EF_g150', 295, ['EM100'], + L2EFChain_g.Config(L2EFChain_g.L2Config('', L2CaloHypo_g7(), L2PhotonFex_1(), L2PhotonHypo_g150()), + L2EFChain_g.EFConfig('', EFPhotonHypo_g150()))), # validated + + ## ###################################################### + ## # Chains with photon conversion reconstruction at EF + ## ###################################################### + + L2EFChain_g_EFID('g20_loose_cnv', 'L2_g20_loose_cnv', 999, 'L1_EM18', 'EF_g20_loose_cnv', 999, ['EM18'], + L2EFChain_g.Config(L2EFChain_g.L2Config('', L2CaloHypo_g7(), L2PhotonFex_1(), L2PhotonHypo_g20_loose()), + L2EFChain_g.EFConfig('', EFPhotonHypo_g20_loose_cnv()))), # validated + + +# ## ################################## +# ## # L2LAr Calibration chains +# ## ################################## +# +# +# L2EFChain_g_L2calib('g10_calib', 'L2_g10_calib', 500, 'L1_EM7', 'EF_g10_calib', 500, ['EM7'], +# L2EFChain_g.Config(L2EFChain_g.L2Config('', L2CaloHypo_g7(), L2PhotonFex_1(), L2PhotonHypo_g10_calib()), +# L2EFChain_g.EFConfig('', EFPhotonHypo_g10_calib()))), # validated +# +# L2EFChain_g_L2calib('g20i_calib', 'L2_g20i_calib', 501, 'L1_EM18I', 'EF_g20i_calib', 501, ['EM18I'], +# L2EFChain_g.Config(L2EFChain_g.L2Config('', L2CaloHypo_g7(), L2PhotonFex_1(), L2PhotonHypo_g20i_calib()), +# L2EFChain_g.EFConfig('', EFPhotonHypo_g20i_calib()))), # validated +# +# L2EFChain_g_L2calib('g25i_calib', 'L2_g25i_calib', 502, 'L1_EM18I', 'EF_g25i_calib', 502, ['EM18I'], +# L2EFChain_g.Config(L2EFChain_g.L2Config('', L2CaloHypo_g7(), L2PhotonFex_1(), L2PhotonHypo_g25i_calib()), +# L2EFChain_g.EFConfig('', EFPhotonHypo_g25i_calib()))), # validated +# + ]#end of Photons chain + + + diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFDielectronMassHypoConfig.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFDielectronMassHypoConfig.py new file mode 100755 index 00000000000..267615dc49d --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFDielectronMassHypoConfig.py @@ -0,0 +1,149 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +from TrigEgammaHypo.TrigEgammaHypoConf import TrigEFDielectronMassFex, TrigEFDielectronMassHypo +from AthenaCommon.SystemOfUnits import GeV +from TrigEgammaHypo.TrigEFDielectronMassHypoMonitoring import * + +class TrigEFDielectronMassFex_Zee ( TrigEFDielectronMassFex ): + __slots__ = [] + def __init__(self, name="TrigEFDielectronMassFex_Zee"): + super(TrigEFDielectronMassFex_Zee, self).__init__(name) + + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll=False + + # require invariant mass within window + self.LowerMassCut=40.0*GeV + self.UpperMassCut=200.0*GeV + + self.AthenaMonTools = [ TrigEFDielectronMassOnlineMonitoring(), TrigEFDielectronMassValidationMonitoring_Zee() ] + +class TrigEFDielectronMassHypo_Zee ( TrigEFDielectronMassHypo ): + __slots__ = [] + def __init__(self, name="TrigEFDielectronMassHypo_Zee"): + super(TrigEFDielectronMassHypo_Zee, self).__init__(name) + + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll=False + + # require invariant mass within window + self.LowerMassCut=45.0*GeV + self.UpperMassCut=180.0*GeV + + self.AthenaMonTools = [ TrigEFDielectronMassOnlineMonitoring(), TrigEFDielectronMassValidationMonitoring_Zee() ] + +class TrigEFDielectronMassHypo_Zee2 ( TrigEFDielectronMassHypo ): + __slots__ = [] + def __init__(self, name="TrigEFDielectronMassHypo_Zee2"): + super(TrigEFDielectronMassHypo_Zee2, self).__init__(name) + + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll=False + self.useElectronElectron = True + self.useElectronCluster = False + + # require invariant mass within window + self.LowerMassCut=40.0*GeV + self.UpperMassCut=130.0*GeV + + self.AthenaMonTools = [ TrigEFDielectronMassOnlineMonitoring(), TrigEFDielectronMassValidationMonitoring_Zee() ] + +class TrigEFDielectronMassFex_Jpsi ( TrigEFDielectronMassFex ): + __slots__ = [] + def __init__(self, name="TrigEFDielectronMassFex_Jpsi"): + super(TrigEFDielectronMassFex_Jpsi, self).__init__(name) + + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll=False + self.useElectronElectron = True + self.useElectronCluster = True + + # require invariant mass within window + self.LowerMassCut=0.5*GeV + self.UpperMassCut=15.0*GeV + + self.AthenaMonTools = [ TrigEFDielectronMassOnlineMonitoring(), TrigEFDielectronMassValidationMonitoring_Jpsi() ] + +class TrigEFDielectronMassHypo_Jpsi ( TrigEFDielectronMassHypo ): + __slots__ = [] + def __init__(self, name="TrigEFDielectronMassHypo_Jpsi"): + super(TrigEFDielectronMassHypo_Jpsi, self).__init__(name) + + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll=False + self.useElectronElectron = True + self.useElectronCluster = True + + # require invariant mass within window + #self.LowerMassCut=1.0*GeV + #self.UpperMassCut=5.0*GeV + # Use Looser cuts for now + self.LowerMassCut=1.0*GeV + self.UpperMassCut=5.0*GeV + self.LowerMassElectronClusterCut=1.0*GeV + self.UpperMassElectronClusterCut=6.0*GeV + + self.AthenaMonTools = [ TrigEFDielectronMassOnlineMonitoring(), TrigEFDielectronMassValidationMonitoring_Jpsi() ] + +class TrigEFDielectronMassFex_Upsi ( TrigEFDielectronMassFex ): + __slots__ = [] + def __init__(self, name="TrigEFDielectronMassFex_Upsi"): + super(TrigEFDielectronMassFex_Upsi, self).__init__(name) + + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll=False + self.useElectronElectron = False + self.useElectronCluster = True + + # require invariant mass within window + self.LowerMassCut=1.0*GeV + self.UpperMassCut=30.0*GeV + + self.AthenaMonTools = [ TrigEFDielectronMassOnlineMonitoring(), TrigEFDielectronMassValidationMonitoring_Upsi() ] + +class TrigEFDielectronMassHypo_Upsi ( TrigEFDielectronMassHypo ): + __slots__ = [] + def __init__(self, name="TrigEFDielectronMassHypo_Upsi"): + super(TrigEFDielectronMassHypo_Upsi, self).__init__(name) + + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll=False + self.useElectronElectron = False + self.useElectronCluster = True + + # require invariant mass within window + self.LowerMassElectronClusterCut=6.0*GeV + self.UpperMassElectronClusterCut=20.0*GeV + + self.AthenaMonTools = [ TrigEFDielectronMassOnlineMonitoring(), TrigEFDielectronMassValidationMonitoring_Upsi() ] + +#-------------------------------------------------------------- +# DC14 +#-------------------------------------------------------------- +class TrigEFDielectronMassFex_Zeg ( TrigEFDielectronMassFex ): + __slots__ = [] + def __init__(self, name="TrigEFDielectronMassFex_Zeg"): + super(TrigEFDielectronMassFex_Zeg, self).__init__(name) + + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll=False + + # require invariant mass within window + self.LowerMassCut=55.0*GeV + self.UpperMassCut=100000.0*GeV + + self.AthenaMonTools = [ TrigEFDielectronMassOnlineMonitoring(), TrigEFDielectronMassValidationMonitoring_Zee() ] + +class TrigEFDielectronMassHypo_Zeg ( TrigEFDielectronMassHypo ): + __slots__ = [] + def __init__(self, name="TrigEFDielectronMassHypo_Zeg"): + super(TrigEFDielectronMassHypo_Zeg, self).__init__(name) + + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll=False + + # require invariant mass within window + self.LowerMassCut=55.0*GeV + self.UpperMassCut=100000.0*GeV + + self.AthenaMonTools = [ TrigEFDielectronMassOnlineMonitoring(), TrigEFDielectronMassValidationMonitoring_Zee() ] diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFDielectronMassHypoMonitoring.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFDielectronMassHypoMonitoring.py new file mode 100755 index 00000000000..9e23939137c --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFDielectronMassHypoMonitoring.py @@ -0,0 +1,70 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +from TrigMonitorBase.TrigGenericMonitoringToolConfig import defineHistogram, TrigGenericMonitoringToolConfig +from AthenaCommon.SystemOfUnits import GeV + +class TrigEFDielectronMassOnlineMonitoring(TrigGenericMonitoringToolConfig): + def __init__ (self, name="TrigEFDielectronMassOnlineMonitoring"): + """ defines hisograms for online """ + super(TrigEFDielectronMassOnlineMonitoring, self).__init__(name) + self.defineTarget("Online") + + self.Histograms = [ defineHistogram('cut', type='TH1F', title="Cut counter", + xbins=3, xmin=-0.5, xmax=2.5, opt="kCumulative") ] + self.Histograms += [ defineHistogram('massOfAccepted', type='TH1F', title="Mass in accepted combinations", + xbins=50, xmin=0.0*GeV, xmax=250.0*GeV) ] + +class TrigEFDielectronMassValidationMonitoring_Zee(TrigGenericMonitoringToolConfig): + def __init__ (self, name="TrigEFDielectronMassValidationMonitoring_Zee"): + """ defines hisograms for online (to be used in Fex and Hypo)""" + super(TrigEFDielectronMassValidationMonitoring_Zee, self).__init__(name) + self.defineTarget("Validation") + + self.Histograms += [ defineHistogram('cut', type='TH1F', title="Cut counter", + xbins=7, xmin=-0.5, xmax=6.5, opt="kCumulative") ] + self.Histograms += [ defineHistogram('massOfAccepted', type='TH1F', title="Mass in accepted combinations", + xbins=50, xmin=0.0*GeV, xmax=250.0*GeV) ] + +class TrigEFDielectronMassOnlineMonitoring(TrigGenericMonitoringToolConfig): + def __init__ (self, name="TrigEFDielectronMassOnlineMonitoring"): + """ defines hisograms for online """ + super(TrigEFDielectronMassOnlineMonitoring, self).__init__(name) + self.defineTarget("Online") + + self.Histograms = [ defineHistogram('cut', type='TH1F', title="Cut counter", + xbins=3, xmin=-0.5, xmax=2.5, opt="kCumulative") ] + self.Histograms += [ defineHistogram('massOfAccepted', type='TH1F', title="Mass in accepted combinations", + xbins=75, xmin=0.0*GeV, xmax=15.0*GeV) ] + +class TrigEFDielectronMassValidationMonitoring_Jpsi(TrigGenericMonitoringToolConfig): + def __init__ (self, name="TrigEFDielectronMassValidationMonitoring_Jpsi"): + """ defines hisograms for online (to be used in Fex and Hypo)""" + super(TrigEFDielectronMassValidationMonitoring_Jpsi, self).__init__(name) + self.defineTarget("Validation") + + self.Histograms += [ defineHistogram('cut', type='TH1F', title="Cut counter", + xbins=7, xmin=-0.5, xmax=6.5, opt="kCumulative") ] + self.Histograms += [ defineHistogram('massOfAccepted', type='TH1F', title="Mass in accepted combinations", + xbins=75, xmin=0.0*GeV, xmax=15.0*GeV) ] + +class TrigEFDielectronMassOnlineMonitoring(TrigGenericMonitoringToolConfig): + def __init__ (self, name="TrigEFDielectronMassOnlineMonitoring"): + """ defines hisograms for online """ + super(TrigEFDielectronMassOnlineMonitoring, self).__init__(name) + self.defineTarget("Online") + + self.Histograms = [ defineHistogram('cut', type='TH1F', title="Cut counter", + xbins=3, xmin=-0.5, xmax=2.5, opt="kCumulative") ] + self.Histograms += [ defineHistogram('massOfAccepted', type='TH1F', title="Mass in accepted combinations", + xbins=60, xmin=0.0*GeV, xmax=30.0*GeV) ] + +class TrigEFDielectronMassValidationMonitoring_Upsi(TrigGenericMonitoringToolConfig): + def __init__ (self, name="TrigEFDielectronMassValidationMonitoring_Upsi"): + """ defines hisograms for online (to be used in Fex and Hypo)""" + super(TrigEFDielectronMassValidationMonitoring_Upsi, self).__init__(name) + self.defineTarget("Validation") + + self.Histograms += [ defineHistogram('cut', type='TH1F', title="Cut counter", + xbins=7, xmin=-0.5, xmax=6.5, opt="kCumulative") ] + self.Histograms += [ defineHistogram('massOfAccepted', type='TH1F', title="Mass in accepted combinations", + xbins=60, xmin=0.0*GeV, xmax=30.0*GeV) ] diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFElectronHypoConfig.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFElectronHypoConfig.py new file mode 100755 index 00000000000..93634f40403 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFElectronHypoConfig.py @@ -0,0 +1,677 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +from AthenaCommon.Logging import logging #AT +import traceback #AT +from TrigEgammaHypo.TrigEgammaHypoConf import TrigEFElectronHypo + +############################## +# EF Electron Hypothesis Algorithm Configuration: +# Phillip Urquijo <Phillip.Urquijo@cern.ch> +############################## + +#### +#### !!!!!!!!!!!!!!!!!!!!!!!!!! +# we have to do something with this, where was this defined before? +from AthenaCommon.SystemOfUnits import GeV +#Load Tool Service +from AthenaCommon.AppMgr import ToolSvc + +############################## +#Configure the track extrapolator to allow for a trigger configured electron impact parameter cut +#AT Jan 2010: from TrkExTools.AtlasExtrapolator import AtlasExtrapolator +#AT Jan 2010: theAtlasExtrapolator=AtlasExtrapolator(name = 'egammaExtrapolator') +#AT Jan 2010: theAtlasExtrapolator.DoCaloDynamic = False # this turns off dynamic calculation of eloss in calorimeters +# all left to MaterialEffects/EnergyLossUpdators + +from TrkExTools.TrkExToolsConf import Trk__MaterialEffectsUpdator as MaterialEffectsUpdator +AtlasMaterialEffectsUpdator = MaterialEffectsUpdator(name = 'AtlasMaterialEffectsUpdator') +ToolSvc += AtlasMaterialEffectsUpdator #default material effects updator +NoElossMaterialEffectsUpdator = MaterialEffectsUpdator(name = 'NoElossMaterialEffectsUpdator') +NoElossMaterialEffectsUpdator.EnergyLoss = False +ToolSvc += NoElossMaterialEffectsUpdator + +#setup MaterialEffectsUpdator arrays +MyUpdators = [] +MyUpdators += [AtlasMaterialEffectsUpdator] # for ID +MyUpdators += [NoElossMaterialEffectsUpdator] # for Calo +#MyUpdators += [NoElossMaterialEffectsUpdator] # for muon + +MySubUpdators = [] +MySubUpdators += [AtlasMaterialEffectsUpdator.name()] # for ID +MySubUpdators += [NoElossMaterialEffectsUpdator.name()] # for Calo +MySubUpdators += [NoElossMaterialEffectsUpdator.name()] # for muon + +#AT Jan 2010: theAtlasExtrapolator.MaterialEffectsUpdators = MyUpdators +#AT Jan 2010: theAtlasExtrapolator.SubMEUpdators = MySubUpdators +#AT Jan 2010: ToolSvc+=theAtlasExtrapolator + +################################# + + +############################################################### +# Include EGammaPIDdefs for loose,medium,tight definitions +from TrigEGammaPIDdefs import SelectionDefElectron +from TrigEGammaPIDdefs import TrigEgammaIDQuality +from TrigEGammaPIDdefsDC14 import SelectionDefElectronDC14 +from TrigEGammaPIDdefsDC14 import TrigEgammaIDQualityDC14 +########################## +import PyCintex +PyCintex.loadDictionary('ElectronPhotonSelectorToolsDict') +from ROOT import LikeEnum + +PyCintex.loadDictionary('egammaEnumsDict') +from ROOT import egammaParameters +from ROOT import egammaPID +# Include electronPIDmenu from ElectronPhotonSelectorTools +#from TrigEgammaElectronIsEMSelectorMapping import electronPIDmenu + +from ElectronPhotonSelectorTools.ElectronLikelihoodToolMapping import electronLHmenu + +# Include electronLHMenu +from ElectronPhotonSelectorTools.ElectronIsEMSelectorMapping import electronPIDmenu + + +class TrigEFElectronHypoBase (TrigEFElectronHypo): + __slots__ = [] + def __init__(self, name): + super( TrigEFElectronHypoBase, self ).__init__( name ) + + from TrigEgammaHypo.TrigEFElectronHypoMonitoring import TrigEFElectronHypoValidationMonitoring, TrigEFElectronHypoOnlineMonitoring, TrigEFElectronHypoCosmicMonitoring + validation = TrigEFElectronHypoValidationMonitoring() + online = TrigEFElectronHypoOnlineMonitoring() + cosmic = TrigEFElectronHypoCosmicMonitoring() + + from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig + time = TrigTimeHistToolConfig("Time") + + self.AthenaMonTools = [ time, validation, online, cosmic ] + #AT Jan 2010: self.Extrapolator = theAtlasExtrapolator + + self.histoPath = "/EXPERT" + +#----------------------------------------------------------------------- +# --- Following classes to be used with TriggerMenu +# --- Rely on TM to configure +# --- RMWhite 2014 +# +# No Cut for EF +class TrigEFElectronHypo_e_NoCut (TrigEFElectronHypoBase): + __slots__ = [] + def __init__(self, name, threshold): + super( TrigEFElectronHypo_e_NoCut, self ).__init__( name ) + self.AcceptAll = True + self.CaloCutsOnly = False + self.ApplyIsEM = False + self.IsEMrequiredBits = 0X0 + self.emEt = float(threshold)*GeV +# +#----------------------------------------------------------------------- +# --- Et Cut only -- threshold passed from TM chain name +# --- No cut applied at L2 +#----------------------------------------------------------------------- +class TrigEFElectronHypo_e_EtCut (TrigEFElectronHypoBase): + __slots__ = [] + def __init__(self, name, threshold): + super( TrigEFElectronHypo_e_EtCut, self ).__init__( name ) + self.AcceptAll = False + self.CaloCutsOnly = False + self.ApplyIsEM = False + self.IsEMrequiredBits = 0X0 + self.emEt = float(threshold)*GeV + +#----------------------------------------------------------------------- +# --- eXX Particle ID selection +# --- loose, medium, tight isEM +# --- mvtloose, mvtmedium, mvttight LH +# --- W T&P supporting trigger +#----------------------------------------------------------------------- +class TrigEFElectronHypo_e_ID (TrigEFElectronHypoBase): + __slots__ = [] + def __init__(self, name, threshold, IDinfo): + super( TrigEFElectronHypo_e_ID, self ).__init__( name ) +# Set the properties + self.AcceptAll = False + self.CaloCutsOnly = False + self.ApplyIsEM = True + self.emEt = float(threshold)*GeV + +# Import the SelectorTools +# try: +# from TrigEgammaRec.TrigEgammaAthElectronIsEMSelectors import TrigEgammaAthElectronIsEMSelector +# except: +# mlog = logging.getLogger(name+'::__init__') +# mlog.error("could not get handle to AthenaSelectorTool") +# print traceback.format_exc() +# return False + + try: + from ElectronPhotonSelectorTools.ConfiguredAsgElectronIsEMSelectors import ConfiguredAsgElectronIsEMSelector + except: + mlog = logging.getLogger(name+'::__init__') + mlog.error("could not get handle to AthenaSelectorTool") + print traceback.format_exc() + return False + + try: + from ElectronPhotonSelectorTools.ConfiguredAsgElectronLikelihoodTools import ConfiguredAsgElectronLikelihoodTool + except: + mlog = logging.getLogger(name+'::__init__') + mlog.error("could not get handle to AthenaSelectorTool") + print traceback.format_exc() + return False + from AthenaCommon.AppMgr import ToolSvc + # Add the PID tools + print IDinfo + if IDinfo == 'loose1': + self.IsEMrequiredBits = SelectionDefElectron.ElectronLoose1 + if hasattr(ToolSvc, "AsgElectronIsEMLoose1Selector"): + self.egammaElectronCutIDToolName = "AsgElectronIsEMLoose1Selector" + else: + theelectroncutloose1id=ConfiguredAsgElectronIsEMSelector("AsgElectronIsEMLoose1Selector",egammaPID.ElectronIDLoosePP,electronPIDmenu.menuTrig2012) + self.egammaElectronCutIDToolName = theelectroncutloose1id.getFullName() + ToolSvc+=theelectroncutloose1id + elif IDinfo == 'loose': + self.IsEMrequiredBits = SelectionDefElectronDC14.ElectronLoose + if hasattr(ToolSvc, "AsgElectronIsEMLooseSelector"): + self.egammaElectronCutIDToolName = "AsgElectronIsEMLooseSelector" + else: + theelectroncutlooseid=ConfiguredAsgElectronIsEMSelector("AsgElectronIsEMLooseSelector",egammaPID.ElectronIDLoose,electronPIDmenu.menuTrigDC14) + self.egammaElectronCutIDToolName = theelectroncutlooseid.getFullName() + ToolSvc+=theelectroncutlooseid + elif IDinfo == 'medium1': + self.IsEMrequiredBits = SelectionDefElectron.ElectronMedium1 + if hasattr(ToolSvc, "AsgElectronIsEMMedium1Selector"): + self.egammaElectronCutIDToolName = "AsgElectronIsEMMedium1Selector" + else: + theelectroncutmedium1id=ConfiguredAsgElectronIsEMSelector("AsgElectronIsEMMedium1Selector",egammaPID.ElectronIDMediumPP,electronPIDmenu.menuTrig2012) + self.egammaElectronCutIDToolName = theelectroncutmedium1id.getFullName() + ToolSvc+=theelectroncutmedium1id + elif IDinfo == 'medium': + self.IsEMrequiredBits = SelectionDefElectronDC14.ElectronMedium + if hasattr(ToolSvc, "AsgElectronIsEMMediumSelector"): + self.egammaElectronCutIDToolName = "AsgElectronIsEMMediumSelector" + else: + theelectroncutmediumid=ConfiguredAsgElectronIsEMSelector("AsgElectronIsEMMediumSelector",egammaPID.ElectronIDMedium,electronPIDmenu.menuTrigDC14) + self.egammaElectronCutIDToolName = theelectroncutmediumid.getFullName() + ToolSvc+=theelectroncutmediumid + elif IDinfo == 'tight1': + self.IsEMrequiredBits = SelectionDefElectron.ElectronTight1 + if hasattr(ToolSvc, "AsgElectronIsEMTight1Selector"): + self.egammaElectronCutIDToolName = "AsgElectronIsEMTight1Selector" + else: + theelectroncuttight1id=ConfiguredAsgElectronIsEMSelector("AsgElectronIsEMTight1Selector",egammaPID.ElectronIDTightPP,electronPIDmenu.menuTrig2012) + self.egammaElectronCutIDToolName = theelectroncuttight1id.getFullName() + ToolSvc+=theelectroncuttight1id + elif IDinfo == 'tight': + self.IsEMrequiredBits = SelectionDefElectronDC14.ElectronTight + if hasattr(ToolSvc, "AsgElectronIsEMTightSelector"): + self.egammaElectronCutIDToolName = "AsgElectronIsEMTightSelector" + else: + theelectroncuttightid=ConfiguredAsgElectronIsEMSelector("AsgElectronIsEMTightSelector",egammaPID.ElectronIDTight,electronPIDmenu.menuTrigDC14) + self.egammaElectronCutIDToolName = theelectroncuttightid.getFullName() + ToolSvc+=theelectroncuttightid + elif IDinfo == 'lhloose': + self.UseAthenaElectronLHIDSelectorTool = True + if hasattr(ToolSvc,"AsgElectronLHLooseSelector"): + self.AthenaElectronLHIDSelectorToolName="AsgElectronLHLooseSelector" + else: + theelectronlhlooseid=ConfiguredAsgElectronLikelihoodTool("AsgElectronLHLooseSelector", + LikeEnum.Loose, + menu=electronLHmenu.trigger2015, + usePVContainer = False) + self.AthenaElectronLHIDSelectorToolName=theelectronlhlooseid.getFullName() + ToolSvc+=theelectronlhlooseid + elif IDinfo == 'lhmedium': + self.UseAthenaElectronLHIDSelectorTool = True + if hasattr(ToolSvc,"AsgElectronLHMediumSelector"): + self.AthenaElectronLHIDSelectorToolName="AsgElectronLHMediumSelector" + else: + theelectronlhmediumid=ConfiguredAsgElectronLikelihoodTool("AsgElectronLHMediumSelector", + LikeEnum.Medium, + menu=electronLHmenu.trigger2015, + usePVContainer = False) + self.AthenaElectronLHIDSelectorToolName=theelectronlhmediumid.getFullName() + ToolSvc+=theelectronlhmediumid + elif IDinfo == 'lhtight': + self.UseAthenaElectronLHIDSelectorTool = True + if hasattr(ToolSvc,"AsgElectronLHTightSelector"): + self.AthenaElectronLHIDSelectorToolName="AsgElectronLHTightSelector" + else: + theelectronlhtightid=ConfiguredAsgElectronLikelihoodTool("AsgElectronLHTightSelector", + LikeEnum.Tight, + menu=electronLHmenu.trigger2015, + usePVContainer = False) + self.AthenaElectronLHIDSelectorToolName=theelectronlhtightid.getFullName() + ToolSvc+=theelectronlhtightid + else: + raise RuntimeError('INCORRECT IDinfo: No SelectorTool configured') + + + +# --- W T&P supporting trigger +#----------------------------------------------------------------------- +class TrigEFElectronHypo_e_WTP (TrigEFElectronHypoBase): + __slots__ = [] + def __init__(self, name, threshold): + super( TrigEFElectronHypo_e_WTP, self ).__init__( name ) +# Set the properties + self.AcceptAll = False + self.CaloCutsOnly = False + self.ApplyIsEM = True + self.emEt = float(threshold)*GeV +# Import the SelectorTools + try: + from TrigEgammaRec.TrigEgammaAthElectronIsEMSelectors import TrigEgammaAthElectronIsEMSelector + except: + mlog = logging.getLogger(name+'::__init__') + mlog.error("could not get handle to AthenaSelectorTool") + print traceback.format_exc() + return False +# Need to check selection to map for W T&P trigger + self.IsEMrequiredBits = SelectionDefElectron.Electron_trk + theelectroncutid=TrigEgammaAthElectronIsEMSelector("athElectronIsEMSelector_"+self.name(),TrigEgammaIDQuality.ElectronIDLoose,electronPIDmenu.menuTrig2012) + self.egammaElectronCutIDToolName = theelectroncutid.getFullName() + +#----------------------------------------------------------------------- +# --- eXX Particle ID selection CaloCuts only +# --- loose, medium, tight isEM +# --- Currently Not for likelihood, but derives from e_ID class +#----------------------------------------------------------------------- +class TrigEFElectronHypo_e_ID_CaloOnly (TrigEFElectronHypo_e_ID): + __slots__ = [] + def __init__(self, name, threshold, IDinfo): + super( TrigEFElectronHypo_e_ID_CaloOnly, self ).__init__( name, threshold, IDinfo ) +# Set the properties + self.CaloCutsOnly = True + +#----------------------------------------------------------------------- +# --- eXX Particle ID and Isolation +# --- derives from e_ID +# --- iloose, imedium +#----------------------------------------------------------------------- +class TrigEFElectronHypo_e_Iso (TrigEFElectronHypo_e_ID): + __slots__ = [] + def __init__(self, name, threshold, IDinfo, isoInfo): + super( TrigEFElectronHypo_e_Iso, self ).__init__( name, threshold, IDinfo ) + #Isolation + self.ApplyIsolation = True + self.useClusETforCaloIso = True + self.useClusETforTrackIso = True + #EtCone Size = 15, 20, 25, 30, 35, 40 + self.EtConeSizes = 6 + self.RelEtConeCut = [-1, -1, -1, -1, -1, -1] + self.EtConeCut = [-1, -1, -1, -1, -1, -1] + #PtCone Size = 20, 30, 40 + self.PtConeSizes = 3 + self.RelPtConeCut = [0.100, -1, -1] + self.PtConeCut = [-1, -1, -1] + +#----------------------------------------------------------------------- +# --- eXX Particle ID and Isolation performance chains +# --- derives from e_ID +# --- iloose, imedium +# --- run selection but accept all +#----------------------------------------------------------------------- +class TrigEFElectronHypo_e_ID_perf (TrigEFElectronHypo_e_ID): + __slots__ = [] + def __init__(self, name, threshold, IDinfo): + super( TrigEFElectronHypo_e_IsD_perf, self ).__init__( name, threshold, IDinfo ) + self.AcceptAll = True + +class TrigEFElectronHypo_e_Iso_perf (TrigEFElectronHypo_e_ID): + __slots__ = [] + def __init__(self, name, threshold, IDinfo, isoInfo): + super( TrigEFElectronHypo_e_Iso_perf, self ).__init__( name, threshold, IDinfo ) + #Isolation + self.AcceptAll = True + self.ApplyIsolation = True + self.useClusETforCaloIso = True + self.useClusETforTrackIso = True + #EtCone Size = 15, 20, 25, 30, 35, 40 + self.EtConeSizes = 6 + self.RelEtConeCut = [-1, -1, -1, -1, -1, -1] + self.EtConeCut = [-1, -1, -1, -1, -1, -1] + #PtCone Size = 20, 30, 40 + self.PtConeSizes = 3 + self.RelPtConeCut = [0.100, -1, -1] + self.PtConeCut = [-1, -1, -1] + +# Restoring tracking chains +class TrigEFElectronHypo_e5_NoCut (TrigEFElectronHypoBase): + __slots__ = [] + def __init__(self, name = "TrigEFElectronHypo_e5_NoCut"): + super( TrigEFElectronHypo_e5_NoCut, self ).__init__( name ) + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll = True + +class TrigEFElectronHypo_e10_NoCut (TrigEFElectronHypoBase): + __slots__ = [] + def __init__(self, name = "TrigEFElectronHypo_e10_NoCut"): + super( TrigEFElectronHypo_e10_NoCut, self ).__init__( name ) + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll = True + +class TrigEFElectronHypo_e5_loose (TrigEFElectronHypoBase): + __slots__ = [] + def __init__(self, name = "TrigEFElectronHypo_e5_loose"): + super( TrigEFElectronHypo_e5_loose, self ).__init__( name ) + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll = False + self.CaloCutsOnly = False + self.ApplyIsEM = True + self.emEt = 5.*GeV + self.IsEMrequiredBits = SelectionDefElectron.ElectronLoose + # Medium cut defs not migrated to new selector maps + # Use Medium1 + + try: + from TrigEgammaRec.TrigEgammaAthElectronIsEMSelectors import TrigEgammaAthElectronIsEMSelector + theelectroncutid=TrigEgammaAthElectronIsEMSelector("athElectronIsEMSelector_"+self.name(),TrigEgammaIDQuality.ElectronIDLoose,electronPIDmenu.menuTrig2012) + except: + mlog = logging.getLogger(name+'::__init__') + mlog.error("could not get handle to AthenaSelectorTool") + print traceback.format_exc() + return False + from AthenaCommon.AppMgr import ToolSvc + ToolSvc+=theelectroncutid + self.egammaElectronCutIDToolName = theelectroncutid.getFullName() + +class TrigEFElectronHypo_e10_loose (TrigEFElectronHypoBase): + __slots__ = [] + def __init__(self, name = "TrigEFElectronHypo_e10_loose"): + super( TrigEFElectronHypo_e10_loose, self ).__init__( name ) + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll = False + self.CaloCutsOnly = False + self.ApplyIsEM = True + self.emEt = 5.*GeV + self.IsEMrequiredBits = SelectionDefElectron.ElectronLoose + # Medium cut defs not migrated to new selector maps + # Use Medium1 + + try: + from TrigEgammaRec.TrigEgammaAthElectronIsEMSelectors import TrigEgammaAthElectronIsEMSelector + theelectroncutid=TrigEgammaAthElectronIsEMSelector("athElectronIsEMSelector_"+self.name(),TrigEgammaIDQuality.ElectronIDLoose,electronPIDmenu.menuTrig2012) + except: + mlog = logging.getLogger(name+'::__init__') + mlog.error("could not get handle to AthenaSelectorTool") + print traceback.format_exc() + return False + from AthenaCommon.AppMgr import ToolSvc + ToolSvc+=theelectroncutid + self.egammaElectronCutIDToolName = theelectroncutid.getFullName() + +class TrigEFElectronHypo_e10_loose1 (TrigEFElectronHypoBase): + __slots__ = [] + def __init__(self, name = "TrigEFElectronHypo_e10_loose1"): + super( TrigEFElectronHypo_e10_loose1, self ).__init__( name ) + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll = False + self.CaloCutsOnly = False + self.ApplyIsEM = True + self.emEt = 5.*GeV + self.IsEMrequiredBits = SelectionDefElectron.ElectronLoose1 + + try: + from TrigEgammaRec.TrigEgammaAthElectronIsEMSelectors import TrigEgammaAthElectronIsEMSelector + theelectroncutid=TrigEgammaAthElectronIsEMSelector("athElectronIsEMSelector_"+self.name(),TrigEgammaIDQuality.ElectronIDLoose1,electronPIDmenu.menuTrig2012) + except: + mlog = logging.getLogger(name+'::__init__') + mlog.error("could not get handle to AthenaSelectorTool") + print traceback.format_exc() + return False + from AthenaCommon.AppMgr import ToolSvc + ToolSvc+=theelectroncutid + self.egammaElectronCutIDToolName = theelectroncutid.getFullName() + +class TrigEFElectronHypo_e15_loose (TrigEFElectronHypoBase): + __slots__ = [] + def __init__(self, name = "TrigEFElectronHypo_e15_loose"): + super( TrigEFElectronHypo_e15_loose, self ).__init__( name ) + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll = False + self.CaloCutsOnly = False + self.ApplyIsEM = True + self.emEt = 5.*GeV + self.IsEMrequiredBits = SelectionDefElectron.ElectronLoose + + try: + from TrigEgammaRec.TrigEgammaAthElectronIsEMSelectors import TrigEgammaAthElectronIsEMSelector + theelectroncutid=TrigEgammaAthElectronIsEMSelector("athElectronIsEMSelector_"+self.name(),TrigEgammaIDQuality.ElectronIDLoose,electronPIDmenu.menuTrig2012) + except: + mlog = logging.getLogger(name+'::__init__') + mlog.error("could not get handle to AthenaSelectorTool") + print traceback.format_exc() + return False + from AthenaCommon.AppMgr import ToolSvc + ToolSvc+=theelectroncutid + self.egammaElectronCutIDToolName = theelectroncutid.getFullName() + +class TrigEFElectronHypo_e10_medium1 (TrigEFElectronHypoBase): + __slots__ = [] + def __init__(self, name = "TrigEFElectronHypo_e10_medium1"): + super( TrigEFElectronHypo_e10_medium1, self ).__init__( name ) + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll = False + self.CaloCutsOnly = False + self.ApplyIsEM = True + self.emEt = 5.*GeV + self.IsEMrequiredBits = SelectionDefElectron.ElectronMedium1 + + try: + from TrigEgammaRec.TrigEgammaAthElectronIsEMSelectors import TrigEgammaAthElectronIsEMSelector + theelectroncutid=TrigEgammaAthElectronIsEMSelector("athElectronIsEMSelector_"+self.name(),TrigEgammaIDQuality.ElectronIDMedium1,electronPIDmenu.menuTrig2012) + except: + mlog = logging.getLogger(name+'::__init__') + mlog.error("could not get handle to AthenaSelectorTool") + print traceback.format_exc() + return False + from AthenaCommon.AppMgr import ToolSvc + ToolSvc+=theelectroncutid + self.egammaElectronCutIDToolName = theelectroncutid.getFullName() + +class TrigEFElectronHypo_e5_medium (TrigEFElectronHypoBase): + __slots__ = [] + def __init__(self, name = "TrigEFElectronHypo_e5_medium"): + super( TrigEFElectronHypo_e5_medium, self ).__init__( name ) + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll = False + self.CaloCutsOnly = False + self.ApplyIsEM = True + self.emEt = 5.*GeV + self.IsEMrequiredBits = SelectionDefElectron.ElectronMedium + # Medium cut defs not migrated to new selector maps + # Use Medium1 + + try: + from TrigEgammaRec.TrigEgammaAthElectronIsEMSelectors import TrigEgammaAthElectronIsEMSelector + theelectroncutid=TrigEgammaAthElectronIsEMSelector("athElectronIsEMSelector_"+self.name(),TrigEgammaIDQuality.ElectronIDMedium1,electronPIDmenu.menuTrig2012) + except: + mlog = logging.getLogger(name+'::__init__') + mlog.error("could not get handle to AthenaSelectorTool") + print traceback.format_exc() + return False + from AthenaCommon.AppMgr import ToolSvc + ToolSvc+=theelectroncutid + self.egammaElectronCutIDToolName = theelectroncutid.getFullName() + +class TrigEFElectronHypo_e5_tight1 (TrigEFElectronHypoBase): + __slots__ = [] + def __init__(self, name = "TrigEFElectronHypo_e5_tight1"): + super( TrigEFElectronHypo_e5_tight1, self ).__init__( name ) + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll = False + self.CaloCutsOnly = False + self.ApplyIsEM = True + self.emEt = 5.*GeV + self.IsEMrequiredBits = SelectionDefElectron.ElectronTight1 + try: + from TrigEgammaRec.TrigEgammaAthElectronIsEMSelectors import TrigEgammaAthElectronIsEMSelector + theelectroncutid=TrigEgammaAthElectronIsEMSelector("athElectronIsEMSelector_"+self.name(),TrigEgammaIDQuality.ElectronIDTight1,electronPIDmenu.menuTrig2012) + except: + mlog = logging.getLogger(name+'::__init__') + mlog.error("could not get handle to AthenaSelectorTool") + print traceback.format_exc() + return False + from AthenaCommon.AppMgr import ToolSvc + ToolSvc+=theelectroncutid + self.egammaElectronCutIDToolName = theelectroncutid.getFullName() + +class TrigEFElectronHypo_e7_loose1 (TrigEFElectronHypoBase): + __slots__ = [] + def __init__(self, name = "TrigEFElectronHypo_e7_loose1"): + super( TrigEFElectronHypo_e7_loose1, self ).__init__( name ) + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll = False + self.CaloCutsOnly = False + self.ApplyIsEM = True + self.emEt = 7.*GeV + self.IsEMrequiredBits = SelectionDefElectron.ElectronLoose1 + try: + from TrigEgammaRec.TrigEgammaAthElectronIsEMSelectors import TrigEgammaAthElectronIsEMSelector + theelectroncutid=TrigEgammaAthElectronIsEMSelector("athElectronIsEMSelector_"+self.name(),TrigEgammaIDQuality.ElectronIDLoose1,electronPIDmenu.menuTrig2012) + except: + mlog = logging.getLogger(name+'::__init__') + mlog.error("could not get handle to AthenaSelectorTool") + print traceback.format_exc() + return False + from AthenaCommon.AppMgr import ToolSvc + ToolSvc+=theelectroncutid + self.egammaElectronCutIDToolName = theelectroncutid.getFullName() + +class TrigEFElectronHypo_e7_medium1 (TrigEFElectronHypoBase): + __slots__ = [] + def __init__(self, name = "TrigEFElectronHypo_e7_medium1"): + super( TrigEFElectronHypo_e7_medium1, self ).__init__( name ) + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll = False + self.CaloCutsOnly = False + self.ApplyIsEM = True + self.emEt = 7.*GeV + self.IsEMrequiredBits = SelectionDefElectron.ElectronMedium1 + try: + from TrigEgammaRec.TrigEgammaAthElectronIsEMSelectors import TrigEgammaAthElectronIsEMSelector + theelectroncutid=TrigEgammaAthElectronIsEMSelector("athElectronIsEMSelector_"+self.name(),TrigEgammaIDQuality.ElectronIDMedium1,electronPIDmenu.menuTrig2012) + except: + mlog = logging.getLogger(name+'::__init__') + mlog.error("could not get handle to AthenaSelectorTool") + print traceback.format_exc() + return False + from AthenaCommon.AppMgr import ToolSvc + ToolSvc+=theelectroncutid + self.egammaElectronCutIDToolName = theelectroncutid.getFullName() + +class TrigEFElectronHypo_e12_loose1 (TrigEFElectronHypoBase): + __slots__ = [] + def __init__(self, name = "TrigEFElectronHypo_e12_loose1"): + super( TrigEFElectronHypo_e12_loose1, self ).__init__( name ) + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll = False + self.CaloCutsOnly = False + self.ApplyIsEM = True + self.emEt = 12.*GeV + self.IsEMrequiredBits = SelectionDefElectron.ElectronLoose1 + try: + from TrigEgammaRec.TrigEgammaAthElectronIsEMSelectors import TrigEgammaAthElectronIsEMSelector + theelectroncutid=TrigEgammaAthElectronIsEMSelector("athElectronIsEMSelector_"+self.name(),TrigEgammaIDQuality.ElectronIDLoose1,electronPIDmenu.menuTrig2012) + except: + mlog = logging.getLogger(name+'::__init__') + mlog.error("could not get handle to AthenaSelectorTool") + print traceback.format_exc() + return False + from AthenaCommon.AppMgr import ToolSvc + ToolSvc+=theelectroncutid + self.egammaElectronCutIDToolName = theelectroncutid.getFullName() + +class TrigEFElectronHypo_e12_medium (TrigEFElectronHypoBase): + __slots__ = [] + def __init__(self, name = "TrigEFElectronHypo_e12_medium"): + super( TrigEFElectronHypo_e12_medium, self ).__init__( name ) + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll = False + self.CaloCutsOnly = False + self.ApplyIsEM = True + self.emEt = 12.*GeV + self.IsEMrequiredBits = SelectionDefElectron.ElectronMedium + # Medium cut defs not migrated to new selector maps + # Use Medium1 + try: + from TrigEgammaRec.TrigEgammaAthElectronIsEMSelectors import TrigEgammaAthElectronIsEMSelector + theelectroncutid=TrigEgammaAthElectronIsEMSelector("athElectronIsEMSelector_"+self.name(),TrigEgammaIDQuality.ElectronIDMedium1,electronPIDmenu.menuTrig2012) + except: + mlog = logging.getLogger(name+'::__init__') + mlog.error("could not get handle to AthenaSelectorTool") + print traceback.format_exc() + return False + from AthenaCommon.AppMgr import ToolSvc + ToolSvc+=theelectroncutid + self.egammaElectronCutIDToolName = theelectroncutid.getFullName() + +class TrigEFElectronHypo_e12_medium1 (TrigEFElectronHypoBase): + __slots__ = [] + def __init__(self, name = "TrigEFElectronHypo_e12_medium1"): + super( TrigEFElectronHypo_e12_medium1, self ).__init__( name ) + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll = False + self.CaloCutsOnly = False + self.ApplyIsEM = True + self.emEt = 12.*GeV + self.IsEMrequiredBits = SelectionDefElectron.ElectronMedium1 + try: + from TrigEgammaRec.TrigEgammaAthElectronIsEMSelectors import TrigEgammaAthElectronIsEMSelector + theelectroncutid=TrigEgammaAthElectronIsEMSelector("athElectronIsEMSelector_"+self.name(),TrigEgammaIDQuality.ElectronIDMedium1,electronPIDmenu.menuTrig2012) + except: + mlog = logging.getLogger(name+'::__init__') + mlog.error("could not get handle to AthenaSelectorTool") + print traceback.format_exc() + return False + from AthenaCommon.AppMgr import ToolSvc + ToolSvc+=theelectroncutid + self.egammaElectronCutIDToolName = theelectroncutid.getFullName() + +class TrigEFElectronHypo_e22_medium (TrigEFElectronHypoBase): + __slots__ = [] + def __init__(self, name = "TrigEFElectronHypo_e22_medium"): + super( TrigEFElectronHypo_e22_medium, self ).__init__( name ) + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll = False + self.CaloCutsOnly = False + self.ApplyIsEM = True + self.emEt = 22.*GeV + self.IsEMrequiredBits = SelectionDefElectron.ElectronMedium + # Medium cut defs not migrated to new selector + # Use medium1 + try: + from TrigEgammaRec.TrigEgammaAthElectronIsEMSelectors import TrigEgammaAthElectronIsEMSelector + theelectroncutid=TrigEgammaAthElectronIsEMSelector("athElectronIsEMSelector_"+self.name(),TrigEgammaIDQuality.ElectronIDMedium1,electronPIDmenu.menuTrig2012) + except: + mlog = logging.getLogger(name+'::__init__') + mlog.error("could not get handle to AthenaSelectorTool") + print traceback.format_exc() + return False + from AthenaCommon.AppMgr import ToolSvc + ToolSvc+=theelectroncutid + self.egammaElectronCutIDToolName = theelectroncutid.getFullName() + +class TrigEFElectronHypo_e24_medium1 (TrigEFElectronHypoBase): + __slots__ = [] + def __init__(self, name = "TrigEFElectronHypo_e24_medium1"): + super( TrigEFElectronHypo_e24_medium1, self ).__init__( name ) + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll = False + self.CaloCutsOnly = False + self.ApplyIsEM = True + self.emEt = 24.*GeV + self.IsEMrequiredBits = SelectionDefElectron.ElectronMedium1 + try: + from TrigEgammaRec.TrigEgammaAthElectronIsEMSelectors import TrigEgammaAthElectronIsEMSelector + theelectroncutid=TrigEgammaAthElectronIsEMSelector("athElectronIsEMSelector_"+self.name(),TrigEgammaIDQuality.ElectronIDMedium1,electronPIDmenu.menuTrig2012) + except: + mlog = logging.getLogger(name+'::__init__') + mlog.error("could not get handle to AthenaSelectorTool") + print traceback.format_exc() + return False + from AthenaCommon.AppMgr import ToolSvc + ToolSvc+=theelectroncutid + self.egammaElectronCutIDToolName = theelectroncutid.getFullName() + diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFElectronHypoMonitoring.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFElectronHypoMonitoring.py new file mode 100755 index 00000000000..98d7944baea --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFElectronHypoMonitoring.py @@ -0,0 +1,476 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +from TrigMonitorBase.TrigGenericMonitoringToolConfig import defineHistogram, TrigGenericMonitoringToolConfig + +class TrigEFElectronHypoValidationMonitoring(TrigGenericMonitoringToolConfig): + def __init__ (self, name="TrigEFElectronHypoValidationMonitoring"): + super(TrigEFElectronHypoValidationMonitoring, self).__init__(name) + self.defineTarget( "Validation" ) + + + cuts=['Input','has EMTrackMatch','isEM','cluster E_{T}', + 'Abs. Etcone','Abs. Ptcone','Rel. Etcone','Rel. Ptcone' + ] + + labelsDescription = '' + for c in cuts: + labelsDescription += c+':' + + self.Histograms = [ defineHistogram('CutCounter', type='TH1I', title="EFElectron Hypo Number of passed cuts; cut", + xbins=10, xmin=-1.5, xmax=8.5, opt="kCumulative", labels=labelsDescription) ] + + #AT 11Jan2010 very old BitDef: + #cuts=['ClusterEtaRange',' ',' ','ClusterHadronicLeakage','ClusterMiddleEnergy','ClusterMiddleEratio37 ', + # 'lusterMiddleEratio33','ClusterMiddleWidth','ClusterStripsEratio','ClusterStripsDeltaEmax2', + # 'lusterStripsDeltaE ','clusterStripsWtot','ClusterStripsFracm','ClusterStripsWeta1c', + # 'ClusterIsolation',' ','TrackBlayer','TrackPixel','TrackSi','TrackA0','TrackMatchEta', + # 'TrackMatchPhi','TrackMatchEoverP',' ','TrackTRThits','TrackTRTratio','TrackTRTratio90'] + #self.Histograms += [ defineHistogram('CutCounterIsEM', type='TH1I', title="EFElectron Hypo passed cuts from isEM flag; cut", + # xbins=27, xmin=-0.5, xmax=26.5, labels=labelsDescription) ] + + #self.Histograms += [ defineHistogram('CutCounterIsEMTrig', type='TH1I', title="EFElectron Hypo passed cuts from isEMTrig flag; cut", + # xbins=27, xmin=-0.5, xmax=26.5, labels=labelsDescription) ] + + + #---------------------------------------------------------- + #AT Jan2010 + #----BitDef for Trigger-coded 28-Bit isEMTrig + cuts=['ClusterEtaRange','ClusterHadronicLeakage','empty2','empty3','ClusterMiddleEnergy','ClusterMiddleEratio37 ', + 'ClusterMiddleEratio33','ClusterMiddleWidth','ClusterStripsEratio','ClusterStripsDeltaEmax2', + 'ClusterStripsDeltaE ','ClusterStripsWtot','ClusterStripsFracm','ClusterStripsWeta1c', + 'ClusterIsolation','ClusterStripsDEmaxs1','TrackBlayer','TrackPixel','TrackSi','TrackA0','TrackMatchEta', + 'TrackMatchPhi','TrackMatchEoverP','empty23','TrackTRThits','TrackTRTratio','TrackTRTratio90', 'TrackIsolation'] + labelsDescription = '' + for c in cuts: + labelsDescription += c+':' + + + # + #----BitDefElectron for Offline 32-Bit isEM + # + cuts=['ClusterEtaRange ','ConversionMatch','ClusterHadronicLeakage ','ClusterMiddleEnergy ', + 'ClusterMiddleEratio37 ','ClusterMiddleEratio33 ','ClusterMiddleWidth ','f3', + 'ClusterStripsEratio ','ClusterStripsDeltaEmax2 ','ClusterStripsDeltaE ', + 'ClusterStripsWtot ','ClusterStripsFracm ','ClusterStripsWeta1c ','empty14', + 'ClusterStripsDEmaxs1 ','TrackBlayer ','TrackPixel ','TrackSi ', + 'TrackA0 ','TrackMatchEta ','TrackMatchPhi ','TrackMatchEoverP ','empty23', + 'TrackTRThits ','TrackTRTratio ','TrackTRTratio90 ','TrackA0Tight','TrackMatchEtaTight', + 'Isolation ','ClusterIsolation ','TrackIsolation '] + labelsDescription = '' + for c in cuts: + labelsDescription += c+':' + + + #isEMTrig Monitoring Histograms - Before/After Offline isEM cuts are applied + self.Histograms += [ defineHistogram('IsEMAfterCut', type='TH1I', title="EFElectron Hypo passed cuts from isEM flag; cut", + xbins=32, xmin=-0.5, xmax=31.5, opt="kVec", labels=labelsDescription) ] + self.Histograms += [ defineHistogram('IsEMBeforeCut', type='TH1I', title="EFElectron Hypo passed cuts from isEM flag; cut", + xbins=32, xmin=-0.5, xmax=31.5, opt="kVec", labels=labelsDescription) ] + self.Histograms += [ defineHistogram('IsEMRequiredBitsBeforeCut', type='TH1I', title="Required Bits for isEM flag Before Cut; cut", + xbins=32, xmin=-0.5, xmax=31.5, opt="kVec", labels=labelsDescription) ] + self.Histograms += [ defineHistogram('IsEMRequiredBitsAfterCut', type='TH1I', title="Required Bits for isEM flag After Cut; cut", + xbins=32, xmin=-0.5, xmax=31.5, opt="kVec", labels=labelsDescription) ] + #---------------------------------------------------------- + + + + cuts=["loose","medium","tight"] + + labelsDescription = '' + for c in cuts: + labelsDescription += c+':' + + #AT Aug2011: deactivate histogram egIsEM - outdated + #self.Histograms += [ defineHistogram('egIsEM', type='TH1I', title="EFElectronHypo isEM; Cut", + # xbins=3, xmin=0.5, xmax=3.5, labels=labelsDescription)] + + self.Histograms += [ defineHistogram('ClusterEt', type='TH1F', title="EFElectron Hypo Cluster E_{T}; E_{T}^{em} [MeV]", + xbins=50, xmin=-2000, xmax=100000) ] + self.Histograms += [ defineHistogram('TrackPt', type='TH1F', title="EFElectron Hypo Track E_{T}; E_{T}^{track}} [MeV]", + xbins=50, xmin=-2000, xmax=100000) ] + self.Histograms += [ defineHistogram('dEta', type='TH1F', title="EFElectron Hypo #Delta #eta between track and cluster in first layer; #Delta#eta", + xbins=100, xmin=-0.100, xmax=0.100) ] + self.Histograms += [ defineHistogram('dPhi', type='TH1F', title="EFElectron Hypo #Delta #phi between track and cluster in second layer; #Delta#phi", + xbins=100, xmin=-0.150, xmax=0.150) ] + self.Histograms += [ defineHistogram('Eoverp', type='TH1F', title="EFElectron Hypo Et/Pt; Eoverp", + xbins=100, xmin=0.0, xmax=10.0) ] + self.Histograms += [ defineHistogram('rTRT', type='TH1F', title="EFElectron Hypo ratio of TRT high threshold hits; rTRT", + xbins=30, xmin=-0.1, xmax=1.1 ) ] + + self.Histograms += [ defineHistogram('F1', type='TH1F', title="EFElectron Hypo fraction of energy found in 1st em sampling;Fraction", + xbins=50, xmin=-0.1, xmax=1.1 ) ] + + self.Histograms += [ defineHistogram('E237', type='TH1F', title="EFElectron Hypo uncor energy in 3x7 cells in em sampling 2; E [MeV]", + xbins=50, xmin=-15000, xmax=150000 ) ] + + self.Histograms += [ defineHistogram('E277', type='TH1F', title="EFElectron Hypo uncor energy in 7x7 cells in em sampling 2;E [MeV]", + xbins=50, xmin=-15000, xmax=150000 ) ] + + self.Histograms += [ defineHistogram('Reta', type='TH1F', title="EFElectron Hypo Reta = E237/E277; Reta", + xbins=130, xmin=-5.0, xmax=1.5 ) ] + + self.Histograms += [ defineHistogram('Eratio', type='TH1F', title="EFElectron Hypo Eratio = (emax1 - emax2) / (emax1 + emax2) ; Eratio ", + xbins=32, xmin=-0.1, xmax=1.5 ) ] + + self.Histograms += [ defineHistogram('EtHad1', type='TH1F', title="EFElectron Hypo E leakage into 1st sampling of had calo; E [MeV]", + xbins=50, xmin=-15000, xmax=150000 ) ] + + self.Histograms += [ defineHistogram('WEta1', type='TH1F', title="EFElectron Hypo corrected width in 3 strips in the 1st samp. ; WEta1", + xbins=20, xmin=0, xmax=1 ) ] + + self.Histograms += [ defineHistogram('WEta2', type='TH1F', title="EFElectron Hypo corrected width in 3 strips in the 2st samp. ; WEta2", + xbins=20, xmin=0, xmax=0.05 ) ] + + self.Histograms += [ defineHistogram('E2tsts1', type='TH1F', title="EFElectron Hypo 2nd maximum in strips; E [MeV]", + xbins=50, xmin=-1000, xmax=5000 ) ] + + self.Histograms += [ defineHistogram('Emins1', type='TH1F', title="EFElectron Hypo energy of strip with minimum between max 1 & 2; E [MeV]", + xbins=50, xmin=-1000, xmax=5000 ) ] + + self.Histograms += [ defineHistogram('Fracs1', type='TH1F', title="EFElectron Hypo energy outside core (E(+-7)-E(+-3))/E(+-7); E [MeV]", + xbins=50, xmin=-5000, xmax=10000 ) ] + + self.Histograms += [ defineHistogram('wtots1', type='TH1F', title="EFElectron Hypo total width in em sampling 1 in 20 strips; WTots1", + xbins=20, xmin=0, xmax=20 ) ] + + self.Histograms += [ defineHistogram('EtConeIso', type='TH1F', title="EFElectron Hypo Et in a ring of DR<0.20 above noise (excluding electron ET); ET [MeV]", + xbins=60, xmin=-10000, xmax=50000 ) ] + + self.Histograms += [ defineHistogram('PtConeIso', type='TH1F', title="EFElectron Hypo Pt in a ring of DR<0.20 above noise (excluding electron PT); PT [MeV]", + xbins=60, xmin=-10000, xmax=50000 ) ] + + self.Histograms += [ defineHistogram('nBLayerHits', type='TH1F', title="EFElectron Hypo number of B layer hits; Number of B layer hits", + xbins=4, xmin=-0.5, xmax=3.5 ) ] + + self.Histograms += [ defineHistogram('nPixelHits', type='TH1F', title="EFElectron Hypo number of pixel hits; Number of pixel hits", + xbins=11, xmin=-0.5, xmax=10.5 ) ] + + self.Histograms += [ defineHistogram('nSCTHits', type='TH1F', title="EFElectron Hypo number of SCT hits; Number of SCT hits", + xbins=26, xmin=-0.5, xmax=25.5 ) ] + + self.Histograms += [ defineHistogram('nTRTHits', type='TH1F', title="EFElectron Hypo number of TRT hits; Number of TRT hits", + xbins=46, xmin=-0.5, xmax=45.5 ) ] + + self.Histograms += [ defineHistogram('nTRTHitsHighTh', type='TH1F', title="EFElectron Hypo number of high threshold TRT hits; Number of TRT HighTh hits", + xbins=26, xmin=-0.5, xmax=25.5 ) ] + + self.Histograms += [ defineHistogram('nTRTHitsHighThOutliers', type='TH1F', title="EFElectron Hypo number of outliers high threshold TRT hits; Number of TRT HighTh outlier hits", + xbins=26, xmin=-0.5, xmax=25.5 ) ] + + self.Histograms += [ defineHistogram('nTRTHitsOutliers', type='TH1F', title="EFElectron Hypo number of outliers TRT hits; Number of TRT outlier hits", + xbins=26, xmin=-0.5, xmax=25.5 ) ] + + self.Histograms += [ defineHistogram('F3', type='TH1F', title="EFElectron Hypo Hypo F3; E3/(E0+E1+E2+E3)",xbins=96, xmin=-0.1, xmax=1.1) ] + + self.Histograms += [ defineHistogram('A0', type='TH1F', title="EFElectron Hypo Hypo A0; Impact Parameter",xbins=100, xmin=-1.0, xmax=1.0) ] + + +class TrigEFElectronHypoOnlineMonitoring(TrigGenericMonitoringToolConfig): + def __init__ (self, name="TrigEFElectronHypoOnlineMonitoring"): + """ defines histograms for online """ + super(TrigEFElectronHypoOnlineMonitoring, self).__init__(name) + self.defineTarget("Online") + + cuts=['Input','has EMTrackMatch','isEM','cluster E_{T}', + 'Abs. Etcone','Abs. Ptcone','Rel. Etcone','Rel. Ptcone' + ] + + labelsDescription = '' + for c in cuts: + labelsDescription += c+':' + + self.Histograms = [ defineHistogram('CutCounter', type='TH1I', title="EFElectron Hypo Number of passed cuts; cut", + xbins=10, xmin=-1.5, xmax=8.5, opt="kCumulative", labels=labelsDescription) ] + + + #---------------------------------------------------------- + #AT Jan2010 + #----BitDef for Trigger-coded 28-Bit isEMTrig + cuts=['ClusterEtaRange','ClusterHadronicLeakage','empty2','empty3','ClusterMiddleEnergy','ClusterMiddleEratio37 ', + 'ClusterMiddleEratio33','ClusterMiddleWidth','ClusterStripsEratio','ClusterStripsDeltaEmax2', + 'ClusterStripsDeltaE ','ClusterStripsWtot','ClusterStripsFracm','ClusterStripsWeta1c', + 'ClusterIsolation','ClusterStripsDEmaxs1','TrackBlayer','TrackPixel','TrackSi','TrackA0','TrackMatchEta', + 'TrackMatchPhi','TrackMatchEoverP','empty23','TrackTRThits','TrackTRTratio','TrackTRTratio90', 'TrackIsolation'] + labelsDescription = '' + for c in cuts: + labelsDescription += c+':' + + + # + #----BitDefElectron for Offline 32-Bit isEM + # + cuts=['ClusterEtaRange ','ConversionMatch','ClusterHadronicLeakage ','ClusterMiddleEnergy ', + 'ClusterMiddleEratio37 ','ClusterMiddleEratio33 ','ClusterMiddleWidth ','f3', + 'ClusterStripsEratio ','ClusterStripsDeltaEmax2 ','ClusterStripsDeltaE ', + 'ClusterStripsWtot ','ClusterStripsFracm ','ClusterStripsWeta1c ','empty14', + 'ClusterStripsDEmaxs1 ','TrackBlayer ','TrackPixel ','TrackSi ', + 'TrackA0 ','TrackMatchEta ','TrackMatchPhi ','TrackMatchEoverP ','empty23', + 'TrackTRThits ','TrackTRTratio ','TrackTRTratio90 ','TrackA0Tight','TrackMatchEtaTight', + 'Isolation ','ClusterIsolation ','TrackIsolation '] + labelsDescription = '' + for c in cuts: + labelsDescription += c+':' + + + #isEMTrig Monitoring Histograms - Before/After Offline isEM cuts are applied + self.Histograms += [ defineHistogram('IsEMAfterCut', type='TH1I', title="EFElectron Hypo passed cuts from isEM flag; cut", + xbins=32, xmin=-0.5, xmax=31.5, opt="kVec", labels=labelsDescription) ] + + self.Histograms += [ defineHistogram('IsEMBeforeCut', type='TH1I', title="EFElectron Hypo passed cuts from isEM flag; cut", + xbins=32, xmin=-0.5, xmax=31.5, opt="kVec", labels=labelsDescription) ] + + self.Histograms += [ defineHistogram('IsEMRequiredBitsBeforeCut', type='TH1I', title="Required Bits for isEM flag Before Cut; cut", + xbins=32, xmin=-0.5, xmax=31.5, opt="kVec", labels=labelsDescription) ] + + self.Histograms += [ defineHistogram('IsEMRequiredBitsAfterCut', type='TH1I', title="Required Bits for isEM flag After Cut; cut", + xbins=32, xmin=-0.5, xmax=31.5, opt="kVec", labels=labelsDescription) ] + #---------------------------------------------------------- + + + + + cuts=["loose","medium","tight"] + + labelsDescription = '' + for c in cuts: + labelsDescription += c+':' + + #AT Aug2011: deactivate histogram egIsEM - outdated + #self.Histograms += [ defineHistogram('egIsEM', type='TH1I', title="EFElectronHypo isEM; Cut", + # xbins=3, xmin=0.5, xmax=3.5, labels=labelsDescription)] + + self.Histograms += [ defineHistogram('ClusterEt', type='TH1F', title="EFElectron Hypo Cluster E_{T}; E_{T}^{em} [MeV]", + xbins=50, xmin=-2000, xmax=100000) ] + self.Histograms += [ defineHistogram('TrackPt', type='TH1F', title="EFElectron Hypo Track E_{T}; E_{T}^{track}} [MeV]", + xbins=50, xmin=-2000, xmax=100000) ] + self.Histograms += [ defineHistogram('dEta', type='TH1F', title="EFElectron Hypo #Delta #eta between track and cluster in first layer; #Delta#eta", + xbins=100, xmin=-0.100, xmax=0.100) ] + self.Histograms += [ defineHistogram('dPhi', type='TH1F', title="EFElectron Hypo #Delta #phi between track and cluster in second layer; #Delta#phi", + xbins=100, xmin=-0.150, xmax=0.150) ] + self.Histograms += [ defineHistogram('Eoverp', type='TH1F', title="EFElectron Hypo Et/Pt; Eoverp", + xbins=100, xmin=0.0, xmax=10.0) ] + self.Histograms += [ defineHistogram('rTRT', type='TH1F', title="EFElectron Hypo ratio of TRT high threshold hits; rTRT", + xbins=30, xmin=-0.1, xmax=1.1 ) ] + + self.Histograms += [ defineHistogram('F1', type='TH1F', title="EFElectron Hypo fraction of energy found in 1st em sampling;Fraction", + xbins=50, xmin=-0.1, xmax=1.1 ) ] + + self.Histograms += [ defineHistogram('E237', type='TH1F', title="EFElectron Hypo uncor energy in 3x7 cells in em sampling 2; E [MeV]", + xbins=50, xmin=-15000, xmax=150000 ) ] + + self.Histograms += [ defineHistogram('E277', type='TH1F', title="EFElectron Hypo uncor energy in 7x7 cells in em sampling 2;E [MeV]", + xbins=50, xmin=-15000, xmax=150000 ) ] + + self.Histograms += [ defineHistogram('Reta', type='TH1F', title="EFElectron Hypo Reta = E237/E277; Reta", + xbins=130, xmin=-5.0, xmax=1.5 ) ] + + self.Histograms += [ defineHistogram('Eratio', type='TH1F', title="EFElectron Hypo Eratio = (emax1 - emax2) / (emax1 + emax2) ; Eratio ", + xbins=32, xmin=-0.1, xmax=1.5 ) ] + + self.Histograms += [ defineHistogram('EtHad1', type='TH1F', title="EFElectron Hypo E leakage into 1st sampling of had calo; E [MeV]", + xbins=50, xmin=-15000, xmax=150000 ) ] + + self.Histograms += [ defineHistogram('WEta1', type='TH1F', title="EFElectron Hypo corrected width in 3 strips in the 1st samp. ; WEta1", + xbins=20, xmin=0, xmax=1 ) ] + + self.Histograms += [ defineHistogram('WEta2', type='TH1F', title="EFElectron Hypo corrected width in 3 strips in the 2st samp. ; WEta2", + xbins=20, xmin=0, xmax=0.05 ) ] + + self.Histograms += [ defineHistogram('E2tsts1', type='TH1F', title="EFElectron Hypo 2nd maximum in strips; E [MeV]", + xbins=50, xmin=-1000, xmax=5000 ) ] + + self.Histograms += [ defineHistogram('Emins1', type='TH1F', title="EFElectron Hypo energy of strip with minimum between max 1 & 2; E [MeV]", + xbins=50, xmin=-1000, xmax=5000 ) ] + + self.Histograms += [ defineHistogram('Fracs1', type='TH1F', title="EFElectron Hypo energy outside core (E(+-7)-E(+-3))/E(+-7); E [MeV]", + xbins=50, xmin=-5000, xmax=10000 ) ] + + self.Histograms += [ defineHistogram('wtots1', type='TH1F', title="EFElectron Hypo total width in em sampling 1 in 20 strips; WTots1", + xbins=20, xmin=0, xmax=20 ) ] + + self.Histograms += [ defineHistogram('EtConeIso', type='TH1F', title="EFElectron Hypo Et in a ring of DR<0.20 above noise (excluding electron ET); ET [MeV]", + xbins=60, xmin=-10000, xmax=50000 )] + + self.Histograms += [ defineHistogram('PtConeIso', type='TH1F', title="EFElectron Hypo Pt in a ring of DR<0.20 above noise (excluding electron PT); PT [MeV]", + xbins=60, xmin=-10000, xmax=50000 )] + self.Histograms += [ defineHistogram('nBLayerHits', type='TH1F', title="EFElectron Hypo number of B layer hits;Number of B layer hits", + xbins=4, xmin=-0.5, xmax=3.5 ) ] + + self.Histograms += [ defineHistogram('nPixelHits', type='TH1F', title="EFElectron Hypo number of pixel hits; Number of pixel hits", + xbins=11, xmin=-0.5, xmax=10.5 ) ] + + self.Histograms += [ defineHistogram('nSCTHits', type='TH1F', title="EFElectron Hypo number of SCT hits; Number of SCT hits", + xbins=26, xmin=-0.5, xmax=25.5 ) ] + + self.Histograms += [ defineHistogram('nTRTHits', type='TH1F', title="EFElectron Hypo number of TRT hits; Number of TRT hits", + xbins=46, xmin=-0.5, xmax=45.5 ) ] + + self.Histograms += [ defineHistogram('nTRTHitsHighTh', type='TH1F', title="EFElectron Hypo number of high threshold TRT hits; Number of TRT HighTh hits", + xbins=26, xmin=-0.5, xmax=25.5 ) ] + + self.Histograms += [ defineHistogram('nTRTHitsHighThOutliers', type='TH1F', title="EFElectron Hypo number of outliers high threshold TRT hits; Number of TRT HighTh outlier hits", + xbins=26, xmin=-0.5, xmax=25.5 ) ] + + self.Histograms += [ defineHistogram('nTRTHitsOutliers', type='TH1F', title="EFElectron Hypo number of outliers TRT hits; Number of TRT outlier hits", + xbins=26, xmin=-0.5, xmax=25.5 ) ] + + self.Histograms += [ defineHistogram('F3', type='TH1F', title="EFElectron Hypo Hypo F3; E3/(E0+E1+E2+E3)",xbins=96, xmin=-0.1, xmax=1.1) ] + + self.Histograms += [ defineHistogram('A0', type='TH1F', title="EFElectron Hypo Hypo A0; Impact Parameter",xbins=100, xmin=-1.0, xmax=1.0) ] + + + + +class TrigEFElectronHypoCosmicMonitoring(TrigGenericMonitoringToolConfig): + def __init__ (self, name="TrigEFElectronHypoCosmicMonitoring"): + """ defines histograms for cosmic """ + super(TrigEFElectronHypoCosmicMonitoring, self).__init__(name) + self.defineTarget("Cosmic") + + + cuts=['Input','has EMTrackMatch','isEM','cluster E_{T}', + 'Abs. Etcone','Abs. Ptcone','Rel. Etcone','Rel. Ptcone' + ] + + labelsDescription = '' + for c in cuts: + labelsDescription += c+':' + + self.Histograms = [ defineHistogram('CutCounter', type='TH1I', title="EFElectron Hypo Number of passed cuts; cut", + xbins=10, xmin=-1.5, xmax=8.5, opt="kCumulative", labels=labelsDescription) ] + + + #---------------------------------------------------------- + #AT Jan2010 + #----BitDef for Trigger-coded 28-Bit isEMTrig + cuts=['ClusterEtaRange','ClusterHadronicLeakage','empty2','empty3','ClusterMiddleEnergy','ClusterMiddleEratio37 ', + 'ClusterMiddleEratio33','ClusterMiddleWidth','ClusterStripsEratio','ClusterStripsDeltaEmax2', + 'ClusterStripsDeltaE ','ClusterStripsWtot','ClusterStripsFracm','ClusterStripsWeta1c', + 'ClusterIsolation','ClusterStripsDEmaxs1','TrackBlayer','TrackPixel','TrackSi','TrackA0','TrackMatchEta', + 'TrackMatchPhi','TrackMatchEoverP','empty23','TrackTRThits','TrackTRTratio','TrackTRTratio90', 'TrackIsolation'] + labelsDescription = '' + for c in cuts: + labelsDescription += c+':' + + + # + #----BitDefElectron for Offline 32-Bit isEM + # + cuts=['ClusterEtaRange ','ConversionMatch','ClusterHadronicLeakage ','ClusterMiddleEnergy ', + 'ClusterMiddleEratio37 ','ClusterMiddleEratio33 ','ClusterMiddleWidth ','f3', + 'ClusterStripsEratio ','ClusterStripsDeltaEmax2 ','ClusterStripsDeltaE ', + 'ClusterStripsWtot ','ClusterStripsFracm ','ClusterStripsWeta1c ','empty14', + 'ClusterStripsDEmaxs1 ','TrackBlayer ','TrackPixel ','TrackSi ', + 'TrackA0 ','TrackMatchEta ','TrackMatchPhi ','TrackMatchEoverP ','empty23', + 'TrackTRThits ','TrackTRTratio ','TrackTRTratio90 ','TrackA0Tight','TrackMatchEtaTight', + 'Isolation ','ClusterIsolation ','TrackIsolation '] + labelsDescription = '' + for c in cuts: + labelsDescription += c+':' + + + #isEMTrig Monitoring Histograms - Before/After Offline isEM cuts are applied + self.Histograms += [ defineHistogram('IsEMAfterCut', type='TH1I', title="EFElectron Hypo passed cuts from isEM flag; cut", + xbins=32, xmin=-0.5, xmax=31.5, opt="kVec", labels=labelsDescription) ] + + self.Histograms += [ defineHistogram('IsEMBeforeCut', type='TH1I', title="EFElectron Hypo passed cuts from isEM flag; cut", + xbins=32, xmin=-0.5, xmax=31.5, opt="kVec", labels=labelsDescription) ] + + self.Histograms += [ defineHistogram('IsEMRequiredBitsBeforeCut', type='TH1I', title="Required Bits for isEM flag Before Cut; cut", + xbins=32, xmin=-0.5, xmax=31.5, opt="kVec", labels=labelsDescription) ] + + self.Histograms += [ defineHistogram('IsEMRequiredBitsAfterCut', type='TH1I', title="Required Bits for isEM flag After Cut; cut", + xbins=32, xmin=-0.5, xmax=31.5, opt="kVec", labels=labelsDescription) ] + #---------------------------------------------------------- + + + + + cuts=["loose","medium","tight"] + + labelsDescription = '' + for c in cuts: + labelsDescription += c+':' + + #AT Aug2011: deactivate histogram egIsEM - outdated + #self.Histograms += [ defineHistogram('egIsEM', type='TH1I', title="EFElectronHypo isEM; Cut", + # xbins=3, xmin=0.5, xmax=3.5, labels=labelsDescription)] + + self.Histograms += [ defineHistogram('ClusterEt', type='TH1F', title="EFElectron Hypo Cluster E_{T}; E_{T}^{em} [MeV]", + xbins=50, xmin=-2000, xmax=100000) ] + self.Histograms += [ defineHistogram('TrackPt', type='TH1F', title="EFElectron Hypo Track E_{T}; E_{T}^{track}} [MeV]", + xbins=50, xmin=-2000, xmax=100000) ] + self.Histograms += [ defineHistogram('dEta', type='TH1F', title="EFElectron Hypo #Delta #eta between track and cluster in first layer; #Delta#eta", + xbins=100, xmin=-0.100, xmax=0.100) ] + self.Histograms += [ defineHistogram('dPhi', type='TH1F', title="EFElectron Hypo #Delta #phi between track and cluster in second layer; #Delta#phi", + xbins=100, xmin=-0.150, xmax=0.150) ] + self.Histograms += [ defineHistogram('Eoverp', type='TH1F', title="EFElectron Hypo Et/Pt; Eoverp", + xbins=100, xmin=0.0, xmax=10.0) ] + self.Histograms += [ defineHistogram('rTRT', type='TH1F', title="EFElectron Hypo ratio of TRT high threshold hits; rTRT", + xbins=30, xmin=-0.1, xmax=1.1 ) ] + + self.Histograms += [ defineHistogram('F1', type='TH1F', title="EFElectron Hypo fraction of energy found in 1st em sampling;Fraction", + xbins=50, xmin=-0.1, xmax=1.1 ) ] + + self.Histograms += [ defineHistogram('E237', type='TH1F', title="EFElectron Hypo uncor energy in 3x7 cells in em sampling 2; E [MeV]", + xbins=50, xmin=-15000, xmax=150000 ) ] + + self.Histograms += [ defineHistogram('E277', type='TH1F', title="EFElectron Hypo uncor energy in 7x7 cells in em sampling 2;E [MeV]", + xbins=50, xmin=-15000, xmax=150000 ) ] + + self.Histograms += [ defineHistogram('Reta', type='TH1F', title="EFElectron Hypo Reta = E237/E277; Reta", + xbins=130, xmin=-5.0, xmax=1.5 ) ] + + self.Histograms += [ defineHistogram('Eratio', type='TH1F', title="EFElectron Hypo Eratio = (emax1 - emax2) / (emax1 + emax2) ; Eratio ", + xbins=32, xmin=-0.1, xmax=1.5 ) ] + + self.Histograms += [ defineHistogram('EtHad1', type='TH1F', title="EFElectron Hypo E leakage into 1st sampling of had calo; E [MeV]", + xbins=50, xmin=-15000, xmax=150000 ) ] + + self.Histograms += [ defineHistogram('WEta1', type='TH1F', title="EFElectron Hypo corrected width in 3 strips in the 1st samp. ; WEta1", + xbins=20, xmin=0, xmax=1 ) ] + + self.Histograms += [ defineHistogram('WEta2', type='TH1F', title="EFElectron Hypo corrected width in 3 strips in the 2st samp. ; WEta2", + xbins=20, xmin=0, xmax=0.05 ) ] + + self.Histograms += [ defineHistogram('E2tsts1', type='TH1F', title="EFElectron Hypo 2nd maximum in strips; E [MeV]", + xbins=50, xmin=-1000, xmax=5000 ) ] + + self.Histograms += [ defineHistogram('Emins1', type='TH1F', title="EFElectron Hypo energy of strip with minimum between max 1 & 2; E [MeV]", + xbins=50, xmin=-1000, xmax=5000 ) ] + + self.Histograms += [ defineHistogram('Fracs1', type='TH1F', title="EFElectron Hypo energy outside core (E(+-7)-E(+-3))/E(+-7); E [MeV]", + xbins=50, xmin=-5000, xmax=10000 ) ] + + self.Histograms += [ defineHistogram('wtots1', type='TH1F', title="EFElectron Hypo total width in em sampling 1 in 20 strips; WTots1", + xbins=20, xmin=0, xmax=20 ) ] + + self.Histograms += [ defineHistogram('EtConeIso', type='TH1F', title="EFElectron Hypo Et in a ring of DR<0.20 above noise (excluding electron ET); ET [MeV]", + xbins=60, xmin=-10000, xmax=50000 ) ] + + self.Histograms += [ defineHistogram('PtConeIso', type='TH1F', title="EFElectron Hypo Pt in a ring of DR<0.20 above noise (excluding electron PT); PT [MeV]", + xbins=60, xmin=-10000, xmax=50000 )] + self.Histograms += [ defineHistogram('nBLayerHits', type='TH1F', title="EFElectron Hypo number of B layer hits;Number of B layer hits", + xbins=4, xmin=-0.5, xmax=3.5 ) ] + + self.Histograms += [ defineHistogram('nPixelHits', type='TH1F', title="EFElectron Hypo number of pixel hits; Number of pixel hits", + xbins=11, xmin=-0.5, xmax=10.5 ) ] + + self.Histograms += [ defineHistogram('nSCTHits', type='TH1F', title="EFElectron Hypo number of SCT hits; Number of SCT hits", + xbins=26, xmin=-0.5, xmax=25.5 ) ] + + self.Histograms += [ defineHistogram('nTRTHits', type='TH1F', title="EFElectron Hypo number of TRT hits; Number of TRT hits", + xbins=46, xmin=-0.5, xmax=45.5 ) ] + + self.Histograms += [ defineHistogram('nTRTHitsHighTh', type='TH1F', title="EFElectron Hypo number of high threshold TRT hits; Number of TRT HighTh hits", + xbins=26, xmin=-0.5, xmax=25.5 ) ] + + self.Histograms += [ defineHistogram('nTRTHitsHighThOutliers', type='TH1F', title="EFElectron Hypo number of outliers high threshold TRT hits; Number of TRT HighTh outlier hits", + xbins=26, xmin=-0.5, xmax=25.5 ) ] + + self.Histograms += [ defineHistogram('nTRTHitsOutliers', type='TH1F', title="EFElectron Hypo number of outliers TRT hits; Number of TRT outlier hits", + xbins=26, xmin=-0.5, xmax=25.5 ) ] + + self.Histograms += [ defineHistogram('F3', type='TH1F', title="EFElectron Hypo Hypo F3; E3/(E0+E1+E2+E3)",xbins=96, xmin=-0.1, xmax=1.1) ] + + self.Histograms += [ defineHistogram('A0', type='TH1F', title="EFElectron Hypo Hypo A0; Impact Parameter",xbins=100, xmin=-1.0, xmax=1.0) ] diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFHadronicRecoilConfig.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFHadronicRecoilConfig.py new file mode 100644 index 00000000000..3879cb32f50 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFHadronicRecoilConfig.py @@ -0,0 +1,10 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +from TrigEgammaHypo.TrigEgammaHypoConf import * +from AthenaCommon.SystemOfUnits import GeV + +class TrigEFHadronicRecoil_recoil40(TrigEFHadronicRecoil): + def __init__(self, name='TrigEFHadronicRecoil_recoil25'): + super(TrigEFHadronicRecoil_recoil40, self).__init__(name) + self.RecoilCut = 40.0*GeV + diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFPhotonHypoConfig.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFPhotonHypoConfig.py new file mode 100755 index 00000000000..013517a1e9b --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFPhotonHypoConfig.py @@ -0,0 +1,138 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +from AthenaCommon.Logging import logging #AT +import traceback #AT +from TrigEgammaHypo.TrigEgammaHypoConf import TrigEFPhotonHypo + + +############################################################### +# Include EGammaPIDdefs for loose,medium,tight definitions +from TrigEGammaPIDdefs import SelectionDefPhoton +from TrigEGammaPIDdefs import TrigEgammaIDQuality +########################## +import PyCintex +PyCintex.loadDictionary('egammaEnumsDict') +from ROOT import egammaParameters + +PyCintex.loadDictionary('ElectronPhotonSelectorToolsDict') +from ROOT import egammaPID + +# Include electronPIDmenu from Trigger specific maps +#from TrigEgammaElectronIsEMSelectorMapping import electronPIDmenu +from ElectronPhotonSelectorTools.ElectronIsEMSelectorMapping import electronPIDmenu +#### +#### !!!!!!!!!!!!!!!!!!!!!!!!!! +# we have to do something with this, where was this defined before? +from AthenaCommon.SystemOfUnits import GeV + +class TrigEFPhotonHypoBase (TrigEFPhotonHypo): + __slots__ = [] + def __init__(self, name): + super( TrigEFPhotonHypoBase, self ).__init__( name ) + + from TrigEgammaHypo.TrigEFPhotonHypoMonitoring import TrigEFPhotonHypoValidationMonitoring, TrigEFPhotonHypoOnlineMonitoring, TrigEFPhotonHypoCosmicMonitoring + validation = TrigEFPhotonHypoValidationMonitoring() + online = TrigEFPhotonHypoOnlineMonitoring() + cosmic = TrigEFPhotonHypoCosmicMonitoring() + + from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig + time = TrigTimeHistToolConfig("Time") + + self.AthenaMonTools = [ time, validation, online, cosmic ] + + + #----------------------------------------------------------- + from AthenaCommon.AppMgr import ToolSvc + mlog = logging.getLogger( 'TrigEFPhotonHypoBase:' ) + +#----------------------------------------------------------------------- +# --- RMWhite 2014 +# --- Following classes to be used with TriggerMenu +# --- Rely on TM to configure +# --- Remove old TMP classes April 22, 2014 +# +#----------------------------------------------------------------------- +# --- Et Cut only -- threshold passed from TM chain name +#----------------------------------------------------------------------- +# --- Et cut only for Photons, configured as nocut +# --- Et cut applied at L2 +class EFPhotonHypo_g_EtCut (TrigEFPhotonHypoBase): + __slots__ = [] + def __init__(self, name, threshold): + super( EFPhotonHypo_g_EtCut, self ).__init__( name ) + self.AcceptAll = True + self.usePhotonCuts = False + +class EFPhotonHypo_g_NoCut (TrigEFPhotonHypoBase): + __slots__ = [] + def __init__(self, name, threshold): + super( EFPhotonHypo_g_NoCut, self ).__init__( name ) + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll = True + self.usePhotonCuts = False + +#----------------------------------------------------------------------- +# --- gXX Particle ID selection +# --- loose, medium isEM with Calo-only +#----------------------------------------------------------------------- +class EFPhotonHypo_g_ID_CaloOnly (TrigEFPhotonHypoBase): + __slots__ = [] + def __init__(self, name, threshold, IDinfo): + super( EFPhotonHypo_g_ID_CaloOnly, self ).__init__( name ) + from AthenaCommon.AppMgr import ToolSvc + self.AcceptAll = False + self.ApplyIsEM = True + self.usePhotonCuts = False + print IDinfo + self.emEt = float(threshold)*GeV + + try: + from ElectronPhotonSelectorTools.ConfiguredAsgElectronIsEMSelectors import ConfiguredAsgElectronIsEMSelector + except: + mlog = logging.getLogger(name+'::__init__') + mlog.error("could not get handle to AsgElectronSelectorTool") + print traceback.format_exc() + return False + + try: + from ElectronPhotonSelectorTools.ConfiguredAsgPhotonIsEMSelectors import ConfiguredAsgPhotonIsEMSelector + except: + mlog = logging.getLogger(name+'::__init__') + mlog.error("could not get handle to AsgPhotonSelectorTool") + print traceback.format_exc() + return False + + if IDinfo == 'loose' or IDinfo == 'loose1': + self.IsEMrequiredBits = SelectionDefPhoton.PhotonLooseEF #includ Rhad , Reta , Weta2 and Eratio + if hasattr(ToolSvc, "AsgPhotonIsEMLooseSelector"): + self.egammaElectronCutIDToolName = "AsgPhotonIsEMLooseSelector" + else: + thephotoncutlooseid=ConfiguredAsgElectronIsEMSelector("AsgPhotonIsEMLooseSelector",egammaPID.PhotonIDLoose,electronPIDmenu.menuTrig2012) + self.egammaElectronCutIDToolName = thephotoncutlooseid.getFullName() + ToolSvc+=thephotoncutlooseid + elif IDinfo == 'medium' or IDinfo == 'medium1': + self.IsEMrequiredBits = SelectionDefPhoton.PhotonMediumEF #includ Rhad , Reta , Weta2 and Eratio + if hasattr(ToolSvc, "AsgPhotonIsEMMediumSelector"): + self.egammaElectronCutIDToolName = "AsgPhotonIsEMMediumSelector" + else: + thephotoncutmediumid=ConfiguredAsgElectronIsEMSelector("AsgPhotonIsEMMediumSelector",egammaPID.PhotonIDMedium,electronPIDmenu.menuTrig2012) + self.egammaElectronCutIDToolName = thephotoncutmediumid.getFullName() + ToolSvc+=thephotoncutmediumid + #--- egammaPhotonCutIDTool without ForcePhotonConversion (same selection as in offline) + #--- Migrated to ElectronPhotonSelectorTool, menu from offline + # at High Lumi use Photon selection + elif IDinfo == 'tight' or IDinfo == 'tight1': + self.usePhotonCuts = True + self.IsEMrequiredBits = SelectionDefPhoton.PhotonTight #includ Rhad , Reta , Weta2 and Eratio + if hasattr(ToolSvc, "AsgPhotonIsEMTightSelector"): + self.egammaPhotonCutIDToolName = thephotoncuttightid.getFullName() + else: + thephotoncuttightid=ConfiguredAsgPhotonIsEMSelector("AsgPhotonIsEMTightSelector",egammaPID.PhotonIDTight) + thephotoncuttightid.ForceConvertedPhotonPID = False + self.egammaPhotonCutIDToolName = thephotoncuttightid.getFullName() + ToolSvc+=thephotoncuttightid + + else: + raise RuntimeError('INCORRECT IDinfo: No SelectorTool configured') + + diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFPhotonHypoMonitoring.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFPhotonHypoMonitoring.py new file mode 100755 index 00000000000..efb25890bb4 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFPhotonHypoMonitoring.py @@ -0,0 +1,225 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +from TrigMonitorBase.TrigGenericMonitoringToolConfig import defineHistogram, TrigGenericMonitoringToolConfig + +class TrigEFPhotonHypoValidationMonitoring(TrigGenericMonitoringToolConfig): + def __init__ (self, name="TrigEFPhotonHypoValidationMonitoring"): + super(TrigEFPhotonHypoValidationMonitoring, self).__init__(name) + self.defineTarget( "Validation" ) + + cuts=['Input','has egammaContainer','isEM','isEMTrig', 'has caloCluster', 'Cluster Et', 'has EMShower', + 'OldSet1','OldSet2','OldSet3'] + + labelsDescription = '' + for c in cuts: + labelsDescription += c+':' + + self.Histograms = [ defineHistogram('CutCounter', type='TH1F', title="EFPhoton Hypo cut counter; Cut", + xbins=10, xmin=0.5, xmax=10.5, opt="kCumulative", labels=labelsDescription) ] + self.Histograms += [ defineHistogram('Et', type='TH1F', title="EFPhoton Hypo E_{T}; E_{T}^{em} [MeV]", xbins=50, xmin=0., xmax=70000.) ] + self.Histograms += [ defineHistogram('Eta', type='TH1F', title="EFPhoton Hypo #eta; #eta", xbins=50, xmin=-3.5, xmax=3.5) ] + self.Histograms += [ defineHistogram('Phi', type='TH1F', title="EFPhoton Hypo #phi; #phi", xbins=64, xmin=-3.2, xmax=3.2) ] + #self.Histograms += [ defineHistogram('rE37E77', type='TH1F', title="EFPhoton Hypo e237/e277; e237/e277", xbins=50, xmin=0., xmax=2.) ] + #self.Histograms += [ defineHistogram('rE33E77', type='TH1F', title="EFPhoton Hypo e233/e277; e233/e277", xbins=50, xmin=0., xmax=2.) ] + #self.Histograms += [ defineHistogram('Eratio', type='TH1F', title="EFPhoton Hypo Eratio; Eratio", xbins=40, xmin=-0.1, xmax=1.5) ] + + + #---------------------------------------------------------- + #AT Jan2010 + #----BitDef for Trigger-coded 28-Bit isEMTrig + cuts=['ClusterEtaRange','ClusterHadronicLeakage','empty2','empty3','ClusterMiddleEnergy','ClusterMiddleEratio37 ', + 'ClusterMiddleEratio33','ClusterMiddleWidth','ClusterStripsEratio','ClusterStripsDeltaEmax2', + 'ClusterStripsDeltaE ','ClusterStripsWtot','ClusterStripsFracm','ClusterStripsWeta1c', + 'ClusterIsolation','ClusterStripsDEmaxs1','TrackBlayer','TrackPixel','TrackSi','TrackA0','TrackMatchEta', + 'TrackMatchPhi','TrackMatchEoverP','empty23','TrackTRThits','TrackTRTratio','TrackTRTratio90', 'TrackIsolation'] + labelsDescription = '' + for c in cuts: + labelsDescription += c+':' + + + # + #----BitDefElectron for Offline 32-Bit isEM (valid for LowLumi, at HighLumi must use BitDefPhoton) + # + cuts=['ClusterEtaRange ','ConversionMatch','ClusterHadronicLeakage ','ClusterMiddleEnergy ', + 'ClusterMiddleEratio37 ','ClusterMiddleEratio33 ','ClusterMiddleWidth ','f3', + 'ClusterStripsEratio ','ClusterStripsDeltaEmax2 ','ClusterStripsDeltaE ', + 'ClusterStripsWtot ','ClusterStripsFracm ','ClusterStripsWeta1c ','empty14', + 'ClusterStripsDEmaxs1 ','TrackBlayer ','TrackPixel ','TrackSi ', + 'TrackA0 ','TrackMatchEta ','TrackMatchPhi ','TrackMatchEoverP ','empty23', + 'TrackTRThits ','TrackTRTratio ','TrackTRTratio90 ','TrackA0Tight','TrackMatchEtaTight', + 'Isolation ','ClusterIsolation ','TrackIsolation '] + labelsDescription = '' + for c in cuts: + labelsDescription += c+':' + + + #isEMTrig Monitoring Histograms - Before/After Offline isEM cuts are applied + self.Histograms += [ defineHistogram('IsEMAfterCut', type='TH1I', title="EFElectron Hypo passed cuts from isEM flag; cut", + xbins=32, xmin=-0.5, xmax=31.5, opt="kVec", labels=labelsDescription) ] + self.Histograms += [ defineHistogram('IsEMBeforeCut', type='TH1I', title="EFElectron Hypo passed cuts from isEM flag; cut", + xbins=32, xmin=-0.5, xmax=31.5, opt="kVec", labels=labelsDescription) ] + self.Histograms += [ defineHistogram('IsEMRequiredBitsBeforeCut', type='TH1I', title="Required Bits for isEM flag Before Cut; cut", + xbins=32, xmin=-0.5, xmax=31.5, opt="kVec", labels=labelsDescription) ] + self.Histograms += [ defineHistogram('IsEMRequiredBitsAfterCut', type='TH1I', title="Required Bits for isEM flag After Cut; cut", + xbins=32, xmin=-0.5, xmax=31.5, opt="kVec", labels=labelsDescription) ] + #---------------------------------------------------------- + + + cuts=["loose","medium","tight"] + + labelsDescription = '' + for c in cuts: + labelsDescription += c+':' + + #AT Aug2011: deactivate histogram egIsEM - outdated + #self.Histograms += [ defineHistogram('egIsEM', type='TH1I', title="EFEgammaHypo isEM; Cut", + # xbins=3, xmin=0.5, xmax=3.5, labels=labelsDescription)] + + + +class TrigEFPhotonHypoOnlineMonitoring(TrigGenericMonitoringToolConfig): + def __init__ (self, name="TrigEFPhotonHypoOnlineMonitoring"): + super(TrigEFPhotonHypoOnlineMonitoring, self).__init__(name) + self.defineTarget("Online") + + cuts=['Input','has egammaContainer','isEM','isEMTrig', 'has caloCluster', 'Cluster Et', 'has EMShower', + 'OldSet1','OldSet2','OldSet3'] + + labelsDescription = '' + for c in cuts: + labelsDescription += c+':' + + self.Histograms = [ defineHistogram('CutCounter', type='TH1F', title="EFPhoton Hypo cut counter; Cut", + xbins=10, xmin=0.5, xmax=10.5, opt="kCumulative", labels=labelsDescription) ] + self.Histograms += [ defineHistogram('Et', type='TH1F', title="EFPhoton Hypo E_{T}; E_{T}^{em} [MeV]", xbins=50, xmin=0., xmax=70000.) ] + self.Histograms += [ defineHistogram('Eta', type='TH1F', title="EFPhoton Hypo #eta; #eta", xbins=50, xmin=-3.5, xmax=3.5) ] + self.Histograms += [ defineHistogram('Phi', type='TH1F', title="EFPhoton Hypo #phi; #phi", xbins=64, xmin=-3.2, xmax=3.2) ] + #self.Histograms += [ defineHistogram('rE37E77', type='TH1F', title="EFPhoton Hypo e237/e277; e237/e277", xbins=50, xmin=0., xmax=2.) ] + #self.Histograms += [ defineHistogram('rE33E77', type='TH1F', title="EFPhoton Hypo e233/e277; e233/e277", xbins=50, xmin=0., xmax=2.) ] + #self.Histograms += [ defineHistogram('Eratio', type='TH1F', title="EFPhoton Hypo Eratio; Eratio", xbins=40, xmin=-0.1, xmax=1.5) ] + + #---------------------------------------------------------- + #AT Jan2010 + #----BitDef for Trigger-coded 28-Bit isEMTrig + cuts=['ClusterEtaRange','ClusterHadronicLeakage','empty2','empty3','ClusterMiddleEnergy','ClusterMiddleEratio37 ', + 'ClusterMiddleEratio33','ClusterMiddleWidth','ClusterStripsEratio','ClusterStripsDeltaEmax2', + 'ClusterStripsDeltaE ','ClusterStripsWtot','ClusterStripsFracm','ClusterStripsWeta1c', + 'ClusterIsolation','ClusterStripsDEmaxs1','TrackBlayer','TrackPixel','TrackSi','TrackA0','TrackMatchEta', + 'TrackMatchPhi','TrackMatchEoverP','empty23','TrackTRThits','TrackTRTratio','TrackTRTratio90', 'TrackIsolation'] + labelsDescription = '' + for c in cuts: + labelsDescription += c+':' + + + # + #----BitDefElectron for Offline 32-Bit isEM (valid for LowLumi, at HighLumi must use BitDefPhoton) + # + cuts=['ClusterEtaRange ','ConversionMatch','ClusterHadronicLeakage ','ClusterMiddleEnergy ', + 'ClusterMiddleEratio37 ','ClusterMiddleEratio33 ','ClusterMiddleWidth ','f3', + 'ClusterStripsEratio ','ClusterStripsDeltaEmax2 ','ClusterStripsDeltaE ', + 'ClusterStripsWtot ','ClusterStripsFracm ','ClusterStripsWeta1c ','empty14', + 'ClusterStripsDEmaxs1 ','TrackBlayer ','TrackPixel ','TrackSi ', + 'TrackA0 ','TrackMatchEta ','TrackMatchPhi ','TrackMatchEoverP ','empty23', + 'TrackTRThits ','TrackTRTratio ','TrackTRTratio90 ','TrackA0Tight','TrackMatchEtaTight', + 'Isolation ','ClusterIsolation ','TrackIsolation '] + labelsDescription = '' + for c in cuts: + labelsDescription += c+':' + + + #isEMTrig Monitoring Histograms - Before/After Offline isEM cuts are applied + self.Histograms += [ defineHistogram('IsEMAfterCut', type='TH1I', title="EFElectron Hypo passed cuts from isEM flag; cut", + xbins=32, xmin=-0.5, xmax=31.5, opt="kVec", labels=labelsDescription) ] + self.Histograms += [ defineHistogram('IsEMBeforeCut', type='TH1I', title="EFElectron Hypo passed cuts from isEM flag; cut", + xbins=32, xmin=-0.5, xmax=31.5, opt="kVec", labels=labelsDescription) ] + self.Histograms += [ defineHistogram('IsEMRequiredBitsBeforeCut', type='TH1I', title="Required Bits for isEM flag Before Cut; cut", + xbins=32, xmin=-0.5, xmax=31.5, opt="kVec", labels=labelsDescription) ] + self.Histograms += [ defineHistogram('IsEMRequiredBitsAfterCut', type='TH1I', title="Required Bits for isEM flag After Cut; cut", + xbins=32, xmin=-0.5, xmax=31.5, opt="kVec", labels=labelsDescription) ] + #---------------------------------------------------------- + + cuts=["loose","medium","tight"] + + labelsDescription = '' + for c in cuts: + labelsDescription += c+':' + + #AT Aug2011: deactivate histogram egIsEM - outdated + #self.Histograms += [ defineHistogram('egIsEM', type='TH1I', title="EFEgammaHypo isEM; Cut", + # xbins=3, xmin=0.5, xmax=3.5, labels=labelsDescription)] + + +class TrigEFPhotonHypoCosmicMonitoring(TrigGenericMonitoringToolConfig): + def __init__ (self, name="TrigEFPhotonHypoCosmicMonitoring"): + super(TrigEFPhotonHypoCosmicMonitoring, self).__init__(name) + self.defineTarget("Cosmic") + + cuts=['Input','has egammaContainer','isEM','isEMTrig', 'has caloCluster', 'Cluster Et', 'has EMShower', + 'OldSet1','OldSet2','OldSet3'] + + labelsDescription = '' + for c in cuts: + labelsDescription += c+':' + + + self.Histograms = [ defineHistogram('CutCounter', type='TH1F', title="EFPhoton Hypo cut counter; Cut", + xbins=10, xmin=0.5, xmax=10.5, opt="kCumulative", labels=labelsDescription) ] + self.Histograms += [ defineHistogram('Et', type='TH1F', title="EFPhoton Hypo E_{T}; E_{T}^{em} [MeV]", xbins=50, xmin=0., xmax=70000.) ] + self.Histograms += [ defineHistogram('Eta', type='TH1F', title="EFPhoton Hypo #eta; #eta", xbins=50, xmin=-3.5, xmax=3.5) ] + self.Histograms += [ defineHistogram('Phi', type='TH1F', title="EFPhoton Hypo #phi; #phi", xbins=64, xmin=-3.2, xmax=3.2) ] + #self.Histograms += [ defineHistogram('rE37E77', type='TH1F', title="EFPhoton Hypo e237/e277; e237/e277", xbins=50, xmin=0., xmax=2.) ] + #self.Histograms += [ defineHistogram('rE33E77', type='TH1F', title="EFPhoton Hypo e233/e277; e233/e277", xbins=50, xmin=0., xmax=2.) ] + #self.Histograms += [ defineHistogram('Eratio', type='TH1F', title="EFPhoton Hypo Eratio; Eratio", xbins=50, xmin=-0.1, xmax=1.5) ] + + + #---------------------------------------------------------- + #AT Jan2010 + #----BitDef for Trigger-coded 28-Bit isEMTrig + cuts=['ClusterEtaRange','ClusterHadronicLeakage','empty2','empty3','ClusterMiddleEnergy','ClusterMiddleEratio37 ', + 'ClusterMiddleEratio33','ClusterMiddleWidth','ClusterStripsEratio','ClusterStripsDeltaEmax2', + 'ClusterStripsDeltaE ','ClusterStripsWtot','ClusterStripsFracm','ClusterStripsWeta1c', + 'ClusterIsolation','ClusterStripsDEmaxs1','TrackBlayer','TrackPixel','TrackSi','TrackA0','TrackMatchEta', + 'TrackMatchPhi','TrackMatchEoverP','empty23','TrackTRThits','TrackTRTratio','TrackTRTratio90', 'TrackIsolation'] + labelsDescription = '' + for c in cuts: + labelsDescription += c+':' + + + # + #----BitDefElectron for Offline 32-Bit isEM (valid for LowLumi, at HighLumi must use BitDefPhoton) + # + cuts=['ClusterEtaRange ','ConversionMatch','ClusterHadronicLeakage ','ClusterMiddleEnergy ', + 'ClusterMiddleEratio37 ','ClusterMiddleEratio33 ','ClusterMiddleWidth ','f3', + 'ClusterStripsEratio ','ClusterStripsDeltaEmax2 ','ClusterStripsDeltaE ', + 'ClusterStripsWtot ','ClusterStripsFracm ','ClusterStripsWeta1c ','empty14', + 'ClusterStripsDEmaxs1 ','TrackBlayer ','TrackPixel ','TrackSi ', + 'TrackA0 ','TrackMatchEta ','TrackMatchPhi ','TrackMatchEoverP ','empty23', + 'TrackTRThits ','TrackTRTratio ','TrackTRTratio90 ','TrackA0Tight','TrackMatchEtaTight', + 'Isolation ','ClusterIsolation ','TrackIsolation '] + labelsDescription = '' + for c in cuts: + labelsDescription += c+':' + + + #isEMTrig Monitoring Histograms - Before/After Offline isEM cuts are applied + self.Histograms += [ defineHistogram('IsEMAfterCut', type='TH1I', title="EFElectron Hypo passed cuts from isEM flag; cut", + xbins=32, xmin=-0.5, xmax=31.5, opt="kVec", labels=labelsDescription) ] + self.Histograms += [ defineHistogram('IsEMBeforeCut', type='TH1I', title="EFElectron Hypo passed cuts from isEM flag; cut", + xbins=32, xmin=-0.5, xmax=31.5, opt="kVec", labels=labelsDescription) ] + self.Histograms += [ defineHistogram('IsEMRequiredBitsBeforeCut', type='TH1I', title="Required Bits for isEM flag Before Cut; cut", + xbins=32, xmin=-0.5, xmax=31.5, opt="kVec", labels=labelsDescription) ] + self.Histograms += [ defineHistogram('IsEMRequiredBitsAfterCut', type='TH1I', title="Required Bits for isEM flag After Cut; cut", + xbins=32, xmin=-0.5, xmax=31.5, opt="kVec", labels=labelsDescription) ] + #---------------------------------------------------------- + + + cuts=["loose","medium","tight"] + + labelsDescription = '' + for c in cuts: + labelsDescription += c+':' + + #AT Aug2011: deactivate histogram egIsEM - outdated + #self.Histograms += [ defineHistogram('egIsEM', type='TH1I', title="EFEgammaHypo isEM; Cut", + # xbins=3, xmin=0.5, xmax=3.5, labels=labelsDescription)] + diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFTrackHypoConfig.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFTrackHypoConfig.py new file mode 100755 index 00000000000..e5c67becc9f --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFTrackHypoConfig.py @@ -0,0 +1,100 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +############################## +# EF Electron Track Hypothesis Algorithm Configuration: +# Phillip Urquijo <Phillip.Urquijo@cern.ch> +# (xAOD) Ryan Mackenzie White <ryan.white@cern.ch> +############################## + +from TrigEgammaHypo.TrigEgammaHypoConf import TrigEFTrackHypo +from TrigMonitorBase.TrigGenericMonitoringToolConfig import defineHistogram, TrigGenericMonitoringToolConfig +from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig + +#### +#### !!!!!!!!!!!!!!!!!!!!!!!!!! +# we have to do something with this, where was this defined before? +from AthenaCommon.SystemOfUnits import GeV + +# monitoring +class EFTrackHypo_OnlineMonitoring(TrigGenericMonitoringToolConfig): + def __init__ (self, name="EFTrackHypo_OnlineMonitoring"): + super(EFTrackHypo_OnlineMonitoring, self).__init__(name) + self.defineTarget("Online") + self.Histograms += [ defineHistogram('pt', + type='TH1F', + title="Track p_{T} (GeV); p_{T} [GeV]", + xbins = 100, xmin=0.0, xmax=50)] + self.Histograms += [ defineHistogram('Phi', + type='TH1F', + title="Phi of track; #phi", + xbins = 100, xmin=-3.2, xmax=3.2)] + self.Histograms += [ defineHistogram('d0', + type='TH1F', + title="d_{0} of track; d_{0}", + xbins = 100, xmin=-100, xmax=100)] + self.Histograms += [ defineHistogram('z0', + type='TH1F', + title="z_{0} of track; z_{0}", + xbins = 100, xmin=-100, xmax=100)] + self.Histograms += [ defineHistogram('numTrkPart', + type='TH1F', + title="Number of input Tracks; Number of tracks", + xbins = 100, xmin=0., xmax=50.)] + + +class EFTrackHypo_ValidationMonitoring(TrigGenericMonitoringToolConfig): + def __init__ (self, name="EFTrackHypo_ValidationMonitoring"): + super(EFTrackHypo_ValidationMonitoring, self).__init__(name) + self.defineTarget("Validation") + + self.Histograms += [ defineHistogram('pt', + type='TH1F', + title="Track p_{T} (GeV); p_{T} [GeV]", + xbins = 100, xmin=0.0, xmax=50)] + self.Histograms += [ defineHistogram('Phi', + type='TH1F', + title="Phi of track; #phi", + xbins = 100, xmin=-3.2, xmax=3.2)] + self.Histograms += [ defineHistogram('d0', + type='TH1F', + title="d_{0} of track; d_{0}", + xbins = 100, xmin=-1.5, xmax=1.5)] + self.Histograms += [ defineHistogram('z0', + type='TH1F', + title="z_{0} of track; z_{0}", + xbins = 100, xmin=-100, xmax=100)] + self.Histograms += [ defineHistogram('numTrkPart', + type='TH1F', + title="Number of input Tracks; Number of tracks", + xbins = 100, xmin=0., xmax=50.)] + + + +#------------------------------------------- +# --- DC14 Menu +# --- Following classes to be used with TriggerMenu +# --- Rely on TM to configure +# --- RMWhite 2014 +# --- Comment, no track variable cuts defined in any hypo. +# --- No Cut only -- threshold passed from TM chain name +class EFTrackHypo_e_NoCut (TrigEFTrackHypo): + __slots__ = [] + def __init__(self, name,threshold): + super( EFTrackHypo_e_NoCut, self ).__init__( name ) + + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll = True + self.AthenaMonTools = [ EFTrackHypo_ValidationMonitoring(), TrigTimeHistToolConfig("Time") ] + +# Track pt cut +# No threshold set +class EFTrackHypo_e (TrigEFTrackHypo): + __slots__ = [] + def __init__(self, name,threshold): + super( EFTrackHypo_e, self ).__init__( name ) + + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll = False + self.AthenaMonTools = [ EFTrackHypo_ValidationMonitoring(), TrigTimeHistToolConfig("Time") ] +#------------------------------------------- + diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEGammaPIDdefs.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEGammaPIDdefs.py new file mode 100644 index 00000000000..04909d918d6 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEGammaPIDdefs.py @@ -0,0 +1,591 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +class TrigEgammaIDQuality: + ElectronIDLoose = 0 + ElectronIDLoose0 = 1 + ElectronIDLoose1 = 2 + ElectronIDLoose2 = 3 + ElectronIDMedium = 4 + ElectronIDMedium1 = 5 + ElectronIDMedium2 = 6 + ElectronIDMedium3 = 7 + ElectronIDMedium_TRT = 8 + ElectronIDTight = 9 + ElectronIDTightEF = 10 + ElectronIDTightEF_TRT = 11 + ElectronIDTightEF_NoEoP_WithTightDeltaEta = 12 + ElectronIDTight1 = 13 + ElectronIDTight2 = 14 + ElectronIDHltTighter = 15 + PhotonIDLoose = 16 + PhotonIDLooseEF = 17 + PhotonIDMediumEF = 18 + PhotonIDTight = 19 + PhotonIDLooseEFTauMass = 20 + +class BitDefElectron: + """ @brief cluster eta range """ + ClusterEtaRange_Electron = 0 + + """ @brief matching to photon (not necessarily conversion--the name is historical) """ + ConversionMatch_Electron = 1 + + """ @brief cluster leakage into the hadronic calorimeter """ + ClusterHadronicLeakage_Electron = 2 + """ @brief energy in 2nd sampling (e.g E277>0) """ + ClusterMiddleEnergy_Electron = 3 + """ @brief energy ratio in 2nd sampling (e.g E237/E277) """ + ClusterMiddleEratio37_Electron = 4 + """ @brief energy ratio in 2nd sampling (e.g E233/E237) """ + ClusterMiddleEratio33_Electron = 5 + """ @brief width in the second sampling (e.g Weta2) """ + ClusterMiddleWidth_Electron = 6 + """ @brief energy fraction in the third layer """ + ClusterBackEnergyFraction_Electron = 7 + """ @brief fraction of energy found in 1st sampling (NB: not used in fact for electrons)""" + ClusterStripsEratio_Electron = 8 + """ @brief energy of 2nd maximum in 1st sampling ~e2tsts1/(1000+const_lumi*et) """ + ClusterStripsDeltaEmax2_Electron = 9 + """ @brief difference between 2nd maximum and 1st minimum in strips (e2tsts1-emins1) """ + ClusterStripsDeltaE_Electron = 10 + """ @brief shower width in 1st sampling """ + ClusterStripsWtot_Electron = 11 + """ @brief shower shape in shower core 1st sampling """ + ClusterStripsFracm_Electron = 12 + """ @brief shower width weighted by distance from the maximum one """ + ClusterStripsWeta1c_Electron = 13 + + """ @brief difference between max and 2nd max in strips """ + ClusterStripsDEmaxs1_Electron = 15 + """ @brief B layer hit """ + TrackBlayer_Electron = 16 + """ @brief number of Pixel hits """ + TrackPixel_Electron = 17 + """ @brief number of Pixel and SCT hits """ + TrackSi_Electron = 18 + """ @brief distance of closet approach """ + TrackA0_Electron = 19 + """ @brief eta difference between cluster and extrapolated track in the 1st sampling """ + TrackMatchEta_Electron = 20 + """ @brief phi difference between cluster and extrapolated track in the 2nd sampling """ + TrackMatchPhi_Electron = 21 + """ @brief energy-momentum match """ + TrackMatchEoverP_Electron = 22 + """ @brief number of TRT hits """ + TrackTRThits_Electron = 24 + """ @brief ratio of high to all TRT hits for isolated electrons """ + TrackTRTratio_Electron = 25 + """ @brief ratio of high to all TRT hits for non-isolated electrons """ + TrackTRTratio90_Electron = 26 + + """ @brief distance of closet approach for tight selection """ + TrackA0Tight_Electron = 27 + """ @brief eta difference between cluster and extrapolated track in the 1st sampling for tight selection """ + TrackMatchEtaTight_Electron = 28 + + """ @brief isolation """ + Isolation_Electron = 29 + """ @brief calorimetric isolation """ + ClusterIsolation_Electron = 30 + """ @brief tracker isolation """ + TrackIsolation_Electron = 31 + + +# +# cut definition for electrons +# +class CutDefElectron: + """ @brief cuts of hadronic leakage""" + HADLEAKETA_ELECTRON = \ + 0x1 << BitDefElectron.ClusterEtaRange_Electron | \ + 0x1 << BitDefElectron.ClusterHadronicLeakage_Electron + """ @brief old cuts in strips (without ClusterStripsDEmaxs1)""" + CALOSTRIPSOLD_ELECTRON = \ + 0x1 << BitDefElectron.ClusterStripsEratio_Electron | \ + 0x1 << BitDefElectron.ClusterStripsDeltaEmax2_Electron | \ + 0x1 << BitDefElectron.ClusterStripsDeltaE_Electron | \ + 0x1 << BitDefElectron.ClusterStripsWtot_Electron | \ + 0x1 << BitDefElectron.ClusterStripsFracm_Electron | \ + 0x1 << BitDefElectron.ClusterStripsWeta1c_Electron + """ @brief cuts in strips (with ClusterStripsDEmaxs1)""" + CALOSTRIPS_ELECTRON = \ + 0x1 << BitDefElectron.ClusterStripsEratio_Electron | \ + 0x1 << BitDefElectron.ClusterStripsDeltaEmax2_Electron | \ + 0x1 << BitDefElectron.ClusterStripsDeltaE_Electron | \ + 0x1 << BitDefElectron.ClusterStripsWtot_Electron | \ + 0x1 << BitDefElectron.ClusterStripsFracm_Electron | \ + 0x1 << BitDefElectron.ClusterStripsWeta1c_Electron | \ + 0x1 << BitDefElectron.ClusterStripsDEmaxs1_Electron + """ @brief cuts in strips for loose electrons sampling""" + CALOSTRIPS_LOOSE_ELECTRON = \ + 0x1 << BitDefElectron.ClusterStripsWtot_Electron | \ + 0x1 << BitDefElectron.ClusterStripsDEmaxs1_Electron + + """ @brief cuts in middle sampling""" + CALOMIDDLE_ELECTRON = \ + 0x1 << BitDefElectron.ClusterMiddleEnergy_Electron | \ + 0x1 << BitDefElectron.ClusterMiddleEratio37_Electron | \ + 0x1 << BitDefElectron.ClusterMiddleWidth_Electron + """ @brief calorimeter isolation""" + CALORIMETRICISOLATION_ELECTRON = \ + 0x1 << BitDefElectron.ClusterIsolation_Electron + + """ @brief "old" all cuts in calorimeter (except isolation) without ClusterStripsDEmaxs1 """ + CALONOISOOLD_ELECTRON = HADLEAKETA_ELECTRON | CALOSTRIPSOLD_ELECTRON | CALOMIDDLE_ELECTRON + """ @brief "old" all cuts in calorimeter (including isolation) without ClusterStripsDEmaxs1 """ + CALOOLD_ELECTRON = CALONOISOOLD_ELECTRON | CALORIMETRICISOLATION_ELECTRON + """ @brief all cuts in calorimeter (except isolation)""" + CALO_ELECTRON = HADLEAKETA_ELECTRON | CALOSTRIPS_ELECTRON | CALOMIDDLE_ELECTRON + + """ @brief Track quality cuts except b-layer for electrons""" + TRACKINGNOBLAYER_ELECTRON = \ + 0x1 << BitDefElectron.TrackPixel_Electron | \ + 0x1 << BitDefElectron.TrackSi_Electron | \ + 0x1 << BitDefElectron.TrackA0_Electron + """ @brief Track quality cuts except b-layer and A0 for electrons""" + TRACKINGLOOSE_ELECTRON = \ + 0x1 << BitDefElectron.TrackPixel_Electron | \ + 0x1 << BitDefElectron.TrackSi_Electron + """ @brief Track quality cuts for electrons""" + TRACKING_ELECTRON = \ + TRACKINGNOBLAYER_ELECTRON | \ + 0x1 << BitDefElectron.TrackBlayer_Electron + """ @brief Track cluster matching in eta for electrons""" + TRACKMATCHDETA_ELECTRON = \ + 0x1 << BitDefElectron.TrackMatchEta_Electron + """ @brief Track cluster matching in eta, phi for electrons""" + TRACKMATCHNOEOVERP_ELECTRON = \ + 0x1 << BitDefElectron.TrackMatchEta_Electron | \ + 0x1 << BitDefElectron.TrackMatchPhi_Electron + """ @brief Track cluster matching in eta, phi, E/p for electrons""" + TRACKMATCH_ELECTRON = \ + 0x1 << BitDefElectron.TrackMatchEta_Electron | \ + 0x1 << BitDefElectron.TrackMatchPhi_Electron | \ + 0x1 << BitDefElectron.TrackMatchEoverP_Electron + """ @brief Tight Track cluster matching """ + TRACKMATCHTIGHT_ELECTRON = \ + 0x1 << BitDefElectron.TrackMatchEtaTight_Electron | \ + 0x1 << BitDefElectron.TrackA0Tight_Electron + """ @brief Tight conversion matching """ + CONVMATCH_ELECTRON = \ + 0x1 << BitDefElectron.ConversionMatch_Electron + + """ @brief TRT hits and TR ratio for electrons""" + TRT_ELECTRON = \ + 0x1 << BitDefElectron.TrackTRThits_Electron | \ + 0x1 << BitDefElectron.TrackTRTratio_Electron + """ @brief TRT hits and TR ratio (@90% eff) for electrons""" + TRT90_ELECTRON = \ + 0x1 << BitDefElectron.TrackTRThits_Electron | \ + 0x1 << BitDefElectron.TrackTRTratio90_Electron + + """ @brief isolation by tracker """ + TRACKINGISOLATION_ELECTRON = \ + 0x1 << BitDefElectron.TrackIsolation_Electron + """ @brief isolation for electrons is combination of calo and tracker """ + ISOLATION_ELECTRON = \ + 0x1 << BitDefElectron.Isolation_Electron + """ @brief isolation for electrons is combination of calo and tracker """ + CALOTRACKISOLATION_ELECTRON = \ + CALORIMETRICISOLATION_ELECTRON | TRACKINGISOLATION_ELECTRON + + """ @brief all cuts except TRT for electrons""" + ALLNOTRT_ELECTRON = \ + TRACKING_ELECTRON | TRACKMATCH_ELECTRON | CALO_ELECTRON + """ @brief all cuts except TRT for electrons(old way)""" + ALLNOTRTOLD_ELECTRON = \ + TRACKING_ELECTRON | TRACKMATCH_ELECTRON | CALOOLD_ELECTRON + """ @brief all cuts for electrons""" + ALL_ELECTRON = \ + ALLNOTRT_ELECTRON | TRT_ELECTRON + """ @brief all cuts fo electrons (old way)""" + ALLOLD_ELECTRON = \ + ALLNOTRTOLD_ELECTRON | TRT_ELECTRON + + ############# + ### Added TrigEGamma Definitions + """ @brief Tight Track cluster matching redefined for EF """ + TRACKMATCHTIGHT_ELECTRON_EF = 0x1 << BitDefElectron.TrackA0Tight_Electron + """ @brief Track-cluster matching with tight deta for electrons""" + TRACKMATCHDETATIGHT_ELECTRON = 0x1 << BitDefElectron.TrackMatchEtaTight_Electron + """ @brief Track-cluster matching in eta, E/p for electrons redefined for EF""" + TRACKMATCH_ELECTRON_EF = 0x1 << BitDefElectron.TrackMatchEta_Electron | \ + 0x1 << BitDefElectron.TrackMatchEoverP_Electron + """ @brief Track-cluster matching in eta for electrons redefined for EF""" + TRACKMATCH_ELECTRON_NoEoP_EF = 0x1 << BitDefElectron.TrackMatchEta_Electron + """ @brief Track quality cuts except b-layer and A0 for electrons""" + TRACKINGNOBLAYERNOA0_ELECTRON = \ + 0x1 << BitDefElectron.TrackPixel_Electron | \ + 0x1 << BitDefElectron.TrackSi_Electron + +class SelectionDefElectron: + + # old definitions of cuts as in rel<15.2.0 +# ElectronLooseOLD = CutDefElectron.CALOMIDDLE_ELECTRON | CutDefElectron.HADLEAKETA_ELECTRON +# ElectronMediumOLD = CutDefElectron.CALOOLD_ELECTRON | \ +# CutDefElectron.TRACKINGNOBLAYER_ELECTRON | CutDefElectron.TRACKMATCHDETA_ELECTRON +# ElectronMediumNoIsoOLD = CutDefElectron.CALONOISOOLD_ELECTRON | \ +# CutDefElectron.TRACKINGNOBLAYER_ELECTRON | CutDefElectron.TRACKMATCHDETA_ELECTRON +# ElectronTightOLD = CutDefElectron.ALLOLD_ELECTRON +# ElectronTightTRTNoIsoOLD = CutDefElectron.TRACKING_ELECTRON | \ +# CutDefElectron.TRACKMATCH_ELECTRON | CutDefElectron.CALONOISOOLD_ELECTRON | CutDefElectron.TRT90_ELECTRON +# ElectronTightNoIsolationOLD = ElectronTightTRTNoIsoOLD + + + # new definitions of cuts as in rel>=15.2.0 + # since 15.7.0 also Tight selection contains + # TRACKMATCHTIGHT_ELECTRON + # CONVMATCH_ELECTRON + # since rel 16.0.0 definition of ElectronTight has changed + + """ @brief Loose electron selection """ + ElectronLoose = CutDefElectron.CALOMIDDLE_ELECTRON | CutDefElectron.HADLEAKETA_ELECTRON + """ @brief Medium electron selection with the delta eta cut has been removed """ + ElectronMedium_WithoutTrackMatch = CutDefElectron.CALO_ELECTRON | CutDefElectron.TRACKINGNOBLAYER_ELECTRON + """ @brief Medium electron selection without deta match with isolation requirement """ + ElectronMediumIso_WithoutTrackMatch = ElectronMedium_WithoutTrackMatch | CutDefElectron.ISOLATION_ELECTRON + """ @brief Medium electron selection with deta match (was ElectronMedium in 15.X)""" + ElectronMedium_WithTrackMatch = CutDefElectron.CALO_ELECTRON | \ + CutDefElectron.TRACKINGNOBLAYER_ELECTRON | CutDefElectron.TRACKMATCHDETA_ELECTRON + """ @brief MediumIso electron selection with deta match (was ElectronMediumIso in 15.X)""" + ElectronMediumIso_WithTrackMatch = ElectronMedium_WithTrackMatch | CutDefElectron.ISOLATION_ELECTRON + """ @brief Medium electron selecton """ + ElectronMedium = ElectronMedium_WithTrackMatch + """ @brief MediumIso electron selecton """ + ElectronMediumIso = ElectronMediumIso_WithTrackMatch + """ @brief obsolete - kept not crash clients """ + ElectronMediumNoIso = ElectronMedium + + """ @brief Tight electron without track match (corresponds to RobusterTight in 15.6.X but + without the deltaEta bits TrackMatchEta_Electron and TrackMatchEtaTight_Electron) """ + ElectronTight_WithoutTrackMatch = CutDefElectron.CALO_ELECTRON | \ + CutDefElectron.TRACKING_ELECTRON | \ + 0x1 << BitDefElectron.TrackMatchEoverP_Electron | \ + 0x1 << BitDefElectron.TrackA0Tight_Electron | \ + CutDefElectron.CONVMATCH_ELECTRON | CutDefElectron.TRT_ELECTRON + + """ @brief Tight without conversion requirement or track match """ + ElectronTight_WithoutTrackMatch_NoConvCut = CutDefElectron.CALO_ELECTRON | \ + CutDefElectron.TRACKING_ELECTRON | \ + 0x1 << BitDefElectron.TrackMatchEoverP_Electron | \ + 0x1 << BitDefElectron.TrackA0Tight_Electron | \ + CutDefElectron.TRT_ELECTRON + + """ @brief Tight_WithTrackMatch electron selection with isolation requirement """ + ElectronTightIso_WithoutTrackMatch = ElectronTight_WithoutTrackMatch | CutDefElectron.ISOLATION_ELECTRON + + """ @brief Tight electron selection with track match""" + ElectronTight_WithTrackMatch = CutDefElectron.CALO_ELECTRON | \ + CutDefElectron.TRACKING_ELECTRON | CutDefElectron.TRACKMATCH_ELECTRON | \ + CutDefElectron.TRACKMATCHTIGHT_ELECTRON | CutDefElectron.CONVMATCH_ELECTRON | \ + CutDefElectron.TRT_ELECTRON + + """ @brief Tight with track match without conversion requirement """ + ElectronTight_WithTrackMatch_NoConvCut = \ + CutDefElectron.CALO_ELECTRON | CutDefElectron.TRACKING_ELECTRON | CutDefElectron.TRACKMATCH_ELECTRON | \ + CutDefElectron.TRACKMATCHTIGHT_ELECTRON | CutDefElectron.TRT_ELECTRON + + """ @brief Tight_WithTrackMatch electron selection with isolation requirement """ + ElectronTightIso_WithTrackMatch = ElectronTight_WithTrackMatch | CutDefElectron.ISOLATION_ELECTRON + + """ @brief Tight electron selection """ + ElectronTight = ElectronTight_WithTrackMatch + """ @brief Tight without conversion requirement """ + ElectronTight_NoConvCut = ElectronTight_WithTrackMatch_NoConvCut + """ @brief Tight electron selection with isolation requirement """ + ElectronTightIso = ElectronTightIso_WithTrackMatch + + """ @brief obsolete - kept not to crash clients """ + ElectronTightTRTNoIso = ElectronTight + """ @brief obsolete - kept not to crash clients """ + ElectronTightNoIsolation = ElectronTight + + """ @brief Tight electron (corresponds to RobusterTight in 15.6.X with the loose deltaEta bit + TrackMatchEta_Electron but with out the tight one TrackMatchEtaTight_Electron) """ + ElectronTight_WithLooseEtaTrackMatch = CutDefElectron.CALO_ELECTRON | \ + CutDefElectron.TRACKING_ELECTRON | CutDefElectron.TRACKMATCHDETA_ELECTRON | \ + 0x1 << BitDefElectron.TrackMatchEoverP_Electron | \ + 0x1 << BitDefElectron.TrackA0Tight_Electron | \ + CutDefElectron.CONVMATCH_ELECTRON | CutDefElectron.TRT_ELECTRON + + """ @brief Tight electron (corresponds to RobusterTight in 15.6.X with the deltaEta bits + TrackMatchEta_Electron and TrackMatchEtaTight_Electron) """ + ElectronTight_WithTightEtaTrackMatch = CutDefElectron.CALO_ELECTRON | \ + CutDefElectron.TRACKING_ELECTRON | CutDefElectron.TRACKMATCHDETA_ELECTRON | \ + CutDefElectron.TRACKMATCHTIGHT_ELECTRON | \ + 0x1 << BitDefElectron.TrackMatchEoverP_Electron | \ + CutDefElectron.CONVMATCH_ELECTRON | CutDefElectron.TRT_ELECTRON + + """ @brief Tight_WithLooseEtaTrackMatch electron selection with isolation requirement """ + ElectronTightIso_WithLooseEtaTrackMatch = ElectronTight_WithLooseEtaTrackMatch | \ + CutDefElectron.ISOLATION_ELECTRON + + """ @brief Tight_WithTightEtaTrackMatch electron selection with isolation requirement """ + ElectronTightIso_WithTightEtaTrackMatch = ElectronTight_WithTightEtaTrackMatch | \ + CutDefElectron.ISOLATION_ELECTRON + + """ @brief Tight electron (NB: kept for backward compatibility) """ + ElectronTightRobust = ElectronTight_WithLooseEtaTrackMatch + + ############# + ### Added TrigEGamma Definitions + """ @brief Loose1 Electron """ + ElectronLoose1 = CutDefElectron.CALOMIDDLE_ELECTRON | \ + CutDefElectron.HADLEAKETA_ELECTRON | \ + CutDefElectron.CALOSTRIPS_LOOSE_ELECTRON | \ + CutDefElectron.TRACKINGLOOSE_ELECTRON | \ + CutDefElectron.TRACKMATCHDETA_ELECTRON + """ @brief Loose2 Electron """ + ElectronLoose2 = CutDefElectron.CALO_ELECTRON | CutDefElectron.TRACKING_ELECTRON | \ + CutDefElectron.TRACKMATCHDETATIGHT_ELECTRON + + """ @brief Medium Electron for TRT chains """ + ElectronMedium_TRT = CutDefElectron.CALO_ELECTRON + """ @brief Medium1 Electron definition for trigger """ + #AT: 7Sept2011, remove TRT Hits from medium1, following offline medium++ prescription + ElectronMedium1 = CutDefElectron.CALO_ELECTRON | CutDefElectron.TRACKING_ELECTRON | \ + CutDefElectron.TRACKMATCHDETA_ELECTRON | \ + 0x1 << BitDefElectron.TrackTRTratio_Electron | \ + 0x1 << BitDefElectron.ClusterBackEnergyFraction_Electron + """ @brief Medium2 Electron definition for trigger """ + ElectronMedium2 = CutDefElectron.CALO_ELECTRON | CutDefElectron.TRACKING_ELECTRON | \ + CutDefElectron.TRACKMATCHDETATIGHT_ELECTRON | \ + 0x1 << BitDefElectron.TrackTRTratio_Electron + ## ElectronMedium2 = CutDefElectron.CALO_ELECTRON | CutDefElectron.TRACKING_ELECTRON | \ +## CutDefElectron.TRACKMATCHDETATIGHT_ELECTRON | CutDefElectron.TRT_ELECTRON + """ @brief Medium3 Electron definition for trigger """ + ElectronMedium3 = CutDefElectron.CALO_ELECTRON | CutDefElectron.TRACKING_ELECTRON | \ + CutDefElectron.TRACKMATCHDETATIGHT_ELECTRON | CutDefElectron.TRT_ELECTRON + """ @brief Medium4 Electron definition for trigger """ + ElectronMedium4 = CutDefElectron.CALO_ELECTRON | CutDefElectron.TRACKING_ELECTRON | \ + CutDefElectron.TRACKMATCHDETATIGHT_ELECTRON | CutDefElectron.TRT_ELECTRON + + """ @brief Tight Electron definition for EF, removes ConversionMatch,TrackMatchPhi,TrackMatchEtaTight bits""" + ElectronTightEF = CutDefElectron.CALO_ELECTRON | CutDefElectron.TRACKING_ELECTRON | \ + CutDefElectron.TRACKMATCH_ELECTRON_EF | CutDefElectron.TRACKMATCHTIGHT_ELECTRON_EF | \ + CutDefElectron.TRT_ELECTRON + """ @brief Tight Electron definition for EF, removes ConversionMatch,TrackMatchPhi, TrackMatchEoverP and add TrackMatchEtaTight bits""" + ElectronTightEF_NoEoP_WithTightDeltaEta = CutDefElectron.CALO_ELECTRON | CutDefElectron.TRACKING_ELECTRON | \ + CutDefElectron.TRACKMATCH_ELECTRON_NoEoP_EF | CutDefElectron.TRACKMATCHTIGHT_ELECTRON | \ + CutDefElectron.TRT_ELECTRON + """ @brief Tight Electron definition for TRT chains in EF """ + ElectronTightEF_TRT = CutDefElectron.CALO_ELECTRON | CutDefElectron.TRT_ELECTRON + """ @brief Tight Electron1 definition for e15_tight in EF """ + ElectronTight1 = CutDefElectron.CALO_ELECTRON | CutDefElectron.TRACKING_ELECTRON | \ + CutDefElectron.TRACKMATCHDETA_ELECTRON | CutDefElectron.TRACKMATCH_ELECTRON_EF | \ + CutDefElectron.TRACKMATCHTIGHT_ELECTRON | CutDefElectron.TRT_ELECTRON + """ @brief Tight Electron definition for e5_tight """ + ElectronTight2 = CutDefElectron.CALO_ELECTRON | CutDefElectron.TRACKING_ELECTRON | \ + CutDefElectron.TRACKMATCHDETA_ELECTRON | CutDefElectron.TRT_ELECTRON | \ + 0x1 << BitDefElectron.ClusterBackEnergyFraction_Electron + """ @brief Tight Electron definition for e5_tight """ + ElectronHltTighter = CutDefElectron.CALO_ELECTRON | CutDefElectron.TRACKING_ELECTRON | \ + CutDefElectron.TRACKMATCHDETA_ELECTRON | CutDefElectron.TRT_ELECTRON | \ + CutDefElectron.TRACKMATCHTIGHT_ELECTRON_EF | CutDefElectron.TRACKMATCH_ELECTRON_EF + + """ @brief Electron definition for Et cut with track quality""" + Electron_trk = BitDefElectron.TrackSi_Electron | BitDefElectron.TrackPixel_Electron + Electron_trkTRT = Electron_trk | CutDefElectron.TRT_ELECTRON + + """ @brief Loose electron for background trigger """ + ElectronLooseTrk = ElectronLoose | CutDefElectron.TRACKINGNOBLAYERNOA0_ELECTRON | \ + CutDefElectron.TRACKMATCHDETA_ELECTRON + +""" \enum Bitdefinitons for the egamma class for photon identification + see egammaParameters for info on the variable definitions """ +class BitDefPhoton: + """ @brief cluster eta range """ + ClusterEtaRange_Photon = 0 + """ @brief cluster eta range """ + ClusterEtaRange_PhotonLoose = 1 + + # selection for Loose photons + """ @brief cluster leakage into the hadronic calorimeter """ + ClusterHadronicLeakage_PhotonLoose = 2 + """ @brief energy in 2nd sampling (e277) """ + ClusterMiddleEnergy_PhotonLoose = 3 + """ @brief energy ratio in 2nd sampling """ + ClusterMiddleEratio37_PhotonLoose = 4 + """ @brief energy ratio in 2nd sampling """ + ClusterMiddleEratio33_PhotonLoose = 5 + """ @brief width in the second sampling """ + ClusterMiddleWidth_PhotonLoose = 6 + + """ @brief energy fraction in the third layer """ + ClusterBackEnergyFraction_Photon = 7 + + # selection for tight photons + """ @brief cluster leakage into the hadronic calorimeter """ + ClusterHadronicLeakage_Photon = 10 + """ @brief energy in 2nd sampling (e277) """ + ClusterMiddleEnergy_Photon = 11 + """ @brief energy ratio in 2nd sampling """ + ClusterMiddleEratio37_Photon = 12 + """ @brief energy ratio in 2nd sampling for photons """ + ClusterMiddleEratio33_Photon = 13 + """ @brief width in the second sampling """ + ClusterMiddleWidth_Photon = 14 + + """ @brief fraction of energy found in 1st sampling """ + ClusterStripsEratio_Photon = 15 + """ @brief energy of 2nd maximum in 1st sampling ~e2tsts1/(1000+const_lumi*et) """ + ClusterStripsDeltaEmax2_Photon = 16 + """ @brief difference between 2nd maximum and 1st minimum in strips (e2tsts1-emins1) """ + ClusterStripsDeltaE_Photon = 17 + """ @brief shower width in 1st sampling """ + ClusterStripsWtot_Photon = 18 + """ @brief shower shape in shower core 1st sampling """ + ClusterStripsFracm_Photon = 19 + """ @brief shower width weighted by distance from the maximum one """ + ClusterStripsWeta1c_Photon = 20 + """ @brief difference between max and 2nd max in strips """ + ClusterStripsDEmaxs1_Photon = 21 + + """ @brief energy-momentum match for photon selection""" + TrackMatchEoverP_Photon = 22 + + """ @brief ambiguity resolution for photon (vs electron) """ + AmbiguityResolution_Photon = 23 + + """ @brief isolation """ + Isolation_Photon = 29 + """ @brief calorimetric isolation for photon selection """ + ClusterIsolation_Photon = 30 + """ @brief tracker isolation for photon selection """ + TrackIsolation_Photon = 31 + + + +# +# Photon cut definitions +# +class CutDefPhoton: + """ @brief cuts of hadronic leakage (for Loose selection)""" + HADLEAKETA_PHOTONLOOSE = \ + 0x1 << BitDefPhoton.ClusterEtaRange_PhotonLoose | \ + 0x1 << BitDefPhoton.ClusterHadronicLeakage_PhotonLoose + """ @brief cuts of hadronic leakage""" + HADLEAKETA_PHOTON = \ + 0x1 << BitDefPhoton.ClusterEtaRange_Photon | \ + 0x1 << BitDefPhoton.ClusterHadronicLeakage_Photon + """ @brief cuts in middle sampling (for Loose selection)""" + CALOMIDDLE_PHOTONLOOSE= \ + 0x1 << BitDefPhoton.ClusterMiddleEnergy_PhotonLoose | \ + 0x1 << BitDefPhoton.ClusterMiddleEratio37_PhotonLoose | \ + 0x1 << BitDefPhoton.ClusterMiddleEratio33_PhotonLoose | \ + 0x1 << BitDefPhoton.ClusterMiddleWidth_PhotonLoose + """ @brief cuts in middle sampling""" + CALOMIDDLE_PHOTON = \ + 0x1 << BitDefPhoton.ClusterMiddleEnergy_Photon | \ + 0x1 << BitDefPhoton.ClusterMiddleEratio37_Photon | \ + 0x1 << BitDefPhoton.ClusterMiddleEratio33_Photon | \ + 0x1 << BitDefPhoton.ClusterMiddleWidth_Photon + """ @brief old cuts in strips (without ClusterStripsDEmaxs1)""" + CALOSTRIPSOLD_PHOTON = \ + 0x1 << BitDefPhoton.ClusterStripsEratio_Photon | \ + 0x1 << BitDefPhoton.ClusterStripsDeltaEmax2_Photon | \ + 0x1 << BitDefPhoton.ClusterStripsDeltaE_Photon | \ + 0x1 << BitDefPhoton.ClusterStripsWtot_Photon | \ + 0x1 << BitDefPhoton.ClusterStripsFracm_Photon | \ + 0x1 << BitDefPhoton.ClusterStripsWeta1c_Photon + """ @brief cuts in strips (with ClusterStripsDEmaxs1)""" + CALOSTRIPS_PHOTON = \ + 0x1 << BitDefPhoton.ClusterStripsEratio_Photon | \ + 0x1 << BitDefPhoton.ClusterStripsDeltaEmax2_Photon | \ + 0x1 << BitDefPhoton.ClusterStripsDeltaE_Photon | \ + 0x1 << BitDefPhoton.ClusterStripsWtot_Photon | \ + 0x1 << BitDefPhoton.ClusterStripsFracm_Photon | \ + 0x1 << BitDefPhoton.ClusterStripsWeta1c_Photon | \ + 0x1 << BitDefPhoton.ClusterStripsDEmaxs1_Photon + + """ @brief calorimeter isolation""" + CALORIMETRICISOLATION_PHOTON = 0x1 << BitDefPhoton.ClusterIsolation_Photon + """ @brief "old" all cuts in calorimeter (except isolation) without ClusterStripsDEmaxs1 """ + CALONOISOOLD_PHOTON = HADLEAKETA_PHOTON | CALOSTRIPSOLD_PHOTON | CALOMIDDLE_PHOTON + """ @brief all cuts in calorimeter (except isolation)""" + CALO_PHOTON = HADLEAKETA_PHOTON | CALOSTRIPS_PHOTON | CALOMIDDLE_PHOTON + + """ @brief isolation by tracker """ + TRACKINGISOLATION_PHOTON = 0x1 << BitDefPhoton.TrackIsolation_Photon + """ @brief isolation for photons is combination of calo and tracker """ + ISOLATION_PHOTON = 0x1 << BitDefPhoton.Isolation_Photon + """ @brief isolation for photons is combination of calo and tracker """ + CALOTRACKISOLATION_PHOTON = CALORIMETRICISOLATION_PHOTON | TRACKINGISOLATION_PHOTON + + """ @brief Track cluster matching E/p for photons""" + TRACKMATCH_PHOTON = 0x1 << BitDefPhoton.TrackMatchEoverP_Photon + + """ @brief Ambigiuty resolve for photons """ + AMBIGUITYRESOLVE_PHOTON = 0x1 << BitDefPhoton.AmbiguityResolution_Photon + + ####### + ## Added for Trigger + """ @brief cuts of hadronic leakage (for Loose selection)""" + HADLEAKETA_PHOTON_EF = \ + 0x1 << BitDefPhoton.ClusterEtaRange_Photon | \ + 0x1 << BitDefPhoton.ClusterHadronicLeakage_PhotonLoose + + """ @brief cuts of Eratio (for Medium selection)""" + CALO_PHOTON_REAT_WETA2_ERATIO = \ + 0x1 << BitDefPhoton.ClusterEtaRange_Photon | \ + 0x1 << BitDefPhoton.ClusterMiddleEnergy_PhotonLoose | \ + 0x1 << BitDefPhoton.ClusterMiddleEratio37_PhotonLoose | \ + 0x1 << BitDefPhoton.ClusterMiddleWidth_PhotonLoose | \ + 0x1 << BitDefPhoton.ClusterStripsEratio_Photon + + + + +# Photon Selection Definitions +# +class SelectionDefPhoton: + """ @brief Loose photon selection with Ambiguity resolver""" + PhotonLooseAR = CutDefPhoton.CALOMIDDLE_PHOTONLOOSE | CutDefPhoton.HADLEAKETA_PHOTONLOOSE | \ + CutDefPhoton.AMBIGUITYRESOLVE_PHOTON + """ @brief Tight photon selection with Ambiguity resolver""" + PhotonTightAR = CutDefPhoton.CALO_PHOTON | CutDefPhoton.TRACKMATCH_PHOTON | \ + CutDefPhoton.AMBIGUITYRESOLVE_PHOTON + """ @brief Tight photon selection with isolation and Ambiguity resolver""" + PhotonTightARIso = PhotonTightAR | CutDefPhoton.ISOLATION_PHOTON + """ @brief Loose photon selection """ + PhotonLoose = CutDefPhoton.CALOMIDDLE_PHOTONLOOSE | CutDefPhoton.HADLEAKETA_PHOTONLOOSE + """ @brief Tight photon selection """ + PhotonTight = CutDefPhoton.CALO_PHOTON + """ @brief Tight photon selection with isolation""" + PhotonTightIso = PhotonTight | CutDefPhoton.ISOLATION_PHOTON + """ @brief Tight photon (old definition) """ + PhotonTightOLD = CutDefPhoton.CALONOISOOLD_PHOTON | CutDefPhoton.CALORIMETRICISOLATION_PHOTON + + ############# + ### Added TrigEGamma Definitions + """ @brief Loose photon selection for online EF""" + PhotonLooseEF = CutDefPhoton.CALOMIDDLE_PHOTONLOOSE | CutDefPhoton.HADLEAKETA_PHOTON_EF + + #Added for 2g20_medium + """ @brief Medium photon selection for online EF""" + PhotonMediumEF = CutDefPhoton.HADLEAKETA_PHOTON_EF | CutDefPhoton.CALO_PHOTON_REAT_WETA2_ERATIO + + +print "" +print "===============================================================================" +print "==== TrigEgamma isEM bit masks =====" +print "==== ElectronLoose: 0x%08x =====" % SelectionDefElectron.ElectronLoose +print "==== ElectronMedium: 0x%08x =====" % SelectionDefElectron.ElectronMedium +print "==== ElectronMedium1: 0x%08x =====" % SelectionDefElectron.ElectronMedium1 +print "==== ElectronMedium2: 0x%08x =====" % SelectionDefElectron.ElectronMedium2 +print "==== ElectronMedium3: 0x%08x =====" % SelectionDefElectron.ElectronMedium3 +print "==== ElectronMedium4: 0x%08x =====" % SelectionDefElectron.ElectronMedium3 +print "==== ElectronMedium_TRT: 0x%08x =====" % SelectionDefElectron.ElectronMedium_TRT +print "==== ElectronTight: 0x%08x =====" % SelectionDefElectron.ElectronTight +print "==== ElectronTightEF: 0x%08x =====" % SelectionDefElectron.ElectronTightEF +print "==== ElectronTightEF_TRT: 0x%08x =====" % SelectionDefElectron.ElectronTightEF_TRT +print "==== ElectronTightEF_NoEoP_WithTightDeltaEta: 0x%08x =====" % SelectionDefElectron.ElectronTightEF_NoEoP_WithTightDeltaEta +print "==== ElectronTight1: 0x%08x =====" % SelectionDefElectron.ElectronTight1 +print "==== ElectronTight2: 0x%08x =====" % SelectionDefElectron.ElectronTight2 +print "==== ElectronHltTighter: 0x%08x =====" % SelectionDefElectron.ElectronHltTighter +print "==== PhotonLoose: 0x%08x =====" % SelectionDefPhoton.PhotonLoose +print "==== PhotonLooseEF: 0x%08x =====" % SelectionDefPhoton.PhotonLooseEF +print "==== PhotonMediumEF: 0x%08x =====" % SelectionDefPhoton.PhotonMediumEF +print "==== PhotonTight: 0x%08x =====" % SelectionDefPhoton.PhotonTight +print "===============================================================================" +print "" diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEGammaPIDdefsDC14.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEGammaPIDdefsDC14.py new file mode 100644 index 00000000000..7c9c8a7b69f --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEGammaPIDdefsDC14.py @@ -0,0 +1,237 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +class TrigEgammaIDQualityDC14: + ElectronIDLoose = 0 + ElectronIDMedium = 1 + ElectronIDTight = 2 + +class BitDefElectron: + """ @brief cluster eta range """ + ClusterEtaRange_Electron = 0 + + """ @brief matching to photon (not necessarily conversion--the name is historical) """ + ConversionMatch_Electron = 1 + + """ @brief cluster leakage into the hadronic calorimeter """ + ClusterHadronicLeakage_Electron = 2 + """ @brief energy in 2nd sampling (e.g E277>0) """ + ClusterMiddleEnergy_Electron = 3 + """ @brief energy ratio in 2nd sampling (e.g E237/E277) """ + ClusterMiddleEratio37_Electron = 4 + """ @brief energy ratio in 2nd sampling (e.g E233/E237) """ + ClusterMiddleEratio33_Electron = 5 + """ @brief width in the second sampling (e.g Weta2) """ + ClusterMiddleWidth_Electron = 6 + """ @brief energy fraction in the third layer """ + ClusterBackEnergyFraction_Electron = 7 + """ @brief fraction of energy found in 1st sampling (NB: not used in fact for electrons)""" + ClusterStripsEratio_Electron = 8 + """ @brief energy of 2nd maximum in 1st sampling ~e2tsts1/(1000+const_lumi*et) """ + ClusterStripsDeltaEmax2_Electron = 9 + """ @brief difference between 2nd maximum and 1st minimum in strips (e2tsts1-emins1) """ + ClusterStripsDeltaE_Electron = 10 + """ @brief shower width in 1st sampling """ + ClusterStripsWtot_Electron = 11 + """ @brief shower shape in shower core 1st sampling """ + ClusterStripsFracm_Electron = 12 + """ @brief shower width weighted by distance from the maximum one """ + ClusterStripsWeta1c_Electron = 13 + + """ @brief difference between max and 2nd max in strips """ + ClusterStripsDEmaxs1_Electron = 15 + """ @brief B layer hit """ + TrackBlayer_Electron = 16 + """ @brief number of Pixel hits """ + TrackPixel_Electron = 17 + """ @brief number of Pixel and SCT hits """ + TrackSi_Electron = 18 + """ @brief distance of closet approach """ + TrackA0_Electron = 19 + """ @brief eta difference between cluster and extrapolated track in the 1st sampling """ + TrackMatchEta_Electron = 20 + """ @brief phi difference between cluster and extrapolated track in the 2nd sampling """ + TrackMatchPhi_Electron = 21 + """ @brief energy-momentum match """ + TrackMatchEoverP_Electron = 22 + """ @brief number of TRT hits """ + TrackTRThits_Electron = 24 + """ @brief ratio of high to all TRT hits for isolated electrons """ + TrackTRTratio_Electron = 25 + """ @brief ratio of high to all TRT hits for non-isolated electrons """ + TrackTRTratio90_Electron = 26 + + """ @brief distance of closet approach for tight selection """ + TrackA0Tight_Electron = 27 + """ @brief eta difference between cluster and extrapolated track in the 1st sampling for tight selection """ + TrackMatchEtaTight_Electron = 28 + + """ @brief isolation """ + Isolation_Electron = 29 + """ @brief calorimetric isolation """ + ClusterIsolation_Electron = 30 + """ @brief tracker isolation """ + TrackIsolation_Electron = 31 + + +# +# cut definition for electrons +# +class CutDefElectron: + """ @brief cuts of hadronic leakage""" + HADLEAKETA_ELECTRON = \ + 0x1 << BitDefElectron.ClusterEtaRange_Electron | \ + 0x1 << BitDefElectron.ClusterHadronicLeakage_Electron + """ @brief old cuts in strips (without ClusterStripsDEmaxs1)""" + CALOSTRIPSOLD_ELECTRON = \ + 0x1 << BitDefElectron.ClusterStripsEratio_Electron | \ + 0x1 << BitDefElectron.ClusterStripsDeltaEmax2_Electron | \ + 0x1 << BitDefElectron.ClusterStripsDeltaE_Electron | \ + 0x1 << BitDefElectron.ClusterStripsWtot_Electron | \ + 0x1 << BitDefElectron.ClusterStripsFracm_Electron | \ + 0x1 << BitDefElectron.ClusterStripsWeta1c_Electron + """ @brief cuts in strips (with ClusterStripsDEmaxs1)""" + CALOSTRIPS_ELECTRON = \ + 0x1 << BitDefElectron.ClusterStripsEratio_Electron | \ + 0x1 << BitDefElectron.ClusterStripsDeltaEmax2_Electron | \ + 0x1 << BitDefElectron.ClusterStripsDeltaE_Electron | \ + 0x1 << BitDefElectron.ClusterStripsWtot_Electron | \ + 0x1 << BitDefElectron.ClusterStripsFracm_Electron | \ + 0x1 << BitDefElectron.ClusterStripsWeta1c_Electron | \ + 0x1 << BitDefElectron.ClusterStripsDEmaxs1_Electron + """ @brief cuts in strips for loose electrons sampling""" + CALOSTRIPS_LOOSE_ELECTRON = \ + 0x1 << BitDefElectron.ClusterStripsWtot_Electron | \ + 0x1 << BitDefElectron.ClusterStripsDEmaxs1_Electron + + """ @brief cuts in middle sampling""" + CALOMIDDLE_ELECTRON = \ + 0x1 << BitDefElectron.ClusterMiddleEnergy_Electron | \ + 0x1 << BitDefElectron.ClusterMiddleEratio37_Electron | \ + 0x1 << BitDefElectron.ClusterMiddleEratio33_Electron | \ + 0x1 << BitDefElectron.ClusterMiddleWidth_Electron + """ @brief calorimeter isolation""" + CALORIMETRICISOLATION_ELECTRON = \ + 0x1 << BitDefElectron.ClusterIsolation_Electron + + """ @brief "old" all cuts in calorimeter (except isolation) without ClusterStripsDEmaxs1 """ + CALONOISOOLD_ELECTRON = HADLEAKETA_ELECTRON | CALOSTRIPSOLD_ELECTRON | CALOMIDDLE_ELECTRON + """ @brief "old" all cuts in calorimeter (including isolation) without ClusterStripsDEmaxs1 """ + CALOOLD_ELECTRON = CALONOISOOLD_ELECTRON | CALORIMETRICISOLATION_ELECTRON + """ @brief all cuts in calorimeter (except isolation)""" + CALO_ELECTRON = HADLEAKETA_ELECTRON | CALOSTRIPS_ELECTRON | CALOMIDDLE_ELECTRON + + """ @brief Track quality cuts except b-layer for electrons""" + TRACKINGNOBLAYER_ELECTRON = \ + 0x1 << BitDefElectron.TrackPixel_Electron | \ + 0x1 << BitDefElectron.TrackSi_Electron | \ + 0x1 << BitDefElectron.TrackA0_Electron + """ @brief Track quality cuts except b-layer and A0 for electrons""" + TRACKINGLOOSE_ELECTRON = \ + 0x1 << BitDefElectron.TrackPixel_Electron | \ + 0x1 << BitDefElectron.TrackSi_Electron + """ @brief Track quality cuts for electrons""" + TRACKING_ELECTRON = \ + TRACKINGNOBLAYER_ELECTRON | \ + 0x1 << BitDefElectron.TrackBlayer_Electron + """ @brief Track cluster matching in eta for electrons""" + TRACKMATCHDETA_ELECTRON = \ + 0x1 << BitDefElectron.TrackMatchEta_Electron + """ @brief Track cluster matching in eta, phi for electrons""" + TRACKMATCHNOEOVERP_ELECTRON = \ + 0x1 << BitDefElectron.TrackMatchEta_Electron | \ + 0x1 << BitDefElectron.TrackMatchPhi_Electron + """ @brief Track cluster matching in eta, phi, E/p for electrons""" + TRACKMATCH_ELECTRON = \ + 0x1 << BitDefElectron.TrackMatchEta_Electron | \ + 0x1 << BitDefElectron.TrackMatchPhi_Electron | \ + 0x1 << BitDefElectron.TrackMatchEoverP_Electron + """ @brief Tight Track cluster matching """ + TRACKMATCHTIGHT_ELECTRON = \ + 0x1 << BitDefElectron.TrackMatchEtaTight_Electron | \ + 0x1 << BitDefElectron.TrackA0Tight_Electron + """ @brief Tight conversion matching """ + CONVMATCH_ELECTRON = \ + 0x1 << BitDefElectron.ConversionMatch_Electron + + """ @brief TRT hits and TR ratio for electrons""" + TRT_ELECTRON = \ + 0x1 << BitDefElectron.TrackTRThits_Electron | \ + 0x1 << BitDefElectron.TrackTRTratio_Electron + """ @brief TRT hits and TR ratio (@90% eff) for electrons""" + TRT90_ELECTRON = \ + 0x1 << BitDefElectron.TrackTRThits_Electron | \ + 0x1 << BitDefElectron.TrackTRTratio90_Electron + + """ @brief isolation by tracker """ + TRACKINGISOLATION_ELECTRON = \ + 0x1 << BitDefElectron.TrackIsolation_Electron + """ @brief isolation for electrons is combination of calo and tracker """ + ISOLATION_ELECTRON = \ + 0x1 << BitDefElectron.Isolation_Electron + """ @brief isolation for electrons is combination of calo and tracker """ + CALOTRACKISOLATION_ELECTRON = \ + CALORIMETRICISOLATION_ELECTRON | TRACKINGISOLATION_ELECTRON + + """ @brief all cuts except TRT for electrons""" + ALLNOTRT_ELECTRON = \ + TRACKING_ELECTRON | TRACKMATCH_ELECTRON | CALO_ELECTRON + """ @brief all cuts except TRT for electrons(old way)""" + ALLNOTRTOLD_ELECTRON = \ + TRACKING_ELECTRON | TRACKMATCH_ELECTRON | CALOOLD_ELECTRON + """ @brief all cuts for electrons""" + ALL_ELECTRON = \ + ALLNOTRT_ELECTRON | TRT_ELECTRON + """ @brief all cuts fo electrons (old way)""" + ALLOLD_ELECTRON = \ + ALLNOTRTOLD_ELECTRON | TRT_ELECTRON + + ############# + ### Added TrigEGamma Definitions + """ @brief Tight Track cluster matching redefined for EF """ + TRACKMATCHTIGHT_ELECTRON_EF = 0x1 << BitDefElectron.TrackA0Tight_Electron + """ @brief Track-cluster matching with tight deta for electrons""" + TRACKMATCHDETATIGHT_ELECTRON = 0x1 << BitDefElectron.TrackMatchEtaTight_Electron + """ @brief Track-cluster matching in eta, E/p for electrons redefined for EF""" + TRACKMATCH_ELECTRON_EF = 0x1 << BitDefElectron.TrackMatchEta_Electron | \ + 0x1 << BitDefElectron.TrackMatchEoverP_Electron + """ @brief Track-cluster matching in eta for electrons redefined for EF""" + TRACKMATCH_ELECTRON_NoEoP_EF = 0x1 << BitDefElectron.TrackMatchEta_Electron + """ @brief Track quality cuts except b-layer and A0 for electrons""" + TRACKINGNOBLAYERNOA0_ELECTRON = \ + 0x1 << BitDefElectron.TrackPixel_Electron | \ + 0x1 << BitDefElectron.TrackSi_Electron + +class SelectionDefElectronDC14: + +# New PID def class for DC14 tunes +# PID working points Loose, Medium, Tight +# Use PID defs from Loose1, Medium1, Tight1 + + + ############# + ### Added TrigEGamma Definitions + """ @brief Loose1 Electron """ + ElectronLoose = CutDefElectron.CALOMIDDLE_ELECTRON | \ + CutDefElectron.HADLEAKETA_ELECTRON | \ + CutDefElectron.CALOSTRIPS_LOOSE_ELECTRON | \ + CutDefElectron.TRACKINGLOOSE_ELECTRON | \ + CutDefElectron.TRACKMATCHDETA_ELECTRON + """ @brief Medium1 Electron definition for trigger """ + #AT: 7Sept2011, remove TRT Hits from medium1, following offline medium++ prescription + ElectronMedium = CutDefElectron.CALO_ELECTRON | CutDefElectron.TRACKING_ELECTRON | \ + CutDefElectron.TRACKMATCHDETA_ELECTRON | \ + 0x1 << BitDefElectron.TrackTRTratio_Electron | \ + 0x1 << BitDefElectron.ClusterBackEnergyFraction_Electron + """ @brief Tight Electron1 definition for e15_tight in EF """ + ElectronTight = CutDefElectron.CALO_ELECTRON | CutDefElectron.TRACKING_ELECTRON | \ + CutDefElectron.TRACKMATCHDETA_ELECTRON | CutDefElectron.TRACKMATCH_ELECTRON_EF | \ + CutDefElectron.TRACKMATCHTIGHT_ELECTRON | CutDefElectron.TRT_ELECTRON + +print "" +print "===============================================================================" +print "==== TrigEgamma isEM bit masks for DC14 =====" +print "==== ElectronLoose: 0x%08x =====" % SelectionDefElectronDC14.ElectronLoose +print "==== ElectronMedium: 0x%08x =====" % SelectionDefElectronDC14.ElectronMedium +print "==== ElectronTight: 0x%08x =====" % SelectionDefElectronDC14.ElectronTight +print "===============================================================================" +print "" diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEgammaElectronIsEMSelectorMapping.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEgammaElectronIsEMSelectorMapping.py new file mode 100644 index 00000000000..2403e47782b --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEgammaElectronIsEMSelectorMapping.py @@ -0,0 +1,73 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +##============================================================================= +## Name: TrigEgammaElectronIsEMSelectorMapping.py +## +## Author: Ryan Mackenzie White +## Created: June 2013 +## Modified: June 2014 -- updating with 2014 tunes +## Description: Find mapping of mask and function for ID quality +##============================================================================= + +#include TrigEGammaPIDdefs for IsEM definitions +from TrigEGammaPIDdefs import SelectionDefElectron +from TrigEGammaPIDdefs import SelectionDefPhoton +from TrigEGammaPIDdefs import TrigEgammaIDQuality +from TrigEGammaPIDdefsDC14 import TrigEgammaIDQualityDC14 +from TrigEGammaPIDdefsDC14 import SelectionDefElectronDC14 + +#import TriggerFlags +from TriggerJobOpts.TriggerFlags import TriggerFlags +menu_name = TriggerFlags.triggerMenuSetup() + +class electronPIDmenu: + menuTrig2011 = 0 + menuTrig2012 = 1 + menuTrigDC14 = 2 + +import TrigEgammaRec.TrigEgammaElectronIsEMCutDefs as TrigEgammaElectronIsEMCutDefs +import TrigEgammaRec.TrigEgammaElectronIsEMCutDefs_loose1 as TrigEgammaElectronIsEMCutDefs_loose1 +import TrigEgammaRec.TrigEgammaElectronIsEMCutDefs_medium1 as TrigEgammaElectronIsEMCutDefs_medium1 +import TrigEgammaRec.TrigEgammaElectronIsEMCutDefs_medium2 as TrigEgammaElectronIsEMCutDefs_medium2 +import TrigEgammaRec.TrigEgammaElectronIsEMCutDefs_tight1 as TrigEgammaElectronIsEMCutDefs_tight1 +import TrigEgammaRec.TrigEgammaElectronIsEMCutDefs_CaloCutsOnly as TrigEgammaElectronIsEMCutDefs_CaloCutsOnly + +import TrigEgammaRec.TrigEgammaElectronIsEMCutDefs_loose as TrigEgammaElectronIsEMCutDefs_loose +import TrigEgammaRec.TrigEgammaElectronIsEMCutDefs_medium as TrigEgammaElectronIsEMCutDefs_medium +import TrigEgammaRec.TrigEgammaElectronIsEMCutDefs_tight as TrigEgammaElectronIsEMCutDefs_tight +# format - key: (mask, function) + +TrigEgammaElectronIsEM2011 = { + TrigEgammaIDQuality.ElectronIDLoose1: (SelectionDefElectron.ElectronLoose1, TrigEgammaElectronIsEMCutDefs_loose1.TrigEgammaElectronIsEMSelectorConfig2011_loose1), + TrigEgammaIDQuality.ElectronIDMedium1: (SelectionDefElectron.ElectronMedium1, TrigEgammaElectronIsEMCutDefs_medium1.TrigEgammaElectronIsEMSelectorConfig2011_medium1), + TrigEgammaIDQuality.PhotonIDLooseEF: (SelectionDefPhoton.PhotonLooseEF, TrigEgammaElectronIsEMCutDefs_CaloCutsOnly.TrigEgammaElectronIsEMSelectorConfig2011_CaloCutsOnly) + } + +TrigEgammaElectronIsEM2012 = { + TrigEgammaIDQuality.ElectronIDLoose: (SelectionDefElectron.ElectronLoose, TrigEgammaElectronIsEMCutDefs.TrigEgammaElectronIsEMSelectorConfig2012), + TrigEgammaIDQuality.ElectronIDLoose0: (SelectionDefElectron.ElectronLoose1, TrigEgammaElectronIsEMCutDefs_loose1.TrigEgammaElectronIsEMSelectorConfig2012_looser1), + TrigEgammaIDQuality.ElectronIDLoose1: (SelectionDefElectron.ElectronLoose1, TrigEgammaElectronIsEMCutDefs_loose1.TrigEgammaElectronIsEMSelectorConfig2012_loose1), + TrigEgammaIDQuality.ElectronIDMedium1: (SelectionDefElectron.ElectronMedium1, TrigEgammaElectronIsEMCutDefs_medium1.TrigEgammaElectronIsEMSelectorConfig2012_medium1), + TrigEgammaIDQuality.ElectronIDMedium2: (SelectionDefElectron.ElectronMedium2, TrigEgammaElectronIsEMCutDefs_medium2.TrigEgammaElectronIsEMSelectorConfig2012_medium2), + TrigEgammaIDQuality.ElectronIDTight1: (SelectionDefElectron.ElectronTight1, TrigEgammaElectronIsEMCutDefs_tight1.TrigEgammaElectronIsEMSelectorConfig2012_tight1), + TrigEgammaIDQuality.PhotonIDLooseEF: (SelectionDefPhoton.PhotonLooseEF, TrigEgammaElectronIsEMCutDefs_CaloCutsOnly.TrigEgammaElectronIsEMSelectorConfig2012_CaloCutsOnly), + TrigEgammaIDQuality.PhotonIDLooseEFTauMass: (SelectionDefPhoton.PhotonLooseEF, TrigEgammaElectronIsEMCutDefs_CaloCutsOnly.TrigEgammaElectronIsEMSelectorConfig2012_CaloCutsOnly_TauMass), + TrigEgammaIDQuality.PhotonIDMediumEF: (SelectionDefPhoton.PhotonMediumEF, TrigEgammaElectronIsEMCutDefs_CaloCutsOnly.TrigEgammaElectronIsEMSelectorConfig2012_CaloCutsOnly_medium) + } + +TrigEgammaElectronIsEMDC14 = { + TrigEgammaIDQualityDC14.ElectronIDLoose: (SelectionDefElectronDC14.ElectronLoose, TrigEgammaElectronIsEMCutDefs_loose.TrigEgammaElectronIsEMSelectorConfigDC14_loose), + TrigEgammaIDQualityDC14.ElectronIDMedium: (SelectionDefElectronDC14.ElectronMedium, TrigEgammaElectronIsEMCutDefs_medium.TrigEgammaElectronIsEMSelectorConfigDC14_medium), + TrigEgammaIDQualityDC14.ElectronIDTight: (SelectionDefElectronDC14.ElectronTight, TrigEgammaElectronIsEMCutDefs_tight.TrigEgammaElectronIsEMSelectorConfigDC14_tight), + } + + +def TrigEgammaElectronIsEMMap(quality, menu): + if menu == electronPIDmenu.menuTrig2011: + return TrigEgammaElectronIsEM2011[quality] + elif menu == electronPIDmenu.menuTrig2012: + return TrigEgammaElectronIsEM2012[quality] + elif menu == electronPIDmenu.menuTrigDC14: + return TrigEgammaElectronIsEMDC14[quality] + else: + raise ValueError("Requested menu is undefined: %d" % menu) diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2CaloHypoConfig.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2CaloHypoConfig.py new file mode 100755 index 00000000000..a3fcba7f5e3 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2CaloHypoConfig.py @@ -0,0 +1,239 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +############################## +# L2 Electron and Photon Calorimeter Hypothesis Algorithm Configuration: +# Phillip Urquijo <Phillip.Urquijo@cern.ch> +############################## + +from TrigEgammaHypo.TrigEgammaHypoConf import TrigL2CaloHypo, TrigL2CaloLayersHypo +from AthenaCommon.SystemOfUnits import GeV + +from TriggerJobOpts.TriggerFlags import TriggerFlags +menu_name = TriggerFlags.triggerMenuSetup() + +from TrigL2CaloHypoCutDefs import L2CaloCutMaps +class TrigL2CaloHypoBase (TrigL2CaloHypo): + __slots__ = [] + def __init__(self, name): + super( TrigL2CaloHypoBase, self ).__init__( name ) + + from TrigEgammaHypo.TrigL2CaloHypoMonitoring import TrigL2CaloHypoValidationMonitoring, TrigL2CaloHypoOnlineMonitoring + validation = TrigL2CaloHypoValidationMonitoring() + online = TrigL2CaloHypoOnlineMonitoring() + + from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig + time = TrigTimeHistToolConfig("Time") + + self.AthenaMonTools = [ time, validation, online ] + + self.EtaBins = [0.0, 0.6, 0.8, 1.15, 1.37, 1.52, 1.81, 2.01, 2.37, 2.47] + self.dETACLUSTERthr = 0.1 + self.dPHICLUSTERthr = 0.1 + self.F1thr = [0.005] + self.ET2thr = [90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV] + self.HADET2thr = [999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0] + self.HADETthr = [0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058, 0.058] + self.WETA2thr = [99999.,99999.,99999.,99999.,99999.,99999.,99999.,99999.,99999.] + self.WSTOTthr = [99999.,99999.,99999.,99999.,99999.,99999.,99999.,99999.,99999.] + self.F3thr = [99999.,99999.,99999.,99999.,99999.,99999.,99999.,99999.,99999.] + + +# basic cut +class L2CaloHypo_1 (TrigL2CaloHypoBase): + __slots__ = [] + def __init__(self, name = "L2CaloHypo_1"): + super( L2CaloHypo_1, self ).__init__( name ) + + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll = True + + # L2 Calo cuts + self.ETthr = [21.*GeV, 21.*GeV, 21.*GeV, 21.*GeV, 21.*GeV, 21.*GeV, 21.*GeV, 21.*GeV, 21.*GeV] + self.CARCOREthr = [0.92, 0.91, 0.91, 0.91, 0.93, 0.92, 0.92, 0.92, 0.92] + self.CAERATIOthr = [0.60, 0.60, 0.60, 0.60, 0.60, 0.60, 0.60, 0.60, 0.60] + + +#------------------------------------------------------------------- +# Electron Signature Configurations +#------------------------------------------------------------------- + +#------------------------------------------------------------------ +#DC 14 items +#------------------------------------------------------------------ +# Fully configurable classes via TM +# NoCut at L2 Calo used for EtCut chains +class L2CaloHypo_NoCut (TrigL2CaloHypoBase): + __slots__ = [] + def __init__(self, name, threshold): + super( L2CaloHypo_NoCut, self ).__init__( name ) + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll = True + # Following just set properties but no cut applied + self.ETthr = [float(threshold)*GeV]*9 + self.CARCOREthr = [0.92, 0.91, 0.91, 0.91, 0.93, 0.92, 0.92, 0.92, 0.92] + self.CAERATIOthr = [0.60, 0.60, 0.60, 0.60, 0.60, 0.60, 0.60, 0.60, 0.60] + +# used in W T&P - etcut at L2 +# previously named etcutTrk +class L2CaloHypo_EtCut (TrigL2CaloHypoBase): + __slots__ = [] + def __init__(self, name, threshold): + super( L2CaloHypo_EtCutTrk, self ).__init__( name ) + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll = False + + #L2 Threshold + self.ETthr = [float(threshold)*GeV]*9 + # No other cuts applied + self.dETACLUSTERthr = 9999. + self.dPHICLUSTERthr = 9999. + self.F1thr = [0.0] + self.HADETthr = [9999., 9999., 9999., 9999., 9999., 9999., 9999., 9999., 9999.] + self.CARCOREthr = [-9999., -9999., -9999., -9999., -9999., -9999., -9999., -9999., -9999.] + self.CAERATIOthr = [-9999., -9999., -9999., -9999., -9999., -9999., -9999., -9999., -9999.] + +# Current cuts not correct! +# Requires cut maps as function of Et and eta +# Currently using cuts from e24 items +class L2CaloHypo_e_ID (TrigL2CaloHypoBase): + __slots__ = [] + def __init__(self, name, threshold, IDinfo): + super( L2CaloHypo_e_ID, self ).__init__( name ) + self.AcceptAll = False + # self.emEt = float(threshold)*GeV # Change to single cut + self.ETthr = [(float(threshold) - 5)*GeV]*9 + # e24 cuts + self.CAERATIOthr = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] + self.HADETthr = [0.013, 0.013, 0.013, 0.013, 0.013, 0.023, 0.018, 0.017, 0.017] + self.CARCOREthr = [0.925, 0.925, 0.92, 0.92, 0.6675, 0.91, 0.9025, 0.895, 0.895] + print IDinfo + self.HADETthr = L2CaloCutMaps(threshold).MapsHADETthr[IDinfo] + self.CARCOREthr = L2CaloCutMaps(threshold).MapsCARCOREthr[IDinfo] + self.CAERATIOthr =L2CaloCutMaps(threshold).MapsCAERATIOthr[IDinfo] + +#------------------------------------------------------------------- +# Photon Signature Configurations +#------------------------------------------------------------------- +# the photon's calorimeter selection criteria are applied in TrigL2PhotonHypo, +# not in TrigL2CaloHypo (like the electron's) + +#------------------------------------------------------------------- +# g4 + +class L2CaloHypo_g_nocut (TrigL2CaloHypoBase): + __slots__ = [] + def __init__(self, name = "L2CaloHypo_g_nocut"): + super( L2CaloHypo_g_nocut, self ).__init__( name ) + self.AcceptAll = True + + # L2 Calo cuts: + self.ETthr = [0.*GeV, 0.*GeV, 0.*GeV, 0.*GeV, 0.*GeV, 0.*GeV, 0.*GeV, 0.*GeV, 0.*GeV] + self.ET2thr = [90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV] + self.HADETthr = [999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV] + self.HADET2thr = [999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV] + self.CARCOREthr = [0., 0., 0., 0., 0., 0., 0., 0., 0.] + self.CAERATIOthr = [0., 0., 0., 0., 0., 0., 0., 0., 0.] + self.dETACLUSTERthr = 0.1 + self.dPHICLUSTERthr = 0.1 + self.F1thr = [0.0] + +class L2CaloHypo_g3 (TrigL2CaloHypoBase): + __slots__ = [] + def __init__(self, name = "L2CaloHypo_g3"): + super( L2CaloHypo_g3, self ).__init__( name ) + + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll = False + + # L2 Calo cuts: g3 + self.ETthr = [3.*GeV, 3.*GeV, 3.*GeV, 3.*GeV, 3.*GeV, 3.*GeV, 3.*GeV, 3.*GeV, 3.*GeV] + self.ET2thr = [90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV] + self.HADETthr = [999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV] + self.HADET2thr = [999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV] + self.CARCOREthr = [0., 0., 0., 0., 0., 0., 0., 0., 0.] + self.CAERATIOthr = [0., 0., 0., 0., 0., 0., 0., 0., 0.] + self.dETACLUSTERthr = 0.1 + self.dPHICLUSTERthr = 0.1 + self.F1thr = [0.0] + +class L2CaloHypo_g4 (TrigL2CaloHypoBase): + __slots__ = [] + def __init__(self, name = "L2CaloHypo_g4"): + super( L2CaloHypo_g4, self ).__init__( name ) + + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll = False + + # L2 Calo cuts: g4 + self.ETthr = [4.*GeV, 4.*GeV, 4.*GeV, 4.*GeV, 4.*GeV, 4.*GeV, 4.*GeV, 4.*GeV, 4.*GeV] + self.ET2thr = [90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV] + self.HADETthr = [999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV] + self.HADET2thr = [999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV] + self.CARCOREthr = [0., 0., 0., 0., 0., 0., 0., 0., 0.] + self.CAERATIOthr = [0., 0., 0., 0., 0., 0., 0., 0., 0.] + self.dETACLUSTERthr = 0.1 + self.dPHICLUSTERthr = 0.1 + self.F1thr = [0.0] + +#------------------------------------------------------------------- +# g7 + +class L2CaloHypo_g7 (TrigL2CaloHypoBase): + __slots__ = [] + def __init__(self, name = "L2CaloHypo_g7"): + super( L2CaloHypo_g7, self ).__init__( name ) + + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll = False + + # L2 Calo cuts: g7 + self.ETthr = [7.*GeV, 7.*GeV, 7.*GeV, 7.*GeV, 7.*GeV, 7.*GeV, 7.*GeV, 7.*GeV, 7.*GeV] + self.ET2thr = [90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV] + self.HADETthr = [999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV] + self.HADET2thr = [999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV,999.0*GeV] + self.CARCOREthr = [0., 0., 0., 0., 0., 0., 0., 0., 0.] + self.CAERATIOthr = [0., 0., 0., 0., 0., 0., 0., 0., 0.] + self.dETACLUSTERthr = 0.1 + self.dPHICLUSTERthr = 0.1 + self.F1thr = [0.0] + +#------------------------------------------------------------------- +# LAr Presampler Noise detection (loose cut) + +class TrigL2CaloLayersHypo_PreS_092 (TrigL2CaloLayersHypo): + __slots__ = [] + def __init__(self, name="TrigL2CaloLayersHypo_PreS_092"): + super( TrigL2CaloLayersHypo_PreS_092, self ).__init__( name ) + + from TrigEgammaHypo.TrigL2CaloHypoMonitoring import TrigL2CaloLayersHypoValidationMonitoring, TrigL2CaloLayersHypoOnlineMonitoring + validation = TrigL2CaloLayersHypoValidationMonitoring() + online = TrigL2CaloLayersHypoOnlineMonitoring() + + from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig + time = TrigTimeHistToolConfig("Time") + + self.AthenaMonTools = [ time, validation, online ] + + self.EnergyFractionCut=[0.92,1.0,1.0,1.0] + self.AcceptAll = False + +#------------------------------------------------------------------- +# LAr Presampler Noise detection (tight cut) + +class TrigL2CaloLayersHypo_PreS_080 (TrigL2CaloLayersHypo): + __slots__ = [] + def __init__(self, name="TrigL2CaloLayersHypo_PreS_080"): + super( TrigL2CaloLayersHypo_PreS_080, self ).__init__( name ) + + from TrigEgammaHypo.TrigL2CaloHypoMonitoring import TrigL2CaloLayersHypoValidationMonitoring, TrigL2CaloLayersHypoOnlineMonitoring + validation = TrigL2CaloLayersHypoValidationMonitoring() + online = TrigL2CaloLayersHypoOnlineMonitoring() + + from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig + time = TrigTimeHistToolConfig("Time") + + self.AthenaMonTools = [ time, validation, online ] + + self.EnergyFractionCut=[0.80,1.0,1.0,1.0] + self.AcceptAll = False + diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2CaloHypoCutDefs.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2CaloHypoCutDefs.py new file mode 100644 index 00000000000..44c5a5b2496 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2CaloHypoCutDefs.py @@ -0,0 +1,173 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +# L2 Calo cut definitions for Electrons +# Ryan Mackenzie White <ryan.white@cern.ch> +# Akshay Katre +# Cuts migrated from L2CaloHypoConfig + +from AthenaCommon.SystemOfUnits import GeV + +class L2CaloCutMaps(): + # The following triggers were optimized in 2012 by YanPing + # e12_loose1 + # e12_loose0 + # loose triggers above 22 GeV use e12_loose1 cut defs + # e24_medium1 -- Higher threshold triggers use same cuts + # tight/tight1 uses e24_medium1 cuts + # New EF ID tunes will start with Run1 loose1,medium1,tight1 cuts + # Cut maps are grouped by Et threshold + def __init__(self, threshold): + ########################## + # Et 5 GeV + ########################## + # e5_loose1 + ########################## + # self.HADETthr = [0.1738, 0.1696, 0.1318, 0.1738, 0.0548875, 0.1486, 0.1696, 0.1738, 0.157] + # self.CAERATIOthr = [0.57, 0.532, 0.342, 0.228, -9999., 0.304, 0.608, 0.722, -9999.] + # self.CARCOREthr = [0.532, 0.57, 0.646, 0.684, -9999., 0.722, 0.684, 0.722, -9999.] + ########################## + # e5_medium1 + #self.HADETthr = [0.1638, 0.1596, 0.1218, 0.1638, 0.0448875, 0.1386, 0.1596, 0.1638, 0.147] + #self.CARCOREthr = [0.532, 0.57, 0.646, 0.684, 0.418, 0.722, 0.684, 0.722, 0.70] + #self.CAERATIOthr = [0.57, 0.532, 0.342, 0.228, -9999., 0.304, 0.608, 0.722, -9999.] + # e5_tight1 + # self.HADETthr = [0.1638, 0.1596, 0.1218, 0.1638, 0.0448875, 0.1386, 0.1596, 0.1638, 0.147] + # self.CARCOREthr = [0.532, 0.57, 0.646, 0.684, 0.418, 0.722, 0.684, 0.722, 0.70] + # self.CAERATIOthr = [0.57, 0.532, 0.342, 0.228, -9999., 0.304, 0.608, 0.722, -9999.] + ########################## + if(float(threshold) >= 5. and float(threshold) < 12): + self.MapsHADETthr = { + 'loose': [0.1738, 0.1696, 0.1318, 0.1738, 0.0548875, 0.1486, 0.1696, 0.1738, 0.157], + 'loose1': [0.1738, 0.1696, 0.1318, 0.1738, 0.0548875, 0.1486, 0.1696, 0.1738, 0.157], + 'lhloose': [0.1738, 0.1696, 0.1318, 0.1738, 0.0548875, 0.1486, 0.1696, 0.1738, 0.157], + 'medium': [0.1638, 0.1596, 0.1218, 0.1638, 0.0448875, 0.1386, 0.1596, 0.1638, 0.147], + 'lhmedium': [0.1638, 0.1596, 0.1218, 0.1638, 0.0448875, 0.1386, 0.1596, 0.1638, 0.147], + 'medium1': [0.1638, 0.1596, 0.1218, 0.1638, 0.0448875, 0.1386, 0.1596, 0.1638, 0.147], + 'tight': [0.1638, 0.1596, 0.1218, 0.1638, 0.0448875, 0.1386, 0.1596, 0.1638, 0.147], + 'lhtight': [0.1638, 0.1596, 0.1218, 0.1638, 0.0448875, 0.1386, 0.1596, 0.1638, 0.147], + 'tight1': [0.1638, 0.1596, 0.1218, 0.1638, 0.0448875, 0.1386, 0.1596, 0.1638, 0.147], + } + self.MapsCAERATIOthr = { + 'loose': [0.57, 0.532, 0.342, 0.228, -9999., 0.304, 0.608, 0.722, -9999.], + 'loose1': [0.57, 0.532, 0.342, 0.228, -9999., 0.304, 0.608, 0.722, -9999.], + 'lhloose': [0.57, 0.532, 0.342, 0.228, -9999., 0.304, 0.608, 0.722, -9999.], + 'medium': [0.57, 0.532, 0.342, 0.228, -9999., 0.304, 0.608, 0.722, -9999.], + 'lhmedium': [0.57, 0.532, 0.342, 0.228, -9999., 0.304, 0.608, 0.722, -9999.], + 'medium1': [0.57, 0.532, 0.342, 0.228, -9999., 0.304, 0.608, 0.722, -9999.], + 'tight': [0.57, 0.532, 0.342, 0.228, -9999., 0.304, 0.608, 0.722, -9999.], + 'lhtight': [0.57, 0.532, 0.342, 0.228, -9999., 0.304, 0.608, 0.722, -9999.], + 'tight1': [0.57, 0.532, 0.342, 0.228, -9999., 0.304, 0.608, 0.722, -9999.], + } + self.MapsCARCOREthr = { + 'loose': [0.532, 0.57, 0.646, 0.684, -9999., 0.722, 0.684, 0.722, -9999.], + 'loose1': [0.532, 0.57, 0.646, 0.684, -9999., 0.722, 0.684, 0.722, -9999.], + 'lhloose': [0.532, 0.57, 0.646, 0.684, -9999., 0.722, 0.684, 0.722, -9999.], + 'medium': [0.532, 0.57, 0.646, 0.684, 0.418, 0.722, 0.684, 0.722, 0.70], + 'lhmedium': [0.532, 0.57, 0.646, 0.684, 0.418, 0.722, 0.684, 0.722, 0.70], + 'medium1': [0.532, 0.57, 0.646, 0.684, 0.418, 0.722, 0.684, 0.722, 0.70], + 'tight': [0.532, 0.57, 0.646, 0.684, 0.418, 0.722, 0.684, 0.722, 0.70], + 'lhtight': [0.532, 0.57, 0.646, 0.684, 0.418, 0.722, 0.684, 0.722, 0.70], + 'tight1': [0.532, 0.57, 0.646, 0.684, 0.418, 0.722, 0.684, 0.722, 0.70], + } + ########################## + # Et 12 GeV + ########################## + # e12_loose1 + #AT 30-March-2012 Optimisation by Yanping: + #self.HADETthr = [0.04225, 0.04075, 0.04575, 0.03575, 0.05275, 0.05325, 0.05525, 0.05325, 0.04675] + #self.CARCOREthr = [0.8275, 0.8225, 0.7975, 0.8275, -9999., 0.8075, 0.8475, 0.8475, -9999.] + #self.CAERATIOthr = [0.775269, 0.735433, 0.574831, 0.513675, -9999., 0.584799, 0.776095, 0.822032, -9999.] + #AT: this optimisation could be well propagated to all loose1 triggers with ET>12 GeV if we need to cut L2 rate further + # e12_medium1 + #self.HADETthr = [0.04225, 0.04075, 0.04575, 0.03575, 0.05275, 0.05325, 0.05525, 0.05325, 0.04675] + #self.CARCOREthr = [0.8275, 0.8225, 0.7975, 0.8275, -9999., 0.8075, 0.8475, 0.8475, -9999.] + #self.CAERATIOthr = [0.775269, 0.735433, 0.574831, 0.513675, -9999., 0.584799, 0.776095, 0.822032, -9999.] + # e12_tight + # self.HADETthr = [0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043] + # self.CARCOREthr = [0.90, 0.89, 0.89, 0.89, 0.90, 0.89, 0.89, 0.89, 0.89] + # self.CAERATIOthr = [0.60, 0.70, 0.70, 0.75, 0.85, 0.90, 0.90, 0.90, 0.90] + elif(float(threshold) >= 12. and float(threshold) < 22): + self.MapsHADETthr = { + 'loose0': [0.0359625, 0.0343875, 0.0396375, 0.0291375, 0.0501375, 0.0559125, 0.0548625, 0.0538125, 0.0469875], + 'loose1': [0.04225, 0.04075, 0.04575, 0.03575, 0.05275, 0.05325, 0.05525, 0.05325, 0.04675], + 'loose': [0.04225, 0.04075, 0.04575, 0.03575, 0.05275, 0.05325, 0.05525, 0.05325, 0.04675], + 'lhloose': [0.04225, 0.04075, 0.04575, 0.03575, 0.05275, 0.05325, 0.05525, 0.05325, 0.04675], + 'medium1': [0.04225, 0.04075, 0.04575, 0.03575, 0.05275, 0.05325, 0.05525, 0.05325, 0.04675], + 'medium': [0.04225, 0.04075, 0.04575, 0.03575, 0.05275, 0.05325, 0.05525, 0.05325, 0.04675], + 'lhmedium': [0.04225, 0.04075, 0.04575, 0.03575, 0.05275, 0.05325, 0.05525, 0.05325, 0.04675], + 'tight': [0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043], + 'lhtight': [0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043], + 'tight1': [0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043, 0.043], + } + self.MapsCARCOREthr = { + 'loose0': [0.786125, 0.786125, 0.767125, 0.795625, 0.703, 0.776625, 0.819375, 0.805125, 0.681625], + 'loose1': [0.8275, 0.8225, 0.7975, 0.8275, -9999., 0.8075, 0.8475, 0.8475, -9999.], + 'loose': [0.8275, 0.8225, 0.7975, 0.8275, -9999., 0.8075, 0.8475, 0.8475, -9999.], + 'lhloose': [0.8275, 0.8225, 0.7975, 0.8275, -9999., 0.8075, 0.8475, 0.8475, -9999.], + 'medium': [0.8275, 0.8225, 0.7975, 0.8275, -9999., 0.8075, 0.8475, 0.8475, -9999.], + 'lhmedium': [0.8275, 0.8225, 0.7975, 0.8275, -9999., 0.8075, 0.8475, 0.8475, -9999.], + 'medium1': [0.8275, 0.8225, 0.7975, 0.8275, -9999., 0.8075, 0.8475, 0.8475, -9999.], + 'tight': [0.90, 0.89, 0.89, 0.89, 0.90, 0.89, 0.89, 0.89, 0.89], + 'lhtight': [0.90, 0.89, 0.89, 0.89, 0.90, 0.89, 0.89, 0.89, 0.89], + 'tight1': [0.90, 0.89, 0.89, 0.89, 0.90, 0.89, 0.89, 0.89, 0.89], + } + self.MapsCAERATIOthr = { + 'loose': [0.775269, 0.735433, 0.574831, 0.513675, -9999., 0.584799, 0.776095, 0.822032, -9999.], + 'lhloose': [0.775269, 0.735433, 0.574831, 0.513675, -9999., 0.584799, 0.776095, 0.822032, -9999.], + 'loose1': [0.775269, 0.735433, 0.574831, 0.513675, -9999., 0.584799, 0.776095, 0.822032, -9999.], + 'medium': [0.775269, 0.735433, 0.574831, 0.513675, -9999., 0.584799, 0.776095, 0.822032, -9999.], + 'lhmedium': [0.775269, 0.735433, 0.574831, 0.513675, -9999., 0.584799, 0.776095, 0.822032, -9999.], + 'medium1': [0.775269, 0.735433, 0.574831, 0.513675, -9999., 0.584799, 0.776095, 0.822032, -9999.], + 'tight': [0.60, 0.70, 0.70, 0.75, 0.85, 0.90, 0.90, 0.90, 0.90], + 'lhtight': [0.60, 0.70, 0.70, 0.75, 0.85, 0.90, 0.90, 0.90, 0.90], + 'tight1': [0.60, 0.70, 0.70, 0.75, 0.85, 0.90, 0.90, 0.90, 0.90], + } + ########################## + # Et 22 GeV + ########################## + # e24_medium1 / e24_tight1 + # AT 30-March-2012 Optimisation by Yanping: + # self.HADETthr = [0.0256693, 0.0240023, 0.0271098, 0.0206744, 0.0211902, 0.0301758, 0.0297629, 0.0295336, 0.020514] + # self.CARCOREthr = [0.882167, 0.882156, 0.857124, 0.886262, 0.724005, 0.871725, 0.902082, 0.887027, 0.744103] + # self.CAERATIOthr = [0.83009, 0.830144, 0.794944, 0.794558, -9999, 0.794933, 0.895365, 0.904011, -9999.] + # e24_loose1 + # self.CAERATIOthr = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] + # self.HADETthr = [0.0275625, 0.0259875, 0.0291375, 0.0228375, 0.0259875, 0.0391125, 0.0359625, 0.0370125, 0.0291375] + # self.CARCOREthr = [0.819375, 0.819375, 0.800375, 0.828875, 0.7125, 0.805125, 0.843125, 0.824125, 0.700625] + elif(float(threshold) >= 22.): + self.MapsHADETthr = { + 'loose': [0.0275625, 0.0259875, 0.0291375, 0.0228375, 0.0259875, 0.0391125, 0.0359625, 0.0370125, 0.0291375], + 'lhloose': [0.0275625, 0.0259875, 0.0291375, 0.0228375, 0.0259875, 0.0391125, 0.0359625, 0.0370125, 0.0291375], + 'loose1': [0.0275625, 0.0259875, 0.0291375, 0.0228375, 0.0259875, 0.0391125, 0.0359625, 0.0370125, 0.0291375], + 'medium': [0.0256693, 0.0240023, 0.0271098, 0.0206744, 0.0211902, 0.0301758, 0.0297629, 0.0295336, 0.020514], + 'lhmedium': [0.0256693, 0.0240023, 0.0271098, 0.0206744, 0.0211902, 0.0301758, 0.0297629, 0.0295336, 0.020514], + 'medium1': [0.0256693, 0.0240023, 0.0271098, 0.0206744, 0.0211902, 0.0301758, 0.0297629, 0.0295336, 0.020514], + 'tight': [0.0256693, 0.0240023, 0.0271098, 0.0206744, 0.0211902, 0.0301758, 0.0297629, 0.0295336, 0.020514], + 'lhtight': [0.0256693, 0.0240023, 0.0271098, 0.0206744, 0.0211902, 0.0301758, 0.0297629, 0.0295336, 0.020514], + 'tight1': [0.0256693, 0.0240023, 0.0271098, 0.0206744, 0.0211902, 0.0301758, 0.0297629, 0.0295336, 0.020514], + } + self.MapsCARCOREthr = { + 'loose': [0.819375, 0.819375, 0.800375, 0.828875, 0.7125, 0.805125, 0.843125, 0.824125, 0.700625], + 'lhloose': [0.819375, 0.819375, 0.800375, 0.828875, 0.7125, 0.805125, 0.843125, 0.824125, 0.700625], + 'loose1': [0.819375, 0.819375, 0.800375, 0.828875, 0.7125, 0.805125, 0.843125, 0.824125, 0.700625], + 'medium': [0.882167, 0.882156, 0.857124, 0.886262, 0.724005, 0.871725, 0.902082, 0.887027, 0.744103], + 'lhmedium': [0.882167, 0.882156, 0.857124, 0.886262, 0.724005, 0.871725, 0.902082, 0.887027, 0.744103], + 'medium1': [0.882167, 0.882156, 0.857124, 0.886262, 0.724005, 0.871725, 0.902082, 0.887027, 0.744103], + 'tight': [0.882167, 0.882156, 0.857124, 0.886262, 0.724005, 0.871725, 0.902082, 0.887027, 0.744103], + 'lhtight': [0.882167, 0.882156, 0.857124, 0.886262, 0.724005, 0.871725, 0.902082, 0.887027, 0.744103], + 'tight1': [0.882167, 0.882156, 0.857124, 0.886262, 0.724005, 0.871725, 0.902082, 0.887027, 0.744103], + } + self.MapsCAERATIOthr = { + 'loose': [-999., -999., -999., -999., -999., -999., -999., -999., -999.], + 'lhloose': [-999., -999., -999., -999., -999., -999., -999., -999., -999.], + 'loose1': [-999., -999., -999., -999., -999., -999., -999., -999., -999.], + 'medium': [0.83009, 0.830144, 0.794944, 0.794558, -9999, 0.794933, 0.895365, 0.904011, -9999.], + 'lhmedium': [0.83009, 0.830144, 0.794944, 0.794558, -9999, 0.794933, 0.895365, 0.904011, -9999.], + 'medium1': [0.83009, 0.830144, 0.794944, 0.794558, -9999, 0.794933, 0.895365, 0.904011, -9999.], + 'tight': [0.83009, 0.830144, 0.794944, 0.794558, -9999, 0.794933, 0.895365, 0.904011, -9999.], + 'lhtight': [0.83009, 0.830144, 0.794944, 0.794558, -9999, 0.794933, 0.895365, 0.904011, -9999.], + 'tight1': [0.83009, 0.830144, 0.794944, 0.794558, -9999, 0.794933, 0.895365, 0.904011, -9999.], + } + else: + raise RuntimeError('INCORRECT threshold: No cuts configured') + diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2CaloHypoMonitoring.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2CaloHypoMonitoring.py new file mode 100755 index 00000000000..4c5a087b155 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2CaloHypoMonitoring.py @@ -0,0 +1,141 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +from TrigMonitorBase.TrigGenericMonitoringToolConfig import defineHistogram, TrigGenericMonitoringToolConfig + +class TrigL2CaloHypoValidationMonitoring(TrigGenericMonitoringToolConfig): + def __init__ (self, name="TrigL2CaloHypoValidationMonitoring"): + super(TrigL2CaloHypoValidationMonitoring, self).__init__(name) + self.defineTarget( "Validation" ) + + self.Histograms = [ defineHistogram('dEta', type='TH1F', title="L2Calo Hypo #Delta#eta_{L2 L1}; #Delta#eta_{L2 L1}", + xbins=80, xmin=-0.01, xmax=0.01) ] + self.Histograms += [ defineHistogram('dPhi', type='TH1F', title="L2Calo Hypo #Delta#phi_{L2 L1}; #Delta#phi_{L2 L1}", + xbins=80, xmin=-0.01, xmax=0.01) ] + self.Histograms += [ defineHistogram('Et_em', type='TH1F', title="L2Calo Hypo cluster E_{T}^{EM};E_{T}^{EM} [MeV]", + xbins=50, xmin=-2000, xmax=100000) ] + self.Histograms += [ defineHistogram('Et_had', type='TH1F', title="L2Calo Hypo E_{T}^{had} in first layer;E_{T}^{had} [MeV]", + xbins=50, xmin=-2000, xmax=100000) ] + self.Histograms += [ defineHistogram('Rcore', type='TH1F', title="L2Calo Hypo R_{core};E^{3x3}/E^{3x7} in sampling 2", + xbins=48, xmin=-0.1, xmax=1.1) ] + self.Histograms += [ defineHistogram('Eratio', type='TH1F', + title="L2Calo Hypo E_{ratio};E^{max1}-E^{max2}/E^{max1}+E^{max2} in sampling 1 (excl.crack)", + xbins=64, xmin=-0.1, xmax=1.5) ] + self.Histograms += [ defineHistogram('EtaBin', type='TH1I', title="L2Calo Hypo entries per Eta bin;Eta bin no.", + xbins=11, xmin=-0.5, xmax=10.5) ] + self.Histograms += [ defineHistogram('Eta', type='TH1F', title="L2Calo Hypo entries per Eta;Eta", + xbins=100, xmin=-2.5, xmax=2.5) ] + self.Histograms += [ defineHistogram('Phi', type='TH1F', title="L2Calo Hypo entries per Phi;Phi", + xbins=128, xmin=-3.2, xmax=3.2) ] + + self.Histograms += [ defineHistogram('F1', type='TH1F', title="L2Calo Hypo f_{1};f_{1}", + xbins=34, xmin=-0.5, xmax=1.2) ] + + self.Histograms += [ defineHistogram('Weta2', type='TH1F', title="L2Calo Hypo Weta2; E Width in sampling 2",xbins=96, xmin=-0.1, xmax=0.61) ] + self.Histograms += [ defineHistogram('Wstot', type='TH1F', title="L2Calo Hypo Wstot; E Width in sampling 1",xbins=48, xmin=-0.1, xmax=11.) ] + self.Histograms += [ defineHistogram('F3', type='TH1F', title="L2Calo Hypo F3; E3/(E0+E1+E2+E3)",xbins=96, xmin=-0.1, xmax=1.1) ] + + cuts=['Input','has one TrigEMCluster', '#Delta #eta L2-L1', '#Delta #phi L2-L1','rCore', + 'eRatio','E_{T}^{EM}', 'E_{T}^{Had}','f_{1}','Weta2','Wstot','F3'] + + labelsDescription = '' + for c in cuts: + labelsDescription += c+':' + + self.Histograms += [ defineHistogram('CutCounter', type='TH1I', title="L2Calo Hypo Passed Cuts;Cut", + xbins=14, xmin=-1.5, xmax=12.5, opt="kCumulative", labels=labelsDescription) ] + + +class TrigL2CaloHypoOnlineMonitoring(TrigGenericMonitoringToolConfig): + def __init__ (self, name="TrigL2CaloHypoOnlineMonitoring"): + """ defines hisograms for online """ + super(TrigL2CaloHypoOnlineMonitoring, self).__init__(name) + self.defineTarget("Online") + + self.Histograms = [ defineHistogram('dEta', type='TH1F', title="L2Calo Hypo #Delta#eta_{L2 L1}; #Delta#eta_{L2 L1}", + xbins=80, xmin=-0.01, xmax=0.01) ] + self.Histograms += [ defineHistogram('dPhi', type='TH1F', title="L2Calo Hypo #Delta#phi_{L2 L1}; #Delta#phi_{L2 L1}", + xbins=80, xmin=-0.01, xmax=0.01) ] + self.Histograms += [ defineHistogram('Et_em', type='TH1F', title="L2Calo Hypo cluster E_{T}^{EM};E_{T}^{EM} [MeV]", + xbins=50, xmin=-2000, xmax=100000) ] + self.Histograms += [ defineHistogram('Et_had', type='TH1F', title="L2Calo Hypo E_{T}^{had} in first layer;E_{T}^{had} [MeV]", + xbins=50, xmin=-2000, xmax=100000) ] + self.Histograms += [ defineHistogram('Rcore', type='TH1F', title="L2Calo Hypo R_{core};E^{3x3}/E^{3x7} in sampling 2", + xbins=48, xmin=-0.1, xmax=1.1) ] + self.Histograms += [ defineHistogram('Eratio', type='TH1F', + title="L2Calo Hypo E_{ratio};E^{max1}-E^{max2}/E^{max1}+E^{max2} in sampling 1 (excl.crack)", + xbins=64, xmin=-0.1, xmax=1.5) ] + self.Histograms += [ defineHistogram('EtaBin', type='TH1I', title="L2Calo Hypo entries per Eta bin;Eta bin no.", + xbins=11, xmin=-0.5, xmax=10.5) ] + self.Histograms += [ defineHistogram('Eta', type='TH1F', title="L2Calo Hypo entries per Eta;Eta", + xbins=100, xmin=-2.5, xmax=2.5) ] + self.Histograms += [ defineHistogram('Phi', type='TH1F', title="L2Calo Hypo entries per Phi;Phi", + xbins=128, xmin=-3.2, xmax=3.2) ] + + self.Histograms += [ defineHistogram('F1', type='TH1F', title="L2Calo Hypo f_{1};f_{1}", + xbins=34, xmin=-0.5, xmax=1.2) ] + + self.Histograms += [ defineHistogram('Weta2', type='TH1F', title="L2Calo Hypo Weta2; E Width in sampling 2",xbins=96, xmin=-0.1, xmax=0.61) ] + self.Histograms += [ defineHistogram('Wstot', type='TH1F', title="L2Calo Hypo Wstot; E Width in sampling 1",xbins=48, xmin=-0.1, xmax=11.) ] + self.Histograms += [ defineHistogram('F3', type='TH1F', title="L2Calo Hypo F3; E3/(E0+E1+E2+E3)",xbins=96, xmin=-0.1, xmax=1.1) ] + + cuts=['Input','has one TrigEMCluster', '#Delta #eta L2-L1', '#Delta #phi L2-L1','rCore', + 'eRatio','E_{T}^{EM}', 'E_{T}^{Had}','f_{1}','Weta2','Wstot','F3'] + + labelsDescription = '' + for c in cuts: + labelsDescription += c+':' + + self.Histograms += [ defineHistogram('CutCounter', type='TH1I', title="L2Calo Hypo Passed Cuts;Cut", + xbins=14, xmin=-1.5, xmax=12.5, opt="kCumulative", labels=labelsDescription) ] + +class TrigL2CaloLayersHypoOnlineMonitoring(TrigGenericMonitoringToolConfig): + def __init__ (self, name="TrigL2CaloLayersHypoOnlineMonitoring"): + """ defines hisograms for online """ + super(TrigL2CaloLayersHypoOnlineMonitoring, self).__init__(name) + self.defineTarget("Online") + + self.Histograms += [ defineHistogram('Energy', type='TH1F', title="RoI Energy [MeV]", + xbins=50, xmin=0, xmax=50000) ] + self.Histograms += [ defineHistogram('PreSampler_Energy', type='TH1F', title="Energy in the PreSampler [MeV]", + xbins=50, xmin=0, xmax=20000) ] + self.Histograms += [ defineHistogram('PreSampler_fracEnergy', type='TH1F', title="Fraction of energy in the PreSampler [MeV]", + xbins=50, xmin=0, xmax=1) ] + self.Histograms += [ defineHistogram('Eta', type='TH1F', title="L2Calo Hypo entries per Eta;Eta", + xbins=50, xmin=-2.5, xmax=2.5) ] + self.Histograms += [ defineHistogram('Phi', type='TH1F', title="L2Calo Hypo entries per Phi;Phi", + xbins=64, xmin=-3.2, xmax=3.2) ] + + cuts=['Input','has one TrigEMCluster', 'Fraction of Energy in PreSampler', 'Absolute Energy in Presampler'] + + labelsDescription = '' + for c in cuts: + labelsDescription += c+':' + + self.Histograms += [ defineHistogram('CutCounter', type='TH1I', title="RoI Layers Hypo Passed Cuts;Cut", + xbins=4, xmin=-0.5, xmax=3.5, opt="kCumulative", labels=labelsDescription) ] + +class TrigL2CaloLayersHypoValidationMonitoring(TrigGenericMonitoringToolConfig): + def __init__ (self, name="TrigL2CaloLayersHypoValidationMonitoring"): + super(TrigL2CaloLayersHypoValidationMonitoring, self).__init__(name) + self.defineTarget( "Validation" ) + + + self.Histograms += [ defineHistogram('Energy', type='TH1F', title="RoI Energy [MeV]", + xbins=50, xmin=0, xmax=50000) ] + self.Histograms += [ defineHistogram('PreSampler_Energy', type='TH1F', title="Energy in the PreSampler [MeV]", + xbins=50, xmin=0, xmax=20000) ] + self.Histograms += [ defineHistogram('PreSampler_fracEnergy', type='TH1F', title="Fraction of energy in the PreSampler [MeV]", + xbins=50, xmin=0, xmax=1) ] + self.Histograms += [ defineHistogram('Eta', type='TH1F', title="L2Calo Hypo entries per Eta;Eta", + xbins=50, xmin=-2.5, xmax=2.5) ] + self.Histograms += [ defineHistogram('Phi', type='TH1F', title="L2Calo Hypo entries per Phi;Phi", + xbins=64, xmin=-3.2, xmax=3.2) ] + + cuts=['Input','has one TrigEMCluster', 'Fraction of Energy in PreSampler', 'Absolute Energy in Presampler'] + + labelsDescription = '' + for c in cuts: + labelsDescription += c+':' + + self.Histograms += [ defineHistogram('CutCounter', type='TH1I', title="RoI Layers Hypo Passed Cuts;Cut", + xbins=4, xmin=-0.5, xmax=3.5, opt="kCumulative", labels=labelsDescription) ] diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2DielectronMassHypoConfig.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2DielectronMassHypoConfig.py new file mode 100755 index 00000000000..ccdb4448d6b --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2DielectronMassHypoConfig.py @@ -0,0 +1,176 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +from TrigEgammaHypo.TrigEgammaHypoConf import TrigL2DielectronMassFex, TrigL2DielectronMassHypo +from AthenaCommon.SystemOfUnits import GeV +from TrigEgammaHypo.TrigL2DielectronMassHypoMonitoring import * + +class TrigL2DielectronMassFex_Jpsiee ( TrigL2DielectronMassFex ): + __slots__ = [] + def __init__(self, name="TrigL2DielectronMassFex_Jpsiee"): + super(TrigL2DielectronMassFex_Jpsiee, self).__init__(name) + + # Use Cluster Mode (use TrigEMCluster as Probe) + self.UseClusterAsProbe=True + + # ElectronMass: used in calculation of invariant mass + self.ElectronMass=0.511 + + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll=False + + # cuts (not used in use cluster mode) + self.OppositeSign=True + self.CommonVertex=True + self.ValidElectron=True + + # require invariant mass within window + self.LowerMassCut=1.0*GeV + self.UpperMassCut=15.0*GeV + + self.AthenaMonTools = [ TrigL2DielectronMassOnlineMonitoring(), TrigL2DielectronMassValidationMonitoring_Jpsiee() ] + +class TrigL2DielectronMassFex_Upsiee ( TrigL2DielectronMassFex ): + __slots__ = [] + def __init__(self, name="TrigL2DielectronMassFex_Upsiee"): + super(TrigL2DielectronMassFex_Upsiee, self).__init__(name) + + # Use Cluster Mode (use TrigEMCluster as Probe) + self.UseClusterAsProbe=True + + # ElectronMass: used in calculation of invariant mass + self.ElectronMass=0.511 + + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll=False + + # cuts (not used in use cluster mode) + self.OppositeSign=True + self.CommonVertex=True + self.ValidElectron=True + + # require invariant mass within window + self.LowerMassCut=1.0*GeV + self.UpperMassCut=30.0*GeV + + self.AthenaMonTools = [ TrigL2DielectronMassOnlineMonitoring(), TrigL2DielectronMassValidationMonitoring_Upsiee() ] + +class TrigL2DielectronMassFex_Zee ( TrigL2DielectronMassFex ): + __slots__ = [] + def __init__(self, name="TrigL2DielectronMassFex_Zee"): + super(TrigL2DielectronMassFex_Zee, self).__init__(name) + + # Use Cluster Mode (use TrigEMCluster as Probe) + self.UseClusterAsProbe=False + + # ElectronMass: used in calculation of invariant mass + self.ElectronMass=0.511 + + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll=False + + # cuts (not used in use cluster mode) + self.OppositeSign=True + self.CommonVertex=True + self.ValidElectron=True + + # require invariant mass within window + self.LowerMassCut=20.0*GeV + self.UpperMassCut=200.0*GeV + + self.AthenaMonTools = [ TrigL2DielectronMassOnlineMonitoring(), TrigL2DielectronMassValidationMonitoring_Zee() ] + +class TrigL2DielectronMassHypo_Jpsiee ( TrigL2DielectronMassHypo ): + __slots__ = [] + def __init__(self, name="TrigL2DielectronMassHypo_Jpsiee"): + super(TrigL2DielectronMassHypo_Jpsiee, self).__init__(name) + + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll=False + + # cuts + self.OppositeSign=True + self.CommonVertex=True + self.ValidElectron=True + + # require invariant mass within window + self.LowerMassCut=1*GeV + self.UpperMassCut=6*GeV + + self.AthenaMonTools = [ TrigL2DielectronMassOnlineMonitoring(), TrigL2DielectronMassValidationMonitoring_Jpsiee() ] + +class TrigL2DielectronMassHypo_Upsiee ( TrigL2DielectronMassHypo ): + __slots__ = [] + def __init__(self, name="TrigL2DielectronMassHypo_Upsiee"): + super(TrigL2DielectronMassHypo_Upsiee, self).__init__(name) + + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll=False + + # cuts + self.OppositeSign=True + self.CommonVertex=True + self.ValidElectron=True + + # require invariant mass within window + self.LowerMassCut=6*GeV + self.UpperMassCut=20*GeV + + self.AthenaMonTools = [ TrigL2DielectronMassOnlineMonitoring(), TrigL2DielectronMassValidationMonitoring_Upsiee() ] + +class TrigL2DielectronMassHypo_Zee ( TrigL2DielectronMassHypo ): + __slots__ = [] + def __init__(self, name="TrigL2DielectronMassHypo_Zee"): + super(TrigL2DielectronMassHypo_Zee, self).__init__(name) + + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll=False + + # cuts + self.OppositeSign=True + self.CommonVertex=True + self.ValidElectron=True + + # require invariant mass within window + self.LowerMassCut=45.0*GeV + self.UpperMassCut=180.0*GeV + + self.AthenaMonTools = [ TrigL2DielectronMassOnlineMonitoring(), TrigL2DielectronMassValidationMonitoring_Zee() ] + +class TrigL2DielectronMassHypo_Zeg ( TrigL2DielectronMassHypo ): + __slots__ = [] + def __init__(self, name="TrigL2DielectronMassHypo_Zeg"): + super(TrigL2DielectronMassHypo_Zeg, self).__init__(name) + + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll=False + + # cuts + self.OppositeSign=False + self.CommonVertex=False + self.ValidElectron=False + + # require invariant mass within window + self.LowerMassCut=45.0*GeV + self.UpperMassCut=100000.0*GeV + + self.AthenaMonTools = [ TrigL2DielectronMassOnlineMonitoring(), TrigL2DielectronMassValidationMonitoring_Zee() ] + +class TrigL2DielectronMassHypo_Zee2 ( TrigL2DielectronMassHypo ): + __slots__ = [] + def __init__(self, name="TrigL2DielectronMassHypo_Zee2"): + super(TrigL2DielectronMassHypo_Zee2, self).__init__(name) + + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll=False + + # cuts + self.OppositeSign=True + self.CommonVertex=True + self.ValidElectron=True + + # require invariant mass within window + self.LowerMassCut=30.0*GeV + self.UpperMassCut=140.0*GeV + + self.AthenaMonTools = [ TrigL2DielectronMassOnlineMonitoring(), TrigL2DielectronMassValidationMonitoring_Zee() ] + diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2DielectronMassHypoMonitoring.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2DielectronMassHypoMonitoring.py new file mode 100755 index 00000000000..a71e1840e4e --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2DielectronMassHypoMonitoring.py @@ -0,0 +1,48 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +from TrigMonitorBase.TrigGenericMonitoringToolConfig import defineHistogram, TrigGenericMonitoringToolConfig +from AthenaCommon.SystemOfUnits import GeV + +class TrigL2DielectronMassOnlineMonitoring(TrigGenericMonitoringToolConfig): + def __init__ (self, name="TrigL2DielectronMassOnlineMonitoring"): + """ defines hisograms for online """ + super(TrigL2DielectronMassOnlineMonitoring, self).__init__(name) + self.defineTarget("Online") + + self.Histograms = [ defineHistogram('cut', type='TH1F', title="Cut counter", + xbins=7, xmin=-0.5, xmax=6.5, opt="kCumulative") ] + + +class TrigL2DielectronMassValidationMonitoring_Jpsiee(TrigGenericMonitoringToolConfig): + def __init__ (self, name="TrigL2DielectronMassValidationMonitoring_Jpsiee"): + """ defines hisograms for online """ + super(TrigL2DielectronMassValidationMonitoring_Jpsiee, self).__init__(name) + self.defineTarget("Validation") + + self.Histograms += [ defineHistogram('cut', type='TH1F', title="Cut counter", + xbins=7, xmin=-0.5, xmax=6.5, opt="kCumulative") ] + self.Histograms += [ defineHistogram('massOfAccepted', type='TH1F', title="Mass in accepted combinations", + xbins=50, xmin=0.*GeV, xmax=20.*GeV) ] + +class TrigL2DielectronMassValidationMonitoring_Upsiee(TrigGenericMonitoringToolConfig): + def __init__ (self, name="TrigL2DielectronMassValidationMonitoring_Upsiee"): + """ defines hisograms for online """ + super(TrigL2DielectronMassValidationMonitoring_Upsiee, self).__init__(name) + self.defineTarget("Validation") + + self.Histograms += [ defineHistogram('cut', type='TH1F', title="Cut counter", + xbins=7, xmin=-0.5, xmax=6.5, opt="kCumulative") ] + self.Histograms += [ defineHistogram('massOfAccepted', type='TH1F', title="Mass in accepted combinations", + xbins=50, xmin=0.*GeV, xmax=50.*GeV) ] + +class TrigL2DielectronMassValidationMonitoring_Zee(TrigGenericMonitoringToolConfig): + def __init__ (self, name="TrigL2DielectronMassValidationMonitoring_Zee"): + """ defines hisograms for online (to be used in Fex and Hypo)""" + super(TrigL2DielectronMassValidationMonitoring_Zee, self).__init__(name) + self.defineTarget("Validation") + + self.Histograms += [ defineHistogram('cut', type='TH1F', title="Cut counter", + xbins=7, xmin=-0.5, xmax=6.5, opt="kCumulative") ] + self.Histograms += [ defineHistogram('massOfAccepted', type='TH1F', title="Mass in accepted combinations", + xbins=50, xmin=0.0*GeV, xmax=250.0*GeV) ] + diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2ElectronFexConfig.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2ElectronFexConfig.py new file mode 100755 index 00000000000..7767a209448 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2ElectronFexConfig.py @@ -0,0 +1,204 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +############################## +# L2 Electron Fex Algorithm Configuration: +# Phillip Urquijo <Phillip.Urquijo@cern.ch> +############################## + +from TrigEgammaHypo.TrigEgammaHypoConf import TrigL2ElectronFex +from AthenaCommon.SystemOfUnits import GeV, mm + +from AthenaCommon.AppMgr import ToolSvc +from TrackToCalo.ExtrapolateToCaloToolBase import \ + ExtrapolateToCaloToolFactory +extrap = ExtrapolateToCaloToolFactory (depth='showerdefault', + straightLine=False) +ToolSvc+=extrap + +# --------------------------------------------------------------- +# class for common setups (like monitoring) +class L2ElectronFexBase(TrigL2ElectronFex): + __slots__ = [] + def __init__(self, name): + super(L2ElectronFexBase,self).__init__(name) + from TrigEgammaHypo.TrigL2ElectronHypoMonitoring import TrigL2ElectronFexValidationMonitoring, TrigL2ElectronFexOnlineMonitoring + validation = TrigL2ElectronFexValidationMonitoring() + online = TrigL2ElectronFexOnlineMonitoring() + from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig + time = TrigTimeHistToolConfig("Time") + + self.AthenaMonTools = [ time, validation, online ] + + self.EtaBins = [0.0, 0.6, 0.8, 1.15, 1.37, 1.52, 1.81, 2.01, 2.37, 2.47] + # Tracking cuts + self.TrackPt = 1.0 * GeV + # Calo-Tracking matching cuts + self.CaloTrackdETA = [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5] + self.CaloTrackdPHI = [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5] + self.CaloTrackdEoverPLow = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] + self.CaloTrackdEoverPHigh = [999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0] + self.dETACLUSTERthr = 0.1 #not used any more + self.dPHICLUSTERthr = 0.1 #not used any more + self.TrackExtrapolator=extrap + +# --------------------------------------------------------------- +# TrigL2ElectronFex configurations +# --------------------------------------------------------------- + +class L2ElectronFex_all(L2ElectronFexBase): + __slots__ = [] + def __init__(self,name="L2ElectronFex_all"): + super(L2ElectronFex_all, self).__init__(name) + + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll = False + + # Select tracking algorithm + self.TrackAlgoId = 9 # IDscan [1=SiTrack, 4=TRT, 0=use all, 5: SiTrack+IDScan] + + # Co-ordinates of calorimeter face for extrapolation + self.RCalBarrelFace = 1470.0*mm + self.ZCalEndcapFace = 3800.0*mm + + +class L2ElectronFex_all_L2SW(L2ElectronFex_all): + __slots__ = [] + def __init__(self,name="L2ElectronFex_all_L2SW"): + super(L2ElectronFex_all_L2SW, self).__init__(name) + +#No Cut chains +class L2ElectronFex_all_NoCut(L2ElectronFex_all): + __slots__ = [] + def __init__(self,name="L2ElectronFex_all_NoCut"): + super(L2ElectronFex_all_NoCut, self).__init__(name) + self.AcceptAll = True + +class L2ElectronFex_1(L2ElectronFex_all): + __slots__ = [] + def __init__(self,name="L2ElectronFex_1"): + super(L2ElectronFex_1, self).__init__(name) + self.AcceptAll = True + +class L2ElectronFex_all_L2SW_NoCut(L2ElectronFex_all): + __slots__ = [] + def __init__(self,name="L2ElectronFex_all_L2SW_NoCut"): + super(L2ElectronFex_all_L2SW_NoCut, self).__init__(name) + self.AcceptAll = True + +class L2ElectronFex_all_Ringer_NoCut(L2ElectronFex_all): + __slots__ = [] + def __init__(self,name="L2ElectronFex_all_Ringer_NoCut"): + super(L2ElectronFex_all_Ringer_NoCut, self).__init__(name) + self.CaloAlgoId = 2 #CaloRinger + self.AcceptAll = True + +#L2 IDScan chains +class L2ElectronFex_IdScan(L2ElectronFex_all): + __slots__ = [] + def __init__(self,name="L2ElectronFex_IdScan"): + super(L2ElectronFex_IdScan, self).__init__(name) + self.TrackAlgoId = 2 # IDscan + +class L2ElectronFex_IdScan_NoCut(L2ElectronFex_IdScan): + __slots__ = [] + def __init__(self,name="L2ElectronFex_IdScan_NoCut"): + super(L2ElectronFex_IdScan_NoCut, self).__init__(name) + self.AcceptAll = True + +#L2 SiTrack chains +class L2ElectronFex_SiTrack(L2ElectronFex_all): + __slots__ = [] + def __init__(self,name="L2ElectronFex_SiTrack"): + super(L2ElectronFex_SiTrack, self).__init__(name) + self.TrackAlgoId = 1 # SiTrack + +class L2ElectronFex_SiTrack_NoCut(L2ElectronFex_SiTrack): + __slots__ = [] + def __init__(self,name="L2ElectronFex_SiTrack_NoCut"): + super(L2ElectronFex_SiTrack_NoCut, self).__init__(name) + self.AcceptAll = True + +#L2 TRTSegFinder chains +class L2ElectronFex_TRTSegFinder(L2ElectronFex_all): + __slots__ = [] + def __init__(self,name="L2ElectronFex_TRTSegFinder"): + super(L2ElectronFex_TRTSegFinder, self).__init__(name) + + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll = False + + # Select tracking algorithm + self.TrackAlgoId = 3 #TRTSegFinder + + # Calo-Tracking matching cuts + self.TrackPtTRT = 1.0 * GeV + self.CaloTrackdETATRT = [999., 999., 999., 999., 999., 999., 999., 999., 999.] + self.CaloTrackdPHITRT = [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5] + + +class L2ElectronFex_TRTSegFinder_NoCut(L2ElectronFex_TRTSegFinder): + __slots__ = [] + def __init__(self,name="L2ElectronFex_TRTSegFinder_NoCut"): + super(L2ElectronFex_TRTSegFinder_NoCut, self).__init__(name) + self.AcceptAll = True + +#L2 Use all tracks, EF forward+back tracking for photon conversion studies +class L2ElectronFex_FwdBackTracking(L2ElectronFexBase): + __slots__ = [] + def __init__(self,name="L2ElectronFex_FwdBackTracking"): + super(L2ElectronFex_FwdBackTracking, self).__init__(name) + + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll = False + + # Select tracking algorithm + self.TrackAlgoId = 0 # Use all tracks + + # Calo-Tracking matching cuts + self.TrackPtTRT = 1.0 * GeV + self.CaloTrackdETATRT = [999., 999., 999., 999., 999., 999., 999., 999., 999.] + self.CaloTrackdPHITRT = [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5] + +# L2Star strategy A,B,C +class L2ElectronFex_L2StarA(L2ElectronFex_all): + __slots__ = [] + def __init__(self,name="L2ElectronFex_L2StarA"): + super(L2ElectronFex_L2StarA, self).__init__(name) + self.TrackAlgoId = 5 # L2Star strategy A + +class L2ElectronFex_L2StarB(L2ElectronFex_all): + __slots__ = [] + def __init__(self,name="L2ElectronFex_L2StarB"): + super(L2ElectronFex_L2StarB, self).__init__(name) + self.TrackAlgoId = 6 # L2Star strategy B + +class L2ElectronFex_L2StarC(L2ElectronFex_all): + __slots__ = [] + def __init__(self,name="L2ElectronFex_L2StarC"): + super(L2ElectronFex_L2StarC, self).__init__(name) + self.TrackAlgoId = 7 # L2Star strategy C + +class L2ElectronFex_FTK(L2ElectronFex_all): + __slots__ = [] + def __init__(self,name="L2ElectronFex_FTK"): + super(L2ElectronFex_FTK, self).__init__(name) + self.TrackAlgoId = 8 + +class L2ElectronFex_IDComb(L2ElectronFex_FwdBackTracking): + __slots__ = [] + def __init__(self,name="L2ElectronFex_IDComb"): + super(L2ElectronFex_IDComb, self).__init__(name) + + +class L2ElectronFex_FwdBackTracking_NoCut(L2ElectronFex_FwdBackTracking): + __slots__ = [] + def __init__(self,name="L2ElectronFex_FwdBackTracking_NoCut"): + super(L2ElectronFex_FwdBackTracking_NoCut, self).__init__(name) + self.AcceptAll = True + +class L2ElectronFex_Ringer(L2ElectronFex_all): + __slots__ = [] + def __init__(self,name="L2ElectronFex_Ringer"): + super(L2ElectronFex_Ringer, self).__init__(name) + self.CaloAlgoId = 2 # CaloRinger + diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2ElectronHypoConfig.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2ElectronHypoConfig.py new file mode 100755 index 00000000000..b98aa88cf8e --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2ElectronHypoConfig.py @@ -0,0 +1,134 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +############################## +# L2 Electron Hypothesis Algorithm Configuration: +# Phillip Urquijo <Phillip.Urquijo@cern.ch> +# Maintained by Ryan M White <ryan.white@cern.ch> +############################## + +# 12-2-10 +# (VD) - removing dPhi cut from every Loose/Medium chain (consistency with OFFLINE selection) +# - removing dEt cut from every Loose chain and loosen ( 0.2 ) for Medium ones(consistency with OFFLINE selection) + +from TrigEgammaHypo.TrigEgammaHypoConf import TrigL2ElectronHypo +from AthenaCommon.SystemOfUnits import GeV, mm + +# --------------------------------------------------------------- +# class for common setups (like monitoring) +class L2ElectronHypoBase(TrigL2ElectronHypo): + __slots__ = [] + def __init__(self, name): + super(L2ElectronHypoBase,self).__init__(name) + from TrigEgammaHypo.TrigL2ElectronHypoMonitoring import TrigL2ElectronHypoValidationMonitoring, TrigL2ElectronHypoOnlineMonitoring + validation = TrigL2ElectronHypoValidationMonitoring() + online = TrigL2ElectronHypoOnlineMonitoring() + from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig + time = TrigTimeHistToolConfig("Time") + + self.AthenaMonTools = [ time, validation, online ] + + #common attributes + self.EtaBins = [0.0, 0.6, 0.8, 1.15, 1.37, 1.52, 1.81, 2.01, 2.37, 2.47] + self.CaloTrackdEoverPLow = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] + self.CaloTrackdEoverPHigh = [999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0] + self.TRTRatio = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] + self.EtaBinsTRT = [0.0, 0.6, 0.8, 1.15, 1.37, 1.52, 1.81, 2.01, 2.37, 2.47] + self.CaloTrackdEoverPLowTRT = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] + self.CaloTrackdEoverPHighTRT = [999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0] + self.TRTRatioTRT = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] + self.CaloTrackdETATRT = [999., 999., 999., 999., 999., 999., 999., 999., 999.] + + +# --------------------------------------------------------------- +# TrigL2ElectronHypo configurations +# --------------------------------------------------------------- +#------------------------------------------- +# --- Following classes to be used with TriggerMenu +# --- Rely on TM to configure +# --- RMWhite 2014 +# +# --- Et Cut only -- threshold passed from TM chain name +class L2ElectronHypo_e_NoCut(L2ElectronHypoBase): + __slots__ = [] + def __init__(self, name, threshold): + super( L2ElectronHypo_e_NoCut, self).__init__(name) + self.AcceptAll = True + +# --- No Cut but set the track algorithm +class L2ElectronHypo_e_NoCut_TrkAlgo(L2ElectronHypoBase): + __slots__ = [] + def __init__(self, name, threshold): + super( L2ElectronHypo_e_NoCut, self).__init__(name) + self.AcceptAll = True + +# Configurable L2 Electron class via menu +# Using cuts based on Et threshold +# Need to be fixed for ID +class L2ElectronHypo_e_ID (L2ElectronHypoBase): + __slots__ = [] + def __init__(self, name, threshold, IDinfo): + super( L2ElectronHypo_e_ID, self ).__init__( name ) + self.AcceptAll = False + self.TrackAlgoId = 9 # [0=All, 3=TRT, 5=SiTrack or IdScan, 6, strategyB, 7, strategyC, 9 new Fast Tracking] + # cuts + self.TrackPt = 1.0 * GeV + self.CaloTrackdETA = [ 0.2 , 0.2 , 0.2 , 0.2 , 0.2 , 0.2 , 0.2 , 0.2 , 0.2 ] + self.CaloTrackdPHI = [ 999., 999., 999., 999., 999., 999., 999., 999., 999.] + if (threshold > 15): + self.TrackPt = 2.0 * GeV + elif (threshold >= 20): + self.TrackPt = 3.0 * GeV + elif (threshold >= 50): + self.TrackPt = 5.0 * GeV + self.CaloTrackdETA = [ 999., 999., 999., 999., 999., 999., 999., 999., 999.] + self.CaloTrackdPHI = [ 999., 999., 999., 999., 999., 999., 999., 999., 999.] + else: + raise RuntimeError('No L2 Electron Theshold: Default cuts configured') + +# Configurable L2 Track Algorithm +class L2ElectronHypo_e_ID_L2TrkAlg (L2ElectronHypo_e_ID): + __slots__ = [] + def __init__(self, name, threshold, IDinfo, L2IDAlg): + super( L2ElectronHypo_e_ID_L2TrkAlg, self ).__init__( name, threshold, IDinfo ) + # Here we need to set the TrackAlgoID from the menu name + if L2IDAlg == 'TRT': + self.TrackAlgoId = 3 + elif L2IDAlg == 'L2StarA': + self.TrackAlgoId = 5 + elif L2IDAlg == 'L2StarB': + self.TrackAlgoId = 6 + elif L2IDAlg == 'L2StarC': + self.TrackAlgoId = 7 + elif L2IDAlg == 'FTK': + self.TrackAlgoId = 8 + else: + self.TrackAlgoId = 9 # [0=All, 3=TRT, 5=SiTrack or IdScan, 6=L2StarB, 7=L2StarC, 8=FTK, 9=Fast] + +# TRT has different cuts +class L2ElectronHypo_e_ID_TRT (L2ElectronHypo_e_ID): + __slots__ = [] + def __init__(self, name, threshold, IDinfo): + super( L2ElectronHypo_e_ID_TRT, self ).__init__( name, threshold, IDinfo ) + # Here we need to set the TrackAlgoID from the menu name + self.TrackAlgoId = 3 # [0=All, 3=TRT, 5=SiTrack or IdScan, 6=L2StarB, 7=L2StarC] + # cuts + self.TrackPtTRT = 1.0 * GeV + self.CaloTrackdPHITRT = [0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3] + +# --------------------------------------------------------------- +# NoCut + +class L2ElectronHypo_1(L2ElectronHypoBase): + __slots__ = [] + def __init__(self, name="L2ElectronHypo_1"): + super( L2ElectronHypo_1, self).__init__(name) + + # AcceptTrigIDCaloHypoAll flag: if true take events regardless of cuts + self.AcceptAll = True + self.TrackAlgoId = 9 # [0=All, 3=TRT, 5=SiTrack or IdScan] + # cuts + self.TrackPt = 2.0 * GeV + self.CaloTrackdETA = [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1] + self.CaloTrackdPHI = [ 999., 999., 999., 999., 999., 999., 999., 999., 999.] + + diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2ElectronHypoMonitoring.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2ElectronHypoMonitoring.py new file mode 100644 index 00000000000..d17de7029bc --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2ElectronHypoMonitoring.py @@ -0,0 +1,72 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + + +from TrigMonitorBase.TrigGenericMonitoringToolConfig import defineHistogram, TrigGenericMonitoringToolConfig + +class TrigL2ElectronHypoOnlineMonitoring(TrigGenericMonitoringToolConfig): + def __init__ (self, name="TrigL2ElectronHypoOnlineMonitoring"): + super(TrigL2ElectronHypoOnlineMonitoring, self).__init__(name) + self.defineTarget( "Online" ) + + cuts=['Input','has TrigElectronContainer', 'p_{T} calo cut', '#Delta #eta tk-cl', '#Delta #phi tk-cl','E/p'] + + labelsDescription = '' + for c in cuts: + labelsDescription += c+':' + + self.Histograms += [ defineHistogram('CutCounter', type='TH1I', title="L2Electron Hypo Cut Counter;Cut Counter", xbins=12, xmin=-1.5, xmax=10, opt="kCumulative", labels=labelsDescription) ] + self.Histograms += [ defineHistogram('CaloTrackdEta', type='TH1F', title="L2Electron Hypo #Delta #eta between cluster and track;#Delta #eta;Nevents", xbins=80, xmin=-0.4, xmax=0.4) ] + self.Histograms += [ defineHistogram('CaloTrackdPhi', type='TH1F', title="L2Electron Hypo #Delta #phi between cluster and track;#Delta #phi;Nevents", xbins=80, xmin=-0.4, xmax=0.4) ] + self.Histograms += [ defineHistogram('CaloTrackEoverP', type='TH1F', title="L2Electron Hypo E/p;E/p;Nevents", xbins=120, xmin=0, xmax=12) ] + self.Histograms += [ defineHistogram('PtTrack', type='TH1F', title="L2Electron Hypo p_{T}^{track} [MeV];p_{T}^{track} [MeV];Nevents", xbins=50, xmin=0, xmax=100000) ] + self.Histograms += [ defineHistogram('PtCalo', type='TH1F', title="L2Electron Hypo p_{T}^{calo} [MeV];p_{T}^{calo} [MeV];Nevents", xbins=50, xmin=0, xmax=100000) ] + self.Histograms += [ defineHistogram('CaloEta', type='TH1F', title="L2Electron Hypo #eta^{calo} ; #eta^{calo};Nevents", xbins=200, xmin=-2.5, xmax=2.5) ] + self.Histograms += [ defineHistogram('CaloPhi', type='TH1F', title="L2Electron Hypo #phi^{calo} ; #phi^{calo};Nevents", xbins=320, xmin=-3.2, xmax=3.2) ] + + +########## Create instance for validation - same as online here +class TrigL2ElectronHypoValidationMonitoring(TrigL2ElectronHypoOnlineMonitoring): + def __init__ (self, name="TrigL2ElectronHypoValidationMonitoring"): + super(TrigL2ElectronHypoOnlineMonitoring, self).__init__(name) + self.defineTarget("Validation") + + cuts=['Input','has TrigElectronContainer', 'p_{T} calo cut', '#Delta #eta tk-cl', '#Delta #phi tk-cl','E/p'] + + labelsDescription = '' + for c in cuts: + labelsDescription += c+':' + + self.Histograms += [ defineHistogram('CutCounter', type='TH1I', title="L2Electron Hypo Cut Counter;Cut Counter", xbins=12, xmin=-1.5, xmax=10, opt="kCumulative", labels=labelsDescription) ] + self.Histograms += [ defineHistogram('CaloTrackdEta', type='TH1F', title="L2Electron Hypo #Delta #eta between cluster and track;#Delta #eta;Nevents", xbins=80, xmin=-0.4, xmax=0.4) ] + self.Histograms += [ defineHistogram('CaloTrackdPhi', type='TH1F', title="L2Electron Hypo #Delta #phi between cluster and track;#Delta #phi;Nevents", xbins=80, xmin=-0.4, xmax=0.4) ] + self.Histograms += [ defineHistogram('CaloTrackEoverP', type='TH1F', title="L2Electron Hypo E/p;E/p;Nevents", xbins=120, xmin=0, xmax=12) ] + self.Histograms += [ defineHistogram('PtTrack', type='TH1F', title="L2Electron Hypo p_{T}^{track} [MeV];p_{T}^{track} [MeV];Nevents", xbins=50, xmin=0, xmax=100000) ] + self.Histograms += [ defineHistogram('PtCalo', type='TH1F', title="L2Electron Hypo p_{T}^{calo} [MeV];p_{T}^{calo} [MeV];Nevents", xbins=50, xmin=0, xmax=100000) ] + self.Histograms += [ defineHistogram('CaloEta', type='TH1F', title="L2Electron Hypo #eta^{calo} ; #eta^{calo};Nevents", xbins=200, xmin=-2.5, xmax=2.5) ] + self.Histograms += [ defineHistogram('CaloPhi', type='TH1F', title="L2Electron Hypo #phi^{calo} ; #phi^{calo};Nevents", xbins=320, xmin=-3.2, xmax=3.2) ] + + + +class TrigL2ElectronFexOnlineMonitoring(TrigGenericMonitoringToolConfig): + def __init__ (self, name="TrigL2ElectronFexOnlineMonitoring"): + super(TrigL2ElectronFexOnlineMonitoring, self).__init__(name) + self.defineTarget( "Online" ) + + self.Histograms += [ defineHistogram('CaloTrackdEta', type='TH1F', title="L2Electron Fex #Delta #eta between cluster and track;#Delta #eta;Nevents", xbins=80, xmin=-0.4, xmax=0.4) ] + self.Histograms += [ defineHistogram('CaloTrackdPhi', type='TH1F', title="L2Electron Fex #Delta #phi between cluster and track;#Delta #phi;Nevents", xbins=80, xmin=-0.4, xmax=0.4) ] + self.Histograms += [ defineHistogram('CaloTrackEoverP', type='TH1F', title="L2Electron Fex E/p;E/p;Nevents", xbins=120, xmin=0, xmax=12) ] + self.Histograms += [ defineHistogram('PtTrack', type='TH1F', title="L2Electron Fex p_{T}^{track} [MeV];p_{T}^{track} [MeV];Nevents", xbins=50, xmin=0, xmax=100000) ] + self.Histograms += [ defineHistogram('PtCalo', type='TH1F', title="L2Electron Fex p_{T}^{calo} [MeV];p_{T}^{calo} [MeV];Nevents", xbins=50, xmin=0, xmax=100000) ] + + +class TrigL2ElectronFexValidationMonitoring(TrigGenericMonitoringToolConfig): + def __init__ (self, name="TrigL2ElectronFexValidationMonitoring"): + super(TrigL2ElectronFexValidationMonitoring, self).__init__(name) + self.defineTarget( "Validation" ) + + self.Histograms += [ defineHistogram('CaloTrackdEta', type='TH1F', title="L2Electron Fex #Delta #eta between cluster and track;#Delta #eta;Nevents", xbins=80, xmin=-0.4, xmax=0.4) ] + self.Histograms += [ defineHistogram('CaloTrackdPhi', type='TH1F', title="L2Electron Fex #Delta #phi between cluster and track;#Delta #phi;Nevents", xbins=80, xmin=-0.4, xmax=0.4) ] + self.Histograms += [ defineHistogram('CaloTrackEoverP', type='TH1F', title="L2Electron Fex E/p;E/p;Nevents", xbins=120, xmin=0, xmax=12) ] + self.Histograms += [ defineHistogram('PtTrack', type='TH1F', title="L2Electron Fex p_{T}^{track} [MeV];p_{T}^{track} [MeV];Nevents", xbins=50, xmin=0, xmax=100000) ] + self.Histograms += [ defineHistogram('PtCalo', type='TH1F', title="L2Electron Fex p_{T}^{calo} [MeV];p_{T}^{calo} [MeV];Nevents", xbins=50, xmin=0, xmax=100000) ] + diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2PhotonFexConfig.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2PhotonFexConfig.py new file mode 100755 index 00000000000..7e1b9bcf498 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2PhotonFexConfig.py @@ -0,0 +1,14 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +from TrigEgammaHypo.TrigEgammaHypoConf import TrigL2PhotonFex + + +# basic cut +class L2PhotonFex_1 (TrigL2PhotonFex): + __slots__ = [] + def __init__(self, name = "L2PhotonFex_1"): + super( L2PhotonFex_1, self ).__init__( name ) + + + + diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2PhotonHypoConfig.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2PhotonHypoConfig.py new file mode 100755 index 00000000000..d27bcff7c67 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2PhotonHypoConfig.py @@ -0,0 +1,1152 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +from TrigEgammaHypo.TrigEgammaHypoConf import TrigL2PhotonHypo + +from TriggerJobOpts.TriggerFlags import TriggerFlags +menu_name = TriggerFlags.triggerMenuSetup() + +#### +#### !!!!!!!!!!!!!!!!!!!!!!!!!! +# we have to do something with this, where was this defined before? +from AthenaCommon.SystemOfUnits import GeV + +# cut map class -- based on L2CaloHypoCutMaps +class L2PhotonCutMaps (): + def __init__(self, threshold): + if(float(threshold) >= 0. and float(threshold) < 10): + self.MapsHADETthr = { + 'loose': [0.1638, 0.1596, 0.1218, 0.1638, 0.0448875, 0.1386, 0.1596, 0.1638, 0.147], + 'loose1': [0.1638, 0.1596, 0.1218, 0.1638, 0.0448875, 0.1386, 0.1596, 0.1638, 0.147], + 'medium':[0.0254625, 0.0238875, 0.0270375, 0.0207375, 0.03465, 0.0378, 0.03465, 0.0286125, 0.02625], + 'medium1':[0.0254625, 0.0238875, 0.0270375, 0.0207375, 0.03465, 0.0378, 0.03465, 0.0286125, 0.02625], + 'tight':[0.0254625, 0.0238875, 0.0270375, 0.0207375, 0.03465, 0.0378, 0.03465, 0.0286125, 0.02625], + 'tight1':[0.0254625, 0.0238875, 0.0270375, 0.0207375, 0.03465, 0.0378, 0.03465, 0.0286125, 0.02625], + } + self.MapsCARCOREthr = { + 'loose': [0.532, 0.57, 0.646, 0.684, 0.418, 0.722, 0.684, 0.722, 0.76], + 'loose1': [0.532, 0.57, 0.646, 0.684, 0.418, 0.722, 0.684, 0.722, 0.76], + 'medium':[0.83125, 0.719625, 0.814625, 0.83125, 0.703, 0.817, 0.83125, 0.8265, 0.719625], + 'medium1':[0.83125, 0.719625, 0.814625, 0.83125, 0.703, 0.817, 0.83125, 0.8265, 0.719625], + 'tight':[0.83125, 0.719625, 0.814625, 0.83125, 0.703, 0.817, 0.83125, 0.8265, 0.719625], + 'tight1':[0.83125, 0.719625, 0.814625, 0.83125, 0.703, 0.817, 0.83125, 0.8265, 0.719625], + } + self.MapsCAERATIOthr = { + 'loose': [-999., -999., -999., -999., -999., -999., -999., -999., -999.], + 'loose1': [-999., -999., -999., -999., -999., -999., -999., -999., -999.], + 'medium':[-999., -999., -999., -999., -999., -999., -999., -999., -999.], + 'medium1':[-999., -999., -999., -999., -999., -999., -999., -999., -999.], + 'tight':[-999., -999., -999., -999., -999., -999., -999., -999., -999.], + 'tight1':[-999., -999., -999., -999., -999., -999., -999., -999., -999.], + } + elif(float(threshold) >= 10. and float(threshold) < 15): + self.MapsHADETthr = { + 'loose': [0.0359625, 0.0343875, 0.0396375, 0.0291375, 0.0501375, 0.0559125, 0.0548625, 0.0538125, 0.0469875], + 'loose1': [0.0359625, 0.0343875, 0.0396375, 0.0291375, 0.0501375, 0.0559125, 0.0548625, 0.0538125, 0.0469875], + 'medium':[0.0359625, 0.0343875, 0.0396375, 0.0291375, 0.0501375, 0.0559125, 0.0548625, 0.0538125, 0.0469875], + 'medium1':[0.0359625, 0.0343875, 0.0396375, 0.0291375, 0.0501375, 0.0559125, 0.0548625, 0.0538125, 0.0469875], + 'tight':[0.0359625, 0.0343875, 0.0396375, 0.0291375, 0.0501375, 0.0559125, 0.0548625, 0.0538125, 0.0469875], + 'tight1':[0.0359625, 0.0343875, 0.0396375, 0.0291375, 0.0501375, 0.0559125, 0.0548625, 0.0538125, 0.0469875], + } + self.MapsCARCOREthr = { + 'loose': [0.786125, 0.786125, 0.767125, 0.795625, 0.703, 0.776625, 0.819375, 0.805125, 0.681625], + 'loose1': [0.786125, 0.786125, 0.767125, 0.795625, 0.703, 0.776625, 0.819375, 0.805125, 0.681625], + 'medium':[0.786125, 0.786125, 0.767125, 0.795625, 0.703, 0.776625, 0.819375, 0.805125, 0.681625], + 'medium1':[0.786125, 0.786125, 0.767125, 0.795625, 0.703, 0.776625, 0.819375, 0.805125, 0.681625], + 'tight':[0.786125, 0.786125, 0.767125, 0.795625, 0.703, 0.776625, 0.819375, 0.805125, 0.681625], + 'tight1':[0.786125, 0.786125, 0.767125, 0.795625, 0.703, 0.776625, 0.819375, 0.805125, 0.681625], + } + self.MapsCAERATIOthr = { + 'loose': [-999., -999., -999., -999., -999., -999., -999., -999., -999.], + 'loose1': [-999., -999., -999., -999., -999., -999., -999., -999., -999.], + 'medium': [-999., -999., -999., -999., -999., -999., -999., -999., -999.], + 'medium1': [-999., -999., -999., -999., -999., -999., -999., -999., -999.], + 'tight': [-999., -999., -999., -999., -999., -999., -999., -999., -999.], + 'tight1': [-999., -999., -999., -999., -999., -999., -999., -999., -999.], + } + elif(float(threshold) >= 15. and float(threshold) < 20): + self.MapsHADETthr = { + 'loose':[0.0328125, 0.0312375, 0.0354375, 0.0270375, 0.0459375, 0.0527625, 0.0433125, 0.0485625, 0.0396375], + 'loose1':[0.0328125, 0.0312375, 0.0354375, 0.0270375, 0.0459375, 0.0527625, 0.0433125, 0.0485625, 0.0396375], + 'medium':[0.0328125, 0.0312375, 0.0354375, 0.0270375, 0.0459375, 0.0527625, 0.0433125, 0.0485625, 0.0396375], + 'medium1':[0.0328125, 0.0312375, 0.0354375, 0.0270375, 0.0459375, 0.0527625, 0.0433125, 0.0485625, 0.0396375], + 'tight':[0.0328125, 0.0312375, 0.0354375, 0.0270375, 0.0459375, 0.0527625, 0.0433125, 0.0485625, 0.0396375], + 'tight1':[0.0328125, 0.0312375, 0.0354375, 0.0270375, 0.0459375, 0.0527625, 0.0433125, 0.0485625, 0.0396375], + } + self.MapsCARCOREthr = { + 'loose':[0.809875, 0.805125, 0.786125, 0.809875, 0.703, 0.795625, 0.819375, 0.814625, 0.691125], + 'loose1':[0.809875, 0.805125, 0.786125, 0.809875, 0.703, 0.795625, 0.819375, 0.814625, 0.691125], + 'medium':[0.809875, 0.805125, 0.786125, 0.809875, 0.703, 0.795625, 0.819375, 0.814625, 0.691125], + 'medium1':[0.809875, 0.805125, 0.786125, 0.809875, 0.703, 0.795625, 0.819375, 0.814625, 0.691125], + 'tight':[0.809875, 0.805125, 0.786125, 0.809875, 0.703, 0.795625, 0.819375, 0.814625, 0.691125], + 'tight1':[0.809875, 0.805125, 0.786125, 0.809875, 0.703, 0.795625, 0.819375, 0.814625, 0.691125], + } + self.MapsCAERATIOthr = { + 'loose': [-999., -999., -999., -999., -999., -999., -999., -999., -999.], + 'loose1': [-999., -999., -999., -999., -999., -999., -999., -999., -999.], + 'medium':[-999., -999., -999., -999., -999., -999., -999., -999., -999.], + 'medium1':[-999., -999., -999., -999., -999., -999., -999., -999., -999.], + 'tight':[-999., -999., -999., -999., -999., -999., -999., -999., -999.], + 'tight1':[-999., -999., -999., -999., -999., -999., -999., -999., -999.], + } + elif(float(threshold) >= 20. and float(threshold) < 30): + self.MapsHADETthr = { + 'loose':[0.0275625, 0.0259875, 0.0291375, 0.0228375, 0.0259875, 0.0391125, 0.0359625, 0.0370125, 0.0291375], + 'loose1':[0.0275625, 0.0259875, 0.0291375, 0.0228375, 0.0259875, 0.0391125, 0.0359625, 0.0370125, 0.0291375], + 'medium':[0.0275625, 0.0259875, 0.0291375, 0.0228375, 0.0259875, 0.0391125, 0.0359625, 0.0370125, 0.0291375], + 'medium1':[0.0275625, 0.0259875, 0.0291375, 0.0228375, 0.0259875, 0.0391125, 0.0359625, 0.0370125, 0.0291375], + 'tight':[0.0275625, 0.0259875, 0.0291375, 0.0228375, 0.0259875, 0.0391125, 0.0359625, 0.0370125, 0.0291375], + 'tight1':[0.0275625, 0.0259875, 0.0291375, 0.0228375, 0.0259875, 0.0391125, 0.0359625, 0.0370125, 0.0291375], + } + self.MapsCARCOREthr = { + 'loose':[0.819375, 0.819375, 0.800375, 0.828875, 0.7125, 0.805125, 0.843125, 0.824125, 0.700625], + 'loose1':[0.819375, 0.819375, 0.800375, 0.828875, 0.7125, 0.805125, 0.843125, 0.824125, 0.700625], + 'medium':[0.819375, 0.819375, 0.800375, 0.828875, 0.7125, 0.805125, 0.843125, 0.824125, 0.700625], + 'medium1':[0.819375, 0.819375, 0.800375, 0.828875, 0.7125, 0.805125, 0.843125, 0.824125, 0.700625], + 'tight':[0.819375, 0.819375, 0.800375, 0.828875, 0.7125, 0.805125, 0.843125, 0.824125, 0.700625], + 'tight1':[0.819375, 0.819375, 0.800375, 0.828875, 0.7125, 0.805125, 0.843125, 0.824125, 0.700625], + } + self.MapsCAERATIOthr = { + 'loose': [-999., -999., -999., -999., -999., -999., -999., -999., -999.], + 'loose1': [-999., -999., -999., -999., -999., -999., -999., -999., -999.], + 'medium':[-999., -999., -999., -999., -999., -999., -999., -999., -999.], + 'medium1':[-999., -999., -999., -999., -999., -999., -999., -999., -999.], + 'tight':[-999., -999., -999., -999., -999., -999., -999., -999., -999.], + 'tight1':[-999., -999., -999., -999., -999., -999., -999., -999., -999.], + } + elif(float(threshold) >= 30. and float(threshold) < 40): + self.MapsHADETthr = { + 'loose':[0.0249375, 0.0233625, 0.0217875, 0.0202125, 0.0202125, 0.0265125, 0.0333375, 0.0328125, 0.0249375], + 'loose1':[0.0249375, 0.0233625, 0.0217875, 0.0202125, 0.0202125, 0.0265125, 0.0333375, 0.0328125, 0.0249375], + 'medium':[0.0249375, 0.0233625, 0.0217875, 0.0202125, 0.0202125, 0.0265125, 0.0333375, 0.0328125, 0.0249375], + 'medium1':[0.0249375, 0.0233625, 0.0217875, 0.0202125, 0.0202125, 0.0265125, 0.0333375, 0.0328125, 0.0249375], + 'tight':[0.0249375, 0.0233625, 0.0217875, 0.0202125, 0.0202125, 0.0265125, 0.0333375, 0.0328125, 0.0249375], + 'tight1':[0.0249375, 0.0233625, 0.0217875, 0.0202125, 0.0202125, 0.0265125, 0.0333375, 0.0328125, 0.0249375], + } + self.MapsCARCOREthr = { + 'loose':[0.852625, 0.843125, 0.833625, 0.833625, 0.7505, 0.828875, 0.843125, 0.838375, 0.748125], + 'loose1':[0.852625, 0.843125, 0.833625, 0.833625, 0.7505, 0.828875, 0.843125, 0.838375, 0.748125], + 'medium':[0.852625, 0.843125, 0.833625, 0.833625, 0.7505, 0.828875, 0.843125, 0.838375, 0.748125], + 'medium1':[0.852625, 0.843125, 0.833625, 0.833625, 0.7505, 0.828875, 0.843125, 0.838375, 0.748125], + 'tight':[0.852625, 0.843125, 0.833625, 0.833625, 0.7505, 0.828875, 0.843125, 0.838375, 0.748125], + 'tight1':[0.852625, 0.843125, 0.833625, 0.833625, 0.7505, 0.828875, 0.843125, 0.838375, 0.748125], + } + self.MapsCAERATIOthr = { + 'loose': [-999., -999., -999., -999., -999., -999., -999., -999., -999.], + 'loose1': [-999., -999., -999., -999., -999., -999., -999., -999., -999.], + 'medium':[-999., -999., -999., -999., -999., -999., -999., -999., -999.], + 'medium1': [-999., -999., -999., -999., -999., -999., -999., -999., -999.], + 'tight': [-999., -999., -999., -999., -999., -999., -999., -999., -999.], + 'tight1':[-999., -999., -999., -999., -999., -999., -999., -999., -999.], + } + elif(float(threshold) >= 40.): + self.MapsHADETthr = { + 'loose':[0.0202125, 0.0217875, 0.0170625, 0.0186375, 0.0186375, 0.0238875, 0.0270375, 0.0228375, 0.0196875], + 'loose1':[0.0202125, 0.0217875, 0.0170625, 0.0186375, 0.0186375, 0.0238875, 0.0270375, 0.0228375, 0.0196875], + 'medium':[0.0202125, 0.0217875, 0.0170625, 0.0186375, 0.0186375, 0.0238875, 0.0270375, 0.0228375, 0.0196875], + 'medium1':[0.0202125, 0.0217875, 0.0170625, 0.0186375, 0.0186375, 0.0238875, 0.0270375, 0.0228375, 0.0196875], + 'tight':[0.0202125, 0.0217875, 0.0170625, 0.0186375, 0.0186375, 0.0238875, 0.0270375, 0.0228375, 0.0196875], + 'tight1':[0.0202125, 0.0217875, 0.0170625, 0.0186375, 0.0186375, 0.0238875, 0.0270375, 0.0228375, 0.0196875], + } + self.MapsCARCOREthr = { + 'loose':[0.862125, 0.857375, 0.852625, 0.847875, 0.7505, 0.833625, 0.857375, 0.843125, 0.800375], + 'loose1':[0.862125, 0.857375, 0.852625, 0.847875, 0.7505, 0.833625, 0.857375, 0.843125, 0.800375], + 'medium':[0.862125, 0.857375, 0.852625, 0.847875, 0.7505, 0.833625, 0.857375, 0.843125, 0.800375], + 'medium1':[0.862125, 0.857375, 0.852625, 0.847875, 0.7505, 0.833625, 0.857375, 0.843125, 0.800375], + 'tight':[0.862125, 0.857375, 0.852625, 0.847875, 0.7505, 0.833625, 0.857375, 0.843125, 0.800375], + 'tight1':[0.862125, 0.857375, 0.852625, 0.847875, 0.7505, 0.833625, 0.857375, 0.843125, 0.800375], + } + self.MapsCAERATIOthr = { + 'loose': [-999., -999., -999., -999., -999., -999., -999., -999., -999.], + 'loose1': [-999., -999., -999., -999., -999., -999., -999., -999., -999.], + 'medium': [-999., -999., -999., -999., -999., -999., -999., -999., -999.], + 'medium1': [-999., -999., -999., -999., -999., -999., -999., -999., -999.], + 'tight': [-999., -999., -999., -999., -999., -999., -999., -999., -999.], + 'tight1': [-999., -999., -999., -999., -999., -999., -999., -999., -999.], + } + else: + raise RuntimeError('INCORRECT threshold: No cuts configured') +# basic cut +class TrigL2PhotonHypoBase (TrigL2PhotonHypo): + __slots__ = [] + def __init__(self, name): + super( TrigL2PhotonHypoBase, self ).__init__( name ) + + from TrigEgammaHypo.TrigL2PhotonHypoMonitoring import TrigL2PhotonHypoValidationMonitoring, TrigL2PhotonHypoOnlineMonitoring, TrigL2PhotonHypoCosmicMonitoring + validation = TrigL2PhotonHypoValidationMonitoring() + online = TrigL2PhotonHypoOnlineMonitoring() + cosmic = TrigL2PhotonHypoCosmicMonitoring() + + from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig + time = TrigTimeHistToolConfig("Time") + + self.AthenaMonTools = [ time, validation, online, cosmic ] + + self.ETthr = [0.*GeV, 0.*GeV, 0.*GeV, 0.*GeV, 0.*GeV, 0.*GeV, 0.*GeV, 0.*GeV, 0.*GeV] + self.CARCOREthr = [0., 0., 0., 0., 0., 0., 0., 0., 0.] + self.CAERATIOthr = [0., 0., 0., 0., 0., 0., 0., 0., 0.] + + self.EtaBins = [0, 0.6, 0.8, 1.15, 1.37, 1.52, 1.81, 2.01, 2.37, 2.47] + self.dETACLUSTERthr = 0.1 + self.dPHICLUSTERthr = 0.1 + self.F1thr = [0.005] + self.ET2thr = [90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV, 90.0*GeV] + self.HADET2thr = [999, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0] + self.HADETthr = [0.035, 0.035, 0.035, 0.035, 0.035, 0.035, 0.035, 0.035, 0.035] + +#---------------------------------------------------------- +# DC14 +#---------------------------------------------------------- +# EtCut only chains +# Et threshold cut applied at L2 only +class L2PhotonHypo_g_EtCut (TrigL2PhotonHypoBase): + __slots__ = [] + def __init__(self, name, threshold): + super( L2PhotonHypo_g_EtCut, self ).__init__( name ) + self.AcceptAll = False + self.EtCutOnly = True + self.ETthr = [(float(threshold)-1.)*GeV]*9 + +class L2PhotonHypo_g_NoCut (TrigL2PhotonHypoBase): + __slots__ = [] + def __init__(self, name, threshold): + super( L2PhotonHypo_g_NoCut, self ).__init__( name ) + self.AcceptAll = True + self.EtCutOnly = True + self.ETthr = [(float(threshold)-1.)*GeV]*9 + +class L2PhotonHypo_g_ID (TrigL2PhotonHypoBase): + __slots__ = [] + def __init__(self, name, threshold, IDinfo): + super( L2PhotonHypo_g_ID, self ).__init__( name ) + self.AcceptAll = False + self.EtCutOnly = False + self.ETthr = [(float(threshold)-3.)*GeV]*9 + self.HADETthr = L2PhotonCutMaps(threshold).MapsHADETthr[IDinfo] + self.CARCOREthr = L2PhotonCutMaps(threshold).MapsCARCOREthr[IDinfo] + self.CAERATIOthr =L2PhotonCutMaps(threshold).MapsCAERATIOthr[IDinfo] + +class L2PhotonHypo_g140_loose1 (TrigL2PhotonHypoBase): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g140_loose1"): + super( L2PhotonHypo_g140_loose1, self ).__init__( name ) + self.AcceptAll = False + self.EtCutOnly = False + self.ETthr = [117.*GeV, 117.*GeV, 117.*GeV, 117.*GeV, 117.*GeV, 117.*GeV, 117.*GeV, 117.*GeV, 117.*GeV] + self.CAERATIOthr = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] + self.HADETthr = [0.0202125, 0.0217875, 0.0170625, 0.0186375, 0.0186375, 0.0238875, 0.0270375, 0.0228375, 0.0196875] + self.CARCOREthr = [0.862125, 0.857375, 0.852625, 0.847875, 0.7505, 0.833625, 0.857375, 0.843125, 0.800375] + +class L2PhotonHypo_g140_loose (TrigL2PhotonHypoBase): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g140_loose"): + super( L2PhotonHypo_g140_loose, self ).__init__( name ) + self.AcceptAll = False + self.EtCutOnly = False + self.ETthr = [117.*GeV, 117.*GeV, 117.*GeV, 117.*GeV, 117.*GeV, 117.*GeV, 117.*GeV, 117.*GeV, 117.*GeV] + self.CAERATIOthr = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] + self.HADETthr = [0.0202125, 0.0217875, 0.0170625, 0.0186375, 0.0186375, 0.0238875, 0.0270375, 0.0228375, 0.0196875] + self.CARCOREthr = [0.862125, 0.857375, 0.852625, 0.847875, 0.7505, 0.833625, 0.857375, 0.843125, 0.800375] + +#---------------------------------------------------------- +class L2PhotonHypo_1 (TrigL2PhotonHypoBase): + def __init__(self, name = "L2PhotonHypo_1"): + super( L2PhotonHypo_1, self ).__init__( name ) + + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll = True + self.EtCutOnly = False + self.ETthr = [7.*GeV, 7.*GeV, 7.*GeV, 7.*GeV, 7.*GeV, 7.*GeV, 7.*GeV, 7.*GeV, 7.*GeV] + self.HADETthr = [999, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0] + self.CARCOREthr = [0., 0., 0., 0., 0., 0., 0., 0., 0.] + self.CAERATIOthr = [0., 0., 0., 0., 0., 0., 0., 0., 0.] + + +#------------------------------------------------------------------- +# g3 + +class L2PhotonHypo_g3 (TrigL2PhotonHypoBase): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g3"): + super( L2PhotonHypo_g3, self ).__init__( name ) + + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll = False + self.EtCutOnly = False + self.ETthr = [3.*GeV, 3.*GeV, 3.*GeV, 3.*GeV, 3.*GeV, 3.*GeV, 3.*GeV, 3.*GeV, 3.*GeV] + self.HADETthr = [0.034, 0.030, 0.030, 0.030, 0.058, 0.070, 0.070, 0.050, 0.040] + self.CARCOREthr = [0.680, 0.680, 0.680, 0.680, 0.650, 0.730, 0.800, 0.800, 0.800] + self.CAERATIOthr = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] + +class L2PhotonHypo_g3_nocut (L2PhotonHypo_g3): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g3_nocut"): + super( L2PhotonHypo_g3_nocut, self ).__init__( name ) + self.AcceptAll = True + +class L2PhotonHypo_g3_loose (L2PhotonHypo_g3): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g3_loose"): + super( L2PhotonHypo_g3_loose, self ).__init__( name ) + self.AcceptAll = False + self.HADETthr = [0.1638, 0.1596, 0.1218, 0.1638, 0.0448875, 0.1386, 0.1596, 0.1638, 0.147] + self.CARCOREthr = [0.532, 0.57, 0.646, 0.684, 0.418, 0.722, 0.684, 0.722, 0.76] + + +#------------------------------------------------------------------- +# g5 + +class L2PhotonHypo_g5 (TrigL2PhotonHypoBase): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g5"): + super( L2PhotonHypo_g5, self ).__init__( name ) + self.AcceptAll = False + self.EtCutOnly = False + self.ETthr = [4.*GeV, 4.*GeV, 4.*GeV, 4.*GeV, 4.*GeV, 4.*GeV, 4.*GeV, 4.*GeV, 4.*GeV] + self.HADETthr = [0.021, 0.019, 0.018, 0.019, 0.058, 0.056, 0.041, 0.031, 0.040] + self.CARCOREthr = [0.695, 0.695, 0.695, 0.695, 0.650, 0.855, 0.875, 0.875, 0.800] + self.CAERATIOthr = [0.57, 0.28, 0.07, 0.09, -9999., 0.08, 0.47, 0.58, -9999.] + +class L2PhotonHypo_g5_nocut (L2PhotonHypo_g5): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g5_nocut"): + super( L2PhotonHypo_g5_nocut, self ).__init__( name ) + self.AcceptAll = True + +#a hypo config for the g5_nocut that is seeded by the MTBS +class L2PhotonHypo_g5_nocut_mtbs (L2PhotonHypo_g5): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g5_nocut_mtbs"): + super( L2PhotonHypo_g5_nocut_mtbs, self ).__init__( name ) + self.AcceptAll = True + +class L2PhotonHypo_g5_loose (L2PhotonHypo_g5): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g5_loose"): + super( L2PhotonHypo_g5_loose, self ).__init__( name ) + self.CAERATIOthr = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] + self.HADETthr = [0.1638, 0.1596, 0.1218, 0.1638, 0.0448875, 0.1386, 0.1596, 0.1638, 0.147] + self.CARCOREthr = [0.532, 0.57, 0.646, 0.684, 0.418, 0.722, 0.684, 0.722, 0.76] + +class L2PhotonHypo_g5_medium (L2PhotonHypo_g5): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g5_medium"): + super( L2PhotonHypo_g5_medium, self ).__init__( name ) + self.CAERATIOthr = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] + self.HADETthr = [0.0254625, 0.0238875, 0.0270375, 0.0207375, 0.03465, 0.0378, 0.03465, 0.0286125, 0.02625] + self.CARCOREthr = [0.83125, 0.719625, 0.814625, 0.83125, 0.703, 0.817, 0.83125, 0.8265, 0.719625] + +class L2PhotonHypo_g5_loose_TauMass (L2PhotonHypo_g5): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g5_loose_TauMass"): + super( L2PhotonHypo_g5_loose_TauMass, self ).__init__( name ) + self.CAERATIOthr = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] + self.HADETthr = [0.1725, 0.162, 0.126, 0.166, 0.1425, 0.142, 0.162, 0.166, 0.15] + self.CARCOREthr = [0.532, 0.57, 0.646, 0.684, 0.418, 0.722, 0.684, 0.722, 0.76] + +class L2PhotonHypo_g5_tight (L2PhotonHypo_g5): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g5_tight"): + super( L2PhotonHypo_g5_tight, self ).__init__( name ) +#------------------------------------------------------------------- +# g6 + +class L2PhotonHypo_g6 (TrigL2PhotonHypoBase): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g6"): + super( L2PhotonHypo_g6, self ).__init__( name ) + self.AcceptAll = False + self.EtCutOnly = False + self.ETthr = [5.*GeV, 5.*GeV, 5.*GeV, 5.*GeV, 5.*GeV, 5.*GeV, 5.*GeV, 5.*GeV, 5.*GeV] + self.HADETthr = [0.021, 0.019, 0.018, 0.019, 0.058, 0.056, 0.041, 0.031, 0.040] + self.CARCOREthr = [0.695, 0.695, 0.695, 0.695, 0.650, 0.855, 0.875, 0.875, 0.800] + self.CAERATIOthr = [0.57, 0.28, 0.07, 0.09, -9999., 0.08, 0.47, 0.58, -9999.] + +class L2PhotonHypo_g6_etcut (L2PhotonHypo_g6): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g6_etcut"): + super( L2PhotonHypo_g6_etcut, self ).__init__( name ) + self.EtCutOnly = True + +class L2PhotonHypo_g6_loose (L2PhotonHypo_g6): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g6_loose"): + super( L2PhotonHypo_g6_loose, self ).__init__( name ) + self.CAERATIOthr = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] + self.HADETthr = [0.1638, 0.1596, 0.1218, 0.1638, 0.0448875, 0.1386, 0.1596, 0.1638, 0.147] + self.CARCOREthr = [0.532, 0.57, 0.646, 0.684, 0.418, 0.722, 0.684, 0.722, 0.76] + + +#------------------------------------------------------------------- +# g7 + +class L2PhotonHypo_g7 (TrigL2PhotonHypoBase): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g7"): + super( L2PhotonHypo_g7, self ).__init__( name ) + self.AcceptAll = False + self.EtCutOnly = False + self.ETthr = [6.*GeV, 6.*GeV, 6.*GeV, 6.*GeV, 6.*GeV, 6.*GeV, 6.*GeV, 6.*GeV, 6.*GeV] + self.HADETthr = [0.021, 0.019, 0.018, 0.019, 0.058, 0.056, 0.041, 0.031, 0.040] + self.CARCOREthr = [0.695, 0.695, 0.695, 0.695, 0.650, 0.855, 0.875, 0.875, 0.800] + self.CAERATIOthr = [0.57, 0.28, 0.07, 0.09, -9999., 0.08, 0.47, 0.58, -9999.] + +class L2PhotonHypo_g7_loose (L2PhotonHypo_g7): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g7_loose"): + super( L2PhotonHypo_g7_loose, self ).__init__( name ) + self.CAERATIOthr = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] + self.HADETthr = [0.1638, 0.1596, 0.1218, 0.1638, 0.0448875, 0.1386, 0.1596, 0.1638, 0.147] + self.CARCOREthr = [0.532, 0.57, 0.646, 0.684, 0.418, 0.722, 0.684, 0.722, 0.76] + + +class L2PhotonHypo_g7_medium (L2PhotonHypo_g7): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g7_medium"): + super( L2PhotonHypo_g7_medium, self ).__init__( name ) + self.CAERATIOthr = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] + self.HADETthr = [0.16600, 0.16200, 0.12600, 0.16600, 0.05275, 0.14200, 0.16200, 0.16600, 0.15000] + self.CARCOREthr = [0.532, 0.57, 0.646, 0.684, 0.418, 0.722, 0.684, 0.722, 0.710125] + +class L2PhotonHypo_g7_tight (L2PhotonHypo_g7): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g7_tight"): + super( L2PhotonHypo_g7_tight, self ).__init__( name ) +#------------------------------------------------------------------- +# g9 + +class L2PhotonHypo_g9 (TrigL2PhotonHypoBase): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g9"): + super( L2PhotonHypo_g9, self ).__init__( name ) + self.AcceptAll = False + self.EtCutOnly = False + self.ETthr = [8.*GeV, 8.*GeV, 8.*GeV, 8.*GeV, 8.*GeV, 8.*GeV, 8.*GeV, 8.*GeV, 8.*GeV] + self.HADETthr = [0.021, 0.019, 0.018, 0.019, 0.058, 0.056, 0.041, 0.031, 0.040] + self.CARCOREthr = [0.695, 0.695, 0.695, 0.695, 0.650, 0.855, 0.875, 0.875, 0.800] + self.CAERATIOthr = [0.57, 0.28, 0.07, 0.09, -9999., 0.08, 0.47, 0.58, -9999.] + +class L2PhotonHypo_g9_etcut (L2PhotonHypo_g9): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g9_etcut"): + super( L2PhotonHypo_g9_etcut, self ).__init__( name ) + self.EtCutOnly = True + +class L2PhotonHypo_g9_tight (L2PhotonHypo_g9): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g9_tight"): + super( L2PhotonHypo_g9_tight, self ).__init__( name ) + +#------------------------------------------------------------------- +# g10 + +class L2PhotonHypo_g10 (TrigL2PhotonHypoBase): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g10"): + super( L2PhotonHypo_g10, self ).__init__( name ) + + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll = False + self.EtCutOnly = False + self.ETthr = [9.*GeV, 9.*GeV, 9.*GeV, 9.*GeV, 9.*GeV, 9.*GeV, 9.*GeV, 9.*GeV, 9.*GeV] + # L2 Photon cuts: same as e10_loose + self.HADETthr = [0.022, 0.022, 0.022, 0.022, 0.043, 0.043, 0.035, 0.035, 0.035] + self.CARCOREthr = [0.810, 0.810, 0.810, 0.800, 0.660, 0.800, 0.830, 0.830, 0.830] + self.CAERATIOthr = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] + +class L2PhotonHypo_g10_nocut (L2PhotonHypo_g10): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g10_nocut"): + super( L2PhotonHypo_g10_nocut, self ).__init__( name ) + self.AcceptAll = True + +class L2PhotonHypo_g10_loose (L2PhotonHypo_g10): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g10_loose"): + super( L2PhotonHypo_g10_loose, self ).__init__( name ) + self.AcceptAll = False + self.HADETthr = [0.0359625, 0.0343875, 0.0396375, 0.0291375, 0.0501375, 0.0559125, 0.0548625, 0.0538125, 0.0469875] + self.CARCOREthr = [0.786125, 0.786125, 0.767125, 0.795625, 0.703, 0.776625, 0.819375, 0.805125, 0.681625] + +class L2PhotonHypo_g10i_loose (L2PhotonHypo_g10_loose): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g10i_loose"): + super( L2PhotonHypo_g10i_loose, self ).__init__( name ) + +class L2PhotonHypo_g10_calib (L2PhotonHypo_g10): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g10_calib"): + super( L2PhotonHypo_g10_calib, self ).__init__( name ) + self.AcceptAll = False + +class L2PhotonHypo_g10_medium (L2PhotonHypo_g10): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g10_medium"): + super( L2PhotonHypo_g10_medium, self ).__init__( name ) + self.AcceptAll = False + self.HADETthr = [0.0359625, 0.0343875, 0.0396375, 0.0291375, 0.0501375, 0.0559125, 0.0548625, 0.0538125, 0.0469875] + self.CARCOREthr = [0.786125, 0.786125, 0.767125, 0.795625, 0.703, 0.776625, 0.819375, 0.805125, 0.681625] + +class L2PhotonHypo_g10_loose_TauMass (L2PhotonHypo_g10): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g10_loose_TauMass"): + super( L2PhotonHypo_g10_loose_TauMass, self ).__init__( name ) + self.CAERATIOthr = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] + self.HADETthr = [0.0875, 0.0875, 0.0825, 0.0575, 0.0725, 0.0825, 0.0725, 0.05325, 0.0475] + self.CARCOREthr = [0.786125, 0.786125, 0.767125, 0.795625, 0.703, 0.776625, 0.819375, 0.805125, 0.681625] + +class L2PhotonHypo_g10_tight (L2PhotonHypo_g10): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g10_tight"): + super( L2PhotonHypo_g10_tight, self ).__init__( name ) +#------------------------------------------------------------------- +# g11 + +class L2PhotonHypo_g11 (TrigL2PhotonHypoBase): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g11"): + super( L2PhotonHypo_g11, self ).__init__( name ) + self.AcceptAll = False + self.EtCutOnly = False + self.ETthr = [10.*GeV, 10.*GeV, 10.*GeV, 10.*GeV, 10.*GeV, 10.*GeV, 10.*GeV, 10.*GeV, 10.*GeV] + self.HADETthr = [0.022, 0.022, 0.022, 0.022, 0.043, 0.043, 0.035, 0.035, 0.035] + self.CARCOREthr = [0.810, 0.810, 0.810, 0.800, 0.660, 0.800, 0.830, 0.830, 0.830] + self.CAERATIOthr = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] + +class L2PhotonHypo_g11_etcut (L2PhotonHypo_g11): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g11_etcut"): + super( L2PhotonHypo_g11_etcut, self ).__init__( name ) + self.EtCutOnly = True + + +#------------------------------------------------------------------- +# g12 + +class L2PhotonHypo_g12 (TrigL2PhotonHypoBase): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g12"): + super( L2PhotonHypo_g12, self ).__init__( name ) + self.AcceptAll = False + self.EtCutOnly = False + self.ETthr = [11.*GeV, 11.*GeV, 11.*GeV, 11.*GeV, 11.*GeV, 11.*GeV, 11.*GeV, 11.*GeV, 11.*GeV] + # L2 Electron cuts: #same as e10 + self.HADETthr = [0.022, 0.022, 0.022, 0.022, 0.043, 0.043, 0.035, 0.035, 0.035] + self.CARCOREthr = [0.810, 0.810, 0.810, 0.800, 0.660, 0.800, 0.830, 0.830, 0.830] + self.CAERATIOthr = [0.5 , 0.5 , 0.39 , 0.29 , -9999., 0.29 , 0.6 , 0.6 , -9999.] + +# Comply with DC14 - Run1 +class L2PhotonHypo_g12_loose1 (L2PhotonHypo_g12): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g12_loose1"): + super( L2PhotonHypo_g12_loose1, self ).__init__( name ) + self.CAERATIOthr = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] + self.HADETthr = [0.0359625, 0.0343875, 0.0396375, 0.0291375, 0.0501375, 0.0559125, 0.0548625, 0.0538125, 0.0469875] + self.CARCOREthr = [0.786125, 0.786125, 0.767125, 0.795625, 0.703, 0.776625, 0.819375, 0.805125, 0.681625] + +class L2PhotonHypo_g12_loose (L2PhotonHypo_g12): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g12_loose"): + super( L2PhotonHypo_g12_loose, self ).__init__( name ) + self.CAERATIOthr = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] + self.HADETthr = [0.0359625, 0.0343875, 0.0396375, 0.0291375, 0.0501375, 0.0559125, 0.0548625, 0.0538125, 0.0469875] + self.CARCOREthr = [0.786125, 0.786125, 0.767125, 0.795625, 0.703, 0.776625, 0.819375, 0.805125, 0.681625] + +class L2PhotonHypo_g12_medium (L2PhotonHypo_g12): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g12_medium"): + super( L2PhotonHypo_g12_medium, self ).__init__( name ) + self.CAERATIOthr = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] + self.HADETthr = [0.0359625, 0.0343875, 0.0396375, 0.0291375, 0.0501375, 0.0559125, 0.0548625, 0.0538125, 0.0469875] + self.CARCOREthr = [0.786125, 0.786125, 0.767125, 0.795625, 0.703, 0.776625, 0.819375, 0.805125, 0.681625] + +class L2PhotonHypo_g12_loose_TauMass (L2PhotonHypo_g12): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g12_loose_TauMass"): + super( L2PhotonHypo_g12_loose_TauMass, self ).__init__( name ) + self.CAERATIOthr = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] + self.HADETthr = [0.0875, 0.0875, 0.0825, 0.0575, 0.0725, 0.0825, 0.0725, 0.05325, 0.0475] + self.CARCOREthr = [0.786125, 0.786125, 0.767125, 0.795625, 0.703, 0.776625, 0.819375, 0.805125, 0.681625] + +class L2PhotonHypo_g12_tight (L2PhotonHypo_g12): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g12_tight"): + super( L2PhotonHypo_g12_tight, self ).__init__( name ) +#------------------------------------------------------------------- +# g15 + +class L2PhotonHypo_g15 (TrigL2PhotonHypoBase): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g15"): + super( L2PhotonHypo_g15, self ).__init__( name ) + self.AcceptAll = False + self.EtCutOnly = False + self.ETthr = [14.*GeV, 14.*GeV, 14.*GeV, 14.*GeV, 14.*GeV, 14.*GeV, 14.*GeV, 14.*GeV, 14.*GeV] + self.CAERATIOthr = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] + self.HADETthr = [0.015, 0.013, 0.013, 0.015, 0.018, 0.032, 0.025, 0.018, 0.024] + self.CARCOREthr = [0.85, 0.85, 0.85, 0.85, 0.66, 0.85, 0.87, 0.87, 0.87] + +class L2PhotonHypo_g15_loose (L2PhotonHypo_g15): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g15_loose"): + super( L2PhotonHypo_g15_loose, self ).__init__( name ) + self.HADETthr = [0.0328125, 0.0312375, 0.0354375, 0.0270375, 0.0459375, 0.0527625, 0.0433125, 0.0485625, 0.0396375] + self.CARCOREthr = [0.809875, 0.805125, 0.786125, 0.809875, 0.703, 0.795625, 0.819375, 0.814625, 0.691125] + +class L2PhotonHypo_g15i_loose (L2PhotonHypo_g15): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g15i_loose"): + super( L2PhotonHypo_g15i_loose, self ).__init__( name ) + self.HADETthr = [0.0328125, 0.0312375, 0.0354375, 0.0270375, 0.0459375, 0.0527625, 0.0433125, 0.0485625, 0.0396375] + self.CARCOREthr = [0.809875, 0.805125, 0.786125, 0.809875, 0.703, 0.795625, 0.819375, 0.814625, 0.691125] + +class L2PhotonHypo_g15_medium (L2PhotonHypo_g15): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g15_medium"): + super( L2PhotonHypo_g15_medium, self ).__init__( name ) + self.HADETthr = [0.0328125, 0.0312375, 0.0354375, 0.0270375, 0.0459375, 0.0527625, 0.0433125, 0.0485625, 0.0396375] + self.CARCOREthr = [0.809875, 0.805125, 0.786125, 0.809875, 0.703, 0.795625, 0.819375, 0.814625, 0.691125] + +class L2PhotonHypo_g15_tight (L2PhotonHypo_g15): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g15_tight"): + super( L2PhotonHypo_g15_tight, self ).__init__( name ) +#------------------------------------------------------------------- +# g17 + +class L2PhotonHypo_g17 (TrigL2PhotonHypoBase): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g17"): + super( L2PhotonHypo_g17, self ).__init__( name ) + self.AcceptAll = False + self.EtCutOnly = False + self.ETthr = [16.*GeV, 16.*GeV, 16.*GeV, 16.*GeV, 16.*GeV, 16.*GeV, 16.*GeV, 16.*GeV, 16.*GeV] + self.CAERATIOthr = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] + self.HADETthr = [0.015, 0.013, 0.013, 0.015, 0.018, 0.032, 0.025, 0.018, 0.024] + self.CARCOREthr = [0.85, 0.85, 0.85, 0.85, 0.66, 0.85, 0.87, 0.87, 0.87] + +class L2PhotonHypo_g17_etcut (L2PhotonHypo_g17): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g17_etcut"): + super( L2PhotonHypo_g17_etcut, self ).__init__( name ) + self.EtCutOnly = True + +class L2PhotonHypo_g17i_tight (TrigL2PhotonHypoBase): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g17i_tight"): + super( L2PhotonHypo_g17i_tight, self ).__init__( name ) + self.AcceptAll = False + self.EtCutOnly = False + self.HADETthr = [0.015, 0.013, 0.013, 0.015, 0.018, 0.032, 0.025, 0.018, 0.024] + self.CARCOREthr = [0.85, 0.85, 0.85, 0.85, 0.66, 0.85, 0.87, 0.87, 0.87] + self.CAERATIOthr = [0.71, 0.63, 0.47, 0.43, -9999., 0.39, 0.82, 0.80, -9999.] + + +#------------------------------------------------------------------- +# g20 + +class L2PhotonHypo_g20 (TrigL2PhotonHypoBase): ## Primary Trigger + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g20"): + super( L2PhotonHypo_g20, self ).__init__( name ) + self.AcceptAll = False + self.EtCutOnly = False + self.ETthr = [19.*GeV, 19.*GeV, 19.*GeV, 19.*GeV, 19.*GeV, 19.*GeV, 19.*GeV, 19.*GeV, 19.*GeV] + self.CAERATIOthr = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] + self.HADETthr = [0.013, 0.013, 0.013, 0.013, 0.013, 0.023, 0.018, 0.017, 0.017] + self.CARCOREthr = [0.925, 0.925, 0.92, 0.92, 0.6675, 0.91, 0.9025, 0.895, 0.895] +# DC14 - Run1 +class L2PhotonHypo_g20_loose1 (L2PhotonHypo_g20): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g20_loose1"): + super( L2PhotonHypo_g20_loose1, self ).__init__( name ) + self.HADETthr = [0.0275625, 0.0259875, 0.0291375, 0.0228375, 0.0259875, 0.0391125, 0.0359625, 0.0370125, 0.0291375] + self.CARCOREthr = [0.819375, 0.819375, 0.800375, 0.828875, 0.7125, 0.805125, 0.843125, 0.824125, 0.700625] + +#DC14 - Run1 (never used tight!) using loose selection +class L2PhotonHypo_g20_tight1 (L2PhotonHypo_g20): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g20_tight1"): + super( L2PhotonHypo_g20_tight1, self ).__init__( name ) + self.HADETthr = [0.0275625, 0.0259875, 0.0291375, 0.0228375, 0.0259875, 0.0391125, 0.0359625, 0.0370125, 0.0291375] + self.CARCOREthr = [0.819375, 0.819375, 0.800375, 0.828875, 0.7125, 0.805125, 0.843125, 0.824125, 0.700625] + +class L2PhotonHypo_g20_loose (L2PhotonHypo_g20): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g20_loose"): + super( L2PhotonHypo_g20_loose, self ).__init__( name ) + self.HADETthr = [0.0275625, 0.0259875, 0.0291375, 0.0228375, 0.0259875, 0.0391125, 0.0359625, 0.0370125, 0.0291375] + self.CARCOREthr = [0.819375, 0.819375, 0.800375, 0.828875, 0.7125, 0.805125, 0.843125, 0.824125, 0.700625] + +class L2PhotonHypo_g20i_loose (L2PhotonHypo_g20): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g20i_loose"): + super( L2PhotonHypo_g20i_loose, self ).__init__( name ) + self.HADETthr = [0.0275625, 0.0259875, 0.0291375, 0.0228375, 0.0259875, 0.0391125, 0.0359625, 0.0370125, 0.0291375] + self.CARCOREthr = [0.819375, 0.819375, 0.800375, 0.828875, 0.7125, 0.805125, 0.843125, 0.824125, 0.700625] + +class L2PhotonHypo_g20i_calib (L2PhotonHypo_g20i_loose): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g20i_calib"): + super( L2PhotonHypo_g20i_calib, self ).__init__( name ) + +# used for 2g20_medium for SM group +class L2PhotonHypo_g20_medium (L2PhotonHypo_g20): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g20_medium"): + super( L2PhotonHypo_g20_medium, self ).__init__( name ) + self.HADETthr = [0.0275625, 0.0259875, 0.0291375, 0.0228375, 0.0259875, 0.0391125, 0.0359625, 0.0370125, 0.0291375] + self.CARCOREthr = [0.819375, 0.819375, 0.800375, 0.828875, 0.7125, 0.805125, 0.843125, 0.824125, 0.700625] + +class L2PhotonHypo_g20_tight (L2PhotonHypo_g20): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g20_tight"): + super( L2PhotonHypo_g20_tight, self ).__init__( name ) + +class L2PhotonHypo_g20_etcut (L2PhotonHypo_g20): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g20_etcut"): + super( L2PhotonHypo_g20_etcut, self ).__init__( name ) + self.EtCutOnly = True + +class L2PhotonHypo_g20_etcut_xe30_noMu (L2PhotonHypo_g20): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g20_etcut_xe30_noMu"): + super( L2PhotonHypo_g20_etcut_xe30_noMu, self ).__init__( name ) + self.EtCutOnly = True + +class L2PhotonHypo_g20_loose_TauMass (L2PhotonHypo_g20): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g20_loose_TauMass"): + super( L2PhotonHypo_g20_loose_TauMass, self ).__init__( name ) + self.CAERATIOthr = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] + self.HADETthr = [0.0525, 0.0525, 0.0425, 0.0425, 0.0575, 0.0525, 0.03725, 0.0375, 0.02975] + self.CARCOREthr = [0.819375, 0.819375, 0.800375, 0.828875, 0.7125, 0.805125, 0.843125, 0.824125, 0.700625] + +#------------------------------------------------------------------- +#g24 +class L2PhotonHypo_g24_etcut (L2PhotonHypo_g20): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g24_etcut"): + super( L2PhotonHypo_g24_etcut, self ).__init__( name ) + self.AcceptAll = False + self.EtCutOnly = True + self.ETthr = [23.*GeV, 23.*GeV, 23.*GeV, 23.*GeV, 23.*GeV, 23.*GeV, 23.*GeV, 23.*GeV, 23.*GeV] + + +#------------------------------------------------------------------- +# g25 + +class L2PhotonHypo_g25 (TrigL2PhotonHypoBase): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g25"): + super( L2PhotonHypo_g25, self ).__init__( name ) + self.AcceptAll = False + self.EtCutOnly = False + self.ETthr = [24.*GeV, 24.*GeV, 24.*GeV, 24.*GeV, 24.*GeV, 24.*GeV, 24.*GeV, 24.*GeV, 24.*GeV] + self.CAERATIOthr = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] + self.HADETthr = [0.013, 0.013, 0.013, 0.013, 0.013, 0.023, 0.018, 0.017, 0.017] + self.CARCOREthr = [0.925, 0.925, 0.92, 0.92, 0.6675, 0.91, 0.9025, 0.895, 0.895] + +# DC14 - Run1 +class L2PhotonHypo_g25_loose1 (L2PhotonHypo_g25): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g25_loose1"): + super( L2PhotonHypo_g25_loose1, self ).__init__( name ) + self.HADETthr = [0.0275625, 0.0259875, 0.0291375, 0.0228375, 0.0259875, 0.0391125, 0.0359625, 0.0370125, 0.0291375] + self.CARCOREthr = [0.819375, 0.819375, 0.800375, 0.828875, 0.7125, 0.805125, 0.843125, 0.824125, 0.700625] + +class L2PhotonHypo_g25_loose (L2PhotonHypo_g25): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g25_loose"): + super( L2PhotonHypo_g25_loose, self ).__init__( name ) + self.HADETthr = [0.0275625, 0.0259875, 0.0291375, 0.0228375, 0.0259875, 0.0391125, 0.0359625, 0.0370125, 0.0291375] + self.CARCOREthr = [0.819375, 0.819375, 0.800375, 0.828875, 0.7125, 0.805125, 0.843125, 0.824125, 0.700625] + +class L2PhotonHypo_g25i_loose (L2PhotonHypo_g25): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g25i_loose"): + super( L2PhotonHypo_g25i_loose, self ).__init__( name ) + self.HADETthr = [0.0275625, 0.0259875, 0.0291375, 0.0228375, 0.0259875, 0.0391125, 0.0359625, 0.0370125, 0.0291375] + self.CARCOREthr = [0.819375, 0.819375, 0.800375, 0.828875, 0.7125, 0.805125, 0.843125, 0.824125, 0.700625] + +# DC14 - Run1 +class L2PhotonHypo_g25_medium1 (L2PhotonHypo_g25): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g25_medium1"): + super( L2PhotonHypo_g25_medium1, self ).__init__( name ) + self.HADETthr = [0.0275625, 0.0259875, 0.0291375, 0.0228375, 0.0259875, 0.0391125, 0.0359625, 0.0370125, 0.0291375] + self.CARCOREthr = [0.819375, 0.819375, 0.800375, 0.828875, 0.7125, 0.805125, 0.843125, 0.824125, 0.700625] + +class L2PhotonHypo_g25_medium (L2PhotonHypo_g25): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g25_medium"): + super( L2PhotonHypo_g25_medium, self ).__init__( name ) + self.HADETthr = [0.0275625, 0.0259875, 0.0291375, 0.0228375, 0.0259875, 0.0391125, 0.0359625, 0.0370125, 0.0291375] + self.CARCOREthr = [0.819375, 0.819375, 0.800375, 0.828875, 0.7125, 0.805125, 0.843125, 0.824125, 0.700625] + +class L2PhotonHypo_g25i_calib (L2PhotonHypo_g25i_loose): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g25i_calib"): + super( L2PhotonHypo_g25i_calib, self ).__init__( name ) + +class L2PhotonHypo_g25_tight (L2PhotonHypo_g25): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g25_tight"): + super( L2PhotonHypo_g25_tight, self ).__init__( name ) + +class L2PhotonHypo_g25i_tight (L2PhotonHypo_g25_tight): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g25i_tight"): + super( L2PhotonHypo_g25i_tight, self ).__init__( name ) + + +#------------------------------------------------------------------- +# g27 + +class L2PhotonHypo_g27_etcut (L2PhotonHypo_g25): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g27_etcut"): + super( L2PhotonHypo_g27_etcut, self ).__init__( name ) + self.AcceptAll = False + self.EtCutOnly = True + self.ETthr = [26.*GeV, 26.*GeV, 26.*GeV, 26.*GeV, 26.*GeV, 26.*GeV, 26.*GeV, 26.*GeV, 26.*GeV] + + +#------------------------------------------------------------------- +# g30 + +class L2PhotonHypo_g30 (TrigL2PhotonHypoBase): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g30"): + super( L2PhotonHypo_g30, self ).__init__( name ) + self.AcceptAll = False + self.EtCutOnly = False + self.ETthr = [29.*GeV, 29.*GeV, 29.*GeV, 29.*GeV, 29.*GeV, 29.*GeV, 29.*GeV, 29.*GeV, 29.*GeV] + self.CAERATIOthr = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] + self.HADETthr = [0.013, 0.013, 0.013, 0.013, 0.013, 0.023, 0.018, 0.017, 0.017] + self.CARCOREthr = [0.925, 0.925, 0.92, 0.92, 0.6675, 0.91, 0.9025, 0.895, 0.895] + +class L2PhotonHypo_g30_loose (L2PhotonHypo_g30): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g30_loose"): + super( L2PhotonHypo_g30_loose, self ).__init__( name ) + self.HADETthr = [0.0249375, 0.0233625, 0.0217875, 0.0202125, 0.0202125, 0.0265125, 0.0333375, 0.0328125, 0.0249375] + self.CARCOREthr = [0.852625, 0.843125, 0.833625, 0.833625, 0.7505, 0.828875, 0.843125, 0.838375, 0.748125] + + +class L2PhotonHypo_g35 (TrigL2PhotonHypoBase): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g35"): + super( L2PhotonHypo_g35, self ).__init__( name ) + self.AcceptAll = False + self.EtCutOnly = False + self.ETthr = [34.*GeV, 34.*GeV, 34.*GeV, 34.*GeV, 34.*GeV, 34.*GeV, 34.*GeV, 34.*GeV, 34.*GeV] + self.CAERATIOthr = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] + self.HADETthr = [0.013, 0.013, 0.013, 0.013, 0.013, 0.023, 0.018, 0.017, 0.017] + self.CARCOREthr = [0.925, 0.925, 0.92, 0.92, 0.6675, 0.91, 0.9025, 0.895, 0.895] + +# DC14 - Run1 +class L2PhotonHypo_g35_loose1 (L2PhotonHypo_g35): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g35_loose1"): + super( L2PhotonHypo_g35_loose1, self ).__init__( name ) + self.HADETthr = [0.0249375, 0.0233625, 0.0217875, 0.0202125, 0.0202125, 0.0265125, 0.0333375, 0.0328125, 0.0249375] + self.CARCOREthr = [0.852625, 0.843125, 0.833625, 0.833625, 0.7505, 0.828875, 0.843125, 0.838375, 0.748125] + +class L2PhotonHypo_g35_loose (L2PhotonHypo_g35): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g35_loose"): + super( L2PhotonHypo_g35_loose, self ).__init__( name ) + self.HADETthr = [0.0249375, 0.0233625, 0.0217875, 0.0202125, 0.0202125, 0.0265125, 0.0333375, 0.0328125, 0.0249375] + self.CARCOREthr = [0.852625, 0.843125, 0.833625, 0.833625, 0.7505, 0.828875, 0.843125, 0.838375, 0.748125] + +class L2PhotonHypo_g30_medium (L2PhotonHypo_g30): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g30_medium"): + super( L2PhotonHypo_g30_medium, self ).__init__( name ) + self.HADETthr = [0.0249375, 0.0233625, 0.0217875, 0.0202125, 0.0202125, 0.0265125, 0.0333375, 0.0328125, 0.0249375] + self.CARCOREthr = [0.852625, 0.843125, 0.833625, 0.833625, 0.7505, 0.828875, 0.843125, 0.838375, 0.748125] + +class L2PhotonHypo_g30_tight (L2PhotonHypo_g30): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g30_tight"): + super( L2PhotonHypo_g30_tight, self ).__init__( name ) + +# DC14 - Run1 +class L2PhotonHypo_g35_medium1 (L2PhotonHypo_g35): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g35_medium1"): + super( L2PhotonHypo_g35_medium1, self ).__init__( name ) + self.HADETthr = [0.0249375, 0.0233625, 0.0217875, 0.0202125, 0.0202125, 0.0265125, 0.0333375, 0.0328125, 0.0249375] + self.CARCOREthr = [0.852625, 0.843125, 0.833625, 0.833625, 0.7505, 0.828875, 0.843125, 0.838375, 0.748125] + +class L2PhotonHypo_g35_medium (L2PhotonHypo_g35): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g35_medium"): + super( L2PhotonHypo_g35_medium, self ).__init__( name ) + self.HADETthr = [0.0249375, 0.0233625, 0.0217875, 0.0202125, 0.0202125, 0.0265125, 0.0333375, 0.0328125, 0.0249375] + self.CARCOREthr = [0.852625, 0.843125, 0.833625, 0.833625, 0.7505, 0.828875, 0.843125, 0.838375, 0.748125] + +#------------------------------------------------------------------- +# g40 + +class L2PhotonHypo_g40 (TrigL2PhotonHypoBase): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g40"): + super( L2PhotonHypo_g40, self ).__init__( name ) + self.AcceptAll = False + self.EtCutOnly = False + self.ETthr = [39.*GeV, 39.*GeV, 39.*GeV, 39.*GeV, 39.*GeV, 39.*GeV, 39.*GeV, 39.*GeV, 39.*GeV] + self.CAERATIOthr = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] + self.HADETthr = [0.013, 0.013, 0.013, 0.013, 0.013, 0.023, 0.018, 0.017, 0.017] + self.CARCOREthr = [0.925, 0.925, 0.92, 0.92, 0.6675, 0.91, 0.9025, 0.895, 0.895] + +# DC14 - Run1 +class L2PhotonHypo_g40_loose1 (L2PhotonHypo_g40): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g40_loose1"): + super( L2PhotonHypo_g40_loose1, self ).__init__( name ) + self.HADETthr = [0.0202125, 0.0217875, 0.0170625, 0.0186375, 0.0186375, 0.0238875, 0.0270375, 0.0228375, 0.0196875] + self.CARCOREthr = [0.862125, 0.857375, 0.852625, 0.847875, 0.7505, 0.833625, 0.857375, 0.843125, 0.800375] + +class L2PhotonHypo_g40_loose (L2PhotonHypo_g40): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g40_loose"): + super( L2PhotonHypo_g40_loose, self ).__init__( name ) + self.HADETthr = [0.0202125, 0.0217875, 0.0170625, 0.0186375, 0.0186375, 0.0238875, 0.0270375, 0.0228375, 0.0196875] + self.CARCOREthr = [0.862125, 0.857375, 0.852625, 0.847875, 0.7505, 0.833625, 0.857375, 0.843125, 0.800375] + +class L2PhotonHypo_g40_medium (L2PhotonHypo_g40): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g40_medium"): + super( L2PhotonHypo_g40_medium, self ).__init__( name ) + self.HADETthr = [0.0202125, 0.0217875, 0.0170625, 0.0186375, 0.0186375, 0.0238875, 0.0270375, 0.0228375, 0.0196875] + self.CARCOREthr = [0.862125, 0.857375, 0.852625, 0.847875, 0.7505, 0.833625, 0.857375, 0.843125, 0.800375] + +class L2PhotonHypo_g40_tight (L2PhotonHypo_g40): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g40_tight"): + super( L2PhotonHypo_g40_tight, self ).__init__( name ) + + +#------------------------------------------------------------------- +# g50 + +class L2PhotonHypo_g50 (TrigL2PhotonHypoBase): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g50"): + super( L2PhotonHypo_g50, self ).__init__( name ) + self.AcceptAll = False + self.EtCutOnly = False + self.ETthr = [49.*GeV, 49.*GeV, 49.*GeV, 49.*GeV, 49.*GeV, 49.*GeV, 49.*GeV, 49.*GeV, 49.*GeV] + self.CAERATIOthr = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] + self.HADETthr = [0.013, 0.013, 0.013, 0.013, 0.013, 0.023, 0.018, 0.017, 0.017] + self.CARCOREthr = [0.925, 0.925, 0.92, 0.92, 0.6675, 0.91, 0.9025, 0.895, 0.895] + +# DC14 - Run1 +class L2PhotonHypo_g50_loose1 (L2PhotonHypo_g50): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g50_loose1"): + super( L2PhotonHypo_g50_loose1, self ).__init__( name ) + self.HADETthr = [0.0202125, 0.0217875, 0.0170625, 0.0186375, 0.0186375, 0.0238875, 0.0270375, 0.0228375, 0.0196875] + self.CARCOREthr = [0.862125, 0.857375, 0.852625, 0.847875, 0.7505, 0.833625, 0.857375, 0.843125, 0.800375] + +class L2PhotonHypo_g50_loose (L2PhotonHypo_g50): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g50_loose"): + super( L2PhotonHypo_g50_loose, self ).__init__( name ) + self.HADETthr = [0.0202125, 0.0217875, 0.0170625, 0.0186375, 0.0186375, 0.0238875, 0.0270375, 0.0228375, 0.0196875] + self.CARCOREthr = [0.862125, 0.857375, 0.852625, 0.847875, 0.7505, 0.833625, 0.857375, 0.843125, 0.800375] + +class L2PhotonHypo_g50_etcut (L2PhotonHypo_g50): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g50_etcut"): + super( L2PhotonHypo_g50_etcut, self ).__init__( name ) + self.EtCutOnly = True + + +#------------------------------------------------------------------- +# g55 + +class L2PhotonHypo_g55 (TrigL2PhotonHypoBase): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g55"): + super( L2PhotonHypo_g55, self ).__init__( name ) + self.AcceptAll = False + self.EtCutOnly = False + self.ETthr = [53.0*GeV, 53.0*GeV, 53.0*GeV, 53.0*GeV, 53.0*GeV, 53.0*GeV, 53.0*GeV, 53.0*GeV, 53.0*GeV] + self.CAERATIOthr = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] + self.HADETthr = [0.013, 0.013, 0.013, 0.013, 0.013, 0.023, 0.018, 0.017, 0.017] + self.CARCOREthr = [0.925, 0.925, 0.92, 0.92, 0.6675, 0.91, 0.9025, 0.895, 0.895] + +class L2PhotonHypo_g55_tight (L2PhotonHypo_g55): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g55_tight"): + super( L2PhotonHypo_g55_tight, self ).__init__( name ) + self.HADETthr = [0.013, 0.013, 0.013, 0.013, 0.013, 0.023, 0.018, 0.017, 0.017] + self.CARCOREthr = [0.925, 0.925, 0.92, 0.92, 0.6675, 0.91, 0.9025, 0.895, 0.895] + self.CAERATIOthr = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] + + +#------------------------------------------------------------------- +# g60 + +class L2PhotonHypo_g60 (TrigL2PhotonHypoBase): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g60"): + super( L2PhotonHypo_g60, self ).__init__( name ) + self.AcceptAll = False + self.EtCutOnly = False + self.ETthr = [58.*GeV, 58.*GeV, 58.*GeV, 58.*GeV, 58.*GeV, 58.*GeV, 58.*GeV, 58.*GeV, 58.*GeV] + self.CAERATIOthr = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] + self.HADETthr = [0.013, 0.013, 0.013, 0.013, 0.013, 0.023, 0.018, 0.017, 0.017] + self.CARCOREthr = [0.925, 0.925, 0.92, 0.92, 0.6675, 0.91, 0.9025, 0.895, 0.895] + +# DC14 - Run1 +class L2PhotonHypo_g60_loose1 (L2PhotonHypo_g60): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g60_loose1"): + super( L2PhotonHypo_g60_loose1, self ).__init__( name ) + self.HADETthr = [0.0202125, 0.0217875, 0.0170625, 0.0186375, 0.0186375, 0.0238875, 0.0270375, 0.0228375, 0.0196875] + self.CARCOREthr = [0.862125, 0.857375, 0.852625, 0.847875, 0.7505, 0.833625, 0.857375, 0.843125, 0.800375] + +class L2PhotonHypo_g60_loose (L2PhotonHypo_g60): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g60_loose"): + super( L2PhotonHypo_g60_loose, self ).__init__( name ) + self.HADETthr = [0.0202125, 0.0217875, 0.0170625, 0.0186375, 0.0186375, 0.0238875, 0.0270375, 0.0228375, 0.0196875] + self.CARCOREthr = [0.862125, 0.857375, 0.852625, 0.847875, 0.7505, 0.833625, 0.857375, 0.843125, 0.800375] + + +#------------------------------------------------------------------- +# g80 + +class L2PhotonHypo_g80 (TrigL2PhotonHypoBase): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g80"): + super( L2PhotonHypo_g80, self ).__init__( name ) + self.AcceptAll = False + self.EtCutOnly = False + self.ETthr = [77.*GeV, 77.*GeV, 77.*GeV, 77.*GeV, 77.*GeV, 77.*GeV, 77.*GeV, 77.*GeV, 77.*GeV] + self.CAERATIOthr = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] + self.HADETthr = [0.013, 0.013, 0.013, 0.013, 0.013, 0.023, 0.018, 0.017, 0.017] + self.CARCOREthr = [0.925, 0.925, 0.92, 0.92, 0.6675, 0.91, 0.9025, 0.895, 0.895] + +# DC14 - Run1 +class L2PhotonHypo_g80_loose1 (L2PhotonHypo_g80): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g80_loose1"): + super( L2PhotonHypo_g80_loose1, self ).__init__( name ) + self.HADETthr = [0.0202125, 0.0217875, 0.0170625, 0.0186375, 0.0186375, 0.0238875, 0.0270375, 0.0228375, 0.0196875] + self.CARCOREthr = [0.862125, 0.857375, 0.852625, 0.847875, 0.7505, 0.833625, 0.857375, 0.843125, 0.800375] + +class L2PhotonHypo_g80_loose (L2PhotonHypo_g80): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g80_loose"): + super( L2PhotonHypo_g80_loose, self ).__init__( name ) + self.HADETthr = [0.0202125, 0.0217875, 0.0170625, 0.0186375, 0.0186375, 0.0238875, 0.0270375, 0.0228375, 0.0196875] + self.CARCOREthr = [0.862125, 0.857375, 0.852625, 0.847875, 0.7505, 0.833625, 0.857375, 0.843125, 0.800375] + + +#------------------------------------------------------------------- +# g100 + +class L2PhotonHypo_g100 (TrigL2PhotonHypoBase): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g100"): + super( L2PhotonHypo_g100, self ).__init__( name ) + self.AcceptAll = False + self.EtCutOnly = False + self.ETthr = [97.*GeV, 97.*GeV, 97.*GeV, 97.*GeV, 97.*GeV, 97.*GeV, 97.*GeV, 97.*GeV, 97.*GeV] + self.CAERATIOthr = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] + self.HADETthr = [0.013, 0.013, 0.013, 0.013, 0.013, 0.023, 0.018, 0.017, 0.017] + self.CARCOREthr = [0.925, 0.925, 0.92, 0.92, 0.6675, 0.91, 0.9025, 0.895, 0.895] + +# DC14 - Run1 +class L2PhotonHypo_g100_loose1 (L2PhotonHypo_g100): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g100_loose1"): + super( L2PhotonHypo_g100_loose1, self ).__init__( name ) + self.HADETthr = [0.0202125, 0.0217875, 0.0170625, 0.0186375, 0.0186375, 0.0238875, 0.0270375, 0.0228375, 0.0196875] + self.CARCOREthr = [0.862125, 0.857375, 0.852625, 0.847875, 0.7505, 0.833625, 0.857375, 0.843125, 0.800375] + +class L2PhotonHypo_g100_loose (L2PhotonHypo_g100): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g100_loose"): + super( L2PhotonHypo_g100_loose, self ).__init__( name ) + self.HADETthr = [0.0202125, 0.0217875, 0.0170625, 0.0186375, 0.0186375, 0.0238875, 0.0270375, 0.0228375, 0.0196875] + self.CARCOREthr = [0.862125, 0.857375, 0.852625, 0.847875, 0.7505, 0.833625, 0.857375, 0.843125, 0.800375] + +class L2PhotonHypo_g100_etcut (L2PhotonHypo_g100): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g100_etcut"): + super( L2PhotonHypo_g100_etcut, self ).__init__( name ) + self.EtCutOnly = True + + +#------------------------------------------------------------------- +# g105 + +class L2PhotonHypo_g105 (TrigL2PhotonHypoBase): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g105"): + super( L2PhotonHypo_g105, self ).__init__( name ) + self.AcceptAll = False + self.EtCutOnly = False + self.ETthr = [102.*GeV, 102.*GeV, 102.*GeV, 102.*GeV, 102.*GeV, 102.*GeV, 102.*GeV, 102.*GeV, 102.*GeV] + self.CAERATIOthr = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] + self.HADETthr = [0.013, 0.013, 0.013, 0.013, 0.013, 0.023, 0.018, 0.017, 0.017] + self.CARCOREthr = [0.925, 0.925, 0.92, 0.92, 0.6675, 0.91, 0.9025, 0.895, 0.895] + +#------------------------------------------------------------------- +#g120 + +class L2PhotonHypo_g120_loose1 (TrigL2PhotonHypoBase): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g120_loose1"): + super( L2PhotonHypo_g120_loose1, self ).__init__( name ) + self.AcceptAll = False + self.EtCutOnly = False + self.ETthr = [117.*GeV, 117.*GeV, 117.*GeV, 117.*GeV, 117.*GeV, 117.*GeV, 117.*GeV, 117.*GeV, 117.*GeV] + self.CAERATIOthr = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] + self.HADETthr = [0.0202125, 0.0217875, 0.0170625, 0.0186375, 0.0186375, 0.0238875, 0.0270375, 0.0228375, 0.0196875] + self.CARCOREthr = [0.862125, 0.857375, 0.852625, 0.847875, 0.7505, 0.833625, 0.857375, 0.843125, 0.800375] + +class L2PhotonHypo_g120_loose (TrigL2PhotonHypoBase): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g120_loose"): + super( L2PhotonHypo_g120_loose, self ).__init__( name ) + self.AcceptAll = False + self.EtCutOnly = False + self.ETthr = [117.*GeV, 117.*GeV, 117.*GeV, 117.*GeV, 117.*GeV, 117.*GeV, 117.*GeV, 117.*GeV, 117.*GeV] + self.CAERATIOthr = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] + self.HADETthr = [0.0202125, 0.0217875, 0.0170625, 0.0186375, 0.0186375, 0.0238875, 0.0270375, 0.0228375, 0.0196875] + self.CARCOREthr = [0.862125, 0.857375, 0.852625, 0.847875, 0.7505, 0.833625, 0.857375, 0.843125, 0.800375] + + +#------------------------------------------------------------------- +# g150 + +class L2PhotonHypo_g150 (TrigL2PhotonHypoBase): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g150"): + super( L2PhotonHypo_g150, self ).__init__( name ) + self.AcceptAll = False + self.EtCutOnly = False + self.ETthr = [147.*GeV, 147.*GeV, 147.*GeV, 147.*GeV, 147.*GeV, 147.*GeV, 147.*GeV, 147.*GeV, 147.*GeV] + self.CAERATIOthr = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] + self.HADETthr = [0.013, 0.013, 0.013, 0.013, 0.013, 0.023, 0.018, 0.017, 0.017] + self.CARCOREthr = [0.925, 0.925, 0.92, 0.92, 0.6675, 0.91, 0.9025, 0.895, 0.895] + +class L2PhotonHypo_g150_etcut (L2PhotonHypo_g150): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g150_etcut"): + super( L2PhotonHypo_g150_etcut, self ).__init__( name ) + self.EtCutOnly = True + +class L2PhotonHypo_g200_etcut (L2PhotonHypo_g150): + __slots__ = [] + def __init__(self, name = "L2PhotonHypo_g200_etcut"): + super( L2PhotonHypo_g200_etcut, self ).__init__( name ) + self.EtCutOnly = True + self.ETthr = [195.*GeV, 195.*GeV, 195.*GeV, 195.*GeV, 195.*GeV, 195.*GeV, 195.*GeV, 195.*GeV, 195.*GeV] diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2PhotonHypoMonitoring.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2PhotonHypoMonitoring.py new file mode 100755 index 00000000000..f48e6243ba4 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2PhotonHypoMonitoring.py @@ -0,0 +1,127 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +from TrigMonitorBase.TrigGenericMonitoringToolConfig import defineHistogram, TrigGenericMonitoringToolConfig + +class TrigL2PhotonHypoValidationMonitoring(TrigGenericMonitoringToolConfig): + def __init__ (self, name="TrigL2PhotonHypoValidationMonitoring"): + super(TrigL2PhotonHypoValidationMonitoring, self).__init__(name) + self.defineTarget( "Validation" ) + + + self.Histograms = [ defineHistogram('PhEt', type='TH1F', title="L2Photon Hypo E_{T}; E_{T}^{EM} [MeV]", + xbins=50, xmin=-2000, xmax=100000) ] + self.Histograms += [ defineHistogram('PhEta', type='TH1F', title="L2Photon Hypo #eta;#eta", + xbins=100, xmin=-2.5, xmax=2.5) ] + self.Histograms += [ defineHistogram('PhPhi', type='TH1F', title="L2Photon Hypo #phi;#phi", + xbins=128, xmin=-3.2, xmax=3.2) ] + self.Histograms += [ defineHistogram('PhEratio', type='TH1F', title="L2Photon Hypo Eratio;Eratio", + xbins=64, xmin=-0.1, xmax=1.5) ] + self.Histograms += [ defineHistogram('PhRcore', type='TH1F', title="L2Photon Hypo Rcore; Rcore", + xbins=48, xmin=-0.1, xmax=1.1 ) ] + + self.Histograms += [ defineHistogram('dEta', type='TH1F', title="L2Photon Hypo #Delta #eta; #Delta #eta", + xbins=80, xmin=-0.2, xmax=0.2 ) ] + + self.Histograms += [ defineHistogram('dPhi', type='TH1F', title="L2Photon Hypo #Delta #phi; #Delta #phi", + xbins=80, xmin=-0.2, xmax=0.2 ) ] + + self.Histograms += [ defineHistogram('PhHadEt', type='TH1F', title="L2Photon Hypo E_{T}^{had} [MeV]; E_{T}^{Had} [MeV]}", + xbins=50, xmin=-2000, xmax=100000 ) ] + + self.Histograms += [ defineHistogram('PhF1', type='TH1F', title="L2Photon Hypo f_{1};f_{1}", + xbins=34, xmin=-0.5, xmax=1.2) ] + + + + cuts=['Input','has TrigPhotonContainer', '#Delta #eta', '#Delta #phi','rCore','eRatio','E_{T}^{EM}', 'E_{T}^{Had}','f_{1}'] + + labelsDescription = '' + for c in cuts: + labelsDescription += c+':' + + self.Histograms += [ defineHistogram('CutCounter', type='TH1I', title="L2Photon Hypo Passed Cuts;Cut", + xbins=12, xmin=-1.5, xmax=10.5, opt="kCumulative", labels=labelsDescription) ] + + +class TrigL2PhotonHypoOnlineMonitoring(TrigGenericMonitoringToolConfig): + def __init__ (self, name="TrigL2PhotonHypoOnlineMonitoring"): + """ defines histograms for online """ + super(TrigL2PhotonHypoOnlineMonitoring, self).__init__(name) + self.defineTarget("Online") + + + self.Histograms = [ defineHistogram('PhEt', type='TH1F', title="L2Photon Hypo E_{T}; E_{T}^{EM} [MeV]", + xbins=50, xmin=-2000, xmax=100000) ] + self.Histograms += [ defineHistogram('PhEta', type='TH1F', title="L2Photon Hypo #eta;#eta", + xbins=100, xmin=-2.5, xmax=2.5) ] + self.Histograms += [ defineHistogram('PhPhi', type='TH1F', title="L2Photon Hypo #phi;#phi", + xbins=128, xmin=-3.2, xmax=3.2) ] + self.Histograms += [ defineHistogram('PhEratio', type='TH1F', title="L2Photon Hypo Eratio;Eratio", + xbins=64, xmin=-0.1, xmax=1.5) ] + self.Histograms += [ defineHistogram('PhRcore', type='TH1F', title="L2Photon Hypo Rcore; Rcore", + xbins=48, xmin=-0.1, xmax=1.1 ) ] + + self.Histograms += [ defineHistogram('dEta', type='TH1F', title="L2Photon Hypo #Delta #eta; #Delta #eta", + xbins=80, xmin=-0.2, xmax=0.2 ) ] + + self.Histograms += [ defineHistogram('dPhi', type='TH1F', title="L2Photon Hypo #Delta #phi; #Delta #phi", + xbins=80, xmin=-0.2, xmax=0.2 ) ] + + self.Histograms += [ defineHistogram('PhHadEt', type='TH1F', title="L2Photon Hypo E_{T}^{had} [MeV]; E_{T}^{Had} [MeV]}", + xbins=50, xmin=-2000, xmax=100000 ) ] + + self.Histograms += [ defineHistogram('PhF1', type='TH1F', title="L2Photon Hypo f_{1};f_{1}", + xbins=34, xmin=-0.5, xmax=1.2) ] + + + cuts=['Input','has TrigPhotonContainer', '#Delta #eta', '#Delta #phi','rCore','eRatio','E_{T}^{EM}', 'E_{T}^{Had}','f_{1}'] + + labelsDescription = '' + for c in cuts: + labelsDescription += c+':' + + self.Histograms += [ defineHistogram('CutCounter', type='TH1I', title="L2Photon Hypo Passed Cuts;Cut", + xbins=12, xmin=-1.5, xmax=10.5, opt="kCumulative", labels=labelsDescription) ] + + + +class TrigL2PhotonHypoCosmicMonitoring(TrigGenericMonitoringToolConfig): + def __init__ (self, name="TrigL2PhotonHypoCosmicMonitoring"): + """ defines histograms for cosmic """ + super(TrigL2PhotonHypoCosmicMonitoring, self).__init__(name) + self.defineTarget("Cosmic") + + self.Histograms = [ defineHistogram('PhEt', type='TH1F', title="L2Photon Hypo E_{T}; E_{T}^{EM} [MeV]", + xbins=50, xmin=-2000, xmax=100000) ] + self.Histograms += [ defineHistogram('PhEta', type='TH1F', title="L2Photon Hypo #eta;#eta", + xbins=100, xmin=-2.5, xmax=2.5) ] + self.Histograms += [ defineHistogram('PhPhi', type='TH1F', title="L2Photon Hypo #phi;#phi", + xbins=128, xmin=-3.2, xmax=3.2) ] + self.Histograms += [ defineHistogram('PhEratio', type='TH1F', title="L2Photon Hypo Eratio;Eratio", + xbins=64, xmin=-0.1, xmax=1.5) ] + self.Histograms += [ defineHistogram('PhRcore', type='TH1F', title="L2Photon Hypo Rcore; Rcore", + xbins=48, xmin=-0.1, xmax=1.1 ) ] + + self.Histograms += [ defineHistogram('dEta', type='TH1F', title="L2Photon Hypo #Delta #eta; #Delta #eta", + xbins=80, xmin=-0.2, xmax=0.2 ) ] + + self.Histograms += [ defineHistogram('dPhi', type='TH1F', title="L2Photon Hypo #Delta #phi; #Delta #phi", + xbins=80, xmin=-0.2, xmax=0.2 ) ] + + self.Histograms += [ defineHistogram('PhHadEt', type='TH1F', title="L2Photon Hypo E_{T}^{had} [MeV]; E_{T}^{Had} [MeV]}", + xbins=50, xmin=-2000, xmax=100000 ) ] + + self.Histograms += [ defineHistogram('PhF1', type='TH1F', title="L2Photon Hypo f_{1};f_{1}", + xbins=34, xmin=-0.5, xmax=1.2) ] + + cuts=['Input','has TrigPhotonContainer', '#Delta #eta', '#Delta #phi','rCore','eRatio','E_{T}^{EM}', 'E_{T}^{Had}'] + + labelsDescription = '' + for c in cuts: + labelsDescription += c+':' + + self.Histograms += [ defineHistogram('CutCounter', type='TH1I', title="L2Photon Hypo Passed Cuts;Cut", + xbins=12, xmin=-1.5, xmax=10.5, opt="kCumulative", labels=labelsDescription) ] + + + diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/UnseededEgamma.temp.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/UnseededEgamma.temp.py new file mode 100644 index 00000000000..01127470929 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/UnseededEgamma.temp.py @@ -0,0 +1,373 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +""" Unseeded Egamma trigger slice signatures """ + +__author__ = 'R.Goncalo, P.Urquijo' +__version__="" +__doc__="Implementation of unseeded egamma signatures" + +from string import atoi +from AthenaCommon.Logging import logging + +from TriggerJobOpts.TriggerFlags import TriggerFlags +from TriggerMenuPython.TriggerPythonConfig import * +from TriggerMenuPython.HltConfig import * + +# get L2 algorithm configurables +if TriggerFlags.doLVL2() or True: + # unseeded allTE algo to start chain from MBTS + from TrigGenericAlgs.TrigGenericAlgsConf import PESA__DummyUnseededAllTEAlgo + theDummyUnseededAllTEAlgo = PESA__DummyUnseededAllTEAlgo("L2DummyAlgo") + + # calorimeter + if TriggerFlags.doCalo or True: + from TrigT2CaloEgamma.TrigT2CaloEgammaConfig import T2CaloEgamma_MBTSA,T2CaloEgamma_MBTSC + theT2CaloEgamma_MBTSA = T2CaloEgamma_MBTSA() + theT2CaloEgamma_MBTSC = T2CaloEgamma_MBTSC() + + # Fex to create TrigElectrons and TrigPhotons + from TrigEgammaHypo.TrigL2PhotonFexConfig import * + from TrigEgammaHypo.TrigL2ElectronFexConfig import * + + # hypothesis algorithms + from TrigEgammaHypo.TrigL2ElectronHypoConfig import * + from TrigEgammaHypo.TrigL2PhotonHypoConfig import * + from TrigEgammaHypo.TrigL2CaloHypoConfig import * + +# get EF algorithm configurables +if TriggerFlags.doEF() or True: + if TriggerFlags.doCalo or True: + from TrigCaloRec.TrigCaloRecConfig import TrigCaloCellMaker_eGamma, TrigCaloTowerMaker_eGamma, TrigCaloClusterMaker_slw, TrigCaloCellMaker_fullcalo, TrigCaloClusterMaker_slw_fullcalo + theTrigCaloCellMaker_eGamma = TrigCaloCellMaker_eGamma() + theTrigCaloCellMaker_fullcalo = TrigCaloCellMaker_fullcalo() + theTrigCaloTowerMaker_eGamma = TrigCaloTowerMaker_eGamma() + theTrigCaloClusterMaker_slw = TrigCaloClusterMaker_slw() + theTrigCaloClusterMaker_slw_fullcalo = TrigCaloClusterMaker_slw_fullcalo() + + if TriggerFlags.doID or True: + from InDetTrigRecExample.EFInDetConfig import * + theTrigEFIDCombined_Photon = TrigEFIDCombined_Photon().getSequence() + theTrigEFIDInsideOut_Electron = TrigEFIDInsideOut_Electron().getSequence() + + from TrigEgammaRec.TrigEgammaRecConfig import * + theTrigEgammaRec_eGamma = TrigEgammaRec_eGamma() + from TrigEgammaHypo.TrigEFPhotonHypoConfig import * + from TrigEgammaHypo.TrigEFElectronHypoConfig import * + from TrigEgammaHypo.TrigEFTrackHypoConfig import * + +class L2EFChain_Unseeded_e(L2EFChainDef): + class L2Config: + def __init__(self, suffix): + self.suffix = suffix + pass + + class EFConfig: + def __init__(self, suffix, + TrigEFTrackHypo_1=None, TrigEFEGammaHypo_1=None): + self.suffix = suffix + self.TrigEFTrackHypo_1 = TrigEFTrackHypo_1 or TrigEFTrackHypo('TrigEFTrackHypo_'+suffix) + self.TrigEFEGammaHypo_1 = TrigEFEGammaHypo_1 or TrigEFElectronHypo('TrigEFEGammaHypo_'+suffix) + pass + + class Config: + def __init__(self, l2config, efconfig): + self.suffix ='' + self.L2Config = l2config + self.EFConfig = efconfig + + def __init__(self, sig_id, + l2_chain_name, l2_chain_counter, l2_lower_chain_name, + ef_chain_name, ef_chain_counter, + l2_inputTEs, config): + L2EFChainDef.__init__(self, sig_id, + l2_chain_name, l2_chain_counter, l2_lower_chain_name, + ef_chain_name, ef_chain_counter, + l2_inputTEs, config) + + def defineStreamGroupTriggerType(self): + self.physics_streams = ['egamma'] + self.calib_streams = [] + self.groups = ['Exclusive_Electrons', 'Inclusive_Electrons'] + self.trigger_type = [] + +class L2EFChain_Unseeded_g(L2EFChainDef): + class L2Config: + def __init__(self, suffix, + TrigL2CaloHypo_1=None, TrigL2PhotonFex_1=None, TrigL2PhotonHypo_1=None): + self.suffix = suffix + self.TrigL2CaloHypo_1 = TrigL2CaloHypo_1 or TrigL2CaloHypo('TrigL2CaloHypo_'+suffix) + self.TrigL2PhotonFex_1 = TrigL2PhotonFex_1 or TrigL2PhotonFex('TrigL2PhotonFex_'+suffix) + self.TrigL2PhotonHypo_1 = TrigL2PhotonHypo_1 or TrigL2PhotonHypo('TrigL2PhotonHypo_'+suffix) + pass + + class EFConfig: + def __init__(self, suffix, TrigEFPhotonHypo_1=None): + self.suffix = suffix + self.TrigEFPhotonHypo_1 = TrigEFPhotonHypo_1 or TrigEFPhotonHypo('EFPhotonHypo_'+suffix) + pass + + class Config: + def __init__(self, l2config, efconfig): + self.suffix ='' + self.L2Config = l2config + self.EFConfig = efconfig + + def __init__(self, sig_id, + l2_chain_name, l2_chain_counter, l2_lower_chain_name, + ef_chain_name, ef_chain_counter, + l2_inputTEs, config): + L2EFChainDef.__init__(self, sig_id, + l2_chain_name, l2_chain_counter, l2_lower_chain_name, + ef_chain_name, ef_chain_counter, + l2_inputTEs, config) + + def defineStreamGroupTriggerType(self): + self.physics_streams = ['egamma'] + self.calib_streams = [] + self.groups = ['Exclusive_Photons', 'Inclusive_Photons'] + self.trigger_type = [] + + +class L2EFChain_Unseeded_g_MBTSA_L2(L2EFChain_Unseeded_g): + + def defineSequences(self, config): + ###### L2 ###### + #Step 1: AllTEAlgo dummy to start the chain + self.addL2Sequence(self.inputTEs, + [theDummyUnseededAllTEAlgo], + 'L2_e_step1') + # Step 2: Calo Fex and Hypo + self.addL2Sequence('L2_e_step1', + [theT2CaloEgamma_MBTSA, config.L2Config.TrigL2CaloHypo_1], + 'L2_e_step2') + # Step 3: Photon Fex and Hypo + self.addL2Sequence(['L2_e_step2'], + [config.L2Config.TrigL2PhotonFex_1, config.L2Config.TrigL2PhotonHypo_1], + 'L2_e_step3') + + ###### EF ###### + # Step 1: Calo Fex + self.addEFSequence('L2_e_step3', + [theTrigCaloCellMaker_eGamma, theTrigCaloTowerMaker_eGamma, theTrigCaloClusterMaker_slw], + 'EF_e_step1') + # Step 2: ID Fex and Hypo + self.addEFSequence('EF_e_step1', + theTrigEFIDCombined_Photon, + 'EF_e_step2') + # Step 3: ID-Calo Fex and Hypo + self.addEFSequence('EF_e_step2', + [theTrigEgammaRec_eGamma, config.EFConfig.TrigEFPhotonHypo_1], + 'EF_e_step3') + + + def defineSignatures(self): + self.addL2Signature(['L2_e_step1']) + self.addL2Signature(['L2_e_step2']) + self.addL2Signature(['L2_e_step3']) + self.addEFSignature(['EF_e_step1']) + self.addEFSignature(['EF_e_step2']) + self.addEFSignature(['EF_e_step3']) + + def defineTErenaming(self): + self.TErenamingMap = { + 'L2_e_step1': mergeRemovingOverlap('L2_', self.sig_id+'_te'), + 'L2_e_step2': mergeRemovingOverlap('L2_', self.sig_id+'_calo'), + 'L2_e_step3': mergeRemovingOverlap('L2_', self.sig_id), + 'EF_e_step1': mergeRemovingOverlap('EF_', self.sig_id+'_calo'), + 'EF_e_step2': mergeRemovingOverlap('EF_', self.sig_id+'_id'), + 'EF_e_step3': mergeRemovingOverlap('EF_', self.sig_id), + } + +class L2EFChain_Unseeded_g_MBTSC_L2(L2EFChain_Unseeded_g_MBTSA_L2): + + def defineSequences(self, config): + ###### L2 ###### + #Step 1: AllTEAlgo dummy to start the chain + self.addL2Sequence(self.inputTEs, + [theDummyUnseededAllTEAlgo], + 'L2_e_step1') + + # Step 2: Calo Fex and Hypo + self.addL2Sequence('L2_e_step1', + [theT2CaloEgamma_MBTSC, config.L2Config.TrigL2CaloHypo_1], + 'L2_e_step2') + + # Step 3: Photon Fex and Hypo + self.addL2Sequence(['L2_e_step2'], + [config.L2Config.TrigL2PhotonFex_1, config.L2Config.TrigL2PhotonHypo_1], + 'L2_e_step3') + + ###### EF ###### + # Step 1: Calo Fex + self.addEFSequence('L2_e_step3', + [theTrigCaloCellMaker_eGamma, theTrigCaloTowerMaker_eGamma, theTrigCaloClusterMaker_slw], + 'EF_e_step1') + # Step 2: ID Fex and Hypo + self.addEFSequence('EF_e_step1', + theTrigEFIDCombined_Photon, + 'EF_e_step2') + # Step 3: ID-Calo Fex and Hypo + self.addEFSequence('EF_e_step2', + [theTrigEgammaRec_eGamma, config.EFConfig.TrigEFPhotonHypo_1], + 'EF_e_step3') + +class L2EFChain_Unseeded_g_EF(L2EFChain_Unseeded_g): + + def defineSequences(self, config): + ###### L2 ###### + #Step 1: AllTEAlgo dummy to start the chain + self.addL2Sequence(self.inputTEs, + [theDummyUnseededAllTEAlgo], + 'L2_e_step1') + + ###### EF ###### + # Step 1: Calo Fex + self.addEFSequence('L2_e_step1', + [theTrigCaloCellMaker_fullcalo], + 'EF_e_step1a') + self.addEFSequence('EF_e_step1a', + [theTrigCaloTowerMaker_eGamma], + 'EF_e_step1b') + self.addEFSequence('EF_e_step1b', + [theTrigCaloClusterMaker_slw_fullcalo], + 'EF_e_step1c') + # Step 2: ID Fex and Hypo + self.addEFSequence('EF_e_step1c', + theTrigEFIDCombined_Photon, + 'EF_e_step2') + # Step 3: ID-Calo Fex and Hypo + self.addEFSequence('EF_e_step2', + [theTrigEgammaRec_eGamma, config.EFConfig.TrigEFPhotonHypo_1], + 'EF_e_step3') + + + def defineSignatures(self): + self.addL2Signature(['L2_e_step1']) + self.addEFSignature(['EF_e_step1a']) + self.addEFSignature(['EF_e_step1b']) + self.addEFSignature(['EF_e_step1c']) + self.addEFSignature(['EF_e_step2']) + self.addEFSignature(['EF_e_step3']) + + def defineTErenaming(self): + self.TErenamingMap = { + 'L2_e_step1': mergeRemovingOverlap('L2_', self.sig_id+'_dummy'), + 'EF_e_step1a': mergeRemovingOverlap('EF_', self.sig_id+'_caloa'), + 'EF_e_step1b': mergeRemovingOverlap('EF_', self.sig_id+'_calob'), + 'EF_e_step1c': mergeRemovingOverlap('EF_', self.sig_id+'_caloc'), + 'EF_e_step2': mergeRemovingOverlap('EF_', self.sig_id+'_id'), + 'EF_e_step3': mergeRemovingOverlap('EF_', self.sig_id), + } + +class L2EFChain_Unseeded_e_EF(L2EFChain_Unseeded_e): + + def defineSequences(self, config): + ###### L2 ###### + #Step 1: AllTEAlgo dummy to start the chain + self.addL2Sequence(self.inputTEs, + [theDummyUnseededAllTEAlgo], + 'L2_e_step1') + + ###### EF ###### + # Step 1: Calo Fex + self.addEFSequence('L2_e_step1', + [theTrigCaloCellMaker_fullcalo], + 'EF_e_step1a') + self.addEFSequence('EF_e_step1a', + [theTrigCaloTowerMaker_eGamma], + 'EF_e_step1b') + self.addEFSequence('EF_e_step1b', + [theTrigCaloClusterMaker_slw_fullcalo], + 'EF_e_step1c') + # Step 2: ID Fex and Hypo + self.addEFSequence('EF_e_step1c', + theTrigEFIDInsideOut_Electron + [config.EFConfig.TrigEFTrackHypo_1], + 'EF_e_step2') + # Step 3: ID-Calo Fex and Hypo + self.addEFSequence('EF_e_step2', + [theTrigEgammaRec_eGamma, config.EFConfig.TrigEFEGammaHypo_1], + 'EF_e_step3') + + + def defineSignatures(self): + self.addL2Signature(['L2_e_step1']) + self.addEFSignature(['EF_e_step1a']) + self.addEFSignature(['EF_e_step1b']) + self.addEFSignature(['EF_e_step1c']) + self.addEFSignature(['EF_e_step2']) + self.addEFSignature(['EF_e_step3']) + + def defineTErenaming(self): + self.TErenamingMap = { + 'L2_e_step1': mergeRemovingOverlap('L2_', self.sig_id+'_dummy'), + 'EF_e_step1a': mergeRemovingOverlap('EF_', self.sig_id+'_caloa'), + 'EF_e_step1b': mergeRemovingOverlap('EF_', self.sig_id+'_calob'), + 'EF_e_step1c': mergeRemovingOverlap('EF_', self.sig_id+'_caloc'), + 'EF_e_step2': mergeRemovingOverlap('EF_', self.sig_id+'_id'), + 'EF_e_step3': mergeRemovingOverlap('EF_', self.sig_id), + } + +################################################################ + +UnseededPhotons=[ + ##L2 T2CaloEgamma configured for MBTS + L2EFChain_Unseeded_g_MBTSA_L2('g0_mbts_a', 'L2_g0_mbts_a', 498, 'L1_MBTS_A', 'EF_g0_mbts_a', 498, ['MBTS_A'], + L2EFChain_Unseeded_g.Config( L2EFChain_Unseeded_g.L2Config('',L2CaloHypo_g4(),L2PhotonFex_1(),L2PhotonHypo_g5_nocut()), + L2EFChain_Unseeded_g.EFConfig('',EFPhotonHypo_g5_nocut()))), + L2EFChain_Unseeded_g_MBTSC_L2('g0_mbts_c', 'L2_g0_mbts_c', 499, 'L1_MBTS_C', 'EF_g0_mbts_c', 499, ['MBTS_C'], + L2EFChain_Unseeded_g.Config( L2EFChain_Unseeded_g.L2Config('',L2CaloHypo_g4(),L2PhotonFex_1(),L2PhotonHypo_g5_nocut()), + L2EFChain_Unseeded_g.EFConfig('',EFPhotonHypo_g5_nocut()))), + + L2EFChain_Unseeded_g_MBTSA_L2('g0_mbts_a_cosmic', 'L2_g0_mbts_a_cosmic', 732, 'L1_MBTS_A_EMPTY', 'EF_g0_mbts_a_cosmic', 732, ['MBTS_A'], + L2EFChain_Unseeded_g.Config( L2EFChain_Unseeded_g.L2Config('',L2CaloHypo_g4(),L2PhotonFex_1(),L2PhotonHypo_g5_nocut()), + L2EFChain_Unseeded_g.EFConfig('',EFPhotonHypo_g5_nocut()))), + L2EFChain_Unseeded_g_MBTSC_L2('g0_mbts_c_cosmic', 'L2_g0_mbts_c_cosmic', 733, 'L1_MBTS_C_EMPTY', 'EF_g0_mbts_c_cosmic', 733, ['MBTS_C'], + L2EFChain_Unseeded_g.Config( L2EFChain_Unseeded_g.L2Config('',L2CaloHypo_g4(),L2PhotonFex_1(),L2PhotonHypo_g5_nocut()), + L2EFChain_Unseeded_g.EFConfig('',EFPhotonHypo_g5_nocut()))), + + + ##EF full calorimeter scan + L2EFChain_Unseeded_g_EF('g0_mbts_a_EFfullcalo', 'L2_g0_mbts_a_EFfullcalo', 515, 'L1_MBTS_A', 'EF_g0_mbts_a_EFfullcalo', 515, ['MBTS_A'], + L2EFChain_Unseeded_g.Config( L2EFChain_Unseeded_g.L2Config('',L2CaloHypo_g4(),L2PhotonFex_1(),L2PhotonHypo_g5_nocut()), + L2EFChain_Unseeded_g.EFConfig('',EFPhotonHypo_g5_nocut()))), + L2EFChain_Unseeded_g_EF('g0_mbts_c_EFfullcalo', 'L2_g0_mbts_c_EFfullcalo', 516, 'L1_MBTS_C', 'EF_g0_mbts_c_EFfullcalo', 516, ['MBTS_C'], + L2EFChain_Unseeded_g.Config( L2EFChain_Unseeded_g.L2Config('',L2CaloHypo_g4(),L2PhotonFex_1(),L2PhotonHypo_g5_nocut()), + L2EFChain_Unseeded_g.EFConfig('',EFPhotonHypo_g5_nocut()))), + + L2EFChain_Unseeded_g_EF('g0_mbts_a_EFfullcalo_cosmic', 'L2_g0_mbts_a_EFfullcalo_cosmic', 734, 'L1_MBTS_A_EMPTY', 'EF_g0_mbts_a_EFfullcalo_cosmic', 734, ['MBTS_A'], + L2EFChain_Unseeded_g.Config( L2EFChain_Unseeded_g.L2Config('',L2CaloHypo_g4(),L2PhotonFex_1(),L2PhotonHypo_g5_nocut()), + L2EFChain_Unseeded_g.EFConfig('',EFPhotonHypo_g5_nocut()))), + L2EFChain_Unseeded_g_EF('g0_mbts_c_EFfullcalo_cosmic', 'L2_g0_mbts_c_EFfullcalo_cosmic', 735, 'L1_MBTS_C_EMPTY', 'EF_g0_mbts_c_EFfullcalo_cosmic', 735, ['MBTS_C'], + L2EFChain_Unseeded_g.Config( L2EFChain_Unseeded_g.L2Config('',L2CaloHypo_g4(),L2PhotonFex_1(),L2PhotonHypo_g5_nocut()), + L2EFChain_Unseeded_g.EFConfig('',EFPhotonHypo_g5_nocut()))), + + L2EFChain_Unseeded_g_EF('g5_EFfullcalo', 'L2_g5_EFfullcalo', 517, 'L1_EM3', 'EF_g5_EFfullcalo', 517, ['EM3'], + L2EFChain_Unseeded_g.Config( L2EFChain_Unseeded_g.L2Config('',L2CaloHypo_g4(),L2PhotonFex_1(),L2PhotonHypo_g5_nocut()), + L2EFChain_Unseeded_g.EFConfig('',EFPhotonHypo_g5_nocut()))), + + L2EFChain_Unseeded_g_EF('g5_EFfullcalo_cosmic', 'L2_g5_EFfullcalo_cosmic', 730, 'L1_EM3_EMPTY', 'EF_g5_EFfullcalo_cosmic', 730, ['EM3'], + L2EFChain_Unseeded_g.Config( L2EFChain_Unseeded_g.L2Config('',L2CaloHypo_g4(),L2PhotonFex_1(),L2PhotonHypo_g5_nocut()), + L2EFChain_Unseeded_g.EFConfig('',EFPhotonHypo_g5_nocut()))) + ] + +UnseededElectrons=[ + ##EF full calorimeter scan + L2EFChain_Unseeded_e_EF('e0_mbts_a_EFfullcalo', 'L2_e0_mbts_a_EFfullcalo', 584, 'L1_MBTS_A', 'EF_e0_mbts_a_EFfullcalo', 584, ['MBTS_A'], + L2EFChain_Unseeded_e.Config( L2EFChain_Unseeded_e.L2Config(''), + L2EFChain_Unseeded_e.EFConfig('',EFTrackHypo_e5_NoCut(), TrigEFElectronHypo_e5_NoCut() ))), + L2EFChain_Unseeded_e_EF('e0_mbts_c_EFfullcalo', 'L2_e0_mbts_c_EFfullcalo', 585, 'L1_MBTS_C', 'EF_e0_mbts_c_EFfullcalo', 585, ['MBTS_C'], + L2EFChain_Unseeded_e.Config( L2EFChain_Unseeded_e.L2Config(''), + L2EFChain_Unseeded_e.EFConfig('',EFTrackHypo_e5_NoCut(), TrigEFElectronHypo_e5_NoCut() ))), + L2EFChain_Unseeded_e_EF('e0_mbts_a_EFfullcalo_cosmic', 'L2_e0_mbts_a_EFfullcalo_cosmic', 736, 'L1_MBTS_A_EMPTY', 'EF_e0_mbts_a_EFfullcalo_cosmic', 736, ['MBTS_A'], + L2EFChain_Unseeded_e.Config( L2EFChain_Unseeded_e.L2Config(''), + L2EFChain_Unseeded_e.EFConfig('',EFTrackHypo_e5_NoCut(), TrigEFElectronHypo_e5_NoCut() ))), + L2EFChain_Unseeded_e_EF('e0_mbts_c_EFfullcalo_cosmic', 'L2_e0_mbts_c_EFfullcalo_cosmic', 737, 'L1_MBTS_C_EMPTY', 'EF_e0_mbts_c_EFfullcalo_cosmic', 737, ['MBTS_C'], + L2EFChain_Unseeded_e.Config( L2EFChain_Unseeded_e.L2Config(''), + L2EFChain_Unseeded_e.EFConfig('',EFTrackHypo_e5_NoCut(), TrigEFElectronHypo_e5_NoCut() ))), + L2EFChain_Unseeded_e_EF('e5_EFfullcalo', 'L2_e5_EFfullcalo', 586, 'L1_EM3', 'EF_e5_EFfullcalo', 586, ['EM3'], + L2EFChain_Unseeded_e.Config( L2EFChain_Unseeded_e.L2Config(''), + L2EFChain_Unseeded_e.EFConfig('',EFTrackHypo_e5_NoCut(), TrigEFElectronHypo_e5_NoCut() ))), + L2EFChain_Unseeded_e_EF('e5_EFfullcalo_cosmic', 'L2_e5_EFfullcalo_cosmic', 738, 'L1_EM3_EMPTY', 'EF_e5_EFfullcalo_cosmic', 738, ['EM3'], + L2EFChain_Unseeded_e.Config( L2EFChain_Unseeded_e.L2Config(''), + L2EFChain_Unseeded_e.EFConfig('',EFTrackHypo_e5_NoCut(), TrigEFElectronHypo_e5_NoCut() ))), + ] diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/__init__.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/__init__.py new file mode 100755 index 00000000000..078ba2b93d3 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/__init__.py @@ -0,0 +1,23 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +# File: TrigEgammaHypo/__init__.py +# Author: Tomasz.Bold@cern.ch + +__version__ = '1.0.0' +__author__ = 'Tomasz.Bold@cern.ch' +__all__ = [ 'TrigEFElectronHypoConfig.py', + 'TrigEFElectronHypoMonitoring.py', + 'TrigEFPhotonHypoConfig.py', + 'TrigEFPhotonHypoMonitoring.py', + 'TrigEFTrackHypoConfig.py', + 'TrigL2CaloHypoConfig.py', + 'TrigL2CaloHypoMonitoring.py', + 'TrigL2DielectronMassHypoConfig.py', + 'TrigL2DielectronMassHypoMonitoring.py', + 'TrigL2ElectronFexConfig.py', + 'TrigL2ElectronHypoConfig.py', + 'TrigL2ElectronHypoMonitoring.py', + 'TrigL2PhotonFexConfig.py', + 'TrigL2PhotonHypoConfig.py', + 'TrigL2PhotonHypoMonitoring.py', + ] diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFCaloHypo.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFCaloHypo.cxx new file mode 100755 index 00000000000..fbb39d0ae9b --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFCaloHypo.cxx @@ -0,0 +1,221 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// ******************************************************************** +// +// NAME: TrigEFCaloHypo.cxx +// PACKAGE: Trigger/TrigHypothesis/TrigEFCaloHypo +// +// AUTHOR: P. Conde Muino +// Performs the Hypothesis cuts on the Event Filter +// Calorimeter variables. +// +// ******************************************************************** +// +#include <list> +#include <iterator> +#include <sstream> +// +#include "GaudiKernel/MsgStream.h" +#include "GaudiKernel/StatusCode.h" +#include "GaudiKernel/ListItem.h" +// +#include "TrigSteeringEvent/TrigRoiDescriptor.h" +#include "TrigEgammaHypo/TrigEFCaloHypo.h" +// +//#include "LArRecEvent/LArCluster.h" +#include "CaloEvent/CaloClusterContainer.h" + +#include "CLHEP/Units/SystemOfUnits.h" + + + +class ISvcLocator; + +///////////////////////////////////////////////////////////////////// +// CONSTRUCTOR: +///////////////////////////////////////////////////////////////////// +// +TrigEFCaloHypo::TrigEFCaloHypo(const std::string& name, ISvcLocator* pSvcLocator): + HLT::HypoAlgo(name, pSvcLocator) { + + declareProperty("Etcut", m_EtCut = 22*CLHEP::GeV); // Default: 22 GeV + declareProperty("DeltaPhiCut", m_deltaPhiCut = 0.1); + declareProperty("DeltaEtaCut", m_deltaEtaCut = 0.1); + declareProperty("EnergySecondSampling", m_energySecondSampling=0); + declareProperty("isEM", m_isEM = 0 ); // Value of isEM. + declareProperty("EtCalibFactor",m_etCalibFactor=1.02); + + declareProperty("histoPath", m_path = "/stat/Monitoring/EventFilter" ); + + +} + +///////////////////////////////////////////////////////////////////// +// DESTRUCTOR: +///////////////////////////////////////////////////////////////////// +// +TrigEFCaloHypo::~TrigEFCaloHypo() +{ } + +///////////////////////////////////////////////////////////////////// +// INITIALIZE: +// The initialize method will create all the required algorithm objects +// Note that it is NOT NECESSARY to run the initialize of individual +// sub-algorithms. The framework takes care of it. +///////////////////////////////////////////////////////////////////// +// + +// ---------------------------------------------------------------------- +HLT::ErrorCode TrigEFCaloHypo::hltInitialize() +// ---------------------------------------------------------------------- +{ + if(msgLvl() <= MSG::DEBUG) + msg() << MSG::INFO << "in initialize()" << endreq; + + // Initialize timing service + //------------------------------ + if (timerSvc()) + m_totalTimer = addTimer("TrigEFCaloHypoTot"); + + + if(msgLvl() <= MSG::DEBUG) + msg() << MSG::INFO + << "Initialization of TrigEFCaloHypo completed successfully" + << endreq; + + return HLT::OK; +} + + + + +// ---------------------------------------------------------------------- +HLT::ErrorCode TrigEFCaloHypo::hltFinalize(){ +// ---------------------------------------------------------------------- + + + msg() << MSG::INFO << "in finalize()" << endreq; + return HLT::OK; +} + + +// ---------------------------------------------------------------------- +HLT::ErrorCode TrigEFCaloHypo::hltExecute(const HLT::TriggerElement* outputTE, + bool& pass){ +// ---------------------------------------------------------------------- + + // Time total TrigEFCaloHypo execution time. + // ------------------------------------- + if (m_timersvc) m_totalTimer->start(); + + + if(msgLvl() <= MSG::DEBUG) + msg() << MSG::INFO << name() << ": in execute()" << endreq; + + + // get RoI descriptor + const TrigRoiDescriptor* roiDescriptor = 0; + HLT::ErrorCode statt = getFeature(outputTE, roiDescriptor, ""); + + if ( statt == HLT::OK ) { + if(msgLvl() <= MSG::DEBUG){ + msg() << MSG::DEBUG << "RoI id " << roiDescriptor->roiId() + << " LVL1 id " << roiDescriptor->l1Id() + << " located at phi = " << roiDescriptor->phi() + << ", eta = " << roiDescriptor->eta() << endreq; + } + } else { + if(msgLvl() <= MSG::WARNING) { + msg() << MSG::WARNING << "No RoI for this Trigger Element! " << endreq; + } + return HLT::NAV_ERROR; + } + + + double EtaRef = roiDescriptor->eta(); + double PhiRef = roiDescriptor->phi(); + + + // Phi was defined between [0,2*pi). LVL1 RoI's are still produced + // with the older convention. + // What are negative phi's????????? + //if(PhiRef <0) continue; + + if(PhiRef > 3.1415926 ) PhiRef -= 2*3.1415926; + + + // get CaloClusterContainer from the trigger element: + //-------------------------------------------------- + + + bool accepted=false; + + std::vector<const CaloClusterContainer*> vectorClusterContainer; + + HLT::ErrorCode stat = getFeatures(outputTE,vectorClusterContainer , ""); + + if (stat != HLT::OK ) { + msg() << MSG::WARNING + << " Failed to get vectorClusterContainers from the trigger element" + << endreq; + if (m_timersvc)m_totalTimer ->stop(); + return HLT::OK; + } + + if(msgLvl() <= MSG::DEBUG) + msg() << MSG::INFO << " Got " << vectorClusterContainer.size() + << " vectorClusterContainer's associated to the TE " << endreq; + + + const CaloClusterContainer * clusterContainer = vectorClusterContainer.front(); + + + for(CaloClusterContainer::const_iterator clusIt = clusterContainer->begin(); + clusIt != clusterContainer->end(); clusIt++){ + + const CaloCluster *clus = *clusIt; + + // DeltaEta, DeltaPhi cuts: + if(msgLvl() <= MSG::DEBUG){ + msg() << MSG::DEBUG << " fabs(clus->eta()-EtaRef) " + << fabs(clus->eta()-EtaRef) + << " fabs(clus->phi()-PhiRef) " << fabs(clus->phi()-PhiRef) + << endreq; + + msg() << MSG::DEBUG << " clus->eta() " << clus->eta() << " EtaRef " + << EtaRef << " clus->phi() " << clus->phi() << " PhiRef " + << PhiRef << endreq; + } + + if( fabs(clus->eta()-EtaRef) > m_deltaEtaCut) continue; + if( fabs(clus->phi()-PhiRef) > m_deltaPhiCut) continue; + + + // Et cut: + + if( clus->et()*m_etCalibFactor < m_EtCut) continue; + + + // --------------------------------------------------- + // At least one cluster passed cuts: accept the event: + // --------------------------------------------------- + + accepted=true; + pass=accepted; + } // end of loop in clusters + + if(msgLvl() <= MSG::DEBUG) { + + msg() << MSG::DEBUG << "Result = " <<(pass ? "passed" : "failed")<< endreq; + } + + + // Time total TrigEFCaloHypo execution time. + // ------------------------------------- + + if (m_timersvc) m_totalTimer->stop(); + + return HLT::OK; +} diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFDielectronMassFex.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFDielectronMassFex.cxx new file mode 100755 index 00000000000..a965c34500e --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFDielectronMassFex.cxx @@ -0,0 +1,344 @@ +// -*- C++ -*- + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/************************************************************************** + ** + ** File: Trigger/TrigHypothesis/TrigEgammaHypo/TrigEFDielectronMassFex.h + ** + ** Description: - Hypothesis algorithm: searc for electron pairs with + ** invariant mass in some interval; intended for Z->ee + ** - Modified from TrigL2DielectronMassFex by R.Goncalo + ** + ** Author: T. Hrynova <thrynova@mail.cern.ch> + ** + ** Created: Nov 9 2009 + ** + ** Author(xAOD): Ryan Mackenzie White + ** Modified: April 2014 + **************************************************************************/ +#include <sstream> + +#include "TrigSteeringEvent/TrigRoiDescriptor.h" + +#include "TrigEgammaHypo/TrigEFDielectronMassFex.h" + +#include "TrigSteeringEvent/TrigOperationalInfo.h" + +#include "TLorentzVector.h" +#include "CLHEP/Vector/LorentzVector.h" +#include <math.h> + +TrigEFDielectronMassFex::TrigEFDielectronMassFex(const std::string & name, ISvcLocator* pSvcLocator) + : HLT::ComboAlgo(name, pSvcLocator) { + + // Read cuts + declareProperty("useElectronElectron", m_useElectronElectron=true, + "Use electron-electron pair to calculate invariant mass"); + declareProperty("useElectronCluster", m_useElectronCluster=false, + "Use electron-cluster pair to calculate invariant mass"); + declareProperty("AcceptAll", m_acceptAll); + declareProperty("LowerMassCut", m_lowerMassCut=50000.0); + declareProperty("UpperMassCut", m_upperMassCut=130000.0); + + // monitoring + declareMonitoredVariable("massOfAccepted", m_monMassAccepted); + declareMonitoredVariable("cut", m_monCut); +} + +TrigEFDielectronMassFex::~TrigEFDielectronMassFex() +{ } + +HLT::ErrorCode TrigEFDielectronMassFex::hltInitialize() +{ + + if (msgLvl() <= MSG::VERBOSE) { + msg() << MSG::DEBUG << "Initialization:" << endreq; + } + + + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Initialization completed successfully:" << endreq; + msg() << MSG::DEBUG << "AcceptAll = " + << (m_acceptAll==true ? "True" : "False") << endreq; + msg() << MSG::DEBUG << "LowerMassCut = " << m_lowerMassCut << endreq; + msg() << MSG::DEBUG << "UpperMassCut = " << m_upperMassCut << endreq; + } + + return HLT::OK; +} + + +HLT::ErrorCode TrigEFDielectronMassFex::hltFinalize() +{ + if ( msgLvl() <= MSG::INFO ) + msg() << MSG::INFO << "in finalize()" << endreq; + + return HLT::OK; +} + + +HLT::ErrorCode TrigEFDielectronMassFex::acceptInputs(HLT::TEConstVec& inputTE, bool& pass ) { + pass = false; + + m_monMassAccepted = -1.; + m_monCut=0; + // sanity checks + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "Running TrigEFDielectronMassFex::acceptInputs" << endreq; + + if ( inputTE.size() != 2 ) { + msg() << MSG::ERROR << "Got diferent than 2 number of input TEs: " << + inputTE.size() << " job badly configured" << endreq; + return HLT::BAD_JOB_SETUP; + } + + // Accept-All mode: temporary patch; should be done with force-accept + if (m_acceptAll) { + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "AcceptAll property is set: taking all events" + << endreq; + pass = true; + return HLT::OK; + } else { + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "AcceptAll property not set: applying selection" + << endreq; + } + + // this are 2 TEs which we eventually will combine + const HLT::TriggerElement* te1 = inputTE[0]; + const HLT::TriggerElement* te2 = inputTE[1]; + + // for debugging purpose look into RoIDescriptors + if ( msgLvl() <= MSG::DEBUG ){ + const TrigRoiDescriptor* roiDescriptor1 = 0; + const TrigRoiDescriptor* roiDescriptor2 = 0; + if ( getFeature(te1, roiDescriptor1) != HLT::OK || getFeature(te2, roiDescriptor2) != HLT::OK ) { + if ( msgLvl() <= MSG::WARNING) { + msg() << MSG::WARNING << "No RoIDescriptors for this Trigger Elements! " << endreq; + } + } else { + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "Trying to combine 2 RoIs: " << *roiDescriptor1 << " & " << *roiDescriptor2 << endreq; + } + } + + // retrieve TrigElectronContainers from this TE + const xAOD::ElectronContainer* electronCont(0); + const xAOD::CaloClusterContainer* clusterCont(0); + if (m_useElectronElectron) { + if ( getFeature(te1, electronCont) != HLT::OK || electronCont == 0 || + getFeature(te2, electronCont) != HLT::OK || electronCont == 0) { + // Not an error condition as it could happen for e+etcut chain + if ( msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Failed to get egammaContainer" << endreq; + } + return HLT::MISSING_FEATURE; + } + } + if (m_useElectronCluster) { + if ( getFeature(te1, electronCont) != HLT::OK || electronCont == 0 || + getFeature(te2, clusterCont) != HLT::OK || clusterCont == 0) { + // Not an error condition as it could happen for e+etcut chain + if ( msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG + << "Failed to get egammaContainer/clusterContainer" << endreq; + } + return HLT::MISSING_FEATURE; + } + } + + pass=true; + + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "pass = " << pass << endreq; + } + return HLT::OK; +} + +HLT::ErrorCode TrigEFDielectronMassFex::hltExecute(HLT::TEConstVec& inputTE, + HLT::TriggerElement* outputTE){ + + m_monMassAccepted = -1.; + m_monCut=0; + m_massElectronElectron.clear(); + m_massElectronCluster.clear(); + + unsigned int i; + if (m_useElectronElectron) { + TrigOperationalInfo* masses_ee = new TrigOperationalInfo(); + processElectronElectron(inputTE, m_massElectronElectron); + for (i=0; i<m_massElectronElectron.size(); ++i) { + std::ostringstream os; + os << "mass_ee" << i; + masses_ee->set(os.str(), m_massElectronElectron[i]); + } + attachFeature(outputTE, masses_ee, "MassesElectronElectron"); + } + if (m_useElectronCluster) { + TrigOperationalInfo* masses_ec = new TrigOperationalInfo(); + processElectronCluster(inputTE, m_massElectronCluster); + for (i=0; i<m_massElectronCluster.size(); ++i) { + std::ostringstream os; + os << "mass_ec" << i; + masses_ec->set(os.str(), m_massElectronCluster[i]); + } + attachFeature(outputTE, masses_ec, "MassesElectronCluster"); + } + + return HLT::OK; +} + +void TrigEFDielectronMassFex::processElectronElectron(HLT::TEConstVec& inputTE, + std::vector<float>& masses) { + const HLT::TriggerElement* te1 = inputTE[0]; + const HLT::TriggerElement* te2 = inputTE[1]; + const xAOD::ElectronContainer* cont1(0); + const xAOD::ElectronContainer* cont2(0); + if (getFeature(te1, cont1) != HLT::OK || getFeature(te2, cont2) != HLT::OK || + cont1 == 0 || cont2 == 0) { + // Not an error condition as it could happen for e+etcut chain + if ( msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG + << "Failed to get egammaContainers" << endreq; + } + return; + } + + xAOD::ElectronContainer::const_iterator p1; + xAOD::ElectronContainer::const_iterator p2; + float mass(0.0); + for (const auto& p1 : *cont1){ + for (const auto& p2 : *cont2){ + m_monCut = 1; + // selection is done here + // + // debug dump (both electrons have tracks now) + + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "New combination:" << endreq; + msg() << MSG::DEBUG << "1st egammaElectron " + << " pt=" << p1->pt() + << "; eta=" << p1->eta() + << "; phi=" << p1->phi() + << endreq; + msg() << MSG::DEBUG << "2nd egammaElectron " + << " pt=" << p2->pt() + << "; eta=" << p2->eta() + << "; phi=" << p2->phi() + << endreq; + } + + // evaluate mass + + TLorentzVector hlv1 = p1->p4(); + TLorentzVector hlv2 = p2->p4(); + mass = (hlv1+hlv2).M(); + +// if (msgLvl() <= MSG::DEBUG) { +// TLorentzVector v1, v2; +// const float m_e = 0.511; + +// float pt1 = hlv1.e()*sin(hlv1.theta()); +// float pt2 = hlv2.e()*sin(hlv2.theta()); +// v1.SetPtEtaPhiM(pt1, hlv1.eta(), hlv1.phi(), m_e); +// v2.SetPtEtaPhiM(pt2, hlv2.eta(), hlv2.phi(), m_e); +// } + + // apply cut on mass + if(mass<m_lowerMassCut || mass>m_upperMassCut) { + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Combination failed mass cut: " + << mass << " not in [" << m_lowerMassCut << "," + << m_upperMassCut << "]" << endreq; + } + continue; + } else { + // good combination found + m_monCut = 2; + if (masses.size() == 0) m_monMassAccepted = mass; + masses.push_back(mass); + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Combination passed mass cut: " + << m_lowerMassCut << " < " << mass << " < " + << m_upperMassCut << endreq; + } + } + } // electrons2 container loop end + } // electrons1 container loop end +} + +void TrigEFDielectronMassFex::processElectronCluster(HLT::TEConstVec& inputTE, + std::vector<float>& masses) { + const HLT::TriggerElement* te1 = inputTE[0]; + const HLT::TriggerElement* te2 = inputTE[1]; + const xAOD::ElectronContainer* cont1(0); + const xAOD::CaloClusterContainer* cont2(0); + if (getFeature(te1, cont1) != HLT::OK || getFeature(te2, cont2) != HLT::OK || + cont1 == 0 || cont2 == 0) { + // Not an error condition as it could happen for e+etcut chain + if ( msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG + << "Failed to get egammaContainer & CaloClusterContainer" + << endreq; + } + return; + } + + xAOD::ElectronContainer::const_iterator p1; + xAOD::CaloClusterContainer::const_iterator p2; + float mass(0.0); + for (const auto& p1 : *cont1){ + for (const auto& p2 : *cont2){ + m_monCut = 1; + // selection is done here + // + // debug dump (both electrons have tracks now) + + //Need to fix for xAOD!!!!!!!!!!!! + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "New combination:" << endreq; + msg() << MSG::DEBUG << "1st egammaElectron " + << " pt=" << p1->pt() + << "; eta=" << p1->eta() + << "; phi=" << p1->phi() + << endreq; + msg() << MSG::DEBUG << "2nd CaloCluster:" + << " pt=" << p2->pt() + << "; eta=" << p2->eta() + << "; phi=" << p2->phi() + << endreq; + } + + // evaluate mass + + TLorentzVector hlv1 = p1->p4(); + TLorentzVector hlv2 = p2->p4(); + mass = (hlv1+hlv2).M(); + + // apply cut on mass + if(mass<m_lowerMassCut || mass>m_upperMassCut) { + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Combination failed mass cut: " + << mass << " not in [" << m_lowerMassCut << "," + << m_upperMassCut << "]" << endreq; + } + continue; + } else { + // good combination found + m_monCut = 2; + if (masses.size() == 0) m_monMassAccepted = mass; + masses.push_back(mass); + if (msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Combination passed mass cut: " + << m_lowerMassCut << " < " << mass << " < " + << m_upperMassCut << endreq; + } + } + } // electrons2 container loop end + } // electrons1 container loop end +} + diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFDielectronMassHypo.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFDielectronMassHypo.cxx new file mode 100755 index 00000000000..0d8b1af02f4 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFDielectronMassHypo.cxx @@ -0,0 +1,155 @@ +// -*- C++ -*- + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/************************************************************************** + ** + ** File: Trigger/TrigHypothesis/TrigEgammaHypo/TrigEFDielectronMassHypo.h + ** + ** Description: - Hypothesis algorithm: searc for electron pairs with + ** invariant mass in some interval; intended for Z->ee + ** - Modified from TrigL2DielectronMassHypo by R. Goncalo + ** + ** Author: T. Hrynova <thrynova@mail.cern.ch> + ** + ** Created: Nov 13 2009 + **************************************************************************/ + +#include "TrigEgammaHypo/TrigEFDielectronMassFex.h" + +#include "TrigEgammaHypo/TrigEFDielectronMassHypo.h" + +#include "TrigSteeringEvent/TrigOperationalInfo.h" + + +class ISvcLocator; + +TrigEFDielectronMassHypo::TrigEFDielectronMassHypo(const std::string & name, ISvcLocator* pSvcLocator): + HLT::HypoAlgo(name, pSvcLocator) +{ + // Read cuts + declareProperty("AcceptAll", m_acceptAll); + declareProperty("useElectronElectron", m_useElectronElectron=true, + "Use electron-electron pair to calculate invariant mass"); + declareProperty("useElectronCluster", m_useElectronCluster=false, + "Use electron-cluster pair to calculate invariant mass"); + declareProperty("LowerMassCut", m_lowerMassCut=50000.0); + declareProperty("UpperMassCut", m_upperMassCut=130000.0); + declareProperty("LowerMassElectronClusterCut", + m_lowerMassElectronClusterCut=50000.0, + "Lower mass cut for electron-cluster pair"); + declareProperty("UpperMassElectronClusterCut", + m_upperMassElectronClusterCut=130000.0, + "Upper mass cut for electron-cluster pair"); + + // monitoring + declareMonitoredVariable("massOfAccepted", m_monMassAccepted); + declareMonitoredVariable("cut", m_monCut); + +} + +TrigEFDielectronMassHypo::~TrigEFDielectronMassHypo() +{ } + +HLT::ErrorCode TrigEFDielectronMassHypo::hltInitialize() +{ + + if (msgLvl() <= MSG::VERBOSE) { + msg() << MSG::DEBUG << "Initialization:" << endreq; + } + + + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Initialization completed successfully:" << endreq; + msg() << MSG::DEBUG << "AcceptAll = " + << (m_acceptAll==true ? "True" : "False") << endreq; + msg() << MSG::DEBUG << "LowerMassCut = " << m_lowerMassCut << endreq; + msg() << MSG::DEBUG << "UpperMassCut = " << m_upperMassCut << endreq; + } + + return HLT::OK; +} + + +HLT::ErrorCode TrigEFDielectronMassHypo::hltFinalize() +{ + if ( msgLvl() <= MSG::INFO ) + msg() << MSG::INFO << "in finalize()" << endreq; + + return HLT::OK; +} + +HLT::ErrorCode TrigEFDielectronMassHypo::hltExecute(const HLT::TriggerElement* outputTE, bool& pass) { + pass = false; + const TrigOperationalInfo* x(0); + + if (m_useElectronElectron) { + if (msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Check electron-electron pair masses" << endreq; + } + if (getFeature(outputTE, x, "MassesElectronElectron") != HLT::OK) { + if (msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Error while getting features " << endreq; + } + } else { + if (checkAllMasses(x, m_lowerMassCut, m_upperMassCut)) { + pass = true; + } + } + } + if (m_useElectronCluster) { + if (msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Check electron-cluster pair masses" << endreq; + } + if (getFeature(outputTE, x, "MassesElectronCluster") != HLT::OK) { + if (msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Error while getting features " << endreq; + } + } else { + if (checkAllMasses(x, m_lowerMassElectronClusterCut, + m_upperMassElectronClusterCut)) { + pass = true; + } + } + } + + // set output TriggerElement true if good combination + if(msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << "pass = " << pass << endreq; + return HLT::OK; +} + +bool TrigEFDielectronMassHypo::checkAllMasses(const TrigOperationalInfo* x, + float mass_min, float mass_max) { + bool status=false; + if (x) { + std::pair<std::vector<std::string>, std::vector<float> > mp = x->infos(); + //std::vector<std::string>& names = mp.first; + std::vector<float>& values = mp.second; + for (unsigned int i=0; i<values.size(); ++i) { + float mass = values[i]; + if (mass < mass_min || mass > mass_max) { + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Combination failed mass cut: " + << mass << " not in [" << mass_min << "," + << mass_max << "]" << endreq; + } + } else { + status = true; + m_monCut = 2; + m_monMassAccepted = mass; + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Combination passed mass cut: " + << mass_min << " < " << mass << " < " + << mass_max << endreq; + msg() << MSG::DEBUG << "Good combination found! Mee=" + << mass << " MeV" << endreq; + } + } + } + } + return status; +} + +// LocalWords: upperMassCut diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFElectronHypo.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFElectronHypo.cxx new file mode 100755 index 00000000000..cdc42a43d3b --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFElectronHypo.cxx @@ -0,0 +1,854 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// ******************************************************************** +// +// NAME: TrigEFElectronHypo.cxx +// PACKAGE: Trigger/TrigHypothesis/TrigEFElectronHypo +// +// MAINTAINED BY: Ryan M. White, Alessandro Tricoli +// +// MODIFIED: A.Tricoli: Use of offline tools to build isEM (Jan 2010) +// MODIFIED: R.M. White: Use PATCore tools to build isEM (Aug 2013) +// MODIFIED: R.M. White: xAOD Migration (April 2014) +// ******************************************************************** +// Comments on xAOD +// Removing checks for showershape checks, track particle checks +// Assume that electrons must have this information +// +#include <list> +#include <iterator> +#include <sstream> +#include <map> + +// +#include "GaudiKernel/MsgStream.h" +#include "GaudiKernel/StatusCode.h" +#include "GaudiKernel/ListItem.h" +// +#include "TrigSteeringEvent/TrigRoiDescriptor.h" +#include "TrigEgammaHypo/TrigEFElectronHypo.h" +#include "egammaEvent/egammaParamDefs.h" +#include "xAODEgamma/Electron.h" +#include "xAODEgamma/Egamma.h" +#include "VxVertex/RecVertex.h" +#include "ITrackToVertex/ITrackToVertex.h" +#include "TrigTimeAlgs/TrigTimerSvc.h" + +#include "TrigSteeringEvent/TrigPassBits.h" + +#include "TrigSteeringEvent/TrigPassFlags.h" + + + + +namespace { + template <class DEST,class SRC> + inline DEST** my_pp_cast(SRC** ptr) { + return (DEST**)(ptr); + } +} + +///////////////////////////////////////////////////////////////////// +// CONSTRUCTOR: +///////////////////////////////////////////////////////////////////// +// +TrigEFElectronHypo::TrigEFElectronHypo(const std::string& name, + ISvcLocator* pSvcLocator): + HLT::HypoAlgo(name, pSvcLocator), + + m_primaryVertex(Amg::Vector3D()), //AT Jan 2010: added + m_trackToVertexTool("Reco::TrackToVertex")//AT Jan 2010: added +{ + + + + declareProperty("AcceptAll", m_acceptAll=true); + + declareProperty("CaloCutsOnly", m_caloCutsOnly); + + // + //Trig isEMTrigCut cuts adopted from offline + // + + + //Calorimeter cuts + + + //isEM offline + declareProperty("ApplyIsEM",m_applyIsEM = false); + declareProperty("IsEMrequiredBits",m_IsEMrequiredBits = 0xF2); + + declareProperty("egammaElectronCutIDToolName",m_egammaElectronCutIDToolName=""); + + //TSelector + //Athena Selector Tool + declareProperty("AthenaElectronLHIDSelectorToolName", m_athElectronLHIDSelectorToolName=""); + declareProperty("UseAthenaElectronLHIDSelectorTool", m_useAthElectronLHIDSelector=false); + + //Tool for track extrapolation to vertex + declareProperty("trackToVertexTool", m_trackToVertexTool, + "Tool for track extrapolation to vertex"); + + declareProperty("emEt",m_emEt = -3.*CLHEP::GeV); + + declareProperty("histoPath", m_path = "/stat/Monitoring/EventFilter" ); + + typedef const DataVector<xAOD::Egamma> m_dataVector; + typedef const DataVector<xAOD::Electron> m_dataVector2; + + // Cluster and ShowerShape Monitoring + declareMonitoredCollection("ClusterEt",*my_pp_cast<m_dataVector>(&m_EgammaContainer), &EtCluster); + declareMonitoredCollection("EtCluster37", *my_pp_cast<m_dataVector>(&m_EgammaContainer), &EtCluster37); + declareMonitoredCollection("E237", *my_pp_cast<m_dataVector>(&m_EgammaContainer), &getE237); + declareMonitoredCollection("E277", *my_pp_cast<m_dataVector>(&m_EgammaContainer), &getE277); + declareMonitoredCollection("Reta", *my_pp_cast<m_dataVector>(&m_EgammaContainer), &getE277); + declareMonitoredCollection("EtHad1", *my_pp_cast<m_dataVector>(&m_EgammaContainer), &getEthad1); + declareMonitoredCollection("WEta1", *my_pp_cast<m_dataVector>(&m_EgammaContainer), &getWeta1); + declareMonitoredCollection("WEta2", *my_pp_cast<m_dataVector>(&m_EgammaContainer), &getWeta2); + declareMonitoredCollection("F1", *my_pp_cast<m_dataVector>(&m_EgammaContainer), &getF1); + declareMonitoredCollection("E2tsts1", *my_pp_cast<m_dataVector>(&m_EgammaContainer), &getE2tsts1); + declareMonitoredCollection("Emins1", *my_pp_cast<m_dataVector>(&m_EgammaContainer), &getEmins1); + declareMonitoredCollection("wtots1", *my_pp_cast<m_dataVector>(&m_EgammaContainer), &getWtots1); + declareMonitoredCollection("Fracs1", *my_pp_cast<m_dataVector>(&m_EgammaContainer), &getfracs1); + declareMonitoredCollection("F3", *my_pp_cast<m_dataVector>(&m_EgammaContainer), &getF3); + declareMonitoredCollection("Eratio", *my_pp_cast<m_dataVector>(&m_EgammaContainer), &getEratio); + declareMonitoredCollection("EtConeIso", *my_pp_cast<m_dataVector>(&m_EgammaContainer), &getEtconeIso); + declareMonitoredCollection("PtConeIso", *my_pp_cast<m_dataVector2>(&m_EgammaContainer), &getPtconeIso); + + declareMonitoredCollection("nBLayerHits", *my_pp_cast<m_dataVector2>(&m_EgammaContainer), &getNbLayer); + declareMonitoredCollection("nPixelHits", *my_pp_cast<m_dataVector2>(&m_EgammaContainer), &getNPixel); + declareMonitoredCollection("nSCTHits", *my_pp_cast<m_dataVector2>(&m_EgammaContainer), &getNSCT); + declareMonitoredCollection("nTRTHits", *my_pp_cast<m_dataVector2>(&m_EgammaContainer), &getNTRT); + declareMonitoredCollection("nTRTHitsHighTh", *my_pp_cast<m_dataVector2>(&m_EgammaContainer), &getNTRThighTh); + declareMonitoredCollection("nTRTHitsHighThOutliers", *my_pp_cast<m_dataVector2>(&m_EgammaContainer), &getNTRThighThOutliers); + declareMonitoredCollection("nTRTHitsOutliers", *my_pp_cast<m_dataVector2>(&m_EgammaContainer), &getNTRTOutliers); + + declareMonitoredCollection("TrackPt", *my_pp_cast<m_dataVector2>(&m_EgammaContainer), &PtTrack); + declareMonitoredCollection("dEta", *my_pp_cast<m_dataVector2>(&m_EgammaContainer), &dEta); + declareMonitoredCollection("dPhi", *my_pp_cast<m_dataVector2>(&m_EgammaContainer), &dPhi); + declareMonitoredCollection("Eoverp", *my_pp_cast<m_dataVector2>(&m_EgammaContainer), &Eoverp); + declareMonitoredCollection("rTRT", *my_pp_cast<m_dataVector2>(&m_EgammaContainer), &rTRT); + + + + + declareMonitoredVariable("CutCounter",m_NofPassedCuts);//Event Counter*/ + + //Isolation + declareProperty("ApplyIsolation", m_applyIsolation=false); + declareProperty("EtConeSizes", m_EtConeSizes = 6); + declareProperty("RelEtConeCut", m_RelEtConeCut); + declareProperty("EtConeCut", m_EtConeCut); + declareProperty("PtConeSizes", m_PtConeSizes = 3); + declareProperty("RelPtConeCut", m_RelPtConeCut); + declareProperty("PtConeCut", m_PtConeCut); + declareProperty("useClusETforCaloIso", m_useClusETforCaloIso = true); + declareProperty("useClusETforTrackIso", m_useClusETforTrackIso = false); + + //isEM monitoring + declareMonitoredStdContainer("IsEMBeforeCut",m_NcandIsEM);//per-object counter of failing isEM bits + // + + declareMonitoredStdContainer("IsEMAfterCut",m_NcandIsEMAfterCut);//per-object counter of failing isEM bits + // + + //Monitor isEM 32-Bit Pattern Before Cuts + + declareMonitoredStdContainer("IsEMRequiredBitsBeforeCut",m_IsEMRequiredBits); + + //Monitor isEM 32-Bit Pattern After Cuts + + declareMonitoredStdContainer("IsEMRequiredBitsAfterCut",m_IsEMRequiredBitsAfterCut); + + // Monitor impact parameter wrt beamspot + declareMonitoredStdContainer("A0",m_a0); + + prepareMonitoringVars(); + + // + +} + +void TrigEFElectronHypo::prepareMonitoringVars() { + //isEM monitoring + + m_NcandIsEM.assign(32,0);//32-bit as it is in the Offline isEM for BitDefElecton and BitDefPhoton + + // + m_NcandIsEMAfterCut.assign(32,0);//32-bit as it is in the Offline isEM for BitDefElecton and BitDefPhoton + + + //Monitor isEM 32-Bit Pattern Before Cuts + m_IsEMRequiredBits.assign(32,0); + + //Monitor isEM 32-Bit Pattern After Cuts + m_IsEMRequiredBitsAfterCut.assign(32,0); +} + + +///////////////////////////////////////////////////////////////////// +// DESTRUCTOR: +///////////////////////////////////////////////////////////////////// +// +TrigEFElectronHypo::~TrigEFElectronHypo() +{ } + +///////////////////////////////////////////////////////////////////// +// INITIALIZE: +// The initialize method will create all the required algorithm objects +// Note that it is NOT NECESSARY to run the initialize of individual +// sub-algorithms. The framework takes care of it. +///////////////////////////////////////////////////////////////////// +// + +// ---------------------------------------------------------------------- +HLT::ErrorCode TrigEFElectronHypo::hltInitialize() + // ---------------------------------------------------------------------- +{ + if(msgLvl() <= MSG::DEBUG) + msg() << MSG::DEBUG << "in initialize()" << endreq; + + // Initialize timing service + //------------------------------ + if (timerSvc()) + m_totalTimer = addTimer("TrigEEgammaHypoTot"); + + + //retrieving TrackToVertex: + if ( m_trackToVertexTool.retrieve().isFailure() ) { + msg() << MSG::ERROR <<"Failed to retrieve tool " << m_trackToVertexTool << endreq; + m_trackToVertexTool = 0; + return StatusCode::FAILURE; + } else { + msg() << MSG::DEBUG << "Retrieved tool " << m_trackToVertexTool<< endreq; + } + + //------------------------------------------------------------------------------- + // Use egammaElectronCutIDTool to run the Offline isEM Buildre in the Hypo. + // The egammaElectronCutIDToolName runs the Electron Selecton only. + //------------------------------------------------------------------------------ + + if (m_egammaElectronCutIDToolName=="") { + msg() << MSG::DEBUG << "egammaElectronCutID PID is disabled " + << m_egammaElectronCutIDToolName + << endreq; + m_egammaElectronCutIDTool=0; + } else { + m_egammaElectronCutIDTool=ToolHandle<IAsgElectronIsEMSelector>(m_egammaElectronCutIDToolName); + if(m_egammaElectronCutIDTool.retrieve().isFailure()) { + msg() << MSG::ERROR << "Unable to retrieve " << m_egammaElectronCutIDTool + << " tool " << endreq; + return HLT::BAD_JOB_SETUP; + } + else { + msg()<<MSG::DEBUG<<"Tool " << m_egammaElectronCutIDTool << " retrieved"<<endreq; + //timing + if (timerSvc()) m_timerPIDTool = addTimer("m_egammaElectronCutIDToolName"); + } + } + + if (m_athElectronLHIDSelectorToolName=="") { + msg() << MSG::DEBUG << "AthenaElectronLHIDSelectorTool is disabled " + << m_athElectronLHIDSelectorToolName << endreq; + m_athElectronLHIDSelectorTool=0; + } else { + m_athElectronLHIDSelectorTool=ToolHandle<IAsgElectronLikelihoodTool>(m_athElectronLHIDSelectorToolName); + // a priori this is not useful + if(m_athElectronLHIDSelectorTool.retrieve().isFailure()) { + msg() << MSG::ERROR << "Unable to retrieve " << m_athElectronLHIDSelectorTool<< endreq; + return HLT::BAD_JOB_SETUP; + } + else{ + msg()<<MSG::DEBUG<<"Tool " << m_athElectronLHIDSelectorTool << " retrieved"<<endreq; + if (timerSvc()) m_timerPIDTool = addTimer("m_athElectronLHIDSelectorToolName"); + } + } + //print summary info + msg() << MSG::INFO << "REGTEST: Particle Identification tool: " << m_egammaElectronCutIDToolName << endreq; + msg() << MSG::INFO << "REGTEST: Athena LH Particle Identification tool: " << m_athElectronLHIDSelectorToolName << endreq; + //------------------------------------------------------------------------------ + + + //Check Isolation Cone Sizes + if(m_applyIsolation){ + if ( m_EtConeCut.size() != m_EtConeSizes ) { + msg() << MSG::ERROR << " m_EtConeCut size is " << m_EtConeCut.size() << " but needs " << m_EtConeSizes << endreq; + return StatusCode::FAILURE; + } + if ( m_RelEtConeCut.size() != m_EtConeSizes ) { + msg() << MSG::ERROR << " m_RelEtConeCut size is " << m_RelEtConeCut.size() << " but needs " << m_EtConeSizes << endreq; + return StatusCode::FAILURE; + } + if ( m_PtConeCut.size() != m_PtConeSizes ) { + msg() << MSG::ERROR << " m_PtConeCut size is " << m_PtConeCut.size() << " but needs " << m_PtConeSizes<< endreq; + return StatusCode::FAILURE; + } + if ( m_RelPtConeCut.size() != m_PtConeSizes ) { + msg() << MSG::ERROR << " m_RelPtConeCut size is " << m_RelPtConeCut.size() << " but needs " << m_PtConeSizes << endreq; + return StatusCode::FAILURE; + } + + //Define mapping between vector of Isolation Cone Sizes and variable names + m_mapEtCone.insert(std::pair<int, string>(0, "etcone15")); + m_mapEtCone.insert(std::pair<int, string>(1, "etcone20")); + m_mapEtCone.insert(std::pair<int, string>(2, "etcone25")); + m_mapEtCone.insert(std::pair<int, string>(3, "etcone30")); + m_mapEtCone.insert(std::pair<int, string>(4, "etcone35")); + m_mapEtCone.insert(std::pair<int, string>(5, "etcone40")); + // + m_mapPtCone.insert(std::pair<int, string>(0, "ptcone20")); + m_mapPtCone.insert(std::pair<int, string>(1, "ptcone30")); + m_mapPtCone.insert(std::pair<int, string>(2, "ptcone40")); + // + m_mapRelEtCone.insert(std::pair<int, string>(0, "etcone15/ele_pt")); + m_mapRelEtCone.insert(std::pair<int, string>(1, "etcone20/ele_pt")); + m_mapRelEtCone.insert(std::pair<int, string>(2, "etcone25/ele_pt")); + m_mapRelEtCone.insert(std::pair<int, string>(3, "etcone30/ele_pt")); + m_mapRelEtCone.insert(std::pair<int, string>(4, "etcone35/ele_pt")); + m_mapRelEtCone.insert(std::pair<int, string>(5, "etcone40/ele_pt")); + // + m_mapRelPtCone.insert(std::pair<int, string>(0, "ptcone20/ele_pt")); + m_mapRelPtCone.insert(std::pair<int, string>(1, "ptcone30/ele_pt")); + m_mapRelPtCone.insert(std::pair<int, string>(2, "ptcone40/ele_pt")); + + }//end of if(m_applyIsolation){ + + //Print Out + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG + << "Initialization of TrigEFElectronHypo completed successfully" + << endreq; + + // print cuts + if (m_acceptAll) { + msg() << MSG::DEBUG << "AcceptAll property is set: taking all events" + << endreq; + } else { + msg() << MSG::DEBUG << "AcceptAll property not set: applying selection" + << endreq; + } + + msg() << MSG::INFO + << " ApplyIsEM: " + << m_applyIsEM + << endreq; + msg() << MSG::INFO + << " emEt: " + << m_emEt + << endreq; + msg() << MSG::INFO + << " IsEMRequired: " + << m_IsEMrequiredBits + << endreq; + } + + return HLT::OK; + } + +HLT::ErrorCode TrigEFElectronHypo::hltBeginRun() { + prepareMonitoringVars(); + return HLT::OK; +} + + +// ---------------------------------------------------------------------- +HLT::ErrorCode TrigEFElectronHypo::hltFinalize(){ + // ---------------------------------------------------------------------- + + msg() << MSG::INFO << "in finalize()" << endreq; + return HLT::OK; +} + + +// ---------------------------------------------------------------------- +HLT::ErrorCode TrigEFElectronHypo::hltExecute(const HLT::TriggerElement* outputTE, + bool& accepted) { + // ---------------------------------------------------------------------- + + m_EgammaContainer = 0; + m_NofPassedCuts=-1; + m_a0.clear(); + // Time total TrigEFElectronHypo execution time. + // ------------------------------------- + if (timerSvc()) m_totalTimer->start(); + + + if(msgLvl() <= MSG::DEBUG) + msg() << MSG::DEBUG << name() << ": in execute()" << endreq; + + // default value, it will be set to true if selection satisfied + accepted=false; + + // AcceptAll property = true means selection cuts should not be applied + if (m_acceptAll) accepted=true; + + // get egamma objects from the trigger element: + //-------------------------------------------------- + + std::vector<const xAOD::ElectronContainer*> vectorEgammaContainers; + + HLT::ErrorCode stat = getFeatures(outputTE, vectorEgammaContainers, ""); + + if (stat != HLT::OK ) { + msg() << MSG::WARNING + << " Failed to get egammaContainer's from the trigger element" + << endreq; + if (timerSvc()) m_totalTimer->stop(); + return HLT::OK; + } + + if(msgLvl() <= MSG::DEBUG) + msg() << MSG::DEBUG << " Got " << vectorEgammaContainers.size() + << " egammaContainers's associated to the TE " << endreq; + + if (vectorEgammaContainers.size() < 1) { + msg() << MSG::DEBUG + << " empty egammaContainer from the trigger element" + << endreq; + if (timerSvc()) m_totalTimer->stop(); + return HLT::OK; + } + + m_EgammaContainer = vectorEgammaContainers.back(); + + if(m_EgammaContainer == 0){ + if ( msgLvl() <= MSG::ERROR ) + msg() << MSG::ERROR + << " REGTEST: Retrieval of egammaContainer from vector failed" + << endreq; + if (timerSvc()) m_totalTimer->stop(); + return HLT::OK; + } + + // generate TrigPassBits mask to flag which egamma objects pass hypo cuts + TrigPassBits* passBits = HLT::makeTrigPassBits(m_EgammaContainer); + + // adding TrigPassFlags for isEM bits - JTC Oct 2011 + const unsigned int flagSize = 32; + //std::cout << "TPF " << name() << " (in ::hltExecute()): size of m_EgammaContainer" << m_EgammaContainer->size() << std::endl; + + // temporarily disable the TrigPassFlags until xAOD format is sorted out + TrigPassFlags* isEMFlags = 0; // HLT::makeTrigPassFlags(m_EgammaContainer, flagSize); + + //counters for each cut + int Ncand[10]; + for(int i=0;i<10;i++) Ncand[i]=0; + + //isEM monitoring variables + for(unsigned int i=0;i<32;i++) m_NcandIsEM[i]=0;//28->32-bit as it is in the Offline isEM for BitDefElecton and BitDefPhoton + for(unsigned int i=0;i<32;i++) m_NcandIsEMAfterCut[i]=0;//28->32-bit as it is in the Offline isEM for BitDefElecton and BitDefPhoton + m_NofPassedCuts = 0; + m_NofPassedCutsIsEM = 0; + m_NofPassedCutsIsEMTrig = 0; + + + //AT Jan 2010: + //Monitor the required isEM bits Before/After Cuts + for(unsigned int i=0;i<32;i++) m_IsEMRequiredBits[i]=0; + for(unsigned int i=0;i<32;i++) m_IsEMRequiredBitsAfterCut[i]=0; + + //Monitor the required isEM 32-Bit pattern Before Cuts + for(unsigned int i=0;i<32;++i) { //32-bit as it is in the Offline isEM for BitDefElecton and BitDefPhoton + m_IsEMRequiredBits[i]+= ((m_IsEMrequiredBits & (0x1<<i)) && 1); + } + for (const auto& egIt : *m_EgammaContainer){ + + int cutIndex=0; + + Ncand[cutIndex++]++; + + if(msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << "REGTEST Ncand[0]: " << Ncand[0] << endreq; + + //------------------------------------------------------------- + //Apply cut on IsEM bit pattern re-running the Offline Builder + if( m_applyIsEM){ + //In order to force the tool to pick up the same cuts for Et>20 GeV, change the trigger threshold + double temp_EtThreshold=m_emEt; + if (temp_EtThreshold>20000) temp_EtThreshold=20000; + + //To re-run the Offline Electron isEM Builder + //Old and new tool + unsigned int isEMTrig = 0; + // again calculate PID but use Athena Selector Tool + bool isLHAcceptTrig = false; + if(m_useAthElectronLHIDSelector){ + //Check the tool + + if (m_athElectronLHIDSelectorTool == 0) { + msg() << MSG::ERROR << m_athElectronLHIDSelectorTool << " null, hypo continues but no AthenaLHSelector cut applied" << endreq; + }else{ + if (timerSvc()) m_timerPIDTool->start(); //timer + //xAOD Tool does not accept Egamma object + const Root::TAccept& acc = m_athElectronLHIDSelectorTool->accept(egIt); + isLHAcceptTrig = (bool) (acc); + ATH_MSG_DEBUG("AthenaLHSelectorTool: TAccept = " << isLHAcceptTrig); + if (timerSvc()) m_timerPIDTool->stop(); //timer + } + } + + else if (m_egammaElectronCutIDTool == 0) { + msg() << MSG::ERROR << m_egammaElectronCutIDTool << " null, hypo continues but no isEM cut applied" << endreq; + }else{ + if (timerSvc()) m_timerPIDTool->start(); //timer + msg() << MSG::DEBUG << m_egammaElectronCutIDTool << " Passing egamma object to AthenaSelectorTool" << endreq; + if ( m_egammaElectronCutIDTool->execute(egIt, temp_EtThreshold, m_caloCutsOnly).isFailure() ) { + if(msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG + << "problem with egammaElectronCutIDTool, egamma object not stored" + << endreq; + } + isEMTrig = m_egammaElectronCutIDTool->IsemValue(); + if(msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG + <<" isEMTrig = " + << std::hex << isEMTrig + << endreq; + if (timerSvc()) m_timerPIDTool->stop(); //timer + } + + //Monitor isEM Before Cut + for(unsigned int i=0;i<32;++i) { //32-bit as it is in the Offline isEM for BitDefElecton and BitDefPhoton + m_NcandIsEM[i]+= ((isEMTrig & (0x1<<i)) && 1); + } + + if(isEMFlags) + HLT::setFlag(isEMFlags, egIt, m_EgammaContainer, HLT::AsFlag(isEMTrig, flagSize) ); + + //Apply cut from LH selector + if(m_useAthElectronLHIDSelector && !m_caloCutsOnly){ + if(msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << m_athElectronLHIDSelectorTool + << " AthenaLHSelectorTool configured, hypo continues with TAccept " << endreq; + if( !isLHAcceptTrig) { + msg() << MSG::DEBUG << m_athElectronLHIDSelectorTool << " AthenaLHSelectorTool, hypo fails isEM " << endreq; + continue; + } + } + //Apply cut on IsEMTrigCut bit pattern + else { + if(msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << m_egammaElectronCutIDTool + << " AthenaSelectorTool configured, hypo continues with isEMTrig " << endreq; + if( (isEMTrig & m_IsEMrequiredBits)!=0 ) { + if(msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << "REGTEST IsEM = " << std::hex << isEMTrig + << " cut not satisfied for pattern:" << std::hex << m_IsEMrequiredBits << endreq; + continue; + } + } + + + //Monitor isEM After Cut + for(unsigned int i=0;i<32;++i) { //32-bit as it is in the Offline isEM for BitDefElecton and BitDefPhoton + m_NcandIsEMAfterCut[i]+= ((isEMTrig & (0x1<<i)) && 1); + } + + //Monitor the required isEM 32-Bit pattern After Cut + for(unsigned int i=0;i<32;++i) { //32-bit as it is in the Offline isEM for BitDefElecton and BitDefPhoton + m_IsEMRequiredBitsAfterCut[i]+= ((m_IsEMrequiredBits & (0x1<<i)) && 1); + } + + + }//end of if( m_applyIsEM) + Ncand[cutIndex++]++; + + //--------------------------------------------- + //Other Trigger Specific Cuts + //--------------------------------------------- + const xAOD::CaloCluster* clus = egIt->caloCluster(); + if(!clus) { + if(msgLvl() <= MSG::DEBUG) + msg() << MSG::DEBUG << "REGTEST no cluster pointer in egamma object " << endreq; + continue; + } + if( clus->et() < m_emEt) { + if(msgLvl() <= MSG::DEBUG) + msg() << MSG::DEBUG << "REGTEST Et cut no satisfied: "<< clus->et() << "< cut: " << m_emEt << endreq; + continue; + } + Ncand[cutIndex++]++; + + if(msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << "REGTEST Ncand[1]: " << Ncand[1] << endreq; + + //-------------------------------------------------------------------------- + //--Check that TrackParticle exists, if so monitor the impact parameter + //-------------------------------------------------------------------------- + //xAOD not working yet + if(!(egIt->trackParticle())) { + + if(msgLvl() <= MSG::INFO) msg() << MSG::INFO << "TrackParticle does NOT Exist, do NOT obtain impact parameter" << endreq; + }else{ + if(msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << "TrackParticle Exists, monitor impact parameter for electron" << endreq; + m_a0.push_back(findImpact(egIt->trackParticle())); + } + + + //--------------------------------------------- + //Isolation Cuts + //--------------------------------------------- + if(!m_applyIsolation) { + //For CutCount monitoring histogram,to fill isolation bins when no isolation cut is applied + Ncand[cutIndex++]++;//Abs. Etcone + Ncand[cutIndex++]++;//Abs. Ptcone + Ncand[cutIndex++]++;//Rel. Etcone + Ncand[cutIndex++]++;//Rel. Ptcone + } + else{ + + if(msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << "Apply Isolation" << endreq; + + //--Declare vectors of isolation variables for different cone sizes + std::vector<float> EtCone, PtCone; + //--Fill vectors of Absolute isolation variables for different cone sizes + float val_float=-99; + egIt->isolationValue(val_float,xAOD::EgammaParameters::etcone15); + EtCone.push_back(val_float); + egIt->isolationValue(val_float,xAOD::EgammaParameters::etcone20); + EtCone.push_back(val_float); + egIt->isolationValue(val_float,xAOD::EgammaParameters::etcone25); + EtCone.push_back(val_float); + egIt->isolationValue(val_float,xAOD::EgammaParameters::etcone30); + EtCone.push_back(val_float); + egIt->isolationValue(val_float,xAOD::EgammaParameters::etcone35); + EtCone.push_back(val_float); + egIt->isolationValue(val_float,xAOD::EgammaParameters::etcone40); + EtCone.push_back(val_float); + + // + egIt->isolationValue(val_float,xAOD::EgammaParameters::ptcone20); + PtCone.push_back(val_float); + egIt->isolationValue(val_float,xAOD::EgammaParameters::ptcone30); + PtCone.push_back(val_float); + egIt->isolationValue(val_float,xAOD::EgammaParameters::ptcone40); + PtCone.push_back(val_float); + + //printout + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Absolute Calo Isolation (vector size = " << EtCone.size() << ") :" << endreq; + for(std::size_t iConeSize = 0; iConeSize < EtCone.size(); iConeSize++) { + msg() << MSG::DEBUG << "*** " << m_mapEtCone[iConeSize] + << ", Cut = " << m_EtConeCut[iConeSize] + << ", Value = " << EtCone[iConeSize] << endreq; + } + msg() << MSG::DEBUG << "Absolute Track Isolation (vector size = " << PtCone.size()<< ") :" << endreq; + for(std::size_t iConeSize = 0; iConeSize < PtCone.size(); iConeSize++) { + msg() << MSG::DEBUG << "*** " << m_mapPtCone[iConeSize] + << ", Cut = " << m_PtConeCut[iConeSize] + << ", Value = " << PtCone[iConeSize] << endreq; + } + } + + + //--Cut on Absolute Calo Isolation + bool absEtConeCut_ispassed = true; + for(std::size_t iConeSize = 0; iConeSize < EtCone.size(); iConeSize++) { + //NB: -ve values in cut means DO NOT CUT + if( ( m_EtConeCut[iConeSize] > 0.) && (EtCone[iConeSize] > m_EtConeCut[iConeSize])) { + if(msgLvl() <= MSG::DEBUG) + msg() << MSG::DEBUG << "REGTEST Absolute Calo Isolation " << m_mapEtCone[iConeSize] << " NOT satisfied: "<< EtCone[iConeSize] << " > cut: " << m_EtConeCut[iConeSize] << endreq; + absEtConeCut_ispassed = false; + break;//skip remaining etcone sizes if one fails + } + } + + if(!absEtConeCut_ispassed) continue;//if one isolation cut fails on one egamma object go to next egamma object + Ncand[cutIndex++]++;//Abs. EtCone + + + //--Cut on Absolute Track Isolation + bool absPtConeCut_ispassed = true; + for(std::size_t iConeSize = 0; iConeSize < PtCone.size(); iConeSize++) { + + //NB: -ve values in cut means DO NOT CUT + if( ( m_PtConeCut[iConeSize] > 0.) && (PtCone[iConeSize] > m_PtConeCut[iConeSize])) { + if(msgLvl() <= MSG::DEBUG) + msg() << MSG::DEBUG << "REGTEST Absolute Track Isolation " << m_mapPtCone[iConeSize] << " NOT satisfied: "<< PtCone[iConeSize] << " > cut: " << m_PtConeCut[iConeSize] << endreq; + absPtConeCut_ispassed = false; + break;//skip remaining ptcone sizes if one fails + } + } + + if(!absPtConeCut_ispassed) continue;//if one isolation cut fails on one egamma object go to next egamma object + Ncand[cutIndex++]++;//Abs. PtCone + + + //--Relative isolation + std::vector<float> RelEtCone, RelPtCone; + + //--Check that CaloCluster exists, if so use cluster ET as Denonimator in Relative Isolation + float caloIso_ele_pt=-9999.; + float trkIso_ele_pt=-9999.; + float ele_clus_pt=-9999.; + float ele_trk_pt=-9999.; + if(!clus) { + + if(msgLvl() <= MSG::INFO) msg() << MSG::INFO << "CaloCluster dees NOT Exist, do NOT use Electron ET as Denominator in Relative Isolation" << endreq; + } else{ + + if(msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << "CaloCluster Exists, may use cluster ET as denominator in relative Isolation varariables" << endreq; + ele_clus_pt=clus->et(); + } + + //--Check that TrackParticle exists, if so use track ET as Denonimator in Relative Isolation + if(!(egIt->trackParticle())) { + + if(msgLvl() <= MSG::INFO) msg() << MSG::INFO << "TrackParticle does NOT Exist, do NOT use Electron Track PT as Denominator in Relative Isolation" << endreq; + }else{ + if(msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << "TrackParticle Exists, may use Electron Track PT as denominator in relative Isolation varariables" << endreq; + ele_trk_pt=egIt->trackParticle()->pt(); + } + + //--Define the electron pt variable to use as denominator in Relative Isolation + + if(m_useClusETforCaloIso) { + caloIso_ele_pt=ele_clus_pt; + if(msgLvl() <= MSG::DEBUG) + msg() << MSG::DEBUG << "For Relative Calo Isolation use ele_clus_pt = " << caloIso_ele_pt << endreq; + } + else { + caloIso_ele_pt=ele_trk_pt; + if(msgLvl() <= MSG::DEBUG) + msg() << MSG::DEBUG << "For Relative Calo Isolation use ele_trk_pt = " << caloIso_ele_pt << endreq; + } + if(m_useClusETforTrackIso) { + trkIso_ele_pt=ele_clus_pt; + msg() << MSG::DEBUG << "For Relative Track Isolation use ele_clus_pt = " << trkIso_ele_pt << endreq; + } + else { + trkIso_ele_pt=ele_trk_pt; + msg() << MSG::DEBUG << "For Relative Track Isolation use ele_trk_pt = " << trkIso_ele_pt << endreq; + } + + + //--Fill vectors of Relative isolation variables for different cone sizes + for (std::size_t iConeSize = 0; iConeSize < EtCone.size(); iConeSize++){ + + if(caloIso_ele_pt > 0.) RelEtCone.push_back(EtCone[iConeSize]/caloIso_ele_pt); + else RelEtCone.push_back(0.); + } + + for (std::size_t iConeSize = 0; iConeSize < PtCone.size(); iConeSize++){ + + if(trkIso_ele_pt > 0.) RelPtCone.push_back(PtCone[iConeSize]/trkIso_ele_pt); + else RelPtCone.push_back(0.); + } + + + + //printout + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Relative Calo Isolation (vector size = " << RelEtCone.size()<< ") :" << endreq; + for(std::size_t iConeSize = 0; iConeSize < RelEtCone.size(); iConeSize++) { + msg() << MSG::DEBUG << "*** " << m_mapRelEtCone[iConeSize] + << ", Cut = " << m_RelEtConeCut[iConeSize] + << ", Value = " << RelEtCone[iConeSize] << endreq; + } + msg() << MSG::DEBUG << "Relative Track Isolation Cuts (vector size = " << RelPtCone.size()<< ") :" << endreq; + for(std::size_t iConeSize = 0; iConeSize < RelPtCone.size(); iConeSize++) { + msg() << MSG::DEBUG << "*** " << m_mapRelPtCone[iConeSize] + << ", Cut = " << m_RelPtConeCut[iConeSize] + << ", Value = " << RelPtCone[iConeSize] << endreq; + } + } + + //--Cut on Relative Calo Isolation + bool relEtConeCut_ispassed = true; + for(std::size_t iConeSize = 0; iConeSize < RelEtCone.size(); iConeSize++) { + //NB: -ve values in cut means DO NOT CUT + if( ( m_RelEtConeCut[iConeSize] > 0.) && (RelEtCone[iConeSize] > m_RelEtConeCut[iConeSize])) { + if(msgLvl() <= MSG::DEBUG) + msg() << MSG::DEBUG << "REGTEST Relative Calo Isolation " << m_mapRelEtCone[iConeSize] << " NOT satisfied: "<< RelEtCone[iConeSize] << " > cut: " << m_RelEtConeCut[iConeSize] << endreq; + relEtConeCut_ispassed = false; + break;//skip remaining etcone sizes if one fails + } + } + + if(!relEtConeCut_ispassed) continue;//if one isolation cut fails on one egamma object go to next egamma object + Ncand[cutIndex++]++;//Rel. Etcone + + + //--Cut on Relative Track Isolation + bool relPtConeCut_ispassed = true; + for(std::size_t iConeSize = 0; iConeSize < RelPtCone.size(); iConeSize++) { + //NB: -ve values in cut means DO NOT CUT + if( ( m_RelPtConeCut[iConeSize] > 0.) && (RelPtCone[iConeSize] > m_RelPtConeCut[iConeSize])) { + if(msgLvl() <= MSG::DEBUG) + msg() << MSG::DEBUG << "REGTEST Relative Track Isolation " << m_mapRelPtCone[iConeSize] << " NOT satisfied: "<< RelPtCone[iConeSize] << " > cut: " << m_RelPtConeCut[iConeSize] << endreq; + relPtConeCut_ispassed = false; + break;//skip remaining ptcone sizes if one fails + } + } + + if(!relPtConeCut_ispassed) continue;//if one isolation cut fails on one egamma object go to next egamma object + Ncand[cutIndex++]++;//Re. Ptcone + + }//end of if(m_applyIsolation) + + //------------------------------------------------- + // At least one Egamma matching passed all cuts. + // Accept the event! + //------------------------------------------------- + Ncand[cutIndex++]++; + accepted=true; + //xAOD need to fix!!!! + HLT::markPassing(passBits, egIt, m_EgammaContainer); // set bit for this egamma in TrigPassBits mask + + }//end of loop over egamma container + + //Count No of Events passing individual cuts + for(int i=0; i<10; i++) m_NofPassedCuts+=(Ncand[i]>0); + + + // print out Result + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "REGTEST Result = " <<(accepted ? "passed" : "failed")<< endreq; + msg() << MSG::DEBUG << "REGTEST AcceptAll= " <<(m_acceptAll ? "true (no cuts)" : "false (selection applied)")<< endreq; + } + + // store TrigPassBits result + if ( attachBits(outputTE, passBits) != HLT::OK ) { + msg() << MSG::ERROR << "Could not store TrigPassBits! " << endreq; + } + // store TrigPassFlags result + if(isEMFlags) { + if ( attachFlags(outputTE, isEMFlags, "isEM") != HLT::OK ) { + msg() << MSG::ERROR << "Could not store isEM flags! " << endreq; + } + } + + + // Time total TrigEFElectronHypo execution time. + // ------------------------------------- + + if (timerSvc()) m_totalTimer->stop(); + + return HLT::OK; +} + + +// ============================================================== +double TrigEFElectronHypo::findImpact(const xAOD::TrackParticle* track) const +{ + // + // recalculate transverse impact parameter + // in case no Vertex is provided by the user, + // beam position will be used if available + // + + double trackD0 = -9999.; + // protection against bad pointers + if (track==0) return -9999.; + + // use beam spot + const Trk::Perigee* perigee = + m_trackToVertexTool->perigeeAtBeamspot(*track); + + if (perigee==0) { + if(msgLvl() <= MSG::WARNING) msg() << MSG::WARNING <<"No perigee using beam spot; no d0 calculation"<<endreq; + perigee = m_trackToVertexTool->perigeeAtVertex(*track, m_primaryVertex); + } + + // destroy object + if (perigee!=0) + trackD0 = perigee->parameters()[Trk::d0]; + delete perigee; + + return trackD0; +} diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFHadronicRecoil.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFHadronicRecoil.cxx new file mode 100644 index 00000000000..90fe4e68af7 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFHadronicRecoil.cxx @@ -0,0 +1,126 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/* + TrigEFHadronicRecoil.cxx +*/ +#include "TrigEgammaHypo/TrigEFHadronicRecoil.h" +#include "TrigNavigation/Navigation.h" +#include "xAODEgamma/ElectronContainer.h" +#include "TrigMissingEtEvent/TrigMissingET.h" +#include "TrigSteeringEvent/TrigPassBits.h" + +using namespace std; + + +TrigEFHadronicRecoil::TrigEFHadronicRecoil(const std::string& name, + ISvcLocator* svcloc) : + HLT::AllTEAlgo(name, svcloc) { + declareProperty("RecoilCut", mRecoilCut=25.0E+3, + "Maximum value of the hadronic recoil (MeV)"); +} + +TrigEFHadronicRecoil::~TrigEFHadronicRecoil() { +} + +HLT::ErrorCode TrigEFHadronicRecoil::hltInitialize() { + return HLT::OK; +} + +HLT::ErrorCode +TrigEFHadronicRecoil::hltExecute(std::vector<HLT::TEVec>& inputs, + unsigned int type_out) { + HLT::TriggerElement* outputTE = makeOutputTE(inputs, type_out); + if (outputTE && inputs.size() != 2) { + // Cannot calculate the hadronic recoil and attach it + msg() << MSG::WARNING << "OutputTE is null or input TE size not two" + << endreq; + return HLT::OK; + } + + outputTE->setActiveState(false); + + HLT::TEVec& tes1 = inputs[0]; // 1st TE must be MET + HLT::TEVec& tes2 = inputs[1]; // 2nd TE must be electrons + + const TrigMissingET* met(0); + std::vector<float> v_recoil; + bool pass(false); + + if (tes1.size() == 1) { + HLT::TriggerElement* te_met = tes1[0]; + std::vector<const TrigMissingET*> v_met; + HLT::ErrorCode status = getFeatures(te_met, v_met); + if (status == HLT::OK) { + if (v_met.size() > 0) met = v_met[0]; + } + } else { + // There should be exactly one MET TE + } + if (msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "MET: " << met << endreq; + } + if (tes2.size() > 0) { + const TrigPassBits* bits(0); + HLT::TEVec::const_iterator p; + const xAOD::ElectronContainer* cont=0; + xAOD::ElectronContainer::const_iterator pe; + for (p=tes2.begin(); p!=tes2.end(); ++p) { + HLT::ErrorCode status = getFeature(*p, cont); + if (status != HLT::OK || cont == 0) continue; + status = getFeature(*p, bits, "passbits"); + if (status != HLT::OK || cont == 0) continue; + + //Need to fix for xADO!!!!!!!!!!!!!!!!!!!!!! + /* unsigned int i=0; + for (pe=cont->begin(); pe!=cont->end(); ++pe, ++i) { + if (msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Checking hadronic recoil with electron" << endreq; + } + if ( (*pe) != 0 && + (bits == 0 || (i<bits->size() && bits->isPassing(i) ) ) ) { + float px = (*pe)->px(); + float py = (*pe)->py(); + float recoil_px = px + met->ex(); + float recoil_py = py + met->ey(); + float recoil = sqrt(recoil_px*recoil_px + recoil_py*recoil_py); + if (msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Electron passed the selection, recoil=" << recoil << endreq; + } + if (recoil < mRecoilCut) pass = true; + // v_recoil.push_back(recoil); + } + }*/ + } + } + + if (msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Decision: " << pass << endreq; + } + if (pass) outputTE->setActiveState(true); + + return HLT::OK; +} + +HLT::ErrorCode TrigEFHadronicRecoil::hltFinalize() { + return HLT::OK; +} + +HLT::TriggerElement* +TrigEFHadronicRecoil::makeOutputTE(std::vector<HLT::TEVec>& inputs, + unsigned int type_out) { + HLT::TEVec allTEs; + if (inputs.size() == 2) { + HLT::TEVec& tes1 = inputs[0]; + HLT::TEVec& tes2 = inputs[1]; + copy(tes1.begin(), tes1.end(), back_inserter(allTEs)); + copy(tes2.begin(), tes2.end(), back_inserter(allTEs)); + } + + HLT::Navigation* navigation = config()->getNavigation(); + HLT::TriggerElement* outputTE = navigation->addNode(allTEs, type_out); + + return outputTE; +} + diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFPhotonHypo.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFPhotonHypo.cxx new file mode 100755 index 00000000000..faefbbebe6f --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFPhotonHypo.cxx @@ -0,0 +1,466 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// ******************************************************************** +// +// NAME: TrigEFPhotonHypo.cxx +// PACKAGE: Trigger/TrigHypothesis/TrigEFPhotonHypo +// +// AUTHOR: Valeria Perez Reale +// Phillip Urquijo +// Alessandro Tricoli +// Ryan Mackenzie White (xAOD) +// +// PURPOSE: Performs the calorimeter shower shape selection for egamma at EF +// +// MODIFIED: V. perez reale: Migration to new steering 1/12/06 +// G. Khoriauli: Add monitoring histograms for new monitoring framework 10/05/07 +// V. Perez-Reale: Fix bug on AcceptAll (present since 1/12/06) 10/05/07 +// A.Tricoli: Use of offline tools to build isEM (Jan 2010) +// R.Goncalo: add TrigPassBits +// R.M. White migration to xAOD (April 2014) +// +// ******************************************************************** +// xAOD Comments +// Need to differentiate between Electron and Photon for the selector +// Disable HighLumi and only use Electron container rather than Egamma/Photon +// Removing old trigger photon selection +// Notice that Et threshold cut done differently +// +#include <list> +#include <iterator> +#include <sstream> +// +#include "GaudiKernel/MsgStream.h" +#include "GaudiKernel/StatusCode.h" +#include "GaudiKernel/ListItem.h" + +#include "TrigEgammaHypo/TrigEFPhotonHypo.h" +#include "CLHEP/Units/SystemOfUnits.h" +#include "GaudiKernel/ITHistSvc.h" +#include <TH1F.h> +//#include "PATCore/IAthSelectorTool.h" +//#include "ElectronPhotonSelectorTools/IAsgElectronIsEMSelector.h" +#include "xAODEgamma/Electron.h" +#include "xAODEgamma/Photon.h" +// to add TrigPassBits +#include "TrigSteeringEvent/TrigPassBits.h" +#include "TrigSteeringEvent/TrigPassFlags.h" + +namespace { + template <class DEST,class SRC> + inline DEST** my_pp_cast(SRC** ptr) { + return (DEST**)(ptr); + } +} + +TrigEFPhotonHypo::TrigEFPhotonHypo(const std::string & name, ISvcLocator* pSvcLocator) + : HLT::HypoAlgo(name, pSvcLocator) +{ + + declareProperty("AcceptAll", m_acceptAll = true); + + //Trig isEMTrigCut cuts adopted from offline + //The cut methods and variables are slightly different online for electrons and photons, so + //both methods are used here (for low and high lumi) photons. + + // declareProperty("LumiLevel",m_LumiLevel="LowLumi");//LowLumi is the default, to use electron cuts - BC 2012, removed to match changes in offline, replaced with usePhotonCuts. "HighLumi" corresponds to usePhotonCuts = true, and "LowLumi" corresponds to usePhotonCuts = false. + declareProperty("usePhotonCuts",m_usePhotonCuts = false); + + //Name of egammaElectronCutIDTool and egammaPhotonCutIDToolName + declareProperty("egammaElectronCutIDToolName",m_egammaElectronCutIDToolName=""); + declareProperty("egammaPhotonCutIDToolName",m_egammaPhotonCutIDToolName=""); + + //isEM offline + declareProperty("ApplyIsEM",m_applyIsEM = false); + declareProperty("IsEMrequiredBits",m_IsEMrequiredBits = 0xF2); + + declareProperty("emEt",m_emEt = 0.*CLHEP::GeV); + + declareProperty("histoPath", m_path = "/EXPERT" ); + typedef const DataVector<xAOD::Egamma> m_dataVector; + declareMonitoredCollection("Eta", *my_pp_cast <m_dataVector>(&m_EgammaContainer), &Eta); + declareMonitoredCollection("Phi", *my_pp_cast <m_dataVector>(&m_EgammaContainer), &Phi); + declareMonitoredCollection("Et", *my_pp_cast <m_dataVector>(&m_EgammaContainer), &Et); + //declareMonitoredCollection("rE37E77", *my_pp_cast <m_dataVector>(&m_EgammaContainer), &rE37E77); + //declareMonitoredCollection("rE33E77", *my_pp_cast <m_dataVector>(&m_EgammaContainer), &rE33E77); + //declareMonitoredCollection("Eratio", *my_pp_cast <m_dataVector>(&m_EgammaContainer), &Eratio); + declareMonitoredVariable("CutCounter",m_NofPassedCuts); + + //isEM monitoring + declareMonitoredStdContainer("IsEMBeforeCut",m_NcandIsEM);//per-object counter of failing isEM bits + declareMonitoredStdContainer("IsEMAfterCut",m_NcandIsEMAfterCut);//per-object counter of failing isEM bits + declareMonitoredStdContainer("IsEMRequiredBitsBeforeCut",m_IsEMRequiredBits); + declareMonitoredStdContainer("IsEMRequiredBitsAfterCut",m_IsEMRequiredBitsAfterCut); + + prepareMonitoringVars(); +} + +void TrigEFPhotonHypo::prepareMonitoringVars() { + //isEM monitoring + + m_NcandIsEM.assign(32,0);//32-bit as it is in the Offline isEM for BitDefElecton and BitDefPhoton + + // + m_NcandIsEMAfterCut.assign(32,0);//32-bit as it is in the Offline isEM for BitDefElecton and BitDefPhoton + + //Monitor isEM 32-Bit Pattern Before Cuts + m_IsEMRequiredBits.assign(32,0); + + //Monitor isEM 32-Bit Pattern After Cuts + m_IsEMRequiredBitsAfterCut.assign(32,0); +} + +TrigEFPhotonHypo::~TrigEFPhotonHypo() +{ } + + +HLT::ErrorCode TrigEFPhotonHypo::hltInitialize() +{ + if(msgLvl() <= MSG::DEBUG) + msg() << MSG::DEBUG << "in initialize()" << endreq; + + if (timerSvc()) + m_totalTimer = addTimer("TrigEFPhotonHypoTot"); + + //------------------------------------------------------------------------------- + // Use egammaElectronCutIDTool to run the Offline isEM. + // The egammaElectronCutIDTool runs the Electron Selecton only + // independently on whether the egamma object has associated TrackParticle or not + //------------------------------------------------------------------------------ + + if (m_egammaElectronCutIDToolName=="") { + msg() << MSG::DEBUG << "egammaElectronCutID PID is disabled " + << m_egammaElectronCutIDToolName + << endreq; + m_egammaElectronCutIDTool=0; + } else { + m_egammaElectronCutIDTool=ToolHandle<IAsgElectronIsEMSelector>(m_egammaElectronCutIDToolName); + if(m_egammaElectronCutIDTool.retrieve().isFailure()) { + msg() << MSG::ERROR << "Unable to retrieve " << m_egammaElectronCutIDTool + << " tool " << endreq; + return HLT::BAD_JOB_SETUP; + } + else { + msg()<<MSG::DEBUG<<"Tool " << m_egammaElectronCutIDTool << " retrieved"<<endreq; + //timing + if (timerSvc()) m_timerPIDTool_Ele = addTimer("m_egammaElectronCutIDToolName"); + } + } + + //print summary info + msg() << MSG::INFO << "REGTEST: Particle Identification tool: " << m_egammaElectronCutIDToolName << endreq; + + + //------------------------------------------------------------------------------- + //Use egammaPhotonCutIDTool to run offline isEM + // egammaPhotonCutIDTool runs the Photon Selecton only + // independently on whether the egamma object has associated TrackParticle or not + //------------------------------------------------------------------------------ + if (m_egammaPhotonCutIDToolName=="") { + msg() << MSG::DEBUG << "egammaPhotonCutID PID is disabled " + << m_egammaPhotonCutIDToolName + << endreq; + m_egammaPhotonCutIDTool=0; + } else { + m_egammaPhotonCutIDTool=ToolHandle<IAsgPhotonIsEMSelector>(m_egammaPhotonCutIDToolName); + if(m_egammaPhotonCutIDTool.retrieve().isFailure()) { + msg() << MSG::ERROR << "Unable to retrieve " << m_egammaPhotonCutIDTool + << " tool " << endreq; + return HLT::BAD_JOB_SETUP; + } + else { + msg()<<MSG::DEBUG<<"Tool " << m_egammaPhotonCutIDTool << " retrieved"<<endreq; + //timing + if (timerSvc()) m_timerPIDTool_Pho = addTimer("m_egammaPhotonCutIDToolName"); + } + } + + //print summary info + msg() << MSG::INFO << "REGTEST: Particle Identification tool: " << m_egammaPhotonCutIDToolName << endreq; + //------------------------------------------------------------------------------ + + if(msgLvl() <= MSG::DEBUG) + msg() << MSG::DEBUG + << "Initialization of TrigEFPhotonHypo completed successfully" + << endreq; + + return HLT::OK; +} + + +HLT::ErrorCode TrigEFPhotonHypo::hltBeginRun() { + prepareMonitoringVars(); + return HLT::OK; +} + + +// ---------------------------------------------------------------------- +HLT::ErrorCode TrigEFPhotonHypo::hltFinalize(){ + // ---------------------------------------------------------------------- + + msg() << MSG::INFO << "in finalize()" << endreq; + return HLT::OK; +} + + +// ---------------------------------------------------------------------- +HLT::ErrorCode TrigEFPhotonHypo::hltExecute(const HLT::TriggerElement* outputTE, + bool& pass) { + // ---------------------------------------------------------------------- + + m_EgammaContainer = 0; + m_NofPassedCuts=-1; + + //counters for each cut + int Ncand[10]; + for(int i=0; i<10; i++) Ncand[i]=0; + Ncand[0]++; + + //isEM monitoring variables + for(unsigned int i=0;i<32;i++) m_NcandIsEM[i]=0; + for(unsigned int i=0;i<32;i++) m_NcandIsEMAfterCut[i]=0; + m_NofPassedCuts = 0; + m_NofPassedCutsIsEM = 0; + m_NofPassedCutsIsEMTrig = 0; + + //m_isEMTrig.clear(); //AT Aug2011: deactivate histogram egIsEM - outdated + + //Monitor the required isEM bits Before/After Cuts + for(unsigned int i=0;i<32;i++) m_IsEMRequiredBits[i]=0; + for(unsigned int i=0;i<32;i++) m_IsEMRequiredBitsAfterCut[i]=0; + + //Monitor the required isEM 32-Bit pattern Before Cuts + for(unsigned int i=0;i<32;++i) { //32-bit as it is in the Offline isEM for BitDefElecton and BitDefPhoton + m_IsEMRequiredBits[i]+= ((m_IsEMrequiredBits & (0x1<<i)) && 1); + } + + + + // Time total TrigEFPhotonHypo execution time. + // ------------------------------------- + if (timerSvc()) m_totalTimer->start(); + + if(msgLvl() <= MSG::DEBUG) + msg() << MSG::DEBUG << name() << ": in execute()" << endreq; + + if (m_acceptAll) { + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "AcceptAll property is set: taking all events" + << endreq; + pass = true; + return HLT::OK; + } + else { + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "AcceptAll property not set: applying selection" + << endreq; + } + + // get egamma objects from the trigger element: + //-------------------------------------------------- + // Use photon containers + std::vector<const xAOD::PhotonContainer*> vectorEgammaContainers; + + HLT::ErrorCode stat = getFeatures(outputTE, vectorEgammaContainers, ""); + + if (stat != HLT::OK ) { + msg() << MSG::WARNING + << " Failed to get xAOD::PhotonContainer's from the trigger element" + << endreq; + if (m_timersvc) m_totalTimer->stop(); + return HLT::OK; + } + + if(msgLvl() <= MSG::DEBUG) + msg() << MSG::DEBUG << "REGTEST: Got " << vectorEgammaContainers.size() + << " xAOD::PhotonContainers's associated to the TE " << endreq; + + if (vectorEgammaContainers.size() < 1) { + msg() << MSG::DEBUG + << " empty xAOD::PhotonContainer from the trigger element" + << endreq; + if (timerSvc()) m_totalTimer->stop(); + return HLT::OK; + } + + m_EgammaContainer = vectorEgammaContainers.back(); + + if(m_EgammaContainer == 0){ + if ( msgLvl() <= MSG::ERROR ) + msg() << MSG::ERROR + << " REGTEST: Retrieval of xOAD::PhotonContainer from vector failed" + << endreq; + if (timerSvc()) m_totalTimer->stop(); + return HLT::OK; + } + + // generate TrigPassBits mask to flag which egamma objects pass hypo cuts + TrigPassBits* passBits = HLT::makeTrigPassBits(m_EgammaContainer); + + + // adding TrigPassFlags for isEM bits + const unsigned int flagSize = 32; + + // temporarily disable the TrigPassFlags until xAOD format is sorted out + TrigPassFlags* isEMFlags = 0; //HLT::makeTrigPassFlags(m_EgammaContainer, flagSize); + + Ncand[1]++; + + //Something to do with old trigger cuts + //removed + //bool passed1=false; + for (const auto& egIt : *m_EgammaContainer){ + + //passed1 = false; + //------------------------------------------------------------- + //Apply cut on IsEM bit pattern re-running the Offline Builder + if( m_applyIsEM){ + unsigned int isEMTrig = 0; + + //LOW LUMI + //At low luminosity use the same cut algorithm as offline electrons + //BC 2012 changed from lumilevel variable to usePhotonCuts, to match offline changes. + //Only applies CaloCuts for Egamma Objects with AsgElectronIsEMSelector + if (!m_usePhotonCuts){ + if(msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << "Applying LOW Lumi Cuts on Photons" << endreq; + + // In order to force the tool to pick up the same cuts for Et>20 GeV, change the trigger threshold + double temp_EtThreshold=m_emEt; + if (temp_EtThreshold>20000) temp_EtThreshold=20000; + + //re-run the offline isEM for Electrons + if (m_egammaElectronCutIDTool == 0) { + msg() << MSG::ERROR << m_egammaElectronCutIDTool << " null, hypo continues but no isEM cut applied" << endreq; + }else{ + if (timerSvc()) m_timerPIDTool_Ele->start(); //timer + //Following method only performs CaloCuts and take Egamma (i.e. photons / electrons) object as input + // + if ( m_egammaElectronCutIDTool->execute(egIt,temp_EtThreshold).isFailure() ) { + if(msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG + << "problem with egammaElectronCutIDTool, egamma object not stored" + << endreq; + } + //AT jan 2010: get isEM value from m_egammaElectronCutIDTool->IsemValue(), not from (*egIt)->isem() + if(msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG <<" IsemValue() = "<< m_egammaElectronCutIDTool->IsemValue()<< endreq; + isEMTrig = m_egammaElectronCutIDTool->IsemValue(); + if(msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG + <<" isEMTrig = " + << std::hex << isEMTrig + << endreq; + if (timerSvc()) m_timerPIDTool_Ele->stop(); //timer + } + }//end of "LowLumi" + + //HIGH LUMI + //At high luminosity use the same cut algorithm as offline photon selection + else{ + if(msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << " Applying HIGH Lumi Cuts on Photons" << endreq; + // re-run the Offline isEM for Photons + if (m_egammaPhotonCutIDTool == 0) { + msg() << MSG::ERROR << m_egammaPhotonCutIDTool << " null, hypo continues but no isEM cut applied" << endreq; + }else{ + if (timerSvc()) m_timerPIDTool_Pho->start(); //timer + if ( m_egammaPhotonCutIDTool->execute(egIt, m_emEt).isFailure() ) { + if(msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG + << "problem with PID egammaPhotonCutIDTool, egamma object not stored" + << endreq; + } + // Get isEM value from m_egammaPhotonCutIDTool->IsemValue(), not from (*egIt)->isem() + if(msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG <<" IsemValue() = "<< m_egammaPhotonCutIDTool->IsemValue()<< endreq; + isEMTrig = m_egammaPhotonCutIDTool->IsemValue(); + if(msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG + <<" isEMTrig = " + << std::hex << isEMTrig + << endreq; + if (timerSvc()) m_timerPIDTool_Pho->stop(); //timer + } + }//end of "HighLumi" + //------------------------------------------------------------- + + //Monitor isEM + for(unsigned int i=0;i<32;++i) { //32-bit as it is in the Offline isEM for BitDefElecton and BitDefPhoton + m_NcandIsEM[i]+= ((isEMTrig & (0x1<<i)) && 1); + } + + // Set the isEM flag for this egamma object + if(isEMFlags) + HLT::setFlag(isEMFlags, egIt, m_EgammaContainer, HLT::AsFlag(isEMTrig, flagSize) ); + + + if( (isEMTrig & m_IsEMrequiredBits)!=0 ) { + if(msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << "REGTEST IsEM = " << std::hex << isEMTrig + << " cut not satisfied for pattern:" << std::hex << m_IsEMrequiredBits << endreq; + continue; + } + + //Monitor isEM After Cut + for(unsigned int i=0;i<32;++i) { //32-bit as it is in the Offline isEM for BitDefElecton and BitDefPhoton + m_NcandIsEMAfterCut[i]+= ((isEMTrig & (0x1<<i)) && 1); + } + + //Monitor the required isEM 32-Bit pattern After Cut + for(unsigned int i=0;i<32;++i) { //32-bit as it is in the Offline isEM for BitDefElecton and BitDefPhoton + m_IsEMRequiredBitsAfterCut[i]+= ((m_IsEMrequiredBits & (0x1<<i)) && 1); + } + + // Do not count on m_NofPassedCuts since this cut might be disabled + // m_NofPassedCuts++; + + }//end of if( m_applyIsEM) + Ncand[2]++; + + + Ncand[3]++; + + // + //other trigger specific cuts + // + + const xAOD::CaloCluster* clus = egIt->caloCluster(); + if(!clus) { + if(msgLvl() <= MSG::DEBUG) + msg() << MSG::DEBUG << "REGTEST no cluster pointer in egamma object " << endreq; + continue; + } + Ncand[4]++; + if( clus->et() < m_emEt) { + if(msgLvl() <= MSG::DEBUG) + msg() << MSG::DEBUG << "REGTEST Et cut no satisfied: "<< clus->et() << "< cut: " << m_emEt << endreq; + continue; + } + Ncand[5]++; + + + Ncand[6]++; + pass = true; + HLT::markPassing(passBits, egIt, m_EgammaContainer); // set bit for this egamma in TrigPassBits mask + } // end of loop in egamma objects. + + for(int i=0; i<10; i++) m_NofPassedCuts+=(Ncand[i]>0); + + + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "REGTEST: Result = " <<(pass ? "passed" : "failed")<< endreq; + } + + // store TrigPassBits result + if ( attachBits(outputTE, passBits) != HLT::OK ) { + msg() << MSG::ERROR << "Could not store TrigPassBits! " << endreq; + } + + // store TrigPassFlags result + if(isEMFlags) { + if ( attachFlags(outputTE, isEMFlags, "isEM") != HLT::OK ) { + msg() << MSG::ERROR << "Could not store isEM flags! " << endreq; + } + } + + // Time total TrigEFPhotonHypo execution time. + // ------------------------------------- + if (timerSvc()) m_totalTimer->stop(); + + return HLT::OK; +} + diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFTrackHypo.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFTrackHypo.cxx new file mode 100755 index 00000000000..09a763b3598 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigEFTrackHypo.cxx @@ -0,0 +1,248 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// ******************************************************************** +// +// NAME: TrigEFTrackHypo.cxx +// PACKAGE: Trigger/TrigHypothesis/TrigEgammaHypo +// +// AUTHOR: P. Conde Muino +// Performs the cuts on the ID variables. +// I.Grabowska-Bold, update Sept 2006 +// +// ******************************************************************** +// +#include <list> +#include <iterator> +#include <sstream> +// +#include "GaudiKernel/MsgStream.h" +#include "GaudiKernel/StatusCode.h" +#include "GaudiKernel/ListItem.h" +// +#include "TrigEgammaHypo/TrigEFTrackHypo.h" +// +#include "Particle/TrackParticleContainer.h" +#include "CLHEP/Units/SystemOfUnits.h" +#include "GaudiKernel/ITHistSvc.h" + +class ISvcLocator; + +template <class SRC> +inline const DataVector<Rec::TrackParticle>** dvec_cast(SRC** ptr) { + return (const DataVector<Rec::TrackParticle>**)(ptr); +} + + +///////////////////////////////////////////////////////////////////// +// CONSTRUCTOR: +///////////////////////////////////////////////////////////////////// +// +TrigEFTrackHypo::TrigEFTrackHypo(const std::string& name, ISvcLocator* pSvcLocator): + HLT::HypoAlgo(name, pSvcLocator), + m_acceptAll(true) +{ + declareProperty("AcceptAll", m_acceptAll); + declareProperty("ApplyTrackCut", m_applyTrackCut=false); + declareProperty("NumBLayerHits", m_numBLayerHits=0, "Number of B-layer hits required"); + declareProperty("NumPixelHits", m_numPixelHits=0, "Number of pixel hits required"); + declareProperty("NumSCTHits", m_numSCTHits=0, "Number of SCT htis required"); + declareProperty("NumTRTHits", m_numTRTHits=0, "Number of TRT hits required"); + declareProperty("TRTRatio", m_TRTRatio=0.0, "TRT high threshold hit ratio (min.)"); + declareProperty("Chi2", m_chi2=-1.0, "Maximum chi2 of the track fit"); + declareProperty("D0", m_d0=-1.0, "Maximum D0 (mm)"); + declareProperty("Pt", m_pt=0.0, "Minimum Pt (MeV)"); + declareProperty("NumTracks", m_numTracks=1, + "Number of tracks satisfying the selection"); + + declareMonitoredCollection("pt", *dvec_cast(&TrkParticleCont), &monPt); + declareMonitoredCollection("Phi",*dvec_cast(&TrkParticleCont), &monPhi); + declareMonitoredCollection("Eta",*dvec_cast(&TrkParticleCont), &monEta); + declareMonitoredCollection("d0", *dvec_cast(&TrkParticleCont), &mond0); + declareMonitoredCollection("z0", *dvec_cast(&TrkParticleCont), &monz0); + declareMonitoredVariable("numTrkPart",m_numTrkPart); +} + +///////////////////////////////////////////////////////////////////// +// DESTRUCTOR: +///////////////////////////////////////////////////////////////////// +// +TrigEFTrackHypo::~TrigEFTrackHypo() +{ } + +///////////////////////////////////////////////////////////////////// +// INITIALIZE: +// The initialize method will create all the required algorithm objects +// Note that it is NOT NECESSARY to run the initialize of individual +// sub-algorithms. The framework takes care of it. +///////////////////////////////////////////////////////////////////// +// +//---------------------------------- +// beginRun method: +//---------------------------------------------------------------------------- +HLT::ErrorCode TrigEFTrackHypo::hltBeginRun(){ + + msg() << MSG::INFO << "TrigEFTrackHypo::beginRun()" << endreq; + return HLT::OK; + +} +//---------------------------------------------------------------------------- + +// ---------------------------------------------------------------------- +HLT::ErrorCode TrigEFTrackHypo::hltInitialize() { +// ---------------------------------------------------------------------- + + msg() << MSG::INFO << "TrigEFTrackHypo initialize()" << endreq; + + msg() << MSG::INFO + << "Initialization of TrigEFTrackHypo completed successfully" + << endreq; + + return HLT::OK; +} + +// ---------------------------------------------------------------------- +HLT::ErrorCode TrigEFTrackHypo::hltFinalize() { +// ---------------------------------------------------------------------- + + msg() << MSG::INFO << "TrigEFTrackHypo finalize()" << endreq; + + return HLT::OK; +} + + +// ---------------------------------------------------------------------- +HLT::ErrorCode TrigEFTrackHypo::hltExecute(const HLT::TriggerElement* outputTE, bool& pass) { +// ---------------------------------------------------------------------- + + // default value, it will be set to true if selection satisfied + pass = false; + TrkParticleCont=0; + + int outputLevel = msgLvl(); + + if(outputLevel <= MSG::DEBUG) + msg() << MSG::DEBUG << name() << ": in execute()" << endreq; + + // AcceptAll property = true means selection cuts should not be applied + if (m_acceptAll){ + if(outputLevel <= MSG::DEBUG) + msg() << MSG::DEBUG << "AcceptAll property is set: taking all events" << endreq; + pass=true; + return HLT::OK; + } + else { + if(outputLevel <= MSG::DEBUG) + msg() << MSG::DEBUG << "AcceptAll property not set: applying selection" + << endreq; + } + + + // get Trk::Tracks's from the trigger element: + //-------------------------------------------------- + bool accepted=false; + + //const Rec::TrackParticleContainer* TrkParticleCont(0); + + if ( HLT::OK != getFeature(outputTE, TrkParticleCont) ) { + msg() << MSG::ERROR << "Failed to get TrackParticleContainer from the trigger element " << endreq; + return HLT::NAV_ERROR; + } + + if ( !TrkParticleCont ) { + msg() << MSG::DEBUG << "No TrackParticleContainer present" << endreq; + return HLT::OK; + } + + if(outputLevel <= MSG::DEBUG) + msg() << MSG::DEBUG << " REGTEST: Got " << TrkParticleCont->size() + << " TrackParticleContainer's associated to the TE " << endreq; + + m_numTrkPart=TrkParticleCont->size(); + + int ntracks=0; + for(Rec::TrackParticleContainer::const_iterator trkIt = TrkParticleCont->begin(); + trkIt != TrkParticleCont->end(); trkIt++){ + + // apply the cuts + // --------------- + + const Trk::TrackSummary* summary = (*trkIt)->trackSummary(); + + if(summary == 0){ + msg() << MSG::WARNING + << " Atention! There is a track with no summary information linked ! " << endreq; + } + if(summary == 0 ) continue; + + bool ok=true; + if (m_applyTrackCut) { + // int ncontrib_pixel = summary->get(Trk::numberOfContribPixelLayers); + int nblayer = summary->get(Trk::numberOfBLayerHits); + int npixel = summary->get(Trk::numberOfPixelHits); + int nsct = summary->get(Trk::numberOfSCTHits); + int ntrt = summary->get(Trk::numberOfTRTHits); + int ntrt_out = summary->get(Trk::numberOfTRTOutliers); + int ntrt_ht = summary->get(Trk::numberOfTRTHighThresholdHits); + int ntrt_ht_out = summary->get(Trk::numberOfTRTHighThresholdOutliers); + int ntrt_total = ntrt + ntrt_out; + float trtratio = 0.0; + if ( (ntrt+ntrt_out) > 0) { + trtratio = static_cast<float>(ntrt_ht+ntrt_ht_out)/(ntrt+ntrt_out); + } + float d0 = 0.0; + const Trk::Perigee* perigee = (*trkIt)->measuredPerigee(); + if (perigee) d0 = perigee->parameters()[Trk::d0]; + float pt = (*trkIt)->pt(); + + // if (summary->get(Trk::expectBLayerHit) && + // nblayer < m_numBLayerHits) ok = false; + if (nblayer < m_numBLayerHits) ok = false; + if (npixel < m_numPixelHits) ok = false; + if (nsct < m_numSCTHits) ok = false; + if (ntrt_total < m_numTRTHits) ok = false; + if (trtratio < m_TRTRatio) ok = false; + if (m_d0>0 && d0 > m_d0) ok = false; + if (pt < m_pt) ok = false; + } + + // msg() << MSG::DEBUG + // << "Track : N(B-layer)=" << nblayer + // << " N(B-layer)=" << nblayer + // << " N(pixel)=" << npixel + // << " N(SCT)=" << nsct + // << " N(TRT)=" << ntrt_total + // << " TRTratio=" << trtratio + // << " D0=" << d0 + // << " Pt=" << pt + // << endreq; + // --------------------------------------------------- + // At least one track passed cuts: accept the event: + // --------------------------------------------------- + + if (ok) ntracks ++; + + } // end of loop in tracks + + // msg() << MSG::DEBUG << "Number of tracks found: " << ntracks << endreq; + if (ntracks >= m_numTracks) accepted = true; + + if(accepted){ + + pass =true; + + if(outputLevel <= MSG::DEBUG) + msg() << MSG::DEBUG << " REGTEST: Event accepted ! " << endreq; + + } + else{ + if(outputLevel <= MSG::DEBUG) + msg() << MSG::DEBUG << " REGTEST: No track was found !! Event rejected " << endreq; + } + + // Time total TrigEFTrackHypo execution time. + // ------------------------------------- + + return HLT::OK; +} diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2CaloHypo.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2CaloHypo.cxx new file mode 100755 index 00000000000..a382a5df701 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2CaloHypo.cxx @@ -0,0 +1,408 @@ +// -*- C++ -*- + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/************************************************************************** + ** + ** File: Trigger/TrigHypothesis/TrigEammaHypo/TrigL2CaloHypo.cxx + ** + ** Description: Hypothesis algorithms to be run at Level 2 after T2Calo + ** + ** Authour: R.Goncalo <r.goncalo@rhul.ac.uk> Thu Jan 20 22:02:43 BST 2005 + ** + ** Created: Sat Mar 1 19:55:56 GMT 2005 + ** Modified: Eduardo J. Ortega <ortegaue@uregina.ca> Mon Mar 3 14:27:57 CST 2008 + ** Modified: Valerio Dao <valerio.dao@cern.ch> 12-10-2009 (added eta range cut+fixes) + ** + **************************************************************************/ + +#include "TrigEgammaHypo/TrigL2CaloHypo.h" + +#include<cmath> +#include "TrigSteeringEvent/TrigRoiDescriptor.h" +//#include "TrigCaloEvent/TrigEMCluster.h" +#include "xAODTrigCalo/TrigEMCluster.h" + +class ISvcLocator; + + +TrigL2CaloHypo::TrigL2CaloHypo(const std::string & name, ISvcLocator* pSvcLocator) + : HLT::HypoAlgo(name, pSvcLocator) +{ + // Read cuts - should probably get these from an xml file + declareProperty("AcceptAll", m_acceptAll=true); + declareProperty("EtaBins", m_etabin); + declareProperty("ETthr", m_eTthr); + declareProperty("ET2thr", m_eT2thr); + declareProperty("HADETthr", m_hadeTthr); + declareProperty("HADET2thr", m_hadeT2thr); + declareProperty("CARCOREthr", m_carcorethr); + declareProperty("CAERATIOthr", m_caeratiothr); + declareProperty("dETACLUSTERthr", m_detacluster=0.2); + declareProperty("dPHICLUSTERthr", m_dphicluster=0.2); + declareProperty("F1thr", m_F1thr); + declareProperty("WETA2thr", m_WETA2thr); + declareProperty("WSTOTthr", m_WSTOTthr); + declareProperty("F3thr", m_F3thr); + + // declare monitoring histograms for all cut variables + declareMonitoredVariable("dEta", dEta); + declareMonitoredVariable("dPhi", dPhi); + declareMonitoredVariable("Et_em", eT_T2Calo); + declareMonitoredVariable("Et_had", hadET_T2Calo); + declareMonitoredVariable("Rcore", rCore); + declareMonitoredVariable("Eratio", energyRatio); + declareMonitoredVariable("EtaBin", etaBin); + declareMonitoredVariable("Eta", monEta); + declareMonitoredVariable("Phi", monPhi); + declareMonitoredVariable("F1", F1); + declareMonitoredVariable("Weta2", Weta2); + declareMonitoredVariable("Wstot", Wstot); + declareMonitoredVariable("F3", Weta2); + declareMonitoredVariable("CutCounter", PassedCuts); +} + + +TrigL2CaloHypo::~TrigL2CaloHypo() +{ } + + +HLT::ErrorCode TrigL2CaloHypo::hltInitialize() +{ + if ( msgLvl() <= MSG::DEBUG ) { + msg() << MSG::DEBUG << "Initialization completed successfully" << endreq; + // default=True (for now...May06) + msg() << MSG::DEBUG << "AcceptAll = " + << (m_acceptAll==true ? "True" : "False") << endreq; + msg() << MSG::DEBUG << "EtaBins = " << m_etabin << endreq; + msg() << MSG::DEBUG << "ETthr = " + << m_eTthr << "(lo)/" << m_eT2thr << "(hi)" << endreq; + msg() << MSG::DEBUG << "HADETthr = " + << m_hadeTthr << "(lo)/" << m_hadeT2thr << "(hi)" << endreq; + msg() << MSG::DEBUG << "CARCOREthr = " << m_carcorethr << endreq; + msg() << MSG::DEBUG << "CAERATIOthr = " << m_caeratiothr << endreq; + msg() << MSG::DEBUG << "dPHICLUSTERthr = " << m_dphicluster << endreq; + msg() << MSG::DEBUG << "dETACLUSTERthr = " << m_detacluster << endreq; + msg() << MSG::DEBUG << "WETA2thr = " << m_WETA2thr << endreq; + msg() << MSG::DEBUG << "WSTOTthr = " << m_WSTOTthr << endreq; + msg() << MSG::DEBUG << "F3thr = " << m_F3thr << endreq; + + } + + unsigned int nEtaBin=m_etabin.size(); + if ( m_eTthr.size() != nEtaBin-1 ) { + msg() << MSG::ERROR << " etThr size is " << m_eTthr.size() << " but needs " << nEtaBin-1 << endreq; + return StatusCode::FAILURE; + } + + if ( m_eT2thr.size() != nEtaBin-1 ) { + msg() << MSG::ERROR << " et2Thr size is " << m_eT2thr.size() << " but needs " << nEtaBin-1 << endreq; + return StatusCode::FAILURE; + } + + if ( m_hadeTthr.size() != nEtaBin-1 ) { + msg() << MSG::ERROR << " hadetThr size is " << m_hadeTthr.size() << " but needs " << nEtaBin-1 << endreq; + return StatusCode::FAILURE; + } + + if ( m_hadeT2thr.size() != nEtaBin-1 ) { + msg() << MSG::ERROR << " hadet2Thr size is " << m_hadeT2thr.size() << " but needs " << nEtaBin-1 << endreq; + return StatusCode::FAILURE; + } + + if ( m_carcorethr.size() != nEtaBin-1 ) { + msg() << MSG::ERROR << " carcore size is " << m_carcorethr.size() << " but needs " << nEtaBin-1 << endreq; + return StatusCode::FAILURE; + } + + if ( m_caeratiothr.size() != nEtaBin-1 ) { + msg() << MSG::ERROR << " caeratio size is " << m_caeratiothr.size() << " but needs " << nEtaBin-1 << endreq; + return StatusCode::FAILURE; + } + + if ( m_WETA2thr.size() != nEtaBin-1 ) { + msg() << MSG::ERROR << " Weta2 size is " << m_WETA2thr.size() << " but needs " << nEtaBin-1 << endreq; + return StatusCode::FAILURE; + } + + if ( m_WSTOTthr.size() != nEtaBin-1 ) { + msg() << MSG::ERROR << " Wstot size is " << m_WSTOTthr.size() << " but needs " << nEtaBin-1 << endreq; + return StatusCode::FAILURE; + } + + if ( m_F3thr.size() != nEtaBin-1 ) { + msg() << MSG::ERROR << " Wstot size is " << m_WSTOTthr.size() << " but needs " << nEtaBin-1 << endreq; + return StatusCode::FAILURE; + } + + return HLT::OK; +} + +HLT::ErrorCode TrigL2CaloHypo::hltFinalize() +{ + if ( msgLvl() <= MSG::INFO ) + msg() << MSG::INFO << "In TrigL2CaloHypo::finalize()" << endreq; + + return HLT::OK; +} + + +HLT::ErrorCode TrigL2CaloHypo::hltExecute(const HLT::TriggerElement* outputTE, bool& pass) +{ + + // initialise monitoring variables for each event + dPhi = -1.0; + dEta = -1.0; + eT_T2Calo = -1.0; + hadET_T2Calo = -1.0; + rCore = -1.0; + energyRatio = -1.0; + Weta2 = -1.0; + Wstot = -1.0; + F3 = -1.0; + PassedCuts = -1; + // Accept-All mode: temporary patch; should be done with force-accept + if (m_acceptAll) { + pass = true; + if ( msgLvl() <= MSG::DEBUG ) { + msg() << MSG::DEBUG << "AcceptAll property is set: taking all events" + << endreq; + } + return HLT::OK; + } else { + pass = false; + if ( msgLvl() <= MSG::DEBUG ) { + msg() << MSG::DEBUG << "AcceptAll property not set: applying selection" + << endreq; + } + } + + ///////////// get RoI descriptor /////////////////////////////////////////////////////// + const TrigRoiDescriptor* roiDescriptor = 0; + HLT::ErrorCode stat = getFeature(outputTE, roiDescriptor) ; + + if (stat != HLT::OK) { + if ( msgLvl() <= MSG::WARNING) { + msg() << MSG::WARNING << "No RoI for this Trigger Element! " << endreq; + } + return stat; + } + + if ( msgLvl() <= MSG::DEBUG ){ + msg() << MSG::DEBUG + << "Using outputTE("<< outputTE <<")->getId(): " << outputTE->getId() + << "; RoI ID = " << roiDescriptor->roiId() + << ": Eta = " << roiDescriptor->eta() + << ", Phi = " << roiDescriptor->phi() + << endreq; + } + + // fill local variables for RoI reference position + double etaRef = roiDescriptor->eta(); + double phiRef = roiDescriptor->phi(); + // correct phi the to right range (probably not needed anymore) + if ( fabs(phiRef) > M_PI ) phiRef -= 2*M_PI; // correct phi if outside range + + // retrieve TrigEMCluster from the TE: must retrieve vector first + std::vector< const xAOD::TrigEMCluster* > vectorOfClusters; + stat = getFeatures( outputTE, vectorOfClusters ); + + if ( stat != HLT::OK ) { + if ( msgLvl() <= MSG::WARNING) + msg() << MSG::WARNING << "Failed to get TrigEMClusters" << endreq; + + return HLT::OK; + } + + if ( msgLvl() <= MSG::DEBUG ) { + msg() << MSG::DEBUG << "Found vector with " << vectorOfClusters.size() + << " TrigEMClusters" << endreq; + } + + // should be only 1 cluster, normally! + if (vectorOfClusters.size() != 1) { + msg() << MSG::DEBUG << "Size of vector of TrigEMClusters is not 1!" + << endreq; + return HLT::OK; + } + + // get cluster + const xAOD::TrigEMCluster* pClus = vectorOfClusters.front(); + + if ( !pClus ) { + msg() << MSG::WARNING << "No EM cluster in RoI" << endreq; + return HLT::OK; + } + + // increment event counter + PassedCuts++; //// the ROI at least contais the cluster + + float absEta = fabs( pClus->eta() ); + etaBin = -1; + monEta = pClus->eta(); + monPhi = pClus->phi(); + for (std::size_t iBin = 0; iBin < m_etabin.size()-1; iBin++) + if ( absEta > m_etabin[iBin] && absEta < m_etabin[iBin+1] ) etaBin = iBin; + + // find if electron is in calorimeter crack + bool inCrack = ( absEta > 2.37 || ( absEta > 1.37 && absEta < 1.52) ); + + + dEta = pClus->eta() - etaRef; + // Deal with angle diferences greater than Pi + dPhi = fabs(pClus->phi() - phiRef); + dPhi = (dPhi < M_PI ? dPhi : 2*M_PI - dPhi ); + + + // calculate cluster quantities // definition taken from TrigElectron constructor + if ( pClus->emaxs1() + pClus->e2tsts1() > 0 ) + energyRatio = ( pClus->emaxs1() - pClus->e2tsts1() ) / ( pClus->emaxs1() + pClus->e2tsts1() ); + + // (VD) here the definition is a bit different to account for the cut of e277 @ EF + if ( pClus->e277()!= 0.) rCore = pClus->e237() / pClus->e277(); + + //fraction of energy deposited in 1st sampling + if ( fabs(pClus->energy()) > 0.00001) F1 = (pClus->energy(CaloSampling::EMB1)+pClus->energy(CaloSampling::EME1))/pClus->energy(); + + eT_T2Calo = pClus->et(); + + if ( eT_T2Calo!=0 && pClus->eta()!=0 ) hadET_T2Calo = pClus->ehad1()/cosh(fabs(pClus->eta()))/eT_T2Calo; + + + //extract Weta2 varable + Weta2 = pClus->weta2(); + + //extract Wstot varable + Wstot = pClus->wstot(); + + //extract F3 (backenergy i EM calorimeter + float e0 = pClus->energy(CaloSampling::PreSamplerB) + pClus->energy(CaloSampling::PreSamplerE); + float e1 = pClus->energy(CaloSampling::EMB1) + pClus->energy(CaloSampling::EME1); + float e2 = pClus->energy(CaloSampling::EMB2) + pClus->energy(CaloSampling::EME2); + float e3 = pClus->energy(CaloSampling::EMB3) + pClus->energy(CaloSampling::EME3); + float eallsamples = e0+e1+e2+e3; + F3= fabs(eallsamples)>0. ? e3/eallsamples : 0.; + + // apply cuts: DeltaEta(clus-ROI) + if ( msgLvl() <= MSG::DEBUG ) { + msg() << MSG::DEBUG << "TrigEMCluster: eta=" << pClus->eta() + << " roi eta=" << etaRef << " DeltaEta=" << dEta + << " cut: <" << m_detacluster << endreq; + } + if ( fabs(pClus->eta() - etaRef) > m_detacluster ) return HLT::OK; + PassedCuts++; + + // DeltaPhi(clus-ROI) + if ( msgLvl() <= MSG::DEBUG ) { + msg() << MSG::DEBUG << ": phi=" << pClus->phi() + << " roi phi="<< phiRef << " DeltaPhi="<< dPhi + << " cut: <" << m_dphicluster << endreq; + } + if( dPhi > m_dphicluster ) return HLT::OK; + PassedCuts++; + + // eta range + if ( etaBin==-1 ) { // VD + msg() << MSG::DEBUG << "Cluster eta: " << absEta << " outside eta range " << m_etabin[m_etabin.size()-1] << endreq; + return HLT::OK; + } else { + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "eta bin used for cuts " << etaBin << endreq; + } + PassedCuts++; // passed eta cut + + // Rcore + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "TrigEMCluster: Rcore=" << rCore + << " cut: >" << m_carcorethr[etaBin] << endreq; + if ( rCore < m_carcorethr[etaBin] ) return HLT::OK; + PassedCuts++; + + // Eratio + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "TrigEMCluster: Eratio=" << energyRatio + << " cut: >" << m_caeratiothr[etaBin] << endreq; + if ( inCrack || F1<m_F1thr[0] ) { + msg() << MSG::DEBUG << "TrigEMCluster: InCrack= " << inCrack << " F1=" << F1 << endreq; + } else { + if ( energyRatio < m_caeratiothr[etaBin] ) return HLT::OK; + } + PassedCuts++; + if(inCrack) energyRatio = -1; //Set default value in crack for monitoring. + + // ET_em + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "TrigEMCluster: ET_em=" << eT_T2Calo + << " cut: >" << m_eTthr[etaBin] << endreq; + if ( eT_T2Calo < m_eTthr[etaBin]) return HLT::OK; + PassedCuts++; + + float hadET_cut = 0.0; + // find which ET_had to apply : this depends on the ET_em and the eta bin + if ( eT_T2Calo > m_eT2thr[etaBin] ) { + hadET_cut = m_hadeT2thr[etaBin] ; + + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "ET_em>" << m_eT2thr[etaBin] + << ": use high ET_had cut: <" << hadET_cut << endreq; + } else { + hadET_cut = m_hadeTthr[etaBin]; + + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "ET_em<" << m_eT2thr[etaBin] + << ": use low ET_had cut: <" << hadET_cut << endreq; + } + + // ET_had + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "TrigEMCluster: ET_had=" << hadET_T2Calo + << " cut: <" << hadET_cut << endreq; + + if ( hadET_T2Calo > hadET_cut ) return HLT::OK; + PassedCuts++; + + // F1 + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "TrigEMCluster: F1=" << F1 + << " cut: >" << m_F1thr[0] << endreq; + // if ( F1 < m_F1thr[0]) return HLT::OK; //(VD) not cutting on this variable, only used to select whether to cut or not on eRatio + PassedCuts++; + + + //Weta2 + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "TrigEMCluster: Weta2=" << Weta2 + << " cut: <" << m_WETA2thr[etaBin] << endreq; + if ( Weta2 > m_WETA2thr[etaBin]) return HLT::OK; + PassedCuts++; + + + //Wstot + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "TrigEMCluster: Wstot=" << Wstot + << " cut: <" << m_WSTOTthr[etaBin] << endreq; + if ( Wstot >= m_WSTOTthr[etaBin]) return HLT::OK; + PassedCuts++; + + //F3 + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "TrigEMCluster: F3=" << F3 + << " cut: <" << m_F3thr[etaBin] << endreq; + if ( F3 > m_F3thr[etaBin]) return HLT::OK; + PassedCuts++; + + + // got this far => passed! + pass = true; + + // Reach this point successfully + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "pass = " << pass << endreq; + + // (VD) this is quite obvious - it would be better to be able to arrive here eve if fails and see the line FAIL! + + return HLT::OK; +} + diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2CaloLayersHypo.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2CaloLayersHypo.cxx new file mode 100755 index 00000000000..b9f6aef4346 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2CaloLayersHypo.cxx @@ -0,0 +1,192 @@ +// -*- C++ -*- + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/************************************************************************** + ** + ** File: Trigger/TrigHypothesis/TrigEammaHypo/TrigL2CaloLayersHypo.cxx + ** + ** Description: Hypothesis algorithms to be run at Level 2 after T2Calo + ** + ** Authour: Denis Oliveira Damazio + ** + ** Created: Sep 06 2010 + ** + **************************************************************************/ + +#include "TrigEgammaHypo/TrigL2CaloLayersHypo.h" + +#include<cmath> +#include "TrigSteeringEvent/TrigRoiDescriptor.h" +//#include "TrigCaloEvent/TrigEMCluster.h" +#include "xAODTrigCalo/TrigEMCluster.h" + +class ISvcLocator; + + +TrigL2CaloLayersHypo::TrigL2CaloLayersHypo(const std::string & name, ISvcLocator* pSvcLocator) + : HLT::HypoAlgo(name, pSvcLocator) +{ + // Read cuts - should probably get these from an xml file + declareProperty("AcceptAll", m_acceptAll=true); + declareProperty("EnergyFractionCut", m_EnergyFracCut); + declareProperty("AbsoluteEnergyCut", m_EnergyAbsCut); + + // declare monitoring histograms for all cut variables + declareMonitoredVariable("Eta", monEta); + declareMonitoredVariable("Phi", monPhi); + declareMonitoredVariable("Energy",m_Energy); + declareMonitoredVariable("PreSampler_Energy",m_preSamp); + declareMonitoredVariable("PreSampler_fracEnergy",m_preSampFrac); + declareMonitoredVariable("CutCounter", PassedCuts); + m_EnergyAbsCut.clear(); + m_EnergyFracCut.clear(); + for(int i=0;i<4;i++){ + m_EnergyAbsCut.push_back(999999.0); + m_EnergyFracCut.push_back(1.0); + } +} + + +TrigL2CaloLayersHypo::~TrigL2CaloLayersHypo() +{ } + + +HLT::ErrorCode TrigL2CaloLayersHypo::hltInitialize() +{ + if ( msgLvl() <= MSG::DEBUG ) { + msg() << MSG::DEBUG << "Initialization completed successfully" << endreq; + msg() << MSG::DEBUG << "AcceptAll = " + << (m_acceptAll==true ? "True" : "False") << endreq; + msg() << MSG::DEBUG << "EnergyFractionCut per layer = " + << m_EnergyFracCut << endreq; + msg() << MSG::DEBUG << "AbsoluteEnergyCut per layer = " + << m_EnergyAbsCut << endreq; + } + + if ( m_EnergyFracCut.size() != 4 ) { + msg() << MSG::ERROR << " EnergyFracCut size is " << m_EnergyFracCut.size() << " but needs 4" << endreq; + return StatusCode::FAILURE; + } + + if ( m_EnergyAbsCut.size() != 4 ) { + msg() << MSG::ERROR << " EnergyAbsCut size is " << m_EnergyAbsCut.size() << " but needs 4" << endreq; + return StatusCode::FAILURE; + } + + return HLT::OK; +} + +HLT::ErrorCode TrigL2CaloLayersHypo::hltFinalize() +{ + if ( msgLvl() <= MSG::INFO ) + msg() << MSG::INFO << "In TrigL2CaloLayersHypo::finalize()" << endreq; + + return HLT::OK; +} + + +HLT::ErrorCode TrigL2CaloLayersHypo::hltExecute(const HLT::TriggerElement* outputTE, bool& pass) +{ + + // Accept-All mode: temporary patch; should be done with force-accept + if (m_acceptAll) { + pass = true; + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "AcceptAll property is set: taking all events" + << endreq; + return HLT::OK; + } else { + pass = false; + if ( msgLvl() <= MSG::DEBUG ) { + msg() << MSG::DEBUG << "AcceptAll property not set: applying selection" + << endreq; + } + } + + ///////////// get RoI descriptor /////////////////////////////////////////////////////// + const TrigRoiDescriptor* roiDescriptor = 0; + HLT::ErrorCode stat = getFeature(outputTE, roiDescriptor) ; + + if (stat != HLT::OK) { + if ( msgLvl() <= MSG::WARNING) { + msg() << MSG::WARNING << "No RoI for this Trigger Element! " << endreq; + } + return stat; + } + + if ( msgLvl() <= MSG::DEBUG ){ + msg() << MSG::DEBUG + << "Using outputTE("<< outputTE <<")->getId(): " << outputTE->getId() + << "; RoI ID = " << roiDescriptor->roiId() + << ": Eta = " << roiDescriptor->eta() + << ", Phi = " << roiDescriptor->phi() + << endreq; + } + + // fill local variables for RoI reference position + + // retrieve TrigEMCluster from the TE: must retrieve vector first + std::vector< const xAOD::TrigEMCluster* > vectorOfClusters; + stat = getFeatures( outputTE, vectorOfClusters ); + + if ( stat != HLT::OK ) { + if ( msgLvl() <= MSG::WARNING) + msg() << MSG::WARNING << "Failed to get TrigEMClusters" << endreq; + + return HLT::OK; + } + + if ( msgLvl() <= MSG::DEBUG ) { + msg() << MSG::DEBUG << "Found vector with " << vectorOfClusters.size() + << " TrigEMClusters" << endreq; + } + + // should be only 1 cluster, normally! + if (vectorOfClusters.size() != 1) { + msg() << MSG::DEBUG << "Size of vector of TrigEMClusters is not 1!" + << endreq; + return HLT::OK; + } + + // get cluster + const xAOD::TrigEMCluster* pClus = vectorOfClusters.front(); + m_preSampFrac=m_preSamp=monEta=monPhi=m_Energy=-9999.0; + + if ( !pClus && (pClus->energy()>0.1) && (fabsf(pClus->eta())<2.1) ) { + msg() << MSG::WARNING << "No EM cluster in RoI" << endreq; + return HLT::OK; + } + monEta = pClus->eta(); + monPhi = pClus->phi(); + + // increment event counter + PassedCuts++; //// the ROI at least contais the cluster + + std::vector<double> fracs; + for(int i=0;i<4;i++){ + fracs.push_back(0); + fracs[i] = (pClus->energy( ((CaloSampling::CaloSample)i) )+pClus->energy( ((CaloSampling::CaloSample)(i+4)) ))/pClus->energy(); + } + m_Energy = pClus->energy(); + + if ( fracs[0] > m_EnergyFracCut[0] ) return HLT::OK; + PassedCuts++; //// + m_preSampFrac = fracs[0]; + + if ( (pClus->energy( ((CaloSampling::CaloSample)0) ) + pClus->energy( ((CaloSampling::CaloSample)4) ) ) > m_EnergyAbsCut[0] ) return HLT::OK; + PassedCuts++; //// + m_preSamp = (fracs[0])*pClus->energy(); + + // got this far => passed! + pass = true; + + // Reach this point successfully + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "pass = " << pass << endreq; + + return HLT::OK; +} + diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2DielectronMassFex.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2DielectronMassFex.cxx new file mode 100755 index 00000000000..9f0384ed86e --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2DielectronMassFex.cxx @@ -0,0 +1,531 @@ +// -*- C++ -*- + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/************************************************************************** + ** + ** File: Trigger/TrigHypothesis/TrigEgammaHypo/TrigL2DielectronMassFex.h + ** + ** Description: - Hypothesis algorithm: searc for electron pairs with + ** invariant mass in some interval; intended for Z->ee + ** - Modified from TrigL2DimuonMassFex by C.Schiavi + ** + ** Author: R.Goncalo <r.goncalo@rhul.ac.uk> + ** + ** Created: Aug 13 2006 + ** Modified: Jan 19 2007 Valeria Perez Reale Adapted to New Steering + ** Modified: Apr 28 2007 Tomasz Bold major changes to run with new steering + ** Modified: May 25 2011 Toyonobu Okuyama major change to attach the calculated + ** invariant mass to outputTE as TrigOperationalInfo + **************************************************************************/ + +#include "TrigSteeringEvent/TrigRoiDescriptor.h" +#include "TrigSteeringEvent/TrigOperationalInfo.h" + +#include "TrigEgammaHypo/TrigL2DielectronMassFex.h" +#include "CxxUtils/sincos.h" + +#include <math.h> +#include <cstdio> + +TrigL2DielectronMassFex::TrigL2DielectronMassFex(const std::string & name, ISvcLocator* pSvcLocator) + : HLT::ComboAlgo(name, pSvcLocator) { + + // use cluster mode + declareProperty("UseClusterAsProbe", m_useClusterAsProbe=true); + + // electron mass definition + declareProperty("ElectronMass", m_electronMass=0.511); + + // Read cuts + declareProperty("AcceptAll", m_acceptAll); + declareProperty("SameTrackAlgo",m_sameTrackAlgo=true); + declareProperty("OppositeSign", m_oppositeCharge=true); + declareProperty("CommonVertex", m_commonVertex=true); + declareProperty("ValidElectron",m_electronValid=true); + declareProperty("LowerMassCut", m_lowerMassCut=1000.0);//! for J/psi + declareProperty("UpperMassCut", m_upperMassCut=15000.0);//! for J/psi + + + // monitoring + declareMonitoredVariable("massOfAccepted", m_monMassAccepted); + declareMonitoredVariable("cut", m_monCut); +} + +TrigL2DielectronMassFex::~TrigL2DielectronMassFex() +{ } + +HLT::ErrorCode TrigL2DielectronMassFex::hltInitialize() +{ + + if (msgLvl() <= MSG::VERBOSE) { + msg() << MSG::DEBUG << "Initialization:" << endreq; + } + + + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Initialization completed successfully:" << endreq; + msg() << MSG::DEBUG << "AcceptAll = " + << (m_acceptAll==true ? "True" : "False") << endreq; + msg() << MSG::DEBUG << "UseClusterAsProbe = " + << (m_useClusterAsProbe==true ? "True" : "False") << endreq; + msg() << MSG::DEBUG << "ElectronMass = " << m_electronMass << endreq; + msg() << MSG::DEBUG << "ValidElectron = " + << (m_electronValid==true ? "True" : "False") << endreq; + msg() << MSG::DEBUG << "SameTrackAlgo = " + << (m_sameTrackAlgo==true ? "True" : "False") << endreq; + msg() << MSG::DEBUG << "OppositeCharge = " + << (m_oppositeCharge==true ? "True" : "False") << endreq; + msg() << MSG::DEBUG << "CommonVertex = " + << (m_commonVertex==true ? "True" : "False") << endreq; + msg() << MSG::DEBUG << "LowerMassCut = " << m_lowerMassCut << endreq; + msg() << MSG::DEBUG << "UpperMassCut = " << m_upperMassCut << endreq; + } + + return HLT::OK; +} + + +HLT::ErrorCode TrigL2DielectronMassFex::hltFinalize() +{ + if ( msgLvl() <= MSG::INFO ) + msg() << MSG::INFO << "in finalize()" << endreq; + + return HLT::OK; +} + + +HLT::ErrorCode TrigL2DielectronMassFex::acceptInputs(HLT::TEConstVec& inputTE, bool& pass ) { + m_massCont.clear(); + m_monMassAccepted = -1.; + m_monCut=0; + // sanity checks + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "Running TrigL2DielectronMassFex::acceptInputs" << endreq; + + if ( inputTE.size() != 2 ) { + msg() << MSG::ERROR << "Got diferent than 2 number of input TEs: " << inputTE.size() << " job badly configured" << endreq; + return HLT::BAD_JOB_SETUP; + } + + + + // Accept-All mode: temporary patch; should be done with force-accept + if (m_acceptAll) { + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "AcceptAll property is set: taking all events" + << endreq; + + pass = true; + return HLT::OK; + } + else { + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "AcceptAll property not set: applying selection" + << endreq; + } + + // this are 2 TEs which we eventually will combine + const HLT::TriggerElement* te1 = inputTE[0]; + const HLT::TriggerElement* te2 = inputTE[1]; + + // for debugging purpose look into RoIDescriptors + if ( msgLvl() <= MSG::DEBUG ){ + const TrigRoiDescriptor* roiDescriptor1 = 0; + const TrigRoiDescriptor* roiDescriptor2 = 0; + if ( getFeature(te1, roiDescriptor1) != HLT::OK || getFeature(te2, roiDescriptor2) != HLT::OK ) { + if ( msgLvl() <= MSG::WARNING) { + msg() << MSG::WARNING << "No RoIDescriptors for this Trigger Elements! " << endreq; + } + } else { + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "Trying to combine 2 RoIs: " << *roiDescriptor1 << " & " << *roiDescriptor2 << endreq; + } + } + + // retrieve TrigElectronContainers(orTrigEMCluster) from this TE + const xAOD::TrigElectronContainer* electronContainer1(0); + const xAOD::TrigElectronContainer* electronContainer2(0); + const xAOD::TrigEMCluster* cluster2(0);//! index "2" means this container is used for probe + if( m_useClusterAsProbe) { + if ( getFeature(te1, electronContainer1) != HLT::OK || getFeature(te2, cluster2) != HLT::OK || + electronContainer1 == 0 || cluster2 == 0 ) { + if ( msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Failed to get TrigElectron or TrigEMCluster collections" << endreq; + } + return HLT::MISSING_FEATURE; + } + } else if ( getFeature(te1, electronContainer1) != HLT::OK || getFeature(te2, electronContainer2) != HLT::OK || + electronContainer1 == 0 || electronContainer2 == 0 ) { + if ( msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Failed to get TrigElectron collections" << endreq; + } + return HLT::MISSING_FEATURE; + } + + + pass=false; + + // now we have 2 bunches of electrons and we need to find out whether they can form topological combination + // loop ver all combinations + xAOD::TrigElectronContainer::const_iterator electron1; + xAOD::TrigElectronContainer::const_iterator electron2; + + if( m_useClusterAsProbe ) { + // Use Cluster Mode (TrigElectron - TrigEMCluster) + //================================================== + for ( electron1 = electronContainer1->begin(); electron1 != electronContainer1->end(); ++electron1 ) { + m_monCut = 5; + // evaluate mass + double mass = TrigL2DielectronMassHelpers::invariantMass((*electron1), cluster2, m_electronMass); + + // apply cut on mass + if(mass<m_lowerMassCut || mass>m_upperMassCut) { + if(msgLvl() <= MSG::VERBOSE) { + msg() << MSG::VERBOSE << "Combination failed mass cut: " + << mass << " not in [" << m_lowerMassCut << "," + << m_upperMassCut << "]" << endreq; + } + continue; + } else { + // good combination found + pass = true; + m_monCut = 6; + m_monMassAccepted = mass; + m_massCont.push_back(mass); + if(msgLvl() <= MSG::VERBOSE) { + msg() << MSG::VERBOSE << "Combination passed mass cut: " + << m_lowerMassCut << " < " << mass << " < " + << m_upperMassCut << endreq; + msg() << MSG::DEBUG << "Good combination found! Mee=" + << mass << " MeV" << endreq; + } + } + } + } else { + // Normal Mode (TrigElectron - TrigElectron) + //================================================== + for ( electron1 = electronContainer1->begin(); electron1 != electronContainer1->end(); ++electron1 ) { + for ( electron2 = electronContainer2->begin(); electron2 != electronContainer2->end(); ++electron2 ) { + m_monCut = 1; + // selection is done here + // + // debug dump (both electrons have tracks now) + + if(msgLvl() <= MSG::VERBOSE) { + msg() << MSG::VERBOSE << "New combination:" << endreq; + msg() << MSG::VERBOSE << "1st TrigElectron " + //<< ((*electron1)->isValid() ? "(valid" : "(not valid") + << ") RoI id="<< (*electron1)->roiWord() + << "; pt=" << (*electron1)->pt() + << "; eta=" << (*electron1)->eta()// <<"+-"<< (*electron1)->err_eta() + << "; phi=" << (*electron1)->phi()// <<"+-"<< (*electron1)->err_phi() +// << "; Zvtx=" << (*electron1)->Zvtx()<<"+-"<< (*electron1)->err_Zvtx() + << endreq; + msg() << MSG::VERBOSE << "2nd TrigElectron " + //<< ((*electron1)->isValid() ? "(valid" : "(not valid") + << ") RoI id="<< (*electron2)->roiWord() + << "; pt=" << (*electron2)->pt() + << "; eta=" << (*electron2)->eta()// <<"+-"<< (*electron2)->err_eta() + << "; phi=" << (*electron2)->phi()// <<"+-"<< (*electron2)->err_phi() +// << "; Zvtx=" << (*electron2)->Zvtx()<<"+-"<< (*electron2)->err_Zvtx() + << endreq; + } + + // check we're starting from valid TrigElectrons (i.e. which + // passed all cuts) + if (m_electronValid) { + + if ( ! TrigL2DielectronMassHelpers::validElectrons(*electron1, *electron2) ) { + + if(msgLvl() <= MSG::VERBOSE) { + msg() << MSG::VERBOSE << "One TrigElectron not valid: rejecting combination" << endreq; + } + continue; // reject non-valid TrigElectrons if cut is on + } + } + m_monCut = 2; + // tracking algorithm (sensible to separate things for now so + // that efficiency can be easily measured for each tracking algo) + if (m_sameTrackAlgo) { + +#ifdef DONTDO + if ( (*electron1)->trackAlgo() != (*electron2)->trackAlgo() ) { + + if(msgLvl() <= MSG::VERBOSE) { + msg() << MSG::VERBOSE + << "TrigElectrons from different tracking algos: ignoring combination" << endreq; + } + } else { + if(msgLvl() <= MSG::VERBOSE) { + msg() << MSG::VERBOSE << "TrigElectrons from same tracking algo" + << endreq; + } + } +#endif + } + + + m_monCut = 3; + // check charge: track pT is signed according to charge but not electron pT + // should study how well charge can actually be estimated for high-pT tracks... + if( m_oppositeCharge ) { + + // note: track charge can be zero (unknown) so must use > and not >= + if ( ! TrigL2DielectronMassHelpers::opositeCharge(*electron1, *electron2) ) { + if(msgLvl() <= MSG::VERBOSE) { + msg() << MSG::VERBOSE << "Combination failed opposite charge cut" << endreq; + } + continue; + } else { + if(msgLvl() <= MSG::VERBOSE) { + msg() << MSG::VERBOSE << "Combination passed opposite charge cut" + << endreq; + } + } + } + m_monCut = 4; + + + // check vertex position: two electrons should come from common + // vertex check only Z of vertex, and only ef Z error is not zero + // take track z at perigee as estimate of vertex z, since lateral + // coordinates are small this should be done better with a vertexing + // algorithm... + if( m_commonVertex ) { + + const TrigL2DielectronMassHelpers::Vertex vx = TrigL2DielectronMassHelpers::commonVertex(*electron1, *electron2); + + if ( vx == TrigL2DielectronMassHelpers::NotCommon ) { + if (msgLvl() <= MSG::VERBOSE) { + msg() << MSG::VERBOSE + << "Combination failed vertex cut" + << endreq; + } + + continue; + } else if ( vx == TrigL2DielectronMassHelpers::Common ) { + if (msgLvl() <= MSG::VERBOSE) { + msg() << MSG::VERBOSE + << "Combination passed vertex cut" << endreq; + } + } else { + if(msgLvl() <= MSG::VERBOSE) { + msg() << MSG::VERBOSE + << "Bad track vertex errors: not applying cut" << endreq; + } + } + } + m_monCut = 5; + // evaluate mass + double mass = TrigL2DielectronMassHelpers::invariantMass((*electron1),(*electron2), m_electronMass); + + // apply cut on mass + if(mass<m_lowerMassCut || mass>m_upperMassCut) { + if(msgLvl() <= MSG::VERBOSE) { + msg() << MSG::VERBOSE << "Combination failed mass cut: " + << mass << " not in [" << m_lowerMassCut << "," + << m_upperMassCut << "]" << endreq; + } + continue; + } else { + // good combination found + pass = true; + m_monCut = 6; + m_monMassAccepted = mass; + m_massCont.push_back(mass); + if(msgLvl() <= MSG::VERBOSE) { + msg() << MSG::VERBOSE << "Combination passed mass cut: " + << m_lowerMassCut << " < " << mass << " < " + << m_upperMassCut << endreq; + } else if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Good combination found! Mee=" + << mass << " MeV" << endreq; + } + } + } // electrons2 container loop end + } // electrons1 container loop end + } + + // set output TriggerElement true if good combination + if(msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << "pass = " << pass << endreq; + return HLT::OK; +} + +HLT::ErrorCode TrigL2DielectronMassFex::hltExecute(HLT::TEConstVec& /*inputTE*/, HLT::TriggerElement* outputTE){ + msg() << MSG::DEBUG << "N mass accepted : " << m_massCont.size() << endreq; + TrigOperationalInfo* trigInfo = new TrigOperationalInfo(); + for(size_t i=0; i<m_massCont.size(); ++i) { + char buf[64]; + std::sprintf(buf, "mass%d", (int)i); + msg() << MSG::DEBUG << " " << buf << " : " << m_massCont[i] << endreq; + trigInfo->set(std::string(buf), m_massCont[i]); + } + attachFeature(outputTE, trigInfo, "L2DielectronInfo"); + msg() << MSG::DEBUG << "attached feature" << endreq; + + return HLT::OK; +} + + +bool TrigL2DielectronMassHelpers::validElectrons(const xAOD::TrigElectron* /*electron1*/, + const xAOD::TrigElectron* /*electron2*/) { + +/* + if ( !(electron1->isValid() && electron2->isValid()) ) + return false; +*/ + return true; +} + +TrigL2DielectronMassHelpers::Vertex TrigL2DielectronMassHelpers::commonVertex(const xAOD::TrigElectron* /*electron1*/, + const xAOD::TrigElectron* /*electron2*/) { + + +#ifdef DONTDO + double trk_e1_z0error = electron1->err_Zvtx(); + double trk_e2_z0error = electron2->err_Zvtx(); + + if ( trk_e1_z0error > 0 && trk_e2_z0error > 0 ) { + double z0_distance = fabs(electron1->Zvtx() + - electron2->Zvtx()); + + double z0_error = sqrt(trk_e1_z0error * trk_e1_z0error + + trk_e2_z0error * trk_e2_z0error); + + // reject combination if distance squared between perigee of + // tracks is greater than sqrt(6)*error = 2.45*error: this + // should accept 99% of good combinations (common vertex) + // Note: I changed 2.45 to 3 to be conservative => efficiency is + // now 99.7% + if (z0_distance > 3*z0_error) { + return NotCommon; + + } else { + return Common; + } + } +#endif + return Unapplicable; +} + + +bool TrigL2DielectronMassHelpers::opositeCharge(const xAOD::TrigElectron* electron1, + const xAOD::TrigElectron* electron2) { + if ( electron1->charge() * electron2->charge() > 0 ) + return false; + return true; +} + +double TrigL2DielectronMassHelpers::invariantMass(const xAOD::TrigElectron* electron1, + const xAOD::TrigElectron* electron2, + const double electronMass) { + + // get parameters: not electron pT no longer signed + double eta1 = electron1->eta(); + double eta2 = electron2->eta(); + + double Pt1 = electron1->pt() ; // IMPORTANT: pt() is the 4-momentum base class method and + double Pt2 = electron2->pt() ; // it returns the cluster pT; the track pT is given by Pt() + + double phi1 = electron1->phi(); + double phi2 = electron2->phi(); + + double theta1 = 2*atan2((double)exp(-eta1),1.); + double theta2 = 2*atan2((double)exp(-eta2),1.); + double P1 = fabs(Pt1)/sin(theta1); + double P2 = fabs(Pt2)/sin(theta2); + + double p1[3],p2[3]; + + // Replace the following by sincos which calculates the sin and cos + // of the same angle 40% faster (fwinkl) +#ifndef __APPLE__ + sincos(phi1,&p1[1],&p1[0]); + p1[0] *= Pt1; + p1[1] *= Pt1; +#else + CxxUtils::sincos scphi1(phi1); + p1[0] = Pt1*scphi1.cs; + p1[1] = Pt1*scphi1.sn; +#endif + +#ifndef __APPLE__ + sincos(phi2,&p2[1],&p2[0]); + p2[0] *= Pt2; + p2[1] *= Pt2; +#else + CxxUtils::sincos scphi2(phi2); + p2[0] = Pt2*scphi2.cs; + p2[1] = Pt2*scphi2.sn; +#endif + + p1[2] = P1*cos(theta1); + p2[2] = P2*cos(theta2); + + // evaluate mass + double Ptot1 = sqrt(std::pow(p1[0],2)+std::pow(p1[1],2)+std::pow(p1[2],2)); + double Ptot2 = sqrt(std::pow(p2[0],2)+std::pow(p2[1],2)+std::pow(p2[2],2)); + double e1 = sqrt(electronMass + Ptot1*Ptot1); + double e2 = sqrt(electronMass + Ptot2*Ptot2); + double mass = sqrt(2*e1*e2 - 2*p1[0]*p2[0] - 2*p1[1]*p2[1] - 2*p1[2]*p2[2]); + + return mass; +} + +double TrigL2DielectronMassHelpers::invariantMass(const xAOD::TrigElectron* electron, + const xAOD::TrigEMCluster* cluster, + const double electronMass) { + // get parameters: not electron pT no longer signed + double eta1 = electron->eta(); + double eta2 = cluster->eta(); + + double Pt1 = electron->pt(); // IMPORTANT: pt() is the 4-momentum base class method and + double Pt2 = cluster->et(); // it returns the cluster pT; the track pT is given by Pt() + + double phi1 = electron->phi(); + double phi2 = cluster->phi(); + + double theta1 = 2*atan2((double)exp(-eta1),1.); + double theta2 = 2*atan2((double)exp(-eta2),1.); + double P1 = fabs(Pt1)/sin(theta1); + double P2 = fabs(Pt2)/sin(theta2); + + double p1[3],p2[3]; + + // Replace the following by sincos which calculates the sin and cos + // of the same angle 40% faster (fwinkl) +#ifndef __APPLE__ + sincos(phi1,&p1[1],&p1[0]); + p1[0] *= Pt1; + p1[1] *= Pt1; +#else + CxxUtils::sincos scphi1(phi1); + p1[0] = Pt1*scphi1.cs; + p1[1] = Pt1*scphi1.sn; +#endif + +#ifndef __APPLE__ + sincos(phi2,&p2[1],&p2[0]); + p2[0] *= Pt2; + p2[1] *= Pt2; +#else + CxxUtils::sincos scphi2(phi2); + p2[0] = Pt2*scphi2.cs; + p2[1] = Pt2*scphi2.sn; +#endif + + p1[2] = P1*cos(theta1); + p2[2] = P2*cos(theta2); + + // evaluate mass + double Ptot1 = sqrt(std::pow(p1[0],2)+std::pow(p1[1],2)+std::pow(p1[2],2)); + double Ptot2 = sqrt(std::pow(p2[0],2)+std::pow(p2[1],2)+std::pow(p2[2],2)); + double e1 = sqrt(electronMass + Ptot1*Ptot1); + double e2 = sqrt(electronMass + Ptot2*Ptot2); + double mass = sqrt(2*e1*e2 - 2*p1[0]*p2[0] - 2*p1[1]*p2[1] - 2*p1[2]*p2[2]); + + return mass; +} diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2DielectronMassHypo.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2DielectronMassHypo.cxx new file mode 100755 index 00000000000..6f67ec63892 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2DielectronMassHypo.cxx @@ -0,0 +1,150 @@ +// -*- C++ -*- + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/************************************************************************** + ** + ** File: Trigger/TrigHypothesis/TrigEgammaHypo/TrigL2DielectronMassHypo.h + ** + ** Description: - Hypothesis algorithm: searc for electron pairs with + ** invariant mass in some interval; intended for Z->ee + ** - Modified from TrigL2DimuonMassHypo by C.Schiavi + ** + ** Author: R.Goncalo <r.goncalo@rhul.ac.uk> + ** + ** Created: Aug 13 2006 + ** Modified: Jan 19 2007 Valeria Perez Reale Adapted to New Steering + ** Modified: Apr 28 2007 Tomasz Bold major changes to run with new steering + ** Modified: May 2011 major changes to use TrigOperatioanlInfo + **************************************************************************/ + +#include "TrigEgammaHypo/TrigL2DielectronMassFex.h" +#include "TrigEgammaHypo/TrigL2DielectronMassHypo.h" + +#include "TrigSteeringEvent/TrigOperationalInfo.h" + +class ISvcLocator; + +TrigL2DielectronMassHypo::TrigL2DielectronMassHypo(const std::string & name, ISvcLocator* pSvcLocator): + HLT::HypoAlgo(name, pSvcLocator) +{ + + // Read cuts + declareProperty("AcceptAll", m_acceptAll); + declareProperty("SameTrackAlgo",m_sameTrackAlgo=true); + declareProperty("OppositeSign", m_oppositeCharge=true); + declareProperty("CommonVertex", m_commonVertex=true); + declareProperty("ValidElectron",m_electronValid=true); +// declareProperty("LowerMassCut", m_lowerMassCut=50000.0); +// declareProperty("UpperMassCut", m_upperMassCut=130000.0); + declareProperty("LowerMassCut", m_lowerMassCut=1000.0); + declareProperty("UpperMassCut", m_upperMassCut=6000.0); + + // monitoring + declareMonitoredVariable("massOfAccepted", m_monMassAccepted); + declareMonitoredVariable("cut", m_monCut); + +} + +TrigL2DielectronMassHypo::~TrigL2DielectronMassHypo() +{ } + +HLT::ErrorCode TrigL2DielectronMassHypo::hltInitialize() +{ + + if (msgLvl() <= MSG::VERBOSE) { + msg() << MSG::DEBUG << "Initialization:" << endreq; + } + + + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Initialization completed successfully:" << endreq; + msg() << MSG::DEBUG << "AcceptAll = " + << (m_acceptAll==true ? "True" : "False") << endreq; + msg() << MSG::DEBUG << "ValidElectron = " + << (m_electronValid==true ? "True" : "False") << endreq; + msg() << MSG::DEBUG << "SameTrackAlgo = " + << (m_sameTrackAlgo==true ? "True" : "False") << endreq; + msg() << MSG::DEBUG << "OppositeCharge = " + << (m_oppositeCharge==true ? "True" : "False") << endreq; + msg() << MSG::DEBUG << "CommonVertex = " + << (m_commonVertex==true ? "True" : "False") << endreq; + msg() << MSG::DEBUG << "LowerMassCut = " << m_lowerMassCut << endreq; + msg() << MSG::DEBUG << "UpperMassCut = " << m_upperMassCut << endreq; + } + + return HLT::OK; +} + + +HLT::ErrorCode TrigL2DielectronMassHypo::hltFinalize() +{ + if ( msgLvl() <= MSG::INFO ) + msg() << MSG::INFO << "in finalize()" << endreq; + + return HLT::OK; +} + +HLT::ErrorCode TrigL2DielectronMassHypo::hltExecute(const HLT::TriggerElement* outputTE, bool& pass) { + pass=false; + m_monCut = 0; + + // retrieve TrigOperationalInfo // + std::vector<const TrigOperationalInfo*> vms; + if (getFeatures(outputTE, vms) != HLT::OK) { + if (msgLvl() <= MSG::WARNING) { + msg() << MSG::WARNING << "Failed to get TrigOperationalInfo" << endreq; + } + return HLT::MISSING_FEATURE; + } else { + if (msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Number of TrigOperationalInfo: " << vms.size() << endreq; + } + } + m_monCut = 1; + + + std::vector<const TrigOperationalInfo*>::const_iterator pm; + for (pm=vms.begin(); pm!=vms.end(); ++pm) { + // check if this TrigOperationalInfo has L2DielectronInfo + if ( !((*pm)->defined("mass0")==1) ) continue; + unsigned int Ninfos = (*pm)->infos().first.size(); + if (msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Number of Info belonging to TrigOperationalInfo: " << Ninfos << endreq; + } + for(unsigned int iInfo=0; iInfo<Ninfos; ++iInfo ) { + char key[64]; + std::sprintf(key, "mass%d", iInfo); + if ( !(*pm)->defined(std::string(key)) ) break; + + float mass = (*pm)->get(std::string(key)); + + m_monCut = 2; + // apply cut on mass + if(mass<m_lowerMassCut || mass>m_upperMassCut) { + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Combination failed mass cut: " + << mass << " not in [" << m_lowerMassCut << "," << m_upperMassCut << "]" << endreq; + } + } else { + // good combination found + pass = true; + m_monCut = 3; + m_monMassAccepted = mass; + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Combination passed mass cut: " + << m_lowerMassCut << " < " << mass << " < " + << m_upperMassCut << endreq; + msg() << MSG::DEBUG << "Good combination found! Mee=" + << mass << " MeV" << endreq; + } + } + }// End of loop over infos in L2DielectronInfo + }// End of loop over TrigOperationalInfo + + + if(msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << "pass = " << pass << endreq; + return HLT::OK; +} diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronFex.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronFex.cxx new file mode 100755 index 00000000000..b0f685472f1 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronFex.cxx @@ -0,0 +1,519 @@ +// -*- C++ -*- + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/************************************************************************** + ** + ** File: Trigger/TrigHypothesis/TrigEgammaHypo/TrigL2ElectronFex.cxx + ** + ** Description: Hypothesis algorithms to be run at Level 2 after + ** tracking algorithms: creates TrigElectrons + ** + ** Author: R.Goncalo <r.goncalo@rhul.ac.uk> Thu Jan 20 22:02:43 BST 2005 + ** P.Urquijo <Phillip.Urquijo@cern.ch> + ** + ** Created: Sat Mar 1 19:55:56 GMT 2005 + ** Modified: RG 18 Mar 06 - fix to always generate TrigElectrons + ** - use key2keyStore for collection names + ** N.Berger Dec.06 - migrate to new steering (RG) + **************************************************************************/ + +//#include "TrigInDetToolInterfaces/ITrigInDetTrackExtrapolator.h" +#include "RecoToolInterfaces/IExtrapolateToCaloTool.h" +#include "TrigEgammaHypo/TrigL2ElectronFex.h" +#include "xAODTrigCalo/TrigEMClusterContainer.h" + +class ISvcLocator; + +template <class SRC> +inline const DataVector<xAOD::TrigElectron>** dvec_cast(SRC** ptr) { + return (const DataVector<xAOD::TrigElectron>**)(ptr); +} + + +TrigL2ElectronFex::TrigL2ElectronFex(const std::string & name, ISvcLocator* pSvcLocator) + : HLT::FexAlgo(name, pSvcLocator), + m_trackExtrapolator("IExtrapolateToCaloTool/ExtrapolateToCaloTool"), + m_trigElecColl(0) +{ + // Read cuts - should probably get these from an xml file + declareProperty( "AcceptAll", m_acceptAll = false ); + // declareProperty( "SaveTrigElectrons", m_saveTrigEl = true ); + declareProperty( "EtaBins", m_etabin ); + declareProperty( "TrackPt", m_trackPtthr = 5.0*CLHEP::GeV ); + declareProperty( "CaloTrackdETA", m_calotrackdeta ); + declareProperty( "CaloTrackdPHI", m_calotrackdphi ); + declareProperty( "CaloTrackdEoverPLow", m_calotrackdeoverp_low ); + declareProperty( "CaloTrackdEoverPHigh", m_calotrackdeoverp_high ); + declareProperty( "TrackAlgoId", m_trackalgoID = 0 ); + declareProperty( "CaloAlgoId", m_calo_algoID = 1 ); // 0=all (N/A); 1=T2Calo; 2=CaloRinger + declareProperty( "dETACLUSTERthr", m_detacluster = 0.1 ); + declareProperty( "dPHICLUSTERthr", m_dphicluster = 0.1 ); + declareProperty( "RCalBarrelFace", m_RCAL = 1470.0*CLHEP::mm ); + declareProperty( "ZCalEndcapFace", m_ZCAL = 3800.0*CLHEP::mm ); + declareProperty( "TrackExtrapolator", m_trackExtrapolator); + + declareProperty( "TrackPtTRT", m_trackPtthrTRT = 5.0*CLHEP::GeV ); + declareProperty( "CaloTrackdETATRT", m_calotrackdetaTRT ); + declareProperty( "CaloTrackdPHITRT", m_calotrackdphiTRT ); + + + declareMonitoredCollection("PtCalo",*dvec_cast(&m_trigElecColl),&TrigL2ElectronFex::getCaloPt); + declareMonitoredCollection("PtTrack",*dvec_cast(&m_trigElecColl),&TrigL2ElectronFex::getTkPt); + declareMonitoredCollection("CaloTrackdEta",*dvec_cast(&m_trigElecColl),&xAOD::TrigElectron::trkClusDeta); + declareMonitoredCollection("CaloTrackdPhi",*dvec_cast(&m_trigElecColl),&xAOD::TrigElectron::trkClusDphi); + declareMonitoredCollection("CaloTrackEoverP",*dvec_cast(&m_trigElecColl),&xAOD::TrigElectron::etOverPt); +} + + +TrigL2ElectronFex::~TrigL2ElectronFex() +{} + + +HLT::ErrorCode TrigL2ElectronFex::hltInitialize() +{ + if ( msgLvl() <= MSG::DEBUG ) msg() << MSG::DEBUG << "Initialization:" << endreq; + + // initialize error counter + m_extrapolator_failed = 0; + + // retrieve extrapolation tool + /* + StatusCode sc = toolSvc()->retrieveTool(m_trackExtrapolatorName, + m_trackExtrapolatorName, + m_trackExtrapolator); + */ + StatusCode sc = m_trackExtrapolator.retrieve(); + if ( sc.isFailure() ) { + msg() << MSG::FATAL << "Unable to locate TrackExtrapolator tool " << endreq; + return HLT::BAD_JOB_SETUP; + } + + // print out settings + if ( msgLvl() <= MSG::DEBUG ) { + msg() << MSG::DEBUG << "Initialization completed successfully:" << endreq; + msg() << MSG::DEBUG << "AcceptAll = " + << (m_acceptAll==true ? "True" : "False") << endreq; + msg() << MSG::DEBUG << "TrackPt = " << m_trackPtthr << endreq; + msg() << MSG::DEBUG << "EtaBins = " << m_etabin << endreq; + msg() << MSG::DEBUG << "CaloTrackdETA = " << m_calotrackdeta << endreq; + msg() << MSG::DEBUG << "CaloTrackdPHI = " << m_calotrackdphi << endreq; + msg() << MSG::DEBUG << "CaloTrackdEoverPLow = " << m_calotrackdeoverp_low << endreq; + msg() << MSG::DEBUG << "CaloTrackdEoverPHigh = " << m_calotrackdeoverp_high<< endreq; + msg() << MSG::DEBUG << "TrackAlgoId = " << m_trackalgoID << endreq; + msg() << MSG::DEBUG << "CaloAlgoId = " << m_calo_algoID << endreq; + msg() << MSG::DEBUG << "dETACLUSTERthr = " << m_detacluster << endreq; + msg() << MSG::DEBUG << "dPHICLUSTERthr = " << m_dphicluster << endreq; + + } + + return HLT::OK; +} + + +HLT::ErrorCode TrigL2ElectronFex::hltFinalize() +{ + if ( msgLvl() <= MSG::INFO ) + msg() << MSG::INFO << "in finalize()" << endreq; + + if (m_extrapolator_failed) + msg() << MSG::INFO << "track extrapolation failed " << m_extrapolator_failed << " times" << endreq; + + return HLT::OK; +} + + +HLT::ErrorCode TrigL2ElectronFex::hltExecute(const HLT::TriggerElement* inputTE, + HLT::TriggerElement* outputTE) { + HLT::ErrorCode stat = HLT::OK; + + // Collection may be never used. Better only create if necessary + // NULL value is specially important to avoid crashs in monitoring + //m_trigElecColl = NULL; + xAOD::TrigElectronAuxContainer trigElecAuxContainer; + if ( !m_trigElecColl ) { + m_trigElecColl = new xAOD::TrigElectronContainer(); + m_trigElecColl->setStore(&trigElecAuxContainer); + } else { + m_trigElecColl->clear(); + } + + bool pass = false; + bool result = false; + // Accept-All mode: temporary patch; should be done with force-accept + if (m_acceptAll) { + pass = true; + if ( msgLvl() <= MSG::DEBUG ) { + msg() << MSG::DEBUG << "AcceptAll property is set: taking all events" + << endreq; + } + } else { + pass = false; + if ( msgLvl() <= MSG::DEBUG ) { + msg() << MSG::DEBUG << "AcceptAll property not set: applying selection" + << endreq; + } + } + + // get RoI descriptor + const TrigRoiDescriptor* roiDescriptor = 0; + if (getFeature(inputTE, roiDescriptor) != HLT::OK) roiDescriptor = 0; + + if ( !roiDescriptor ) { + if ( msgLvl() <= MSG::WARNING) { + msg() << MSG::WARNING << "No RoI for this Trigger Element! " << endreq; + } + return HLT::NAV_ERROR; + } + + // get the initial RoI descriptor + const TrigRoiDescriptor* initialRoI = 0; + if (getFeature(inputTE, initialRoI, "initialRoI") != HLT::OK) { + initialRoI = roiDescriptor; + if ( msgLvl() <= MSG::WARNING) { + msg() << MSG::WARNING << "Initial RoI was not found for this Trigger Element! " << endreq; + } + } + + + if ( msgLvl() <= MSG::DEBUG ){ + msg() << MSG::DEBUG + << "Using inputTE("<< inputTE <<")->getId(): " << inputTE->getId() + << "; RoI ID = " << roiDescriptor->roiId() + // << "; RoI word=" << roiDescriptor->roiWord() + << "; RoI word=" << initialRoI->roiWord() + << ": Eta = " << roiDescriptor->eta() + << ", Phi = " << roiDescriptor->phi() + << endreq; + } + + // fill local variables for RoI reference position + double etaRef = roiDescriptor->eta(); + double phiRef = roiDescriptor->phi(); + + // CaloAlgoId now isn't used anymore, as TrigCaloRinger also dumps a TrigEMCluster + // It is kept for backward compability. + // Eventually it can be passed to the next algos for information?! + + float calo_eta(999), calo_phi(999), calo_et(-1); + // the ElementLink pointing to a TrigEMCluster needs to be declared in this scope + ElementLink<xAOD::TrigEMClusterContainer> el_t2calo_clus; + + // retrieve TrigEMCluster using the Navigation methods + stat = getFeatureLink<xAOD::TrigEMClusterContainer,xAOD::TrigEMCluster>(inputTE, el_t2calo_clus); + + if ( stat == HLT::OK && el_t2calo_clus.isValid() ) { + + // copy relevant quantities to local variables + calo_eta = (*el_t2calo_clus)->eta(); + calo_phi = (*el_t2calo_clus)->phi(); + calo_et = (*el_t2calo_clus)->et(); + + // cluster found: print debug information + //if ( msgLvl() <= MSG::DEBUG ) (*el_t2calo_clus)->print(msg()); + + } else { + if ( msgLvl() <= MSG::DEBUG) + msg() << MSG::DEBUG << "Failed to get TrigEMCluster" << endreq; + return HLT::MISSING_FEATURE; + } + + + // figure out what eta bin this cluster is in + float absEta = fabs(calo_eta); + int etaBin = 0; + + if(m_etabin.size()<2 ) { + if ( msgLvl() <= MSG::DEBUG ) msg() << MSG::DEBUG << "etaBin not configured correctly" << endreq; + return HLT::OK;//eta bins not configured correctly + } + + for (unsigned int iBin = 0; iBin < (m_etabin.size()-1); iBin++ ) + if ( absEta > m_etabin[iBin] && absEta < m_etabin[iBin+1] ) etaBin = iBin; + + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "eta bin used for cuts: " << etaBin << endreq; + + + // calculate eta and phi distances (deal with angle diferences > Pi) + float dPhi = calo_phi - phiRef; + dPhi = ( fabs(dPhi) < M_PI ? dPhi : 2*M_PI - dPhi ); + + float dEta = fabs( etaRef - calo_eta ); + + + // VD already cutting on TriL2CaloHypo + // Accept only L2 em clusters which are "close" to the one provided by L1 + + if ( msgLvl() <= MSG::DEBUG ) { + msg() << MSG::DEBUG << "Not cutting on dEta=" << dEta << " or dPhi=" << dPhi << endreq; + } + + //if ( dEta > m_detacluster || dPhi > m_dphicluster ) { + // if ( msgLvl() <= MSG::DEBUG ) { + // msg() << MSG::DEBUG << "Cluster doesn't match RoI! Leaving." << endreq; + // } + // return HLT::OK; + //} + + + // Transverse em energy + if ( msgLvl() <= MSG::DEBUG ) { + msg() << MSG::DEBUG << "Cluster: ET=" << calo_et << endreq; + msg() << MSG::DEBUG << "searching a matching track: loop over tracks" + << endreq; + } + + + // get vector of TrigInDetTrackCollections + ElementLinkVector< xAOD::TrackParticleContainer > v_inputTracks; + stat = getFeaturesLinks< xAOD::TrackParticleContainer, xAOD::TrackParticleContainer > (inputTE, v_inputTracks, ""); + + if ( stat != HLT::OK || v_inputTracks.size() < 1) { + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "No track collections found! Leaving." << endreq; + return HLT::OK; + } + + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "Got vector of " << v_inputTracks.size() + << " InDetTrackCollections" << endreq; + + + // loop over track collections + int n_coll = 0; + ElementLinkVector< xAOD::TrackParticleContainer >::const_iterator collIter,collEnd=(v_inputTracks).end(); + for ( collIter = v_inputTracks.begin(); collIter != collEnd; ++n_coll, ++collIter) { + + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "Starting on collection nr." << n_coll <<endreq; + + // loop over tracks + int n_trk = 0; + const xAOD::TrackParticle* trkIter = *(collIter->cptr()); //,trkEnd = (collIter)->end(); + //for ( trkIter = (collIter)->begin(); trkIter != trkEnd; ++n_trk, ++trkIter) { + + if ( msgLvl() <= MSG::DEBUG ) { + msg() << MSG::DEBUG << "Track " << n_trk << " in collection " << n_coll << endreq; + msg() << MSG::DEBUG << "AlgoId = " << (trkIter)->patternRecoInfo() << endreq; + msg() << MSG::DEBUG << "At perigee:" << endreq; + msg() << MSG::DEBUG << " Pt = " << fabs((trkIter)->pt()) << endreq; + msg() << MSG::DEBUG << " phi = " << fabs((trkIter)->phi0())<< endreq; + msg() << MSG::DEBUG << " eta = " << fabs((trkIter)->eta()) << endreq; +// msg() << MSG::DEBUG << " a0 = " << fabs((trkIter)->a0()) << endreq; + msg() << MSG::DEBUG << " z0 = " << fabs((trkIter)->z0()) << endreq; + } + + // algorithm ID + //TrackParticle::AlgoId algoId = (*trkIter)->algorithmId(); + //TrackParticle::AlgoId algoId = 0; //(*trkIter)->algorithmId(); + int algoId = 0; //(*trkIter)->algorithmId(); + if ( trkIter->patternRecoInfo()[xAOD::TrackPatternRecoInfo::FastTrackFinderSeed] ) algoId=9; + if ( trkIter->patternRecoInfo()[xAOD::TrackPatternRecoInfo::strategyA] ) algoId=5; + if ( trkIter->patternRecoInfo()[xAOD::TrackPatternRecoInfo::strategyB] ) algoId=6; + if ( trkIter->patternRecoInfo()[xAOD::TrackPatternRecoInfo::strategyC] ) algoId=7; + + // do not try track/cluster match if produced by wrong algo (0=all algos) + if (m_trackalgoID == 0 || (unsigned int)algoId == m_trackalgoID || m_acceptAll || + (m_trackalgoID == 5 && (unsigned int)algoId <= 2 )) { + + if ( msgLvl() <= MSG::DEBUG ) msg() << MSG::DEBUG << "good track AlgoId" << endreq; + + //Use SiTrack/IDScan cuts or TRT cuts + + std::vector<float> temp_calotrackdeta; + std::vector<float> temp_calotrackdphi; + float temp_trackPtthr; + if((unsigned int)algoId != 3 ){//SiTrack or IDScan + temp_calotrackdeta = m_calotrackdeta; + temp_calotrackdphi = m_calotrackdphi; + temp_trackPtthr = m_trackPtthr; + } + if((unsigned int)algoId == 3 ){//TRTSegFinder + temp_calotrackdeta = m_calotrackdetaTRT; + temp_calotrackdphi = m_calotrackdphiTRT; + temp_trackPtthr = m_trackPtthrTRT; + } + + //ignore tracks that don't have cuts + if(temp_calotrackdeta.size()<1 || temp_calotrackdphi.size()<1 ){ + if ( msgLvl() <= MSG::DEBUG ) msg() << MSG::DEBUG << "Track type does not have corresponding cut configuration" << endreq; + continue; + } + //ignore incorrect cut configurations + if(temp_calotrackdeta.size()!=(m_etabin.size()-1) || temp_calotrackdphi.size()!=(m_etabin.size()-1) ){ + if ( msgLvl() <= MSG::DEBUG ) msg() << MSG::DEBUG << "Track type has inconsistent cut configuration" << endreq; + continue; + } + + // Pt cut + float trkPt = fabs((trkIter)->pt()); + + if (trkPt > temp_trackPtthr || m_acceptAll) { + if ( msgLvl() <= MSG::DEBUG ) msg() << MSG::DEBUG << "passed pT cut" << endreq; + + // match in ET/PT + float etoverpt = fabs(calo_et/trkPt); + + if (etoverpt > m_calotrackdeoverp_low[etaBin] || m_acceptAll) { + msg() << MSG::DEBUG << "passed low cut on ET/PT" << endreq; + + if (etoverpt < m_calotrackdeoverp_high[etaBin] || m_acceptAll) { + if ( msgLvl() <= MSG::DEBUG ) msg() << MSG::DEBUG << "passed high cut on ET/PT" << endreq; + + // extrapolate track using tool + double phiAtCalo = 0, etaAtCalo = 0; + double offset = 0.; + const Trk::TrackParameters* parametersInCalo (0); + + if ( (*el_t2calo_clus)->energy(CaloSampling::CaloSample::EMB2) > (*el_t2calo_clus)->energy(CaloSampling::CaloSample::EME2) ) { + parametersInCalo = m_trackExtrapolator->extrapolate( *(trkIter), (CaloCell_ID::CaloSample)CaloSampling::CaloSample::EMB2,offset); + } else { + parametersInCalo = m_trackExtrapolator->extrapolate( *(trkIter), (CaloCell_ID::CaloSample)CaloSampling::CaloSample::EME2,offset); + } + +/* + StatusCode sc = m_trackExtrapolator->extrapolateToCalo((trkIter), + m_RCAL, m_ZCAL, + phiAtCalo, etaAtCalo); +*/ + + // if extrapolation failed for some reason, don't do calo-track matching cuts + // and instead reject electron already here (jump to next electron) + if ( !parametersInCalo ) { + if ( msgLvl() <= MSG::DEBUG ) msg() << MSG::DEBUG << "extrapolator failed "<<endreq; + m_extrapolator_failed++; + + // jump to next electron + continue; + + } else { + etaAtCalo = parametersInCalo->position().eta(); + phiAtCalo = parametersInCalo->position().phi(); + delete parametersInCalo; + // all ok: do track-matching cuts + if ( msgLvl() <= MSG::DEBUG ) msg() << MSG::DEBUG << "extrapolated eta/phi=" << etaAtCalo + << "/" << phiAtCalo << endreq; + + // match in eta + float dEtaCalo = fabs(etaAtCalo - calo_eta); + + if ( dEtaCalo < temp_calotrackdeta[etaBin] || m_acceptAll) { + if ( msgLvl() <= MSG::DEBUG ) msg() << MSG::DEBUG << "passed eta match cut" << endreq; + + // match in phi: deal with differences larger than Pi + float dPhiCalo = fabs(phiAtCalo - calo_phi); + dPhiCalo = ( dPhiCalo < M_PI ? dPhiCalo : 2*M_PI - dPhiCalo ); + + if ( dPhiCalo < temp_calotrackdphi[etaBin] || m_acceptAll) { + if ( msgLvl() <= MSG::DEBUG ) msg() << MSG::DEBUG << "passed phi match cut" << endreq; + + // all cuts passed + result = true; + + /** Create a TrigElectron corresponding to this candidate + assume cluster quantities give better estimate of transverse energy + (probably a safe assumption for large pT) and that track parameters + at perigee give better estimates of angular quantities */ + + msg() << MSG::DEBUG << "cluster pointer=" << + el_t2calo_clus.getStorableObjectPointer() << " and index=" << el_t2calo_clus.index() << endreq; + msg() << MSG::DEBUG << "track pointer=" << (*collIter) << " and index=" << n_trk << endreq; + //roirDescriptor->roiWord(), + //ElementLink<const xAOD::TrackParticleContainer> el_t2trk (*collIter); + //if ( n_trk < el_t2trk->size() ) el_t2trk.toIndexredElement( collIter, n_trk ); + // ElementLinkVector< xAOD::TrackParticleContainer >::const_iterator collIter,collEnd=(v_inputTracks).end(); + ElementLink< xAOD::TrackParticleContainer > trkLink ( *collIter ); + trkLink.toIndexedElement( (*collIter).getStorableObjectRef(), n_trk ); + xAOD::TrigElectron* trigElec = new xAOD::TrigElectron(); + m_trigElecColl->push_back(trigElec); + trigElec->init( initialRoI->roiWord(), + etaAtCalo, phiAtCalo, etoverpt, + //el_t2calo_clus.getStorableObjectPointer(), el_t2calo_clus.index(), + el_t2calo_clus, + trkLink); + //(*collIter), n_trk); + // obsolete: the constructor used to take dEtaCalo, dPhiCalo, etoverpt, + // Ok. If collection does not exist, build it for the first time +// if ( !m_trigElecColl ) m_trigElecColl = new xAOD::TrigElectronContainer(); + // electron passed all cuts: push into collection +// m_trigElecColl->push_back(trigElec); + //if ( msgLvl() <= MSG::DEBUG ) msg() << MSG::DEBUG << (*trigElec) << endreq; + } + } + } + } + } + } + } + //} + } + + // set output TriggerElement unless acceptAll is set + if (!m_acceptAll) pass = result; + + if ( msgLvl() <= MSG::DEBUG ) msg() << MSG::DEBUG << "acceptInput = " << pass << endreq; + + // return HLT::OK; + + + if (!m_trigElecColl) { + if ( msgLvl() <= MSG::DEBUG) + msg() << MSG::DEBUG + << "Execute called will NULL pointer to TrigElectronContainer" << endreq; + m_trigElecColl = NULL; + return HLT::OK; + } + + // attach the TrigElectronCollection to the TriggerElement so + // it is accessible from trigger navigation + stat = attachFeature(outputTE, m_trigElecColl, "L2ElectronFex"); + if ( stat != HLT::OK ) { + + if ( msgLvl() <= MSG::WARNING) + msg() << MSG::WARNING + << "Failed to attach TrigElectronContainer to navigation" << endreq; + + return stat; + } + + // print debug info + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "* Summary: storing a collection with size " + << m_trigElecColl->size() << "." <<endreq; + + int i = 0; + + for (xAOD::TrigElectronContainer::iterator elecIter = m_trigElecColl->begin(); + elecIter != m_trigElecColl->end(); ++i, ++elecIter) { + +#ifdef DONTDO + msg() << MSG::DEBUG + << "TrigElec[" << i << "]->isValid()=" << (*elecIter)->isValid() + << endreq; + + /* IMPORTANT: pt() is the 4-momentum base class method; returns cluster ET */ + msg() << MSG::DEBUG << (**elecIter) << endreq; +// << ">eta0= " << (*elecIter)->eta() +// << " phi0= " << (*elecIter)->phi() +// << " calo: Et= " << (*elecIter)->pt() +// << " track: Pt= " << (*elecIter)->Pt() +// << " eta at calo= " << (*elecIter)->trkEtaAtCalo() +// << " phi at calo= " << (*elecIter)->trkPhiAtCalo() +// << " match: Deta= " << (*elecIter)->trkClusDeta() +// << " Dphi= " << (*elecIter)->trkClusDphi() +// << endreq; + + + msg() << MSG::DEBUG + << ">Tracking algo " << (*elecIter)->trackAlgo() + << endreq; +#endif + + } + + m_trigElecColl = NULL; + return HLT::OK; +} diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronHypo.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronHypo.cxx new file mode 100755 index 00000000000..46bbd794cd5 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronHypo.cxx @@ -0,0 +1,353 @@ +// -*- C++ -*- + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/************************************************************************** + ** + ** File: Trigger/TrigHypothesis/TrigEgammaHypo/TrigL2ElectronHypo.cxx + ** + ** Description: Hypothesis algorithms to be run at Level 2 after + ** tracking algorithms: creates TrigElectrons + ** + ** Author: R.Goncalo <r.goncalo@rhul.ac.uk> Thu Jan 20 22:02:43 BST 2005 + ** P.Urquijo <Phillip.Urquijo@cern.ch> + ** + ** Created: Sat Mar 1 19:55:56 GMT 2005 + ** Modified: RG 18 Mar 06 - fix to always generate TrigElectrons + ** - use key2keyStore for collection names + ** N.Berger Dec.06 - migrate to new steering (RG) + **************************************************************************/ + +//#include "TrigInDetToolInterfaces/ITrigInDetTrackExtrapolator.h" +#include "TrigEgammaHypo/TrigL2ElectronHypo.h" +#include "TrigSteeringEvent/TrigPassBits.h" + +class ISvcLocator; + +template <class SRC> +inline const DataVector<xAOD::TrigElectron>** dvec_cast(SRC** ptr) { + return (const DataVector<xAOD::TrigElectron>**)(ptr); +} + +TrigL2ElectronHypo::TrigL2ElectronHypo(const std::string & name, ISvcLocator* pSvcLocator): + HLT::HypoAlgo(name, pSvcLocator) +{ + declareProperty( "AcceptAll", m_acceptAll = true ); + declareProperty( "TrackAlgoId", m_trackalgoID = 0 ); + + declareProperty( "EtaBins", m_etabin ); + declareProperty( "TrackPt", m_trackPtthr = 5.0*CLHEP::GeV ); + declareProperty( "CaloTrackdETA", m_calotrackdeta ); //loose cut + declareProperty( "CaloTrackdPHI", m_calotrackdphi ); //loose cut + declareProperty( "CaloTrackdEoverPLow", m_calotrackdeoverp_low ); + declareProperty( "CaloTrackdEoverPHigh", m_calotrackdeoverp_high ); + declareProperty( "TRTRatio", m_trtratio ); + + declareProperty( "EtaBinsTRT", m_etabinTRT ); + declareProperty( "TrackPtTRT", m_trackPtthrTRT = 5.0*CLHEP::GeV ); + declareProperty( "CaloTrackdETATRT", m_calotrackdetaTRT ); //loose cut + declareProperty( "CaloTrackdPHITRT", m_calotrackdphiTRT ); //loose cut + declareProperty( "TRTRatioTRT", m_trtratioTRT ); + declareProperty( "CaloTrackdEoverPLowTRT", m_calotrackdeoverp_lowTRT ); + declareProperty( "CaloTrackdEoverPHighTRT", m_calotrackdeoverp_highTRT ); + + declareMonitoredVariable("CutCounter",m_cutCounter); + declareMonitoredCollection("PtCalo",*dvec_cast(&m_egamma_container),&TrigL2ElectronHypo::getCaloPt); + declareMonitoredCollection("PtTrack",*dvec_cast(&m_egamma_container),&TrigL2ElectronHypo::getTkPt); + declareMonitoredCollection("CaloTrackdEta",*dvec_cast(&m_egamma_container),&xAOD::TrigElectron::trkClusDeta); + declareMonitoredCollection("CaloTrackdPhi",*dvec_cast(&m_egamma_container),&xAOD::TrigElectron::trkClusDphi); + declareMonitoredCollection("CaloTrackEoverP",*dvec_cast(&m_egamma_container),&xAOD::TrigElectron::etOverPt); + declareMonitoredCollection("CaloEta",*dvec_cast(&m_egamma_container),&xAOD::TrigElectron::caloEta); + declareMonitoredCollection("CaloPhi",*dvec_cast(&m_egamma_container),&xAOD::TrigElectron::caloPhi); +} + + +TrigL2ElectronHypo::~TrigL2ElectronHypo() +{ } + + +HLT::ErrorCode TrigL2ElectronHypo::hltInitialize() +{ + if ( msgLvl() <= MSG::DEBUG ) { + msg() << MSG::DEBUG << "Initialization:" << endreq; + } + + if ( msgLvl() <= MSG::DEBUG ) { + msg() << MSG::DEBUG << "Initialization completed successfully:" << endreq; + msg() << MSG::DEBUG << "AcceptAll = " + << (m_acceptAll==true ? "True" : "False") << endreq; + msg() << MSG::DEBUG << "EtaBins = " << m_etabin << endreq; + msg() << MSG::DEBUG << "TrackPt = " << m_trackPtthr << endreq; + msg() << MSG::DEBUG << "CaloTrackdETA = " << m_calotrackdeta << endreq; + msg() << MSG::DEBUG << "CaloTrackdPHI = " << m_calotrackdphi << endreq; + msg() << MSG::DEBUG << "CaloTrackdEoverPLow = " << m_calotrackdeoverp_low << endreq; + msg() << MSG::DEBUG << "CaloTrackdEoverPHigh = " << m_calotrackdeoverp_high<< endreq; + msg() << MSG::DEBUG << "TrackAlgoId = " << m_trackalgoID << endreq; + msg() << MSG::DEBUG << "TRTRatio = " << m_trtratio << endreq; + + msg() << MSG::DEBUG << "EtaBinsTRT = " << m_etabinTRT << endreq; + msg() << MSG::DEBUG << "TrackPtTRT = " << m_trackPtthrTRT << endreq; + msg() << MSG::DEBUG << "CaloTrackdETATRT = " << m_calotrackdetaTRT << endreq; + msg() << MSG::DEBUG << "CaloTrackdPHITRT = " << m_calotrackdphiTRT << endreq; + msg() << MSG::DEBUG << "CaloTrackdEoverPLowTRT = " << m_calotrackdeoverp_lowTRT << endreq; + msg() << MSG::DEBUG << "CaloTrackdEoverPHighTRT = " << m_calotrackdeoverp_highTRT<< endreq; + msg() << MSG::DEBUG << "TRTRatioTRT = " << m_trtratioTRT << endreq; + + } + + return HLT::OK; +} + + +HLT::ErrorCode TrigL2ElectronHypo::hltFinalize() +{ + if ( msgLvl() <= MSG::INFO ) + msg() << MSG::INFO << "in finalize()" << endreq; + + return HLT::OK; +} + +HLT::ErrorCode TrigL2ElectronHypo::hltExecute(const HLT::TriggerElement* outputTE, bool& pass) +{ + // initialize monitoring counter + m_cutCounter=-1; + m_egamma_container = 0; + + // Accept-All mode: temporary patch; should be done with force-accept + if (m_acceptAll) { + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "AcceptAll property is set: taking all events" + << endreq; + pass = true; + return HLT::OK; + } + else { + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "AcceptAll property not set: applying selection" + << endreq; + } + + // get RoI descriptor + const TrigRoiDescriptor* roiDescriptor = 0; + if (getFeature(outputTE, roiDescriptor) != HLT::OK) roiDescriptor = 0; + + if ( !roiDescriptor ) { + if ( msgLvl() <= MSG::WARNING) { + msg() << MSG::WARNING << "No RoI for this Trigger Element! " << endreq; + } + + return HLT::NAV_ERROR; + } + + if ( msgLvl() <= MSG::DEBUG ){ + msg() << MSG::DEBUG + << "Using outputTE("<< outputTE <<")->getId(): " << outputTE->getId() + << "; RoI = " << *roiDescriptor + // << "; RoI Id = " << roiDescriptor->roiId() + // << ": Eta = " << roiDescriptor->eta() << "+-" << roiDescriptor->etaHalfWidth() + // << ", Phi = " << roiDescriptor->phi() << "+-" << roiDescriptor->phiHalfWidth() + << endreq; + } + + // get TrigElectrons from the steering + const xAOD::TrigElectronContainer* trigElecColl = 0; + HLT::ErrorCode stat = getFeature(outputTE, trigElecColl, "L2ElectronFex"); + + if ( stat != HLT::OK || trigElecColl == 0) { + if ( msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Failed to get TrigElectron collection" << endreq; + } + return HLT::OK; + } + + if ( msgLvl() <= MSG::DEBUG ) { + msg() << MSG::DEBUG << "Got collection with " << trigElecColl->size() + << " TrigElectrons" << endreq; + } + + // generate TrigPassBits mask to flag which TrigElectrons pass hypo cuts + TrigPassBits* passBits = HLT::makeTrigPassBits(trigElecColl); + + // if no electrons were found, just leave TrigElectronColl. empty and leave + if ( trigElecColl->size() == 0 ) { + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "No electrons to analyse, leaving!" << endreq; + return HLT::OK; + } + + // initialize counter after all error conditions checked + m_egamma_container = trigElecColl; + m_cutCounter=0; + bool pTcaloCut=false; + bool dEtaCaloCut=false; + bool dPhiCaloCut=false; + bool eTOverPtCut_lo=false; + bool eTOverPtCut_hi=false; + bool TRTRatioCut=false; + + + // Now loop over electrons, see if at least one passes all cuts + xAOD::TrigElectronContainer::const_iterator elecIter, elecEnd=trigElecColl->end(); + for (elecIter = trigElecColl->begin(); elecIter != elecEnd; ++elecIter) { + + //int algoId = (*elecIter)->trackAlgo(); + const xAOD::TrackParticle* trkIter = (*elecIter)-> trackParticle(); + if (trkIter==NULL) continue; // disconsider candidates without track + int algoId = 0; + if ( trkIter->patternRecoInfo()[xAOD::TrackPatternRecoInfo::FastTrackFinderSeed] ) algoId=9; + if ( trkIter->patternRecoInfo()[xAOD::TrackPatternRecoInfo::strategyA] ) algoId=5; + if ( trkIter->patternRecoInfo()[xAOD::TrackPatternRecoInfo::strategyB] ) algoId=6; + if ( trkIter->patternRecoInfo()[xAOD::TrackPatternRecoInfo::strategyC] ) algoId=7; + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "Trackalgo: "<< algoId << endreq; + // do not try track/cluster match if produced by wrong algo (0=all algos) + if (m_trackalgoID == 0 || (unsigned int)algoId == m_trackalgoID || m_acceptAll || + (m_trackalgoID == 5 && (unsigned int)algoId <= 2 )) { + + // Retrieve all quantities + float absEta = fabs((*elecIter)->caloEta()); + float dPhiCalo = (*elecIter)->trkClusDphi(); + float dEtaCalo = (*elecIter)->trkClusDeta(); + float pTcalo = (*elecIter)->pt(); + float eTOverPt = (*elecIter)->etOverPt(); + // int trackIndx = (*elecIter)->trackIndx(); + float NTRHits = (float)((*elecIter)->nTRTHits()); + float NStrawHits = (float)((*elecIter)->nTRTHiThresholdHits()); + float TRTHitRatio = NStrawHits==0 ? 1e10 : NTRHits/NStrawHits; + + // figure out what eta bin this cluster is in + //Separate binning for IDScan/SiTrack and TRTSegFinder tracks + std::vector<float> temp_etabin; + std::vector<float> temp_calotrackdeta; + std::vector<float> temp_calotrackdphi; + std::vector<float> temp_calotrackdeoverp_low; + std::vector<float> temp_calotrackdeoverp_high; + float temp_trackPtthr = m_trackPtthr; + std::vector<float> temp_trtratio; + + if(algoId != 3 ){ //SiTrack or IDScan tracks cuts + temp_etabin = m_etabin; + temp_calotrackdeta = m_calotrackdeta; + temp_calotrackdphi = m_calotrackdphi; + temp_calotrackdeoverp_low = m_calotrackdeoverp_low; + temp_calotrackdeoverp_high = m_calotrackdeoverp_high; + temp_trackPtthr = m_trackPtthr; + temp_trtratio = m_trtratio; + } + if(algoId == 3 ){ //TRTSegFinder tracks cuts + temp_etabin = m_etabinTRT; + temp_calotrackdeta = m_calotrackdetaTRT; + temp_calotrackdphi = m_calotrackdphiTRT; + temp_calotrackdeoverp_low = m_calotrackdeoverp_lowTRT; + temp_calotrackdeoverp_high = m_calotrackdeoverp_highTRT; + temp_trackPtthr = m_trackPtthrTRT; + temp_trtratio = m_trtratioTRT; + } + + //ignore if cuts/binning not configured + int etaBin = 0; + if(temp_etabin.size()<2 || temp_calotrackdeta.size()<1 || temp_calotrackdphi.size()<1 + || temp_calotrackdeoverp_low.size()<1 || temp_calotrackdeoverp_high.size()<1 || temp_trtratio.size()<1) { + if ( msgLvl() <= MSG::DEBUG ) msg() << MSG::DEBUG << "Track type "<< algoId<<" does not have corresponding cut configuration" << endreq; + continue;//eta bins and cuts not defined for this track type, ignore track + } + + //ignore misconfigured cuts + if(temp_calotrackdeta.size()!= (temp_etabin.size()-1)|| temp_calotrackdphi.size()!= (temp_etabin.size()-1) + || temp_calotrackdeoverp_low.size()!= (temp_etabin.size()-1)|| temp_calotrackdeoverp_high.size()!= (temp_etabin.size()-1) + || temp_trtratio.size()!= (temp_etabin.size()-1)){ + if ( msgLvl() <= MSG::DEBUG ) msg() << MSG::DEBUG << "Track type has inconsistent cut configuration" << endreq; + continue; + } + + + //## + + for (std::size_t iBin = 0; iBin < (temp_etabin.size()-1); iBin++ ) + if ( absEta > temp_etabin[iBin] && absEta < temp_etabin[iBin+1] ) etaBin = iBin; + + + //## + + if ( msgLvl() <= MSG::DEBUG ) { +#ifdef DONTDO + msg() << MSG::DEBUG + << "TrigElec[i]->isValid()=" << (*elecIter)->isValid() + << endreq; + + msg() << MSG::DEBUG << (**elecIter) << endreq; + /* IMPORTANT: pt() is the 4-momentum base class method; returns cluster ET */ +// msg() << MSG::DEBUG +// << ">eta0= " << (*elecIter)->eta() +// << " phi0= " << (*elecIter)->phi() +// << " calo: Et= " << (*elecIter)->pt() +// << " track: Pt= " << (*elecIter)->Pt() +// << " eta at calo= " << (*elecIter)->trkEtaAtCalo() +// << " phi at calo= " << (*elecIter)->trkPhiAtCalo() +// << " match: Deta= " << (*elecIter)->trkClusDeta() +// << " Dphi= " << (*elecIter)->trkClusDphi() +// << " NTRHits = " << NTRHits +// << " NStrawHits = " << NStrawHits +// << " NTRTRatio = " <<TRTHitRatio +// << endreq; + + msg() << MSG::DEBUG + << ">Tracking algo " << (*elecIter)->trackAlgo() + << endreq; +#endif + + msg() << MSG::DEBUG << "absEta = " << absEta << " ==> etaBin = " << etaBin << endreq; + msg() << MSG::DEBUG << "pT (Calo) = " << pTcalo << endreq; + msg() << MSG::DEBUG << "dEtaCalo = " << dEtaCalo << ", cut = " << temp_calotrackdeta[etaBin] << endreq; + msg() << MSG::DEBUG << "dPhiCalo = " << dPhiCalo << ", cut = " << temp_calotrackdphi[etaBin] << endreq; + msg() << MSG::DEBUG << "eTOverPt = " << eTOverPt << ", cuts = [" + << temp_calotrackdeoverp_low[etaBin] << ", " << temp_calotrackdeoverp_high[etaBin] << "]" << endreq; + + + } + + // apply cuts + + if (pTcalo > temp_trackPtthr) { + pTcaloCut=true; + if (dEtaCalo < temp_calotrackdeta[etaBin]) { + dEtaCaloCut=true; + if (dPhiCalo < temp_calotrackdphi[etaBin]) { + dPhiCaloCut=true; + if(eTOverPt > temp_calotrackdeoverp_low[etaBin] ) { + eTOverPtCut_lo = true; + if ( eTOverPt < temp_calotrackdeoverp_high[etaBin] ) { + eTOverPtCut_hi = true; + if (TRTHitRatio > temp_trtratio[etaBin]){ + TRTRatioCut = true; + + // TrigElectron passed all cuts: set flags + pass = true; + HLT::markPassing(passBits, (*elecIter), trigElecColl); + + if ( msgLvl() <= MSG::DEBUG ) { + msg() << MSG::DEBUG << "Event accepted !" << endreq; + } + + } + } + } + } + } + } + } + } // end of loop over electrons + + + m_cutCounter=pTcaloCut+dEtaCaloCut+dPhiCaloCut+eTOverPtCut_lo+eTOverPtCut_hi+TRTRatioCut; + + // store TrigPassBits result + if ( attachBits(outputTE, passBits) != HLT::OK ) { + msg() << MSG::ERROR << "Could not store TrigPassBits! " << endreq; + } + + return HLT::OK; +} + diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronHypoMoni.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronHypoMoni.cxx new file mode 100755 index 00000000000..eb717877364 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronHypoMoni.cxx @@ -0,0 +1,277 @@ +// -*- C++ -*- + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/************************************************************************** + ** + ** File: Trigger/TrigHypothesis/TrigEgammaHypo/TrigL2ElectronHypoMoni.cxx + ** + ** Description: Hypothesis algorithms to be run at Level 2 after + ** tracking algorithms: creates TrigElectrons + ** + ** Authour: R.Goncalo <r.goncalo@rhul.ac.uk> Thu Jan 20 22:02:43 BST 2005 + ** + ** Created: Sat Mar 1 19:55:56 GMT 2005 + ** Modified: RG 18 Mar 06 - fix to always generate TrigElectrons + ** - use key2keyStore for collection names + ** James Keates 17 Oct - Added monitoring histograms. + ** Valeria perez reale 29 Jan - migration to new steering + ** + **************************************************************************/ + +//#include "TrigInDetToolInterfaces/ITrigInDetTrackExtrapolator.h" +#include "RecoToolInterfaces/IExtrapolateToCaloTool.h" +#include "TrigEgammaHypo/TrigL2ElectronHypoMoni.h" + +class ISvcLocator; + +TrigL2ElectronHypoMoni::TrigL2ElectronHypoMoni(const std::string & name, ISvcLocator* pSvcLocator): + HLT::HypoAlgo(name, pSvcLocator), m_trackExtrapolator("ExtrapolateToCaloTool") +{ + + // Read cuts - should probably get these from an xml file + declareProperty("AcceptAll", m_acceptAll=true); + declareProperty("EtaBins", m_etabin); + declareProperty("TrackPt", m_trackPtthr=5.0*CLHEP::GeV); + declareProperty("CaloTrackdETA", m_calotrackdeta); //loose cut + declareProperty("CaloTrackdPHI", m_calotrackdphi); //loose cut + declareProperty("CaloTrackdEoverPLow", m_calotrackdeoverp_low); + declareProperty("CaloTrackdEoverPHigh", m_calotrackdeoverp_high); + declareProperty("TrackAlgoId", m_trackalgoID=0); + declareProperty("dETACLUSTERthr", m_detacluster=0.1); + declareProperty("dPHICLUSTERthr", m_dphicluster=0.1); + declareProperty("RCalBarrelFace", m_RCAL=1470.0*CLHEP::mm); + declareProperty("ZCalEndcapFace", m_ZCAL=3800.0*CLHEP::mm); + declareProperty( "TrackExtrapolator", m_trackExtrapolator); +} + +TrigL2ElectronHypoMoni::~TrigL2ElectronHypoMoni() +{ } + +HLT::ErrorCode TrigL2ElectronHypoMoni::hltInitialize() +{ + if ( msgLvl() <= MSG::DEBUG ) { + msg() << MSG::DEBUG << "Initialization:" << endreq; + } + +/* + StatusCode sc = toolSvc()->retrieveTool(m_trackExtrapolatorName, + m_trackExtrapolatorName, + m_trackExtrapolator); +*/ + StatusCode sc = m_trackExtrapolator.retrieve(); + if ( sc.isFailure() ) { + msg() << MSG::FATAL << "Unable to locate TrackExtrapolator tool " << endreq; + return HLT::BAD_JOB_SETUP; + } + + if ( msgLvl() <= MSG::DEBUG ) { + msg() << MSG::DEBUG << "Initialization completed successfully:" << endreq; + } + + //Declare histograms + + m_CaloTrackdETAHist = new TH1F("CaloTrackdETAMon", "Calo Track dETA", 50, 0, 0.4); + m_CaloTrackdETAHist->GetXaxis()->SetTitle("Calo Track dETA"); + m_CaloTrackdPHIHist = new TH1F("CaloTrackdPHIMon", "Calo Track dPHI", 50, 0, 0.2); + m_CaloTrackdPHIHist->GetXaxis()->SetTitle("Calo Track dPHI"); + m_CaloTrackdEoverPHist = new TH1F("CaloTrackdEoverPMon", "Calo Track dE over P", 50, 0, 2); + m_CaloTrackdEoverPHist->GetXaxis()->SetTitle("Calo Track dE over P"); + m_trackPtHist = new TH1F("trackPtMon", "Track Pt", 50, 0,40 ); + m_trackPtHist->GetXaxis()->SetTitle("Track Pt [GeV]"); + m_trackAlgoIDHist = new TH1F("trackAlgoIDMon", "Track Algo ID", 5, 0, 5 ); + m_trackAlgoIDHist->GetXaxis()->SetTitle("Track Algo ID"); + m_dETACLUSTERHist = new TH1F("dETACLUSTERMon", "dEta Cluster", 50, 0, 0.1); + m_dETACLUSTERHist->GetXaxis()->SetTitle("dEta Cluster"); + m_dPHICLUSTERHist = new TH1F("dPHICLUSTERMon", "dPhi Cluster", 50, 0, 0.1); + m_dPHICLUSTERHist->GetXaxis()->SetTitle("dPhi Cluster"); + + + + ITHistSvc *rootHistSvc; + if (!service("THistSvc", rootHistSvc, true).isSuccess()) { + msg() << MSG::ERROR << "Unable to locate THistSvc" << endreq; + return HLT::BAD_JOB_SETUP; + } + // book + std::string path = "/EXMON/lv2/L2ElectronHypo/technical/"; + if ( rootHistSvc->regHist(path+m_trackPtHist->GetName(),m_trackPtHist).isFailure()) + msg() << MSG::WARNING << "Can't book" << path+m_trackPtHist->GetName() << endreq; + if ( rootHistSvc->regHist(path+m_trackAlgoIDHist->GetName(),m_trackAlgoIDHist).isFailure()) + msg() << MSG::WARNING << "Can't book" << path+m_trackAlgoIDHist->GetName() << endreq; + if ( rootHistSvc->regHist(path+m_CaloTrackdETAHist->GetName(),m_CaloTrackdETAHist).isFailure()) + msg() << MSG::WARNING << "Can't book" << path+m_CaloTrackdETAHist->GetName() << endreq; + if ( rootHistSvc->regHist(path+m_CaloTrackdPHIHist->GetName(),m_CaloTrackdPHIHist).isFailure()) + msg() << MSG::WARNING << "Can't book" << path+m_CaloTrackdPHIHist->GetName() << endreq; + if ( rootHistSvc->regHist(path+m_CaloTrackdEoverPHist->GetName(),m_CaloTrackdEoverPHist).isFailure()) + msg() << MSG::WARNING << "Can't book" << path+m_CaloTrackdEoverPHist->GetName() << endreq; + if ( rootHistSvc->regHist(path+m_dETACLUSTERHist->GetName(),m_dETACLUSTERHist).isFailure()) + msg() << MSG::WARNING << "Can't book" << path+m_dETACLUSTERHist->GetName() << endreq; + if ( rootHistSvc->regHist(path+m_dPHICLUSTERHist->GetName(),m_dPHICLUSTERHist).isFailure()) + msg() << MSG::WARNING << "Can't book" << path+m_dPHICLUSTERHist->GetName() << endreq; + + msg() << MSG::DEBUG << "Histograms are booked" << endreq; + + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Initialization completed successfully:" << endreq; + // default=True (for now...May06) + msg() << MSG::DEBUG << "AcceptAll = " + << (m_acceptAll==true ? "True" : "False") << endreq; + msg() << MSG::DEBUG << "TrackPt = " << m_trackPtthr << endreq; + msg() << MSG::DEBUG << "EtaBins = " << m_etabin << endreq; + msg() << MSG::DEBUG << "CaloTrackdETA = " << m_calotrackdeta << endreq; + msg() << MSG::DEBUG << "CaloTrackdPHI = " << m_calotrackdphi << endreq; + msg() << MSG::DEBUG << "CaloTrackdEoverPLow = " << m_calotrackdeoverp_low << endreq; + msg() << MSG::DEBUG << "CaloTrackdEoverPHigh = " << m_calotrackdeoverp_high<< endreq; + msg() << MSG::DEBUG << "TrackAlgoId = " << m_trackalgoID << endreq; + msg() << MSG::DEBUG << "dETACLUSTERthr = " << m_detacluster << endreq; + msg() << MSG::DEBUG << "dPHICLUSTERthr = " << m_dphicluster << endreq; + + } + + return HLT::OK; +} + + + +HLT::ErrorCode TrigL2ElectronHypoMoni::hltFinalize() +{ + if ( msgLvl() <= MSG::INFO ){ + msg() << MSG::INFO << "in finalize()" << endreq; + + } + + return HLT::OK; +} + +HLT::ErrorCode TrigL2ElectronHypoMoni::hltExecute(const HLT::TriggerElement* outputTE, bool& pass) +{ + + // Accept-All mode: temporary patch; should be done with force-accept + if (m_acceptAll) { + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "AcceptAll property is set: taking all events" + << endreq; + + pass = true; + return HLT::OK; + } + else { + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "AcceptAll property not set: applying selection" + << endreq; + } + + // get RoI descriptor + const TrigRoiDescriptor* roiDescriptor = 0; + if (getFeature(outputTE, roiDescriptor) != HLT::OK) roiDescriptor = 0; + + if ( !roiDescriptor ) { + if ( msgLvl() <= MSG::WARNING) { + msg() << MSG::WARNING << "No RoI for this Trigger Element! " << endreq; + } + + return HLT::NAV_ERROR; + } + + if ( msgLvl() <= MSG::DEBUG ){ + msg() << MSG::DEBUG + << "Using outputTE("<< outputTE <<")->getId(): " << outputTE->getId() + << "; RoI ID = " << roiDescriptor->roiId() + << ": Eta = " << roiDescriptor->eta() + << ", Phi = " << roiDescriptor->phi() + << endreq; + } + + // RoI reference position + double etaRef = roiDescriptor->eta(); + double phiRef = roiDescriptor->phi(); + + const xAOD::TrigElectronContainer* trigElecColl = 0; + HLT::ErrorCode stat = getFeature(outputTE, trigElecColl, "L2ElectronFex"); + + if ( stat != HLT::OK ) { + if ( msgLvl() <= MSG::WARNING) { + msg() << MSG::WARNING << "Failed to get TrigElectron collection" << endreq; + } + + return HLT::OK; + } + + if ( msgLvl() <= MSG::DEBUG ) { + msg() << MSG::DEBUG << "Got collection with " << trigElecColl->size() + << " TrigElectrons" << endreq; + } + + // if no electrons were found, just leave TrigElectronColl. empty and leave + if ( trigElecColl->size() == 0 ) { + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "No electrons to analyse, leaving!" << endreq; + + return HLT::OK; + } + + // Now loop over electrons, see if at least one passes all cuts + + for (xAOD::TrigElectronContainer::const_iterator elecIter = trigElecColl->begin(); + elecIter != trigElecColl->end(); ++elecIter) { + + // Retrieve all quantities + float dPhi = (*elecIter)->phi() - phiRef; + dPhi = ( fabs(dPhi) < M_PI ? dPhi : 2*M_PI - dPhi ); + + float dEta = fabs( etaRef - (*elecIter)->eta() ); + + float dPhiCalo = (*elecIter)->trkClusDphi(); + float dEtaCalo = (*elecIter)->trkClusDeta(); + float absEta = fabs( (*elecIter)->eta() ); + float eT_T2Calo = (*elecIter)->emCluster()->et(); + float trkPt = fabs( (*elecIter)->pt() ); + float eTOverPt = fabs( eT_T2Calo/trkPt ); + + // figure out what eta bin this cluster is in + int etaBin = 0; + for (int iBin = 0; iBin < 4; iBin++ ) + if ( absEta > m_etabin[iBin] && absEta < m_etabin[iBin+1] ) etaBin = iBin; + + if ( msgLvl() <= MSG::DEBUG ) { + msg() << MSG::DEBUG << "absEta = " << absEta << " ==> etaBin = " << etaBin << endreq; + msg() << MSG::DEBUG << "eT_T2Calo = " << eT_T2Calo << endreq; + msg() << MSG::DEBUG << "dEta = " << dEta << ", cut = " << m_dphicluster << endreq; + msg() << MSG::DEBUG << "dPhi = " << dPhi << ", cut = " << m_dphicluster << endreq; + msg() << MSG::DEBUG << "trkPt = " << trkPt << ", cut = " << m_dphicluster << endreq; + msg() << MSG::DEBUG << "dEtaCalo = " << dEtaCalo << ", cut = " << m_calotrackdeta[etaBin] << endreq; + msg() << MSG::DEBUG << "dPhiCalo = " << dPhiCalo << ", cut = " << m_calotrackdphi[etaBin] << endreq; + msg() << MSG::DEBUG << "eTOverPt = " << eTOverPt << ", cuts = [" + << m_calotrackdeoverp_low[etaBin] << " , " << m_calotrackdeoverp_high[etaBin] << " ]" << endreq; + } + + m_dETACLUSTERHist->Fill(dEta); + m_dPHICLUSTERHist->Fill(dPhi); + m_trackPtHist->Fill(trkPt/1.e3); + m_CaloTrackdETAHist->Fill(dEtaCalo); + m_CaloTrackdPHIHist->Fill(dPhiCalo); + m_CaloTrackdEoverPHist->Fill(fabs(eTOverPt)); + + + if ( dEta < m_detacluster && dPhi < m_dphicluster && trkPt > m_trackPtthr && + dEtaCalo < m_calotrackdeta[etaBin] && dPhiCalo < m_calotrackdphi[etaBin] && + eTOverPt > m_calotrackdeoverp_low[etaBin] && + eTOverPt < m_calotrackdeoverp_high[etaBin] ) { + + if ( msgLvl() <= MSG::DEBUG ) { + msg() << MSG::DEBUG << "Event accepted !" << endreq; + } + + pass = true; + } + } + + + + + + return HLT::OK; +} diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2PhotonFex.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2PhotonFex.cxx new file mode 100755 index 00000000000..5e5b8c1c33b --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2PhotonFex.cxx @@ -0,0 +1,200 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + + +// -*- C++ -*- + +/************************************************************************** + ** + ** Original Author: R.Goncalo + ** + ** File: Trigger/TrigHypothesis/TrigEgammaHypo/TrigL2PhotonHypo.cxx + ** + ** Description: Fex algo for TrigPhotons + ** + ** Modified by: R.Goncalo + ** V. Perez-Reale + ** A.Hamilton + ** V. Dao (new TrigPhoton constructor used) + ** + ** Created: Thu Jun 06 16:01:12 BST 2006 + **************************************************************************/ + +#include "TrigEgammaHypo/TrigL2PhotonFex.h" +#include "xAODTrigEgamma/TrigPhotonAuxContainer.h" + + +class ISvcLocator; + + +TrigL2PhotonFex::TrigL2PhotonFex(const std::string & name, ISvcLocator* pSvcLocator) + : HLT::FexAlgo(name, pSvcLocator), + m_trigPhotonContainer (0) +{ + +} + + +TrigL2PhotonFex::~TrigL2PhotonFex() +{ + delete m_trigPhotonContainer; +} + + +HLT::ErrorCode TrigL2PhotonFex::hltInitialize() +{ + if ( msgLvl() <= MSG::DEBUG ) { + msg() << MSG::DEBUG << "Initializing" << endreq; + } + + return HLT::OK; +} + + +HLT::ErrorCode TrigL2PhotonFex::hltFinalize() +{ + if ( msgLvl() <= MSG::DEBUG ) { + msg() << MSG::DEBUG << "Finalizing" << endreq; + } + + return HLT::OK; +} + + +HLT::ErrorCode TrigL2PhotonFex::hltExecute(const HLT::TriggerElement* inputTE, + HLT::TriggerElement* outputTE) +{ + + HLT::ErrorCode status = HLT::OK; + xAOD::TrigPhotonAuxContainer trigPhotonAuxContainer; + + // always create a TrigPhotonContainer, even if it will be empty + if(!m_trigPhotonContainer) { + m_trigPhotonContainer = new xAOD::TrigPhotonContainer(); + m_trigPhotonContainer->setStore(&trigPhotonAuxContainer); + } + else { + m_trigPhotonContainer->clear(); + } + + // get RoI descriptor + const TrigRoiDescriptor* roiDescriptor = 0; + status = getFeature(inputTE, roiDescriptor); + + if ( status != HLT::OK ) { + if ( msgLvl() <= MSG::WARNING) { + msg() << MSG::WARNING << "No RoI for this Trigger Element! " << endreq; + } + return HLT::NAV_ERROR; + } + + if ( msgLvl() <= MSG::DEBUG ){ + msg() << MSG::DEBUG + << "Using inputTE("<< inputTE <<")->getId(): " << inputTE->getId() + << "; RoI ID = " << roiDescriptor->roiId() + << ": Eta = " << roiDescriptor->eta() + << ", Phi = " << roiDescriptor->phi() + << endreq; + } + + // fill local variables for RoI reference position + double etaRef = roiDescriptor->eta(); + double phiRef = roiDescriptor->phi(); + // correct phi the to right range (probably not needed anymore) + if ( fabs(phiRef) > M_PI ) phiRef -= 2*M_PI; // correct phi if outside range + + + // retrieve TrigEMCluster ElementLink from the TriggerElement + ElementLink< xAOD::TrigEMClusterContainer > elink_cluster; + status = getFeatureLink< xAOD::TrigEMClusterContainer, xAOD::TrigEMCluster >( inputTE, elink_cluster ); + + if( status == HLT::OK && elink_cluster.isValid() ){ +#ifdef DONTDO + if( msgLvl() <= MSG::DEBUG ){ + (*elink_cluster)->print( msg() ); + } +#endif + } + else { + if ( msgLvl() <= MSG::DEBUG){ + msg() << MSG::DEBUG << "Failed to get TrigEMCluster" << endreq; + } + return HLT::MISSING_FEATURE; + } + + // retrieve the TrigEMCluster from the ElementLink + const xAOD::TrigEMCluster* pClus = (*elink_cluster); + + if(pClus == 0){ + if ( msgLvl() <= MSG::WARNING ){ + msg() << MSG::WARNING << "Failed to retieve TrigEMCluster from ElementLink" << endreq; + } + return HLT::MISSING_FEATURE; + } + + float dEta = pClus->eta() - etaRef; + // Deal with angle diferences greater than Pi + float dPhi = fabs(pClus->phi() - phiRef); + dPhi = (dPhi < M_PI ? dPhi : 2*M_PI - dPhi ); + if ( msgLvl() <= MSG::DEBUG ) { + msg() << MSG::DEBUG << "TrigPhoton will be built with: dEta=" << dEta + << " and dPhi= " << dPhi << endreq; + } + + // create TrigPhoton from TrigEMCluster + xAOD::TrigPhoton* p_trigPhoton = new xAOD::TrigPhoton(); + // push TrigPhoton into TrigPhotonContainer + m_trigPhotonContainer->push_back(p_trigPhoton); + p_trigPhoton->init( roiDescriptor->roiId(), dPhi, dEta, elink_cluster); +// elink_cluster.getStorableObjectPointer(), +// elink_cluster.index() ); + + + + + // REGTEST output + if ( msgLvl() <= MSG::DEBUG ) { + msg() << MSG::DEBUG << "REGTEST: TrigPhotonContainer has " << m_trigPhotonContainer->size() + << " element" << endreq; + if (!m_trigPhotonContainer->empty()) { + xAOD::TrigPhoton* p_tp = m_trigPhotonContainer->front(); + msg() << MSG::DEBUG << "REGTEST: TrigPhoton: RoI=" << p_tp->roiWord() +// << "; valid=" << p_tp->isValid() + << "; eta=" << p_tp->eta() + << "; phi=" << p_tp->phi() + << "; Et=" << p_tp->emCluster()->et() + << "; Had Et=" << p_tp->etHad() + << "; EnergyRatio=" << p_tp->eratio() + << "; rCore=" << p_tp->rcore() + << endreq; + } + } + + + // attach TrigPhotonContainer to the output TriggerElement and + // record it in StoreGate with key "L2PhotonFex" + status = attachFeature( outputTE, m_trigPhotonContainer, "L2PhotonFex"); + m_trigPhotonContainer = 0; + + // this TrigPhotonContainer will contain 1 TrigPhoton, this is historical and + // should be changed to attach just the TrigPhoton, but requires an EDM change + // so has not been done yet. + + if( status == HLT::OK ){ + if( msgLvl() <= MSG::DEBUG ){ + msg() << MSG::DEBUG << "Attached TrigPhotonContainer to outputTE with ID: " << outputTE->getId() << endreq; + } + } + else { + if ( msgLvl() <= MSG::ERROR ){ + msg() << MSG::ERROR << "Failed to attach TrigPhotonContainer!" << endreq; + } + return status; + } + + return HLT::OK; +} + + + diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2PhotonHypo.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2PhotonHypo.cxx new file mode 100755 index 00000000000..6d4e362ce02 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2PhotonHypo.cxx @@ -0,0 +1,391 @@ +// -*- C++ -*- + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + + +/************************************************************************** + ** + ** Author: R.Goncalo + ** + ** File: Trigger/TrigHypothesis/TrigEgammaHypo/TrigL2PhotonHypo.cxx + ** + ** Description: Hypothesis algorithms to be run for Photon + ** signatures at Level 2 after T2Calo + ** + ** Authour: R.Goncalo + ** + ** Created: Thu Jun 06 16:01:12 BST 2006 + ** Modified: V. Perez-Reale, N. Berger Nov 24 2006 + ** Divided FEX and HYPO for attaching features + ** V.PEREZ REALE May 26 2007 + ** Added Histograms for Monitoring, Timing and bug fixes + ** V.Dao copied the structure of TrigL2CaloHypo 13/10/2009 + ** + **************************************************************************/ + +#include "TrigEgammaHypo/TrigL2PhotonHypo.h" + +#include <cmath> + +class ISvcLocator; + +template <class SRC> +inline const DataVector<xAOD::TrigPhoton>** dvec_cast(SRC** ptr) { + return (const DataVector<xAOD::TrigPhoton>**)(ptr); +} + + +TrigL2PhotonHypo::TrigL2PhotonHypo(const std::string & name, ISvcLocator* pSvcLocator): + HLT::HypoAlgo(name, pSvcLocator) +{ + + + // Read cuts - should probably get these from an xml file + declareProperty("AcceptAll", m_acceptAll=true); + declareProperty("EtCutOnly", m_etCutOnly=true); + declareProperty("EtaBins", m_etabin); + declareProperty("ETthr", m_eTthr); + declareProperty("ET2thr", m_eT2thr); + declareProperty("HADETthr", m_hadeTthr); + declareProperty("HADET2thr", m_hadeT2thr); + declareProperty("CARCOREthr", m_carcorethr); + declareProperty("CAERATIOthr", m_caeratiothr); + declareProperty("dETACLUSTERthr", m_detacluster=0.2); + declareProperty("dPHICLUSTERthr", m_dphicluster=0.2); + declareProperty("F1thr", m_F1thr); + + // declare monitoring histograms for all cut variables + declareMonitoredCollection("PhEt", *dvec_cast(&m_PhotonContainer), &xAOD::TrigPhoton::pt); + declareMonitoredCollection("PhEta", *dvec_cast(&m_PhotonContainer), &PhEta); + declareMonitoredCollection("PhPhi", *dvec_cast(&m_PhotonContainer), &PhPhi); + declareMonitoredCollection("dEta", *dvec_cast(&m_PhotonContainer), &xAOD::TrigPhoton::dEta); + declareMonitoredCollection("dPhi", *dvec_cast(&m_PhotonContainer), &xAOD::TrigPhoton::dPhi); + declareMonitoredCollection("PhRcore", *dvec_cast(&m_PhotonContainer), &xAOD::TrigPhoton::rcore); + declareMonitoredCollection("PhEratio",*dvec_cast(&m_PhotonContainer), &xAOD::TrigPhoton::eratio); + declareMonitoredCollection("PhHadEt", *dvec_cast(&m_PhotonContainer), &xAOD::TrigPhoton::etHad); + declareMonitoredCollection("PhF1", *dvec_cast(&m_PhotonContainer), &xAOD::TrigPhoton::f1); + declareMonitoredVariable("CutCounter",PassedCuts); +} + + +TrigL2PhotonHypo::~TrigL2PhotonHypo() +{ } + + +HLT::ErrorCode TrigL2PhotonHypo::hltInitialize() +{ + if ( msgLvl() <= MSG::DEBUG ) { + msg() << MSG::DEBUG << "Initialization completed successfully" << endreq; + msg() << MSG::DEBUG << "AcceptAll = " + << (m_acceptAll==true ? "True" : "False") << endreq; + // msg() << MSG::DEBUG << "SaveTrigPhotons = " + // << (m_saveTrigPh==true ? "True" : "False") << endreq; + msg() << MSG::DEBUG << "EtaBins = " << m_etabin << endreq; + msg() << MSG::DEBUG << "ETthr = " + << m_eTthr << "(lo)/" << m_eT2thr << "(hi)" << endreq; + msg() << MSG::DEBUG << "HADETthr = " + << m_hadeTthr << "(lo)/" << m_hadeT2thr << "(hi)" << endreq; + msg() << MSG::DEBUG << "CARCOREthr = " << m_carcorethr << endreq; + msg() << MSG::DEBUG << "CAERATIOthr = " << m_caeratiothr << endreq; + msg() << MSG::DEBUG << "dPHICLUSTERthr = " << m_dphicluster << endreq; + msg() << MSG::DEBUG << "dETACLUSTERthr = " << m_detacluster << endreq; + + } + + + unsigned int nEtaBin=m_etabin.size(); + if ( m_eTthr.size() != nEtaBin-1 ) { + msg() << MSG::ERROR << " etThr size is " << m_eTthr.size() << " but needs " << nEtaBin-1 << endreq; + return StatusCode::FAILURE; + } + + if ( m_eT2thr.size() != nEtaBin-1 ) { + msg() << MSG::ERROR << " et2Thr size is " << m_eT2thr.size() << " but needs " << nEtaBin-1 << endreq; + return StatusCode::FAILURE; + } + + if ( m_hadeTthr.size() != nEtaBin-1 ) { + msg() << MSG::ERROR << " hadetThr size is " << m_hadeTthr.size() << " but needs " << nEtaBin-1 << endreq; + return StatusCode::FAILURE; + } + + if ( m_hadeT2thr.size() != nEtaBin-1 ) { + msg() << MSG::ERROR << " hadet2Thr size is " << m_hadeT2thr.size() << " but needs " << nEtaBin-1 << endreq; + return StatusCode::FAILURE; + } + + if ( m_carcorethr.size() != nEtaBin-1 ) { + msg() << MSG::ERROR << " carcore size is " << m_carcorethr.size() << " but needs " << nEtaBin-1 << endreq; + return StatusCode::FAILURE; + } + + if ( m_caeratiothr.size() != nEtaBin-1 ) { + msg() << MSG::ERROR << " caeratio size is " << m_caeratiothr.size() << " but needs " << nEtaBin-1 << endreq; + return StatusCode::FAILURE; + } + + return HLT::OK; +} + + +HLT::ErrorCode TrigL2PhotonHypo::hltFinalize() +{ + if ( msgLvl() <= MSG::INFO ) + msg() << MSG::INFO << "In TrigL2PhotonHypo::finalize()" << endreq; + + return HLT::OK; +} + + + + + +HLT::ErrorCode TrigL2PhotonHypo::hltExecute(const HLT::TriggerElement* outputTE, bool& pass) +{ + m_PhotonContainer=0; + + // initialise monitoring variables for each event + dPhi = -1.0; + dEta = -1.0; + EmET = -1.0; + HadEmRatio = -1.0; + Reta = -1.0; + Eratio = -1.0; + f1 = -1.0; + PassedCuts = -1; + + // Accept-All mode + if (m_acceptAll) { + pass = true; + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "AcceptAll property is set: taking all events" + << endreq; + return HLT::OK; + } else { + pass = false; + if ( msgLvl() <= MSG::DEBUG ) { + msg() << MSG::DEBUG << "AcceptAll property not set: applying selection" + << endreq; + } + } + + // Get the TrigPhotonContainer from the Trigger Element (TE) + // - there is a vector of TrigPhotonContainers attached to the TE + // - but there should be only 1 TrigPhotonContainer in the vector (because of trigger persistency) + + std::vector<const xAOD::TrigPhotonContainer*> vecTrigPhotonCont; + HLT::ErrorCode status = getFeatures(outputTE, vecTrigPhotonCont, ""); + + if( status != HLT::OK ) { + if(msgLvl() <= MSG::WARNING) { + msg() << MSG::WARNING << "Failed to get TrigPhotonContainer from TE" << endreq; + } + return HLT::OK; + } + + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Retrieved vector with " << vecTrigPhotonCont.size() + << " TrigPhotonContainers from TE" << endreq; + } + + if(vecTrigPhotonCont.size()!=1){ + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Number of TrigPhotonContainers retrieved from TE is not 1, exiting" << endreq; + } + return HLT::OK; + } + + m_PhotonContainer = vecTrigPhotonCont.back(); + + + // Get the TrigPhoton from the TrigPhotonContainer + // - there should be only 1 TrigPhoton in the TrigPhotonContainer (because the TrigL2PhotonFex attaches a TrigPhotonContainer instead of a TrigPhoton - which should be changed, but requires an EDM change) + + if ( m_PhotonContainer == 0 ) { + if ( msgLvl() <= MSG::DEBUG ) { + msg() << MSG::DEBUG << "TrigPhotonContainer is NULL, exiting" << endreq; + } + return HLT::OK; + } + + if(m_PhotonContainer->size()!=1){ + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Number of TrigPhotons in TrigPhotonContainer is not 1, exiting" << endreq; + } + return HLT::OK; + } + + const xAOD::TrigPhoton* photon = m_PhotonContainer->back(); + + if ( photon == 0 ) { + if ( msgLvl() <= MSG::DEBUG ) { + msg() << MSG::DEBUG << "TrigPhoton is NULL, exiting" << endreq; + } + return HLT::OK; + } + + // Increment event counter + PassedCuts++; //// the ROI at least contais the TrigPhoton + +/* + if ( !photon->isValid() ) { + if ( msgLvl() <= MSG::DEBUG ) { + msg() << MSG::DEBUG << "TrigPhoton has Valid flag = FALSE" << endreq; + } + return HLT::OK; + } +*/ + PassedCuts++; //// the TrigPhoton is valid + + + // Determine which eta bin to apply the cuts + float absEta = fabs( photon->eta() ); + int etaBin = -1; + for (std::size_t iBin = 0; iBin < m_etabin.size()-1; iBin++) + if ( absEta > m_etabin[iBin] && absEta < m_etabin[iBin+1] ) etaBin = iBin; + + // getting photon variable + Eta = photon->eta(); + Phi = photon->phi(); + dEta = photon->dEta(); + dPhi = photon->dPhi(); + Eratio = photon->eratio(); + Reta = photon->rcore(); + EmET = photon->pt(); + HadET = photon->etHad(); + f1 = photon->f1(); + + if(m_etCutOnly) { + // ET_em + if ( msgLvl() <= MSG::DEBUG ){ + msg() << MSG::DEBUG << "EtCutOnly property is set: TrigPhoton: ET_em=" << EmET + << " cut in etaBin " << etaBin << " is ET_em >= " << m_eTthr[0] << endreq; + } + if ( EmET < m_eTthr[0]) return HLT::OK; + pass = true; + return HLT::OK; + } + + //now use the ratio, not the absolute HadEt (this is not yet persistified in the TrigPhoton) + float HadEmRatio = (EmET!=0) ? HadET/EmET : -1.0; + + // apply cuts: DeltaEta(clus-ROI) + if ( msgLvl() <= MSG::DEBUG ) { + msg() << MSG::DEBUG << "TrigPhoton dEta=" << dEta + << " cut is dEta <= " << m_detacluster << endreq; + } + if ( fabs(dEta) > m_detacluster ) return HLT::OK; + PassedCuts++; + + // DeltaPhi(clus-ROI) + if ( msgLvl() <= MSG::DEBUG ) { + msg() << MSG::DEBUG << "TrigPhoton dPhi=" << dPhi + << " cut is dPhi <= " << m_dphicluster << endreq; + } + if( fabs(dPhi) > m_dphicluster ) return HLT::OK; + PassedCuts++; + + // eta range + if ( etaBin==-1 ) { + msg() << MSG::DEBUG << "Photon eta: " << absEta << " outside eta range " << m_etabin[m_etabin.size()-1] << endreq; + return HLT::OK; + } else { + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "eta bin used for cuts " << etaBin << endreq; + } + PassedCuts++; // passed eta cut + + // Reta (was previously called Rcore) + if ( msgLvl() <= MSG::DEBUG ){ + msg() << MSG::DEBUG << "TrigPhoton Reta=" << Reta + << " cut in etaBin " << etaBin << " is Reta >= " << m_carcorethr[etaBin] << endreq; + } + if ( Reta < m_carcorethr[etaBin] ) return HLT::OK; + PassedCuts++; + + // Eratio + if ( msgLvl() <= MSG::DEBUG ){ + msg() << MSG::DEBUG << "TrigPhoton: Eratio=" << Eratio + << " cut in etaBin " << etaBin << " is Eratio >= " << m_caeratiothr[etaBin] << endreq; + } + bool inCrack = ( absEta > 2.37 || ( absEta > 1.37 && absEta < 1.52) ); + if ( inCrack || f1<m_F1thr[0] ) { + msg() << MSG::DEBUG << "TrigPhoton: InCrack= " << inCrack << " F1=" << f1 + << " Eratio cut not being applied" << endreq; + } else { + if ( Eratio < m_caeratiothr[etaBin] ) return HLT::OK; + } + PassedCuts++; + if(inCrack) Eratio = -1; //Set default value in crack for monitoring. + + // ET_em + if ( msgLvl() <= MSG::DEBUG ){ + msg() << MSG::DEBUG << "TrigPhoton: ET_em=" << EmET + << " cut in etaBin " << etaBin << " is ET_em >= " << m_eTthr[etaBin] << endreq; + } + if ( EmET < m_eTthr[etaBin]) return HLT::OK; + PassedCuts++; + + + // ET_had + // find which ET_had to apply : this depends on the ET_em and the eta bin + float hadET_cut=-1; + if ( EmET > m_eT2thr[etaBin] ) { + hadET_cut = m_hadeT2thr[etaBin] ; + + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "ET_em>" << m_eT2thr[etaBin] + << ": use high ET_had cut: <" << hadET_cut << endreq; + } else { + hadET_cut = m_hadeTthr[etaBin]; + + if ( msgLvl() <= MSG::DEBUG ) + msg() << MSG::DEBUG << "ET_em<" << m_eT2thr[etaBin] + << ": use low ET_had cut: <" << hadET_cut << endreq; + } + + if ( msgLvl() <= MSG::DEBUG ){ + msg() << MSG::DEBUG << "TrigPhoton: ET_had=" << HadEmRatio + << " cut in etaBin " << etaBin << " is ET_had <=" << hadET_cut << endreq; + } + if ( HadEmRatio > hadET_cut ) return HLT::OK; + PassedCuts++; + + + // F1 + if ( msgLvl() <= MSG::DEBUG ){ + msg() << MSG::DEBUG << "TrigPhoton: F1=" << f1 + << " cut: >" << m_F1thr[0] << endreq; + } + // if ( f1 < m_F1thr[0]) return HLT::OK; //(VD) not cutting on this (see comment on TrigL2CaloHypo) + if ( msgLvl() <= MSG::DEBUG ){ + msg() << MSG::DEBUG << "F1 cut is NOT being applied" << endreq; + } + PassedCuts++; + + pass = true; + + if ( msgLvl() <= MSG::DEBUG ){ + msg() << MSG::DEBUG << "pass = " << pass << endreq; + } + + return HLT::OK; +} + + + + + + + + + + + + + + + + diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/components/TrigEgammaHypo_entries.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/components/TrigEgammaHypo_entries.cxx new file mode 100755 index 00000000000..dafa434e7e5 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/components/TrigEgammaHypo_entries.cxx @@ -0,0 +1,57 @@ +#include "TrigEgammaHypo/TrigL2CaloHypo.h" +#include "TrigEgammaHypo/TrigL2ElectronFex.h" +#include "TrigEgammaHypo/TrigL2ElectronHypo.h" +#include "TrigEgammaHypo/TrigL2ElectronHypoMoni.h" +#include "TrigEgammaHypo/TrigL2PhotonFex.h" +#include "TrigEgammaHypo/TrigL2PhotonHypo.h" +#include "TrigEgammaHypo/TrigL2DielectronMassHypo.h" +#include "TrigEgammaHypo/TrigL2DielectronMassFex.h" +#include "TrigEgammaHypo/TrigEFDielectronMassHypo.h" +#include "TrigEgammaHypo/TrigEFDielectronMassFex.h" +#include "TrigEgammaHypo/TrigEFHadronicRecoil.h" +#include "TrigEgammaHypo/TrigEFCaloHypo.h" +#include "TrigEgammaHypo/TrigEFElectronHypo.h" +#include "TrigEgammaHypo/TrigEFPhotonHypo.h" +#include "TrigEgammaHypo/TrigEFTrackHypo.h" +#include "TrigEgammaHypo/TrigL2PhotonFex.h" +#include "TrigEgammaHypo/TrigL2CaloLayersHypo.h" + +#include "GaudiKernel/DeclareFactoryEntries.h" + + +DECLARE_ALGORITHM_FACTORY( TrigL2CaloHypo ) +DECLARE_ALGORITHM_FACTORY( TrigL2ElectronFex ) +DECLARE_ALGORITHM_FACTORY( TrigL2ElectronHypo ) +DECLARE_ALGORITHM_FACTORY( TrigL2ElectronHypoMoni ) +DECLARE_ALGORITHM_FACTORY( TrigL2PhotonFex ) +DECLARE_ALGORITHM_FACTORY( TrigL2PhotonHypo ) +DECLARE_ALGORITHM_FACTORY( TrigL2DielectronMassHypo ) +DECLARE_ALGORITHM_FACTORY( TrigL2DielectronMassFex ) +DECLARE_ALGORITHM_FACTORY( TrigEFDielectronMassHypo ) +DECLARE_ALGORITHM_FACTORY( TrigEFDielectronMassFex ) +DECLARE_ALGORITHM_FACTORY( TrigEFHadronicRecoil ) +DECLARE_ALGORITHM_FACTORY( TrigEFCaloHypo ) +DECLARE_ALGORITHM_FACTORY( TrigEFElectronHypo ) +DECLARE_ALGORITHM_FACTORY( TrigEFPhotonHypo ) +DECLARE_ALGORITHM_FACTORY( TrigEFTrackHypo ) +DECLARE_ALGORITHM_FACTORY( TrigL2CaloLayersHypo ) + +DECLARE_FACTORY_ENTRIES( TrigEgammaHypo ) { + DECLARE_ALGORITHM( TrigL2CaloHypo ) + DECLARE_ALGORITHM( TrigL2ElectronFex ) + DECLARE_ALGORITHM( TrigL2ElectronHypo ) + DECLARE_ALGORITHM( TrigL2ElectronHypoMoni ) + DECLARE_ALGORITHM( TrigL2PhotonFex ) + DECLARE_ALGORITHM( TrigL2PhotonHypo ) + DECLARE_ALGORITHM( TrigL2DielectronMassHypo ) + DECLARE_ALGORITHM( TrigL2DielectronMassFex ) + DECLARE_ALGORITHM( TrigEFDielectronMassHypo ) + DECLARE_ALGORITHM( TrigEFDielectronMassFex ) + DECLARE_ALGORITHM( TrigEFHadronicRecoil ) + DECLARE_ALGORITHM( TrigEFCaloHypo ) + DECLARE_ALGORITHM( TrigEFElectronHypo ) + DECLARE_ALGORITHM( TrigEFPhotonHypo ) + DECLARE_ALGORITHM( TrigEFTrackHypo ) + DECLARE_ALGORITHM( TrigL2CaloLayersHypo ) +} + diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/components/TrigEgammaHypo_load.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/components/TrigEgammaHypo_load.cxx new file mode 100755 index 00000000000..93e3dc76389 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/components/TrigEgammaHypo_load.cxx @@ -0,0 +1,4 @@ +#include "GaudiKernel/LoadFactoryEntries.h" + +LOAD_FACTORY_ENTRIES( TrigEgammaHypo ) + -- GitLab