ATLAS Offline Software
Loading...
Searching...
No Matches
xAODTauJetAuxContainerCnv_v1.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3*/
4
5
6// System include(s):
7#include <stdexcept>
8
9// Gaudi/Athena include(s):
10#include "GaudiKernel/MsgStream.h"
11
12// EDM include(s):
15
16// Local include(s):
18
19
23
27 MsgStream& /*log*/ ) const {
28
29 // Clear the transient object:
30 newObj->resize( 0 );
31
32 // Set up interface containers on top of them:
34 for( size_t i = 0; i < oldObj->size(); ++i ) {
35 oldInt.push_back( new xAOD::TauJet_v1() );
36 }
37 oldInt.setStore( oldObj );
39 newInt.setStore( newObj );
40
41 // Loop over the interface objects, and do the conversion with their help:
42 for( const xAOD::TauJet_v1* oldTau : oldInt ) {
43
44 // Add an object to the output container:
45 xAOD::TauJet* newTau = new xAOD::TauJet;
46 newInt.push_back( newTau );
47
48 //
49 // Copy the 4-momentum variables:
50 //
51 newTau->setP4( oldTau->pt(), oldTau->eta(), oldTau->phi(), oldTau->m() );
52 newTau->setP4( xAOD::TauJetParameters::JetSeed, oldTau->ptJetSeed(), oldTau->etaJetSeed(), oldTau->phiJetSeed(), oldTau->mJetSeed() );
53 newTau->setP4( xAOD::TauJetParameters::DetectorAxis, oldTau->ptDetectorAxis(), oldTau->etaDetectorAxis(), oldTau->phiDetectorAxis(), oldTau->mDetectorAxis() );
54 newTau->setP4( xAOD::TauJetParameters::IntermediateAxis, oldTau->ptIntermediateAxis(), oldTau->etaIntermediateAxis(), oldTau->phiIntermediateAxis(), oldTau->mIntermediateAxis() );
55 newTau->setP4( xAOD::TauJetParameters::TauEnergyScale, oldTau->ptTauEnergyScale(), oldTau->etaTauEnergyScale(), oldTau->phiTauEnergyScale(), oldTau->mTauEnergyScale() );
56 newTau->setP4( xAOD::TauJetParameters::TauEtaCalib, oldTau->ptTauEtaCalib(), oldTau->etaTauEtaCalib(), oldTau->phiTauEtaCalib(), oldTau->mTauEtaCalib() );
57 newTau->setP4( xAOD::TauJetParameters::PanTauCellBased, oldTau->ptPanTauCellBased(), oldTau->etaPanTauCellBased(), oldTau->phiPanTauCellBased(), oldTau->mPanTauCellBased() );
58 newTau->setP4( xAOD::TauJetParameters::PanTauCellBasedProto, oldTau->ptPanTauCellBasedProto(), oldTau->etaPanTauCellBasedProto(), oldTau->phiPanTauCellBasedProto(), oldTau->mPanTauCellBasedProto() );
59
60 // ROI and charge
61 newTau->setROIWord( oldTau->ROIWord() );
62 newTau->setCharge( oldTau->charge() );
63 newTau->setTrackFilterProngs( oldTau->trackFilterProngs() );
64 newTau->setTrackFilterQuality( oldTau->trackFilterQuality() );
65 newTau->setPi0ConeDR( oldTau->pi0ConeDR() );
66
67 //
68 //copy PID variables
69 //
80
81 //
82 //set individual int type details variables
83 //
88
89 //
90 //set individual float type details variables
91 //
142
143
144 //
145 //set pantau details
146 //
159
160 //copy element links
161 newTau->setJetLink( oldTau->jetLink() );
162 newTau->setVertexLink( oldTau->vertexLink() );
163 newTau->setSecondaryVertexLink( oldTau->secondaryVertexLink() );
164
165 const static SG::AuxElement::Accessor<xAOD::TauJet_v1::PFOLinks_t> neutralPFOAcc ("neutral_PFOLinks");
166 if (neutralPFOAcc.isAvailable (*oldTau)) {
167 newTau->setNeutralPFOLinks( oldTau->neutral_PFOLinks() );
168 }
169 const static SG::AuxElement::Accessor<xAOD::TauJet_v1::PFOLinks_t> chargedPFOAcc ("charged_PFOLinks");
170 if (chargedPFOAcc.isAvailable (*oldTau)) {
171 newTau->setChargedPFOLinks( oldTau->charged_PFOLinks() );
172 }
173 const static SG::AuxElement::Accessor<xAOD::TauJet_v1::PFOLinks_t> pi0PFOAcc ("pi0_PFOLinks");
174 if (pi0PFOAcc.isAvailable (*oldTau)) {
175 newTau->setPi0PFOLinks( oldTau->pi0_PFOLinks() );
176 }
177 const static SG::AuxElement::Accessor<xAOD::TauJet_v1::PFOLinks_t> shotPFOAcc ("shot_PFOLinks");
178 if (shotPFOAcc.isAvailable (*oldTau)) {
179 newTau->setShotPFOLinks( oldTau->shot_PFOLinks() );
180 }
181
182 //v2 doesn't have pfo element link with specific type name, so copy cellbased ones into proto
183 const static SG::AuxElement::Accessor<xAOD::TauJet_v1::PFOLinks_t> cellBasedNeutralPFOAcc ("cellBased_Neutral_PFOLinks");
184 if (cellBasedNeutralPFOAcc.isAvailable (*oldTau)) {
185 newTau->setProtoNeutralPFOLinks( oldTau->cellBased_Neutral_PFOLinks() );
186 }
187 const static SG::AuxElement::Accessor<xAOD::TauJet_v1::PFOLinks_t> cellBasedChargedPFOAcc ("cellBased_Charged_PFOLinks");
188 if (cellBasedChargedPFOAcc.isAvailable (*oldTau)) {
189 newTau->setProtoChargedPFOLinks( oldTau->cellBased_Charged_PFOLinks() );
190 }
191 const static SG::AuxElement::Accessor<xAOD::TauJet_v1::PFOLinks_t> cellBased_Pi0_PFOAcc ("cellBased_Pi0_PFOLinks");
192 if (cellBasedChargedPFOAcc.isAvailable (*oldTau)) {
193 newTau->setProtoPi0PFOLinks( oldTau->cellBased_Pi0_PFOLinks() );
194 }
195
196 }
197
198 return;
199}
200
206 MsgStream& log ) const {
207
208 log << MSG::ERROR
209 << "Somebody called xAODTauJetAuxContainerCnv_v1::transToPers"
210 << endmsg;
211 throw std::runtime_error( "Somebody called xAODTauJetAuxContainerCnv_v1::"
212 "transToPers" );
213
214 return;
215}
216
#define endmsg
value_type push_back(value_type pElem)
Add an element to the end of the collection.
SG::Accessor< T, ALLOC > Accessor
Definition AuxElement.h:572
bool isAvailable(const ELT &e) const
Test to see if this variable exists in the store.
virtual void transToPers(const xAOD::TauJetAuxContainer *, xAOD::TauJetAuxContainer_v1 *, MsgStream &log) const override
Dummy function inherited from the base class.
virtual void persToTrans(const xAOD::TauJetAuxContainer_v1 *oldObj, xAOD::TauJetAuxContainer *newObj, 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.
Definition TauJet_v1.h:38
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 setCharge(float)
void setVertexLink(const VertexLink_t &vertexLink)
void setPi0ConeDR(float)
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 setChargedPFOLinks(const PFOLinks_t &chargedPFOs)
@ hadRadius
Get hadron calorimeter radius.
Definition TauDefs.h:192
@ EMRadius
Get E_T radius.
Definition TauDefs.h:190
@ secMaxStripEt
migrate only seedTrk_ variables which are used in reco and ID and without prefix
Definition TauDefs.h:230
@ TauJetVtxFraction
@Tau Jet Vertex Fraction
Definition TauDefs.h:262
@ stripWidth2
Get strip width ^2.
Definition TauDefs.h:202
@ topoInvMass
get invariant mass from topoclusters of jet associated to tau candidate
Definition TauDefs.h:177
@ etHadAtEMScale
Get Hadronic energy at EM scale.
Definition TauDefs.h:196
@ isolFrac
Get isolation fraction.
Definition TauDefs.h:198
@ lead2ClusterEOverAllClusterE
Get sum of 2 leading cluster energy over all cluster energy.
Definition TauDefs.h:218
@ topoMeanDeltaR
get mean distance to leading topocluster for topoclusters of jet associated to tau candidate
Definition TauDefs.h:181
@ trkRmsDist
Get the RMS of track distance to calorimeter seed.
Definition TauDefs.h:216
@ nStrip
Get number of strips.
Definition TauDefs.h:204
@ cellBasedEnergyRing4
Ring 4: 0.10 < R < 0.125.
Definition TauDefs.h:252
@ effTopoMeanDeltaR
get mean distance to leading topocluster for effective topoclusters of jet associated to tau candidat...
Definition TauDefs.h:183
@ caloIso
Get sum of transvers energy of clusters around jet seed within 0.2 < dR < 0.4.
Definition TauDefs.h:222
@ trkAvgDist
Get calibrated EM transverse energy (DEPRECATED since r19)
Definition TauDefs.h:214
@ cellBasedEnergyRing6
Ring 6: 0.15 < R < 0.2.
Definition TauDefs.h:256
@ cellBasedEnergyRing5
Ring 5: 0.125 < R < 0.15.
Definition TauDefs.h:254
@ effTopoInvMass
get invariant mass from effective topoclusters of jet associated to tau candidate
Definition TauDefs.h:179
@ cellBasedEnergyRing7
Ring 7: 0.2 < R < 0.4.
Definition TauDefs.h:258
@ etEMAtEMScale
Get EM energy at EM scale.
Definition TauDefs.h:194
@ TRT_NHT_OVER_NLT
TRT hits high threshold over low threshold.
Definition TauDefs.h:260
@ centFrac
Get centrality fraction.
Definition TauDefs.h:200
@ caloIsoCorrected
Get sum of transvers energy of clusters around jet seed within 0.2 < dR < 0.4 (pile up corrected)
Definition TauDefs.h:224
@ cellBasedEnergyRing2
Ring 2: 0.05 < R < 0.075.
Definition TauDefs.h:248
@ numTopoClusters
get number of topocluster constituents of jet associated to tau candidate
Definition TauDefs.h:173
@ numEffTopoClusters
get number of effective topocluster constituents of jet associated to tau candidate !...
Definition TauDefs.h:175
@ cellBasedEnergyRing3
Ring 3: 0.075 < R < 0.10.
Definition TauDefs.h:250
@ cellBasedEnergyRing1
EM+TES final scale.
Definition TauDefs.h:246
@ dRmax
Get maximal dR of tracks associated to calo-seeded tau.
Definition TauDefs.h:226
@ lead3ClusterEOverAllClusterE
Get sum of 3 leading cluster energy over all cluster energy.
Definition TauDefs.h:220
@ PanTau_BDTVar_Neutral_PID_BDTValues_BDTSort_2
Definition TauDefs.h:371
@ PanTau_BDTVar_Neutral_Ratio_1stBDTEtOverEtAllConsts
Definition TauDefs.h:372
@ PanTau_BDTVar_Neutral_PID_BDTValues_BDTSort_1
Definition TauDefs.h:370
@ PanTau_BDTVar_Combined_DeltaR1stNeutralTo1stCharged
Definition TauDefs.h:375
@ PanTau_BDTVar_Neutral_Ratio_EtOverEtAllConsts
Definition TauDefs.h:373
@ PanTau_BDTVar_Charged_StdDev_Et_WrtEtAllConsts
Definition TauDefs.h:368
@ BDTJetScore
Boosted Decision Tree socre for Jet rejection (not transformed)
Definition TauDefs.h:78
@ BDTEleScore
Boosted Decision Tree score for electron rejection.
Definition TauDefs.h:80
@ BDTJetScoreSigTrans
BDT score which is signal transformed/flattened.
Definition TauDefs.h:84
DataVector< xAOD::TauJet_v1 > TauJetContainer_v1
The container is a simple typedef for now.
TauJet_v3 TauJet
Definition of the current "tau version".
TauJetAuxContainer_v3 TauJetAuxContainer
Definition of the current taujet auxiliary container.
TauJetContainer_v3 TauJetContainer
Definition of the current "taujet container version".