Go to the documentation of this file.00001 #include <L1Trigger/CSCTrackFinder/src/CSCTFDTReceiver.h>
00002 #include <L1Trigger/DTTrackFinder/src/L1MuDTTFConfig.h>
00003 #include <L1TriggerConfig/DTTPGConfig/interface/DTConfigTraco.h>
00004 #include <DataFormats/MuonDetId/interface/CSCDetId.h>
00005 #include <DataFormats/MuonDetId/interface/CSCTriggerNumbering.h>
00006 #include <DataFormats/L1CSCTrackFinder/interface/CSCBitWidths.h>
00007 #include <L1Trigger/CSCCommonTrigger/interface/CSCConstants.h>
00008 #include <DataFormats/MuonDetId/interface/DTChamberId.h>
00009
00010 #include <L1Trigger/CSCTrackFinder/src/CSCTFDTReceiverLUT.h>
00011
00012 CSCTriggerContainer<csctf::TrackStub> CSCTFDTReceiver::process(const L1MuDTChambPhContainer* dttrig)
00013 {
00014 dtstubs.clear();
00015 if( !dttrig ) return dtstubs;
00016
00017 const int dt_minBX = L1MuDTTFConfig::getBxMin();
00018 const int dt_maxBX = L1MuDTTFConfig::getBxMax();
00019
00020 const int dt_toffs = 0;
00021
00022
00023 for(int bx = dt_minBX + dt_toffs; bx <= dt_maxBX + dt_toffs; ++bx)
00024 for(int e = CSCDetId::minEndcapId(); e <= CSCDetId::maxEndcapId(); ++e)
00025 for(int s = CSCTriggerNumbering::minTriggerSectorId(); s <= CSCTriggerNumbering::maxTriggerSectorId(); ++s)
00026 {
00027 int wheel = (e == 1) ? 2 : -2;
00028 int sector = 2*s - 1;
00029 int csc_bx = bx + 6;
00030
00031
00032
00033 for(int is = sector; is <= sector+1; ++is)
00034 {
00035 int iss = (is == 12) ? 0 : is;
00036 L1MuDTChambPhDigi* dtts[2];
00037
00038 for(int stub = 0; stub < 2; ++stub)
00039 {
00040 dtts[stub] = (stub == 0) ? dttrig->chPhiSegm1(wheel,1,iss,bx) :
00041 dttrig->chPhiSegm2(wheel,1,iss,bx);
00042 if(dtts[stub])
00043 {
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070 int phi = dtts[stub] -> phi();
00071
00072 if (phi < 0) phi += 4096;
00073
00074 if (phi > 4096)
00075 { std::cout << "AAAAAAAAAAGH TOO BIG PHI:" << phi << std::endl;
00076 continue;
00077 }
00078 if (phi < 0){
00079 std::cout << "AAAAAAAAH NEG PHI" << phi << std::endl;
00080 continue;
00081 }
00082
00083 phi = CSCTFDTReceiverLUT::lut[phi];
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094 phi = (phi>0) ? phi : 0;
00095 phi = (phi<(1<<(CSCBitWidths::kGlobalPhiDataBitWidth))) ? phi :
00096 (1<<(CSCBitWidths::kGlobalPhiDataBitWidth))-1;
00097
00098
00099
00100 int phib = ((dtts[stub]->phiB() & 0x3FF) >> 5) & 0x1F;
00101 int qual = dtts[stub]->code();
00102
00104 qual = (qual + 1)%8;
00105
00106 CSCCorrelatedLCTDigi dtinfo(stub+1,1, qual, 0, stub, 0, phib, csc_bx+stub, 1+(is+1)%2);
00107 DTChamberId dtid(wheel,1,iss+1);
00108 csctf::TrackStub tsCSC(dtinfo,dtid, phi, 0);
00109
00110 dtstubs.push_back(tsCSC);
00111 }
00112 }
00113 }
00114 }
00115
00116 return dtstubs;
00117 }
00118