#include <L1Trigger/RPCTrigger/interface/RPCDetInfo.h>
Public Types | |
typedef std::map< int, float > | RPCStripPhiMap |
Public Member Functions | |
int | etaToTower (float eta) |
Converts eta to coresponding m_tower number. | |
float | getEtaCentre () |
int | getGlobRollNo () |
Calculates globall iroll no. | |
int | getHwPlane () |
Gets hwplane. | |
float | getMaxPhi () |
Gets maxPhi of this detid. | |
int | getMaxTower () |
Gives the highest m_tower number. | |
float | getMinPhi () |
Gets minPhi of this detid. | |
int | getMinTower () |
Gives the lowest m_tower number. | |
float | getPhi () |
Gets phi of this detid. | |
int | getRegion () |
Gets region. | |
int | getRing () |
Gets ring. | |
int | getRingFromRollsId () |
gets coresponding curlid. | |
int | getRoll () |
Gets roll. | |
RPCStripPhiMap | getRPCStripPhiMap () |
Gets stripMap ////////////////////////////////////////////////////////////////////////////. | |
int | giveStripOfPhi (float) |
void | printContents () |
prints the contents of a RpcDetInfo. | |
uint32_t | rawId () |
RPCDetInfo (RPCRoll *roll) | |
Construct from roll. | |
RPCDetInfo () | |
Private Member Functions | |
int | etaToSign (float eta) |
Gives sign of eta (+) -> 1; (-) -> 0. | |
void | makeStripPhiMap (RPCRoll *roll) |
void | setHwPlane () |
Returns hardware plane number (mHwPlane). | |
float | transformPhi (float phi) |
Transforms phi. | |
Private Attributes | |
uint32_t | m_detId |
DetId number. | |
float | m_etaCentre |
eta of centre of this detId | |
float | m_etaMax |
etaMin and etaMax define to which m_tower(s) chamber contributes | |
float | m_etaMin |
etaMin and etaMax define to which m_tower(s) chamber contributes | |
int | m_globRoll |
int | m_hwPlane |
1...6 for barell and 1...4 for endcaps | |
int | m_layer |
Inner or outer layer. | |
float | m_phi |
Phi of center of this detId (different than globalPoint.phi() - [0...2PI[). | |
float | m_phiMax |
The highest phi of strips. | |
float | m_phiMin |
The lowest phi of strips. | |
int | m_region |
(+-)1 for endcaps, 0 for barrell | |
int | m_ring |
Wheel number for barrell, Ring number for endcap (RE*/1 - RE*/3 -> 1...3 ). | |
int | m_roll |
Roll number. | |
int | m_sector |
Sector number. | |
int | m_station |
Muon station number (RB1...RB4; RE1...RE4). | |
RPCStripPhiMap | m_stripPhiMap |
int | m_subsector |
Subsector number. | |
int | m_towerMax |
Highest tower number to which chamber contributes. | |
int | m_towerMin |
Lowest tower number to which chamber contributes. | |
Static Private Attributes | |
static const float | m_towerBounds [] |
Defines m_tower bounds. |
Definition at line 26 of file RPCDetInfo.h.
typedef std::map<int, float> RPCDetInfo::RPCStripPhiMap |
Definition at line 29 of file RPCDetInfo.h.
RPCDetInfo::RPCDetInfo | ( | ) | [inline] |
RPCDetInfo::RPCDetInfo | ( | RPCRoll * | roll | ) |
Construct from roll.
Definition at line 22 of file RPCDetInfo.cc.
References RPCRoll::centreOfStrip(), detId, prof2calltree::edges, PV3DBase< T, PVType, FrameType >::eta(), RPCGeomServ::eta_partition(), etaToTower(), i, RPCRoll::id(), RPCDetId::layer(), StripTopology::localStripLength(), m_detId, m_etaCentre, m_etaMax, m_etaMin, m_globRoll, m_layer, m_phi, m_phiMax, m_phiMin, m_region, m_ring, m_roll, m_sector, m_station, m_stripPhiMap, m_subsector, m_towerMax, m_towerMin, max, min, RPCRoll::nstrips(), PV3DBase< T, PVType, FrameType >::phi(), phi, DetId::rawId(), RPCDetId::region(), RPCDetId::ring(), RPCDetId::roll(), RPCDetId::sector(), setHwPlane(), RPCDetId::station(), RPCDetId::subsector(), pyDBSRunClass::temp, GeomDet::toGlobal(), RPCRoll::topology(), and transformPhi().
00022 { 00023 00024 RPCDetId detId = roll->id(); 00025 00026 RPCGeomServ grs(detId); 00027 m_globRoll = grs.eta_partition(); 00028 00029 m_detId = detId.rawId(); 00030 m_region = detId.region(); 00031 00032 // Hand;le endcaps. Needed to verify that etaPartition works ok in barrel 00033 //if (m_region==1 || m_region == -1){ 00034 // m_globRoll = 12; 00035 //} 00036 00037 m_ring = detId.ring(); 00038 m_station = detId.station(); 00039 m_layer = detId.layer(); 00040 m_roll = detId.roll(); 00041 m_sector = detId.sector(); 00042 m_subsector = detId.subsector(); 00043 00044 setHwPlane(); 00045 00046 00047 00048 // Determine min and max \eta values 00049 const StripTopology* topology = dynamic_cast<const StripTopology*> 00050 (&(roll->topology())); 00051 00052 float stripLength = topology->localStripLength(LocalPoint( 0., 0., 0. )); 00053 00054 // The list of chamber local positions used to find etaMin and etaMax 00055 // of a chamber. You can add as many points as desire, but make sure 00056 // the point lays _inside_ the chamber. 00057 00058 std::vector<LocalPoint> edges; 00059 edges.push_back(LocalPoint(0., stripLength/2., 0.)); // Add (?) correction for 00060 edges.push_back(LocalPoint(0.,-stripLength/2., 0.)); // nonzero chamber height 00061 00062 std::vector<float> m_etas; 00063 for (unsigned int i=0; i < edges.size(); i++){ 00064 GlobalPoint gp = roll->toGlobal( edges[i] ); 00065 m_etas.push_back( gp.eta() ); 00066 } 00067 00068 m_etaMin = *(min_element(m_etas.begin(), m_etas.end())); 00069 m_etaMax = *(max_element(m_etas.begin(), m_etas.end())); 00070 m_etaCentre = roll->toGlobal(LocalPoint( 0., 0., 0. )).eta(); 00071 00072 m_towerMin = etaToTower(m_etaMin); 00073 m_towerMax = etaToTower(m_etaMax); 00074 00075 m_phi = transformPhi( (float)(roll->toGlobal(LocalPoint(0., 0., 0.)).phi()) ); 00076 00077 00078 // add strips to the map 00079 for (int i=1; i<=roll->nstrips(); i++ ) { // note: the strip numbering convention is likely to chnage in future 00080 00081 LocalPoint lStripCentre = roll->centreOfStrip(i); 00082 GlobalPoint gStripCentre = roll->toGlobal(lStripCentre); 00083 float phiRaw = gStripCentre.phi(); 00084 float phi = transformPhi( phiRaw ); 00085 00086 m_stripPhiMap[i]=phi; 00087 00088 } 00089 00090 // Fill m_phiMin and m_phiMax values 00091 LocalPoint lStripCentre = roll->centreOfStrip(1); // XXX - strip numbering convention(!) 00092 GlobalPoint gStripCentre = roll->toGlobal(lStripCentre); 00093 float phi1 = transformPhi(gStripCentre.phi()); 00094 00095 LocalPoint lStripCentre2 = roll->centreOfStrip(roll->nstrips());// XXX - strip numbering convention(!) 00096 GlobalPoint gStripCentre2 = roll->toGlobal(lStripCentre2); 00097 float phi2 = transformPhi(gStripCentre2.phi()); 00098 00099 /* std::cout << "Roll: " <<m_globRoll 00100 << " plane: "<< m_hwPlane 00101 << " z: " << gStripCentre2.z() 00102 << " r: " << gStripCentre2.perp() 00103 <<std::endl; 00104 */ 00105 m_phiMin = std::min(phi1,phi2); 00106 m_phiMax = std::max(phi1,phi2); 00107 00108 // fix the problem around phi=0: (2pi - epsilon) < (0+epsilon) 00109 if ( (m_phiMin<1)&&(m_phiMax>5) ){ 00110 float temp = m_phiMin; 00111 m_phiMin = m_phiMax; 00112 m_phiMax = temp; 00113 } 00114 00115 }
int RPCDetInfo::etaToSign | ( | float | eta | ) | [private] |
Gives sign of eta (+) -> 1; (-) -> 0.
Definition at line 282 of file RPCDetInfo.cc.
Referenced by etaToTower(), and getRingFromRollsId().
00282 { 00283 00284 if (eta < 0) return 0; 00285 return 1; 00286 00287 }
int RPCDetInfo::etaToTower | ( | float | eta | ) |
Converts eta to coresponding m_tower number.
Definition at line 220 of file RPCDetInfo.cc.
References etaToSign(), and m_towerBounds.
Referenced by RPCDetInfo().
00220 { 00221 00222 int sign = etaToSign(eta); 00223 eta = std::fabs(eta); 00224 00225 int m_tower = 0; 00226 // The highest m_tower no is 16 00227 while ( (eta > m_towerBounds[m_tower]) && (m_tower!=16) ){ 00228 m_tower++; 00229 } 00230 00231 if (sign == 0) 00232 return -m_tower; 00233 else 00234 return m_tower; 00235 00236 }
float RPCDetInfo::getEtaCentre | ( | ) |
int RPCDetInfo::getGlobRollNo | ( | ) |
Calculates globall iroll no.
Definition at line 143 of file RPCDetInfo.cc.
References m_globRoll.
Referenced by RPCRingFromRolls::addDetId(), and getRingFromRollsId().
00143 { 00144 00145 00146 return m_globRoll; 00147 /* 00148 int globRoll=20; 00149 00150 if (m_region==0){ //barell 00151 00152 int hr = 0; 00153 switch (m_roll) { 00154 case 1: 00155 hr=1; 00156 break; 00157 case 2: 00158 hr=0; 00159 break; 00160 case 3: 00161 hr=-1; 00162 break; 00163 } 00164 if (m_ring==0) { // Temp fix for eta problem in barell ring0 00165 00166 // std::cout << m_sector << " " << m_subsector << std::endl; 00167 if(m_sector == 1 || 00168 m_sector == 4 || m_sector == 5 || 00169 m_sector == 8 || m_sector == 9 || 00170 m_sector == 12) 00171 { 00172 if (hr==-1) 00173 hr=1; 00174 else if (hr==1) 00175 hr=-1; 00176 } 00177 } 00178 00179 00180 if (m_ring >= 0) 00181 globRoll = m_ring*3-hr; 00182 else 00183 globRoll = m_ring*3+hr; 00184 } 00185 else { 00186 00187 int mr = 0; 00188 switch (m_ring) { 00189 case 1: 00190 mr=3; 00191 break; 00192 case 2: 00193 mr=2; 00194 break; 00195 case 3: 00196 mr=1; 00197 break; 00198 } 00199 globRoll=((mr-1)*3+m_roll+7); 00200 } 00201 00202 if (m_region==-1) 00203 globRoll= -globRoll; 00204 00205 if ( (globRoll==20) || (globRoll==-20)) 00206 edm::LogError("RPCTrigger") << "Problem with RPCDetInfo::getGlobRollNo function. GlobRoll=" << globRoll; 00207 00208 return globRoll;*/ 00209 00210 }
int RPCDetInfo::getHwPlane | ( | ) |
Gets hwplane.
Definition at line 300 of file RPCDetInfo.cc.
References m_hwPlane.
Referenced by RPCRingFromRolls::addDetId().
float RPCDetInfo::getMaxPhi | ( | ) |
Gets maxPhi of this detid.
Definition at line 296 of file RPCDetInfo.cc.
References m_phiMax.
Referenced by RPCRingFromRolls::doVirtualStrips().
int RPCDetInfo::getMaxTower | ( | ) |
Gives the highest m_tower number.
Definition at line 293 of file RPCDetInfo.cc.
References m_towerMax.
float RPCDetInfo::getMinPhi | ( | ) |
Gets minPhi of this detid.
Definition at line 295 of file RPCDetInfo.cc.
References m_phiMin.
Referenced by RPCRingFromRolls::doVirtualStrips().
int RPCDetInfo::getMinTower | ( | ) |
Gives the lowest m_tower number.
Definition at line 292 of file RPCDetInfo.cc.
References m_towerMin.
float RPCDetInfo::getPhi | ( | ) |
Gets phi of this detid.
Definition at line 294 of file RPCDetInfo.cc.
References m_phi.
Referenced by RPCRingFromRolls::addDetId(), and printContents().
int RPCDetInfo::getRegion | ( | ) |
Gets region.
Definition at line 298 of file RPCDetInfo.cc.
References m_region.
Referenced by RPCRingFromRolls::addDetId().
int RPCDetInfo::getRing | ( | ) |
Gets ring.
Definition at line 299 of file RPCDetInfo.cc.
References m_ring.
Referenced by RPCRingFromRolls::addDetId().
int RPCDetInfo::getRingFromRollsId | ( | ) |
gets coresponding curlid.
Definition at line 127 of file RPCDetInfo.cc.
References funct::abs(), etaToSign(), getGlobRollNo(), and m_hwPlane.
Referenced by RPCTriggerGeo::addDet(), and RPCRingFromRolls::addDetId().
00127 { 00128 00129 int gr = getGlobRollNo(); 00130 int curlId = 1000*(m_hwPlane) + //1...6 00131 100*(etaToSign(gr) ) + // 00132 1*( std::abs(getGlobRollNo()) ); //-17...17 00133 00134 return curlId; 00135 }
int RPCDetInfo::getRoll | ( | ) |
Gets roll.
Definition at line 301 of file RPCDetInfo.cc.
References m_roll.
Referenced by RPCRingFromRolls::addDetId().
RPCDetInfo::RPCStripPhiMap RPCDetInfo::getRPCStripPhiMap | ( | ) |
Gets stripMap ////////////////////////////////////////////////////////////////////////////.
Definition at line 302 of file RPCDetInfo.cc.
References m_stripPhiMap.
Referenced by RPCRingFromRolls::updatePhiStripsMap().
int RPCDetInfo::giveStripOfPhi | ( | float | ) |
void RPCDetInfo::printContents | ( | ) |
prints the contents of a RpcDetInfo.
Definition at line 334 of file RPCDetInfo.cc.
References lat::endl(), getPhi(), LogDebug, m_towerMax, m_towerMin, and rawId().
00334 { 00335 00336 //* 00337 LogDebug("RPCTrigger")<<"####"<<std::endl; 00338 LogDebug("RPCTrigger")<< "DetId "<< rawId() << " Centre Phi " << getPhi(); 00339 LogDebug("RPCTrigger")<< " m_Tower min" << m_towerMin << " m_tower max " << m_towerMax; 00340 00341 /* 00342 RPCStripPhiMap::const_iterator it; 00343 for (it = m_stripPhiMap.begin(); it != m_stripPhiMap.end(); it++){ 00344 00345 LogDebug("RPCTrigger") 00346 << "Strip: " << it->first << " " 00347 << "Phi: " << it->second << " " 00348 00349 00350 } 00351 //*/ 00352 }
uint32_t RPCDetInfo::rawId | ( | ) |
Definition at line 288 of file RPCDetInfo.cc.
References m_detId.
Referenced by RPCTriggerGeo::addDet(), RPCRingFromRolls::addDetId(), printContents(), and RPCRingFromRolls::updatePhiStripsMap().
00288 { 00289 return m_detId; 00290 }
void RPCDetInfo::setHwPlane | ( | ) | [private] |
Returns hardware plane number (mHwPlane).
Definition at line 245 of file RPCDetInfo.cc.
References m_hwPlane, m_layer, m_region, and m_station.
Referenced by RPCDetInfo().
00246 { 00247 int region = m_region; 00248 int station = m_station; 00249 int layer = m_layer; 00250 00251 int hwPlane = 0; 00252 if (region != 0){ // endcaps 00253 hwPlane = station; 00254 } 00255 // Now comes the barell 00256 else if ( station > 2 ){ 00257 hwPlane = station; 00258 } 00259 else if ( station == 1 && layer == 1) { 00260 hwPlane = 1; 00261 } 00262 else if ( station == 1 && layer == 2) { 00263 hwPlane = 5; 00264 } 00265 else if ( station == 2 && layer == 1) { 00266 hwPlane = 2; 00267 } 00268 else if ( station == 2 && layer == 2) { 00269 hwPlane = 6; 00270 } 00271 00272 m_hwPlane = hwPlane; 00273 00274 }
float RPCDetInfo::transformPhi | ( | float | phi | ) | [private] |
Transforms phi.
Definition at line 310 of file RPCDetInfo.cc.
References pi.
Referenced by RPCDetInfo().
00310 { 00311 00312 00313 float pi = 3.141592654; 00314 00315 if (phi < 0) 00316 return phi+2*pi; 00317 else 00318 return phi; 00319 00320 }
uint32_t RPCDetInfo::m_detId [private] |
float RPCDetInfo::m_etaCentre [private] |
eta of centre of this detId
Definition at line 82 of file RPCDetInfo.h.
Referenced by getEtaCentre(), and RPCDetInfo().
float RPCDetInfo::m_etaMax [private] |
etaMin and etaMax define to which m_tower(s) chamber contributes
Definition at line 81 of file RPCDetInfo.h.
Referenced by RPCDetInfo().
float RPCDetInfo::m_etaMin [private] |
etaMin and etaMax define to which m_tower(s) chamber contributes
Definition at line 80 of file RPCDetInfo.h.
Referenced by RPCDetInfo().
int RPCDetInfo::m_globRoll [private] |
int RPCDetInfo::m_hwPlane [private] |
1...6 for barell and 1...4 for endcaps
Definition at line 79 of file RPCDetInfo.h.
Referenced by getHwPlane(), getRingFromRollsId(), and setHwPlane().
int RPCDetInfo::m_layer [private] |
Inner or outer layer.
Definition at line 75 of file RPCDetInfo.h.
Referenced by RPCDetInfo(), and setHwPlane().
float RPCDetInfo::m_phi [private] |
Phi of center of this detId (different than globalPoint.phi() - [0...2PI[).
Definition at line 83 of file RPCDetInfo.h.
Referenced by getPhi(), and RPCDetInfo().
float RPCDetInfo::m_phiMax [private] |
The highest phi of strips.
Definition at line 85 of file RPCDetInfo.h.
Referenced by getMaxPhi(), and RPCDetInfo().
float RPCDetInfo::m_phiMin [private] |
The lowest phi of strips.
Definition at line 84 of file RPCDetInfo.h.
Referenced by getMinPhi(), and RPCDetInfo().
int RPCDetInfo::m_region [private] |
(+-)1 for endcaps, 0 for barrell
Definition at line 72 of file RPCDetInfo.h.
Referenced by getRegion(), RPCDetInfo(), and setHwPlane().
int RPCDetInfo::m_ring [private] |
Wheel number for barrell, Ring number for endcap (RE*/1 - RE*/3 -> 1...3 ).
Definition at line 73 of file RPCDetInfo.h.
Referenced by getRing(), and RPCDetInfo().
int RPCDetInfo::m_roll [private] |
int RPCDetInfo::m_sector [private] |
int RPCDetInfo::m_station [private] |
Muon station number (RB1...RB4; RE1...RE4).
Definition at line 74 of file RPCDetInfo.h.
Referenced by RPCDetInfo(), and setHwPlane().
RPCStripPhiMap RPCDetInfo::m_stripPhiMap [private] |
int RPCDetInfo::m_subsector [private] |
const float RPCDetInfo::m_towerBounds [static, private] |
Initial value:
{0.07, 0.27, 0.44, 0.58, 0.72, 0.83, 0.93, 1.04, 1.14, 1.24, 1.36, 1.48, 1.61, 1.73, 1.85, 1.97, 2.10 }
Definition at line 89 of file RPCDetInfo.h.
Referenced by etaToTower().
int RPCDetInfo::m_towerMax [private] |
Highest tower number to which chamber contributes.
Definition at line 87 of file RPCDetInfo.h.
Referenced by getMaxTower(), printContents(), and RPCDetInfo().
int RPCDetInfo::m_towerMin [private] |
Lowest tower number to which chamber contributes.
Definition at line 86 of file RPCDetInfo.h.
Referenced by getMinTower(), printContents(), and RPCDetInfo().