Skip to content
Snippets Groups Projects
Commit 5c0faac7 authored by Emmanuel Le Guirriec's avatar Emmanuel Le Guirriec
Browse files

First change to use DataHandles in JetTagTools

parent c892bbcb
No related branches found
No related tags found
No related merge requests found
......@@ -12,6 +12,7 @@ atlas_depends_on_subdirs(
Control/AthToolSupport/AsgTools
Control/AthenaBaseComps
Control/SGTools
Control/StoreGate
DetectorDescription/GeoPrimitives
Event/xAOD/xAODBTagging
Event/xAOD/xAODJet
......@@ -29,8 +30,10 @@ atlas_depends_on_subdirs(
Control/AthenaKernel
Control/Navigation
Event/xAOD/xAODMuon
InnerDetector/InDetRecTools/InDetSVWithMuonTool
InnerDetector/InDetRecTools/InDetTrackSelectionTool
InnerDetector/InDetRecTools/TrackVertexAssociationTool
InnerDetector/InDetRecTools/InDetRecToolInterfaces
PhysicsAnalysis/AnalysisCommon/ParticleJetTools
PhysicsAnalysis/JetTagging/JetTagCalibration
PhysicsAnalysis/MuonID/MuonSelectorTools
......
......@@ -17,6 +17,7 @@
#include "AthenaBaseComps/AthAlgTool.h"
#include "GaudiKernel/ToolHandle.h"
#include "StoreGate/ReadHandle.h"
#include <vector>
#include "JetTagTools/ITagTool.h"
#include "xAODTracking/TrackParticle.h"
......@@ -78,7 +79,7 @@ namespace Analysis
ToolHandle< TrackSelector > m_trackSelectorTool;
std::string m_originalTPCollectionName;
const xAOD::TrackParticleContainer* m_originalTPCollection;
SG::ReadHandle<xAOD::TrackParticleContainer> m_originalTPCollection;
bool m_writeInfoBase; // writes a basic info for each tagger with Pb, Pu (IPInfoBase)
std::string m_infoPlusName; // key to store the IPInfoPlus
......
......@@ -22,6 +22,7 @@
#include "xAODTracking/TrackParticle.h"
#include "egammaMVACalib/egammaMVACalib.h"
#include "MVAUtils/BDT.h"
#include "StoreGate/ReadHandle.h"
#include "TMVA/MethodBase.h"
#include "TMVA/IMethod.h"
......
......@@ -48,7 +48,7 @@ public:
bool selectTrack(const xAOD::TrackParticle* track, double refPt = 0);
/** Processes all the tracks in input and outputs the tracks
passing the selection */
StatusCode selectAllTracks();
//StatusCode selectAllTracks();
inline const std::bitset<17> currentTrackpassedCuts() const { return m_passedCuts; }
......
......@@ -321,14 +321,14 @@ namespace Analysis {
author ) != m_jetWithInfoPlus.end()) keepInfoPlus = true;
/** retrieve the original TP collection for persistence: */
if(m_runModus == "analysis" && keepInfoPlus) {
/*if(m_runModus == "analysis" && keepInfoPlus) {
if (evtStore()->retrieve(m_originalTPCollection, m_originalTPCollectionName).isFailure()) {
ATH_MSG_ERROR("#BTAG# " << m_originalTPCollectionName << " not found in StoreGate.");
return;
} else {
ATH_MSG_VERBOSE("#BTAG# TrackParticleContainer " << m_originalTPCollectionName << " found.");
}
}
}*/
/** for reference mode: */
bool jetIsOkForReference = false;
......
......@@ -743,8 +743,9 @@ namespace Analysis
//std::cout << " trk: " << tmpMuon->primaryTrackParticle()->z0() << " PVZ: " << m_priVtx->z() << " and z: " << z0 << std::endl;
//Finding SV with a muon
const xAOD::TrackParticleContainer *trackParticles = 0;
CHECK( evtStore()->retrieve(trackParticles, "InDetTrackParticles") );
//const xAOD::TrackParticleContainer *trackParticles = 0;
//evtStore()->retrieve(trackParticles, "InDetTrackParticles") );
SG::ReadHandle<xAOD::TrackParticleContainer> trackParticles("InDetTrackParticles");
xAOD::TrackParticleContainer::const_iterator trackItr = trackParticles->begin();
xAOD::TrackParticleContainer::const_iterator trackItrE = trackParticles->end();
std::vector<const xAOD::TrackParticle*> my_trkparticles(0);
......
......@@ -12,6 +12,7 @@
#include "CLHEP/GenericFunctions/CumulativeChiSquare.hh"
#include "GeoPrimitives/GeoPrimitives.h"
#include "GaudiKernel/IToolSvc.h"
//#include "StoreGate/ReadHandle.h"
#include "ITrackToVertex/ITrackToVertex.h"
#include <TMath.h>
#include <string>
......@@ -364,22 +365,23 @@ namespace Analysis {
}
StatusCode TrackSelector::selectAllTracks() {
// StatusCode TrackSelector::selectAllTracks() {
/** retrieve input tracks: */
const xAOD::TrackParticleContainer* inputTracks(0);
StatusCode sc = evtStore()->retrieve(inputTracks, m_inputTrackCollection);
//const xAOD::TrackParticleContainer* inputTracks(0);
//SG::ReadHandle<xAOD::TrackParticleContainer> inputTracks(m_inputTrackCollection);
/* StatusCode sc = evtStore()->retrieve(inputTracks, m_inputTrackCollection);
if (sc.isFailure()) {
ATH_MSG_ERROR("#BTAG# TrackParticleContainer " << m_inputTrackCollection << " not found.");
return sc;
}
ATH_MSG_VERBOSE("#BTAG# TrackParticleContainer " << m_inputTrackCollection << " found.");
*/
/** create output container: */
xAOD::TrackParticleContainer* outputTracks = new xAOD::TrackParticleContainer();
// xAOD::TrackParticleContainer* outputTracks = new xAOD::TrackParticleContainer();
/** loop on tracks, select and fill output container: */
xAOD::TrackParticleContainer::const_iterator nextTrk(inputTracks->begin());
/* xAOD::TrackParticleContainer::const_iterator nextTrk(inputTracks->begin());
xAOD::TrackParticleContainer::const_iterator lastTrk(inputTracks->end());
for (; nextTrk!=lastTrk; nextTrk++) {
if( this->selectTrack( (*nextTrk) ) ) {
......@@ -387,10 +389,10 @@ namespace Analysis {
outputTracks->push_back( new xAOD::TrackParticle(**nextTrk) );
}
}
*/
/** storing output collection in StoreGate: */
ATH_MSG_VERBOSE("#BTAG# recording to StoreGate: " << m_outputTrackCollection);
sc = evtStore()->record(outputTracks, m_outputTrackCollection, false);
/* ATH_MSG_VERBOSE("#BTAG# recording to StoreGate: " << m_outputTrackCollection);
StatusCode sc = evtStore()->record(outputTracks, m_outputTrackCollection, false);
if (sc.isFailure()) {
ATH_MSG_ERROR("#BTAG# unable to store TrackParticleContainer " << m_outputTrackCollection);
return sc;
......@@ -399,5 +401,5 @@ namespace Analysis {
return StatusCode::SUCCESS;
}
*/
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment