|
ATLAS Offline Software
|
Go to the documentation of this file.
43 return StatusCode::SUCCESS;
48 bool missingMoment =
false;
59 float eta0=
cl->eta0();
65 p4_pos.SetZ(
radius*std::sinh(eta0)-origin->
z());
67 double deta=p4_pos.Eta()-eta0;
68 double dphi=p4_pos.Phi()-
phi0;
71 if(p4_cl.Eta()*eta0 <0.) deta*=-1;
73 double eta_prime=p4_cl.Eta()+deta;
74 double phi_prime=p4_cl.Phi()+dphi;
75 double e_subtr=p4_cl.E();
76 p4_cl.SetPtEtaPhiE(e_subtr/std::cosh(eta_prime),eta_prime,phi_prime,e_subtr);
78 else missingMoment=
true;
89 shape = readHandleEvtShape.
cptr();
91 if(es_index ==
nullptr)
ATH_MSG_FATAL(
"The HIEventShapeMapTool returned a null pointer. Binning scheme not coherent");
103 bool isOriginPossible =
true;
109 vertices = readHandleVertexContainer.
get();
110 for (
const auto *vertice : *vertices)
118 if(!primVertex && vertices->size() > 0)
120 ATH_MSG_WARNING(
"No primary vertices found, using first in container");
121 primVertex=vertices->at(0);
123 if(!primVertex && vertices->size() == 0)
125 ATH_MSG_WARNING(
"No primary vertices found, and vertex container empty. Abortin Origin correction for this event.");
126 isOriginPossible =
false;
129 bool missingMoment=
false;
131 const auto *originalCluster = readHandleClusters.
cptr();
135 copyClusters->setStore(copyClustersAux);
136 copyClusters->
reserve (originalCluster->size());
169 << std::setw(12) <<
"Before:"
170 << std::setw(10) << std::setprecision(3) << p4.Pt()*1
e-3
171 << std::setw(10) << std::setprecision(3) << p4.Eta()
172 << std::setw(10) << std::setprecision(3) << p4.Phi()
173 << std::setw(10) << std::setprecision(3) << p4.E()*1
e-3
174 << std::setw(10) << std::setprecision(3) << p4.M()*1
e-3);
180 << std::setw(12) <<
"After:"
181 << std::setw(10) << std::setprecision(3) << p4.Pt()*1
e-3
182 << std::setw(10) << std::setprecision(3) << p4.Eta()
183 << std::setw(10) << std::setprecision(3) << p4.Phi()
184 << std::setw(10) << std::setprecision(3) << p4.E()*1
e-3
185 << std::setw(10) << std::setprecision(3) << p4.M()*1
e-3);
192 ATH_MSG_DEBUG(
" Applying correction = " << clusterCorrectionTool->name() );
193 CHECK(clusterCorrectionTool->execute(Gaudi::Hive::currentContext(), copyClusters), 1);
196 if(missingMoment)
ATH_MSG_WARNING(
"No origin correction applied, CENTERMAG missing");
199 std::unique_ptr<xAOD::CaloClusterContainer> outClusters(copyClusters);
200 std::unique_ptr<xAOD::CaloClusterAuxContainer> deepAux(copyClustersAux);
202 if(writeHandleDeepCopyClusters.
record ( std::move(outClusters), std::move(deepAux)).isFailure() ){
void reserve(size_type n)
Attempt to preallocate enough memory for a specified number of elements.
@ CENTER_MAG
Cluster Centroid ( )
SG::ReadHandleKey< xAOD::CaloClusterContainer > m_inClusterKey
Name of input cluster container.
float x() const
Returns the x position.
Gaudi::Property< bool > m_originCorrection
HIClusterSubtraction(const std::string &name)
SG::ReadHandleKey< xAOD::VertexContainer > m_vertexContainer
|brief Name of Vertex Container for origin correction
const_pointer_type cptr()
Dereference the pointer.
constexpr xAOD::CaloCluster::State subtractedOriginCorrectedClusterState()
Gaudi::Property< bool > m_setMoments
const std::string & key() const
Return the StoreGate ID for the referenced object.
SG::WriteHandleKey< xAOD::CaloClusterContainer > m_outClusterKey
|brief New writeHandleKey to store the shallow copy used for new CaloClusterTreatment
CaloCluster_v1 CaloCluster
Define the latest version of the calorimeter cluster class.
virtual int execute() const
Method to be called for each event.
TLorentzVector FourMom_t
Definition of the 4-momentum type.
Interface class for the HI reconstruction EDM.
Handle class for recording to StoreGate.
CaloClusterContainer_v1 CaloClusterContainer
Define the latest version of the calorimeter cluster container.
Description of a calorimeter cluster.
constexpr xAOD::CaloCluster::State subtractedClusterState()
ToolHandle< IHIEventShapeMapTool > m_eventShapeMapTool
(Non-const) Iterator class for DataVector/DataList.
::StatusCode StatusCode
StatusCode definition for legacy code.
const_pointer_type get() const
Dereference the pointer, but don't cache anything.
ToolHandleArray< CaloClusterCollectionProcessor > m_clusterCorrectionTools
#define CHECK(...)
Evaluate an expression and check for errors.
float z() const
Returns the z position.
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
ToolHandle< IHISubtractorTool > m_subtractorTool
Auxiliary container for calorimeter cluster containers.
CaloClusterAuxContainer_v2 CaloClusterAuxContainer
Define the latest version of the calorimeter cluster auxiliary container.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
const_iterator end() const noexcept
Return a const_iterator pointing past the end of the collection.
bool doOriginCorrection(xAOD::CaloCluster *cl, const xAOD::Vertex *origin, xAOD::IParticle::FourMom_t &p4_cl) const
Class describing a Vertex.
StatusCode record(std::unique_ptr< T > data)
Record a const object to the store.
#define ATH_MSG_WARNING(x)
float y() const
Returns the y position.
SG::ReadHandleKey< xAOD::HIEventShapeContainer > m_eventShapeKey
Name of HIEventShapeContainer defining background.
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
Helper class to provide constant type-safe access to aux data.
Handle class for reading from StoreGate.
virtual StatusCode initialize()
Dummy implementation of the initialisation function.
cl
print [x.__class__ for x in toList(dqregion.getSubRegions()) ]
Scalar mag() const
mag method
void setClusterP4(const xAOD::CaloCluster::FourMom_t &p, xAOD::CaloCluster *cl, xAOD::CaloCluster::State s)
const_iterator begin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
ToolHandle< IHIUEModulatorTool > m_modulatorTool