20 const IInterface*
p) :
24 m_massHypothesis(0.0),
25 m_massHypothesis2(0.0)
36 ATH_MSG_ERROR(
"No SG name provided for the output of invariant mass tool!");
37 return StatusCode::FAILURE;
51 return StatusCode::SUCCESS;
57 return StatusCode::SUCCESS;
64 ATH_MSG_ERROR(
"Tool is attempting to write a StoreGate key " <<
m_sgName <<
" which already exists. Please use a different key");
65 return StatusCode::FAILURE;
67 std::unique_ptr<std::vector<float> >
masses(
new std::vector<float>());
72 return StatusCode::SUCCESS;
82 return StatusCode::FAILURE;
87 bool from2Collections(
false);
91 particles2=particleHdl2.cptr();
92 from2Collections =
true;
99 unsigned int nEntries2 = entries2.size();
102 if (!from2Collections) {
104 ATH_MSG_ERROR(
"Branch sizes incompatible - returning zero. Check your selection strings.");
106 return StatusCode::FAILURE;
109 if (from2Collections) {
111 ATH_MSG_ERROR(
"Branch sizes incompatible - returning zero. Check your selection strings.");
113 return StatusCode::FAILURE;
118 unsigned int outerIt, innerIt;
119 std::vector<std::vector<int> >
pairs;
121 if (!from2Collections) {
122 for (outerIt=0; outerIt<
nEntries; ++outerIt) {
123 for (innerIt=outerIt+1; innerIt<
nEntries; ++innerIt) {
124 std::vector<int> tmpPair;
125 tmpPair.push_back(outerIt); tmpPair.push_back(innerIt);
126 pairs.push_back(tmpPair);
130 std::vector<std::vector<int> >
::iterator pairIt;
131 for (pairIt=
pairs.begin(); pairIt!=
pairs.end(); ++pairIt) {
132 unsigned int first = (*pairIt)[0];
133 unsigned int second = (*pairIt)[1];
146 if (from2Collections) {
147 for (outerIt=0; outerIt<
nEntries; ++outerIt) {
148 if (
entries[outerIt]==0)
continue;
149 for (innerIt=0; innerIt<nEntries2; ++innerIt) {
150 if (entries2[innerIt]==0)
continue;
151 std::vector<int> tmpPair;
152 tmpPair.push_back(outerIt); tmpPair.push_back(innerIt);
153 pairs.push_back(tmpPair);
157 std::vector<std::vector<int> >
::iterator pairIt;
158 for (pairIt=
pairs.begin(); pairIt!=
pairs.end(); ++pairIt) {
159 unsigned int first = (*pairIt)[0];
160 unsigned int second = (*pairIt)[1];
162 ((*particles2)[
second])->p4().Vect(),
169 return StatusCode::SUCCESS;
173 TLorentzVector
p1(v1, M1 > 0 ? std::hypot(M1, v1.Mag()) : v1.Mag());
174 TLorentzVector
p2(
v2, M2 > 0 ? std::hypot(M2,
v2.Mag()) :
v2.Mag());