 |
ATLAS Offline Software
|
Go to the documentation of this file.
15 constexpr
float cellEtaSize = 0.1;
16 constexpr
float cellPhiSize = 0.1;
27 ATH_MSG_DEBUG(
"Will store cookie cut clusters in this container "
55 return StatusCode::SUCCESS;
64 static const std::vector<CaloSampling::CaloSample> s_sam
78 m_outClusterContainerKey,
84 m_outClusterContainerCellLinkKey,
88 std::make_unique<CaloClusterCellLinkContainer>())
96 return StatusCode::SUCCESS;
99 std::vector<SG::WriteDecorHandle<xAOD::EgammaContainer, float>> decoM;
100 decoM.reserve(m_nDecor);
101 for (
int i = 0;
i < m_nDecor - 1;
i++) {
102 decoM.emplace_back(m_SGKey_electrons_decorations[
i], ctx);
106 std::call_once(m_Seen, [
this,&decoM]() {
107 for (
int i = 0;
i < m_nDecor - 1;
i++) {
109 <<
" " << m_SGKey_electrons_decorations[
i].
key()
110 <<
" " << decoM[
i].decorKey());
116 decoEl(m_SGKey_electrons_decorations[m_nDecor-1],ctx);
120 m_caloDetDescrMgrKey, ctx
122 ATH_CHECK(caloDetDescrMgrHandle.isValid());
127 std::vector<bool> success(
nF,
true);
133 <<
" pT = " << cluster->
pt()
134 <<
" eta = " << cluster->
eta());
139 std::unique_ptr<xAOD::CaloCluster> newCluster =
141 cellCont, m_CookieCutPars);
148 <<
" original cluster " << cluster->
index()
149 <<
" pT = " << cluster->
pt()
150 <<
" eta = " << cluster->
eta()
151 <<
" has EME2 or FCAL0"
155 << (newCluster ?
" no cells in cluster" :
" no cluster"));
162 success[iel] =
false;
168 <<
" pT = " << newCluster->
pt()
169 <<
" eta = " << newCluster->
eta());
171 outClusterContainer->
push_back(std::move(newCluster));
172 size_t index = outClusterContainer->
size() - 1;
174 clusterLink(*outClusterContainer,
index, ctx);
180 if (m_storeOrigMom) {
181 for (
size_t i = 0;
i < m_vecM.size();
i++) {
182 int indexDecor = m_storeCookMom ? 2*
i+1 :
i;
188 <<
" does not exist for the original cluster");
190 decoM[indexDecor](*electron) =
float(
m);
192 <<
" with original moment "
193 <<
i <<
" " << m_vecMName[
i]
194 <<
" = " <<
m <<
" (decoration index =" << indexDecor
195 <<
" key = " << decoM[indexDecor].decorKey() <<
")");
201 if (!m_clusterCorrectionTools.empty()) {
202 ToolHandleArray<CaloClusterCollectionProcessor>::const_iterator
203 toolIt = m_clusterCorrectionTools.begin(),
204 toolIt_e = m_clusterCorrectionTools.end();
205 for (; toolIt != toolIt_e; ++toolIt) {
206 ATH_CHECK((*toolIt)->execute(ctx, outClusterContainer.
ptr()));
209 if (m_storeCookMom) {
212 cookClusLinkAcc(
"cookiecutClusterLink" );
219 if (success[iel] && cluster ==
nullptr) {
221 "could not be retrieved");
224 for (
size_t i = 0;
i < m_vecM.size();
i++) {
225 int indexDecor = m_storeOrigMom ? 2*
i :
i;
232 <<
" does not exist for the new cluster");
235 decoM[indexDecor](*electron) =
float(
m);
237 <<
" with new moment "
238 <<
i <<
" " << m_vecMName[
i]
239 <<
" = " <<
m <<
" (decoration index = " << indexDecor
240 <<
" key = " << decoM[indexDecor].decorKey() <<
")");
250 outClusterContainerCellLink);
253 <<
" cookie cut clusters");
255 return StatusCode::SUCCESS;
xAOD::ElectronContainer * electronContainer
static StatusCode finalizeClusters(SG::WriteHandle< CaloClusterCellLinkContainer > &h, xAOD::CaloClusterContainer *pClusterColl)
Finalize clusters (move CaloClusterCellLink to a separate container).
static StatusCode AddContainerWriteHandle(SG::WriteHandle< xAOD::CaloClusterContainer > &clusColl)
Creates a new xAOD::CaloClusterContainer in the given WriteHandle + CaloClusterAuxContainer and recor...
Helper class to provide type-safe access to aux data.
#define ATH_MSG_VERBOSE(x)
const std::string & key() const
Return the StoreGate ID for the referenced object.
const DataLink< CaloCellContainer > & getCellContainerLink() const
MomentType
Enums to identify different moments.
Description of a calorimeter cluster.
virtual double eta() const
The pseudorapidity ( ) of the particle.
std::unique_ptr< xAOD::CaloCluster > cookieCut(const xAOD::CaloCluster &cluster, const CaloDetDescrManager &mgr, const DataLink< CaloCellContainer > &cellCont, const egammaClusterCookieCut::CookieCutPars &pars)
::StatusCode StatusCode
StatusCode definition for legacy code.
pointer_type ptr()
Dereference the pointer.
Handle class for adding a decoration to an object.
EgammaContainer_v1 EgammaContainer
Definition of the current "egamma container version".
bool retrieveMoment(MomentType type, double &value) const
Retrieve individual moment.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
size_t index() const
Return the index of this element within its container.
const CaloClusterCellLink * getCellLinks() const
Get a pointer to the CaloClusterCellLink object (const version)
ElementLink implementation for ROOT usage.
virtual double pt() const
The transverse momentum ( ) of the particle (negative for negative-energy clusters)
size_t size() const
size method
value_type push_back(value_type pElem)
Add an element to the end of the collection.
StatusCode initialize(bool used=true)
float eSample(const CaloSample sampling) const
This class provides the client interface for accessing the detector description information common to...
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
#define ATH_MSG_WARNING(x)
bool hasSampling(const CaloSample s) const
Checks if certain smapling contributes to cluster.
size_type size() const noexcept
Returns the number of elements in the collection.
const xAOD::CaloCluster * getCluster(const xAOD::Egamma *eg, bool cook=true)
return the associated egamma cluster, that might be cookie-cut cluster (fwd electron)