Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
20 #include "TLorentzVector.h"
33 const IInterface*
p) :
38 declareInterface<DerivationFramework::IAugmentationTool>(
this);
59 ATH_MSG_ERROR(
"No SG name provided for the output of ZeeVertexRefittingTool!");
60 return StatusCode::FAILURE;
63 return StatusCode::SUCCESS;
69 return StatusCode::SUCCESS;
78 bool skipSample =
true;
80 if (mcid==eventInfo->mcChannelNumber()) {
85 if (skipSample)
return StatusCode::SUCCESS;
90 ATH_MSG_ERROR(
"Tool is attempting to write a StoreGate key " <<
m_refitpvKey.key() <<
" which already exists. Please use a different key");
91 return StatusCode::FAILURE;
99 refittedPVContainer->setStore( refittedPVAuxContainer );
103 std::unique_ptr< xAOD::VertexAuxContainer >(refittedPVAuxContainer)));
106 for (
const auto *
v : *pv_cont ) {
113 return StatusCode::SUCCESS;
121 std::vector< std::vector<unsigned int> > eepairs;
126 for (
auto pair : eepairs) {
127 std::vector<const xAOD::TrackParticle*> tps = {
132 TLorentzVector
v0, v1, egamVec;
133 if(
electrons->at(pair[0])->caloCluster())
135 v0.SetPtEtaPhiM(
electrons->at(pair[0])->e()/cosh(
electrons->at(pair[0])->caloCluster()->etaBE(2)),
136 electrons->at(pair[0])->caloCluster()->etaBE(2),
137 electrons->at(pair[0])->caloCluster()->phiBE(2),
141 if(
electrons->at(pair[1])->caloCluster())
143 v1.SetPtEtaPhiM(
electrons->at(pair[1])->e()/cosh(
electrons->at(pair[1])->caloCluster()->etaBE(2)),
144 electrons->at(pair[1])->caloCluster()->etaBE(2),
145 electrons->at(pair[1])->caloCluster()->phiBE(2),
151 ATH_MSG_DEBUG(
"Refitting PV for e tracks: " << tps[0] <<
" " << tps[1]);
160 if(ipv !=0 ) refittedPVContainer->
push_back(nv);
170 float vert_dphi = (fabs(vtxmom.DeltaPhi(egamVec)));
172 vertices_sumPt(*
v) = vert_sumpt;
173 vertices_sumPt2(*
v) = vert_sumpt2;
174 vertices_dPhi(*
v) = vert_dphi;
184 std::vector<ElementLink<xAOD::TrackParticleContainer> > electronTrackLinks = {
185 electrons->at(pair[0])->trackParticleLink(),
186 electrons->at(pair[1])->trackParticleLink()
188 electronTrackLinksDecor(*pv_ref) = electronTrackLinks;
190 ATH_MSG_DEBUG(
"Electrons from pair not used in the refitting ");
200 return StatusCode::SUCCESS;
205 if (
particles->size()<2)
return StatusCode::SUCCESS;
208 std::vector<int> isSelected =
m_parser->evaluateAsVector();
209 unsigned int nEntries = isSelected.size();
212 if (
nEntries==0)
return StatusCode::SUCCESS;
217 return StatusCode::FAILURE;
222 if (isSelected[
i]!=1)
continue;
225 for (
unsigned int j=
i+1; j<
nEntries; ++j) {
226 if (isSelected[j]!=1)
continue;
230 if (qi*qj>=0)
continue;
236 ZeePairs.push_back( {
i, j} );
239 return StatusCode::SUCCESS;
StatusCode finalizeParser()
float getVertexSumPt(const xAOD::Vertex *vertex, int power=1, bool useAux=true)
Loop over track particles associated with vertex and return scalar sum of pT^power in GeV (from auxda...
size_t nTrackParticles() const
Get the number of tracks associated with this vertex.
Temporary container used until we have I/O for AuxStoreInternal.
Vertex_v1 Vertex
Define the latest version of the vertex class.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
std::conditional< NUM_PARSER==1, std::unique_ptr< ExpressionParsing::ExpressionParser >, std::array< std::unique_ptr< ExpressionParsing::ExpressionParser >, NUM_PARSER > >::type m_parser
@ IS_SIMULATION
true: simulation, false: data
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
Helper class to provide type-safe access to aux data.
StatusCode recordNonConst(std::unique_ptr< T > data)
Record a non-const object to the store.
VertexAuxContainer_v1 VertexAuxContainer
Definition of the current jet auxiliary container.
::StatusCode StatusCode
StatusCode definition for legacy code.
#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.
TLorentzVector getVertexMomentum(const xAOD::Vertex *vertex, bool useAux=true, const std::string &derivationPrefix="")
Return vector sum of tracks associated with vertex (from auxdata if available and useAux = true)
StatusCode initializeParser(const ExpressionParsing::SelectionArg< 1 > &selection_string)
value_type push_back(value_type pElem)
Add an element to the end of the collection.
void makePrivateStore()
Create a new (empty) private store for this object.
Class describing a Vertex.
const xAOD::TrackParticle * getOriginalTrackParticle(const xAOD::Electron *el)
Helper function for getting the "Original" Track Particle (i.e before GSF) via the electron.
size_type size() const noexcept
Returns the number of elements in the collection.