CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
CALIBLogicalMapEntry Class Reference

#include <HcalMappingEntry.h>

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

Constructor & Destructor Documentation

◆ CALIBLogicalMapEntry() [1/2]

CALIBLogicalMapEntry::CALIBLogicalMapEntry ( )
inline

Definition at line 123 of file HcalMappingEntry.h.

123 {}

◆ CALIBLogicalMapEntry() [2/2]

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

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

306  {
307  int mytopbot;
308  (in_s_fpga == "bot") ? mytopbot = 0 : mytopbot = 1;
309 
310  myside_ = in_sid;
311  mydphi_ = in_dph;
312  mywedge_ = in_wed;
313  // string data members
314  mycalibsubdet_ = in_s_subdet;
315 
316  //create the hcal electronics id
317  HcalElectronicsId heid(in_fi_ch, in_htr_fi, in_spig, in_fed - 700);
318  heid.setHTR(in_cr, in_htr, mytopbot);
319 
320  //create the hcal det id for a calibration unit channel
321  HcalSubdetector mysubdet = HcalEmpty;
322  if (in_s_det == "HB")
323  mysubdet = HcalBarrel;
324  else if (in_s_det == "HE")
325  mysubdet = HcalEndcap;
326  else if (in_s_det == "HO")
327  mysubdet = HcalOuter;
328  else if (in_s_det == "HF")
329  mysubdet = HcalForward;
330 
331  HcalCalibDetId hcalibdid(mysubdet, in_et, in_ph, in_ch_ty);
332 
333  int in_rm, in_pix, in_qie, in_adc;
334  //CM RM in HF is 4 rather than 5
335  if (in_s_det == "HF")
336  in_rm = 4;
337  else
338  in_rm = 5;
339 
340  in_pix = 0;
341  in_qie = 1;
342  in_adc = in_fi_ch + (3 * (in_rm_fi - 1));
343 
344  HcalFrontEndId hrbx(in_s_rbx, in_rm, in_pix, in_rm_fi, in_fi_ch, in_qie, in_adc);
345 
346  //store the different ids
347  hcalEID_ = heid.rawId();
348  hcalCalibDetID_ = hcalibdid.rawId();
349  hcalFrontEndID_ = hrbx.rawId();
350 }
HcalSubdetector
Definition: HcalAssistant.h:31
Readout chain identification for Hcal.

◆ ~CALIBLogicalMapEntry()

CALIBLogicalMapEntry::~CALIBLogicalMapEntry ( )
inline

Definition at line 142 of file HcalMappingEntry.h.

142 {}

Member Function Documentation

◆ getDetId()

const DetId CALIBLogicalMapEntry::getDetId ( ) const
inline

Definition at line 147 of file HcalMappingEntry.h.

References hcalCalibDetID_.

Referenced by HcalLogicalMapGenerator::buildCALIBMap().

147 { return DetId(hcalCalibDetID_); }
Definition: DetId.h:17

◆ getHcalElectronicsId()

const HcalElectronicsId CALIBLogicalMapEntry::getHcalElectronicsId ( ) const
inline

Definition at line 146 of file HcalMappingEntry.h.

References hcalEID_.

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

◆ getHcalFrontEndId()

const HcalFrontEndId CALIBLogicalMapEntry::getHcalFrontEndId ( ) const
inline

Definition at line 148 of file HcalMappingEntry.h.

References hcalFrontEndID_.

◆ getLinearIndex()

const uint32_t CALIBLogicalMapEntry::getLinearIndex ( ) const
inline

Definition at line 145 of file HcalMappingEntry.h.

References hcalEID_, and HcalElectronicsId::linearIndex().

Referenced by HcalLogicalMapGenerator::buildCALIBMap().

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

◆ printLMapLine()

char * CALIBLogicalMapEntry::printLMapLine ( )

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

352  {
353  static char myline[512];
354 
355  HcalElectronicsId hcaleid(hcalEID_);
356  HcalCalibDetId hcalcalibid(hcalCalibDetID_);
359 
360  int mydcc_sl = 0;
361  int mydcc = 0;
362  if ((hcaleid.dccid() % 2) == 1) {
363  mydcc_sl = 20;
364  mydcc = 2;
365  } else {
366  mydcc_sl = 10;
367  mydcc = 1;
368  }
369 
370  string myfpga = "";
371  string mydet = "";
372  HcalSubdetector mysubdet = hcalcalibid.hcalSubdet();
373  (mysubdet == HcalBarrel)
374  ? mydet = "HB"
375  : ((mysubdet == HcalEndcap)
376  ? mydet = "HE"
377  : ((mysubdet == HcalOuter) ? mydet = "HO"
378  : ((mysubdet == HcalForward) ? mydet = "HF" : mydet = "invalid")));
379  (hcaleid.htrTopBottom() == 0) ? myfpga = "bot" : myfpga = "top";
380 
381  sprintf(myline,
382  "%1d %6d %6d %6d %6d %6s %7s",
383  0,
384  myside_,
385  hcalcalibid.ieta(),
386  hcalcalibid.iphi(),
387  mydphi_,
388  mydet.c_str(),
389  rbxid.rbx().c_str());
390  sprintf(myline + strlen(myline),
391  "%8d %6d %6d %6d %6d %4d %5s",
392  mywedge_,
393  rbxid.rm(),
394  rbxid.rmFiber(),
395  hcaleid.fiberChanId(),
396  hcaleid.readoutVMECrateId(),
397  hcaleid.htrSlot(),
398  myfpga.c_str());
399  sprintf(myline + strlen(myline),
400  "%8d %7d %6d %4d %6d %8d %9s\n",
401  hcaleid.fiberIndex(),
402  mydcc_sl,
403  hcaleid.spigot(),
404  mydcc,
405  hcaleid.dccid() + 700,
406  hcalcalibid.cboxChannel(),
407  mycalibsubdet_.c_str());
408 
409  return myline;
410 }
HcalSubdetector
Definition: HcalAssistant.h:31
Readout chain identification for Hcal.

Member Data Documentation

◆ hcalCalibDetID_

uint32_t CALIBLogicalMapEntry::hcalCalibDetID_
private

Definition at line 152 of file HcalMappingEntry.h.

Referenced by getDetId().

◆ hcalEID_

uint32_t CALIBLogicalMapEntry::hcalEID_
private

Definition at line 151 of file HcalMappingEntry.h.

Referenced by getHcalElectronicsId(), and getLinearIndex().

◆ hcalFrontEndID_

uint32_t CALIBLogicalMapEntry::hcalFrontEndID_
private

Definition at line 153 of file HcalMappingEntry.h.

Referenced by getHcalFrontEndId().

◆ mycalibsubdet_

std::string CALIBLogicalMapEntry::mycalibsubdet_
private

Definition at line 157 of file HcalMappingEntry.h.

◆ mydphi_

int CALIBLogicalMapEntry::mydphi_
private

Definition at line 156 of file HcalMappingEntry.h.

◆ myside_

int CALIBLogicalMapEntry::myside_
private

Definition at line 156 of file HcalMappingEntry.h.

◆ mywedge_

int CALIBLogicalMapEntry::mywedge_
private

Definition at line 156 of file HcalMappingEntry.h.