Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #include "L1Trigger/CSCTriggerPrimitives/src/CSCMuonPortCard.h"
00024 #include "L1Trigger/CSCCommonTrigger/interface/CSCConstants.h"
00025 #include <algorithm>
00026
00027 void CSCMuonPortCard::loadDigis(const CSCCorrelatedLCTDigiCollection& thedigis)
00028 {
00029
00030
00031 clear();
00032
00033 CSCCorrelatedLCTDigiCollection::DigiRangeIterator Citer;
00034
00035 for (Citer = thedigis.begin(); Citer != thedigis.end(); Citer++) {
00036 CSCCorrelatedLCTDigiCollection::const_iterator Diter = (*Citer).second.first;
00037 CSCCorrelatedLCTDigiCollection::const_iterator Dend = (*Citer).second.second;
00038
00039 for (; Diter != Dend; Diter++) {
00040 csctf::TrackStub theStub((*Diter), (*Citer).first);
00041 _stubs.push_back(theStub);
00042 }
00043 }
00044 }
00045
00046 std::vector<csctf::TrackStub> CSCMuonPortCard::sort(const unsigned endcap, const unsigned station,
00047 const unsigned sector, const unsigned subsector, const int bx)
00048 {
00049 std::vector<csctf::TrackStub> result;
00050 std::vector<csctf::TrackStub>::iterator LCT;
00051
00052 result = _stubs.get(endcap, station, sector, subsector, bx);
00053
00054
00055 for (LCT = result.begin(); LCT != result.end(); LCT++) {
00056 if ( !(LCT->getQuality() && LCT->isValid()) )
00057 result.erase(LCT, LCT);
00058 }
00059
00060 if (result.size()) {
00061 std::sort(result.begin(), result.end(), std::greater<csctf::TrackStub>());
00062
00063 if (result.size() > CSCConstants::maxStubs)
00064 result.erase(result.begin() + CSCConstants::maxStubs, result.end());
00065
00066
00067
00068 unsigned i = 0;
00069 for (LCT = result.begin(); LCT != result.end(); LCT++)
00070 LCT->setMPCLink(++i);
00071 }
00072
00073 return result;
00074 }