/*********************************************************************** ** ** ** /----------------------------------------------\ ** ** | 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 // abs(int) TCompare *TRootGenParticle::fgCompare = 0; TCompare *TRootGenFwdParticle::fgCompare = 0; TCompare *TRootC::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 *TRootForwardTaggerHits::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 TRootGenFwdParticle::Set(const TLorentzVector& momentum) { genE = momentum.E(); genPx = momentum.Px(); genPy = momentum.Py(); genPz = momentum.Pz(); genPT = momentum.Pt(); genEta = momentum.Eta(); genPhi = 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 TRootGenFwdParticle::Set(const float px, const float py, const float pz, const float e) { TLorentzVector toFill; toFill.SetPxPyPzE(px,py,pz,e); genE = e; genPx = px; genPy = py; genPz = pz; genPT = toFill.Pt(); genEta = toFill.Eta(); genPhi = 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); } void TRootGenFwdParticle::SetEtaPhiEET(const float eta, const float phi, const float e, const float et) { genEta = eta; genPhi = phi; genE = e; genPT = et; genPx = genPT*cos(genPhi); genPy = genPT*sin(genPhi); } TRootGenFwdParticle::TRootGenFwdParticle(const TRootGenFwdParticle& p): TSortableObject(), genE(p.genE), genPx(p.genPx), genPy(p.genPy), genPz(p.genPz), genPT(p.genPT), genEta(p.genEta), genPhi(p.genPhi) {} TRootGenFwdParticle& TRootGenFwdParticle::operator=(const TRootGenFwdParticle& p){ if(this == &p) return *this; genE=p.genE; genPx=p.genPx; genPy=p.genPy; genPz=p.genPz; genPT=p.genPT; genEta=p.genEta; genPhi=p.genPhi; return *this; } namespace TRootC { GenParticle::GenParticle(const TRootGenParticle& p) : PID(p.PID), Status(p.Status), M1(p.M1), M2(p.M2), D1(p.D1), D2(p.D2), Charge(p.Charge), T(p.T), X(p.X), Y(p.Y), Z(p.Z), M(p.M) { } } TRootGenParticle::TRootGenParticle(TRootC::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() : Eta(UNDEFINED), Phi(UNDEFINED), EtaOuter(UNDEFINED), PhiOuter(UNDEFINED), PT(UNDEFINED), E(UNDEFINED), Px(UNDEFINED), Py(UNDEFINED), Pz(UNDEFINED), Charge(UNDEFINED) {} TRootTracks::TRootTracks(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(); Charge = UNDEFINED; } TRootTracks::TRootTracks(const TRootTracks& track) : TSortableObject(), 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), Charge(track.Charge) {} 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; Charge = track.Charge; return *this; } void TRootTracks::Set(const float inEta, const float inPhi, const float outEta, const float outPhi, const float pt, const float charge) { 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(); Charge = charge; } 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) : TSortableObject() { 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(); } TRootZdcHits::TRootZdcHits(const float e, const float t, const int side, const bool had) : E(e), T(t), side(side), hadronic_hit(had) {} TRootZdcHits::TRootZdcHits(const TRootZdcHits& zdc) : TRootGenFwdParticle(zdc), E(zdc.E), T(zdc.T), side(zdc.side), hadronic_hit(zdc.hadronic_hit) {} TRootZdcHits& TRootZdcHits::operator=(const TRootZdcHits& zdc) { if(this==&zdc) return *this; E = zdc.E; T = zdc.T; side = zdc.side; hadronic_hit = zdc.hadronic_hit; return *this; } void TRootGenParticle:: print(){ cout << "pid = " << PID << "\tM=" << M << "\tQ= " << Charge << "\tStatus = " << Status << "\t E= " << E << endl; // cout << "T = " << T << "\t X = " << X << "\t Y = " << Y << "\t Z = " << Z << endl; }