27 const std::string&
group,
37 std::vector<LArEM_region*>::iterator first =
m_vecOfRegions.begin();
39 for (; first != last; ++first)
delete (*first);
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 = "
225 ATH_MSG_ERROR(
"initLevelsFromDict - dictionary NOT initialized");
246 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'subdet' field");
255 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'part' field");
264 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'barrel-endcap' field");
273 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'sampling' field");
282 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'region' field");
291 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'eta' field");
300 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'phi' field");
309 ATH_MSG_ERROR(
"initLevelsFromDict - unable to find 'is-slar' field");
317 ATH_MSG_ERROR(
"initLevelsFromDict - cannot find " << group_name <<
" group' field ");
333 ATH_MSG_DEBUG(
"decode index and bit fields for each level: ");
349 if (
channels().init (*
this,
"channels",
353 if (
regions().init (*
this,
"regions",
364 const std::string& group_name)
371 ATH_MSG_DEBUG(
"Request to reinitialize not satisfied - tags have not changed");
392 if (atlasDict->
get_label_value(
"subdet",
"LArCalorimeter", larField)) {
393 ATH_MSG_ERROR(
"Could not get value for label 'LArCalorimeter' of field 'subdet' in dictionary "
394 << atlasDict->
name());
400 if (
dict()->get_label_value(
"part",
"LArEM", larEmField)) {
401 ATH_MSG_ERROR(
"Could not get value for label 'LArEM' of field 'part' in dictionary "
408 reg_id.
add(larField);
409 reg_id.
add(larEmField);
543 std::vector<IdentifierHash>& neighbourList)
const
547 neighbourList.clear();
550 ATH_MSG_WARNING(
"neighbours not initialized !!! returning empty list");
559 const short int maxNeighb=22;
561 int neighbourIndex = 0;
564 unsigned int index=id;
570 unsigned short int regionN = (itr -
m_cells.begin()) - 1;
575 short int nPhi = emRegion->
phiN();
577 unsigned int minHash = emRegion->
hashMin();
578 unsigned int maxHash = emRegion->
hashMax();
590 prevNeighbInPhi=neighbList[neighbourIndex-1];
605 nextNeighbInPhi=neighbList[neighbourIndex-1];
617 get_prevInEta(emRegion,
index, nPhi, gPhi, minHash, neighbourIndex, neighbList, nPrevBiggerCell);
625 get_nextInEta(emRegion,
index, nPhi, gPhi, maxHash, neighbourIndex, neighbList, nNextBiggerCell);
633 unsigned int index1=prevNeighbInPhi;
634 int oldNeighbourIndex = neighbourIndex;
639 get_prevInEta(emRegion, index1, nPhi, gPhi, minHash, neighbourIndex, neighbList, nPrevBiggerCell);
640 if ( neighbourIndex > oldNeighbourIndex+1 ) {
641 neighbList[oldNeighbourIndex] = neighbList[neighbourIndex-1];
642 neighbourIndex = oldNeighbourIndex+1;
644 oldNeighbourIndex = neighbourIndex;
645 get_nextInEta(emRegion, index1, nPhi, gPhi, maxHash, neighbourIndex, neighbList, nNextBiggerCell);
646 if ( neighbourIndex > oldNeighbourIndex+1 ) {
647 neighbList[oldNeighbourIndex] = neighbList[neighbourIndex-1];
648 neighbourIndex = oldNeighbourIndex+1;
653 unsigned int index2=nextNeighbInPhi;
654 int oldNeighbourIndex = neighbourIndex;
659 get_prevInEta(emRegion, index2, nPhi, gPhi, minHash, neighbourIndex, neighbList, nPrevBiggerCell);
660 if ( neighbourIndex > oldNeighbourIndex+1 ) {
661 neighbourIndex = oldNeighbourIndex+1;
663 oldNeighbourIndex = neighbourIndex;
664 get_nextInEta(emRegion, index2, nPhi, gPhi, maxHash, neighbourIndex, neighbList, nNextBiggerCell);
665 if ( neighbourIndex > oldNeighbourIndex+1 ) {
666 neighbourIndex = oldNeighbourIndex+1;
679 int nEta = int( (
index-minHash) / nPhi);
680 double absEta = (double)(emRegion->
etaMin()) + (double)(nEta * gEta);
684 get_prevInSamp(emRegion,
index, nPhi, minHash, gEta, gPhi, absEta, neighbourIndex, neighbList);
689 get_nextInSamp(emRegion,
index, nPhi, minHash, gEta, gPhi, absEta, neighbourIndex, neighbList);
700 int nEta = int( (
index-minHash) / nPhi);
701 double absEta = (double)(emRegion->
etaMin()) + (double)(nEta * gEta);
714 neighbourList.resize(neighbourIndex);
715 if (neighbourIndex > 0) {
716 if (neighbourIndex <= maxNeighb) {
717 std::copy (&neighbList[0], &neighbList[neighbourIndex], neighbourList.begin());
720 ATH_MSG_WARNING(
" more than 22 neighbours for this cell, NONE will be retained");
732 unsigned int nIndex =
index-1;
734 if( ((
index-minHash)%(nPhi)) == 0 ) nIndex=
index+nPhi-1;
736 neighbList[neighbourIndex] = nHash;
748 unsigned int nIndex =
index+1;
749 if( ((
index-minHash+1)%(nPhi)) == 0 ) nIndex=
index-nPhi+1;
751 neighbList[neighbourIndex] = nHash;
759 const unsigned int& minHash,
760 int& neighbourIndex,
IdentifierHash* neighbList,
unsigned int& nBiggerCell)
const
764 unsigned int nIndex = 0;
775 unsigned int minHashMinus = prevEmRegion->
hashMin();
776 nIndex = minHashMinus +
index-minHash ;
778 neighbList[neighbourIndex] = nHash;
787 short int nPhiMinus = prevEmRegion->
phiN();
789 unsigned int maxHashMinus = prevEmRegion->
hashMax();
790 float phiMargin = 0.25*std::min(gPhi,gPhiMinus);
791 float rPhi = (
index-minHash)*gPhi+emRegion->
phiMin();
792 int nPhiMinusFirst = int(std::floor((rPhi -prevEmRegion->
phiMin())
793 /gPhiMinus+phiMargin))
794 +maxHashMinus-nPhiMinus;
795 int nPhiMinusNext = int(std::floor((rPhi+gPhi-prevEmRegion->
phiMin())
796 /gPhiMinus+phiMargin))
797 +maxHashMinus-nPhiMinus;
798 if ( nPhiMinusNext == nPhiMinusFirst ) nPhiMinusNext++;
800 for(
int i=nPhiMinusFirst; i<nPhiMinusNext; i++){
802 if(nIndex != nBiggerCell) {
804 neighbList[neighbourIndex] = nHash;
809 if(gPhi < gPhiMinus && nBiggerCell ==
NOT_VALID_HASH) nBiggerCell=nIndex;
816 nIndex =
index - nPhi;
818 neighbList[neighbourIndex] = nHash;
826 const unsigned int& maxHash,
827 int& neighbourIndex,
IdentifierHash* neighbList,
unsigned int& nBiggerCell)
const
831 unsigned int nIndex = 0;
845 unsigned int minHashPlus = nextEmRegion->
hashMin();
846 float phiMargin = 0.25*std::min(gPhi,gPhiPlus);
847 float rPhi = (
index+nPhi-maxHash)*gPhi+emRegion->
phiMin();
848 int nPhiPlusFirst = int(std::floor((rPhi -nextEmRegion->
phiMin())
849 /gPhiPlus+phiMargin))+minHashPlus;
850 int nPhiPlusNext = int(std::floor((rPhi+gPhi-nextEmRegion->
phiMin())
851 /gPhiPlus+phiMargin))+minHashPlus;
852 if ( nPhiPlusNext == nPhiPlusFirst ) nPhiPlusNext++;
854 for(
int i=nPhiPlusFirst; i<nPhiPlusNext; i++){
856 if(nIndex != nBiggerCell) {
858 neighbList[neighbourIndex] = nHash;
863 if(gPhi < gPhiPlus && nBiggerCell ==
NOT_VALID_HASH) nBiggerCell=nIndex;
869 nIndex =
index + nPhi;
871 neighbList[neighbourIndex] = nHash;
879 const double& gEta,
const float& gPhi,
const double& absEta,
885 unsigned int nIndex=0;
891 int nPrevSampReg = prevSampRegion.size();
892 if(nPrevSampReg > 0) {
893 for(
int ireg=0; ireg<nPrevSampReg; ireg++) {
898 double minEtaMinus = (double)(prevEmRegion->
etaMin());
899 double maxEtaMinus = (double)(prevEmRegion->
etaMax());
900 double margin = 0.25*std::min(gEta,gEtaMinus);
901 if((minEtaMinus < absEta+gEta-margin) && (absEta+margin < maxEtaMinus)) {
910 short int nPhiMinus = prevEmRegion->
phiN();
912 unsigned int minHashMinus = prevEmRegion->
hashMin();
913 float phiMargin = 0.25*std::min(gPhi,gPhiMinus);
915 float rPhi = ((
index-minHash)%nPhi)*gPhi+emRegion->
phiMin();
916 int nPhiMinusFirst = int(std::floor((rPhi -prevEmRegion->
phiMin())
917 /gPhiMinus+phiMargin));
918 int nPhiMinusNext = int(std::floor((rPhi+gPhi-prevEmRegion->
phiMin())
919 /gPhiMinus+phiMargin));
920 if ( nPhiMinusNext == nPhiMinusFirst ) nPhiMinusNext++;
923 double fEtaMinus = (absEta-minEtaMinus) / gEtaMinus + margin ;
925 double fEtaMaxMinus = (absEta+gEta-minEtaMinus) / gEtaMinus + margin ;
926 int nEtaMinus = int(fEtaMinus);
927 int nEtaMaxMinus = int(fEtaMaxMinus);
928 if ( nEtaMaxMinus == nEtaMinus ) nEtaMaxMinus++;
929 for(
int i=nEtaMinus; i<nEtaMaxMinus; i++) {
930 for (
int j=nPhiMinusFirst; j<nPhiMinusNext;j++) {
931 nIndex = minHashMinus + i * nPhiMinus + j;
932 if( (nIndex >= prevEmRegion->
hashMin()) && (nIndex < prevEmRegion->hashMax()) ) {
934 neighbList[neighbourIndex] = nHash;
947 const double& gEta,
const float& gPhi,
const double& absEta,
953 unsigned int nIndex=0;
958 int nNextSampReg = nextSampRegion.size();
959 if(nNextSampReg > 0) {
960 for(
int ireg=0; ireg<nNextSampReg; ireg++) {
964 double minEtaPlus = (double)(nextEmRegion->
etaMin());
965 double maxEtaPlus = (double)(nextEmRegion->
etaMax());
966 double margin = 0.25*std::min(gEta,gEtaPlus);
967 if((minEtaPlus < absEta+gEta-margin) && (absEta+margin < maxEtaPlus)) {
973 short int nPhiPlus = nextEmRegion->
phiN();
974 unsigned int minHashPlus = nextEmRegion->
hashMin();
975 float phiMargin = 0.25*std::min(gPhi,gPhiPlus);
977 float rPhi = ((
index-minHash)%nPhi)*gPhi+emRegion->
phiMin();
978 int nPhiPlusFirst = int(std::floor((rPhi -nextEmRegion->
phiMin())
979 /gPhiPlus+phiMargin));
980 int nPhiPlusNext = int(std::floor((rPhi+gPhi-nextEmRegion->
phiMin())
981 /gPhiPlus+phiMargin));
982 if ( nPhiPlusNext == nPhiPlusFirst ) nPhiPlusNext++;
984 double fEtaPlus = (absEta-minEtaPlus) / gEtaPlus + margin ;
986 double fEtaMaxPlus = (absEta+gEta-minEtaPlus) / gEtaPlus + margin ;
987 int nEtaPlus = int(fEtaPlus) ;
988 int nEtaMaxPlus = int(fEtaMaxPlus) ;
989 if (nEtaMaxPlus == nEtaPlus) nEtaMaxPlus++;
991 for(
int i=nEtaPlus; i<nEtaMaxPlus; i++){
992 for(
int j=nPhiPlusFirst; j<nPhiPlusNext; j++){
993 nIndex = minHashPlus + i * nPhiPlus + j;
994 if( (nIndex >= nextEmRegion->
hashMin()) && (nIndex < nextEmRegion->hashMax()) ) {
996 neighbList[neighbourIndex] = nHash;
1010 const double& gEta,
const float& gPhi,
const double& absEta,
1016 unsigned int nIndex=0;
1021 const std::vector<short int>& prevSubdetRegion= emRegion->
prevSubdetRegion();
1022 int nPrevSubdetReg = prevSubdetRegion.size();
1023 if(nPrevSubdetReg > 0) {
1024 for(
int ireg=0; ireg<nPrevSubdetReg; ireg++) {
1029 double minEtaMinus = (double)(prevEmRegion->
etaMin());
1030 double maxEtaMinus = (double)(prevEmRegion->
etaMax());
1031 double margin = 0.25*std::min(gEta,gEtaMinus);
1032 if((minEtaMinus < absEta+gEta-margin) && (absEta+margin < maxEtaMinus)) {
1041 short int nPhiMinus = prevEmRegion->
phiN();
1043 unsigned int minHashMinus = prevEmRegion->
hashMin();
1044 float phiMargin = 0.25*std::min(gPhi,gPhiMinus);
1046 float rPhi = ((
index-minHash)%nPhi)*gPhi+emRegion->
phiMin();
1047 int nPhiMinusFirst = int(std::floor((rPhi -prevEmRegion->
phiMin())
1048 /gPhiMinus+phiMargin));
1049 int nPhiMinusNext = int(std::floor((rPhi+gPhi-prevEmRegion->
phiMin())
1050 /gPhiMinus+phiMargin));
1051 if ( nPhiMinusNext == nPhiMinusFirst ) nPhiMinusNext++;
1053 double fEtaMinus = (absEta-minEtaMinus) / gEtaMinus + margin ;
1055 double fEtaMaxMinus = (absEta+gEta-minEtaMinus) / gEtaMinus + margin ;
1056 int nEtaMinus = int(fEtaMinus);
1057 int nEtaMaxMinus = int(fEtaMaxMinus);
1058 if ( nEtaMaxMinus == nEtaMinus ) nEtaMaxMinus++;
1060 for(
int i=nEtaMinus; i<nEtaMaxMinus; i++) {
1061 for (
int j=nPhiMinusFirst; j<nPhiMinusNext;j++) {
1062 nIndex = minHashMinus + i * nPhiMinus + j;
1063 if( (nIndex >= prevEmRegion->
hashMin()) && (nIndex < prevEmRegion->hashMax()) ) {
1065 neighbList[neighbourIndex] = nHash;
1078 const double& gEta,
const float& gPhi,
const double& absEta,
1084 unsigned int nIndex=0;
1088 const std::vector<short int>& nextSubdetRegion= emRegion->
nextSubdetRegion();
1089 int nNextSubdetReg = nextSubdetRegion.size();
1090 if(nNextSubdetReg > 0) {
1091 for(
int ireg=0; ireg<nNextSubdetReg; ireg++) {
1095 double minEtaPlus = (double)(nextEmRegion->
etaMin());
1096 double maxEtaPlus = (double)(nextEmRegion->
etaMax());
1097 double margin = 0.25*std::min(gEta,gEtaPlus);
1098 if((minEtaPlus < absEta+gEta-margin) && (absEta+margin < maxEtaPlus)) {
1104 short int nPhiPlus = nextEmRegion->
phiN();
1105 unsigned int minHashPlus = nextEmRegion->
hashMin();
1106 float phiMargin = 0.25*std::min(gPhi,gPhiPlus);
1108 float rPhi = ((
index-minHash)%nPhi)*gPhi+emRegion->
phiMin();
1109 int nPhiPlusFirst = int(std::floor((rPhi -nextEmRegion->
phiMin())
1110 /gPhiPlus+phiMargin));
1111 int nPhiPlusNext = int(std::floor((rPhi+gPhi-nextEmRegion->
phiMin())
1112 /gPhiPlus+phiMargin));
1113 if ( nPhiPlusNext == nPhiPlusFirst ) nPhiPlusNext++;
1115 double fEtaPlus = (absEta-minEtaPlus) / gEtaPlus + margin ;
1117 double fEtaMaxPlus = (absEta+gEta-minEtaPlus) / gEtaPlus + margin ;
1118 int nEtaPlus = int(fEtaPlus) ;
1119 int nEtaMaxPlus = int(fEtaMaxPlus) ;
1120 if (nEtaMaxPlus == nEtaPlus) nEtaMaxPlus++;
1122 for(
int i=nEtaPlus; i<nEtaMaxPlus; i++) {
1123 for(
int j=nPhiPlusFirst; j<nPhiPlusNext; j++) {
1124 nIndex = minHashPlus + i * nPhiPlus + j;
1125 if( (nIndex >= nextEmRegion->
hashMin()) && (nIndex < nextEmRegion->hashMax()) ) {
1127 neighbList[neighbourIndex] = nHash;
1144 const std::vector<const IdDictRegion*>& vecOfDictRegions =
dictRegions();
1151 std::vector<Identifier>::const_iterator debut=
reg_begin() ;
1152 std::vector<Identifier>::const_iterator fin =
reg_end() ;
1153 for (; debut != fin; ++debut) {
1157 bool isBarrelMiddle =
false;
1167 if(etaMin >= 0 && phiMin >= 0) {
1194 unsigned int ireg0=0;
1211 const IdDictRegion* prevEtaDicReg = vecOfDictRegions[reg]->prev_abs_eta();
1213 const IdDictRegion* nextEtaDicReg = vecOfDictRegions[reg]->next_abs_eta();
1214 for(
unsigned int ireg=ireg0;ireg<ireg1;ireg++){
1215 if(vecOfDictRegions[ireg] == prevEtaDicReg) regForPrevEta = ireg;
1216 if(vecOfDictRegions[ireg] == nextEtaDicReg) regForNextEta = ireg;
1221 isBarrelMiddle =
true;
1223 regForPrevEta = reg+6;
1225 regForPrevEta = reg-6;
1233 std::vector<short int> regForPrevSamp;
1234 for (
const IdDictRegion* dictreg : vecOfDictRegions[reg]->prev_samp()) {
1235 for(
unsigned int ireg=ireg0;ireg<ireg1;ireg++){
1236 if(vecOfDictRegions[ireg] == dictreg) regForPrevSamp.push_back(ireg);
1240 std::vector<short int> regForNextSamp;
1241 for (
const IdDictRegion* dictreg : vecOfDictRegions[reg]->next_samp()) {
1242 for(
unsigned int ireg=ireg0;ireg<ireg1;ireg++){
1243 if(vecOfDictRegions[ireg] == dictreg) regForNextSamp.push_back(ireg);
1250 std::vector<short int> regForPrevSubdet;
1251 for (
const IdDictRegion* dictreg : vecOfDictRegions[reg]->prev_subdet()) {
1252 for(
unsigned int ireg=ireg0;ireg<ireg1;ireg++){
1253 if(vecOfDictRegions[ireg] == dictreg) regForPrevSubdet.push_back(ireg);
1257 std::vector<short int> regForNextSubdet;
1258 for (
const IdDictRegion* dictreg : vecOfDictRegions[reg]->next_subdet()) {
1259 for(
unsigned int ireg=ireg0;ireg<ireg1;ireg++){
1260 if(vecOfDictRegions[ireg] == dictreg) regForNextSubdet.push_back(ireg);
1269 regForPrevEta,regForNextEta,
1270 regForPrevSamp,regForNextSamp,
1271 regForPrevSubdet,regForNextSubdet);
1289 if(regId != lastRegId) {
1298 if ((
short int)hashReg != reg) {
1299 ATH_MSG_ERROR(
"init_neighbors: problem reg, hashReg = " << reg <<
" " << hashReg);
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#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.
int initialize_base_from_dictionary(const IdDictMgr &dict_mgr, const std::string &dict_name)
Do basic initialization of the helper.
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="")
Initialize the list of detector regions.
float phiGranularity(const IdentifierHash regHash) const
Return the phi granularity of a region, or NOT_VALID.
const IdDictDictionary * dict() const
Return the dictionary for this subdetector.
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...
size_type end_index() const
MultiRange build_multirange() const
Get MultiRange for full dictionary.
int get_label_value(const std::string &field, const std::string &label, int &value) const
IdDictGroup * find_group(const std::string &group_name)
const std::string & name() const
Dictionary name.
const IdDictField * find_field(const std::string &name) const
const IdDictRegion & region(size_t i) const
Region at index i.
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.
std::string strformat(const char *fmt,...)
return a std::string according to a format fmt and varargs
Tell the compiler to optimize assuming that FP may trap.
#define CXXUTILS_TRAPPING_FP