24 {
25
26 using namespace asg::msgUserCode;
27
29
30
31 if( argc < 2 ) {
34 return 1;
35 }
36
37
41 return 1;
42 }
43
44
47 TFile *
file =
new TFile(fileName,
"READ");
48
53 return 1;
54 }
55
56
58
59 Long64_t
entries =
event.getEntries();
60 if( argc > 2 ) {
61 const Long64_t
e = atoll( argv[2] );
64 }
65
66
68
69
70 matchTool.msg().setLevel( MSG::DEBUG );
71 ATH_CHECK( matchTool.setProperty(
"trackMatchProb", 0.7 ) );
72 ATH_CHECK( matchTool.setProperty(
"vertexMatchWeight", 0.7 ) );
74
75 TFile
fout(
"output.root",
"RECREATE");
77
78
79 TH1F * h_cat =
new TH1F(
"vertexMatchTypes",
"Number of vertices of each type",4,-0.5,3.5);
80 h_cat->GetXaxis()->SetBinLabel(1, "Matched");
81 h_cat->GetXaxis()->SetBinLabel(2, "Merged");
82 h_cat->GetXaxis()->SetBinLabel(3, "Split");
83 h_cat->GetXaxis()->SetBinLabel(4, "Fake");
84
85
86
87 TH1F * h_cat_hs =
new TH1F(
"vertexTypes_hardScatter",
"Number of events of each type",5,-0.5,4.5);
88 h_cat_hs->GetXaxis()->SetBinLabel(1, "Clean");
89 h_cat_hs->GetXaxis()->SetBinLabel(2, "Low PU");
90 h_cat_hs->GetXaxis()->SetBinLabel(3, "High PU");
91 h_cat_hs->GetXaxis()->SetBinLabel(4, "Split");
92 h_cat_hs->GetXaxis()->SetBinLabel(5, "No match");
93
94
96
97 event.getEntry( entry );
98
100 result =
event.retrieve( ei,
"EventInfo" );
102 Error(
APP_NAME,
"Failed to retrieve EventInfo on entry %i",
static_cast<int>(entry));
103 return 1;
104 }
105
106 if( entry % 100 == 0 ) {
108 "===Start event %i, run %i; %i events processed so far===",
111 static_cast<int>( entry ) );
112 }
113
114
116 result =
event.retrieve( vxContainer,
"PrimaryVertices" );
118 Error(
APP_NAME,
"Failed to retrieve PrimaryVertices on entry %i",
static_cast<int>(entry));
119 return 1;
120 }
121
122 int status = matchTool.matchVertices( *vxContainer );
123 if(!status) {
124 Error(
APP_NAME,
"Bad status from matching tool on entry %i",
static_cast<int>(entry));
125 continue;
126 }
127
128
130
131
132 for( auto vxit : *vxContainer ) {
133 h_cat->Fill( matchTypeDecor( *vxit ) );
134 }
135
136
138
139
140
141
142 }
143
144 h_cat->Write();
145 h_cat_hs->Write();
147
148 return 0;
149}
#define ATH_CHECK
Evaluate an expression and check for errors.
Class for vertex truth matching.
SG::Decorator< T, ALLOC > Decorator
class to provide type-safe access to aux data.
uint32_t runNumber() const
The current event's run number.
uint64_t eventNumber() const
The current event's event number.
Tool for accessing xAOD files outside of Athena.
@ kClassAccess
Access auxiliary data using the aux containers.
A relatively simple transient store for objects created in analysis.
HardScatterType classifyHardScatter(const xAOD::VertexContainer &vxContainer)
Error
The different types of error that can be flagged in the L1TopoRDO.
TH1F(name, title, nxbins, bins_par2, bins_par3=None, path='', **kwargs)
StatusCode Init(const char *appname)
Function initialising ROOT/PyROOT for using the ATLAS EDM.
EventInfo_v1 EventInfo
Definition of the latest event info version.
VertexContainer_v1 VertexContainer
Definition of the current "Vertex container version".