11#include "CxxUtils/make_unique.h"
20using CxxUtils::make_unique;
22int main(
int argc,
char* argv[])
24 string appName =
argv[0];
25 if( !
xAOD::Init(appName.data()).isSuccess() ) {
26 Error( appName.data(),
"Could not call xAOD::Init()" );
35 Error( appName.data(),
"No file name received!" );
36 Error( appName.data(),
" Usage: %s [xAOD file name]", appName.data() );
46 Long64_t
entries =
event->getEntries();
47 Info( appName.data(),
"Number of events in file: %llu",
entries );
49 auto vertexSelTool = make_unique< HI::HIVertexSelectionTool >(
"vertexSelectionTool");
50 ASG_CHECK_SA( appName, vertexSelTool->setProperty(
"MinNTrk", 10 ) );
51 ASG_CHECK_SA( appName, vertexSelTool->setProperty(
"MinRmsPt", 10000. ) );
53 auto vtxTrkTool = make_unique<InDet::InDetTrackSelectionTool>(
"vtxTrkTool",
"HILoose");
54 ToolHandle< InDet::IInDetTrackSelectionTool > vtxTrkToolHandle = vtxTrkTool.get();
56 ASG_CHECK_SA( appName, vertexSelTool->setProperty(
"TrackSelectionTool", vtxTrkToolHandle ) );
61 Long64_t nVtxPass = 0;
62 Long64_t nVtxFail = 0;
63 for (Long64_t i_evt=0; i_evt<
entries; ++i_evt) {
64 event->getEntry( i_evt );
67 if ( !
event->retrieve( vertices,
"PrimaryVertices" ).isSuccess() ) {
68 Error( appName.data(),
"Could not retrieve PrimaryVertices" );
72 for (
const auto* vtx : *vertices) {
73 if (vertexSelTool->accept( *vtx )) nVtxPass++;
78 Info( appName.data(),
"%llu passed.", nVtxPass );
79 Info( appName.data(),
"%llu failed.", nVtxFail );
#define ASG_CHECK_SA(SOURCE, EXP)
Helper macro for checking the status code of a call outside of an ASG tool.
@ kClassAccess
Access auxiliary data using the aux containers.
Error
The different types of error that can be flagged in the L1TopoRDO.
std::string getenv(const std::string &variableName)
get an environment variable
StatusCode Init(const char *appname)
Function initialising ROOT/PyROOT for using the ATLAS EDM.
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".