|
ATLAS Offline Software
|
#include <CaloClusterCellWeightCalib.h>
|
| CaloClusterCellWeightCalib (const std::string &type, const std::string &name, const IInterface *pParent) |
| Algorithm tool constructor. More...
|
|
virtual | ~CaloClusterCellWeightCalib () override |
| Base tool destructor. More...
|
|
virtual StatusCode | initialize () override |
| Tool initialization. More...
|
|
virtual StatusCode | execute (const EventContext &ctx, xAOD::CaloCluster *theCluster) const override |
| Execute on a single cluster. More...
|
|
virtual StatusCode | execute (const EventContext &ctx, xAOD::CaloCluster *cluster) const=0 |
| Tool execution. More...
|
|
virtual StatusCode | execute (xAOD::CaloCluster *cluster) final |
| Tool execution. More...
|
|
virtual StatusCode | execute (const EventContext &ctx, xAOD::CaloClusterContainer *collection) const |
| Tool execution. More...
|
|
virtual StatusCode | execute (xAOD::CaloCluster *cluster) final |
| Execute on a single cluster. More...
|
|
virtual StatusCode | execute (const EventContext &ctx, xAOD::CaloClusterContainer *collection) const |
| Execute on an entire collection of clusters. More...
|
|
virtual StatusCode | execute (xAOD::CaloClusterContainer *collection) final |
| Execute on an entire collection of clusters. More...
|
|
ServiceHandle< StoreGateSvc > & | evtStore () |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | evtStore () const |
| The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
const ServiceHandle< StoreGateSvc > & | detStore () const |
| The standard StoreGateSvc/DetectorStore Returns (kind of) a pointer to the StoreGateSvc . More...
|
|
virtual StatusCode | sysInitialize () override |
| Perform system initialization for an algorithm. More...
|
|
virtual StatusCode | sysStart () override |
| Handle START transition. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | inputHandles () const override |
| Return this algorithm's input handles. More...
|
|
virtual std::vector< Gaudi::DataHandle * > | outputHandles () const override |
| Return this algorithm's output handles. More...
|
|
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Property< T > &t) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKey &hndl, const std::string &doc, const SG::VarHandleKeyType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleBase &hndl, const std::string &doc, const SG::VarHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, SG::VarHandleKeyArray &hndArr, const std::string &doc, const SG::VarHandleKeyArrayType &) |
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc, const SG::NotHandleType &) |
| Declare a new Gaudi property. More...
|
|
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, T &property, const std::string &doc="none") |
| Declare a new Gaudi property. More...
|
|
void | updateVHKA (Gaudi::Details::PropertyBase &) |
|
MsgStream & | msg () const |
|
MsgStream & | msg (const MSG::Level lvl) const |
|
bool | msgLvl (const MSG::Level lvl) const |
|
Tool calculates alternative cluster calibration using an external cell weight tool with interface ICellWeightTool
. It only modifies the cluster 4-vector from alternative calibration, i.e. it switches the CaloCluster
to signal state P4SignalState::ALTCALIBRATED
and puts the result of the cell weight calibration into this state. Previously set alternative calibrations are overwritten, but the basic (P4SignalState::UNCALIBRATED
) and (local hadronic) calibrated (P4SignalState::CALIBRATED
) are not changed. The cluster is returned to the signal state it has been received in. Even though with this behaviour the tool could run at any time in the cluster algorithm, it should run right after the cluster formation, i.e. it should be the first calibration/correction tool, as it is using the geometrical weights, which are lost in local hadronic calibration. Note that the tool can be configured to ignore these weights, but this can lead to unexpected signal calibrations.
Definition at line 16 of file CaloClusterCellWeightCalib.h.
◆ CALCULATOR
typedef StatusCode(CaloClusterCellWeightCalib::* CaloClusterCellWeightCalib::CALCULATOR) (xAOD::CaloCluster *pClus) const |
|
protected |
Processor type for cluster calibration / typedef StatusCode (CaloClusterCellWeightCalib::*PROCESSOR)(const xAOD::CaloCluster pClus) const;.
/*! Processor implementation for all clusters / StatusCode p_execAll(const xAOD::CaloCluster pClus) const; /*! Processor implementation for dedicated noise cluster treatment / StatusCode p_execSpc(const xAOD::CaloCluster pClus) const;
/*! Pointer to cluster processor */ PROCESSOR p_execute;
/*! Calculator type for direction calculation
Definition at line 116 of file CaloClusterCellWeightCalib.h.
◆ StoreGateSvc_t
◆ CaloClusterCellWeightCalib()
CaloClusterCellWeightCalib::CaloClusterCellWeightCalib |
( |
const std::string & |
type, |
|
|
const std::string & |
name, |
|
|
const IInterface * |
pParent |
|
) |
| |
◆ ~CaloClusterCellWeightCalib()
CaloClusterCellWeightCalib::~CaloClusterCellWeightCalib |
( |
| ) |
|
|
overridevirtualdefault |
◆ cmpNoCase()
bool CaloClusterCellWeightCalib::cmpNoCase |
( |
const std::string & |
a, |
|
|
const std::string & |
b |
|
) |
| |
|
staticprotected |
Helper for non-case sensitive string comparison.
Definition at line 230 of file CaloClusterCellWeightCalib.cxx.
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;
◆ declareGaudiProperty() [1/4]
specialization for handling Gaudi::Property<SG::VarHandleKeyArray>
Definition at line 170 of file AthCommonDataStore.h.
175 hndl.documentation());
◆ declareGaudiProperty() [2/4]
specialization for handling Gaudi::Property<SG::VarHandleKey>
Definition at line 156 of file AthCommonDataStore.h.
161 hndl.documentation());
◆ declareGaudiProperty() [3/4]
specialization for handling Gaudi::Property<SG::VarHandleBase>
Definition at line 184 of file AthCommonDataStore.h.
189 hndl.documentation());
◆ declareGaudiProperty() [4/4]
◆ declareProperty() [1/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleBase
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 245 of file AthCommonDataStore.h.
250 this->declare(hndl.
vhKey());
251 hndl.
vhKey().setOwner(
this);
253 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [2/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
hndl | Object holding the property value. |
doc | Documentation string for the property. |
This is the version for types that derive from SG::VarHandleKey
. The property value object is put on the input and output lists as appropriate; then we forward to the base class.
Definition at line 221 of file AthCommonDataStore.h.
229 return PBASE::declareProperty(
name,hndl,
doc);
◆ declareProperty() [3/6]
◆ declareProperty() [4/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This is the generic version, for types that do not derive from SG::VarHandleKey
. It just forwards to the base class version of declareProperty
.
Definition at line 333 of file AthCommonDataStore.h.
338 return PBASE::declareProperty(
name, property,
doc);
◆ declareProperty() [5/6]
Declare a new Gaudi property.
- Parameters
-
name | Name of the property. |
property | Object holding the property value. |
doc | Documentation string for the property. |
This dispatches to either the generic declareProperty
or the one for VarHandle/Key/KeyArray.
Definition at line 352 of file AthCommonDataStore.h.
◆ declareProperty() [6/6]
◆ detStore()
◆ evtStore() [1/2]
◆ evtStore() [2/2]
◆ execute() [1/7]
virtual StatusCode CaloClusterProcessor::execute |
◆ execute() [2/7]
StatusCode CaloClusterCellWeightCalib::execute |
( |
const EventContext & |
ctx, |
|
|
xAOD::CaloCluster * |
cluster |
|
) |
| const |
|
overridevirtual |
Execute on a single cluster.
- Parameters
-
cluster | The cluster to process. |
ctx | The event context. |
Implements CaloClusterProcessor.
Definition at line 95 of file CaloClusterCellWeightCalib.cxx.
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;
◆ execute() [3/7]
StatusCode CaloClusterProcessor::execute |
◆ execute() [4/7]
Execute on an entire collection of clusters.
- Parameters
-
collection | The container of clusters. |
This will iterate over all the clusters in collection
and call execute
on each one individually.
- Parameters
-
collection | The container of clusters. |
ctx | The event context. |
This will iterate over all the clusters in collection
and call execute
on each one individually.
Implements CaloClusterCollectionProcessor.
Reimplemented in CaloClusterRemoveBad.
Definition at line 57 of file CaloClusterProcessor.cxx.
65 return StatusCode::SUCCESS;
◆ execute() [5/7]
StatusCode CaloClusterProcessor::execute |
|
final |
◆ execute() [6/7]
Execute on a single cluster.
- Parameters
-
cluster | The cluster to process. (deprecated) |
Definition at line 43 of file CaloClusterProcessor.cxx.
45 return execute (Gaudi::Hive::currentContext(), cluster);
◆ execute() [7/7]
|
inlinefinalvirtualinherited |
Execute on an entire collection of clusters.
- Parameters
-
collection | The container of clusters. (deprecated) |
Definition at line 49 of file CaloClusterCollectionProcessor.h.
51 return execute (Gaudi::Hive::currentContext(), collection);
◆ extraDeps_update_handler()
Add StoreName to extra input/output deps as needed.
use the logic of the VarHandleKey to parse the DataObjID keys supplied via the ExtraInputs and ExtraOuputs Properties to add the StoreName if it's not explicitly given
◆ f_dirAbs()
Calculator implementation for direction from absolute signal.
The absolute signal is used to re-calculate the cluster direction. This is stable for all clusters but changes the direction with respect to the fixed scenario somewhat.
Definition at line 362 of file CaloClusterCellWeightCalib.cxx.
371 for ( ; fCell != lCell; fCell++ )
375 double eWght(fCell.weight() *
382 etaRef +=
cell->eta() * eWght;
390 pClus->
setEta(etaRef/eRef);
394 return StatusCode::SUCCESS;
◆ f_dirAbsNW()
Calculator implementation for direction from absolute signal.
The absolute signal is used to re-calculate the cluster direction. This is stable for all clusters but changes the direction with respect to the fixed scenario somewhat. Geometrical weights are ignored.
Definition at line 397 of file CaloClusterCellWeightCalib.cxx.
412 etaRef +=
cell->eta() * eWght;
420 pClus->setEta(etaRef/eRef);
421 pClus->setPhi(phiRef);
424 return StatusCode::SUCCESS;
◆ f_dirPos()
Calculator implementation for direction from positive signal.
Direction is calculated using E>0 cell signals only. This may be highly fluctuating for noise clusters.
Definition at line 292 of file CaloClusterCellWeightCalib.cxx.
301 for ( ; fCell != lCell; fCell++ )
305 double eWght(fCell.weight() *
313 etaRef +=
cell->eta() * eWght;
322 pClus->
setEta(etaRef/eRef);
326 return StatusCode::SUCCESS;
◆ f_dirPosNW()
Calculator implementation for direction from positive signal.
Direction is calculated using E>0 cell signals only. This may be highly fluctuating for noise clusters. Geometrical weights are ignored.
Definition at line 329 of file CaloClusterCellWeightCalib.cxx.
339 double eWght(
cell->e() *
346 etaRef +=
cell->eta() * eWght;
355 pClus->setEta(etaRef/eRef);
356 pClus->setPhi(phiRef);
359 return StatusCode::SUCCESS;
◆ f_dirRaw()
Calculator implementation for energy only update.
Direction is taken from electromagnetic scale. This is safe for all clusters.
Definition at line 253 of file CaloClusterCellWeightCalib.cxx.
259 for ( ; fCell != lCell; fCell++ )
271 return StatusCode::SUCCESS;
◆ f_dirRawNW()
Calculator implementation for energy only update.
Direction is taken from electromagnetic scale. This is safe for all clusters. The energy calculation ignores geometrical weights.
Definition at line 274 of file CaloClusterCellWeightCalib.cxx.
288 return StatusCode::SUCCESS;
◆ initialize()
StatusCode CaloClusterCellWeightCalib::initialize |
( |
| ) |
|
|
overridevirtual |
Tool initialization.
Definition at line 60 of file CaloClusterCellWeightCalib.cxx.
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;
◆ inputHandles()
Return this algorithm's input handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ interfaceID()
static const InterfaceID& CaloClusterProcessor::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
◆ msg() [1/2]
◆ msg() [2/2]
◆ msgLvl()
◆ outputHandles()
Return this algorithm's output handles.
We override this to include handle instances from key arrays if they have not yet been declared. See comments on updateVHKA.
◆ renounce()
◆ renounceArray()
◆ setup()
bool CaloClusterCellWeightCalib::setup |
( |
const std::string & |
name, |
|
|
const std::string & |
tag, |
|
|
CALCULATOR & |
calc, |
|
|
std::string & |
conf, |
|
|
MsgStream & |
report |
|
) |
| |
|
protected |
Common setup function.
Definition at line 176 of file CaloClusterCellWeightCalib.cxx.
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!"
◆ setupAll()
StatusCode CaloClusterCellWeightCalib::setupAll |
( |
MsgStream & |
report | ) |
|
|
protected |
Setup for calculation for all or non-noise clusters.
Definition at line 157 of file CaloClusterCellWeightCalib.cxx.
160 std::string
tag(
"all");
162 ? StatusCode::SUCCESS : StatusCode::FAILURE;
◆ setupSpc()
StatusCode CaloClusterCellWeightCalib::setupSpc |
( |
MsgStream & |
report | ) |
|
|
protected |
Setup for different calculation for noise clusters.
Definition at line 165 of file CaloClusterCellWeightCalib.cxx.
168 std::string aboveTag(
"above threshold");
169 std::string belowTag(
"below threshold");
173 ? StatusCode::SUCCESS : StatusCode::FAILURE;
◆ sysInitialize()
◆ sysStart()
Handle START transition.
We override this in order to make sure that conditions handle keys can cache a pointer to the conditions container.
◆ updateVHKA()
◆ m_absName
std::string const CaloClusterCellWeightCalib::m_absName = "AbsSignal" |
|
staticprotected |
◆ m_calc
◆ m_calc_noise
CALCULATOR CaloClusterCellWeightCalib::m_calc_noise |
|
protected |
◆ m_calibNoiseLikeAll
bool CaloClusterCellWeightCalib::m_calibNoiseLikeAll |
|
protected |
Property controlling calibration of noise clusters.
Flags calibration of noise (E<0) clusters:
- Parameters
-
true | (default) means noise clusters are treated as all others |
false | means noise clusters are not calibrated at all |
Definition at line 58 of file CaloClusterCellWeightCalib.h.
◆ m_cellWeight
◆ m_defName
◆ m_detStore
◆ m_directionCalculation
std::string CaloClusterCellWeightCalib::m_directionCalculation |
|
protected |
Property controlling negative signal handling.
Negative cell signals are problematic for the direction calculation from cells:
- Parameters
-
Signal | use only E>0 cells for direction |
AbsSignal | (default) use w*|E| for direction |
RawSignal | do not recalculate direction at all |
The property is not case sensitive. The default is AbsSignal, i.e. following a strategy very similar to the direction calculation performed during cluster formation.
Definition at line 49 of file CaloClusterCellWeightCalib.h.
◆ m_eThreshold
double CaloClusterCellWeightCalib::m_eThreshold |
|
protected |
◆ m_evtStore
◆ m_ignoreGeoWghts
bool CaloClusterCellWeightCalib::m_ignoreGeoWghts |
|
protected |
Flag to ignore geometrical cell weights in clusters.
This flags controls the use of geometrical cell weights in clusters:
- Parameters
-
false | (default) geometrical weights are used |
true | geometrical weights are ignored |
Note that using the geometrical weights requires this tool to run before the Local Hadronic calibration tools.
Definition at line 84 of file CaloClusterCellWeightCalib.h.
◆ m_noiseDirectionCalculation
std::string CaloClusterCellWeightCalib::m_noiseDirectionCalculation |
|
protected |
Property controlling calibration method for noise clusters.
Tags calibration method for noise (E<0) clusters. Only effective if these clusters are calibrated at all, i.e. m_calibNoise
is true
:
- Parameters
-
true | (default) uses same direction correction as all other clusters |
false | uses AbsSignal calibration for noise clusters. |
Definition at line 69 of file CaloClusterCellWeightCalib.h.
◆ m_posName
std::string const CaloClusterCellWeightCalib::m_posName = "Signal" |
|
staticprotected |
◆ m_rawName
std::string const CaloClusterCellWeightCalib::m_rawName = "RawSignal" |
|
staticprotected |
◆ m_varHandleArraysDeclared
◆ m_vhka
The documentation for this class was generated from the following files:
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)
StatusCode f_dirRaw(xAOD::CaloCluster *pClus) const
Calculator implementation for energy only update.
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.
virtual StatusCode execute(const EventContext &ctx, xAOD::CaloClusterContainer *collection) const =0
Execute on an entire collection of clusters.
double proxim(double b, double a)
StatusCode setupSpc(MsgStream &report)
Setup for different calculation for noise clusters.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
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.
virtual void setOwner(IDataHandleHolder *o)=0
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.
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.
(Non-const) Iterator class for DataVector/DataList.
StatusCode f_dirPos(xAOD::CaloCluster *pClus) const
Calculator implementation for direction from positive signal.
::StatusCode StatusCode
StatusCode definition for legacy code.
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.
#define CHECK(...)
Evaluate an expression and check for errors.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
StatusCode f_dirRawNW(xAOD::CaloCluster *pClus) const
Calculator implementation for energy only update.
static double fix(double phi)
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
CaloClusterProcessor(const std::string &type, const std::string &name, const IInterface *parent)
Constructor.
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.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
Data object for each calorimeter readout cell.
CALCULATOR m_calc
Pointer to direction calculation implementation.
const_cell_iterator cell_end() const
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
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.
virtual StatusCode execute(const EventContext &ctx, xAOD::CaloCluster *cluster) const =0
Execute on a single cluster.
CALCULATOR m_calc_noise
Pointer to direction calculation for noise clusters.
StatusCode setupAll(MsgStream &report)
Setup for calculation for all or non-noise clusters.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.