26 defineParameter(
"InputWidth1", 9);
27 defineParameter(
"InputWidth2", 9);
28 defineParameter(
"MaxTob1", 0);
29 defineParameter(
"MaxTob2", 0);
30 defineParameter(
"NumResultBits", 3);
31 defineParameter(
"MinET1",1,0);
32 defineParameter(
"MinET2",1,0);
33 defineParameter(
"DeltaRMin", 0, 0);
34 defineParameter(
"DeltaRMax", 0, 0);
35 defineParameter(
"MinET1",1,1);
36 defineParameter(
"MinET2",1,1);
37 defineParameter(
"DeltaRMin", 0, 1);
38 defineParameter(
"DeltaRMax", 0, 1);
39 defineParameter(
"MinET1",1,2);
40 defineParameter(
"MinET2",1,2);
41 defineParameter(
"DeltaRMin", 0, 2);
42 defineParameter(
"DeltaRMax", 0, 2);
43 setNumberOutputBits(3);
52 m_NumberLeading1 = parameter(
"InputWidth1").value();
53 m_NumberLeading2 = parameter(
"InputWidth2").value();
54 if(parameter(
"MaxTob1").
value() > 0) m_NumberLeading1 = parameter(
"MaxTob1").value();
55 if(parameter(
"MaxTob2").
value() > 0) m_NumberLeading2 = parameter(
"MaxTob2").value();
57 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
58 m_DeltaRMin[
i] = parameter(
"DeltaRMin",
i).value();
59 m_DeltaRMax[
i] = parameter(
"DeltaRMax",
i).value();
60 m_MinET1[
i] = parameter(
"MinET1",
i).value();
61 m_MinET2[
i] = parameter(
"MinET2",
i).value();
76 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
77 std::string hname_accept =
"hDeltaRSqrIncl2Charge_accept_bit"+
std::to_string(
static_cast<int>(
i));
78 std::string hname_reject =
"hDeltaRSqrIncl2Charge_reject_bit"+
std::to_string(
static_cast<int>(
i));
80 bookHist(m_histAccept, hname_accept,
"DR", 100, std::sqrt(m_DeltaRMin[
i]), std::sqrt(m_DeltaRMax[
i]));
81 bookHist(m_histReject, hname_reject,
"DR", 100, std::sqrt(m_DeltaRMin[
i]), std::sqrt(m_DeltaRMax[
i]));
83 bookHist(m_histAcceptEta1Eta2, hname_accept,
"ETA vs ETA", 100, -70, 70, 100, -70, 70);
84 bookHist(m_histRejectEta1Eta2, hname_reject,
"ETA vs ETA", 100, -70, 70, 100, -70, 70);
93 const std::vector<TCS::TOBArray *> &
output,
97 if(
input.size() == 2) {
107 unsigned int deltaR2 = calcDeltaR2BW( *tob1, *tob2 );
110 int charge1 = (*tob1)->charge();
111 int charge2 = (*tob2)->charge();
112 int totalCharge = charge1 + charge2;
113 bool acceptCharge =
true;
114 if ( std::abs(totalCharge) == 2 ) { acceptCharge =
false; }
115 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
117 if(
parType_t((*tob1)->Et()) <= m_MinET1[
i])
continue;
118 if(
parType_t((*tob2)->Et()) <= m_MinET2[
i])
continue;
120 const bool fillAccept = fillHistos() and (fillHistosBasedOnHardware() ? getDecisionHardwareBit(
i) :
accept);
121 const bool fillReject = fillHistos() and not fillAccept;
122 const bool alreadyFilled = decision.
bit(
i);
127 if(fillAccept and not alreadyFilled) {
128 fillHist1D(m_histAccept[
i],std::sqrt(
static_cast<float>(
deltaR2)));
129 fillHist2D(m_histAcceptEta1Eta2[
i],(*tob1)->eta(),(*tob2)->eta());
130 }
else if(fillReject) {
131 fillHist1D(m_histReject[
i],std::sqrt(
static_cast<float>(
deltaR2)));
132 fillHist2D(m_histRejectEta1Eta2[
i],(*tob1)->eta(),(*tob2)->eta());
139 TCS_EXCEPTION(
"DeltaRSqrIncl2Charge alg must have 2 inputs, but got " <<
input.size());
146 const std::vector<TCS::TOBArray *> &
output,
150 if(
input.size() == 2) {
162 unsigned int deltaR2 = calcDeltaR2( *tob1, *tob2 );
165 int charge1 = (*tob1)->charge();
166 int charge2 = (*tob2)->charge();
167 int totalCharge = charge1 + charge2;
168 bool acceptCharge =
true;
169 if ( std::abs(totalCharge) == 2 ) { acceptCharge =
false; }
170 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
172 if(
parType_t((*tob1)->Et()) <= m_MinET1[
i])
continue;
173 if(
parType_t((*tob2)->Et()) <= m_MinET2[
i])
continue;
175 const bool fillAccept = fillHistos() and (fillHistosBasedOnHardware() ? getDecisionHardwareBit(
i) :
accept);
176 const bool fillReject = fillHistos() and not fillAccept;
177 const bool alreadyFilled = decision.
bit(
i);
182 if(fillAccept and not alreadyFilled) {
183 fillHist1D(m_histAccept[
i],std::sqrt(
static_cast<float>(
deltaR2)));
184 fillHist2D(m_histAcceptEta1Eta2[
i],(*tob1)->eta(),(*tob2)->eta());
185 }
else if(fillReject) {
186 fillHist1D(m_histReject[
i],std::sqrt(
static_cast<float>(
deltaR2)));
187 fillHist2D(m_histRejectEta1Eta2[
i],(*tob1)->eta(),(*tob2)->eta());
194 TCS_EXCEPTION(
"DeltaRSqrIncl2Charge alg must have 2 inputs, but got " <<
input.size());