10#include <generators/modules/GeneratorPreselectionLeptonicModule.h>
11#include <framework/gearbox/Unit.h>
22 setDescription(
"Filtering based on generator truth information. Returns 0 if cuts have not been passed, 1 only if all cuts are passed.");
30 addParam(
"projectionMin",
m_projectionMin,
"minimum value for projection of tau lepton onto signal lepton momentum (in CMS)",
32 addParam(
"projectionMax",
m_projectionMax,
"maximum value for projection of tau lepton onto signal lepton momentum (in CMS)", 10.0);
34 "minimum value for the cosine of the angle between the tau and signal lepton momentum vectors (in CMS)", -1.0);
36 "maximum value for the cosine of the angle between the tau and signal lepton momentum vectors (in CMS)", 1.0);
37 addParam(
"zDiffMin",
m_zDiffMin,
"minimum value for difference between production vertex z-component for signal and tau leptons",
39 addParam(
"zDiffMax",
m_zDiffMax,
"maximum value for difference between production vertex z-component for signal and tau leptons",
41 addParam(
"UMin",
m_UMin,
"minimum value of U = E - p (calculated using vector sum of momenta and energy for neutrinos in CMS)",
43 addParam(
"UMax",
m_UMax,
"maximum value of U = E - p (calculated using vector sum of momenta and energy for neutrinos in CMS)",
80 double angle = dotProduct / (signalLeptonPCMS * tauLeptonPCMS);
81 double projection = dotProduct / signalLeptonPCMS;
100 int pdg = mc.getPDG();
101 const auto vec =
m_initial->getLabToCMS() * mc.get4Vector();
107 ROOT::Math::XYZVector temp(vec.Px(), vec.Py(), vec.Pz());
114 ROOT::Math::XYZVector temp(vec.Px(), vec.Py(), vec.Pz());
119 if (abs(pdg) == 12 || abs(pdg) == 14 || abs(pdg) == 16) {
static const ChargedStable muon
muon particle
static const ChargedStable electron
electron particle
double m_projectionMin
Minimum value for projection of tau lepton onto signal lepton momentum (in CMS)
double m_signalLeptonPMax
Maximum momentum (CMS) for signal lepton.
double m_signalLeptonPDG
PDG code of the signal lepton.
int m_nSignalLepton
Number of good signal leptons.
double m_zDiffMax
Maximum value for difference between production vertex z-component for signal and tau leptons.
double m_tauLeptonPMin
Minimum momentum (CMS) for tau lepton.
void initialize() override
Initialise the parameters.
void event() override
Event processor.
std::vector< ROOT::Math::XYZVector > m_tauLeptonPVecs
Vector of momentum vectors for tau leptons.
double m_signalLeptonZ
Storing the production vertex z-component for signal lepton.
StoreArray< MCParticle > m_mcparticles
Store array for the MCParticles.
double m_missingPz
Sum of pz components for neutrinos in event.
double m_UMin
Minimum value of U = E - p (calculated using vector sum of momenta and energy for neutrinos in CMS)
double m_UMax
Maximum value of U = E - p (calculated using vector sum of momenta and energy for neutrinos in CMS)
double m_angleMax
Maximum value for the cosine of the angle between the tau and signal lepton momentum vectors (in CMS)
std::vector< double > m_tauLeptonZs
Vector of production vertex z-components for tau leptons.
double m_missingE
Sum of energy for neutrinos in event.
int m_nTauLepton
Number of good tau leptons counted.
void checkParticle(const MCParticle &mc)
Called for each particle, performs basic cut checks.
double m_missingPx
Sum of px components for neutrinos in event.
StoreObjPtr< MCInitialParticles > m_initial
Pointer to the actual beam parameters.
std::string m_particleList
The name of the MCParticle collection.
double m_tauLeptonPMax
Maximum momentum (CMS) for tau lepton.
double m_missingPy
Sum of py components for neutrinos in event.
GeneratorPreselectionLeptonicModule()
Constructor: Sets the description, the properties and the parameters of the module.
double m_projectionMax
Maximum value for projection of tau lepton onto signal lepton momentum (in CMS)
double m_angleMin
Minimum value for the cosine of the angle between the tau and signal lepton momentum vectors (in CMS)
double m_zDiffMin
Minimum value for difference between production vertex z-component for signal and tau leptons.
ROOT::Math::XYZVector m_signalLeptonPVec
Vector storing momentum components of signal lepton.
double m_signalLeptonPMin
Minimum momentum (CMS) for signal lepton.
A Class to store the Monte Carlo particle information.
@ c_Initial
bit 5: Particle is initial such as e+ or e- and not going to Geant4
@ c_PrimaryParticle
bit 0: Particle is primary particle.
@ c_IsVirtual
bit 4: Particle is virtual and not going to Geant4.
void setDescription(const std::string &description)
Sets the description of the module.
void setPropertyFlags(unsigned int propertyFlags)
Sets the flags for the module properties.
void setReturnValue(int value)
Sets the return value for this module as integer.
@ c_ParallelProcessingCertified
This module can be run in parallel processing mode safely (All I/O must be done through the data stor...
bool isRequired(const std::string &name="")
Ensure this array/object has been registered previously.
int getEntries() const
Get the number of objects in the array.
void addParam(const std::string &name, T ¶mVariable, const std::string &description, const T &defaultValue)
Adds a new parameter to the module.
#define REG_MODULE(moduleName)
Register the given module (without 'Module' suffix) with the framework.
double sqrt(double a)
sqrt for double
Abstract base class for different kinds of events.