9#include "GaudiKernel/MsgStream.h"
10#include "GaudiKernel/ThreadLocalContext.h"
24#include "GaudiKernel/ServiceHandle.h"
35 const std::string& key,
36 MsgStream& log )
const {
39 if (evtStore.retrieve().isFailure()) {
40 log << MSG::ERROR <<
"Cannot get StoreGateHandle" <<
endmsg;
44 std::string tauTrackContName=key;
45 if (tauTrackContName.ends_with (
"Aux.")) {
46 tauTrackContName.resize (tauTrackContName.size()-4);
53 if(tauTrackContName.find(
"Jet") != std::string::npos){
54 tauTrackContName.replace( tauTrackContName.find(
"Jet"), 3,
"Track" );
55 if(tauTrackContName.find(
"HLT") != std::string::npos) tauTrackContName+=
"Tracks";
57 else if (key.length() > 0) {
58 log << MSG::ERROR <<
"Cannot decipher name TauTrackContainer should have" <<
endmsg;
62 std::string tauTrackAuxContName=tauTrackContName+
"Aux.";
71 pTracks->setStore(pAuxTracks);
73 if(evtStore->record(pTracks, tauTrackContName).isFailure() ||
74 evtStore->record(pAuxTracks, tauTrackAuxContName).isFailure()){
75 log << MSG::DEBUG <<
"Couldn't Record TauTracks" <<
endmsg;
85 for(
size_t i = 0; i < oldObj->
size(); ++i ) {
88 oldInt.setStore( oldObj );
90 newInt.setStore( newObj );
102 newTau->
setP4( oldTau->pt(), oldTau->eta(), oldTau->phi(), oldTau->m() );
225 if(key.length()==0)
continue;
228 const EventContext& ctx = Gaudi::Hive::currentContext();
233 for(
unsigned int i = 0; i < oldTau->nTracks(); ++i){
236 if(!linkToTrackParticle.
isValid())
continue;
238 pTracks->
push_back(std::make_unique<xAOD::TauTrack>());
241 track.addTrackLink(linkToTrackParticle);
242 track.setP4(trackParticle->
pt(), trackParticle->
eta(), trackParticle->
phi(), trackParticle->
m());
252 for(
unsigned int i = 0; i < oldTau->nWideTracks(); ++i){
255 if(!linkToTrackParticle.
isValid())
continue;
257 pTracks->
push_back(std::make_unique<xAOD::TauTrack>());
260 track.addTrackLink(linkToTrackParticle);
261 track.setP4(trackParticle->
pt(), trackParticle->
eta(), trackParticle->
phi(), trackParticle->
m());
269 for(
unsigned int i = 0; i < oldTau->nOtherTracks(); ++i){
272 if(!linkToTrackParticle.
isValid())
continue;
274 pTracks->
push_back(std::make_unique<xAOD::TauTrack>());
277 track.addTrackLink(linkToTrackParticle);
278 track.setP4(trackParticle->
pt(), trackParticle->
eta(), trackParticle->
phi(), trackParticle->
m());
301 MsgStream& log )
const {
304 <<
"Somebody called xAODTauJetAuxContainerCnv_v2::transToPers"
306 throw std::runtime_error(
"Somebody called xAODTauJetAuxContainerCnv_v2::"
const T * back() const
Access the last element in the collection as an rvalue.
value_type push_back(value_type pElem)
Add an element to the end of the collection.
size_type size() const noexcept
Returns the number of elements in the collection.
ElementLink implementation for ROOT usage.
virtual bool toTransient()
Reset the object's internal cache.
bool isValid() const
Test to see if the link can be dereferenced.
sgkey_t key() const
Get the key that we reference, as a hash.
xAOD::TVirtualEvent * source() const
Get the data source for the reference.
xAODTauJetAuxContainerCnv_v2()
Default constructor.
virtual void transToPersWithKey(const xAOD::TauJetAuxContainer *, xAOD::TauJetAuxContainer_v2 *, const std::string &key, MsgStream &log) const override
Dummy function inherited from the base class.
virtual void persToTransWithKey(const xAOD::TauJetAuxContainer_v2 *oldObj, xAOD::TauJetAuxContainer *newObj, const std::string &key, MsgStream &log) const override
Function converting from the old type to the current one.
virtual bool resize(size_t size) override
Resize the arrays to a given size.
virtual size_t size() const override
Get the size of the container.
Temporary container used until we have I/O for AuxStoreInternal.
Class describing a tau jet.
void setShotPFOLinks(const PFOLinks_t &shotPFOs)
void setProtoPi0PFOLinks(const PFOLinks_t &protoPi0PFOs)
void setJetLink(const JetLink_t &jetLink)
void setPi0PFOLinks(const PFOLinks_t &pi0PFOs)
void setROIWord(unsigned int)
void setPanTauDetail(TauJetParameters::PanTauDetails panTauDetail, int value)
void setVertexLink(const VertexLink_t &vertexLink)
void setProtoChargedPFOLinks(const PFOLinks_t &protoChargedPFOs)
void setSecondaryVertexLink(const VertexLink_t &vertexLink)
void setDiscriminant(TauJetParameters::TauID discID, double disc)
Set value of discriminant.
void setDetail(TauJetParameters::Detail detail, int value)
void setTrackFilterQuality(int)
void setP4(double pt, double eta, double phi, double m)
Set methods for IParticle values.
void setTrackFilterProngs(int)
void setIsTau(TauJetParameters::IsTauFlag flag, bool value)
Set Flag for tau acceptance based on predefined arbitrary criteria.
void setProtoNeutralPFOLinks(const PFOLinks_t &protoNeutralPFOs)
void setNeutralPFOLinks(const PFOLinks_t &neutralPFOs)
void addTauTrackLink(const ElementLink< TauTrackContainer > &tr)
add a TauTrack to the tau
void setChargedPFOLinks(const PFOLinks_t &chargedPFOs)
size_t nTracks(TauJetParameters::TauTrackFlag flag=TauJetParameters::TauTrackFlag::classifiedCharged) const
virtual double m() const override final
The invariant mass of the particle..
virtual FourMom_t p4() const override final
The full 4-momentum of the particle.
virtual double phi() const override final
The azimuthal angle ( ) of the particle (has range to .)
virtual double pt() const override final
The transverse momentum ( ) of the particle.
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
uint32_t sgkey_t
Type used for hashed StoreGate key+CLID pairs.
@ hadRadius
Get hadron calorimeter radius.
@ EMRadius
Get E_T radius.
@ secMaxStripEt
migrate only seedTrk_ variables which are used in reco and ID and without prefix
@ TauJetVtxFraction
@Tau Jet Vertex Fraction
@ stripWidth2
Get strip width ^2.
@ topoInvMass
get invariant mass from topoclusters of jet associated to tau candidate
@ etHadAtEMScale
Get Hadronic energy at EM scale.
@ etOverPtLeadTrkCorrected
@ isolFrac
Get isolation fraction.
@ lead2ClusterEOverAllClusterE
Get sum of 2 leading cluster energy over all cluster energy.
@ topoMeanDeltaR
get mean distance to leading topocluster for topoclusters of jet associated to tau candidate
@ trkRmsDist
Get the RMS of track distance to calorimeter seed.
@ nStrip
Get number of strips.
@ cellBasedEnergyRing4
Ring 4: 0.10 < R < 0.125.
@ effTopoMeanDeltaR
get mean distance to leading topocluster for effective topoclusters of jet associated to tau candidat...
@ sumEMCellEtOverLeadTrkPt
@ caloIso
Get sum of transvers energy of clusters around jet seed within 0.2 < dR < 0.4.
@ trkAvgDist
Get calibrated EM transverse energy (DEPRECATED since r19)
@ cellBasedEnergyRing6
Ring 6: 0.15 < R < 0.2.
@ cellBasedEnergyRing5
Ring 5: 0.125 < R < 0.15.
@ effTopoInvMass
get invariant mass from effective topoclusters of jet associated to tau candidate
@ cellBasedEnergyRing7
Ring 7: 0.2 < R < 0.4.
@ innerTrkAvgDistCorrected
@ etEMAtEMScale
Get EM energy at EM scale.
@ TRT_NHT_OVER_NLT
TRT hits high threshold over low threshold.
@ centFrac
Get centrality fraction.
@ caloIsoCorrected
Get sum of transvers energy of clusters around jet seed within 0.2 < dR < 0.4 (pile up corrected)
@ cellBasedEnergyRing2
Ring 2: 0.05 < R < 0.075.
@ numTopoClusters
get number of topocluster constituents of jet associated to tau candidate
@ numEffTopoClusters
get number of effective topocluster constituents of jet associated to tau candidate !...
@ cellBasedEnergyRing3
Ring 3: 0.075 < R < 0.10.
@ cellBasedEnergyRing1
EM+TES final scale.
@ dRmax
Get maximal dR of tracks associated to calo-seeded tau.
@ lead3ClusterEOverAllClusterE
Get sum of 3 leading cluster energy over all cluster energy.
@ PanTau_BDTVar_Neutral_PID_BDTValues_BDTSort_2
@ PanTau_BDTValue_1p1n_vs_1pXn
@ PanTau_BDTVar_Neutral_Ratio_1stBDTEtOverEtAllConsts
@ PanTau_BDTValue_3p0n_vs_3pXn
@ PanTau_isPanTauCandidate
@ PanTau_BDTVar_Neutral_PID_BDTValues_BDTSort_1
@ PanTau_BDTVar_Combined_DeltaR1stNeutralTo1stCharged
@ PanTau_BDTVar_Neutral_Ratio_EtOverEtAllConsts
@ PanTau_BDTVar_Charged_StdDev_Et_WrtEtAllConsts
@ PanTau_BDTValue_1p0n_vs_1p1n
@ BDTJetScore
Boosted Decision Tree socre for Jet rejection (not transformed)
@ BDTEleScore
Boosted Decision Tree score for electron rejection.
@ BDTJetScoreSigTrans
BDT score which is signal transformed/flattened.
TrackParticle_v1 TrackParticle
Reference the current persistent version:
TauTrack_v1 TauTrack
Definition of the current version.
TauJet_v3 TauJet
Definition of the current "tau version".
TauJetAuxContainer_v3 TauJetAuxContainer
Definition of the current taujet auxiliary container.
TauTrackContainer_v1 TauTrackContainer
Definition of the current TauTrack container version.
DataVector< xAOD::TauJet_v2 > TauJetContainer_v2
The container is a simple typedef for now.
TauJetContainer_v3 TauJetContainer
Definition of the current "taujet container version".
TauTrackAuxContainer_v1 TauTrackAuxContainer