ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/L1RpcTriggerAnalysis/interface/L1ObjColl.h
Revision: 1.8
Committed: Sun Dec 16 22:56:14 2012 UTC (12 years, 4 months ago) by konec
Content type: text/plain
Branch: MAIN
Changes since 1.7: +12 -0 lines
Log Message:
*** empty log message ***

File Contents

# User Rev Content
1 konec 1.1 #ifndef L1ObjColl_H
2     #define L1ObjColl_H
3    
4     #include "UserCode/L1RpcTriggerAnalysis/interface/L1Obj.h"
5     #include <vector>
6 konec 1.8 #include <cmath>
7 konec 1.1
8     class L1ObjColl : public TObject {
9    
10     public:
11     L1ObjColl() {}
12     virtual ~L1ObjColl(){}
13    
14 konec 1.3 typedef L1Obj::TYPE TYPE;
15 konec 1.1 void set(const std::vector<L1Obj> & obj) { theL1Obj = obj; }
16     void set(const std::vector<bool> & comp) { theL1Matching = comp; }
17 konec 1.4 void set(const std::vector<double> & dr) { theDeltaR = dr; }
18 konec 1.6 void push_back(const L1Obj & obj, bool match, double deltaR);
19 konec 1.5
20 konec 1.1 const std::vector<L1Obj> & getL1Objs() const { return theL1Obj; }
21     const std::vector<bool> & getL1ObjsMatching() const { return theL1Matching; }
22 konec 1.5 const std::vector<double> & getL1ObjDeltaR() const { return theDeltaR; }
23 konec 1.6
24     L1ObjColl l1RpcColl() const {
25     return selectByType(L1Obj::RPCb)+selectByType(L1Obj::RPCf);
26     }
27     L1ObjColl l1RpcCollEmu() const {
28     return selectByType(L1Obj::RPCb_emu)+selectByType(L1Obj::RPCf_emu);
29     }
30     L1ObjColl l1OthColl() const {
31     return selectByType(L1Obj::DT)+selectByType(L1Obj::CSC);
32     }
33    
34     L1ObjColl selectByType( TYPE t1) const;
35 konec 1.7 L1ObjColl selectByPt( double ptMin = 0., double ptMax = 161.) const;
36 konec 1.6 L1ObjColl selectByPtMin( double ptMin = 0.) const;
37     L1ObjColl selectByEta( double etaMin = -1.61, double etaMax = 1.61) const;
38     L1ObjColl selectByBx( int bxMin = 0, int bxMax = 0) const;
39     L1ObjColl selectByQuality( int qMin = 0, int qMax = 7) const;
40     L1ObjColl selectByMatched() const;
41     L1ObjColl selectByDeltaR( double deltaRMax) const;
42     L1ObjColl operator+(const L1ObjColl &o) const;
43 konec 1.8 operator bool() const {return !theL1Obj.empty(); }
44     bool operator!() const {return theL1Obj.empty(); }
45    
46     inline bool isMatching_DRBx(double deltaR, int bx) const {
47     for (unsigned int i=0; i< theL1Obj.size(); i++) if ( (bx == theL1Obj[i].bx) && ( theDeltaR[i] < deltaR) ) return true;
48     return false;
49     }
50     inline bool isMatching_PtminPtmaxBx(double ptMin, double ptMax, int bx ) const {
51     for (unsigned int i=0; i< theL1Obj.size(); i++) if ( (theL1Obj[i].pt >= ptMin && theL1Obj[i].pt < ptMax) && (bx == theL1Obj[i].bx) ) return true;
52     return false;
53     }
54 konec 1.5
55 konec 1.6 friend ostream & operator<< (ostream &out, const L1ObjColl&s);
56 konec 1.1
57 konec 1.5 //tmp
58 konec 1.1 std::vector<L1Obj> getL1ObjsMatched(double ptMin = 0) const;
59 konec 1.2 std::vector<L1Obj> getL1ObjsSelected(
60     bool requireMatched = true, bool requireNonMatched = false,
61     double ptMin = 0., double ptMax = 161.,
62     int bxMin = 0, int bxMax = 0,
63     double etaMin = -2.5, double etaMax = 2.5,
64     double phiMin = 0., double phiMax = 7.,
65     int qMin = 0, int qMax = 7) const;
66 konec 1.3 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);
67 konec 1.1
68     private:
69     std::vector<L1Obj> theL1Obj;
70     std::vector<bool> theL1Matching;
71 konec 1.4 std::vector<double> theDeltaR;
72 konec 1.1
73     public:
74     ClassDef(L1ObjColl,1)
75    
76     };
77    
78     #endif