1 |
konec |
1.1 |
#ifndef L1RpcTriggerAnalysis_RPCDetIdUtil_H
|
2 |
|
|
#define L1RpcTriggerAnalysis_RPCDetIdUtil_H
|
3 |
|
|
|
4 |
|
|
#include "DataFormats/MuonDetId/interface/RPCDetId.h"
|
5 |
|
|
#include <iostream>
|
6 |
|
|
|
7 |
|
|
class RPCDetIdUtil{
|
8 |
|
|
public:
|
9 |
|
|
RPCDetIdUtil( const RPCDetId & rpcDet) : theRpcDet(rpcDet) { }
|
10 |
|
|
|
11 |
|
|
bool isBarrel() const { return (theRpcDet.region()==0); }
|
12 |
|
|
|
13 |
|
|
unsigned int layer() const {
|
14 |
|
|
return isBarrel() ?
|
15 |
|
|
( theRpcDet.station() <=2 ? 2*( theRpcDet.station()-1)+ theRpcDet.layer() : theRpcDet.station()+2 )
|
16 |
|
|
: theRpcDet.station();
|
17 |
|
|
}
|
18 |
|
|
|
19 |
|
|
int part() {
|
20 |
|
|
return isBarrel() ? theRpcDet.ring() :
|
21 |
|
|
(theRpcDet.region()==1 ? theRpcDet.ring()+1 : -theRpcDet.ring()-1);
|
22 |
|
|
}
|
23 |
|
|
|
24 |
|
|
RPCDetId rpdDetIt() { return theRpcDet; }
|
25 |
|
|
|
26 |
|
|
void print() {
|
27 |
|
|
std::cout <<"DetId: "<<theRpcDet.rawId()
|
28 |
|
|
<<" region: "<<theRpcDet.region()
|
29 |
|
|
<<" layer: "<<layer()
|
30 |
|
|
<<" ring/wheel: "<<theRpcDet.ring() << std::endl; }
|
31 |
|
|
|
32 |
|
|
private:
|
33 |
|
|
RPCDetId theRpcDet;
|
34 |
|
|
};
|
35 |
|
|
#endif
|