CMS 3D CMS Logo

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

#include <HcalMappingEntry.h>

Public Member Functions

const DetId getDetId () const
 
const HcalElectronicsId getHcalElectronicsId () const
 
const HcalFrontEndId getHcalFrontEndId () const
 
const uint32_t getLinearIndex () const
 
 HOHXLogicalMapEntry ()
 
 HOHXLogicalMapEntry (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_sid, int in_et, int in_ph, int in_dep, int in_dph, int in_sec, int in_rm, int in_rm_fi, int in_pix, int in_qie, int in_adc, std::string in_s_rbx, std::string in_s_let)
 
char * printLMapLine ()
 
 ~HOHXLogicalMapEntry ()
 

Private Attributes

uint32_t hcalDetID_
 
uint32_t hcalEID_
 
uint32_t hcalFrontEndID_
 
int mydphi_
 
std::string myletter_
 
int mysector_
 

Detailed Description

Definition at line 70 of file HcalMappingEntry.h.

Constructor & Destructor Documentation

◆ HOHXLogicalMapEntry() [1/2]

HOHXLogicalMapEntry::HOHXLogicalMapEntry ( )
inline

Definition at line 75 of file HcalMappingEntry.h.

75 :

◆ HOHXLogicalMapEntry() [2/2]

HOHXLogicalMapEntry::HOHXLogicalMapEntry ( 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_sid,
int  in_et,
int  in_ph,
int  in_dep,
int  in_dph,
int  in_sec,
int  in_rm,
int  in_rm_fi,
int  in_pix,
int  in_qie,
int  in_adc,
std::string  in_s_rbx,
std::string  in_s_let 
)

Definition at line 157 of file HcalMappingEntry.cc.

177  {
178  int mytopbot;
179  (in_s_fpga == "bot") ? mytopbot = 0 : mytopbot = 1;
180 
181  mydphi_ = in_dph;
182  mysector_ = in_sec;
183  // string data members
184  myletter_ = in_s_let;
185 
186  // create the hcal electronics id
187  HcalElectronicsId heid(in_fi_ch, in_htr_fi, in_spig, in_fed - 700);
188  heid.setHTR(in_cr, in_htr, mytopbot);
189 
190  if (in_s_det == "HO") {
191  //create the hcal det id in the case of regular HO channel
192  HcalDetId hdid(HcalOuter, in_sid * in_et, in_ph, in_dep);
193  hcalDetID_ = hdid.rawId();
194  } else {
195  //create the calib det id in the case of HO cross talk channels
196  HcalCalibDetId hdid(in_sid * in_et, in_ph);
197  hcalDetID_ = hdid.rawId();
198  }
199 
200  HcalFrontEndId hrbx(in_s_rbx, in_rm, in_pix, in_rm_fi, in_fi_ch, in_qie, in_adc);
201 
202  // store the different ids
203  hcalEID_ = heid.rawId();
204  hcalFrontEndID_ = hrbx.rawId();
205 }

References HcalOuter, HcalFrontEndId::rawId(), DetId::rawId(), HcalElectronicsId::rawId(), and HcalElectronicsId::setHTR().

◆ ~HOHXLogicalMapEntry()

HOHXLogicalMapEntry::~HOHXLogicalMapEntry ( )
inline

Definition at line 98 of file HcalMappingEntry.h.

99 {}

Member Function Documentation

◆ getDetId()

const DetId HOHXLogicalMapEntry::getDetId ( ) const
inline

Definition at line 103 of file HcalMappingEntry.h.

103 { return HcalElectronicsId(hcalEID_); }

References hcalEID_.

Referenced by HcalLogicalMapGenerator::buildHOXMap().

◆ getHcalElectronicsId()

const HcalElectronicsId HOHXLogicalMapEntry::getHcalElectronicsId ( ) const
inline

Definition at line 102 of file HcalMappingEntry.h.

References hcalEID_, and HcalElectronicsId::linearIndex().

◆ getHcalFrontEndId()

const HcalFrontEndId HOHXLogicalMapEntry::getHcalFrontEndId ( ) const
inline

Definition at line 104 of file HcalMappingEntry.h.

104 { return DetId(hcalDetID_); }

References hcalDetID_.

◆ getLinearIndex()

const uint32_t HOHXLogicalMapEntry::getLinearIndex ( ) const
inline

Definition at line 101 of file HcalMappingEntry.h.

Referenced by HcalLogicalMapGenerator::buildHOXMap().

◆ printLMapLine()

char * HOHXLogicalMapEntry::printLMapLine ( )

Definition at line 207 of file HcalMappingEntry.cc.

