24 const std::string&
group,
34 std::vector<LArEM_region*>::iterator first =
m_vecOfRegions.begin();
36 for (; first != last; ++first)
delete (*first);
53 if (range.match(expId)) {
55 if (not eta_field.
empty()) {
61 if (etamin < result) result = etamin;
79 if (range.match(expId)) {
81 if (not eta_field.
empty()) {
83 if (result < etamax) result = etamax;
100 if (range.match(expId)) {
102 if (not phi_field.
empty()) {
104 if (-999 == result) {
108 if (phimin < result) result = phimin;
126 if (range.match(expId)) {
128 if (not phi_field.
empty()) {
130 if (result < phimax) result = phimax;
148 std::string errorMessage =
"LArEM_Base_ID::region_id_checks() result is not OK: ID, range = "
165 std::string errorMessage =
"LArEM_Base_ID::channel_id_checks() result is not OK: ID, range = "
181 std::string errorMessage =
"LArEM_Base_ID::channel_id_checks(regId) result is not OK: ID = "
189 std::string errorMessage =
"LArEM_Base_ID::channel_id_checks(regId) result is not OK: ID, range = "
207 if(context && context->end_index() >=
m_ETA_INDEX) {
222 ATH_MSG_ERROR(
"initLevelsFromDict - dictionary NOT initialized");
238 const IdDictField* field = dict()->find_field(
"subdet") ;
243 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'subdet' field");
247 field = dict()->find_field(
"part") ;
252 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'part' field");
256 field = dict()->find_field(
"barrel-endcap") ;
261 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'barrel-endcap' field");
265 field = dict()->find_field(
"sampling") ;
270 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'sampling' field");
274 field = dict()->find_field(
"region") ;
279 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'region' field");
283 field = dict()->find_field(
"eta") ;
288 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'eta' field");
292 field = dict()->find_field(
"phi") ;
297 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'phi' field");
301 field = dict()->find_field(
"is-slar") ;
306 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'is-slar' field");
314 ATH_MSG_ERROR(
"initLevelsFromDict - cannot find " << group_name <<
" group' field ");
330 ATH_MSG_DEBUG(
"decode index and bit fields for each level: ");
346 if (
channels().init (*
this,
"channels",
350 if (
regions().init (*
this,
"regions",
361 const std::string& group_name)
368 ATH_MSG_DEBUG(
"Request to reinitialize not satisfied - tags have not changed");
376 if(CaloIDHelper::initialize_base_from_dictionary(dict_mgr,
389 if (atlasDict->
get_label_value(
"subdet",
"LArCalorimeter", larField)) {
390 ATH_MSG_ERROR(
"Could not get value for label 'LArCalorimeter' of field 'subdet' in dictionary "
391 << atlasDict->
name());
397 if (dict()->get_label_value(
"part",
"LArEM", larEmField)) {
398 ATH_MSG_ERROR(
"Could not get value for label 'LArEM' of field 'part' in dictionary "
405 reg_id.
add(larField);
406 reg_id.
add(larEmField);
409 m_full_em_range = dict()->build_multirange(reg_id, group_name, prefix);
540 std::vector<IdentifierHash>& neighbourList)
const
544 neighbourList.clear();
547 ATH_MSG_WARNING(
"neighbours not initialized !!! returning empty list");
556 const short int maxNeighb=22;
558 int neighbourIndex = 0;
561 unsigned int index=id;
567 unsigned short int regionN = (itr -
m_cells.begin()) - 1;
572 short int nPhi = emRegion->
phiN();
574 unsigned int minHash = emRegion->
hashMin();
575 unsigned int maxHash = emRegion->
hashMax();
587 prevNeighbInPhi=neighbList[neighbourIndex-1];
602 nextNeighbInPhi=neighbList[neighbourIndex-1];
614 get_prevInEta(emRegion,
index, nPhi, gPhi, minHash, neighbourIndex, neighbList, nPrevBiggerCell);
622 get_nextInEta(emRegion,
index, nPhi, gPhi, maxHash, neighbourIndex, neighbList, nNextBiggerCell);
630 unsigned int index1=prevNeighbInPhi;
631 int oldNeighbourIndex = neighbourIndex;
636 get_prevInEta(emRegion, index1, nPhi, gPhi, minHash, neighbourIndex, neighbList, nPrevBiggerCell);
637 if ( neighbourIndex > oldNeighbourIndex+1 ) {
638 neighbList[oldNeighbourIndex] = neighbList[neighbourIndex-1];
639 neighbourIndex = oldNeighbourIndex+1;
641 oldNeighbourIndex = neighbourIndex;
642 get_nextInEta(emRegion, index1, nPhi, gPhi, maxHash, neighbourIndex, neighbList, nNextBiggerCell);
643 if ( neighbourIndex > oldNeighbourIndex+1 ) {
644 neighbList[oldNeighbourIndex] = neighbList[neighbourIndex-1];
645 neighbourIndex = oldNeighbourIndex+1;
650 unsigned int index2=nextNeighbInPhi;
651 int oldNeighbourIndex = neighbourIndex;
656 get_prevInEta(emRegion, index2, nPhi, gPhi, minHash, neighbourIndex, neighbList, nPrevBiggerCell);
657 if ( neighbourIndex > oldNeighbourIndex+1 ) {
658 neighbourIndex = oldNeighbourIndex+1;
660 oldNeighbourIndex = neighbourIndex;
661 get_nextInEta(emRegion, index2, nPhi, gPhi, maxHash, neighbourIndex, neighbList, nNextBiggerCell);
662 if ( neighbourIndex > oldNeighbourIndex+1 ) {
663 neighbourIndex = oldNeighbourIndex+1;
676 int nEta = int( (
index-minHash) / nPhi);
677 double absEta = (double)(emRegion->
etaMin()) + (double)(nEta * gEta);
681 get_prevInSamp(emRegion,
index, nPhi, minHash, gEta, gPhi, absEta, neighbourIndex, neighbList);
686 get_nextInSamp(emRegion,
index, nPhi, minHash, gEta, gPhi, absEta, neighbourIndex, neighbList);
697 int nEta = int( (
index-minHash) / nPhi);
698 double absEta = (double)(emRegion->
etaMin()) + (double)(nEta * gEta);
711 neighbourList.resize(neighbourIndex);
712 if (neighbourIndex > 0) {
713 if (neighbourIndex <= maxNeighb) {
714 std::copy (&neighbList[0], &neighbList[neighbourIndex], neighbourList.begin());
717 ATH_MSG_WARNING(
" more than 22 neighbours for this cell, NONE will be retained");
729 unsigned int nIndex =
index-1;
731 if( ((
index-minHash)%(nPhi)) == 0 ) nIndex=
index+nPhi-1;
733 neighbList[neighbourIndex] = nHash;
745 unsigned int nIndex =
index+1;
746 if( ((
index-minHash+1)%(nPhi)) == 0 ) nIndex=
index-nPhi+1;
748 neighbList[neighbourIndex] = nHash;
756 const unsigned int& minHash,
757 int& neighbourIndex,
IdentifierHash* neighbList,
unsigned int& nBiggerCell)
const
761 unsigned int nIndex = 0;
772 unsigned int minHashMinus = prevEmRegion->
hashMin();
773 nIndex = minHashMinus +
index-minHash ;
775 neighbList[neighbourIndex] = nHash;
784 short int nPhiMinus = prevEmRegion->
phiN();
786 unsigned int maxHashMinus = prevEmRegion->
hashMax();
787 float phiMargin = 0.25*std::min(gPhi,gPhiMinus);
788 float rPhi = (
index-minHash)*gPhi+emRegion->
phiMin();
789 int nPhiMinusFirst = int(std::floor((rPhi -prevEmRegion->
phiMin())
790 /gPhiMinus+phiMargin))
791 +maxHashMinus-nPhiMinus;
792 int nPhiMinusNext = int(std::floor((rPhi+gPhi-prevEmRegion->
phiMin())
793 /gPhiMinus+phiMargin))
794 +maxHashMinus-nPhiMinus;
795 if ( nPhiMinusNext == nPhiMinusFirst ) nPhiMinusNext++;
797 for(
int i=nPhiMinusFirst; i<nPhiMinusNext; i++){
799 if(nIndex != nBiggerCell) {
801 neighbList[neighbourIndex] = nHash;
806 if(gPhi < gPhiMinus && nBiggerCell ==
NOT_VALID_HASH) nBiggerCell=nIndex;
813 nIndex =
index - nPhi;
815 neighbList[neighbourIndex] = nHash;
823 const unsigned int& maxHash,
824 int& neighbourIndex,
IdentifierHash* neighbList,
unsigned int& nBiggerCell)
const
828 unsigned int nIndex = 0;
842 unsigned int minHashPlus = nextEmRegion->
hashMin();
843 float phiMargin = 0.25*std::min(gPhi,gPhiPlus);
844 float rPhi = (
index+nPhi-maxHash)*gPhi+emRegion->
phiMin();
845 int nPhiPlusFirst = int(std::floor((rPhi -nextEmRegion->
phiMin())
846 /gPhiPlus+phiMargin))+minHashPlus;
847 int nPhiPlusNext = int(std::floor((rPhi+gPhi-nextEmRegion->
phiMin())
848 /gPhiPlus+phiMargin))+minHashPlus;
849 if ( nPhiPlusNext == nPhiPlusFirst ) nPhiPlusNext++;
851 for(
int i=nPhiPlusFirst; i<nPhiPlusNext; i++){
853 if(nIndex != nBiggerCell) {
855 neighbList[neighbourIndex] = nHash;
860 if(gPhi < gPhiPlus && nBiggerCell ==
NOT_VALID_HASH) nBiggerCell=nIndex;
866 nIndex =
index + nPhi;
868 neighbList[neighbourIndex] = nHash;
876 const double& gEta,
const float& gPhi,
const double& absEta,
882 unsigned int nIndex=0;
888 int nPrevSampReg = prevSampRegion.size();
889 if(nPrevSampReg > 0) {
890 for(
int ireg=0; ireg<nPrevSampReg; ireg++) {
895 double minEtaMinus = (double)(prevEmRegion->
etaMin());
896 double maxEtaMinus = (double)(prevEmRegion->
etaMax());
897 double margin = 0.25*std::min(gEta,gEtaMinus);
898 if((minEtaMinus < absEta+gEta-margin) && (absEta+margin < maxEtaMinus)) {
907 short int nPhiMinus = prevEmRegion->
phiN();
909 unsigned int minHashMinus = prevEmRegion->
hashMin();
910 float phiMargin = 0.25*std::min(gPhi,gPhiMinus);
912 float rPhi = ((
index-minHash)%nPhi)*gPhi+emRegion->
phiMin();
913 int nPhiMinusFirst = int(std::floor((rPhi -prevEmRegion->
phiMin())
914 /gPhiMinus+phiMargin));
915 int nPhiMinusNext = int(std::floor((rPhi+gPhi-prevEmRegion->
phiMin())
916 /gPhiMinus+phiMargin));
917 if ( nPhiMinusNext == nPhiMinusFirst ) nPhiMinusNext++;
920 double fEtaMinus = (absEta-minEtaMinus) / gEtaMinus + margin ;
922 double fEtaMaxMinus = (absEta+gEta-minEtaMinus) / gEtaMinus + margin ;
923 int nEtaMinus = int(fEtaMinus);
924 int nEtaMaxMinus = int(fEtaMaxMinus);
925 if ( nEtaMaxMinus == nEtaMinus ) nEtaMaxMinus++;
926 for(
int i=nEtaMinus; i<nEtaMaxMinus; i++) {
927 for (
int j=nPhiMinusFirst; j<nPhiMinusNext;j++) {
928 nIndex = minHashMinus + i * nPhiMinus + j;
929 if( (nIndex >= prevEmRegion->
hashMin()) && (nIndex < prevEmRegion->hashMax()) ) {
931 neighbList[neighbourIndex] = nHash;
944 const double& gEta,
const float& gPhi,
const double& absEta,
950 unsigned int nIndex=0;
955 int nNextSampReg = nextSampRegion.size();
956 if(nNextSampReg > 0) {
957 for(
int ireg=0; ireg<nNextSampReg; ireg++) {
961 double minEtaPlus = (double)(nextEmRegion->
etaMin());
962 double maxEtaPlus = (double)(nextEmRegion->
etaMax());
963 double margin = 0.25*std::min(gEta,gEtaPlus);
964 if((minEtaPlus < absEta+gEta-margin) && (absEta+margin < maxEtaPlus)) {
970 short int nPhiPlus = nextEmRegion->
phiN();
971 unsigned int minHashPlus = nextEmRegion->
hashMin();
972 float phiMargin = 0.25*std::min(gPhi,gPhiPlus);
974 float rPhi = ((
index-minHash)%nPhi)*gPhi+emRegion->
phiMin();
975 int nPhiPlusFirst = int(std::floor((rPhi -nextEmRegion->
phiMin())
976 /gPhiPlus+phiMargin));
977 int nPhiPlusNext = int(std::floor((rPhi+gPhi-nextEmRegion->
phiMin())
978 /gPhiPlus+phiMargin));
979 if ( nPhiPlusNext == nPhiPlusFirst ) nPhiPlusNext++;
981 double fEtaPlus = (absEta-minEtaPlus) / gEtaPlus + margin ;
983 double fEtaMaxPlus = (absEta+gEta-minEtaPlus) / gEtaPlus + margin ;
984 int nEtaPlus = int(fEtaPlus) ;
985 int nEtaMaxPlus = int(fEtaMaxPlus) ;
986 if (nEtaMaxPlus == nEtaPlus) nEtaMaxPlus++;
988 for(
int i=nEtaPlus; i<nEtaMaxPlus; i++){
989 for(
int j=nPhiPlusFirst; j<nPhiPlusNext; j++){
990 nIndex = minHashPlus + i * nPhiPlus + j;
991 if( (nIndex >= nextEmRegion->
hashMin()) && (nIndex < nextEmRegion->hashMax()) ) {
993 neighbList[neighbourIndex] = nHash;
1007 const double& gEta,
const float& gPhi,
const double& absEta,
1013 unsigned int nIndex=0;
1018 const std::vector<short int>& prevSubdetRegion= emRegion->
prevSubdetRegion();
1019 int nPrevSubdetReg = prevSubdetRegion.size();
1020 if(nPrevSubdetReg > 0) {
1021 for(
int ireg=0; ireg<nPrevSubdetReg; ireg++) {
1026 double minEtaMinus = (double)(prevEmRegion->
etaMin());
1027 double maxEtaMinus = (double)(prevEmRegion->
etaMax());
1028 double margin = 0.25*std::min(gEta,gEtaMinus);
1029 if((minEtaMinus < absEta+gEta-margin) && (absEta+margin < maxEtaMinus)) {
1038 short int nPhiMinus = prevEmRegion->
phiN();
1040 unsigned int minHashMinus = prevEmRegion->
hashMin();
1041 float phiMargin = 0.25*std::min(gPhi,gPhiMinus);
1043 float rPhi = ((
index-minHash)%nPhi)*gPhi+emRegion->
phiMin();
1044 int nPhiMinusFirst = int(std::floor((rPhi -prevEmRegion->
phiMin())
1045 /gPhiMinus+phiMargin));
1046 int nPhiMinusNext = int(std::floor((rPhi+gPhi-prevEmRegion->
phiMin())
1047 /gPhiMinus+phiMargin));
1048 if ( nPhiMinusNext == nPhiMinusFirst ) nPhiMinusNext++;
1050 double fEtaMinus = (absEta-minEtaMinus) / gEtaMinus + margin ;
1052 double fEtaMaxMinus = (absEta+gEta-minEtaMinus) / gEtaMinus + margin ;
1053 int nEtaMinus = int(fEtaMinus);
1054 int nEtaMaxMinus = int(fEtaMaxMinus);
1055 if ( nEtaMaxMinus == nEtaMinus ) nEtaMaxMinus++;
1057 for(
int i=nEtaMinus; i<nEtaMaxMinus; i++) {
1058 for (
int j=nPhiMinusFirst; j<nPhiMinusNext;j++) {
1059 nIndex = minHashMinus + i * nPhiMinus + j;
1060 if( (nIndex >= prevEmRegion->
hashMin()) && (nIndex < prevEmRegion->hashMax()) ) {
1062 neighbList[neighbourIndex] = nHash;
1075 const double& gEta,
const float& gPhi,
const double& absEta,
1081 unsigned int nIndex=0;
1085 const std::vector<short int>& nextSubdetRegion= emRegion->
nextSubdetRegion();
1086 int nNextSubdetReg = nextSubdetRegion.size();
1087 if(nNextSubdetReg > 0) {
1088 for(
int ireg=0; ireg<nNextSubdetReg; ireg++) {
1092 double minEtaPlus = (double)(nextEmRegion->
etaMin());
1093 double maxEtaPlus = (double)(nextEmRegion->
etaMax());
1094 double margin = 0.25*std::min(gEta,gEtaPlus);
1095 if((minEtaPlus < absEta+gEta-margin) && (absEta+margin < maxEtaPlus)) {
1101 short int nPhiPlus = nextEmRegion->
phiN();
1102 unsigned int minHashPlus = nextEmRegion->
hashMin();
1103 float phiMargin = 0.25*std::min(gPhi,gPhiPlus);
1105 float rPhi = ((
index-minHash)%nPhi)*gPhi+emRegion->
phiMin();
1106 int nPhiPlusFirst = int(std::floor((rPhi -nextEmRegion->
phiMin())
1107 /gPhiPlus+phiMargin));
1108 int nPhiPlusNext = int(std::floor((rPhi+gPhi-nextEmRegion->
phiMin())
1109 /gPhiPlus+phiMargin));
1110 if ( nPhiPlusNext == nPhiPlusFirst ) nPhiPlusNext++;
1112 double fEtaPlus = (absEta-minEtaPlus) / gEtaPlus + margin ;
1114 double fEtaMaxPlus = (absEta+gEta-minEtaPlus) / gEtaPlus + margin ;
1115 int nEtaPlus = int(fEtaPlus) ;
1116 int nEtaMaxPlus = int(fEtaMaxPlus) ;
1117 if (nEtaMaxPlus == nEtaPlus) nEtaMaxPlus++;
1119 for(
int i=nEtaPlus; i<nEtaMaxPlus; i++) {
1120 for(
int j=nPhiPlusFirst; j<nPhiPlusNext; j++) {
1121 nIndex = minHashPlus + i * nPhiPlus + j;
1122 if( (nIndex >= nextEmRegion->
hashMin()) && (nIndex < nextEmRegion->hashMax()) ) {
1124 neighbList[neighbourIndex] = nHash;
1141 const std::vector<const IdDictRegion*>& vecOfDictRegions =
dictRegions();
1148 std::vector<Identifier>::const_iterator debut=
reg_begin() ;
1149 std::vector<Identifier>::const_iterator fin =
reg_end() ;
1150 for (; debut != fin; ++debut) {
1154 bool isBarrelMiddle =
false;
1164 if(etaMin >= 0 && phiMin >= 0) {
1191 unsigned int ireg0=0;
1208 const IdDictRegion* prevEtaDicReg = vecOfDictRegions[reg]->prev_abs_eta();
1210 const IdDictRegion* nextEtaDicReg = vecOfDictRegions[reg]->next_abs_eta();
1211 for(
unsigned int ireg=ireg0;ireg<ireg1;ireg++){
1212 if(vecOfDictRegions[ireg] == prevEtaDicReg) regForPrevEta = ireg;
1213 if(vecOfDictRegions[ireg] == nextEtaDicReg) regForNextEta = ireg;
1218 isBarrelMiddle =
true;
1220 regForPrevEta = reg+6;
1222 regForPrevEta = reg-6;
1230 std::vector<short int> regForPrevSamp;
1231 for (
const IdDictRegion* dictreg : vecOfDictRegions[reg]->prev_samp()) {
1232 for(
unsigned int ireg=ireg0;ireg<ireg1;ireg++){
1233 if(vecOfDictRegions[ireg] == dictreg) regForPrevSamp.push_back(ireg);
1237 std::vector<short int> regForNextSamp;
1238 for (
const IdDictRegion* dictreg : vecOfDictRegions[reg]->next_samp()) {
1239 for(
unsigned int ireg=ireg0;ireg<ireg1;ireg++){
1240 if(vecOfDictRegions[ireg] == dictreg) regForNextSamp.push_back(ireg);
1247 std::vector<short int> regForPrevSubdet;
1248 for (
const IdDictRegion* dictreg : vecOfDictRegions[reg]->prev_subdet()) {
1249 for(
unsigned int ireg=ireg0;ireg<ireg1;ireg++){
1250 if(vecOfDictRegions[ireg] == dictreg) regForPrevSubdet.push_back(ireg);
1254 std::vector<short int> regForNextSubdet;
1255 for (
const IdDictRegion* dictreg : vecOfDictRegions[reg]->next_subdet()) {
1256 for(
unsigned int ireg=ireg0;ireg<ireg1;ireg++){
1257 if(vecOfDictRegions[ireg] == dictreg) regForNextSubdet.push_back(ireg);
1266 regForPrevEta,regForNextEta,
1267 regForPrevSamp,regForNextSamp,
1268 regForPrevSubdet,regForNextSubdet);
1286 if(regId != lastRegId) {
1295 if ((
short int)hashReg != reg) {
1296 ATH_MSG_ERROR(
"init_neighbors: problem reg, hashReg = " << reg <<
" " << hashReg);
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_MSG_DEBUG(x,...)
#define ATH_MSG_ERROR(x,...)
#define ATH_MSG_WARNING(x,...)
Factor out code common between LArEM_ID and LArEM_SuperCell_ID.
virtual std::string dictionaryVersion(void) const override
bool m_do_checks
Flag for subclasses to know whether or not to perform checks.
bool m_do_neighbours
Flag for subclasses to know whether or not to perform neighbour initialization.
bool reinitialize(const IdDictMgr &dict_mgr)
Test whether an idhelper should be reinitialized based on the change of tags.
ExpandedIdentifier lar_em_exp(void) const
LAr.
virtual void setDictVersion(const IdDictMgr &dict_mgr, const std::string &name) override
int lar_field_value() const
std::string show_to_string(Identifier id, const IdContext *context=0, char sep='.') const
or provide the printout in string form
const std::string & group() const
Group name for this helper.
int lar_em_field_value() const
size_type hash_max() const
Return one more than the largest hash code.
float phi0(const IdentifierHash regHash) const
Return the minimum phi of region, or NOT_VALID.
const HashGroup & regions() const
Return the HashGroup for regions.
float eta0(const IdentifierHash regHash) const
Return the minimum eta of region, or NOT_VALID.
const std::vector< const IdDictRegion * > & dictRegions() const
Return the vector of IdDictRegion, accessed via region hash.
float etaGranularity(const IdentifierHash regHash) const
Return the eta granularity of a region, or NOT_VALID.
size_type region_hash_max() const
One more than the largest region hash code.
IdContext region_context() const
Return the context for regions.
size_type channel_hash_max() const
One more than the largest channel (cell) hash code.
CaloIDHelper(const std::string &name, const std::string &group)
Constructor.
int fill_vec_of_dict_regions(const std::string &group_name="")
Do basic initialization of the helper.
float phiGranularity(const IdentifierHash regHash) const
Return the phi granularity of a region, or NOT_VALID.
const std::string & name() const
Return the name for this helper.
const HashGroup & channels() const
Return the HashGroup for channels (cells).
void add(element_type value)
Append a value into a new field.
void clear()
Erase all fields.
This class saves the "context" of an expanded identifier (ExpandedIdentifier) for compact or hash ver...
int get_label_value(const std::string &field, const std::string &label, int &value) const
const std::string & name() const
Dictionary name.
Identifier::size_type size_type
const IdDictDictionary * find_dictionary(const std::string &name) const
Access dictionary by name.
element_type get_minimum() const
Query the values.
bool empty() const
If true, this field does not have any constraints, and may hold any value representable by element_ty...
element_type get_maximum() const
This is a "hash" representation of an Identifier.
small class holding the starting hash value, the min eta and the number of phi bins of each region
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
IdentifierHash region_hash(Identifier regionId) const
Convert a connected region Identifier to a hash code.
int region(const Identifier id) const
return region according to :
IdentifierHash channel_hash_binary_search(Identifier channelId) const
create hash id from channel id – method NOT optimised, please use channel_hash() above
std::vector< unsigned > m_cells
int eta(const Identifier id) const
return eta according to :
int eta_max(const Identifier regId) const
max value of eta index (-999 == failure)
Identifier region_id(const ExpandedIdentifier &exp_id) const
Build a cell identifier from an expanded identifier.
size_type m_SAMPLING_INDEX
int phi_max(const Identifier regId) const
max value of phi index (-999 == failure)
int eta_min(const Identifier regId) const
min value of eta index (-999 == failure)
id_range em_range() const
Range over full set of EM Identifiers.
void region_id_checks(int barrel_ec, int sampling, int region) const
bool is_supercell(const Identifier id) const
Test if the identifier represents a supercell.
IdDictFieldImplementation m_em_impl
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
IdDictFieldImplementation m_phi_impl
IdDictFieldImplementation m_sampling_impl
IdDictFieldImplementation m_region_impl
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
size_type m_em_region_index
int initialize_base_from_dictionary(const IdDictMgr &dict_mgr, const std::string &group_name)
initialization from the identifier dictionary
std::vector< LArEM_region * > m_vecOfRegions
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 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 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
int phi(const Identifier id) const
return phi according to :
IdDictFieldImplementation m_lar_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)
int phi_min_init(const Identifier regId) const
int phi_min(const Identifier regId) const
min value of phi index (-999 == failure)
MultiRange m_full_em_range
static int get_prevInPhi(const LArEM_region *emRegion, const unsigned int &index, const short int &nPhi, const unsigned int &minHash, int &neighbourIndex, IdentifierHash *neighbList)
IdDictFieldImplementation m_bec_impl
MultiRange m_full_region_range
Identifier channel_id(const ExpandedIdentifier &exp_id) const
Build a cell identifier from an expanded identifier.
std::vector< int > m_vecOfPhiMin
std::vector< HashCalc > m_hash_calcs
IdDictFieldImplementation m_slar_impl
void channel_id_checks(int barrel_ec, int sampling, int region, int eta, int phi) const
id_iterator reg_end() const
end iterator over set of Region Identifiers
IdDictFieldImplementation m_bec_reg_impl
bool twoSymSides() const
True if the + and - sides of the calorimeter are identical (true layout).
IdDictFieldImplementation m_eta_impl
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 :
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
id_iterator reg_begin() const
begin iterator over set of Region Identifiers
IdentifierHash channel_hash(Identifier channelId) const
create hash id from channel id
int initLevelsFromDict(const std::string &group_name)
LArEM_Base_ID(const std::string &name, const std::string &group, bool supercell)
Constructor.
This class provides an interface to deal with regions in the neighbours finding.
float phiGranularity() const
phi granularity
const std::vector< short int > & prevSamplingRegion() const
region number of the prev region in sampling
const std::vector< short int > & nextSubdetRegion() const
region number of the next region in subdet
short int nextEtaRegion() const
region number of the next region in eta
bool isEtaMax(unsigned int index) const
is the considered cell in the last eta bin of the region ?
unsigned int hashMax() const
hash Id of the last cell of the region +1
short int prevEtaRegion() const
region number of the previous region in eta
float etaGranularity() const
eta granularity
float etaMax() const
end eta
const std::vector< short int > & nextSamplingRegion() const
region number of the next region in sampling
unsigned int hashMin() const
hash Id of the first cell of the region
const std::vector< short int > & prevSubdetRegion() const
region number of the prev region in subdet
bool isFirstBarrelRegion() const
true if region close to barrel middle
float etaMin() const
starting eta
float phiMin() const
starting phi
bool isPhiMin(unsigned int index) const
is the considered cell in the first phi bin of the region ?
short int phiN() const
number of phi bins
bool isEtaMin(unsigned int index) const
is the considered cell in the first eta bin of the region ?
bool isPhiMax(unsigned int index) const
is the considered cell in the last phi bin of the region ?
Exception class for LAr Identifiers.
A Range describes the possible ranges for the field values of an ExpandedIdentifier.
Tell the compiler to optimize assuming that FP may trap.
#define CXXUTILS_TRAPPING_FP