CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
ZDCLogicalMapEntry Class Reference

#include <HcalMappingEntry.h>

Public Member Functions

const DetId getDetId () const
 
const HcalElectronicsId getHcalElectronicsId () const
 
const uint32_t getLinearIndex () const
 
char * printLMapLine ()
 
 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)
 
 ~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.

137 {}
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, DetId::rawId(), HcalElectronicsId::rawId(), HcalZDCDetId::RPD, HcalElectronicsId::setHTR(), and HcalZDCDetId::Unknown.

295 {
296  int mytopbot;
297  (in_s_fpga=="bot") ? mytopbot = 0 : mytopbot = 1;
298 
299  myx_ = in_x;
300  myy_ = in_y;
301  mydx_ = in_dx;
302  mycable_ = in_cab;
303  myrm_ = in_rm;
304  myqie_ = in_qie;
305  myadc_ = in_adc;
306  myrm_fi_ = in_rm_fi;
307 
308  // create the hcal electronics id
309  HcalElectronicsId heid( in_fi_ch, in_htr_fi, in_spigot, in_fed - 700 );
310  heid.setHTR( in_cr, in_htr, mytopbot );
311 
312  //create the hcal det id
313  bool myzdccheck;
314  HcalZDCDetId::Section myzdcsec;
315  if (in_s_det=="ZDC_EM") myzdcsec = HcalZDCDetId::EM;
316  else if (in_s_det=="ZDC_HAD") myzdcsec = HcalZDCDetId::HAD;
317  else if (in_s_det=="ZDC_LUM") myzdcsec = HcalZDCDetId::LUM;
318  else if (in_s_det=="ZDC_RPD") myzdcsec = HcalZDCDetId::RPD;
319  else myzdcsec = HcalZDCDetId::Unknown;
320 
321  (in_sid > 0) ? myzdccheck = true : myzdccheck = false;
322  HcalZDCDetId hzdcdid( myzdcsec, myzdccheck, in_det_ch );
323 
324  // store the different ids
325  hcalEID_ = heid.rawId();
326  hcalZDCDetID_ = hzdcdid.rawId();
327 
328 }
Readout chain identification for Hcal.
ZDCLogicalMapEntry::~ZDCLogicalMapEntry ( )
inline

Definition at line 145 of file HcalMappingEntry.h.

145 { }

Member Function Documentation

const DetId ZDCLogicalMapEntry::getDetId ( ) const
inline

Definition at line 150 of file HcalMappingEntry.h.

References hcalZDCDetID_.

150 {return DetId(hcalZDCDetID_);}
Definition: DetId.h:18
const HcalElectronicsId ZDCLogicalMapEntry::getHcalElectronicsId ( ) const
inline

Definition at line 149 of file HcalMappingEntry.h.

References hcalEID_.

149 {return HcalElectronicsId(hcalEID_);}
Readout chain identification for Hcal.
const uint32_t ZDCLogicalMapEntry::getLinearIndex ( ) const
inline

Definition at line 148 of file HcalMappingEntry.h.

References hcalEID_, and HcalElectronicsId::linearIndex().

Referenced by HcalLogicalMapGenerator::buildZDCMap().

int linearIndex() const
get a fast, compact, unique index for linear lookups
Readout chain identification for Hcal.
char * ZDCLogicalMapEntry::printLMapLine ( )

Definition at line 330 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().

330  {
331 
332  static char myline[512];
333 
334  HcalElectronicsId hcaleid(hcalEID_);
335  HcalZDCDetId hcalzdcid(hcalZDCDetID_);
336  HcalGenericDetId hcalgenid(hcalZDCDetID_);
337 
338  int mydcc_sl = -1;
339  int mydcc = -1;
340  if ((hcaleid.dccid()%2)==1) {
341  mydcc_sl = 20;
342  mydcc = 2;
343  }
344  else {
345  mydcc_sl = 10;
346  mydcc = 1;
347  }
348 
349  string myfpga ="";
350  string mydet ="ZDC_";
351  HcalZDCDetId::Section myzdcsec = hcalzdcid.section();
352 
353  if (myzdcsec==0) mydet += "Unknown";
354  else if (myzdcsec==1) mydet += "EM";
355  else if (myzdcsec==2) mydet += "HAD";
356  else if (myzdcsec==3) mydet += "LUM";
357  else mydet += "RPD";
358 
359  (hcaleid.htrTopBottom()==0) ? myfpga = "bot" : myfpga = "top";
360 
361  sprintf(myline,"%1d %5d %2d %2d %3d %6d %7s %7d",0,hcalzdcid.zside(),myx_,myy_,mydx_,hcalzdcid.depth(),mydet.c_str(),hcalzdcid.channel());
362  sprintf(myline+strlen(myline),"%7d %3d %4d %4d %6d %6d %6d",mycable_,myrm_,myqie_,myadc_,myrm_fi_,hcaleid.fiberChanId(),hcaleid.readoutVMECrateId());
363  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);
364 
365  return myline;
366 }
Readout chain identification for Hcal.

Member Data Documentation

uint32_t ZDCLogicalMapEntry::hcalEID_
private

Definition at line 154 of file HcalMappingEntry.h.

Referenced by getHcalElectronicsId(), and getLinearIndex().

uint32_t ZDCLogicalMapEntry::hcalZDCDetID_
private

Definition at line 155 of file HcalMappingEntry.h.

Referenced by getDetId().

int ZDCLogicalMapEntry::myadc_
private

Definition at line 158 of file HcalMappingEntry.h.

int ZDCLogicalMapEntry::mycable_
private

Definition at line 158 of file HcalMappingEntry.h.

int ZDCLogicalMapEntry::mydet_ch_
private

Definition at line 158 of file HcalMappingEntry.h.

int ZDCLogicalMapEntry::mydx_
private

Definition at line 158 of file HcalMappingEntry.h.

int ZDCLogicalMapEntry::myqie_
private

Definition at line 158 of file HcalMappingEntry.h.

int ZDCLogicalMapEntry::myrm_
private

Definition at line 158 of file HcalMappingEntry.h.

int ZDCLogicalMapEntry::myrm_fi_
private

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.