Loading [MathJax]/extensions/tex2jax.js
 |
ATLAS Offline Software
|
Go to the documentation of this file.
24 m_slar (supercell ? 1 : 0)
50 if (
range.match(expId)) {
52 if (not eta_field.
empty()) {
76 if (
range.match(expId)) {
78 if (not eta_field.
empty()) {
97 if (
range.match(expId)) {
99 if (not phi_field.
empty()) {
123 if (
range.match(expId)) {
125 if (not phi_field.
empty()) {
145 std::string errorMessage =
"LArEM_Base_ID::region_id_checks() result is not OK: ID, range = "
162 std::string errorMessage =
"LArEM_Base_ID::channel_id_checks() result is not OK: ID, range = "
178 std::string errorMessage =
"LArEM_Base_ID::channel_id_checks(regId) result is not OK: ID = "
186 std::string errorMessage =
"LArEM_Base_ID::channel_id_checks(regId) result is not OK: ID, range = "
221 log << MSG::ERROR <<
"initLevelsFromDict - dictionary NOT initialized "
225 std::cout <<
"LArEM_Base_ID::initLevelsFromDict - dictionary NOT initialized "
249 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'subdet' field "
253 std::cout <<
"LArEM_Base_ID::initLevelsFromDict - unable to find 'subdet' field "
265 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'part' field "
269 std::cout <<
"LArEM_Base_ID::initLevelsFromDict - unable to find 'part' field "
281 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'barrel-endcap' field "
285 std::cout <<
"LArEM_Base_ID::initLevelsFromDict - unable to find 'barrel-endcap' field "
297 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'sampling' field "
301 std::cout <<
"LArEM_Base_ID::initLevelsFromDict - unable to find 'sampling' field "
313 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'region' field "
317 std::cout <<
"LArEM_Base_ID::initLevelsFromDict - unable to find 'region' field "
329 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'eta' field "
333 std::cout <<
"LArEM_Base_ID::initLevelsFromDict - unable to find 'eta' field "
345 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'phi' field "
349 std::cout <<
"LArEM_Base_ID::initLevelsFromDict - unable to find 'phi' field "
361 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'is-slar' field "
365 std::cout <<
"LArEM_Base_ID::initLevelsFromDict - unable to find 'is-slar' field "
375 log << MSG::ERROR <<
"initLevelsFromDict - cannot find " <<
group_name
376 <<
" group' field " <<
endmsg;
405 std::cout <<
"decode index and bit fields for each level: " << std::endl;
448 log <<
MSG::DEBUG <<
"Request to reinitialize not satisfied - tags have not changed" <<
endmsg;
469 if (atlasDict->
get_label_value(
"subdet",
"LArCalorimeter", larField)) {
471 log << MSG::ERROR <<
"Could not get value for label 'LArCalorimeter' of field 'subdet' in dictionary "
476 std::cout <<
"Could not get value for label 'LArCalorimeter' of field 'subdet' in dictionary "
485 if (
dict()->get_label_value(
"part",
"LArEM", larEmField)) {
487 log << MSG::ERROR <<
"Could not get value for label 'LArEM' of field 'part' in dictionary "
492 std::cout <<
"Could not get value for label 'LArEM' of field 'part' in dictionary "
501 reg_id.
add(larField);
502 reg_id.
add(larEmField);
518 std::cout <<
" LArEM_Base_ID::initialize_from_dict : "
613 log << MSG::WARNING <<
"min > 255 "
620 std::cout <<
"min > 255 "
659 log << MSG::ERROR <<
"channel ranges, id, hash "
666 std::cout <<
" ***** Error ";
667 std::cout <<
"channel ranges, id, hash "
687 std::vector<IdentifierHash>& neighbourList)
const
691 neighbourList.clear();
696 log << MSG::WARNING <<
"neighbours not initialized !!! returning empty list" <<
endmsg;
699 std::cout <<
" WARNING: neighbours not initialized !!! returning empty list " << std::endl;
707 log << MSG::WARNING <<
"neighbours requested for non-existing channel -- id/max " <<
id <<
"/"
711 std::cout <<
" neighbours requested for non-existing channel -- id/max " <<
id <<
"/"
717 const short int maxNeighb=22;
719 int neighbourIndex = 0;
728 unsigned short int regionN = (itr -
m_cells.begin()) - 1;
735 unsigned int minHash = emRegion->
hashMin();
736 unsigned int maxHash = emRegion->
hashMax();
748 prevNeighbInPhi=neighbList[neighbourIndex-1];
763 nextNeighbInPhi=neighbList[neighbourIndex-1];
791 unsigned int index1=prevNeighbInPhi;
792 int oldNeighbourIndex = neighbourIndex;
798 if ( neighbourIndex > oldNeighbourIndex+1 ) {
799 neighbList[oldNeighbourIndex] = neighbList[neighbourIndex-1];
800 neighbourIndex = oldNeighbourIndex+1;
802 oldNeighbourIndex = neighbourIndex;
804 if ( neighbourIndex > oldNeighbourIndex+1 ) {
805 neighbList[oldNeighbourIndex] = neighbList[neighbourIndex-1];
806 neighbourIndex = oldNeighbourIndex+1;
811 unsigned int index2=nextNeighbInPhi;
812 int oldNeighbourIndex = neighbourIndex;
818 if ( neighbourIndex > oldNeighbourIndex+1 ) {
819 neighbourIndex = oldNeighbourIndex+1;
821 oldNeighbourIndex = neighbourIndex;
823 if ( neighbourIndex > oldNeighbourIndex+1 ) {
824 neighbourIndex = oldNeighbourIndex+1;
872 neighbourList.resize(neighbourIndex);
873 if (neighbourIndex > 0) {
874 if (neighbourIndex <= maxNeighb) {
875 std::copy (&neighbList[0], &neighbList[neighbourIndex], neighbourList.begin());
880 log << MSG::WARNING <<
" more than 22 neighbours for this cell, NONE will be retained" <<
endmsg;
883 std::cout <<
"WARNING: more than 22 neighbours for this cell, NONE will be retained " << neighbourIndex << std::endl;
896 unsigned int nIndex =
index-1;
900 neighbList[neighbourIndex] = nHash;
912 unsigned int nIndex =
index+1;
915 neighbList[neighbourIndex] = nHash;
923 const unsigned int& minHash,
924 int& neighbourIndex,
IdentifierHash* neighbList,
unsigned int& nBiggerCell)
const
928 unsigned int nIndex = 0;
939 unsigned int minHashMinus = prevEmRegion->
hashMin();
940 nIndex = minHashMinus +
index-minHash ;
942 neighbList[neighbourIndex] = nHash;
951 short int nPhiMinus = prevEmRegion->
phiN();
953 unsigned int maxHashMinus = prevEmRegion->
hashMax();
954 float phiMargin = 0.25*
std::min(gPhi,gPhiMinus);
955 float rPhi = (
index-minHash)*gPhi+emRegion->
phiMin();
956 int nPhiMinusFirst =
int(std::floor((rPhi -prevEmRegion->
phiMin())
957 /gPhiMinus+phiMargin))
958 +maxHashMinus-nPhiMinus;
959 int nPhiMinusNext =
int(std::floor((rPhi+gPhi-prevEmRegion->
phiMin())
960 /gPhiMinus+phiMargin))
961 +maxHashMinus-nPhiMinus;
962 if ( nPhiMinusNext == nPhiMinusFirst ) nPhiMinusNext++;
964 for(
int i=nPhiMinusFirst;
i<nPhiMinusNext;
i++){
966 if(nIndex != nBiggerCell) {
968 neighbList[neighbourIndex] = nHash;
973 if(gPhi < gPhiMinus && nBiggerCell ==
NOT_VALID_HASH) nBiggerCell=nIndex;
982 neighbList[neighbourIndex] = nHash;
990 const unsigned int& maxHash,
991 int& neighbourIndex,
IdentifierHash* neighbList,
unsigned int& nBiggerCell)
const
995 unsigned int nIndex = 0;
1009 unsigned int minHashPlus = nextEmRegion->
hashMin();
1010 float phiMargin = 0.25*
std::min(gPhi,gPhiPlus);
1012 int nPhiPlusFirst =
int(std::floor((rPhi -nextEmRegion->
phiMin())
1013 /gPhiPlus+phiMargin))+minHashPlus;
1014 int nPhiPlusNext =
int(std::floor((rPhi+gPhi-nextEmRegion->
phiMin())
1015 /gPhiPlus+phiMargin))+minHashPlus;
1016 if ( nPhiPlusNext == nPhiPlusFirst ) nPhiPlusNext++;
1018 for(
int i=nPhiPlusFirst;
i<nPhiPlusNext;
i++){
1020 if(nIndex != nBiggerCell) {
1022 neighbList[neighbourIndex] = nHash;
1027 if(gPhi < gPhiPlus && nBiggerCell ==
NOT_VALID_HASH) nBiggerCell=nIndex;
1035 neighbList[neighbourIndex] = nHash;
1043 const double& gEta,
const float& gPhi,
const double&
absEta,
1049 unsigned int nIndex=0;
1055 int nPrevSampReg = prevSampRegion.size();
1056 if(nPrevSampReg > 0) {
1057 for(
int ireg=0; ireg<nPrevSampReg; ireg++) {
1064 double margin = 0.25*
std::min(gEta,gEtaMinus);
1065 if((minEtaMinus <
absEta+gEta-margin) && (
absEta+margin < maxEtaMinus)) {
1074 short int nPhiMinus = prevEmRegion->
phiN();
1076 unsigned int minHashMinus = prevEmRegion->
hashMin();
1077 float phiMargin = 0.25*
std::min(gPhi,gPhiMinus);
1080 int nPhiMinusFirst =
int(std::floor((rPhi -prevEmRegion->
phiMin())
1081 /gPhiMinus+phiMargin));
1082 int nPhiMinusNext =
int(std::floor((rPhi+gPhi-prevEmRegion->
phiMin())
1083 /gPhiMinus+phiMargin));
1084 if ( nPhiMinusNext == nPhiMinusFirst ) nPhiMinusNext++;
1087 double fEtaMinus = (
absEta-minEtaMinus) / gEtaMinus + margin ;
1089 double fEtaMaxMinus = (
absEta+gEta-minEtaMinus) / gEtaMinus + margin ;
1090 int nEtaMinus =
int(fEtaMinus);
1091 int nEtaMaxMinus =
int(fEtaMaxMinus);
1092 if ( nEtaMaxMinus == nEtaMinus ) nEtaMaxMinus++;
1093 for(
int i=nEtaMinus;
i<nEtaMaxMinus;
i++) {
1094 for (
int j=nPhiMinusFirst; j<nPhiMinusNext;j++) {
1095 nIndex = minHashMinus +
i * nPhiMinus + j;
1096 if( (nIndex >= prevEmRegion->
hashMin()) && (nIndex < prevEmRegion->hashMax()) ) {
1098 neighbList[neighbourIndex] = nHash;
1111 const double& gEta,
const float& gPhi,
const double&
absEta,
1117 unsigned int nIndex=0;
1122 int nNextSampReg = nextSampRegion.size();
1123 if(nNextSampReg > 0) {
1124 for(
int ireg=0; ireg<nNextSampReg; ireg++) {
1130 double margin = 0.25*
std::min(gEta,gEtaPlus);
1131 if((minEtaPlus <
absEta+gEta-margin) && (
absEta+margin < maxEtaPlus)) {
1137 short int nPhiPlus = nextEmRegion->
phiN();
1138 unsigned int minHashPlus = nextEmRegion->
hashMin();
1139 float phiMargin = 0.25*
std::min(gPhi,gPhiPlus);
1142 int nPhiPlusFirst =
int(std::floor((rPhi -nextEmRegion->
phiMin())
1143 /gPhiPlus+phiMargin));
1144 int nPhiPlusNext =
int(std::floor((rPhi+gPhi-nextEmRegion->
phiMin())
1145 /gPhiPlus+phiMargin));
1146 if ( nPhiPlusNext == nPhiPlusFirst ) nPhiPlusNext++;
1148 double fEtaPlus = (
absEta-minEtaPlus) / gEtaPlus + margin ;
1150 double fEtaMaxPlus = (
absEta+gEta-minEtaPlus) / gEtaPlus + margin ;
1151 int nEtaPlus =
int(fEtaPlus) ;
1152 int nEtaMaxPlus =
int(fEtaMaxPlus) ;
1153 if (nEtaMaxPlus == nEtaPlus) nEtaMaxPlus++;
1155 for(
int i=nEtaPlus;
i<nEtaMaxPlus;
i++){
1156 for(
int j=nPhiPlusFirst; j<nPhiPlusNext; j++){
1157 nIndex = minHashPlus +
i * nPhiPlus + j;
1158 if( (nIndex >= nextEmRegion->
hashMin()) && (nIndex < nextEmRegion->hashMax()) ) {
1160 neighbList[neighbourIndex] = nHash;
1174 const double& gEta,
const float& gPhi,
const double&
absEta,
1180 unsigned int nIndex=0;
1185 const std::vector<short int>& prevSubdetRegion= emRegion->
prevSubdetRegion();
1186 int nPrevSubdetReg = prevSubdetRegion.size();
1187 if(nPrevSubdetReg > 0) {
1188 for(
int ireg=0; ireg<nPrevSubdetReg; ireg++) {
1195 double margin = 0.25*
std::min(gEta,gEtaMinus);
1196 if((minEtaMinus <
absEta+gEta-margin) && (
absEta+margin < maxEtaMinus)) {
1205 short int nPhiMinus = prevEmRegion->
phiN();
1207 unsigned int minHashMinus = prevEmRegion->
hashMin();
1208 float phiMargin = 0.25*
std::min(gPhi,gPhiMinus);
1211 int nPhiMinusFirst =
int(std::floor((rPhi -prevEmRegion->
phiMin())
1212 /gPhiMinus+phiMargin));
1213 int nPhiMinusNext =
int(std::floor((rPhi+gPhi-prevEmRegion->
phiMin())
1214 /gPhiMinus+phiMargin));
1215 if ( nPhiMinusNext == nPhiMinusFirst ) nPhiMinusNext++;
1217 double fEtaMinus = (
absEta-minEtaMinus) / gEtaMinus + margin ;
1219 double fEtaMaxMinus = (
absEta+gEta-minEtaMinus) / gEtaMinus + margin ;
1220 int nEtaMinus =
int(fEtaMinus);
1221 int nEtaMaxMinus =
int(fEtaMaxMinus);
1222 if ( nEtaMaxMinus == nEtaMinus ) nEtaMaxMinus++;
1224 for(
int i=nEtaMinus;
i<nEtaMaxMinus;
i++) {
1225 for (
int j=nPhiMinusFirst; j<nPhiMinusNext;j++) {
1226 nIndex = minHashMinus +
i * nPhiMinus + j;
1227 if( (nIndex >= prevEmRegion->
hashMin()) && (nIndex < prevEmRegion->hashMax()) ) {
1229 neighbList[neighbourIndex] = nHash;
1242 const double& gEta,
const float& gPhi,
const double&
absEta,
1248 unsigned int nIndex=0;
1252 const std::vector<short int>& nextSubdetRegion= emRegion->
nextSubdetRegion();
1253 int nNextSubdetReg = nextSubdetRegion.size();
1254 if(nNextSubdetReg > 0) {
1255 for(
int ireg=0; ireg<nNextSubdetReg; ireg++) {
1261 double margin = 0.25*
std::min(gEta,gEtaPlus);
1262 if((minEtaPlus <
absEta+gEta-margin) && (
absEta+margin < maxEtaPlus)) {
1268 short int nPhiPlus = nextEmRegion->
phiN();
1269 unsigned int minHashPlus = nextEmRegion->
hashMin();
1270 float phiMargin = 0.25*
std::min(gPhi,gPhiPlus);
1273 int nPhiPlusFirst =
int(std::floor((rPhi -nextEmRegion->
phiMin())
1274 /gPhiPlus+phiMargin));
1275 int nPhiPlusNext =
int(std::floor((rPhi+gPhi-nextEmRegion->
phiMin())
1276 /gPhiPlus+phiMargin));
1277 if ( nPhiPlusNext == nPhiPlusFirst ) nPhiPlusNext++;
1279 double fEtaPlus = (
absEta-minEtaPlus) / gEtaPlus + margin ;
1281 double fEtaMaxPlus = (
absEta+gEta-minEtaPlus) / gEtaPlus + margin ;
1282 int nEtaPlus =
int(fEtaPlus) ;
1283 int nEtaMaxPlus =
int(fEtaMaxPlus) ;
1284 if (nEtaMaxPlus == nEtaPlus) nEtaMaxPlus++;
1286 for(
int i=nEtaPlus;
i<nEtaMaxPlus;
i++) {
1287 for(
int j=nPhiPlusFirst; j<nPhiPlusNext; j++) {
1288 nIndex = minHashPlus +
i * nPhiPlus + j;
1289 if( (nIndex >= nextEmRegion->
hashMin()) && (nIndex < nextEmRegion->hashMax()) ) {
1291 neighbList[neighbourIndex] = nHash;
1311 std::cout <<
" LArEM_Base_ID::init_neighbors " << std::endl;
1314 const std::vector<const IdDictRegion*>& vecOfDictRegions =
dictRegions();
1321 std::vector<Identifier>::const_iterator debut=
reg_begin() ;
1322 std::vector<Identifier>::const_iterator
fin =
reg_end() ;
1323 for (; debut !=
fin; ++debut) {
1327 bool isBarrelMiddle =
false;
1337 if(
etaMin >= 0 && phiMin >= 0) {
1343 log << MSG::ERROR <<
" LArId exception "
1344 << (std::string)except
1349 <<
" LArId exception "
1350 << (std::string)except
1359 log << MSG::WARNING <<
" could not find non negative etaMin and phiMin for region "
1364 std::cout <<
"WARNING !! could not find non negative etaMin and phiMin for region "
1383 unsigned int ireg0=0;
1400 IdDictRegion* prevEtaDicReg = vecOfDictRegions[reg]->m_prev_abs_eta;
1402 IdDictRegion* nextEtaDicReg = vecOfDictRegions[reg]->m_next_abs_eta;
1403 for(
unsigned int ireg=ireg0;ireg<ireg1;ireg++){
1404 if(vecOfDictRegions[ireg] == prevEtaDicReg) regForPrevEta = ireg;
1405 if(vecOfDictRegions[ireg] == nextEtaDicReg) regForNextEta = ireg;
1410 isBarrelMiddle =
true;
1412 regForPrevEta = reg+6;
1414 regForPrevEta = reg-6;
1422 std::vector<short int> regForPrevSamp;
1423 std::vector<IdDictRegion*> prevSampDicReg = vecOfDictRegions[reg]->m_prev_samp;
1424 for(
unsigned int isam=0;isam<prevSampDicReg.size();isam++){
1425 for(
unsigned int ireg=ireg0;ireg<ireg1;ireg++){
1426 if(vecOfDictRegions[ireg] == prevSampDicReg[isam]) regForPrevSamp.push_back(ireg);
1430 std::vector<short int> regForNextSamp;
1431 std::vector<IdDictRegion*> nextSampDicReg = vecOfDictRegions[reg]->m_next_samp;
1432 for(
unsigned int isam=0;isam<nextSampDicReg.size();isam++){
1433 for(
unsigned int ireg=ireg0;ireg<ireg1;ireg++){
1434 if(vecOfDictRegions[ireg] == nextSampDicReg[isam]) regForNextSamp.push_back(ireg);
1441 std::vector<short int> regForPrevSubdet;
1442 std::vector<IdDictRegion*> prevSubdetDicReg = vecOfDictRegions[reg]->m_prev_subdet;
1443 for(
unsigned int isubdet=0;isubdet<prevSubdetDicReg.size();isubdet++){
1444 for(
unsigned int ireg=ireg0;ireg<ireg1;ireg++){
1445 if(vecOfDictRegions[ireg] == prevSubdetDicReg[isubdet]) regForPrevSubdet.push_back(ireg);
1449 std::vector<short int> regForNextSubdet;
1450 std::vector<IdDictRegion*> nextSubdetDicReg = vecOfDictRegions[reg]->m_next_subdet;
1451 for(
unsigned int isubdet=0;isubdet<nextSubdetDicReg.size();isubdet++){
1452 for(
unsigned int ireg=ireg0;ireg<ireg1;ireg++){
1453 if(vecOfDictRegions[ireg] == nextSubdetDicReg[isubdet]) regForNextSubdet.push_back(ireg);
1462 regForPrevEta,regForNextEta,
1463 regForPrevSamp,regForNextSamp,
1464 regForPrevSubdet,regForNextSubdet);
1482 if(regId != lastRegId) {
1491 if ((
short int)hashReg != reg) {
1493 log << MSG::ERROR <<
" init_neighbors: problem reg, hashReg = " << reg <<
" " << hashReg
1497 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