25 defineParameter(
"InputWidth1", 5);
26 defineParameter(
"InputWidth2", 3);
27 defineParameter(
"MaxTob1", 0);
28 defineParameter(
"MaxTob2", 0);
29 defineParameter(
"NumResultBits", 3);
30 defineParameter(
"MinET1",1,0);
31 defineParameter(
"MinET2",1,0);
32 defineParameter(
"DeltaEtaMin", 0, 0);
33 defineParameter(
"DeltaEtaMax", 63, 0);
34 defineParameter(
"DeltaPhiMin", 0, 0);
35 defineParameter(
"DeltaPhiMax", 63, 0);
36 defineParameter(
"MinET1",1,1);
37 defineParameter(
"MinET2",1,1);
38 defineParameter(
"DeltaEtaMin", 0, 1);
39 defineParameter(
"DeltaEtaMax", 5, 1);
40 defineParameter(
"DeltaPhiMin", 0, 1);
41 defineParameter(
"DeltaPhiMax", 5, 1);
42 defineParameter(
"MinET1",1,2);
43 defineParameter(
"MinET2",1,2);
44 defineParameter(
"DeltaEtaMin", 25, 2);
45 defineParameter(
"DeltaEtaMax", 32, 2);
46 defineParameter(
"DeltaPhiMin", 25, 2);
47 defineParameter(
"DeltaPhiMax", 32, 2);
48 setNumberOutputBits(3);
56 p_NumberLeading1 = parameter(
"InputWidth1").value();
57 p_NumberLeading2 = parameter(
"InputWidth2").value();
58 if(parameter(
"MaxTob1").
value() > 0) p_NumberLeading1 = parameter(
"MaxTob1").value();
59 if(parameter(
"MaxTob2").
value() > 0) p_NumberLeading2 = parameter(
"MaxTob2").value();
61 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
62 p_DeltaPhiMin[
i] = parameter(
"DeltaPhiMin",
i).value();
63 p_DeltaPhiMax[
i] = parameter(
"DeltaPhiMax",
i).value();
64 p_DeltaEtaMin[
i] = parameter(
"DeltaEtaMin",
i).value();
65 p_DeltaEtaMax[
i] = parameter(
"DeltaEtaMax",
i).value();
66 p_MinET1[
i] = parameter(
"MinET1",
i).value();
67 p_MinET2[
i] = parameter(
"MinET2",
i).value();
85 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
86 std::string hname_accept =
"hDeltaEtaPhiIncl2_accept_bit"+
std::to_string((
int)
i);
87 std::string hname_reject =
"hDeltaEtaPhiIncl2_reject_bit"+
std::to_string((
int)
i);
89 bookHist(m_histAccept, hname_accept,
"DETA vs DPHI", 100, p_DeltaEtaMin[
i], p_DeltaEtaMax[
i], 100, p_DeltaPhiMin[
i], p_DeltaPhiMax[
i]);
90 bookHist(m_histReject, hname_reject,
"DETA vs DPHI", 100, p_DeltaEtaMin[
i], p_DeltaEtaMax[
i], 100, p_DeltaPhiMin[
i], p_DeltaPhiMax[
i]);
100 const std::vector<TCS::TOBArray *> &
output,
103 if(
input.size() == 2) {
105 unsigned int nLeading = p_NumberLeading1;
114 unsigned int deltaPhi = calcDeltaPhiBW( *tob1, *tob2 );
116 unsigned int deltaEta = calcDeltaEtaBW( *tob1, *tob2 );
119 std::stringstream msgss;
120 msgss <<
" phi1=" << (*tob1)->phi() <<
" , phi2=" << (*tob2)->phi()
122 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
124 if(
parType_t((*tob1)->Et()) <= p_MinET1[
i] )
continue;
125 if(
parType_t((*tob2)->Et()) <= p_MinET2[
i])
continue;
127 const bool fillAccept = fillHistos() and (fillHistosBasedOnHardware() ? getDecisionHardwareBit(
i) :
accept);
128 const bool fillReject = fillHistos() and not fillAccept;
129 const bool alreadyFilled = decision.
bit(
i);
134 if(fillAccept and not alreadyFilled) {
136 }
else if(fillReject) {
139 msgss <<
"DeltaRApproxBoxCutIncl2 alg bit" <<
i << (
accept?
" pass":
" fail") <<
"|";
153 const std::vector<TCS::TOBArray *> &
output,
156 if(
input.size() == 2) {
158 unsigned int nLeading = p_NumberLeading1;
167 unsigned int deltaPhi = calcDeltaPhi( *tob1, *tob2 );
169 unsigned int deltaEta = calcDeltaEta( *tob1, *tob2 );
172 std::stringstream msgss;
175 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
177 if(
parType_t((*tob1)->Et()) <= p_MinET1[
i] )
continue;
178 if(
parType_t((*tob2)->Et()) <= p_MinET2[
i])
continue;
180 const bool fillAccept = fillHistos() and (fillHistosBasedOnHardware() ? getDecisionHardwareBit(
i) :
accept);
181 const bool fillReject = fillHistos() and not fillAccept;
182 const bool alreadyFilled = decision.
bit(
i);
187 if(fillAccept and not alreadyFilled) {
189 }
else if(fillReject) {
192 msgss <<
"DeltaRApproxBoxCutIncl2 alg bit" <<
i << (
accept?
" pass":
" fail") <<
"|";