L1CaloRegionDetId

Macros

Line Code
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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
#ifndef L1CALOREGIONDETID_H
#define L1CALOREGIONDETID_H

#include "DataFormats/DetId/interface/DetId.h"

/** \class L1CaloRegionDetId
 *  Cell identifier class for L1 Calo Trigger Regions (4x4 trigger tower sums)
 *
 *  \author Jim Brooke 
*/

/**
 * Stores eta value in bits 4-0, phi value in bits 9-5
 *
 *
 */

class L1CaloRegionDetId : public DetId {
public:
  static const unsigned N_PHI = 18;
  static const unsigned N_ETA = 22;

  /// create null id
  L1CaloRegionDetId();

  /// create id from raw data (0=invalid code?)
  L1CaloRegionDetId(uint32_t rawid);

  /// create id from global eta, phi indices (eta=0-21, phi=0-17)
  L1CaloRegionDetId(unsigned ieta, unsigned iphi);

  /// create id from RCT crate, RCT card, RCT region (within card)
  /// icard=999 is used to indicate HF regions
  L1CaloRegionDetId(unsigned icrate, unsigned icard, unsigned irgn);

  /// global eta index (0-21)
  unsigned ieta() const { return id_ & 0x1f; }

  /// global phi index (0-17)
  unsigned iphi() const { return (id_ >> 5) & 0x1f; }

  /// return central or forward type
  bool isHf() const { return (ieta() < 4 || ieta() > 17); }

  /// return RCT crate number (0-17)
  unsigned rctCrate() const;

  /// return RCT card number (0-6)
  unsigned rctCard() const;

  /// return RCT region index (0-1 for barrel, 0-7 for HF)
  unsigned rctRegion() const;

  /// return local RCT eta index (0-10)
  unsigned rctEta() const { return (ieta() < 11 ? 10 - ieta() : ieta() - 11); }

  /// return local RCT phi index (0-1)
  unsigned rctPhi() const { return (iphi() % 2); }
};

#endif