23 csctf_.trSize = csctfTrks->size();
27 for(L1CSCTrackCollection::const_iterator trk=csctfTrks->begin();
28 trk<csctfTrks->end(); trk++){
34 csctf_.trEndcap.push_back(trk->first.endcap()==2 ? trk->first.endcap()-3 : trk->first.endcap());
36 csctf_.trSector.push_back(6* (trk->first.endcap()-1) + trk->first.sector());
37 csctf_.trBx.push_back(trk->first.BX());
39 csctf_.trME1ID.push_back(trk->first.me1ID());
40 csctf_.trME2ID.push_back(trk->first.me2ID());
41 csctf_.trME3ID.push_back(trk->first.me3ID());
42 csctf_.trME4ID.push_back(trk->first.me4ID());
43 csctf_.trMB1ID.push_back(trk->first.mb1ID());
45 csctf_.trME1TBin.push_back(trk->first.me1Tbin());
46 csctf_.trME2TBin.push_back(trk->first.me2Tbin());
47 csctf_.trME3TBin.push_back(trk->first.me3Tbin());
48 csctf_.trME4TBin.push_back(trk->first.me4Tbin());
49 csctf_.trMB1TBin.push_back(trk->first.mb1Tbin());
52 csctf_.trOutputLink.push_back(trk->first.outputLink());
55 ptadd thePtAddress(trk->first.ptLUTAddress());
57 csctf_.trPhiSign.push_back(thePtAddress.delta_phi_sign);
58 csctf_.trPhi12.push_back(thePtAddress.delta_phi_12);
59 csctf_.trPhi23.push_back(thePtAddress.delta_phi_23);
60 csctf_.trMode.push_back(thePtAddress.track_mode);
61 csctf_.trForR.push_back(thePtAddress.track_fr);
62 csctf_.trCharge.push_back(trk->first.chargeValue());
67 ptdat thePtData = ptLUTs_->
Pt(thePtAddress);
70 if (thePtAddress.track_fr) {
71 csctf_.trPtBit.push_back(thePtData.front_rank&0x1f);
72 csctf_.trQuality.push_back((thePtData.front_rank>>5)&0x3);
73 csctf_.trChargeValid.push_back(thePtData.charge_valid_front);
75 csctf_.trPtBit.push_back(thePtData.rear_rank&0x1f);
76 csctf_.trQuality.push_back((thePtData.rear_rank>>5)&0x3);
77 csctf_.trChargeValid.push_back(thePtData.charge_valid_rear);
85 csctf_.trEtaBit.push_back(trk->first.eta_packed());
86 csctf_.trPhiBit.push_back(trk->first.localPhi());
95 csctf_.trPhi_02PI.push_back(fmod(csctf_.trPhi[nTrk-1] +
109 lctOfTrks != lctsOfTracks.end() ; lctOfTrks++){
114 lctsOfTracks.get((*lctOfTrks).first);
117 lctTrk = lctRange.first ;
118 lctTrk != lctRange.second; lctTrk++, lctTrkId++){
121 csctf_.trLctEndcap[nTrk-1][LctTrkId_] = (*lctOfTrks).first.zendcap();
122 if ((*lctOfTrks).first.zendcap() > 0)
123 csctf_.trLctSector[nTrk-1][LctTrkId_] = (*lctOfTrks).first.triggerSector();
125 csctf_.trLctSector[nTrk-1][LctTrkId_] = 6+(*lctOfTrks).first.triggerSector();
127 csctf_.trLctBx[nTrk-1][LctTrkId_] = lctTrk -> getBX();
128 csctf_.trLctBx0[nTrk-1][LctTrkId_] = lctTrk -> getBX0();
130 csctf_.trLctStation[nTrk-1][LctTrkId_] = (*lctOfTrks).first.station();
131 csctf_.trLctRing[nTrk-1][LctTrkId_] = (*lctOfTrks).first.ring();
132 csctf_.trLctChamber[nTrk-1][LctTrkId_] = (*lctOfTrks).first.chamber();
133 csctf_.trLctTriggerCSCID[nTrk-1][LctTrkId_] = (*lctOfTrks).first.triggerCscId();
134 csctf_.trLctFpga[nTrk-1][LctTrkId_] =
135 ( csctf_.trLctSubSector[nTrk-1][LctTrkId_] ? csctf_.trLctSubSector[nTrk-1][LctTrkId_] : (*lctOfTrks).first.station()+1);
139 if( csctf_.trLctSector[nTrk-1][LctTrkId_] < 1 || csctf_.trLctSector[nTrk-1][LctTrkId_] > 12 ||
140 csctf_.trLctStation[nTrk-1][LctTrkId_] < 1 || csctf_.trLctStation[nTrk-1][LctTrkId_] > 4 ||
141 csctf_.trLctTriggerCSCID[nTrk-1][LctTrkId_] < 1 || csctf_.trLctTriggerCSCID[nTrk-1][LctTrkId_] > 9 ||
142 lctTrkId < 0 || lctTrkId > 1 ){
144 edm::LogInfo(
"L1NtupleProducer")<<
" TRACK ERROR: CSC digi are out of range: ";
150 int endcap = (*lctOfTrks).first.zendcap();
151 if (endcap < 0) endcap = 0;
153 int StationLctTrk = (*lctOfTrks).first.station();
154 int CscIdLctTrk = (*lctOfTrks).first.triggerCscId();
155 int SubSectorLctTrk =
159 ( SubSectorLctTrk ? SubSectorLctTrk-1 : StationLctTrk );
167 csctf_.trLctstripNum[nTrk-1][LctTrkId_] = lctTrk->getStrip();
168 lclPhi = srLUTs_[FPGALctTrk][
endcap] -> localPhi(lctTrk->getStrip(),
169 lctTrk->getPattern(),
170 lctTrk->getQuality(),
173 csctf_.trLctlocalPhi[nTrk-1][LctTrkId_] = lclPhi.phi_local;
176 csctf_.trLctQuality[nTrk-1][LctTrkId_] = lctTrk->getQuality();
181 bzero(&lclPhi,
sizeof(lclPhi));
182 csctf_.trLctlocalPhi[nTrk-1][LctTrkId_] = -999;
185 csctf_.trLctQuality[nTrk-1][LctTrkId_] = -999;
203 csctf_.trLctwireGroup[nTrk-1][LctTrkId_] = lctTrk->getKeyWG();
204 gblPhi = srLUTs_[FPGALctTrk][
endcap] -> globalPhiME(lclPhi.phi_local ,
208 csctf_.trLctglobalPhi[nTrk-1][LctTrkId_] = gblPhi.global_phi;
211 bzero(&gblPhi,
sizeof(gblPhi));
212 csctf_.trLctglobalPhi[nTrk-1][LctTrkId_] = -999;
219 gblEta = srLUTs_[FPGALctTrk][
endcap] -> globalEtaME(lclPhi.phi_bend_local,
223 csctf_.trLctglobalEta[nTrk-1][LctTrkId_] = gblEta.global_eta;
224 csctf_.trLctCLCT_pattern[nTrk-1][LctTrkId_] = gblEta.global_bend;
227 bzero(&gblEta,
sizeof(gblEta));
228 csctf_.trLctglobalEta[nTrk-1][LctTrkId_] = -999;
229 csctf_.trLctCLCT_pattern[nTrk-1][LctTrkId_] = -999;
237 csctf_.trNumLCTs.push_back(LctTrkId_);
255 corrLct = corrlcts.
product()->begin();
256 corrLct != corrlcts.
product()->end() ; corrLct++){
263 corrlcts.
product()->get((*corrLct).first);
266 lct = lctRange.first ;
267 lct != lctRange.second; lct++, lctId++){
269 csctf_.lctEndcap.push_back((*corrLct).first.zendcap());
270 if ((*corrLct).first.zendcap() > 0)
271 csctf_.lctSector.push_back((*corrLct).first.triggerSector());
273 csctf_.lctSector.push_back(6+(*corrLct).first.triggerSector());
276 csctf_.lctBx.push_back(lct->getBX());
277 csctf_.lctBx0.push_back(lct->getBX0());
279 csctf_.lctStation.push_back((*corrLct).first.station());
280 csctf_.lctRing.push_back((*corrLct).first.ring());
281 csctf_.lctChamber.push_back((*corrLct).first.chamber());
282 csctf_.lctTriggerCSCID.push_back((*corrLct).first.triggerCscId());
283 csctf_.lctFpga.push_back((csctf_.lctSubSector.back() ? csctf_.lctSubSector.back() : (*corrLct).first.station()+1));
287 if( csctf_.lctSector.back() < 1 || csctf_.lctSector.back() > 12 ||
288 csctf_.lctStation.back() < 1 || csctf_.lctStation.back() > 4 ||
289 csctf_.lctTriggerCSCID.back() < 1 || csctf_.lctTriggerCSCID.back() > 9 ||
290 lctId < 0 || lctId > 1 ){
292 edm::LogInfo(
"L1NtupleProducer")<<
" LCT ERROR: CSC digi are out of range: ";
298 int endcap = (*corrLct).first.zendcap();
299 if (endcap < 0) endcap = 0;
301 int StationLct = (*corrLct).first.station();
302 int CscIdLct = (*corrLct).first.triggerCscId();
306 int FPGALct = ( SubSectorLct ? SubSectorLct-1 : StationLct );
328 csctf_.lctstripNum.push_back(lct->getStrip());
329 lclPhi = srLUTs_[FPGALct][
endcap] -> localPhi(lct->getStrip(),
334 csctf_.lctlocalPhi.push_back(lclPhi.phi_local);
337 csctf_.lctQuality.push_back(lct->getQuality());
343 bzero(&lclPhi,
sizeof(lclPhi));
344 csctf_.lctlocalPhi.push_back(-999);
347 csctf_.lctQuality.push_back(-999);
355 csctf_.lctwireGroup.push_back(lct->getKeyWG());
361 gblPhi = srLUTs_[FPGALct][
endcap] -> globalPhiME(lclPhi.phi_local ,
364 csctf_.lctglobalPhi.push_back(gblPhi.global_phi);
368 bzero(&gblPhi,
sizeof(gblPhi));
369 csctf_.lctglobalPhi.push_back(-999);
376 gblEta = srLUTs_[FPGALct][
endcap] -> globalEtaME(lclPhi.phi_bend_local,
381 csctf_.lctglobalEta.push_back(gblEta.global_eta);
382 csctf_.lctCLCT_pattern.push_back(gblEta.global_bend);
385 bzero(&gblEta,
sizeof(gblEta));
386 csctf_.lctglobalEta.push_back(-999);
387 csctf_.lctCLCT_pattern.push_back(-999);
393 csctf_.lctSize = nLCT;
401 for(std::vector<L1CSCSPStatusDigi>::const_iterator stat=status->second.begin();
402 stat!=status->second.end(); stat++){
405 if (stat->VPs() != 0) {
407 csctf_.stSPslot.push_back(stat->slot());
408 csctf_.stL1A_BXN.push_back(stat->BXN());
409 csctf_.stTrkCounter.push_back((const_cast<L1CSCSPStatusDigi*>(&(*stat)))->track_counter());
410 csctf_.stOrbCounter.push_back((const_cast<L1CSCSPStatusDigi*>(&(*stat)))->orbit_counter());
423 std::vector<csctf::TrackStub> vstubs = dtStubs->get();
425 for (std::vector<csctf::TrackStub>::const_iterator stub = vstubs.begin();
426 stub != vstubs.end(); stub++) {
427 csctf_.dtBXN.push_back(stub->BX());
428 csctf_.dtFLAG.push_back(stub->getStrip());
429 csctf_.dtCAL.push_back(stub->getKeyWG());
431 csctf_.dtSector.push_back( 6*(stub->endcap()-1) + stub->sector() );
432 csctf_.dtSubSector.push_back(stub->subsector());
434 csctf_.dtBX0.push_back(stub->getBX0());
435 csctf_.dtPhiBend.push_back(stub->getBend());
436 csctf_.dtPhiPacked.push_back(stub->phiPacked());
437 csctf_.dtQuality.push_back(stub->getQuality());
440 csctf_.dtSize = vstubs.size();
ptdat Pt(const ptadd &) const
const L1MuScale * getPtScale() const
get the Pt scale
void SetStatus(const edm::Handle< L1CSCStatusDigiCollection > status)
virtual float getLowEdge(unsigned packed) const =0
get the low edge of bin represented by packed
virtual float getCenter(unsigned packed) const =0
get the center of bin represented by packed
U second(std::pair< T, U > const &p)
void SetTracks(const edm::Handle< L1CSCTrackCollection > csctfTrks, const L1MuTriggerScales *ts, const L1MuTriggerPtScale *tpts, CSCSectorReceiverLUT *srLUTs_[5][2], CSCTFPtLUT *ptLUTs_)
const L1MuScale * getPhiScale() const
get the phi scale
T const * product() const
class global_phi_data gblphidat
class local_phi_address lclphiadd
std::vector< CSCCorrelatedLCTDigi >::const_iterator const_iterator
class local_phi_data lclphidat
Data Types.
static int triggerSubSectorFromLabels(int station, int chamber)
const L1MuScale * getRegionalEtaScale(int isys) const
get the regioanl muon trigger eta scale, isys = 0(DT), 1(bRPC), 2(CSC), 3(fwdRPC) ...
void SetLCTs(const edm::Handle< CSCCorrelatedLCTDigiCollection > corrlcts, CSCSectorReceiverLUT *srLUTs_[5][2])
std::pair< const_iterator, const_iterator > Range
void SetDTStubs(const edm::Handle< CSCTriggerContainer< csctf::TrackStub > > dtStubs)
class global_eta_data gbletadat