ATLAS Offline Software
Filter_RoIMatching.h
Go to the documentation of this file.
1 /* emacs: this is -*- c++ -*- */
12 #ifndef TrigInDetAnalysisUtils_Filter_RoIMatching_H
13 #define TrigInDetAnalysisUtils_Filter_RoIMatching_H
14 
15 
16 #include <iostream>
17 #include <string>
18 #include <cmath>
19 #include <map>
20 
24 
25 
26 class Filter_RoIMatching : public TIDA::TrackFilter {
27 
28  public:
29 
31 
32  bool select(const TIDA::Track* t) {
33  return true;
34  }
35 
36  bool select(const TIDA::Track* t, const TrigInDetAnalysis::TIDARoiDescriptor* roi) {
37  double deltaEta = t->eta() - roi->eta();
38  double deltaPhi = t->phi() - roi->phi(); if(deltaPhi<-M_PI)deltaPhi+=2*M_PI; if(deltaPhi>M_PI)deltaPhi-=2*M_PI;
39  if(std::fabs(deltaEta)>roi->etaHalfWidth() || std::fabs(deltaPhi)>roi->phiHalfWidth()) return false;
40  return true;
41  }
42 
43 };
44 
45 
46 #endif // TrigInDetAnalysisUtils_Filter_RoIMatching_H
Track.h
xAOD::deltaPhi
setSAddress setEtaMS setDirPhiMS setDirZMS setBarrelRadius setEndcapAlpha setEndcapRadius setInterceptInner setEtaMap setEtaBin setIsTgcFailure setDeltaPt deltaPhi
Definition: L2StandAloneMuon_v1.cxx:160
TrackFilter.h
base class for a single track selection filter allowing parameter setting for complex track selection
M_PI
#define M_PI
Definition: ActiveFraction.h:11
TIDARoiDescriptor.h
read_hist_ntuple.t
t
Definition: read_hist_ntuple.py:5
Filter_RoIMatching::select
bool select(const TIDA::Track *t)
Definition: Filter_RoIMatching.h:32
Filter_RoIMatching
Definition: Filter_RoIMatching.h:26
P4Helpers::deltaEta
double deltaEta(const I4Momentum &p1, const I4Momentum &p2)
Computes efficiently .
Definition: P4Helpers.h:53
Filter_RoIMatching::Filter_RoIMatching
Filter_RoIMatching()
Definition: Filter_RoIMatching.h:30
Filter_RoIMatching::select
bool select(const TIDA::Track *t, const TrigInDetAnalysis::TIDARoiDescriptor *roi)
Definition: Filter_RoIMatching.h:36
TIDA::Track
Definition: Trigger/TrigAnalysis/TrigInDetAnalysis/TrigInDetAnalysis/Track.h:26