11 #include "CxxUtils/make_unique.h"
19 using std::unique_ptr;
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() );
43 unique_ptr<TFile>
fin( TFile::Open(
fileName.data(),
"READ" ) );
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 );
85 #endif // XAOD_STANDALONE