23 defineParameter(
"InputWidth1", 5);
24 defineParameter(
"InputWidth2", 3);
25 defineParameter(
"NumResultBits", 3);
26 defineParameter(
"DeltaPhiMin", 0, 0);
27 defineParameter(
"DeltaPhiMax", 63, 0);
28 defineParameter(
"DeltaPhiMin", 0, 1);
29 defineParameter(
"DeltaPhiMax", 5, 1);
30 defineParameter(
"DeltaPhiMin", 25, 2);
31 defineParameter(
"DeltaPhiMax", 32, 2);
32 defineParameter(
"DeltaEtaMin", 0, 0);
33 defineParameter(
"DeltaEtaMax", 63, 0);
34 defineParameter(
"DeltaEtaMin", 0, 1);
35 defineParameter(
"DeltaEtaMax", 5, 1);
36 defineParameter(
"DeltaEtaMin", 25, 2);
37 defineParameter(
"DeltaEtaMax", 32, 2);
38 defineParameter(
"MinET1",1);
39 defineParameter(
"MinET2",1);
40 setNumberOutputBits(3);
48 p_NumberLeading1 = parameter(
"InputWidth1").value();
49 p_NumberLeading2 = parameter(
"InputWidth2").value();
50 for(
int i=0;
i<3; ++
i) {
51 p_DeltaPhiMin[
i] = parameter(
"DeltaPhiMin",
i).value();
52 p_DeltaPhiMax[
i] = parameter(
"DeltaPhiMax",
i).value();
53 p_DeltaEtaMin[
i] = parameter(
"DeltaEtaMin",
i).value();
54 p_DeltaEtaMax[
i] = parameter(
"DeltaEtaMax",
i).value();
57 p_MinET1 = parameter(
"MinET1").value();
58 p_MinET2 = parameter(
"MinET2").value();
81 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
82 std::string hname_accept =
"hDeltaRApproxBoxCutIncl2_accept_bit"+
std::to_string((
int)
i);
83 std::string hname_reject =
"hDeltaRApproxBoxCutIncl2_reject_bit"+
std::to_string((
int)
i);
85 bookHist(m_histAccept, hname_accept,
"DETA vs DPHI", 100, p_DeltaEtaMin[
i], p_DeltaEtaMax[
i], 100, p_DeltaPhiMin[
i], p_DeltaPhiMax[
i]);
86 bookHist(m_histReject, hname_reject,
"DETA vs DPHI", 100, p_DeltaEtaMin[
i], p_DeltaEtaMax[
i], 100, p_DeltaPhiMin[
i], p_DeltaPhiMax[
i]);
94 const std::vector<TCS::TOBArray *> &
output,
105 const std::vector<TCS::TOBArray *> &
output,
108 if(
input.size() == 2) {
110 unsigned int nLeading = p_NumberLeading1;
115 if(
parType_t((*tob1)->Et()) <= p_MinET1 )
continue;
119 if(
parType_t((*tob2)->Et()) <= p_MinET2)
continue;
121 unsigned int deltaPhi = calcDeltaPhi( *tob1, *tob2 );
123 unsigned int deltaEta = calcDeltaEta( *tob1, *tob2 );
126 std::stringstream msgss;
129 <<
" phi1=" << (*tob1)->phi()
130 <<
" , phi2=" << (*tob2)->phi()
132 <<
", DeltaEta = " <<
deltaEta <<
" -> ";
133 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
136 const bool fillAccept = fillHistos() and (fillHistosBasedOnHardware() ? getDecisionHardwareBit(
i) :
accept);
137 const bool fillReject = fillHistos() and not fillAccept;
138 const bool alreadyFilled = decision.
bit(
i);
143 if(fillAccept and not alreadyFilled) {
145 }
else if(fillReject) {
148 msgss <<
"DeltaRApproxBoxCutIncl2 alg bit" <<
i << (
accept?
" pass":
" fail") <<
"|";
154 TCS_EXCEPTION(
"DeltaRApproxBoxCutIncl2 alg must have 2 inputs, but got " <<
input.size());