CMS 3D CMS Logo

Public Member Functions | Private Attributes

ZDCLogicalMapEntry Class Reference

#include <HcalMappingEntry.h>

List of all members.

Public Member Functions

const DetId getDetId () const
const HcalElectronicsId getHcalElectronicsId () const
const uint32_t getLinearIndex () const
char * printLMapLine ()
 ZDCLogicalMapEntry (int in_fi_ch, int in_htr_fi, int in_spigot, int in_fed, int in_cr, int in_htr, std::string in_s_fpga, std::string in_s_det, int in_sid, int in_dep, int in_x, int in_y, int in_dx, int in_det_ch, int in_cab, int in_rm, int in_qie, int in_adc, int in_rm_fi)
 ZDCLogicalMapEntry ()
 ~ZDCLogicalMapEntry ()

Private Attributes

uint32_t hcalEID_
uint32_t hcalZDCDetID_
int myadc_
int mycable_
int mydet_ch_
int mydx_
int myqie_
int myrm_
int myrm_fi_
int myx_
int myy_

Detailed Description

Definition at line 129 of file HcalMappingEntry.h.


Constructor & Destructor Documentation

ZDCLogicalMapEntry::ZDCLogicalMapEntry ( ) [inline]

Definition at line 137 of file HcalMappingEntry.h.

{}
ZDCLogicalMapEntry::ZDCLogicalMapEntry ( int  in_fi_ch,
int  in_htr_fi,
int  in_spigot,
int  in_fed,
int  in_cr,
int  in_htr,
std::string  in_s_fpga,
std::string  in_s_det,
int  in_sid,
int  in_dep,
int  in_x,
int  in_y,
int  in_dx,
int  in_det_ch,
int  in_cab,
int  in_rm,
int  in_qie,
int  in_adc,
int  in_rm_fi 
)

Definition at line 289 of file HcalMappingEntry.cc.

References HcalZDCDetId::EM, HcalZDCDetId::HAD, HcalZDCDetId::LUM, HcalElectronicsId::rawId(), DetId::rawId(), HcalElectronicsId::setHTR(), and Unknown.

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

  myx_      = in_x;
  myy_      = in_y;
  mydx_     = in_dx;
  mycable_  = in_cab;
  myrm_     = in_rm;
  myqie_    = in_qie;
  myadc_    = in_adc;
  myrm_fi_  = in_rm_fi;

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

  //create the hcal det id
  bool myzdccheck;
  HcalZDCDetId::Section myzdcsec;
  if (in_s_det=="ZDC_EM") myzdcsec = HcalZDCDetId::EM;
  else if (in_s_det=="ZDC_HAD") myzdcsec = HcalZDCDetId::HAD;
  else if (in_s_det=="ZDC_LUM") myzdcsec = HcalZDCDetId::LUM;
  else myzdcsec = HcalZDCDetId::Unknown;
 
  (in_sid > 0) ? myzdccheck = true : myzdccheck = false;
  HcalZDCDetId hzdcdid( myzdcsec, myzdccheck, in_det_ch );

  // store the different ids
  hcalEID_      = heid.rawId();
  hcalZDCDetID_ = hzdcdid.rawId();

}
ZDCLogicalMapEntry::~ZDCLogicalMapEntry ( ) [inline]

Definition at line 145 of file HcalMappingEntry.h.

{ }

Member Function Documentation

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

Definition at line 150 of file HcalMappingEntry.h.

References hcalZDCDetID_.

{return DetId(hcalZDCDetID_);}
const HcalElectronicsId ZDCLogicalMapEntry::getHcalElectronicsId ( ) const [inline]

Definition at line 149 of file HcalMappingEntry.h.

References hcalEID_.

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

Definition at line 329 of file HcalMappingEntry.cc.

References HcalZDCDetId::channel(), HcalElectronicsId::dccid(), HcalZDCDetId::depth(), HcalElectronicsId::fiberChanId(), HcalElectronicsId::fiberIndex(), HcalElectronicsId::htrSlot(), HcalElectronicsId::htrTopBottom(), HcalElectronicsId::readoutVMECrateId(), HcalZDCDetId::section(), HcalElectronicsId::spigot(), and HcalZDCDetId::zside().

                                        {

  static char myline[512];

  HcalElectronicsId hcaleid(hcalEID_);
  HcalZDCDetId hcalzdcid(hcalZDCDetID_);
  HcalGenericDetId hcalgenid(hcalZDCDetID_);

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

  string myfpga ="";
  string mydet ="ZDC_";
  HcalZDCDetId::Section myzdcsec = hcalzdcid.section();

  if (myzdcsec==0) mydet += "Unknown";
  else if (myzdcsec==1) mydet += "EM";
  else if (myzdcsec==2) mydet += "HAD";
  else mydet += "LUM";

  (hcaleid.htrTopBottom()==0) ? myfpga = "bot" : myfpga = "top";

  sprintf(myline,"%1d %5d %2d %2d %3d %6d %7s %7d",0,hcalzdcid.zside(),myx_,myy_,mydx_,hcalzdcid.depth(),mydet.c_str(),hcalzdcid.channel());
  sprintf(myline+strlen(myline),"%7d %3d %4d %4d %6d %6d %6d",mycable_,myrm_,myqie_,myadc_,myrm_fi_,hcaleid.fiberChanId(),hcaleid.readoutVMECrateId());
  sprintf(myline+strlen(myline),"%5d %5s %7d %7d %6d %4d %6d\n",hcaleid.htrSlot(),myfpga.c_str(),hcaleid.fiberIndex(),mydcc_sl,hcaleid.spigot(),mydcc,hcaleid.dccid()+700);

  return myline;
}

Member Data Documentation

uint32_t ZDCLogicalMapEntry::hcalEID_ [private]

Definition at line 154 of file HcalMappingEntry.h.

Referenced by getHcalElectronicsId(), and getLinearIndex().

Definition at line 155 of file HcalMappingEntry.h.

Referenced by getDetId().

Definition at line 158 of file HcalMappingEntry.h.

Definition at line 158 of file HcalMappingEntry.h.

Definition at line 158 of file HcalMappingEntry.h.

Definition at line 158 of file HcalMappingEntry.h.

Definition at line 158 of file HcalMappingEntry.h.

Definition at line 158 of file HcalMappingEntry.h.

Definition at line 158 of file HcalMappingEntry.h.

int ZDCLogicalMapEntry::myx_ [private]

Definition at line 158 of file HcalMappingEntry.h.

int ZDCLogicalMapEntry::myy_ [private]

Definition at line 158 of file HcalMappingEntry.h.