CMS 3D CMS Logo

Public Member Functions | Static Public Attributes

L1CaloRegionDetId Class Reference

#include <L1CaloRegionDetId.h>

Inheritance diagram for L1CaloRegionDetId:
DetId

List of all members.

Public Member Functions

unsigned ieta () const
 global eta index (0-21)
unsigned iphi () const
 global phi index (0-17)
bool isHf () const
 return central or forward type
 L1CaloRegionDetId ()
 create null id
 L1CaloRegionDetId (unsigned icrate, unsigned icard, unsigned irgn)
 L1CaloRegionDetId (uint32_t rawid)
 create id from raw data (0=invalid code?)
 L1CaloRegionDetId (unsigned ieta, unsigned iphi)
 create id from global eta, phi indices (eta=0-21, phi=0-17)
unsigned rctCard () const
 return RCT card number (0-6)
unsigned rctCrate () const
 return RCT crate number (0-17)
unsigned rctEta () const
 return local RCT eta index (0-10)
unsigned rctPhi () const
 return local RCT phi index (0-1)
unsigned rctRegion () const
 return RCT region index (0-1 for barrel, 0-7 for HF)

Static Public Attributes

static const unsigned N_ETA = 22
static const unsigned N_PHI = 18

Detailed Description

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

Cell identifier class for L1 Calo Trigger Regions (4x4 trigger tower sums)

Date:
2007/07/09 09:47:22
Revision:
1.14
Author:
Jim Brooke

Definition at line 20 of file L1CaloRegionDetId.h.


Constructor & Destructor Documentation

L1CaloRegionDetId::L1CaloRegionDetId ( )

create null id

Definition at line 10 of file L1CaloRegionDetId.cc.

: DetId() { }
L1CaloRegionDetId::L1CaloRegionDetId ( uint32_t  rawid)

create id from raw data (0=invalid code?)

Definition at line 14 of file L1CaloRegionDetId.cc.

: DetId(rawid) { }
L1CaloRegionDetId::L1CaloRegionDetId ( unsigned  ieta,
unsigned  iphi 
)

create id from global eta, phi indices (eta=0-21, phi=0-17)

Definition at line 19 of file L1CaloRegionDetId.cc.

References DetId::id_.

                                                                 :
  DetId(Calo, 2) 
{ 
  id_ |= (ieta & 0x1f) | ((iphi & 0x1f)<<5);
}
L1CaloRegionDetId::L1CaloRegionDetId ( unsigned  icrate,
unsigned  icard,
unsigned  irgn 
)

create id from RCT crate, RCT card, RCT region (within card) icard=999 is used to indicate HF regions

TODO - check calculation of ieta and iphi from RCT crate/card/region #

Definition at line 27 of file L1CaloRegionDetId.cc.

References DetId::id_, ieta(), and iphi().

                                                                                   :
  DetId(Calo, 2)
{

  int ieta=0;
  int iphi=0;

  // Calculate iphi
  int phi_index = icrate % 9;
  if ((icard == 0) || (icard == 2) || (icard == 4))
    phi_index = phi_index * 2;
  else if ((icard == 1) || (icard == 3) || (icard == 5))
    phi_index = phi_index * 2 + 1;
  else if (icard == 6)
    phi_index = phi_index * 2 + irgn;
  // for HF
  else if (icard == 999)
    phi_index = phi_index * 2 + (irgn/4);
  iphi = (22 - phi_index) % 18;

  // Calculate ieta
  int eta_index = 0;
  if (icard < 6)
    eta_index = (icard/2) * 2 + irgn;
  else if (icard == 6)
    eta_index = 6;
  // HF
  else if (icard == 999)
    eta_index = (irgn % 4) + 7;
  
  if (icrate < 9)
    ieta = 10 - eta_index;
  else if (icrate >= 9)
    ieta = 11 + eta_index;

  id_ |= (ieta & 0x1f) | ((iphi & 0x1f)<<5);
}

Member Function Documentation

unsigned L1CaloRegionDetId::ieta ( ) const [inline]
unsigned L1CaloRegionDetId::iphi ( ) const [inline]
bool L1CaloRegionDetId::isHf ( ) const [inline]

