#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) {
119 selToolMap[
cut] = unique_ptr<TrkSelTool>(
new TrkSelTool( (
cut+
"TrackSelection") ));
120 CHECK( selToolMap[
cut]->setProperty(
"CutLevel",
cut) );
124 selToolMap[
"IP"] = unique_ptr<TrkSelTool>(
new TrkSelTool(
"IPTrackSelection"));
125 CHECK( selToolMap[
"IP"]->setProperty(
"maxD0", 1.5 ) );
126 CHECK( selToolMap[
"IP"]->setProperty(
"maxZ0SinTheta", 1.5 ) );
128 histFamilyMap[
"IP"] = unique_ptr<HistFamily>(
new HistFamily(
"IP"));
129 selToolMap[
"IPSigma"] = unique_ptr<TrkSelTool>(
new TrkSelTool(
"IPSigmaTrackSelection"));
130 CHECK( selToolMap[
"IPSigma"]->setProperty(
"maxSigmaD0", 1.5 ) );
131 CHECK( selToolMap[
"IPSigma"]->setProperty(
"maxSigmaZ0SinTheta", 1.5 ) );
133 histFamilyMap[
"IPSigma"] = unique_ptr<HistFamily>(
new HistFamily(
"IPSigma"));
134 selToolMap[
"IPSignificance"] = unique_ptr<TrkSelTool>(
new TrkSelTool(
"IPSignificanceTrackSelection"));
135 CHECK( selToolMap[
"IPSignificance"]->setProperty(
"maxD0overSigmaD0", 3.0 ) );
136 CHECK( selToolMap[
"IPSignificance"]->setProperty(
"maxZ0SinThetaoverSigmaZ0SinTheta", 3.0 ) );
138 histFamilyMap[
"IPSignificance"] = unique_ptr<HistFamily>(
new HistFamily(
"IPSignificance"));
152 const auto it_pv = std::find_if(vertices->
cbegin(), vertices->
cend(),
154 {return vtx->vertexType() == xAOD::VxType::PriVtx;});
155 const xAOD::Vertex* primaryVertex = (it_pv == vertices->
cend()) ?
nullptr : *it_pv;
156 if (primaryVertex ==
nullptr) Warning(
APP_NAME,
"No primary vertex found." );
159 if (
track ==
nullptr) {
163 for (
const auto&
cut : cutNames) {
166 for (
const auto&
cut : otherCutNames) {
174 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.