CMS 3D CMS Logo

Public Member Functions | Private Attributes

CALIBLogicalMapEntry Class Reference

#include <HcalMappingEntry.h>

List of all members.

Public Member Functions

 CALIBLogicalMapEntry ()
 CALIBLogicalMapEntry (int in_fi_ch, int in_htr_fi, int in_spig, int in_fed, int in_cr, int in_htr, std::string in_s_fpga, std::string in_s_det, int in_et, int in_ph, int in_ch_ty, int in_sid, int in_dph, std::string in_s_rbx, int in_wed, int in_rm_fi, std::string in_s_subdet)
const DetId getDetId () const
const HcalElectronicsId getHcalElectronicsId () const
const HcalFrontEndId getHcalFrontEndId () const
const uint32_t getLinearIndex () const
char * printLMapLine ()
 ~CALIBLogicalMapEntry ()

Private Attributes

uint32_t hcalCalibDetID_
uint32_t hcalEID_
uint32_t hcalFrontEndID_
std::string mycalibsubdet_
int mydphi_
int myside_
int mywedge_

Detailed Description

Definition at line 91 of file HcalMappingEntry.h.


Constructor & Destructor Documentation

CALIBLogicalMapEntry::CALIBLogicalMapEntry ( ) [inline]

Definition at line 100 of file HcalMappingEntry.h.

{}
CALIBLogicalMapEntry::CALIBLogicalMapEntry ( int  in_fi_ch,
int  in_htr_fi,
int  in_spig,
int  in_fed,
int  in_cr,
int  in_htr,
std::string  in_s_fpga,
std::string  in_s_det,
int  in_et,
int  in_ph,
int  in_ch_ty,
int  in_sid,
int  in_dph,
std::string  in_s_rbx,
int  in_wed,
int  in_rm_fi,
std::string  in_s_subdet 
)

Definition at line 201 of file HcalMappingEntry.cc.

References HcalBarrel, HcalEmpty, HcalEndcap, HcalForward, HcalOuter, HcalFrontEndId::rawId(), HcalElectronicsId::rawId(), DetId::rawId(), and HcalElectronicsId::setHTR().

{
  int mytopbot;
  (in_s_fpga=="bot") ? mytopbot = 0 : mytopbot = 1;

  myside_   = in_sid;
  mydphi_   = in_dph;
  mywedge_  = in_wed;
  // string data members
  mycalibsubdet_ = in_s_subdet;

  //create the hcal electronics id
  HcalElectronicsId heid( in_fi_ch, in_htr_fi, in_spig, in_fed - 700 );
  heid.setHTR( in_cr, in_htr, mytopbot );

  //create the hcal det id for a calibration unit channel
  HcalSubdetector mysubdet = HcalEmpty;
  if (in_s_det=="HB") mysubdet = HcalBarrel;
  else if (in_s_det=="HE") mysubdet = HcalEndcap;
  else if (in_s_det=="HO") mysubdet = HcalOuter;
  else if (in_s_det=="HF") mysubdet = HcalForward;

  HcalCalibDetId hcalibdid( mysubdet, in_et, in_ph, in_ch_ty );

  int in_rm, in_pix, in_qie, in_adc;
  //CM RM in HF is 4 rather than 5
  if (in_s_det=="HF")
    in_rm  = 4;
  else
    in_rm  = 5;

  in_pix = 0;
  in_qie = 1;
  in_adc = in_fi_ch + ( 3 * ( in_rm_fi - 1 ) );

  HcalFrontEndId hrbx( in_s_rbx, in_rm, in_pix, in_rm_fi, in_fi_ch, in_qie, in_adc );

  //store the different ids
  hcalEID_        = heid.rawId();
  hcalCalibDetID_ = hcalibdid.rawId();
  hcalFrontEndID_ = hrbx.rawId();
}
CALIBLogicalMapEntry::~CALIBLogicalMapEntry ( ) [inline]

Definition at line 108 of file HcalMappingEntry.h.

{}

Member Function Documentation

const DetId CALIBLogicalMapEntry::getDetId ( ) const [inline]

Definition at line 113 of file HcalMappingEntry.h.

