28 #define LOG cout << fullname() << ": "
66 p_NumberLeading1 = parameter(
"InputWidth1").value();
67 p_NumberLeading2 = parameter(
"InputWidth2").value();
68 if(parameter(
"MaxTob1").
value() > 0) p_NumberLeading1 = parameter(
"MaxTob1").value();
69 if(parameter(
"MaxTob2").
value() > 0) p_NumberLeading2 = parameter(
"MaxTob2").value();
71 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
72 p_DeltaEtaMin[
i] = parameter(
"MinDeltaEta",
i).value();
73 p_DeltaEtaMax[
i] = parameter(
"MaxDeltaEta",
i).value();
75 p_MinET1[
i] = parameter(
"MinET1",
i).value();
76 p_MinET2[
i] = parameter(
"MinET2",
i).value();
81 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
90 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
91 std::string hname_accept =
"hDeltaEtaIncl2_accept_bit"+
std::to_string((
int)
i);
92 std::string hname_reject =
"hDeltaEtaIncl2_reject_bit"+
std::to_string((
int)
i);
94 bookHist(m_histAccept, hname_accept,
"DETA", 100, p_DeltaEtaMin[
i], p_DeltaEtaMax[
i]);
95 bookHist(m_histReject, hname_reject,
"DETA", 100, p_DeltaEtaMin[
i], p_DeltaEtaMax[
i]);
104 const std::vector<TCS::TOBArray *> & output,
108 if( input.size() == 2) {
110 tob1 != input[0]->end() &&
distance(input[0]->
begin(), tob1) < p_NumberLeading1;
114 tob2 != input[1]->end() &&
distance(input[1]->
begin(), tob2) < p_NumberLeading2;
117 unsigned int deltaEta = calcDeltaEtaBW( *tob1, *tob2 );
118 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
120 if(
parType_t((*tob1)->Et()) <= p_MinET1[
i])
continue;
121 if(
parType_t((*tob2)->Et()) <= p_MinET2[
i])
continue;
123 const bool fillAccept = fillHistos() and (fillHistosBasedOnHardware() ? getDecisionHardwareBit(
i) :
accept);
124 const bool fillReject = fillHistos() and not fillAccept;
125 const bool alreadyFilled = decision.
bit(
i);
130 if(fillAccept and not alreadyFilled) {
131 fillHist1D(m_histAccept[
i],(
float)
deltaEta);
132 }
else if(fillReject) {
133 fillHist1D(m_histReject[
i],(
float)
deltaEta);
136 << (
accept?
"pass":
"fail"));
140 for (
unsigned int i=0;
i < numberOutputBits(); ++
i) {
143 output[
i]->setAmbiguityFlag(hasAmbiguousInputs);
146 TCS_EXCEPTION(
"DeltaEtaIncl2 alg must have 2 inputs, but got " << input.size());
153 const std::vector<TCS::TOBArray *> & output,
156 if( input.size() == 2) {
158 tob1 != input[0]->end() &&
distance(input[0]->
begin(), tob1) < p_NumberLeading1;
162 tob2 != input[1]->end() &&
distance(input[1]->
begin(), tob2) < p_NumberLeading2;
165 unsigned int deltaEta = calcDeltaEta( *tob1, *tob2 );
166 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
168 if(
parType_t((*tob1)->Et()) <= p_MinET1[
i])
continue;
169 if(
parType_t((*tob2)->Et()) <= p_MinET2[
i])
continue;
171 const bool fillAccept = fillHistos() and (fillHistosBasedOnHardware() ? getDecisionHardwareBit(
i) :
accept);
172 const bool fillReject = fillHistos() and not fillAccept;
173 const bool alreadyFilled = decision.
bit(
i);
178 if(fillAccept and not alreadyFilled) {
179 fillHist1D(m_histAccept[
i],(
float)
deltaEta);
180 }
else if(fillReject) {
181 fillHist1D(m_histReject[
i],(
float)
deltaEta);
184 << (
accept?
"pass":
"fail"));
189 TCS_EXCEPTION(
"DeltaEtaIncl2 alg must have 2 inputs, but got " << input.size());