|
ATLAS Offline Software
|
Go to the documentation of this file.
8 #include "GaudiKernel/MsgStream.h"
9 #include <CLHEP/Units/SystemOfUnits.h>
15 const std::string&
name,
28 return StatusCode::SUCCESS;
38 <<
" phi = " << theCluster->
phi() <<
endmsg;
50 const double absEClus = fabs(theCluster->
e());
53 const double inv_absEClus = 1. / absEClus;
58 double weightAll(0),etaAll(0),phiAll(0);
62 for (;itrCell!=itrCellEnd; ++itrCell) {
67 double absE = fabs(
weight*thisCell->
e());
74 << thisCell->
eta() <<
" phi " << thisCell->
phi()
75 <<
" energy " << thisCell->
e() <<
" weight " <<
weight
76 <<
" sampling " << theSample <<
" cluster e "
77 << theCluster->
e() <<
" log weight " <<
lw);
80 etaAll += thisCell->
eta()*
lw;
89 phiAll += (thisCell->
phi()-360*
deg)*
lw;
90 else if ( weightAll > 0
93 phiAll += (thisCell->
phi()+360*
deg)*
lw;
95 phiAll += thisCell->
phi()*
lw;
99 etaSample[theSample] += thisCell->
eta()*
lw;
100 if ( weightSample[theSample] > 0
101 && phiSample[theSample]/weightSample[theSample]
104 phiSample[theSample] += (thisCell->
phi()-360*
deg)*
lw;
105 else if ( weightSample[theSample] > 0
106 && phiSample[theSample]/weightSample[theSample]
109 phiSample[theSample] += (thisCell->
phi()+360*
deg)*
lw;
111 phiSample[theSample] += thisCell->
phi()*
lw;
112 weightSample[theSample] +=
lw;
118 if ( weightAll > 0 ) {
119 const double inv_weightAll = 1. / weightAll;
120 theCluster->
setEta(etaAll * inv_weightAll);
137 etaSample /= weightSample[
i];
138 phiSample /= weightSample[
i];
140 theCluster->
setEta(
s,etaSample);
141 theCluster->
setPhi(
s,phiSample);
149 <<
" phi = " << theCluster->
phi());
162 return StatusCode::SUCCESS;
virtual double phi() const
The azimuthal angle ( ) of the particle.
const_cell_iterator cell_begin() const
Iterator of the underlying CaloClusterCellLink (const version)
virtual double phi() const override final
get phi (through CaloDetDescrElement)
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
weight_t weight() const
Accessor for weight associated to this cell.
virtual double e() const override final
get energy (data member) (synonym to method energy()
#define ATH_MSG_VERBOSE(x)
StatusCode execute(const EventContext &ctx, xAOD::CaloCluster *theCluster) const override
Execute on a single cluster.
float etaSample(const CaloSample sampling) const
Retrieve barycenter in a given sample.
StatusCode initialize() override
Description of a calorimeter cluster.
msgSvc
Provide convenience handles for various services.
virtual double eta() const
The pseudorapidity ( ) of the particle.
CaloClusterLogPos(const std::string &type, const std::string &name, const IInterface *parent)
Standard AlgTool constructor.
::StatusCode StatusCode
StatusCode definition for legacy code.
const CaloDetDescrElement * caloDDE() const
get pointer to CaloDetDescrElement (data member)
CaloPhiRange class declaration.
float phiSample(const CaloSample sampling) const
Retrieve barycenter in a given sample.
static double fix(double phi)
Data object for each calorimeter readout cell.
CaloCell_ID::CaloSample getSampling() const
cell sampling
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.
bool setEta(const CaloSample sampling, const float eta)
Set in a given sampling. Returns false if the sample isn't part of the cluster.
bool hasSampling(const CaloSample s) const
Checks if certain smapling contributes to cluster.
virtual double e() const
The total energy of the particle.
virtual double eta() const override final
get eta (through CaloDetDescrElement)