CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/DataFormats/L1DTTrackFinder/src/L1MuDTChambPhContainer.cc

Go to the documentation of this file.
00001 //-------------------------------------------------
00002 //
00003 //   Class L1MuDTChambPhContainer
00004 //
00005 //   Description: input data for PHTF trigger
00006 //
00007 //
00008 //   Author List: Jorge Troconiz  UAM Madrid
00009 //
00010 //
00011 //--------------------------------------------------
00012 
00013 //-----------------------
00014 // This Class's Header --
00015 //-----------------------
00016 #include "DataFormats/L1DTTrackFinder/interface/L1MuDTChambPhContainer.h"
00017 
00018 //-------------------------------
00019 // Collaborating Class Headers --
00020 //-------------------------------
00021 
00022 
00023 //---------------
00024 // C++ Headers --
00025 //---------------
00026 using namespace std;
00027 
00028 //-------------------
00029 // Initializations --
00030 //-------------------
00031 
00032 
00033 //----------------
00034 // Constructors --
00035 //----------------
00036 L1MuDTChambPhContainer::L1MuDTChambPhContainer() {}
00037 
00038 //--------------
00039 // Destructor --
00040 //--------------
00041 L1MuDTChambPhContainer::~L1MuDTChambPhContainer() {}
00042 
00043 //--------------
00044 // Operations --
00045 //--------------
00046 void L1MuDTChambPhContainer::setContainer(const Phi_Container& inputSegments) {
00047 
00048   phiSegments = inputSegments;
00049 }
00050 
00051 L1MuDTChambPhContainer::Phi_Container* L1MuDTChambPhContainer::getContainer() const {
00052 
00053   Phi_Container* rT=0;
00054 
00055   rT = const_cast<Phi_Container*>(&phiSegments);
00056 
00057   return(rT);
00058 }
00059 
00060 bool L1MuDTChambPhContainer::bxEmpty(int step) const {
00061 
00062   bool empty = true;
00063 
00064   for ( Phi_iterator i  = phiSegments.begin();
00065                      i != phiSegments.end();
00066                      i++ ) {
00067     if  (step == i->bxNum()) empty = false;
00068   }
00069 
00070   return(empty);
00071 }
00072 
00073 int L1MuDTChambPhContainer::bxSize(int step1, int step2) const {
00074 
00075   int size = 0;
00076 
00077   for ( Phi_iterator i  = phiSegments.begin();
00078                      i != phiSegments.end();
00079                      i++ ) {
00080     if  (step1 <= i->bxNum() && step2 >= i->bxNum() 
00081       && i->Ts2Tag() == 0 && i->code() != 7) size++;
00082     if  (step1 <= i->bxNum()-1 && step2 >= i->bxNum()-1 
00083       && i->Ts2Tag() == 1 && i->code() != 7) size++;
00084   }
00085 
00086   return(size);
00087 }
00088 
00089 L1MuDTChambPhDigi* L1MuDTChambPhContainer::chPhiSegm1(int wheel, int stat, int sect, int step) const {
00090 
00091   L1MuDTChambPhDigi* rT=0;
00092 
00093   for ( Phi_iterator i  = phiSegments.begin();
00094                      i != phiSegments.end();
00095                      i++ ) {
00096     if  (step == i->bxNum() && wheel == i->whNum() && sect == i->scNum()
00097       && stat == i->stNum() && i->Ts2Tag() == 0)
00098       rT = const_cast<L1MuDTChambPhDigi*>(&(*i));
00099   }
00100 
00101   return(rT);
00102 }
00103 
00104 L1MuDTChambPhDigi* L1MuDTChambPhContainer::chPhiSegm2(int wheel, int stat, int sect, int step) const {
00105 
00106   L1MuDTChambPhDigi* rT=0;
00107 
00108   for ( Phi_iterator i  = phiSegments.begin();
00109                      i != phiSegments.end();
00110                      i++ ) {
00111     if  (step == i->bxNum()-1 && wheel == i->whNum() && sect == i->scNum()
00112       && stat == i->stNum() && i->Ts2Tag() == 1)
00113       rT = const_cast<L1MuDTChambPhDigi*>(&(*i));
00114   }
00115 
00116   return(rT);
00117 }