25 #define LOG std::cout << "TCS::DisambiguationDetaDPhiIncl3: "
61 p_NumberLeading1 = parameter(
"InputWidth1").value();
62 p_NumberLeading2 = parameter(
"InputWidth2").value();
63 p_NumberLeading3 = parameter(
"InputWidth3").value();
65 if(parameter(
"MaxTob1").
value() > 0) p_NumberLeading1 = parameter(
"MaxTob1").value();
66 if(parameter(
"MaxTob2").
value() > 0) p_NumberLeading2 = parameter(
"MaxTob2").value();
67 if(parameter(
"MaxTob3").
value() > 0) p_NumberLeading3 = parameter(
"MaxTob3").value();
70 p_MinET1 = parameter(
"MinET1").value();
71 p_MinET2 = parameter(
"MinET2").value();
72 p_MinET3 = parameter(
"MinET3").value();
73 p_EtaMin1 = parameter(
"EtaMin1").value();
74 p_EtaMax1 = parameter(
"EtaMax1").value();
75 p_EtaMin2 = parameter(
"EtaMin2").value();
76 p_EtaMax2 = parameter(
"EtaMax2").value();
77 p_EtaMin3 = parameter(
"EtaMin3").value();
78 p_EtaMax3 = parameter(
"EtaMax3").value();
79 p_DeltaPhiMin = parameter(
"DeltaPhiMin").value();
80 p_DeltaPhiMax = parameter(
"DeltaPhiMax").value();
81 p_DeltaEtaMin = parameter(
"DeltaEtaMin").value();
82 p_DeltaEtaMax = parameter(
"DeltaEtaMax").value();
85 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
86 p_DisambDR[
i] = parameter(
"DisambDR",
i).value();
117 const std::vector<TCS::TOBArray *> & output,
122 if( input.size() == 3) {
126 tob1 != input[0]->end() &&
distance(input[0]->
begin(), tob1) < p_NumberLeading1;
130 if(
parType_t((*tob1)->Et()) <= p_MinET1)
continue;
131 if(
parType_t(std::abs((*tob1)->eta())) > p_EtaMax1 )
continue;
132 if(
parType_t(std::abs((*tob1)->eta())) < p_EtaMin1 )
continue;
135 tob2 != input[1]->end() &&
distance(input[1]->
begin(), tob2) < p_NumberLeading2;
138 if(
parType_t((*tob2)->Et()) <= p_MinET2)
continue;
139 if(
parType_t(std::abs((*tob2)->eta())) > p_EtaMax2 )
continue;
140 if(
parType_t(std::abs((*tob2)->eta())) < p_EtaMin2 )
continue;
143 unsigned int deltaPhi = calcDeltaPhiBW( *tob1, *tob2 );
145 unsigned int deltaEta = calcDeltaEtaBW( *tob1, *tob2 );
151 tob3 != input[2]->end() ;
153 if(
parType_t((*tob3)->Et()) <= p_MinET3)
continue;
154 if(
parType_t(std::abs((*tob3)->eta())) > p_EtaMax3 )
continue;
155 if(
parType_t(std::abs((*tob3)->eta())) < p_EtaMin3 )
continue;
156 unsigned int deltaR13 = calcDeltaR2BW( *tob1, *tob3 );
157 unsigned int deltaR23 = calcDeltaR2BW( *tob2, *tob3 );
158 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
160 accept = deltaR13 > p_DisambDR[
i] && deltaR23 > p_DisambDR[
i] ;
165 TRG_MSG_DEBUG(
"Decision " <<
i <<
": " << (
accept?
"pass":
"fail") <<
" deltaR13 = " << deltaR13 <<
" deltaR23 = " << deltaR23);
173 for (
unsigned int i=0;
i < numberOutputBits(); ++
i) {
174 output[
i]->setAmbiguityFlag(hasAmbiguousInputs);
177 TCS_EXCEPTION(
"DisambiguationDetaDPhiIncl3 alg must have 3 inputs, but got " << input.size());
185 const std::vector<TCS::TOBArray *> & output,
190 if( input.size() == 3) {
194 tob1 != input[0]->end() &&
distance(input[0]->
begin(), tob1) < p_NumberLeading1;
198 if(
parType_t((*tob1)->Et()) <= p_MinET1)
continue;
199 if(
parType_t(std::abs((*tob1)->eta())) > p_EtaMax1 )
continue;
200 if(
parType_t(std::abs((*tob1)->eta())) < p_EtaMin1 )
continue;
203 tob2 != input[1]->end() &&
distance(input[1]->
begin(), tob2) < p_NumberLeading2;
206 if(
parType_t((*tob2)->Et()) <= p_MinET2)
continue;
207 if(
parType_t(std::abs((*tob2)->eta())) > p_EtaMax2 )
continue;
208 if(
parType_t(std::abs((*tob2)->eta())) < p_EtaMin2 )
continue;
211 unsigned int deltaPhi = calcDeltaPhi( *tob1, *tob2 );
213 unsigned int deltaEta = calcDeltaEta( *tob1, *tob2 );
219 tob3 != input[2]->end() ;
221 if(
parType_t((*tob3)->Et()) <= p_MinET3)
continue;
222 if(
parType_t(std::abs((*tob3)->eta())) > p_EtaMax3 )
continue;
223 if(
parType_t(std::abs((*tob3)->eta())) < p_EtaMin3 )
continue;
224 unsigned int deltaR13 = calcDeltaR2( *tob1, *tob3 );
225 unsigned int deltaR23 = calcDeltaR2( *tob2, *tob3 );
226 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
228 accept = deltaR13 > p_DisambDR[
i] && deltaR23 > p_DisambDR[
i] ;
233 TRG_MSG_DEBUG(
"Decision " <<
i <<
": " << (
accept?
"pass":
"fail") <<
" deltaR13 = " << deltaR13 <<
" deltaR23 = " << deltaR23);
239 TCS_EXCEPTION(
"DisambiguationDetaDPhiIncl3 alg must have 3 inputs, but got " << input.size());