ATLAS Offline Software
TIDATools.h
Go to the documentation of this file.
1 /* emacs: this is -*- c++ -*- */
13 #ifndef TrigInDetAnalysisExample_TIDATools_H
14 #define TrigInDetAnalysisExample_TIDATools_H
15 
16 
17 #include <vector>
18 
19 template<typename T>
20 void HighestPTOnly( std::vector<T*>& tracks ) {
21 
22  if ( tracks.size()>1 ) {
23 
24  std::vector<T*> tmp_tracks;
25 
26  int ih = 0;
27 
28  for ( unsigned i=1 ; i<tracks.size() ; i++ ) {
29  if ( std::fabs(tracks[i]->pT())>std::fabs(tracks[ih]->pT()) ) ih = i;
30  }
31 
32  tmp_tracks.push_back( tracks[ih] );
33 
34  tracks = tmp_tracks;
35  }
36 }
37 
38 
39 
40 template<typename T>
41 void FilterPT( std::vector<T*>& tracks, double pt ) {
42 
43  std::vector<T*> tmp_tracks;
44 
45  tmp_tracks.reserve( tracks.size() );
46 
47  for ( unsigned i=0 ; i<tracks.size() ; i++ ) {
48  if ( std::fabs(tracks[i]->pT())>=pt ) tmp_tracks.push_back( tracks[i] );
49  }
50 
51  if ( tmp_tracks.size()<tracks.size() ) tracks = tmp_tracks;
52 
53 }
54 
55 
56 
57 #endif // TrigInDetAnalysisExample_TIDATools_H
CalculateHighPtTerm.pT
pT
Definition: ICHEP2016/CalculateHighPtTerm.py:57
test_pyathena.pt
pt
Definition: test_pyathena.py:11
FilterPT
void FilterPT(std::vector< T * > &tracks, double pt)
Definition: TIDATools.h:41
lumiFormat.i
int i
Definition: lumiFormat.py:85
HighestPTOnly
void HighestPTOnly(std::vector< T * > &tracks)
Definition: TIDATools.h:20