Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:04:26

0001 //-------------------------------------------------
0002 //
0003 //   Class L1MuDTTrackContainer
0004 //
0005 //   Description: output data for DTTF 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/L1MuDTTrackContainer.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 L1MuDTTrackContainer::L1MuDTTrackContainer() {}
0035 
0036 //--------------
0037 // Destructor --
0038 //--------------
0039 L1MuDTTrackContainer::~L1MuDTTrackContainer() {}
0040 
0041 //--------------
0042 // Operations --
0043 //--------------
0044 void L1MuDTTrackContainer::setContainer(const TrackContainer& inputTracks) { dtTracks = inputTracks; }
0045 
0046 L1MuDTTrackContainer::TrackContainer const* L1MuDTTrackContainer::getContainer() const { return &dtTracks; }
0047 
0048 bool L1MuDTTrackContainer::bxEmpty(int step) const {
0049   bool empty = true;
0050 
0051   for (Trackiterator i = dtTracks.begin(); i != dtTracks.end(); i++) {
0052     if (step == i->bx())
0053       empty = false;
0054   }
0055 
0056   return (empty);
0057 }
0058 
0059 int L1MuDTTrackContainer::bxSize(int step1, int step2) const {
0060   int size = 0;
0061 
0062   for (Trackiterator i = dtTracks.begin(); i != dtTracks.end(); i++) {
0063     if (step1 <= i->bx() && step2 >= i->bx() && i->quality_packed() != 0)
0064       size++;
0065   }
0066 
0067   return (size);
0068 }
0069 
0070 L1MuDTTrackCand const* L1MuDTTrackContainer::dtTrackCand1(int wheel, int sect, int step) const {
0071   L1MuDTTrackCand const* rT = nullptr;
0072 
0073   for (Trackiterator i = dtTracks.begin(); i != dtTracks.end(); i++) {
0074     if (step == i->bx() && wheel == i->whNum() && sect == i->scNum() && i->TrkTag() == 0)
0075       rT = &(*i);
0076   }
0077 
0078   return (rT);
0079 }
0080 
0081 L1MuDTTrackCand const* L1MuDTTrackContainer::dtTrackCand2(int wheel, int sect, int step) const {
0082   L1MuDTTrackCand const* rT = nullptr;
0083 
0084   for (Trackiterator i = dtTracks.begin(); i != dtTracks.end(); i++) {
0085     if (step == i->bx() && wheel == i->whNum() && sect == i->scNum() && i->TrkTag() == 1)
0086       rT = &(*i);
0087   }
0088 
0089   return (rT);
0090 }