ATLAS Offline Software
Filter_OfflineR22.h
Go to the documentation of this file.
1 /* emacs: this is -*- c++ -*- */
15 #ifndef TRIGINDETANALYSISUTILS_FILTER_OFFLINER22_H
16 #define TRIGINDETANALYSISUTILS_FILTER_OFFLINER22_H
17 
18 #include <iostream>
19 #include <cmath>
20 
24 
25 
26 // generic selection cut selection function
27 
28 class Filter_OfflineR22 : public TrackFilter {
29 
30 public:
31 
32  Filter_OfflineR22( 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<8 ) selected = false;
54  if( Nsiholes>2 ) selected = false;
55  if ( t->pixelHoles()>1 ) selected = false;
56  }
57  else if ( m_type=="loose-primary" ) {
58 
59  // Select track silicon hit content
60  if ( ( Nsi<10 ) && ( Nsi<8 || Nsiholes>0 ) ) selected = false;
61 
62  }
63  else if ( m_type=="tight" || m_type=="vtight" ) {
64 
65  // Select track silicon hit content
66  if ( std::fabs(t->eta())< 1.65 && Nsi<9 ) selected = false;
67  if ( std::fabs(t->eta())>=1.65 && Nsi<11 ) selected = false;
68 
69  if( Nsiholes>2 ) selected = false;
70  if ( t->pixelHoles()>0 ) selected = false;
71 
73  if ( ( t->expectBL() || t->hasTruth() ) && t->bLayerHits()<1 ) selected = false;
74 
75  if ( m_type=="vtight" && t->pixelHits()==0 ) selected = false;
76  }
77  else if ( m_type=="tight-tau" ) {
78 
79  // Select track silicon hit content
80  if ( std::fabs(t->eta())< 1.65 && Nsi<9 ) selected = false;
81  if ( std::fabs(t->eta())>=1.65 && Nsi<11 ) selected = false;
82 
83  if ( t->pixelHoles()>0 ) selected = false;
84 
85  if ( t->pixelHits()<4 ) selected = false;
86 
88  if ( ( t->expectBL() || t->hasTruth() ) && t->bLayerHits()<1 ) selected = false;
89  }
90  else {
91  std::cerr << "Filter_OfflineR22::type: " << m_type << "not recognised" << std::endl;
92  std::abort();
93  }
94 
95 
96  return selected;
97  }
98 
99 private:
100 
101  // selection
102 
103  double m_pTMin;
104  double m_z0max;
105  double m_a0max;
106  std::string m_type;
107 
108 };
109 
110 
111 
112 
113 
114 inline std::ostream& operator<<( std::ostream& s, const Filter_OfflineR22& ) {
115  return s;
116 }
117 
118 
119 #endif // TRIGINDETANALYSISUTILS_FILTER_OFFLINER22_H
120 
121 
122 
123 
124 
125 
126 
127 
128 
129 
Track.h
python.SystemOfUnits.s
int s
Definition: SystemOfUnits.py:131
Filter_OfflineR22
Definition: Filter_OfflineR22.h:28
Filter_OfflineR22::m_type
std::string m_type
Definition: Filter_OfflineR22.h:106
operator<<
std::ostream & operator<<(std::ostream &s, const Filter_OfflineR22 &)
Definition: Filter_OfflineR22.h:114
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_OfflineR22::Filter_OfflineR22
Filter_OfflineR22(double pTMin=1000, const std::string &type="tight", double z0=1000, double a0=1000)
Definition: Filter_OfflineR22.h:32
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
Filter_OfflineR22::select
bool select(const TIDA::Track *t, const TIDARoiDescriptor *=0)
Definition: Filter_OfflineR22.h:39
Filter_OfflineR22::m_z0max
double m_z0max
Definition: Filter_OfflineR22.h:104
TRT::Track::z0
@ z0
Definition: InnerDetector/InDetCalibEvent/TRT_CalibData/TRT_CalibData/TrackInfo.h:63
a0
double a0
Definition: globals.cxx:27
Filter_OfflineR22::m_a0max
double m_a0max
Definition: Filter_OfflineR22.h:105
python.CaloScaleNoiseConfig.type
type
Definition: CaloScaleNoiseConfig.py:78
TIDA::Track
Definition: Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/Track.h:26
Filter_OfflineR22::m_pTMin
double m_pTMin
Definition: Filter_OfflineR22.h:103