ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/L1RpcTriggerAnalysis/interface/RPCDigiSpec.h
Revision: 1.1
Committed: Fri May 17 13:04:52 2013 UTC (11 years, 11 months ago) by konec
Content type: text/plain
Branch: MAIN
CVS Tags: Artur_11_07_2013_B, Artur_11_07_2013_A, Artur_11_07_2013, Artur_28_06_2013, HEAD
Log Message:
extenstion for OTF

File Contents

# Content
1 #ifndef UserCode_1RpcTriggerAnalysis_RPCDigiSpec_H
2 #define UserCode_1RpcTriggerAnalysis_RPCDigiSpec_H
3
4 #include <ostream>
5
6 class RPCDigiSpec {
7 typedef unsigned int DigiType;
8 public:
9
10 RPCDigiSpec(uint32_t aRawId, unsigned int aFromStrip, unsigned int aToStrip)
11 : theRawId(aRawId), theCodedDigi( ((aFromStrip&0xFF) << 8) | (aToStrip&0xFF) )
12 { }
13
14 RPCDigiSpec(uint32_t aRawId, DigiType aCodedDigi)
15 : theRawId(aRawId), theCodedDigi(aCodedDigi)
16 { }
17
18 unsigned int fromStrip() const { return ((theCodedDigi >>8) & 0xFF); }
19 unsigned int toStrip() const { return (theCodedDigi&0xFF); }
20 unsigned int halfStrip() const { return fromStrip()+toStrip(); }
21
22 void setToStrip( unsigned int aToStrip) {
23 theCodedDigi = ( (theCodedDigi&(0xFF<<8)) | (aToStrip&0xFF) );
24 }
25 void setFromStrip( unsigned int aFromStrip) {
26 theCodedDigi = ((theCodedDigi&0xFF) | (((aFromStrip&0xFF) << 8)) );
27 }
28
29 uint32_t rawId() const { return theRawId; }
30 DigiType codedDigi() const { return theCodedDigi; }
31
32 private:
33 uint32_t theRawId;
34 DigiType theCodedDigi;
35
36 friend std::ostream & operator << (std::ostream &out, const RPCDigiSpec &o) {
37 out <<"RPC: "<<o.rawId()<< " halfStrip: "<<o.halfStrip()<<" ("<<o.fromStrip()<<":"<<o.toStrip()<<")";
38 return out;
39 }
40 };
41 #endif