24 defineParameter(
"InputWidth", 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(
"InputWidth").value();
49 p_NumberLeading2 = parameter(
"InputWidth").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();
79 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
80 std::string hname_accept =
"hDeltaRApproxBoxCutIncl1_accept_bit"+
std::to_string((
int)
i);
81 std::string hname_reject =
"hDeltaRApproxBoxCutIncl1_reject_bit"+
std::to_string((
int)
i);
83 bookHist(m_histAccept, hname_accept,
"DETA vs DPHI", 100, p_DeltaEtaMin[
i], p_DeltaEtaMax[
i], 100, p_DeltaPhiMin[
i], p_DeltaPhiMax[
i]);
84 bookHist(m_histReject, hname_reject,
"DETA vs DPHI", 100, p_DeltaEtaMin[
i], p_DeltaEtaMax[
i], 100, p_DeltaPhiMin[
i], p_DeltaPhiMax[
i]);
93 const std::vector<TCS::TOBArray *> &
output,
103 const std::vector<TCS::TOBArray *> &
output,
106 if(
input.size() == 1) {
108 unsigned int nLeading = p_NumberLeading1;
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 <<
"DeltaRApproxBoxCutIncl1 alg bit" <<
i << (
accept?
" pass":
" fail") <<
"|";
154 TCS_EXCEPTION(
"DeltaRApproxBoxCutIncl1 alg must have 1 input, but got " <<
input.size());