|
ATLAS Offline Software
|
#include <EGElectronAmbiguityTool.h>
|
| EGElectronAmbiguityTool (const std::string &t, const std::string &n, const IInterface *p) |
|
virtual StatusCode | initialize () override final |
|
virtual StatusCode | addBranches () const override final |
| Pass the thinning service
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 |
|
|
SG::ReadHandleKey< xAOD::ElectronContainer > | m_containerName |
|
SG::ReadHandleKey< xAOD::VertexContainer > | m_VtxContainerName |
|
SG::ReadHandleKey< xAOD::TrackParticleContainer > | m_tpContainerName |
|
SG::ReadHandleKey< xAOD::TrackParticleContainer > | m_tpCName |
|
SG::WriteDecorHandleKey< xAOD::ElectronContainer > | m_drv { this, "DFCommonSimpleConvRadius", "", "" } |
|
SG::WriteDecorHandleKey< xAOD::ElectronContainer > | m_dphiv { this, "DFCommonSimpleConvPhi", "", "" } |
|
SG::WriteDecorHandleKey< xAOD::ElectronContainer > | m_dmee { this, "DFCommonSimpleMee", "", "" } |
|
SG::WriteDecorHandleKey< xAOD::ElectronContainer > | m_dmeeVtx { this, "DFCommonSimpleMeeAtVtx", "", "" } |
|
SG::WriteDecorHandleKey< xAOD::ElectronContainer > | m_dsep { this, "DFCommonSimpleSeparation", "", "" } |
|
SG::WriteDecorHandleKey< xAOD::ElectronContainer > | m_dambi { this, "DFCommonAddAmbiguity", "", "" } |
|
SG::WriteDecorHandleKey< xAOD::ElectronContainer > | m_dtrv { this, "DFCommonProdTrueRadius", "", "" } |
|
SG::WriteDecorHandleKey< xAOD::ElectronContainer > | m_dtpv { this, "DFCommonProdTruePhi", "", "" } |
|
SG::WriteDecorHandleKey< xAOD::ElectronContainer > | m_dtzv { this, "DFCommonProdTrueZ", "", "" } |
|
bool | m_isMC {} |
|
double | m_elepTCut |
|
std::string | m_idCut |
|
unsigned int | m_nSiCut |
|
double | m_dctCut |
|
double | m_sepCut |
|
double | m_dzCut |
|
double | m_rvECCut |
|
double | m_meeAtVtxECCut |
|
double | m_meeICCut |
|
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 33 of file EGElectronAmbiguityTool.h.
◆ StoreGateSvc_t
◆ EGElectronAmbiguityTool()
DerivationFramework::EGElectronAmbiguityTool::EGElectronAmbiguityTool |
( |
const std::string & |
t, |
|
|
const std::string & |
n, |
|
|
const IInterface * |
p |
|
) |
| |
Definition at line 50 of file EGElectronAmbiguityTool.cxx.
55 declareInterface<DerivationFramework::IAugmentationTool>(
this);
60 "pTCut",
m_elepTCut = 9
e3,
"minimum pT for an electron to be studied");
62 m_idCut =
"DFCommonElectronsLHLoose",
63 "minimal quality for an electron to be studied");
66 "nSiCut",
m_nSiCut = 7,
"minimum number of Si hits in the other track");
68 "dzsinTCut",
m_dzCut = 0.5,
"max dz sinTheta between ele and other tracks");
74 "minimum radius to be classified as external conversion");
78 "maximal mass at vertex to be classified as external conversion");
81 "maximal mass at primary vertex to be classified as gamma*");
◆ addBranches()
StatusCode DerivationFramework::EGElectronAmbiguityTool::addBranches |
( |
| ) |
const |
|
finaloverridevirtual |
Pass the thinning service
Implements DerivationFramework::IAugmentationTool.
Definition at line 132 of file EGElectronAmbiguityTool.cxx.
134 const EventContext& ctx = Gaudi::Hive::currentContext();
145 for (
const auto*
vertex : *vtxC) {
161 return StatusCode::FAILURE;
164 ATH_MSG_DEBUG(
"No primary vertex found. Setting default values.");
167 dh.dphiv(*iele) = -1;
169 dh.dmeeVtx(*iele) = -1;
171 dh.dambi(*iele) = -1;
176 return StatusCode::SUCCESS;
178 ATH_MSG_DEBUG(
"Pvx z = " << pvtx->z() <<
", number of electrons "
187 std::set<const xAOD::TrackParticle*> alreadyStored;
188 std::set<const xAOD::TrackParticle*> eleIDtpStored, eleGSFtpStored;
190 std::make_unique<ConstDataVector<xAOD::TrackParticleContainer>>(
193 for (
const auto* ele : *eleC) {
199 m_idCut.empty() || !aidCut.isAvailable(*ele) || !aidCut(*ele))
204 eleGSFtpStored.insert(eleGSFtp);
208 eleIDtpStored.insert(eleIDtp);
211 for (
const auto*
tp : *idtpC) {
215 closeByTracks->push_back(
tp);
216 alreadyStored.insert(
tp);
221 if (alreadyStored.find(
tp) != alreadyStored.end())
229 double dR = eleIDtp->
p4().DeltaR(
tp->p4());
230 double dz = std::abs(eleIDtp->
z0() -
tp->z0()) *
sin(eleIDtp->
theta());
231 if (dR >= 0.3 || dz >=
m_dzCut)
238 alreadyStored.insert(
tp);
240 closeByTracks->push_back(
tp);
244 if (closeByTracks->empty())
245 return StatusCode::SUCCESS;
253 << idtpC->size() <<
" , number of selected close-by tracks "
254 << closeByTracks->size() <<
" , number of GSF tracks "
256 for (
const auto* trk : eleIDtpStored)
258 << trk <<
" pt = " << trk->pt() * 1
e-3
259 <<
" eta = " << trk->eta() <<
" phi = " << trk->phi()
261 for (
const auto* trk : eleGSFtpStored)
263 << trk <<
" pt = " << trk->pt() * 1
e-3
264 <<
" eta = " << trk->eta() <<
" phi = " << trk->phi()
268 << trk <<
" pt = " << trk->pt() * 1
e-3
269 <<
" eta = " << trk->eta() <<
" phi = " << trk->phi()
273 for (
const auto* ele : *eleC) {
277 m_idCut.empty() || !aidCut.isAvailable(*ele) || !aidCut(*ele))
282 ATH_MSG_ERROR(
"Cannot decorate the electron with the simple info");
283 return StatusCode::FAILURE;
288 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]
◆ decorateSimple()
HelixToCircle Main Track Electron
HelixToCircle Other Electron Conv Track
Definition at line 293 of file EGElectronAmbiguityTool.cxx.
313 <<
" phi = " << ele->
phi() <<
" GSF trk ptr = "
314 << eleGSFtrkP <<
" ID trk ptr " << eleIDtrkP);
319 double tpvr = -1, tpvp = 9e9, tpvz = 9e9;
320 if (truthEl && std::abs(truthEl->
pdgId()) == 11 &&
321 truthEl->
prodVtx() !=
nullptr) {
326 dh.dtrv(*ele) = tpvr;
327 dh.dtpv(*ele) = tpvp;
328 dh.dtzv(*ele) = tpvz;
334 double detaMin = 9e9;
337 if (
tp->charge() * eletrkP->
charge() > 0)
341 double dR = eletrkP->
p4().DeltaR(
tp->p4());
342 double dz = std::abs(eletrkP->
z0() -
tp->z0()) *
sin(eletrkP->
theta());
343 if (dR >= 0.3 || dz >=
m_dzCut)
346 double deta = std::abs(eletrkP->
eta() -
tp->eta());
347 if (deta < detaMin) {
356 double meeAtVtx = -1.;
358 bool goodConv =
false;
364 ep4.SetPtEtaPhiM(eletrkP->
pt(), eletrkP->
eta(), eletrkP->
phi(), 0.511);
368 op4.SetPtEtaPhiM(otrkP->pt(), otrkP->eta(), otrkP->phi(), 0.511);
371 mee = (ep4 + op4).M();
372 op4.SetPhi(eletrkP->
phi());
373 meeAtVtx = (ep4 + op4).M();
376 std::vector<double> helix1, helix2;
379 helix(eletrkP, pvtx, helix1);
380 helix(otrkP, pvtx, helix2);
383 if (helix1[4] < helix2[4])
384 beta = TMath::PiOver2() - helix1[4];
386 beta = TMath::PiOver2() - helix2[4];
388 double phi1(helix1[4] +
beta);
389 if (phi1 > TMath::TwoPi())
390 phi1 -= TMath::TwoPi();
392 phi1 += TMath::TwoPi();
394 double phi2(helix2[4] +
beta);
395 if (phi2 > TMath::TwoPi())
396 phi2 -= TMath::TwoPi();
398 phi2 += TMath::TwoPi();
401 double r1 = 1 / (2. * std::abs(helix1[1]));
406 double rcenter1(helix1[3] / charge1 + r1);
407 double phicenter1(phi1 + TMath::PiOver2() * charge1);
409 double x1 = rcenter1 *
cos(phicenter1);
410 double y1 = rcenter1 *
sin(phicenter1);
413 double r2 = 1 / (2. * std::abs(helix2[1]));
418 double rcenter2(helix2[3] / charge2 + r2);
419 double phicenter2(phi2 + TMath::PiOver2() * charge2);
421 double x2 = rcenter2 *
cos(phicenter2);
422 double y2 = rcenter2 *
sin(phicenter2);
426 if (dx < 1e-9 && dx > 0.)
428 if (
dx > -1
e-9 &&
dx < 0.)
430 double slope((
y1 -
y2) /
dx);
431 double b(
y1 - slope *
x1);
432 double alpha(
atan(slope));
435 double separation =
d -
r1 -
r2;
445 double temp1 = (cpx1 + cpx2) / 2;
446 double temp2 = slope * temp1 +
b;
450 double dct(helix1[0] - helix2[0]);
456 pv = std::atan2(convY, convX);
457 rv = sqrt(convX * convX + convY * convY);
458 if (convX *
cos(eletrkP->
phi()) + convY *
sin(eletrkP->
phi()) < 0)
467 dh.dmeeVtx(*ele) = meeAtVtx;
477 return StatusCode::SUCCESS;
◆ 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
◆ initialize()
StatusCode DerivationFramework::EGElectronAmbiguityTool::initialize |
( |
| ) |
|
|
finaloverridevirtual |
Definition at line 85 of file EGElectronAmbiguityTool.cxx.
94 m_drv = baseName +
".DFCommonSimpleConvRadius";
95 m_dphiv = baseName +
".DFCommonSimpleConvPhi";
96 m_dmee = baseName +
".DFCommonSimpleMee";
97 m_dmeeVtx = baseName +
".DFCommonSimpleMeeAtVtx";
98 m_dsep = baseName +
".DFCommonSimpleSeparation";
99 m_dambi = baseName +
".DFCommonAddAmbiguity";
100 m_dtrv = baseName +
".DFCommonProdTrueRadius";
101 m_dtpv = baseName +
".DFCommonProdTruePhi";
102 m_dtzv = baseName +
".DFCommonProdTrueZ";
114 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& DerivationFramework::IAugmentationTool::interfaceID |
( |
| ) |
|
|
inlinestaticinherited |
AlgTool interface methods.
Definition at line 31 of file IAugmentationTool.h.
31 {
return IID_IAugmentationTool; }
◆ 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()
◆ 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()
◆ DecorHandles
◆ m_containerName
Initial value:{
this,
"ContainerName",
"Electrons",
"SG key of electron container"
}
Definition at line 47 of file EGElectronAmbiguityTool.h.
◆ m_dambi
◆ m_dctCut
double DerivationFramework::EGElectronAmbiguityTool::m_dctCut |
|
private |
◆ m_detStore
◆ m_dmee
◆ m_dmeeVtx
◆ m_dphiv
◆ m_drv
◆ m_dsep
◆ m_dtpv
◆ m_dtrv
◆ m_dtzv
◆ m_dzCut
double DerivationFramework::EGElectronAmbiguityTool::m_dzCut |
|
private |
◆ m_elepTCut
double DerivationFramework::EGElectronAmbiguityTool::m_elepTCut |
|
private |
◆ m_evtStore
◆ m_idCut
std::string DerivationFramework::EGElectronAmbiguityTool::m_idCut |
|
private |
◆ m_isMC
bool DerivationFramework::EGElectronAmbiguityTool::m_isMC {} |
|
private |
◆ m_meeAtVtxECCut
double DerivationFramework::EGElectronAmbiguityTool::m_meeAtVtxECCut |
|
private |
◆ m_meeICCut
double DerivationFramework::EGElectronAmbiguityTool::m_meeICCut |
|
private |
◆ m_nSiCut
unsigned int DerivationFramework::EGElectronAmbiguityTool::m_nSiCut |
|
private |
◆ m_rvECCut
double DerivationFramework::EGElectronAmbiguityTool::m_rvECCut |
|
private |
◆ m_sepCut
double DerivationFramework::EGElectronAmbiguityTool::m_sepCut |
|
private |
◆ m_tpCName
Initial value:{
this,
"tpCName",
"GSFTrackParticles",
"SG key of TrackParticleInputContainer"
}
Definition at line 66 of file EGElectronAmbiguityTool.h.
◆ m_tpContainerName
Initial value:{
this,
"tpContainerName",
"InDetTrackParticles",
"SG key of track particles container"
}
Definition at line 59 of file EGElectronAmbiguityTool.h.
◆ m_varHandleArraysDeclared
◆ m_vhka
◆ m_VtxContainerName
Initial value:{
this,
"VtxContainerName",
"PrimaryVertices",
"SG key of vertex container"
}
Definition at line 53 of file EGElectronAmbiguityTool.h.
The documentation for this class was generated from the following files:
virtual double pt() const override final
The transverse momentum ( ) of the particle.
float phi() const
Vertex azimuthal angle.
@ VIEW_ELEMENTS
this data object is a view, it does not own its elmts
float charge() const
Returns the charge.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
float z0() const
Returns the parameter.
StoreGateSvc_t m_evtStore
Pointer to StoreGate (event store by default)
std::vector< SG::VarHandleKeyArray * > m_vhka
bool msgLvl(const MSG::Level lvl) const
const xAOD::TrackParticle * trackParticle(size_t index=0) const
Pointer to the xAOD::TrackParticle/s that match the electron candidate.
Helper class to provide constant type-safe access to aux data.
const std::string & key() const
Return the StoreGate ID for the referenced object.
virtual void setOwner(IDataHandleHolder *o)=0
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
Class describing a truth particle in the MC record.
float perp() const
Vertex transverse distance from the beam line.
virtual double phi() const override final
The azimuthal angle ( ) of the particle.
StoreGateSvc_t m_detStore
Pointer to StoreGate (detector store by default)
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
virtual void renounce()=0
std::conditional< std::is_base_of< SG::VarHandleKeyArray, T >::value, VarHandleKeyArrayType, type2 >::type type
const TruthVertex_v1 * prodVtx() const
The production vertex of this particle.
const xAOD::TruthParticle * getTruthParticle(const xAOD::IParticle &p)
Return the truthParticle associated to the given IParticle (if any)
std::size_t numberOfSiHits(const xAOD::TrackParticle *tp)
return the number of Si hits in the track particle
StatusCode initialize(bool used=true)
If this object is used as a property, then this should be called during the initialize phase.
Class describing a Vertex.
float z() const
Vertex longitudinal distance along the beam line form the origin.
SG::VarHandleKey & vhKey()
Return a non-const reference to the HandleKey.
virtual double pt() const override final
The transverse momentum ( ) of the particle.
const xAOD::TrackParticle * getOriginalTrackParticle(const xAOD::Electron *el)
Helper function for getting the "Original" Track Particle (i.e before GSF) via the electron.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
Class describing a TrackParticle.
int pdgId() const
PDG ID code.
float theta() const
Returns the parameter, which has range 0 to .
size_type size() const noexcept
Returns the number of elements in the collection.
Gaudi::Details::PropertyBase & declareGaudiProperty(Gaudi::Property< T > &hndl, const SG::VarHandleKeyType &)
specialization for handling Gaudi::Property<SG::VarHandleKey>
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)