2 |
|
#define L1ObjColl_H |
3 |
|
|
4 |
|
#include "UserCode/L1RpcTriggerAnalysis/interface/L1Obj.h" |
5 |
+ |
#include "DataFormats/Math/interface/deltaR.h" |
6 |
|
#include <vector> |
7 |
+ |
#include <cmath> |
8 |
|
|
9 |
|
class L1ObjColl : public TObject { |
10 |
|
|
33 |
|
} |
34 |
|
|
35 |
|
L1ObjColl selectByType( TYPE t1) const; |
36 |
+ |
L1ObjColl selectByPt( double ptMin = 0., double ptMax = 161.) const; |
37 |
|
L1ObjColl selectByPtMin( double ptMin = 0.) const; |
38 |
|
L1ObjColl selectByEta( double etaMin = -1.61, double etaMax = 1.61) const; |
39 |
|
L1ObjColl selectByBx( int bxMin = 0, int bxMax = 0) const; |
41 |
|
L1ObjColl selectByMatched() const; |
42 |
|
L1ObjColl selectByDeltaR( double deltaRMax) const; |
43 |
|
L1ObjColl operator+(const L1ObjColl &o) const; |
44 |
+ |
operator bool() const {return !theL1Obj.empty(); } |
45 |
+ |
bool operator!() const {return theL1Obj.empty(); } |
46 |
+ |
|
47 |
+ |
inline bool isMatching_DRBx_At(double deltaR, int bx, double ptMin, double eta, double phi) const { |
48 |
+ |
for (unsigned int i=0; i< theL1Obj.size(); i++) if ( (bx == theL1Obj[i].bx) && ( reco::deltaR(theL1Obj[i].eta, theL1Obj[i].phi, eta, phi) < deltaR) && (theL1Obj[i].pt >= ptMin) ) return true; |
49 |
+ |
return false; |
50 |
+ |
} |
51 |
+ |
inline bool isMatching_DRBx(double deltaR, int bx, double ptMin = 0.) const { |
52 |
+ |
for (unsigned int i=0; i< theL1Obj.size(); i++) if ( (bx == theL1Obj[i].bx) && ( theDeltaR[i] < deltaR) && (theL1Obj[i].pt >= ptMin) ) return true; |
53 |
+ |
return false; |
54 |
+ |
} |
55 |
+ |
|
56 |
+ |
inline bool isMatching_PtminPtmaxBx(double ptMin, double ptMax, int bx, bool firstBXonly) const { |
57 |
+ |
bool firstBX = true; |
58 |
+ |
bool result = false; |
59 |
+ |
for (unsigned int i=0; i< theL1Obj.size(); i++) { |
60 |
+ |
if (theL1Obj[i].bx < bx && theL1Obj[i].pt >= ptMin) firstBX = false; |
61 |
+ |
if ( (theL1Obj[i].pt >= ptMin && theL1Obj[i].pt < ptMax) && (bx == theL1Obj[i].bx) ) result = true; |
62 |
+ |
} |
63 |
+ |
return firstBXonly ? (result && firstBX) : result; |
64 |
+ |
} |
65 |
+ |
|
66 |
+ |
/* |
67 |
+ |
inline bool isMatching_PtminPtmaxBx(double ptMin, double ptMax, int bx, bool firstBXonly) const { |
68 |
+ |
bool firstBX = true; |
69 |
+ |
bool result = false; |
70 |
+ |
for (unsigned int i=0; i< theL1Obj.size(); i++) { |
71 |
+ |
if (theL1Obj[i].bx < bx) firstBX = false; |
72 |
+ |
if ( (theL1Obj[i].pt >= ptMin && theL1Obj[i].pt < ptMax) && (bx == theL1Obj[i].bx) ) result = true; |
73 |
+ |
} |
74 |
+ |
return firstBXonly ? (result && firstBX) : result; |
75 |
+ |
} |
76 |
+ |
*/ |
77 |
|
|
78 |
|
friend ostream & operator<< (ostream &out, const L1ObjColl&s); |
79 |
|
|
87 |
|
double phiMin = 0., double phiMax = 7., |
88 |
|
int qMin = 0, int qMax = 7) const; |
89 |
|
static std::vector<L1Obj> typeSelector(const std::vector<L1Obj> & col, TYPE t1=L1Obj::NONE, TYPE t2=L1Obj::NONE, TYPE t3=L1Obj::NONE, TYPE t4=L1Obj::NONE); |
54 |
– |
|
90 |
|
|
91 |
|
private: |
92 |
|
std::vector<L1Obj> theL1Obj; |