|
ATLAS Offline Software
|
Go to the documentation of this file.
27 using std::unique_ptr;
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() );
186 auto* currentFile = TFile::CurrentFile();
187 currentFile->mkdir(
cut_name.data())->cd();
188 #define HIST_INIT( NAME, AXIS_LABEL, AXIS_N, AXIS_XL, AXIS_XH ) \
190 h_##NAME = new TH2F(#NAME, #NAME ";#eta;" AXIS_LABEL, 50,-2.5,2.5, \
191 AXIS_N, AXIS_XL, AXIS_XH); \
195 HIST_INIT( si_hits_phys,
"Si physical hits", 24, 0, 24 );
196 HIST_INIT( si_hits,
"Si hits", 24, 0, 24 );
197 HIST_INIT( si_holes,
"Si holes", 6, 0, 6 );
198 HIST_INIT( si_shared,
"Si shared hits", 6, 0, 6 );
199 HIST_INIT( pix_hits_phys,
"Pixel physical hits", 10, 0, 10 );
200 HIST_INIT( pix_hits,
"Pixel hits", 10, 0, 10 );
201 HIST_INIT( pix_holes,
"Pixel holes", 4, 0, 4 );
202 HIST_INIT( pix_shared,
"Pixel shared hits", 4, 0, 4 );
203 HIST_INIT( sct_hits_phys,
"SCT physical hits", 16, 0, 16 );
204 HIST_INIT( sct_hits,
"SCT hits", 16, 0, 16 );
205 HIST_INIT( sct_holes,
"SCT holes", 4, 0, 4 );
206 HIST_INIT( sct_shared,
"SCT shared hits", 4, 0, 4 );
207 HIST_INIT( ibl_hits,
"IBL hits", 4, 0, 4 );
208 HIST_INIT( ibl_expected,
"expect IBL hit", 2, 0, 2 );
209 HIST_INIT( bl_hits,
"BLayer hits", 4, 0, 4 );
210 HIST_INIT( bl_expected,
"expect BLayer hit", 2, 0, 2 );
211 HIST_INIT( trt_hits,
"TRT hits + outliers", 60, 0, 60 );
212 HIST_INIT( trt_outlier_fraction,
"TRT outlier fraction", 25, 0., 1. );
214 h_d0 =
new TH2F(
"d0",
"d_{0}^{BL};d_{0}^{BL} [mm];#sigma_{d_{0}} [mm]", 60, -3., 3., 60, 0., 3. );
215 h_z0sintheta =
new TH2F(
"z0sintheta",
"z_{0}^{PV} sin #theta;z_{0}^{PV} sin #theta [mm];#sigma_{z_{0} sin #theta} [mm]", 100, -5., 5., 50, 0., 5. );
254 h_si_hits->Fill(
eta, nPixHits + nPixDead + nSctHits + nSctDead);
262 double z0 = trk.
z0();
263 if (vtx !=
nullptr) {
264 z0 += trk.
vz() - vtx->
z();
268 double varZ0SinTheta = 0.;
269 varZ0SinTheta +=
covMatrix(1,1)*sinTheta*sinTheta;
270 varZ0SinTheta += 2*
covMatrix(1,3)*
z0*sinTheta*cosTheta;
281 Error(
"HistFamily::getSum()",
"Could not get summary type %i", sum_type );
virtual double pt() const override final
The transverse momentum ( ) of the particle.
@ numberOfPixelHoles
number of pixel layers on track with absence of hits [unit8_t].
@ numberOfSCTSharedHits
number of SCT hits shared by several tracks [unit8_t].
Scalar eta() const
pseudorapidity method
virtual double eta() const override final
The pseudorapidity ( ) of the particle.
StatusCode accept(const xAOD::Muon *mu)
bool summaryValue(uint8_t &value, const SummaryType &information) const
Accessor for TrackSummary values.
float vz() const
The z origin for the parameters.
float z0() const
Returns the parameter.
const_iterator cend() const noexcept
Return a const_iterator pointing past the end of the collection.
@ numberOfPixelHits
these are the pixel hits, including the b-layer [unit8_t].
@ expectInnermostPixelLayerHit
Do we expect a 0th-layer barrel hit for this track?
@ numberOfTRTHits
number of TRT hits [unit8_t].
@ kClassAccess
Access auxiliary data using the aux containers.
def TH2F(name, title, nxbins, bins_par2, bins_par3, bins_par4, bins_par5=None, bins_par6=None, path='', **kwargs)
float d0() const
Returns the parameter.
@ numberOfPixelSharedHits
number of Pixel all-layer hits shared by several tracks [unit8_t].
SummaryType
Enumerates the different types of information stored in Summary.
StatusCode readFrom(TFile *file)
@ expectNextToInnermostPixelLayerHit
Do we expect a 1st-layer barrel hit for this track?
POOL::TEvent event(POOL::TEvent::kClassAccess)
::StatusCode StatusCode
StatusCode definition for legacy code.
cut
This script demonstrates how to call a C++ class from Python Also how to use PyROOT is shown.
TH2 * h_trt_outlier_fraction
float z() const
Returns the z position.
@ numberOfSCTHoles
number of SCT holes [unit8_t].
outFile
Comment Out Those You do not wish to run.
@ numberOfNextToInnermostPixelLayerHits
these are the hits in the 1st pixel barrel layer
void fill(const xAOD::TrackParticle &, const xAOD::Vertex *)
const ParametersCovMatrix_t definingParametersCovMatrix() const
Returns the 5x5 symmetric matrix containing the defining parameters covariance matrix.
HistFamily & operator=(const HistFamily &)=delete
@ numberOfTRTOutliers
number of TRT outliers [unit8_t].
std::string getenv(const std::string &variableName)
get an environment variable
Class describing a Vertex.
HistFamily(const string &)
@ numberOfSCTDeadSensors
number of dead SCT sensors crossed [unit8_t].
StatusCode retrieve(const T *&obj)
uint8_t getSum(const xAOD::TrackParticle &, xAOD::SummaryType) const
@ numberOfSCTHits
number of hits in SCT [unit8_t].
const_iterator cbegin() const noexcept
Return a const_iterator pointing at the beginning of the collection.
Error
The different types of error that can be flagged in the L1TopoRDO.
@ numberOfPixelDeadSensors
number of dead pixel sensors crossed [unit8_t].
Class describing a TrackParticle.
float theta() const
Returns the parameter, which has range 0 to .
Tool for accessing xAOD files outside of Athena.
@ numberOfInnermostPixelLayerHits
these are the hits in the 0th pixel barrel layer
StatusCode Init(const char *appname)
Function initialising ROOT/PyROOT for using the ATLAS EDM.
HistFamily(const HistFamily &)=delete