/** * * Definition of classes to be stored in the root tree. * Function CompareXYZ sorts objects by the variable XYZ that MUST be * present in the data members of the root tree class of the branch. * * $Date: 2008-06-04 13:57:24 $ * $Revision: 1.1 $ * * * \author P. Demin - UCL, Louvain-la-Neuve * */ #include "classes/DelphesClasses.h" #include "classes/DelphesFactory.h" #include "classes/SortableObject.h" CompBase *GenParticle::fgCompare = 0; CompBase *Photon::fgCompare = CompPT::Instance(); CompBase *Electron::fgCompare = CompPT::Instance(); CompBase *Muon::fgCompare = CompPT::Instance(); CompBase *TauJet::fgCompare = CompPT::Instance(); CompBase *Jet::fgCompare = CompPT::Instance(); CompBase *Track::fgCompare = CompPT::Instance(); CompBase *Tower::fgCompare = CompE::Instance(); CompBase *Candidate::fgCompare = 0; //------------------------------------------------------------------------------ Candidate::Candidate() : PID(0), Status(0), M1(0), M2(0), D1(0), D2(0), Charge(0), Mass(0.0), BTag(0), Eem(0.0), Ehad(0.0), Momentum(0.0, 0.0, 0.0, 0.0), Position(0.0, 0.0, 0.0, 0.0), Mother(0), fFactory(0), fArray(0) { } //------------------------------------------------------------------------------ void Candidate::AddCandidate(Candidate *object) { if(!fArray) fArray = fFactory->NewArray(); fArray->Add(object); } //------------------------------------------------------------------------------ TObject *Candidate::Clone(const char *newname) const { Candidate *object = fFactory->NewCandidate(); Copy(*object); return object; } //------------------------------------------------------------------------------ void Candidate::Copy(TObject &obj) const { Candidate &object = static_cast(obj); object.PID = PID; object.Status = Status; object.M1 = M1; object.M2 = M2; object.D1 = D1; object.D2 = D2; object.Charge = Charge; object.Mass = Mass; object.BTag = BTag; object.Eem = Eem; object.Ehad = Ehad; object.Momentum = Momentum; object.Position = Position; object.fFactory = fFactory; object.fArray = 0; const Candidate *candidateOld; Candidate *candidateNew; if(fArray && fArray->GetEntriesFast() > 0) { TIter itArray(fArray); object.fArray = fFactory->NewArray(); while((candidateOld = static_cast(itArray.Next()))) { candidateNew = static_cast(candidateOld->Clone()); object.fArray->Add(candidateNew); } } } //------------------------------------------------------------------------------ void Candidate::Clear(Option_t* option) { SetUniqueID(0); PID = 0; Status = 0; M1 = 0; M2 = 0; D1 = 0; D2 = 0; Charge = 0; Mass = 0.0; BTag = 0; Eem = 0.0; Ehad = 0.0; Momentum.SetXYZT(0.0, 0.0, 0.0, 0.0); Position.SetXYZT(0.0, 0.0, 0.0, 0.0); Mother = 0; fArray = 0; }