Skip to content
Snippets Groups Projects
Commit 08ba2cee authored by Attila Krasznahorkay's avatar Attila Krasznahorkay
Browse files

Started the DataHandle update of RoIBResultToxAOD.

I coupled it with a general rehaul of the code. Not tested yet, as I'll
need to modify the TrigTier0 package as well for that.
parent d03074bb
No related branches found
No related tags found
No related merge requests found
// Dear emacs, this is -*- c++ -*-
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
*/
// $Id: RoIBResultToxAOD.h 679933 2015-07-02 21:37:29Z watsona $
//
// Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
//
#ifndef ANALYSISTRIGGERALGS_ROIBRESULTTOXAOD_H
#define ANALYSISTRIGGERALGS_ROIBRESULTTOXAOD_H
// Gaudi/Athena include(s):
#include "AthenaBaseComps/AthAlgorithm.h"
#include "AthenaBaseComps/AthReentrantAlgorithm.h"
#include "GaudiKernel/ServiceHandle.h"
#include "GaudiKernel/ToolHandle.h"
#include "StoreGate/DataHandle.h"
// xAOD include(s):
#include "xAODTriggerCnv/IMuonRoICnvTool.h"
#include "StoreGate/ReadHandleKey.h"
#include "StoreGate/WriteHandleKey.h"
#include "TrigT1CaloToolInterfaces/IL1JEMJetTools.h"
// Tool/service include(s):
#include "TrigConfInterfaces/ILVL1ConfigSvc.h"
#include "TrigT1Interfaces/RecMuonRoiSvc.h"
#include "TrigT1Interfaces/TrigT1CaloDefs.h"
#include "TrigT1CaloToolInterfaces/IL1CPMTools.h"
#include "TrigT1CaloToolInterfaces/IL1JEMJetTools.h"
// Forward declaration(s):
class StoreGateSvc;
class LVL1_ROI;
namespace TrigConf {
class ILVL1ConfigSvc;
}
namespace ROIB {
class RoIBResult;
}
// EDM include(s):
#include "TrigT1Result/RoIBResult.h"
#include "xAODTrigL1Calo/CPMTowerContainer.h"
#include "xAODTrigL1Calo/JetElementContainer.h"
#include "xAODTrigger/MuonRoIContainer.h"
#include "xAODTrigger/EmTauRoIContainer.h"
#include "xAODTrigger/EnergySumRoI.h"
#include "xAODTrigger/JetEtRoI.h"
#include "xAODTrigger/JetRoIContainer.h"
/**
* @short RoIB result to xAOD converter
......@@ -45,74 +43,149 @@ namespace ROIB {
*
* The CTP_Decision and LVL1_ROI objects are stored in ESD/AOD.
*
* $Id: RoIBResultToxAOD.h 679933 2015-07-02 21:37:29Z watsona $
*
* @author Tadashi Maeno <Tadashi.Maeno@cern.ch>
* @author Attila Kraznahorkay Jr. <Attila.Krasznahorkay@cern.ch>
* @author Alan Watson <Alan.Watson@cern.ch>
* @author Wolfgang Ehrenfeld <Wolfgang.Menges@desy.de>
* @author last commit \$Author: watsona $
*
*/
class RoIBResultToxAOD : public AthAlgorithm {
class RoIBResultToxAOD : public AthReentrantAlgorithm {
public:
RoIBResultToxAOD( const std::string& name, ISvcLocator* pSvcLocator );
/// Algorithm constructor
RoIBResultToxAOD( const std::string& name, ISvcLocator* svcLoc );
/// @name Function(s) implementing the @c Algorithm interface
/// @{
/// Function initialising the algorithm
virtual StatusCode initialize() override;
/// Function executing the algorithm
virtual StatusCode execute_r( const EventContext& ctx ) const override;
StatusCode initialize();
StatusCode finalize();
StatusCode execute();
/// @}
private:
/// build CTP_Decision from CTPResult stored in ROIB::RoIBResult
StatusCode buildCTP_Decision();
/// add EmTauRoi to LVL1_ROI from EmTauResult stored in ROIB::RoIBResult
StatusCode addEmTauRoI(const ROIB::RoIBResult*);
/// add JetEnergyRoi to LVL1_ROI from JetEnergyResult stored in ROIB::RoIBResult
StatusCode addJetEnergyRoI(const ROIB::RoIBResult*);
/// add MuonRoi to LVL1_ROI from MuCTPIResult stored in ROIB::RoIBResult
void addMuonRoI(const ROIB::RoIBResult*, LVL1_ROI*);
/// convert AOD ROI objects to xAOD objects
StatusCode convertToxAOD(LVL1_ROI*);
// services
ServiceHandle<TrigConf::ILVL1ConfigSvc> m_configSvc; //!< property, see @link RoIBResultToxAOD::RoIBResultToxAOD @endlink
ServiceHandle<LVL1::RecMuonRoiSvc> m_recRPCRoiSvc; //!< property, see @link RoIBResultToxAOD::RoIBResultToxAOD @endlink
ServiceHandle<LVL1::RecMuonRoiSvc> m_recTGCRoiSvc; //!< property, see @link RoIBResultToxAOD::RoIBResultToxAOD @endlink
// tools
ToolHandle<LVL1::IL1CPMTools> m_EmTauTool; //!< property, see @link RoIBResultToxAOD::RoIBResultToxAOD @endlink
ToolHandle<LVL1::IL1JEMJetTools> m_JetTool; //!< property, see @link RoIBResultToxAOD::RoIBResultToxAOD @endlink
bool m_retrievedEmTauTool;
bool m_retrievedJetTool;
// xAOD conversion tools:
std::string m_xaodKeyMu;
std::string m_xaodKeyEmTau;
std::string m_xaodKeyEsum;
std::string m_xaodKeyJetEt;
std::string m_xaodKeyJet;
ToolHandle< xAODMaker::IMuonRoICnvTool > m_MuCnvTool;
// Data object StoreGate keys
std::string m_CPMTowerLocation;
std::string m_JetElementLocation;
std::string m_roibInputKey;
std::string m_lvl1RoIOutputKey;
// properties
bool m_doCalo; //!< property, see @link RoIBResultToxAOD::RoIBResultToxAOD @endlink
bool m_doMuon; //!< property, see @link RoIBResultToxAOD::RoIBResultToxAOD @endlink
// trigger items for each TTW bit
std::vector< std::string > m_egammaItem; //!< property, see @link RoIBResultToxAOD::RoIBResultToxAOD @endlink
std::vector< std::string > m_tauhadItem; //!< property, see @link RoIBResultToxAOD::RoIBResultToxAOD @endlink
std::vector< std::string > m_jetItem; //!< property, see @link RoIBResultToxAOD::RoIBResultToxAOD @endlink
std::vector< std::string > m_esumItem; //!< property, see @link RoIBResultToxAOD::RoIBResultToxAOD @endlink
std::vector< std::string > m_highmuItem; //!< property, see @link RoIBResultToxAOD::RoIBResultToxAOD @endlink
std::vector< std::string > m_lowmuItem; //!< property, see @link RoIBResultToxAOD::RoIBResultToxAOD @endlink
/// Create the EmTau RoI objects
StatusCode createEmTauRoI( const ROIB::RoIBResult& roib,
const EventContext& ctx ) const;
/// Create the JetEnergy RoI object
StatusCode createJetEnergyRoI( const ROIB::RoIBResult& roib,
const EventContext& ctx ) const;
/// Create the Muon RoI objects
StatusCode createMuonRoI( const ROIB::RoIBResult& roib,
const EventContext& ctx ) const;
/// @name Services
/// @{
/// The trigger configuration service
ServiceHandle< TrigConf::ILVL1ConfigSvc > m_configSvc {
this, "LVL1ConfigSvc", "TrigConf::LVL1ConfigSvc/LVL1ConfigSvc",
"Service providing the LVL1 trigger configuration" };
/// The RPC RoI reconstruction service
ServiceHandle< LVL1::RecMuonRoiSvc > m_recRPCRoiSvc {
this, "RecRpcRoiSvc", LVL1::ID_RecRpcRoiSvc,
"RPC RoI reconstruction service" };
/// The TGC RoI reconstruction service
ServiceHandle< LVL1::RecMuonRoiSvc > m_recTGCRoiSvc {
this, "RecTgcRoiSvc", LVL1::ID_RecTgcRoiSvc,
"TGC RoI reconstruction service" };
/// @}
/// @name Tools
/// @{
/// Tool for calculation of EmTau trigger sums per RoI
ToolHandle< LVL1::IL1CPMTools > m_emTauTool {
this, "L1CPMTools", "LVL1::L1CPMTools/L1CPMTools",
"Tool for calculation of EmTau trigger sums per RoI" };
/// Tool for calculation of Jet cluster sums per RoI
ToolHandle< LVL1::IL1JEMJetTools > m_jetTool {
this, "L1JEMJetTools", "LVL1::L1JEMJetTools/L1JEMJetTools",
"Tool for calculation of Jet cluster sums per RoI" };
/// @}
/// @name Read handle keys
/// @{
/// Read key for the ROIB::RoIBResult object
SG::ReadHandleKey< ROIB::RoIBResult > m_roibResultKey {
this, "RoIBResultInputKey", "RoIBResult",
"Key for the ROIB::RoIBResult input object" };
/// Read key for the xAOD::CPMTowerContainer object
SG::ReadHandleKey< xAOD::CPMTowerContainer > m_cpmTowerKey {
this, "CPMTowerLocation", LVL1::TrigT1CaloDefs::CPMTowerLocation,
"Key for the xAOD::CPMTowerContainer input object" };
/// Read key for the xAOD::JetElementContainer object
SG::ReadHandleKey< xAOD::JetElementContainer > m_jetElementKey {
this, "JetElementLocation", LVL1::TrigT1CaloDefs::JetElementLocation,
"Key for the xAOD::JetElementContainer input object" };
/// @}
/// @name Write handle keys
/// @{
/// Write key for the xAOD::MuonRoIContainer object
SG::WriteHandleKey< xAOD::MuonRoIContainer > m_muonRoIKey {
this, "xAODKeyMuon", "LVL1MuonRoIs",
"Key for the xAOD::MuonRoIContainer output object" };
/// Write key for the xAOD::EmTauRoIContainer object
SG::WriteHandleKey< xAOD::EmTauRoIContainer > m_emtauRoIKey {
this, "xAODKeyEmTau", "LVL1EmTauRoIs",
"Key for the xAOD::EmTauRoIContainer output object" };
/// Write key for the xAOD::EnergySumRoI object
SG::WriteHandleKey< xAOD::EnergySumRoI > m_energysumRoIKey {
this, "xAODKeyEsum", "LVL1EnergySumRoI",
"Key for the xAOD::EnergySumRoI output object" };
/// Write key for the xAOD::JetEtRoI object
SG::WriteHandleKey< xAOD::JetEtRoI > m_jetetRoIKey {
this, "xAODKeyJetEt", "LVL1JetEtRoI",
"Key for the xAOD::JetEtRoI output object" };
/// Write key for the xAOD::JetRoIContainer object
SG::WriteHandleKey< xAOD::JetRoIContainer > m_jetRoIKey {
this, "xAODKeyJet", "LVL1JetRoIs",
"Key for the xAOD::JetRoIContainer output object" };
/// @}
/// @name Other properties
/// @{
/// Use inputs from the Calo system
Gaudi::Property< bool > m_doCalo {
this, "DoCalo", true, "Use inputs from the Calo system" };
/// Use inputs from the Muon system
Gaudi::Property< bool > m_doMuon {
this, "DoMuon", true, "Use inputs from the Muon system" };
/// List of LVL1 items for e/gamma trigger type
Gaudi::Property< std::vector< std::string > > m_egammaItem {
this, "EGammaItem", {}, "List of LVL1 items for e/gamma trigger type" };
/// List of LVL1 items for tau trigger type
Gaudi::Property< std::vector< std::string > > m_tauhadItem {
this, "TauHadItem", {}, "List of LVL1 items for tau trigger type" };
/// List of LVL1 items for jet trigger type
Gaudi::Property< std::vector< std::string > > m_jetItem {
this, "JetItem", {}, "List of LVL1 items for jet trigger type" };
/// List of LVL1 items for energy sum trigger type
Gaudi::Property< std::vector< std::string > > m_esumItem {
this, "ESumItem", {}, "List of LVL1 items for energy sum trigger type" };
/// List of LVL1 items for high pt muon trigger type
Gaudi::Property< std::vector< std::string > > m_highmuItem {
this, "HighMuItem", {},
"List of LVL1 items for high pt muon trigger type" };
/// List of LVL1 items for low pt muon trigger type
Gaudi::Property< std::vector< std::string > > m_lowmuItem {
this, "LowMuItem", {},
"List of LVL1 items for low pt muon trigger type" };
/// @}
}; // class RoIBResultToxAOD
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment