3 |
|
|
4 |
|
#include "DataFormats/MuonDetId/interface/RPCDetId.h" |
5 |
|
#include <iostream> |
6 |
+ |
#include <ostream> |
7 |
|
#include <cmath> |
8 |
+ |
namespace edm { class EventSetup; } |
9 |
|
|
10 |
|
class RPCDetIdUtil{ |
11 |
|
public: |
12 |
|
RPCDetIdUtil( const RPCDetId & rpcDet) : theRpcDet(rpcDet) { } |
13 |
+ |
RPCDetIdUtil( uint32_t rawId) : theRpcDet( RPCDetId(rawId) ) { } |
14 |
|
|
15 |
|
bool isBarrel() const { return (theRpcDet.region()==0); } |
16 |
|
|
26 |
|
return isBarrel() ? barrelLayer() : endcapLayer(); |
27 |
|
} |
28 |
|
|
29 |
+ |
//WARNING - use eta of DetUnit position, not muon direction |
30 |
|
unsigned int layer(float eta) const { |
31 |
|
if (fabs(eta) < 0.83) { |
32 |
|
return barrelLayer(); |
57 |
|
|
58 |
|
RPCDetId rpdDetIt() { return theRpcDet; } |
59 |
|
|
60 |
< |
void print() { |
57 |
< |
std::cout <<"DetId: "<<theRpcDet.rawId() |
58 |
< |
<<" region: "<<theRpcDet.region() |
59 |
< |
<<" layer: "<<layer() |
60 |
< |
<<" ring/wheel: "<<theRpcDet.ring() << std::endl; } |
60 |
> |
void print(const edm::EventSetup& es); |
61 |
|
|
62 |
|
private: |
63 |
|
RPCDetId theRpcDet; |
64 |
+ |
friend std::ostream & operator<< (std::ostream &out, const RPCDetIdUtil &o); |
65 |
|
}; |
66 |
|
#endif |