ATLAS Offline Software
Loading...
Searching...
No Matches
TLorentzVectorFactoryEtaE.h
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2019 CERN for the benefit of the ATLAS collaboration
3*/
4
5#ifndef TRIGHLTJETHYPOUNITTESTS_LORENTZVECTORFACTORYETAE_H
6#define TRIGHLTJETHYPOUNITTESTS_LORENTZVECTORFACTORYETAE_H
7
9#include <TLorentzVector.h>
10#include <cmath>
11#include <stdexcept>
12
14 public:
15 virtual TLorentzVector make(double eta, double e) const override{
16 if(e <= 0.) {throw std::out_of_range("E < 0");}
17
18 double ttOn2 = std::exp(-eta); //tan(theta/2)
19 double tt = 2.*ttOn2/(1.- ttOn2*ttOn2); // tan(theta)
20 double cost = sqrt(1./(1+tt*tt)); // 1+ tan^2(theta) = 1/cos^2(theta)
21 double sint = tt*cost;
22 TLorentzVector tl;
23 tl.SetXYZM(0., e*sint, e*cost, 0.);
24
25 return tl;
26 }
27};
28#endif
Scalar eta() const
pseudorapidity method
virtual TLorentzVector make(double eta, double e) const override
int cost(std::vector< std::string > &files, node &n, const std::string &directory="", bool deleteref=false, bool relocate=false)
Definition hcg.cxx:922