21 if (fString.empty ())
return fString;
22 int startIndex = fString.find_first_not_of(
" \t\n");
23 int endIndex = fString.find_last_not_of(
" \t\n");
24 return fString.substr(startIndex, (endIndex-startIndex)+1);
29 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 :
43 if (!
init (fFlavor, fField1, fField2, fField3)) {
44 std::cerr <<
"HcalText2DetIdConverter::HcalText2DetIdConverter-> Can not initiate detId from items: "
45 << fFlavor <<
'/' << fField1 <<
'/' << fField2 <<
'/' << fField3 << std::endl;
47 <<
" Can not initiate detId from items: "
48 << fFlavor <<
'/' << fField1 <<
'/' << fField2 <<
'/' << fField3 << std::endl;
101 }
else if (triggerId.
version() == 1) {
116 default: result =
false;
130 default: result =
false;
144 std::cerr <<
"HcalText2DetIdConverter::init-> Unknown detId: " << std::hex << std::showbase <<
mId.
rawId() << std::endl;
173 const int depth_field =
getField(3);
174 const int ones = depth_field % 10;
175 const int tens = (depth_field - ones) / 10;
177 const int depth = ones;
180 }
else if (tens == 1) {
203 int channel = calibChannel (
field3);
215 std::cerr <<
"HcalText2DetIdConverter::init-> Unknown HcalDetId flavor: " <<
flavorName << std::endl;
224 const char* nptr = i == 1 ?
field1.c_str() :
226 long result = strtol (nptr, &endptr, 0);
227 if (*nptr !=
'\0' && *endptr ==
'\0') {
231 int result = calibChannel (
field2);
235 std::cerr <<
"HcalText2DetIdConverter::getField-> Can not convert string "<< nptr <<
" to int. Bad symbol: " << *endptr << std::endl;
242 sprintf (buffer,
"%d", fValue);
243 if (i == 1)
field1 = buffer;
244 else if (i == 2)
field2 = buffer;
static const HcalDetId Undefined
bool isHcalZDCDetId() const
CalibDetType calibFlavor() const
get the flavor of this calibration detid
int zside() const
get the z-side of the cell (1/-1)
std::string toString() const
int ieta() const
get the tower ieta
int ieta() const
get the rbx name (if relevant)
uint32_t rawId() const
get the raw id
bool isHcalZDCDetId() const
bool isHcalTrigTowerDetId() const
int depth() const
get the tower depth
bool isHcalTrigTowerDetId() const
void setField(int i, int fValue)
int ieta() const
get the cell ieta
HcalText2DetIdConverter(const std::string &fFlavor="NA", const std::string &fField1="0", const std::string &fField2="0", const std::string &fField3="0")
Section section() const
get the section
int iphi() const
get the low-edge iphi (if relevant)
bool init(const std::string &fFlavor, const std::string &fField1, const std::string &fField2, const std::string &fField3)
int iphi() const
get the cell iphi
int version() const
get the version code for the trigger tower
bool isHcalCalibDetId() const
int channel() const
get the channel
static const HcalTrigTowerDetId Undefined
int cboxChannel() const
get the calibration box channel (if relevant)
bool isHcalCalibDetId() const
HcalSubdetector hcalSubdet() const
get the HcalSubdetector (if relevant)
HcalGenericSubdetector genericSubdet() const
int iphi() const
get the tower iphi
int getField(int i) const