36 defineParameter(
"InputWidth", 3);
37 defineParameter(
"MaxTob", 0);
38 defineParameter(
"NumResultBits", 6);
39 defineParameter(
"RequireOneBarrel", 0);
40 defineParameter(
"MinMSqr", 0, 0);
41 defineParameter(
"MaxMSqr", 999, 0);
42 defineParameter(
"MinMSqr", 0, 1);
43 defineParameter(
"MaxMSqr", 999, 1);
44 defineParameter(
"MinMSqr", 0, 2);
45 defineParameter(
"MaxMSqr", 999, 2);
46 defineParameter(
"MinMSqr", 0, 3);
47 defineParameter(
"MaxMSqr", 999, 3);
48 defineParameter(
"MinMSqr", 0, 4);
49 defineParameter(
"MaxMSqr", 999, 4);
50 defineParameter(
"MinMSqr", 0, 5);
51 defineParameter(
"MaxMSqr", 999, 5);
52 defineParameter(
"MinET1",0,0);
53 defineParameter(
"MinET1",0,1);
54 defineParameter(
"MinET1",0,2);
55 defineParameter(
"MinET1",0,3);
56 defineParameter(
"MinET1",0,4);
57 defineParameter(
"MinET1",0,5);
59 setNumberOutputBits(6);
67 if(parameter(
"MaxTob").
value() > 0) {
68 p_NumberLeading1 = parameter(
"MaxTob").value();
70 p_NumberLeading1 = parameter(
"InputWidth").value();
73 p_OneBarrel = parameter(
"RequireOneBarrel").value();
75 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
76 p_InvMassMin[
i] = parameter(
"MinMSqr",
i).value();
77 p_InvMassMax[
i] = parameter(
"MaxMSqr",
i).value();
79 p_MinET1[
i] = parameter(
"MinET1",
i).value();
83 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
92 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
93 std::string hname_accept =
"hInvariantMassThreeTOBsIncl1_accept_bit"+
std::to_string((
int)
i);
94 std::string hname_reject =
"hInvariantMassThreeTOBsIncl1_reject_bit"+
std::to_string((
int)
i);
96 bookHist(m_histAccept, hname_accept,
"INVM", 100, sqrt(p_InvMassMin[
i]), sqrt(p_InvMassMax[
i]));
97 bookHist(m_histReject, hname_reject,
"INVM", 100, sqrt(p_InvMassMin[
i]), sqrt(p_InvMassMax[
i]));
109 const std::vector<TCS::TOBArray *> &
output,
113 if(
input.size() == 1) {
131 if (p_OneBarrel &&
parType_t(abs((*tob1)->eta())) > 10 &&
parType_t(abs((*tob2)->eta())) > 10 &&
parType_t(abs((*tob3)->eta())) > 10 )
continue;
134 unsigned int invmass2_12 = calcInvMassBW( *tob1, *tob2 );
135 unsigned int invmass2_13 = calcInvMassBW( *tob1, *tob3 );
136 unsigned int invmass2_23 = calcInvMassBW( *tob2, *tob3 );
137 unsigned int invmass2 = invmass2_12 + invmass2_13 + invmass2_23;
138 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
140 if(
parType_t((*tob1)->Et()) <= p_MinET1[
i])
continue;
141 if(
parType_t((*tob2)->Et()) <= p_MinET1[
i])
continue;
142 if(
parType_t((*tob3)->Et()) <= p_MinET1[
i])
continue;
144 accept = invmass2 >= p_InvMassMin[
i] && invmass2 <= p_InvMassMax[
i];
145 const bool fillAccept = fillHistos() and (fillHistosBasedOnHardware() ? getDecisionHardwareBit(
i) :
accept);
146 const bool fillReject = fillHistos() and not fillAccept;
147 const bool alreadyFilled = decision.
bit(
i);
149 std::vector<TCS::GenericTOB*> TOBvector;
150 TOBvector.push_back( *tob1 );
151 TOBvector.push_back( *tob2 );
152 TOBvector.push_back( *tob3 );
157 if(fillAccept and not alreadyFilled) {
158 fillHist1D(m_histAccept[
i],sqrt(invmass2));
159 }
else if(fillReject) {
160 fillHist1D(m_histReject[
i],sqrt(invmass2));
162 TRG_MSG_DEBUG(
"Decision " <<
i <<
": " << (
accept?
"pass":
"fail") <<
" invmass2 = " << invmass2);
170 TCS_EXCEPTION(
"InvariantMassThreeTOBsIncl1 alg must have 1 input list, but got " <<
input.size());
180 const std::vector<TCS::TOBArray *> &
output,
184 if(
input.size() == 1) {
202 if (p_OneBarrel &&
parType_t(abs((*tob1)->eta())) > 10 &&
parType_t(abs((*tob2)->eta())) > 10 &&
parType_t(abs((*tob3)->eta())) > 10 )
continue;
206 unsigned int invmass2_12 = calcInvMass( *tob1, *tob2 );
207 unsigned int invmass2_13 = calcInvMass( *tob1, *tob3 );
208 unsigned int invmass2_23 = calcInvMass( *tob2, *tob3 );
209 unsigned int invmass2 = invmass2_12 + invmass2_13 + invmass2_23;
210 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
212 if(
parType_t((*tob1)->Et()) <= p_MinET1[
i])
continue;
213 if(
parType_t((*tob2)->Et()) <= p_MinET1[
i])
continue;
214 if(
parType_t((*tob3)->Et()) <= p_MinET1[
i])
continue;
216 accept = invmass2 >= p_InvMassMin[
i] && invmass2 <= p_InvMassMax[
i];
217 const bool fillAccept = fillHistos() and (fillHistosBasedOnHardware() ? getDecisionHardwareBit(
i) :
accept);
218 const bool fillReject = fillHistos() and not fillAccept;
219 const bool alreadyFilled = decision.
bit(
i);
221 std::vector<TCS::GenericTOB*> TOBvector;
222 TOBvector.push_back( *tob1 );
223 TOBvector.push_back( *tob2 );
224 TOBvector.push_back( *tob3 );
229 if(fillAccept and not alreadyFilled) {
230 fillHist1D(m_histAccept[
i],sqrt(invmass2));
231 }
else if(fillReject) {
232 fillHist1D(m_histReject[
i],sqrt(invmass2));
234 TRG_MSG_DEBUG(
"Decision " <<
i <<
": " << (
accept?
"pass":
"fail") <<
" invmass2 = " << invmass2);
242 TCS_EXCEPTION(
"InvariantMassThreeTOBsIncl1 alg must have either 1 input list, but got " <<
input.size());