ATLAS Offline Software
Filter_Offline2017.h
Go to the documentation of this file.
1 /* emacs: this is -*- c++ -*- */
15 #ifndef TRIGINDETANALYSISUTILS_FILTER_OFFLINE2017_H
16 #define TRIGINDETANALYSISUTILS_FILTER_OFFLINE2017_H
17 
18 #include <iostream>
19 #include <cmath>
20 
24 
25 
26 // generic selection cut selection function
27 
29 
30 public:
31 
32  Filter_Offline2017( double pTMin=1000, const std::string& type="tight", double z0=1000, double a0=1000 ) :
33  m_pTMin(pTMin),
34  m_z0max(z0),
35  m_a0max(a0),
36  m_type(type)
37  { }
38 
39  bool select(const TIDA::Track* t, const TIDARoiDescriptor* =0 ) {
40  // Select track parameters
41  bool selected = true;
42 
43  int Nsi = t->pixelHits()*0.5 + t->sctHits();
44  int Nsiholes = t->pixelHoles()+t->sctHoles();
45 
46  if ( std::fabs(t->z0())>m_z0max ) selected = false;
47  if ( std::fabs(t->a0())>m_a0max ) selected = false;
48  if ( std::fabs(t->eta())>2.5 || std::fabs(t->pT())<m_pTMin ) selected = false;
49 
50  if ( m_type=="loose" ) {
51 
52  // Select track silicon hit content
53  if( Nsi<7 ) selected = false;
54  if( Nsiholes>2 ) selected = false;
55  if ( t->pixelHoles()>1 ) selected = false;
56 
57  // if ( m_expectBL && ( ( t->expectBL() || t->hasTruth() ) && t->bLayerHits()<1) ) selected = false;
58  }
59  else if ( m_type=="loose-primary" ) {
60 
61  // Select track silicon hit content
62  if ( ( Nsi<10 ) && ( Nsi<7 || Nsiholes>0 ) ) selected = false;
63 
64  }
65  else if ( m_type=="tight" || m_type=="vtight" ) {
66 
67  // Select track silicon hit content
68  if ( std::fabs(t->eta())< 1.65 && Nsi<9 ) selected = false;
69  if ( std::fabs(t->eta())>=1.65 && Nsi<11 ) selected = false;
70 
71  if ( t->pixelHoles()>0 ) selected = false;
72 
74  if ( ( t->expectBL() || t->hasTruth() ) && t->bLayerHits()<1 ) selected = false;
75 
76  if ( m_type=="vtight" && t->pixelHits()==0 ) selected = false;
77  }
78  else if ( m_type=="tight-tau" ) {
79 
80  // Select track silicon hit content
81  if ( std::fabs(t->eta())< 1.65 && Nsi<9 ) selected = false;
82  if ( std::fabs(t->eta())>=1.65 && Nsi<11 ) selected = false;
83 
84  if ( t->pixelHoles()>0 ) selected = false;
85 
86  if ( t->pixelHits()<4 ) selected = false;
87 
89  if ( ( t->expectBL() || t->hasTruth() ) && t->bLayerHits()<1 ) selected = false;
90  }
91  else {
92  std::cerr << "Filter_Offline2017::type: " << m_type << "not recognised" << std::endl;
93  std::abort();
94  }
95 
96 
97  return selected;
98  }
99 
100 private:
101 
102  // selection
103 
104  double m_pTMin;
105  double m_z0max;
106  double m_a0max;
107  std::string m_type;
108 
109 };
110 
111 
112 
113 
114 
115 inline std::ostream& operator<<( std::ostream& s, const Filter_Offline2017& ) {
116  return s;
117 }
118 
119 
120 #endif // TRIGINDETANALYSISUTILS_FILTER_OFFLINE2017_H
121 
122 
123 
124 
125 
126 
127 
128 
129 
130 
Track.h
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
TrackFilter
Definition: TrackFilter.h:26
TrackFilter.h
base class for a single track selection filter allowing parameter setting for complex track selection
TIDARoiDescriptor
Describes the Region of Ineterest geometry It has basically 8 parameters.
Definition: TIDARoiDescriptor.h:42
TIDARoiDescriptor.h
Filter_Offline2017::select
bool select(const TIDA::Track *t, const TIDARoiDescriptor *=0)
Definition: Filter_Offline2017.h:39
operator<<
std::ostream & operator<<(std::ostream &s, const Filter_Offline2017 &)
Definition: Filter_Offline2017.h:115
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
Filter_Offline2017::m_pTMin
double m_pTMin
Definition: Filter_Offline2017.h:104
Filter_Offline2017::m_z0max
double m_z0max
Definition: Filter_Offline2017.h:105
Filter_Offline2017::m_type
std::string m_type
Definition: Filter_Offline2017.h:107
Filter_Offline2017
Definition: Filter_Offline2017.h:28
Filter_Offline2017::Filter_Offline2017
Filter_Offline2017(double pTMin=1000, const std::string &type="tight", double z0=1000, double a0=1000)
Definition: Filter_Offline2017.h:32
TRT::Track::z0
@ z0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:63
a0
double a0
Definition: globals.cxx:27
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TIDA::Track
Definition: Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/Track.h:26
Filter_Offline2017::m_a0max
double m_a0max
Definition: Filter_Offline2017.h:106