2 #ifndef RIVET_EventMixingFinalState_HH 3 #define RIVET_EventMixingFinalState_HH 5 #include "Rivet/Projection.hh" 6 #include "Rivet/Projections/ParticleFinder.hh" 29 typedef map<double, deque<Particles> > MixMap;
34 double oMin,
double oMax,
double deltao ) : nMix(nMixIn){
35 setName(
"EventMixingFinalState");
38 MSG_WARNING(
"EventMixingFinalState is a naive implementation, not currently " <<
39 "validated. Use with caution.");
42 for(
double o = oMin; o < oMax; o+=deltao )
43 mixEvents[o] = deque<Particles>();
51 vector<Particles> getMixingEvents()
const {
52 MixMap::const_iterator mixItr = mixEvents.lower_bound(mObs);
53 if(mixItr == mixEvents.end() || mixItr->second.size() < nMix + 1)
54 return vector<Particles>();
55 return vector<Particles>(mixItr->second.begin(), mixItr->second.end() - 1);
62 virtual void calculateMixingObs(
const Particles& parts){
68 const Particles parts = applyProjection<ParticleFinder>(e,
"FS").
particles();
70 calculateMixingObs(parts);
72 MixMap::iterator mixItr = mixEvents.lower_bound(mObs);
73 if(mixItr == mixEvents.end()){
75 MSG_DEBUG(
"Mixing observable out of bounds.");
78 const Particles mix = applyProjection<ParticleFinder>(e,
"MIX").
particles();
80 mixItr->second.push_back(mix);
81 if(mixItr->second.size() > nMix + 1)
82 mixItr->second.pop_front();
void setName(const std::string &name)
Used by derived classes to set their name.
Definition: Projection.hh:133
Definition: ALICE_2010_I880049.cc:13
std::vector< GenParticle const * > particles(const GenEvent *ge)
Definition: RivetHepMC.hh:36
Base class for projections which return subsets of an event's particles.
Definition: ParticleFinder.hh:11
void project(const Event &e)
Perform the projection on the Event.
Definition: EventMixingFinalState.hh:67
Cmp< Projection > mkNamedPCmp(const Projection &otherparent, const std::string &pname) const
Definition: Projection.cc:51
const PROJ & addProjection(const PROJ &proj, const std::string &name)
Register a contained projection (user-facing version)
Definition: ProjectionApplier.hh:170
Definition: EventMixingFinalState.hh:30
Base class for all Rivet projections.
Definition: Projection.hh:29
int compare(const Projection &p) const
Compare with other projections.
Definition: EventMixingFinalState.hh:86