#include <Geometry/ForwardGeometry/interface/ZdcTopology.h>
Public Member Functions | |
virtual std::vector< DetId > | down (const DetId &id) const |
Get the neighbors of the given cell in down direction (inward). | |
virtual std::vector< DetId > | east (const DetId &id) const |
Get the neighbors of the given cell in east direction. | |
int | exclude (int zside, HcalZDCDetId::Section section, int ich1, int ich2) |
Exclude a range of channels (deph) for a given subdetector. | |
void | exclude (int zside, HcalZDCDetId::Section section) |
Exclude a section, in either side (+1 positive, -1 negative). | |
void | exclude (int zside) |
Exclude a side. | |
void | exclude (const HcalZDCDetId &id) |
Exlucde a cell. | |
int | firstCell (HcalZDCDetId::Section section) const |
int | lastCell (HcalZDCDetId::Section section) const |
virtual std::vector< DetId > | longitudinal (const DetId &id) const |
Get the longitudinal neighbors (Z) of the given cell. | |
int | ncells (HcalZDCDetId::Section section) const |
virtual std::vector< DetId > | north (const DetId &id) const |
Get the neighbors of the given cell in north direction. | |
virtual std::vector< DetId > | south (const DetId &id) const |
Get the neighbors of the given cell in south direction. | |
virtual std::vector< DetId > | transverse (const DetId &id) const |
Get the transverse (X) neighbors of the given cell. | |
virtual std::vector< DetId > | up (const DetId &id) const |
Get the neighbors of the given cell in up direction (outward). | |
virtual bool | valid (const HcalZDCDetId &id) const |
Is this a valid cell id? | |
virtual std::vector< DetId > | west (const DetId &id) const |
Get the neighbors of the given cell in west direction. | |
ZdcTopology () | |
Private Member Functions | |
int | firstEMModule () const |
int | firstHADModule () const |
int | firstLUMModule () const |
bool | isExcluded (const HcalZDCDetId &id) const |
int | lastEMModule () const |
int | lastHADModule () const |
int | lastLUMModule () const |
bool | validRaw (const HcalZDCDetId &id) const |
Private Attributes | |
bool | excludeEM_ |
bool | excludeHAD_ |
bool | excludeLUM_ |
bool | excludeZN_ |
bool | excludeZP_ |
std::vector< HcalZDCDetId > | exclusionList_ |
int | firstEMModule_ |
int | firstHADModule_ |
int | firstLUMModule_ |
int | lastEMModule_ |
int | lastHADModule_ |
int | lastLUMModule_ |
Definition at line 15 of file ZdcTopology.h.
ZdcTopology::ZdcTopology | ( | ) |
Definition at line 10 of file ZdcTopology.cc.
00010 : 00011 excludeEM_(false), 00012 excludeHAD_(false), 00013 excludeLUM_(false), 00014 excludeZP_(false), 00015 excludeZN_(false), 00016 firstEMModule_(1), 00017 lastEMModule_(5), 00018 firstHADModule_(1), 00019 lastHADModule_(4), 00020 firstLUMModule_(1), 00021 lastLUMModule_(2) 00022 { 00023 }
Get the neighbors of the given cell in down direction (inward).
Implements CaloSubdetectorTopology.
Definition at line 230 of file ZdcTopology.cc.
References GenMuonPlsPt100GeV_cfg::cout, and lat::endl().
00231 { 00232 std::cout << "ZdcTopology::down() not yet implemented" << std::endl; 00233 std::vector<DetId> vNeighborsDetId; 00234 return vNeighborsDetId; 00235 }
Get the neighbors of the given cell in east direction.
Implements CaloSubdetectorTopology.
Definition at line 198 of file ZdcTopology.cc.
References GenMuonPlsPt100GeV_cfg::cout, and lat::endl().
00199 { 00200 std::cout << "ZdcTopology::east() not yet implemented" << std::endl; 00201 std::vector<DetId> vNeighborsDetId; 00202 return vNeighborsDetId; 00203 }
int ZdcTopology::exclude | ( | int | zside, | |
HcalZDCDetId::Section | section, | |||
int | ich1, | |||
int | ich2 | |||
) |
Exclude a range of channels (deph) for a given subdetector.
Definition at line 89 of file ZdcTopology.cc.
References HcalZDCDetId::EM, exclude(), excludeEM_, excludeHAD_, excludeLUM_, excludeZN_, excludeZP_, HcalZDCDetId::HAD, id, HcalZDCDetId::LUM, n, and validRaw().
00089 { 00090 bool exed = false; 00091 switch(zside){ 00092 case( 1): exed = excludeZP_; break; 00093 case(-1): exed = excludeZN_; break; 00094 default: exed = false; 00095 } 00096 if (exed) return 0; 00097 00098 switch (section) { 00099 case(HcalZDCDetId::EM) : exed = excludeEM_; break; 00100 case(HcalZDCDetId::HAD) : exed = excludeHAD_; break; 00101 case(HcalZDCDetId::LUM) : exed = excludeLUM_; break; 00102 default: exed = false; 00103 } 00104 if (exed) return 0; 00105 00106 bool isPositive = false; 00107 if(zside = 1)isPositive = true; 00108 00109 int n = 0; 00110 for (int ich = ich1; ich < ich2; ich++){ 00111 HcalZDCDetId id(section, isPositive, ich); 00112 if(validRaw(id))exclude(id); 00113 n++; 00114 } 00115 return n; 00116 }
void ZdcTopology::exclude | ( | int | zside, | |
HcalZDCDetId::Section | section | |||
) |
Exclude a section, in either side (+1 positive, -1 negative).
Definition at line 75 of file ZdcTopology.cc.
References HcalZDCDetId::EM, excludeEM_, excludeHAD_, excludeLUM_, excludeZN_, excludeZP_, HcalZDCDetId::HAD, and HcalZDCDetId::LUM.
00075 { 00076 switch(zside){ 00077 case( 1): excludeZP_ = true; break; 00078 case(-1): excludeZN_ = true; break; 00079 default: break; 00080 } 00081 switch (section) { 00082 case(HcalZDCDetId::EM) : excludeEM_ = true; break; 00083 case(HcalZDCDetId::HAD) : excludeHAD_ = true; break; 00084 case(HcalZDCDetId::LUM) : excludeLUM_ = true; break; 00085 default: break; 00086 } 00087 }
Exclude a side.
Definition at line 67 of file ZdcTopology.cc.
References excludeZN_, and excludeZP_.
00067 { 00068 switch(zside){ 00069 case( 1): excludeZP_ = true; break; 00070 case(-1): excludeZN_ = true; break; 00071 default: break; 00072 } 00073 }
void ZdcTopology::exclude | ( | const HcalZDCDetId & | id | ) |
Exlucde a cell.
Definition at line 59 of file ZdcTopology.cc.
References exclusionList_, and i.
Referenced by exclude().
00059 { 00060 std::vector<HcalZDCDetId>::iterator 00061 i=std::lower_bound(exclusionList_.begin(),exclusionList_.end(),id); 00062 if (i==exclusionList_.end() || *i!=id) { 00063 exclusionList_.insert(i,id); 00064 } 00065 }
int ZdcTopology::firstCell | ( | HcalZDCDetId::Section | section | ) | const |
Definition at line 248 of file ZdcTopology.cc.
References HcalZDCDetId::EM, firstEMModule_, firstHADModule_, firstLUMModule_, HcalZDCDetId::HAD, HcalZDCDetId::LUM, and HcalZDCDetId::Unknown.
00248 { 00249 int firstCell = 0; 00250 switch (section) { 00251 case(HcalZDCDetId::EM) : firstCell = firstEMModule_ ; break; 00252 case(HcalZDCDetId::HAD) : firstCell = firstHADModule_; break; 00253 case(HcalZDCDetId::LUM) : firstCell = firstLUMModule_; break; 00254 case(HcalZDCDetId::Unknown) : firstCell = 0; break; 00255 } 00256 return firstCell; 00257 }
int ZdcTopology::firstEMModule | ( | ) | const [inline, private] |
Definition at line 66 of file ZdcTopology.h.
References firstEMModule_.
00066 {return firstEMModule_;}
int ZdcTopology::firstHADModule | ( | ) | const [inline, private] |
Definition at line 67 of file ZdcTopology.h.
References firstHADModule_.
00067 {return firstHADModule_;}
int ZdcTopology::firstLUMModule | ( | ) | const [inline, private] |
Definition at line 68 of file ZdcTopology.h.
References firstLUMModule_.
00068 {return firstLUMModule_;}
bool ZdcTopology::isExcluded | ( | const HcalZDCDetId & | id | ) | const [private] |
Definition at line 32 of file ZdcTopology.cc.
References HcalZDCDetId::EM, excludeEM_, excludeHAD_, excludeLUM_, excludeZN_, excludeZP_, exclusionList_, HcalZDCDetId::HAD, i, and HcalZDCDetId::LUM.
Referenced by valid().
00032 { 00033 bool exed=false; 00034 00035 //check the for side exclusions 00036 switch(id.zside()){ 00037 case( 1): exed = excludeZP_; break; 00038 case(-1): exed = excludeZN_; break; 00039 default: exed = false; 00040 } 00041 00042 // check for section exclutions 00043 switch (id.section()) { 00044 case(HcalZDCDetId::EM) : exed = excludeEM_; break; 00045 case(HcalZDCDetId::HAD) : exed = excludeHAD_; break; 00046 case(HcalZDCDetId::LUM) : exed = excludeLUM_; break; 00047 default: exed = false; 00048 } 00049 00050 // check the entire list 00051 if (!exed && !exclusionList_.empty()) { 00052 std::vector<HcalZDCDetId>::const_iterator 00053 i=std::lower_bound(exclusionList_.begin(),exclusionList_.end(),id); 00054 if (i!=exclusionList_.end() && *i==id) exed=true; 00055 } 00056 return exed; 00057 }
int ZdcTopology::lastCell | ( | HcalZDCDetId::Section | section | ) | const |
Definition at line 259 of file ZdcTopology.cc.
References HcalZDCDetId::EM, HcalZDCDetId::HAD, lastEMModule_, lastHADModule_, lastLUMModule_, HcalZDCDetId::LUM, and HcalZDCDetId::Unknown.
00259 { 00260 int lastCell = 0; 00261 switch (section) { 00262 case(HcalZDCDetId::EM) : lastCell = lastEMModule_; break; 00263 case(HcalZDCDetId::HAD) : lastCell = lastHADModule_; break; 00264 case(HcalZDCDetId::LUM) : lastCell = lastLUMModule_; break; 00265 case(HcalZDCDetId::Unknown) : lastCell = 0; break; 00266 } 00267 return lastCell; 00268 }
int ZdcTopology::lastEMModule | ( | ) | const [inline, private] |
Definition at line 69 of file ZdcTopology.h.
References lastEMModule_.
00069 {return lastEMModule_;}
int ZdcTopology::lastHADModule | ( | ) | const [inline, private] |
Definition at line 70 of file ZdcTopology.h.
References lastHADModule_.
00070 {return lastHADModule_;}
int ZdcTopology::lastLUMModule | ( | ) | const [inline, private] |
Definition at line 71 of file ZdcTopology.h.
References lastLUMModule_.
00071 {return lastLUMModule_;}
Get the longitudinal neighbors (Z) of the given cell.
Definition at line 159 of file ZdcTopology.cc.
References HcalZDCDetId::depth(), HcalZDCDetId::HAD, ICH_HAD_MAX, ICH_LUM_MAX, HcalZDCDetId::LUM, DetId::rawId(), HcalZDCDetId::section(), validRaw(), and HcalZDCDetId::zside().
00159 { 00160 std::vector<DetId> vNeighborsDetId; 00161 HcalZDCDetId zdcId = HcalZDCDetId(id); 00162 HcalZDCDetId zdcDetId; 00163 if(validRaw(zdcId) && zdcId.section()== HcalZDCDetId::HAD){ 00164 bool isPositive = false; 00165 if(zdcId.zside()==1)isPositive = true; 00166 if(zdcId.depth()==1){ 00167 zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.depth()+1); 00168 vNeighborsDetId.push_back(zdcDetId.rawId()); 00169 return vNeighborsDetId; 00170 } 00171 if(zdcId.depth()== ICH_HAD_MAX){ 00172 zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.depth()-1); 00173 vNeighborsDetId.push_back(zdcDetId.rawId()); 00174 return vNeighborsDetId; 00175 } 00176 zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.depth()-1); 00177 vNeighborsDetId.push_back(zdcDetId.rawId()); 00178 zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.depth()+1); 00179 vNeighborsDetId.push_back(zdcDetId.rawId()); 00180 } 00181 if(validRaw(zdcId) && zdcId.section()== HcalZDCDetId::LUM){ 00182 bool isPositive = false; 00183 if(zdcId.zside()==1)isPositive = true; 00184 if(zdcId.depth()==1){ 00185 zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.depth()+1); 00186 vNeighborsDetId.push_back(zdcDetId.rawId()); 00187 return vNeighborsDetId; 00188 } 00189 if(zdcId.depth()== ICH_LUM_MAX){ 00190 zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.depth()-1); 00191 vNeighborsDetId.push_back(zdcDetId.rawId()); 00192 return vNeighborsDetId; 00193 } 00194 } 00195 return vNeighborsDetId; 00196 }
int ZdcTopology::ncells | ( | HcalZDCDetId::Section | section | ) | const |
Definition at line 237 of file ZdcTopology.cc.
References HcalZDCDetId::EM, HcalZDCDetId::HAD, ICH_EM_MAX, ICH_HAD_MAX, ICH_LUM_MAX, HcalZDCDetId::LUM, and HcalZDCDetId::Unknown.
00237 { 00238 int ncells = 0; 00239 switch (section) { 00240 case(HcalZDCDetId::EM) : ncells = ICH_EM_MAX; break; 00241 case(HcalZDCDetId::HAD) : ncells = ICH_HAD_MAX; break; 00242 case(HcalZDCDetId::LUM) : ncells = ICH_LUM_MAX; break; 00243 case(HcalZDCDetId::Unknown) : ncells =0; break; 00244 } 00245 return ncells; 00246 }
Get the neighbors of the given cell in north direction.
Implements CaloSubdetectorTopology.
Definition at line 212 of file ZdcTopology.cc.
References GenMuonPlsPt100GeV_cfg::cout, and lat::endl().
00213 { 00214 std::cout << "ZdcTopology::north() not yet implemented" << std::endl; 00215 std::vector<DetId> vNeighborsDetId; 00216 return vNeighborsDetId; 00217 }
Get the neighbors of the given cell in south direction.
Implements CaloSubdetectorTopology.
Definition at line 218 of file ZdcTopology.cc.
References GenMuonPlsPt100GeV_cfg::cout, and lat::endl().
00219 { 00220 std::cout << "ZdcTopology::south() not yet implemented" << std::endl; 00221 std::vector<DetId> vNeighborsDetId; 00222 return vNeighborsDetId; 00223 }
Get the transverse (X) neighbors of the given cell.
Definition at line 134 of file ZdcTopology.cc.
References HcalZDCDetId::depth(), HcalZDCDetId::EM, ICH_EM_MAX, DetId::rawId(), HcalZDCDetId::section(), validRaw(), and HcalZDCDetId::zside().
00134 { 00135 std::vector<DetId> vNeighborsDetId; 00136 HcalZDCDetId zdcId = HcalZDCDetId(id); 00137 HcalZDCDetId zdcDetId; 00138 if(validRaw(zdcId) && zdcId.section()== HcalZDCDetId::EM){ 00139 bool isPositive = false; 00140 if(zdcId.zside()==1)isPositive = true; 00141 if(zdcId.depth()==1){ 00142 zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.depth()+1); 00143 vNeighborsDetId.push_back(zdcDetId.rawId()); 00144 return vNeighborsDetId; 00145 } 00146 if(zdcId.depth()== ICH_EM_MAX){ 00147 zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.depth()-1); 00148 vNeighborsDetId.push_back(zdcDetId.rawId()); 00149 return vNeighborsDetId; 00150 } 00151 zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.depth()-1); 00152 vNeighborsDetId.push_back(zdcDetId.rawId()); 00153 zdcDetId = HcalZDCDetId(zdcId.section(), isPositive, zdcId.depth()+1); 00154 vNeighborsDetId.push_back(zdcDetId.rawId()); 00155 } 00156 return vNeighborsDetId; 00157 }
Get the neighbors of the given cell in up direction (outward).
Implements CaloSubdetectorTopology.
Definition at line 224 of file ZdcTopology.cc.
References GenMuonPlsPt100GeV_cfg::cout, and lat::endl().
00225 { 00226 std::cout << "ZdcTopology::up() not yet implemented" << std::endl; 00227 std::vector<DetId> vNeighborsDetId; 00228 return vNeighborsDetId; 00229 }
bool ZdcTopology::valid | ( | const HcalZDCDetId & | id | ) | const [virtual] |
Is this a valid cell id?
Definition at line 25 of file ZdcTopology.cc.
References isExcluded(), and validRaw().
Referenced by allCells().
00025 { 00026 // check the raw rules 00027 bool ok=validRaw(id); 00028 ok=ok && !isExcluded(id); 00029 return ok; 00030 }
bool ZdcTopology::validRaw | ( | const HcalZDCDetId & | id | ) | const [private] |
Definition at line 118 of file ZdcTopology.cc.
References funct::abs(), HcalZDCDetId::EM, HcalZDCDetId::HAD, ICH_EM_MAX, ICH_HAD_MAX, ICH_LUM_MAX, and HcalZDCDetId::LUM.
Referenced by exclude(), longitudinal(), transverse(), and valid().
00118 { 00119 bool ok = true; 00120 if(abs(id.zside())!=1)return false; 00121 if(id.depth() <= 0)return false; 00122 if(!(id.section()== HcalZDCDetId::EM || 00123 id.section()== HcalZDCDetId::HAD || 00124 id.section()== HcalZDCDetId::LUM)) return false; 00125 if(id.section()== HcalZDCDetId::EM && id.depth() > ICH_EM_MAX) 00126 return false; 00127 if(id.section()== HcalZDCDetId::HAD && id.depth() > ICH_HAD_MAX) 00128 return false; 00129 if(id.section()== HcalZDCDetId::LUM && id.depth() > ICH_LUM_MAX) 00130 return false; 00131 return ok; 00132 }
Get the neighbors of the given cell in west direction.
Implements CaloSubdetectorTopology.
Definition at line 205 of file ZdcTopology.cc.
References GenMuonPlsPt100GeV_cfg::cout, and lat::endl().
00206 { 00207 std::cout << "ZdcTopology::west() not yet implemented" << std::endl; 00208 std::vector<DetId> vNeighborsDetId; 00209 return vNeighborsDetId; 00210 }
bool ZdcTopology::excludeEM_ [private] |
bool ZdcTopology::excludeHAD_ [private] |
bool ZdcTopology::excludeLUM_ [private] |
bool ZdcTopology::excludeZN_ [private] |
bool ZdcTopology::excludeZP_ [private] |
std::vector<HcalZDCDetId> ZdcTopology::exclusionList_ [private] |
int ZdcTopology::firstEMModule_ [private] |
int ZdcTopology::firstHADModule_ [private] |
int ZdcTopology::firstLUMModule_ [private] |
int ZdcTopology::lastEMModule_ [private] |
int ZdcTopology::lastHADModule_ [private] |
int ZdcTopology::lastLUMModule_ [private] |