/*********************************************************************** ** ** ** /----------------------------------------------\ ** ** | Delphes, a framework for the fast simulation | ** ** | of a generic collider experiment | ** ** \----------------------------------------------/ ** ** ** ** ** ** This package uses: ** ** ------------------ ** ** FastJet algorithm: Phys. Lett. B641 (2006) [hep-ph/0512210] ** ** Hector: JINST 2:P09005 (2007) [physics.acc-ph:0707.1198v2] ** ** FROG: [hep-ex/0901.2718v1] ** ** ** ** ------------------------------------------------------------------ ** ** ** ** Main authors: ** ** ------------- ** ** ** ** Severine Ovyn Xavier Rouby ** ** severine.ovyn@uclouvain.be xavier.rouby@cern ** ** ** ** Center for Particle Physics and Phenomenology (CP3) ** ** Universite catholique de Louvain (UCL) ** ** Louvain-la-Neuve, Belgium ** ** ** ** Copyright (C) 2008-2009, ** ** All rights reserved. ** ** ** ***********************************************************************/ #include "BlockClasses.h" #include "BlockCompare.h" #include "TLorentzVector.h" #include TCompare *TRootGenParticle::fgCompare = 0; TCompare *GenParticle::fgCompare = 0; TCompare *TRootElectron::fgCompare = TComparePT::Instance(); TCompare *TRootMuon::fgCompare = TComparePT::Instance(); TCompare *TRootPhoton::fgCompare = TComparePT::Instance(); TCompare *TRootTauJet::fgCompare = TComparePT::Instance(); TCompare *TRootJet::fgCompare = TComparePT::Instance(); TCompare *TRootTracks::fgCompare = 0; TCompare *TRootETmis::fgCompare = 0; TCompare *TRootCalo::fgCompare = 0; TCompare *TRootZdcHits::fgCompare = 0; TCompare *TRootGenEvent:: fgCompare = 0; TCompare *TRootParticle::fgCompare=0; TCompare *TRootLHEFParticle::fgCompare = 0; TCompare *TRootRomanPotHits::fgCompare =0; TCompare *TRootTrigger::fgCompare =0; void TRootParticle::Set(const TLorentzVector& momentum) { E = momentum.E(); Px = momentum.Px(); Py = momentum.Py(); Pz = momentum.Pz(); PT = momentum.Pt(); Eta = momentum.Eta(); Phi = momentum.Phi(); } void TRootTauJet::Set(const TLorentzVector& momentum) { E = momentum.E(); Px = momentum.Px(); Py = momentum.Py(); Pz = momentum.Pz(); PT = momentum.Pt(); Eta = momentum.Eta(); Phi = momentum.Phi(); } void TRootParticle::Set(const float px, const float py, const float pz, const float e) { TLorentzVector toFill; toFill.SetPxPyPzE(px,py,pz,e); E = e; Px = px; Py = py; Pz = pz; PT = toFill.Pt(); Eta = toFill.Eta(); Phi = toFill.Phi(); } void TRootParticle::SetEtaPhiEET(const float eta, const float phi, const float e, const float et) { Eta = eta; Phi = phi; E = e; PT = et; //float theta = 2* atan(exp(-Eta); Px = PT*cos(Phi); Py = PT*sin(Phi); } TRootGenParticle::TRootGenParticle(GenParticle* part) : PID(part->PID),Status(part->Status),M1(part->M1),M2(part->M2),D1(part->D1),D2(part->D2), T(part->T),X(part->X),Y(part->Y),Z(part->Z),M(part->M){ E=part->E; Px=part->Px; Py=part->Py; Pz=part->Pz; Eta=part->Eta; Phi=part->Phi; PT=part->PT; _initialised=false; } void TRootGenParticle::setFractions() { switch(abs(PID)) { default: _Fem = 0; _Fhad=1; break; case(pE): case(pGAMMA): case(pPI0): _Fem = 1; _Fhad=0; break; case(pNU1): case(pNU2): case(pNU3): case(pMU): _Fem =0; _Fhad=0; break; case(pK0S): case(pLAMBDA): _Fem=0.3; _Fhad=0.7; break; } _initialised=true; } float Eta, Phi; // (eta,phi) at the beginning of the track float EtaOuter, PhiOuter; // (eta,phi) at the end of the track float PT, E, Px, Py, Pz; TRootTracks::TRootTracks() : TRootParticle(), EtaOuter(UNDEFINED), PhiOuter(UNDEFINED) {} /* Eta = UNDEFINED; Phi = UNDEFINED; PT = UNDEFINED; E = UNDEFINED; Px = UNDEFINED; Py = UNDEFINED; Pz = UNDEFINED; }*/ TRootTracks::TRootTracks(const float inEta, const float inPhi, const float outEta, const float outPhi, const float pt) : EtaOuter(outEta), PhiOuter(outPhi) { Eta = inEta; Phi = inPhi; PT = pt; TLorentzVector p; p.SetPtEtaPhiE(PT,Eta,Phi,PT*cosh(Eta)); Px = p.Px(); Py = p.Py(); Pz = p.Pz(); E=p.E(); } TRootTracks::TRootTracks(const TRootTracks& track) : EtaOuter(track.EtaOuter), PhiOuter(track.PhiOuter) { Eta = track.Eta; Phi = track.Phi; PT = track.PT; E = track.E; Px = track.Px; Py = track.Py; Pz = track.Pz; } TRootTracks& TRootTracks::operator=(const TRootTracks& track) { if(this == &track) return *this; Eta = track.Eta; Phi = track.Phi; EtaOuter = track.EtaOuter; PhiOuter = track.PhiOuter; PT = track.PT; E = track.E; Px = track.Px; Py= track.Py; Pz =track.Pz; return *this; } void TRootTracks::Set(const float inEta, const float inPhi, const float outEta, const float outPhi, const float pt) { Eta= inEta; Phi=inPhi; EtaOuter=outEta; PhiOuter=outPhi; PT=pt; TLorentzVector p; p.SetPtEtaPhiE(PT,Eta,Phi,PT*cosh(Eta)); Px = p.Px(); Py = p.Py(); Pz = p.Pz(); E=p.E(); } const TLorentzVector TRootTracks::GetFourVector() const { TLorentzVector v; v.SetPtEtaPhiE(PT,Eta,Phi,PT*cosh(Eta)); return TLorentzVector(v); } TRootCalo::TRootCalo() : E_em(UNDEFINED), E_had(UNDEFINED), ET(UNDEFINED) {} //Eta(UNDEFINED), Phi(UNDEFINED), E_em(UNDEFINED), E_had(UNDEFINED), E(UNDEFINED), ET(UNDEFINED) {} TRootCalo::TRootCalo(const TRootCalo& cal) { E_em=cal.E_em; E_had=cal.E_had; ET=cal.ET; //Eta =cal.Eta; Phi=cal.Phi; E_em=cal.E_em; E_had=cal.E_had; E=cal.E; ET=cal.ET; } TRootCalo& TRootCalo::operator=(const TRootCalo& cal) { if(this==&cal) return *this; Eta =cal.Eta; Phi=cal.Phi; E_em=cal.E_em; E_had=cal.E_had; E=cal.E; ET=cal.ET; return *this; } void TRootCalo::set(const D_CaloTower& cal) { Eta =cal.getEta(); Phi=cal.getPhi(); E_em=cal.getEem(); E_had=cal.getEhad(); E =cal.getE(); ET =cal.getET(); }