1 #include "QCDSmearSequence.h"
2 #include "mother_probability.hh"
6 QCDSmearSequence::QCDSmearSequence(
const AlphaStrong& alphaS)
11 QCDSmearSequence::QCDSmearSequence(
const AlphaStrong& alphaS,
12 const std::vector<QCDSmearSequenceCallback*> cb)
13 : alphaS_(alphaS), callbacks_(cb)
15 const unsigned nCallbacks = callbacks_.size();
16 for (
unsigned icall=0; icall<nCallbacks; ++icall)
17 assert(callbacks_[icall]);
25 const unsigned sz = m_event.size();
27 for (
unsigned i=0; i != sz; i++ )
28 smearedEvent[i] = m_event[i];
35 for (
unsigned i=0; i<sz; ++i)
36 ptValues_.push_back(smearedEvent[i].pt());
40 const unsigned szm1 = sz - 1U;
41 for (
unsigned i=0; i<szm1; ++i)
43 const PseudoJet& pi = smearedEvent[i];
44 for (
unsigned j=i+1; j<sz; ++j)
46 const double prob = mother_probability(pi, smearedEvent[j], alphaS_);
47 probs_.push_back(ProbTriple(prob, i, j));
50 std::sort(probs_.begin(), probs_.end(), std::greater<ProbTriple>());
55 for (
unsigned i=0; i<sz; ++i)
58 const unsigned nCallbacks = callbacks_.size();
59 const unsigned long nprobs = probs_.size();
60 for (
unsigned long iprob=0; iprob<nprobs; ++iprob)
62 const ProbTriple& t(probs_[iprob]);
65 if (ptValues_[t.second] < ptValues_[t.third])
78 bool continueIterating =
true;
79 for (
unsigned icall=0; icall<nCallbacks && continueIterating; ++icall)
81 continueIterating = (*callbacks_[icall])(
82 t.first, m_callBackCount, hard,
83 soft, smearedEvent[hard], smearedEvent[soft]);
84 if (continueIterating)
88 if (!continueIterating)
virtual void smear(Event &event)
smear the event, return the smeared event via the function argument.