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) {
123 tob1 != input[0]->end() &&
distance( input[0]->
begin(), tob1) < p_NumberLeading1;
130 tob2 != input[0]->end() &&
distance( input[0]->
begin(), tob2) < p_NumberLeading2;
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);
161 for (
unsigned int i=0;
i < numberOutputBits(); ++
i) {
164 output[
i]->setAmbiguityFlag(hasAmbiguousInputs);
168 TCS_EXCEPTION(
"InvariantMassInclusive1 alg must have either 1 inputs, but got " << input.size());
178 const std::vector<TCS::TOBArray *> & output,
182 if(input.size() == 1) {
184 tob1 != input[0]->end() &&
distance( input[0]->
begin(), tob1) < p_NumberLeading1;
191 tob2 != input[0]->end() &&
distance( input[0]->
begin(), tob2) < p_NumberLeading2;
196 if (p_OneBarrel &&
parType_t(abs((*tob1)->eta())) > 10 &&
parType_t(abs((*tob2)->eta())) > 10 )
continue;
200 unsigned int invmass2 = calcInvMass( *tob1, *tob2 );
203 for(
unsigned int i=0;
i<numberOutputBits(); ++
i) {
208 accept = invmass2 >= p_InvMassMin[
i] && invmass2 <= p_InvMassMax[
i];
209 const bool fillAccept = fillHistos() and (fillHistosBasedOnHardware() ? getDecisionHardwareBit(
i) :
accept);
210 const bool fillReject = fillHistos() and not fillAccept;
211 const bool alreadyFilled = decision.
bit(
i);
216 if(fillAccept and not alreadyFilled) {
217 fillHist1D(m_histAccept[
i],sqrt((
float)invmass2));
218 }
else if(fillReject) {
219 fillHist1D(m_histReject[
i],sqrt((
float)invmass2));
221 TRG_MSG_DEBUG(
"Decision " <<
i <<
": " << (
accept?
"pass":
"fail") <<
" invmass2 = " << invmass2);
227 TCS_EXCEPTION(
"InvariantMassInclusive1 alg must have either 1 inputs, but got " << input.size());