References hcalCalibDetID_.

Referenced by HcalLogicalMapGenerator::buildCALIBMap().

const HcalElectronicsId CALIBLogicalMapEntry::getHcalElectronicsId ( ) const [inline]

Definition at line 112 of file HcalMappingEntry.h.

References hcalEID_.

const HcalFrontEndId CALIBLogicalMapEntry::getHcalFrontEndId ( ) const [inline]

Definition at line 114 of file HcalMappingEntry.h.

References hcalFrontEndID_.

const uint32_t CALIBLogicalMapEntry::getLinearIndex ( ) const [inline]
char * CALIBLogicalMapEntry::printLMapLine ( )

Definition at line 249 of file HcalMappingEntry.cc.

References HcalCalibDetId::cboxChannel(), HcalElectronicsId::dccid(), HcalElectronicsId::fiberChanId(), HcalElectronicsId::fiberIndex(), HcalBarrel, HcalEndcap, HcalForward, HcalOuter, HcalCalibDetId::hcalSubdet(), HcalElectronicsId::htrSlot(), HcalElectronicsId::htrTopBottom(), HcalCalibDetId::ieta(), HcalCalibDetId::iphi(), HcalFrontEndId::rbx(), HcalElectronicsId::readoutVMECrateId(), HcalFrontEndId::rm(), HcalFrontEndId::rmFiber(), and HcalElectronicsId::spigot().

                                          {

  static char myline[512];

  HcalElectronicsId hcaleid(hcalEID_);
  HcalCalibDetId    hcalcalibid(hcalCalibDetID_);
  HcalGenericDetId  hcalgenid(hcalCalibDetID_);
  HcalFrontEndId    rbxid(hcalFrontEndID_);

  int mydcc_sl = 0;
  int mydcc    = 0;
  if ((hcaleid.dccid()%2)==1) {
    mydcc_sl = 20;
    mydcc    = 2;
  } 
  else {
    mydcc_sl = 10;
    mydcc    = 1;
  } 

  string myfpga = "";
  string mydet  = "";
  HcalSubdetector mysubdet = hcalcalibid.hcalSubdet();
  (mysubdet==HcalBarrel) ? mydet = "HB" : 
              ((mysubdet==HcalEndcap)  ? mydet = "HE" :
              ((mysubdet==HcalOuter)   ? mydet = "HO" : 
              ((mysubdet==HcalForward) ? mydet = "HF" : 
              mydet = "invalid")));
  (hcaleid.htrTopBottom()==0) ? myfpga = "bot" : myfpga = "top";

  sprintf(myline,"%1d %6d %6d %6d %6d %6s %7s",0,myside_,hcalcalibid.ieta(),hcalcalibid.iphi(),mydphi_,mydet.c_str(),rbxid.rbx().c_str());
  sprintf(myline+strlen(myline),"%8d %6d %6d %6d %6d %4d %5s",mywedge_,rbxid.rm(),rbxid.rmFiber(),hcaleid.fiberChanId(),hcaleid.readoutVMECrateId(),hcaleid.htrSlot(),myfpga.c_str());
  sprintf(myline+strlen(myline),"%8d %7d %6d %4d %6d %8d %9s\n",hcaleid.fiberIndex(),mydcc_sl,hcaleid.spigot(),mydcc,hcaleid.dccid()+700, hcalcalibid.cboxChannel(), mycalibsubdet_.c_str());

  return myline;
}

Member Data Documentation

Definition at line 119 of file HcalMappingEntry.h.

Referenced by getDetId().

uint32_t CALIBLogicalMapEntry::hcalEID_ [private]

Definition at line 118 of file HcalMappingEntry.h.

Referenced by getHcalElectronicsId(), and getLinearIndex().

Definition at line 120 of file HcalMappingEntry.h.

Referenced by getHcalFrontEndId().

std::string CALIBLogicalMapEntry::mycalibsubdet_ [private]

Definition at line 124 of file HcalMappingEntry.h.

Definition at line 123 of file HcalMappingEntry.h.

Definition at line 123 of file HcalMappingEntry.h.

Definition at line 123 of file HcalMappingEntry.h.