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.8 by konec, Sun Dec 16 22:56:14 2012 UTC vs.
Revision 1.10 by konec, Thu May 23 18:24:03 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  
# Line 18 | Line 19 | public:
19    void push_back(const L1Obj & obj, bool match, double deltaR);
20  
21    const std::vector<L1Obj> & getL1Objs() const { return theL1Obj; }
22 +  operator  const std::vector<L1Obj> & () const {  return theL1Obj; }
23 +
24    const std::vector<bool> & getL1ObjsMatching() const { return theL1Matching; }
25    const std::vector<double> & getL1ObjDeltaR() const { return theDeltaR; }
26  
# Line 43 | Line 46 | public:
46    operator bool() const {return !theL1Obj.empty(); }
47    bool operator!() const {return theL1Obj.empty(); }
48  
49 <  inline bool isMatching_DRBx(double deltaR, int bx) const {
50 <    for (unsigned int i=0; i< theL1Obj.size(); i++) if ( (bx ==  theL1Obj[i].bx) && ( theDeltaR[i] < deltaR) ) return true;
49 >  inline bool isMatching_DRBx_At(double deltaR, int bx, double ptMin, double eta, double phi) const {
50 >    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;
51      return false;
52    }
53 <  inline bool isMatching_PtminPtmaxBx(double ptMin, double ptMax, int bx ) const {
54 <    for (unsigned int i=0; i< theL1Obj.size(); i++) if ( (theL1Obj[i].pt >= ptMin && theL1Obj[i].pt < ptMax) && (bx ==  theL1Obj[i].bx) ) return true;
53 >  inline bool isMatching_DRBx(double deltaR, int bx, double ptMin = 0.) const {
54 >    for (unsigned int i=0; i< theL1Obj.size(); i++) if ( (bx ==  theL1Obj[i].bx) && ( theDeltaR[i] < deltaR) && (theL1Obj[i].pt >= ptMin) ) return true;
55      return false;
56    }
57  
58 +  inline bool isMatching_PtminPtmaxBx(double ptMin, double ptMax, int bx, bool firstBXonly) const {
59 +    bool firstBX = true;
60 +    bool result = false;
61 +    for (unsigned int i=0; i< theL1Obj.size(); i++) {
62 +      if (theL1Obj[i].bx < bx && theL1Obj[i].pt >= ptMin) firstBX = false;
63 +      if ( (theL1Obj[i].pt >= ptMin && theL1Obj[i].pt < ptMax) && (bx == theL1Obj[i].bx) ) result = true;
64 +    }
65 +    return firstBXonly ? (result && firstBX) : result;
66 +  }
67 +
68 + /*
69 +  inline bool isMatching_PtminPtmaxBx(double ptMin, double ptMax, int bx, bool firstBXonly) const {
70 +    bool firstBX = true;
71 +    bool result = false;
72 +    for (unsigned int i=0; i< theL1Obj.size(); i++) {
73 +      if (theL1Obj[i].bx < bx) firstBX = false;
74 +      if ( (theL1Obj[i].pt >= ptMin && theL1Obj[i].pt < ptMax) && (bx == theL1Obj[i].bx) ) result = true;
75 +    }
76 +    return firstBXonly ? (result && firstBX) : result;
77 +  }
78 + */
79 +
80    friend ostream & operator<< (ostream &out, const L1ObjColl&s);
81  
82   //tmp
# Line 62 | Line 87 | public:
87                    int bxMin = 0, int bxMax = 0,                  
88                    double etaMin = -2.5, double etaMax = 2.5,
89                    double phiMin = 0., double phiMax = 7.,
90 <                  int qMin = 0, int qMax = 7) const;
90 >                  int qMin = 0, int qMax = 99) const;
91    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);
92    
93   private:

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines