CMS 3D CMS Logo

RPCRingFromRolls.cc

Go to the documentation of this file.
00001 
00007 #include "L1Trigger/RPCTrigger/interface/RPCRingFromRolls.h"
00008 #include "L1Trigger/RPCTrigger/interface/RPCDetInfo.h"
00009 #include "L1Trigger/RPCTrigger/interface/RPCException.h"
00010 #include <cmath>
00011 #include <algorithm>
00012 //#############################################################################
00018 //#############################################################################
00019 RPCRingFromRolls::RPCRingFromRolls()
00020 { 
00021   m_towerMin = 0;
00022   m_towerMax = 0;
00023   m_hwPlane = 0;
00024   m_region = 0;
00025   m_ring = 0;
00026   m_roll = 0;
00027   m_curlId = 0;
00028   m_globRoll = 0;
00029   
00030   m_physStripsInRingFromRolls = 0;
00031   m_virtStripsInRingFromRolls = 0;
00032   
00033   m_isRefPlane = false;
00034   m_isDataFresh = true;
00035   m_didVirtuals = false; 
00036   m_didFiltering = false;
00037   
00038 }
00039 
00040 RPCRingFromRolls::~RPCRingFromRolls(){ }
00041 //#############################################################################
00050 //#############################################################################
00051 bool RPCRingFromRolls::addDetId(RPCDetInfo detInfo){
00052   
00053   if(m_isDataFresh) { // should be done in constructor...
00054     
00055 //    m_towerMin=detInfo.getMinTower();
00056     //m_towerMax=detInfo.getMaxTower();
00057     
00058     m_hwPlane = detInfo.getHwPlane();
00059     m_region = detInfo.getRegion();
00060     m_ring = detInfo.getRing();
00061     m_roll = detInfo.getRoll();
00062     m_curlId = detInfo.getRingFromRollsId();
00063     m_globRoll = detInfo.getGlobRollNo();
00064     
00065     setRefPlane();
00066     
00067     m_towerMin=-1;
00068     m_towerMax=-1;
00069     
00070     for (int i=0; i < 3; i++){
00071       int ttemp = m_mrtow [std::abs(m_globRoll)] [m_hwPlane-1][i];
00072       if (  ((m_towerMin < 0)||(m_towerMax < 0)) && (ttemp >= 0)   ){ 
00073         m_towerMin = ttemp;
00074         m_towerMax = ttemp;
00075       }
00076       if (ttemp >= 0) {
00077         if (ttemp < m_towerMin)
00078           m_towerMin = ttemp;
00079         if (ttemp > m_towerMax)
00080           m_towerMax = ttemp;
00081       }
00082     }
00083     
00084     if (m_globRoll < 0){
00085       int temp = m_towerMin;
00086       m_towerMin = -m_towerMax;
00087       m_towerMax = -temp; // swap is needed (!)
00088     }
00089     
00090     m_isDataFresh=false;
00091   } 
00092   /*
00093   else 
00094   {
00095     int min = detInfo.getMinTower();
00096     int max = detInfo.getMinTower();
00097     if (min < m_towerMin)
00098       min = m_towerMin;
00099     if (max > m_towerMax)
00100       max = m_towerMax;
00101   }
00102   */
00103   
00104   updatePhiStripsMap(detInfo);
00105   
00106   m_RPCDetInfoMap[detInfo.rawId()]=detInfo; 
00107   m_RPCDetPhiMap[detInfo.getPhi()]=detInfo.rawId();
00108  
00109   
00110   return true;
00111 }
00112 
00113 //#############################################################################
00119 //#############################################################################
00120 int RPCRingFromRolls::makeOtherConnections(float phiCentre, int m_tower, int m_PAC){
00121   
00122   if (isRefPlane()){
00123     edm::LogError("RPCTrigger") << "Trouble. RingFromRolls " << m_curlId
00124         << " is a reference curl. makeOtherConnections() is not good for reference curls";
00125     return -1;
00126   }
00127 
00128   if ( (m_tower < getMinTower()) || (m_tower > getMaxTower()))  // This curl not contributes to this m_tower.
00129     return 0;
00130 
00131   doVirtualStrips();
00132   filterMixedStrips(); // Fixes overlaping chambers problem
00133   
00134   RPCConnection newConnection;
00135   newConnection.m_PAC = m_PAC;
00136   newConnection.m_tower = m_tower; 
00137   newConnection.m_logplane = giveLogPlaneForTower(newConnection.m_tower);
00138     
00139   if (newConnection.m_logplane < 0){
00140     
00141     LogDebug("RPCTrigger") << "Trouble. RingFromRolls "<< getRingFromRollsId()
00142         << " wants to contribute to m_tower " << m_tower;
00143        
00144     return -1;
00145   }
00146   
00147   int logplaneSize = m_LOGPLANE_SIZE[std::abs(newConnection.m_tower)][newConnection.m_logplane-1];
00148   //int logplaneSize = m_LOGPLANE_SIZE[std::abs(newConnection.m_tower)][m_hwPlane-1];
00149   
00150   if ((logplaneSize > 72)||(logplaneSize < 1)){
00151     LogDebug("RPCTrigger") << "Trouble. RingFromRolls "<< getRingFromRollsId()
00152         << " wants to have wrong strips number (" << logplaneSize<< ")"
00153         << " in plane " << newConnection.m_logplane
00154         << " in m_tower " << newConnection.m_tower;
00155         
00156     return -1;
00157   }
00158   
00159       
00160   // \note The  m_stripPhiMap is sorted in a special way (see header)
00161   GlobalStripPhiMap::const_iterator it = m_stripPhiMap.lower_bound(phiCentre);
00162   if (it==m_stripPhiMap.end()){
00163       it == m_stripPhiMap.begin();
00164   }
00165     
00166   
00167   for (int i=0; i < logplaneSize/2; i++){ 
00168     if (it==m_stripPhiMap.begin())
00169       it=m_stripPhiMap.end();  // (m_stripPhiMap.end()--) is ok.
00170     it--;
00171   }
00172   
00173   // In barell station 4 (farrest station) chambers overlap in phi.
00174   // This is the q&d method to avoid mixing of strips in logplanes
00175   /*
00176   if (m_region == 0 && m_hwPlane == 4){
00177                
00178       std::map<uint32_t,GlobalStripPhiMap> chambersMap;
00179       std::map<uint32_t,float> lowestPhiMap; // For finding lowest phi in each chamber
00180       
00181       for (int i=0; i < logplaneSize; i++){
00182           stripCords scTemp = it->second;
00183           (chambersMap[scTemp.m_detRawId])[it->first]=it->second;
00184           //aMap[it->first]=it->second;
00185           
00186           if (lowestPhiMap.find(scTemp.m_detRawId)==lowestPhiMap.end())// New detID
00187             {
00188                lowestPhiMap[scTemp.m_detRawId]=it->first;                                               
00189             } 
00190           else // detId allready in map
00191             {
00192                RPCRingFromRolls::phiMapCompare compare;
00193                   // compare(a,b) <=>  (a<b)
00194                if (compare(lowestPhiMap[scTemp.m_detRawId],it->first))
00195                  {
00196                    lowestPhiMap[scTemp.m_detRawId]=it->first;
00197                  }
00198             }
00199         it++;
00200         if (it==m_stripPhiMap.end())
00201           it=m_stripPhiMap.begin();
00202       } // for (int i=0; i < logplaneSize; i++) ends
00203       
00204 
00205       
00206       // sort chambers in phi
00207       std::map<float,uint32_t,phiMapCompare> chambersIds;
00208       
00209       std::map<uint32_t,float>::const_iterator phiIt =  lowestPhiMap.begin();
00210       for (;phiIt!=lowestPhiMap.end();phiIt++){
00211           chambersIds[phiIt->second]=phiIt->first;
00212       }
00213       
00214       // Now we can iterate over the strips in each chamber      
00215       std::map<float,uint32_t,phiMapCompare>::const_iterator chambersIt = chambersIds.begin();
00216       int curStripInConeNo = 0;
00217       for (;chambersIt!=chambersIds.end();chambersIt++){
00218           GlobalStripPhiMap aMap = chambersMap[chambersIt->second];
00219           
00220           GlobalStripPhiMap::const_iterator stripIt = aMap.begin();
00221           for(;stripIt!=aMap.end();stripIt++){
00222              //stripCords scTemp = stripIt->second;
00223              newConnection.m_posInCone = curStripInConeNo;
00224              m_links[stripIt->second].push_back(newConnection);
00225              curStripInConeNo++;
00226           }
00227       }
00228   
00229 }
00230   else // Normal, non overlaping chamber
00231   {
00232       for (int i=0; i < logplaneSize; i++){
00233         stripCords scTemp = it->second;
00234         newConnection.m_posInCone = i;
00235         m_links[it->second].push_back(newConnection);
00236     
00237         it++;
00238         if (it==m_stripPhiMap.end())
00239           it=m_stripPhiMap.begin();
00240       }
00241   }
00242   */
00243   
00244   // 
00245   for (int i=0; i < logplaneSize; i++){
00246     stripCords scTemp = it->second;
00247     newConnection.m_posInCone = i;
00248     m_links[it->second].push_back(newConnection);
00249     
00250     it++;
00251     if (it==m_stripPhiMap.end())
00252       it=m_stripPhiMap.begin();
00253   }
00254 
00255     
00256   return 0;
00257   
00258 }
00259 //#############################################################################
00260 RPCRingFromRolls::RPCLinks RPCRingFromRolls::giveConnections(){
00261   
00262   return m_links;
00263 }
00264 //#############################################################################
00272 //#############################################################################
00273 int RPCRingFromRolls::makeRefConnections(RPCRingFromRolls *otherRingFromRolls){
00274   
00275   if (!isRefPlane()){
00276     
00277     edm::LogError("RPCTrigger") << "Trouble. RingFromRolls " << m_curlId 
00278         << " is not a reference curl. makeRefConnections() is good only for reference curls";
00279         
00280     return -1;
00281   }
00282   
00283   doVirtualStrips();
00284   
00285   int curPacNo=-1;  // pacs are numbered from 0 to 143 (there is curPacNo++ in first iteration)
00286   int curStripNo=0;
00287   int curBegStripNo=0;
00288   
00289   
00290   GlobalStripPhiMap::const_iterator it;    
00291   // \note The  m_stripPhiMap is sorted in a special way (see header)
00292   for (it=m_stripPhiMap.begin(); it != m_stripPhiMap.end(); it++){
00293     
00294     if (curStripNo%8==0)    // new pac
00295     {
00296       curPacNo++;
00297       curBegStripNo=curStripNo;
00298       
00299       GlobalStripPhiMap::const_iterator plus8 = it;    
00300       for (int i=0;i<7;i++){  // i<7 (!) - there are 8 strips in ref plane !! i<8 would be wrong
00301         plus8++;
00302         if (plus8==m_stripPhiMap.end()){ // \note The  m_stripPhiMap is sorted in a special way (see header)
00303           plus8--;
00304           break;
00305         }
00306       }
00307       
00308       float phi1 = it->first;
00309       float phi2 = plus8->first;
00310       float centrePhi = (phi1+phi2)/2;
00311       
00312       if (std::min(phi1,phi2) < 1 && std::max(phi1,phi2) > 5)// to avoid (0+2pi)/2 = pi (should be = 0 )
00313       {
00314         const float pi = 3.141592654;
00315         centrePhi -= pi;
00316         if (centrePhi<0)
00317           centrePhi += 2*pi;
00318       }
00319       otherRingFromRolls->makeOtherConnections(centrePhi, m_towerMin, curPacNo);// Make Connections within the other curl
00320     } // new pac end
00321     
00322     RPCConnection newConnection;
00323     newConnection.m_PAC = curPacNo;
00324     newConnection.m_tower = m_towerMin; // For refRingFromRolls m_towerMin and m_towerMax are equal
00325     newConnection.m_posInCone = curStripNo-curBegStripNo;  // Conevention: first strip in m_logplane is no. 0 
00326     
00327     newConnection.m_logplane = giveLogPlaneForTower(newConnection.m_tower);
00328   
00329     if (newConnection.m_logplane < 0){
00330       
00331       edm::LogError("RPCTrigger") << "Trouble. Strip " << it->second.m_stripNo
00332           << " of det " << it->second.m_detRawId
00333           << " has negative m_logplane";
00334       
00335     }
00336     
00337     if (m_links.find(it->second)==m_links.end() ){// new strip in map
00338       m_links[it->second].push_back(newConnection);
00339     } 
00340     else {  // strip allready in map, we should have the same connections
00341       
00342       RPCConnectionsVec existingConnection = m_links[it->second];
00343       if ( (existingConnection[0].m_PAC != newConnection.m_PAC ) ||  
00344             (existingConnection[0].m_tower != newConnection.m_tower ) ||
00345             (existingConnection[0].m_logplane != newConnection.m_logplane ) ||
00346             (existingConnection[0].m_posInCone != newConnection.m_posInCone ) )
00347       {
00348         
00349         edm::LogError("RPCTrigger") << "Trouble. Strip " << it->second.m_stripNo
00350             << " of reference det " << it->second.m_detRawId
00351             << " has multiple connections";
00352             
00353       }
00354       
00355     } // end check if strip allready in map
00356     curStripNo++;
00357   }// end loop over strips
00358   
00359   
00360   return 0;    
00361 }
00362 //#############################################################################
00369 //#############################################################################
00370 int RPCRingFromRolls::giveLogPlaneForTower(int tower){
00371     
00372   int logplane = -1;
00373   for (int i=0;i<3;i++){
00374     int ttemp = m_mrtow [std::abs(m_globRoll)] [m_hwPlane-1][i];
00375     if ( ttemp == std::abs(tower) )
00376       logplane = m_mrlogp [std::abs(m_globRoll)] [m_hwPlane-1][i];
00377   }
00378 
00379   return logplane;
00380 }
00381 //#############################################################################
00387 //#############################################################################
00388 void RPCRingFromRolls::updatePhiStripsMap(RPCDetInfo detInfo){
00389   
00390   uint32_t rawId = detInfo.rawId();
00391   
00392   RPCDetInfo::RPCStripPhiMap sourceMap = detInfo.getRPCStripPhiMap();
00393   RPCDetInfo::RPCStripPhiMap::const_iterator it;
00394   
00395   float maxPhi=0, minPhi=0;
00396   int maxStripNo=0;
00397   bool firstIt=true;
00398   
00399   for (it = sourceMap.begin(); it != sourceMap.end(); it++){
00400 
00401     float phi = it->second;
00402     stripCords sc;
00403     sc.m_stripNo = it->first;
00404     sc.m_detRawId = rawId;
00405     sc.m_isVirtual = false;
00406     m_stripPhiMap[phi]=sc;
00407     
00408     if(firstIt){
00409       maxPhi=phi;
00410       minPhi=phi;
00411       maxStripNo = sc.m_stripNo;
00412       firstIt=false;          
00413     } 
00414     
00415     if(phi < minPhi){
00416       minPhi=phi;
00417     }
00418     if(phi > maxPhi){
00419       maxPhi=phi;
00420     }
00421     
00422     if (maxStripNo<sc.m_stripNo)
00423       maxStripNo=sc.m_stripNo;
00424     
00425     m_physStripsInRingFromRolls++;
00426   }// loop end
00427   
00428 }
00429 //#############################################################################
00435 //#############################################################################
00436 void RPCRingFromRolls::filterMixedStrips(){
00437 
00438   if (m_didFiltering){ // run once
00439     return;
00440   }
00441   
00442   m_didFiltering=true;
00443   
00444   if (m_region != 0 || m_hwPlane != 4) 
00445     return;
00446   
00447 //  std::cout << "Another filtering" << std::endl;
00448   
00449   RPCRingFromRolls::phiMapCompare compare;
00450   /*
00451                   // compare(a,b) <=>  (a<b)
00452   if (compare(lowestPhiMap[scTemp.m_detRawId],it->first))
00453   {
00454     lowestPhiMap[scTemp.m_detRawId]=it->first;
00455   }
00456   */
00457   /*  
00458   std::map<uint32_t,float> phiCutMap;
00459   //Iterate over the chambers. For each chamber calculate a cut in phi
00460   RPCDetInfoPhiMap::const_iterator it = m_RPCDetPhiMap.begin();
00461   for(;it!=m_RPCDetPhiMap.end();it++){
00462   
00463   
00464 }*/
00465   
00466   // filter strips
00467   
00468   uint32_t curRawID = 0, firstRawID = 0;
00469   bool firstRun=true;
00470   float phiCut = 0;
00471   
00472   std::vector<uint32_t> procChambers; // Stores rawIds of chambers that were processed
00473     
00474   GlobalStripPhiMap::iterator it = m_stripPhiMap.begin();
00475   for(;it!=m_stripPhiMap.end();it++){
00476     
00477     if(firstRun){
00478       firstRun=false;
00479       curRawID = it->second.m_detRawId;
00480       phiCut = m_RPCDetInfoMap[curRawID].getMaxPhi();
00481       firstRawID = curRawID; // First chamber is processed twice - at begin at the end of processing
00482     } 
00483     else {
00484       float phi = it->first;
00485       uint32_t rawID = it->second.m_detRawId;
00486   //    std::cout << rawID << " " << phi << " " << phiCut << std::endl;
00487       if (rawID!=curRawID){ // Region of mixed strips
00488         //if (procChambers.find(rawID)!=procChambers.end()){
00489         if (std::find(procChambers.begin(),procChambers.end(),rawID)!=procChambers.end()){
00490           if (rawID == firstRawID && procChambers.size() != 1) {} //do nothing for first processed chamber when  
00491                                                                   // proccesing it second time at the end
00492           else
00493             throw RPCException("The chamber should be allready processed");
00494         }
00495         if (compare(phi,phiCut)){  // compare(a,b) <=>  (a<b)
00496           //GlobalStripPhiMap::iterator ittemp = it;
00497           m_stripPhiMap.erase(it++);// delete strip pointed by it (not by it++ !)
00498           //ittemp--; // 
00499           //it=ittemp; 
00500           it--; // go to prev. element - loop will inc. it for us
00501         } 
00502         else { // Strip is ok - start new chamber
00503           procChambers.push_back(curRawID); // Store info, that the chamber was proccessd
00504           curRawID=rawID; // save new chamber id
00505           phiCut = m_RPCDetInfoMap[curRawID].getMaxPhi(); // get new cut
00506         }
00507       
00508       }
00509         
00510         
00511     }
00512   
00513   
00514   }
00515   
00516   
00517 
00518 }
00519 //#############################################################################
00529 //#############################################################################
00530 void RPCRingFromRolls::doVirtualStrips(){
00531   
00532   if (m_didVirtuals){ // run once
00533     return;
00534   }
00535   m_didVirtuals=true;
00536   
00537   const float pi = 3.141592654;
00538 
00539   bool firstRun=true;
00540   GlobalStripPhiMap newVirtualStrips;
00541   
00542   double dphi=2.0*pi/1152;  // defines angular granulation of strips.
00543   
00544   float phiMinNext=0, phiMaxNext=0, phiMinLast=0,phiMaxLast=0;
00545   uint32_t rawDetIDLast=0,rawDetIDNext=0;
00546   
00547   //now we iterate over all dets adding virtual strips begining from phiMax+dphi
00548   RPCDetInfoPhiMap::const_iterator it;
00549   for (it=m_RPCDetPhiMap.begin(); it != m_RPCDetPhiMap.end(); it++){
00550     
00551     RPCDetInfo *det = &m_RPCDetInfoMap[it->second];
00552     
00553     /*
00554       In first iteration we dont have *Last and *Next values. We must suck them
00555       in 'artificial' way
00556     */
00557     if(firstRun){
00558       phiMinNext = det->getMinPhi();
00559       phiMaxNext = det->getMaxPhi();
00560       rawDetIDNext=it->second; // not really needed
00561       
00562       RPCDetInfoPhiMap::const_reverse_iterator itTemp = m_RPCDetPhiMap.rbegin();
00563       RPCDetInfo *detTemp = &m_RPCDetInfoMap[itTemp->second];
00564       phiMinLast=detTemp->getMinPhi();
00565       phiMaxLast=detTemp->getMaxPhi();
00566       rawDetIDLast= itTemp->second;
00567       firstRun=false;
00568     }
00569     else {
00570       rawDetIDLast=rawDetIDNext;
00571       rawDetIDNext=it->second;
00572       phiMinLast = phiMinNext;
00573       phiMaxLast = phiMaxNext;
00574       phiMinNext = det->getMinPhi();
00575       phiMaxNext = det->getMaxPhi();
00576     }
00577     
00578     float delta = phiMinNext - phiMaxLast;
00579     delta += 2*pi*(delta<-5);// (-5) Fixes problem of overlaping chambers
00580     
00581     if (delta<0)
00582       continue;
00583 
00584     int stripsToAdd = (int)std::floor(delta/dphi)-1;
00585     if ( isRefPlane() && m_hwPlane==6)
00586        stripsToAdd++; 
00587     
00588     stripCords sc;
00589     sc.m_detRawId = rawDetIDLast;
00590     sc.m_stripNo = 0;
00591     sc.m_isVirtual = true;
00592     for (int i = 0;i<stripsToAdd;i++){
00593         sc.m_stripNo--;
00594         newVirtualStrips[phiMaxLast+dphi*(i+1)]=sc;
00595         m_virtStripsInRingFromRolls++;
00596     }
00597   } // loop over dets end 
00598   
00599   
00600   if ( (isRefPlane()) && (m_virtStripsInRingFromRolls+m_physStripsInRingFromRolls!=1152)){
00601     
00602     edm::LogError("RPCTrigger")<<"Trouble. Reference curl " << getRingFromRollsId() 
00603         << " has " << m_virtStripsInRingFromRolls+m_physStripsInRingFromRolls << " strips."
00604         << " (v=" << m_virtStripsInRingFromRolls 
00605         << ";p=" << m_physStripsInRingFromRolls <<")";         
00606   }
00607   
00608   m_stripPhiMap.insert(newVirtualStrips.begin(),newVirtualStrips.end() );
00609 }
00610 //#############################################################################
00617 //#############################################################################
00618 void RPCRingFromRolls::setRefPlane() {
00619   
00620   m_isRefPlane = false;
00621   if (m_region == 0 && std::abs(m_ring)<2 && m_hwPlane == 2) // for barell wheel -1,0,1 refplane is hwPlane=2
00622     m_isRefPlane = true;
00623   else if (m_region == 0 && std::abs(m_ring)==2 && m_hwPlane == 6) // for barell wheel -2,2 refplane is hwPlane=6
00624     m_isRefPlane = true;
00625   else if (m_region != 0 && m_hwPlane == 2) // for endcaps
00626     m_isRefPlane = true;
00627   
00628   if( m_curlId == 2008 || m_curlId == 2108) //exception: endcaps;hwplane 2;farest roll from beam
00629     m_isRefPlane = false;
00630 }
00631 
00632 //#############################################################################
00633 //#
00634 //# Simple getters
00635 //#
00636 //#############################################################################
00637 bool RPCRingFromRolls::isRefPlane() const { return m_isRefPlane;} 
00638 int RPCRingFromRolls::getMinTower() const { return m_towerMin;} 
00639 int RPCRingFromRolls::getMaxTower() const{ return m_towerMax;} 
00640 int RPCRingFromRolls::getRingFromRollsId() const{ return m_curlId;} 
00641 
00642 
00643 //#############################################################################
00644 //##
00645 //## \note RingFromRolls of hwPlane = 2, roll = 8 is connected nowhere. Why?
00646 //##
00647 //#############################################################################
00648 
00649 
00650 // Straigth from ORCA
00651 const int RPCRingFromRolls::m_mrtow [RPCRingFromRolls::IROLL_MAX+1] [RPCRingFromRolls::NHPLANES] [RPCRingFromRolls::NPOS] =
00652 //const int RPCRingFromRolls::m_mrtow [] [] [] =
00653 {
00654 // MB1in/MF1  MB2in/MF2   MB3/MF3   MB4/MF4      MB1out    MB2out
00655 //     1          2          3         4           5         6
00656   { {-1,-1,-1},{ 0,-1,-1},{-1,-1,-1},{-1,-1,-1},{-1,-1,-1},{-1,-1,-1} },   //roll 0
00657   { { 0, 1,-2},{ 1,-1,-1},{ 0, 1,-1},{ 0, 1,-1},{ 0, 1,-2},{ 0, 1,-1} },   //     1
00658   { { 2, 3, 4},{ 2,-1,-1},{ 1, 2,-1},{ 1, 2,-1},{ 2, 3, 4},{ 2, 3,-1} },   //     2  //<<corrected plane 3, kb
00659   { {-1,-1,-1},{ 3,-1,-1},{-1,-1,-1},{-1,-1,-1},{-1,-1,-1},{-1,-1,-1} },   //     3
00660   { { 4, 5,-6},{ 4,-1,-1},{ 2, 3, 4},{ 2, 3,-1},{ 4, 5,-1},{ 3, 4,-1} },   //     4  //<<corrected plane 3, kb
00661   { { 6, 7, 8},{ 5,-6, 6},{ 4, 5,-1},{ 4,-1,-1},{ 5, 6, 7},{ 5,-1,-1} },   //     5
00662   { {-1,-1,-1},{-1,-1,-1},{-1,-1,-1},{-1,-1,-1},{-1,-1,-1},{ 6,-1,-1} },   //     6
00663   { { 8, 9,-1},{ 7,-7,-1},{ 5, 6,-1},{ 4, 5,-1},{ 7, 8,-1},{ 7,-1,-1} },   //     7
00664   { {-1, 7,-1},{-1,-1,-1},{ 9,-9,-1},{10,-1,-1},{-1,-1,-1},{-1,-1,-1} },   //     8
00665   { { 7, 8,-1},{ 8,-1,-1},{ 9,-9,10},{10,11,-1},{-1,-1,-1},{-1,-1,-1} },   //     9
00666   { { 8,-1,-1},{ 9,-1,-1},{10,11,-1},{11,12,-1},{-1,-1,-1},{-1,-1,-1} },   //    10
00667   { {10,-1,-1},{10,-1,-1},{11,12,-1},{12,13,-1},{-1,-1,-1},{-1,-1,-1} },   //    11
00668   { {10,11,-1},{11,-1,-1},{12,13,-1},{13,14,-1},{-1,-1,-1},{-1,-1,-1} },   //    12
00669   { {11,12,-1},{12,-1,-1},{13,14,-1},{14,15,-1},{-1,-1,-1},{-1,-1,-1} },   //    13
00670   { {13,14,-1},{13,-1,-1},{14,15,-1},{15,16,-1},{-1,-1,-1},{-1,-1,-1} },   //    14
00671   { {14,15,-1},{14,-1,-1},{15,16,-1},{16,-1,-1},{-1,-1,-1},{-1,-1,-1} },   //    15
00672   { {15,16,-1},{15,-1,-1},{-1,-1,-1},{-1,-1,-1},{-1,-1,-1},{-1,-1,-1} },   //    16
00673   { {16,-1,-1},{16,-1,-1},{-1,-1,-1},{-1,-1,-1},{-1,-1,-1},{-1,-1,-1} }    //    17
00674 };
00675 
00676 const int RPCRingFromRolls::m_mrlogp [RPCRingFromRolls::IROLL_MAX+1] [RPCRingFromRolls::NHPLANES] [RPCRingFromRolls::NPOS] =
00677 //const int RPCRingFromRolls::m_mrlogp [] [] [] =
00678 {
00679 // MB1in/MF1  MB2in/MF2   MB3/MF3   MB4/MF4      MB1out    MB2out
00680 //     1          2          3          4          5          6
00681   {  {0,0,0},   {3,0,0},   {0,0,0},   {0,0,0},   {0,0,0},   {0,0,0} },  // roll  0
00682   {  {1,1,-1},  {3,0,0},   {5,5,0},   {6,6,0},   {2,2,-2},  {4,4,0} },  //       1
00683   {  {1,1,1},   {3,0,0},   {5,5,0},   {6,6,0},   {2,2,2},   {4,4,0} },  //       2 <<3
00684   {  {0,0,0},   {3,0,0},   {0,0,0},   {0,0,0},   {0,0,0},   {0,0,0} },  //       3
00685   {  {1,1,-5},  {3,0,0},   {5,5,5},   {6,6,0},   {2,2,0},   {4,4,0} },  //       4 <<3
00686   {  {1,1,1},   {3,-3,3},  {5,5,0},   {6,0,0},   {2,2,2},   {4,0,0} },  //       5
00687   {  {0,0,0},   {0,0,0},   {0,0,0},   {0,0,0},   {0,0,0},   {4,0,0} },  //       6
00688   {  {1,1,0},   {3,-3,0},  {5,5,0},   {6,6,0},   {2,2,0},   {4,0,0} },  //       7
00689   {  {0,5,0},   {0,0,0},   {3,-5,0},  {4,0,0},   {0,0,0},   {0,0,0} },  //       8
00690   {  {5,3,0},   {4,0,0},   {3,-5,3},  {4,4,0},   {0,0,0},   {0,0,0} },  //       9
00691   {  {3,0,0},   {2,0,0},   {3,3,0},   {4,4,0},   {0,0,0},   {0,0,0} },  //      10
00692   {  {1,0,0},   {2,0,0},   {3,3,0},   {4,4,0},   {0,0,0},   {0,0,0} },  //      11
00693   {  {1,1,0},   {2,0,0},   {3,3,0},   {4,4,0},   {0,0,0},   {0,0,0} },  //      12
00694   {  {1,1,0},   {2,0,0},   {3,3,0},   {4,4,0},   {0,0,0},   {0,0,0} },  //      13
00695   {  {1,1,0},   {2,0,0},   {3,3,0},   {4,4,0},   {0,0,0},   {0,0,0} },  //      14
00696   {  {1,1,0},   {2,0,0},   {3,3,0},   {4,0,0},   {0,0,0},   {0,0,0} },  //      15
00697   {  {1,1,0},   {2,0,0},   {0,0,0},   {0,0,0},   {0,0,0},   {0,0,0} },  //      16
00698   {  {1,0,0},   {2,0,0},   {0,0,0},   {0,0,0},   {0,0,0},   {0,0,0} }   //      17
00699 };
00700 
00701 
00702 // Straigth from ORCA
00703 const unsigned int RPCRingFromRolls::m_LOGPLANE_SIZE[RPCRingFromRolls::TOWERMAX+1][RPCRingFromRolls::NHPLANES] = {
00704 //const unsigned int RPCRingFromRolls::m_LOGPLANE_SIZE[17][6] = {
00705  //LOGPLANE  1,  2,  3   4   5   6
00706            {72, 56,  8, 40, 40, 24}, //TOWER 0
00707            {72, 56,  8, 40, 40, 24}, //TOWER 1
00708            {72, 56,  8, 40, 40, 24}, //TOWER 2
00709            {72, 56,  8, 40, 40, 24}, //TOWER 3
00710            {72, 56,  8, 40, 40, 24}, //TOWER 4
00711            {72, 56, 40,  8, 40, 24}, //TOWER 5
00712            {56, 72, 40,  8, 24,  0}, //TOWER 6
00713            {72, 56, 40,  8, 24,  0}, //TOWER 7
00714            {72, 24, 40,  8,  0,  0}, //TOWER 8
00715            {72,  8, 40,  0,  0,  0}, //TOWER 9
00716            {72,  8, 40, 24,  0,  0}, //TOWER 10
00717            {72,  8, 40, 24,  0,  0}, //TOWER 11
00718            {72,  8, 40, 24,  0,  0}, //TOWER 12
00719            {72,  8, 40, 24,  0,  0}, //TOWER 13
00720            {72,  8, 40, 24,  0,  0}, //TOWER 14
00721            {72,  8, 40, 24,  0,  0}, //TOWER 15
00722            {72,  8, 40, 24,  0,  0}  //TOWER 16
00723 
00724 };
00725 //#############################################################################
00731 //#############################################################################
00732 void RPCRingFromRolls::printContents() {
00733 
00734   /*
00735   if (getRingFromRollsId()==71001){
00736 
00737     GlobalStripPhiMap::const_iterator it;
00738     for (it=m_stripPhiMap.begin(); it != m_stripPhiMap.end(); it++){
00739       LogDebug("RPCTrigger") << "phi" << it->first
00740           << " m_stripNo=" << (it->second).m_stripNo
00741           << " m_isVirtual=" << (it->second).m_isVirtual
00742     }
00743   }//*/
00744 
00745   if (isRefPlane())
00746     LogDebug("RPCTrigger") << " Reference plane:";
00747   else
00748     LogDebug("RPCTrigger") << " Normal plane:";
00749   
00750   LogDebug("RPCTrigger") << "No. of DetInfo's " << m_RPCDetInfoMap.size()
00751       << "; towers: min= " << m_towerMin 
00752       << " max= " << m_towerMax 
00753       << "|globRoll= " << m_globRoll
00754       << " hwPlane= " << m_hwPlane
00755       << "|strips:"
00756       << " phys= " << m_physStripsInRingFromRolls
00757       << " virt= " << m_virtStripsInRingFromRolls
00758       << " all= " << m_virtStripsInRingFromRolls+m_physStripsInRingFromRolls
00759       << "|strips conneced: " << m_links.size(); // with or without virtual strips. check it, it may have changed
00760   
00761   
00762   /*
00763   RPCDetInfoPhiMap::const_iterator it;
00764   for (it = m_RPCDetPhiMap.begin(); it != m_RPCDetPhiMap.end(); it++){
00765   
00766     //LogDebug("RPCTrigger")
00767     //    << "Phi: " << it->first << " "
00768     //   << "detId: " << it->second  <<
00769   
00770     
00771     m_RPCDetInfoMap[it->second].printContents();
00772         
00773   }
00774   //*/
00775   /*
00776   GlobalStripPhiMap::const_iterator it;
00777   for (it = m_stripPhiMap.begin(); it != m_stripPhiMap.end(); it++){
00778   LogDebug("RPCTrigger")
00779         << "Phi: " << it->first 
00780         << " detId: " << it->second.m_detRawId 
00781         << " m_stripNo: " << it->second.m_stripNo  << 
00782   }//*/
00783 
00784 }
00785 
00786 

Generated on Tue Jun 9 17:40:25 2009 for CMSSW by  doxygen 1.5.4