CMS 3D CMS Logo

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 160 of file HcalMappingEntry.h.

Constructor & Destructor Documentation

◆ ZDCLogicalMapEntry() [1/2]

ZDCLogicalMapEntry::ZDCLogicalMapEntry ( )
inline

Definition at line 166 of file HcalMappingEntry.h.

166 {}

◆ ZDCLogicalMapEntry() [2/2]

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 414 of file HcalMappingEntry.cc.

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

432  {
433  int mytopbot;
434  (in_s_fpga == "bot") ? mytopbot = 0 : mytopbot = 1;
435 
436  myx_ = in_x;
437  myy_ = in_y;
438  mydx_ = in_dx;
439  mycable_ = in_cab;
440  myrm_ = in_rm;
441  myqie_ = in_qie;
442  myadc_ = in_adc;
443  myrm_fi_ = in_rm_fi;
444 
445  // create the hcal electronics id
446  HcalElectronicsId heid(in_fi_ch, in_htr_fi, in_spigot, in_fed - 700);
447  heid.setHTR(in_cr, in_htr, mytopbot);
448 
449  //create the hcal det id
450  bool myzdccheck;
451  HcalZDCDetId::Section myzdcsec;
452  if (in_s_det == "ZDC_EM")
453  myzdcsec = HcalZDCDetId::EM;
454  else if (in_s_det == "ZDC_HAD")
455  myzdcsec = HcalZDCDetId::HAD;
456  else if (in_s_det == "ZDC_LUM")
457  myzdcsec = HcalZDCDetId::LUM;
458  else if (in_s_det == "ZDC_RPD")
459  myzdcsec = HcalZDCDetId::RPD;
460  else
461  myzdcsec = HcalZDCDetId::Unknown;
462 
463  (in_sid > 0) ? myzdccheck = true : myzdccheck = false;
464  HcalZDCDetId hzdcdid(myzdcsec, myzdccheck, in_det_ch);
465 
466  // store the different ids
467  hcalEID_ = heid.rawId();
468  hcalZDCDetID_ = hzdcdid.rawId();
469 }
Readout chain identification for Hcal.

◆ ~ZDCLogicalMapEntry()

ZDCLogicalMapEntry::~ZDCLogicalMapEntry ( )
inline

Definition at line 187 of file HcalMappingEntry.h.

187 {}

Member Function Documentation

◆ getDetId()

const DetId ZDCLogicalMapEntry::getDetId ( ) const
inline

Definition at line 192 of file HcalMappingEntry.h.

References hcalZDCDetID_.

192 { return DetId(hcalZDCDetID_); }
Definition: DetId.h:17

◆ getHcalElectronicsId()

const HcalElectronicsId ZDCLogicalMapEntry::getHcalElectronicsId ( ) const
inline

Definition at line 191 of file HcalMappingEntry.h.

References hcalEID_.

191 { return HcalElectronicsId(hcalEID_); }
Readout chain identification for Hcal.

◆ getLinearIndex()

const uint32_t ZDCLogicalMapEntry::getLinearIndex ( ) const
inline

Definition at line 190 of file HcalMappingEntry.h.

References hcalEID_, and HcalElectronicsId::linearIndex().

Referenced by HcalLogicalMapGenerator::buildZDCMap().

constexpr int linearIndex() const
get a fast, compact, unique index for linear lookups
Readout chain identification for Hcal.

◆ printLMapLine()

char * ZDCLogicalMapEntry::printLMapLine ( )

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

471  {
472  static char myline[512];
473 
474  HcalElectronicsId hcaleid(hcalEID_);
475  HcalZDCDetId hcalzdcid(hcalZDCDetID_);
476  HcalGenericDetId hcalgenid(hcalZDCDetID_);
477 
478  int mydcc_sl = -1;
479  int mydcc = -1;
480  if ((hcaleid.dccid() % 2) == 1) {
481  mydcc_sl = 20;
482  mydcc = 2;
483  } else {
484  mydcc_sl = 10;
485  mydcc = 1;
486  }
487 
488  string myfpga = "";
489  string mydet = "ZDC_";
490  HcalZDCDetId::Section myzdcsec = hcalzdcid.section();
491 
492  if (myzdcsec == 0)
493  mydet += "Unknown";
494  else if (myzdcsec == 1)
495  mydet += "EM";
496  else if (myzdcsec == 2)
497  mydet += "HAD";
498  else if (myzdcsec == 3)
499  mydet += "LUM";
500  else
501  mydet += "RPD";
502 
503  (hcaleid.htrTopBottom() == 0) ? myfpga = "bot" : myfpga = "top";
504 
505  sprintf(myline,
506  "%1d %5d %2d %2d %3d %6d %7s %7d",
507  0,
508  hcalzdcid.zside(),
509  myx_,
510  myy_,
511  mydx_,
512  hcalzdcid.depth(),
513  mydet.c_str(),
514  hcalzdcid.channel());
515  sprintf(myline + strlen(myline),
516  "%7d %3d %4d %4d %6d %6d %6d",
517  mycable_,
518  myrm_,
519  myqie_,
520  myadc_,
521  myrm_fi_,
522  hcaleid.fiberChanId(),
523  hcaleid.readoutVMECrateId());
524  sprintf(myline + strlen(myline),
525  "%5d %5s %7d %7d %6d %4d %6d\n",
526  hcaleid.htrSlot(),
527  myfpga.c_str(),
528  hcaleid.fiberIndex(),
529  mydcc_sl,
530  hcaleid.spigot(),
531  mydcc,
532  hcaleid.dccid() + 700);
533 
534  return myline;
535 }
Readout chain identification for Hcal.

Member Data Documentation

◆ hcalEID_

uint32_t ZDCLogicalMapEntry::hcalEID_
private

Definition at line 195 of file HcalMappingEntry.h.

Referenced by getHcalElectronicsId(), and getLinearIndex().

◆ hcalZDCDetID_

uint32_t ZDCLogicalMapEntry::hcalZDCDetID_
private

Definition at line 196 of file HcalMappingEntry.h.

Referenced by getDetId().

◆ myadc_

int ZDCLogicalMapEntry::myadc_
private

Definition at line 199 of file HcalMappingEntry.h.

◆ mycable_

int ZDCLogicalMapEntry::mycable_
private

Definition at line 199 of file HcalMappingEntry.h.

◆ mydet_ch_

int ZDCLogicalMapEntry::mydet_ch_
private

Definition at line 199 of file HcalMappingEntry.h.

◆ mydx_

int ZDCLogicalMapEntry::mydx_
private

Definition at line 199 of file HcalMappingEntry.h.

◆ myqie_

int ZDCLogicalMapEntry::myqie_
private

Definition at line 199 of file HcalMappingEntry.h.

◆ myrm_

int ZDCLogicalMapEntry::myrm_
private

Definition at line 199 of file HcalMappingEntry.h.

◆ myrm_fi_

int ZDCLogicalMapEntry::myrm_fi_
private

Definition at line 199 of file HcalMappingEntry.h.

◆ myx_

int ZDCLogicalMapEntry::myx_
private

Definition at line 199 of file HcalMappingEntry.h.

◆ myy_

int ZDCLogicalMapEntry::myy_
private

Definition at line 199 of file HcalMappingEntry.h.