#include <memory>
#include <cstdlib>
#include <TFile.h>
#include <TError.h>
#include <TH2F.h>
#include "InDetTrackSelectionTool/InDetTrackSelectionTool.h"
Go to the source code of this file.
|
int | main (int argc, char *argv[]) |
|
◆ CHECK
◆ HIST_INIT
#define HIST_INIT |
( |
|
NAME, |
|
|
|
AXIS_LABEL, |
|
|
|
AXIS_N, |
|
|
|
AXIS_XL, |
|
|
|
AXIS_XH |
|
) |
| |
Value: do{ \
h_##NAME =
new TH2F(#NAME, #NAME
";#eta;" AXIS_LABEL, 50,-2.5,2.5, \
AXIS_N, AXIS_XL, AXIS_XH); \
} while (false)
◆ TrkSelTool
◆ main()
int main |
( |
int |
argc, |
|
|
char * |
argv[] |
|
) |
| |
Definition at line 66 of file InDetTrackSelectionToolTester.cxx.
70 #define CHECK( ARG ) do {ASG_CHECK_SA( APP_NAME, ARG );} while (false)
86 StatusCode::enableFailure();
93 unique_ptr< TFile >
ifile( TFile::Open(
fileName.data(),
"READ" ) );
94 StatusCode gotFile =
ifile.get()!=
nullptr ? StatusCode::SUCCESS : StatusCode::FAILURE;
103 Long64_t
entries =
event.getEntries();
105 const Long64_t
e = atoll(
argv[ 2 ] );
111 unique_ptr< TFile >
outFile(
new TFile(
"IDTrackSelectionToolTestOut.root",
"RECREATE"));
114 const vector<string> cutNames = {
"NoCut",
"Loose",
"LoosePrimary",
"TightPrimary",
"LooseMuon",
"LooseElectron",
"MinBias",
"HILoose",
"HITight",
"HILooseOptimized",
"HITightOptimized"};
115 const vector<string> otherCutNames = {
"IP",
"IPSigma",
"IPSignificance"};
116 std::map<string, unique_ptr<TrkSelTool> > selToolMap;
117 std::map<string, unique_ptr<HistFamily> > histFamilyMap;
118 for (
const auto&
cut : cutNames) {
123 selToolMap[
"IP"] = unique_ptr<TrkSelTool>(
new TrkSelTool(
"IPTrackSelection"));
124 CHECK( selToolMap[
"IP"]->setProperty(
"maxD0", 1.5 ) );
125 CHECK( selToolMap[
"IP"]->setProperty(
"maxZ0SinTheta", 1.5 ) );
127 histFamilyMap[
"IP"] = unique_ptr<HistFamily>(
new HistFamily(
"IP"));
128 selToolMap[
"IPSigma"] = unique_ptr<TrkSelTool>(
new TrkSelTool(
"IPSigmaTrackSelection"));
129 CHECK( selToolMap[
"IPSigma"]->setProperty(
"maxSigmaD0", 1.5 ) );
130 CHECK( selToolMap[
"IPSigma"]->setProperty(
"maxSigmaZ0SinTheta", 1.5 ) );
132 histFamilyMap[
"IPSigma"] = unique_ptr<HistFamily>(
new HistFamily(
"IPSigma"));
133 selToolMap[
"IPSignificance"] = unique_ptr<TrkSelTool>(
new TrkSelTool(
"IPSignificanceTrackSelection"));
134 CHECK( selToolMap[
"IPSignificance"]->setProperty(
"maxD0overSigmaD0", 3.0 ) );
135 CHECK( selToolMap[
"IPSignificance"]->setProperty(
"maxZ0SinThetaoverSigmaZ0SinTheta", 3.0 ) );
137 histFamilyMap[
"IPSignificance"] = unique_ptr<HistFamily>(
new HistFamily(
"IPSignificance"));
151 const auto it_pv = std::find_if(vertices->
cbegin(), vertices->
cend(),
153 {return vtx->vertexType() == xAOD::VxType::PriVtx;});
154 const xAOD::Vertex* primaryVertex = (it_pv == vertices->
cend()) ?
nullptr : *it_pv;
155 if (primaryVertex ==
nullptr) Warning(
APP_NAME,
"No primary vertex found." );
158 if (
track ==
nullptr) {
162 for (
const auto&
cut : cutNames) {
165 for (
const auto&
cut : otherCutNames) {
173 for (
const auto& selTool : selToolMap)
CHECK( selTool.second->finalize() );
def TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)
outFile
Comment Out Those You do not wish to run.
Class describing a TrackParticle.