27 #define LOG std::cout << "TCS::DeltaRSqrIncl1Charge: "
51 if(parameter(
"MaxTob").
value() > 0) {
52 p_NumberLeading1 = parameter(
"MaxTob").value();
53 p_NumberLeading2 = parameter(
"MaxTob").value();
55 p_NumberLeading1 = parameter(
"InputWidth").value();
56 p_NumberLeading2 = parameter(
"InputWidth").value();
58 p_OneBarrel = parameter(
"RequireOneBarrel").value();
60 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
61 p_DeltaRMin[
i] = parameter(
"DeltaRMin",
i).value();
62 p_DeltaRMax[
i] = parameter(
"DeltaRMax",
i).value();
64 p_MinET1 = parameter(
"MinET1").value();
65 p_MinET2 = parameter(
"MinET2").value();
71 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
81 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
82 std::string hname_accept =
"hDeltaRSqrIncl1Charge_accept_bit"+
std::to_string(
static_cast<int>(
i));
83 std::string hname_reject =
"hDeltaRSqrIncl1Charge_reject_bit"+
std::to_string(
static_cast<int>(
i));
85 bookHist(m_histAccept, hname_accept,
"DR", 100, std::sqrt(p_DeltaRMin[
i]), std::sqrt(p_DeltaRMax[
i]));
86 bookHist(m_histReject, hname_reject,
"DR", 100, std::sqrt(p_DeltaRMin[
i]), std::sqrt(p_DeltaRMax[
i]));
88 bookHist(m_histAcceptEta1Eta2, hname_accept,
"ETA vs ETA", 100, -70, 70, 100, -70, 70);
89 bookHist(m_histRejectEta1Eta2, hname_reject,
"ETA vs ETA", 100, -70, 70, 100, -70, 70);
99 const std::vector<TCS::TOBArray *> &
output,
103 if(
input.size() == 1) {
116 if (p_OneBarrel &&
parType_t(std::abs((*tob1)->eta())) > 10 &&
parType_t(std::abs((*tob2)->eta())) > 10 )
continue;
118 unsigned int deltaR2 = calcDeltaR2BW( *tob1, *tob2 );
120 int charge1 = (*tob1)->charge();
121 int charge2 = (*tob2)->charge();
122 int totalCharge = charge1 + charge2;
123 bool acceptCharge =
true;
124 if ( std::abs(totalCharge) == 2 ) { acceptCharge =
false; }
125 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
128 const bool fillAccept = fillHistos() and (fillHistosBasedOnHardware() ? getDecisionHardwareBit(
i) :
accept);
129 const bool fillReject = fillHistos() and not fillAccept;
130 const bool alreadyFilled = decision.
bit(
i);
135 if(fillAccept and not alreadyFilled) {
136 fillHist1D(m_histAccept[
i],std::sqrt(
static_cast<float>(
deltaR2)));
137 fillHist2D(m_histAcceptEta1Eta2[
i],(*tob1)->eta(),(*tob2)->eta());
138 }
else if(fillReject) {
139 fillHist1D(m_histReject[
i],std::sqrt(
static_cast<float>(
deltaR2)));
140 fillHist2D(m_histRejectEta1Eta2[
i],(*tob1)->eta(),(*tob2)->eta());
147 TCS_EXCEPTION(
"DeltaRSqrIncl1Charge alg must have either 1 input, but got " <<
input.size());
154 const std::vector<TCS::TOBArray *> &
output,
157 if(
input.size() == 1) {
170 if (p_OneBarrel &&
parType_t(std::abs((*tob1)->eta())) > 10 &&
parType_t(std::abs((*tob2)->eta())) > 10 )
continue;
172 unsigned int deltaR2 = calcDeltaR2( *tob1, *tob2 );
174 int charge1 = (*tob1)->charge();
175 int charge2 = (*tob2)->charge();
176 int totalCharge = charge1 + charge2;
177 bool acceptCharge =
true;
178 if ( std::abs(totalCharge) == 2 ) { acceptCharge =
false; }
179 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
182 const bool fillAccept = fillHistos() and (fillHistosBasedOnHardware() ? getDecisionHardwareBit(
i) :
accept);
183 const bool fillReject = fillHistos() and not fillAccept;
184 const bool alreadyFilled = decision.
bit(
i);
189 if(fillAccept and not alreadyFilled) {
190 fillHist1D(m_histAccept[
i],std::sqrt(
static_cast<float>(
deltaR2)));
191 fillHist2D(m_histAcceptEta1Eta2[
i],(*tob1)->eta(),(*tob2)->eta());
192 }
else if(fillReject) {
193 fillHist1D(m_histReject[
i],std::sqrt(
static_cast<float>(
deltaR2)));
194 fillHist2D(m_histRejectEta1Eta2[
i],(*tob1)->eta(),(*tob2)->eta());
201 TCS_EXCEPTION(
"DeltaRSqrIncl1Charge alg must have either 1 input, but got " <<
input.size());