Skip to content
Snippets Groups Projects
Commit 5a7e374e authored by Vakhtang Tsulaia's avatar Vakhtang Tsulaia
Browse files

Several PhysicsAnalysis packages migrated to xAOD::EventInfo

parent 5383c1a0
No related branches found
No related tags found
No related merge requests found
Showing
with 62 additions and 80 deletions
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/ */
/** /**
...@@ -13,7 +13,6 @@ ...@@ -13,7 +13,6 @@
#ifndef TRUTHD3P3MAKER_PILEUPINFOASSOCIATORTOOL_H #ifndef TRUTHD3P3MAKER_PILEUPINFOASSOCIATORTOOL_H
#define TRUTHD3P3MAKER_PILEUPINFOASSOCIATORTOOL_H #define TRUTHD3P3MAKER_PILEUPINFOASSOCIATORTOOL_H
#include "EventInfo/EventInfo.h"
#include "EventInfo/PileUpEventInfo.h" #include "EventInfo/PileUpEventInfo.h"
#include "D3PDMakerUtils/MultiAssociationTool.h" #include "D3PDMakerUtils/MultiAssociationTool.h"
......
...@@ -16,7 +16,6 @@ atlas_depends_on_subdirs( PRIVATE ...@@ -16,7 +16,6 @@ atlas_depends_on_subdirs( PRIVATE
Control/AthenaBaseComps Control/AthenaBaseComps
Control/AthenaKernel Control/AthenaKernel
Control/CxxUtils Control/CxxUtils
Event/EventInfo
Event/EventKernel Event/EventKernel
Event/xAOD/xAODCaloEvent Event/xAOD/xAODCaloEvent
Event/xAOD/xAODEgamma Event/xAOD/xAODEgamma
...@@ -36,7 +35,7 @@ atlas_depends_on_subdirs( PRIVATE ...@@ -36,7 +35,7 @@ atlas_depends_on_subdirs( PRIVATE
atlas_add_component( egammaD3PDAnalysis atlas_add_component( egammaD3PDAnalysis
src/*.cxx src/*.cxx
src/components/*.cxx src/components/*.cxx
LINK_LIBRARIES CaloClusterCorrectionLib CaloEvent CaloGeoHelpers CaloRecLib AthContainers AthenaBaseComps AthenaKernel CxxUtils EventInfo EventKernel xAODCaloEvent xAODEgamma xAODTruth GaudiKernel LArCablingLib D3PDMakerUtils MCTruthClassifierLib RecoToolInterfaces egammaEvent TrkCaloExtension VxVertex ) LINK_LIBRARIES CaloClusterCorrectionLib CaloEvent CaloGeoHelpers CaloRecLib AthContainers AthenaBaseComps AthenaKernel CxxUtils EventKernel xAODCaloEvent xAODEgamma xAODTruth GaudiKernel LArCablingLib D3PDMakerUtils MCTruthClassifierLib RecoToolInterfaces egammaEvent TrkCaloExtension VxVertex )
# Install files from the package: # Install files from the package:
atlas_install_headers( egammaD3PDAnalysis ) atlas_install_headers( egammaD3PDAnalysis )
......
// This file's extension implies that it's C, but it's really -*- C++ -*-. // This file's extension implies that it's C, but it's really -*- C++ -*-.
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/ */
// $Id: egammaTimeCorrAlg.h 604352 2014-07-01 04:52:11Z ssnyder $ // $Id: egammaTimeCorrAlg.h 604352 2014-07-01 04:52:11Z ssnyder $
...@@ -23,9 +23,6 @@ ...@@ -23,9 +23,6 @@
#include "VxVertex/VxContainer.h" #include "VxVertex/VxContainer.h"
#include "VxVertex/RecVertex.h" #include "VxVertex/RecVertex.h"
#include "EventInfo/EventInfo.h"
#include "EventInfo/EventID.h"
#include "CaloInterface/ICaloClusterTimeTool.h" #include "CaloInterface/ICaloClusterTimeTool.h"
#include <vector> #include <vector>
......
...@@ -14,7 +14,6 @@ atlas_depends_on_subdirs( PUBLIC ...@@ -14,7 +14,6 @@ atlas_depends_on_subdirs( PUBLIC
PhysicsAnalysis/DerivationFramework/DerivationFrameworkInterfaces PhysicsAnalysis/DerivationFramework/DerivationFrameworkInterfaces
PRIVATE PRIVATE
Control/AthenaKernel Control/AthenaKernel
Event/EventInfo
Event/xAOD/xAODBase Event/xAOD/xAODBase
Event/xAOD/xAODJet Event/xAOD/xAODJet
Generators/GeneratorObjects Generators/GeneratorObjects
...@@ -34,7 +33,7 @@ atlas_add_library( DerivationFrameworkMCTruthLib ...@@ -34,7 +33,7 @@ atlas_add_library( DerivationFrameworkMCTruthLib
INCLUDE_DIRS ${HEPPDT_INCLUDE_DIRS} ${FASTJET_INCLUDE_DIRS} ${HEPMC_INCLUDE_DIRS} INCLUDE_DIRS ${HEPPDT_INCLUDE_DIRS} ${FASTJET_INCLUDE_DIRS} ${HEPMC_INCLUDE_DIRS}
PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS}
LINK_LIBRARIES ${HEPPDT_LIBRARIES} ${FASTJET_LIBRARIES} ${HEPMC_LIBRARIES} AthenaBaseComps xAODEventInfo xAODTruth GaudiKernel SGtests ExpressionEvaluationLib MCTruthClassifierLib LINK_LIBRARIES ${HEPPDT_LIBRARIES} ${FASTJET_LIBRARIES} ${HEPMC_LIBRARIES} AthenaBaseComps xAODEventInfo xAODTruth GaudiKernel SGtests ExpressionEvaluationLib MCTruthClassifierLib
PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaKernel EventInfo xAODBase xAODJet GeneratorObjects ) PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaKernel xAODBase xAODJet GeneratorObjects )
atlas_add_component( DerivationFrameworkMCTruth atlas_add_component( DerivationFrameworkMCTruth
src/components/*.cxx src/components/*.cxx
......
...@@ -36,7 +36,8 @@ ...@@ -36,7 +36,8 @@
#include "DerivationFrameworkMCTruth/DecayGraphHelper.h" #include "DerivationFrameworkMCTruth/DecayGraphHelper.h"
#include "xAODTruth/TruthParticleContainer.h" #include "xAODTruth/TruthParticleContainer.h"
#include "GaudiKernel/ToolHandle.h" #include "GaudiKernel/ToolHandle.h"
#include "StoreGate/ReadHandleKey.h"
#include "xAODEventInfo/EventInfo.h"
class IThinningSvc; class IThinningSvc;
namespace DerivationFramework { namespace DerivationFramework {
...@@ -59,8 +60,8 @@ namespace DerivationFramework { ...@@ -59,8 +60,8 @@ namespace DerivationFramework {
// handle to the thinning service // handle to the thinning service
ServiceHandle<IThinningSvc> m_thinningSvc; ServiceHandle<IThinningSvc> m_thinningSvc;
SG::ReadHandleKey<xAOD::EventInfo> m_evt {this, "EvtInfo", "EventInfo", "EventInfo name"};
// TruthParticle container names // TruthParticle container names
std::string m_eventInfoName;
std::string m_truthParticleName; std::string m_truthParticleName;
std::string m_truthVertexName; std::string m_truthVertexName;
std::string m_hardParticleName; std::string m_hardParticleName;
......
...@@ -21,13 +21,9 @@ ...@@ -21,13 +21,9 @@
#include "xAODJet/JetContainer.h" #include "xAODJet/JetContainer.h"
#include "xAODBase/IParticle.h" #include "xAODBase/IParticle.h"
#include "xAODBase/IParticleContainer.h" #include "xAODBase/IParticleContainer.h"
#include "xAODEventInfo/EventInfo.h"
//#include "EventKernel/PdtPdg.h"
#include "AthenaKernel/errorcheck.h" #include "AthenaKernel/errorcheck.h"
#include "HepPID/ParticleIDMethods.hh" #include "HepPID/ParticleIDMethods.hh"
#include "GaudiKernel/SystemOfUnits.h" #include "GaudiKernel/SystemOfUnits.h"
#include "EventInfo/EventInfo.h"
#include "EventInfo/EventID.h"
#include <vector> #include <vector>
#include <string> #include <string>
...@@ -60,9 +56,6 @@ DerivationFramework::HardTruthThinning::HardTruthThinning( ...@@ -60,9 +56,6 @@ DerivationFramework::HardTruthThinning::HardTruthThinning(
declareInterface<DerivationFramework::IThinningTool>(this); declareInterface<DerivationFramework::IThinningTool>(this);
declareProperty("ThinningService", m_thinningSvc); declareProperty("ThinningService", m_thinningSvc);
declareProperty("EventInfo", m_eventInfoName,
"EventInfo name");
declareProperty("TruthParticles", m_truthParticleName, declareProperty("TruthParticles", m_truthParticleName,
"truth particle container name"); "truth particle container name");
...@@ -116,6 +109,8 @@ DerivationFramework::HardTruthThinning::~HardTruthThinning() { ...@@ -116,6 +109,8 @@ DerivationFramework::HardTruthThinning::~HardTruthThinning() {
StatusCode DerivationFramework::HardTruthThinning::initialize() StatusCode DerivationFramework::HardTruthThinning::initialize()
{ {
ATH_CHECK( m_evt.initialize() );
m_evtCount = -1; m_evtCount = -1;
m_errCount = 0; m_errCount = 0;
...@@ -151,14 +146,12 @@ StatusCode DerivationFramework::HardTruthThinning::doThinning() const ...@@ -151,14 +146,12 @@ StatusCode DerivationFramework::HardTruthThinning::doThinning() const
//bool doExtra = false; //bool doExtra = false;
// Retrieve Event/EventInfo -- FIXME SG::ReadHandle<xAOD::EventInfo> evt(m_evt);
if(!evt.isValid()) {
const EventInfo* eventInfo = 0; ATH_MSG_ERROR("Failed to retrieve EventInfo");
if( !evtStore()->retrieve( eventInfo, m_eventInfoName).isSuccess() ){
ATH_MSG_ERROR("No EventInfo found with name " <<m_eventInfoName );
return StatusCode::FAILURE; return StatusCode::FAILURE;
} }
long long int evtNum = eventInfo->event_ID()->event_number(); long long int evtNum = evt->eventNumber();
// Retrieve truth particles and vertices // Retrieve truth particles and vertices
......
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/ */
#ifndef EGAMMATAGTOOL_H #ifndef EGAMMATAGTOOL_H
...@@ -14,17 +14,13 @@ Purpose : build the Egamma Tag objects - AnalysisTag.h. ...@@ -14,17 +14,13 @@ Purpose : build the Egamma Tag objects - AnalysisTag.h.
The Egamma Analysis Tag fragment is built here The Egamma Analysis Tag fragment is built here
*****************************************************************************/ *****************************************************************************/
#include "StoreGate/StoreGateSvc.h" #include "StoreGate/StoreGateSvc.h"
#include "StoreGate/ReadHandleKey.h"
#include "AthenaBaseComps/AthAlgTool.h" #include "AthenaBaseComps/AthAlgTool.h"
#include "EventInfo/EventInfo.h" #include "xAODEventInfo/EventInfo.h"
#include "EventInfo/EventType.h"
#include "EventInfo/EventID.h"
//#include "egammaEvent/ElectronContainer.h"
#include "xAODEgamma/EgammaContainer.h" #include "xAODEgamma/EgammaContainer.h"
#include "xAODEgamma/PhotonContainer.h" #include "xAODEgamma/PhotonContainer.h"
#include "xAODEgamma/ElectronContainer.h" #include "xAODEgamma/ElectronContainer.h"
#include "xAODMissingET/MissingETContainer.h" #include "xAODMissingET/MissingETContainer.h"
//#include "egammaEvent/PhotonContainer.h"
//#include "MissingETEvent/MissingET.h"
#include "TagEvent/TagFragmentCollection.h" #include "TagEvent/TagFragmentCollection.h"
#include "AthenaPoolUtilities/AthenaAttributeSpecification.h" #include "AthenaPoolUtilities/AthenaAttributeSpecification.h"
#include <vector> #include <vector>
...@@ -51,12 +47,12 @@ public: ...@@ -51,12 +47,12 @@ public:
private: private:
bool ZeeSelection (const xAOD::ElectronContainer* eleColl, bool ZeeSelection (const xAOD::ElectronContainer* eleColl,
const DataHandle<EventInfo>& eventInfo); SG::ReadHandle<xAOD::EventInfo> eventInfo);
bool WenuSelection (const xAOD::ElectronContainer* eleColl, bool WenuSelection (const xAOD::ElectronContainer* eleColl,
const xAOD::MissingETContainer* metTopo, const xAOD::MissingETContainer* metTopo,
const DataHandle<EventInfo>& eventInfo); SG::ReadHandle<xAOD::EventInfo> eventInfo);
void dumpEventDetails(const xAOD::Electron*, void dumpEventDetails(const xAOD::Electron*,
const DataHandle<EventInfo>& eventInfo); SG::ReadHandle<xAOD::EventInfo> eventInfo);
private: private:
...@@ -78,6 +74,8 @@ private: ...@@ -78,6 +74,8 @@ private:
double m_welectronPtCut; double m_welectronPtCut;
double m_invMass; double m_invMass;
SG::ReadHandleKey<xAOD::EventInfo> m_evt {this, "EvtInfo", "EventInfo", "EventInfo name"};
}; };
#endif // ELECTRONTAGTOOL_H #endif // ELECTRONTAGTOOL_H
......
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/ */
/***************************************************************************** /*****************************************************************************
...@@ -52,6 +52,7 @@ EgammaTagTool::EgammaTagTool (const std::string& type, const std::string& name, ...@@ -52,6 +52,7 @@ EgammaTagTool::EgammaTagTool (const std::string& type, const std::string& name,
StatusCode EgammaTagTool::initialize() StatusCode EgammaTagTool::initialize()
{ {
ATH_MSG_DEBUG("in initialize()"); ATH_MSG_DEBUG("in initialize()");
ATH_CHECK( m_evt.initialize() );
return StatusCode::SUCCESS; return StatusCode::SUCCESS;
} }
...@@ -81,8 +82,11 @@ StatusCode EgammaTagTool::execute(TagFragmentCollection& egammaTagCol, const int ...@@ -81,8 +82,11 @@ StatusCode EgammaTagTool::execute(TagFragmentCollection& egammaTagCol, const int
const xAOD::MissingETContainer* metTopo = nullptr; const xAOD::MissingETContainer* metTopo = nullptr;
ATH_CHECK( evtStore()->retrieve(metTopo, m_missingEtObject) ); ATH_CHECK( evtStore()->retrieve(metTopo, m_missingEtObject) );
const DataHandle<EventInfo> eventInfo; SG::ReadHandle<xAOD::EventInfo> evt(m_evt);
ATH_CHECK( evtStore()->retrieve(eventInfo) ); if(!evt.isValid()) {
ATH_MSG_ERROR("Failed to retrieve EventInfo");
return StatusCode::FAILURE;
}
/** Flags for Z and W events */ /** Flags for Z and W events */
m_flagZeeEvent = false; m_flagZeeEvent = false;
...@@ -91,12 +95,12 @@ StatusCode EgammaTagTool::execute(TagFragmentCollection& egammaTagCol, const int ...@@ -91,12 +95,12 @@ StatusCode EgammaTagTool::execute(TagFragmentCollection& egammaTagCol, const int
//=================================================== //===================================================
// Zee event reconstruction // Zee event reconstruction
//=================================================== //===================================================
m_flagZeeEvent = ZeeSelection (eleColl, eventInfo); m_flagZeeEvent = ZeeSelection (eleColl, evt);
//=================================================== //===================================================
// Wenu event reconstruction // Wenu event reconstruction
//=================================================== //===================================================
m_flagWenuEvent = WenuSelection (eleColl, metTopo, eventInfo); m_flagWenuEvent = WenuSelection (eleColl, metTopo, evt);
//=================================================== //===================================================
...@@ -121,7 +125,7 @@ StatusCode EgammaTagTool::finalize() { ...@@ -121,7 +125,7 @@ StatusCode EgammaTagTool::finalize() {
bool EgammaTagTool::ZeeSelection (const xAOD::ElectronContainer* eleColl, bool EgammaTagTool::ZeeSelection (const xAOD::ElectronContainer* eleColl,
const DataHandle<EventInfo>& eventInfo) SG::ReadHandle<xAOD::EventInfo> eventInfo)
{ {
ATH_MSG_DEBUG("in ZeeSelection()"); ATH_MSG_DEBUG("in ZeeSelection()");
...@@ -173,7 +177,7 @@ bool EgammaTagTool::ZeeSelection (const xAOD::ElectronContainer* eleColl, ...@@ -173,7 +177,7 @@ bool EgammaTagTool::ZeeSelection (const xAOD::ElectronContainer* eleColl,
if ( (m_massZLow < invMass) && (invMass < m_massZHigh) ) m_flagZeeEvent = true; if ( (m_massZLow < invMass) && (invMass < m_massZHigh) ) m_flagZeeEvent = true;
/** Print the details of Zee Candidate if outputLevel=DEBUG */ /** Print the details of Zee Candidate if outputLevel=DEBUG */
if (m_flagZeeEvent) { if (m_flagZeeEvent && msgLvl(MSG::DEBUG)) {
ATH_MSG_DEBUG("***** First electron candidate of Zee *****" ); ATH_MSG_DEBUG("***** First electron candidate of Zee *****" );
dumpEventDetails(electrons_positive[i], eventInfo); dumpEventDetails(electrons_positive[i], eventInfo);
ATH_MSG_DEBUG("***** Second electron candidate of Zee *****" ); ATH_MSG_DEBUG("***** Second electron candidate of Zee *****" );
...@@ -190,7 +194,7 @@ bool EgammaTagTool::ZeeSelection (const xAOD::ElectronContainer* eleColl, ...@@ -190,7 +194,7 @@ bool EgammaTagTool::ZeeSelection (const xAOD::ElectronContainer* eleColl,
bool EgammaTagTool::WenuSelection (const xAOD::ElectronContainer* eleColl, bool EgammaTagTool::WenuSelection (const xAOD::ElectronContainer* eleColl,
const xAOD::MissingETContainer* metTopo, const xAOD::MissingETContainer* metTopo,
const DataHandle<EventInfo>& eventInfo) SG::ReadHandle<xAOD::EventInfo> eventInfo)
{ {
ATH_MSG_DEBUG("in WenuSelection()"); ATH_MSG_DEBUG("in WenuSelection()");
...@@ -212,7 +216,7 @@ bool EgammaTagTool::WenuSelection (const xAOD::ElectronContainer* eleColl, ...@@ -212,7 +216,7 @@ bool EgammaTagTool::WenuSelection (const xAOD::ElectronContainer* eleColl,
if (select) m_flagWenuEvent = true; if (select) m_flagWenuEvent = true;
if (m_flagWenuEvent) { if (m_flagWenuEvent && msgLvl(MSG::DEBUG)) {
ATH_MSG_DEBUG("***** Electron Candidate in Wenu *****" ); ATH_MSG_DEBUG("***** Electron Candidate in Wenu *****" );
dumpEventDetails(*eleItr, eventInfo); dumpEventDetails(*eleItr, eventInfo);
} }
...@@ -223,30 +227,20 @@ bool EgammaTagTool::WenuSelection (const xAOD::ElectronContainer* eleColl, ...@@ -223,30 +227,20 @@ bool EgammaTagTool::WenuSelection (const xAOD::ElectronContainer* eleColl,
} }
void EgammaTagTool::dumpEventDetails(const xAOD::Electron* eleItr, void EgammaTagTool::dumpEventDetails(const xAOD::Electron* eleItr,
const DataHandle<EventInfo>& eventInfo) SG::ReadHandle<xAOD::EventInfo> eventInfo)
{ {
ATH_MSG_DEBUG("Event info : " ATH_MSG_DEBUG("Event info : "
<< " runNumber = " << eventInfo->event_ID()->run_number() << " runNumber = " << eventInfo->runNumber()
<< " lumiBlock = " << eventInfo->event_ID()->lumi_block() << " lumiBlock = " << eventInfo->lumiBlock()
<< " eventNumber = " << eventInfo->event_ID()->event_number() << " eventNumber = " << eventInfo->eventNumber()
); );
ATH_MSG_DEBUG("Electrons : " ATH_MSG_DEBUG("Electrons : "
<<" pt = " << eleItr->pt() <<" pt = " << eleItr->pt()
<<" eta = " << eleItr->eta() <<" eta = " << eleItr->eta()
<<" phi = " << eleItr->phi() <<" phi = " << eleItr->phi()
<<" charge = " << eleItr->charge() <<" charge = " << eleItr->charge()
// <<" loosePP = " << eleItr->passID(egammaPID::ElectronIDLoosePP) );
// <<" mediumPP = " << eleItr->passID(egammaPID::ElectronIDMediumPP)
// <<" tightPP = " << eleItr->passID(egammaPID::ElectronIDTightPP)
);
ATH_MSG_DEBUG("Event MET_topo : "
// <<" pt = " << metTopo->et()
// <<" phi = " << metTopo->phi()
);
ATH_MSG_DEBUG("Invariant mass = " << m_invMass ); ATH_MSG_DEBUG("Invariant mass = " << m_invMass );
} }
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/ */
#ifndef EVENTTAGALGS_GLOBALEVENTATTRIBUTENAMES_H #ifndef EVENTTAGALGS_GLOBALEVENTATTRIBUTENAMES_H
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
Author - Ketevi A. Assamagan Author - Ketevi A. Assamagan
Feb 2006 Feb 2006
****************************************/ ****************************************/
//#include "EventInfo/EventInfo.h"
#include "AthenaPoolUtilities/AthenaAttributeSpecification.h" #include "AthenaPoolUtilities/AthenaAttributeSpecification.h"
#include "GlobalGroupAndUnitNames.h" #include "GlobalGroupAndUnitNames.h"
#include <string> #include <string>
......
...@@ -20,7 +20,6 @@ atlas_depends_on_subdirs( PUBLIC ...@@ -20,7 +20,6 @@ atlas_depends_on_subdirs( PUBLIC
PRIVATE PRIVATE
Control/AthenaKernel Control/AthenaKernel
Event/EventBookkeeperMetaData Event/EventBookkeeperMetaData
Event/EventInfo
Event/FourMomUtils Event/FourMomUtils
Event/xAOD/xAODEventInfo Event/xAOD/xAODEventInfo
Event/xAOD/xAODJet Event/xAOD/xAODJet
...@@ -35,7 +34,7 @@ atlas_add_component( LongLivedParticleDPDMaker ...@@ -35,7 +34,7 @@ atlas_add_component( LongLivedParticleDPDMaker
src/*.cxx src/*.cxx
src/components/*.cxx src/components/*.cxx
INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS}
LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps xAODCaloEvent xAODEgamma xAODMuon xAODTracking GaudiKernel MuonSelectorToolsLib TrigDecisionToolLib TrigObjectMatchingLib AthenaKernel EventBookkeeperMetaData EventInfo FourMomUtils xAODEventInfo xAODJet xAODMissingET ) LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps xAODCaloEvent xAODEgamma xAODMuon xAODTracking GaudiKernel MuonSelectorToolsLib TrigDecisionToolLib TrigObjectMatchingLib AthenaKernel EventBookkeeperMetaData FourMomUtils xAODEventInfo xAODJet xAODMissingET )
# Install files from the package: # Install files from the package:
atlas_install_headers( LongLivedParticleDPDMaker ) atlas_install_headers( LongLivedParticleDPDMaker )
......
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/ */
#ifndef RPVLL_TESTRATES_H #ifndef RPVLL_TESTRATES_H
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
#include "GaudiKernel/IIncidentListener.h" #include "GaudiKernel/IIncidentListener.h"
#include "AthenaBaseComps/AthAlgorithm.h" #include "AthenaBaseComps/AthAlgorithm.h"
#include "GaudiKernel/ITHistSvc.h" #include "GaudiKernel/ITHistSvc.h"
#include "StoreGate/ReadHandleKey.h"
#include "xAODEventInfo/EventInfo.h"
#include "TH1.h" #include "TH1.h"
#include "TH2.h" #include "TH2.h"
...@@ -51,6 +53,8 @@ class RPVLLTestRates : public AthAlgorithm { ...@@ -51,6 +53,8 @@ class RPVLLTestRates : public AthAlgorithm {
int m_lumiBlock; int m_lumiBlock;
int m_evtNum; int m_evtNum;
std::vector<int> m_filterPassed; std::vector<int> m_filterPassed;
SG::ReadHandleKey<xAOD::EventInfo> m_evt {this, "EvtInfo", "EventInfo", "EventInfo name"};
}; };
#endif #endif
......
/* /*
Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
*/ */
#include "LongLivedParticleDPDMaker/RPVLLTestRates.h" #include "LongLivedParticleDPDMaker/RPVLLTestRates.h"
#include "EventBookkeeperMetaData/EventBookkeeperCollection.h" #include "EventBookkeeperMetaData/EventBookkeeperCollection.h"
#include "EventBookkeeperMetaData/SkimDecisionCollection.h" #include "EventBookkeeperMetaData/SkimDecisionCollection.h"
#include "EventInfo/EventInfo.h"
#include "EventInfo/EventID.h"
#include <iostream> #include <iostream>
...@@ -23,7 +21,6 @@ RPVLLTestRates::RPVLLTestRates(const std::string& name, ISvcLocator* pSvcLocator ...@@ -23,7 +21,6 @@ RPVLLTestRates::RPVLLTestRates(const std::string& name, ISvcLocator* pSvcLocator
m_runNum(0), m_runNum(0),
m_lumiBlock(0), m_lumiBlock(0),
m_evtNum(0) m_evtNum(0)
// m_filterPassed(0)
{ {
} }
...@@ -43,6 +40,8 @@ StatusCode RPVLLTestRates::initialize() { ...@@ -43,6 +40,8 @@ StatusCode RPVLLTestRates::initialize() {
StatusCode sc = m_tHistSvc.retrieve(); StatusCode sc = m_tHistSvc.retrieve();
if (sc.isFailure()) return StatusCode::FAILURE; if (sc.isFailure()) return StatusCode::FAILURE;
ATH_CHECK( m_evt.initialize() );
m_myTree= new TTree("myTree","myTree"); m_myTree= new TTree("myTree","myTree");
sc = m_tHistSvc->regTree("/AANT/myTree",m_myTree); sc = m_tHistSvc->regTree("/AANT/myTree",m_myTree);
if (sc.isFailure()) msg(MSG::ERROR)<<"Failed to book TTree"<<endmsg; if (sc.isFailure()) msg(MSG::ERROR)<<"Failed to book TTree"<<endmsg;
...@@ -94,19 +93,19 @@ StatusCode RPVLLTestRates::execute() { ...@@ -94,19 +93,19 @@ StatusCode RPVLLTestRates::execute() {
m_EventCounter++; m_EventCounter++;
const EventInfo* eventInfo = nullptr; SG::ReadHandle<xAOD::EventInfo> evt(m_evt);
StatusCode sc = evtStore()->retrieve(eventInfo); if (!evt.isValid()) {
if (sc.isFailure()) {
ATH_MSG_ERROR( "Could not retrieve event info" ); ATH_MSG_ERROR( "Could not retrieve event info" );
return StatusCode::FAILURE;
} }
m_runNum = eventInfo->event_ID()->run_number(); m_runNum = evt->runNumber();
m_evtNum = eventInfo->event_ID()->event_number(); m_evtNum = evt->eventNumber();
m_lumiBlock = eventInfo->event_ID()->lumi_block(); m_lumiBlock = evt->lumiBlock();
//// these are the ones that are useful for RPVLL filters //// these are the ones that are useful for RPVLL filters
const SkimDecisionCollection *SDcoll = 0; const SkimDecisionCollection *SDcoll = 0;
sc = evtStore()->retrieve(SDcoll, "StreamDESDM_RPVLL_SkimDecisionsContainer"); StatusCode sc = evtStore()->retrieve(SDcoll, "StreamDESDM_RPVLL_SkimDecisionsContainer");
int isAc=0; int isAc=0;
if (sc.isSuccess()){ if (sc.isSuccess()){
......
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