rivet is hosted by Hepforge, IPPP Durham
Projection.cc
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 #include "Rivet/Projection.hh"
00003 #include "Rivet/Tools/Logging.hh"
00004 #include "Rivet/BeamConstraint.hh"
00005 #include "Rivet/Event.hh"
00006 #include "Rivet/Cmp.hh"
00007 
00008 namespace Rivet {
00009 
00010 
00011   Projection::Projection()
00012     : _name("BaseProjection")
00013   {
00014     addPdgIdPair(PID::ANY, PID::ANY);
00015   }
00016 
00017 
00018   Projection:: ~Projection() {  }
00019 
00020 
00021   Projection& Projection::operator = (const Projection&) { return *this; }
00022 
00023 
00024   bool Projection::before(const Projection& p) const {
00025     const std::type_info& thisid = typeid(*this);
00026     const std::type_info& otherid = typeid(p);
00027     if (thisid == otherid) {
00028       return compare(p) < 0;
00029     } else {
00030       return thisid.before(otherid);
00031     }
00032   }
00033 
00034 
00035   const set<PdgIdPair> Projection::beamPairs() const {
00036     set<PdgIdPair> ret = _beamPairs;
00037     set<ConstProjectionPtr> projs = getProjections();
00038     for (set<ConstProjectionPtr>::const_iterator ip = projs.begin(); ip != projs.end(); ++ip) {
00039       ConstProjectionPtr p = *ip;
00040       getLog() << Log::TRACE << "Proj addr = " << p << endl;
00041       if (p) ret = intersection(ret, p->beamPairs());
00042     }
00043     return ret;
00044   }
00045 
00046 
00047   Cmp<Projection> Projection::mkNamedPCmp(const Projection& otherparent,
00048                                           const string& pname) const {
00049     return pcmp(*this, otherparent, pname);
00050   }
00051 
00052 
00053   Cmp<Projection> Projection::mkPCmp(const Projection& otherparent,
00054                                      const string& pname) const {
00055     return pcmp(*this, otherparent, pname);
00056   }
00057 
00058 
00059 }