 |
ATLAS Offline Software
|
Go to the documentation of this file.
27 const std::string&
group,
30 m_slar (supercell ? 1 : 0)
56 if (
range.match(expId)) {
58 if (not eta_field.
empty()) {
82 if (
range.match(expId)) {
84 if (not eta_field.
empty()) {
103 if (
range.match(expId)) {
105 if (not phi_field.
empty()) {
129 if (
range.match(expId)) {
131 if (not phi_field.
empty()) {
151 std::string errorMessage =
"LArEM_Base_ID::region_id_checks() result is not OK: ID, range = "
168 std::string errorMessage =
"LArEM_Base_ID::channel_id_checks() result is not OK: ID, range = "
184 std::string errorMessage =
"LArEM_Base_ID::channel_id_checks(regId) result is not OK: ID = "
192 std::string errorMessage =
"LArEM_Base_ID::channel_id_checks(regId) result is not OK: ID, range = "
227 log << MSG::ERROR <<
"initLevelsFromDict - dictionary NOT initialized "
231 std::cout <<
"LArEM_Base_ID::initLevelsFromDict - dictionary NOT initialized "
255 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'subdet' field "
259 std::cout <<
"LArEM_Base_ID::initLevelsFromDict - unable to find 'subdet' field "
271 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'part' field "
275 std::cout <<
"LArEM_Base_ID::initLevelsFromDict - unable to find 'part' field "
287 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'barrel-endcap' field "
291 std::cout <<
"LArEM_Base_ID::initLevelsFromDict - unable to find 'barrel-endcap' field "
303 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'sampling' field "
307 std::cout <<
"LArEM_Base_ID::initLevelsFromDict - unable to find 'sampling' field "
319 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'region' field "
323 std::cout <<
"LArEM_Base_ID::initLevelsFromDict - unable to find 'region' field "
335 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'eta' field "
339 std::cout <<
"LArEM_Base_ID::initLevelsFromDict - unable to find 'eta' field "
351 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'phi' field "
355 std::cout <<
"LArEM_Base_ID::initLevelsFromDict - unable to find 'phi' field "
367 log << MSG::ERROR <<
"initLevelsFromDict - unable to find 'is-slar' field "
371 std::cout <<
"LArEM_Base_ID::initLevelsFromDict - unable to find 'is-slar' field "
381 log << MSG::ERROR <<
"initLevelsFromDict - cannot find " <<
group_name
382 <<
" group' field " <<
endmsg;
411 std::cout <<
"decode index and bit fields for each level: " << std::endl;
454 log <<
MSG::DEBUG <<
"Request to reinitialize not satisfied - tags have not changed" <<
endmsg;
475 if (atlasDict->
get_label_value(
"subdet",
"LArCalorimeter", larField)) {
477 log << MSG::ERROR <<
"Could not get value for label 'LArCalorimeter' of field 'subdet' in dictionary "
482 std::cout <<
"Could not get value for label 'LArCalorimeter' of field 'subdet' in dictionary "
491 if (
dict()->get_label_value(
"part",
"LArEM", larEmField)) {
493 log << MSG::ERROR <<
"Could not get value for label 'LArEM' of field 'part' in dictionary "
498 std::cout <<
"Could not get value for label 'LArEM' of field 'part' in dictionary "
507 reg_id.
add(larField);
508 reg_id.
add(larEmField);
524 std::cout <<
" LArEM_Base_ID::initialize_from_dict : "
619 log << MSG::WARNING <<
"min > 255 "
626 std::cout <<
"min > 255 "
665 log << MSG::ERROR <<
"channel ranges, id, hash "
672 std::cout <<
" ***** Error ";
673 std::cout <<
"channel ranges, id, hash "
693 std::vector<IdentifierHash>& neighbourList)
const
697 neighbourList.clear();
702 log << MSG::WARNING <<
"neighbours not initialized !!! returning empty list" <<
endmsg;
705 std::cout <<
" WARNING: neighbours not initialized !!! returning empty list " << std::endl;
713 log << MSG::WARNING <<
"neighbours requested for non-existing channel -- id/max " <<
id <<
"/"
717 std::cout <<
" neighbours requested for non-existing channel -- id/max " <<
id <<
"/"
723 const short int maxNeighb=22;
725 int neighbourIndex = 0;
734 unsigned short int regionN = (itr -
m_cells.begin()) - 1;
741 unsigned int minHash = emRegion->
hashMin();
742 unsigned int maxHash = emRegion->
hashMax();
754 prevNeighbInPhi=neighbList[neighbourIndex-1];
769 nextNeighbInPhi=neighbList[neighbourIndex-1];
797 unsigned int index1=prevNeighbInPhi;
798 int oldNeighbourIndex = neighbourIndex;
804 if ( neighbourIndex > oldNeighbourIndex+1 ) {
805 neighbList[oldNeighbourIndex] = neighbList[neighbourIndex-1];
806 neighbourIndex = oldNeighbourIndex+1;
808 oldNeighbourIndex = neighbourIndex;
810 if ( neighbourIndex > oldNeighbourIndex+1 ) {
811 neighbList[oldNeighbourIndex] = neighbList[neighbourIndex-1];
812 neighbourIndex = oldNeighbourIndex+1;
817 unsigned int index2=nextNeighbInPhi;
818 int oldNeighbourIndex = neighbourIndex;
824 if ( neighbourIndex > oldNeighbourIndex+1 ) {
825 neighbourIndex = oldNeighbourIndex+1;
827 oldNeighbourIndex = neighbourIndex;
829 if ( neighbourIndex > oldNeighbourIndex+1 ) {
830 neighbourIndex = oldNeighbourIndex+1;
878 neighbourList.resize(neighbourIndex);
879 if (neighbourIndex > 0) {
880 if (neighbourIndex <= maxNeighb) {
881 std::copy (&neighbList[0], &neighbList[neighbourIndex], neighbourList.begin());
886 log << MSG::WARNING <<
" more than 22 neighbours for this cell, NONE will be retained" <<
endmsg;
889 std::cout <<
"WARNING: more than 22 neighbours for this cell, NONE will be retained " << neighbourIndex << std::endl;
902 unsigned int nIndex =
index-1;
906 neighbList[neighbourIndex] = nHash;
918 unsigned int nIndex =
index+1;
921 neighbList[neighbourIndex] = nHash;
929 const unsigned int& minHash,
930 int& neighbourIndex,
IdentifierHash* neighbList,
unsigned int& nBiggerCell)
const
934 unsigned int nIndex = 0;
945 unsigned int minHashMinus = prevEmRegion->
hashMin();
946 nIndex = minHashMinus +
index-minHash ;
948 neighbList[neighbourIndex] = nHash;
957 short int nPhiMinus = prevEmRegion->
phiN();
959 unsigned int maxHashMinus = prevEmRegion->
hashMax();
960 float phiMargin = 0.25*
std::min(gPhi,gPhiMinus);
961 float rPhi = (
index-minHash)*gPhi+emRegion->
phiMin();
962 int nPhiMinusFirst =
int(std::floor((rPhi -prevEmRegion->
phiMin())
963 /gPhiMinus+phiMargin))
964 +maxHashMinus-nPhiMinus;
965 int nPhiMinusNext =
int(std::floor((rPhi+gPhi-prevEmRegion->
phiMin())
966 /gPhiMinus+phiMargin))
967 +maxHashMinus-nPhiMinus;
968 if ( nPhiMinusNext == nPhiMinusFirst ) nPhiMinusNext++;
970 for(
int i=nPhiMinusFirst;
i<nPhiMinusNext;
i++){
972 if(nIndex != nBiggerCell) {
974 neighbList[neighbourIndex] = nHash;
979 if(gPhi < gPhiMinus && nBiggerCell ==
NOT_VALID_HASH) nBiggerCell=nIndex;
988 neighbList[neighbourIndex] = nHash;
996 const unsigned int& maxHash,
997 int& neighbourIndex,
IdentifierHash* neighbList,
unsigned int& nBiggerCell)
const
1001 unsigned int nIndex = 0;
1015 unsigned int minHashPlus = nextEmRegion->
hashMin();
1016 float phiMargin = 0.25*
std::min(gPhi,gPhiPlus);
1018 int nPhiPlusFirst =
int(std::floor((rPhi -nextEmRegion->
phiMin())
1019 /gPhiPlus+phiMargin))+minHashPlus;
1020 int nPhiPlusNext =
int(std::floor((rPhi+gPhi-nextEmRegion->
phiMin())
1021 /gPhiPlus+phiMargin))+minHashPlus;
1022 if ( nPhiPlusNext == nPhiPlusFirst ) nPhiPlusNext++;
1024 for(
int i=nPhiPlusFirst;
i<nPhiPlusNext;
i++){
1026 if(nIndex != nBiggerCell) {
1028 neighbList[neighbourIndex] = nHash;
1033 if(gPhi < gPhiPlus && nBiggerCell ==
NOT_VALID_HASH) nBiggerCell=nIndex;
1041 neighbList[neighbourIndex] = nHash;
1049 const double& gEta,
const float& gPhi,
const double&
absEta,
1055 unsigned int nIndex=0;
1061 int nPrevSampReg = prevSampRegion.size();
1062 if(nPrevSampReg > 0) {
1063 for(
int ireg=0; ireg<nPrevSampReg; ireg++) {
1070 double margin = 0.25*
std::min(gEta,gEtaMinus);
1071 if((minEtaMinus <
absEta+gEta-margin) && (
absEta+margin < maxEtaMinus)) {
1080 short int nPhiMinus = prevEmRegion->
phiN();
1082 unsigned int minHashMinus = prevEmRegion->
hashMin();
1083 float phiMargin = 0.25*
std::min(gPhi,gPhiMinus);
1086 int nPhiMinusFirst =
int(std::floor((rPhi -prevEmRegion->
phiMin())
1087 /gPhiMinus+phiMargin));
1088 int nPhiMinusNext =
int(std::floor((rPhi+gPhi-prevEmRegion->
phiMin())
1089 /gPhiMinus+phiMargin));
1090 if ( nPhiMinusNext == nPhiMinusFirst ) nPhiMinusNext++;
1093 double fEtaMinus = (
absEta-minEtaMinus) / gEtaMinus + margin ;
1095 double fEtaMaxMinus = (
absEta+gEta-minEtaMinus) / gEtaMinus + margin ;
1096 int nEtaMinus =
int(fEtaMinus);
1097 int nEtaMaxMinus =
int(fEtaMaxMinus);
1098 if ( nEtaMaxMinus == nEtaMinus ) nEtaMaxMinus++;
1099 for(
int i=nEtaMinus;
i<nEtaMaxMinus;
i++) {
1100 for (
int j=nPhiMinusFirst; j<nPhiMinusNext;j++) {
1101 nIndex = minHashMinus +
i * nPhiMinus + j;
1102 if( (nIndex >= prevEmRegion->
hashMin()) && (nIndex < prevEmRegion->hashMax()) ) {
1104 neighbList[neighbourIndex] = nHash;
1117 const double& gEta,
const float& gPhi,
const double&
absEta,
1123 unsigned int nIndex=0;
1128 int nNextSampReg = nextSampRegion.size();
1129 if(nNextSampReg > 0) {
1130 for(
int ireg=0; ireg<nNextSampReg; ireg++) {
1136 double margin = 0.25*
std::min(gEta,gEtaPlus);
1137 if((minEtaPlus <
absEta+gEta-margin) && (
absEta+margin < maxEtaPlus)) {
1143 short int nPhiPlus = nextEmRegion->
phiN();
1144 unsigned int minHashPlus = nextEmRegion->
hashMin();
1145 float phiMargin = 0.25*
std::min(gPhi,gPhiPlus);
1148 int nPhiPlusFirst =
int(std::floor((rPhi -nextEmRegion->
phiMin())
1149 /gPhiPlus+phiMargin));
1150 int nPhiPlusNext =
int(std::floor((rPhi+gPhi-nextEmRegion->
phiMin())
1151 /gPhiPlus+phiMargin));
1152 if ( nPhiPlusNext == nPhiPlusFirst ) nPhiPlusNext++;
1154 double fEtaPlus = (
absEta-minEtaPlus) / gEtaPlus + margin ;
1156 double fEtaMaxPlus = (
absEta+gEta-minEtaPlus) / gEtaPlus + margin ;
1157 int nEtaPlus =
int(fEtaPlus) ;
1158 int nEtaMaxPlus =
int(fEtaMaxPlus) ;
1159 if (nEtaMaxPlus == nEtaPlus) nEtaMaxPlus++;
1161 for(
int i=nEtaPlus;
i<nEtaMaxPlus;
i++){
1162 for(
int j=nPhiPlusFirst; j<nPhiPlusNext; j++){
1163 nIndex = minHashPlus +
i * nPhiPlus + j;
1164 if( (nIndex >= nextEmRegion->
hashMin()) && (nIndex < nextEmRegion->hashMax()) ) {
1166 neighbList[neighbourIndex] = nHash;
1180 const double& gEta,
const float& gPhi,
const double&
absEta,
1186 unsigned int nIndex=0;
1191 const std::vector<short int>& prevSubdetRegion= emRegion->
prevSubdetRegion();
1192 int nPrevSubdetReg = prevSubdetRegion.size();
1193 if(nPrevSubdetReg > 0) {
1194 for(
int ireg=0; ireg<nPrevSubdetReg; ireg++) {
1201 double margin = 0.25*
std::min(gEta,gEtaMinus);
1202 if((minEtaMinus <
absEta+gEta-margin) && (
absEta+margin < maxEtaMinus)) {
1211 short int nPhiMinus = prevEmRegion->
phiN();
1213 unsigned int minHashMinus = prevEmRegion->
hashMin();
1214 float phiMargin = 0.25*
std::min(gPhi,gPhiMinus);
1217 int nPhiMinusFirst =
int(std::floor((rPhi -prevEmRegion->
phiMin())
1218 /gPhiMinus+phiMargin));
1219 int nPhiMinusNext =
int(std::floor((rPhi+gPhi-prevEmRegion->
phiMin())
1220 /gPhiMinus+phiMargin));
1221 if ( nPhiMinusNext == nPhiMinusFirst ) nPhiMinusNext++;
1223 double fEtaMinus = (
absEta-minEtaMinus) / gEtaMinus + margin ;
1225 double fEtaMaxMinus = (
absEta+gEta-minEtaMinus) / gEtaMinus + margin ;
1226 int nEtaMinus =
int(fEtaMinus);
1227 int nEtaMaxMinus =
int(fEtaMaxMinus);
1228 if ( nEtaMaxMinus == nEtaMinus ) nEtaMaxMinus++;
1230 for(
int i=nEtaMinus;
i<nEtaMaxMinus;
i++) {
1231 for (
int j=nPhiMinusFirst; j<nPhiMinusNext;j++) {
1232 nIndex = minHashMinus +
i * nPhiMinus + j;
1233 if( (nIndex >= prevEmRegion->
hashMin()) && (nIndex < prevEmRegion->hashMax()) ) {
1235 neighbList[neighbourIndex] = nHash;
1248 const double& gEta,
const float& gPhi,
const double&
absEta,
1254 unsigned int nIndex=0;
1258 const std::vector<short int>& nextSubdetRegion= emRegion->
nextSubdetRegion();
1259 int nNextSubdetReg = nextSubdetRegion.size();
1260 if(nNextSubdetReg > 0) {
1261 for(
int ireg=0; ireg<nNextSubdetReg; ireg++) {
1267 double margin = 0.25*
std::min(gEta,gEtaPlus);
1268 if((minEtaPlus <
absEta+gEta-margin) && (
absEta+margin < maxEtaPlus)) {
1274 short int nPhiPlus = nextEmRegion->
phiN();
1275 unsigned int minHashPlus = nextEmRegion->
hashMin();
1276 float phiMargin = 0.25*
std::min(gPhi,gPhiPlus);
1279 int nPhiPlusFirst =
int(std::floor((rPhi -nextEmRegion->
phiMin())
1280 /gPhiPlus+phiMargin));
1281 int nPhiPlusNext =
int(std::floor((rPhi+gPhi-nextEmRegion->
phiMin())
1282 /gPhiPlus+phiMargin));
1283 if ( nPhiPlusNext == nPhiPlusFirst ) nPhiPlusNext++;
1285 double fEtaPlus = (
absEta-minEtaPlus) / gEtaPlus + margin ;
1287 double fEtaMaxPlus = (
absEta+gEta-minEtaPlus) / gEtaPlus + margin ;
1288 int nEtaPlus =
int(fEtaPlus) ;
1289 int nEtaMaxPlus =
int(fEtaMaxPlus) ;
1290 if (nEtaMaxPlus == nEtaPlus) nEtaMaxPlus++;
1292 for(
int i=nEtaPlus;
i<nEtaMaxPlus;
i++) {
1293 for(
int j=nPhiPlusFirst; j<nPhiPlusNext; j++) {
1294 nIndex = minHashPlus +
i * nPhiPlus + j;
1295 if( (nIndex >= nextEmRegion->
hashMin()) && (nIndex < nextEmRegion->hashMax()) ) {
1297 neighbList[neighbourIndex] = nHash;
1317 std::cout <<
" LArEM_Base_ID::init_neighbors " << std::endl;
1320 const std::vector<const IdDictRegion*>& vecOfDictRegions =
dictRegions();
1327 std::vector<Identifier>::const_iterator debut=
reg_begin() ;
1328 std::vector<Identifier>::const_iterator
fin =
reg_end() ;
1329 for (; debut !=
fin; ++debut) {
1333 bool isBarrelMiddle =
false;
1343 if(
etaMin >= 0 && phiMin >= 0) {
1349 log << MSG::ERROR <<
" LArId exception "
1350 << (std::string)except
1355 <<
" LArId exception "
1356 << (std::string)except
1365 log << MSG::WARNING <<
" could not find non negative etaMin and phiMin for region "
1370 std::cout <<
"WARNING !! could not find non negative etaMin and phiMin for region "
1389 unsigned int ireg0=0;
1406 const IdDictRegion* prevEtaDicReg = vecOfDictRegions[reg]->prev_abs_eta();
1408 const IdDictRegion* nextEtaDicReg = vecOfDictRegions[reg]->next_abs_eta();
1409 for(
unsigned int ireg=ireg0;ireg<ireg1;ireg++){
1410 if(vecOfDictRegions[ireg] == prevEtaDicReg) regForPrevEta = ireg;
1411 if(vecOfDictRegions[ireg] == nextEtaDicReg) regForNextEta = ireg;
1416 isBarrelMiddle =
true;
1418 regForPrevEta = reg+6;
1420 regForPrevEta = reg-6;
1428 std::vector<short int> regForPrevSamp;
1429 for (
const IdDictRegion* dictreg : vecOfDictRegions[reg]->prev_samp()) {
1430 for(
unsigned int ireg=ireg0;ireg<ireg1;ireg++){
1431 if(vecOfDictRegions[ireg] == dictreg) regForPrevSamp.push_back(ireg);
1435 std::vector<short int> regForNextSamp;
1436 for (
const IdDictRegion* dictreg : vecOfDictRegions[reg]->next_samp()) {
1437 for(
unsigned int ireg=ireg0;ireg<ireg1;ireg++){
1438 if(vecOfDictRegions[ireg] == dictreg) regForNextSamp.push_back(ireg);
1445 std::vector<short int> regForPrevSubdet;
1446 for (
const IdDictRegion* dictreg : vecOfDictRegions[reg]->prev_subdet()) {
1447 for(
unsigned int ireg=ireg0;ireg<ireg1;ireg++){
1448 if(vecOfDictRegions[ireg] == dictreg) regForPrevSubdet.push_back(ireg);
1452 std::vector<short int> regForNextSubdet;
1453 for (
const IdDictRegion* dictreg : vecOfDictRegions[reg]->next_subdet()) {
1454 for(
unsigned int ireg=ireg0;ireg<ireg1;ireg++){
1455 if(vecOfDictRegions[ireg] == dictreg) 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.
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
const IdDictRegion & region(size_t i) const
Region at index i.
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.
const std::string & name() const
Dictionary name.
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
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.
bool absEta(const xAOD::TauJet &tau, float &out)
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.
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