|
ATLAS Offline Software
|
Go to the documentation of this file.
24 m_slar (supercell ? 1 : 0)
60 if (
range.match(expId)) {
62 if (not eta_field.
empty()) {
86 if (
range.match(expId)) {
88 if (not eta_field.
empty()) {
107 if (
range.match(expId)) {
109 if (not phi_field.
empty()) {
133 if (
range.match(expId)) {
135 if (not phi_field.
empty()) {
155 std::string errorMessage =
"LArEM_Base_ID::region_id_checks() result is not OK: ID, range = "
172 std::string errorMessage =
"LArEM_Base_ID::channel_id_checks() result is not OK: ID, range = "
188 std::string errorMessage =
"LArEM_Base_ID::channel_id_checks(regId) result is not OK: ID = "
196 std::string errorMessage =
"LArEM_Base_ID::channel_id_checks(regId) result is not OK: ID, range = "
231 log << MSG::ERROR <<
"initLevelsFromDict - dictionary NOT initialized "
235 std::cout <<
"LArEM_Base_ID::initLevelsFromDict - dictionary NOT initialized "
259 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'subdet' field "
263 std::cout <<
"LArEM_Base_ID::initLevelsFromDict - unable to find 'subdet' field "
275 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'part' field "
279 std::cout <<
"LArEM_Base_ID::initLevelsFromDict - unable to find 'part' field "
291 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'barrel-endcap' field "
295 std::cout <<
"LArEM_Base_ID::initLevelsFromDict - unable to find 'barrel-endcap' field "
307 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'sampling' field "
311 std::cout <<
"LArEM_Base_ID::initLevelsFromDict - unable to find 'sampling' field "
323 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'region' field "
327 std::cout <<
"LArEM_Base_ID::initLevelsFromDict - unable to find 'region' field "
339 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'eta' field "
343 std::cout <<
"LArEM_Base_ID::initLevelsFromDict - unable to find 'eta' field "
355 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'phi' field "
359 std::cout <<
"LArEM_Base_ID::initLevelsFromDict - unable to find 'phi' field "
371 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'is-slar' field "
375 std::cout <<
"LArEM_Base_ID::initLevelsFromDict - unable to find 'is-slar' field "
385 log << MSG::ERROR <<
"initLevelsFromDict - cannot find " <<
group_name
386 <<
" group' field " <<
endmsg;
415 std::cout <<
"decode index and bit fields for each level: " << std::endl;
458 log <<
MSG::DEBUG <<
"Request to reinitialize not satisfied - tags have not changed" <<
endmsg;
479 if (atlasDict->
get_label_value(
"subdet",
"LArCalorimeter", larField)) {
481 log << MSG::ERROR <<
"Could not get value for label 'LArCalorimeter' of field 'subdet' in dictionary "
486 std::cout <<
"Could not get value for label 'LArCalorimeter' of field 'subdet' in dictionary "
495 if (
dict()->get_label_value(
"part",
"LArEM", larEmField)) {
497 log << MSG::ERROR <<
"Could not get value for label 'LArEM' of field 'part' in dictionary "
502 std::cout <<
"Could not get value for label 'LArEM' of field 'part' in dictionary "
511 reg_id.
add(larField);
512 reg_id.
add(larEmField);
528 std::cout <<
" LArEM_Base_ID::initialize_from_dict : "
623 log << MSG::WARNING <<
"min > 255 "
630 std::cout <<
"min > 255 "
669 log << MSG::ERROR <<
"channel ranges, id, hash "
676 std::cout <<
" ***** Error ";
677 std::cout <<
"channel ranges, id, hash "
697 std::vector<IdentifierHash>& neighbourList)
const
701 neighbourList.clear();
706 log << MSG::WARNING <<
"neighbours not initialized !!! returning empty list" <<
endmsg;
709 std::cout <<
" WARNING: neighbours not initialized !!! returning empty list " << std::endl;
717 log << MSG::WARNING <<
"neighbours requested for non-existing channel -- id/max " <<
id <<
"/"
721 std::cout <<
" neighbours requested for non-existing channel -- id/max " <<
id <<
"/"
727 const short int maxNeighb=22;
729 int neighbourIndex = 0;
738 unsigned short int regionN = (itr -
m_cells.begin()) - 1;
745 unsigned int minHash = emRegion->
hashMin();
746 unsigned int maxHash = emRegion->
hashMax();
758 prevNeighbInPhi=neighbList[neighbourIndex-1];
773 nextNeighbInPhi=neighbList[neighbourIndex-1];
801 unsigned int index1=prevNeighbInPhi;
802 int oldNeighbourIndex = neighbourIndex;
808 if ( neighbourIndex > oldNeighbourIndex+1 ) {
809 neighbList[oldNeighbourIndex] = neighbList[neighbourIndex-1];
810 neighbourIndex = oldNeighbourIndex+1;
812 oldNeighbourIndex = neighbourIndex;
814 if ( neighbourIndex > oldNeighbourIndex+1 ) {
815 neighbList[oldNeighbourIndex] = neighbList[neighbourIndex-1];
816 neighbourIndex = oldNeighbourIndex+1;
821 unsigned int index2=nextNeighbInPhi;
822 int oldNeighbourIndex = neighbourIndex;
828 if ( neighbourIndex > oldNeighbourIndex+1 ) {
829 neighbourIndex = oldNeighbourIndex+1;
831 oldNeighbourIndex = neighbourIndex;
833 if ( neighbourIndex > oldNeighbourIndex+1 ) {
834 neighbourIndex = oldNeighbourIndex+1;
882 neighbourList.resize(neighbourIndex);
883 if (neighbourIndex > 0) {
884 if (neighbourIndex <= maxNeighb) {
885 std::copy (&neighbList[0], &neighbList[neighbourIndex], neighbourList.begin());
890 log << MSG::WARNING <<
" more than 22 neighbours for this cell, NONE will be retained" <<
endmsg;
893 std::cout <<
"WARNING: more than 22 neighbours for this cell, NONE will be retained " << neighbourIndex << std::endl;
906 unsigned int nIndex =
index-1;
910 neighbList[neighbourIndex] = nHash;
922 unsigned int nIndex =
index+1;
925 neighbList[neighbourIndex] = nHash;
933 const unsigned int& minHash,
934 int& neighbourIndex,
IdentifierHash* neighbList,
unsigned int& nBiggerCell)
const
938 unsigned int nIndex = 0;
949 unsigned int minHashMinus = prevEmRegion->
hashMin();
950 nIndex = minHashMinus +
index-minHash ;
952 neighbList[neighbourIndex] = nHash;
961 short int nPhiMinus = prevEmRegion->
phiN();
963 unsigned int maxHashMinus = prevEmRegion->
hashMax();
964 float phiMargin = 0.25*
std::min(gPhi,gPhiMinus);
965 float rPhi = (
index-minHash)*gPhi+emRegion->
phiMin();
966 int nPhiMinusFirst =
int(std::floor((rPhi -prevEmRegion->
phiMin())
967 /gPhiMinus+phiMargin))
968 +maxHashMinus-nPhiMinus;
969 int nPhiMinusNext =
int(std::floor((rPhi+gPhi-prevEmRegion->
phiMin())
970 /gPhiMinus+phiMargin))
971 +maxHashMinus-nPhiMinus;
972 if ( nPhiMinusNext == nPhiMinusFirst ) nPhiMinusNext++;
974 for(
int i=nPhiMinusFirst;
i<nPhiMinusNext;
i++){
976 if(nIndex != nBiggerCell) {
978 neighbList[neighbourIndex] = nHash;
983 if(gPhi < gPhiMinus && nBiggerCell ==
NOT_VALID_HASH) nBiggerCell=nIndex;
992 neighbList[neighbourIndex] = nHash;
1000 const unsigned int& maxHash,
1001 int& neighbourIndex,
IdentifierHash* neighbList,
unsigned int& nBiggerCell)
const
1005 unsigned int nIndex = 0;
1019 unsigned int minHashPlus = nextEmRegion->
hashMin();
1020 float phiMargin = 0.25*
std::min(gPhi,gPhiPlus);
1022 int nPhiPlusFirst =
int(std::floor((rPhi -nextEmRegion->
phiMin())
1023 /gPhiPlus+phiMargin))+minHashPlus;
1024 int nPhiPlusNext =
int(std::floor((rPhi+gPhi-nextEmRegion->
phiMin())
1025 /gPhiPlus+phiMargin))+minHashPlus;
1026 if ( nPhiPlusNext == nPhiPlusFirst ) nPhiPlusNext++;
1028 for(
int i=nPhiPlusFirst;
i<nPhiPlusNext;
i++){
1030 if(nIndex != nBiggerCell) {
1032 neighbList[neighbourIndex] = nHash;
1037 if(gPhi < gPhiPlus && nBiggerCell ==
NOT_VALID_HASH) nBiggerCell=nIndex;
1045 neighbList[neighbourIndex] = nHash;
1053 const double& gEta,
const float& gPhi,
const double&
absEta,
1059 unsigned int nIndex=0;
1065 int nPrevSampReg = prevSampRegion.size();
1066 if(nPrevSampReg > 0) {
1067 for(
int ireg=0; ireg<nPrevSampReg; ireg++) {
1074 double margin = 0.25*
std::min(gEta,gEtaMinus);
1075 if((minEtaMinus <
absEta+gEta-margin) && (
absEta+margin < maxEtaMinus)) {
1084 short int nPhiMinus = prevEmRegion->
phiN();
1086 unsigned int minHashMinus = prevEmRegion->
hashMin();
1087 float phiMargin = 0.25*
std::min(gPhi,gPhiMinus);
1090 int nPhiMinusFirst =
int(std::floor((rPhi -prevEmRegion->
phiMin())
1091 /gPhiMinus+phiMargin));
1092 int nPhiMinusNext =
int(std::floor((rPhi+gPhi-prevEmRegion->
phiMin())
1093 /gPhiMinus+phiMargin));
1094 if ( nPhiMinusNext == nPhiMinusFirst ) nPhiMinusNext++;
1097 double fEtaMinus = (
absEta-minEtaMinus) / gEtaMinus + margin ;
1099 double fEtaMaxMinus = (
absEta+gEta-minEtaMinus) / gEtaMinus + margin ;
1100 int nEtaMinus =
int(fEtaMinus);
1101 int nEtaMaxMinus =
int(fEtaMaxMinus);
1102 if ( nEtaMaxMinus == nEtaMinus ) nEtaMaxMinus++;
1103 for(
int i=nEtaMinus;
i<nEtaMaxMinus;
i++) {
1104 for (
int j=nPhiMinusFirst; j<nPhiMinusNext;j++) {
1105 nIndex = minHashMinus +
i * nPhiMinus + j;
1106 if( (nIndex >= prevEmRegion->
hashMin()) && (nIndex < prevEmRegion->hashMax()) ) {
1108 neighbList[neighbourIndex] = nHash;
1121 const double& gEta,
const float& gPhi,
const double&
absEta,
1127 unsigned int nIndex=0;
1132 int nNextSampReg = nextSampRegion.size();
1133 if(nNextSampReg > 0) {
1134 for(
int ireg=0; ireg<nNextSampReg; ireg++) {
1140 double margin = 0.25*
std::min(gEta,gEtaPlus);
1141 if((minEtaPlus <
absEta+gEta-margin) && (
absEta+margin < maxEtaPlus)) {
1147 short int nPhiPlus = nextEmRegion->
phiN();
1148 unsigned int minHashPlus = nextEmRegion->
hashMin();
1149 float phiMargin = 0.25*
std::min(gPhi,gPhiPlus);
1152 int nPhiPlusFirst =
int(std::floor((rPhi -nextEmRegion->
phiMin())
1153 /gPhiPlus+phiMargin));
1154 int nPhiPlusNext =
int(std::floor((rPhi+gPhi-nextEmRegion->
phiMin())
1155 /gPhiPlus+phiMargin));
1156 if ( nPhiPlusNext == nPhiPlusFirst ) nPhiPlusNext++;
1158 double fEtaPlus = (
absEta-minEtaPlus) / gEtaPlus + margin ;
1160 double fEtaMaxPlus = (
absEta+gEta-minEtaPlus) / gEtaPlus + margin ;
1161 int nEtaPlus =
int(fEtaPlus) ;
1162 int nEtaMaxPlus =
int(fEtaMaxPlus) ;
1163 if (nEtaMaxPlus == nEtaPlus) nEtaMaxPlus++;
1165 for(
int i=nEtaPlus;
i<nEtaMaxPlus;
i++){
1166 for(
int j=nPhiPlusFirst; j<nPhiPlusNext; j++){
1167 nIndex = minHashPlus +
i * nPhiPlus + j;
1168 if( (nIndex >= nextEmRegion->
hashMin()) && (nIndex < nextEmRegion->hashMax()) ) {
1170 neighbList[neighbourIndex] = nHash;
1184 const double& gEta,
const float& gPhi,
const double&
absEta,
1190 unsigned int nIndex=0;
1195 const std::vector<short int>& prevSubdetRegion= emRegion->
prevSubdetRegion();
1196 int nPrevSubdetReg = prevSubdetRegion.size();
1197 if(nPrevSubdetReg > 0) {
1198 for(
int ireg=0; ireg<nPrevSubdetReg; ireg++) {
1205 double margin = 0.25*
std::min(gEta,gEtaMinus);
1206 if((minEtaMinus <
absEta+gEta-margin) && (
absEta+margin < maxEtaMinus)) {
1215 short int nPhiMinus = prevEmRegion->
phiN();
1217 unsigned int minHashMinus = prevEmRegion->
hashMin();
1218 float phiMargin = 0.25*
std::min(gPhi,gPhiMinus);
1221 int nPhiMinusFirst =
int(std::floor((rPhi -prevEmRegion->
phiMin())
1222 /gPhiMinus+phiMargin));
1223 int nPhiMinusNext =
int(std::floor((rPhi+gPhi-prevEmRegion->
phiMin())
1224 /gPhiMinus+phiMargin));
1225 if ( nPhiMinusNext == nPhiMinusFirst ) nPhiMinusNext++;
1227 double fEtaMinus = (
absEta-minEtaMinus) / gEtaMinus + margin ;
1229 double fEtaMaxMinus = (
absEta+gEta-minEtaMinus) / gEtaMinus + margin ;
1230 int nEtaMinus =
int(fEtaMinus);
1231 int nEtaMaxMinus =
int(fEtaMaxMinus);
1232 if ( nEtaMaxMinus == nEtaMinus ) nEtaMaxMinus++;
1234 for(
int i=nEtaMinus;
i<nEtaMaxMinus;
i++) {
1235 for (
int j=nPhiMinusFirst; j<nPhiMinusNext;j++) {
1236 nIndex = minHashMinus +
i * nPhiMinus + j;
1237 if( (nIndex >= prevEmRegion->
hashMin()) && (nIndex < prevEmRegion->hashMax()) ) {
1239 neighbList[neighbourIndex] = nHash;
1252 const double& gEta,
const float& gPhi,
const double&
absEta,
1258 unsigned int nIndex=0;
1262 const std::vector<short int>& nextSubdetRegion= emRegion->
nextSubdetRegion();
1263 int nNextSubdetReg = nextSubdetRegion.size();
1264 if(nNextSubdetReg > 0) {
1265 for(
int ireg=0; ireg<nNextSubdetReg; ireg++) {
1271 double margin = 0.25*
std::min(gEta,gEtaPlus);
1272 if((minEtaPlus <
absEta+gEta-margin) && (
absEta+margin < maxEtaPlus)) {
1278 short int nPhiPlus = nextEmRegion->
phiN();
1279 unsigned int minHashPlus = nextEmRegion->
hashMin();
1280 float phiMargin = 0.25*
std::min(gPhi,gPhiPlus);
1283 int nPhiPlusFirst =
int(std::floor((rPhi -nextEmRegion->
phiMin())
1284 /gPhiPlus+phiMargin));
1285 int nPhiPlusNext =
int(std::floor((rPhi+gPhi-nextEmRegion->
phiMin())
1286 /gPhiPlus+phiMargin));
1287 if ( nPhiPlusNext == nPhiPlusFirst ) nPhiPlusNext++;
1289 double fEtaPlus = (
absEta-minEtaPlus) / gEtaPlus + margin ;
1291 double fEtaMaxPlus = (
absEta+gEta-minEtaPlus) / gEtaPlus + margin ;
1292 int nEtaPlus =
int(fEtaPlus) ;
1293 int nEtaMaxPlus =
int(fEtaMaxPlus) ;
1294 if (nEtaMaxPlus == nEtaPlus) nEtaMaxPlus++;
1296 for(
int i=nEtaPlus;
i<nEtaMaxPlus;
i++) {
1297 for(
int j=nPhiPlusFirst; j<nPhiPlusNext; j++) {
1298 nIndex = minHashPlus +
i * nPhiPlus + j;
1299 if( (nIndex >= nextEmRegion->
hashMin()) && (nIndex < nextEmRegion->hashMax()) ) {
1301 neighbList[neighbourIndex] = nHash;
1321 std::cout <<
" LArEM_Base_ID::init_neighbors " << std::endl;
1324 const std::vector<const IdDictRegion*>& vecOfDictRegions =
dictRegions();
1331 std::vector<Identifier>::const_iterator debut=
reg_begin() ;
1332 std::vector<Identifier>::const_iterator
fin =
reg_end() ;
1333 for (; debut !=
fin; ++debut) {
1337 bool isBarrelMiddle =
false;
1347 if(
etaMin >= 0 && phiMin >= 0) {
1353 log << MSG::ERROR <<
" LArId exception "
1354 << (std::string)except
1359 <<
" LArId exception "
1360 << (std::string)except
1369 log << MSG::WARNING <<
" could not find non negative etaMin and phiMin for region "
1374 std::cout <<
"WARNING !! could not find non negative etaMin and phiMin for region "
1393 unsigned int ireg0=0;
1410 IdDictRegion* prevEtaDicReg = vecOfDictRegions[reg]->m_prev_abs_eta;
1412 IdDictRegion* nextEtaDicReg = vecOfDictRegions[reg]->m_next_abs_eta;
1413 for(
unsigned int ireg=ireg0;ireg<ireg1;ireg++){
1414 if(vecOfDictRegions[ireg] == prevEtaDicReg) regForPrevEta = ireg;
1415 if(vecOfDictRegions[ireg] == nextEtaDicReg) regForNextEta = ireg;
1420 isBarrelMiddle =
true;
1422 regForPrevEta = reg+6;
1424 regForPrevEta = reg-6;
1432 std::vector<short int> regForPrevSamp;
1433 std::vector<IdDictRegion*> prevSampDicReg = vecOfDictRegions[reg]->m_prev_samp;
1434 for(
unsigned int isam=0;isam<prevSampDicReg.size();isam++){
1435 for(
unsigned int ireg=ireg0;ireg<ireg1;ireg++){
1436 if(vecOfDictRegions[ireg] == prevSampDicReg[isam]) regForPrevSamp.push_back(ireg);
1440 std::vector<short int> regForNextSamp;
1441 std::vector<IdDictRegion*> nextSampDicReg = vecOfDictRegions[reg]->m_next_samp;
1442 for(
unsigned int isam=0;isam<nextSampDicReg.size();isam++){
1443 for(
unsigned int ireg=ireg0;ireg<ireg1;ireg++){
1444 if(vecOfDictRegions[ireg] == nextSampDicReg[isam]) regForNextSamp.push_back(ireg);
1451 std::vector<short int> regForPrevSubdet;
1452 std::vector<IdDictRegion*> prevSubdetDicReg = vecOfDictRegions[reg]->m_prev_subdet;
1453 for(
unsigned int isubdet=0;isubdet<prevSubdetDicReg.size();isubdet++){
1454 for(
unsigned int ireg=ireg0;ireg<ireg1;ireg++){
1455 if(vecOfDictRegions[ireg] == prevSubdetDicReg[isubdet]) regForPrevSubdet.push_back(ireg);
1459 std::vector<short int> regForNextSubdet;
1460 std::vector<IdDictRegion*> nextSubdetDicReg = vecOfDictRegions[reg]->m_next_subdet;
1461 for(
unsigned int isubdet=0;isubdet<nextSubdetDicReg.size();isubdet++){
1462 for(
unsigned int ireg=ireg0;ireg<ireg1;ireg++){
1463 if(vecOfDictRegions[ireg] == nextSubdetDicReg[isubdet]) regForNextSubdet.push_back(ireg);
1472 regForPrevEta,regForNextEta,
1473 regForPrevSamp,regForNextSamp,
1474 regForPrevSubdet,regForNextSubdet);
1492 if(regId != lastRegId) {
1501 if ((
short int)hashReg != reg) {
1503 log << MSG::ERROR <<
" init_neighbors: problem reg, hashReg = " << reg <<
" " << hashReg
1507 std::cout <<
" init_neighbors: problem reg, hashReg = " << reg <<
" " << hashReg
JetConstituentVector::iterator iterator
int lar_em_field_value() const
Factor out code common between LArEM_ID and LArEM_SuperCell_ID.
#define CXXUTILS_TRAPPING_FP
int phi(const Identifier id) const
return phi according to :
const std::vector< short int > & prevSubdetRegion() const
region number of the prev region in subdet
MultiRange build_multirange() const
Get MultiRange for full dictionary.
IdDictFieldImplementation m_eta_impl
int phi_max(const Identifier regId) const
max value of phi index (-999 == failure)
id_iterator reg_end(void) const
end iterator over set of Region Identifiers
bool isEtaMin(unsigned int index) const
is the considered cell in the first eta bin of the region ?
Scalar phi() const
phi method
int phi_min_init(const Identifier regId) const
float phiMin() const
starting phi
const std::vector< short int > & nextSubdetRegion() const
region number of the next region in subdet
std::string show_to_string(void) const
size_type channel_hash_max() const
One more than the largest channel (cell) hash code.
IdDictFieldImplementation m_slar_impl
Scalar eta() const
pseudorapidity method
int fill_vec_of_dict_regions(const std::string &group_name="")
Initialize the list of detector regions.
element_type get_minimum() const
Query the values.
bool isPhiMin(unsigned int index) const
is the considered cell in the first phi bin of the region ?
Identifier region_id(const ExpandedIdentifier &exp_id) const
Build a cell identifier from an expanded identifier.
size_type end_index() const
IdContext region_context() const
Return the context for regions.
void add(element_type value)
Append a value into a new field.
std::vector< LArEM_region * > m_vecOfRegions
int region(const Identifier id) const
return region according to :
int sampling(const Identifier id) const
return sampling according to :
int get_nextInSubdet(const LArEM_region *emRegion, const unsigned int &index, const short int &nPhi, const unsigned int &minHash, const double &gEta, const float &gPhi, const double &absEta, int &neighbourIndex, IdentifierHash *neighbList) const
IMessageSvc * m_msgSvc
pointer to the message service
element_type get_maximum() const
bool m_do_checks
Flag for subclasses to know whether or not to perform checks.
float etaMax() const
end eta
int lar_field_value() const
int unpack(Identifier id) const
Identifier manipulation methods.
Identifier channel_id(const ExpandedIdentifier &exp_id) const
Build a cell identifier from an expanded identifier.
IdDictFieldImplementation m_em_impl
virtual int get_expanded_id(const Identifier &id, ExpandedIdentifier &exp_id, const IdContext *context) const
create expanded Identifier from Identifier (return == 0 for OK)
constexpr int nPhi
Default bin number of phi for vertex map.
IdDictField * find_field(const std::string &name) const
const HashGroup & regions() const
Return the HashGroup for regions.
virtual std::string dictionaryVersion(void) const override
int eta(const Identifier id) const
return eta according to :
int get_nextInSamp(const LArEM_region *emRegion, const unsigned int &index, const short int &nPhi, const unsigned int &minHash, const double &gEta, const float &gPhi, const double &absEta, int &neighbourIndex, IdentifierHash *neighbList) const
bool m_do_neighbours
Flag for subclasses to know whether or not to perform neighbour initialization.
int initLevelsFromDict(const std::string &group_name)
int get_prevInSamp(const LArEM_region *emRegion, const unsigned int &index, const short int &nPhi, const unsigned int &minHash, const double &gEta, const float &gPhi, const double &absEta, int &neighbourIndex, IdentifierHash *neighbList) const
IdDictFieldImplementation m_sampling_impl
MultiRange m_full_em_range
IdDictFieldImplementation m_phi_impl
This class provides an interface to deal with regions in the neighbours finding
int eta_max(const Identifier regId) const
max value of eta index (-999 == failure)
IdDictFieldImplementation m_region_impl
IdentifierHash channel_hash(Identifier channelId) const
create hash id from channel id
IdDictGroup * find_group(const std::string &group_name) const
IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
size_type region_hash_max() const
One more than the largest region hash code.
small class holding the starting hash value, the min eta and the number of phi bins of each region
double deltaEta(const I4Momentum &p1, const I4Momentum &p2)
Computes efficiently .
float phiGranularity() const
phi granularity
float etaGranularity(const IdentifierHash regHash) const
Return the eta granularity of a region, or NOT_VALID.
int phi_min(const Identifier regId) const
min value of phi index (-999 == failure)
void set_bits(size_type bits, size_type bits_offset)
const IdDictDictionary * dict() const
Return the dictionary for this subdetector.
Base class to factor out code common among Calo ID helpers.
IdDictFieldImplementation m_bec_reg_impl
MultiRange m_full_region_range
bool isEtaMax(unsigned int index) const
is the considered cell in the last eta bin of the region ?
size_type m_SAMPLING_INDEX
bool twoSymSides() const
True if the + and - sides of the calorimeter are identical (true layout).
size_type bits_offset() const
std::vector< IdDictRegion * > m_regions
float etaMin() const
starting eta
IdDictFieldImplementation m_lar_impl
unsigned int hashMax() const
hash Id of the last cell of the region +1
short int phiN() const
number of phi bins
IdDictFieldImplementation m_bec_impl
const std::vector< short int > & prevSamplingRegion() const
region number of the prev region in sampling
bool m_quiet
If true, suppress DEBUG/INFO messages.
static int get_prevInPhi(const LArEM_region *emRegion, const unsigned int &index, const short int &nPhi, const unsigned int &minHash, int &neighbourIndex, IdentifierHash *neighbList)
int eta_min(const Identifier regId) const
min value of eta index (-999 == failure)
static int get_nextInPhi(const LArEM_region *emRegion, const unsigned int &index, const short int &nPhi, const unsigned int &minHash, int &neighbourIndex, IdentifierHash *neighbList)
int initialize_base_from_dictionary(const IdDictMgr &dict_mgr, const std::string &dict_name)
Do basic initialization of the helper.
void region_id_checks(int barrel_ec, int sampling, int region) const
Tell the compiler to optimize assuming that FP may trap.
int get_label_value(const std::string &field, const std::string &label, int &value) const
std::string strformat(const char *fmt,...)
return a std::string according to a format fmt and varargs
float eta0(const IdentifierHash regHash) const
Return the minimum eta of region, or NOT_VALID.
std::vector< unsigned > m_cells
int get_neighbours(const IdentifierHash id, const LArNeighbours::neighbourOption &option, std::vector< IdentifierHash > &neighbourList) const
access to hashes for neighbours return == 0 for neighbours found option = prevInPhi,...
int barrel_ec(const Identifier id) const
return barrel_ec according to :
virtual void setDictVersion(const IdDictMgr &dict_mgr, const std::string &name) override
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
int get_prevInEta(const LArEM_region *emRegion, const unsigned int &index, const short int &nPhi, const float &gPhi, const unsigned int &minHash, int &neighbourIndex, IdentifierHash *neighbList, unsigned int &nBiggerCell) const
bool isFirstBarrelRegion() const
true if region close to barrel middle
def init(v_theApp, v_rootStream=None)
short int nextEtaRegion() const
region number of the next region in eta
const HashGroup & channels() const
Return the HashGroup for channels (cells).
int match(const ExpandedIdentifier &id) const
Match an identifier.
bool reinitialize(const IdDictMgr &dict_mgr)
Test whether an idhelper should be reinitialized based on the change of tags.
float etaGranularity() const
eta granularity
float phi0(const IdentifierHash regHash) const
Return the minimum phi of region, or NOT_VALID.
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
const std::vector< const IdDictRegion * > & dictRegions() const
Return the vector of IdDictRegion, accessed via region hash.
int get_prevInSubdet(const LArEM_region *emRegion, const unsigned int &index, const short int &nPhi, const unsigned int &minHash, const double &gEta, const float &gPhi, const double &absEta, int &neighbourIndex, IdentifierHash *neighbList) const
This is the individual specification for the range of one ExpandedIdentifier IdentifierField.
bool absEta(const xAOD::TauJet &tau, double &out)
void clear()
Erase all fields.
size_type m_em_region_index
int get_nextInEta(const LArEM_region *emRegion, const unsigned int &index, const short int &nPhi, const float &gPhi, const unsigned int &maxHash, int &neighbourIndex, IdentifierHash *neighbList, unsigned int &nBiggerCell) const
int initialize_base_from_dictionary(const IdDictMgr &dict_mgr, const std::string &group_name)
initialization from the identifier dictionary
short int prevEtaRegion() const
region number of the previous region in eta
float phiGranularity(const IdentifierHash regHash) const
Return the phi granularity of a region, or NOT_VALID.
void channel_id_checks(int barrel_ec, int sampling, int region, int eta, int phi) const
This is a "hash" representation of an Identifier. This encodes a 32 bit index which can be used to lo...
id_range em_range() const
Range over full set of EM Identifiers.
id_iterator reg_begin(void) const
begin iterator over set of Region Identifiers
constexpr int nEta
Default bin number of eta for vertex map.
std::vector< int > m_vecOfPhiMin
bool isPhiMax(unsigned int index) const
is the considered cell in the last phi bin of the region ?
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
IdentifierHash region_hash(Identifier regionId) const
Convert a connected region Identifier to a hash code.
const std::vector< short int > & nextSamplingRegion() const
region number of the next region in sampling
ExpandedIdentifier lar_em_exp(void) const
LAr.
Exception class for LAr Identifiers.
unsigned int hashMin() const
hash Id of the first cell of the region
IdentifierHash channel_hash_binary_search(Identifier channelId) const
create hash id from channel id – method NOT optimised, please use channel_hash() above
bool is_supercell(const Identifier id) const
Test if the identifier represents a supercell.
Identifier::size_type size_type
LArEM_Base_ID(const std::string &name, bool supercell)
Constructor.
size_type hash_max() const
Return one more than the largest hash code.
std::vector< HashCalc > m_hash_calcs