CMS 3D CMS Logo

Public Member Functions | Public Attributes | Private Attributes

RPCWheelMap Class Reference

#include <RPCWheelMap.h>

List of all members.

Public Member Functions

void addHit (int, int, int)
void prepareData ()
 RPCWheelMap (int)
 RPCWheelMap ()
 Standard constructor.
int wheelid ()
int wheelIdx ()
virtual ~RPCWheelMap ()
 Destructor.

Public Attributes

TTUInputm_ttuinVec

Private Attributes

int m_bx
bool m_debug
int m_maxBx
int m_maxBxWindow
int m_maxSectors
int m_wheelid
std::bitset< 6 > * m_wheelMap
std::bitset< 6 > * m_wheelMapBx

Detailed Description

Author:
Andres Felipe Osorio Oliveros
Date:
2008-11-24

Definition at line 15 of file RPCWheelMap.h.


Constructor & Destructor Documentation

RPCWheelMap::RPCWheelMap ( ) [inline]

Standard constructor.

Definition at line 18 of file RPCWheelMap.h.

{};
RPCWheelMap::RPCWheelMap ( int  wheelid)

Definition at line 19 of file RPCWheelMap.cc.

References i, m_debug, m_maxBx, m_maxBxWindow, m_maxSectors, m_ttuinVec, m_wheelid, m_wheelMap, m_wheelMapBx, reset(), and wheelid().

                                      {
  
  m_maxBx = 7;
  m_maxBxWindow = 3; //... considering that we have a bxing in the range [-3,+3]
  m_maxSectors = 12;
  
  int maxMaps = m_maxBx * m_maxSectors;
  
  m_wheelid    = wheelid;
  m_wheelMap   = new std::bitset<6>[m_maxSectors];
  m_wheelMapBx = new std::bitset<6>[m_maxSectors * m_maxBx];
  m_ttuinVec   = new TTUInput[m_maxBx];
    
  for(int i=0; i < m_maxSectors; ++i)
    m_wheelMap[i].reset();
  
  for(int i=0; i < maxMaps; ++i)
    m_wheelMapBx[i].reset();
  
  m_debug = false;
  
}
RPCWheelMap::~RPCWheelMap ( ) [virtual]

Destructor.

Definition at line 44 of file RPCWheelMap.cc.

References m_ttuinVec, m_wheelMap, and m_wheelMapBx.

                          {
  
  if ( m_wheelMap )   delete[] m_wheelMap;
  if ( m_wheelMapBx ) delete[] m_wheelMapBx;
  if ( m_ttuinVec )   delete[] m_ttuinVec;
  
} 

Member Function Documentation

void RPCWheelMap::addHit ( int  bx,
int  sec,
int  layer 
)

Definition at line 53 of file RPCWheelMap.cc.

References m_maxBxWindow, m_maxSectors, and m_wheelMapBx.

{
  
  // |--12--|--12--|--12--|--12--|--12--|--12--|--12--| (12 sectors x 6 layers x  7 bx)
  // 0.....11
  int indx1 = bx + m_maxBxWindow;
  int indx2 = sec + indx1*m_maxSectors;
  m_wheelMapBx[ indx2 ].set( layer-1, 1);
  
}
void RPCWheelMap::prepareData ( )

Definition at line 64 of file RPCWheelMap.cc.

References gather_cfg::cout, i, TTUInput::input_sec, TTUInput::m_bx, m_debug, TTUInput::m_hasHits, m_maxBx, m_maxBxWindow, m_maxSectors, m_ttuinVec, m_wheelMap, m_wheelMapBx, and run_regression::test.

{
  
  bool anyHits(false);
  
  for(int bx=0; bx < m_maxBx; ++bx) {
  
    anyHits = false;
      
    for(int i=0; i < m_maxSectors; ++i) {
      
      int indx = i + bx*m_maxSectors;
      
      m_ttuinVec[bx].m_bx = ( bx - m_maxBxWindow );
      m_wheelMap[i] = m_wheelMapBx[ indx ];
      m_ttuinVec[bx].input_sec[i] = m_wheelMap[i]; 
    
      anyHits |= m_wheelMap[i].any();
      
      if( m_debug ) {
        std::string test;
        test = m_wheelMap[i].to_string<char,std::char_traits<char>,std::allocator<char> >();
        std::cout << "prepareData> sec: " << i << " " << test << " anyHits " << anyHits << std::endl;
      }
      
    }
    
    m_ttuinVec[bx].m_hasHits = anyHits;
    
  }
  
  if( m_debug ) std::cout << "prepareData> done." << '\n';
  
}
int RPCWheelMap::wheelid ( ) [inline]

Definition at line 28 of file RPCWheelMap.h.

References m_wheelid.

Referenced by RPCWheelMap().

{ return m_wheelid; };
int RPCWheelMap::wheelIdx ( ) [inline]

Definition at line 30 of file RPCWheelMap.h.

References m_wheelid.

{ return (m_wheelid+2); };

Member Data Documentation

int RPCWheelMap::m_bx [private]

Definition at line 38 of file RPCWheelMap.h.

bool RPCWheelMap::m_debug [private]

Definition at line 47 of file RPCWheelMap.h.

Referenced by prepareData(), and RPCWheelMap().

int RPCWheelMap::m_maxBx [private]

Definition at line 40 of file RPCWheelMap.h.

Referenced by prepareData(), and RPCWheelMap().

Definition at line 42 of file RPCWheelMap.h.

Referenced by addHit(), prepareData(), and RPCWheelMap().

Definition at line 41 of file RPCWheelMap.h.

Referenced by addHit(), prepareData(), and RPCWheelMap().

Definition at line 30 of file RPCWheelMap.h.

Referenced by prepareData(), RPCWheelMap(), and ~RPCWheelMap().

int RPCWheelMap::m_wheelid [private]

Definition at line 39 of file RPCWheelMap.h.

Referenced by RPCWheelMap(), wheelid(), and wheelIdx().

std::bitset<6>* RPCWheelMap::m_wheelMap [private]

Definition at line 44 of file RPCWheelMap.h.

Referenced by prepareData(), RPCWheelMap(), and ~RPCWheelMap().

std::bitset<6>* RPCWheelMap::m_wheelMapBx [private]

Definition at line 45 of file RPCWheelMap.h.

Referenced by addHit(), prepareData(), RPCWheelMap(), and ~RPCWheelMap().