|
ATLAS Offline Software
|
#include <ZeeVertexRefittingTool.h>
|
| ZeeVertexRefittingTool (const std::string &t, const std::string &n, const IInterface *p) |
|
StatusCode | initialize () override |
|
StatusCode | finalize () override |
|
StatusCode | addBranches () const override |
| Pass the thinning service
More...
|
|
StatusCode | initializeParser (const ExpressionParsing::SelectionArg< 1 > &selection_string) |
|
StatusCode | finalizeParser () |
|
virtual bool | updateDataNeeds (const std::vector< const DataObjID * > &input_data_in, const std::vector< const DataObjID * > &output_data_in, std::vector< Gaudi::DataHandle * > &new_input_handles, std::vector< Gaudi::DataHandle * > &new_output_handles) override |
| Inform a dynamic data consumer about all consumed or produced data. More...
|
|
virtual bool | renounceInput (const DataObjID &output_data_id) override |
|
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 |
|
|
std::string | m_expression |
|
float | m_massCut |
|
SG::ReadHandleKey< xAOD::VertexContainer > | m_primaryVertexKey {this, "PVContainerName", "PrimaryVertices", "" } |
|
SG::ReadHandleKey< xAOD::ElectronContainer > | m_electronKey { this, "ElectronContainerName", "Electrons", "" } |
|
SG::WriteHandleKey< xAOD::VertexContainer > | m_refitpvKey {this, "RefittedPVContainerName", "HggPrimaryVertices", "" } |
|
SG::ReadHandleKey< xAOD::EventInfo > | m_eventInfoKey { this, "EventInfoKey", "EventInfo", "" } |
|
std::vector< unsigned int > | m_MCSamples |
|
ToolHandle< Analysis::PrimaryVertexRefitter > | m_pvrefitter {this, "PrimaryVertexRefitterTool", "Analysis::PrimaryVertexRefitter"} |
|
StoreGateSvc_t | m_evtStore |
| Pointer to StoreGate (event store by default) More...
|
|
StoreGateSvc_t | m_detStore |
| Pointer to StoreGate (detector store by default) More...
|
|
std::vector< SG::VarHandleKeyArray * > | m_vhka |
|
bool | m_varHandleArraysDeclared |
|
Definition at line 36 of file ZeeVertexRefittingTool.h.
◆ StoreGateSvc_t
◆ ZeeVertexRefittingTool()
DerivationFramework::ZeeVertexRefittingTool::ZeeVertexRefittingTool |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
◆ _initializeParser()
◆ addBranches()
StatusCode DerivationFramework::ZeeVertexRefittingTool::addBranches |
( |
| ) |
const |
|
overridevirtual |
Pass the thinning service
Implements DerivationFramework::IAugmentationTool.
Definition at line 72 of file ZeeVertexRefittingTool.cxx.
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 );
102 ATH_CHECK(vertexContainer.recordNonConst(std::unique_ptr< xAOD::VertexContainer >(refittedPVContainer),
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 ");
198 ATH_MSG_DEBUG(
"Vertex container size: " << refittedPVContainer->size());
200 return StatusCode::SUCCESS;
◆ 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]
◆ 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
◆ finalize()
StatusCode DerivationFramework::ZeeVertexRefittingTool::finalize |
( |
| ) |
|
|
override |
◆ finalizeParser()
◆ initialize()
StatusCode DerivationFramework::ZeeVertexRefittingTool::initialize |
( |
| ) |
|
|
override |
◆ initializeParser()
◆ 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& DerivationFramework::IAugmentationTool::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
AlgTool interface methods.
Definition at line 31 of file IAugmentationTool.h.
31 {
return IID_IAugmentationTool; }
◆ makeZeePairs()
StatusCode DerivationFramework::ZeeVertexRefittingTool::makeZeePairs |
( |
const xAOD::ElectronContainer * |
particles, |
|
|
std::vector< std::vector< unsigned int > > & |
ZeePairs |
|
) |
| const |
|
private |
Definition at line 203 of file ZeeVertexRefittingTool.cxx.
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;
◆ 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()
◆ renounceInput()
◆ 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.
◆ updateDataNeeds()
virtual bool ExpressionParserUserBase< AthAlgTool , NUM_PARSER >::updateDataNeeds |
( |
const std::vector< const DataObjID * > & |
input_data_in, |
|
|
const std::vector< const DataObjID * > & |
output_data_in, |
|
|
std::vector< Gaudi::DataHandle * > & |
new_input_handles, |
|
|
std::vector< Gaudi::DataHandle * > & |
new_output_handles |
|
) |
| |
|
overridevirtualinherited |
Inform a dynamic data consumer about all consumed or produced data.
- Parameters
-
input_data_in | the input data object IDs of all algorithms and tools |
output_data_in | the output data object IDs of all algorithms and tools |
new_input_handles | the new input data handles added by this call |
new_output_handles | the new output data handles added by this call |
- Returns
- true if the consumer did update its handles, false otherwise
Implements IDynamicDataConsumer.
◆ updateVHKA()
◆ m_detStore
◆ m_electronKey
◆ m_eventInfoKey
◆ m_evtStore
◆ m_expression
std::string DerivationFramework::ZeeVertexRefittingTool::m_expression |
|
private |
◆ m_massCut
float DerivationFramework::ZeeVertexRefittingTool::m_massCut |
|
private |
◆ m_MCSamples
std::vector<unsigned int> DerivationFramework::ZeeVertexRefittingTool::m_MCSamples |
|
private |
◆ m_parser
◆ m_primaryVertexKey
◆ m_proxyLoaders
◆ m_pvrefitter
◆ m_refitpvKey
◆ m_renounce
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ m_xAODProxyLoader
The documentation for this class was generated from the following files:
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
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
@ IS_SIMULATION
true: simulation, false: data
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".
virtual void setOwner(IDataHandleHolder *o)=0
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
VertexAuxContainer_v1 VertexAuxContainer
Definition of the current jet auxiliary container.
#define CHECK(...)
Evaluate an expression and check for errors.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
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)
virtual void renounce()=0
StatusCode initializeParser(const ExpressionParsing::SelectionArg< 1 > &selection_string)
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
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.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
const xAOD::TrackParticle * getOriginalTrackParticle(const xAOD::Electron *el)
Helper function for getting the "Original" Track Particle (i.e before GSF) via the electron.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>