Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:53:45

0001 #ifndef L1CALOREGIONDETID_H
0002 #define L1CALOREGIONDETID_H
0003 
0004 #include "DataFormats/DetId/interface/DetId.h"
0005 
0006 /** \class L1CaloRegionDetId
0007  *  Cell identifier class for L1 Calo Trigger Regions (4x4 trigger tower sums)
0008  *
0009  *  \author Jim Brooke 
0010 */
0011 
0012 /**
0013  * Stores eta value in bits 4-0, phi value in bits 9-5
0014  *
0015  *
0016  */
0017 
0018 class L1CaloRegionDetId : public DetId {
0019 public:
0020   static const unsigned N_PHI = 18;
0021   static const unsigned N_ETA = 22;
0022 
0023   /// create null id
0024   L1CaloRegionDetId();
0025 
0026   /// create id from raw data (0=invalid code?)
0027   L1CaloRegionDetId(uint32_t rawid);
0028 
0029   /// create id from global eta, phi indices (eta=0-21, phi=0-17)
0030   L1CaloRegionDetId(unsigned ieta, unsigned iphi);
0031 
0032   /// create id from RCT crate, RCT card, RCT region (within card)
0033   /// icard=999 is used to indicate HF regions
0034   L1CaloRegionDetId(unsigned icrate, unsigned icard, unsigned irgn);
0035 
0036   /// global eta index (0-21)
0037   unsigned ieta() const { return id_ & 0x1f; }
0038 
0039   /// global phi index (0-17)
0040   unsigned iphi() const { return (id_ >> 5) & 0x1f; }
0041 
0042   /// return central or forward type
0043   bool isHf() const { return (ieta() < 4 || ieta() > 17); }
0044 
0045   /// return RCT crate number (0-17)
0046   unsigned rctCrate() const;
0047 
0048   /// return RCT card number (0-6)
0049   unsigned rctCard() const;
0050 
0051   /// return RCT region index (0-1 for barrel, 0-7 for HF)
0052   unsigned rctRegion() const;
0053 
0054   /// return local RCT eta index (0-10)
0055   unsigned rctEta() const { return (ieta() < 11 ? 10 - ieta() : ieta() - 11); }
0056 
0057   /// return local RCT phi index (0-1)
0058   unsigned rctPhi() const { return (iphi() % 2); }
0059 };
0060 
0061 #endif