41 edm::LogError(
"L1T|EMTF") <<
"Payload size in 'SP Output Data Record' is different than expected";
45 for (
unsigned int i = 0;
i < 8;
i++) {
48 edm::LogError(
"L1T|EMTF") <<
"Payload[" <<
i <<
"] has more than 16 bits in 'SP Output Data Record'";
64 edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in SP1a are incorrect";
68 edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in SP1b are incorrect";
72 edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in SP1c are incorrect";
76 edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in SP1d are incorrect";
80 edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in SP2a are incorrect";
84 edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in SP2b are incorrect";
88 edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in SP2c are incorrect";
92 edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in SP2d are incorrect";
100 int new_sector = _sector;
103 int arr[] = {_csc_ID, -99, -99, -99};
104 std::vector<int> vec(arr, arr + 4);
106 }
else if (_csc_ID == 0) {
107 int arr[] = {-1, -1, -1, -1};
108 std::vector<int> vec(arr, arr + 4);
110 }
else if (_csc_ID <= 9) {
111 int arr[] = {_csc_ID, new_sector, _subsector + 1, 0};
112 std::vector<int> vec(arr, arr + 4);
115 new_sector = (_sector != 1) ? _sector - 1 : 6;
118 int arr[] = {3, new_sector, 2, 1};
119 std::vector<int> vec(arr, arr + 4);
121 }
else if (_csc_ID == 11) {
122 int arr[] = {6, new_sector, 2, 1};
123 std::vector<int> vec(arr, arr + 4);
125 }
else if (_csc_ID == 12) {
126 int arr[] = {9, new_sector, 2, 1};
127 std::vector<int> vec(arr, arr + 4);
130 int arr[] = {_csc_ID, -99, -99, -99};
131 std::vector<int> vec(arr, arr + 4);
134 }
else if (_station == 2 || _station == 3 || _station == 4) {
136 int arr[] = {_csc_ID, -99, -99, -99};
137 std::vector<int> vec(arr, arr + 4);
139 }
else if (_csc_ID == 0) {
140 int arr[] = {-1, -1, -1, -1};
141 std::vector<int> vec(arr, arr + 4);
143 }
else if (_csc_ID <= 9) {
144 int arr[] = {_csc_ID, new_sector, -1, 0};
145 std::vector<int> vec(arr, arr + 4);
148 new_sector = (_sector != 1) ? _sector - 1 : 6;
151 int arr[] = {3, new_sector, -1, 1};
152 std::vector<int> vec(arr, arr + 4);
154 }
else if (_csc_ID == 11) {
155 int arr[] = {9, new_sector, -1, 1};
156 std::vector<int> vec(arr, arr + 4);
159 int arr[] = {_csc_ID, -99, -99, -99};
160 std::vector<int> vec(arr, arr + 4);
164 int arr[] = {-99, -99, -99, -99};
165 std::vector<int> vec(arr, arr + 4);
182 bool reducedDAQWindow =
186 static constexpr
int nominalShower_ = 1;
187 static constexpr
int tightShower_ = 3;
208 int iOut =
res->size() - 1;
209 std::vector<int> conv_vals_SP;
210 std::vector<int> conv_vals_pT_LUT;
220 res_cand =
static_cast<EMTFCollections*
>(coll)->getRegionalMuonCands();
224 res_shower =
static_cast<EMTFCollections*
>(coll)->getRegionalMuonShowers();
266 if (reducedDAQWindow)
281 ImportSP(Track_, SP_, (
res->at(iOut)).PtrEventHeader()->Endcap(), (
res->at(iOut)).PtrEventHeader()->Sector());
284 if (!(
res->at(iOut)).PtrSPCollection()->empty())
285 if (SP_.
TBIN() == (
res->at(iOut)).PtrSPCollection()->at((
res->at(iOut)).PtrSPCollection()->size() - 1).TBIN())
309 int EMTF_kBX = ((
res->at(iOut)).PtrEventHeader()->L1A_BXN() % 2048) - 25 + Track_.
BX();
328 int nDelay[3] = {0, 0, 0};
329 if (Track_.
Mode() >= 8)
331 if ((Track_.
Mode() % 8) >= 4)
333 if ((Track_.
Mode() % 4) >= 2)
335 if ((Track_.
Mode() % 2) == 1)
342 else if (nDelay[2] + nDelay[1] >= 2)
344 else if (nDelay[2] + nDelay[1] + nDelay[0] >= 2)
353 auto get_subsector_rpc_cppf = [](
int subsector_rpc) {
return ((subsector_rpc + 3) % 6) + 1; };
355 std::array<int, 4> St_hits{{0, 0, 0, 0}};
357 for (
auto const&
Hit : *res_hit) {
358 if (Track_.
Mode() == 1)
364 if (
Hit.Station() == 1)
366 else if (
Hit.Station() == 2)
368 else if (
Hit.Station() == 3)
370 else if (
Hit.Station() == 4)
374 if (
Hit.BX() + 3 + hit_delay != SP_.
TBIN() + trk_delay)
381 if (
Hit.Station() == 1 &&
Hit.Sector() == conv_vals_SP.at(1) &&
Hit.Neighbor() == conv_vals_SP.at(3) &&
383 if (
Hit.Is_CSC() == 1 && (
Hit.CSC_ID() != conv_vals_SP.at(0) ||
Hit.Subsector() != conv_vals_SP.at(2)))
386 int tmp_subsector = get_subsector_rpc_cppf(
Hit.Subsector_RPC());
387 int RPC_subsector = ((tmp_subsector - 1) / 3) + 1;
388 int RPC_CSC_ID = ((tmp_subsector - 1) % 3) + 4;
390 if (
Hit.Is_RPC() == 1 && (RPC_CSC_ID != conv_vals_SP.at(0) || RPC_subsector != conv_vals_SP.at(2)))
393 if (St_hits.at(0) == 0) {
406 if (
Hit.Station() == 2 &&
Hit.Sector() == conv_vals_SP.at(1) &&
Hit.Neighbor() == conv_vals_SP.at(3) &&
408 if (
Hit.Is_CSC() == 1 &&
Hit.CSC_ID() != conv_vals_SP.at(0))
411 int tmp_subsector = get_subsector_rpc_cppf(
Hit.Subsector_RPC());
412 if (
Hit.Is_RPC() == 1 && tmp_subsector + 3 != conv_vals_SP.at(0))
415 if (St_hits.at(1) == 0) {
428 if (
Hit.Station() == 3 &&
Hit.Sector() == conv_vals_SP.at(1) &&
Hit.Neighbor() == conv_vals_SP.at(3) &&
430 if (
Hit.Is_CSC() == 1 &&
Hit.CSC_ID() != conv_vals_SP.at(0))
433 int tmp_subsector = get_subsector_rpc_cppf(
Hit.Subsector_RPC());
434 if (
Hit.Is_RPC() == 1 && tmp_subsector + 3 != conv_vals_SP.at(0))
437 if (St_hits.at(2) == 0) {
450 if (
Hit.Station() == 4 &&
Hit.Sector() == conv_vals_SP.at(1) &&
Hit.Neighbor() == conv_vals_SP.at(3) &&
452 if (
Hit.Is_CSC() == 1 &&
Hit.CSC_ID() != conv_vals_SP.at(0))
455 int tmp_subsector = get_subsector_rpc_cppf(
Hit.Subsector_RPC());
456 if (
Hit.Is_RPC() == 1 && tmp_subsector + 3 != conv_vals_SP.at(0))
459 if (St_hits.at(3) == 0) {
472 if (Track_.
Mode() == 1) {
474 int chamber_min = ((Track_.
GMT_phi() - 17) / 16) + Track_.
Sector() * 6 - 3;
475 int chamber_max = ((Track_.
GMT_phi() + 1) / 16) + Track_.
Sector() * 6 - 3;
476 for (
int iChamb = chamber_max; iChamb >= chamber_min; iChamb--) {
477 int chamber = (iChamb < 37 ? iChamb : (iChamb % 36));
479 for (
auto const&
Hit : *res_hit) {
482 if (
Hit.BX() != Track_.
BX())
486 if (
Hit.Is_CSC() != 1)
488 if (
Hit.Station() != 1)
490 if ((
Hit.Ring() % 3) != 1)
492 if (
Hit.Neighbor() == 1)
496 bool hit_already_used =
false;
497 for (
auto const& Trk : *res_track) {
500 if (Trk.NumHits() < 1)
503 if (Trk.Hits().at(0).Station() == 1 && Trk.Hits().at(0).Chamber() ==
chamber &&
504 Trk.Hits().at(0).BX() ==
Hit.BX() && Trk.Hits().at(0).Ring() ==
Hit.Ring() &&
505 Trk.Hits().at(0).Strip() ==
Hit.Strip() && Trk.Hits().at(0).Wire() ==
Hit.Wire()) {
506 hit_already_used =
true;
511 if (!hit_already_used) {
587 if (Track_.
BX() > 3
or Track_.
BX() < -3) {
588 edm::LogWarning(
"L1T|EMTF") <<
"EMTF unpacked track with out-of-range BX! BX: " << Track_.
BX()
589 <<
" endcap: " << (Track_.
Endcap() == 1 ? 1 : 2) <<
" sector: " << Track_.
Sector()
593 <<
" qual: " << Track_.
GMT_quality() <<
" pt: " << Track_.
Pt()
594 <<
" pt_dxy: " << Track_.
Pt_dxy() << std::endl;
598 (
res->at(iOut)).push_SP(SP_);
600 res_track->push_back(Track_);
void set_me3_stub_num(int bits)
void setOneTightInTime(const bool bit)
void setHwPhi(int bits)
Set compressed relative phi as transmitted by hardware LSB = 2*pi/576 (8 bits)
void set_me2_stub_num(int bits)
void set_pt_dxy_GMT(int bits)
void set_me3_CSC_ID(int bits)
unsigned int getAlgoVersion()
virtual int checkFormat(const Block &block)
int calc_uGMT_chamber(int csc_ID, int subsector, int neighbor, int station)
Log< level::Error, false > LogError
void set_me2_CSC_ID(int bits)
void set_me1_stub_num(int bits)
void set_pt_GMT(int bits)
void set_me4_delay(int bits)
void set_phi_GMT(int bits)
int TwosCompl(int nBits, int bits)
void set_me1_delay(int bits)
void set_me2_delay(int bits)
void setTFIdentifiers(int processor, tftype trackFinder)
Set the processor ID, track-finder type. From these two, the link is set.
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
std::vector< EMTFHit > EMTFHitCollection
std::vector< EMTFDaqOut > EMTFDaqOutCollection
void setTrackSubAddress(bmtfAddress subAddress, int value)
Set a part of the muon candidates track address; specialised for BMTF.
void set_track_num(int bits)
void set_eta_GMT(int bits)
void setHwQual(int bits)
Set compressed quality code as transmitted by hardware (4 bits)
void setHwPt(int bits)
Set compressed pT as transmitted by hardware LSB = 0.5 (9 bits)
void set_me4_CSC_ID(int bits)
void setHwEta(int bits)
Set compressed eta as transmitted by hardware LSB = 0.010875 (9 bits)
void setHwDXY(int bits)
Set compressed impact parameter with respect to beamspot (4 bits)
void setOneNominalInTime(const bool bit)
void set_me4_stub_num(int bits)
bool unpack(const Block &block, UnpackerCollections *coll) override
void set_me3_delay(int bits)
void set_dxy_GMT(int bits)
int ME1_subsector() const
void setBXRange(int bxFirst, int bxLast)
void setTFIdentifiers(int processor, tftype trackFinder)
Set the processor ID, track-finder type. From these two, the link is set.
void set_pt_LUT_addr(unsigned long bits)
void ImportSP(EMTFTrack &_track, const l1t::emtf::SP _SP, const int _endcap, const int _evt_sector)
void push_Hit(const EMTFHit &hit)
#define DEFINE_L1T_UNPACKER(type)
void set_me1_CSC_ID(int bits)
void setHwSignValid(int bits)
Set whether charge measurement is valid (0 for high pT muons)
std::vector< int > convert_SP_location(int _csc_ID, int _sector, int _subsector, int _station)
std::vector< EMTFTrack > EMTFTrackCollection
uint16_t GetHexBits(uint16_t word, uint16_t lowBit, uint16_t highBit)
Log< level::Warning, false > LogWarning
void set_me1_subsector(int bits)
void setHwPtUnconstrained(int bits)
Set compressed second displaced pT as transmitted by hardware LSB = 1.0 (8 bits)
void set_quality_GMT(int bits)
void push_back(int bx, T object)
void set_phi_full(int bits)
void setHwSign(int bits)
Set charge sign bit (charge = (-1)^(sign))
void set_nn_pt_valid(int bits)