 |
ATLAS Offline Software
|
Go to the documentation of this file.
23 const std::string&
group,
26 m_slar (supercell ? 1 : 0)
52 if (
range.match(expId)) {
54 if (not eta_field.
empty()) {
78 if (
range.match(expId)) {
80 if (not eta_field.
empty()) {
99 if (
range.match(expId)) {
101 if (not phi_field.
empty()) {
125 if (
range.match(expId)) {
127 if (not phi_field.
empty()) {
147 std::string errorMessage =
"LArEM_Base_ID::region_id_checks() result is not OK: ID, range = "
164 std::string errorMessage =
"LArEM_Base_ID::channel_id_checks() result is not OK: ID, range = "
180 std::string errorMessage =
"LArEM_Base_ID::channel_id_checks(regId) result is not OK: ID = "
188 std::string errorMessage =
"LArEM_Base_ID::channel_id_checks(regId) result is not OK: ID, range = "
223 log << MSG::ERROR <<
"initLevelsFromDict - dictionary NOT initialized "
227 std::cout <<
"LArEM_Base_ID::initLevelsFromDict - dictionary NOT initialized "
251 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'subdet' field "
255 std::cout <<
"LArEM_Base_ID::initLevelsFromDict - unable to find 'subdet' field "
267 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'part' field "
271 std::cout <<
"LArEM_Base_ID::initLevelsFromDict - unable to find 'part' field "
283 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'barrel-endcap' field "
287 std::cout <<
"LArEM_Base_ID::initLevelsFromDict - unable to find 'barrel-endcap' field "
299 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'sampling' field "
303 std::cout <<
"LArEM_Base_ID::initLevelsFromDict - unable to find 'sampling' field "
315 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'region' field "
319 std::cout <<
"LArEM_Base_ID::initLevelsFromDict - unable to find 'region' field "
331 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'eta' field "
335 std::cout <<
"LArEM_Base_ID::initLevelsFromDict - unable to find 'eta' field "
347 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'phi' field "
351 std::cout <<
"LArEM_Base_ID::initLevelsFromDict - unable to find 'phi' field "
363 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'is-slar' field "
367 std::cout <<
"LArEM_Base_ID::initLevelsFromDict - unable to find 'is-slar' field "
377 log << MSG::ERROR <<
"initLevelsFromDict - cannot find " <<
group_name
378 <<
" group' field " <<
endmsg;
407 std::cout <<
"decode index and bit fields for each level: " << std::endl;
450 log <<
MSG::DEBUG <<
"Request to reinitialize not satisfied - tags have not changed" <<
endmsg;
471 if (atlasDict->
get_label_value(
"subdet",
"LArCalorimeter", larField)) {
473 log << MSG::ERROR <<
"Could not get value for label 'LArCalorimeter' of field 'subdet' in dictionary "
478 std::cout <<
"Could not get value for label 'LArCalorimeter' of field 'subdet' in dictionary "
487 if (
dict()->get_label_value(
"part",
"LArEM", larEmField)) {
489 log << MSG::ERROR <<
"Could not get value for label 'LArEM' of field 'part' in dictionary "
494 std::cout <<
"Could not get value for label 'LArEM' of field 'part' in dictionary "
503 reg_id.
add(larField);
504 reg_id.
add(larEmField);
520 std::cout <<
" LArEM_Base_ID::initialize_from_dict : "
615 log << MSG::WARNING <<
"min > 255 "
622 std::cout <<
"min > 255 "
661 log << MSG::ERROR <<
"channel ranges, id, hash "
668 std::cout <<
" ***** Error ";
669 std::cout <<
"channel ranges, id, hash "
689 std::vector<IdentifierHash>& neighbourList)
const
693 neighbourList.clear();
698 log << MSG::WARNING <<
"neighbours not initialized !!! returning empty list" <<
endmsg;
701 std::cout <<
" WARNING: neighbours not initialized !!! returning empty list " << std::endl;
709 log << MSG::WARNING <<
"neighbours requested for non-existing channel -- id/max " <<
id <<
"/"
713 std::cout <<
" neighbours requested for non-existing channel -- id/max " <<
id <<
"/"
719 const short int maxNeighb=22;
721 int neighbourIndex = 0;
730 unsigned short int regionN = (itr -
m_cells.begin()) - 1;
737 unsigned int minHash = emRegion->
hashMin();
738 unsigned int maxHash = emRegion->
hashMax();
750 prevNeighbInPhi=neighbList[neighbourIndex-1];
765 nextNeighbInPhi=neighbList[neighbourIndex-1];
793 unsigned int index1=prevNeighbInPhi;
794 int oldNeighbourIndex = neighbourIndex;
800 if ( neighbourIndex > oldNeighbourIndex+1 ) {
801 neighbList[oldNeighbourIndex] = neighbList[neighbourIndex-1];
802 neighbourIndex = oldNeighbourIndex+1;
804 oldNeighbourIndex = neighbourIndex;
806 if ( neighbourIndex > oldNeighbourIndex+1 ) {
807 neighbList[oldNeighbourIndex] = neighbList[neighbourIndex-1];
808 neighbourIndex = oldNeighbourIndex+1;
813 unsigned int index2=nextNeighbInPhi;
814 int oldNeighbourIndex = neighbourIndex;
820 if ( neighbourIndex > oldNeighbourIndex+1 ) {
821 neighbourIndex = oldNeighbourIndex+1;
823 oldNeighbourIndex = neighbourIndex;
825 if ( neighbourIndex > oldNeighbourIndex+1 ) {
826 neighbourIndex = oldNeighbourIndex+1;
874 neighbourList.resize(neighbourIndex);
875 if (neighbourIndex > 0) {
876 if (neighbourIndex <= maxNeighb) {
877 std::copy (&neighbList[0], &neighbList[neighbourIndex], neighbourList.begin());
882 log << MSG::WARNING <<
" more than 22 neighbours for this cell, NONE will be retained" <<
endmsg;
885 std::cout <<
"WARNING: more than 22 neighbours for this cell, NONE will be retained " << neighbourIndex << std::endl;
898 unsigned int nIndex =
index-1;
902 neighbList[neighbourIndex] = nHash;
914 unsigned int nIndex =
index+1;
917 neighbList[neighbourIndex] = nHash;
925 const unsigned int& minHash,
926 int& neighbourIndex,
IdentifierHash* neighbList,
unsigned int& nBiggerCell)
const
930 unsigned int nIndex = 0;
941 unsigned int minHashMinus = prevEmRegion->
hashMin();
942 nIndex = minHashMinus +
index-minHash ;
944 neighbList[neighbourIndex] = nHash;
953 short int nPhiMinus = prevEmRegion->
phiN();
955 unsigned int maxHashMinus = prevEmRegion->
hashMax();
956 float phiMargin = 0.25*
std::min(gPhi,gPhiMinus);
957 float rPhi = (
index-minHash)*gPhi+emRegion->
phiMin();
958 int nPhiMinusFirst =
int(std::floor((rPhi -prevEmRegion->
phiMin())
959 /gPhiMinus+phiMargin))
960 +maxHashMinus-nPhiMinus;
961 int nPhiMinusNext =
int(std::floor((rPhi+gPhi-prevEmRegion->
phiMin())
962 /gPhiMinus+phiMargin))
963 +maxHashMinus-nPhiMinus;
964 if ( nPhiMinusNext == nPhiMinusFirst ) nPhiMinusNext++;
966 for(
int i=nPhiMinusFirst;
i<nPhiMinusNext;
i++){
968 if(nIndex != nBiggerCell) {
970 neighbList[neighbourIndex] = nHash;
975 if(gPhi < gPhiMinus && nBiggerCell ==
NOT_VALID_HASH) nBiggerCell=nIndex;
984 neighbList[neighbourIndex] = nHash;
992 const unsigned int& maxHash,
993 int& neighbourIndex,
IdentifierHash* neighbList,
unsigned int& nBiggerCell)
const
997 unsigned int nIndex = 0;
1011 unsigned int minHashPlus = nextEmRegion->
hashMin();
1012 float phiMargin = 0.25*
std::min(gPhi,gPhiPlus);
1014 int nPhiPlusFirst =
int(std::floor((rPhi -nextEmRegion->
phiMin())
1015 /gPhiPlus+phiMargin))+minHashPlus;
1016 int nPhiPlusNext =
int(std::floor((rPhi+gPhi-nextEmRegion->
phiMin())
1017 /gPhiPlus+phiMargin))+minHashPlus;
1018 if ( nPhiPlusNext == nPhiPlusFirst ) nPhiPlusNext++;
1020 for(
int i=nPhiPlusFirst;
i<nPhiPlusNext;
i++){
1022 if(nIndex != nBiggerCell) {
1024 neighbList[neighbourIndex] = nHash;
1029 if(gPhi < gPhiPlus && nBiggerCell ==
NOT_VALID_HASH) nBiggerCell=nIndex;
1037 neighbList[neighbourIndex] = nHash;
1045 const double& gEta,
const float& gPhi,
const double&
absEta,
1051 unsigned int nIndex=0;
1057 int nPrevSampReg = prevSampRegion.size();
1058 if(nPrevSampReg > 0) {
1059 for(
int ireg=0; ireg<nPrevSampReg; ireg++) {
1066 double margin = 0.25*
std::min(gEta,gEtaMinus);
1067 if((minEtaMinus <
absEta+gEta-margin) && (
absEta+margin < maxEtaMinus)) {
1076 short int nPhiMinus = prevEmRegion->
phiN();
1078 unsigned int minHashMinus = prevEmRegion->
hashMin();
1079 float phiMargin = 0.25*
std::min(gPhi,gPhiMinus);
1082 int nPhiMinusFirst =
int(std::floor((rPhi -prevEmRegion->
phiMin())
1083 /gPhiMinus+phiMargin));
1084 int nPhiMinusNext =
int(std::floor((rPhi+gPhi-prevEmRegion->
phiMin())
1085 /gPhiMinus+phiMargin));
1086 if ( nPhiMinusNext == nPhiMinusFirst ) nPhiMinusNext++;
1089 double fEtaMinus = (
absEta-minEtaMinus) / gEtaMinus + margin ;
1091 double fEtaMaxMinus = (
absEta+gEta-minEtaMinus) / gEtaMinus + margin ;
1092 int nEtaMinus =
int(fEtaMinus);
1093 int nEtaMaxMinus =
int(fEtaMaxMinus);
1094 if ( nEtaMaxMinus == nEtaMinus ) nEtaMaxMinus++;
1095 for(
int i=nEtaMinus;
i<nEtaMaxMinus;
i++) {
1096 for (
int j=nPhiMinusFirst; j<nPhiMinusNext;j++) {
1097 nIndex = minHashMinus +
i * nPhiMinus + j;
1098 if( (nIndex >= prevEmRegion->
hashMin()) && (nIndex < prevEmRegion->hashMax()) ) {
1100 neighbList[neighbourIndex] = nHash;
1113 const double& gEta,
const float& gPhi,
const double&
absEta,
1119 unsigned int nIndex=0;
1124 int nNextSampReg = nextSampRegion.size();
1125 if(nNextSampReg > 0) {
1126 for(
int ireg=0; ireg<nNextSampReg; ireg++) {
1132 double margin = 0.25*
std::min(gEta,gEtaPlus);
1133 if((minEtaPlus <
absEta+gEta-margin) && (
absEta+margin < maxEtaPlus)) {
1139 short int nPhiPlus = nextEmRegion->
phiN();
1140 unsigned int minHashPlus = nextEmRegion->
hashMin();
1141 float phiMargin = 0.25*
std::min(gPhi,gPhiPlus);
1144 int nPhiPlusFirst =
int(std::floor((rPhi -nextEmRegion->
phiMin())
1145 /gPhiPlus+phiMargin));
1146 int nPhiPlusNext =
int(std::floor((rPhi+gPhi-nextEmRegion->
phiMin())
1147 /gPhiPlus+phiMargin));
1148 if ( nPhiPlusNext == nPhiPlusFirst ) nPhiPlusNext++;
1150 double fEtaPlus = (
absEta-minEtaPlus) / gEtaPlus + margin ;
1152 double fEtaMaxPlus = (
absEta+gEta-minEtaPlus) / gEtaPlus + margin ;
1153 int nEtaPlus =
int(fEtaPlus) ;
1154 int nEtaMaxPlus =
int(fEtaMaxPlus) ;
1155 if (nEtaMaxPlus == nEtaPlus) nEtaMaxPlus++;
1157 for(
int i=nEtaPlus;
i<nEtaMaxPlus;
i++){
1158 for(
int j=nPhiPlusFirst; j<nPhiPlusNext; j++){
1159 nIndex = minHashPlus +
i * nPhiPlus + j;
1160 if( (nIndex >= nextEmRegion->
hashMin()) && (nIndex < nextEmRegion->hashMax()) ) {
1162 neighbList[neighbourIndex] = nHash;
1176 const double& gEta,
const float& gPhi,
const double&
absEta,
1182 unsigned int nIndex=0;
1187 const std::vector<short int>& prevSubdetRegion= emRegion->
prevSubdetRegion();
1188 int nPrevSubdetReg = prevSubdetRegion.size();
1189 if(nPrevSubdetReg > 0) {
1190 for(
int ireg=0; ireg<nPrevSubdetReg; ireg++) {
1197 double margin = 0.25*
std::min(gEta,gEtaMinus);
1198 if((minEtaMinus <
absEta+gEta-margin) && (
absEta+margin < maxEtaMinus)) {
1207 short int nPhiMinus = prevEmRegion->
phiN();
1209 unsigned int minHashMinus = prevEmRegion->
hashMin();
1210 float phiMargin = 0.25*
std::min(gPhi,gPhiMinus);
1213 int nPhiMinusFirst =
int(std::floor((rPhi -prevEmRegion->
phiMin())
1214 /gPhiMinus+phiMargin));
1215 int nPhiMinusNext =
int(std::floor((rPhi+gPhi-prevEmRegion->
phiMin())
1216 /gPhiMinus+phiMargin));
1217 if ( nPhiMinusNext == nPhiMinusFirst ) nPhiMinusNext++;
1219 double fEtaMinus = (
absEta-minEtaMinus) / gEtaMinus + margin ;
1221 double fEtaMaxMinus = (
absEta+gEta-minEtaMinus) / gEtaMinus + margin ;
1222 int nEtaMinus =
int(fEtaMinus);
1223 int nEtaMaxMinus =
int(fEtaMaxMinus);
1224 if ( nEtaMaxMinus == nEtaMinus ) nEtaMaxMinus++;
1226 for(
int i=nEtaMinus;
i<nEtaMaxMinus;
i++) {
1227 for (
int j=nPhiMinusFirst; j<nPhiMinusNext;j++) {
1228 nIndex = minHashMinus +
i * nPhiMinus + j;
1229 if( (nIndex >= prevEmRegion->
hashMin()) && (nIndex < prevEmRegion->hashMax()) ) {
1231 neighbList[neighbourIndex] = nHash;
1244 const double& gEta,
const float& gPhi,
const double&
absEta,
1250 unsigned int nIndex=0;
1254 const std::vector<short int>& nextSubdetRegion= emRegion->
nextSubdetRegion();
1255 int nNextSubdetReg = nextSubdetRegion.size();
1256 if(nNextSubdetReg > 0) {
1257 for(
int ireg=0; ireg<nNextSubdetReg; ireg++) {
1263 double margin = 0.25*
std::min(gEta,gEtaPlus);
1264 if((minEtaPlus <
absEta+gEta-margin) && (
absEta+margin < maxEtaPlus)) {
1270 short int nPhiPlus = nextEmRegion->
phiN();
1271 unsigned int minHashPlus = nextEmRegion->
hashMin();
1272 float phiMargin = 0.25*
std::min(gPhi,gPhiPlus);
1275 int nPhiPlusFirst =
int(std::floor((rPhi -nextEmRegion->
phiMin())
1276 /gPhiPlus+phiMargin));
1277 int nPhiPlusNext =
int(std::floor((rPhi+gPhi-nextEmRegion->
phiMin())
1278 /gPhiPlus+phiMargin));
1279 if ( nPhiPlusNext == nPhiPlusFirst ) nPhiPlusNext++;
1281 double fEtaPlus = (
absEta-minEtaPlus) / gEtaPlus + margin ;
1283 double fEtaMaxPlus = (
absEta+gEta-minEtaPlus) / gEtaPlus + margin ;
1284 int nEtaPlus =
int(fEtaPlus) ;
1285 int nEtaMaxPlus =
int(fEtaMaxPlus) ;
1286 if (nEtaMaxPlus == nEtaPlus) nEtaMaxPlus++;
1288 for(
int i=nEtaPlus;
i<nEtaMaxPlus;
i++) {
1289 for(
int j=nPhiPlusFirst; j<nPhiPlusNext; j++) {
1290 nIndex = minHashPlus +
i * nPhiPlus + j;
1291 if( (nIndex >= nextEmRegion->
hashMin()) && (nIndex < nextEmRegion->hashMax()) ) {
1293 neighbList[neighbourIndex] = nHash;
1313 std::cout <<
" LArEM_Base_ID::init_neighbors " << std::endl;
1316 const std::vector<const IdDictRegion*>& vecOfDictRegions =
dictRegions();
1323 std::vector<Identifier>::const_iterator debut=
reg_begin() ;
1324 std::vector<Identifier>::const_iterator
fin =
reg_end() ;
1325 for (; debut !=
fin; ++debut) {
1329 bool isBarrelMiddle =
false;
1339 if(
etaMin >= 0 && phiMin >= 0) {
1345 log << MSG::ERROR <<
" LArId exception "
1346 << (std::string)except
1351 <<
" LArId exception "
1352 << (std::string)except
1361 log << MSG::WARNING <<
" could not find non negative etaMin and phiMin for region "
1366 std::cout <<
"WARNING !! could not find non negative etaMin and phiMin for region "
1385 unsigned int ireg0=0;
1402 IdDictRegion* prevEtaDicReg = vecOfDictRegions[reg]->m_prev_abs_eta;
1404 IdDictRegion* nextEtaDicReg = vecOfDictRegions[reg]->m_next_abs_eta;
1405 for(
unsigned int ireg=ireg0;ireg<ireg1;ireg++){
1406 if(vecOfDictRegions[ireg] == prevEtaDicReg) regForPrevEta = ireg;
1407 if(vecOfDictRegions[ireg] == nextEtaDicReg) regForNextEta = ireg;
1412 isBarrelMiddle =
true;
1414 regForPrevEta = reg+6;
1416 regForPrevEta = reg-6;
1424 std::vector<short int> regForPrevSamp;
1425 std::vector<IdDictRegion*> prevSampDicReg = vecOfDictRegions[reg]->m_prev_samp;
1426 for(
unsigned int isam=0;isam<prevSampDicReg.size();isam++){
1427 for(
unsigned int ireg=ireg0;ireg<ireg1;ireg++){
1428 if(vecOfDictRegions[ireg] == prevSampDicReg[isam]) regForPrevSamp.push_back(ireg);
1432 std::vector<short int> regForNextSamp;
1433 std::vector<IdDictRegion*> nextSampDicReg = vecOfDictRegions[reg]->m_next_samp;
1434 for(
unsigned int isam=0;isam<nextSampDicReg.size();isam++){
1435 for(
unsigned int ireg=ireg0;ireg<ireg1;ireg++){
1436 if(vecOfDictRegions[ireg] == nextSampDicReg[isam]) regForNextSamp.push_back(ireg);
1443 std::vector<short int> regForPrevSubdet;
1444 std::vector<IdDictRegion*> prevSubdetDicReg = vecOfDictRegions[reg]->m_prev_subdet;
1445 for(
unsigned int isubdet=0;isubdet<prevSubdetDicReg.size();isubdet++){
1446 for(
unsigned int ireg=ireg0;ireg<ireg1;ireg++){
1447 if(vecOfDictRegions[ireg] == prevSubdetDicReg[isubdet]) regForPrevSubdet.push_back(ireg);
1451 std::vector<short int> regForNextSubdet;
1452 std::vector<IdDictRegion*> nextSubdetDicReg = vecOfDictRegions[reg]->m_next_subdet;
1453 for(
unsigned int isubdet=0;isubdet<nextSubdetDicReg.size();isubdet++){
1454 for(
unsigned int ireg=ireg0;ireg<ireg1;ireg++){
1455 if(vecOfDictRegions[ireg] == nextSubdetDicReg[isubdet]) regForNextSubdet.push_back(ireg);
1464 regForPrevEta,regForNextEta,
1465 regForPrevSamp,regForNextSamp,
1466 regForPrevSubdet,regForNextSubdet);
1484 if(regId != lastRegId) {
1493 if ((
short int)hashReg != reg) {
1495 log << MSG::ERROR <<
" init_neighbors: problem reg, hashReg = " << reg <<
" " << hashReg
1499 std::cout <<
" init_neighbors: problem reg, hashReg = " << reg <<
" " << hashReg
JetConstituentVector::iterator iterator
int lar_em_field_value() const
LArEM_Base_ID(const std::string &name, const std::string &group, bool supercell)
Constructor.
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)
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
id_iterator reg_end() const
end iterator over set of Region Identifiers
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 .
bool empty() const
If true, this field does not have any constraints, and may hold any value representable by element_ty...
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
const std::string & group() const
Group name for this helper.
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).
id_iterator reg_begin() const
begin iterator over set of Region Identifiers
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.
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
size_type hash_max() const
Return one more than the largest hash code.
std::vector< HashCalc > m_hash_calcs