ATLAS Offline Software
Loading...
Searching...
No Matches
TruthTrackSmearer.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
3*/
4
5#include "TruthTrackSmearer.h"
6#include "CLHEP/Random/RandFlat.h"
7#include "CLHEP/Random/RandGauss.h"
8
9namespace L0Muon {
10
12: m_rngWrapper(rngWrapper) {
13 m_efficiencyMap[0] = 0.0; // pT < 3 GeV
14 m_efficiencyMap[1] = 0.95; // pT > 3 GeV
15}
16
17double TruthTrackSmearer::effFunc(double pt) const {
18 // TODO: Efficiency is changed at only 3 GeV...
19 return (pt < 3000.) ? m_efficiencyMap[0] : m_efficiencyMap[1];
20}
21
22bool TruthTrackSmearer::emulateL0MuonTrack(double curv, float eta, float phi, L0MuonTrack& otrack) const {
23 // input curv(q/pT) is in MeV
24 CLHEP::HepRandomEngine* engine = m_rngWrapper->getEngine(Gaudi::Hive::currentContext());
25
26 // efficiency emulation
27 double abspt = std::abs(1.0 / curv);
28 if (CLHEP::RandFlat::shoot(engine) > effFunc(abspt)) return false;
29
30 // TODO: extrapolate to the pivot plane
31
32 // position efficiency map
33 if (std::abs(eta) > 2.41) return false; // for the time being...
34
35 // TODO: The position is NOT smeared here - since the binning of RoIs could be larger. To be checked.
36
37 // pt smearing
38 double sigma = curv * 0.05; // TODO: 5% uniform for the time being...
39
40 double gencurv = CLHEP::RandGauss::shoot(engine, curv, sigma);
41
42 otrack.setTrack(gencurv, eta, phi);
43
44 return true;
45}
46
47} // end of namespace
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
A wrapper class for event-slot-local random engines.
Definition RNGWrapper.h:56
void setTrack(const double invpt, const float eta, const float phi)
Definition L0MuonTrack.h:28
std::array< float, 2 > m_efficiencyMap
ATHRNG::RNGWrapper * m_rngWrapper
bool emulateL0MuonTrack(double curv, float eta, float phi, L0MuonTrack &otrack) const
TruthTrackSmearer(ATHRNG::RNGWrapper *rndWrapper)
double effFunc(double pt) const