ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/L1RpcTriggerAnalysis/interface/L1ObjColl.h
(Generate patch)

Comparing UserCode/L1RpcTriggerAnalysis/interface/L1ObjColl.h (file contents):
Revision 1.7 by konec, Tue Nov 27 16:16:47 2012 UTC vs.
Revision 1.9 by konec, Tue Apr 23 09:27:52 2013 UTC

# Line 2 | Line 2
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  
# Line 39 | Line 41 | public:
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  

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines