CMS 3D CMS Logo

RPCTriggerGeo Class Reference

Class describing RPC trigger geometry. More...

#include <L1Trigger/RPCTrigger/interface/RPCTriggerGeo.h>

List of all members.

Public Member Functions

void buildGeometry (edm::ESHandle< RPCGeometry > rpcGeom)
 Builds RpcGeometry.
L1RpcLogConesVec getCones (edm::Handle< RPCDigiCollection > rpcDigis, int bx)
 Builds cones from digis.
RPCRingFromRolls::RPCLinks getLinks () const
std::vector< intgetTowersForStrip (RPCDetId detID, int strip)
 Returns vector of tower numbers coresponding to given strip.
bool isGeometryBuilt ()
 Checks, if we have built the geometry already.
void printLinks ()
 Util function to print m_links map contents.
 RPCTriggerGeo ()
 Default constructor.
 ~RPCTriggerGeo ()

Private Types

typedef std::map< uint32_t,
RPCRingFromRolls
RPCRingFromRollsMap

Private Member Functions

void addDet (RPCRoll *roll)
 Adds detID to the collection.
int etaToTower (float eta)
void printRingFromRollsMapInfo ()
 Util function to print rpcChambersMap contents.

Private Attributes

std::set< uint32_t > m_detsToIngore
 Temp. solution to the problem of not connected dets (in ORCA).
bool m_isGeometryBuilt
 Determines if geometry is built allready.
RPCRingFromRolls::RPCLinks m_links
 Translates rpcdigi into loghits.
RPCRingFromRollsMap m_otherRPCRingFromRollsMap
 Stores other curls.
RPCRingFromRollsMap m_refRPCRingFromRollsMap
 Stores refernce curls.
RPCRingFromRollsMap m_RPCRingFromRollsMap
 Stores all curls.


Detailed Description

Class describing RPC trigger geometry.

Aim: easly convert RPCdetId.firedStrip to loghit/logcone

Author:
Tomasz Fruboes

Definition at line 29 of file RPCTriggerGeo.h.


Member Typedef Documentation

typedef std::map<uint32_t, RPCRingFromRolls> RPCTriggerGeo::RPCRingFromRollsMap [private]

Definition at line 50 of file RPCTriggerGeo.h.


Constructor & Destructor Documentation

RPCTriggerGeo::RPCTriggerGeo (  ) 

Default constructor.

Definition at line 32 of file RPCTriggerGeo.cc.

References m_isGeometryBuilt.

00032                             {
00033 
00034   m_isGeometryBuilt=false;
00035 
00036 }

RPCTriggerGeo::~RPCTriggerGeo (  )  [inline]

Definition at line 32 of file RPCTriggerGeo.h.

00032 {};


Member Function Documentation

void RPCTriggerGeo::addDet ( RPCRoll roll  )  [private]

Adds detID to the collection.

Definition at line 169 of file RPCTriggerGeo.cc.

References RPCRingFromRolls::addDetId(), RPCDetInfo::getRingFromRollsId(), m_detsToIngore, m_RPCRingFromRollsMap, and RPCDetInfo::rawId().

Referenced by buildGeometry().

00169                                        {
00170 
00171   RPCDetInfo detInfo(roll);
00172 
00173   // This two RingFromRolls werent connected anywhere in ORCA. They are filtered out for consitency with ORCA.
00174   if ( (detInfo.getRingFromRollsId() == 2108) ||(detInfo.getRingFromRollsId() == 2008) ){
00175     m_detsToIngore.insert(detInfo.rawId());
00176     return;
00177   }
00178   
00179   
00180   if( m_RPCRingFromRollsMap.find(detInfo.getRingFromRollsId()) != m_RPCRingFromRollsMap.end() ){ // RingFromRolls allready in map
00181 
00182      m_RPCRingFromRollsMap[detInfo.getRingFromRollsId()].addDetId(detInfo);
00183 
00184   } else {  // add a new RingFromRolls
00185     
00186     RPCRingFromRolls newRingFromRolls;
00187     newRingFromRolls.addDetId(detInfo);
00188     m_RPCRingFromRollsMap[detInfo.getRingFromRollsId()]=newRingFromRolls;
00189 
00190   }
00191 
00192 }

void RPCTriggerGeo::buildGeometry ( edm::ESHandle< RPCGeometry rpcGeom  ) 

Builds RpcGeometry.

Note:
m_Code accessing geometry info is heavly based on CMSSW/Geometry/RPCGeometry/test/RPCGeometryAnalyzer.cc

Definition at line 53 of file RPCTriggerGeo.cc.

References addDet(), it, m_isGeometryBuilt, m_links, m_otherRPCRingFromRollsMap, m_refRPCRingFromRollsMap, and m_RPCRingFromRollsMap.

Referenced by RPCVHDLConeMaker::initRPCLinks(), RPCTrigger::produce(), and RPCVHDLConeMaker::writeConesDef().

00053                                                                  {
00054  
00055   // Get some information for all RpcDetId`s; store it locally
00056   for(TrackingGeometry::DetContainer::const_iterator it = rpcGeom->dets().begin();
00057       it != rpcGeom->dets().end();
00058       it++)
00059   {
00060     
00061     if( dynamic_cast< RPCRoll* >( *it ) == 0 ) continue;
00062     RPCRoll* roll = dynamic_cast< RPCRoll*>( *it );
00063     addDet(roll);
00064     
00065   } // RpcDet loop end
00066   
00067   // Separete reference curls from others, should be done in previous step
00068   for(RPCRingFromRollsMap::iterator it = m_RPCRingFromRollsMap.begin();
00069       it!=m_RPCRingFromRollsMap.end();
00070       it++)
00071   {
00072     if ( (it->second).isRefPlane() ){
00073       m_refRPCRingFromRollsMap[it->first]=it->second;
00074     }
00075     else  
00076       m_otherRPCRingFromRollsMap[it->first]=it->second;
00077   }
00078   
00079   //loop over reference curls
00080   for ( RPCRingFromRollsMap::iterator itRefRingFromRolls=m_refRPCRingFromRollsMap.begin(); 
00081         itRefRingFromRolls != m_refRPCRingFromRollsMap.end();
00082         itRefRingFromRolls++)
00083   {
00084     //loop over other curls
00085     for ( RPCRingFromRollsMap::iterator itOtherRingFromRolls=m_otherRPCRingFromRollsMap.begin(); 
00086           itOtherRingFromRolls != m_otherRPCRingFromRollsMap.end();
00087           itOtherRingFromRolls++)
00088     {
00089       (itRefRingFromRolls->second).makeRefConnections(&(itOtherRingFromRolls->second));
00090     } //otherRingFromRolls loop end
00091   } // refRingFromRolls's loop end
00092   
00093   
00094   // Copy all stripConections into one place
00095   for ( RPCRingFromRollsMap::iterator it=m_refRPCRingFromRollsMap.begin(); 
00096         it != m_refRPCRingFromRollsMap.end();
00097         it++){
00098           
00099           RPCRingFromRolls::RPCLinks linksTemp = (it->second).giveConnections();
00100           m_links.insert(linksTemp.begin(),linksTemp.end() );
00101           
00102         }
00103   
00104   for ( RPCRingFromRollsMap::iterator it=m_otherRPCRingFromRollsMap.begin(); 
00105         it != m_otherRPCRingFromRollsMap.end();
00106         it++){
00107           
00108           RPCRingFromRolls::RPCLinks linksTemp = (it->second).giveConnections();
00109           m_links.insert(linksTemp.begin(),linksTemp.end() );
00110   
00111   }
00112     
00113   //printRingFromRollsMapInfo();
00114   
00115   // Free memory
00116   m_RPCRingFromRollsMap.clear();
00117   m_refRPCRingFromRollsMap.clear();
00118   m_otherRPCRingFromRollsMap.clear();
00119     
00120   m_isGeometryBuilt=true;
00121   
00122 }

int RPCTriggerGeo::etaToTower ( float  eta  )  [private]

L1RpcLogConesVec RPCTriggerGeo::getCones ( edm::Handle< RPCDigiCollection rpcDigis,
int  bx 
)

Builds cones from digis.

Note:
Based on L1RpcConeBuilder from ORCA

Definition at line 201 of file RPCTriggerGeo.cc.

References it, RPCRingFromRolls::stripCords::m_detRawId, m_detsToIngore, RPCRingFromRolls::stripCords::m_isVirtual, m_links, RPCRingFromRolls::stripCords::m_stripNo, range, and RPCLogCone::setIdx().

Referenced by RPCTrigger::produce().

