ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
LArCalorimeter
LArCellRec
src
LArHVFraction.cxx
Go to the documentation of this file.
1
#include "
LArHVFraction.h
"
2
/*
3
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
4
*/
5
6
7
LArHVFraction::LArHVFraction
(
const
std::string&
type
,
8
const
std::string& name,
9
const
IInterface* parent) :
10
AthAlgTool
(
type
,name,parent) {
11
declareInterface<ILArHVFraction>(
this
);
12
}
13
14
15
StatusCode
LArHVFraction::initialize
() {
16
ATH_CHECK
(
m_cablingKey
.initialize());
17
ATH_CHECK
(
m_hvScaleKey
.initialize());
18
return
StatusCode::SUCCESS;
19
}
20
21
std::pair<double,unsigned>
LArHVFraction::getLArHVFrac
(
const
CaloClusterCellLink
* cclc,
const
EventContext& ctx)
const
{
22
23
SG::ReadCondHandle<LArOnOffIdMapping>
cablingHdl(
m_cablingKey
,ctx);
24
const
LArOnOffIdMapping
* cabling=*cablingHdl;
25
26
SG::ReadCondHandle<ILArHVScaleCorr>
hvScaleHdl(
m_hvScaleKey
,ctx);
27
const
ILArHVScaleCorr
* hvcorr=*hvScaleHdl;
28
29
30
double
energyHVaff=0;
31
unsigned
numCellsHVaff=0;
32
33
for
(
const
CaloCell
* cell : *cclc) {
34
if
(cell->caloDDE()->is_tile())
continue
;
35
HWIdentifier
hwid=cabling->createSignalChannelID(cell->ID());
36
float
corr=hvcorr->
HVScaleCorr
(hwid);
37
//Correction should be between (0 and 2)
38
if
(corr<=0. || corr>=100.)
continue
;
39
40
if
(fabs(corr-1.)>
m_threshold
) {
41
energyHVaff+=fabs(cell->e());
42
numCellsHVaff++;
43
}
//end of non nominal HV area
44
}
//end loop over cells
45
46
return
{energyHVaff,numCellsHVaff};
47
}
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
LArHVFraction.h
AthAlgTool::AthAlgTool
AthAlgTool(const std::string &type, const std::string &name, const IInterface *parent)
Constructor with parameters:
Definition
AthAlgTool.cxx:16
CaloCell
Data object for each calorimeter readout cell.
Definition
CaloCell.h:57
CaloClusterCellLink
Bookkeeping of cells that make up a cluster Simplified replacement for CaloCellLink,...
Definition
CaloClusterCellLink.h:24
HWIdentifier
Definition
HWIdentifier.h:13
ILArHVScaleCorr
Definition
ILArHVScaleCorr.h:13
ILArHVScaleCorr::HVScaleCorr
virtual const float & HVScaleCorr(const HWIdentifier &id) const =0
LArHVFraction::m_hvScaleKey
SG::ReadCondHandleKey< ILArHVScaleCorr > m_hvScaleKey
Definition
LArHVFraction.h:35
LArHVFraction::getLArHVFrac
std::pair< double, unsigned > getLArHVFrac(const CaloClusterCellLink *cclc, const EventContext &ctx) const override
Definition
LArHVFraction.cxx:21
LArHVFraction::m_cablingKey
SG::ReadCondHandleKey< LArOnOffIdMapping > m_cablingKey
Definition
LArHVFraction.h:33
LArHVFraction::initialize
StatusCode initialize() override
Definition
LArHVFraction.cxx:15
LArHVFraction::m_threshold
Gaudi::Property< float > m_threshold
Definition
LArHVFraction.h:37
LArHVFraction::LArHVFraction
LArHVFraction(const std::string &type, const std::string &name, const IInterface *parent)
Definition
LArHVFraction.cxx:7
LArOnOffIdMapping
Definition
LArOnOffIdMapping.h:20
SG::ReadCondHandle
Definition
ReadCondHandle.h:40
type
Generated on
for ATLAS Offline Software by
1.17.0