Lazily builds collections of reconstructed muons. More...
#include <MuonBuilder.h>
Public Member Functions | |
MuonBuilder (Dataset &dataset, Options const &options, TabulatedRngEngine &rngEngine) | |
Constructor. | |
std::vector< Muon > const & | Get () const override |
Alias for GetTight. | |
std::vector< Muon > const & | GetLoose () const |
Returns collection of loose muons. | |
std::vector< Muon > const & | GetTight () const |
Returns collection of tight muons. | |
Private Member Functions | |
void | ApplyRochesterCorrection (int index, Muon *muon, int trackerLayers) const |
Applies Rochester correction to momentum of the muon. | |
void | Build () const override |
Constructs muons for the current event. | |
std::optional< GenParticle > | FindGenMatch (Muon const &muon, double maxDR) const |
Finds matching generator-level muon using (eta, phi) metric. | |
Private Attributes | |
double | minPtLoose_ |
Minimal pt for loose muons, GeV. | |
double | minPtTight_ |
Minimal pt for tight muons, GeV. | |
double | maxRelIsoLoose_ |
Maximal rel iso for loose muons. | |
double | maxRelIsoTight_ |
Maximal rel iso for tight muons. | |
std::vector< Muon > | looseMuons_ |
Collection of muons passing loose selection. | |
std::vector< Muon > | tightMuons_ |
Collection of muons passing tight selection. | |
bool | isSim_ |
Indicates whether running on simulation or data. | |
std::unique_ptr< RoccoR > | rochesterCorrection_ |
Object to compute Rochester correction to muon pt. | |
TabulatedRandomGenerator | tabulatedRng_ |
Random number generator. | |
TTreeReaderArray< float > | srcPt_ |
TTreeReaderArray< float > | srcEta_ |
TTreeReaderArray< float > | srcPhi_ |
TTreeReaderArray< float > | srcMass_ |
TTreeReaderArray< int > | srcCharge_ |
TTreeReaderArray< float > | srcIsolation_ |
TTreeReaderArray< bool > | srcIsPfMuon_ |
TTreeReaderArray< bool > | srcIsGlobalMuon_ |
TTreeReaderArray< bool > | srcIsTrackerMuon_ |
TTreeReaderArray< bool > | srcId_ |
TTreeReaderArray< int > | srcTrackerLayers_ |
std::unique_ptr < TTreeReaderArray< int > > | genPartId_ |
std::unique_ptr < TTreeReaderArray< float > > | genPartPt_ |
std::unique_ptr < TTreeReaderArray< float > > | genPartEta_ |
std::unique_ptr < TTreeReaderArray< float > > | genPartPhi_ |
Lazily builds collections of reconstructed muons.
For each event two collections of muons are constructed: tight and loose. They differ in the minimal pt cut as well as identification requirements. The tight collection is a subset of the loose one.
Rochester corrections for muon momenta are applied. The changes in momenta of loose muons are aggregated for GetSumMomentumShift.
MuonBuilder::MuonBuilder | ( | Dataset & | dataset, | |
Options const & | options, | |||
TabulatedRngEngine & | rngEngine | |||
) |
Constructor.
[in] | dataset | Dataset that will be processed. |
[in] | options | Configuration options for the job. |
[in] | rngEngine | Engine to construct TabulatedRandomGenerator. |
void MuonBuilder::ApplyRochesterCorrection | ( | int | index, | |
Muon * | muon, | |||
int | trackerLayers | |||
) | const [private] |
Applies Rochester correction to momentum of the muon.
[in] | index | Index of the muon to choose channel for tabulatedRng_. |
[in,out] | muon | Muon to be corrected. |
[in] | trackerLayers | Number of tracker layers with measurements for the given muon. |
The Rochester correction is applied in place.
std::optional<GenParticle> MuonBuilder::FindGenMatch | ( | Muon const & | muon, | |
double | maxDR | |||
) | const [private] |
Finds matching generator-level muon using (eta, phi) metric.
[in] | muon | Recontructed muon for which a generator-level match needs to be found. |
[in] | maxDR | Maximal allowed distance in the (eta, phi) metric. |