24 #define LOG std::cout << "TCS::DeltaRSqrIncl2: "
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();
59 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
60 p_DeltaRMin[
i] = parameter(
"DeltaRMin",
i).value();
61 p_DeltaRMax[
i] = parameter(
"DeltaRMax",
i).value();
62 p_MinET1[
i] = parameter(
"MinET1",
i).value();
63 p_MinET2[
i] = parameter(
"MinET2",
i).value();
78 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
79 std::string hname_accept =
"hDeltaRSqrIncl2_accept_bit"+
std::to_string((
int)
i);
80 std::string hname_reject =
"hDeltaRSqrIncl2_reject_bit"+
std::to_string((
int)
i);
82 bookHist(m_histAccept, hname_accept,
"DR", 100, sqrt(p_DeltaRMin[
i]), sqrt(p_DeltaRMax[
i]));
83 bookHist(m_histReject, hname_reject,
"DR", 100, sqrt(p_DeltaRMin[
i]), sqrt(p_DeltaRMax[
i]));
92 const std::vector<TCS::TOBArray *> & output,
96 if( input.size() == 2) {
99 tob1 != input[0]->end() &&
distance(input[0]->
begin(), tob1) < p_NumberLeading1;
103 tob2 != input[1]->end() &&
distance(input[1]->
begin(), tob2) < p_NumberLeading2;
106 unsigned int deltaR2 = calcDeltaR2BW( *tob1, *tob2 );
108 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
110 if(
parType_t((*tob1)->Et()) <= p_MinET1[
i])
continue;
111 if(
parType_t((*tob2)->Et()) <= p_MinET2[
i])
continue;
113 const bool fillAccept = fillHistos() and (fillHistosBasedOnHardware() ? getDecisionHardwareBit(
i) :
accept);
114 const bool fillReject = fillHistos() and not fillAccept;
115 const bool alreadyFilled = decision.
bit(
i);
120 if(fillAccept and not alreadyFilled) {
121 fillHist1D(m_histAccept[
i],sqrt((
float)
deltaR2));
122 }
else if(fillReject) {
123 fillHist1D(m_histReject[
i],sqrt((
float)
deltaR2));
129 for (
unsigned int i=0;
i < numberOutputBits(); ++
i) {
132 output[
i]->setAmbiguityFlag(hasAmbiguousInputs);
135 TCS_EXCEPTION(
"DeltaRSqrIncl2 alg must have 2 inputs, but got " << input.size());
142 const std::vector<TCS::TOBArray *> & output,
146 if( input.size() == 2) {
149 tob1 != input[0]->end() &&
distance(input[0]->
begin(), tob1) < p_NumberLeading1;
155 tob2 != input[1]->end() &&
distance(input[1]->
begin(), tob2) < p_NumberLeading2;
158 unsigned int deltaR2 = calcDeltaR2( *tob1, *tob2 );
161 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
163 if(
parType_t((*tob1)->Et()) <= p_MinET1[
i])
continue;
164 if(
parType_t((*tob2)->Et()) <= p_MinET2[
i])
continue;
166 const bool fillAccept = fillHistos() and (fillHistosBasedOnHardware() ? getDecisionHardwareBit(
i) :
accept);
167 const bool fillReject = fillHistos() and not fillAccept;
168 const bool alreadyFilled = decision.
bit(
i);
173 if(fillAccept and not alreadyFilled) {
174 fillHist1D(m_histAccept[
i],sqrt((
float)
deltaR2));
175 }
else if(fillReject) {
176 fillHist1D(m_histReject[
i],sqrt((
float)
deltaR2));
183 TCS_EXCEPTION(
"DeltaRSqrIncl2 alg must have 2 inputs, but got " << input.size());