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 
00022   bool Projection::before(const Projection& p) const {
00023     const std::type_info& thisid = typeid(*this);
00024     const std::type_info& otherid = typeid(p);
00025     if (thisid == otherid) {
00026       return compare(p) < 0;
00027     } else {
00028       return thisid.before(otherid);
00029     }
00030   }
00031 
00032 
00033   const set<PdgIdPair> Projection::beamPairs() const {
00034     set<PdgIdPair> ret = _beamPairs;
00035     set<ConstProjectionPtr> projs = getProjections();
00036     for (set<ConstProjectionPtr>::const_iterator ip = projs.begin(); ip != projs.end(); ++ip) {
00037       ConstProjectionPtr p = *ip;
00038       getLog() << Log::TRACE << "Proj addr = " << p << endl;
00039       if (p) ret = intersection(ret, p->beamPairs());
00040     }
00041     return ret;
00042   }
00043 
00044 
00045   Cmp<Projection> Projection::mkNamedPCmp(const Projection& otherparent,
00046                                           const string& pname) const {
00047     return pcmp(*this, otherparent, pname);
00048   }
00049 
00050 
00051   Cmp<Projection> Projection::mkPCmp(const Projection& otherparent,
00052                                      const string& pname) const {
00053     return pcmp(*this, otherparent, pname);
00054   }
00055 
00056 
00057 }