54 p_NumberLeading1 = parameter(
"InputWidth1").value();
55 p_NumberLeading2 = parameter(
"InputWidth2").value();
56 if(parameter(
"MaxTob1").
value() > 0) p_NumberLeading1 = parameter(
"MaxTob1").value();
57 if(parameter(
"MaxTob2").
value() > 0) p_NumberLeading2 = parameter(
"MaxTob2").value();
58 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
59 p_DeltaPhiMin[
i] = parameter(
"MinDeltaPhi",
i).value();
60 p_DeltaPhiMax[
i] = parameter(
"MaxDeltaPhi",
i).value();
61 p_MinET1[
i] = parameter(
"MinET1",
i).value();
62 p_MinET2[
i] = parameter(
"MinET2",
i).value();
76 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
77 std::string hname_accept =
"hDeltaPhiIncl2_accept_bit"+
std::to_string((
int)
i);
78 std::string hname_reject =
"hDeltaPhiIncl2_reject_bit"+
std::to_string((
int)
i);
80 bookHist(m_histAccept, hname_accept,
"DPHI", 100, p_DeltaPhiMin[
i], p_DeltaPhiMax[
i]);
81 bookHist(m_histReject, hname_reject,
"DPHI", 100, p_DeltaPhiMin[
i], p_DeltaPhiMax[
i]);
92 const std::vector<TCS::TOBArray *> & output,
95 if( input.size() == 2) {
96 std::vector<bool> iaccept (numberOutputBits());
98 tob1 != input[0]->end() &&
distance(input[0]->
begin(), tob1) < p_NumberLeading1;
102 tob2 != input[1]->end() &&
distance(input[1]->
begin(), tob2) < p_NumberLeading2;
105 unsigned int deltaPhi = calcDeltaPhiBW( *tob1, *tob2 );
106 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
108 if(
parType_t((*tob1)->Et()) <= p_MinET1[
i])
continue;
109 if(
parType_t((*tob2)->Et()) <= p_MinET2[
i])
continue;
111 const bool fillAccept = fillHistos() and (fillHistosBasedOnHardware() ? getDecisionHardwareBit(
i) :
accept);
112 const bool fillReject = fillHistos() and not fillAccept;
113 const bool alreadyFilled = decision.
bit(
i);
118 if(fillAccept and not alreadyFilled) {
120 }
else if(fillReject) {
124 << (
accept?
"pass":
"fail"));
128 for (
unsigned int i=0;
i < numberOutputBits(); ++
i) {
131 output[
i]->setAmbiguityFlag(hasAmbiguousInputs);
134 TCS_EXCEPTION(
"DeltaPhiIncl2 alg must have 2 inputs, but got " << input.size());
142 const std::vector<TCS::TOBArray *> & output,
145 if( input.size() == 2) {
146 std::vector<bool> iaccept (numberOutputBits());
148 tob1 != input[0]->end() &&
distance(input[0]->
begin(), tob1) < p_NumberLeading1;
152 tob2 != input[1]->end() &&
distance(input[1]->
begin(), tob2) < p_NumberLeading2;
155 unsigned int deltaPhi = calcDeltaPhi( *tob1, *tob2 );
156 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
158 if(
parType_t((*tob1)->Et()) <= p_MinET1[
i])
continue;
159 if(
parType_t((*tob2)->Et()) <= p_MinET2[
i])
continue;
161 const bool fillAccept = fillHistos() and (fillHistosBasedOnHardware() ? getDecisionHardwareBit(
i) :
accept);
162 const bool fillReject = fillHistos() and not fillAccept;
163 const bool alreadyFilled = decision.
bit(
i);
168 if(fillAccept and not alreadyFilled) {
170 }
else if(fillReject) {
174 << (
accept?
"pass":
"fail"));
179 TCS_EXCEPTION(
"DeltaPhiIncl2 alg must have 2 inputs, but got " << input.size());