41 edm::LogError(
"L1T|EMTF") <<
"Payload size in 'ME Data Record' is different than expected";
45 for (
unsigned int i = 0;
i < 4;
i++) {
48 edm::LogError(
"L1T|EMTF") <<
"Payload[" <<
i <<
"] has more than 16 bits in 'ME Data Record'";
60 edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in MEa are incorrect";
64 edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in MEb are incorrect";
68 edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in MEc are incorrect";
72 edm::LogError(
"L1T|EMTF") <<
"Format identifier bits in MEd are incorrect";
79 std::vector<int>
convert_ME_location(
int _station,
int _csc_ID,
int _sector,
bool _csc_ID_shift =
false) {
80 int new_sector = _sector;
81 int new_csc_ID = _csc_ID;
85 int arr[] = {1, new_csc_ID, new_sector, 1, 0};
86 std::vector<int> vec(arr, arr + 5);
88 }
else if (_station == 1) {
89 int arr[] = {1, new_csc_ID, new_sector, 2, 0};
90 std::vector<int> vec(arr, arr + 5);
92 }
else if (_station <= 4) {
93 int arr[] = {_station, new_csc_ID, new_sector, -1, 0};
94 std::vector<int> vec(arr, arr + 5);
96 }
else if (_station == 5) {
97 new_sector = (_sector != 1) ? _sector - 1 : 6;
99 int arr[] = {_station, _csc_ID, _sector, -99, -99};
100 std::vector<int> vec(arr, arr + 5);
105 if (new_csc_ID == 1) {
106 int arr[] = {1, 3, new_sector, 2, 1};
107 std::vector<int> vec(arr, arr + 5);
109 }
else if (new_csc_ID == 2) {
110 int arr[] = {1, 6, new_sector, 2, 1};
111 std::vector<int> vec(arr, arr + 5);
113 }
else if (new_csc_ID == 3) {
114 int arr[] = {1, 9, new_sector, 2, 1};
115 std::vector<int> vec(arr, arr + 5);
117 }
else if (new_csc_ID == 4) {
118 int arr[] = {2, 3, new_sector, -1, 1};
119 std::vector<int> vec(arr, arr + 5);
121 }
else if (new_csc_ID == 5) {
122 int arr[] = {2, 9, new_sector, -1, 1};
123 std::vector<int> vec(arr, arr + 5);
125 }
else if (new_csc_ID == 6) {
126 int arr[] = {3, 3, new_sector, -1, 1};
127 std::vector<int> vec(arr, arr + 5);
129 }
else if (new_csc_ID == 7) {
130 int arr[] = {3, 9, new_sector, -1, 1};
131 std::vector<int> vec(arr, arr + 5);
133 }
else if (new_csc_ID == 8) {
134 int arr[] = {4, 3, new_sector, -1, 1};
135 std::vector<int> vec(arr, arr + 5);
137 }
else if (new_csc_ID == 9) {
138 int arr[] = {4, 9, new_sector, -1, 1};
139 std::vector<int> vec(arr, arr + 5);
142 int arr[] = {_station, _csc_ID, _sector, -99, -99};
143 std::vector<int> vec(arr, arr + 5);
171 int iOut =
res->size() - 1;
189 bool run3_DAQ_format =
191 bool reducedDAQWindow =
211 if (reducedDAQWindow)
229 std::vector<int> conv_vals =
241 <<
", outside proper [1, 4] range" << std::endl;
244 <<
", outside proper [1, 9] range" << std::endl;
247 <<
", outside proper [1, 6] range" << std::endl;
250 bool isOTMB = (Hit_.
Ring() == 1
or 254 isOTMB and run3_DAQ_format;
256 if (run3_DAQ_format) {
270 const unsigned slopeList[32] = {10, 10, 10, 8, 8, 8, 6, 6, 6, 4, 4, 4, 2, 2, 2, 2,
271 10, 10, 10, 9, 9, 9, 7, 7, 7, 5, 5, 5, 3, 3, 3, 3};
274 unsigned slope_and_sign(ME_.
Slope());
276 slope_and_sign += 16;
278 unsigned run2_converted_PID = slopeList[slope_and_sign];
287 if (ME_.
Frame() == 1) {
308 ImportME(Hit_, ME_, (
res->at(iOut)).PtrEventHeader()->Endcap(), (
res->at(iOut)).PtrEventHeader()->Sector());
315 CSCShowerDigi::ShowerType::kEMTFShower);
322 bool exact_duplicate =
false;
323 bool neighbor_duplicate =
false;
324 for (
auto const& iHit : *res_hit) {
325 if (iHit.Is_CSC() == 1 && Hit_.
BX() == iHit.BX() && Hit_.
Endcap() == iHit.Endcap() &&
326 Hit_.
Station() == iHit.Station() && Hit_.
Chamber() == iHit.Chamber() &&
327 (Hit_.
Ring() % 3) == (iHit.Ring() % 3)) {
329 if (Hit_.
Ring() == iHit.Ring() && Hit_.
Strip() == iHit.Strip() && Hit_.
Wire() == iHit.Wire()) {
330 exact_duplicate = (Hit_.
Neighbor() == iHit.Neighbor());
331 neighbor_duplicate = (Hit_.
Neighbor() != iHit.Neighbor());
332 }
else if (Hit_.
Neighbor() == iHit.Neighbor()) {
340 if (Hit_.
BX() > 3
or Hit_.
BX() < -3) {
341 edm::LogWarning(
"L1T|EMTF") <<
"EMTF unpacked LCTs with out-of-range BX! BX " << Hit_.
BX() <<
", endcap " 343 <<
", neighbor " << Hit_.
Neighbor() <<
", ring " << Hit_.
Ring() <<
", chamber " 350 edm::LogWarning(
"L1T|EMTF") <<
"EMTF unpacked duplicate LCTs: BX " << Hit_.
BX() <<
", endcap " 352 <<
", neighbor " << Hit_.
Neighbor() <<
", ring " << Hit_.
Ring() <<
", chamber " 356 (
res->at(iOut)).push_ME(ME_);
357 if (!exact_duplicate && Hit_.
Valid() == 1)
358 res_hit->push_back(Hit_);
359 if (!exact_duplicate && !neighbor_duplicate &&
362 if (ME_.
HMV() == 1) {
int HMT_outOfTime() const
void set_neighbor(int bits)
unsigned int getAlgoVersion()
void ImportME(EMTFHit &_hit, const l1t::emtf::ME _ME, const int _endcap, const int _evt_sector)
void set_stub_num(int bits)
void set_station(int bits)
void insertDigi(const IndexType &index, const DigiType &digi)
insert a digi for a given DetUnit
Log< level::Error, false > LogError
CSCCorrelatedLCTDigi CreateCSCCorrelatedLCTDigi(const bool isRun3) const
std::vector< int > convert_ME_location(int _station, int _csc_ID, int _sector, bool _csc_ID_shift=false)
void set_eighth_strip(int bits)
virtual int checkFormat(const Block &block)
bool unpack(const Block &block, UnpackerCollections *coll) override
void set_stub_num(int bits)
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
void set_csc_ID(int bits)
void set_quality(int bits)
std::vector< EMTFHit > EMTFHitCollection
std::vector< EMTFDaqOut > EMTFDaqOutCollection
void set_csc_ID(int bits)
void set_run3_pattern(int bits)
void set_sector(int bits)
void set_hmt_inTime(int bits)
int calc_ring(int station, int csc_ID, int strip)
CSCDetId CSC_DetId() const
void set_station(int bits)
#define DEFINE_L1T_UNPACKER(type)
void set_me_bxn(int bits)
uint16_t GetHexBits(uint16_t word, uint16_t lowBit, uint16_t highBit)
Log< level::Warning, false > LogWarning
void set_quarter_strip(int bits)
void set_hmt_outOfTime(int bits)
void set_clct_pattern(int bits)
void set_subsector(int bits)
A container for a generic type of digis indexed by some index, implemented with a map<IndexType...