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

Comparing UserCode/L1RpcTriggerAnalysis/src/L1ObjColl.cc (file contents):
Revision 1.1 by konec, Sun Jun 13 17:27:02 2010 UTC vs.
Revision 1.2 by konec, Mon Nov 28 18:39:48 2011 UTC

# Line 1 | Line 1
1   #include "UserCode/L1RpcTriggerAnalysis/interface/L1ObjColl.h"
2 + #include <iostream>
3  
4   ClassImp(L1Obj)
5   ClassImp(L1ObjColl)
6  
7 +
8   std::vector<L1Obj> L1ObjColl::getL1ObjsMatched(double ptMin) const
9   {
10    std::vector<L1Obj> result;
# Line 14 | Line 16 | std::vector<L1Obj> L1ObjColl::getL1ObjsM
16  
17    return result;
18   }
19 +
20 + std::vector<L1Obj> L1ObjColl::getL1ObjsSelected(
21 +    bool requireMatched,
22 +    bool requireNonMatched,
23 +    double ptMin, double ptMax,
24 +    int bxMin, int bxMax,
25 +    double etaMin, double etaMax,
26 +    double phiMin, double phiMax,
27 +    int qMin, int qMax) const
28 + {
29 +  std::vector<L1Obj> result;
30 +  unsigned int nMS = theL1Matching.size();
31 +  for (unsigned int i=0; i<theL1Obj.size(); ++i) {
32 +          bool isMatched = ( (i<nMS) && theL1Matching[i] );
33 +          if (requireMatched && !isMatched ) continue;
34 +          if (requireNonMatched && isMatched) continue;
35 +          if (theL1Obj[i].pt < ptMin) continue;
36 +          if (theL1Obj[i].pt > ptMax) continue;
37 +          if (theL1Obj[i].bx < bxMin) continue;
38 +          if (theL1Obj[i].bx > bxMax) continue;
39 +          if (theL1Obj[i].eta < etaMin) continue;
40 +          if (theL1Obj[i].eta > etaMax) continue;
41 +          if (theL1Obj[i].phi < phiMin) continue;
42 +          if (theL1Obj[i].phi > phiMax) continue;
43 +          if (theL1Obj[i].q < qMin) continue;
44 +          if (theL1Obj[i].q > qMax) continue;
45 +          result.push_back(theL1Obj[i]);
46 +  }
47 +  return result;
48 + }
49 +
50 + void L1ObjColl::print() const
51 + {
52 +  for (unsigned int i=0; i<theL1Obj.size(); ++i) {
53 +    std::cout <<"("<<i<<")";theL1Obj[i].print();
54 +    if (theL1Matching.size()>i) std::cout<<" matched: "<<theL1Matching[i];
55 +    std::cout <<std::endl;
56 +  }
57 + }

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines