1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
#ifndef DATAFORMATS_CALOTOWERS_CALOTOWERDETID_H
#define DATAFORMATS_CALOTOWERS_CALOTOWERDETID_H 1
#include "DataFormats/DetId/interface/DetId.h"
/** \class CaloTowerDetId
*
* CaloTowerDetId uses DetId::Det of Calo and subdetId() of 1.
*
* \author J. Mans - Minnesota
*/
class CaloTowerDetId : public DetId {
public:
/** Create a null cellid*/
CaloTowerDetId();
/** Create cellid from raw id (0=invalid tower id) */
explicit CaloTowerDetId(uint32_t rawid);
/** Constructor from signed tower ieta and iphi */
CaloTowerDetId(int tower_ieta, int tower_iphi);
/** Constructor from a generic cell id */
CaloTowerDetId(const DetId& id);
/** Assignment from a generic cell id */
CaloTowerDetId& operator=(const DetId& id);
/// get the z-side of the tower (1/-1)
int zside() const { return (id_ & 0x2000) ? (1) : (-1); }
/// get the absolute value of the tower ieta
int ietaAbs() const { return (id_ >> 7) & 0x3f; }
/// get the tower ieta
int ieta() const { return zside() * ietaAbs(); }
/// get the tower iphi
int iphi() const;
static const int SubdetId = 1;
};
std::ostream& operator<<(std::ostream&, const CaloTowerDetId& id);
#endif
|