23 int startIndex = fString.find_first_not_of(
" \t\n");
24 int endIndex = fString.find_last_not_of(
" \t\n");
25 return fString.substr(startIndex, (endIndex - startIndex) + 1);
29 return fName ==
"Mixer-High" ? 1
30 :
fName ==
"Mixer-Low" ? 2
31 :
fName ==
"Megatile" ? 3
32 :
fName ==
"Mixer-Scintillator" ? 4
33 :
fName ==
"RadDam1" ? 5
34 :
fName ==
"RadDam2" ? 6
35 :
fName ==
"RadDam3" ? 7
36 : atoi(
fName.c_str());
45 if (!
init(fFlavor, fField1, fField2, fField3)) {
46 std::cerr <<
"HcalText2DetIdConverter::HcalText2DetIdConverter-> Can not initiate detId from items: " << fFlavor
47 <<
'/' << fField1 <<
'/' << fField2 <<
'/' << fField3 << std::endl;
49 <<
" Can not initiate detId from items: " << fFlavor <<
'/' << fField1 <<
'/' << fField2 <<
'/' << fField3
180 std::cerr <<
"HcalText2DetIdConverter::init-> Unknown detId: " << std::hex << std::showbase <<
mId.
rawId()
237 if (
flavorName.find(
"HB") != std::string::npos)
239 else if (
flavorName.find(
"HE") != std::string::npos)
241 else if (
flavorName.find(
"HO") != std::string::npos)
243 else if (
flavorName.find(
"HF") != std::string::npos)
248 int channel = calibChannel(
field3);
272 std::cerr <<
"HcalText2DetIdConverter::init-> Unknown HcalDetId flavor: " <<
flavorName << std::endl;
281 long result = strtol(nptr, &endptr, 0);
282 if (*nptr !=
'\0' && *endptr ==
'\0') {
291 std::cerr <<
"HcalText2DetIdConverter::getField-> Can not convert string " << nptr
292 <<
" to int. Bad symbol: " << *endptr << std::endl;
299 sprintf(
buffer,
"%d", fValue);
static const HcalDetId Undefined
int cboxChannel() const
get the calibration box channel (if relevant)
Section section() const
get the section
HcalSubdetector hcalSubdet() const
get the HcalSubdetector (if relevant)
bool isHcalCalibDetId() const
int iphi() const
get the tower iphi
int depth() const
get the depth (zero for LHC Run 1, may be nonzero for later runs)
void setField(int i, int fValue)
constexpr int ieta() const
get the cell ieta
int iphi() const
get the low-edge iphi (if relevant)
HcalText2DetIdConverter(const std::string &fFlavor="NA", const std::string &fField1="0", const std::string &fField2="0", const std::string &fField3="0")
bool isHcalTrigTowerDetId() const
int rm() const
get the rm (where relevant)
int getField(int i) const
int ieta() const
get the tower ieta
bool isHcalCalibDetId() const
HcalGenericSubdetector genericSubdet() const
bool init(const std::string &fFlavor, const std::string &fField1, const std::string &fField2, const std::string &fField3)
constexpr uint32_t rawId() const
get the raw id
CalibDetType calibFlavor() const
get the flavor of this calibration detid
static const HcalTrigTowerDetId Undefined
bool isHcalZDCDetId() const
std::string toString() const
int fiber() const
get the fiber (where relevant)
int channel() const
get the channel (for uMNio/qie or similar)
int version() const
get the version code for the trigger tower
bool isHcalZDCDetId() const
constexpr int iphi() const
get the cell iphi
int zside() const
get the z-side of the cell (1/-1)
bool isHcalTrigTowerDetId() const
int channel() const
get the channel
constexpr int depth() const
get the tower depth