56 std::vector<csc::L1Track> trks;
61 for (Citer = lcts->begin(); Citer != lcts->end(); Citer++) {
65 for (; Diter != Dend; Diter++) {
82 int spReturnValue =
my_SPs[
e - 1][
s - 1]->
run(current_e_s);
83 if (spReturnValue == -1)
88 }
else if (spReturnValue) {
90 trks.insert(trks.end(), theTracks.begin(), theTracks.end());
97 trkcoll->resize(trks.size());
98 std::vector<csc::L1Track>::const_iterator titr = trks.begin();
99 L1CSCTrackCollection::iterator tcitr = trkcoll->begin();
101 for (; titr != trks.end(); titr++) {
102 tcitr->first = (*titr);
103 std::vector<csctf::TrackStub> possible_stubs =
my_SPs[titr->endcap() - 1][titr->sector() - 1]->
filteredStubs();
104 std::vector<csctf::TrackStub>::const_iterator tkstbs = possible_stubs.begin();
106 int me1ID = titr->me1ID();
107 int me2ID = titr->me2ID();
108 int me3ID = titr->me3ID();
109 int me4ID = titr->me4ID();
110 int mb1ID = titr->mb1ID();
111 int me1delay = titr->me1Tbin();
112 int me2delay = titr->me2Tbin();
113 int me3delay = titr->me3Tbin();
114 int me4delay = titr->me4Tbin();
115 int mb1delay = titr->mb1Tbin();
119 std::map<int, std::list<int> > timeline;
121 timeline[me1delay].push_back(1);
123 timeline[me2delay].push_back(2);
125 timeline[me3delay].push_back(3);
127 timeline[me4delay].push_back(4);
128 int earliest_tbin = 0, second_earliest_tbin = 0;
129 for (
int bx = 7;
bx >= 0;
bx--) {
130 std::list<int>::const_iterator iter = timeline[
bx].begin();
131 while (iter != timeline[
bx].
end()) {
132 if (earliest_tbin == 0)
134 else if (second_earliest_tbin == 0)
135 second_earliest_tbin =
bx;
142 int me1Tbin = titr->bx() - me1delay + second_earliest_tbin +
shift;
143 int me2Tbin = titr->bx() - me2delay + second_earliest_tbin +
shift;
144 int me3Tbin = titr->bx() - me3delay + second_earliest_tbin +
shift;
145 int me4Tbin = titr->bx() - me4delay + second_earliest_tbin +
shift;
146 int mb1Tbin = titr->bx() - mb1delay + second_earliest_tbin +
shift;
148 for (; tkstbs != possible_stubs.end(); tkstbs++) {
149 switch (tkstbs->station()) {
151 if ((tkstbs->getMPCLink() +
154 me1ID != 0 && me1Tbin == tkstbs->BX()) {
155 tcitr->second.insertDigi(
CSCDetId(tkstbs->getDetId().rawId()), *(tkstbs->getDigi()));
159 if (tkstbs->getMPCLink() == me2ID && me2ID != 0 && me2Tbin == tkstbs->BX()) {
160 tcitr->second.insertDigi(
CSCDetId(tkstbs->getDetId().rawId()), *(tkstbs->getDigi()));
164 if (tkstbs->getMPCLink() == me3ID && me3ID != 0 && me3Tbin == tkstbs->BX()) {
165 tcitr->second.insertDigi(
CSCDetId(tkstbs->getDetId().rawId()), *(tkstbs->getDigi()));
169 if (tkstbs->getMPCLink() == me4ID && me4ID != 0 && me4Tbin == tkstbs->BX()) {
170 tcitr->second.insertDigi(
CSCDetId(tkstbs->getDetId().rawId()), *(tkstbs->getDigi()));
174 if (tkstbs->getMPCLink() == mb1ID && mb1ID != 0 && mb1Tbin == tkstbs->BX()) {
180 <<
"SERIOUS ERROR: STATION " << tkstbs->station() <<
" NOT IN RANGE [1,5]\n";