Commit 8b90ad2b authored by Scott Snyder's avatar Scott Snyder Committed by Johannes Elmsheuser
Browse files

TrigT1CaloCalibTools+TrigT1CaloCalibUtils+TrigT1CaloCalibToolInterfaces:...

TrigT1CaloCalibTools+TrigT1CaloCalibUtils+TrigT1CaloCalibToolInterfaces: Remove use of LArCablingLegacyService.
parent 79ec0f26
/*
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
// ***************************************************************************
// * Author: John Morris (john.morris@cern.ch) *
......@@ -10,8 +10,8 @@
// Pure abstract base class interface to L1CaloCells2TriggerTowers
//
#ifndef _TRIGGER_TRIGT1_TRIGT1CALOCALIBTOOLINTERFACES_IL1CALOCELLS2TRIGGERTOWERS_H_
#define _TRIGGER_TRIGT1_TRIGT1CALOCALIBTOOLINTERFACES_IL1CALOCELLS2TRIGGERTOWERS_H_
#ifndef TRIGT1CALOCALIBTOOLINTERFACES_IL1CALOCELLS2TRIGGERTOWERS_H
#define TRIGT1CALOCALIBTOOLINTERFACES_IL1CALOCELLS2TRIGGERTOWERS_H
// Framework include(s):
#include "AsgTools/IAsgTool.h"
......@@ -25,6 +25,7 @@ class CaloCell;
class Identifier;
class LArDigit;
class TileDigits;
class LArOnOffIdMapping;
namespace LVL1{
......@@ -48,6 +49,7 @@ namespace LVL1{
virtual float energy(const Identifier& ttId) const = 0;
virtual float et(const Identifier& ttId) const = 0;
virtual void matchCell2Tower(const CaloCell* caloCell, Identifier& ttId1, Identifier& ttId2) const = 0;
virtual void matchCell2Tower(const LArOnOffIdMapping& cabling, const CaloCell* caloCell, Identifier& ttId1, Identifier& ttId2) const = 0;
// Return a vector digits belonging the to requested trigger tower
virtual std::vector<double> samples(const Identifier& ttId) const = 0;
virtual std::vector<const LArDigit*> larDigits(const Identifier& ttId) const = 0;
......
/*
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
// ***************************************************************************
// * Author: John Morris (john.morris@cern.ch) *
......@@ -10,8 +10,8 @@
// Pure abstract base class interface to L1CaloLArTowerEnergy
//
#ifndef _TRIGGER_TRIGT1_TRIGT1CALOCALIBTOOLINTERFACES_IL1CALOLARTOWERENERGY_H_
#define _TRIGGER_TRIGT1_TRIGT1CALOCALIBTOOLINTERFACES_IL1CALOLARTOWERENERGY_H_
#ifndef TRIGT1CALOCALIBTOOLINTERFACES_IL1CALOLARTOWERENERGY_H
#define TRIGT1CALOCALIBTOOLINTERFACES_IL1CALOLARTOWERENERGY_H
// Framework include(s):
......@@ -21,6 +21,7 @@
class CaloCellContainer;
class Identifier;
class LArOnOffIdMapping;
namespace LVL1{
......@@ -33,6 +34,8 @@ namespace LVL1{
virtual bool initL1CaloLArTowerEnergy(const CaloCellContainer& cellContainer, const TriggerTowerCollection &triggerTowerCollection) = 0;
virtual float EtLArg(const Identifier& TTid) const = 0;
virtual bool hasMissingFEB(const Identifier& TTid) const = 0;
virtual bool hasMissingFEB(const LArOnOffIdMapping& cabling,
const Identifier& TTid) const = 0;
protected:
virtual void reset() = 0;
......
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
// ***************************************************************************
// * Author: John Morris (john.morris@cern.ch) *
......@@ -97,8 +97,7 @@ namespace LVL1{
virtual float hadLArTowerEnergy(const TriggerTower* tt) const = 0;
virtual float tileCellEnergy(const TriggerTower* tt,IdTTL1CellMapType& map) const = 0;
// Bad Calo, High Voltage Information
virtual int emBadCalo(const TriggerTower* tt) const = 0;
// High Voltage Information
virtual float emCaloQuality(const TriggerTower* tt) const = 0;
virtual float emNCellsNonNominal(const TriggerTower* tt) const = 0;
virtual std::vector<float> emNCellsNonNominalByLayer(const TriggerTower* tt) const = 0;
......@@ -108,7 +107,6 @@ namespace LVL1{
virtual std::vector<float> emNonNominalMeanScaleByReceiver(const TriggerTower* tt) const = 0;
virtual std::vector<std::vector<float> > emNonNominalMeanScaleByReceiverByLayer(const TriggerTower* tt) const = 0;
virtual int hadBadCalo(const TriggerTower* tt,IdTTL1CellMapType& map) const = 0;
virtual float hadCaloQuality(const TriggerTower* tt) const = 0;
virtual float hadNCellsNonNominal(const TriggerTower* tt) const = 0;
virtual std::vector<float> hadNCellsNonNominalByLayer(const TriggerTower* tt) const = 0;
......
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#ifndef _TRIGGER_TRIGT1_TRIGT1CALOCALIBTOOLS_L1CALOCELLS2TRIGGERTOWERS_H_
#define _TRIGGER_TRIGT1_TRIGT1CALOCALIBTOOLS_L1CALOCELLS2TRIGGERTOWERS_H_
#ifndef TRIGT1CALOCALIBTOOLS_L1CALOCELLS2TRIGGERTOWERS_H
#define TRIGT1CALOCALIBTOOLS_L1CALOCELLS2TRIGGERTOWERS_H
// Athena Includes
#include "AsgTools/AsgTool.h"
#include "GaudiKernel/ToolHandle.h"
#include "CxxUtils/checker_macros.h"
#include "StoreGate/StoreGateSvc.h"
#include "StoreGate/ReadCondHandleKey.h"
// Calo includes
#include "CaloIdentifier/CaloIdManager.h"
......@@ -22,7 +21,7 @@
// LAr includes
#include "LArRawEvent/LArDigitContainer.h"
#include "LArRawEvent/LArDigit.h"
#include "LArCabling/LArCablingLegacyService.h"
#include "LArCabling/LArOnOffIdMapping.h"
// Tile includes
#include "TileEvent/TileDigitsContainer.h"
......@@ -49,7 +48,7 @@
namespace LVL1 {
class ATLAS_NOT_THREAD_SAFE // use of LArCablingBase
class
L1CaloCells2TriggerTowers final : virtual public IL1CaloCells2TriggerTowers, public asg::AsgTool
{
/// Create a proper constructor for Athena
......@@ -65,57 +64,58 @@ public:
L1CaloCells2TriggerTowers(L1CaloCells2TriggerTowers&& rhs) = delete;
L1CaloCells2TriggerTowers& operator=(const L1CaloCells2TriggerTowers& rhs) = delete;
virtual StatusCode initialize();
virtual StatusCode finalize();
virtual StatusCode initialize() override;
virtual StatusCode finalize() override;
// To associate CaloCell to the trigger tower they belong to
// This method must be called before any other method in order
// to setup correctly the CaloCell-TT map
bool initCaloCellsTriggerTowers(const CaloCellContainer& cellContainer);
bool initLArDigitsTriggerTowers(const LArDigitContainer& larDigitContainer);
bool initTileDigitsTriggerTowers(const TileDigitsContainer& tileDigitsContainer);
virtual bool initCaloCellsTriggerTowers(const CaloCellContainer& cellContainer) override;
virtual bool initLArDigitsTriggerTowers(const LArDigitContainer& larDigitContainer) override;
virtual bool initTileDigitsTriggerTowers(const TileDigitsContainer& tileDigitsContainer) override;
// John Morris <john.morris@cern.ch> 15/2/2011
// Moving most useful functions to the top of this file for clarity
std::vector<const CaloCell*> caloCells(const Identifier& ttId) const;
std::vector<std::vector<const CaloCell*> > caloCellsByLayer(const Identifier& ttId) const;
virtual std::vector<int> layerNames(const Identifier& ttID) const;
virtual int layerNames(const CaloCell* cell) const;
virtual float energy(const std::vector<const CaloCell*> &cells) const;
virtual float et(const std::vector<const CaloCell*> &cells) const;
virtual float energy(const Identifier& ttId) const;
virtual float et(const Identifier& ttId) const;
void matchCell2Tower(const CaloCell* caloCell, Identifier& ttId1, Identifier& ttId2) const;
virtual std::vector<const CaloCell*> caloCells(const Identifier& ttId) const override;
virtual std::vector<std::vector<const CaloCell*> > caloCellsByLayer(const Identifier& ttId) const override;
virtual std::vector<int> layerNames(const Identifier& ttID) const override;
virtual int layerNames(const CaloCell* cell) const override;
virtual float energy(const std::vector<const CaloCell*> &cells) const override;
virtual float et(const std::vector<const CaloCell*> &cells) const override;
virtual float energy(const Identifier& ttId) const override;
virtual float et(const Identifier& ttId) const override;
virtual void matchCell2Tower(const CaloCell* caloCell, Identifier& ttId1, Identifier& ttId2) const override;
virtual void matchCell2Tower(const LArOnOffIdMapping& cabling, const CaloCell* caloCell, Identifier& ttId1, Identifier& ttId2) const override;
// Return a vector digits belonging the to requested trigger tower
std::vector<double> samples(const Identifier& ttId) const;
std::vector<const LArDigit*> larDigits(const Identifier& ttId) const;
std::vector<const TileDigits*> tileDigits(const Identifier& ttId) const;
virtual std::vector<double> samples(const Identifier& ttId) const override;
virtual std::vector<const LArDigit*> larDigits(const Identifier& ttId) const override;
virtual std::vector<const TileDigits*> tileDigits(const Identifier& ttId) const override;
void dumpCaloCells() const;
void dumpCaloCells(const Identifier& ttId) const;
virtual void dumpCaloCells() const override;
virtual void dumpCaloCells(const Identifier& ttId) const override;
void dumpDigits(const Identifier& ttId) const;
virtual void dumpDigits(const Identifier& ttId) const override;
void dumpLArDigits(const Identifier& ttId) const; /* ttId must be a LAr TTId */
void dumpLArDigits() const;
virtual void dumpLArDigits(const Identifier& ttId) const override; /* ttId must be a LAr TTId */
virtual void dumpLArDigits() const override;
void dumpTileDigits(const Identifier& ttId) const; /* ttId must be a Tile TTId */
void dumpTileDigits() const;
virtual void dumpTileDigits(const Identifier& ttId) const override; /* ttId must be a Tile TTId */
virtual void dumpTileDigits() const override;
protected:
float calcEnergyOrEt(const std::vector<const CaloCell*> &cells, const unsigned int mode) const;
virtual float calcEnergyOrEt(const std::vector<const CaloCell*> &cells, const unsigned int mode) const override;
void reset();
void resetCaloCells();
void resetLArDigits();
void resetTileDigits();
virtual void reset() override;
virtual void resetCaloCells() override;
virtual void resetLArDigits() override;
virtual void resetTileDigits() override;
void dump(const std::vector<const CaloCell*>& vCells) const;
void dump(const std::vector<const LArDigit*>& vCells) const;
void dump(const std::vector<const TileDigits*>& vCells) const;
virtual void dump(const std::vector<const CaloCell*>& vCells) const override;
virtual void dump(const std::vector<const LArDigit*>& vCells) const override;
virtual void dump(const std::vector<const TileDigits*>& vCells) const override;
private:
......@@ -128,7 +128,8 @@ private:
const CaloCell_ID* m_caloCellHelper;
// Services
LArCablingLegacyService* m_larCablingSvc;
SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey
{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"};
const TileCablingService * m_tileCablingService;
CaloTriggerTowerService* m_ttSvc;
......
/*
Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#ifndef _TRIGGER_TRIGT1_TRIGT1CALOCALIBTOOLS_L1CALOLARTOWERENERGY_H_
#define _TRIGGER_TRIGT1_TRIGT1CALOCALIBTOOLS_L1CALOLARTOWERENERGY_H_
#ifndef TRIGT1CALOCALIBTOOLS_L1CALOLARTOWERENERGY_H
#define TRIGT1CALOCALIBTOOLS_L1CALOLARTOWERENERGY_H
// Athena includes
#include "AsgTools/AsgTool.h"
#include "GaudiKernel/ToolHandle.h"
#include "CxxUtils/checker_macros.h"
#include "StoreGate/StoreGateSvc.h"
#include "StoreGate/ReadCondHandleKey.h"
#include "Identifier/Identifier.h"
#include "TrigT1CaloToolInterfaces/IL1TriggerTowerTool.h"
......@@ -19,13 +18,13 @@
#include "TrigT1CaloCondSvc/L1CaloCondSvc.h"
#include "CaloIdentifier/CaloIdManager.h"
#include "LArRecConditions/ILArBadFebMasker.h"
#include "LArCabling/LArCablingLegacyService.h"
#include "LArCabling/LArOnOffIdMapping.h"
#include "LArIdentifier/LArOnlineID.h"
// PABC interface include
#include "TrigT1CaloCalibToolInterfaces/IL1CaloLArTowerEnergy.h"
// STL inlcudes
// STL includes
#include <vector>
#include <map>
#include <string>
......@@ -41,7 +40,7 @@
namespace LVL1 {
class ATLAS_NOT_THREAD_SAFE // use of LArCablingBase
class
L1CaloLArTowerEnergy : virtual public IL1CaloLArTowerEnergy, public asg::AsgTool
{
/// Create a proper constructor for Athena
......@@ -52,16 +51,18 @@ public:
L1CaloLArTowerEnergy( const std::string& name );
virtual ~L1CaloLArTowerEnergy() {};
virtual StatusCode initialize();
virtual StatusCode finalize();
virtual StatusCode initialize() override;
virtual StatusCode finalize() override;
bool initL1CaloLArTowerEnergy(const CaloCellContainer& cellContainer, const TriggerTowerCollection &triggerTowerCollection);
float EtLArg(const Identifier& TTid) const;
bool hasMissingFEB(const Identifier& TTid) const;
virtual bool initL1CaloLArTowerEnergy(const CaloCellContainer& cellContainer, const TriggerTowerCollection &triggerTowerCollection) override;
virtual float EtLArg(const Identifier& TTid) const override;
virtual bool hasMissingFEB(const Identifier& TTid) const override;
virtual bool hasMissingFEB(const LArOnOffIdMapping& cabling,
const Identifier& TTid) const override;
protected:
void reset();
double IDeta(const Identifier& TTid) const;
virtual void reset() override;
virtual double IDeta(const Identifier& TTid) const override;
private:
......@@ -79,9 +80,10 @@ private:
ToolHandle<LVL1::IL1CaloCells2TriggerTowers> m_cells2tt;
ToolHandle< ILArBadFebMasker > m_badFebMasker; // Handle to badChannelTool
ToolHandle<LArCablingLegacyService> m_larCablingSvc; // Handle to LarCablingService
ToolHandle<LVL1::IL1TriggerTowerTool> m_ttTool; // Handle to L1TriggerTowerTool
SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey
{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"};
typedef std::map<Identifier, double> mapTT;
......
/*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
......@@ -19,8 +19,10 @@
#include "AsgTools/AsgTool.h"
#include "GaudiKernel/ToolHandle.h"
#include "StoreGate/ReadCondHandleKey.h"
#include "TrigT1CaloCalibToolInterfaces/IL1CaloMonitoringCaloTool.h"
#include "LArCabling/LArOnOffIdMapping.h"
class IInterface;
class StatusCode;
......@@ -61,6 +63,9 @@ namespace LVL1 {
int region(const int index) const;
int etaBin(const int index) const;
SG::ReadCondHandleKey<LArOnOffIdMapping> m_cablingKey
{this,"CablingKey","LArOnOffIdMap","SG Key of LArOnOffIdMapping object"};
ToolHandle<LVL1::IL1CaloCells2TriggerTowers> m_cells2tt;
const CaloLVL1_ID* m_lvl1Helper;
......
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
// ***************************************************************************
// * Author: John Morris (john.morris@cern.ch) *
......@@ -141,8 +141,7 @@ public:
virtual float tileCellEnergy(const TriggerTower* tt, IdTTL1CellMapType& map) const override;
// Bad Calo, High Voltage Information
virtual int emBadCalo(const TriggerTower* tt) const override;
// High Voltage Information
virtual float emCaloQuality(const TriggerTower* tt) const override;
virtual float emNCellsNonNominal(const TriggerTower* tt) const override;
virtual std::vector<float> emNCellsNonNominalByLayer(const TriggerTower* tt) const override;
......@@ -152,7 +151,6 @@ public:
virtual std::vector<float> emNonNominalMeanScaleByReceiver(const TriggerTower* tt) const override;
virtual std::vector<std::vector<float> > emNonNominalMeanScaleByReceiverByLayer(const TriggerTower* tt) const override;
virtual int hadBadCalo(const TriggerTower* tt, IdTTL1CellMapType& map) const override;
virtual float hadCaloQuality(const TriggerTower* tt) const override;
virtual float hadNCellsNonNominal(const TriggerTower* tt) const override;
virtual std::vector<float> hadNCellsNonNominalByLayer(const TriggerTower* tt) const override;
......
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#include "TrigT1CaloCalibTools/L1CaloCells2TriggerTowers.h"
#include "StoreGate/ReadCondHandle.h"
namespace LVL1{
L1CaloCells2TriggerTowers::L1CaloCells2TriggerTowers(const std::string& name) :
......@@ -11,7 +12,6 @@ namespace LVL1{
m_lvl1Helper(nullptr),
m_tileID(nullptr),
m_caloCellHelper(nullptr),
m_larCablingSvc(nullptr),
m_tileCablingService(nullptr),
m_ttSvc(nullptr),
m_bInitialized(false),
......@@ -174,14 +174,13 @@ namespace LVL1{
sc = toolSvc->retrieveTool("CaloTriggerTowerService",m_ttSvc);
if(sc.isFailure()){ATH_MSG_ERROR("Could not retrieve CaloTriggerTowerService Tool");return sc;}
sc = toolSvc->retrieveTool("LArCablingLegacyService", m_larCablingSvc);
if(sc.isFailure()){ATH_MSG_ERROR("Could not retrieve LArCablingService");return sc;}
}
else{ATH_MSG_ERROR("Could not retrieve ToolSvc");return sc;}
m_tileCablingService = TileCablingService::getInstance();
ATH_CHECK( m_cablingKey.initialize() );
return sc;
}
......@@ -191,6 +190,8 @@ namespace LVL1{
bool L1CaloCells2TriggerTowers::initCaloCellsTriggerTowers(const CaloCellContainer& cellContainer) {
SG::ReadCondHandle<LArOnOffIdMapping> cabling (m_cablingKey);
this->resetCaloCells();
std::vector<Identifier>::const_iterator it_towerId = m_lvl1Helper->tower_begin();
......@@ -209,7 +210,7 @@ namespace LVL1{
Identifier ttId1;
Identifier ttId2;
this->matchCell2Tower(caloCell, ttId1, ttId2);
this->matchCell2Tower(**cabling, caloCell, ttId1, ttId2);
if (ttId1 != invalidId) {
m_mTTCaloCells[ttId1.get_identifier32().get_compact()].push_back(caloCell);
......@@ -224,8 +225,14 @@ namespace LVL1{
return m_bInitialized;
}
void L1CaloCells2TriggerTowers::matchCell2Tower(const CaloCell* caloCell, Identifier& ttId1, Identifier& ttId2) const {
void L1CaloCells2TriggerTowers::matchCell2Tower(const CaloCell* caloCell, Identifier& ttId1, Identifier& ttId2) const
{
SG::ReadCondHandle<LArOnOffIdMapping> cabling (m_cablingKey);
matchCell2Tower (**cabling, caloCell, ttId1, ttId2);
}
void L1CaloCells2TriggerTowers::matchCell2Tower(const LArOnOffIdMapping& cabling,
const CaloCell* caloCell, Identifier& ttId1, Identifier& ttId2) const
{
const Identifier invalidId(0);
ttId1 = invalidId;
ttId2 = invalidId;
......@@ -284,8 +291,8 @@ namespace LVL1{
if(lvl1) {
// check if the channel is connected
HWIdentifier channelID = m_larCablingSvc->createSignalChannelID(cellId);
if(m_larCablingSvc->isOnlineConnected(channelID)) {
HWIdentifier channelID = cabling.createSignalChannelID(cellId);
if(cabling.isOnlineConnected(channelID)) {
// As we don't want the layer information embedded in the identifier, we recreate a tower Id
ttId1 = m_lvl1Helper->tower_id( m_lvl1Helper->pos_neg_z(layerId), m_lvl1Helper->sampling(layerId), m_lvl1Helper->region(layerId), m_lvl1Helper->eta(layerId), m_lvl1Helper->phi(layerId));
......@@ -299,6 +306,8 @@ namespace LVL1{
this->resetLArDigits();
SG::ReadCondHandle<LArOnOffIdMapping> cabling (m_cablingKey);
std::vector<Identifier>::const_iterator it_towerId = m_lvl1Helper->tower_begin();
std::vector<Identifier>::const_iterator it_towerEnd = m_lvl1Helper->tower_end();
......@@ -313,9 +322,9 @@ namespace LVL1{
const LArDigit * larDigit= *itLArDigit;
const HWIdentifier larDigitChannelID = larDigit->channelID();
if(m_larCablingSvc->isOnlineConnected(larDigitChannelID)) {
if(cabling->isOnlineConnected(larDigitChannelID)) {
// convert HWID to ID
Identifier larDigitID = m_larCablingSvc->cnvToIdentifier(larDigitChannelID);
Identifier larDigitID = cabling->cnvToIdentifier(larDigitChannelID);
//whichTTID ttId returns a layer_id, not a tower_id !
const Identifier layerId(m_ttSvc->whichTTID(larDigitID));
......@@ -603,6 +612,7 @@ namespace LVL1{
void L1CaloCells2TriggerTowers::dump(const std::vector<const LArDigit*>& vLArDigits) const {
SG::ReadCondHandle<LArOnOffIdMapping> cabling (m_cablingKey);
ATH_MSG_INFO( "ncells: "<< vLArDigits.size() );
std::vector<const LArDigit*>::const_iterator itLArDigits = vLArDigits.begin();
......@@ -610,7 +620,7 @@ namespace LVL1{
const LArDigit* larDigit= *itLArDigits;
HWIdentifier hwId = larDigit->channelID();
Identifier larDigitID = m_larCablingSvc->cnvToIdentifier(hwId);
Identifier larDigitID = cabling->cnvToIdentifier(hwId);
ATH_MSG_INFO( "pos_neg: " << m_caloCellHelper->pos_neg(larDigitID)<<", sampling: "<< m_caloCellHelper->sampling(larDigitID)<<", region: "<< m_caloCellHelper->region(larDigitID)<<", eta: "<< m_caloCellHelper->eta(larDigitID)<<", phi: "<< m_caloCellHelper->phi(larDigitID) );
std::vector<short> vADC= larDigit->samples();
......
/*
Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
*/
#include "TrigT1CaloCalibTools/L1CaloLArTowerEnergy.h"
#include "LArRecConditions/LArBadChannelCont.h"
#include "StoreGate/ReadCondHandle.h"
namespace LVL1{
......@@ -16,7 +17,6 @@ namespace LVL1{
m_ttService(nullptr),
m_cells2tt("LVL1::L1CaloCells2TriggerTowers/L1CaloCells2TriggerTowers"),
m_badFebMasker("LArBadFebMasker"),
m_larCablingSvc("LArCablingLegacyService"),
m_ttTool("LVL1::L1TriggerTowerTool/LVL1::L1TriggerTowerTool")
{
}
......@@ -48,9 +48,6 @@ namespace LVL1{
ATH_CHECK(m_badFebMasker.retrieve());
ATH_CHECK(m_larCablingSvc.retrieve());
//Retrieve cabling & tt services
ISvcLocator* svcLoc = Gaudi::svcLocator( );
IToolSvc* toolSvc;
......@@ -62,6 +59,8 @@ namespace LVL1{
}
ATH_CHECK( m_cablingKey.initialize() );
return sc;
}
......@@ -77,6 +76,8 @@ namespace LVL1{
this->reset();
SG::ReadCondHandle<LArOnOffIdMapping> cabling (m_cablingKey);
// access database - each event conditions may have changed ...
sc = m_ttTool->retrieveConditions();
if(!sc.isSuccess()) {
......@@ -110,7 +111,7 @@ namespace LVL1{
TTid = m_ttTool->identifier(tt->eta(), tt->phi(), 0);
coolId = m_ttTool->channelID(TTid).id();
if(!this->hasMissingFEB(TTid) && !m_ttTool->disabledChannel(coolId)) {
if(!this->hasMissingFEB(**cabling, TTid) && !m_ttTool->disabledChannel(coolId)) {
sinTheta = 1. / std::cosh(tt->eta());
caloEnergy = 1e-3 * m_cells2tt->energy(TTid) * sinTheta;
......@@ -143,7 +144,7 @@ namespace LVL1{
bool bIsTile = m_lvl1Helper->is_tile(TTid);
if(bIsTile) continue;
if(hasMissingFEB(TTid)) continue;
if(hasMissingFEB(**cabling, TTid)) continue;
it_map = m_map_sumEtcells_phi_had.find(tt->eta());
if(it_map == m_map_sumEtcells_phi_had.end()) {
......@@ -162,6 +163,8 @@ namespace LVL1{
float L1CaloLArTowerEnergy::EtLArg(const Identifier& TTid) const {
SG::ReadCondHandle<LArOnOffIdMapping> cabling (m_cablingKey);
float energy = 0;
mapTT::const_iterator it_mapTT;
......@@ -172,7 +175,7 @@ namespace LVL1{
//electromagnetic sampling
if(sampling==0) {
if(this->hasMissingFEB(TTid)) {
if(this->hasMissingFEB(**cabling, TTid)) {
it_mapSum = m_map_sumEtcells_phi_em.find(eta);
std::pair<double,int> Et = (*it_mapSum).second;
energy = Et.first/Et.second;
......@@ -192,7 +195,7 @@ namespace LVL1{
energy = (*it_mapTT).second;
}
else {
if(this->hasMissingFEB(TTid)) {
if(this->hasMissingFEB(**cabling, TTid)) {
it_mapSum = m_map_sumEtcells_phi_had.find(eta);
std::pair<double,int> Et = (*it_mapSum).second;
energy = Et.first/Et.second;
......@@ -226,8 +229,14 @@ namespace LVL1{
}
bool L1CaloLArTowerEnergy::hasMissingFEB(const Identifier& TTid) const {