24 #define LOG std::cout << "TCS::DeltaRSqrIncl1: "
48 if(parameter(
"MaxTob").
value() > 0) {
49 p_NumberLeading1 = parameter(
"MaxTob").value();
50 p_NumberLeading2 = parameter(
"MaxTob").value();
52 p_NumberLeading1 = parameter(
"InputWidth").value();
53 p_NumberLeading2 = parameter(
"InputWidth").value();
55 p_OneBarrel = parameter(
"RequireOneBarrel").value();
57 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
58 p_DeltaRMin[
i] = parameter(
"DeltaRMin",
i).value();
59 p_DeltaRMax[
i] = parameter(
"DeltaRMax",
i).value();
61 p_MinET1 = parameter(
"MinET1").value();
62 p_MinET2 = parameter(
"MinET2").value();
68 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
78 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
79 std::string hname_accept =
"hDeltaRSqrIncl1_accept_bit"+
std::to_string((
int)
i);
80 std::string hname_reject =
"hDeltaRSqrIncl1_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]));
93 const std::vector<TCS::TOBArray *> & output,
96 if(input.size() == 1) {
98 tob1 != input[0]->end() &&
distance( input[0]->
begin(), tob1) < p_NumberLeading1;
104 tob2 != input[0]->end() &&
distance( input[0]->
begin(), tob2) < p_NumberLeading2;
109 if (p_OneBarrel &&
parType_t(abs((*tob1)->eta())) > 10 &&
parType_t(abs((*tob2)->eta())) > 10 )
continue;
111 unsigned int deltaR2 = calcDeltaR2BW( *tob1, *tob2 );
112 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
115 const bool fillAccept = fillHistos() and (fillHistosBasedOnHardware() ? getDecisionHardwareBit(
i) :
accept);
116 const bool fillReject = fillHistos() and not fillAccept;
117 const bool alreadyFilled = decision.
bit(
i);
122 if(fillAccept and not alreadyFilled) {
123 fillHist1D(m_histAccept[
i],sqrt((
float)
deltaR2));
124 }
else if(fillReject) {
125 fillHist1D(m_histReject[
i],sqrt((
float)
deltaR2));
133 for (
unsigned int i=0;
i < numberOutputBits(); ++
i) {
134 output[
i]->setAmbiguityFlag(hasAmbiguousInputs);
137 TCS_EXCEPTION(
"DeltaRSqrIncl1 alg must have either 1 input, but got " << input.size());
144 const std::vector<TCS::TOBArray *> & output,
147 if(input.size() == 1) {
149 tob1 != input[0]->end() &&
distance( input[0]->
begin(), tob1) < p_NumberLeading1;
155 tob2 != input[0]->end() &&
distance( input[0]->
begin(), tob2) < p_NumberLeading2;
160 if (p_OneBarrel &&
parType_t(abs((*tob1)->eta())) > 10 &&
parType_t(abs((*tob2)->eta())) > 10 )
continue;
162 unsigned int deltaR2 = calcDeltaR2( *tob1, *tob2 );
163 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
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(
"DeltaRSqrIncl1 alg must have either 1 input, but got " << input.size());