28 #define LOG cout << "TCS::InvariantMassInclusive1: "
70 if(parameter(
"MaxTob").
value() > 0) {
71 p_NumberLeading1 = parameter(
"MaxTob").value();
72 p_NumberLeading2 = parameter(
"MaxTob").value();
74 p_NumberLeading1 = parameter(
"InputWidth").value();
75 p_NumberLeading2 = parameter(
"InputWidth").value();
78 p_OneBarrel = parameter(
"RequireOneBarrel").value();
80 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
81 p_InvMassMin[
i] = parameter(
"MinMSqr",
i).value();
82 p_InvMassMax[
i] = parameter(
"MaxMSqr",
i).value();
84 p_MinET1[
i] = parameter(
"MinET1",
i).value();
85 p_MinET2[
i] = parameter(
"MinET2",
i).value();
90 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
101 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
102 std::string hname_accept =
"hInvariantMassInclusive1_accept_bit"+
std::to_string((
int)
i);
103 std::string hname_reject =
"hInvariantMassInclusive1_reject_bit"+
std::to_string((
int)
i);
105 bookHist(m_histAccept, hname_accept,
"INVM", 100, sqrt(p_InvMassMin[
i]), sqrt(p_InvMassMax[
i]));
106 bookHist(m_histReject, hname_reject,
"INVM", 100, sqrt(p_InvMassMin[
i]), sqrt(p_InvMassMax[
i]));
116 const std::vector<TCS::TOBArray *> &
output,
120 if(
input.size() == 1) {
135 if (p_OneBarrel &&
parType_t(abs((*tob1)->eta())) > 10 &&
parType_t(abs((*tob2)->eta())) > 10 )
continue;
138 unsigned int invmass2 = calcInvMassBW( *tob1, *tob2 );
139 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
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);
152 if(fillAccept and not alreadyFilled) {
153 fillHist1D(m_histAccept[
i],sqrt((
float)invmass2));
154 }
else if(fillReject) {
155 fillHist1D(m_histReject[
i],sqrt((
float)invmass2));
157 TRG_MSG_DEBUG(
"Decision " <<
i <<
": " << (
accept?
"pass":
"fail") <<
" invmass2 = " << invmass2);
163 TCS_EXCEPTION(
"InvariantMassInclusive1 alg must have either 1 inputs, but got " <<
input.size());
173 const std::vector<TCS::TOBArray *> &
output,
177 if(
input.size() == 1) {
191 if (p_OneBarrel &&
parType_t(abs((*tob1)->eta())) > 10 &&
parType_t(abs((*tob2)->eta())) > 10 )
continue;
195 unsigned int invmass2 = calcInvMass( *tob1, *tob2 );
198 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
203 accept = invmass2 >= p_InvMassMin[
i] && invmass2 <= p_InvMassMax[
i];
204 const bool fillAccept = fillHistos() and (fillHistosBasedOnHardware() ? getDecisionHardwareBit(
i) :
accept);
205 const bool fillReject = fillHistos() and not fillAccept;
206 const bool alreadyFilled = decision.
bit(
i);
211 if(fillAccept and not alreadyFilled) {
212 fillHist1D(m_histAccept[
i],sqrt((
float)invmass2));
213 }
else if(fillReject) {
214 fillHist1D(m_histReject[
i],sqrt((
float)invmass2));
216 TRG_MSG_DEBUG(
"Decision " <<
i <<
": " << (
accept?
"pass":
"fail") <<
" invmass2 = " << invmass2);
222 TCS_EXCEPTION(
"InvariantMassInclusive1 alg must have either 1 inputs, but got " <<
input.size());