00201                                                                                      {
00202 
00203   std::vector<RPCLogHit> logHits;
00204     
00205 // Build cones from digis
00206   RPCDigiCollection::DigiRangeIterator detUnitIt;
00207   for (detUnitIt=rpcDigis->begin();
00208        detUnitIt!=rpcDigis->end();
00209        ++detUnitIt)
00210   {
00211     const RPCDetId& id = (*detUnitIt).first;
00212     
00213     int rawId = id.rawId();
00214     
00215     const RPCDigiCollection::Range& range = (*detUnitIt).second;
00216     
00217     for (RPCDigiCollection::const_iterator digiIt = range.first;
00218          digiIt!=range.second;
00219          ++digiIt)
00220     {
00221       if (digiIt->bx()!=bx)
00222          continue;
00223 
00224       RPCRingFromRolls::stripCords sc;
00225       sc.m_detRawId=rawId;
00226       sc.m_stripNo=digiIt->strip();
00227       sc.m_isVirtual=false;
00228       
00229       // Find strip in map
00230       if (m_links.find(sc)!=m_links.end()){
00231       
00232         RPCRingFromRolls::RPCConnectionsVec stripCons = m_links[sc];
00233         //Build loghits
00234         for (RPCRingFromRolls::RPCConnectionsVec::iterator it = stripCons.begin();
00235              it != stripCons.end();
00236              it++)
00237         {
00238           logHits.push_back( RPCLogHit(it->m_tower, it->m_PAC, it->m_logplane, it->m_posInCone) );
00239         }
00240       
00241       } 
00242       // m_detsToIngore fixes problem with two unconnected curls (ORCA consistency)
00243       else if ( m_detsToIngore.find(rawId)==m_detsToIngore.end() ) { 
00244 //       RPCDetId missing = RPCDetId(sc.m_detRawId);
00245         // FIXME: commented out due to changes in handling of overlaping chambers
00246         //throw RPCException( "Strip not present in map ");
00247 //            << missing;
00248         
00249         
00250       }
00251     } // for digiCollection
00252   }// for detUnits
00253 
00254   
00255   // Build cones
00256   L1RpcLogConesVec ActiveCones;
00257   
00258   std::vector<RPCLogHit>::iterator p_lhit;
00259   for (p_lhit = logHits.begin(); p_lhit != logHits.end(); p_lhit++){
00260     bool hitTaken = false;
00261     L1RpcLogConesVec::iterator p_cone;
00262     for (p_cone = ActiveCones.begin(); p_cone != ActiveCones.end(); p_cone++){
00263       hitTaken = p_cone->addLogHit(*p_lhit);
00264       if(hitTaken)
00265         break;
00266     }
00267 
00268     if(!hitTaken) {
00269       RPCLogCone newcone(*p_lhit);
00270       newcone.setIdx(ActiveCones.size());
00271       ActiveCones.push_back(newcone);
00272     }
00273   }// for loghits
00274   
00275   return ActiveCones;
00276 }

RPCRingFromRolls::RPCLinks RPCTriggerGeo::getLinks (  )  const [inline]

Definition at line 40 of file RPCTriggerGeo.h.

References m_links.

Referenced by RPCVHDLConeMaker::initRPCLinks(), and RPCVHDLConeMaker::writeConesDef().

00040 {return m_links;};

std::vector< int > RPCTriggerGeo::getTowersForStrip ( RPCDetId  detID,
int  strip 
)

Returns vector of tower numbers coresponding to given strip.

Definition at line 130 of file RPCTriggerGeo.cc.

References it, RPCRingFromRolls::stripCords::m_detRawId, m_detsToIngore, RPCRingFromRolls::stripCords::m_isVirtual, m_links, RPCRingFromRolls::stripCords::m_stripNo, and DetId::rawId().

00130                                                                         {
00131 
00132   std::vector<int> towersV;
00133   RPCRingFromRolls::stripCords sc;
00134   sc.m_detRawId=detID.rawId();
00135   sc.m_stripNo=strip;
00136   sc.m_isVirtual=false;
00137 
00138   if (m_links.find(sc)!=m_links.end()){
00139      RPCRingFromRolls::RPCConnectionsVec stripCons = m_links[sc];
00140      for (RPCRingFromRolls::RPCConnectionsVec::iterator it = stripCons.begin();
00141           it != stripCons.end();
00142           it++)
00143      {
00144        towersV.push_back(it->m_tower);
00145      }  
00146   }
00147 
00148   else if ( m_detsToIngore.find(sc.m_detRawId)==m_detsToIngore.end() ) { 
00149     // FIXME: commented out due to changes in handling of overlaping chambers
00150     //throw RPCException( "Strip not present in map ");
00151   } 
00152   
00153   else {
00154     // Give output that requested strip is ignored by RPCTrigger
00155 
00156   }
00157 
00158 
00159   return towersV;
00160 
00161 }

bool RPCTriggerGeo::isGeometryBuilt (  ) 

Checks, if we have built the geometry already.

Definition at line 44 of file RPCTriggerGeo.cc.

References m_isGeometryBuilt.

Referenced by RPCVHDLConeMaker::initRPCLinks(), RPCTrigger::produce(), and RPCVHDLConeMaker::writeConesDef().

00044 { return m_isGeometryBuilt; }

void RPCTriggerGeo::printLinks (  ) 

Util function to print m_links map contents.

Definition at line 311 of file RPCTriggerGeo.cc.

References GenMuonPlsPt100GeV_cfg::cout, lat::endl(), RPCRingFromRolls::stripCords::m_detRawId, m_links, and RPCRingFromRolls::stripCords::m_stripNo.