return central or forward type

Definition at line 47 of file L1CaloRegionDetId.h.

References ieta().

Referenced by L1CaloRegion::isHbHe(), and L1CaloRegion::isHf().

{ return (ieta()<4 || ieta()>17); }
unsigned L1CaloRegionDetId::rctCard ( ) const

return RCT card number (0-6)

Definition at line 73 of file L1CaloRegionDetId.cc.

References ieta(), getHLTprescales::index, and iphi().

Referenced by L1CaloMipQuietRegion::rctCard(), and L1CaloRegion::rctCard().

                                          {
  unsigned card = 999;
  unsigned rct_phi_index = (22 - iphi()) % 18;
  if ((ieta() == 4) || (ieta() == 17)){
    card = 6;
  }
  else if ((ieta() > 4) && (ieta() <= 10)){
    unsigned index = (ieta() - 5)/2;
    card = ((2 - index) * 2) + (rct_phi_index % 2);
  }
  else if ((ieta() >= 11) && (ieta() < 17)){
    unsigned index = (ieta() - 11)/2;
    card = (index * 2) + (rct_phi_index % 2);
  }
  return card;
}
unsigned L1CaloRegionDetId::rctCrate ( ) const

return RCT crate number (0-17)

Definition at line 67 of file L1CaloRegionDetId.cc.

References ieta(), iphi(), N_ETA, and N_PHI.

Referenced by L1CaloMipQuietRegion::rctCrate(), and L1CaloRegion::rctCrate().

                                           { // TODO - check this is correct!
  unsigned phiCrate = ((N_PHI + 4 - iphi()) % N_PHI) / 2;
  return (ieta()<(N_ETA/2) ? phiCrate : phiCrate + N_PHI/2) ;
}
unsigned L1CaloRegionDetId::rctEta ( ) const [inline]

return local RCT eta index (0-10)

Definition at line 59 of file L1CaloRegionDetId.h.

References ieta().

Referenced by L1GctJet::hwEta(), L1GctEmCand::L1GctEmCand(), L1CaloMipQuietRegion::rctEta(), L1CaloRegion::rctEta(), and L1GctJet::rctEta().

{ return (ieta()<11 ? 10-ieta() : ieta()-11); }
unsigned L1CaloRegionDetId::rctPhi ( ) const [inline]

return local RCT phi index (0-1)

Definition at line 62 of file L1CaloRegionDetId.h.

References iphi().

Referenced by L1GctJet::rctPhi(), L1CaloMipQuietRegion::rctPhi(), and L1CaloRegion::rctPhi().

{ return (iphi()%2); }
unsigned L1CaloRegionDetId::rctRegion ( ) const

return RCT region index (0-1 for barrel, 0-7 for HF)

Definition at line 91 of file L1CaloRegionDetId.cc.

References ieta(), and iphi().

Referenced by L1CaloRegion::rctRegionIndex(), and L1CaloMipQuietRegion::rctRegionIndex().

                                            {
  unsigned rgn = 999;
  unsigned rct_phi_index = (22 - iphi()) % 18;
  if (ieta() < 4){
    rgn = (3 - ieta()) + 4 * (rct_phi_index % 2);
  }
  else if (ieta() > 17){
    rgn = (ieta() - 18) + 4 * (rct_phi_index % 2);
  }
  else if ((ieta() == 4) || (ieta() == 17)){
    rgn = (rct_phi_index % 2);
  }
  else if ((ieta() > 4) && (ieta() <= 10)){
    rgn = (ieta() % 2);
  }
  else if ((ieta() >= 11) && (ieta() < 17)){
    rgn = ((ieta() - 1) % 2);
  }
  return rgn;
}

Member Data Documentation

unsigned const L1CaloRegionDetId::N_ETA = 22 [static]

Definition at line 25 of file L1CaloRegionDetId.h.

Referenced by L1GctHardwareJetFinder::makeProtoJet(), and rctCrate().

unsigned const L1CaloRegionDetId::N_PHI = 18 [static]