ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/L1RpcTriggerAnalysis/interface/Pattern.h
Revision: 1.7
Committed: Thu Jul 11 11:25:21 2013 UTC (11 years, 9 months ago) by akalinow
Content type: text/plain
Branch: MAIN
CVS Tags: Artur_11_07_2013_B, Artur_11_07_2013_A, Artur_11_07_2013, HEAD
Changes since 1.6: +6 -1 lines
Log Message:
*last commit before migration to Git.

File Contents

# Content
1 #ifndef UserCode_L1RpcTriggerAnalysis_PatternCreator_H
2 #define UserCode_L1RpcTriggerAnalysis_PatternCreator_H
3
4 #include "FWCore/ParameterSet/interface/ParameterSet.h"
5 #include <vector>
6 #include <utility>
7 #include <ostream>
8 #include <map>
9
10
11 class Pattern {
12 public:
13
14 typedef std::map<uint32_t, unsigned int > DataType;
15
16 Pattern() {}
17
18
19 static uint32_t rotateDetId(uint32_t rawId, int step);
20 Pattern getRotated(int step) const;
21
22
23 //is not empty
24 operator bool() const { return theData.size() > 0; }
25
26 bool add(std::pair<uint32_t, unsigned int > aData) { return !addOrCopy(aData); }
27
28 static void add( std::vector<Pattern> & vpat, std::pair<uint32_t, unsigned int > aData);
29
30 unsigned int size() const { return theData.size(); }
31 operator const DataType & () const { return theData; }
32
33 bool operator==(const Pattern& o) const;
34
35 private:
36
37 // try to add data from raw id to this pattern. if the data from detUnit
38 // is already assigned to this patterns return a copy of this pattern with
39 // modified (from aData) data attached to detUnit. Otherwise add data from detUnit
40 // to this pattern and return an empty pattern;
41 Pattern addOrCopy ( std::pair<uint32_t, unsigned int > aData);
42
43 private:
44 DataType theData;
45 friend std::ostream & operator << (std::ostream &out, const Pattern &o);
46 };
47 #endif
48
49