Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:30:24

0001 //-------------------------------------------------
0002 //
0003 //   Class L1MuTMChambPhContainer
0004 //
0005 //
0006 //
0007 //
0008 //   Author List: Jorge Troconiz, George Karathanasis
0009 //
0010 //
0011 //--------------------------------------------------
0012 
0013 //-----------------------
0014 // This Class's Header --
0015 //-----------------------
0016 #include "L1Trigger/L1TTwinMux/interface/L1MuTMChambPhContainer.h"
0017 
0018 //-------------------------------
0019 // Collaborating Class Headers --
0020 //-------------------------------
0021 
0022 //---------------
0023 // C++ Headers --
0024 //---------------
0025 using namespace std;
0026 
0027 //-------------------
0028 // Initializations --
0029 //-------------------
0030 
0031 //----------------
0032 // Constructors --
0033 //----------------
0034 L1MuTMChambPhContainer::L1MuTMChambPhContainer() {}
0035 
0036 //--------------
0037 // Destructor --
0038 //--------------
0039 L1MuTMChambPhContainer::~L1MuTMChambPhContainer() {}
0040 
0041 //--------------
0042 // Operations --
0043 //--------------
0044 void L1MuTMChambPhContainer::setContainer(const Phi_Container& inputSegments) { phiSegments = inputSegments; }
0045 
0046 L1MuTMChambPhContainer::Phi_Container const* L1MuTMChambPhContainer::getContainer() const { return &phiSegments; }
0047 
0048 bool L1MuTMChambPhContainer::bxEmpty(int step) const {
0049   for (Phi_iterator i = phiSegments.begin(); i != phiSegments.end(); i++) {
0050     if (step == i->bxNum())
0051       return false;
0052   }
0053 
0054   return true;
0055 }
0056 
0057 int L1MuTMChambPhContainer::bxSize(int step1, int step2) const {
0058   int size = 0;
0059 
0060   for (Phi_iterator i = phiSegments.begin(); i != phiSegments.end(); i++) {
0061     if (step1 <= i->bxNum() && step2 >= i->bxNum() && i->Ts2Tag() == 0 && i->code() != 7)
0062       size++;
0063     if (step1 <= i->bxNum() - 1 && step2 >= i->bxNum() - 1 && i->Ts2Tag() == 1 && i->code() != 7)
0064       size++;
0065   }
0066 
0067   return (size);
0068 }
0069 
0070 L1MuDTChambPhDigi const* L1MuTMChambPhContainer::chPhiSegm1(int wheel, int stat, int sect, int step) const {
0071   L1MuDTChambPhDigi const* rT = nullptr;
0072 
0073   for (Phi_iterator i = phiSegments.begin(); i != phiSegments.end(); i++) {
0074     if (step == i->bxNum() && wheel == i->whNum() && sect == i->scNum() && stat == i->stNum() && i->Ts2Tag() == 0)
0075       rT = &(*i);
0076   }
0077 
0078   return (rT);
0079 }
0080 
0081 L1MuDTChambPhDigi const* L1MuTMChambPhContainer::chPhiSegm2(int wheel, int stat, int sect, int step) const {
0082   L1MuDTChambPhDigi const* rT = nullptr;
0083 
0084   for (Phi_iterator i = phiSegments.begin(); i != phiSegments.end(); i++) {
0085     if (step == i->bxNum() - 1 && wheel == i->whNum() && sect == i->scNum() && stat == i->stNum() && i->Ts2Tag() == 1)
0086       rT = &(*i);
0087   }
0088 
0089   return (rT);
0090 }
0091 
0092 L1MuDTChambPhDigi* L1MuTMChambPhContainer::chPhiSegm(int wheel, int stat, int sect, int step, int ts2tag) {
0093   L1MuDTChambPhDigi* rT = nullptr;
0094   for (Phi_Container::iterator i = phiSegments.begin(); i != phiSegments.end(); i++) {
0095     if (step == i->bxNum() && wheel == i->whNum() && sect == i->scNum() && stat == i->stNum() && i->Ts2Tag() == ts2tag)
0096       rT = &(*i);
0097   }
0098 
0099   return (rT);
0100 }