00311                               { 
00312 
00313   for(int iTower=0;iTower<17;iTower++){
00314     for(int iCone=0;iCone<144;iCone++){
00315       for(int iPlane=1;iPlane<7;iPlane++){
00316         if(iTower!=0 || iCone!=1) continue;
00317         std::cout<<"m_Tower, cone: "<<iTower<<" "<<iCone<<std::endl;
00318         
00319         RPCRingFromRolls::RPCLinks::const_iterator CI= m_links.begin();
00320         for(;CI!=m_links.end();CI++){
00321           RPCRingFromRolls::stripCords aCoords = CI->first;
00322           RPCRingFromRolls::RPCConnectionsVec aConnVec = CI->second;
00323           
00324           RPCRingFromRolls::RPCConnectionsVec::const_iterator aConnCI = aConnVec.begin();
00325           for(;aConnCI!=aConnVec.end();aConnCI++){
00326             if(aConnCI->m_tower==iTower && 
00327                aConnCI->m_PAC==iCone &&
00328                aConnCI->m_logplane==iPlane)
00329             {
00330               std::cout<<"chId: "<<aCoords.m_detRawId
00331                        <<" chStrip: "<<aCoords.m_stripNo;
00332               std::cout<<" m_PAC: "<<aConnCI->m_PAC
00333                        <<" m_tower: "<<aConnCI->m_tower
00334                        <<" logPlane: "<<aConnCI->m_logplane
00335                        <<" m_posInCone: "<<aConnCI->m_posInCone
00336                        <<std::endl;
00338             }
00339           }
00340         }
00341       }
00342     }
00343   }
00344      
00345      
00346 }

void RPCTriggerGeo::printRingFromRollsMapInfo (  )  [private]

Util function to print rpcChambersMap contents.

Definition at line 284 of file RPCTriggerGeo.cc.

References it, LogDebug, m_links, m_otherRPCRingFromRollsMap, and m_refRPCRingFromRollsMap.

00284                                              { // XXX - Erase ME
00285   
00286   //*
00287   for ( RPCRingFromRollsMap::iterator it=m_refRPCRingFromRollsMap.begin(); it != m_refRPCRingFromRollsMap.end(); it++){
00288     LogDebug("RPCTrigger") << "------------------------------";
00289     LogDebug("RPCTrigger")  << "RingFromRollsId " << (it->first);
00290     (it->second).printContents();
00291   }
00292   for ( RPCRingFromRollsMap::iterator it=m_otherRPCRingFromRollsMap.begin(); it != m_otherRPCRingFromRollsMap.end(); it++){
00293     LogDebug("RPCTrigger")<< "------------------------------";
00294     LogDebug("RPCTrigger") << "RingFromRollsId " << (it->first);
00295     (it->second).printContents();
00296   }
00297   //*/
00298   
00299   LogDebug("RPCTrigger") << "No of refs: " << m_refRPCRingFromRollsMap.size();
00300   LogDebug("RPCTrigger")  << m_otherRPCRingFromRollsMap.size(); 
00301   LogDebug("RPCTrigger")  << m_links.size();
00302 
00303 }


Member Data Documentation

std::set<uint32_t> RPCTriggerGeo::m_detsToIngore [private]

Temp. solution to the problem of not connected dets (in ORCA).

Definition at line 60 of file RPCTriggerGeo.h.

Referenced by addDet(), getCones(), and getTowersForStrip().

bool RPCTriggerGeo::m_isGeometryBuilt [private]

Determines if geometry is built allready.

Definition at line 49 of file RPCTriggerGeo.h.

Referenced by buildGeometry(), isGeometryBuilt(), and RPCTriggerGeo().

RPCRingFromRolls::RPCLinks RPCTriggerGeo::m_links [private]

Translates rpcdigi into loghits.

Definition at line 58 of file RPCTriggerGeo.h.

Referenced by buildGeometry(), getCones(), getLinks(), getTowersForStrip(), printLinks(), and printRingFromRollsMapInfo().

RPCRingFromRollsMap RPCTriggerGeo::m_otherRPCRingFromRollsMap [private]

Stores other curls.

Definition at line 54 of file RPCTriggerGeo.h.

Referenced by buildGeometry(), and printRingFromRollsMapInfo().

RPCRingFromRollsMap RPCTriggerGeo::m_refRPCRingFromRollsMap [private]

Stores refernce curls.

Definition at line 53 of file RPCTriggerGeo.h.

Referenced by buildGeometry(), and printRingFromRollsMapInfo().

RPCRingFromRollsMap RPCTriggerGeo::m_RPCRingFromRollsMap [private]

Stores all curls.

Definition at line 52 of file RPCTriggerGeo.h.

Referenced by addDet(), and buildGeometry().


The documentation for this class was generated from the following files:
Generated on Tue Jun 9 18:31:13 2009 for CMSSW by  doxygen 1.5.4