CMS 3D CMS Logo

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules 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 160 of file HcalMappingEntry.h.

Constructor & Destructor Documentation

◆ ZDCLogicalMapEntry() [1/2]

ZDCLogicalMapEntry::ZDCLogicalMapEntry ( )
inline

Definition at line 165 of file HcalMappingEntry.h.

165 :
166  ZDCLogicalMapEntry() {}

◆ 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.

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 }

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

◆ ~ZDCLogicalMapEntry()

ZDCLogicalMapEntry::~ZDCLogicalMapEntry ( )
inline

Definition at line 186 of file HcalMappingEntry.h.

187 {}

Member Function Documentation

◆ getDetId()

const DetId ZDCLogicalMapEntry::getDetId ( ) const
inline

Definition at line 191 of file HcalMappingEntry.h.

191 { return HcalElectronicsId(hcalEID_); }

References hcalEID_.

◆ getHcalElectronicsId()

const HcalElectronicsId ZDCLogicalMapEntry::getHcalElectronicsId ( ) const
inline

Definition at line 190 of file HcalMappingEntry.h.

References hcalEID_, and HcalElectronicsId::linearIndex().

◆ getLinearIndex()

const uint32_t ZDCLogicalMapEntry::getLinearIndex ( ) const
inline

Definition at line 189 of file HcalMappingEntry.h.

Referenced by HcalLogicalMapGenerator::buildZDCMap().

◆ printLMapLine()

char * ZDCLogicalMapEntry::printLMapLine ( )

Definition at line 471 of file HcalMappingEntry.cc.

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 }

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

Member Data Documentation

◆ hcalEID_

uint32_t ZDCLogicalMapEntry::hcalEID_
private

Definition at line 194 of file HcalMappingEntry.h.

Referenced by getDetId(), and getHcalElectronicsId().

◆ hcalZDCDetID_

uint32_t ZDCLogicalMapEntry::hcalZDCDetID_
private

Definition at line 195 of file HcalMappingEntry.h.

◆ myadc_

int ZDCLogicalMapEntry::myadc_
private

Definition at line 198 of file HcalMappingEntry.h.

◆ mycable_

int ZDCLogicalMapEntry::mycable_
private

Definition at line 198 of file HcalMappingEntry.h.

◆ mydet_ch_

int ZDCLogicalMapEntry::mydet_ch_
private

Definition at line 198 of file HcalMappingEntry.h.

◆ mydx_

int ZDCLogicalMapEntry::mydx_
private

Definition at line 198 of file HcalMappingEntry.h.

◆ myqie_

int ZDCLogicalMapEntry::myqie_
private

Definition at line 198 of file HcalMappingEntry.h.

◆ myrm_

int ZDCLogicalMapEntry::myrm_
private

Definition at line 198 of file HcalMappingEntry.h.

◆ myrm_fi_

int ZDCLogicalMapEntry::myrm_fi_
private

Definition at line 198 of file HcalMappingEntry.h.

◆ myx_

int ZDCLogicalMapEntry::myx_
private

Definition at line 198 of file HcalMappingEntry.h.

◆ myy_

int ZDCLogicalMapEntry::myy_
private

Definition at line 198 of file HcalMappingEntry.h.

ZDCLogicalMapEntry::mycable_
int mycable_
Definition: HcalMappingEntry.h:198
ZDCLogicalMapEntry::ZDCLogicalMapEntry
ZDCLogicalMapEntry()
Definition: HcalMappingEntry.h:165
HcalZDCDetId::HAD
Definition: HcalZDCDetId.h:23
HcalGenericDetId
Definition: HcalGenericDetId.h:15
HcalZDCDetId::Section
Section
Definition: HcalZDCDetId.h:23
ZDCLogicalMapEntry::myqie_
int myqie_
Definition: HcalMappingEntry.h:198
ZDCLogicalMapEntry::myy_
int myy_
Definition: HcalMappingEntry.h:198
HcalZDCDetId
Definition: HcalZDCDetId.h:16
HcalElectronicsId
Readout chain identification for Hcal.
Definition: HcalElectronicsId.h:32
ZDCLogicalMapEntry::mydx_
int mydx_
Definition: HcalMappingEntry.h:198
ZDCLogicalMapEntry::hcalZDCDetID_
uint32_t hcalZDCDetID_
Definition: HcalMappingEntry.h:195
HcalZDCDetId::RPD
Definition: HcalZDCDetId.h:23
HcalZDCDetId::Unknown
Definition: HcalZDCDetId.h:23
ZDCLogicalMapEntry::myx_
int myx_
Definition: HcalMappingEntry.h:198
HcalElectronicsId::linearIndex
constexpr int linearIndex() const
get a fast, compact, unique index for linear lookups
Definition: HcalElectronicsId.h:111
ZDCLogicalMapEntry::hcalEID_
uint32_t hcalEID_
Definition: HcalMappingEntry.h:194
HcalZDCDetId::LUM
Definition: HcalZDCDetId.h:23
ZDCLogicalMapEntry::myadc_
int myadc_
Definition: HcalMappingEntry.h:198
ZDCLogicalMapEntry::myrm_
int myrm_
Definition: HcalMappingEntry.h:198
HcalZDCDetId::EM
Definition: HcalZDCDetId.h:23
ZDCLogicalMapEntry::myrm_fi_
int myrm_fi_
Definition: HcalMappingEntry.h:198