30 defineParameter(
"InputWidth", 3);
31 defineParameter(
"MaxTob", 0);
32 defineParameter(
"NumResultBits", 6);
33 defineParameter(
"RequireOneBarrel", 0);
34 defineParameter(
"MinMSqr", 0, 0);
35 defineParameter(
"MaxMSqr", 999, 0);
36 defineParameter(
"MinMSqr", 0, 1);
37 defineParameter(
"MaxMSqr", 999, 1);
38 defineParameter(
"MinMSqr", 0, 2);
39 defineParameter(
"MaxMSqr", 999, 2);
40 defineParameter(
"MinMSqr", 0, 3);
41 defineParameter(
"MaxMSqr", 999, 3);
42 defineParameter(
"MinMSqr", 0, 4);
43 defineParameter(
"MaxMSqr", 999, 4);
44 defineParameter(
"MinMSqr", 0, 5);
45 defineParameter(
"MaxMSqr", 999, 5);
46 defineParameter(
"MinET1",0,0);
47 defineParameter(
"MinET2",0,0);
48 defineParameter(
"MinET1",0,1);
49 defineParameter(
"MinET2",0,1);
50 defineParameter(
"MinET1",0,2);
51 defineParameter(
"MinET2",0,2);
52 defineParameter(
"MinET1",0,3);
53 defineParameter(
"MinET2",0,3);
54 defineParameter(
"MinET1",0,4);
55 defineParameter(
"MinET2",0,4);
56 defineParameter(
"MinET1",0,5);
57 defineParameter(
"MinET2",0,5);
58 defineParameter(
"DeltaRMin", 0, 0);
59 defineParameter(
"DeltaRMax", 0, 0);
60 defineParameter(
"DeltaRMin", 0, 1);
61 defineParameter(
"DeltaRMax", 0, 1);
62 defineParameter(
"DeltaRMin", 0, 2);
63 defineParameter(
"DeltaRMax", 0, 2);
64 defineParameter(
"DeltaRMin", 0, 3);
65 defineParameter(
"DeltaRMax", 0, 3);
66 defineParameter(
"DeltaRMin", 0, 4);
67 defineParameter(
"DeltaRMax", 0, 4);
68 defineParameter(
"DeltaRMin", 0, 5);
69 defineParameter(
"DeltaRMax", 0, 5);
72 setNumberOutputBits(6);
80 if(parameter(
"MaxTob").
value() > 0) {
81 p_NumberLeading1 = parameter(
"MaxTob").value();
82 p_NumberLeading2 = parameter(
"MaxTob").value();
84 p_NumberLeading1 = parameter(
"InputWidth").value();
85 p_NumberLeading2 = parameter(
"InputWidth").value();
88 p_OneBarrel = parameter(
"RequireOneBarrel").value();
94 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
95 p_InvMassMin[
i] = parameter(
"MinMSqr",
i).value();
96 p_InvMassMax[
i] = parameter(
"MaxMSqr",
i).value();
97 p_DeltaRMin[
i] = parameter(
"DeltaRMin",
i).value();
98 p_DeltaRMax[
i] = parameter(
"DeltaRMax",
i).value();
99 p_MinET1[
i] = parameter(
"MinET1",
i).value();
100 p_MinET2[
i] = parameter(
"MinET2",
i).value();
113 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
114 std::string hname_accept =
"hInvariantMassInclusiveDeltaRSqrIncl1_accept_bit"+
std::to_string((
int)
i);
115 std::string hname_reject =
"hInvariantMassInclusiveDeltaRSqrIncl1_reject_bit"+
std::to_string((
int)
i);
117 bookHist(m_histAcceptM, hname_accept,
"INVM vs DR", 100, sqrt(p_InvMassMin[
i]), sqrt(p_InvMassMax[
i]), 100, sqrt(p_DeltaRMin[
i]), sqrt(p_DeltaRMax[
i]));
118 bookHist(m_histRejectM, hname_reject,
"INVM vs DR", 100, sqrt(p_InvMassMin[
i]), sqrt(p_InvMassMax[
i]), 100, sqrt(p_DeltaRMin[
i]), sqrt(p_DeltaRMax[
i]));
129 const std::vector<TCS::TOBArray *> &
output,
133 if(
input.size() == 1) {
148 if (p_OneBarrel &&
parType_t(abs((*tob1)->eta())) > 10 &&
parType_t(abs((*tob2)->eta())) > 10 )
continue;
151 unsigned int invmass2 = calcInvMassBW( *tob1, *tob2 );
153 unsigned int deltaR2 = calcDeltaR2BW( *tob1, *tob2 );
154 TRG_MSG_DEBUG(
"Jet1 = " << **tob1 <<
", Jet2 = " << **tob2 <<
", invmass2 = " << invmass2 <<
", deltaR2 = " <<
deltaR2);
155 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
160 accept = invmass2 >= p_InvMassMin[
i] && invmass2 <= p_InvMassMax[i] && deltaR2 >= p_DeltaRMin[
i] &&
deltaR2 <= p_DeltaRMax[
i];
161 const bool fillAccept = fillHistos() and (fillHistosBasedOnHardware() ? getDecisionHardwareBit(
i) :
accept);
162 const bool fillReject = fillHistos() and not fillAccept;
163 const bool alreadyFilled = decision.
bit(
i);
168 if(fillAccept and not alreadyFilled) {
169 fillHist2D(m_histAcceptM[
i],sqrt((
float)invmass2),sqrt((
float)
deltaR2));
170 }
else if(fillReject) {
171 fillHist2D(m_histRejectM[
i],sqrt((
float)invmass2),sqrt((
float)
deltaR2));
179 TCS_EXCEPTION(
"InvariantMassInclusiveDeltaRSqrIncl1 alg must have either 1 inputs, but got " <<
input.size());
189 const std::vector<TCS::TOBArray *> &
output,
193 if(
input.size() == 1) {
207 if (p_OneBarrel &&
parType_t(abs((*tob1)->eta())) > 10 &&
parType_t(abs((*tob2)->eta())) > 10 )
continue;
210 unsigned int invmass2 = calcInvMass( *tob1, *tob2 );
212 unsigned int deltaR2 = calcDeltaR2( *tob1, *tob2 );
213 TRG_MSG_DEBUG(
"Jet1 = " << **tob1 <<
", Jet2 = " << **tob2 <<
", invmass2 = " << invmass2 <<
", deltaR2 = " <<
deltaR2);
215 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
220 accept = invmass2 >= p_InvMassMin[
i] && invmass2 <= p_InvMassMax[i] && deltaR2 >= p_DeltaRMin[
i] &&
deltaR2 <= p_DeltaRMax[
i];
221 const bool fillAccept = fillHistos() and (fillHistosBasedOnHardware() ? getDecisionHardwareBit(
i) :
accept);
222 const bool fillReject = fillHistos() and not fillAccept;
223 const bool alreadyFilled = decision.
bit(
i);
228 if(fillAccept and not alreadyFilled) {
229 fillHist2D(m_histAcceptM[
i],sqrt((
float)invmass2),sqrt((
float)
deltaR2));
230 }
else if(fillReject) {
231 fillHist2D(m_histRejectM[
i],sqrt((
float)invmass2),sqrt((
float)
deltaR2));
239 TCS_EXCEPTION(
"InvariantMassInclusiveDeltaRSqrIncl1 alg must have either 1 inputs, but got " <<
input.size());