25 defineParameter(
"InputWidth", 0);
26 defineParameter(
"MaxTob", 0);
27 defineParameter(
"NumResultBits", 2);
28 defineParameter(
"MinET1",0,0);
29 defineParameter(
"MinET2",0,0);
30 defineParameter(
"MinDeltaPhi", 0, 0);
31 defineParameter(
"MaxDeltaPhi", 31, 0);
32 defineParameter(
"MinET1",0,1);
33 defineParameter(
"MinET2",0,1);
34 defineParameter(
"MinDeltaPhi", 0, 1);
35 defineParameter(
"MaxDeltaPhi", 31, 1);
37 setNumberOutputBits(2);
46 if(parameter(
"MaxTob").
value() > 0) {
47 p_NumberLeading1 = parameter(
"MaxTob").value();
48 p_NumberLeading2 = parameter(
"MaxTob").value();
50 p_NumberLeading1 = parameter(
"InputWidth").value();
51 p_NumberLeading2 = parameter(
"InputWidth").value();
54 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
55 p_DeltaPhiMin[
i] = parameter(
"MinDeltaPhi",
i).value();
56 p_DeltaPhiMax[
i] = parameter(
"MaxDeltaPhi",
i).value();
57 p_MinET1[
i] = parameter(
"MinET1",
i).value();
58 p_MinET2[
i] = parameter(
"MinET2",
i).value();
72 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
73 std::string hname_accept =
"hDeltaPhiIncl1_accept_bit"+
std::to_string((
int)
i);
74 std::string hname_reject =
"hDeltaPhiIncl1_reject_bit"+
std::to_string((
int)
i);
76 bookHist(m_histAccept, hname_accept,
"DPHI", 100, p_DeltaPhiMin[
i], p_DeltaPhiMax[
i]);
77 bookHist(m_histReject, hname_reject,
"DPHI", 100, p_DeltaPhiMin[
i], p_DeltaPhiMax[
i]);
88 const std::vector<TCS::TOBArray *> &
output,
91 if(
input.size() == 1) {
93 unsigned int nLeading = p_NumberLeading1;
94 unsigned int nLeading2 = p_NumberLeading2;
101 if ((*tob1)->Et() == (*tob1_plus1)->Et() &&
distance(
input[0]->
begin(), tob1) == nLeading - 1) {
102 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
103 output[
i]->setAmbiguityFlag(
true);
112 unsigned int deltaPhi = calcDeltaPhiBW( *tob1, *tob2 );
113 std::stringstream msgss;
114 msgss <<
" phi1=" << (*tob1)->phi() <<
" , phi2=" << (*tob2)->phi()
115 <<
", DeltaPhi = " <<
deltaPhi <<
" -> ";
116 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
122 const bool fillAccept = fillHistos() and (fillHistosBasedOnHardware() ? getDecisionHardwareBit(
i) :
accept);
123 const bool fillReject = fillHistos() and not fillAccept;
124 const bool alreadyFilled = decision.
bit(
i);
129 if(fillAccept and not alreadyFilled) {
131 }
else if(fillReject) {
135 << (
accept?
"pass":
"fail"));
147 const std::vector<TCS::TOBArray *> &
output,
150 if(
input.size() == 1) {
152 unsigned int nLeading = p_NumberLeading1;
153 unsigned int nLeading2 = p_NumberLeading2;
160 if ((*tob1)->Et() == (*tob1_plus1)->Et() &&
distance(
input[0]->
begin(), tob1) == nLeading - 1) {
161 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
162 output[
i]->setAmbiguityFlag(
true);
171 unsigned int deltaPhi = calcDeltaPhi( *tob1, *tob2 );
172 std::stringstream msgss;
175 <<
" phi1=" << (*tob1)->phi()
176 <<
" , phi2=" << (*tob2)->phi()
177 <<
", DeltaPhi = " <<
deltaPhi <<
" -> ";
178 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
184 const bool fillAccept = fillHistos() and (fillHistosBasedOnHardware() ? getDecisionHardwareBit(
i) :
accept);
185 const bool fillReject = fillHistos() and not fillAccept;
186 const bool alreadyFilled = decision.
bit(
i);
191 if(fillAccept and not alreadyFilled) {
193 }
else if(fillReject) {
197 << (
accept?
"pass":
"fail"));