![]() |
![]() |
#include <L1Trigger/RPCTrigger/interface/RPCLogCone.h>
Public Types | |
typedef std::map< int, std::vector< int > > | TLogPlane |
Hits in one Logic Plane, if strips is fired, its number is added to the map as a key. | |
Public Member Functions | |
bool | addLogHit (const RPCLogHit &logHit) |
Adds next logHit . | |
unsigned long long | getCompressedCone () |
Compresses cone. Throws exception, if there is more than one hit in any logplane. | |
RPCConst::l1RpcConeCrdnts | getConeCrdnts () const |
int | getFiredPlanesCnt () const |
int | getHitsCnt (int logPlane) const |
Gets fired strips count in given logPlane. | |
int | getIdx () const |
TLogPlane | getLogPlane (int logPlane) const |
int | getLogSector () const |
int | getLogSegment () const |
std::vector< int > | getLogStripDigisIdxs (int logPlane, unsigned int logStripNum) const |
Get vector of didgis indexes (in digis vector stored by L1RpcTrigg) for given logic strip. | |
bool | getLogStripState (int logPlane, unsigned int logStripNum) const |
Get logic strip state. | |
int | getMuonCode () const |
| |
int | getMuonSign () const |
int | getTower () const |
bool | isPlaneFired (int logPlane) const |
int | possibleTrigger () const |
| |
RPCLogCone (const unsigned long long &pat, int tower, int logSector, int logSegment) | |
Constructor. The cone is built from unsigned long long. | |
RPCLogCone (const RPCLogHit &logHit) | |
Constructor. One hit is added, cone coordinates are set from logHit. | |
RPCLogCone (int m_tower, int logSector, int logSegment) | |
Constructor. Cone coordinates are set. | |
RPCLogCone () | |
Default constructor. No hits, no muon. | |
void | setIdx (int index) |
void | setLogStrip (int logPlane, int logStripNum) |
Set logic strip as fired. | |
void | setLogStrip (int logPlane, int logStripNum, int m_digiIdx) |
Set logic strip as fired. m_digiIdx - index of digi in digis vector stored by L1RpcTrigg. | |
void | setMuonCode (int code) |
sets pt code of muon that fired the strips */ | |
void | setMuonSign (int sign) |
void | shift (int pos) |
Changes fired LogStrips: from "stripNum" to "stripNum + pos". | |
std::string | toString () const |
Private Attributes | |
RPCConst::l1RpcConeCrdnts | m_ConeCrdnts |
std::vector< std::vector< int > > | m_DigisIdx |
Digis that formed log hits in this LogCone, m_DigisIdx[logPlaneNum][i] gets the index in DigisVec stored in L1RpcTrigg. | |
int | m_Index |
m_Index in LogConesVec stored by L1RpcTrigg | |
std::vector< TLogPlane > | m_LogPlanesVec |
Logic Planes. | |
int | m_MuonCode |
int | m_MuonSign |
State of strips in smalest unit of volum in RPC trigger system (Logic Cone), defined by 8 strips of reference plane.
Definition at line 25 of file RPCLogCone.h.
typedef std::map<int, std::vector<int> > RPCLogCone::TLogPlane |
Hits in one Logic Plane, if strips is fired, its number is added to the map as a key.
Vector stores the indexes in DigisVec (stored in L1RpcTrigg) of Digis that formed log hits Logic m_Strips are diferent from RPC strips - Logic m_Strips it is usaly OR of 2 RPC strips with diferent eta (but the same phi).
Definition at line 34 of file RPCLogCone.h.
RPCLogCone::RPCLogCone | ( | ) |
Default constructor. No hits, no muon.
Default constructor.
No hits, no muon.
Definition at line 19 of file RPCLogCone.cc.
References RPCConst::m_LOGPLANES_COUNT, m_LogPlanesVec, m_MuonCode, and m_MuonSign.
00019 : 00020 m_ConeCrdnts() 00021 { 00022 m_LogPlanesVec.assign(RPCConst::m_LOGPLANES_COUNT, TLogPlane()); 00023 m_MuonCode = 0; 00024 m_MuonSign = 0; 00025 }
Constructor. Cone coordinates are set.
Constructor.
Cone coordinates are set.
Definition at line 32 of file RPCLogCone.cc.
References RPCConst::m_LOGPLANES_COUNT, m_LogPlanesVec, m_MuonCode, and m_MuonSign.
00032 : 00033 m_ConeCrdnts(tower, logSector, logSegment) 00034 { 00035 m_LogPlanesVec.assign(RPCConst::m_LOGPLANES_COUNT, TLogPlane()); 00036 m_MuonCode = 0; 00037 m_MuonSign = 0; 00038 }
RPCLogCone::RPCLogCone | ( | const RPCLogHit & | logHit | ) |
Constructor. One hit is added, cone coordinates are set from logHit.
Copying Constructor.
Definition at line 44 of file RPCLogCone.cc.
References RPCLogHit::getConeCrdnts(), RPCLogHit::getDigiIdx(), RPCLogHit::getlogPlaneNumber(), RPCLogHit::getStripNumberInCone(), m_ConeCrdnts, RPCConst::m_LOGPLANES_COUNT, m_LogPlanesVec, m_MuonCode, m_MuonSign, and setLogStrip().
00045 { 00046 m_LogPlanesVec.assign(RPCConst::m_LOGPLANES_COUNT, TLogPlane()); 00047 00048 m_ConeCrdnts = logHit.getConeCrdnts(); 00049 00050 m_MuonCode = 0; 00051 m_MuonSign = 0; 00052 00053 setLogStrip(logHit.getlogPlaneNumber() -1, logHit.getStripNumberInCone(), logHit.getDigiIdx()); 00054 }
Constructor. The cone is built from unsigned long long.
Definition at line 56 of file RPCLogCone.cc.
References funct::abs(), getTower(), RPCConst::m_FIRST_PLANE, RPCConst::m_LOGPLANE_SIZE, RPCConst::m_LOGPLANES_COUNT, m_LogPlanesVec, m_MuonCode, m_MuonSign, RPCConst::m_USED_PLANES_COUNT, setLogStrip(), shift(), and strip().
00056 : 00057 m_ConeCrdnts(tower, logSector, logSegment) 00058 { 00059 m_LogPlanesVec.assign(RPCConst::m_LOGPLANES_COUNT, TLogPlane()); 00060 m_MuonCode = 0; 00061 m_MuonSign = 0; 00062 00063 unsigned long long int mask = 255; // (first 8 bits) 00064 int shift = 0; 00065 00066 //std::cout << "Decompressing pattern: " << pat << std::endl; 00067 for (int logplane = RPCConst::m_FIRST_PLANE; 00068 logplane != RPCConst::m_USED_PLANES_COUNT[std::abs(getTower())]; 00069 ++logplane ) 00070 { 00071 unsigned int strip = (pat & (mask<<shift) ) >> shift; 00072 //std::cout << logplane << " " << strip << std::endl; 00073 shift += 8; 00074 // We should prob. use m_NOT_CONNECTED value 00075 if (strip != RPCConst::m_LOGPLANE_SIZE[std::abs(getTower())][logplane]) 00076 setLogStrip(logplane,strip); 00077 } 00078 }
Adds next logHit .
Adds a loghit to a cone.
Definition at line 221 of file RPCLogCone.cc.
References RPCLogHit::getDigiIdx(), RPCLogHit::getlogPlaneNumber(), RPCLogHit::getLogSector(), RPCLogHit::getLogSegment(), RPCLogHit::getStripNumberInCone(), RPCLogHit::getTower(), m_ConeCrdnts, RPCConst::l1RpcConeCrdnts::m_LogSector, RPCConst::l1RpcConeCrdnts::m_LogSegment, RPCConst::l1RpcConeCrdnts::m_Tower, and setLogStrip().
00221 { 00222 00223 if (m_ConeCrdnts.m_Tower == logHit.getTower() && 00224 m_ConeCrdnts.m_LogSector == logHit.getLogSector() && 00225 m_ConeCrdnts.m_LogSegment == logHit.getLogSegment()) 00226 { 00227 setLogStrip(logHit.getlogPlaneNumber()-1, logHit.getStripNumberInCone(), logHit.getDigiIdx()); 00228 return true; 00229 } 00230 else 00231 return false; 00232 }
unsigned long long RPCLogCone::getCompressedCone | ( | ) |
Compresses cone. Throws exception, if there is more than one hit in any logplane.
Definition at line 80 of file RPCLogCone.cc.
References funct::abs(), getHitsCnt(), getLogPlane(), getTower(), lp, RPCConst::m_FIRST_PLANE, RPCConst::m_LOGPLANE_SIZE, RPCConst::m_USED_PLANES_COUNT, shift(), and strip().
00080 { 00081 00082 unsigned long long int pattern = 0; 00083 int shift = 0; 00084 00085 for (int logplane = RPCConst::m_FIRST_PLANE; 00086 logplane != RPCConst::m_USED_PLANES_COUNT[std::abs(getTower())]; 00087 logplane++ ) 00088 { 00089 unsigned long long int strip; 00090 if (getHitsCnt(logplane)==0) { 00091 // We need to mark somehow, that plane is empty (strip 0 is not fired) 00092 strip = RPCConst::m_LOGPLANE_SIZE[std::abs(getTower())][logplane]; 00093 } 00094 else if (getHitsCnt(logplane)==1) { 00095 RPCLogCone::TLogPlane lp = getLogPlane(logplane); 00096 strip = lp.begin()->first; 00097 } 00098 else { 00099 throw RPCException("To many hits in logcone"); 00100 } 00101 pattern = pattern | (strip << shift); 00102 shift += 8; 00103 } 00104 00105 //std::cout << " Compressed cone: " << pattern << std::endl; 00106 return pattern; 00107 }
RPCConst::l1RpcConeCrdnts RPCLogCone::getConeCrdnts | ( | ) | const |
Definition at line 194 of file RPCLogCone.cc.
References m_ConeCrdnts.
00194 { return m_ConeCrdnts; }
int RPCLogCone::getFiredPlanesCnt | ( | ) | const |
Definition at line 251 of file RPCLogCone.cc.
References funct::abs(), isPlaneFired(), m_ConeCrdnts, RPCConst::m_FIRST_PLANE, RPCConst::l1RpcConeCrdnts::m_Tower, and RPCConst::m_USED_PLANES_COUNT.
00251 { 00252 int firedPlanes = 0; 00253 for(int logPlane = RPCConst::m_FIRST_PLANE; 00254 logPlane < RPCConst::m_USED_PLANES_COUNT[abs(m_ConeCrdnts.m_Tower)]; 00255 logPlane++) 00256 { 00257 firedPlanes = firedPlanes + isPlaneFired(logPlane); 00258 } 00259 return firedPlanes; 00260 }
Gets fired strips count in given logPlane.
Definition at line 174 of file RPCLogCone.cc.
References m_LogPlanesVec.
Referenced by getCompressedCone().
00174 { 00175 return m_LogPlanesVec[logPlane].size(); 00176 }
int RPCLogCone::getIdx | ( | ) | const |
Definition at line 198 of file RPCLogCone.cc.
References m_Index.
Referenced by RPCPac::run().
00198 { return m_Index; }
RPCLogCone::TLogPlane RPCLogCone::getLogPlane | ( | int | logPlane | ) | const |
Definition at line 169 of file RPCLogCone.cc.
References m_LogPlanesVec.
Referenced by getCompressedCone().
00169 { 00170 return m_LogPlanesVec[logPlane]; 00171 }
int RPCLogCone::getLogSector | ( | ) | const |
Definition at line 190 of file RPCLogCone.cc.
References m_ConeCrdnts, and RPCConst::l1RpcConeCrdnts::m_LogSector.
00190 { return m_ConeCrdnts.m_LogSector; }
int RPCLogCone::getLogSegment | ( | ) | const |
Definition at line 192 of file RPCLogCone.cc.
References m_ConeCrdnts, and RPCConst::l1RpcConeCrdnts::m_LogSegment.
Referenced by RPCTriggerBoard::runCone().
00192 { return m_ConeCrdnts.m_LogSegment; }
std::vector< int > RPCLogCone::getLogStripDigisIdxs | ( | int | logPlane, | |
unsigned int | logStripNum | |||
) | const |
Get vector of didgis indexes (in digis vector stored by L1RpcTrigg) for given logic strip.
If strip was not fired returns empty vector
Definition at line 235 of file RPCLogCone.cc.
References end, it, and m_LogPlanesVec.
00235 { 00236 TLogPlane::const_iterator it = m_LogPlanesVec[logPlane].find(logStripNum); 00237 if(it != m_LogPlanesVec[logPlane].end()) 00238 return it->second; 00239 else 00240 return std::vector<int>(); 00241 }
Get logic strip state.
Definition at line 211 of file RPCLogCone.cc.
References m_LogPlanesVec.
Referenced by RPCPacData::getTPatternsGroupShape(), RPCPac::runEnergeticPatternsGroups(), RPCPac::runTrackPatternsGroup(), and toString().
00211 { 00212 return m_LogPlanesVec[logPlane].count(logStripNum); 00213 }
int RPCLogCone::getMuonCode | ( | ) | const |
Definition at line 182 of file RPCLogCone.cc.
References m_MuonCode.
00182 { return m_MuonCode; }
int RPCLogCone::getMuonSign | ( | ) | const |
int RPCLogCone::getTower | ( | ) | const |
Definition at line 188 of file RPCLogCone.cc.
References m_ConeCrdnts, and RPCConst::l1RpcConeCrdnts::m_Tower.
Referenced by getCompressedCone(), RPCLogCone(), and RPCTriggerBoard::runCone().
00188 { return m_ConeCrdnts.m_Tower; }
Definition at line 244 of file RPCLogCone.cc.
References m_LogPlanesVec, and size.
Referenced by getFiredPlanesCnt(), and possibleTrigger().
00244 { 00245 if(m_LogPlanesVec[logPlane].size() == 0) 00246 return false; 00247 else 00248 return true; 00249 }
int RPCLogCone::possibleTrigger | ( | ) | const |
Definition at line 263 of file RPCLogCone.cc.
References funct::abs(), isPlaneFired(), m_ConeCrdnts, RPCConst::m_FIRST_PLANE, RPCConst::m_LOGPLANE4, RPCConst::l1RpcConeCrdnts::m_Tower, and RPCConst::m_USED_PLANES_COUNT.
00263 { 00264 int triggerType = 0; //0 - trigger not possible 00265 //1 - 3/4 (3 inner planes fired) 00266 //2 - 4/6 (four palnes fired) 00267 int firedPlanes = 0; 00268 00269 int logPlane = RPCConst::m_FIRST_PLANE; 00270 for( ; logPlane <= RPCConst::m_LOGPLANE4; logPlane++) { 00271 firedPlanes = firedPlanes + isPlaneFired(logPlane); 00272 } 00273 if(firedPlanes >= 3) 00274 triggerType = 1; 00275 00276 for( ; 00277 logPlane < RPCConst::m_USED_PLANES_COUNT[abs(m_ConeCrdnts.m_Tower)]; 00278 logPlane++) 00279 { 00280 firedPlanes = firedPlanes + isPlaneFired(logPlane); 00281 } 00282 if(firedPlanes >= 4) 00283 triggerType = 2; 00284 00285 return triggerType; 00286 }
Definition at line 196 of file RPCLogCone.cc.
References m_Index.
Referenced by RPCTriggerGeo::getCones(), and RPCConeBuilderFromES::getConesFromES().
Set logic strip as fired.
Definition at line 206 of file RPCLogCone.cc.
References m_LogPlanesVec.
00206 { 00207 m_LogPlanesVec[logPlane].insert(TLogPlane::value_type(logStripNum, std::vector<int>())); 00208 }
Set logic strip as fired. m_digiIdx - index of digi in digis vector stored by L1RpcTrigg.
Definition at line 200 of file RPCLogCone.cc.
References m_LogPlanesVec.
Referenced by addLogHit(), RPCLogCone(), and TPatternsGroup::updateShape().
00200 { 00201 //m_LogPlanesVec[logPlane].insert(logStripNum); 00202 //m_LogPlanesVec[logPlane].insert(TLogPlane::value_type(logStripNum, vector<int>())); 00203 m_LogPlanesVec[logPlane][logStripNum].push_back(m_digiIdx); 00204 }
sets pt code of muon that fired the strips */
Definition at line 179 of file RPCLogCone.cc.
References m_MuonCode.
00179 { m_MuonCode = code; }
Changes fired LogStrips: from "stripNum" to "stripNum + pos".
Definition at line 145 of file RPCLogCone.cc.
References funct::abs(), begin, it, m_ConeCrdnts, RPCConst::m_FIRST_PLANE, RPCConst::m_LAST_PLANE, RPCConst::m_LOGPLANE_SIZE, m_LogPlanesVec, and RPCConst::l1RpcConeCrdnts::m_Tower.
Referenced by getCompressedCone(), and RPCLogCone().
00145 { 00146 int shiftPos; 00147 for(int logPlane = RPCConst::m_FIRST_PLANE; logPlane <= RPCConst::m_LAST_PLANE; logPlane++) { 00148 TLogPlane shifted; 00149 for(TLogPlane::iterator it = m_LogPlanesVec[logPlane].begin(); 00150 it != m_LogPlanesVec[logPlane].end(); 00151 it++) 00152 { 00153 shiftPos = it->first + pos; 00154 /* std::cout << shiftPos << " " 00155 << RPCConst::m_LOGPLANE_SIZE[abs(m_ConeCrdnts.m_Tower)] 00156 << std::endl;*/ 00157 if ( shiftPos >= 0 && shiftPos < (int)RPCConst::m_LOGPLANE_SIZE[abs(m_ConeCrdnts.m_Tower)][logPlane]) 00158 shifted.insert(TLogPlane::value_type(shiftPos, it->second)); 00159 } 00160 m_LogPlanesVec[logPlane] = shifted; 00161 } 00162 }
std::string RPCLogCone::toString | ( | ) | const |
Definition at line 110 of file RPCLogCone.cc.
References funct::abs(), lat::endl(), getLogStripState(), i, m_ConeCrdnts, RPCConst::m_FIRST_PLANE, RPCConst::m_LAST_PLANE, RPCConst::m_LOGPLANE_SIZE, RPCConst::m_LOGPLANE_STR, RPCConst::l1RpcConeCrdnts::m_LogSector, RPCConst::l1RpcConeCrdnts::m_LogSegment, and RPCConst::l1RpcConeCrdnts::m_Tower.
00110 { 00111 std::ostringstream ostr; 00112 ostr << "\n ======================> TOWER = "; 00113 ostr<<std::setw(2) 00114 <<m_ConeCrdnts.m_Tower 00115 <<", m_LogSector = " 00116 <<m_ConeCrdnts.m_LogSector 00117 <<", m_LogSegment = " 00118 <<m_ConeCrdnts.m_LogSegment 00119 <<" <======================="<< std::endl; 00120 00121 std::string spacer; 00122 00123 for (int logPlane = RPCConst::m_LAST_PLANE; logPlane >= RPCConst::m_FIRST_PLANE; logPlane--) { 00124 ostr<<RPCConst::m_LOGPLANE_STR[logPlane]<<" "; 00125 spacer.assign((72 - RPCConst::m_LOGPLANE_SIZE[abs(m_ConeCrdnts.m_Tower)][logPlane])/2, ' '); 00126 ostr<<spacer; 00127 00128 for(int i = RPCConst::m_LOGPLANE_SIZE[abs(m_ConeCrdnts.m_Tower)][logPlane]-1; i >=0; i--) { 00129 if(getLogStripState(logPlane, i)) 00130 ostr<<"X"; 00131 else { 00132 if(i%8 == 0) 00133 ostr<<i%10; 00134 else 00135 ostr<<"."; 00136 } 00137 } 00138 00139 ostr<<std::endl; 00140 } 00141 00142 ostr<< std::endl; 00143 return ostr.str(); 00144 }
Definition at line 116 of file RPCLogCone.h.
Referenced by addLogHit(), getConeCrdnts(), getFiredPlanesCnt(), getLogSector(), getLogSegment(), getTower(), possibleTrigger(), RPCLogCone(), shift(), and toString().
std::vector<std::vector<int> > RPCLogCone::m_DigisIdx [private] |
Digis that formed log hits in this LogCone, m_DigisIdx[logPlaneNum][i] gets the index in DigisVec stored in L1RpcTrigg.
Definition at line 114 of file RPCLogCone.h.
int RPCLogCone::m_Index [private] |
std::vector<TLogPlane> RPCLogCone::m_LogPlanesVec [private] |
Logic Planes.
Definition at line 109 of file RPCLogCone.h.
Referenced by getHitsCnt(), getLogPlane(), getLogStripDigisIdxs(), getLogStripState(), isPlaneFired(), RPCLogCone(), setLogStrip(), and shift().
int RPCLogCone::m_MuonCode [private] |
Definition at line 118 of file RPCLogCone.h.
Referenced by getMuonCode(), RPCLogCone(), and setMuonCode().
int RPCLogCone::m_MuonSign [private] |
Definition at line 120 of file RPCLogCone.h.
Referenced by getMuonSign(), RPCLogCone(), and setMuonSign().