|
ATLAS Offline Software
|
Go to the documentation of this file.
7 #include "CLHEP/Units/SystemOfUnits.h"
15 #include "CaloEvent/CaloCluster.h"
33 const std::string&
name,
34 const IInterface* pParent)
36 , m_directionCalculation(m_defName)
37 , m_calibNoiseLikeAll(true)
38 , m_noiseDirectionCalculation(m_defName)
40 , m_ignoreGeoWghts(false)
43 , m_calc_noise(nullptr)
68 if ( checkOut.isFailure() )
71 <<
"failed to configure direction calculations."
73 return StatusCode::FAILURE;
80 <<
"*** configuration insufficient *** "
81 <<
"no hadronic cell calibration tool configured"
83 return StatusCode::FAILURE;
87 return StatusCode::SUCCESS;
100 double clusterE(pClus->
rawE());
101 double clusterEta(pClus->
rawEta());
102 double clusterPhi(pClus->
rawPhi());
111 pClus->
setE(clusterE);
112 pClus->
setEta(clusterEta);
113 pClus->
setPhi(clusterPhi);
124 checkOut = (this->*
m_calc)(pClus);
128 checkOut = pClus->
e() > 0.
138 if ( checkOut.isFailure() )
141 <<
"problem in calculation of cell weighted signal state"
143 return StatusCode::SUCCESS;
160 std::string
tag(
"all");
162 ? StatusCode::SUCCESS : StatusCode::FAILURE;
168 std::string aboveTag(
"above threshold");
169 std::string belowTag(
"below threshold");
173 ? StatusCode::SUCCESS : StatusCode::FAILURE;
177 const std::string&
tag,
185 <<
"cluster direction ("
187 <<
") from positive cells only"
198 <<
"cluster direction ("
200 <<
") from absolute cell signals"
211 <<
"cluster direction ("
213 <<
") from raw signals (unchanged by this tool)"
224 <<
"invalid configuration, use default!"
231 const std::string&
b)
234 if (
a.length() !=
b.length() )
return false;
237 std::string::const_iterator
p1(
a.begin());
238 std::string::const_iterator
p2(
b.begin());
239 while (
p1 !=
a.end() &&
p2 !=
b.end() )
241 if ( std::toupper(*
p1) != std::toupper(*
p2) )
return false;
259 for ( ; fCell != lCell; fCell++ )
271 return StatusCode::SUCCESS;
288 return StatusCode::SUCCESS;
301 for ( ; fCell != lCell; fCell++ )
305 double eWght(fCell.
weight() *
313 etaRef +=
cell->eta() * eWght;
322 pClus->
setEta(etaRef/eRef);
326 return StatusCode::SUCCESS;
339 double eWght(
cell->e() *
346 etaRef +=
cell->eta() * eWght;
355 pClus->setEta(etaRef/eRef);
356 pClus->setPhi(phiRef);
359 return StatusCode::SUCCESS;
371 for ( ; fCell != lCell; fCell++ )
375 double eWght(fCell.
weight() *
382 etaRef +=
cell->eta() * eWght;
390 pClus->
setEta(etaRef/eRef);
394 return StatusCode::SUCCESS;
412 etaRef +=
cell->eta() * eWght;
420 pClus->setEta(etaRef/eRef);
421 pClus->setPhi(phiRef);
424 return StatusCode::SUCCESS;
StatusCode f_dirPosNW(xAOD::CaloCluster *pClus) const
Calculator implementation for direction from positive signal.
Helper to temporarily change the signal state of a cluster.
const_cell_iterator cell_begin() const
Iterator of the underlying CaloClusterCellLink (const version)
flt_t rawEta() const
Get in signal state UNCALIBRATED.
StatusCode f_dirRaw(xAOD::CaloCluster *pClus) const
Calculator implementation for energy only update.
virtual void setStatus(const StatusIndicator &statusIndicator)
Set status.
std::string m_directionCalculation
Property controlling negative signal handling.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
StatusCode f_dirAbs(xAOD::CaloCluster *pClus) const
Calculator implementation for direction from absolute signal.
double proxim(double b, double a)
StatusCode setupSpc(MsgStream &report)
Setup for different calculation for noise clusters.
weight_t weight() const
Accessor for weight associated to this cell.
static const std::string m_defName
Negative signal handling: default tag.
static const std::string m_posName
Negative signal handling: positive signal tag.
ToolHandle< ICellWeightTool > m_cellWeight
Handle for cell weight tool.
StatusCode f_dirAbsNW(xAOD::CaloCluster *pClus) const
Calculator implementation for direction from absolute signal.
double m_eThreshold
Energy threshold for direction calculation.
bool m_ignoreGeoWghts
Flag to ignore geometrical cell weights in clusters.
Description of a calorimeter cluster.
static const std::string m_rawName
Negative signal handling: raw signal tag.
bool m_calibNoiseLikeAll
Property controlling calibration of noise clusters.
msgSvc
Provide convenience handles for various services.
StatusCode f_dirPos(xAOD::CaloCluster *pClus) const
Calculator implementation for direction from positive signal.
virtual StatusCode initialize() override
Tool initialization.
::StatusCode StatusCode
StatusCode definition for legacy code.
virtual ~CaloClusterCellWeightCalib() override
Base tool destructor.
bool setup(const std::string &name, const std::string &tag, CALCULATOR &calc, std::string &conf, MsgStream &report)
Common setup function.
std::string m_noiseDirectionCalculation
Property controlling calibration method for noise clusters.
CaloPhiRange class declaration.
StatusCode f_dirRawNW(xAOD::CaloCluster *pClus) const
Calculator implementation for energy only update.
static double fix(double phi)
CaloRecoStatus & recoStatus()
Accesssor to CaloRecoStatus (non-const)
virtual StatusCode execute(const EventContext &ctx, xAOD::CaloCluster *theCluster) const override
Execute on a single cluster.
static const std::string m_absName
Negative signal handling: absolute signal tag.
Data object for each calorimeter readout cell.
flt_t rawPhi() const
Get in signal state UNCALIBRATED.
CALCULATOR m_calc
Pointer to direction calculation implementation.
const_cell_iterator cell_end() const
bool setPhi(const CaloSample sampling, const float phi)
Set in a given sampling. Returns false if the sample isn't part of the cluster.
static bool cmpNoCase(const std::string &a, const std::string &b)
Helper for non-case sensitive string comparison.
bool setEta(const CaloSample sampling, const float eta)
Set in a given sampling. Returns false if the sample isn't part of the cluster.
CaloClusterCellWeightCalib(const std::string &type, const std::string &name, const IInterface *pParent)
Algorithm tool constructor.
CALCULATOR m_calc_noise
Pointer to direction calculation for noise clusters.
StatusCode setupAll(MsgStream &report)
Setup for calculation for all or non-noise clusters.
virtual double e() const
The total energy of the particle.