207  {
208  static char myline[512];
209 
210  HcalElectronicsId hcaleid(hcalEID_);
211  HcalGenericDetId hcalgenid(hcalDetID_);
213 
214  int mydcc_sl = 0;
215  int mydcc = 0;
216  if ((hcaleid.dccid() % 2) == 1) {
217  mydcc_sl = 20;
218  mydcc = 2;
219  } else {
220  mydcc_sl = 10;
221  mydcc = 1;
222  }
223 
224  string myfpga = "";
225  string mydet = "";
226  int mydepth = 0;
227  int myside = -2;
228  int myeta = 0;
229  int myphi = -1;
230  if (hcalgenid.isHcalCalibDetId()) {
231  HcalCalibDetId hcalcompid(hcalDetID_);
232  mydet = "HOX";
233  mydepth = 4;
234  myside = hcalcompid.zside();
235  myeta = hcalcompid.ieta() * myside;
236  myphi = hcalcompid.iphi();
237  } else if (hcalgenid.isHcalDetId()) {
238  HcalDetId hcalcompid(hcalDetID_);
239  HcalSubdetector mysubdet = hcalcompid.subdet();
240  (mysubdet == HcalBarrel)
241  ? mydet = "HB"
242  : ((mysubdet == HcalEndcap)
243  ? mydet = "HE"
244  : ((mysubdet == HcalOuter) ? mydet = "HO"
245  : ((mysubdet == HcalForward) ? mydet = "HF" : mydet = "invalid")));
246  mydepth = hcalcompid.depth();
247  myside = hcalcompid.zside();
248  myeta = hcalcompid.ietaAbs();
249  myphi = hcalcompid.iphi();
250  }
251 
252  (hcaleid.htrTopBottom() == 0) ? myfpga = "bot" : myfpga = "top";
253 
254  sprintf(myline,
255  "%1d %6d %6d %6d %6d %6d %6s %7s %6d %6d %6d",
256  0,
257  myside,
258  myeta,
259  myphi,
260  mydphi_,
261  mydepth,
262  mydet.c_str(),
263  rbxid.rbx().c_str(),
264  mysector_,
265  rbxid.rm(),
266  rbxid.pixel());
267  sprintf(myline + strlen(myline),
268  "%6d %6d %6d %6d %8s %6d %6d %6s",
269  rbxid.qieCard(),
270  rbxid.adc(),
271  rbxid.rmFiber(),
272  hcaleid.fiberChanId(),
273  myletter_.c_str(),
274  hcaleid.readoutVMECrateId(),
275  hcaleid.htrSlot(),
276  myfpga.c_str());
277  sprintf(myline + strlen(myline),
278  "%8d %7d %6d %6d %6d\n",
279  hcaleid.fiberIndex(),
280  mydcc_sl,
281  hcaleid.spigot(),
282  mydcc,
283  hcaleid.dccid() + 700);
284 
285  return myline;
286 }

References HcalFrontEndId::adc(), HcalElectronicsId::dccid(), HcalDetId::depth(), HcalElectronicsId::fiberChanId(), HcalElectronicsId::fiberIndex(), HcalBarrel, HcalEndcap, HcalForward, HcalOuter, HcalElectronicsId::htrSlot(), HcalElectronicsId::htrTopBottom(), HcalCalibDetId::ieta(), HcalDetId::ietaAbs(), HcalCalibDetId::iphi(), HcalDetId::iphi(), HcalGenericDetId::isHcalCalibDetId(), HcalGenericDetId::isHcalDetId(), HcalFrontEndId::pixel(), HcalFrontEndId::qieCard(), HcalFrontEndId::rbx(), HcalElectronicsId::readoutVMECrateId(), HcalFrontEndId::rm(), HcalFrontEndId::rmFiber(), HcalElectronicsId::spigot(), HcalDetId::subdet(), HcalCalibDetId::zside(), and HcalDetId::zside().

Member Data Documentation

◆ hcalDetID_

uint32_t HOHXLogicalMapEntry::hcalDetID_
private

Definition at line 108 of file HcalMappingEntry.h.

Referenced by getHcalFrontEndId().

◆ hcalEID_

uint32_t HOHXLogicalMapEntry::hcalEID_
private

Definition at line 107 of file HcalMappingEntry.h.

Referenced by getDetId(), and getHcalElectronicsId().

◆ hcalFrontEndID_

uint32_t HOHXLogicalMapEntry::hcalFrontEndID_
private

Definition at line 109 of file HcalMappingEntry.h.

◆ mydphi_

int HOHXLogicalMapEntry::mydphi_
private

Definition at line 112 of file HcalMappingEntry.h.

◆ myletter_

std::string HOHXLogicalMapEntry::myletter_
private

Definition at line 113 of file HcalMappingEntry.h.

◆ mysector_

int HOHXLogicalMapEntry::mysector_
private

Definition at line 112 of file HcalMappingEntry.h.

HOHXLogicalMapEntry::hcalDetID_
uint32_t hcalDetID_
Definition: HcalMappingEntry.h:108
HOHXLogicalMapEntry::HOHXLogicalMapEntry
HOHXLogicalMapEntry()
Definition: HcalMappingEntry.h:75
HcalGenericDetId
Definition: HcalGenericDetId.h:15
HcalCalibDetId
Definition: HcalCalibDetId.h:45
HcalBarrel
Definition: HcalAssistant.h:33
DetId
Definition: DetId.h:17
HOHXLogicalMapEntry::hcalEID_
uint32_t hcalEID_
Definition: HcalMappingEntry.h:107
HOHXLogicalMapEntry::myletter_
std::string myletter_
Definition: HcalMappingEntry.h:113
HcalElectronicsId
Readout chain identification for Hcal.
Definition: HcalElectronicsId.h:32
HcalFrontEndId
Definition: HcalFrontEndId.h:8
HcalOuter
Definition: HcalAssistant.h:35
HcalDetId
Definition: HcalDetId.h:12
HcalSubdetector
HcalSubdetector
Definition: HcalAssistant.h:31
HcalForward
Definition: HcalAssistant.h:36
HcalElectronicsId::linearIndex
constexpr int linearIndex() const
get a fast, compact, unique index for linear lookups
Definition: HcalElectronicsId.h:111
HcalEndcap
Definition: HcalAssistant.h:34
HOHXLogicalMapEntry::hcalFrontEndID_
uint32_t hcalFrontEndID_
Definition: HcalMappingEntry.h:109
HOHXLogicalMapEntry::mysector_
int mysector_
Definition: HcalMappingEntry.h:112
HOHXLogicalMapEntry::mydphi_
int mydphi_
Definition: HcalMappingEntry.h:112