diff --git a/CalibMuon/CSCCalibration/plugins/CSCL1TPLookupTableEP.cc b/CalibMuon/CSCCalibration/plugins/CSCL1TPLookupTableEP.cc index 5b904cb010978..8b1c906fa55a8 100644 --- a/CalibMuon/CSCCalibration/plugins/CSCL1TPLookupTableEP.cc +++ b/CalibMuon/CSCCalibration/plugins/CSCL1TPLookupTableEP.cc @@ -84,11 +84,8 @@ std::unique_ptr CSCL1TPLookupTableEP::produceME11ILT( std::unique_ptr lut = std::make_unique(); // get the text files - std::vector padToHsME1aFiles_ = pset_.getParameter>("padToHsME1aFiles"); - std::vector padToHsME1bFiles_ = pset_.getParameter>("padToHsME1bFiles"); - - std::vector padToEsME1aFiles_ = pset_.getParameter>("padToEsME1aFiles"); - std::vector padToEsME1bFiles_ = pset_.getParameter>("padToEsME1bFiles"); + std::vector padToEsME11aFiles_ = pset_.getParameter>("padToEsME11aFiles"); + std::vector padToEsME11bFiles_ = pset_.getParameter>("padToEsME11bFiles"); std::vector rollToMaxWgME11Files_ = pset_.getParameter>("rollToMaxWgME11Files"); std::vector rollToMinWgME11Files_ = pset_.getParameter>("rollToMinWgME11Files"); @@ -99,104 +96,97 @@ std::unique_ptr CSCL1TPLookupTableEP::produceME11ILT( std::vector gemCscSlopeCorrectionFiles_ = pset_.getParameter>("gemCscSlopeCorrectionFiles"); - std::vector esDiffToSlopeME1aFiles_ = - pset_.getParameter>("esDiffToSlopeME1aFiles"); - std::vector esDiffToSlopeME1bFiles_ = - pset_.getParameter>("esDiffToSlopeME1bFiles"); + std::vector esDiffToSlopeME11aFiles_ = + pset_.getParameter>("esDiffToSlopeME11aFiles"); + std::vector esDiffToSlopeME11bFiles_ = + pset_.getParameter>("esDiffToSlopeME11bFiles"); // read the text files and extract the data - auto GEM_pad_CSC_hs_ME1a_even_ = load(padToHsME1aFiles_[0]); - auto GEM_pad_CSC_hs_ME1a_odd_ = load(padToHsME1aFiles_[1]); - auto GEM_pad_CSC_hs_ME1b_even_ = load(padToHsME1bFiles_[0]); - auto GEM_pad_CSC_hs_ME1b_odd_ = load(padToHsME1bFiles_[1]); - - auto GEM_pad_CSC_es_ME1a_even_ = load(padToEsME1aFiles_[0]); - auto GEM_pad_CSC_es_ME1a_odd_ = load(padToEsME1aFiles_[1]); - auto GEM_pad_CSC_es_ME1b_even_ = load(padToEsME1bFiles_[0]); - auto GEM_pad_CSC_es_ME1b_odd_ = load(padToEsME1bFiles_[1]); - - auto GEM_roll_L1_CSC_min_wg_ME11_even_ = load(rollToMinWgME11Files_[0]); - auto GEM_roll_L1_CSC_min_wg_ME11_odd_ = load(rollToMinWgME11Files_[1]); - auto GEM_roll_L2_CSC_min_wg_ME11_even_ = load(rollToMinWgME11Files_[2]); - auto GEM_roll_L2_CSC_min_wg_ME11_odd_ = load(rollToMinWgME11Files_[3]); - - auto GEM_roll_L1_CSC_max_wg_ME11_even_ = load(rollToMaxWgME11Files_[0]); - auto GEM_roll_L1_CSC_max_wg_ME11_odd_ = load(rollToMaxWgME11Files_[1]); - auto GEM_roll_L2_CSC_max_wg_ME11_even_ = load(rollToMaxWgME11Files_[2]); - auto GEM_roll_L2_CSC_max_wg_ME11_odd_ = load(rollToMaxWgME11Files_[3]); - - auto CSC_slope_cosi_2to1_L1_ME11_even_ = load(gemCscSlopeCosiFiles_[0]); - auto CSC_slope_cosi_2to1_L1_ME11_odd_ = load(gemCscSlopeCosiFiles_[1]); - auto CSC_slope_cosi_3to1_L1_ME11_even_ = load(gemCscSlopeCosiFiles_[2]); - auto CSC_slope_cosi_3to1_L1_ME11_odd_ = load(gemCscSlopeCosiFiles_[3]); - - auto CSC_slope_cosi_corr_L1_ME11_even_ = load(gemCscSlopeCosiCorrectionFiles_[0]); - auto CSC_slope_cosi_corr_L2_ME11_even_ = load(gemCscSlopeCosiCorrectionFiles_[1]); - auto CSC_slope_cosi_corr_L1_ME11_odd_ = load(gemCscSlopeCosiCorrectionFiles_[2]); - auto CSC_slope_cosi_corr_L2_ME11_odd_ = load(gemCscSlopeCosiCorrectionFiles_[3]); - - auto CSC_slope_corr_L1_ME11_even_ = load(gemCscSlopeCorrectionFiles_[0]); - auto CSC_slope_corr_L2_ME11_even_ = load(gemCscSlopeCorrectionFiles_[1]); - auto CSC_slope_corr_L1_ME11_odd_ = load(gemCscSlopeCorrectionFiles_[2]); - auto CSC_slope_corr_L2_ME11_odd_ = load(gemCscSlopeCorrectionFiles_[3]); - - auto es_diff_slope_L1_ME1a_even_ = load(esDiffToSlopeME1aFiles_[0]); - auto es_diff_slope_L1_ME1a_odd_ = load(esDiffToSlopeME1aFiles_[1]); - auto es_diff_slope_L2_ME1a_even_ = load(esDiffToSlopeME1aFiles_[2]); - auto es_diff_slope_L2_ME1a_odd_ = load(esDiffToSlopeME1aFiles_[3]); - - auto es_diff_slope_L1_ME1b_even_ = load(esDiffToSlopeME1bFiles_[0]); - auto es_diff_slope_L1_ME1b_odd_ = load(esDiffToSlopeME1bFiles_[1]); - auto es_diff_slope_L2_ME1b_even_ = load(esDiffToSlopeME1bFiles_[2]); - auto es_diff_slope_L2_ME1b_odd_ = load(esDiffToSlopeME1bFiles_[3]); + auto GEM_pad_CSC_es_ME11a_even_ = load(padToEsME11aFiles_[0]); + auto GEM_pad_CSC_es_ME11a_odd_ = load(padToEsME11aFiles_[1]); + auto GEM_pad_CSC_es_ME11b_even_ = load(padToEsME11bFiles_[0]); + auto GEM_pad_CSC_es_ME11b_odd_ = load(padToEsME11bFiles_[1]); + + auto GEM_roll_CSC_min_wg_ME11_even_ = load(rollToMinWgME11Files_[0]); + auto GEM_roll_CSC_min_wg_ME11_odd_ = load(rollToMinWgME11Files_[1]); + auto GEM_roll_CSC_max_wg_ME11_even_ = load(rollToMaxWgME11Files_[0]); + auto GEM_roll_CSC_max_wg_ME11_odd_ = load(rollToMaxWgME11Files_[1]); + + auto CSC_slope_cosi_2to1_L1_ME11a_even_ = load(gemCscSlopeCosiFiles_[0]); + auto CSC_slope_cosi_2to1_L1_ME11a_odd_ = load(gemCscSlopeCosiFiles_[1]); + auto CSC_slope_cosi_3to1_L1_ME11a_even_ = load(gemCscSlopeCosiFiles_[2]); + auto CSC_slope_cosi_3to1_L1_ME11a_odd_ = load(gemCscSlopeCosiFiles_[3]); + + auto CSC_slope_cosi_2to1_L1_ME11b_even_ = load(gemCscSlopeCosiFiles_[4]); + auto CSC_slope_cosi_2to1_L1_ME11b_odd_ = load(gemCscSlopeCosiFiles_[5]); + auto CSC_slope_cosi_3to1_L1_ME11b_even_ = load(gemCscSlopeCosiFiles_[6]); + auto CSC_slope_cosi_3to1_L1_ME11b_odd_ = load(gemCscSlopeCosiFiles_[7]); + + auto CSC_slope_cosi_corr_L1_ME11a_even_ = load(gemCscSlopeCosiCorrectionFiles_[0]); + auto CSC_slope_cosi_corr_L1_ME11b_even_ = load(gemCscSlopeCosiCorrectionFiles_[1]); + auto CSC_slope_cosi_corr_L1_ME11a_odd_ = load(gemCscSlopeCosiCorrectionFiles_[3]); + auto CSC_slope_cosi_corr_L1_ME11b_odd_ = load(gemCscSlopeCosiCorrectionFiles_[4]); + + auto CSC_slope_corr_L1_ME11a_even_ = load(gemCscSlopeCorrectionFiles_[0]); + auto CSC_slope_corr_L1_ME11b_even_ = load(gemCscSlopeCorrectionFiles_[1]); + auto CSC_slope_corr_L1_ME11a_odd_ = load(gemCscSlopeCorrectionFiles_[3]); + auto CSC_slope_corr_L1_ME11b_odd_ = load(gemCscSlopeCorrectionFiles_[4]); + auto CSC_slope_corr_L2_ME11a_even_ = load(gemCscSlopeCorrectionFiles_[6]); + auto CSC_slope_corr_L2_ME11b_even_ = load(gemCscSlopeCorrectionFiles_[7]); + auto CSC_slope_corr_L2_ME11a_odd_ = load(gemCscSlopeCorrectionFiles_[9]); + auto CSC_slope_corr_L2_ME11b_odd_ = load(gemCscSlopeCorrectionFiles_[10]); + + auto es_diff_slope_L1_ME11a_even_ = load(esDiffToSlopeME11aFiles_[0]); + auto es_diff_slope_L1_ME11a_odd_ = load(esDiffToSlopeME11aFiles_[1]); + auto es_diff_slope_L2_ME11a_even_ = load(esDiffToSlopeME11aFiles_[2]); + auto es_diff_slope_L2_ME11a_odd_ = load(esDiffToSlopeME11aFiles_[3]); + + auto es_diff_slope_L1_ME11b_even_ = load(esDiffToSlopeME11bFiles_[0]); + auto es_diff_slope_L1_ME11b_odd_ = load(esDiffToSlopeME11bFiles_[1]); + auto es_diff_slope_L2_ME11b_even_ = load(esDiffToSlopeME11bFiles_[2]); + auto es_diff_slope_L2_ME11b_odd_ = load(esDiffToSlopeME11bFiles_[3]); // set the data in the LUT object - lut->set_GEM_pad_CSC_hs_ME1b_even(std::move(GEM_pad_CSC_hs_ME1b_even_)); - lut->set_GEM_pad_CSC_hs_ME1a_even(std::move(GEM_pad_CSC_hs_ME1a_even_)); - lut->set_GEM_pad_CSC_hs_ME1b_odd(std::move(GEM_pad_CSC_hs_ME1b_odd_)); - lut->set_GEM_pad_CSC_hs_ME1a_odd(std::move(GEM_pad_CSC_hs_ME1a_odd_)); - - lut->set_GEM_pad_CSC_es_ME1b_even(std::move(GEM_pad_CSC_es_ME1b_even_)); - lut->set_GEM_pad_CSC_es_ME1a_even(std::move(GEM_pad_CSC_es_ME1a_even_)); - lut->set_GEM_pad_CSC_es_ME1b_odd(std::move(GEM_pad_CSC_es_ME1b_odd_)); - lut->set_GEM_pad_CSC_es_ME1a_odd(std::move(GEM_pad_CSC_es_ME1a_odd_)); - - lut->set_GEM_roll_L1_CSC_min_wg_ME11_even(std::move(GEM_roll_L1_CSC_min_wg_ME11_even_)); - lut->set_GEM_roll_L1_CSC_max_wg_ME11_even(std::move(GEM_roll_L1_CSC_max_wg_ME11_even_)); - lut->set_GEM_roll_L1_CSC_min_wg_ME11_odd(std::move(GEM_roll_L1_CSC_min_wg_ME11_odd_)); - lut->set_GEM_roll_L1_CSC_max_wg_ME11_odd(std::move(GEM_roll_L1_CSC_max_wg_ME11_odd_)); - - lut->set_GEM_roll_L2_CSC_min_wg_ME11_even(std::move(GEM_roll_L2_CSC_min_wg_ME11_even_)); - lut->set_GEM_roll_L2_CSC_max_wg_ME11_even(std::move(GEM_roll_L2_CSC_max_wg_ME11_even_)); - lut->set_GEM_roll_L2_CSC_min_wg_ME11_odd(std::move(GEM_roll_L2_CSC_min_wg_ME11_odd_)); - lut->set_GEM_roll_L2_CSC_max_wg_ME11_odd(std::move(GEM_roll_L2_CSC_max_wg_ME11_odd_)); - - // GEM-CSC trigger: slope correction - lut->set_CSC_slope_cosi_2to1_L1_ME11_even(std::move(CSC_slope_cosi_2to1_L1_ME11_even_)); - lut->set_CSC_slope_cosi_2to1_L1_ME11_odd(std::move(CSC_slope_cosi_2to1_L1_ME11_odd_)); - lut->set_CSC_slope_cosi_3to1_L1_ME11_even(std::move(CSC_slope_cosi_3to1_L1_ME11_even_)); - lut->set_CSC_slope_cosi_3to1_L1_ME11_odd(std::move(CSC_slope_cosi_3to1_L1_ME11_odd_)); + lut->set_GEM_pad_CSC_es_ME11b_even(std::move(GEM_pad_CSC_es_ME11b_even_)); + lut->set_GEM_pad_CSC_es_ME11a_even(std::move(GEM_pad_CSC_es_ME11a_even_)); + lut->set_GEM_pad_CSC_es_ME11b_odd(std::move(GEM_pad_CSC_es_ME11b_odd_)); + lut->set_GEM_pad_CSC_es_ME11a_odd(std::move(GEM_pad_CSC_es_ME11a_odd_)); - lut->set_CSC_slope_cosi_corr_L1_ME11_even(std::move(CSC_slope_cosi_corr_L1_ME11_even_)); - lut->set_CSC_slope_cosi_corr_L1_ME11_odd(std::move(CSC_slope_cosi_corr_L1_ME11_odd_)); - lut->set_CSC_slope_cosi_corr_L2_ME11_even(std::move(CSC_slope_cosi_corr_L2_ME11_even_)); - lut->set_CSC_slope_cosi_corr_L2_ME11_odd(std::move(CSC_slope_cosi_corr_L2_ME11_odd_)); + lut->set_GEM_roll_CSC_min_wg_ME11_even(std::move(GEM_roll_CSC_min_wg_ME11_even_)); + lut->set_GEM_roll_CSC_min_wg_ME11_odd(std::move(GEM_roll_CSC_min_wg_ME11_odd_)); + lut->set_GEM_roll_CSC_max_wg_ME11_even(std::move(GEM_roll_CSC_max_wg_ME11_even_)); + lut->set_GEM_roll_CSC_max_wg_ME11_odd(std::move(GEM_roll_CSC_max_wg_ME11_odd_)); - lut->set_CSC_slope_corr_L1_ME11_even(std::move(CSC_slope_corr_L1_ME11_even_)); - lut->set_CSC_slope_corr_L1_ME11_odd(std::move(CSC_slope_corr_L1_ME11_odd_)); - lut->set_CSC_slope_corr_L2_ME11_even(std::move(CSC_slope_corr_L2_ME11_even_)); - lut->set_CSC_slope_corr_L2_ME11_odd(std::move(CSC_slope_corr_L2_ME11_odd_)); + // GEM-CSC trigger: slope correction + lut->set_CSC_slope_cosi_2to1_L1_ME11a_even(std::move(CSC_slope_cosi_2to1_L1_ME11a_even_)); + lut->set_CSC_slope_cosi_2to1_L1_ME11a_odd(std::move(CSC_slope_cosi_2to1_L1_ME11a_odd_)); + lut->set_CSC_slope_cosi_3to1_L1_ME11a_even(std::move(CSC_slope_cosi_3to1_L1_ME11a_even_)); + lut->set_CSC_slope_cosi_3to1_L1_ME11a_odd(std::move(CSC_slope_cosi_3to1_L1_ME11a_odd_)); + + lut->set_CSC_slope_cosi_2to1_L1_ME11b_even(std::move(CSC_slope_cosi_2to1_L1_ME11b_even_)); + lut->set_CSC_slope_cosi_2to1_L1_ME11b_odd(std::move(CSC_slope_cosi_2to1_L1_ME11b_odd_)); + lut->set_CSC_slope_cosi_3to1_L1_ME11b_even(std::move(CSC_slope_cosi_3to1_L1_ME11b_even_)); + lut->set_CSC_slope_cosi_3to1_L1_ME11b_odd(std::move(CSC_slope_cosi_3to1_L1_ME11b_odd_)); + + lut->set_CSC_slope_corr_L1_ME11a_even(std::move(CSC_slope_corr_L1_ME11a_even_)); + lut->set_CSC_slope_corr_L1_ME11a_odd(std::move(CSC_slope_corr_L1_ME11a_odd_)); + lut->set_CSC_slope_corr_L1_ME11b_even(std::move(CSC_slope_corr_L1_ME11b_even_)); + lut->set_CSC_slope_corr_L1_ME11b_odd(std::move(CSC_slope_corr_L1_ME11b_odd_)); + lut->set_CSC_slope_corr_L2_ME11a_even(std::move(CSC_slope_corr_L2_ME11a_even_)); + lut->set_CSC_slope_corr_L2_ME11a_odd(std::move(CSC_slope_corr_L2_ME11a_odd_)); + lut->set_CSC_slope_corr_L2_ME11b_even(std::move(CSC_slope_corr_L2_ME11b_even_)); + lut->set_CSC_slope_corr_L2_ME11b_odd(std::move(CSC_slope_corr_L2_ME11b_odd_)); // GEM-CSC trigger: 1/8-strip difference to slope - lut->set_es_diff_slope_L1_ME1a_even(std::move(es_diff_slope_L1_ME1a_even_)); - lut->set_es_diff_slope_L2_ME1a_even(std::move(es_diff_slope_L2_ME1a_even_)); - lut->set_es_diff_slope_L1_ME1a_odd(std::move(es_diff_slope_L1_ME1a_odd_)); - lut->set_es_diff_slope_L2_ME1a_odd(std::move(es_diff_slope_L2_ME1a_odd_)); + lut->set_es_diff_slope_L1_ME11a_even(std::move(es_diff_slope_L1_ME11a_even_)); + lut->set_es_diff_slope_L1_ME11a_odd(std::move(es_diff_slope_L1_ME11a_odd_)); + lut->set_es_diff_slope_L2_ME11a_even(std::move(es_diff_slope_L2_ME11a_even_)); + lut->set_es_diff_slope_L2_ME11a_odd(std::move(es_diff_slope_L2_ME11a_odd_)); - lut->set_es_diff_slope_L1_ME1b_even(std::move(es_diff_slope_L1_ME1b_even_)); - lut->set_es_diff_slope_L2_ME1b_even(std::move(es_diff_slope_L2_ME1b_even_)); - lut->set_es_diff_slope_L1_ME1b_odd(std::move(es_diff_slope_L1_ME1b_odd_)); - lut->set_es_diff_slope_L2_ME1b_odd(std::move(es_diff_slope_L2_ME1b_odd_)); + lut->set_es_diff_slope_L1_ME11b_even(std::move(es_diff_slope_L1_ME11b_even_)); + lut->set_es_diff_slope_L1_ME11b_odd(std::move(es_diff_slope_L1_ME11b_odd_)); + lut->set_es_diff_slope_L2_ME11b_even(std::move(es_diff_slope_L2_ME11b_even_)); + lut->set_es_diff_slope_L2_ME11b_odd(std::move(es_diff_slope_L2_ME11b_odd_)); return lut; } @@ -206,19 +196,21 @@ std::unique_ptr CSCL1TPLookupTableEP::produceME21ILT( std::unique_ptr lut = std::make_unique(); // get the text files - std::vector padToHsME21Files_ = pset_.getParameter>("padToHsME21Files"); std::vector padToEsME21Files_ = pset_.getParameter>("padToEsME21Files"); std::vector rollToMaxWgME21Files_ = pset_.getParameter>("rollToMaxWgME21Files"); std::vector rollToMinWgME21Files_ = pset_.getParameter>("rollToMinWgME21Files"); + std::vector gemCscSlopeCosiFiles_ = pset_.getParameter>("gemCscSlopeCosiFiles"); + std::vector gemCscSlopeCosiCorrectionFiles_ = + pset_.getParameter>("gemCscSlopeCosiCorrectionFiles"); + std::vector gemCscSlopeCorrectionFiles_ = + pset_.getParameter>("gemCscSlopeCorrectionFiles"); + std::vector esDiffToSlopeME21Files_ = pset_.getParameter>("esDiffToSlopeME21Files"); // read the text files and extract the data - auto GEM_pad_CSC_hs_ME21_even_ = load(padToHsME21Files_[0]); - auto GEM_pad_CSC_hs_ME21_odd_ = load(padToHsME21Files_[1]); - auto GEM_pad_CSC_es_ME21_even_ = load(padToEsME21Files_[0]); auto GEM_pad_CSC_es_ME21_odd_ = load(padToEsME21Files_[1]); @@ -237,10 +229,20 @@ std::unique_ptr CSCL1TPLookupTableEP::produceME21ILT( auto es_diff_slope_L2_ME21_even_ = load(esDiffToSlopeME21Files_[2]); auto es_diff_slope_L2_ME21_odd_ = load(esDiffToSlopeME21Files_[3]); - // set the data in the LUT object - lut->set_GEM_pad_CSC_hs_ME21_even(std::move(GEM_pad_CSC_hs_ME21_even_)); - lut->set_GEM_pad_CSC_hs_ME21_odd(std::move(GEM_pad_CSC_hs_ME21_odd_)); + auto CSC_slope_cosi_2to1_L1_ME21_even_ = load(gemCscSlopeCosiFiles_[8]); + auto CSC_slope_cosi_2to1_L1_ME21_odd_ = load(gemCscSlopeCosiFiles_[9]); + auto CSC_slope_cosi_3to1_L1_ME21_even_ = load(gemCscSlopeCosiFiles_[10]); + auto CSC_slope_cosi_3to1_L1_ME21_odd_ = load(gemCscSlopeCosiFiles_[11]); + + auto CSC_slope_cosi_corr_L1_ME21_even_ = load(gemCscSlopeCosiCorrectionFiles_[2]); + auto CSC_slope_cosi_corr_L1_ME21_odd_ = load(gemCscSlopeCosiCorrectionFiles_[5]); + auto CSC_slope_corr_L1_ME21_even_ = load(gemCscSlopeCorrectionFiles_[2]); + auto CSC_slope_corr_L1_ME21_odd_ = load(gemCscSlopeCorrectionFiles_[5]); + auto CSC_slope_corr_L2_ME21_even_ = load(gemCscSlopeCorrectionFiles_[8]); + auto CSC_slope_corr_L2_ME21_odd_ = load(gemCscSlopeCorrectionFiles_[11]); + + // set the data in the LUT object lut->set_GEM_pad_CSC_es_ME21_even(std::move(GEM_pad_CSC_es_ME21_even_)); lut->set_GEM_pad_CSC_es_ME21_odd(std::move(GEM_pad_CSC_es_ME21_odd_)); @@ -255,10 +257,20 @@ std::unique_ptr CSCL1TPLookupTableEP::produceME21ILT( lut->set_GEM_roll_L2_CSC_max_wg_ME21_odd(std::move(GEM_roll_L2_CSC_max_wg_ME21_odd_)); lut->set_es_diff_slope_L1_ME21_even(std::move(es_diff_slope_L1_ME21_even_)); - lut->set_es_diff_slope_L2_ME21_even(std::move(es_diff_slope_L2_ME21_even_)); lut->set_es_diff_slope_L1_ME21_odd(std::move(es_diff_slope_L1_ME21_odd_)); + lut->set_es_diff_slope_L2_ME21_even(std::move(es_diff_slope_L2_ME21_even_)); lut->set_es_diff_slope_L2_ME21_odd(std::move(es_diff_slope_L2_ME21_odd_)); + lut->set_CSC_slope_cosi_2to1_L1_ME21_even(std::move(CSC_slope_cosi_2to1_L1_ME21_even_)); + lut->set_CSC_slope_cosi_2to1_L1_ME21_odd(std::move(CSC_slope_cosi_2to1_L1_ME21_odd_)); + lut->set_CSC_slope_cosi_3to1_L1_ME21_even(std::move(CSC_slope_cosi_3to1_L1_ME21_even_)); + lut->set_CSC_slope_cosi_3to1_L1_ME21_odd(std::move(CSC_slope_cosi_3to1_L1_ME21_odd_)); + + lut->set_CSC_slope_corr_L1_ME21_even(std::move(CSC_slope_corr_L1_ME21_even_)); + lut->set_CSC_slope_corr_L1_ME21_odd(std::move(CSC_slope_corr_L1_ME21_odd_)); + lut->set_CSC_slope_corr_L2_ME21_even(std::move(CSC_slope_corr_L2_ME21_even_)); + lut->set_CSC_slope_corr_L2_ME21_odd(std::move(CSC_slope_corr_L2_ME21_odd_)); + return lut; } diff --git a/CalibMuon/CSCCalibration/python/CSCL1TPLookupTableEP_cff.py b/CalibMuon/CSCCalibration/python/CSCL1TPLookupTableEP_cff.py index 0b9b4625c4072..96a3ceefd1ab6 100644 --- a/CalibMuon/CSCCalibration/python/CSCL1TPLookupTableEP_cff.py +++ b/CalibMuon/CSCCalibration/python/CSCL1TPLookupTableEP_cff.py @@ -17,28 +17,13 @@ "L1Trigger/CSCTriggerPrimitives/data/CCLUT/CSCComparatorCodeSlopeLUT_pat3_v1.txt", "L1Trigger/CSCTriggerPrimitives/data/CCLUT/CSCComparatorCodeSlopeLUT_pat4_v1.txt" ), - ## convert pad number to 1/2-strip in ME1a - padToHsME1aFiles = cms.vstring( - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_hs_ME1a_even.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_hs_ME1a_odd.txt", - ), - ## convert pad number to 1/2-strip in ME1b - padToHsME1bFiles = cms.vstring( - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_hs_ME1b_even.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_hs_ME1b_odd.txt", - ), - ## convert pad number to 1/2-strip in ME21 - padToHsME21Files = cms.vstring( - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_hs_ME21_even.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_hs_ME21_odd.txt", - ), ## convert pad number to 1/8-strip in ME1a - padToEsME1aFiles = cms.vstring( + padToEsME11aFiles = cms.vstring( "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_es_ME1a_even.txt", "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_es_ME1a_odd.txt", ), ## convert pad number to 1/8-strip in ME1b - padToEsME1bFiles = cms.vstring( + padToEsME11bFiles = cms.vstring( "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_es_ME1b_even.txt", "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_pad_es_ME1b_odd.txt", ), @@ -51,15 +36,11 @@ rollToMinWgME11Files = cms.vstring( "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l1_min_wg_ME11_even.txt", "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l1_min_wg_ME11_odd.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l2_min_wg_ME11_even.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l2_min_wg_ME11_odd.txt", ), ## convert eta partition to maximum wiregroup in ME11 rollToMaxWgME11Files = cms.vstring( "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l1_max_wg_ME11_even.txt", "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l1_max_wg_ME11_odd.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l2_max_wg_ME11_even.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/CoordinateConversion/GEMCSCLUT_roll_l2_max_wg_ME11_odd.txt", ), ## convert eta partition to minimum wiregroup in ME21 rollToMinWgME21Files = cms.vstring( @@ -77,46 +58,60 @@ ), # lookup tables for the GEM-CSC slope correction gemCscSlopeCorrectionFiles = cms.vstring( - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/GEMCSCSlopeCorr_ME11_even_GE11_layer1.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/GEMCSCSlopeCorr_ME11_even_GE11_layer2.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/GEMCSCSlopeCorr_ME11_odd_GE11_layer1.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/GEMCSCSlopeCorr_ME11_odd_GE11_layer2.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/ExtrapolationBySlope_ME11a_even_GEMlayer1.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/ExtrapolationBySlope_ME11b_even_GEMlayer1.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/ExtrapolationBySlope_ME21_even_GEMlayer1.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/ExtrapolationBySlope_ME11a_odd_GEMlayer1.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/ExtrapolationBySlope_ME11b_odd_GEMlayer1.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/ExtrapolationBySlope_ME21_odd_GEMlayer1.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/ExtrapolationBySlope_ME11a_even_GEMlayer2.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/ExtrapolationBySlope_ME11b_even_GEMlayer2.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/ExtrapolationBySlope_ME21_even_GEMlayer2.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/ExtrapolationBySlope_ME11a_odd_GEMlayer2.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/ExtrapolationBySlope_ME11b_odd_GEMlayer2.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/ExtrapolationBySlope_ME21_odd_GEMlayer2.txt", ), # lookup tables for the GEM-CSC slope correction gemCscSlopeCosiFiles = cms.vstring( - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/CSCconsistency_2to1_SlopeShift_ME11_even_GE11_layer1.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/CSCconsistency_2to1_SlopeShift_ME11_odd_GE11_layer1.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/CSCconsistency_3to1_SlopeShift_ME11_even_GE11_layer1.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/CSCconsistency_3to1_SlopeShift_ME11_odd_GE11_layer1.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/CSCconsistency_2to1_SlopeShift_ME11_even_GE11_layer2.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/CSCconsistency_2to1_SlopeShift_ME11_odd_GE11_layer2.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/CSCconsistency_3to1_SlopeShift_ME11_even_GE11_layer2.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/CSCconsistency_3to1_SlopeShift_ME11_odd_GE11_layer2.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/CSCconsistency_2to1_SlopeShift_ME11a_even_layer1.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/CSCconsistency_2to1_SlopeShift_ME11a_odd_layer1.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/CSCconsistency_3to1_SlopeShift_ME11a_even_layer1.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/CSCconsistency_3to1_SlopeShift_ME11a_odd_layer1.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/CSCconsistency_2to1_SlopeShift_ME11b_even_layer1.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/CSCconsistency_2to1_SlopeShift_ME11b_odd_layer1.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/CSCconsistency_3to1_SlopeShift_ME11b_even_layer1.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/CSCconsistency_3to1_SlopeShift_ME11b_odd_layer1.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/CSCconsistency_2to1_SlopeShift_ME21_even_layer1.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/CSCconsistency_2to1_SlopeShift_ME21_odd_layer1.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/CSCconsistency_3to1_SlopeShift_ME21_even_layer1.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/CSCconsistency_3to1_SlopeShift_ME21_odd_layer1.txt", ), # lookup tables for the GEM-CSC slope correction gemCscSlopeCosiCorrectionFiles = cms.vstring( - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/GEMCSCconsistentSlopeCorr_ME11_even_GE11_layer1.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/GEMCSCconsistentSlopeCorr_ME11_even_GE11_layer2.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/GEMCSCconsistentSlopeCorr_ME11_odd_GE11_layer1.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/GEMCSCconsistentSlopeCorr_ME11_odd_GE11_layer2.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/GEMCSCconsistentSlopeCorr_ME11a_even_layer1.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/GEMCSCconsistentSlopeCorr_ME11b_even_layer1.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/GEMCSCconsistentSlopeCorr_ME21_even_layer1.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/GEMCSCconsistentSlopeCorr_ME11a_odd_layer1.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/GEMCSCconsistentSlopeCorr_ME11b_odd_layer1.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/SlopeCorrection/FacingChambers/GEMCSCconsistentSlopeCorr_ME21_odd_layer1.txt", ), # convert differences in 1/8-strip numbers between GEM and CSC to Run-3 slopes - esDiffToSlopeME1aFiles = cms.vstring( - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/GEMCSCLUT_es_diff_slope_L1_ME1a_even.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/GEMCSCLUT_es_diff_slope_L1_ME1a_odd.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/GEMCSCLUT_es_diff_slope_L2_ME1a_even.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/GEMCSCLUT_es_diff_slope_L2_ME1a_odd.txt", - ), - esDiffToSlopeME1bFiles = cms.vstring( - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/GEMCSCLUT_es_diff_slope_L1_ME1b_even.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/GEMCSCLUT_es_diff_slope_L1_ME1b_odd.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/GEMCSCLUT_es_diff_slope_L2_ME1b_even.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/GEMCSCLUT_es_diff_slope_L2_ME1b_odd.txt", + esDiffToSlopeME11aFiles = cms.vstring( + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/SlopeAmendment_ME11a_even_GEMlayer1.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/SlopeAmendment_ME11a_odd_GEMlayer1.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/SlopeAmendment_ME11a_even_GEMlayer2.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/SlopeAmendment_ME11a_odd_GEMlayer2.txt", + ), + esDiffToSlopeME11bFiles = cms.vstring( + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/SlopeAmendment_ME11b_even_GEMlayer1.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/SlopeAmendment_ME11b_odd_GEMlayer1.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/SlopeAmendment_ME11b_even_GEMlayer2.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/SlopeAmendment_ME11b_odd_GEMlayer2.txt", ), esDiffToSlopeME21Files = cms.vstring( - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/GEMCSCLUT_es_diff_slope_L1_ME21_even.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/GEMCSCLUT_es_diff_slope_L1_ME21_odd.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/GEMCSCLUT_es_diff_slope_L2_ME21_even.txt", - "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/GEMCSCLUT_es_diff_slope_L2_ME21_odd.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/SlopeAmendment_ME21_even_GEMlayer1.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/SlopeAmendment_ME21_odd_GEMlayer1.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/SlopeAmendment_ME21_even_GEMlayer2.txt", + "L1Trigger/CSCTriggerPrimitives/data/GEMCSC/BendingAngle/SlopeAmendment_ME21_odd_GEMlayer2.txt", ), ) diff --git a/CondFormats/CSCObjects/interface/CSCL1TPLookupTableME11ILT.h b/CondFormats/CSCObjects/interface/CSCL1TPLookupTableME11ILT.h index f6d530d30afe9..40338fb5c21df 100644 --- a/CondFormats/CSCObjects/interface/CSCL1TPLookupTableME11ILT.h +++ b/CondFormats/CSCObjects/interface/CSCL1TPLookupTableME11ILT.h @@ -13,142 +13,139 @@ class CSCL1TPLookupTableME11ILT { typedef std::vector t_lut; // setters - void set_GEM_pad_CSC_hs_ME1b_even(t_lut lut); - void set_GEM_pad_CSC_hs_ME1a_even(t_lut lut); - void set_GEM_pad_CSC_hs_ME1b_odd(t_lut lut); - void set_GEM_pad_CSC_hs_ME1a_odd(t_lut lut); - - void set_GEM_pad_CSC_es_ME1b_even(t_lut lut); - void set_GEM_pad_CSC_es_ME1a_even(t_lut lut); - void set_GEM_pad_CSC_es_ME1b_odd(t_lut lut); - void set_GEM_pad_CSC_es_ME1a_odd(t_lut lut); - - void set_GEM_roll_L1_CSC_min_wg_ME11_even(t_lut lut); - void set_GEM_roll_L1_CSC_max_wg_ME11_even(t_lut lut); - void set_GEM_roll_L1_CSC_min_wg_ME11_odd(t_lut lut); - void set_GEM_roll_L1_CSC_max_wg_ME11_odd(t_lut lut); - - void set_GEM_roll_L2_CSC_min_wg_ME11_even(t_lut lut); - void set_GEM_roll_L2_CSC_max_wg_ME11_even(t_lut lut); - void set_GEM_roll_L2_CSC_min_wg_ME11_odd(t_lut lut); - void set_GEM_roll_L2_CSC_max_wg_ME11_odd(t_lut lut); + void set_GEM_pad_CSC_es_ME11b_even(t_lut lut); + void set_GEM_pad_CSC_es_ME11a_even(t_lut lut); + void set_GEM_pad_CSC_es_ME11b_odd(t_lut lut); + void set_GEM_pad_CSC_es_ME11a_odd(t_lut lut); + + void set_GEM_roll_CSC_min_wg_ME11_even(t_lut lut); + void set_GEM_roll_CSC_max_wg_ME11_even(t_lut lut); + void set_GEM_roll_CSC_min_wg_ME11_odd(t_lut lut); + void set_GEM_roll_CSC_max_wg_ME11_odd(t_lut lut); // GEM-CSC trigger: slope correction - void set_CSC_slope_cosi_2to1_L1_ME11_even(t_lut lut); - void set_CSC_slope_cosi_2to1_L1_ME11_odd(t_lut lut); - void set_CSC_slope_cosi_3to1_L1_ME11_even(t_lut lut); - void set_CSC_slope_cosi_3to1_L1_ME11_odd(t_lut lut); - - void set_CSC_slope_cosi_corr_L1_ME11_even(t_lut lut); - void set_CSC_slope_cosi_corr_L2_ME11_even(t_lut lut); - void set_CSC_slope_cosi_corr_L1_ME11_odd(t_lut lut); - void set_CSC_slope_cosi_corr_L2_ME11_odd(t_lut lut); - - void set_CSC_slope_corr_L1_ME11_even(t_lut lut); - void set_CSC_slope_corr_L2_ME11_even(t_lut lut); - void set_CSC_slope_corr_L1_ME11_odd(t_lut lut); - void set_CSC_slope_corr_L2_ME11_odd(t_lut lut); - - void set_es_diff_slope_L1_ME1a_even(t_lut lut); - void set_es_diff_slope_L2_ME1a_even(t_lut lut); - void set_es_diff_slope_L1_ME1a_odd(t_lut lut); - void set_es_diff_slope_L2_ME1a_odd(t_lut lut); - void set_es_diff_slope_L1_ME1b_even(t_lut lut); - void set_es_diff_slope_L2_ME1b_even(t_lut lut); - void set_es_diff_slope_L1_ME1b_odd(t_lut lut); - void set_es_diff_slope_L2_ME1b_odd(t_lut lut); + void set_CSC_slope_cosi_2to1_L1_ME11a_even(t_lut lut); + void set_CSC_slope_cosi_2to1_L1_ME11a_odd(t_lut lut); + void set_CSC_slope_cosi_3to1_L1_ME11a_even(t_lut lut); + void set_CSC_slope_cosi_3to1_L1_ME11a_odd(t_lut lut); + + void set_CSC_slope_cosi_2to1_L1_ME11b_even(t_lut lut); + void set_CSC_slope_cosi_2to1_L1_ME11b_odd(t_lut lut); + void set_CSC_slope_cosi_3to1_L1_ME11b_even(t_lut lut); + void set_CSC_slope_cosi_3to1_L1_ME11b_odd(t_lut lut); + + void set_CSC_slope_cosi_corr_L1_ME11a_even(t_lut lut); + void set_CSC_slope_cosi_corr_L1_ME11b_even(t_lut lut); + void set_CSC_slope_cosi_corr_L1_ME11a_odd(t_lut lut); + void set_CSC_slope_cosi_corr_L1_ME11b_odd(t_lut lut); + + void set_CSC_slope_corr_L1_ME11a_even(t_lut lut); + void set_CSC_slope_corr_L1_ME11b_even(t_lut lut); + void set_CSC_slope_corr_L1_ME11a_odd(t_lut lut); + void set_CSC_slope_corr_L1_ME11b_odd(t_lut lut); + void set_CSC_slope_corr_L2_ME11a_even(t_lut lut); + void set_CSC_slope_corr_L2_ME11b_even(t_lut lut); + void set_CSC_slope_corr_L2_ME11a_odd(t_lut lut); + void set_CSC_slope_corr_L2_ME11b_odd(t_lut lut); + + void set_es_diff_slope_L1_ME11a_even(t_lut lut); + void set_es_diff_slope_L1_ME11a_odd(t_lut lut); + void set_es_diff_slope_L1_ME11b_even(t_lut lut); + void set_es_diff_slope_L1_ME11b_odd(t_lut lut); + void set_es_diff_slope_L2_ME11a_even(t_lut lut); + void set_es_diff_slope_L2_ME11a_odd(t_lut lut); + void set_es_diff_slope_L2_ME11b_even(t_lut lut); + void set_es_diff_slope_L2_ME11b_odd(t_lut lut); // getters - unsigned GEM_pad_CSC_hs_ME1b_even(unsigned pad) const; - unsigned GEM_pad_CSC_hs_ME1a_even(unsigned pad) const; - unsigned GEM_pad_CSC_hs_ME1b_odd(unsigned pad) const; - unsigned GEM_pad_CSC_hs_ME1a_odd(unsigned pad) const; - - unsigned GEM_pad_CSC_es_ME1b_even(unsigned pad) const; - unsigned GEM_pad_CSC_es_ME1a_even(unsigned pad) const; - unsigned GEM_pad_CSC_es_ME1b_odd(unsigned pad) const; - unsigned GEM_pad_CSC_es_ME1a_odd(unsigned pad) const; - - unsigned GEM_roll_L1_CSC_min_wg_ME11_even(unsigned roll) const; - unsigned GEM_roll_L1_CSC_max_wg_ME11_even(unsigned roll) const; - unsigned GEM_roll_L1_CSC_min_wg_ME11_odd(unsigned roll) const; - unsigned GEM_roll_L1_CSC_max_wg_ME11_odd(unsigned roll) const; - - unsigned GEM_roll_L2_CSC_min_wg_ME11_even(unsigned roll) const; - unsigned GEM_roll_L2_CSC_max_wg_ME11_even(unsigned roll) const; - unsigned GEM_roll_L2_CSC_min_wg_ME11_odd(unsigned roll) const; - unsigned GEM_roll_L2_CSC_max_wg_ME11_odd(unsigned roll) const; - - // GEM-CSC trigger: slope correction - unsigned CSC_slope_cosi_2to1_L1_ME11_even(unsigned channel) const; - unsigned CSC_slope_cosi_2to1_L1_ME11_odd(unsigned channel) const; - unsigned CSC_slope_cosi_3to1_L1_ME11_even(unsigned channel) const; - unsigned CSC_slope_cosi_3to1_L1_ME11_odd(unsigned channel) const; + unsigned GEM_pad_CSC_es_ME11b_even(unsigned pad) const; + unsigned GEM_pad_CSC_es_ME11a_even(unsigned pad) const; + unsigned GEM_pad_CSC_es_ME11b_odd(unsigned pad) const; + unsigned GEM_pad_CSC_es_ME11a_odd(unsigned pad) const; - unsigned CSC_slope_cosi_corr_L1_ME11_even(unsigned channel) const; - unsigned CSC_slope_cosi_corr_L2_ME11_even(unsigned channel) const; - unsigned CSC_slope_cosi_corr_L1_ME11_odd(unsigned channel) const; - unsigned CSC_slope_cosi_corr_L2_ME11_odd(unsigned channel) const; + unsigned GEM_roll_CSC_min_wg_ME11_even(unsigned roll) const; + unsigned GEM_roll_CSC_max_wg_ME11_even(unsigned roll) const; + unsigned GEM_roll_CSC_min_wg_ME11_odd(unsigned roll) const; + unsigned GEM_roll_CSC_max_wg_ME11_odd(unsigned roll) const; - unsigned CSC_slope_corr_L1_ME11_even(unsigned channel) const; - unsigned CSC_slope_corr_L2_ME11_even(unsigned channel) const; - unsigned CSC_slope_corr_L1_ME11_odd(unsigned channel) const; - unsigned CSC_slope_corr_L2_ME11_odd(unsigned channel) const; + // GEM-CSC trigger: slope correction + unsigned CSC_slope_cosi_2to1_L1_ME11a_even(unsigned channel) const; + unsigned CSC_slope_cosi_2to1_L1_ME11a_odd(unsigned channel) const; + unsigned CSC_slope_cosi_3to1_L1_ME11a_even(unsigned channel) const; + unsigned CSC_slope_cosi_3to1_L1_ME11a_odd(unsigned channel) const; + + unsigned CSC_slope_cosi_2to1_L1_ME11b_even(unsigned channel) const; + unsigned CSC_slope_cosi_2to1_L1_ME11b_odd(unsigned channel) const; + unsigned CSC_slope_cosi_3to1_L1_ME11b_even(unsigned channel) const; + unsigned CSC_slope_cosi_3to1_L1_ME11b_odd(unsigned channel) const; + + unsigned CSC_slope_cosi_corr_L1_ME11a_even(unsigned channel) const; + unsigned CSC_slope_cosi_corr_L1_ME11b_even(unsigned channel) const; + unsigned CSC_slope_cosi_corr_L1_ME11a_odd(unsigned channel) const; + unsigned CSC_slope_cosi_corr_L1_ME11b_odd(unsigned channel) const; + + unsigned CSC_slope_corr_L1_ME11a_even(unsigned channel) const; + unsigned CSC_slope_corr_L1_ME11b_even(unsigned channel) const; + unsigned CSC_slope_corr_L1_ME11a_odd(unsigned channel) const; + unsigned CSC_slope_corr_L1_ME11b_odd(unsigned channel) const; + unsigned CSC_slope_corr_L2_ME11a_even(unsigned channel) const; + unsigned CSC_slope_corr_L2_ME11b_even(unsigned channel) const; + unsigned CSC_slope_corr_L2_ME11a_odd(unsigned channel) const; + unsigned CSC_slope_corr_L2_ME11b_odd(unsigned channel) const; // GEM-CSC trigger: 1/8-strip difference to slope - unsigned es_diff_slope_L1_ME1a_even(unsigned es_diff) const; - unsigned es_diff_slope_L2_ME1a_even(unsigned es_diff) const; - unsigned es_diff_slope_L1_ME1a_odd(unsigned es_diff) const; - unsigned es_diff_slope_L2_ME1a_odd(unsigned es_diff) const; - unsigned es_diff_slope_L1_ME1b_even(unsigned es_diff) const; - unsigned es_diff_slope_L2_ME1b_even(unsigned es_diff) const; - unsigned es_diff_slope_L1_ME1b_odd(unsigned es_diff) const; - unsigned es_diff_slope_L2_ME1b_odd(unsigned es_diff) const; + unsigned es_diff_slope_L1_ME11a_even(unsigned es_diff) const; + unsigned es_diff_slope_L1_ME11a_odd(unsigned es_diff) const; + unsigned es_diff_slope_L1_ME11b_even(unsigned es_diff) const; + unsigned es_diff_slope_L1_ME11b_odd(unsigned es_diff) const; + unsigned es_diff_slope_L2_ME11a_even(unsigned es_diff) const; + unsigned es_diff_slope_L2_ME11a_odd(unsigned es_diff) const; + unsigned es_diff_slope_L2_ME11b_even(unsigned es_diff) const; + unsigned es_diff_slope_L2_ME11b_odd(unsigned es_diff) const; private: - t_lut GEM_pad_CSC_hs_ME1b_even_; - t_lut GEM_pad_CSC_hs_ME1a_even_; - t_lut GEM_pad_CSC_hs_ME1b_odd_; - t_lut GEM_pad_CSC_hs_ME1a_odd_; - - t_lut GEM_pad_CSC_es_ME1b_even_; - t_lut GEM_pad_CSC_es_ME1a_even_; - t_lut GEM_pad_CSC_es_ME1b_odd_; - t_lut GEM_pad_CSC_es_ME1a_odd_; - - t_lut GEM_roll_L1_CSC_min_wg_ME11_even_; - t_lut GEM_roll_L1_CSC_max_wg_ME11_even_; - t_lut GEM_roll_L1_CSC_min_wg_ME11_odd_; - t_lut GEM_roll_L1_CSC_max_wg_ME11_odd_; - - t_lut GEM_roll_L2_CSC_min_wg_ME11_even_; - t_lut GEM_roll_L2_CSC_max_wg_ME11_even_; - t_lut GEM_roll_L2_CSC_min_wg_ME11_odd_; - t_lut GEM_roll_L2_CSC_max_wg_ME11_odd_; - - t_lut CSC_slope_cosi_2to1_L1_ME11_even_; - t_lut CSC_slope_cosi_2to1_L1_ME11_odd_; - t_lut CSC_slope_cosi_3to1_L1_ME11_even_; - t_lut CSC_slope_cosi_3to1_L1_ME11_odd_; - - t_lut CSC_slope_cosi_corr_L1_ME11_even_; - t_lut CSC_slope_cosi_corr_L2_ME11_even_; - t_lut CSC_slope_cosi_corr_L1_ME11_odd_; - t_lut CSC_slope_cosi_corr_L2_ME11_odd_; - - t_lut CSC_slope_corr_L1_ME11_even_; - t_lut CSC_slope_corr_L2_ME11_even_; - t_lut CSC_slope_corr_L1_ME11_odd_; - t_lut CSC_slope_corr_L2_ME11_odd_; - - t_lut es_diff_slope_L1_ME1a_even_; - t_lut es_diff_slope_L2_ME1a_even_; - t_lut es_diff_slope_L1_ME1a_odd_; - t_lut es_diff_slope_L2_ME1a_odd_; - t_lut es_diff_slope_L1_ME1b_even_; - t_lut es_diff_slope_L2_ME1b_even_; - t_lut es_diff_slope_L1_ME1b_odd_; - t_lut es_diff_slope_L2_ME1b_odd_; + t_lut GEM_pad_CSC_es_ME11b_even_; + t_lut GEM_pad_CSC_es_ME11a_even_; + t_lut GEM_pad_CSC_es_ME11b_odd_; + t_lut GEM_pad_CSC_es_ME11a_odd_; + + t_lut GEM_roll_CSC_min_wg_ME11_even_; + t_lut GEM_roll_CSC_max_wg_ME11_even_; + t_lut GEM_roll_CSC_min_wg_ME11_odd_; + t_lut GEM_roll_CSC_max_wg_ME11_odd_; + + t_lut CSC_slope_cosi_2to1_L1_ME11a_even_; + t_lut CSC_slope_cosi_2to1_L1_ME11a_odd_; + t_lut CSC_slope_cosi_3to1_L1_ME11a_even_; + t_lut CSC_slope_cosi_3to1_L1_ME11a_odd_; + + t_lut CSC_slope_cosi_2to1_L1_ME11b_even_; + t_lut CSC_slope_cosi_2to1_L1_ME11b_odd_; + t_lut CSC_slope_cosi_3to1_L1_ME11b_even_; + t_lut CSC_slope_cosi_3to1_L1_ME11b_odd_; + + t_lut CSC_slope_cosi_corr_L1_ME11a_even_; + t_lut CSC_slope_cosi_corr_L1_ME11b_even_; + t_lut CSC_slope_cosi_corr_L1_ME11a_odd_; + t_lut CSC_slope_cosi_corr_L1_ME11b_odd_; + + t_lut CSC_slope_corr_L1_ME11a_even_; + t_lut CSC_slope_corr_L1_ME11b_even_; + t_lut CSC_slope_corr_L1_ME11a_odd_; + t_lut CSC_slope_corr_L1_ME11b_odd_; + t_lut CSC_slope_corr_L2_ME11a_even_; + t_lut CSC_slope_corr_L2_ME11b_even_; + t_lut CSC_slope_corr_L2_ME11a_odd_; + t_lut CSC_slope_corr_L2_ME11b_odd_; + + t_lut es_diff_slope_L1_ME11a_even_; + t_lut es_diff_slope_L1_ME11a_odd_; + t_lut es_diff_slope_L1_ME11b_even_; + t_lut es_diff_slope_L1_ME11b_odd_; + t_lut es_diff_slope_L2_ME11a_even_; + t_lut es_diff_slope_L2_ME11a_odd_; + t_lut es_diff_slope_L2_ME11b_even_; + t_lut es_diff_slope_L2_ME11b_odd_; COND_SERIALIZABLE; }; diff --git a/CondFormats/CSCObjects/interface/CSCL1TPLookupTableME21ILT.h b/CondFormats/CSCObjects/interface/CSCL1TPLookupTableME21ILT.h index 733581f13cf44..1db24a17e431c 100644 --- a/CondFormats/CSCObjects/interface/CSCL1TPLookupTableME21ILT.h +++ b/CondFormats/CSCObjects/interface/CSCL1TPLookupTableME21ILT.h @@ -13,9 +13,6 @@ class CSCL1TPLookupTableME21ILT { typedef std::vector t_lut; // setters - void set_GEM_pad_CSC_hs_ME21_even(t_lut lut); - void set_GEM_pad_CSC_hs_ME21_odd(t_lut lut); - void set_GEM_pad_CSC_es_ME21_even(t_lut lut); void set_GEM_pad_CSC_es_ME21_odd(t_lut lut); @@ -30,14 +27,24 @@ class CSCL1TPLookupTableME21ILT { void set_GEM_roll_L2_CSC_max_wg_ME21_odd(t_lut lut); void set_es_diff_slope_L1_ME21_even(t_lut lut); - void set_es_diff_slope_L2_ME21_even(t_lut lut); void set_es_diff_slope_L1_ME21_odd(t_lut lut); + void set_es_diff_slope_L2_ME21_even(t_lut lut); void set_es_diff_slope_L2_ME21_odd(t_lut lut); - // getters - unsigned GEM_pad_CSC_hs_ME21_even(unsigned pad) const; - unsigned GEM_pad_CSC_hs_ME21_odd(unsigned pad) const; + void set_CSC_slope_cosi_2to1_L1_ME21_even(t_lut lut); + void set_CSC_slope_cosi_2to1_L1_ME21_odd(t_lut lut); + void set_CSC_slope_cosi_3to1_L1_ME21_even(t_lut lut); + void set_CSC_slope_cosi_3to1_L1_ME21_odd(t_lut lut); + + void set_CSC_slope_cosi_corr_L1_ME21_even(t_lut lut); + void set_CSC_slope_cosi_corr_L1_ME21_odd(t_lut lut); + void set_CSC_slope_corr_L1_ME21_even(t_lut lut); + void set_CSC_slope_corr_L1_ME21_odd(t_lut lut); + void set_CSC_slope_corr_L2_ME21_even(t_lut lut); + void set_CSC_slope_corr_L2_ME21_odd(t_lut lut); + + // getters unsigned GEM_pad_CSC_es_ME21_even(unsigned pad) const; unsigned GEM_pad_CSC_es_ME21_odd(unsigned pad) const; @@ -51,16 +58,26 @@ class CSCL1TPLookupTableME21ILT { unsigned GEM_roll_L2_CSC_min_wg_ME21_odd(unsigned roll) const; unsigned GEM_roll_L2_CSC_max_wg_ME21_odd(unsigned roll) const; + unsigned CSC_slope_cosi_2to1_L1_ME21_even(unsigned slope) const; + unsigned CSC_slope_cosi_2to1_L1_ME21_odd(unsigned slope) const; + unsigned CSC_slope_cosi_3to1_L1_ME21_even(unsigned slope) const; + unsigned CSC_slope_cosi_3to1_L1_ME21_odd(unsigned slope) const; + + unsigned CSC_slope_cosi_corr_L1_ME21_even(unsigned slope) const; + unsigned CSC_slope_cosi_corr_L1_ME21_odd(unsigned slope) const; + + unsigned CSC_slope_corr_L1_ME21_even(unsigned slope) const; + unsigned CSC_slope_corr_L1_ME21_odd(unsigned slope) const; + unsigned CSC_slope_corr_L2_ME21_even(unsigned slope) const; + unsigned CSC_slope_corr_L2_ME21_odd(unsigned slope) const; + // GEM-CSC trigger: 1/8-strip difference to slope unsigned es_diff_slope_L1_ME21_even(unsigned es_diff) const; - unsigned es_diff_slope_L2_ME21_even(unsigned es_diff) const; unsigned es_diff_slope_L1_ME21_odd(unsigned es_diff) const; + unsigned es_diff_slope_L2_ME21_even(unsigned es_diff) const; unsigned es_diff_slope_L2_ME21_odd(unsigned es_diff) const; private: - std::vector GEM_pad_CSC_hs_ME21_even_; - std::vector GEM_pad_CSC_hs_ME21_odd_; - std::vector GEM_pad_CSC_es_ME21_even_; std::vector GEM_pad_CSC_es_ME21_odd_; @@ -74,9 +91,22 @@ class CSCL1TPLookupTableME21ILT { std::vector GEM_roll_L2_CSC_min_wg_ME21_odd_; std::vector GEM_roll_L2_CSC_max_wg_ME21_odd_; + std::vector CSC_slope_cosi_2to1_L1_ME21_even_; + std::vector CSC_slope_cosi_2to1_L1_ME21_odd_; + std::vector CSC_slope_cosi_3to1_L1_ME21_even_; + std::vector CSC_slope_cosi_3to1_L1_ME21_odd_; + + std::vector CSC_slope_cosi_corr_L1_ME21_even_; + std::vector CSC_slope_cosi_corr_L1_ME21_odd_; + + std::vector CSC_slope_corr_L1_ME21_even_; + std::vector CSC_slope_corr_L1_ME21_odd_; + std::vector CSC_slope_corr_L2_ME21_even_; + std::vector CSC_slope_corr_L2_ME21_odd_; + std::vector es_diff_slope_L1_ME21_even_; - std::vector es_diff_slope_L2_ME21_even_; std::vector es_diff_slope_L1_ME21_odd_; + std::vector es_diff_slope_L2_ME21_even_; std::vector es_diff_slope_L2_ME21_odd_; COND_SERIALIZABLE; diff --git a/CondFormats/CSCObjects/src/CSCL1TPLookupTableME11ILT.cc b/CondFormats/CSCObjects/src/CSCL1TPLookupTableME11ILT.cc index c0dab08691faf..ca34946e58f53 100644 --- a/CondFormats/CSCObjects/src/CSCL1TPLookupTableME11ILT.cc +++ b/CondFormats/CSCObjects/src/CSCL1TPLookupTableME11ILT.cc @@ -1,321 +1,333 @@ #include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableME11ILT.h" CSCL1TPLookupTableME11ILT::CSCL1TPLookupTableME11ILT() - : GEM_pad_CSC_hs_ME1b_even_(0), - GEM_pad_CSC_hs_ME1a_even_(0), - GEM_pad_CSC_hs_ME1b_odd_(0), - GEM_pad_CSC_hs_ME1a_odd_(0), - - GEM_pad_CSC_es_ME1b_even_(0), - GEM_pad_CSC_es_ME1a_even_(0), - GEM_pad_CSC_es_ME1b_odd_(0), - GEM_pad_CSC_es_ME1a_odd_(0), - - GEM_roll_L1_CSC_min_wg_ME11_even_(0), - GEM_roll_L1_CSC_max_wg_ME11_even_(0), - GEM_roll_L1_CSC_min_wg_ME11_odd_(0), - GEM_roll_L1_CSC_max_wg_ME11_odd_(0), - - GEM_roll_L2_CSC_min_wg_ME11_even_(0), - GEM_roll_L2_CSC_max_wg_ME11_even_(0), - GEM_roll_L2_CSC_min_wg_ME11_odd_(0), - GEM_roll_L2_CSC_max_wg_ME11_odd_(0), - - CSC_slope_cosi_2to1_L1_ME11_even_(0), - CSC_slope_cosi_2to1_L1_ME11_odd_(0), - CSC_slope_cosi_3to1_L1_ME11_even_(0), - CSC_slope_cosi_3to1_L1_ME11_odd_(0), - - CSC_slope_cosi_corr_L1_ME11_even_(0), - CSC_slope_cosi_corr_L2_ME11_even_(0), - CSC_slope_cosi_corr_L1_ME11_odd_(0), - CSC_slope_cosi_corr_L2_ME11_odd_(0), - - CSC_slope_corr_L1_ME11_even_(0), - CSC_slope_corr_L2_ME11_even_(0), - CSC_slope_corr_L1_ME11_odd_(0), - CSC_slope_corr_L2_ME11_odd_(0), - - es_diff_slope_L1_ME1a_even_(0), - es_diff_slope_L2_ME1a_even_(0), - es_diff_slope_L1_ME1a_odd_(0), - es_diff_slope_L2_ME1a_odd_(0), - es_diff_slope_L1_ME1b_even_(0), - es_diff_slope_L2_ME1b_even_(0), - es_diff_slope_L1_ME1b_odd_(0), - es_diff_slope_L2_ME1b_odd_(0) {} + : GEM_pad_CSC_es_ME11b_even_(0), + GEM_pad_CSC_es_ME11a_even_(0), + GEM_pad_CSC_es_ME11b_odd_(0), + GEM_pad_CSC_es_ME11a_odd_(0), + + GEM_roll_CSC_min_wg_ME11_even_(0), + GEM_roll_CSC_max_wg_ME11_even_(0), + GEM_roll_CSC_min_wg_ME11_odd_(0), + GEM_roll_CSC_max_wg_ME11_odd_(0), + + CSC_slope_cosi_2to1_L1_ME11a_even_(0), + CSC_slope_cosi_2to1_L1_ME11a_odd_(0), + CSC_slope_cosi_3to1_L1_ME11a_even_(0), + CSC_slope_cosi_3to1_L1_ME11a_odd_(0), + + CSC_slope_cosi_2to1_L1_ME11b_even_(0), + CSC_slope_cosi_2to1_L1_ME11b_odd_(0), + CSC_slope_cosi_3to1_L1_ME11b_even_(0), + CSC_slope_cosi_3to1_L1_ME11b_odd_(0), + + CSC_slope_cosi_corr_L1_ME11a_even_(0), + CSC_slope_cosi_corr_L1_ME11b_even_(0), + CSC_slope_cosi_corr_L1_ME11a_odd_(0), + CSC_slope_cosi_corr_L1_ME11b_odd_(0), + + CSC_slope_corr_L1_ME11a_even_(0), + CSC_slope_corr_L1_ME11b_even_(0), + CSC_slope_corr_L1_ME11a_odd_(0), + CSC_slope_corr_L1_ME11b_odd_(0), + CSC_slope_corr_L2_ME11a_even_(0), + CSC_slope_corr_L2_ME11b_even_(0), + CSC_slope_corr_L2_ME11a_odd_(0), + CSC_slope_corr_L2_ME11b_odd_(0), + + es_diff_slope_L1_ME11a_even_(0), + es_diff_slope_L1_ME11a_odd_(0), + es_diff_slope_L1_ME11b_even_(0), + es_diff_slope_L1_ME11b_odd_(0), + es_diff_slope_L2_ME11a_even_(0), + es_diff_slope_L2_ME11a_odd_(0), + es_diff_slope_L2_ME11b_even_(0), + es_diff_slope_L2_ME11b_odd_(0) {} // GEM-CSC trigger: coordinate conversion -void CSCL1TPLookupTableME11ILT::set_GEM_pad_CSC_hs_ME1b_even(t_lut lut) { GEM_pad_CSC_hs_ME1b_even_ = std::move(lut); } +void CSCL1TPLookupTableME11ILT::set_GEM_pad_CSC_es_ME11b_even(t_lut lut) { + GEM_pad_CSC_es_ME11b_even_ = std::move(lut); +} -void CSCL1TPLookupTableME11ILT::set_GEM_pad_CSC_hs_ME1a_even(t_lut lut) { GEM_pad_CSC_hs_ME1a_even_ = std::move(lut); } +void CSCL1TPLookupTableME11ILT::set_GEM_pad_CSC_es_ME11a_even(t_lut lut) { + GEM_pad_CSC_es_ME11a_even_ = std::move(lut); +} -void CSCL1TPLookupTableME11ILT::set_GEM_pad_CSC_hs_ME1b_odd(t_lut lut) { GEM_pad_CSC_hs_ME1b_odd_ = std::move(lut); } +void CSCL1TPLookupTableME11ILT::set_GEM_pad_CSC_es_ME11b_odd(t_lut lut) { GEM_pad_CSC_es_ME11b_odd_ = std::move(lut); } -void CSCL1TPLookupTableME11ILT::set_GEM_pad_CSC_hs_ME1a_odd(t_lut lut) { GEM_pad_CSC_hs_ME1a_odd_ = std::move(lut); } +void CSCL1TPLookupTableME11ILT::set_GEM_pad_CSC_es_ME11a_odd(t_lut lut) { GEM_pad_CSC_es_ME11a_odd_ = std::move(lut); } -void CSCL1TPLookupTableME11ILT::set_GEM_pad_CSC_es_ME1b_even(t_lut lut) { GEM_pad_CSC_es_ME1b_even_ = std::move(lut); } +void CSCL1TPLookupTableME11ILT::set_GEM_roll_CSC_min_wg_ME11_even(t_lut lut) { + GEM_roll_CSC_min_wg_ME11_even_ = std::move(lut); +} -void CSCL1TPLookupTableME11ILT::set_GEM_pad_CSC_es_ME1a_even(t_lut lut) { GEM_pad_CSC_es_ME1a_even_ = std::move(lut); } +void CSCL1TPLookupTableME11ILT::set_GEM_roll_CSC_max_wg_ME11_even(t_lut lut) { + GEM_roll_CSC_max_wg_ME11_even_ = std::move(lut); +} -void CSCL1TPLookupTableME11ILT::set_GEM_pad_CSC_es_ME1b_odd(t_lut lut) { GEM_pad_CSC_es_ME1b_odd_ = std::move(lut); } +void CSCL1TPLookupTableME11ILT::set_GEM_roll_CSC_min_wg_ME11_odd(t_lut lut) { + GEM_roll_CSC_min_wg_ME11_odd_ = std::move(lut); +} -void CSCL1TPLookupTableME11ILT::set_GEM_pad_CSC_es_ME1a_odd(t_lut lut) { GEM_pad_CSC_es_ME1a_odd_ = std::move(lut); } +void CSCL1TPLookupTableME11ILT::set_GEM_roll_CSC_max_wg_ME11_odd(t_lut lut) { + GEM_roll_CSC_max_wg_ME11_odd_ = std::move(lut); +} -void CSCL1TPLookupTableME11ILT::set_GEM_roll_L1_CSC_min_wg_ME11_even(t_lut lut) { - GEM_roll_L1_CSC_min_wg_ME11_even_ = std::move(lut); +// GEM-CSC trigger: slope correction +void CSCL1TPLookupTableME11ILT::set_CSC_slope_cosi_2to1_L1_ME11a_even(t_lut lut) { + CSC_slope_cosi_2to1_L1_ME11a_even_ = std::move(lut); } -void CSCL1TPLookupTableME11ILT::set_GEM_roll_L1_CSC_max_wg_ME11_even(t_lut lut) { - GEM_roll_L1_CSC_max_wg_ME11_even_ = std::move(lut); +void CSCL1TPLookupTableME11ILT::set_CSC_slope_cosi_2to1_L1_ME11b_even(t_lut lut) { + CSC_slope_cosi_2to1_L1_ME11b_even_ = std::move(lut); } -void CSCL1TPLookupTableME11ILT::set_GEM_roll_L1_CSC_min_wg_ME11_odd(t_lut lut) { - GEM_roll_L1_CSC_min_wg_ME11_odd_ = std::move(lut); +void CSCL1TPLookupTableME11ILT::set_CSC_slope_cosi_2to1_L1_ME11a_odd(t_lut lut) { + CSC_slope_cosi_2to1_L1_ME11a_odd_ = std::move(lut); } -void CSCL1TPLookupTableME11ILT::set_GEM_roll_L1_CSC_max_wg_ME11_odd(t_lut lut) { - GEM_roll_L1_CSC_max_wg_ME11_odd_ = std::move(lut); +void CSCL1TPLookupTableME11ILT::set_CSC_slope_cosi_2to1_L1_ME11b_odd(t_lut lut) { + CSC_slope_cosi_2to1_L1_ME11b_odd_ = std::move(lut); } -void CSCL1TPLookupTableME11ILT::set_GEM_roll_L2_CSC_min_wg_ME11_even(t_lut lut) { - GEM_roll_L2_CSC_min_wg_ME11_even_ = std::move(lut); +void CSCL1TPLookupTableME11ILT::set_CSC_slope_cosi_3to1_L1_ME11a_even(t_lut lut) { + CSC_slope_cosi_3to1_L1_ME11a_even_ = std::move(lut); } -void CSCL1TPLookupTableME11ILT::set_GEM_roll_L2_CSC_max_wg_ME11_even(t_lut lut) { - GEM_roll_L2_CSC_max_wg_ME11_even_ = std::move(lut); +void CSCL1TPLookupTableME11ILT::set_CSC_slope_cosi_3to1_L1_ME11b_even(t_lut lut) { + CSC_slope_cosi_3to1_L1_ME11b_even_ = std::move(lut); } -void CSCL1TPLookupTableME11ILT::set_GEM_roll_L2_CSC_min_wg_ME11_odd(t_lut lut) { - GEM_roll_L2_CSC_min_wg_ME11_odd_ = std::move(lut); +void CSCL1TPLookupTableME11ILT::set_CSC_slope_cosi_3to1_L1_ME11a_odd(t_lut lut) { + CSC_slope_cosi_3to1_L1_ME11a_odd_ = std::move(lut); } -void CSCL1TPLookupTableME11ILT::set_GEM_roll_L2_CSC_max_wg_ME11_odd(t_lut lut) { - GEM_roll_L2_CSC_max_wg_ME11_odd_ = std::move(lut); +void CSCL1TPLookupTableME11ILT::set_CSC_slope_cosi_3to1_L1_ME11b_odd(t_lut lut) { + CSC_slope_cosi_3to1_L1_ME11b_odd_ = std::move(lut); } -// GEM-CSC trigger: slope correction -void CSCL1TPLookupTableME11ILT::set_CSC_slope_cosi_2to1_L1_ME11_even(t_lut lut) { - CSC_slope_cosi_2to1_L1_ME11_even_ = std::move(lut); +void CSCL1TPLookupTableME11ILT::set_CSC_slope_cosi_corr_L1_ME11a_even(t_lut lut) { + CSC_slope_cosi_corr_L1_ME11a_even_ = std::move(lut); } -void CSCL1TPLookupTableME11ILT::set_CSC_slope_cosi_2to1_L1_ME11_odd(t_lut lut) { - CSC_slope_cosi_2to1_L1_ME11_odd_ = std::move(lut); +void CSCL1TPLookupTableME11ILT::set_CSC_slope_cosi_corr_L1_ME11b_even(t_lut lut) { + CSC_slope_cosi_corr_L1_ME11b_even_ = std::move(lut); } -void CSCL1TPLookupTableME11ILT::set_CSC_slope_cosi_3to1_L1_ME11_even(t_lut lut) { - CSC_slope_cosi_3to1_L1_ME11_even_ = std::move(lut); +void CSCL1TPLookupTableME11ILT::set_CSC_slope_cosi_corr_L1_ME11a_odd(t_lut lut) { + CSC_slope_cosi_corr_L1_ME11a_odd_ = std::move(lut); } -void CSCL1TPLookupTableME11ILT::set_CSC_slope_cosi_3to1_L1_ME11_odd(t_lut lut) { - CSC_slope_cosi_3to1_L1_ME11_odd_ = std::move(lut); +void CSCL1TPLookupTableME11ILT::set_CSC_slope_cosi_corr_L1_ME11b_odd(t_lut lut) { + CSC_slope_cosi_corr_L1_ME11b_odd_ = std::move(lut); } -void CSCL1TPLookupTableME11ILT::set_CSC_slope_cosi_corr_L1_ME11_even(t_lut lut) { - CSC_slope_cosi_corr_L1_ME11_even_ = std::move(lut); +void CSCL1TPLookupTableME11ILT::set_CSC_slope_corr_L1_ME11a_even(t_lut lut) { + CSC_slope_corr_L1_ME11a_even_ = std::move(lut); } -void CSCL1TPLookupTableME11ILT::set_CSC_slope_cosi_corr_L2_ME11_even(t_lut lut) { - CSC_slope_cosi_corr_L2_ME11_even_ = std::move(lut); + +void CSCL1TPLookupTableME11ILT::set_CSC_slope_corr_L1_ME11b_even(t_lut lut) { + CSC_slope_corr_L1_ME11b_even_ = std::move(lut); } -void CSCL1TPLookupTableME11ILT::set_CSC_slope_cosi_corr_L1_ME11_odd(t_lut lut) { - CSC_slope_cosi_corr_L1_ME11_odd_ = std::move(lut); +void CSCL1TPLookupTableME11ILT::set_CSC_slope_corr_L1_ME11a_odd(t_lut lut) { + CSC_slope_corr_L1_ME11a_odd_ = std::move(lut); } -void CSCL1TPLookupTableME11ILT::set_CSC_slope_cosi_corr_L2_ME11_odd(t_lut lut) { - CSC_slope_cosi_corr_L2_ME11_odd_ = std::move(lut); +void CSCL1TPLookupTableME11ILT::set_CSC_slope_corr_L1_ME11b_odd(t_lut lut) { + CSC_slope_corr_L1_ME11b_odd_ = std::move(lut); } -void CSCL1TPLookupTableME11ILT::set_CSC_slope_corr_L1_ME11_even(t_lut lut) { - CSC_slope_corr_L1_ME11_even_ = std::move(lut); +void CSCL1TPLookupTableME11ILT::set_es_diff_slope_L1_ME11a_even(t_lut lut) { + es_diff_slope_L1_ME11a_even_ = std::move(lut); } -void CSCL1TPLookupTableME11ILT::set_CSC_slope_corr_L2_ME11_even(t_lut lut) { - CSC_slope_corr_L2_ME11_even_ = std::move(lut); +void CSCL1TPLookupTableME11ILT::set_es_diff_slope_L1_ME11a_odd(t_lut lut) { + es_diff_slope_L1_ME11a_odd_ = std::move(lut); } -void CSCL1TPLookupTableME11ILT::set_CSC_slope_corr_L1_ME11_odd(t_lut lut) { - CSC_slope_corr_L1_ME11_odd_ = std::move(lut); +void CSCL1TPLookupTableME11ILT::set_es_diff_slope_L1_ME11b_even(t_lut lut) { + es_diff_slope_L1_ME11b_even_ = std::move(lut); } -void CSCL1TPLookupTableME11ILT::set_CSC_slope_corr_L2_ME11_odd(t_lut lut) { - CSC_slope_corr_L2_ME11_odd_ = std::move(lut); +void CSCL1TPLookupTableME11ILT::set_es_diff_slope_L1_ME11b_odd(t_lut lut) { + es_diff_slope_L1_ME11b_odd_ = std::move(lut); } -void CSCL1TPLookupTableME11ILT::set_es_diff_slope_L1_ME1a_even(t_lut lut) { - es_diff_slope_L1_ME1a_even_ = std::move(lut); +void CSCL1TPLookupTableME11ILT::set_CSC_slope_corr_L2_ME11a_even(t_lut lut) { + CSC_slope_corr_L2_ME11a_even_ = std::move(lut); } -void CSCL1TPLookupTableME11ILT::set_es_diff_slope_L2_ME1a_even(t_lut lut) { - es_diff_slope_L2_ME1a_even_ = std::move(lut); +void CSCL1TPLookupTableME11ILT::set_CSC_slope_corr_L2_ME11b_even(t_lut lut) { + CSC_slope_corr_L2_ME11b_even_ = std::move(lut); } -void CSCL1TPLookupTableME11ILT::set_es_diff_slope_L1_ME1a_odd(t_lut lut) { - es_diff_slope_L1_ME1a_odd_ = std::move(lut); +void CSCL1TPLookupTableME11ILT::set_CSC_slope_corr_L2_ME11a_odd(t_lut lut) { + CSC_slope_corr_L2_ME11a_odd_ = std::move(lut); } -void CSCL1TPLookupTableME11ILT::set_es_diff_slope_L2_ME1a_odd(t_lut lut) { - es_diff_slope_L2_ME1a_odd_ = std::move(lut); +void CSCL1TPLookupTableME11ILT::set_CSC_slope_corr_L2_ME11b_odd(t_lut lut) { + CSC_slope_corr_L2_ME11b_odd_ = std::move(lut); } -void CSCL1TPLookupTableME11ILT::set_es_diff_slope_L1_ME1b_even(t_lut lut) { - es_diff_slope_L1_ME1b_even_ = std::move(lut); +void CSCL1TPLookupTableME11ILT::set_es_diff_slope_L2_ME11a_even(t_lut lut) { + es_diff_slope_L2_ME11a_even_ = std::move(lut); } -void CSCL1TPLookupTableME11ILT::set_es_diff_slope_L2_ME1b_even(t_lut lut) { - es_diff_slope_L2_ME1b_even_ = std::move(lut); +void CSCL1TPLookupTableME11ILT::set_es_diff_slope_L2_ME11a_odd(t_lut lut) { + es_diff_slope_L2_ME11a_odd_ = std::move(lut); } -void CSCL1TPLookupTableME11ILT::set_es_diff_slope_L1_ME1b_odd(t_lut lut) { - es_diff_slope_L1_ME1b_odd_ = std::move(lut); +void CSCL1TPLookupTableME11ILT::set_es_diff_slope_L2_ME11b_even(t_lut lut) { + es_diff_slope_L2_ME11b_even_ = std::move(lut); } -void CSCL1TPLookupTableME11ILT::set_es_diff_slope_L2_ME1b_odd(t_lut lut) { - es_diff_slope_L2_ME1b_odd_ = std::move(lut); +void CSCL1TPLookupTableME11ILT::set_es_diff_slope_L2_ME11b_odd(t_lut lut) { + es_diff_slope_L2_ME11b_odd_ = std::move(lut); } // GEM-CSC trigger: coordinate conversion -unsigned CSCL1TPLookupTableME11ILT::GEM_pad_CSC_hs_ME1b_even(unsigned pad) const { - return GEM_pad_CSC_hs_ME1b_even_.at(pad); +unsigned CSCL1TPLookupTableME11ILT::GEM_pad_CSC_es_ME11b_even(unsigned pad) const { + return GEM_pad_CSC_es_ME11b_even_.at(pad); } -unsigned CSCL1TPLookupTableME11ILT::GEM_pad_CSC_hs_ME1a_even(unsigned pad) const { - return GEM_pad_CSC_hs_ME1a_even_.at(pad); +unsigned CSCL1TPLookupTableME11ILT::GEM_pad_CSC_es_ME11a_even(unsigned pad) const { + return GEM_pad_CSC_es_ME11a_even_.at(pad); } -unsigned CSCL1TPLookupTableME11ILT::GEM_pad_CSC_hs_ME1b_odd(unsigned pad) const { - return GEM_pad_CSC_hs_ME1b_odd_.at(pad); +unsigned CSCL1TPLookupTableME11ILT::GEM_pad_CSC_es_ME11b_odd(unsigned pad) const { + return GEM_pad_CSC_es_ME11b_odd_.at(pad); } -unsigned CSCL1TPLookupTableME11ILT::GEM_pad_CSC_hs_ME1a_odd(unsigned pad) const { - return GEM_pad_CSC_hs_ME1a_odd_.at(pad); +unsigned CSCL1TPLookupTableME11ILT::GEM_pad_CSC_es_ME11a_odd(unsigned pad) const { + return GEM_pad_CSC_es_ME11a_odd_.at(pad); } -unsigned CSCL1TPLookupTableME11ILT::GEM_pad_CSC_es_ME1b_even(unsigned pad) const { - return GEM_pad_CSC_es_ME1b_even_.at(pad); +unsigned CSCL1TPLookupTableME11ILT::GEM_roll_CSC_min_wg_ME11_even(unsigned roll) const { + return GEM_roll_CSC_min_wg_ME11_even_[roll]; } -unsigned CSCL1TPLookupTableME11ILT::GEM_pad_CSC_es_ME1a_even(unsigned pad) const { - return GEM_pad_CSC_es_ME1a_even_.at(pad); +unsigned CSCL1TPLookupTableME11ILT::GEM_roll_CSC_max_wg_ME11_even(unsigned roll) const { + return GEM_roll_CSC_max_wg_ME11_even_[roll]; } -unsigned CSCL1TPLookupTableME11ILT::GEM_pad_CSC_es_ME1b_odd(unsigned pad) const { - return GEM_pad_CSC_es_ME1b_odd_.at(pad); +unsigned CSCL1TPLookupTableME11ILT::GEM_roll_CSC_min_wg_ME11_odd(unsigned roll) const { + return GEM_roll_CSC_min_wg_ME11_odd_[roll]; } -unsigned CSCL1TPLookupTableME11ILT::GEM_pad_CSC_es_ME1a_odd(unsigned pad) const { - return GEM_pad_CSC_es_ME1a_odd_.at(pad); +unsigned CSCL1TPLookupTableME11ILT::GEM_roll_CSC_max_wg_ME11_odd(unsigned roll) const { + return GEM_roll_CSC_max_wg_ME11_odd_[roll]; } -unsigned CSCL1TPLookupTableME11ILT::GEM_roll_L1_CSC_min_wg_ME11_even(unsigned roll) const { - return GEM_roll_L1_CSC_min_wg_ME11_even_[roll]; +// GEM-CSC trigger: slope correction +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_cosi_2to1_L1_ME11a_even(unsigned slope) const { + return CSC_slope_cosi_2to1_L1_ME11a_even_[slope]; } -unsigned CSCL1TPLookupTableME11ILT::GEM_roll_L1_CSC_max_wg_ME11_even(unsigned roll) const { - return GEM_roll_L1_CSC_max_wg_ME11_even_[roll]; +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_cosi_2to1_L1_ME11b_even(unsigned slope) const { + return CSC_slope_cosi_2to1_L1_ME11b_even_[slope]; } -unsigned CSCL1TPLookupTableME11ILT::GEM_roll_L1_CSC_min_wg_ME11_odd(unsigned roll) const { - return GEM_roll_L1_CSC_min_wg_ME11_odd_[roll]; +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_cosi_2to1_L1_ME11a_odd(unsigned slope) const { + return CSC_slope_cosi_2to1_L1_ME11a_odd_[slope]; } -unsigned CSCL1TPLookupTableME11ILT::GEM_roll_L1_CSC_max_wg_ME11_odd(unsigned roll) const { - return GEM_roll_L1_CSC_max_wg_ME11_odd_[roll]; +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_cosi_2to1_L1_ME11b_odd(unsigned slope) const { + return CSC_slope_cosi_2to1_L1_ME11b_odd_[slope]; } -unsigned CSCL1TPLookupTableME11ILT::GEM_roll_L2_CSC_min_wg_ME11_even(unsigned roll) const { - return GEM_roll_L2_CSC_min_wg_ME11_even_[roll]; +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_cosi_3to1_L1_ME11a_even(unsigned slope) const { + return CSC_slope_cosi_3to1_L1_ME11a_even_[slope]; } -unsigned CSCL1TPLookupTableME11ILT::GEM_roll_L2_CSC_max_wg_ME11_even(unsigned roll) const { - return GEM_roll_L2_CSC_max_wg_ME11_even_[roll]; +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_cosi_3to1_L1_ME11b_even(unsigned slope) const { + return CSC_slope_cosi_3to1_L1_ME11b_even_[slope]; } -unsigned CSCL1TPLookupTableME11ILT::GEM_roll_L2_CSC_min_wg_ME11_odd(unsigned roll) const { - return GEM_roll_L2_CSC_min_wg_ME11_odd_[roll]; +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_cosi_3to1_L1_ME11a_odd(unsigned slope) const { + return CSC_slope_cosi_3to1_L1_ME11a_odd_[slope]; } -unsigned CSCL1TPLookupTableME11ILT::GEM_roll_L2_CSC_max_wg_ME11_odd(unsigned roll) const { - return GEM_roll_L2_CSC_max_wg_ME11_odd_[roll]; +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_cosi_3to1_L1_ME11b_odd(unsigned slope) const { + return CSC_slope_cosi_3to1_L1_ME11b_odd_[slope]; } -// GEM-CSC trigger: slope correction -unsigned CSCL1TPLookupTableME11ILT::CSC_slope_cosi_2to1_L1_ME11_even(unsigned slope) const { - return CSC_slope_cosi_2to1_L1_ME11_even_[slope]; +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_cosi_corr_L1_ME11a_even(unsigned slope) const { + return CSC_slope_cosi_corr_L1_ME11a_even_[slope]; } -unsigned CSCL1TPLookupTableME11ILT::CSC_slope_cosi_2to1_L1_ME11_odd(unsigned slope) const { - return CSC_slope_cosi_2to1_L1_ME11_odd_[slope]; +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_cosi_corr_L1_ME11b_even(unsigned slope) const { + return CSC_slope_cosi_corr_L1_ME11b_even_[slope]; } -unsigned CSCL1TPLookupTableME11ILT::CSC_slope_cosi_3to1_L1_ME11_even(unsigned slope) const { - return CSC_slope_cosi_3to1_L1_ME11_even_[slope]; +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_cosi_corr_L1_ME11a_odd(unsigned slope) const { + return CSC_slope_cosi_corr_L1_ME11a_odd_[slope]; } -unsigned CSCL1TPLookupTableME11ILT::CSC_slope_cosi_3to1_L1_ME11_odd(unsigned slope) const { - return CSC_slope_cosi_3to1_L1_ME11_odd_[slope]; +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_cosi_corr_L1_ME11b_odd(unsigned slope) const { + return CSC_slope_cosi_corr_L1_ME11b_odd_[slope]; } -unsigned CSCL1TPLookupTableME11ILT::CSC_slope_cosi_corr_L1_ME11_even(unsigned slope) const { - return CSC_slope_cosi_corr_L1_ME11_even_[slope]; +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_corr_L1_ME11a_even(unsigned slope) const { + return CSC_slope_corr_L1_ME11a_even_[slope]; } -unsigned CSCL1TPLookupTableME11ILT::CSC_slope_cosi_corr_L1_ME11_odd(unsigned slope) const { - return CSC_slope_cosi_corr_L1_ME11_odd_[slope]; +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_corr_L1_ME11b_even(unsigned slope) const { + return CSC_slope_corr_L1_ME11b_even_[slope]; } -unsigned CSCL1TPLookupTableME11ILT::CSC_slope_cosi_corr_L2_ME11_even(unsigned slope) const { - return CSC_slope_cosi_corr_L2_ME11_even_[slope]; +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_corr_L1_ME11a_odd(unsigned slope) const { + return CSC_slope_corr_L1_ME11a_odd_[slope]; } -unsigned CSCL1TPLookupTableME11ILT::CSC_slope_cosi_corr_L2_ME11_odd(unsigned slope) const { - return CSC_slope_cosi_corr_L2_ME11_odd_[slope]; +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_corr_L1_ME11b_odd(unsigned slope) const { + return CSC_slope_corr_L1_ME11b_odd_[slope]; } -unsigned CSCL1TPLookupTableME11ILT::CSC_slope_corr_L1_ME11_even(unsigned slope) const { - return CSC_slope_corr_L1_ME11_even_[slope]; +unsigned CSCL1TPLookupTableME11ILT::es_diff_slope_L1_ME11a_even(unsigned es_diff) const { + return es_diff_slope_L1_ME11a_even_[es_diff]; } -unsigned CSCL1TPLookupTableME11ILT::CSC_slope_corr_L1_ME11_odd(unsigned slope) const { - return CSC_slope_corr_L1_ME11_odd_[slope]; +unsigned CSCL1TPLookupTableME11ILT::es_diff_slope_L1_ME11a_odd(unsigned es_diff) const { + return es_diff_slope_L1_ME11a_odd_[es_diff]; } -unsigned CSCL1TPLookupTableME11ILT::CSC_slope_corr_L2_ME11_even(unsigned slope) const { - return CSC_slope_corr_L2_ME11_even_[slope]; +unsigned CSCL1TPLookupTableME11ILT::es_diff_slope_L1_ME11b_even(unsigned es_diff) const { + return es_diff_slope_L1_ME11b_even_[es_diff]; } -unsigned CSCL1TPLookupTableME11ILT::CSC_slope_corr_L2_ME11_odd(unsigned slope) const { - return CSC_slope_corr_L2_ME11_odd_[slope]; +unsigned CSCL1TPLookupTableME11ILT::es_diff_slope_L1_ME11b_odd(unsigned es_diff) const { + return es_diff_slope_L1_ME11b_odd_[es_diff]; } -unsigned CSCL1TPLookupTableME11ILT::es_diff_slope_L1_ME1a_even(unsigned es_diff) const { - return es_diff_slope_L1_ME1a_even_[es_diff]; +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_corr_L2_ME11a_even(unsigned slope) const { + return CSC_slope_corr_L2_ME11a_even_[slope]; } -unsigned CSCL1TPLookupTableME11ILT::es_diff_slope_L2_ME1a_even(unsigned es_diff) const { - return es_diff_slope_L2_ME1a_even_[es_diff]; +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_corr_L2_ME11b_even(unsigned slope) const { + return CSC_slope_corr_L2_ME11b_even_[slope]; } -unsigned CSCL1TPLookupTableME11ILT::es_diff_slope_L1_ME1a_odd(unsigned es_diff) const { - return es_diff_slope_L1_ME1a_odd_[es_diff]; +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_corr_L2_ME11a_odd(unsigned slope) const { + return CSC_slope_corr_L2_ME11a_odd_[slope]; } -unsigned CSCL1TPLookupTableME11ILT::es_diff_slope_L2_ME1a_odd(unsigned es_diff) const { - return es_diff_slope_L2_ME1a_odd_[es_diff]; +unsigned CSCL1TPLookupTableME11ILT::CSC_slope_corr_L2_ME11b_odd(unsigned slope) const { + return CSC_slope_corr_L2_ME11b_odd_[slope]; } -unsigned CSCL1TPLookupTableME11ILT::es_diff_slope_L1_ME1b_even(unsigned es_diff) const { - return es_diff_slope_L1_ME1b_even_[es_diff]; +unsigned CSCL1TPLookupTableME11ILT::es_diff_slope_L2_ME11a_even(unsigned es_diff) const { + return es_diff_slope_L2_ME11a_even_[es_diff]; } -unsigned CSCL1TPLookupTableME11ILT::es_diff_slope_L2_ME1b_even(unsigned es_diff) const { - return es_diff_slope_L2_ME1b_even_[es_diff]; +unsigned CSCL1TPLookupTableME11ILT::es_diff_slope_L2_ME11a_odd(unsigned es_diff) const { + return es_diff_slope_L2_ME11a_odd_[es_diff]; } -unsigned CSCL1TPLookupTableME11ILT::es_diff_slope_L1_ME1b_odd(unsigned es_diff) const { - return es_diff_slope_L1_ME1b_odd_[es_diff]; +unsigned CSCL1TPLookupTableME11ILT::es_diff_slope_L2_ME11b_even(unsigned es_diff) const { + return es_diff_slope_L2_ME11b_even_[es_diff]; } -unsigned CSCL1TPLookupTableME11ILT::es_diff_slope_L2_ME1b_odd(unsigned es_diff) const { - return es_diff_slope_L2_ME1b_odd_[es_diff]; +unsigned CSCL1TPLookupTableME11ILT::es_diff_slope_L2_ME11b_odd(unsigned es_diff) const { + return es_diff_slope_L2_ME11b_odd_[es_diff]; } diff --git a/CondFormats/CSCObjects/src/CSCL1TPLookupTableME21ILT.cc b/CondFormats/CSCObjects/src/CSCL1TPLookupTableME21ILT.cc index 3ff567ca10645..0c87eee03d929 100644 --- a/CondFormats/CSCObjects/src/CSCL1TPLookupTableME21ILT.cc +++ b/CondFormats/CSCObjects/src/CSCL1TPLookupTableME21ILT.cc @@ -1,10 +1,7 @@ #include "CondFormats/CSCObjects/interface/CSCL1TPLookupTableME21ILT.h" CSCL1TPLookupTableME21ILT::CSCL1TPLookupTableME21ILT() - : GEM_pad_CSC_hs_ME21_even_(0), - GEM_pad_CSC_hs_ME21_odd_(0), - - GEM_pad_CSC_es_ME21_even_(0), + : GEM_pad_CSC_es_ME21_even_(0), GEM_pad_CSC_es_ME21_odd_(0), GEM_roll_L1_CSC_min_wg_ME21_even_(0), @@ -17,15 +14,24 @@ CSCL1TPLookupTableME21ILT::CSCL1TPLookupTableME21ILT() GEM_roll_L2_CSC_min_wg_ME21_odd_(0), GEM_roll_L2_CSC_max_wg_ME21_odd_(0), + CSC_slope_cosi_2to1_L1_ME21_even_(0), + CSC_slope_cosi_2to1_L1_ME21_odd_(0), + CSC_slope_cosi_3to1_L1_ME21_even_(0), + CSC_slope_cosi_3to1_L1_ME21_odd_(0), + + CSC_slope_cosi_corr_L1_ME21_even_(0), + CSC_slope_cosi_corr_L1_ME21_odd_(0), + + CSC_slope_corr_L1_ME21_even_(0), + CSC_slope_corr_L1_ME21_odd_(0), + CSC_slope_corr_L2_ME21_even_(0), + CSC_slope_corr_L2_ME21_odd_(0), + es_diff_slope_L1_ME21_even_(0), - es_diff_slope_L2_ME21_even_(0), es_diff_slope_L1_ME21_odd_(0), + es_diff_slope_L2_ME21_even_(0), es_diff_slope_L2_ME21_odd_(0) {} -void CSCL1TPLookupTableME21ILT::set_GEM_pad_CSC_hs_ME21_even(t_lut lut) { GEM_pad_CSC_hs_ME21_even_ = std::move(lut); } - -void CSCL1TPLookupTableME21ILT::set_GEM_pad_CSC_hs_ME21_odd(t_lut lut) { GEM_pad_CSC_hs_ME21_odd_ = std::move(lut); } - void CSCL1TPLookupTableME21ILT::set_GEM_pad_CSC_es_ME21_even(t_lut lut) { GEM_pad_CSC_es_ME21_even_ = std::move(lut); } void CSCL1TPLookupTableME21ILT::set_GEM_pad_CSC_es_ME21_odd(t_lut lut) { GEM_pad_CSC_es_ME21_odd_ = std::move(lut); } @@ -62,28 +68,60 @@ void CSCL1TPLookupTableME21ILT::set_GEM_roll_L2_CSC_max_wg_ME21_odd(t_lut lut) { GEM_roll_L2_CSC_max_wg_ME21_odd_ = std::move(lut); } -void CSCL1TPLookupTableME21ILT::set_es_diff_slope_L1_ME21_even(t_lut lut) { - es_diff_slope_L1_ME21_even_ = std::move(lut); +void CSCL1TPLookupTableME21ILT::set_CSC_slope_cosi_2to1_L1_ME21_even(t_lut lut) { + CSC_slope_cosi_2to1_L1_ME21_even_ = std::move(lut); } -void CSCL1TPLookupTableME21ILT::set_es_diff_slope_L2_ME21_even(t_lut lut) { - es_diff_slope_L2_ME21_even_ = std::move(lut); +void CSCL1TPLookupTableME21ILT::set_CSC_slope_cosi_2to1_L1_ME21_odd(t_lut lut) { + CSC_slope_cosi_2to1_L1_ME21_odd_ = std::move(lut); +} + +void CSCL1TPLookupTableME21ILT::set_CSC_slope_cosi_3to1_L1_ME21_even(t_lut lut) { + CSC_slope_cosi_3to1_L1_ME21_even_ = std::move(lut); +} + +void CSCL1TPLookupTableME21ILT::set_CSC_slope_cosi_3to1_L1_ME21_odd(t_lut lut) { + CSC_slope_cosi_3to1_L1_ME21_odd_ = std::move(lut); +} + +void CSCL1TPLookupTableME21ILT::set_CSC_slope_cosi_corr_L1_ME21_even(t_lut lut) { + CSC_slope_cosi_corr_L1_ME21_even_ = std::move(lut); +} + +void CSCL1TPLookupTableME21ILT::set_CSC_slope_cosi_corr_L1_ME21_odd(t_lut lut) { + CSC_slope_cosi_corr_L1_ME21_odd_ = std::move(lut); +} + +void CSCL1TPLookupTableME21ILT::set_CSC_slope_corr_L1_ME21_even(t_lut lut) { + CSC_slope_corr_L1_ME21_even_ = std::move(lut); +} + +void CSCL1TPLookupTableME21ILT::set_CSC_slope_corr_L1_ME21_odd(t_lut lut) { + CSC_slope_corr_L1_ME21_odd_ = std::move(lut); +} + +void CSCL1TPLookupTableME21ILT::set_es_diff_slope_L1_ME21_even(t_lut lut) { + es_diff_slope_L1_ME21_even_ = std::move(lut); } void CSCL1TPLookupTableME21ILT::set_es_diff_slope_L1_ME21_odd(t_lut lut) { es_diff_slope_L1_ME21_odd_ = std::move(lut); } -void CSCL1TPLookupTableME21ILT::set_es_diff_slope_L2_ME21_odd(t_lut lut) { - es_diff_slope_L2_ME21_odd_ = std::move(lut); +void CSCL1TPLookupTableME21ILT::set_CSC_slope_corr_L2_ME21_even(t_lut lut) { + CSC_slope_corr_L2_ME21_even_ = std::move(lut); +} + +void CSCL1TPLookupTableME21ILT::set_CSC_slope_corr_L2_ME21_odd(t_lut lut) { + CSC_slope_corr_L2_ME21_odd_ = std::move(lut); } -unsigned CSCL1TPLookupTableME21ILT::GEM_pad_CSC_hs_ME21_even(unsigned pad) const { - return GEM_pad_CSC_hs_ME21_even_[pad]; +void CSCL1TPLookupTableME21ILT::set_es_diff_slope_L2_ME21_even(t_lut lut) { + es_diff_slope_L2_ME21_even_ = std::move(lut); } -unsigned CSCL1TPLookupTableME21ILT::GEM_pad_CSC_hs_ME21_odd(unsigned pad) const { - return GEM_pad_CSC_hs_ME21_odd_[pad]; +void CSCL1TPLookupTableME21ILT::set_es_diff_slope_L2_ME21_odd(t_lut lut) { + es_diff_slope_L2_ME21_odd_ = std::move(lut); } unsigned CSCL1TPLookupTableME21ILT::GEM_pad_CSC_es_ME21_even(unsigned pad) const { @@ -126,18 +164,58 @@ unsigned CSCL1TPLookupTableME21ILT::GEM_roll_L2_CSC_max_wg_ME21_odd(unsigned rol return GEM_roll_L2_CSC_max_wg_ME21_odd_[roll]; } -unsigned CSCL1TPLookupTableME21ILT::es_diff_slope_L1_ME21_even(unsigned es_diff) const { - return es_diff_slope_L1_ME21_even_[es_diff]; +unsigned CSCL1TPLookupTableME21ILT::CSC_slope_cosi_2to1_L1_ME21_even(unsigned slope) const { + return CSC_slope_cosi_2to1_L1_ME21_even_[slope]; } -unsigned CSCL1TPLookupTableME21ILT::es_diff_slope_L2_ME21_even(unsigned es_diff) const { - return es_diff_slope_L2_ME21_even_[es_diff]; +unsigned CSCL1TPLookupTableME21ILT::CSC_slope_cosi_2to1_L1_ME21_odd(unsigned slope) const { + return CSC_slope_cosi_2to1_L1_ME21_odd_[slope]; +} + +unsigned CSCL1TPLookupTableME21ILT::CSC_slope_cosi_3to1_L1_ME21_even(unsigned slope) const { + return CSC_slope_cosi_3to1_L1_ME21_even_[slope]; +} + +unsigned CSCL1TPLookupTableME21ILT::CSC_slope_cosi_3to1_L1_ME21_odd(unsigned slope) const { + return CSC_slope_cosi_3to1_L1_ME21_odd_[slope]; +} + +unsigned CSCL1TPLookupTableME21ILT::CSC_slope_cosi_corr_L1_ME21_even(unsigned slope) const { + return CSC_slope_cosi_corr_L1_ME21_even_[slope]; +} + +unsigned CSCL1TPLookupTableME21ILT::CSC_slope_cosi_corr_L1_ME21_odd(unsigned slope) const { + return CSC_slope_cosi_corr_L1_ME21_odd_[slope]; +} + +unsigned CSCL1TPLookupTableME21ILT::CSC_slope_corr_L1_ME21_even(unsigned slope) const { + return CSC_slope_corr_L1_ME21_even_[slope]; +} + +unsigned CSCL1TPLookupTableME21ILT::CSC_slope_corr_L1_ME21_odd(unsigned slope) const { + return CSC_slope_corr_L1_ME21_odd_[slope]; +} + +unsigned CSCL1TPLookupTableME21ILT::es_diff_slope_L1_ME21_even(unsigned es_diff) const { + return es_diff_slope_L1_ME21_even_[es_diff]; } unsigned CSCL1TPLookupTableME21ILT::es_diff_slope_L1_ME21_odd(unsigned es_diff) const { return es_diff_slope_L1_ME21_odd_[es_diff]; } +unsigned CSCL1TPLookupTableME21ILT::CSC_slope_corr_L2_ME21_even(unsigned slope) const { + return CSC_slope_corr_L2_ME21_even_[slope]; +} + +unsigned CSCL1TPLookupTableME21ILT::CSC_slope_corr_L2_ME21_odd(unsigned slope) const { + return CSC_slope_corr_L2_ME21_odd_[slope]; +} + +unsigned CSCL1TPLookupTableME21ILT::es_diff_slope_L2_ME21_even(unsigned es_diff) const { + return es_diff_slope_L2_ME21_even_[es_diff]; +} + unsigned CSCL1TPLookupTableME21ILT::es_diff_slope_L2_ME21_odd(unsigned es_diff) const { return es_diff_slope_L2_ME21_odd_[es_diff]; } diff --git a/DQM/CSCMonitorModule/plugins/CSCDQM_EventProcessor_processCSC.cc b/DQM/CSCMonitorModule/plugins/CSCDQM_EventProcessor_processCSC.cc index 8354fc03000cc..3e2846656a34f 100644 --- a/DQM/CSCMonitorModule/plugins/CSCDQM_EventProcessor_processCSC.cc +++ b/DQM/CSCMonitorModule/plugins/CSCDQM_EventProcessor_processCSC.cc @@ -1012,7 +1012,8 @@ namespace cscdqm { } } for (unsigned ieta = 0; ieta < 8; ieta++) { - std::vector gemEtaDigis = gemData->etaDigis(i, ieta); + std::vector gemEtaDigis = + gemData->etaDigis(i, ieta, tmbHeader->ALCTMatchTime()); if (!gemEtaDigis.empty()) { for (unsigned digi = 0; digi < gemEtaDigis.size(); digi++) { if (gemEtaDigis[digi].isValid()) { diff --git a/DQM/L1TMonitor/python/L1TStage2Emulator_cff.py b/DQM/L1TMonitor/python/L1TStage2Emulator_cff.py index 868a7e426a857..a808fa90cab31 100644 --- a/DQM/L1TMonitor/python/L1TStage2Emulator_cff.py +++ b/DQM/L1TMonitor/python/L1TStage2Emulator_cff.py @@ -68,8 +68,20 @@ commonParam = dict(runME11ILT = False) ) +from Configuration.Eras.Modifier_run3_common_cff import run3_common +run3_common.toModify( valCscStage2Digis, + keepShowers = True, + commonParam = dict(run3 = True, + runCCLUT_OTMB = True, + runPhase2 = True, + runME11Up = True, + runME21Up = True, + runME31Up = True, + runME41Up = True) +) + from Configuration.Eras.Modifier_run3_GEM_cff import run3_GEM -run3_GEM.toModify( valCscStage2Digis, GEMPadDigiClusterProducer = "valMuonGEMPadDigiClusters" ) +run3_GEM.toModify( valCscStage2Digis, GEMPadDigiClusterProducer = "valMuonGEMPadDigiClusters" , commonParam = dict(runME11ILT = True) ) # EMTF from L1Trigger.L1TMuonEndCap.simEmtfDigis_cfi import * @@ -78,6 +90,8 @@ RPCInput = "muonRPCDigis", GEMInput = 'valMuonGEMPadDigiClusters' ) +run3_GEM.toModify( valEmtfStage2Digis, UseRun3CCLUT_OTMB = cms.bool(True), Era = cms.string('Run3_2021')) + # EMTF shower from L1Trigger.L1TMuonEndCap.simEmtfShowers_cfi import * valEmtfStage2Showers = simEmtfShowers.clone( diff --git a/DataFormats/GEMDigi/interface/GEMPadDigiCluster.h b/DataFormats/GEMDigi/interface/GEMPadDigiCluster.h index 56670dee4ae54..32e84477898a1 100644 --- a/DataFormats/GEMDigi/interface/GEMPadDigiCluster.h +++ b/DataFormats/GEMDigi/interface/GEMPadDigiCluster.h @@ -38,14 +38,19 @@ class GEMPadDigiCluster { const std::vector& pads() const { return v_; } int bx() const { return bx_; } + GEMSubDetId::Station station() const { return station_; } unsigned nPartitions() const { return part_; } void print() const; + int alctMatchTime() const { return alctMatchTime_; } + void setAlctMatchTime(int matchWin) { alctMatchTime_ = matchWin; } + private: std::vector v_; int32_t bx_; + int alctMatchTime_ = -1; GEMSubDetId::Station station_; // number of eta partitions unsigned part_; diff --git a/DataFormats/GEMDigi/src/classes_def.xml b/DataFormats/GEMDigi/src/classes_def.xml index 2046f2f9f66b6..64db452776cb1 100644 --- a/DataFormats/GEMDigi/src/classes_def.xml +++ b/DataFormats/GEMDigi/src/classes_def.xml @@ -22,10 +22,11 @@ - + + diff --git a/EventFilter/CSCRawToDigi/interface/CSCGEMData.h b/EventFilter/CSCRawToDigi/interface/CSCGEMData.h index a16950720d3f2..f33b20b919dc6 100644 --- a/EventFilter/CSCRawToDigi/interface/CSCGEMData.h +++ b/EventFilter/CSCRawToDigi/interface/CSCGEMData.h @@ -17,7 +17,7 @@ class CSCGEMData { // std::vector BXN() const; std::vector digis(int gem_chamber) const; - std::vector etaDigis(int gem_chamber, int eta) const; + std::vector etaDigis(int gem_chamber, int eta, int correctionToALCTbx) const; int sizeInWords() const { return size_; } int numGEMs() const { return 2; // !!! TODO actual number of GEM chambers in readout diff --git a/EventFilter/CSCRawToDigi/interface/CSCTMBHeader.h b/EventFilter/CSCRawToDigi/interface/CSCTMBHeader.h index c7fbfa80159c2..1ffa9fdb3ab4a 100644 --- a/EventFilter/CSCRawToDigi/interface/CSCTMBHeader.h +++ b/EventFilter/CSCRawToDigi/interface/CSCTMBHeader.h @@ -42,6 +42,7 @@ class CSCTMBHeader { uint16_t BXNCount() const { return theHeaderFormat->BXNCount(); } uint16_t ALCTMatchTime() const { return theHeaderFormat->ALCTMatchTime(); } + void setALCTMatchTime(uint16_t alctmatchtime) { theHeaderFormat->setALCTMatchTime(alctmatchtime); } uint16_t CLCTOnly() const { return theHeaderFormat->CLCTOnly(); } uint16_t ALCTOnly() const { return theHeaderFormat->ALCTOnly(); } uint16_t TMBMatch() const { return theHeaderFormat->TMBMatch(); } diff --git a/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2006.h b/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2006.h index 8d437e95f8d66..f38d8404a95ba 100644 --- a/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2006.h +++ b/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2006.h @@ -11,6 +11,7 @@ struct CSCTMBHeader2006 : public CSCVTMBHeaderFormat { uint16_t BXNCount() const override { return bits.bxnCount; } uint16_t ALCTMatchTime() const override { return bits.alctMatchTime; } + void setALCTMatchTime(uint16_t alctmatchtime) override { bits.alctMatchTime = alctmatchtime & 0xF; } uint16_t CLCTOnly() const override { return bits.clctOnly; } uint16_t ALCTOnly() const override { return bits.alctOnly; } uint16_t TMBMatch() const override { return bits.tmbMatch; } diff --git a/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2007.h b/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2007.h index 36e6809fd11f0..64cee063d9ef3 100644 --- a/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2007.h +++ b/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2007.h @@ -11,6 +11,7 @@ struct CSCTMBHeader2007 : public CSCVTMBHeaderFormat { uint16_t BXNCount() const override { return bits.bxnCount; } uint16_t ALCTMatchTime() const override { return bits.matchWin; } + void setALCTMatchTime(uint16_t alctmatchtime) override { bits.matchWin = alctmatchtime & 0xF; } uint16_t CLCTOnly() const override { return bits.clctOnly; } uint16_t ALCTOnly() const override { return bits.alctOnly; } uint16_t TMBMatch() const override { return bits.tmbMatch; } diff --git a/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2007_rev0x50c3.h b/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2007_rev0x50c3.h index 65296355259c8..f0f83f065d380 100644 --- a/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2007_rev0x50c3.h +++ b/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2007_rev0x50c3.h @@ -11,6 +11,7 @@ struct CSCTMBHeader2007_rev0x50c3 : public CSCVTMBHeaderFormat { uint16_t BXNCount() const override { return bits.bxnCount; } uint16_t ALCTMatchTime() const override { return bits.matchWin; } + void setALCTMatchTime(uint16_t alctmatchtime) override { bits.matchWin = alctmatchtime & 0xF; } uint16_t CLCTOnly() const override { return bits.clctOnly; } uint16_t ALCTOnly() const override { return bits.alctOnly; } uint16_t TMBMatch() const override { return bits.tmbMatch; } diff --git a/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2013.h b/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2013.h index eb4bfc5d4ecab..82d00e229b6d0 100644 --- a/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2013.h +++ b/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2013.h @@ -11,6 +11,7 @@ struct CSCTMBHeader2013 : public CSCVTMBHeaderFormat { uint16_t BXNCount() const override { return bits.bxnCount; } uint16_t ALCTMatchTime() const override { return bits.matchWin; } + void setALCTMatchTime(uint16_t alctmatchtime) override { bits.matchWin = alctmatchtime & 0xF; } uint16_t CLCTOnly() const override { return bits.clctOnly; } uint16_t ALCTOnly() const override { return bits.alctOnly; } uint16_t TMBMatch() const override { return bits.tmbMatch; } diff --git a/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2020_CCLUT.h b/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2020_CCLUT.h index f70f699e4ae83..5a6b4780751e7 100644 --- a/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2020_CCLUT.h +++ b/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2020_CCLUT.h @@ -11,6 +11,7 @@ struct CSCTMBHeader2020_CCLUT : public CSCVTMBHeaderFormat { uint16_t BXNCount() const override { return bits.bxnCount; } uint16_t ALCTMatchTime() const override { return bits.matchWin; } + void setALCTMatchTime(uint16_t alctmatchtime) override { bits.matchWin = alctmatchtime & 0xF; } uint16_t CLCTOnly() const override { return bits.clctOnly; } uint16_t ALCTOnly() const override { return bits.alctOnly; } uint16_t TMBMatch() const override { return bits.tmbMatch; } diff --git a/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2020_GEM.h b/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2020_GEM.h index 8eb73c6dfa292..b066bf7f50a97 100644 --- a/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2020_GEM.h +++ b/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2020_GEM.h @@ -11,6 +11,7 @@ struct CSCTMBHeader2020_GEM : public CSCVTMBHeaderFormat { uint16_t BXNCount() const override { return bits.bxnCount; } uint16_t ALCTMatchTime() const override { return bits.matchWin; } + void setALCTMatchTime(uint16_t alctmatchtime) override { bits.matchWin = alctmatchtime & 0xF; } uint16_t CLCTOnly() const override { return bits.clctOnly; } uint16_t ALCTOnly() const override { return bits.alctOnly; } uint16_t TMBMatch() const override { return bits.tmbMatch; } diff --git a/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2020_Run2.h b/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2020_Run2.h index a6eadac6e5039..790bc1c89505a 100644 --- a/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2020_Run2.h +++ b/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2020_Run2.h @@ -11,6 +11,7 @@ struct CSCTMBHeader2020_Run2 : public CSCVTMBHeaderFormat { uint16_t BXNCount() const override { return bits.bxnCount; } uint16_t ALCTMatchTime() const override { return bits.matchWin; } + void setALCTMatchTime(uint16_t alctmatchtime) override { bits.matchWin = alctmatchtime & 0xF; } uint16_t CLCTOnly() const override { return bits.clctOnly; } uint16_t ALCTOnly() const override { return bits.alctOnly; } uint16_t TMBMatch() const override { return bits.tmbMatch; } diff --git a/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2020_TMB.h b/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2020_TMB.h index cc9fcddf7712a..61931dbe428b9 100644 --- a/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2020_TMB.h +++ b/EventFilter/CSCRawToDigi/interface/CSCTMBHeader2020_TMB.h @@ -11,6 +11,7 @@ struct CSCTMBHeader2020_TMB : public CSCVTMBHeaderFormat { uint16_t BXNCount() const override { return bits.bxnCount; } uint16_t ALCTMatchTime() const override { return bits.matchWin; } + void setALCTMatchTime(uint16_t alctmatchtime) override { bits.matchWin = alctmatchtime & 0xF; } uint16_t CLCTOnly() const override { return bits.clctOnly; } uint16_t ALCTOnly() const override { return bits.alctOnly; } uint16_t TMBMatch() const override { return bits.tmbMatch; } diff --git a/EventFilter/CSCRawToDigi/interface/CSCVTMBHeaderFormat.h b/EventFilter/CSCRawToDigi/interface/CSCVTMBHeaderFormat.h index 71cb0c3f7049c..619d075cac3ca 100644 --- a/EventFilter/CSCRawToDigi/interface/CSCVTMBHeaderFormat.h +++ b/EventFilter/CSCRawToDigi/interface/CSCVTMBHeaderFormat.h @@ -19,6 +19,7 @@ class CSCVTMBHeaderFormat { virtual void setEventInformation(const CSCDMBHeader&) = 0; virtual uint16_t BXNCount() const = 0; virtual uint16_t ALCTMatchTime() const = 0; + virtual void setALCTMatchTime(uint16_t alctmatchtime) = 0; virtual uint16_t CLCTOnly() const = 0; virtual uint16_t ALCTOnly() const = 0; virtual uint16_t TMBMatch() const = 0; diff --git a/EventFilter/CSCRawToDigi/plugins/CSCDCCUnpacker.cc b/EventFilter/CSCRawToDigi/plugins/CSCDCCUnpacker.cc index 7a101e3387595..cbe4e6441aa51 100644 --- a/EventFilter/CSCRawToDigi/plugins/CSCDCCUnpacker.cc +++ b/EventFilter/CSCRawToDigi/plugins/CSCDCCUnpacker.cc @@ -103,6 +103,7 @@ class CSCDCCUnpacker : public edm::stream::EDProducer<> { bool instantiateDQM; bool disableMappingCheck, b904Setup; + int b904vmecrate, b904dmb; CSCMonitorInterface* monitor; @@ -140,6 +141,8 @@ CSCDCCUnpacker::CSCDCCUnpacker(const edm::ParameterSet& pset) : numOfEvents(0) { disableMappingCheck = pset.getUntrackedParameter("DisableMappingCheck", false); // Make aware the unpacker that B904 test setup is used (disable mapping inconsistency check) b904Setup = pset.getUntrackedParameter("B904Setup", false); + b904vmecrate = pset.getUntrackedParameter("B904vmecrate", 1); + b904dmb = pset.getUntrackedParameter("B904dmb", 3); /// Visualization of raw data visualFEDInspect = pset.getUntrackedParameter("VisualFEDInspect", false); @@ -229,6 +232,8 @@ void CSCDCCUnpacker::fillDescriptions(edm::ConfigurationDescriptions& descriptio desc.addUntracked("DisableMappingCheck", false) ->setComment("# Disable FED/DDU to chamber mapping inconsistency check"); desc.addUntracked("B904Setup", false)->setComment("# Make the unpacker aware of B904 test setup configuration"); + desc.addUntracked("B904vmecrate", 1)->setComment("# Set vmecrate number for chamber used in B904 test setup"); + desc.addUntracked("B904dmb", 3)->setComment("# Set dmb slot for chamber used in B904 test setup"); descriptions.add("muonCSCDCCUnpacker", desc); descriptions.setComment(" This is the generic cfi file for CSC unpacking"); } @@ -466,8 +471,9 @@ void CSCDCCUnpacker::produce(edm::Event& e, const edm::EventSetup& c) { for (unsigned int iCSC = 0; iCSC < cscData.size(); ++iCSC) // loop over CSCs { ///first process chamber-wide digis such as LCT - int vmecrate = cscData[iCSC].dmbHeader()->crateID(); - int dmb = cscData[iCSC].dmbHeader()->dmbID(); + + int vmecrate = b904Setup ? b904vmecrate : cscData[iCSC].dmbHeader()->crateID(); + int dmb = b904Setup ? b904dmb : cscData[iCSC].dmbHeader()->dmbID(); int icfeb = 0; /// default value for all digis not related to cfebs int ilayer = 0; /// layer=0 flags entire chamber @@ -523,8 +529,11 @@ void CSCDCCUnpacker::produce(edm::Event& e, const edm::EventSetup& c) { if (SuppressZeroLCT) { std::vector alctDigis_0; for (int unsigned i = 0; i < alctDigis.size(); ++i) { - if (alctDigis[i].isValid()) + if (alctDigis[i].isValid()) { + if (debug) + LogTrace("CSCDCCUnpacker|CSCRawToDigi") << alctDigis[i] << std::endl; alctDigis_0.push_back(alctDigis[i]); + } } alctProduct->move(std::make_pair(alctDigis_0.begin(), alctDigis_0.end()), layer); } else @@ -562,8 +571,11 @@ void CSCDCCUnpacker::produce(edm::Event& e, const edm::EventSetup& c) { if (SuppressZeroLCT) { std::vector correlatedlctDigis_0; for (int unsigned i = 0; i < correlatedlctDigis.size(); ++i) { - if (correlatedlctDigis[i].isValid()) + if (correlatedlctDigis[i].isValid()) { + if (debug) + LogTrace("CSCDCCUnpacker|CSCRawToDigi") << correlatedlctDigis[i] << std::endl; correlatedlctDigis_0.push_back(correlatedlctDigis[i]); + } } corrlctProduct->move(std::make_pair(correlatedlctDigis_0.begin(), correlatedlctDigis_0.end()), layer); } else @@ -573,8 +585,11 @@ void CSCDCCUnpacker::produce(edm::Event& e, const edm::EventSetup& c) { if (SuppressZeroLCT) { std::vector clctDigis_0; for (int unsigned i = 0; i < clctDigis.size(); ++i) { - if (clctDigis[i].isValid()) + if (clctDigis[i].isValid()) { + if (debug) + LogTrace("CSCDCCUnpacker|CSCRawToDigi") << clctDigis[i] << std::endl; clctDigis_0.push_back(clctDigis[i]); + } } clctProduct->move(std::make_pair(clctDigis_0.begin(), clctDigis_0.end()), layer); } else @@ -623,12 +638,12 @@ void CSCDCCUnpacker::produce(edm::Event& e, const edm::EventSetup& c) { int gem_region = (layer.endcap() == 1) ? 1 : -1; // Loop over GEM layer eta/rolls for (unsigned ieta = 0; ieta < 8; ieta++) { - // GE11 eta/roll collection addressing according to GEMDetID definition is 1-8 + // GE11 eta/roll collection addressing according to GEMDetID definition is 1-8 (eta 8 being closest to beampipe) GEMDetId gemid(gem_region, layer.ring(), layer.station(), igem + 1, gem_chamber, ieta + 1); - // GE11 actual data format reporting eta/rolls in 0-7 range + // GE11 trigger data format reports eta/rolls in 0-7 range (eta 0 being closest to beampipe) // mapping agreement is that real data eta needs to be reversed from 0-7 to 8-1 for GEMDetId collection convention - std::vector gemDigis = - cscData[iCSC].tmbData()->gemData()->etaDigis(igem, 7 - ieta); + std::vector gemDigis = cscData[iCSC].tmbData()->gemData()->etaDigis( + igem, 7 - ieta, cscData[iCSC].tmbHeader()->ALCTMatchTime()); if (!gemDigis.empty()) { gemProduct->move(std::make_pair(gemDigis.begin(), gemDigis.end()), gemid); } diff --git a/EventFilter/CSCRawToDigi/src/CSCEventData.cc b/EventFilter/CSCRawToDigi/src/CSCEventData.cc index 16925716597a4..1bee1a9f0412a 100644 --- a/EventFilter/CSCRawToDigi/src/CSCEventData.cc +++ b/EventFilter/CSCRawToDigi/src/CSCEventData.cc @@ -548,6 +548,8 @@ void CSCEventData::add(const std::vector& clusters, const GEM int gem_layer = gemdetid.layer(); int eta_roll = gemdetid.roll(); for (const auto& it : clusters) { + if (it.isValid()) + theTMBData->tmbHeader()->setALCTMatchTime(it.alctMatchTime()); theTMBData->gemData()->addEtaPadCluster(it, gem_layer - 1, 8 - eta_roll); } } diff --git a/EventFilter/CSCRawToDigi/src/CSCGEMData.cc b/EventFilter/CSCRawToDigi/src/CSCGEMData.cc index 14776426adaee..8be603115e193 100644 --- a/EventFilter/CSCRawToDigi/src/CSCGEMData.cc +++ b/EventFilter/CSCRawToDigi/src/CSCGEMData.cc @@ -1,11 +1,13 @@ #include "EventFilter/CSCRawToDigi/interface/CSCGEMData.h" #include "DataFormats/GEMDigi/interface/GEMPadDigiCluster.h" #include "FWCore/MessageLogger/interface/MessageLogger.h" +#include "DataFormats/CSCDigi/interface/CSCConstants.h" #include #include #include // for bzero #include +#include #ifdef LOCAL_UNPACK bool CSCGEMData::debug = false; @@ -143,7 +145,7 @@ std::vector CSCGEMData::digis(int gem_chamber) const { /// Unpack GEMPadDigiCluster digi trigger objects per eta/roll /// gem_chamber - GEM GE11 layer gemA/B [0,1] /// eta_roll - GEM eta/roll 8 rolls per GEM layer [0-7] -std::vector CSCGEMData::etaDigis(int gem_chamber, int eta_roll) const { +std::vector CSCGEMData::etaDigis(int gem_chamber, int eta_roll, int alctMatchTime) const { /// GEM data format v2 std::vector result; result.clear(); @@ -168,11 +170,12 @@ std::vector CSCGEMData::etaDigis(int gem_chamber, int eta_rol << "GEMlayer" << gem_layer << " cl_word" << dataAddr << ": 0x" << std::hex << cl_word << std::dec << " tbin: " << i << " fiber#: " << (fiber + 1) << " cluster#: " << (cluster + 1) << " padInPart: " << padInPart << " pad: " << pad << " eta: " << eta - << " cluster_size: " << cluster_size << std::endl; + << " cluster_size: " << cluster_size << " alctMatchTime: " << alctMatchTime << std::endl; std::vector pads; for (int iP = 0; iP <= cluster_size; ++iP) pads.push_back(padInPart + iP); GEMPadDigiCluster pad_cluster(pads, i); + pad_cluster.setAlctMatchTime(alctMatchTime); result.push_back(pad_cluster); } } diff --git a/EventFilter/GEMRawToDigi/test/runGEMUnpacker_cfg.py b/EventFilter/GEMRawToDigi/test/runGEMUnpacker_cfg.py index 60987422d398e..80b31b43f1545 100644 --- a/EventFilter/GEMRawToDigi/test/runGEMUnpacker_cfg.py +++ b/EventFilter/GEMRawToDigi/test/runGEMUnpacker_cfg.py @@ -74,10 +74,16 @@ VarParsing.VarParsing.multiplicity.singleton, VarParsing.VarParsing.varType.string, "Label for the GEM unpacker RAW input collection") -options.register('useB904Data', +options.register('useB904GE11Long', False, VarParsing.VarParsing.multiplicity.singleton, - VarParsing.VarParsing.varType.bool) + VarParsing.VarParsing.varType.bool, + "Set to True when using data from GE1/1 Long super chamber in B904.") +options.register('useB904GE11Short', + False, + VarParsing.VarParsing.multiplicity.singleton, + VarParsing.VarParsing.varType.bool, + "Set to True when using data from GE1/1 Short super chamber in B904.") options.parseArguments() @@ -142,9 +148,16 @@ # Other statements from Configuration.AlCa.GlobalTag import GlobalTag process.GlobalTag = GlobalTag(process.GlobalTag, '112X_dataRun3_Prompt_v5', '') -## for the time being the mapping does not work with the data label. Use MC instead -if options.useB904Data: - process.GlobalTag = GlobalTag(process.GlobalTag, 'auto:phase1_2022_realistic', '') + +# Mapping for b904 GEM-CSC integration stand +if (options.useB904GE11Long or options.useB904GE11Short): + process.GlobalTag.toGet = cms.VPSet( + cms.PSet(record = cms.string("GEMChMapRcd"), + tag = cms.string("GEMeMap_GE11_b904_v1"), + connect = cms.string("frontier://FrontierProd/CMS_CONDITIONS") + ) + ) + process.muonGEMDigis.useDBEMap = True # dump raw data process.dumpRaw = cms.EDAnalyzer( @@ -162,6 +175,8 @@ ) process.muonGEMDigis.InputLabel = options.unpackerLabel +process.muonGEMDigis.fedIdStart = options.feds[0] +process.muonGEMDigis.fedIdEnd = options.feds[-1] process.simMuonGEMPadDigis.InputCollection = 'muonGEMDigis' ## schedule and path definition diff --git a/L1Trigger/CSCTriggerPrimitives/interface/CSCBaseboard.h b/L1Trigger/CSCTriggerPrimitives/interface/CSCBaseboard.h index dad5ad2575e8d..e2384512b0e4e 100644 --- a/L1Trigger/CSCTriggerPrimitives/interface/CSCBaseboard.h +++ b/L1Trigger/CSCTriggerPrimitives/interface/CSCBaseboard.h @@ -108,6 +108,7 @@ class CSCBaseboard { bool runME31Up_; bool runME41Up_; + bool run3_; bool runCCLUT_; bool runCCLUT_TMB_; bool runCCLUT_OTMB_; diff --git a/L1Trigger/CSCTriggerPrimitives/interface/CSCGEMMatcher.h b/L1Trigger/CSCTriggerPrimitives/interface/CSCGEMMatcher.h index d141242367bb4..a4c2cc35c0aed 100644 --- a/L1Trigger/CSCTriggerPrimitives/interface/CSCGEMMatcher.h +++ b/L1Trigger/CSCTriggerPrimitives/interface/CSCGEMMatcher.h @@ -6,6 +6,7 @@ * Helper class to check if an ALCT or CLCT matches with a GEMInternalCluster * * \author Sven Dildick (Rice University) + * \updates by Giovanni Mocellin (UC Davis) * */ @@ -35,79 +36,46 @@ class CSCGEMMatcher { void setESLookupTables(const CSCL1TPLookupTableME21ILT* conf); // calculate the bending angle - unsigned calculateGEMCSCBending(const CSCCLCTDigi& clct, const GEMInternalCluster& cluster) const; - - // match by BX - - // coincidences - void matchingClustersBX(const CSCALCTDigi& alct, - const GEMInternalClusters& clusters, - GEMInternalClusters& selected) const; - - // coincidences - void matchingClustersBX(const CSCCLCTDigi& clct, - const GEMInternalClusters& clusters, - GEMInternalClusters& selected) const; - - // coincidences or single clusters - void matchingClustersBX(const CSCALCTDigi& alct, - const CSCCLCTDigi& clct, - const GEMInternalClusters& clusters, - GEMInternalClusters& selected) const; + int calculateGEMCSCBending(const CSCCLCTDigi& clct, const GEMInternalCluster& cluster) const; // match by location - // coincidences + // ALCT-GEM void matchingClustersLoc(const CSCALCTDigi& alct, const GEMInternalClusters& clusters, - GEMInternalClusters& selected) const; + GEMInternalClusters& output) const; - // coincidences + // CLCT-GEM void matchingClustersLoc(const CSCCLCTDigi& clct, const GEMInternalClusters& clusters, - GEMInternalClusters& selected) const; + GEMInternalClusters& output, + bool ignoreALCTGEMmatch) const; - // match by 1/2-strip - bool matchedClusterLocHS(const CSCCLCTDigi& clct, const GEMInternalCluster& cluster) const; + // matching candidate distance in 1/8 strip, always the total without extrapolation correction, if ForceTotal is true + int matchedClusterDistES(const CSCCLCTDigi& clct, + const GEMInternalCluster& cluster, + const bool isLayer2, + const bool ForceTotal) const; - // match by 1/8-strip - bool matchedClusterLocES(const CSCCLCTDigi& clct, const GEMInternalCluster& cluster) const; - - // coincidences or single clusters + // ALCT-CLCT-GEM void matchingClustersLoc(const CSCALCTDigi& alct, const CSCCLCTDigi& clct, const GEMInternalClusters& clusters, - GEMInternalClusters& selected) const; - - // match by BX and location - - // coincidences - void matchingClustersBXLoc(const CSCALCTDigi& alct, - const GEMInternalClusters& clusters, - GEMInternalClusters& selected) const; - - // coincidences - void matchingClustersBXLoc(const CSCCLCTDigi& clct, - const GEMInternalClusters& clusters, - GEMInternalClusters& selected) const; + GEMInternalClusters& output) const; - // coincidences or single clusters - void matchingClustersBXLoc(const CSCALCTDigi& alct, - const CSCCLCTDigi& clct, - const GEMInternalClusters& clusters, - GEMInternalClusters& selected) const; + // best matching clusters by location - // best matching clusters - void bestClusterBXLoc(const CSCALCTDigi& alct, const GEMInternalClusters& clusters, GEMInternalCluster& best) const; + // ALCT-GEM + void bestClusterLoc(const CSCALCTDigi& alct, const GEMInternalClusters& clusters, GEMInternalCluster& best) const; - // coincidences - void bestClusterBXLoc(const CSCCLCTDigi& clct, const GEMInternalClusters& clusters, GEMInternalCluster& best) const; + // CLCT-GEM + void bestClusterLoc(const CSCCLCTDigi& clct, const GEMInternalClusters& clusters, GEMInternalCluster& best) const; - // coincidences or single clusters - void bestClusterBXLoc(const CSCALCTDigi& alct, - const CSCCLCTDigi& clct, - const GEMInternalClusters& clusters, - GEMInternalCluster& best) const; + // ALCT-CLCT-GEM + void bestClusterLoc(const CSCALCTDigi& alct, + const CSCCLCTDigi& clct, + const GEMInternalClusters& clusters, + GEMInternalCluster& best) const; private: // access to lookup tables via eventsetup @@ -118,7 +86,7 @@ class CSCGEMMatcher { uint16_t mitigatedSlopeByConsistency(const CSCCLCTDigi& clct) const; // calculate slope correction - int CSCGEMSlopeCorrector(const bool isL1orCopad, const int cscSlope) const; + int CSCGEMSlopeCorrector(const bool isME1a, const int cscSlope, bool isLayer2) const; unsigned endcap_; unsigned station_; @@ -126,15 +94,17 @@ class CSCGEMMatcher { unsigned chamber_; bool isEven_; - unsigned maxDeltaBXALCTGEM_; - unsigned maxDeltaBXCLCTGEM_; + // enable GEM-CSC matching in ME1a and ME1b + bool enable_match_gem_me1a_; + bool enable_match_gem_me1b_; - bool matchWithHS_; + // match GEM-CSC by propagating CLCT to GEM via LUT + bool matchCLCTpropagation_; + // Matching interval in Half Strips (less bits to deal with in FW), but then used as Eighth Strips (es=hs*4) + unsigned maxDeltaWG_; unsigned maxDeltaHsEven_; unsigned maxDeltaHsOdd_; - unsigned maxDeltaHsEvenME1a_; - unsigned maxDeltaHsOddME1a_; bool assign_gem_csc_bending_; bool mitigateSlopeByCosi_; diff --git a/L1Trigger/CSCTriggerPrimitives/interface/CSCGEMMotherboard.h b/L1Trigger/CSCTriggerPrimitives/interface/CSCGEMMotherboard.h index 8975cf8122412..67c40af832712 100644 --- a/L1Trigger/CSCTriggerPrimitives/interface/CSCGEMMotherboard.h +++ b/L1Trigger/CSCTriggerPrimitives/interface/CSCGEMMotherboard.h @@ -8,10 +8,12 @@ * ALCT/CLCT to GEM single clusters or coincidences of clusters * * \author Sven Dildick (Rice University) + * \updates by Giovanni Mocellin (UC Davis) * */ #include "L1Trigger/CSCTriggerPrimitives/interface/CSCMotherboard.h" +#include "L1Trigger/CSCTriggerPrimitives/interface/GEMInternalCluster.h" #include "L1Trigger/CSCTriggerPrimitives/interface/GEMClusterProcessor.h" #include "L1Trigger/CSCTriggerPrimitives/interface/CSCGEMMatcher.h" #include "Geometry/GEMGeometry/interface/GEMGeometry.h" @@ -33,15 +35,9 @@ class CSCGEMMotherboard : public CSCMotherboard { // clear stored pads and copads void clear(); - /* - Use ALCTs, CLCTs, GEMs to build LCTs. Matches are attempted in the following order: - 1) ALCT-CLCT-2GEM (coincidence pad) - 2) ALCT-CLCT-GEM - 3) ALCT-CLCT - 4) CLCT-2GEM (requires CLCT with at least 4 layers) - 5) ALCT-2GEM (requires ALCT with at least 4 layers) - Sort LCTs according to the cross-bunch-crossing algorithm, and send out best 2 LCTs - */ + //helper function to convert GEM-CSC amended slopes into Run2 patterns + uint16_t Run2PatternConverter(const int slope) const; + void run(const CSCWireDigiCollection* wiredc, const CSCComparatorDigiCollection* compdc, const GEMPadDigiClusterCollection* gemPads); @@ -53,79 +49,52 @@ class CSCGEMMotherboard : public CSCMotherboard { void setGEMGeometry(const GEMGeometry* g) { gem_g = g; } private: - // match ALCT-CLCT-(2)GEM pairs - void matchALCTCLCTGEM(bool bunch_crossing_mask[CSCConstants::MAX_ALCT_TBINS]); - - // match ALCT-CLCT pairs - void matchALCTCLCT(bool bunch_crossing_mask[CSCConstants::MAX_ALCT_TBINS]); - - // match CLCT-2GEM pairs. The GEM coincidence cluster BX is considered the - // reference - void matchCLCT2GEM(bool bunch_crossing_mask[CSCConstants::MAX_ALCT_TBINS]); - - // match ALCT-2GEM pairs. The GEM coincidence cluster BX is considered the - // reference - void matchALCT2GEM(bool bunch_crossing_mask[CSCConstants::MAX_ALCT_TBINS]); - - /* correlate a pair of ALCTs and a pair of CLCTs with matched clusters or coclusters - the output is up to two LCTs */ - void correlateLCTsGEM(const CSCALCTDigi& bestALCT, - const CSCALCTDigi& secondALCT, - const CSCCLCTDigi& bestCLCT, - const CSCCLCTDigi& secondCLCT, - const GEMInternalClusters& clusters, - CSCCorrelatedLCTDigi& lct1, - CSCCorrelatedLCTDigi& lct2) const; + /* + Use ALCTs, CLCTs, GEMs to build LCTs. Matches in FW are attempted in the following order: + 1) ALCT-CLCT-2GEM (coincidence pad) + 2) ALCT-CLCT-GEM + 3) ALCT-CLCT (requires CLCT with at least 4 layers) + 4) CLCT-2GEM (requires CLCT with at least 4 layers) + 5) ALCT-2GEM (requires ALCT with at least 4 layers) + => If there are second ALCTs/CLCTs which could not be matched to GEM: + 6) Copy over valid to invalid + 7) ALCT-CLCT with unused combination + */ + void matchALCTCLCTGEM(); - /* correlate a pair of CLCTs with matched clusters or coclusters - the output is up to two LCTs */ - void correlateLCTsGEM(const CSCCLCTDigi& bestCLCT, - const CSCCLCTDigi& secondCLCT, + // correlate ALCT, CLCT with matched pads or copads + void correlateLCTsGEM(const CSCALCTDigi& ALCT, + const CSCCLCTDigi& CLCT, const GEMInternalClusters& clusters, - CSCCorrelatedLCTDigi& lct1, - CSCCorrelatedLCTDigi& lct2) const; + CSCCorrelatedLCTDigi& lct) const; - /* correlate a pair of ALCTs with matched clusters or coclusters - the output is up to two LCTs */ - void correlateLCTsGEM(const CSCALCTDigi& bestALCT, - const CSCALCTDigi& secondALCT, - const GEMInternalClusters& clusters, - CSCCorrelatedLCTDigi& lct1, - CSCCorrelatedLCTDigi& lct2) const; + // correlate ALCT and CLCT, no GEM + void correlateLCTsGEM(const CSCALCTDigi& ALCT, const CSCCLCTDigi& CLCT, CSCCorrelatedLCTDigi& lct) const; - /* Construct LCT from CSC and GEM information. Options are ALCT-CLCT-GEM, ALCT-CLCT-2GEM */ - void constructLCTsGEM(const CSCALCTDigi& alct, - const CSCCLCTDigi& clct, - const GEMInternalCluster& gem, - CSCCorrelatedLCTDigi& lct) const; + // correlate CLCT with matched pads or copads + void correlateLCTsGEM(const CSCCLCTDigi& CLCT, const GEMInternalClusters& clusters, CSCCorrelatedLCTDigi& lct) const; - /* Construct LCT from CSC and GEM information. Options are CLCT-2GEM */ - void constructLCTsGEM(const CSCCLCTDigi& clct, - const GEMInternalCluster& gem, - int trackNumber, - CSCCorrelatedLCTDigi& lct) const; + // correlate ALCT with matched pads or copads + void correlateLCTsGEM(const CSCALCTDigi& ALCT, const GEMInternalClusters& clusters, CSCCorrelatedLCTDigi& lct) const; - /* Construct LCT from CSC and GEM information. Options are ALCT-2GEM */ + // Construct LCT from CSC and GEM information. ALCT+CLCT+GEM void constructLCTsGEM(const CSCALCTDigi& alct, + const CSCCLCTDigi& clct, const GEMInternalCluster& gem, - int trackNumber, CSCCorrelatedLCTDigi& lct) const; - // helper functions to drop low quality ALCTs or CLCTs - // without matching LCTs - void dropLowQualityALCTNoClusters(CSCALCTDigi& alct, const GEMInternalCluster& cluster) const; - void dropLowQualityCLCTNoClusters(CSCCLCTDigi& clct, const GEMInternalCluster& cluster) const; + // Construct LCT from CSC and no GEM information. ALCT+CLCT + void constructLCTsGEM(const CSCALCTDigi& alct, const CSCCLCTDigi& clct, CSCCorrelatedLCTDigi& lct) const; - /* - - For Run-2 GEM-CSC trigger primitives, which we temporarily have - to integrate with the Run-2 EMTF during LS2, we sort by quality. - Larger quality means smaller bending + // Construct LCT from CSC and GEM information. CLCT+2GEM + void constructLCTsGEM(const CSCCLCTDigi& clct, const GEMInternalCluster& gem, CSCCorrelatedLCTDigi& lct) const; - - For Run-3 GEM-CSC trigger primitives, which we have - to integrate with the Run-3 EMTF, we sort by slope. - Smaller slope means smaller bending - */ - void sortLCTsByBending(std::vector& lcts) const; + // Construct LCT from CSC and GEM information. ALCT+2GEM + void constructLCTsGEM(const CSCALCTDigi& alct, const GEMInternalCluster& gem, CSCCorrelatedLCTDigi& lct) const; + + // LCTs are sorted by quality. If there are two with the same quality, + // then the sorting is done by the slope + void sortLCTs(std::vector& lcts) const; /** Chamber id (trigger-type labels). */ unsigned gemId; @@ -134,37 +103,29 @@ class CSCGEMMotherboard : public CSCMotherboard { // map of BX to vectors of GEM clusters. Makes it easier to match objects std::map clusters_; + /* CSCGEM matcher */ std::unique_ptr cscGEMMatcher_; /* GEM cluster processor */ std::shared_ptr clusterProc_; // Drop low quality stubs in ME1/b or ME2/1 - bool drop_low_quality_alct_no_gems_; - bool drop_low_quality_clct_no_gems_; + bool drop_low_quality_alct_; + bool drop_low_quality_clct_; + // Drop low quality stubs in ME1/a + bool drop_low_quality_clct_me1a_; // build LCT from ALCT/CLCT and GEM in ME1/b or ME2/1 - bool build_lct_from_alct_clct_2gem_; - bool build_lct_from_alct_clct_1gem_; bool build_lct_from_alct_gem_; bool build_lct_from_clct_gem_; - // Drop low quality stubs in ME1/a - bool drop_low_quality_clct_no_gems_me1a_; - - // build LCT from CLCT and GEM in ME1/a - bool build_lct_from_clct_gem_me1a_; - // bunch crossing window cuts - unsigned max_delta_bx_alct_gem_; - unsigned max_delta_bx_clct_gem_; + unsigned alct_gem_bx_window_size_; + unsigned clct_gem_bx_window_size_; // assign GEM-CSC bending angle bool assign_gem_csc_bending_; - bool drop_used_gems_; - bool match_earliest_gem_only_; - // The GE2/1 geometry should have 16 eta partitions // The 8-eta partition case (older prototype versions) is not supported bool hasGE21Geometry16Partitions_; diff --git a/L1Trigger/CSCTriggerPrimitives/interface/CSCMotherboard.h b/L1Trigger/CSCTriggerPrimitives/interface/CSCMotherboard.h index b7b6dfe79a63d..967023a75fabe 100644 --- a/L1Trigger/CSCTriggerPrimitives/interface/CSCMotherboard.h +++ b/L1Trigger/CSCTriggerPrimitives/interface/CSCMotherboard.h @@ -31,7 +31,7 @@ * in ORCA). * Porting from ORCA by S. Valuev (Slava.Valuev@cern.ch), May 2006. * - * Extended for Run-3 and Phase-2 by Vadim Khotilovich, Tao Huang and Sven Dildick + * Extended for Run-3 and Phase-2 by Vadim Khotilovich, Tao Huang, Sven Dildick and Giovanni Mocellin */ #include "L1Trigger/CSCTriggerPrimitives/interface/CSCAnodeLCTProcessor.h" @@ -186,17 +186,9 @@ class CSCMotherboard : public CSCBaseboard { match-time window. Valid CLCTs are matched in-time. If a match was found for the best ALCT and best CLCT, also the second best ALCT and second best CLCT are sent to a correlation function "correlateLCTs" that will - make the best-best pair and second-second pair (if applicable). This - "matchALCTCLCT" function used to be directly in the "run" function, but - was put in a separate procedure so it can be reused for the GEM-CSC - motherboards. The argument is a mask, which plays no role for regular - CSC motherboards (TMB or OTMB). It does play a role in the GEM-CSC - motherboard. Different kinds of LCTs can be made there (see - CSCGEMMotherboard class), and the matching follows a sequence of priority - (first ALCT-CLCT-(2)GEM, then ALCT-CLCT, then CLCT-2GEM, then ALCT-2GEM). - At each step bunch crossings are masked where at least one LCT was found. + make the best-best pair and second-second pair (if applicable). */ - void matchALCTCLCT(bool bunch_crossing_mask[CSCConstants::MAX_ALCT_TBINS]); + void matchALCTCLCT(); /* This function matches maximum two ALCTs with maximum two CLCTs in @@ -226,10 +218,11 @@ class CSCMotherboard : public CSCBaseboard { const CSCALCTDigi& aLCT, const CSCCLCTDigi& cLCT, int type, int trknmb, CSCCorrelatedLCTDigi& lct) const; /* - This function copies valid ALCT/CLCT information to invalid the ALCT/CLCT - if present, so that we always construct the maximum number of valid LCts + These functions copy valid ALCT/CLCT information to invalid the ALCT/CLCT + if present, so that we always construct the maximum number of valid LCTs */ - void copyValidToInValid(CSCALCTDigi&, CSCALCTDigi&, CSCCLCTDigi&, CSCCLCTDigi&) const; + void copyValidToInValidALCT(CSCALCTDigi&, CSCALCTDigi&) const; + void copyValidToInValidCLCT(CSCCLCTDigi&, CSCCLCTDigi&) const; bool doesALCTCrossCLCT(const CSCALCTDigi&, const CSCCLCTDigi&) const; diff --git a/L1Trigger/CSCTriggerPrimitives/interface/GEMClusterProcessor.h b/L1Trigger/CSCTriggerPrimitives/interface/GEMClusterProcessor.h index 2878d150c46b5..031a821fa9e9a 100644 --- a/L1Trigger/CSCTriggerPrimitives/interface/GEMClusterProcessor.h +++ b/L1Trigger/CSCTriggerPrimitives/interface/GEMClusterProcessor.h @@ -4,7 +4,7 @@ /** \class GEMClusterProcessor * * \author Sven Dildick (Rice University) - * + * \updates by Giovanni Mocellin (UC Davis) */ #include "FWCore/ParameterSet/interface/ParameterSet.h" @@ -32,10 +32,7 @@ class GEMClusterProcessor { 1: single and coincidence, 2: only coincidence, 3: only single */ enum ClusterTypes { AllClusters = 1, SingleClusters = 2, CoincidenceClusters = 3 }; - std::vector getClusters(int bx, int deltaBX = 0, ClusterTypes option = AllClusters) const; - - /* Returns coincidence clusters for a given BX */ - std::vector getCoincidenceClusters(int bx) const; + std::vector getClusters(int bx, ClusterTypes option = AllClusters) const; /** Returns vector of CoPads in the read-out time window, if any. */ std::vector readoutCoPads() const; @@ -59,12 +56,14 @@ class GEMClusterProcessor { // for matching with CSC trigger primitives void doCoordinateConversion(); - /** Chamber id (trigger-type labels). */ + // Chamber id (trigger-type labels) const int region_; const int station_; const int chamber_; bool isEven_; + unsigned int tmbL1aWindowSize_; + unsigned int delayGEMinOTMB_; unsigned int maxDeltaPad_; unsigned int maxDeltaBX_; unsigned int maxDeltaRoll_; diff --git a/L1Trigger/CSCTriggerPrimitives/interface/GEMInternalCluster.h b/L1Trigger/CSCTriggerPrimitives/interface/GEMInternalCluster.h index 7173b36922275..97c8b121d18c3 100644 --- a/L1Trigger/CSCTriggerPrimitives/interface/GEMInternalCluster.h +++ b/L1Trigger/CSCTriggerPrimitives/interface/GEMInternalCluster.h @@ -7,9 +7,10 @@ * 1/2-strips, 1/8-strips and wiregroups for easy matching with CSC TPs * * Author: Sven Dildick (Rice University) - * + * Updates by Giovanni Mocellin (UC Davis) */ +#include "FWCore/ParameterSet/interface/ParameterSet.h" #include "DataFormats/MuonDetId/interface/GEMDetId.h" #include "DataFormats/GEMDigi/interface/GEMPadDigiCluster.h" #include "DataFormats/GEMDigi/interface/GEMPadDigi.h" @@ -18,14 +19,29 @@ class GEMInternalCluster { public: // constructor - GEMInternalCluster(const GEMDetId& id, const GEMPadDigiCluster& cluster1, const GEMPadDigiCluster& cluster2); + GEMInternalCluster(const GEMDetId& id1, + const GEMDetId& id2, + const GEMPadDigiCluster& cluster1, + const GEMPadDigiCluster& cluster2, + const unsigned delayGEMinOTMB, + const unsigned tmbL1aWindowSize); // empty object GEMInternalCluster(); - GEMDetId id() const { return id_; } + GEMDetId id1() const { return id1_; } + GEMDetId id2() const { return id2_; } GEMPadDigiCluster cl1() const { return cl1_; } GEMPadDigiCluster cl2() const { return cl2_; } + bool isMatchingLayer1() const { return isMatchingLayer1_; } + bool isMatchingLayer2() const { return isMatchingLayer2_; } + + // setter for coincidence + void set_coincidence(const bool isCoincidence) { isCoincidence_ = isCoincidence; } + + // setter for detIDs + void set_matchingLayer1(const bool isMatching) { isMatchingLayer1_ = isMatching; } + void set_matchingLayer2(const bool isMatching) { isMatchingLayer2_ = isMatching; } // an internal cluster is valid if at least one is valid bool isValid() const { return isValid_; } @@ -38,7 +54,8 @@ class GEMInternalCluster { GEMCoPadDigi copad() const; int bx() const { return bx_; } - int roll() const { return id_.roll(); } + int roll1() const { return id1_.roll(); } + int roll2() const { return id2_.roll(); } int layer1_pad() const { return layer1_pad_; } int layer1_size() const { return layer1_size_; } int layer2_pad() const { return layer2_pad_; } @@ -47,33 +64,13 @@ class GEMInternalCluster { int layer1_max_wg() const { return layer1_max_wg_; } int layer2_min_wg() const { return layer2_min_wg_; } int layer2_max_wg() const { return layer2_max_wg_; } - int min_wg() const; - int max_wg() const; bool isCoincidence() const { return isCoincidence_; } // return "key wiregroup" and "key half-strip" for a cluster // these are approximate numbers obviously for LCTs with lower quality - unsigned getKeyWG() const { return (min_wg() + max_wg()) / 2.; } - uint16_t getKeyStrip(int n = 2) const; - uint16_t getKeyStripME1a(int n = 2) const; - - // first and last 1/2-strips - int layer1_first_hs() const { return layer1_first_hs_; } - int layer2_first_hs() const { return layer2_first_hs_; } - int layer1_last_hs() const { return layer1_last_hs_; } - int layer2_last_hs() const { return layer2_last_hs_; } - - int layer1_first_hs_me1a() const { return layer1_first_hs_me1a_; } - int layer2_first_hs_me1a() const { return layer2_first_hs_me1a_; } - int layer1_last_hs_me1a() const { return layer1_last_hs_me1a_; } - int layer2_last_hs_me1a() const { return layer2_last_hs_me1a_; } - - // middle 1/2-strips (sum divided by two) - int layer1_middle_hs() const { return layer1_middle_hs_; } - int layer2_middle_hs() const { return layer2_middle_hs_; } - - int layer1_middle_hs_me1a() const { return layer1_middle_hs_me1a_; } - int layer2_middle_hs_me1a() const { return layer2_middle_hs_me1a_; } + unsigned getKeyWG() const { return (layer2_min_wg() + layer2_max_wg()) / 2.; } + uint16_t getKeyStrip(int n = 2, bool isLayer2 = false) const; + uint16_t getKeyStripME1a(int n = 2, bool isLayer2 = false) const; // first and last 1/8-strips int layer1_first_es() const { return layer1_first_es_; } @@ -93,23 +90,6 @@ class GEMInternalCluster { int layer1_middle_es_me1a() const { return layer1_middle_es_me1a_; } int layer2_middle_es_me1a() const { return layer2_middle_es_me1a_; } - // setters for first/last 1/2-strip - void set_layer1_first_hs(const int hs) { layer1_first_hs_ = hs; } - void set_layer2_first_hs(const int hs) { layer2_first_hs_ = hs; } - void set_layer1_last_hs(const int hs) { layer1_last_hs_ = hs; } - void set_layer2_last_hs(const int hs) { layer2_last_hs_ = hs; } - - void set_layer1_first_hs_me1a(const int hs) { layer1_first_hs_me1a_ = hs; } - void set_layer2_first_hs_me1a(const int hs) { layer2_first_hs_me1a_ = hs; } - void set_layer1_last_hs_me1a(const int hs) { layer1_last_hs_me1a_ = hs; } - void set_layer2_last_hs_me1a(const int hs) { layer2_last_hs_me1a_ = hs; } - - // setters for middle 1/2-strip - void set_layer1_middle_hs(const int hs) { layer1_middle_hs_ = hs; } - void set_layer2_middle_hs(const int hs) { layer2_middle_hs_ = hs; } - void set_layer1_middle_hs_me1a(const int hs) { layer1_middle_hs_me1a_ = hs; } - void set_layer2_middle_hs_me1a(const int hs) { layer2_middle_hs_me1a_ = hs; } - // setters for first/last 1/8-strip void set_layer1_first_es(const int es) { layer1_first_es_ = es; } void set_layer2_first_es(const int es) { layer2_first_es_ = es; } @@ -140,15 +120,19 @@ class GEMInternalCluster { private: /* - Detector id. There are three cases. For single clusters in layer 1 - the GEMDetId in layer 1 is stored. Similarly, for single clusters in - layer 2 the GEMDetId in layer 2 is stored. For coincidences the GEMDetId - in layer 1 is stored + Detector id. For single clusters in layer 1 the GEMDetId in layer 1 is stored. + Similarly, for single clusters in layer 2 the GEMDetId in layer 2 is stored. + For coincidences the GEMDetId both are stored. */ - GEMDetId id_; + GEMDetId id1_; + GEMDetId id2_; GEMPadDigiCluster cl1_; GEMPadDigiCluster cl2_; + // set matches to false first + bool isMatchingLayer1_; + bool isMatchingLayer2_; + bool isValid_; // bunch crossing @@ -162,25 +146,6 @@ class GEMInternalCluster { int layer2_pad_; int layer2_size_; - // corresponding CSC 1/2-strip coordinates (es) of the cluster - // in each layer (if applicable) - int layer1_first_hs_; - int layer1_last_hs_; - int layer2_first_hs_; - int layer2_last_hs_; - // for ME1/a - int layer1_first_hs_me1a_; - int layer1_last_hs_me1a_; - int layer2_first_hs_me1a_; - int layer2_last_hs_me1a_; - - // middle CSC 1/2-strip - int layer1_middle_hs_; - int layer2_middle_hs_; - // for ME1/a - int layer1_middle_hs_me1a_; - int layer2_middle_hs_me1a_; - // corresponding CSC 1/8-strip coordinates (es) of the cluster // in each layer (if applicable) int layer1_first_es_; diff --git a/L1Trigger/CSCTriggerPrimitives/interface/LCTQualityAssignment.h b/L1Trigger/CSCTriggerPrimitives/interface/LCTQualityAssignment.h index e7ffa4bd02c69..b13c35070721f 100644 --- a/L1Trigger/CSCTriggerPrimitives/interface/LCTQualityAssignment.h +++ b/L1Trigger/CSCTriggerPrimitives/interface/LCTQualityAssignment.h @@ -10,6 +10,7 @@ * which receive GEM information. * * \author Sven Dildick (Rice University) + * \updates by Giovanni Mocellin (UC Davis) * */ @@ -46,8 +47,8 @@ class LCTQualityAssignment : public CSCBaseboard { // See DN-20-016 enum class LCT_QualityRun3GEM : unsigned int { INVALID = 0, - ALCT_2GEM = 1, - CLCT_2GEM = 2, + CLCT_2GEM = 1, + ALCT_2GEM = 2, ALCT_CLCT = 3, ALCT_CLCT_1GEM_CSCBend = 4, ALCT_CLCT_1GEM_GEMCSCBend = 5, @@ -76,10 +77,10 @@ class LCTQualityAssignment : public CSCBaseboard { unsigned findQuality(const CSCCLCTDigi& cLCT, const GEMInternalCluster& cl) const; private: - // quality for all LCTs in Run-1 and Run-2 (CCLUT off) + // quality for all LCTs in Run-1 and Run-2 (run-3 mode off) unsigned findQualityRun2(const CSCALCTDigi& aLCT, const CSCCLCTDigi& cLCT) const; - // quality for non-ME1/1 LCTs in Run-3 without GEMs (CCLUT on) + // quality for non-ME1/1 LCTs in Run-3 without GEMs (run-3 mode on) unsigned findQualityRun3(const CSCALCTDigi& aLCT, const CSCCLCTDigi& cLCT) const; // quality for LCTs in Run-3 with GEMs (CCLUT off) @@ -87,7 +88,7 @@ class LCTQualityAssignment : public CSCBaseboard { unsigned findQualityGEMv1(const CSCCLCTDigi&, const GEMInternalCluster& cl) const; unsigned findQualityGEMv1(const CSCALCTDigi&, const CSCCLCTDigi&, const GEMInternalCluster& cl) const; - // quality for LCTs in Run-3 with GEMs (CCLUT on( + // quality for LCTs in Run-3 with GEMs (CCLUT on) unsigned findQualityGEMv2(const CSCALCTDigi&, const CSCCLCTDigi&, const GEMInternalCluster& cl) const; bool assignGEMCSCBending_; diff --git a/L1Trigger/CSCTriggerPrimitives/python/cscTriggerPrimitiveDigis_cfi.py b/L1Trigger/CSCTriggerPrimitives/python/cscTriggerPrimitiveDigis_cfi.py index 4e8c92f44ef47..44e5948595c22 100644 --- a/L1Trigger/CSCTriggerPrimitives/python/cscTriggerPrimitiveDigis_cfi.py +++ b/L1Trigger/CSCTriggerPrimitives/python/cscTriggerPrimitiveDigis_cfi.py @@ -63,7 +63,9 @@ from Configuration.Eras.Modifier_run3_common_cff import run3_common run3_common.toModify( cscTriggerPrimitiveDigis, keepShowers = True, - commonParam = dict(runPhase2 = True, + commonParam = dict(run3 = True, + runCCLUT_OTMB = True, + runPhase2 = True, runME11Up = True, runME21Up = True, runME31Up = True, diff --git a/L1Trigger/CSCTriggerPrimitives/python/params/auxiliaryParams.py b/L1Trigger/CSCTriggerPrimitives/python/params/auxiliaryParams.py index 8dc897d33a94a..02bbd0cc7dafd 100644 --- a/L1Trigger/CSCTriggerPrimitives/python/params/auxiliaryParams.py +++ b/L1Trigger/CSCTriggerPrimitives/python/params/auxiliaryParams.py @@ -28,6 +28,9 @@ runME11ILT = cms.bool(False), runME21ILT = cms.bool(False), + # Run-3 mode + run3 = cms.bool(False), + # comparator-code algorithm to improve # CLCT position and bending resolution # CCLUT for TMB is NOT planned for startup Run-3 diff --git a/L1Trigger/CSCTriggerPrimitives/python/params/clctParams.py b/L1Trigger/CSCTriggerPrimitives/python/params/clctParams.py index 3419d1573d3c9..8d8ed0c569fc7 100644 --- a/L1Trigger/CSCTriggerPrimitives/python/params/clctParams.py +++ b/L1Trigger/CSCTriggerPrimitives/python/params/clctParams.py @@ -34,7 +34,7 @@ # Parameters for upgrade CLCT processors clctPhase2 = clctPhase1.clone( # decrease possible minimal #HS distance between two CLCTs in a BX from 10 to 5: - clctMinSeparation = 5, + clctMinSeparation = 5, # Turns on algorithms of localized dead-time zones: useDeadTimeZoning = True, @@ -49,11 +49,9 @@ clctPretriggerTriggerZone = cms.uint32(224), ) -# in the GEM-CSC trigger, we can lower the CLCT threshold from 4 to 3, -# provided there is at least one matching GEM cluster. This cluster matching -# is done in the CSCGEMMatcher +# CLCT threshold still set to 4 for now clctPhase2GEM = clctPhase2.clone( - clctNplanesHitPattern = 3 + clctNplanesHitPattern = 4 ) clctPSets = cms.PSet( diff --git a/L1Trigger/CSCTriggerPrimitives/python/params/gemcscParams.py b/L1Trigger/CSCTriggerPrimitives/python/params/gemcscParams.py index 96747607e171c..fd06735e72ab6 100644 --- a/L1Trigger/CSCTriggerPrimitives/python/params/gemcscParams.py +++ b/L1Trigger/CSCTriggerPrimitives/python/params/gemcscParams.py @@ -3,7 +3,7 @@ # GEM coincidence pad processors copadParamGE11 = cms.PSet( verbosity = cms.uint32(0), - maxDeltaPad = cms.uint32(4), + maxDeltaPad = cms.uint32(8), maxDeltaRoll = cms.uint32(1), maxDeltaBX = cms.uint32(0) ) diff --git a/L1Trigger/CSCTriggerPrimitives/python/params/tmbParams.py b/L1Trigger/CSCTriggerPrimitives/python/params/tmbParams.py index 880d952744e03..ee374a4eee1c3 100644 --- a/L1Trigger/CSCTriggerPrimitives/python/params/tmbParams.py +++ b/L1Trigger/CSCTriggerPrimitives/python/params/tmbParams.py @@ -34,7 +34,7 @@ matchEarliestClctOnly = cms.bool(True), # For ALCT-centric matching, whether to drop CLCTs that were matched # to ALCTs in this BX, and not use them in the following BX - tmbDropUsedClcts = cms.bool(True), + tmbDropUsedClcts = cms.bool(False), # True: allow construction of unphysical LCTs # in ME11 for which WG and HS do not intersect. # False: do not build such unphysical LCTs @@ -47,64 +47,69 @@ # to be used by ME11 chambers with upgraded TMB and ALCT tmbPhase2 = tmbPhase1.clone( - # reduce ALCT-CLCT matching window size from 7 to 5 - matchTrigWindowSize = 5, - # LCTs found in the window [6, 7, 8, 9, 10] are good - tmbL1aWindowSize = 5, + # ALCT-CLCT stays at 7 for the moment + matchTrigWindowSize = 7, + # LCTs found in the window [5, 6, 7, 8, 9, 10, 11] are good + tmbL1aWindowSize = 7, tmbDropUsedClcts = False, ) tmbPhase2GEM = tmbPhase2.clone( # matching to GEM clusters in time - maxDeltaBXALCTGEM = cms.uint32(1), - maxDeltaBXCLCTGEM = cms.uint32(2), - # True: use the half-strip coordinate to match - # GEM with CSC TPs - # False: use the eighth-strip coordinate + CCLUT slope - # to match GEM with CSC TPs - matchWithHS = cms.bool(True), + windowBXALCTGEM = cms.uint32(3), + windowBXCLCTGEM = cms.uint32(7), + # Set to True for matching CLCT and GEM clusters by "propagating" + # CLCT slope to GEM. Otherwise, just matching keystrip positions + matchCLCTpropagation = cms.bool(True), # efficiency recovery switches - dropLowQualityALCTsNoGEMs = cms.bool(False), - dropLowQualityCLCTsNoGEMs = cms.bool(True), - buildLCTfromALCTCLCTand2GEM = cms.bool(True), - buildLCTfromALCTCLCTand1GEM = cms.bool(True), + dropLowQualityALCTs = cms.bool(True), + dropLowQualityCLCTs = cms.bool(True), buildLCTfromALCTandGEM = cms.bool(True), - buildLCTfromCLCTandGEM = cms.bool(True), + buildLCTfromCLCTandGEM = cms.bool(False), # assign GEM-CSC bending angle. Works only for # Run-3 GEM-CSC TPs. - assignGEMCSCBending = cms.bool(False), - # whether to drop GEMs that were matched to ALCTs or CLCTs - # in this BX, and not use them in the following BX - tmbDropUsedGems = cms.bool(False), - # For ALCT-centric matching to GEMs, break after finding - # the first BX with matching GEM coincidence clusters - matchEarliestGemsOnly = cms.bool(True), + assignGEMCSCBending = cms.bool(True), # When running the GEM-CSC matching, whether to mitigate # the slope of CLCTs with high, meaning inconsistent, # values of cosi (consistency of slope indicator) # to optimize GEM-CSC slope correction - mitigateSlopeByCosi = cms.bool(True), + mitigateSlopeByCosi = cms.bool(False), + # Preferred order of bunchcrossing difference between CSC minus GEM BX for matching + BunchCrossingCSCminGEMwindow = cms.vint32(0, -1, 1, -2, 2, -3, 3) ) # to be used by ME11 chambers with GEM-CSC ILT tmbPhase2GE11 = tmbPhase2GEM.clone( - # matching to GEM clusters with half-strips - maxDeltaHsEven = cms.uint32(7), - maxDeltaHsOdd = cms.uint32(16), - maxDeltaHsEvenME1a = cms.uint32(5), - maxDeltaHsOddME1a = cms.uint32(12), + # match ME1a with GEM (it affects CLCT-GEM match) + enableMatchGEMandME1a = cms.bool(True), + # match ME1b with GEM (it affects CLCT-GEM match) + enableMatchGEMandME1b = cms.bool(True), + # matching windows for ALCT-GEM clusters in wiregroups + maxDeltaWG = cms.uint32(7), + # matching windows for CLCT-GEM clusters in half strip units + maxDeltaHsEven = cms.uint32(5), + maxDeltaHsOdd = cms.uint32(10), # efficiency recovery switches - dropLowQualityCLCTsNoGEMs_ME1a = cms.bool(True), - buildLCTfromALCTandGEM_ME1a = cms.bool(True), - buildLCTfromCLCTandGEM_ME1a = cms.bool(True), + dropLowQualityCLCTs_ME1a = cms.bool(True), + # delay applied in OTMB to GEM trigger primitives + delayGEMinOTMB = cms.uint32(0) ) # to be used by ME21 chambers with GEM-CSC ILT tmbPhase2GE21 = tmbPhase2GEM.clone( - # matching to GEM clusters with half-strips - maxDeltaHsEven = cms.uint32(3), - maxDeltaHsOdd = cms.uint32(5), - dropLowQualityALCTsNoGEMs = True, + # match ME1a with GEM (it affects CLCT-GEM match) + enableMatchGEMandME1a = cms.bool(True), + # match ME1b with GEM (it affects CLCT-GEM match) + enableMatchGEMandME1b = cms.bool(True), + # matching windows for ALCT-GEM clusters in wiregroups + maxDeltaWG = cms.uint32(7), + # matching windows for CLCT-GEM clusters in half strip units + maxDeltaHsEven = cms.uint32(5), + maxDeltaHsOdd = cms.uint32(10), + # efficiency recovery switches + dropLowQualityCLCTs_ME1a = cms.bool(True), + # delay applied in OTMB to GEM trigger primitives + delayGEMinOTMB = cms.uint32(0) ) tmbPSets = cms.PSet( diff --git a/L1Trigger/CSCTriggerPrimitives/src/CSCBaseboard.cc b/L1Trigger/CSCTriggerPrimitives/src/CSCBaseboard.cc index 1351fce105ccd..403cf8af85d08 100644 --- a/L1Trigger/CSCTriggerPrimitives/src/CSCBaseboard.cc +++ b/L1Trigger/CSCTriggerPrimitives/src/CSCBaseboard.cc @@ -48,6 +48,7 @@ CSCBaseboard::CSCBaseboard(unsigned endcap, runME11ILT_ = commonParams_.getParameter("runME11ILT"); runME21ILT_ = commonParams_.getParameter("runME21ILT"); + run3_ = commonParams_.getParameter("run3"); runCCLUT_TMB_ = commonParams_.getParameter("runCCLUT_TMB"); runCCLUT_OTMB_ = commonParams_.getParameter("runCCLUT_OTMB"); // check if CCLUT should be on in this chamber diff --git a/L1Trigger/CSCTriggerPrimitives/src/CSCCathodeLCTProcessor.cc b/L1Trigger/CSCTriggerPrimitives/src/CSCCathodeLCTProcessor.cc index 6250745f65299..3bf4626b1afb1 100644 --- a/L1Trigger/CSCTriggerPrimitives/src/CSCCathodeLCTProcessor.cc +++ b/L1Trigger/CSCTriggerPrimitives/src/CSCCathodeLCTProcessor.cc @@ -325,7 +325,7 @@ void CSCCathodeLCTProcessor::run( // This version of the run() function can either be called in a standalone // test, being passed the halfstrip times, or called by the // run() function above. It uses the findLCTs() method to find vectors - // of LCT candidates. These candidates are sorted and the best two per bx + // of LCT candidates. These candidates are already sorted and the best two per bx // are returned. // initialize the pulse array. @@ -334,10 +334,6 @@ void CSCCathodeLCTProcessor::run( std::vector CLCTlist = findLCTs(halfstrip); - // LCT sorting. - if (CLCTlist.size() > 1) - sort(CLCTlist.begin(), CLCTlist.end(), std::greater()); - for (const auto& p : CLCTlist) { const int bx = p.getBX(); if (bx >= CSCConstants::MAX_CLCT_TBINS) { @@ -647,6 +643,45 @@ std::vector CSCCathodeLCTProcessor::findLCTs( tempSecondCLCT = constructCLCT(first_bx, best_hs, hits_in_patterns[best_hs][best_pid[best_hs]]); } } + + // Sort bestCLCT and secondALCT by quality + // if qualities are the same, sort by run-2 or run-3 pattern + // if qualities and patterns are the same, sort by half strip number + bool changeOrder = false; + + unsigned qualityBest = 0, qualitySecond = 0; + unsigned patternBest = 0, patternSecond = 0; + unsigned halfStripBest = 0, halfStripSecond = 0; + + if (tempBestCLCT.isValid() and tempSecondCLCT.isValid()) { + qualityBest = tempBestCLCT.getQuality(); + qualitySecond = tempSecondCLCT.getQuality(); + if (!runCCLUT_) { + patternBest = tempBestCLCT.getPattern(); + patternSecond = tempSecondCLCT.getPattern(); + } else { + patternBest = tempBestCLCT.getRun3Pattern(); + patternSecond = tempSecondCLCT.getRun3Pattern(); + } + halfStripBest = tempBestCLCT.getKeyStrip(); + halfStripSecond = tempSecondCLCT.getKeyStrip(); + + if (qualitySecond > qualityBest) + changeOrder = true; + else if ((qualitySecond == qualityBest) and (int(patternSecond / 2) > int(patternBest / 2))) + changeOrder = true; + else if ((qualitySecond == qualityBest) and (int(patternSecond / 2) == int(patternBest / 2)) and + (halfStripSecond < halfStripBest)) + changeOrder = true; + } + + CSCCLCTDigi tempCLCT; + if (changeOrder) { + tempCLCT = tempBestCLCT; + tempBestCLCT = tempSecondCLCT; + tempSecondCLCT = tempCLCT; + } + // add the CLCTs to the collection if (tempBestCLCT.isValid()) { lctList.push_back(tempBestCLCT); diff --git a/L1Trigger/CSCTriggerPrimitives/src/CSCGEMMatcher.cc b/L1Trigger/CSCTriggerPrimitives/src/CSCGEMMatcher.cc index 5861e46d02807..27aa1329dd64a 100644 --- a/L1Trigger/CSCTriggerPrimitives/src/CSCGEMMatcher.cc +++ b/L1Trigger/CSCTriggerPrimitives/src/CSCGEMMatcher.cc @@ -13,23 +13,14 @@ CSCGEMMatcher::CSCGEMMatcher( : endcap_(endcap), station_(station), chamber_(chamber) { isEven_ = (chamber_ % 2 == 0); - // These LogErrors are sanity checks and should not be printed - if (station_ == 3 or station_ == 4) { - edm::LogError("CSCGEMMatcher") << "Class constructed for a chamber in ME3 or ME4!"; - }; - - maxDeltaBXALCTGEM_ = tmbParams.getParameter("maxDeltaBXALCTGEM"); - maxDeltaBXCLCTGEM_ = tmbParams.getParameter("maxDeltaBXCLCTGEM"); - - matchWithHS_ = tmbParams.getParameter("matchWithHS"); + enable_match_gem_me1a_ = tmbParams.getParameter("enableMatchGEMandME1a"); + enable_match_gem_me1b_ = tmbParams.getParameter("enableMatchGEMandME1b"); + maxDeltaWG_ = tmbParams.getParameter("maxDeltaWG"); maxDeltaHsEven_ = tmbParams.getParameter("maxDeltaHsEven"); maxDeltaHsOdd_ = tmbParams.getParameter("maxDeltaHsOdd"); - if (station_ == 1) { - maxDeltaHsEvenME1a_ = tmbParams.getParameter("maxDeltaHsEvenME1a"); - maxDeltaHsOddME1a_ = tmbParams.getParameter("maxDeltaHsOddME1a"); - } + matchCLCTpropagation_ = tmbParams.getParameter("matchCLCTpropagation"); mitigateSlopeByCosi_ = tmbParams.getParameter("mitigateSlopeByCosi"); assign_gem_csc_bending_ = tmbParams.getParameter("assignGEMCSCBending"); @@ -39,224 +30,182 @@ void CSCGEMMatcher::setESLookupTables(const CSCL1TPLookupTableME11ILT* conf) { l void CSCGEMMatcher::setESLookupTables(const CSCL1TPLookupTableME21ILT* conf) { lookupTableME21ILT_ = conf; } -unsigned CSCGEMMatcher::calculateGEMCSCBending(const CSCCLCTDigi& clct, const GEMInternalCluster& cluster) const { - // difference in 1/8-strip number - const unsigned diff = std::abs(int(clct.getKeyStrip(8)) - int(cluster.getKeyStrip(8))); +//############################################################## +// Best clusters by location +//############################################################## - unsigned slope = 0; - - // need LUT to convert differences in 1/8-strips between GEM and CSC to slope - if (station_ == 2) { - if (isEven_) { - if (cluster.id().layer() == 1) - slope = lookupTableME21ILT_->es_diff_slope_L1_ME21_even(diff); - else - slope = lookupTableME21ILT_->es_diff_slope_L2_ME21_even(diff); - } else { - if (cluster.id().layer() == 1) - slope = lookupTableME21ILT_->es_diff_slope_L1_ME21_odd(diff); - else - slope = lookupTableME21ILT_->es_diff_slope_L2_ME21_odd(diff); - } - } else if (station_ == 1) { - if (clct.getKeyStrip() > CSCConstants::MAX_HALF_STRIP_ME1B) { //is in ME1a - if (isEven_) { - if (cluster.id().layer() == 1) - slope = lookupTableME11ILT_->es_diff_slope_L1_ME1a_even(diff); - else - slope = lookupTableME11ILT_->es_diff_slope_L2_ME1a_even(diff); - } else { - if (cluster.id().layer() == 1) - slope = lookupTableME11ILT_->es_diff_slope_L1_ME1a_odd(diff); - else - slope = lookupTableME11ILT_->es_diff_slope_L2_ME1a_odd(diff); - } - } else { - if (isEven_) { - if (cluster.id().layer() == 1) - slope = lookupTableME11ILT_->es_diff_slope_L1_ME1b_even(diff); - else - slope = lookupTableME11ILT_->es_diff_slope_L2_ME1b_even(diff); - } else { - if (cluster.id().layer() == 1) - slope = lookupTableME11ILT_->es_diff_slope_L1_ME1b_odd(diff); - else - slope = lookupTableME11ILT_->es_diff_slope_L2_ME1b_odd(diff); - } - } - } - - return slope; -} - -// match an ALCT to GEMInternalCluster by bunch-crossing -void CSCGEMMatcher::matchingClustersBX(const CSCALCTDigi& alct, - const GEMInternalClusters& clusters, - GEMInternalClusters& output) const { +void CSCGEMMatcher::bestClusterLoc(const CSCALCTDigi& alct, + const GEMInternalClusters& clusters, + GEMInternalCluster& best) const { if (!alct.isValid() or clusters.empty()) return; - // select clusters matched in time - for (const auto& cl : clusters) { - const unsigned diff = std::abs(int(alct.getBX()) - cl.bx()); - if (diff <= maxDeltaBXALCTGEM_) - output.push_back(cl); - } + // match spatially + GEMInternalClusters clustersLoc; + matchingClustersLoc(alct, clusters, clustersLoc); + + // simply pick the first matching one + if (!clustersLoc.empty()) + best = clustersLoc[0]; } -// match a CLCT to GEMInternalCluster by bunch-crossing -void CSCGEMMatcher::matchingClustersBX(const CSCCLCTDigi& clct, - const GEMInternalClusters& clusters, - GEMInternalClusters& output) const { +void CSCGEMMatcher::bestClusterLoc(const CSCCLCTDigi& clct, + const GEMInternalClusters& clusters, + GEMInternalCluster& best) const { if (!clct.isValid() or clusters.empty()) return; - // select clusters matched in time - for (const auto& cl : clusters) { - const unsigned diff = std::abs(int(clct.getBX()) - cl.bx()); - if (diff <= maxDeltaBXCLCTGEM_) - output.push_back(cl); - } + // match spatially + bool ignoreALCTGEMmatch = true; + GEMInternalClusters clustersLoc; + matchingClustersLoc(clct, clusters, clustersLoc, ignoreALCTGEMmatch); + + // the first matching one is also the closest in phi distance (to expected position, if extrapolating), by ordered list in CLCT matching + if (!clustersLoc.empty()) + best = clustersLoc[0]; } -// match an ALCT and CLCT to GEMInternalCluster by bunch-crossing -void CSCGEMMatcher::matchingClustersBX(const CSCALCTDigi& alct, - const CSCCLCTDigi& clct, - const GEMInternalClusters& clusters, - GEMInternalClusters& output) const { - // both need to be valid +void CSCGEMMatcher::bestClusterLoc(const CSCALCTDigi& alct, + const CSCCLCTDigi& clct, + const GEMInternalClusters& clusters, + GEMInternalCluster& best) const { if (!alct.isValid() or !clct.isValid() or clusters.empty()) return; - // get the single matches - GEMInternalClusters alctClusters, clctClusters; - matchingClustersBX(alct, clusters, alctClusters); - matchingClustersBX(clct, clusters, clctClusters); - - // get the intersection - for (const auto& p : alctClusters) { - for (const auto& q : clctClusters) { - if (p == q) { - output.push_back(p); - } - } + // match spatially + GEMInternalClusters clustersLoc; + matchingClustersLoc(alct, clct, clusters, clustersLoc); + + // the first matching one is also the closest in phi distance (to expected position, if extrapolating), by ordered list in CLCT matching + if (!clustersLoc.empty()) { + best = clustersLoc[0]; + if (best.isCoincidence() and !best.isMatchingLayer1() and best.isMatchingLayer2()) + best.set_coincidence(false); + // std::cout << "\nGEM selected: " << best << "\n" << std::endl; } } +//############################################################## +// Matching by locations +//############################################################## + +// match an ALCT to GEMInternalCluster by location void CSCGEMMatcher::matchingClustersLoc(const CSCALCTDigi& alct, const GEMInternalClusters& clusters, GEMInternalClusters& output) const { if (!alct.isValid() or clusters.empty()) return; + int number_of_wg = 0; + if (station_ == 1) + number_of_wg = CSCConstants::NUM_WIREGROUPS_ME11; + else if (station_ == 2) + number_of_wg = CSCConstants::NUM_WIREGROUPS_ME21; + // select clusters matched in wiregroup + for (const auto& cl : clusters) { - // for now add 10 wiregroups to make sure the matching can be done - // this should be quite generous - unsigned deltaWG(station_ == 1 ? 10 : 20); - if (cl.min_wg() <= alct.getKeyWG() and alct.getKeyWG() <= cl.max_wg() + deltaWG) { + // std::cout << "GEM cluster: " << cl << std::endl; + bool isMatchedLayer1 = false; + bool isMatchedLayer2 = false; + + if (cl.id1().layer() == 1) { // cluster has valid layer 1 + int min_wg = std::max(0, int(cl.layer1_min_wg() - maxDeltaWG_)); + int max_wg = std::min(number_of_wg - 1, int(cl.layer1_max_wg() + maxDeltaWG_)); + if (min_wg <= alct.getKeyWG() and alct.getKeyWG() <= max_wg) + isMatchedLayer1 = true; + } + if (cl.id2().layer() == 2) { // cluster has valid layer 2 + int min_wg = std::max(0, int(cl.layer2_min_wg() - maxDeltaWG_)); + int max_wg = std::min(number_of_wg - 1, int(cl.layer2_max_wg() + maxDeltaWG_)); + if (min_wg <= alct.getKeyWG() and alct.getKeyWG() <= max_wg) + isMatchedLayer2 = true; + } + + // std::cout << "ALCT-GEM matching L1-L2: " << isMatchedLayer1 << " " << isMatchedLayer2 << std::endl; + + if (isMatchedLayer1 or isMatchedLayer2) { output.push_back(cl); + if (isMatchedLayer1) + output.back().set_matchingLayer1(true); + if (isMatchedLayer2) + output.back().set_matchingLayer2(true); } } } +// match a CLCT to GEMInternalCluster by location void CSCGEMMatcher::matchingClustersLoc(const CSCCLCTDigi& clct, const GEMInternalClusters& clusters, - GEMInternalClusters& output) const { + GEMInternalClusters& output, + bool ignoreALCTGEMmatch) const { if (!clct.isValid() or clusters.empty()) return; - // select clusters matched by 1/2-strip or 1/8-strip - for (const auto& cl : clusters) { - const bool isMatched(matchWithHS_ ? matchedClusterLocHS(clct, cl) : matchedClusterLocES(clct, cl)); - if (isMatched) { - output.push_back(cl); - } - } -} + if (station_ == 1 and !enable_match_gem_me1a_ and !enable_match_gem_me1b_) + return; -// match by 1/2-strip -bool CSCGEMMatcher::matchedClusterLocHS(const CSCCLCTDigi& clct, const GEMInternalCluster& cluster) const { const bool isME1a(station_ == 1 and clct.getKeyStrip() > CSCConstants::MAX_HALF_STRIP_ME1B); - unsigned halfStripDiff = std::abs(int(clct.getKeyStrip(2)) - int(cluster.getKeyStrip(2))); - if (isME1a) { - halfStripDiff = std::abs(int(clct.getKeyStrip(2)) - int(cluster.getKeyStripME1a(2))); - } - - // 98% acceptance cuts - unsigned halfStripCut; - if (isEven_) { - if (isME1a) - halfStripCut = maxDeltaHsEvenME1a_; - else - halfStripCut = maxDeltaHsEven_; - } else { - if (isME1a) - halfStripCut = maxDeltaHsOddME1a_; - else - halfStripCut = maxDeltaHsOdd_; - } - // 10 degree chamber is ~0.18 radian wide - // 98% acceptance for clusters in odd/even chambers for muons with 5 GeV - // {5, 0.02123785, 0.00928431} - // This corresponds to 0.12 and 0.052 fractions of the chamber - // or 16 and 7 half-strips - - // 20 degree chamber is ~0.35 radian wide - // 98% acceptance for clusters in odd/even chambers for muons with 5 GeV - // {5, 0.01095490, 0.00631625}, - // This corresponds to 0.031 and 0.018 fractions of the chamber - // or 5 and 3 half-strips - - return halfStripDiff <= halfStripCut; -} - -// match by 1/8-strip -bool CSCGEMMatcher::matchedClusterLocES(const CSCCLCTDigi& clct, const GEMInternalCluster& cl) const { - // key 1/8-strip - int key_es = -1; + //determine window size + unsigned eighthStripCut = isEven_ ? 4 * maxDeltaHsEven_ : 4 * maxDeltaHsOdd_; // Cut in 1/8 = 4 * cut in 1/2 - //modification of DeltaStrip by CLCT slope - int SlopeShift = 0; - uint16_t baseSlope = 0; - if (mitigateSlopeByCosi_) - baseSlope = mitigatedSlopeByConsistency(clct); - else - baseSlope = clct.getSlope(); - int clctSlope = pow(-1, clct.getBend()) * baseSlope; - - // for coincidences or single clusters in L1 - if (cl.isCoincidence() or cl.id().layer() == 1) { - key_es = cl.layer1_middle_es(); - if (station_ == 1 and clct.getKeyStrip() > CSCConstants::MAX_HALF_STRIP_ME1B) - key_es = cl.layer1_middle_es_me1a(); - - //set SlopeShift for L1 or Copad case - SlopeShift = - CSCGEMSlopeCorrector(true, clctSlope); // fixed to facing detectors, must be determined at motherboard level - } - - // for single clusters in L2 - else if (cl.id().layer() == 2) { - key_es = cl.layer2_middle_es(); - if (station_ == 1 and clct.getKeyStrip() > CSCConstants::MAX_HALF_STRIP_ME1B) - key_es = cl.layer2_middle_es_me1a(); + for (const auto& cl : clusters) { + // std::cout << "GEM cluster: " << cl << std::endl; + // if (!ignoreALCTGEMmatch) std::cout << "IN CLCT-GEM => ALCT-GEM matching L1-L2: " << cl.isMatchingLayer1() << " " << cl.isMatchingLayer2() << std::endl; + + bool isMatchedLayer1 = false; + bool isMatchedLayer2 = false; + + if (cl.id1().layer() == 1) { // cluster has valid layer 1 + if ((station_ == 1 and enable_match_gem_me1a_ and + ((isME1a and cl.roll1() == 8) or (!isME1a and cl.roll1() < 8))) or + (station_ == 1 and !enable_match_gem_me1a_ and !isME1a) or (station_ == 2)) { + constexpr bool isLayer2 = false; + unsigned distanceES = abs(matchedClusterDistES(clct, cl, isLayer2, false)); + if (distanceES <= eighthStripCut) + isMatchedLayer1 = true; + } + } + if (cl.id2().layer() == 2) { // cluster has valid layer 2 + if ((station_ == 1 and enable_match_gem_me1a_ and + ((isME1a and cl.roll2() == 8) or (!isME1a and cl.roll2() < 8))) or + (station_ == 1 and !enable_match_gem_me1a_ and !isME1a) or (station_ == 2)) { + constexpr bool isLayer2 = true; + unsigned distanceES = abs(matchedClusterDistES(clct, cl, isLayer2, false)); + if (distanceES <= eighthStripCut) + isMatchedLayer2 = true; + } + } - //set SlopeShift for L2 case - SlopeShift = - CSCGEMSlopeCorrector(false, clctSlope); // fixed to facing detectors, must be determined at motherboard level + // std::cout << "CLCT-GEM matching L1-L2: " << isMatchedLayer1 << " " << isMatchedLayer2 << std::endl; + if (((ignoreALCTGEMmatch or cl.isMatchingLayer1()) and isMatchedLayer1) or + ((ignoreALCTGEMmatch or cl.isMatchingLayer2()) and isMatchedLayer2)) { + output.push_back(cl); + output.back().set_matchingLayer1(false); + output.back().set_matchingLayer2(false); + if ((ignoreALCTGEMmatch or cl.isMatchingLayer1()) and isMatchedLayer1) + output.back().set_matchingLayer1(true); + if ((ignoreALCTGEMmatch or cl.isMatchingLayer2()) and isMatchedLayer2) + output.back().set_matchingLayer2(true); + } } - else - edm::LogWarning("CSCGEMMatcher") << "cluster.id().layer =" << cl.id().layer() << " out of acceptable range 1-2!"; - - // matching by 1/8-strip - // determine matching window by chamber, assuming facing chambers only are processed - int window = chamber_ % 2 == 0 ? 20 : 40; - - return std::abs(clct.getKeyStrip(8) - key_es + SlopeShift) < window; + // Sorting of matching cluster prefers copads and ordering by smallest relative distance + std::sort( + output.begin(), output.end(), [clct, this](const GEMInternalCluster cl1, const GEMInternalCluster cl2) -> bool { + if (cl1.isCoincidence() and !cl2.isCoincidence()) + return cl1.isCoincidence(); + else if ((cl1.isCoincidence() and cl2.isCoincidence()) or (!cl1.isCoincidence() and !cl2.isCoincidence())) { + bool cl1_isLayer2 = !cl1.isMatchingLayer1() and cl1.isMatchingLayer2(); + bool cl2_isLayer2 = !cl2.isMatchingLayer1() and cl2.isMatchingLayer2(); + unsigned cl1_distanceES = abs(matchedClusterDistES(clct, cl1, cl1_isLayer2, false)); + unsigned cl2_distanceES = abs(matchedClusterDistES(clct, cl2, cl2_isLayer2, false)); + return cl1_distanceES < cl2_distanceES; + } else + return false; + }); } void CSCGEMMatcher::matchingClustersLoc(const CSCALCTDigi& alct, @@ -268,108 +217,50 @@ void CSCGEMMatcher::matchingClustersLoc(const CSCALCTDigi& alct, return; // get the single matches - GEMInternalClusters alctClusters, clctClusters; + bool ignoreALCTGEMmatch = false; + GEMInternalClusters alctClusters; matchingClustersLoc(alct, clusters, alctClusters); - matchingClustersLoc(clct, clusters, clctClusters); - - // get the intersection - for (const auto& p : alctClusters) { - for (const auto& q : clctClusters) { - if (p == q) { - output.push_back(p); - } - } - } + matchingClustersLoc(clct, alctClusters, output, ignoreALCTGEMmatch); } -void CSCGEMMatcher::matchingClustersBXLoc(const CSCALCTDigi& alct, - const GEMInternalClusters& clusters, - GEMInternalClusters& output) const { - if (!alct.isValid() or clusters.empty()) - return; - - // match by BX - GEMInternalClusters clustersBX; - matchingClustersBX(alct, clusters, clustersBX); +//############################################################## +// Ancillary functions: CLCT to GEM distance in eighth strips +//############################################################## - // match spatially - matchingClustersLoc(alct, clustersBX, output); -} - -void CSCGEMMatcher::matchingClustersBXLoc(const CSCCLCTDigi& clct, - const GEMInternalClusters& clusters, - GEMInternalClusters& output) const { - if (!clct.isValid() or clusters.empty()) - return; - - // match by BX - GEMInternalClusters clustersBX; - matchingClustersBX(clct, clusters, clustersBX); - - // match spatially - matchingClustersLoc(clct, clustersBX, output); -} - -void CSCGEMMatcher::matchingClustersBXLoc(const CSCALCTDigi& alct, - const CSCCLCTDigi& clct, - const GEMInternalClusters& clusters, - GEMInternalClusters& selected) const { - // both need to be valid - if (!alct.isValid() or !clct.isValid() or clusters.empty()) - return; +// calculate distance in eighth-strip units between CLCT and GEM, switch ForceTotal on to calculate total distance without slope extrapolation +int CSCGEMMatcher::matchedClusterDistES(const CSCCLCTDigi& clct, + const GEMInternalCluster& cl, + const bool isLayer2, + const bool ForceTotal) const { + const bool isME1a(station_ == 1 and clct.getKeyStrip() > CSCConstants::MAX_HALF_STRIP_ME1B); - // match by BX - GEMInternalClusters clustersBX; - matchingClustersBX(alct, clct, clusters, clustersBX); + int cl_es = isME1a ? cl.getKeyStripME1a(8, isLayer2) : cl.getKeyStrip(8, isLayer2); - // match spatially - matchingClustersLoc(alct, clct, clustersBX, selected); -} + int eighthStripDiff = cl_es - clct.getKeyStrip(8); -void CSCGEMMatcher::bestClusterBXLoc(const CSCALCTDigi& alct, - const GEMInternalClusters& clusters, - GEMInternalCluster& best) const { - if (!alct.isValid() or clusters.empty()) - return; + if (matchCLCTpropagation_ and !ForceTotal) { //modification of DeltaStrip by CLCT slope + int SlopeShift = 0; + uint16_t baseSlope = -1; + baseSlope = mitigateSlopeByCosi_ ? mitigatedSlopeByConsistency(clct) : clct.getSlope(); - GEMInternalClusters clustersBXLoc; - matchingClustersBXLoc(alct, clusters, clustersBXLoc); + int clctSlope = pow(-1, clct.getBend()) * baseSlope; - // simply pick the first matching one - if (!clustersBXLoc.empty()) - best = clustersBXLoc[0]; -} - -void CSCGEMMatcher::bestClusterBXLoc(const CSCCLCTDigi& clct, - const GEMInternalClusters& clusters, - GEMInternalCluster& best) const { - if (!clct.isValid() or clusters.empty()) - return; - - // match by BX - GEMInternalClusters clustersBXLoc; - matchingClustersBXLoc(clct, clusters, clustersBXLoc); + SlopeShift = CSCGEMSlopeCorrector(isME1a, clctSlope, isLayer2); + eighthStripDiff -= SlopeShift; + } - // FIXME - for now: pick the first matching one - if (!clustersBXLoc.empty()) - best = clustersBXLoc[0]; + return eighthStripDiff; } -void CSCGEMMatcher::bestClusterBXLoc(const CSCALCTDigi& alct, - const CSCCLCTDigi& clct, - const GEMInternalClusters& clusters, - GEMInternalCluster& best) const { - // match by BX - GEMInternalClusters clustersBXLoc; - matchingClustersBXLoc(alct, clct, clusters, clustersBXLoc); - - // FIXME - for now: pick the first matching one - if (!clustersBXLoc.empty()) - best = clustersBXLoc[0]; -} +//############################################################## +// Ancillary functions: CLCT COSI +//############################################################## +// function to determine CLCT consistency of slope indicator (COSI) and use it to mitigate slope according to LUT uint16_t CSCGEMMatcher::mitigatedSlopeByConsistency(const CSCCLCTDigi& clct) const { - //extract hit values from CLCT hit matrix + const bool isME1a(station_ == 1 and clct.getKeyStrip() > CSCConstants::MAX_HALF_STRIP_ME1B); + + // extract hit values from CLCT hit matrix std::vector> CLCTHitMatrix = clct.getHits(); int CLCTHits[6] = {-1, -1, -1, -1, -1, -1}; @@ -383,6 +274,9 @@ uint16_t CSCGEMMatcher::mitigatedSlopeByConsistency(const CSCCLCTDigi& clct) con } } + //Debugging + //std::cout<<"CLCT Hits = "<("dropLowQualityCLCTsNoGEMs")), - build_lct_from_alct_clct_2gem_(tmbParams_.getParameter("buildLCTfromALCTCLCTand2GEM")), - build_lct_from_alct_clct_1gem_(tmbParams_.getParameter("buildLCTfromALCTCLCTand1GEM")), + drop_low_quality_alct_(tmbParams_.getParameter("dropLowQualityALCTs")), + drop_low_quality_clct_(tmbParams_.getParameter("dropLowQualityCLCTs")), build_lct_from_alct_gem_(tmbParams_.getParameter("buildLCTfromALCTandGEM")), build_lct_from_clct_gem_(tmbParams_.getParameter("buildLCTfromCLCTandGEM")) { // case for ME1/1 if (isME11_) { - drop_low_quality_clct_no_gems_me1a_ = tmbParams_.getParameter("dropLowQualityCLCTsNoGEMs_ME1a"); - build_lct_from_clct_gem_me1a_ = tmbParams_.getParameter("buildLCTfromCLCTandGEM_ME1a"); + drop_low_quality_clct_me1a_ = tmbParams_.getParameter("dropLowQualityCLCTs_ME1a"); } - max_delta_bx_alct_gem_ = tmbParams_.getParameter("maxDeltaBXALCTGEM"); - max_delta_bx_clct_gem_ = tmbParams_.getParameter("maxDeltaBXCLCTGEM"); + alct_gem_bx_window_size_ = tmbParams_.getParameter("windowBXALCTGEM"); + clct_gem_bx_window_size_ = tmbParams_.getParameter("windowBXCLCTGEM"); assign_gem_csc_bending_ = tmbParams_.getParameter("assignGEMCSCBending"); qualityAssignment_->setGEMCSCBending(assign_gem_csc_bending_); - drop_used_gems_ = tmbParams_.getParameter("tmbDropUsedGems"); - match_earliest_gem_only_ = tmbParams_.getParameter("matchEarliestGemsOnly"); - // These LogErrors are sanity checks and should not be printed if (isME11_ and !runME11ILT_) { edm::LogError("CSCGEMMotherboard") << "TMB constructed while runME11ILT_ is not set!"; @@ -38,11 +32,6 @@ CSCGEMMotherboard::CSCGEMMotherboard(unsigned endcap, edm::LogError("CSCGEMMotherboard") << "TMB constructed while runME21ILT_ is not set!"; }; - // These LogErrors are sanity checks and should not be printed - if (!isME11_ and !isME21_) { - edm::LogError("CSCGEMMotherboard") << "GEM-CSC OTMB constructed for a non-ME1/1 or a non-ME2/1 chamber!"; - }; - // super chamber has layer=0! gemId = GEMDetId(theRegion, 1, theStation, 0, theChamber, 0).rawId(); @@ -58,19 +47,44 @@ void CSCGEMMotherboard::clear() { clusterProc_->clear(); } +//function to convert GEM-CSC amended signed slope into Run2 legacy pattern number +uint16_t CSCGEMMotherboard::Run2PatternConverter(const int slope) const { + unsigned sign = std::signbit(slope); + unsigned slope_ = abs(slope); + uint16_t Run2Pattern = 0; + + if (slope_ < 3) + Run2Pattern = 10; + else if (slope_ < 6) + Run2Pattern = 8 + sign; + else if (slope_ < 9) + Run2Pattern = 6 + sign; + else if (slope_ < 12) + Run2Pattern = 4 + sign; + else + Run2Pattern = 2 + sign; + + return Run2Pattern; +} + void CSCGEMMotherboard::run(const CSCWireDigiCollection* wiredc, const CSCComparatorDigiCollection* compdc, const GEMPadDigiClusterCollection* gemClusters) { // Step 1: Setup clear(); + // check for GEM geometry + if (gem_g == nullptr) { + edm::LogError("CSCGEMMotherboard") << "run() called for GEM-CSC integrated trigger without valid GEM geometry! \n"; + return; + } + // Check that the processors can deliver data if (!(alctProc and clctProc)) { - edm::LogError("CSCGEMMotherboard") << "run() called for non-existing ALCT/CLCT processor in " << theCSCName_; + edm::LogError("CSCGEMMotherboard") << "run() called for non-existing ALCT/CLCT processor! \n"; return; } - // set geometry alctProc->setCSCGeometry(cscGeometry_); clctProc->setCSCGeometry(cscGeometry_); @@ -90,430 +104,404 @@ void CSCGEMMotherboard::run(const CSCWireDigiCollection* wiredc, if (alctV.empty() and clctV.empty()) return; - bool validClustersAndGeometry = true; - - // Step 3a: check for GEM geometry - if (gem_g == nullptr) { - edm::LogWarning("CSCGEMMotherboard") << "run() called for GEM-CSC integrated trigger" - << " without valid GEM geometry! Running CSC-only" - << " trigger algorithm in " << theCSCName_; - validClustersAndGeometry = false; - } - - // Step 3b: check that the GEM cluster collection is a valid pointer - if (gemClusters == nullptr) { - edm::LogWarning("CSCGEMMotherboard") << "run() called for GEM-CSC integrated trigger" - << " without valid GEM clusters! Running CSC-only" - << " trigger algorithm in " << theCSCName_; - validClustersAndGeometry = false; - } - - if (validClustersAndGeometry) { - // Step 3c: set the lookup tables for coordinate conversion and matching - if (isME11_) { - clusterProc_->setESLookupTables(lookupTableME11ILT_); - cscGEMMatcher_->setESLookupTables(lookupTableME11ILT_); - } - if (isME21_) { - clusterProc_->setESLookupTables(lookupTableME21ILT_); - cscGEMMatcher_->setESLookupTables(lookupTableME21ILT_); - } - - // Step 3d: run the GEM cluster processor to get the internal clusters - clusterProc_->run(gemClusters); - hasGE21Geometry16Partitions_ = clusterProc_->hasGE21Geometry16Partitions(); + // set the lookup tables for coordinate conversion and matching + if (isME11_) { + clusterProc_->setESLookupTables(lookupTableME11ILT_); + cscGEMMatcher_->setESLookupTables(lookupTableME11ILT_); } - - /* - Mask for bunch crossings were LCTs were previously found - If LCTs were found in BXi for ALCT-CLCT-2GEM or ALCT-CLCT-1GEM, - we do not consider BXi in the future. This is - because we consider ALCT-CLCT-2GEM > ALCT-CLCT-1GEM > ALCT-CLCT - > CLCT-2GEM > ALCT-2GEM. The mask is passsed from one function to the next. - */ - bool bunch_crossing_mask[CSCConstants::MAX_ALCT_TBINS] = {false}; - - // Step 4: ALCT-CLCT-2GEM and ALCT-CLCT-1GEM matching - if (build_lct_from_alct_clct_2gem_ or build_lct_from_alct_clct_1gem_) { - matchALCTCLCTGEM(bunch_crossing_mask); + if (isME21_) { + clusterProc_->setESLookupTables(lookupTableME21ILT_); + cscGEMMatcher_->setESLookupTables(lookupTableME21ILT_); } - // Step 5: regular ALCT-CLCT matching (always enabled) - CSCMotherboard::matchALCTCLCT(bunch_crossing_mask); - - // Step 6: CLCT-2GEM matching for BX's that were not previously masked - if (build_lct_from_clct_gem_ and validClustersAndGeometry) { - matchCLCT2GEM(bunch_crossing_mask); - } + // Step 3: run the GEM cluster processor to get the internal clusters + clusterProc_->run(gemClusters); + hasGE21Geometry16Partitions_ = clusterProc_->hasGE21Geometry16Partitions(); - // Step 7: ALCT-2GEM matching for BX's that were not previously masked - if (build_lct_from_alct_gem_ and validClustersAndGeometry) { - matchALCT2GEM(bunch_crossing_mask); - } + // Step 4: ALCT-CLCT-GEM matching + matchALCTCLCTGEM(); - // Step 8: Select at most 2 LCTs per BX + // Step 5: Select at most 2 LCTs per BX selectLCTs(); } -void CSCGEMMotherboard::matchALCTCLCTGEM(bool bunch_crossing_mask[CSCConstants::MAX_ALCT_TBINS]) { +void CSCGEMMotherboard::matchALCTCLCTGEM() { // no matching is done for GE2/1 geometries with 8 eta partitions // this has been superseded by 16-eta partition geometries if (isME21_ and !hasGE21Geometry16Partitions_) return; - // by default we will try to match with both single clusters and coincidence clusters - // if we do not build ALCT-CLCT-2GEM type LCTs, consider only single clusters - GEMClusterProcessor::ClusterTypes option = GEMClusterProcessor::AllClusters; - if (!build_lct_from_alct_clct_2gem_) - option = GEMClusterProcessor::SingleClusters; + for (int bx_alct = 0; bx_alct < CSCConstants::MAX_ALCT_TBINS; bx_alct++) { + // Declaration of all LCTs for this BX: + + // ALCT + CLCT + GEM + CSCCorrelatedLCTDigi LCTbestAbestCgem, LCTbestAsecondCgem, LCTsecondAbestCgem, LCTsecondAsecondCgem; + // ALCT + CLCT + CSCCorrelatedLCTDigi LCTbestAbestC, LCTbestAsecondC, LCTsecondAbestC, LCTsecondAsecondC; + // CLCT + 2 GEM + CSCCorrelatedLCTDigi LCTbestCLCTgem, LCTsecondCLCTgem; + // ALCT + 2 GEM + CSCCorrelatedLCTDigi LCTbestALCTgem, LCTsecondALCTgem; + + // Construct all the LCTs, selection will come later: + + CSCALCTDigi bestALCT = alctProc->getBestALCT(bx_alct), secondALCT = alctProc->getSecondALCT(bx_alct); + CSCCLCTDigi bestCLCT, secondCLCT; + GEMInternalClusters clustersGEM; + + // Find best and second CLCTs by preferred CLCT BX, taking into account that there is an offset in the simulation + + unsigned matchingBX = 0; + + // BestCLCT and secondCLCT + for (unsigned mbx = 0; mbx < match_trig_window_size; mbx++) { + unsigned bx_clct = bx_alct + preferred_bx_match_[mbx] - CSCConstants::ALCT_CLCT_OFFSET; + if (bx_clct >= CSCConstants::MAX_CLCT_TBINS) + continue; + bestCLCT = clctProc->getBestCLCT(bx_clct); + secondCLCT = clctProc->getSecondCLCT(bx_clct); + matchingBX = mbx; + if (bestCLCT.isValid()) + break; + } - // array to mask CLCTs - bool used_clct_mask[CSCConstants::MAX_CLCT_TBINS] = {false}; + if (!bestALCT.isValid() and !secondALCT.isValid() and !bestCLCT.isValid() and !secondCLCT.isValid()) + continue; + if (!build_lct_from_clct_gem_ and !bestALCT.isValid()) + continue; + if (!build_lct_from_alct_gem_ and !bestCLCT.isValid()) + continue; - for (int bx_alct = 0; bx_alct < CSCConstants::MAX_ALCT_TBINS; bx_alct++) { - // do not consider invalid ALCTs - if (alctProc->getBestALCT(bx_alct).isValid()) { - for (unsigned mbx = 0; mbx < match_trig_window_size; mbx++) { - // evaluate the preffered CLCT BX, taking into account that there is an offset in the simulation - unsigned bx_clct = bx_alct + preferred_bx_match_[mbx] - CSCConstants::ALCT_CLCT_OFFSET; - - // CLCT BX must be in the time window - if (bx_clct >= CSCConstants::MAX_CLCT_TBINS) - continue; - // drop this CLCT if it was previously matched to an ALCT - if (drop_used_clcts and used_clct_mask[bx_clct]) - continue; - // do not consider invalid CLCTs - if (clctProc->getBestCLCT(bx_clct).isValid()) { - LogTrace("CSCMotherboard") << "Successful ALCT-CLCT match: bx_alct = " << bx_alct << "; bx_clct = " << bx_clct - << "; mbx = " << mbx; - - // now correlate the ALCT and CLCT into LCT. - // smaller mbx means more preferred! - correlateLCTsGEM(alctProc->getBestALCT(bx_alct), - alctProc->getSecondALCT(bx_alct), - clctProc->getBestCLCT(bx_clct), - clctProc->getSecondCLCT(bx_clct), - clusterProc_->getClusters(bx_alct, max_delta_bx_alct_gem_, option), - allLCTs_(bx_alct, mbx, 0), - allLCTs_(bx_alct, mbx, 1)); - - if (allLCTs_(bx_alct, mbx, 0).isValid()) { - // mask this CLCT as used. If a flag is set, the CLCT may or may not be reused - used_clct_mask[bx_clct] = true; - // mask this bunch crossing for future considation - bunch_crossing_mask[bx_alct] = true; - // if we only consider the first valid CLCT, we move on to the next ALCT immediately - if (match_earliest_clct_only_) - break; - } - } + // ALCT + CLCT + GEM + + for (unsigned gmbx = 0; gmbx < alct_gem_bx_window_size_; gmbx++) { + unsigned bx_gem = bx_alct + preferred_bx_match_[gmbx]; + clustersGEM = clusterProc_->getClusters(bx_gem, GEMClusterProcessor::AllClusters); + if (!clustersGEM.empty()) { + correlateLCTsGEM(bestALCT, bestCLCT, clustersGEM, LCTbestAbestCgem); + correlateLCTsGEM(bestALCT, secondCLCT, clustersGEM, LCTbestAsecondCgem); + correlateLCTsGEM(secondALCT, bestCLCT, clustersGEM, LCTsecondAbestCgem); + correlateLCTsGEM(secondALCT, secondCLCT, clustersGEM, LCTsecondAsecondCgem); + break; } } - } -} -void CSCGEMMotherboard::matchCLCT2GEM(bool bunch_crossing_mask[CSCConstants::MAX_ALCT_TBINS]) { - // no matching is done for GE2/1 geometries with 8 eta partitions - // this has been superseded by 16-eta partition geometries - if (isME21_ and !hasGE21Geometry16Partitions_) - return; + // ALCT + CLCT - // array to mask CLCTs - bool used_clct_mask[CSCConstants::MAX_CLCT_TBINS] = {false}; + correlateLCTsGEM(bestALCT, bestCLCT, LCTbestAbestC); + correlateLCTsGEM(bestALCT, secondCLCT, LCTbestAsecondC); + correlateLCTsGEM(secondALCT, bestCLCT, LCTsecondAbestC); + correlateLCTsGEM(secondALCT, secondCLCT, LCTsecondAsecondC); - for (int bx_gem = 0; bx_gem < CSCConstants::MAX_ALCT_TBINS; bx_gem++) { - // do not consider LCT building in this BX if the mask was set - if (bunch_crossing_mask[bx_gem]) - continue; + // CLCT + 2 GEM + + if (build_lct_from_clct_gem_) { + unsigned bx_gem = bx_alct; - // Check that there is at least one valid GEM coincidence cluster in this BX - if (!clusterProc_->getCoincidenceClusters(bx_gem).empty()) { - // GEM clusters will have central BX 8. So do ALCTs. But! CLCTs still have central BX 7 - // therefore we need to make a correction. The correction is thus the same as for ALCT-CLCT - for (unsigned mbx = 0; mbx < 2 * max_delta_bx_clct_gem_ + 1; mbx++) { - // evaluate the preffered CLCT BX, taking into account that there is an offset in the simulation - int bx_clct = bx_gem + preferred_bx_match_[mbx] - CSCConstants::ALCT_CLCT_OFFSET; - - // CLCT BX must be in the time window - if (bx_clct < 0 or bx_clct >= CSCConstants::MAX_CLCT_TBINS) - continue; - // drop this CLCT if it was previously matched to a GEM coincidence cluster - if (drop_used_clcts and used_clct_mask[bx_clct]) - continue; - // do not consider invalid CLCTs - if (clctProc->getBestCLCT(bx_clct).isValid()) { - // if this is an ME1/a CLCT, you could consider not building this LCT - if (!build_lct_from_clct_gem_me1a_ and isME11_ and - clctProc->getBestCLCT(bx_clct).getKeyStrip() > CSCConstants::MAX_HALF_STRIP_ME1B) - continue; - // mbx is a relative time difference, which is used later in the - // cross-bunching sorting algorithm to determine the preferred LCTs - // to be sent to the MPC - correlateLCTsGEM(clctProc->getBestCLCT(bx_clct), - clctProc->getSecondCLCT(bx_clct), - clusterProc_->getCoincidenceClusters(bx_gem), - allLCTs_(bx_gem, mbx, 0), - allLCTs_(bx_gem, mbx, 1)); - - if (allLCTs_(bx_gem, mbx, 0).isValid()) { - // do not consider GEM clusters - used_clct_mask[bx_clct] = true; - // mask this bunch crossing for future consideration - bunch_crossing_mask[bx_gem] = true; - // if we only consider the first valid GEM coincidence clusters, - // we move on to the next ALCT immediately - if (match_earliest_clct_only_) - break; - } + clustersGEM = clusterProc_->getClusters(bx_gem, GEMClusterProcessor::CoincidenceClusters); + correlateLCTsGEM(bestCLCT, clustersGEM, LCTbestCLCTgem); + clustersGEM = clusterProc_->getClusters(bx_gem, GEMClusterProcessor::CoincidenceClusters); + correlateLCTsGEM(secondCLCT, clustersGEM, LCTsecondCLCTgem); + } + + // ALCT + 2 GEM + + if (build_lct_from_alct_gem_) { + for (unsigned gmbx = 0; gmbx < alct_gem_bx_window_size_; gmbx++) { + unsigned bx_gem = bx_alct + preferred_bx_match_[gmbx]; + clustersGEM = clusterProc_->getClusters(bx_gem, GEMClusterProcessor::CoincidenceClusters); + if (!clustersGEM.empty()) { + correlateLCTsGEM(bestALCT, clustersGEM, LCTbestALCTgem); + correlateLCTsGEM(secondALCT, clustersGEM, LCTsecondALCTgem); + break; } } } - } -} -void CSCGEMMotherboard::matchALCT2GEM(bool bunch_crossing_mask[CSCConstants::MAX_ALCT_TBINS]) { - // no matching is done for GE2/1 geometries with 8 eta partitions - // this has been superseded by 16-eta partition geometries - if (isME21_ and !hasGE21Geometry16Partitions_) - return; + // Select LCTs, following FW logic - // clear the array to mask GEMs this window is quite wide. - // We don't expect GEM coincidence clusters to show up too far - // from the central BX (8) - bool used_gem_mask[CSCConstants::MAX_ALCT_TBINS] = {false}; + std::vector selectedLCTs; - for (int bx_alct = 0; bx_alct < CSCConstants::MAX_ALCT_TBINS; bx_alct++) { - // do not consider LCT building in this BX if the mask was set - if (bunch_crossing_mask[bx_alct]) - continue; + // CASE => Only bestALCT is valid + if (bestALCT.isValid() and !secondALCT.isValid() and !bestCLCT.isValid() and !secondCLCT.isValid()) { + if (LCTbestALCTgem.isValid()) { + LCTbestALCTgem.setTrknmb(1); + allLCTs_(bx_alct, matchingBX, 0) = LCTbestALCTgem; + } + } - if (alctProc->getBestALCT(bx_alct).isValid()) { - for (unsigned mbx = 0; mbx < 2 * max_delta_bx_alct_gem_ + 1; mbx++) { - // evaluate the preffered GEM BX - int bx_gem = bx_alct + preferred_bx_match_[mbx]; - - if (bx_gem < 0 or bx_gem >= CSCConstants::MAX_ALCT_TBINS) - continue; - // drop GEMs in this BX if one of them was previously matched to an ALCT - if (drop_used_gems_ and used_gem_mask[bx_gem]) - continue; - // check for at least one valid GEM cluster - if (!clusterProc_->getCoincidenceClusters(bx_gem).empty()) { - // now correlate the ALCT and GEM into LCT. - // smaller mbx means more preferred! - correlateLCTsGEM(alctProc->getBestALCT(bx_alct), - alctProc->getSecondALCT(bx_alct), - clusterProc_->getCoincidenceClusters(bx_gem), - allLCTs_(bx_alct, mbx, 0), - allLCTs_(bx_alct, mbx, 1)); - - if (allLCTs_(bx_alct, mbx, 0).isValid()) { - // do not consider GEM clusters - used_gem_mask[bx_gem] = true; - // mask this bunch crossing for future consideration - bunch_crossing_mask[bx_alct] = true; - // if we only consider the first valid GEM coincidence clusters, - // we move on to the next ALCT immediately - if (match_earliest_gem_only_) - break; - } - } + // CASE => Only bestCLCT is valid + if (!bestALCT.isValid() and !secondALCT.isValid() and bestCLCT.isValid() and !secondCLCT.isValid()) { + if (LCTbestCLCTgem.isValid()) { + LCTbestCLCTgem.setTrknmb(1); + allLCTs_(bx_alct, matchingBX, 0) = LCTbestCLCTgem; } } - } -} -void CSCGEMMotherboard::correlateLCTsGEM(const CSCALCTDigi& bALCT, - const CSCALCTDigi& sALCT, - const CSCCLCTDigi& bCLCT, - const CSCCLCTDigi& sCLCT, - const GEMInternalClusters& clusters, - CSCCorrelatedLCTDigi& lct1, - CSCCorrelatedLCTDigi& lct2) const { - // case where there no valid clusters - if (clusters.empty()) - return; + // CASE => bestALCT and bestCLCT are valid + if (bestALCT.isValid() and !secondALCT.isValid() and bestCLCT.isValid() and !secondCLCT.isValid()) { + if (LCTbestAbestCgem.isValid()) { + LCTbestAbestCgem.setTrknmb(1); + allLCTs_(bx_alct, matchingBX, 0) = LCTbestAbestCgem; + } else if (LCTbestAbestC.isValid()) { + LCTbestAbestC.setTrknmb(1); + allLCTs_(bx_alct, matchingBX, 0) = LCTbestAbestC; + } + } - // temporary container - std::vector lcts; + // CASE => bestALCT, secondALCT, bestCLCT are valid + if (bestALCT.isValid() and secondALCT.isValid() and bestCLCT.isValid() and !secondCLCT.isValid()) { + CSCCorrelatedLCTDigi lctbb, lctsb; + if (LCTbestAbestCgem.isValid()) + lctbb = LCTbestAbestCgem; + else if (LCTbestAbestC.isValid()) + lctbb = LCTbestAbestC; + if (LCTsecondAbestCgem.isValid()) + lctsb = LCTsecondAbestCgem; + else if (LCTsecondAbestC.isValid()) + lctsb = LCTsecondAbestC; + + if (lctbb.getQuality() >= lctsb.getQuality() and lctbb.isValid()) { + selectedLCTs.push_back(lctbb); + if (LCTsecondALCTgem.isValid() and build_lct_from_alct_gem_) + selectedLCTs.push_back(LCTsecondALCTgem); + else if (LCTsecondAbestC.isValid()) + selectedLCTs.push_back(LCTsecondAbestC); + } else if (lctbb.getQuality() < lctsb.getQuality() and lctsb.isValid()) { + selectedLCTs.push_back(lctsb); + if (LCTbestALCTgem.isValid() and build_lct_from_alct_gem_) + selectedLCTs.push_back(LCTbestALCTgem); + else if (LCTbestAbestC.isValid()) + selectedLCTs.push_back(LCTbestAbestC); + } - CSCALCTDigi bestALCT = bALCT; - CSCALCTDigi secondALCT = sALCT; - CSCCLCTDigi bestCLCT = bCLCT; - CSCCLCTDigi secondCLCT = sCLCT; + sortLCTs(selectedLCTs); - // Sanity checks on the ALCT and CLCT - if (!bestALCT.isValid()) { - edm::LogError("CSCGEMMotherboard") << "Best ALCT invalid in correlateLCTsGEM!"; - return; - } + for (unsigned iLCT = 0; iLCT < std::min(unsigned(selectedLCTs.size()), unsigned(CSCConstants::MAX_LCTS_PER_CSC)); + iLCT++) { + if (selectedLCTs[iLCT].isValid()) { + selectedLCTs[iLCT].setTrknmb(iLCT + 1); + allLCTs_(bx_alct, matchingBX, iLCT) = selectedLCTs[iLCT]; + } + } + } - if (!bestCLCT.isValid()) { - edm::LogError("CSCGEMMotherboard") << "Best CLCT invalid in correlateLCTsGEM!"; - return; - } + // CASE => bestALCT, bestCLCT, secondCLCT are valid + if (bestALCT.isValid() and !secondALCT.isValid() and bestCLCT.isValid() and secondCLCT.isValid()) { + CSCCorrelatedLCTDigi lctbb, lctbs; + if (LCTbestAbestCgem.isValid()) + lctbb = LCTbestAbestCgem; + else if (LCTbestAbestC.isValid()) + lctbb = LCTbestAbestC; + if (LCTbestAsecondCgem.isValid()) + lctbs = LCTbestAsecondCgem; + else if (LCTbestAsecondC.isValid()) + lctbs = LCTbestAsecondC; + + if (lctbb.getQuality() >= lctbs.getQuality() and lctbb.isValid()) { + selectedLCTs.push_back(lctbb); + if (LCTsecondCLCTgem.isValid() and build_lct_from_clct_gem_) + selectedLCTs.push_back(LCTsecondCLCTgem); + else if (LCTbestAsecondC.isValid()) + selectedLCTs.push_back(LCTbestAsecondC); + } else if (lctbb.getQuality() < lctbs.getQuality() and lctbs.isValid()) { + selectedLCTs.push_back(lctbs); + if (LCTbestCLCTgem.isValid() and build_lct_from_alct_gem_) + selectedLCTs.push_back(LCTbestCLCTgem); + else if (LCTbestAbestC.isValid()) + selectedLCTs.push_back(LCTbestAbestC); + } - // at this point, we have at least one valid cluster, and we're either dealing - // wit GE1/1 or GE2/1 with 16 partitions, both are OK for GEM-CSC trigger + sortLCTs(selectedLCTs); - // before matching ALCT-CLCT pairs with clusters, we check if we need - // to drop particular low quality ALCTs or CLCTs without matching clusters - // drop low quality CLCTs if no clusters and flags are set - GEMInternalCluster bestALCTCluster, secondALCTCluster; - GEMInternalCluster bestCLCTCluster, secondCLCTCluster; - cscGEMMatcher_->bestClusterBXLoc(bestALCT, clusters, bestALCTCluster); - cscGEMMatcher_->bestClusterBXLoc(secondALCT, clusters, secondALCTCluster); - cscGEMMatcher_->bestClusterBXLoc(bestCLCT, clusters, bestCLCTCluster); - cscGEMMatcher_->bestClusterBXLoc(secondCLCT, clusters, secondCLCTCluster); + for (unsigned iLCT = 0; iLCT < std::min(unsigned(selectedLCTs.size()), unsigned(CSCConstants::MAX_LCTS_PER_CSC)); + iLCT++) { + if (selectedLCTs[iLCT].isValid()) { + selectedLCTs[iLCT].setTrknmb(iLCT + 1); + allLCTs_(bx_alct, matchingBX, iLCT) = selectedLCTs[iLCT]; + } + } + } - dropLowQualityALCTNoClusters(bestALCT, bestALCTCluster); - dropLowQualityALCTNoClusters(secondALCT, secondALCTCluster); - dropLowQualityCLCTNoClusters(bestCLCT, bestCLCTCluster); - dropLowQualityCLCTNoClusters(secondCLCT, secondCLCTCluster); + // CASE => bestALCT, secondALCT, bestCLCT, secondCLCT are valid + if (bestALCT.isValid() and secondALCT.isValid() and bestCLCT.isValid() and secondCLCT.isValid()) { + CSCCorrelatedLCTDigi lctbb, lctbs, lctsb, lctss; + + // compute LCT bestA-bestC + if (LCTbestAbestCgem.isValid()) + lctbb = LCTbestAbestCgem; + else if (LCTbestAbestC.isValid()) + lctbb = LCTbestAbestC; + + // compute LCT bestA-secondC + if (LCTbestAsecondCgem.isValid()) + lctbs = LCTbestAsecondCgem; + else if (LCTbestAsecondC.isValid()) + lctbs = LCTbestAsecondC; + + if (lctbb.getQuality() >= lctbs.getQuality()) { + // push back LCT bestA-bestC + selectedLCTs.push_back(lctbb); + + // compute LCT secondA-secondC + if (LCTsecondAsecondCgem.isValid()) + lctss = LCTsecondAsecondCgem; + else if (LCTsecondAsecondC.isValid()) + lctss = LCTsecondAsecondC; + + // push back LCT secondA-secondC + selectedLCTs.push_back(lctss); + } else { + // push back LCT bestA-secondC + selectedLCTs.push_back(lctbs); + + // compute LCT secondA-bestC + if (LCTsecondAbestCgem.isValid()) + lctsb = LCTsecondAbestCgem; + else if (LCTsecondAbestC.isValid()) + lctsb = LCTsecondAbestC; + + // push back LCT secondA-bestC + selectedLCTs.push_back(lctsb); + } - // check which ALCTs and CLCTs are valid after dropping the low-quality ones - copyValidToInValid(bestALCT, secondALCT, bestCLCT, secondCLCT); + sortLCTs(selectedLCTs); - // We can now check possible triplets and construct all LCTs with - // valid ALCT, valid CLCTs and coincidence clusters - GEMInternalCluster bbCluster, bsCluster, sbCluster, ssCluster; - cscGEMMatcher_->bestClusterBXLoc(bestALCT, bestCLCT, clusters, bbCluster); - cscGEMMatcher_->bestClusterBXLoc(bestALCT, secondCLCT, clusters, bsCluster); - cscGEMMatcher_->bestClusterBXLoc(secondALCT, bestCLCT, clusters, sbCluster); - cscGEMMatcher_->bestClusterBXLoc(secondALCT, secondCLCT, clusters, ssCluster); - - // At this point it is still possible that certain pairs with high-quality - // ALCTs and CLCTs do not have matching clusters. In that case we construct - // a regular ALCT-CLCT type LCT. For instance, it could be that two muons went - // through the chamber, produced 2 ALCTs, 2 CLCTs, but only 1 GEM cluster - because - // GEM cluster efficiency is not 100% (closer to 95%). So we don't require - // all clusters to be valid. If they are valid, the LCTs is constructed accordingly. - // But we do require that the ALCT and CLCT are valid for each pair. - CSCCorrelatedLCTDigi lctbb, lctbs, lctsb, lctss; - if (bestALCT.isValid() and bestCLCT.isValid()) { - constructLCTsGEM(bestALCT, bestCLCT, bbCluster, lctbb); - lcts.push_back(lctbb); - } - if (bestALCT.isValid() and secondCLCT.isValid() and (secondCLCT != bestCLCT)) { - constructLCTsGEM(bestALCT, secondCLCT, bsCluster, lctbs); - lcts.push_back(lctbs); + for (unsigned iLCT = 0; iLCT < std::min(unsigned(selectedLCTs.size()), unsigned(CSCConstants::MAX_LCTS_PER_CSC)); + iLCT++) { + if (selectedLCTs[iLCT].isValid()) { + selectedLCTs[iLCT].setTrknmb(iLCT + 1); + allLCTs_(bx_alct, matchingBX, iLCT) = selectedLCTs[iLCT]; + } + } + } } - if (bestCLCT.isValid() and secondALCT.isValid() and (secondALCT != bestALCT)) { - constructLCTsGEM(secondALCT, bestCLCT, sbCluster, lctsb); - lcts.push_back(lctsb); +} + +// Correlate CSC and GEM information. Option ALCT-CLCT-GEM +void CSCGEMMotherboard::correlateLCTsGEM(const CSCALCTDigi& ALCT, + const CSCCLCTDigi& CLCT, + const GEMInternalClusters& clusters, + CSCCorrelatedLCTDigi& lct) const { + // Sanity checks on ALCT, CLCT, GEM clusters + if (!ALCT.isValid()) { + LogTrace("CSCGEMMotherboard") << "Best ALCT invalid in correlateLCTsGEM"; + return; } - if (secondALCT.isValid() and secondCLCT.isValid() and (secondALCT != bestALCT) and (secondCLCT != bestCLCT)) { - constructLCTsGEM(secondALCT, secondCLCT, ssCluster, lctss); - lcts.push_back(lctss); + + if (!CLCT.isValid()) { + LogTrace("CSCGEMMotherboard") << "Best CLCT invalid in correlateLCTsGEM"; + return; } - // no LCTs - if (lcts.empty()) + GEMInternalClusters ValidClusters; + for (const auto& cl : clusters) + if (cl.isValid()) + ValidClusters.push_back(cl); + if (ValidClusters.empty()) return; - // sort by bending angle - sortLCTsByBending(lcts); + // We can now check possible triplets and construct all LCTs with + // valid ALCT, valid CLCTs and GEM clusters + GEMInternalCluster bestCluster; + cscGEMMatcher_->bestClusterLoc(ALCT, CLCT, ValidClusters, bestCluster); + if (bestCluster.isValid()) + constructLCTsGEM(ALCT, CLCT, bestCluster, lct); +} - // retain best two - lcts.resize(CSCConstants::MAX_LCTS_PER_CSC); +// Correlate CSC information. Option ALCT-CLCT +void CSCGEMMotherboard::correlateLCTsGEM(const CSCALCTDigi& ALCT, + const CSCCLCTDigi& CLCT, + CSCCorrelatedLCTDigi& lct) const { + // Sanity checks on ALCT, CLCT + if (!ALCT.isValid() or (ALCT.getQuality() == 0 and drop_low_quality_alct_)) { + LogTrace("CSCGEMMotherboard") << "Best ALCT invalid in correlateLCTsGEM"; + return; + } - // assign the track number - if (lcts[0].isValid()) { - lct1 = lcts[0]; - lct1.setTrknmb(1); + bool dropLowQualityCLCT = drop_low_quality_clct_; + if (isME11_ and CLCT.getKeyStrip() > CSCConstants::MAX_HALF_STRIP_ME1B) + dropLowQualityCLCT = drop_low_quality_clct_me1a_; + + if (!CLCT.isValid() or (CLCT.getQuality() <= 3 and dropLowQualityCLCT)) { + LogTrace("CSCGEMMotherboard") << "Best CLCT invalid in correlateLCTsGEM"; + return; } - if (lcts[1].isValid()) { - lct2 = lcts[1]; - lct2.setTrknmb(2); + // construct LCT + if (match_trig_enable and doesALCTCrossCLCT(ALCT, CLCT)) { + constructLCTsGEM(ALCT, CLCT, lct); } } -void CSCGEMMotherboard::correlateLCTsGEM(const CSCCLCTDigi& bCLCT, - const CSCCLCTDigi& sCLCT, +// Correlate CSC and GEM information. Option CLCT-GEM +void CSCGEMMotherboard::correlateLCTsGEM(const CSCCLCTDigi& CLCT, const GEMInternalClusters& clusters, - CSCCorrelatedLCTDigi& lct1, - CSCCorrelatedLCTDigi& lct2) const { - CSCCLCTDigi bestCLCT = bCLCT; - CSCCLCTDigi secondCLCT = sCLCT; - - if (!bestCLCT.isValid()) { - edm::LogError("CSCGEMMotherboard") << "Best CLCT invalid in correlateLCTsGEM!"; + CSCCorrelatedLCTDigi& lct) const { + // Sanity checks on CLCT, GEM clusters + bool dropLowQualityCLCT = drop_low_quality_clct_; + if (isME11_ and CLCT.getKeyStrip() > CSCConstants::MAX_HALF_STRIP_ME1B) + dropLowQualityCLCT = drop_low_quality_clct_me1a_; + + if (!CLCT.isValid() or (CLCT.getQuality() <= 3 and dropLowQualityCLCT)) { + LogTrace("CSCGEMMotherboard") << "Best CLCT invalid in correlateLCTsGEM"; return; } - // if the second best CLCT equals the best CLCT, clear it - if (secondCLCT == bestCLCT) - secondCLCT.clear(); + GEMInternalClusters ValidClusters; + for (const auto& cl : clusters) + if (cl.isValid()) + ValidClusters.push_back(cl); + if (ValidClusters.empty()) + return; // get the best matching cluster GEMInternalCluster bestCluster; - GEMInternalCluster secondCluster; - cscGEMMatcher_->bestClusterBXLoc(bestCLCT, clusters, bestCluster); - cscGEMMatcher_->bestClusterBXLoc(secondCLCT, clusters, secondCluster); - - // drop low quality CLCTs if no clusters and flags are set - dropLowQualityCLCTNoClusters(bestCLCT, bestCluster); - dropLowQualityCLCTNoClusters(secondCLCT, secondCluster); + cscGEMMatcher_->bestClusterLoc(CLCT, ValidClusters, bestCluster); // construct all LCTs with valid CLCTs and coincidence clusters - if (bestCLCT.isValid() and bestCluster.isCoincidence()) { - constructLCTsGEM(bestCLCT, bestCluster, 1, lct1); - } - if (secondCLCT.isValid() and secondCluster.isCoincidence()) { - constructLCTsGEM(secondCLCT, secondCluster, 2, lct2); + if (bestCluster.isCoincidence()) { + constructLCTsGEM(CLCT, bestCluster, lct); } } -void CSCGEMMotherboard::correlateLCTsGEM(const CSCALCTDigi& bALCT, - const CSCALCTDigi& sALCT, +// Correlate CSC and GEM information. Option ALCT-GEM +void CSCGEMMotherboard::correlateLCTsGEM(const CSCALCTDigi& ALCT, const GEMInternalClusters& clusters, - CSCCorrelatedLCTDigi& lct1, - CSCCorrelatedLCTDigi& lct2) const { - CSCALCTDigi bestALCT = bALCT; - CSCALCTDigi secondALCT = sALCT; - - if (!bestALCT.isValid()) { - edm::LogError("CSCGEMMotherboard") << "Best ALCT invalid in correlateLCTsGEM!"; + CSCCorrelatedLCTDigi& lct) const { + // Sanity checks on ALCT, GEM clusters + if (!ALCT.isValid() or (ALCT.getQuality() == 0 and drop_low_quality_alct_)) { + LogTrace("CSCGEMMotherboard") << "Best ALCT invalid in correlateLCTsGEM"; return; } - // if the second best ALCT equals the best ALCT, clear it - if (secondALCT == bestALCT) - secondALCT.clear(); + GEMInternalClusters ValidClusters; + for (const auto& cl : clusters) + if (cl.isValid()) + ValidClusters.push_back(cl); + if (ValidClusters.empty()) + return; // get the best matching cluster GEMInternalCluster bestCluster; - GEMInternalCluster secondCluster; - cscGEMMatcher_->bestClusterBXLoc(bestALCT, clusters, bestCluster); - cscGEMMatcher_->bestClusterBXLoc(secondALCT, clusters, secondCluster); - - // drop low quality ALCTs if no clusters and flags are set - dropLowQualityALCTNoClusters(bestALCT, bestCluster); - dropLowQualityALCTNoClusters(secondALCT, secondCluster); + cscGEMMatcher_->bestClusterLoc(ALCT, ValidClusters, bestCluster); // construct all LCTs with valid ALCTs and coincidence clusters - if (bestALCT.isValid() and bestCluster.isCoincidence()) { - constructLCTsGEM(bestALCT, bestCluster, 1, lct1); - } - if (secondALCT.isValid() and secondCluster.isCoincidence()) { - constructLCTsGEM(secondALCT, secondCluster, 2, lct2); + if (bestCluster.isCoincidence()) { + constructLCTsGEM(ALCT, bestCluster, lct); } } +// Construct LCT from CSC and GEM information. Option ALCT-CLCT-GEM void CSCGEMMotherboard::constructLCTsGEM(const CSCALCTDigi& alct, const CSCCLCTDigi& clct, const GEMInternalCluster& gem, CSCCorrelatedLCTDigi& thisLCT) const { thisLCT.setValid(true); - if (gem.isCoincidence()) { + if (gem.isCoincidence()) thisLCT.setType(CSCCorrelatedLCTDigi::ALCTCLCT2GEM); - } else if (gem.isValid()) { + else if (gem.isValid()) thisLCT.setType(CSCCorrelatedLCTDigi::ALCTCLCTGEM); - } else { - thisLCT.setType(CSCCorrelatedLCTDigi::ALCTCLCT); - } thisLCT.setQuality(qualityAssignment_->findQuality(alct, clct, gem)); thisLCT.setALCT(getBXShiftedALCT(alct)); thisLCT.setCLCT(getBXShiftedCLCT(clct)); @@ -525,17 +513,20 @@ void CSCGEMMotherboard::constructLCTsGEM(const CSCALCTDigi& alct, thisLCT.setBX0(0); thisLCT.setSyncErr(0); thisLCT.setCSCID(theTrigChamber); - // track number to be set later in final sorting stage - thisLCT.setTrknmb(0); + thisLCT.setTrknmb(0); // will be set later after sorting thisLCT.setWireGroup(alct.getKeyWG()); thisLCT.setStrip(clct.getKeyStrip()); thisLCT.setBend(clct.getBend()); thisLCT.setBX(alct.getBX()); if (runCCLUT_) { thisLCT.setRun3(true); - if (assign_gem_csc_bending_) - thisLCT.setSlope(cscGEMMatcher_->calculateGEMCSCBending(clct, gem)); - else + if (assign_gem_csc_bending_ && + gem.isValid()) { //calculate new slope from strip difference between CLCT and associated GEM + int slope = cscGEMMatcher_->calculateGEMCSCBending(clct, gem); + thisLCT.setSlope(abs(slope)); + thisLCT.setBend(std::signbit(slope)); + thisLCT.setPattern(Run2PatternConverter(slope)); + } else thisLCT.setSlope(clct.getSlope()); thisLCT.setQuartStripBit(clct.getQuartStripBit()); thisLCT.setEighthStripBit(clct.getEighthStripBit()); @@ -543,10 +534,38 @@ void CSCGEMMotherboard::constructLCTsGEM(const CSCALCTDigi& alct, } } -/* Construct LCT from CSC and GEM information. Option CLCT-2GEM */ +// Construct LCT from CSC and GEM information. Option ALCT-CLCT +void CSCGEMMotherboard::constructLCTsGEM(const CSCALCTDigi& aLCT, + const CSCCLCTDigi& cLCT, + CSCCorrelatedLCTDigi& thisLCT) const { + thisLCT.setValid(true); + thisLCT.setType(CSCCorrelatedLCTDigi::ALCTCLCT); + thisLCT.setALCT(getBXShiftedALCT(aLCT)); + thisLCT.setCLCT(getBXShiftedCLCT(cLCT)); + thisLCT.setPattern(encodePattern(cLCT.getPattern())); + thisLCT.setMPCLink(0); + thisLCT.setBX0(0); + thisLCT.setSyncErr(0); + thisLCT.setCSCID(theTrigChamber); + thisLCT.setTrknmb(0); // will be set later after sorting + thisLCT.setWireGroup(aLCT.getKeyWG()); + thisLCT.setStrip(cLCT.getKeyStrip()); + thisLCT.setBend(cLCT.getBend()); + thisLCT.setBX(aLCT.getBX()); + thisLCT.setQuality(qualityAssignment_->findQuality(aLCT, cLCT)); + if (runCCLUT_) { + thisLCT.setRun3(true); + // 4-bit slope value derived with the CCLUT algorithm + thisLCT.setSlope(cLCT.getSlope()); + thisLCT.setQuartStripBit(cLCT.getQuartStripBit()); + thisLCT.setEighthStripBit(cLCT.getEighthStripBit()); + thisLCT.setRun3Pattern(cLCT.getRun3Pattern()); + } +} + +// Construct LCT from CSC and GEM information. Option CLCT-2GEM void CSCGEMMotherboard::constructLCTsGEM(const CSCCLCTDigi& clct, const GEMInternalCluster& gem, - int trackNumber, CSCCorrelatedLCTDigi& thisLCT) const { thisLCT.setValid(true); thisLCT.setType(CSCCorrelatedLCTDigi::CLCT2GEM); @@ -559,16 +578,20 @@ void CSCGEMMotherboard::constructLCTsGEM(const CSCCLCTDigi& clct, thisLCT.setBX0(0); thisLCT.setSyncErr(0); thisLCT.setCSCID(theTrigChamber); - thisLCT.setTrknmb(trackNumber); + thisLCT.setTrknmb(0); // will be set later after sorting thisLCT.setWireGroup(gem.getKeyWG()); thisLCT.setStrip(clct.getKeyStrip()); thisLCT.setBend(clct.getBend()); thisLCT.setBX(gem.bx()); if (runCCLUT_) { thisLCT.setRun3(true); - if (assign_gem_csc_bending_) - thisLCT.setSlope(cscGEMMatcher_->calculateGEMCSCBending(clct, gem)); - else + if (assign_gem_csc_bending_ && + gem.isValid()) { //calculate new slope from strip difference between CLCT and associated GEM + int slope = cscGEMMatcher_->calculateGEMCSCBending(clct, gem); + thisLCT.setSlope(abs(slope)); + thisLCT.setBend(pow(-1, std::signbit(slope))); + thisLCT.setPattern(Run2PatternConverter(slope)); + } else thisLCT.setSlope(clct.getSlope()); thisLCT.setQuartStripBit(clct.getQuartStripBit()); thisLCT.setEighthStripBit(clct.getEighthStripBit()); @@ -576,10 +599,9 @@ void CSCGEMMotherboard::constructLCTsGEM(const CSCCLCTDigi& clct, } } -/* Construct LCT from CSC and GEM information. Option ALCT-2GEM */ +// Construct LCT from CSC and GEM information. Option ALCT-2GEM void CSCGEMMotherboard::constructLCTsGEM(const CSCALCTDigi& alct, const GEMInternalCluster& gem, - int trackNumber, CSCCorrelatedLCTDigi& thisLCT) const { thisLCT.setValid(true); thisLCT.setType(CSCCorrelatedLCTDigi::ALCT2GEM); @@ -592,7 +614,7 @@ void CSCGEMMotherboard::constructLCTsGEM(const CSCALCTDigi& alct, thisLCT.setBX0(0); thisLCT.setSyncErr(0); thisLCT.setCSCID(theTrigChamber); - thisLCT.setTrknmb(trackNumber); + thisLCT.setTrknmb(0); // will be set later after sorting thisLCT.setWireGroup(alct.getKeyWG()); thisLCT.setStrip(gem.getKeyStrip()); thisLCT.setBend(0); @@ -607,43 +629,14 @@ void CSCGEMMotherboard::constructLCTsGEM(const CSCALCTDigi& alct, } } -void CSCGEMMotherboard::dropLowQualityALCTNoClusters(CSCALCTDigi& alct, const GEMInternalCluster& cluster) const { - // clear alct if they are of low quality without matching GEM clusters - if (alct.getQuality() == 0 and !cluster.isValid() and drop_low_quality_alct_no_gems_) - alct.clear(); -} - -void CSCGEMMotherboard::dropLowQualityCLCTNoClusters(CSCCLCTDigi& clct, const GEMInternalCluster& cluster) const { - // Here, we need to check which could be an ME1/a LCT - bool dropLQCLCTNoGEMs = drop_low_quality_clct_no_gems_; - if (isME11_ and clct.getKeyStrip() > CSCConstants::MAX_HALF_STRIP_ME1B) - dropLQCLCTNoGEMs = drop_low_quality_clct_no_gems_me1a_; - - // clear clct if they are of low quality without matching GEM clusters - if (clct.getQuality() <= 3 and !cluster.isValid() and dropLQCLCTNoGEMs) - clct.clear(); -} - -void CSCGEMMotherboard::sortLCTsByBending(std::vector& lcts) const { - /* - For Run-2 GEM-CSC trigger primitives, which we temporarily have - to integrate with the Run-2 EMTF during LS2, we sort by quality. - Larger quality means smaller bending - */ - if (!runCCLUT_) { - std::sort(lcts.begin(), lcts.end(), [](const CSCCorrelatedLCTDigi& lct1, const CSCCorrelatedLCTDigi& lct2) -> bool { +void CSCGEMMotherboard::sortLCTs(std::vector& lcts) const { + // LCTs are sorted by quality. If there are two with the same quality, then the sorting is done by the slope + std::sort(lcts.begin(), lcts.end(), [](const CSCCorrelatedLCTDigi& lct1, const CSCCorrelatedLCTDigi& lct2) -> bool { + if (lct1.getQuality() > lct2.getQuality()) return lct1.getQuality() > lct2.getQuality(); - }); - } - - /* - For Run-3 GEM-CSC trigger primitives, which we have - to integrate with the Run-3 EMTF, we sort by slope. - Smaller slope means smaller bending - */ - else { - std::sort(lcts.begin(), lcts.end(), [](const CSCCorrelatedLCTDigi& lct1, const CSCCorrelatedLCTDigi& lct2) -> bool { + else if (lct1.getQuality() == lct2.getQuality()) return lct1.getSlope() < lct2.getSlope(); - }); - } + else + return false; + }); } diff --git a/L1Trigger/CSCTriggerPrimitives/src/CSCMotherboard.cc b/L1Trigger/CSCTriggerPrimitives/src/CSCMotherboard.cc index b17c72a572bdf..7ca47cdf64a68 100644 --- a/L1Trigger/CSCTriggerPrimitives/src/CSCMotherboard.cc +++ b/L1Trigger/CSCTriggerPrimitives/src/CSCMotherboard.cc @@ -160,28 +160,19 @@ void CSCMotherboard::run(const CSCWireDigiCollection* wiredc, const CSCComparato return; // step 3: match the ALCTs to the CLCTs - bool bunch_crossing_mask[CSCConstants::MAX_ALCT_TBINS] = {false}; - matchALCTCLCT(bunch_crossing_mask); + matchALCTCLCT(); // Step 4: Select at most 2 LCTs per BX selectLCTs(); } -void CSCMotherboard::matchALCTCLCT(bool bunch_crossing_mask[CSCConstants::MAX_ALCT_TBINS]) { +void CSCMotherboard::matchALCTCLCT() { // array to mask CLCTs bool used_clct_mask[CSCConstants::MAX_CLCT_TBINS] = {false}; // Step 3: ALCT-centric ALCT-to-CLCT matching int bx_clct_matched = 0; // bx of last matched CLCT for (int bx_alct = 0; bx_alct < CSCConstants::MAX_ALCT_TBINS; bx_alct++) { - // do not consider LCT building in this BX if the mask was set - // this check should have no effect on the regular LCT finding - // it does play a role in the LCT finding for GEM-CSC ILTs - // namely, if a GEM-CSC ILT was found a bunch crossing, the - // algorithm would skip the bunch crossing for regular LCT finding - if (bunch_crossing_mask[bx_alct]) - continue; - // There should be at least one valid CLCT or ALCT for a // correlated LCT to be formed. Decision on whether to reject // non-complete LCTs (and if yes of which type) is made further @@ -230,7 +221,6 @@ void CSCMotherboard::matchALCTCLCT(bool bunch_crossing_mask[CSCConstants::MAX_AL if (allLCTs_(bx_alct, mbx, 0).isValid()) { is_matched = true; used_clct_mask[bx_clct] = true; - bunch_crossing_mask[bx_alct] = true; bx_clct_matched = bx_clct; if (match_earliest_clct_only_) break; @@ -367,6 +357,9 @@ std::vector CSCMotherboard::readoutLCTs() const { qualityControl_->checkMultiplicityBX(tmpV); for (const auto& lct : tmpV) { qualityControl_->checkValid(lct); + /*std::cout << "\n########################################## Emu LCT ##########################################\n" << std::endl; + std::cout << "Emu LCT: " << lct << std::endl; + std::cout << "\n########################################## THE END ##########################################\n" << std::endl;*/ } return tmpV; @@ -395,10 +388,10 @@ void CSCMotherboard::correlateLCTs(const CSCALCTDigi& bALCT, if (secondCLCT.getQuality() <= 3) secondCLCT.clear(); - // check which ALCTs and CLCTs are valid // if the best ALCT/CLCT is valid, but the second ALCT/CLCT is not, // the information is copied over - copyValidToInValid(bestALCT, secondALCT, bestCLCT, secondCLCT); + copyValidToInValidALCT(bestALCT, secondALCT); + copyValidToInValidCLCT(bestCLCT, secondCLCT); // ALCT-only LCTs const bool bestCase1(alct_trig_enable and bestALCT.isValid()); @@ -438,31 +431,21 @@ void CSCMotherboard::correlateLCTs(const CSCALCTDigi& bALCT, // at least one component must be different in order to consider the secondLCT if ((secondALCT != bestALCT) or (secondCLCT != bestCLCT)) { // at least one of the cases must be valid - if (secondCase1 or secondCase2 or secondCase3) { + if (secondCase1 or secondCase2 or secondCase3) constructLCTs(secondALCT, secondCLCT, type, 2, sLCT); - } } } -void CSCMotherboard::copyValidToInValid(CSCALCTDigi& bestALCT, - CSCALCTDigi& secondALCT, - CSCCLCTDigi& bestCLCT, - CSCCLCTDigi& secondCLCT) const { - // check which ALCTs and CLCTs are valid - const bool anodeBestValid = bestALCT.isValid(); - const bool anodeSecondValid = secondALCT.isValid(); - const bool cathodeBestValid = bestCLCT.isValid(); - const bool cathodeSecondValid = secondCLCT.isValid(); - - // copy the valid ALCT/CLCT information to the valid ALCT/CLCT - if (anodeBestValid && !anodeSecondValid) +// copy the valid ALCT/CLCT information to the valid ALCT +void CSCMotherboard::copyValidToInValidALCT(CSCALCTDigi& bestALCT, CSCALCTDigi& secondALCT) const { + if (bestALCT.isValid() and !secondALCT.isValid()) secondALCT = bestALCT; - if (!anodeBestValid && anodeSecondValid) - bestALCT = secondALCT; - if (cathodeBestValid && !cathodeSecondValid) +} + +// copy the valid CLCT information to the valid CLCT +void CSCMotherboard::copyValidToInValidCLCT(CSCCLCTDigi& bestCLCT, CSCCLCTDigi& secondCLCT) const { + if (bestCLCT.isValid() and !secondCLCT.isValid()) secondCLCT = bestCLCT; - if (!cathodeBestValid && cathodeSecondValid) - bestCLCT = secondCLCT; } bool CSCMotherboard::doesALCTCrossCLCT(const CSCALCTDigi& alct, const CSCCLCTDigi& clct) const { diff --git a/L1Trigger/CSCTriggerPrimitives/src/CSCUpgradeCathodeLCTProcessor.cc b/L1Trigger/CSCTriggerPrimitives/src/CSCUpgradeCathodeLCTProcessor.cc index 99836b2eb7731..272aaf85fcbd5 100644 --- a/L1Trigger/CSCTriggerPrimitives/src/CSCUpgradeCathodeLCTProcessor.cc +++ b/L1Trigger/CSCTriggerPrimitives/src/CSCUpgradeCathodeLCTProcessor.cc @@ -252,6 +252,45 @@ std::vector CSCUpgradeCathodeLCTProcessor::findLCTs( } } } + + // Sort bestCLCT and secondALCT by quality + // if qualities are the same, sort by run-2 or run-3 pattern + // if qualities and patterns are the same, sort by half strip number + bool changeOrder = false; + + unsigned qualityBest = 0, qualitySecond = 0; + unsigned patternBest = 0, patternSecond = 0; + unsigned halfStripBest = 0, halfStripSecond = 0; + + if (tempBestCLCT.isValid() and tempSecondCLCT.isValid()) { + qualityBest = tempBestCLCT.getQuality(); + qualitySecond = tempSecondCLCT.getQuality(); + if (!run3_) { + patternBest = tempBestCLCT.getPattern(); + patternSecond = tempSecondCLCT.getPattern(); + } else { + patternBest = tempBestCLCT.getRun3Pattern(); + patternSecond = tempSecondCLCT.getRun3Pattern(); + } + halfStripBest = tempBestCLCT.getKeyStrip(); + halfStripSecond = tempSecondCLCT.getKeyStrip(); + + if (qualitySecond > qualityBest) + changeOrder = true; + else if ((qualitySecond == qualityBest) and (int(patternSecond / 2) > int(patternBest / 2))) + changeOrder = true; + else if ((qualitySecond == qualityBest) and (int(patternSecond / 2) == int(patternBest / 2)) and + (halfStripSecond < halfStripBest)) + changeOrder = true; + } + + CSCCLCTDigi tempCLCT; + if (changeOrder) { + tempCLCT = tempBestCLCT; + tempBestCLCT = tempSecondCLCT; + tempSecondCLCT = tempCLCT; + } + // add the CLCTs to the collection if (tempBestCLCT.isValid()) { lctList.push_back(tempBestCLCT); diff --git a/L1Trigger/CSCTriggerPrimitives/src/GEMClusterProcessor.cc b/L1Trigger/CSCTriggerPrimitives/src/GEMClusterProcessor.cc index 53fc2948e360f..01b99439287bc 100644 --- a/L1Trigger/CSCTriggerPrimitives/src/GEMClusterProcessor.cc +++ b/L1Trigger/CSCTriggerPrimitives/src/GEMClusterProcessor.cc @@ -5,16 +5,17 @@ #include GEMClusterProcessor::GEMClusterProcessor(int region, unsigned station, unsigned chamber, const edm::ParameterSet& conf) - : region_(region), station_(station), chamber_(chamber), hasGE21Geometry16Partitions_(false) { + : region_(region), station_(station), chamber_(chamber) { isEven_ = chamber_ % 2 == 0; - // These LogErrors are sanity checks and should not be printed - if (station_ == 3 or station_ == 4) { - edm::LogError("GEMClusterProcessor") << "Class constructed for a chamber in ME3 or ME4!"; - }; + const edm::ParameterSet aux(conf.getParameter("commonParam")); if (station_ == 1) { + const edm::ParameterSet tmb(conf.getParameter("tmbPhase2")); + const edm::ParameterSet tmb_gem(conf.getParameter("tmbPhase2GE11")); const edm::ParameterSet copad(conf.getParameter("copadParamGE11")); + tmbL1aWindowSize_ = tmb.getParameter("tmbL1aWindowSize"); + delayGEMinOTMB_ = tmb_gem.getParameter("delayGEMinOTMB"); maxDeltaPad_ = copad.getParameter("maxDeltaPad"); maxDeltaRoll_ = copad.getParameter("maxDeltaRoll"); maxDeltaBX_ = copad.getParameter("maxDeltaBX"); @@ -24,7 +25,11 @@ GEMClusterProcessor::GEMClusterProcessor(int region, unsigned station, unsigned // by default set to true hasGE21Geometry16Partitions_ = true; + const edm::ParameterSet tmb(conf.getParameter("tmbPhase2")); + const edm::ParameterSet tmb_gem(conf.getParameter("tmbPhase2GE21")); const edm::ParameterSet copad(conf.getParameter("copadParamGE21")); + tmbL1aWindowSize_ = tmb.getParameter("tmbL1aWindowSize"); + delayGEMinOTMB_ = tmb_gem.getParameter("delayGEMinOTMB"); maxDeltaPad_ = copad.getParameter("maxDeltaPad"); maxDeltaRoll_ = copad.getParameter("maxDeltaRoll"); maxDeltaBX_ = copad.getParameter("maxDeltaBX"); @@ -41,7 +46,6 @@ void GEMClusterProcessor::run(const GEMPadDigiClusterCollection* in_clusters) { // Step 1: clear the GEMInternalCluster vector clear(); - // check that the GEM cluster collection is a valid pointer if (in_clusters == nullptr) { edm::LogWarning("GEMClusterProcessor") << "Attempt to run without valid in_clusters pointer."; return; @@ -57,12 +61,12 @@ void GEMClusterProcessor::run(const GEMPadDigiClusterCollection* in_clusters) { doCoordinateConversion(); } -std::vector GEMClusterProcessor::getClusters(int bx, int deltaBX, ClusterTypes option) const { +std::vector GEMClusterProcessor::getClusters(int bx, ClusterTypes option) const { std::vector output; for (const auto& cl : clusters_) { // valid single clusters with the right BX - if (std::abs(cl.bx() - bx) <= deltaBX and cl.isValid()) { + if (cl.bx() == bx and cl.isValid()) { // ignore the coincidence clusters if (option == SingleClusters and cl.isCoincidence()) continue; @@ -72,20 +76,6 @@ std::vector GEMClusterProcessor::getClusters(int bx, int del output.push_back(cl); } } - - return output; -} - -std::vector GEMClusterProcessor::getCoincidenceClusters(int bx) const { - std::vector output; - - for (const auto& cl : clusters_) { - // valid coincidences with the right BX - if (cl.bx() == bx and cl.isCoincidence()) { - output.push_back(cl); - } - } - return output; } @@ -155,7 +145,8 @@ void GEMClusterProcessor::addCoincidenceClusters(const GEMPadDigiClusterCollecti continue; // make a new coincidence - clusters_.emplace_back(id, *p, *co_p); + clusters_.emplace_back(id, co_id, *p, *co_p, delayGEMinOTMB_, tmbL1aWindowSize_); + // std::cout << clusters_.back() << std::endl; } } } @@ -197,10 +188,13 @@ void GEMClusterProcessor::addSingleClusters(const GEMPadDigiClusterCollection* i continue; // put the single clusters into the collection - if (id.layer() == 1) - clusters_.emplace_back(id, *p, GEMPadDigiCluster()); - else - clusters_.emplace_back(id, GEMPadDigiCluster(), *p); + if (id.layer() == 1) { + clusters_.emplace_back(id, id, *p, GEMPadDigiCluster(), delayGEMinOTMB_, tmbL1aWindowSize_); + // std::cout << clusters_.back() << std::endl; + } else { + clusters_.emplace_back(id, id, GEMPadDigiCluster(), *p, delayGEMinOTMB_, tmbL1aWindowSize_); + // std::cout << clusters_.back() << std::endl; + } } } } @@ -213,54 +207,6 @@ void GEMClusterProcessor::doCoordinateConversion() { const int layer1_first_pad = cluster.layer1_pad(); const int layer1_last_pad = layer1_first_pad + cluster.layer1_size() - 1; - // calculate the 1/2-strip - int layer1_pad_to_first_hs = -1; - int layer1_pad_to_last_hs = -1; - int layer1_pad_to_first_hs_me1a = -1; - int layer1_pad_to_last_hs_me1a = -1; - - // ME1/1 - if (station_ == 1) { - if (isEven_) { - // ME1/b - layer1_pad_to_first_hs = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1b_even(layer1_first_pad); - layer1_pad_to_last_hs = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1b_even(layer1_last_pad); - // ME1/a - layer1_pad_to_first_hs_me1a = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1a_even(layer1_first_pad); - layer1_pad_to_last_hs_me1a = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1a_even(layer1_last_pad); - } else { - // ME1/b - layer1_pad_to_first_hs = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1b_odd(layer1_first_pad); - layer1_pad_to_last_hs = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1b_odd(layer1_last_pad); - // ME1/a - layer1_pad_to_first_hs_me1a = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1a_odd(layer1_first_pad); - layer1_pad_to_last_hs_me1a = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1a_odd(layer1_last_pad); - } - } - // ME2/1 - if (station_ == 2) { - if (isEven_) { - layer1_pad_to_first_hs = lookupTableME21ILT_->GEM_pad_CSC_hs_ME21_even(layer1_first_pad); - layer1_pad_to_last_hs = lookupTableME21ILT_->GEM_pad_CSC_hs_ME21_even(layer1_last_pad); - } else { - layer1_pad_to_first_hs = lookupTableME21ILT_->GEM_pad_CSC_hs_ME21_odd(layer1_first_pad); - layer1_pad_to_last_hs = lookupTableME21ILT_->GEM_pad_CSC_hs_ME21_odd(layer1_last_pad); - } - } - // middle 1/2-strip - int layer1_middle_hs = 0.5 * (layer1_pad_to_first_hs + layer1_pad_to_last_hs); - int layer1_middle_hs_me1a = 0.5 * (layer1_pad_to_first_hs_me1a + layer1_pad_to_last_hs_me1a); - - // set the values - cluster.set_layer1_first_hs(layer1_pad_to_first_hs); - cluster.set_layer1_last_hs(layer1_pad_to_last_hs); - cluster.set_layer1_middle_hs(layer1_middle_hs); - - if (station_ == 1) { - cluster.set_layer1_first_hs_me1a(layer1_pad_to_first_hs_me1a); - cluster.set_layer1_last_hs_me1a(layer1_pad_to_last_hs_me1a); - cluster.set_layer1_middle_hs_me1a(layer1_middle_hs_me1a); - } // calculate the 1/8-strips int layer1_pad_to_first_es = -1; int layer1_pad_to_last_es = -1; @@ -272,18 +218,18 @@ void GEMClusterProcessor::doCoordinateConversion() { if (station_ == 1) { if (isEven_) { // ME1/b - layer1_pad_to_first_es = lookupTableME11ILT_->GEM_pad_CSC_es_ME1b_even(layer1_first_pad); - layer1_pad_to_last_es = lookupTableME11ILT_->GEM_pad_CSC_es_ME1b_even(layer1_last_pad); + layer1_pad_to_first_es = lookupTableME11ILT_->GEM_pad_CSC_es_ME11b_even(layer1_first_pad); + layer1_pad_to_last_es = lookupTableME11ILT_->GEM_pad_CSC_es_ME11b_even(layer1_last_pad); // ME1/a - layer1_pad_to_first_es_me1a = lookupTableME11ILT_->GEM_pad_CSC_es_ME1a_even(layer1_first_pad); - layer1_pad_to_last_es_me1a = lookupTableME11ILT_->GEM_pad_CSC_es_ME1a_even(layer1_last_pad); + layer1_pad_to_first_es_me1a = lookupTableME11ILT_->GEM_pad_CSC_es_ME11a_even(layer1_first_pad); + layer1_pad_to_last_es_me1a = lookupTableME11ILT_->GEM_pad_CSC_es_ME11a_even(layer1_last_pad); } else { // ME1/b - layer1_pad_to_first_es = lookupTableME11ILT_->GEM_pad_CSC_es_ME1b_odd(layer1_first_pad); - layer1_pad_to_last_es = lookupTableME11ILT_->GEM_pad_CSC_es_ME1b_odd(layer1_last_pad); + layer1_pad_to_first_es = lookupTableME11ILT_->GEM_pad_CSC_es_ME11b_odd(layer1_first_pad); + layer1_pad_to_last_es = lookupTableME11ILT_->GEM_pad_CSC_es_ME11b_odd(layer1_last_pad); // ME1/a - layer1_pad_to_first_es_me1a = lookupTableME11ILT_->GEM_pad_CSC_es_ME1a_odd(layer1_first_pad); - layer1_pad_to_last_es_me1a = lookupTableME11ILT_->GEM_pad_CSC_es_ME1a_odd(layer1_last_pad); + layer1_pad_to_first_es_me1a = lookupTableME11ILT_->GEM_pad_CSC_es_ME11a_odd(layer1_first_pad); + layer1_pad_to_last_es_me1a = lookupTableME11ILT_->GEM_pad_CSC_es_ME11a_odd(layer1_last_pad); } } // ME2/1 @@ -297,8 +243,8 @@ void GEMClusterProcessor::doCoordinateConversion() { } } // middle 1/8-strip - int layer1_middle_es = 0.5 * (layer1_pad_to_first_es + layer1_pad_to_last_es); - int layer1_middle_es_me1a = 0.5 * (layer1_pad_to_first_es_me1a + layer1_pad_to_last_es_me1a); + int layer1_middle_es = (layer1_pad_to_first_es + layer1_pad_to_last_es) / 2.; + int layer1_middle_es_me1a = (layer1_pad_to_first_es_me1a + layer1_pad_to_last_es_me1a) / 2.; cluster.set_layer1_first_es(layer1_pad_to_first_es); cluster.set_layer1_last_es(layer1_pad_to_last_es); @@ -312,7 +258,7 @@ void GEMClusterProcessor::doCoordinateConversion() { // calculate the wiregroups // need to subtract 1 to use the LUTs - const int roll = cluster.roll() - 1; + const int roll = cluster.roll1() - 1; int roll_l1_to_min_wg = -1; int roll_l1_to_max_wg = -1; @@ -320,11 +266,11 @@ void GEMClusterProcessor::doCoordinateConversion() { // ME1/1 if (station_ == 1) { if (isEven_) { - roll_l1_to_min_wg = lookupTableME11ILT_->GEM_roll_L1_CSC_min_wg_ME11_even(roll); - roll_l1_to_max_wg = lookupTableME11ILT_->GEM_roll_L1_CSC_max_wg_ME11_even(roll); + roll_l1_to_min_wg = lookupTableME11ILT_->GEM_roll_CSC_min_wg_ME11_even(roll); + roll_l1_to_max_wg = lookupTableME11ILT_->GEM_roll_CSC_max_wg_ME11_even(roll); } else { - roll_l1_to_min_wg = lookupTableME11ILT_->GEM_roll_L1_CSC_min_wg_ME11_odd(roll); - roll_l1_to_max_wg = lookupTableME11ILT_->GEM_roll_L1_CSC_max_wg_ME11_odd(roll); + roll_l1_to_min_wg = lookupTableME11ILT_->GEM_roll_CSC_min_wg_ME11_odd(roll); + roll_l1_to_max_wg = lookupTableME11ILT_->GEM_roll_CSC_max_wg_ME11_odd(roll); } } @@ -349,53 +295,6 @@ void GEMClusterProcessor::doCoordinateConversion() { const int layer2_first_pad = cluster.layer2_pad(); const int layer2_last_pad = layer2_first_pad + cluster.layer2_size() - 1; - // calculate the 1/2-strip - int layer2_pad_to_first_hs = -1; - int layer2_pad_to_last_hs = -1; - int layer2_pad_to_first_hs_me1a = -1; - int layer2_pad_to_last_hs_me1a = -1; - - if (station_ == 1) { - if (isEven_) { - // ME1/b - layer2_pad_to_first_hs = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1b_even(layer2_first_pad); - layer2_pad_to_last_hs = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1b_even(layer2_last_pad); - // ME1/a - layer2_pad_to_first_hs_me1a = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1a_even(layer2_first_pad); - layer2_pad_to_last_hs_me1a = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1a_even(layer2_last_pad); - } else { - // ME1/b - layer2_pad_to_first_hs = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1b_odd(layer2_first_pad); - layer2_pad_to_last_hs = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1b_odd(layer2_last_pad); - // ME1/a - layer2_pad_to_first_hs_me1a = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1a_odd(layer2_first_pad); - layer2_pad_to_last_hs_me1a = lookupTableME11ILT_->GEM_pad_CSC_hs_ME1a_odd(layer2_last_pad); - } - } - // ME2/1 - if (station_ == 2) { - if (isEven_) { - layer2_pad_to_first_hs = lookupTableME21ILT_->GEM_pad_CSC_hs_ME21_even(layer2_first_pad); - layer2_pad_to_last_hs = lookupTableME21ILT_->GEM_pad_CSC_hs_ME21_even(layer2_last_pad); - } else { - layer2_pad_to_first_hs = lookupTableME21ILT_->GEM_pad_CSC_hs_ME21_odd(layer2_first_pad); - layer2_pad_to_last_hs = lookupTableME21ILT_->GEM_pad_CSC_hs_ME21_odd(layer2_last_pad); - } - } - // middle 1/2-strip - int layer2_middle_hs = 0.5 * (layer2_pad_to_first_hs + layer2_pad_to_last_hs); - int layer2_middle_hs_me1a = 0.5 * (layer2_pad_to_first_hs_me1a + layer2_pad_to_last_hs_me1a); - - // set the values - cluster.set_layer2_first_hs(layer2_pad_to_first_hs); - cluster.set_layer2_last_hs(layer2_pad_to_last_hs); - cluster.set_layer2_middle_hs(layer2_middle_hs); - - if (station_ == 1) { - cluster.set_layer2_first_hs_me1a(layer2_pad_to_first_hs_me1a); - cluster.set_layer2_last_hs_me1a(layer2_pad_to_last_hs_me1a); - cluster.set_layer2_middle_hs_me1a(layer2_middle_hs_me1a); - } // calculate the 1/8-strips int layer2_pad_to_first_es = -1; int layer2_pad_to_last_es = -1; @@ -406,18 +305,18 @@ void GEMClusterProcessor::doCoordinateConversion() { if (station_ == 1) { if (isEven_) { // ME1/b - layer2_pad_to_first_es = lookupTableME11ILT_->GEM_pad_CSC_es_ME1b_even(layer2_first_pad); - layer2_pad_to_last_es = lookupTableME11ILT_->GEM_pad_CSC_es_ME1b_even(layer2_last_pad); + layer2_pad_to_first_es = lookupTableME11ILT_->GEM_pad_CSC_es_ME11b_even(layer2_first_pad); + layer2_pad_to_last_es = lookupTableME11ILT_->GEM_pad_CSC_es_ME11b_even(layer2_last_pad); // ME1/a - layer2_pad_to_first_es_me1a = lookupTableME11ILT_->GEM_pad_CSC_es_ME1a_even(layer2_first_pad); - layer2_pad_to_last_es_me1a = lookupTableME11ILT_->GEM_pad_CSC_es_ME1a_even(layer2_last_pad); + layer2_pad_to_first_es_me1a = lookupTableME11ILT_->GEM_pad_CSC_es_ME11a_even(layer2_first_pad); + layer2_pad_to_last_es_me1a = lookupTableME11ILT_->GEM_pad_CSC_es_ME11a_even(layer2_last_pad); } else { // ME1/b - layer2_pad_to_first_es = lookupTableME11ILT_->GEM_pad_CSC_es_ME1b_odd(layer2_first_pad); - layer2_pad_to_last_es = lookupTableME11ILT_->GEM_pad_CSC_es_ME1b_odd(layer2_last_pad); + layer2_pad_to_first_es = lookupTableME11ILT_->GEM_pad_CSC_es_ME11b_odd(layer2_first_pad); + layer2_pad_to_last_es = lookupTableME11ILT_->GEM_pad_CSC_es_ME11b_odd(layer2_last_pad); // ME1/a - layer2_pad_to_first_es_me1a = lookupTableME11ILT_->GEM_pad_CSC_es_ME1a_odd(layer2_first_pad); - layer2_pad_to_last_es_me1a = lookupTableME11ILT_->GEM_pad_CSC_es_ME1a_odd(layer2_last_pad); + layer2_pad_to_first_es_me1a = lookupTableME11ILT_->GEM_pad_CSC_es_ME11a_odd(layer2_first_pad); + layer2_pad_to_last_es_me1a = lookupTableME11ILT_->GEM_pad_CSC_es_ME11a_odd(layer2_last_pad); } } @@ -432,8 +331,8 @@ void GEMClusterProcessor::doCoordinateConversion() { } } // middle 1/8-strip - int layer2_middle_es = 0.5 * (layer2_pad_to_first_es + layer2_pad_to_last_es); - int layer2_middle_es_me1a = 0.5 * (layer2_pad_to_first_es_me1a + layer2_pad_to_last_es_me1a); + int layer2_middle_es = int((layer2_pad_to_first_es + layer2_pad_to_last_es) / 2.0); + int layer2_middle_es_me1a = int((layer2_pad_to_first_es_me1a + layer2_pad_to_last_es_me1a) / 2.0); cluster.set_layer2_first_es(layer2_pad_to_first_es); cluster.set_layer2_last_es(layer2_pad_to_last_es); @@ -448,7 +347,7 @@ void GEMClusterProcessor::doCoordinateConversion() { // calculate the wiregroups // need to subtract 1 to use the LUTs - const int roll = cluster.roll() - 1; + const int roll = cluster.roll2() - 1; int roll_l2_to_min_wg = -1; int roll_l2_to_max_wg = -1; @@ -456,11 +355,11 @@ void GEMClusterProcessor::doCoordinateConversion() { // ME1/1 if (station_ == 1) { if (isEven_) { - roll_l2_to_min_wg = lookupTableME11ILT_->GEM_roll_L2_CSC_min_wg_ME11_even(roll); - roll_l2_to_max_wg = lookupTableME11ILT_->GEM_roll_L2_CSC_max_wg_ME11_even(roll); + roll_l2_to_min_wg = lookupTableME11ILT_->GEM_roll_CSC_min_wg_ME11_even(roll); + roll_l2_to_max_wg = lookupTableME11ILT_->GEM_roll_CSC_max_wg_ME11_even(roll); } else { - roll_l2_to_min_wg = lookupTableME11ILT_->GEM_roll_L2_CSC_min_wg_ME11_odd(roll); - roll_l2_to_max_wg = lookupTableME11ILT_->GEM_roll_L2_CSC_max_wg_ME11_odd(roll); + roll_l2_to_min_wg = lookupTableME11ILT_->GEM_roll_CSC_min_wg_ME11_odd(roll); + roll_l2_to_max_wg = lookupTableME11ILT_->GEM_roll_CSC_max_wg_ME11_odd(roll); } } @@ -491,7 +390,7 @@ std::vector GEMClusterProcessor::readoutCoPads() const { continue; // construct coincidence pads out of the centers of the coincidence clusters - output.emplace_back(cluster.roll(), cluster.mid1(), cluster.mid2()); + output.emplace_back(cluster.roll2(), cluster.mid1(), cluster.mid2()); } return output; diff --git a/L1Trigger/CSCTriggerPrimitives/src/GEMInternalCluster.cc b/L1Trigger/CSCTriggerPrimitives/src/GEMInternalCluster.cc index 6b14614121bec..832b70c022013 100644 --- a/L1Trigger/CSCTriggerPrimitives/src/GEMInternalCluster.cc +++ b/L1Trigger/CSCTriggerPrimitives/src/GEMInternalCluster.cc @@ -1,32 +1,52 @@ #include "L1Trigger/CSCTriggerPrimitives/interface/GEMInternalCluster.h" #include "DataFormats/CSCDigi/interface/CSCConstants.h" -GEMInternalCluster::GEMInternalCluster(const GEMDetId& id, +GEMInternalCluster::GEMInternalCluster(const GEMDetId& id1, + const GEMDetId& id2, const GEMPadDigiCluster& cluster1, - const GEMPadDigiCluster& cluster2) { - id_ = id; - + const GEMPadDigiCluster& cluster2, + const unsigned delayGEMinOTMB, + const unsigned tmbL1aWindowSize) { // set coincidence to false first isCoincidence_ = false; isValid_ = false; + // set matches to false first + isMatchingLayer1_ = false; + isMatchingLayer2_ = false; + + id1_ = id1; + id2_ = id2; + if (cluster1.isValid()) { isValid_ = true; cl1_ = cluster1; - bx_ = cluster1.bx() + CSCConstants::LCT_CENTRAL_BX; + if (cluster1.alctMatchTime() == -1) // It is a MC simulation + bx_ = cluster1.bx() + CSCConstants::LCT_CENTRAL_BX; + else if (cluster1.alctMatchTime() >= 0) // It is real data + bx_ = cluster1.bx() + CSCConstants::LCT_CENTRAL_BX - int(tmbL1aWindowSize / 2) - cluster1.alctMatchTime() + + delayGEMinOTMB; layer1_pad_ = cluster1.pads()[0]; layer1_size_ = cluster1.pads().size(); } if (cluster2.isValid()) { isValid_ = true; cl2_ = cluster2; - bx_ = cluster2.bx() + CSCConstants::LCT_CENTRAL_BX; + if (cluster2.alctMatchTime() == -1) // It is a MC simulation + bx_ = cluster2.bx() + CSCConstants::LCT_CENTRAL_BX; + else if (cluster2.alctMatchTime() >= 0) // It is real data + bx_ = cluster2.bx() + CSCConstants::LCT_CENTRAL_BX - int(tmbL1aWindowSize / 2) - cluster2.alctMatchTime() + + delayGEMinOTMB; layer2_pad_ = cluster2.pads()[0]; layer2_size_ = cluster2.pads().size(); } if (cluster1.isValid() and cluster2.isValid()) { - bx_ = cluster1.bx() + CSCConstants::LCT_CENTRAL_BX; + if (cluster1.alctMatchTime() == -1) // It is a MC simulation + bx_ = cluster1.bx() + CSCConstants::LCT_CENTRAL_BX; + else if (cluster1.alctMatchTime() >= 0) // It is real data + bx_ = cluster1.bx() + CSCConstants::LCT_CENTRAL_BX - int(tmbL1aWindowSize / 2) - cluster1.alctMatchTime() + + delayGEMinOTMB; isCoincidence_ = true; } @@ -35,22 +55,6 @@ GEMInternalCluster::GEMInternalCluster(const GEMDetId& id, layer2_min_wg_ = -1; layer2_max_wg_ = -1; - layer1_first_hs_ = -1; - layer2_first_hs_ = -1; - layer1_last_hs_ = -1; - layer2_last_hs_ = -1; - - layer1_first_hs_me1a_ = -1; - layer2_first_hs_me1a_ = -1; - layer1_last_hs_me1a_ = -1; - layer2_last_hs_me1a_ = -1; - - layer1_middle_hs_ = -1; - layer2_middle_hs_ = -1; - - layer1_middle_hs_me1a_ = -1; - layer2_middle_hs_me1a_ = -1; - layer1_first_es_ = -1; layer2_first_es_ = -1; layer1_last_es_ = -1; @@ -73,27 +77,15 @@ GEMInternalCluster::GEMInternalCluster() { isCoincidence_ = false; isValid_ = false; + // set matches to false first + isMatchingLayer1_ = false; + isMatchingLayer2_ = false; + layer1_min_wg_ = -1; layer1_max_wg_ = -1; layer2_min_wg_ = -1; layer2_max_wg_ = -1; - layer1_first_hs_ = -1; - layer2_first_hs_ = -1; - layer1_last_hs_ = -1; - layer2_last_hs_ = -1; - - layer1_first_hs_me1a_ = -1; - layer2_first_hs_me1a_ = -1; - layer1_last_hs_me1a_ = -1; - layer2_last_hs_me1a_ = -1; - - layer1_middle_hs_ = -1; - layer2_middle_hs_ = -1; - - layer1_middle_hs_me1a_ = -1; - layer2_middle_hs_me1a_ = -1; - layer1_first_es_ = -1; layer2_first_es_ = -1; layer1_last_es_ = -1; @@ -127,57 +119,35 @@ GEMPadDigi GEMInternalCluster::mid2() const { return GEMPadDigi(pad, cl2_.bx(), cl2_.station(), cl2_.nPartitions()); } -int GEMInternalCluster::min_wg() const { - if (id_.layer() == 1) - return layer1_min_wg(); - else - return layer2_min_wg(); -} - -int GEMInternalCluster::max_wg() const { - if (id_.layer() == 1) - return layer1_max_wg(); - else - return layer2_max_wg(); -} - -uint16_t GEMInternalCluster::getKeyStrip(int n) const { - // case for half-strips - if (n == 2) { - if (id_.layer() == 1) { - return (layer1_first_hs_ + layer1_last_hs_) / 2.; - } else { - return (layer2_first_hs_ + layer2_last_hs_) / 2.; - } - } - - // case for 1/8-strips - else { - if (id_.layer() == 1) { +uint16_t GEMInternalCluster::getKeyStrip(int n, bool isLayer2) const { + if (n == 8) { + if (!isLayer2) { return (layer1_first_es_ + layer1_last_es_) / 2.; } else { return (layer2_first_es_ + layer2_last_es_) / 2.; } - } -} - -uint16_t GEMInternalCluster::getKeyStripME1a(int n) const { - // case for half-strips - if (n == 2) { - if (id_.layer() == 1) { - return (layer1_first_hs_me1a_ + layer1_last_hs_me1a_) / 2.; + } else { // Half Strip units + if (!isLayer2) { + return (layer1_first_es_ + layer1_last_es_) / 8.; } else { - return (layer2_first_hs_me1a_ + layer2_last_hs_me1a_) / 2.; + return (layer2_first_es_ + layer2_last_es_) / 8.; } } +} - // case for 1/8-strips - else { - if (id_.layer() == 1) { +uint16_t GEMInternalCluster::getKeyStripME1a(int n, bool isLayer2) const { + if (n == 8) { + if (!isLayer2) { return (layer1_first_es_me1a_ + layer1_last_es_me1a_) / 2.; } else { return (layer2_first_es_me1a_ + layer2_last_es_me1a_) / 2.; } + } else { // Half Strip units + if (!isLayer2) { + return (layer1_first_es_me1a_ + layer1_last_es_me1a_) / 8.; + } else { + return (layer2_first_es_me1a_ + layer2_last_es_me1a_) / 8.; + } } } @@ -186,9 +156,10 @@ bool GEMInternalCluster::has_cluster(const GEMPadDigiCluster& cluster) const { } bool GEMInternalCluster::operator==(const GEMInternalCluster& cluster) const { - return id_ == cluster.id() and cl1_ == cluster.cl1() and cl2_ == cluster.cl2(); + return id1_ == cluster.id1() and id2_ == cluster.id2() and cl1_ == cluster.cl1() and cl2_ == cluster.cl2(); } std::ostream& operator<<(std::ostream& os, const GEMInternalCluster& cl) { - return os << cl.id() << " " << cl.cl1() << " " << cl.cl2(); + return os << "Cluster Layer 1: " << cl.id1() << " " << cl.cl1() << ", Cluster Layer 2: " << cl.id2() << " " + << cl.cl2(); } diff --git a/L1Trigger/CSCTriggerPrimitives/src/LCTQualityAssignment.cc b/L1Trigger/CSCTriggerPrimitives/src/LCTQualityAssignment.cc index c0e82e58263f4..974453081e57d 100644 --- a/L1Trigger/CSCTriggerPrimitives/src/LCTQualityAssignment.cc +++ b/L1Trigger/CSCTriggerPrimitives/src/LCTQualityAssignment.cc @@ -13,7 +13,7 @@ LCTQualityAssignment::LCTQualityAssignment(unsigned endcap, unsigned LCTQualityAssignment::findQuality(const CSCALCTDigi& aLCT, const CSCCLCTDigi& cLCT) const { // ALCT-CLCT matching without a cluster and ILT off - if (runCCLUT_ and !runILT_) { + if (run3_ and !runILT_) { return findQualityRun3(aLCT, cLCT); } // ALCT-CLCT matching without a cluster and ILT on diff --git a/L1Trigger/CSCTriggerPrimitives/src/LCTQualityControl.cc b/L1Trigger/CSCTriggerPrimitives/src/LCTQualityControl.cc index 02133e4993bff..60facdfa9023e 100644 --- a/L1Trigger/CSCTriggerPrimitives/src/LCTQualityControl.cc +++ b/L1Trigger/CSCTriggerPrimitives/src/LCTQualityControl.cc @@ -488,8 +488,8 @@ std::pair LCTQualityControl::get_csc_lct_min_max_quality(uns const bool GEMCSC = (isME11_ and runME11ILT_) or (isME21_ and runME21ILT_); - // Run-3 with CCLUT on - if (runCCLUT_ and !GEMCSC) { + // Run-3 + if (run3_ and !GEMCSC) { min_quality = static_cast(LCTQualityAssignment::LCT_QualityRun3::LowQ); max_quality = static_cast(LCTQualityAssignment::LCT_QualityRun3::HighQ); } @@ -502,7 +502,7 @@ std::pair LCTQualityControl::get_csc_lct_min_max_quality(uns // Run-3 CSC with GEM-CSC on and CCLUT on if (runCCLUT_ and GEMCSC) { - min_quality = static_cast(LCTQualityAssignment::LCT_QualityRun3GEM::ALCT_2GEM); + min_quality = static_cast(LCTQualityAssignment::LCT_QualityRun3GEM::CLCT_2GEM); max_quality = static_cast(LCTQualityAssignment::LCT_QualityRun3GEM::ALCT_CLCT_2GEM_GEMCSCBend); } return std::make_pair(min_quality, max_quality); diff --git a/L1Trigger/CSCTriggerPrimitives/test/runCSCTriggerPrimitiveProducer_cfg.py b/L1Trigger/CSCTriggerPrimitives/test/runCSCTriggerPrimitiveProducer_cfg.py index 6e8c37ec5c0f3..bd69270ea784d 100644 --- a/L1Trigger/CSCTriggerPrimitives/test/runCSCTriggerPrimitiveProducer_cfg.py +++ b/L1Trigger/CSCTriggerPrimitives/test/runCSCTriggerPrimitiveProducer_cfg.py @@ -31,8 +31,16 @@ options.register("useB904ME21", False, VarParsing.multiplicity.singleton, VarParsing.varType.bool, "Set to True when using B904 ME2/1 data (also works for ME3/1 and ME4/1).") options.register("useB904ME234s2", False, VarParsing.multiplicity.singleton, VarParsing.varType.bool, - "Set to True when using B904 ME1/1 data (also works for MEX/2 and ME1/3).") -options.register("run3", True, VarParsing.multiplicity.singleton, VarParsing.varType.bool, + "Set to True when using B904 ME4/2 data (also works for MEX/2 and ME1/3).") +options.register('useB904ME11PositiveEndcap',False,VarParsing.multiplicity.singleton,VarParsing.varType.bool, + "Set to True when using data from ME1/1 set as Positive Endcap chamber in B904.") +options.register('useB904ME11NegativeEndcap',False,VarParsing.multiplicity.singleton,VarParsing.varType.bool, + "Set to True when using data from ME1/1 set as Negative Endcap chamber in B904.") +options.register('useB904GE11Short',False,VarParsing.multiplicity.singleton,VarParsing.varType.bool, + "Set to True when using data from GE1/1 Short super chamber in B904.") +options.register('useB904GE11Long',False,VarParsing.multiplicity.singleton,VarParsing.varType.bool, + "Set to True when using data from GE1/1 Long super chamber in B904.") +options.register("run3", False, VarParsing.multiplicity.singleton, VarParsing.varType.bool, "Set to True when using Run-3 data.") options.register("runCCLUTOTMB", False, VarParsing.multiplicity.singleton, VarParsing.varType.bool, "Set to True when using the CCLUT OTMB algorithm.") @@ -116,14 +124,54 @@ process.muonCSCDigis.DisableMappingCheck = True process.muonCSCDigis.B904Setup = True process.muonCSCDigis.InputObjects = "rawDataCollectorCSC" + + if options.useB904ME11: + + if options.useB904ME11PositiveEndcap + options.useB904ME11NegativeEndcap == 2: + print("Choose at most one between useB904ME11PositiveEndcap and useB904ME11NegativeEndcap!") + elif options.useB904ME11NegativeEndcap: # Set manually the VME crate number for ME-1/1/02 + process.muonCSCDigis.B904vmecrate = 31 + else: # Set manually the VME crate number for ME+1/1/02 + process.muonCSCDigis.B904vmecrate = 1 + + if options.useB904GE11Short + options.useB904GE11Long == 2: + print("Choose at most one between useB904GE11Short and useB904GE11Long!") + elif options.useB904GE11Short: # Set manually the DMB slot for ME+-1/1/01 + process.muonCSCDigis.B904dmb = 2 + else: # Set manually the DMB slot for ME+-1/1/02 + process.muonCSCDigis.B904dmb = 3 + + elif options.useB904ME21: # Set manually the VME crate number and default DMB for ME+2/1/01 + process.muonCSCDigis.B904vmecrate = 18 + process.muonCSCDigis.B904dmb = 3 + + elif options.useB904ME234s2: # Set manually the VME crate number and default DMB for ME+4/2/01 + process.muonCSCDigis.B904vmecrate = 30 + process.muonCSCDigis.B904dmb = 9 + + else: # Set manually the VME crate number and default DMB for ME+1/1/02 + process.muonCSCDigis.B904vmecrate = 1 + process.muonCSCDigis.B904dmb = 3 + if options.unpackGEM: - process.muonCSCDigis.useGEMs = True - ## GEM + process.muonCSCDigis.useGEMs = True + + ## GEM mapping for b904 GEM-CSC integration stand + process.GlobalTag.toGet = cms.VPSet( + cms.PSet(record = cms.string("GEMChMapRcd"), + tag = cms.string("GEMeMap_GE11_b904_v1"), + connect = cms.string("frontier://FrontierProd/CMS_CONDITIONS") + ) + ) + process.muonGEMDigis.useDBEMap = True process.muonGEMDigis.InputLabel = "rawDataCollectorGEM" + process.muonGEMDigis.fedIdStart = 1478 + process.muonGEMDigis.fedIdEnd = 1478 ## l1 emulator l1csc = process.cscTriggerPrimitiveDigis if options.l1: + l1csc.commonParam.run3 = cms.bool(options.run3) l1csc.commonParam.runCCLUT_OTMB = cms.bool(options.runCCLUTOTMB) l1csc.commonParam.runCCLUT_TMB = cms.bool(options.runCCLUTTMB) l1csc.commonParam.runME11ILT = options.runME11ILT @@ -155,7 +203,7 @@ process.l1tdeGEMTPG.data = "emtfStage2Digis" ## GEM pad clusters from the CSC TPG else: - process.l1tdeGEMTPG.data = "muonCSCDigis" + process.l1tdeGEMTPG.data = "muonCSCDigis:MuonGEMPadDigiCluster" ## GEM pad clusters from the GEM TPG process.l1tdeGEMTPG.emul = "simMuonGEMPadDigiClusters" diff --git a/L1Trigger/L1TGEM/plugins/GEMPadDigiClusterProducer.cc b/L1Trigger/L1TGEM/plugins/GEMPadDigiClusterProducer.cc index 7b822470d7745..0c355bc86afaa 100644 --- a/L1Trigger/L1TGEM/plugins/GEMPadDigiClusterProducer.cc +++ b/L1Trigger/L1TGEM/plugins/GEMPadDigiClusterProducer.cc @@ -7,7 +7,28 @@ * * Based on documentation provided by the GEM firmware architects * - * \author Sven Dildick (TAMU) + * \author Sven Dildick (TAMU), updated by Giovanni Mocellin (UCDavis) + * + * ***************************************************** + * ** Notes on chambers and cluster packing algorithm ** + * ***************************************************** + * + * Based on: https://gitlab.cern.ch/emu/0xbefe/-/tree/devel/gem/hdl/cluster_finding/README.org + * (Andrew Peck, 2020/06/26) + * + * GE1/1 chamber has 8 iEta partitions and 1 OH + * GE2/1 chamber has 16 iEta partitions and 4 OH (one per module) + * + * Both GE1/1 and GE2/1 have 384 strips = 192 pads per iEta partition + * + * GE1/1 OH has 4 clustering partitions, each covering 2 iEta partitions + * GE2/1 OH has 4 clustering partitions, each covering 1 iEta partition + * + * Each clustering partition finds up to 4 clusters per BX, which are + * then sent to the sorter. The sorting of the clusters favors lower + * eta partitions and lower pad numbers. + * + * The first 8 clusters are selected and sent out through optical fibers. */ #include "FWCore/Framework/interface/MakerMacros.h" @@ -38,14 +59,9 @@ class GEMPadDigiClusterProducer : public edm::stream::EDProducer<> { public: - // all clusters per eta partition typedef std::vector GEMPadDigiClusters; typedef std::map GEMPadDigiClusterContainer; - // all clusters sorted by chamber, by opthohybrid and by eta partition - typedef std::map > > > - GEMPadDigiClusterSortedContainer; - explicit GEMPadDigiClusterProducer(const edm::ParameterSet& ps); ~GEMPadDigiClusterProducer() override; @@ -57,48 +73,8 @@ class GEMPadDigiClusterProducer : public edm::stream::EDProducer<> { static void fillDescriptions(edm::ConfigurationDescriptions& descriptions); private: - /** - * - ************************************* - ** Light Cluster Packing Algorithm ** - ************************************* - - Based on: https://github.com/cms-gem-daq-project/OptoHybridv3/raw/master/doc/OH_modules.docx - (Andrew Peck, Thomas Lenzi, Evaldas Juska) - - In the current version of the algorithm, cluster finding is segmented - into two separate halves of the GE1/1 chambers. Thus, each one of the - trigger fibers can transmit clusters only from the half of the chamber - that it corresponds to. For GE2/1, there are four separate quarts of - the GE2/1 chamber. - - This has the downside of being unable to transmit more than 4 clusters - when they occur within that side of the chamber, so there will be a - slightly higher rate of cluster overflow. For GE2/1 each OH can transmit - up to 5 clusters. - - The benefit, however, is in terms of (1) latency and (2) resource usage. - - The burden of finding clusters on of the chamber is significantly less, - and allows the cluster packer to operate in a simple, pipelined architecture - which returns up to 4 (or 5) clusters per half-chamber per bunch crossing. - - This faster architecture allows the mechanism to operate with only a - single copy of the cluster finding priority encoder and cluster truncator - (instead of two multiplexed copies), so the total resource usage of - these stages is approximately half. - - Further, a second step of cluster merging that is required in the full - algorithm is avoided, which reduces latency by an additional bunch - crossing and significantly reduces resource usage as well. - - The sorting of the clusters favors lower eta partitions and lower pad numbers - */ - void buildClusters(const GEMPadDigiCollection& pads, GEMPadDigiClusterContainer& out_clusters) const; - void sortClusters(const GEMPadDigiClusterContainer& in_clusters, - GEMPadDigiClusterSortedContainer& out_clusters) const; - void selectClusters(const GEMPadDigiClusterSortedContainer& in, GEMPadDigiClusterCollection& out) const; + void selectClusters(const GEMPadDigiClusterContainer& in_clusters, GEMPadDigiClusterCollection& out) const; template void checkValid(const T& cluster, const GEMDetId& id) const; @@ -107,10 +83,14 @@ class GEMPadDigiClusterProducer : public edm::stream::EDProducer<> { edm::ESGetToken geom_token_; edm::InputTag pads_; - unsigned int maxClustersOHGE11_; - unsigned int maxClustersOHGE21_; + unsigned int nPartitionsGE11_; + unsigned int nPartitionsGE21_; + unsigned int maxClustersPartitionGE11_; + unsigned int maxClustersPartitionGE21_; unsigned int nOHGE11_; unsigned int nOHGE21_; + unsigned int maxClustersOHGE11_; + unsigned int maxClustersOHGE21_; unsigned int maxClusterSize_; bool sendOverflowClusters_; @@ -119,10 +99,14 @@ class GEMPadDigiClusterProducer : public edm::stream::EDProducer<> { GEMPadDigiClusterProducer::GEMPadDigiClusterProducer(const edm::ParameterSet& ps) : geometry_(nullptr) { pads_ = ps.getParameter("InputCollection"); - maxClustersOHGE11_ = ps.getParameter("maxClustersOHGE11"); - maxClustersOHGE21_ = ps.getParameter("maxClustersOHGE21"); + nPartitionsGE11_ = ps.getParameter("nPartitionsGE11"); + nPartitionsGE21_ = ps.getParameter("nPartitionsGE21"); + maxClustersPartitionGE11_ = ps.getParameter("maxClustersPartitionGE11"); + maxClustersPartitionGE21_ = ps.getParameter("maxClustersPartitionGE21"); nOHGE11_ = ps.getParameter("nOHGE11"); nOHGE21_ = ps.getParameter("nOHGE21"); + maxClustersOHGE11_ = ps.getParameter("maxClustersOHGE11"); + maxClustersOHGE21_ = ps.getParameter("maxClustersOHGE21"); maxClusterSize_ = ps.getParameter("maxClusterSize"); sendOverflowClusters_ = ps.getParameter("sendOverflowClusters"); @@ -143,11 +127,15 @@ GEMPadDigiClusterProducer::~GEMPadDigiClusterProducer() {} void GEMPadDigiClusterProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) { edm::ParameterSetDescription desc; desc.add("InputCollection", edm::InputTag("simMuonGEMPadDigis")); - desc.add("maxClustersOHGE11", 4); - desc.add("maxClustersOHGE21", 5); - desc.add("nOHGE11", 2); - desc.add("nOHGE21", 4); - desc.add("maxClusterSize", 8); + desc.add("nPartitionsGE11", 4); // Number of clusterizer partitions per OH + desc.add("nPartitionsGE21", 4); // Number of clusterizer partitions per OH + desc.add("maxClustersPartitionGE11", 4); // Maximum number of clusters per clusterizer partition + desc.add("maxClustersPartitionGE21", 4); // Maximum number of clusters per clusterizer partition + desc.add("nOHGE11", 1); // Number of OH boards per chamber + desc.add("nOHGE21", 4); // Number of OH boards per chamber + desc.add("maxClustersOHGE11", 8); // Maximum number of clusters per OH + desc.add("maxClustersOHGE21", 8); // Maximum number of clusters per OH + desc.add("maxClusterSize", 8); // Maximum cluster size (number of pads) desc.add("sendOverflowClusters", false); descriptions.add("simMuonGEMPadDigiClustersDef", desc); @@ -169,12 +157,8 @@ void GEMPadDigiClusterProducer::produce(edm::Event& e, const edm::EventSetup& ev GEMPadDigiClusterContainer proto_clusters; buildClusters(*(hpads.product()), proto_clusters); - // // sort clusters per chamber, per OH, per partition number and per pad number - GEMPadDigiClusterSortedContainer sorted_clusters; - sortClusters(proto_clusters, sorted_clusters); - - // select the clusters from sorted clusters - selectClusters(sorted_clusters, *pClusters); + // sort and select clusters per chamber, per OH, per partition number and per pad number + selectClusters(proto_clusters, *pClusters); // store them in the event e.put(std::move(pClusters)); @@ -246,67 +230,38 @@ void GEMPadDigiClusterProducer::buildClusters(const GEMPadDigiCollection& det_pa } // end of partition loop } -void GEMPadDigiClusterProducer::sortClusters(const GEMPadDigiClusterContainer& proto_clusters, - GEMPadDigiClusterSortedContainer& sorted_clusters) const { - // The sorting of the clusters favors lower eta partitions and lower pad numbers - // By default the eta partitions are sorted by Id - - sorted_clusters.clear(); - - for (const auto& ch : geometry_->chambers()) { - // check the station number - const unsigned nOH = ch->id().isGE11() ? nOHGE11_ : nOHGE21_; - const unsigned nPartOH = ch->nEtaPartitions() / nOH; - - std::vector > > temp_clustersCH; - - for (unsigned int iOH = 0; iOH < nOH; iOH++) { - // all clusters for a set of eta partitions - std::vector > temp_clustersOH; - - // loop over the 4 or 2 eta partitions for this optohybrid - for (unsigned iPart = 1; iPart <= nPartOH; iPart++) { - // get the clusters for this eta partition - const GEMDetId& partId = ch->etaPartition(iPart + iOH * nPartOH)->id(); - if (proto_clusters.find(partId) != proto_clusters.end()) { - temp_clustersOH.emplace_back(partId, proto_clusters.at(partId)); - } - } // end of eta partition loop - - temp_clustersCH.emplace_back(temp_clustersOH); - } // end of OH loop - - sorted_clusters.emplace(ch->id(), temp_clustersCH); - } // end of chamber loop -} - -void GEMPadDigiClusterProducer::selectClusters(const GEMPadDigiClusterSortedContainer& sorted_clusters, +void GEMPadDigiClusterProducer::selectClusters(const GEMPadDigiClusterContainer& proto_clusters, GEMPadDigiClusterCollection& out_clusters) const { - // loop over chambers for (const auto& ch : geometry_->chambers()) { + const unsigned nOH = ch->id().isGE11() ? nOHGE11_ : nOHGE21_; + const unsigned nPartitions = ch->id().isGE11() ? nPartitionsGE11_ : nPartitionsGE21_; + const unsigned nEtaPerPartition = ch->nEtaPartitions() / (nPartitions * nOH); + const unsigned maxClustersPart = ch->id().isGE11() ? maxClustersPartitionGE11_ : maxClustersPartitionGE21_; const unsigned maxClustersOH = ch->id().isGE11() ? maxClustersOHGE11_ : maxClustersOHGE21_; - // loop over the optohybrids - for (const auto& optohybrid : sorted_clusters.at(ch->id())) { - // at most maxClustersOH per OH! - unsigned nClusters = 0; - - // loop over the eta partitions for this OH - for (const auto& etapart : optohybrid) { - const auto& detid(etapart.first); - const auto& clusters(etapart.second); - - // pick the clusters with lowest pad number - for (const auto& clus : clusters) { - if (nClusters < maxClustersOH) { - // check if the output cluster is valid - checkValid(clus, detid); - - out_clusters.insertDigi(detid, clus); - nClusters++; + // loop over OH in this chamber + for (unsigned int iOH = 0; iOH < nOH; iOH++) { + unsigned int nClustersOH = 0; // Up to 8 clusters per OH + // loop over clusterizer partitions + for (unsigned int iPart = 0; iPart < nPartitions; iPart++) { + unsigned int nClustersPart = 0; // Up to 4 clusters per clustizer partition + // loop over the eta partitions for this clusterizer partition + for (unsigned iEta = 1; iEta <= nEtaPerPartition; iEta++) { + // get the clusters for this eta partition + const GEMDetId& iEtaId = + ch->etaPartition(iEta + iPart * nEtaPerPartition + iOH * nPartitions * nEtaPerPartition)->id(); + if (proto_clusters.find(iEtaId) != proto_clusters.end()) { + for (const auto& cluster : proto_clusters.at(iEtaId)) { + if (nClustersPart < maxClustersPart and nClustersOH < maxClustersOH) { + checkValid(cluster, iEtaId); + out_clusters.insertDigi(iEtaId, cluster); + nClustersPart++; + nClustersOH++; + } + } // end of loop on clusters in eta } - } // end of cluster loop - } // end of eta partition loop + } // end of eta partition loop + } // end of clusterizer partition loop } // end of OH loop } // end of chamber loop } diff --git a/L1Trigger/L1TMuonEndCap/python/simEmtfDigis_cfi.py b/L1Trigger/L1TMuonEndCap/python/simEmtfDigis_cfi.py index f1b76bd0f7248..9125b662f1986 100644 --- a/L1Trigger/L1TMuonEndCap/python/simEmtfDigis_cfi.py +++ b/L1Trigger/L1TMuonEndCap/python/simEmtfDigis_cfi.py @@ -152,16 +152,16 @@ ## Era: Run2_2016 from Configuration.Eras.Modifier_stage2L1Trigger_cff import stage2L1Trigger -stage2L1Trigger.toModify(simEmtfDigis, RPCEnable = cms.bool(False), Era = cms.string('Run2_2016')) +stage2L1Trigger.toModify(simEmtfDigis, RPCEnable = False, Era = 'Run2_2016') ## Era: Run2_2017 from Configuration.Eras.Modifier_stage2L1Trigger_2017_cff import stage2L1Trigger_2017 -stage2L1Trigger_2017.toModify(simEmtfDigis, RPCEnable = cms.bool(True), Era = cms.string('Run2_2017')) +stage2L1Trigger_2017.toModify(simEmtfDigis, RPCEnable = True, Era = 'Run2_2017') ## Era: Run2_2018 from Configuration.Eras.Modifier_stage2L1Trigger_2018_cff import stage2L1Trigger_2018 -stage2L1Trigger_2018.toModify(simEmtfDigis, RPCEnable = cms.bool(True), Era = cms.string('Run2_2018')) +stage2L1Trigger_2018.toModify(simEmtfDigis, RPCEnable = True, Era = 'Run2_2018') ## Era: Run3_2021 from Configuration.Eras.Modifier_stage2L1Trigger_2021_cff import stage2L1Trigger_2021 -stage2L1Trigger_2021.toModify(simEmtfDigis, RPCEnable = cms.bool(True), UseRun3CCLUT_OTMB = cms.bool(False), Era = cms.string('Run3_2021')) +stage2L1Trigger_2021.toModify(simEmtfDigis, RPCEnable = True, UseRun3CCLUT_OTMB = True, Era = 'Run3_2021')