46 const std::vector<L1MuDTChambPhDigi> *phiChambVectorDT;
51 const std::vector<L1MuDTChambPhDigi> *phiChambVectorRPC;
55 int ibx_dtm = 0, fbx_dtm = 0;
56 int ibx_dtp = 0, fbx_dtp = 0;
59 for (
int sector=0;sector<12; sector++ ){
61 bool shifted[7] = {
false,
false,
false,
false,
false,
false,
false};
62 bool dups[7] = {
false,
false,
false,
false,
false,
false,
false};
63 bool secondTs[7] = {
false,
false,
false,
false,
false,
false,
false};
66 for(
int bx=3; bx>=-3; bx--){
67 vector<int> delta_m, delta_p, delta_0;
68 for(
int rpcbx=bx-1; rpcbx<=bx+1; rpcbx++){
79 if((dtts->
bxNum()-rpcbx)==-1 ) {
81 ibx_dtm = dtts->
bxNum();
84 if((dtts->
bxNum()-rpcbx)==0 ) {
87 if((dtts->
bxNum()-rpcbx)==1 ) {
89 ibx_dtp = dtts->
bxNum();
98 delta.insert(delta.end(), delta_0.begin(), delta_0.end());
99 delta.insert(delta.end(), delta_p.begin(), delta_p.end());
100 delta.insert(delta.end(), delta_m.begin(), delta_m.end());
106 std::vector<L1MuDTChambPhDigi> l1ttma_outsh;
108 unsigned int min_index =
std::distance(delta.begin(), std::min_element(delta.begin(), delta.end())) + 0;
109 int init_bx = 0, final_bx = 0;
111 if ( ((delta_0.size() <= min_index) && ( min_index < (delta_0.size() + delta_p.size()) ) && !delta_p.empty() ) ) {
115 else if ( (delta_0.size() + delta_p.size()) <= min_index && !delta_m.empty() ) {
123 bool shift_1 =
false;
124 if(dtts && dtts->
code()<
m_QualityLimit && (!dttsnew || shifted[final_bx+3] || dups[final_bx+3])) {
126 l1ttma_outsh.push_back(*dtts_sh);
127 shifted[init_bx+3] =
true;
139 secondTs[final_bx+3] =
true;
140 dups[init_bx+3] =
false;
141 shifted[init_bx+3] =
true;
148 for(
int bx=-3; bx<=3; bx++){
155 if(dups[bx+3])
continue;
158 if(!shifted[bx+3] && dtts) {
181 const std::vector<L1MuDTChambPhDigi>* vInCon = inCon.
getContainer();
182 for (
auto &
i: *vInCon){
183 if (bx ==
i.bxNum() &&
i.code() != 7 &&
i.whNum()==wh &&
i.scNum()==sec &&
i.stNum()==st) size++;
191 const std::vector<L1MuDTChambPhDigi>* vInCon = inCon.
getContainer();
192 for (
auto &
i:* vInCon){
193 if (bx ==
i.bxNum() &&
i.code() != 7 &&
i.whNum()==wh &&
i.scNum()==sec &&
i.stNum()==st) size++;
void run(const edm::EventSetup &c)
L1MuDTChambPhDigi * chPhiSegm(int wheel, int stat, int sect, int bx, int ts2tag)
int get_DphiWindowBxShift() const
void setContainer(const Phi_Container &inputSegments)
void BxCorrection(int track_seg)
PRODUCT const & get(ESGetToken< PRODUCT, T > const &iToken) const
void setContainer(Phi_Container inputSegments)
Phi_Container const * getContainer() const
Abs< T >::type abs(const T &t)
std::vector< L1MuDTChambPhDigi > m_l1ttma_out
int get_USERPCBXFORDTBELOWQUALITY() const
L1MuDTChambPhContainer m_phiRPCDigis
static int deltaPhi(int dt_phi, int rpc_strip)
static int nRPCHits(L1MuTMChambPhContainer inCon, int bx, int wh, int sec, int st)
Phi_Container const * getContainer() const
edm::ESHandle< L1TTwinMuxParams > tmParamsHandle
T const * product() const
L1MuDTChambPhContainer m_dt_tsshifted
DTRPCBxCorrection(L1MuDTChambPhContainer, L1MuDTChambPhContainer)
L1MuDTChambPhContainer m_phiDTDigis