CMS 3D CMS Logo

Public Member Functions | Private Attributes

CSCTriggerContainer< T > Class Template Reference

#include <CSCTriggerContainer.h>

List of all members.

Public Member Functions

void clear ()
 CSCTriggerContainer (const CSCTriggerContainer &cpy)
 CSCTriggerContainer ()
 CSCTriggerContainer (const std::vector< T > &)
std::vector< T > get (const unsigned &endcap, const unsigned &station, const unsigned &tsector, const unsigned &tsubsector, const unsigned &cscid, const int &BX) const
std::vector< T > get (const int &BX) const
std::vector< T > get (const unsigned &endcap, const unsigned &station, const unsigned &tsector, const unsigned &tsubsector, const int &BX) const
 in a station.
std::vector< T > get (const unsigned &endcap, const unsigned &sector, const int &BX) const
std::vector< T > get (const unsigned &endcap, const unsigned &sector) const
 For objects which span multiple stations.
std::vector< T > get () const
CSCTriggerContaineroperator= (const CSCTriggerContainer &)
CSCTriggerContaineroperator= (const std::vector< T > &)
void push_back (const T data)
void push_many (const CSCTriggerContainer< T > data)
void push_many (const std::vector< T > data)

Private Attributes

std::vector< T > _objs

Detailed Description

template<class T>
class CSCTriggerContainer< T >

Author:
L. Gray

A container class to make things more manageable for a Trigger Processor. DigiCollections make per-BX processing complicated, this class makes it easier.

Any class T must have the following functions: // inherit from base class! T(const T&) operator= station() sector() subsector() BX()

Definition at line 23 of file CSCTriggerContainer.h.


Constructor & Destructor Documentation

template<class T>
CSCTriggerContainer< T >::CSCTriggerContainer ( ) [inline]

Definition at line 27 of file CSCTriggerContainer.h.

{}
template<class T>
CSCTriggerContainer< T >::CSCTriggerContainer ( const CSCTriggerContainer< T > &  cpy) [inline]

Definition at line 28 of file CSCTriggerContainer.h.

{ _objs = cpy._objs; }
template<class T>
CSCTriggerContainer< T >::CSCTriggerContainer ( const std::vector< T > &  parent)

Definition at line 55 of file CSCTriggerContainer.h.

References dbtoconf::parent.

{
  _objs = parent;
}

Member Function Documentation

template<class T>
void CSCTriggerContainer< T >::clear ( void  ) [inline]
template<class T >
std::vector< T > CSCTriggerContainer< T >::get ( const unsigned &  endcap,
const unsigned &  station,
const unsigned &  tsector,
const unsigned &  tsubsector,
const unsigned &  cscid,
const int &  BX 
) const

Definition at line 84 of file CSCTriggerContainer.h.

References Reference_intrackfit_cff::endcap, i, and query::result.

{
  std::vector<T> result;  

  for(unsigned i = 0; i < _objs.size(); i++)
    if(_objs[i].endcap() == endcap && _objs[i].station() == station && 
       _objs[i].sector() == tsector && (station != 1 || _objs[i].subsector() == tsubsector) && 
       _objs[i].cscid() == cscid && _objs[i].BX() == BX)
      result.push_back(_objs[i]);
  
  return result;
}
template<class T >
std::vector< T > CSCTriggerContainer< T >::get ( const int &  BX) const

Definition at line 141 of file CSCTriggerContainer.h.

References i, and query::result.

{
  std::vector<T> result;

  for(unsigned i = 0; i < _objs.size(); ++i)
    if(_objs[i].BX() == BX) result.push_back(_objs[i]);

  return result;
}
template<class T >
std::vector< T > CSCTriggerContainer< T >::get ( const unsigned &  endcap,
const unsigned &  station,
const unsigned &  tsector,
const unsigned &  tsubsector,
const int &  BX 
) const

in a station.

For a specific chamber

Parameters:
tsubsectorFor a specific station in a sector.

Definition at line 100 of file CSCTriggerContainer.h.

References Reference_intrackfit_cff::endcap, i, and query::result.

{
  std::vector<T> result;  

  for(unsigned i = 0; i < _objs.size(); ++i)
    if(_objs[i].endcap() == endcap && _objs[i].station() == station && 
       _objs[i].sector() == tsector && (station != 1 || _objs[i].subsector() == tsubsector) 
       && _objs[i].BX() == BX)
      result.push_back(_objs[i]);
  
  return result;
}
template<class T >
std::vector< T > CSCTriggerContainer< T >::get ( void  ) const
template<class T >
std::vector< T > CSCTriggerContainer< T >::get ( const unsigned &  endcap,
const unsigned &  sector,
const int &  BX 
) const

Definition at line 116 of file CSCTriggerContainer.h.

References Reference_intrackfit_cff::endcap, i, and query::result.

{
  std::vector<T> result;

  for(unsigned i = 0; i < _objs.size(); ++i)
    if(_objs[i].endcap() == endcap && _objs[i].sector() == sector && _objs[i].BX() == BX)
      result.push_back(_objs[i]);

  return result;
}
template<class T >
std::vector< T > CSCTriggerContainer< T >::get ( const unsigned &  endcap,
const unsigned &  sector 
) const

For objects which span multiple stations.

Definition at line 129 of file CSCTriggerContainer.h.

References Reference_intrackfit_cff::endcap, i, and query::result.

{
  std::vector<T> result;

  for(unsigned i = 0; i < _objs.size(); ++i)
    if(_objs[i].endcap() == endcap && _objs[i].sector() == sector)
      result.push_back(_objs[i]);

  return result;
}
template<class T >
CSCTriggerContainer< T > & CSCTriggerContainer< T >::operator= ( const CSCTriggerContainer< T > &  rhs)

Definition at line 61 of file CSCTriggerContainer.h.

References CSCTriggerContainer< T >::_objs.

{
  if(this != &rhs)
    {
      _objs = rhs._objs;
    }
  return *this;
}
template<class T>
CSCTriggerContainer< T > & CSCTriggerContainer< T >::operator= ( const std::vector< T > &  rhs)

Definition at line 71 of file CSCTriggerContainer.h.

{
  _objs = rhs;
  return *this;
}
template<class T>
void CSCTriggerContainer< T >::push_back ( const T  data) [inline]
template<class T>
void CSCTriggerContainer< T >::push_many ( const std::vector< T >  data) [inline]

Definition at line 45 of file CSCTriggerContainer.h.

Referenced by CSCTFTrackBuilder::buildTracks(), CSCTFTrackProducer::produce(), and CSCTFSectorProcessor::run().

{ _objs.insert(_objs.end(), data.begin(), data.end()); }
template<class T>
void CSCTriggerContainer< T >::push_many ( const CSCTriggerContainer< T >  data) [inline]

Definition at line 46 of file CSCTriggerContainer.h.

{ std::vector<T> vec = data.get(); _objs.insert(_objs.end(), vec.begin(), vec.end()); }

Member Data Documentation

template<class T>
std::vector<T> CSCTriggerContainer< T >::_objs [private]