ATLAS Offline Software
Loading...
Searching...
No Matches
TrigJpsi.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration
3*/
4
5/********************************************************************
6 NAME: TrigJpsi.cxx
7 PACKAGE: TrigBphysEvent
8********************************************************************/
13#include <math.h>
14
16{
17 m_jpsimuon[0] = nullptr;
18 m_jpsimuon[1] = nullptr;
19}
20
22{
23 setDaughters(jpsimuon1,jpsimuon2);
24}
25
28
30{
31 if (i==0 || i==1)
32 return m_jpsimuon[i];
33 else
34 return 0;
35}
36
37void TrigJpsi::setDaughters( const CombinedMuonFeature* jpsimuon1, const CombinedMuonFeature* jpsimuon2)
38{
39 m_jpsimuon[0]=jpsimuon1;
40 m_jpsimuon[1]=jpsimuon2;
41 CLHEP::HepLorentzVector hlv[2];
42
43 for ( int i=0 ; i<2 ; ++i )
44 {
45 double cot_teta=1/tan(2*atan(exp(-m_jpsimuon[i]->IDTrack()->param()->eta())));
46 double mass_muon = ParticleConstants::muonMassInMeV;
47 double absPt = fabs(m_jpsimuon[i]->pt());
48 const double px = cos(m_jpsimuon[i]->IDTrack()->param()->phi0())*absPt;
49 const double py = sin(m_jpsimuon[i]->IDTrack()->param()->phi0())*absPt;
50 const double pz = cot_teta*absPt;
51 const double en = sqrt((px*px+py*py+pz*pz)+ mass_muon*mass_muon);
52
53 hlv[i].set(px,py,pz,en);
54 }
55 m_hlvJ=hlv[0]+hlv[1];
56
57}
A number of constexpr particle constants to avoid hardcoding them directly in various places.
void setDaughters(const CombinedMuonFeature *jpsimuon1, const CombinedMuonFeature *jpsimuon2)
Definition TrigJpsi.cxx:37
const CombinedMuonFeature * m_jpsimuon[2]
Definition TrigJpsi.h:36
CLHEP::HepLorentzVector m_hlvJ
Definition TrigJpsi.h:35
const CombinedMuonFeature * getDaughter(const int i) const
Definition TrigJpsi.cxx:29
double eta() const
Definition TrigJpsi.h:27
constexpr double muonMassInMeV
the mass of the muon (in MeV)