Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 12:53:46

0001 //-------------------------------------------------
0002 //
0003 //   Class L1MuDTChambPhContainer
0004 //
0005 //   Description: input data for PHTF trigger
0006 //
0007 //
0008 //   Author List: Jorge Troconiz  UAM Madrid
0009 //
0010 //
0011 //--------------------------------------------------
0012 
0013 //-----------------------
0014 // This Class's Header --
0015 //-----------------------
0016 #include "DataFormats/L1DTTrackFinder/interface/L1MuDTChambPhContainer.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 L1MuDTChambPhContainer::L1MuDTChambPhContainer(Phi_Container c) : phiSegments(std::move(c)) {}
0035 
0036 //--------------
0037 // Operations --
0038 //--------------
0039 void L1MuDTChambPhContainer::setContainer(Phi_Container inputSegments) { phiSegments = std::move(inputSegments); }
0040 
0041 L1MuDTChambPhContainer::Phi_Container const* L1MuDTChambPhContainer::getContainer() const { return &phiSegments; }
0042 
0043 bool L1MuDTChambPhContainer::bxEmpty(int step) const {
0044   bool empty = true;
0045 
0046   for (Phi_iterator i = phiSegments.begin(); i != phiSegments.end(); i++) {
0047     if (step == i->bxNum())
0048       empty = false;
0049   }
0050 
0051   return (empty);
0052 }
0053 
0054 int L1MuDTChambPhContainer::bxSize(int step1, int step2) const {
0055   int size = 0;
0056 
0057   for (Phi_iterator i = phiSegments.begin(); i != phiSegments.end(); i++) {
0058     if (step1 <= i->bxNum() && step2 >= i->bxNum() && i->Ts2Tag() == 0 && i->code() != 7)
0059       size++;
0060     if (step1 <= i->bxNum() - 1 && step2 >= i->bxNum() - 1 && i->Ts2Tag() == 1 && i->code() != 7)
0061       size++;
0062   }
0063 
0064   return (size);
0065 }
0066 
0067 L1MuDTChambPhDigi const* L1MuDTChambPhContainer::chPhiSegm1(int wheel, int stat, int sect, int step) const {
0068   L1MuDTChambPhDigi const* rT = nullptr;
0069 
0070   for (Phi_iterator i = phiSegments.begin(); i != phiSegments.end(); i++) {
0071     if (step == i->bxNum() && wheel == i->whNum() && sect == i->scNum() && stat == i->stNum() && i->Ts2Tag() == 0)
0072       rT = &(*i);
0073   }
0074 
0075   return (rT);
0076 }
0077 
0078 L1MuDTChambPhDigi const* L1MuDTChambPhContainer::chPhiSegm2(int wheel, int stat, int sect, int step) const {
0079   L1MuDTChambPhDigi const* rT = nullptr;
0080 
0081   for (Phi_iterator i = phiSegments.begin(); i != phiSegments.end(); i++) {
0082     if (step == i->bxNum() - 1 && wheel == i->whNum() && sect == i->scNum() && stat == i->stNum() && i->Ts2Tag() == 1)
0083       rT = &(*i);
0084   }
0085 
0086   return (rT);
0087 }