![Logo](../../ATLAS-Logo-Square-Blue-RGB.png) |
ATLAS Offline Software
|
Go to the documentation of this file.
6 #include "GaudiKernel/PhysicalConstants.h"
8 #include "CLHEP/Random/RandomEngine.h"
42 if (m_MinLeadJetPt < 1999. && m_MaxLeadJetPt > 21. &&
m_doShape) {
51 return StatusCode::SUCCESS;
57 return StatusCode::SUCCESS;
65 const EventContext& ctx = Gaudi::Hive::currentContext();
68 ATH_MSG_WARNING(
"Failed to retrieve random number engine QCDTruthJetFilter");
69 setFilterPassed(
false);
70 return StatusCode::SUCCESS;
79 return StatusCode::SUCCESS;
86 if (!(*it_truth))
continue;
87 if (std::abs( (*it_truth)->eta() ) >
m_MaxEta)
continue;
89 if (pt_lead < (*it_truth)->pt()) pt_lead = (*it_truth)->pt();
94 if (Njet < m_Njet && m_Njet > 0) {
96 setFilterPassed(
false);
98 return StatusCode::SUCCESS;
104 setFilterPassed(
false);
106 return StatusCode::SUCCESS;
112 double rnd = rndm->flat();
114 setFilterPassed(
false);
115 ATH_MSG_DEBUG(
"Event failed weighting cut. Weight is " <<
w <<
" for pt_lead of " << pt_lead <<
" high end is " <<
m_high <<
" rnd is " << rnd);
116 return StatusCode::SUCCESS;
121 setFilterPassed(
true);
126 ATH_MSG_DEBUG(
"Event passed. Will mod event weights by " <<
w*
m_norm <<
" for pt_lead of " << pt_lead <<
" norm " <<
m_norm <<
" w " <<
w <<
" high " <<
m_high <<
" rnd " << rnd);
129 for (
unsigned int i=0;
i<mec->
size();++
i) {
130 if ( !(*mec)[
i] )
continue;
131 orig = (*mec)[
i]->weights().
size()>0?(*mec)[
i]->weights()[0]:1.;
132 if ((*mec)[
i]->weights().size()>0) (*mec)[
i]->weights()[0] = orig*
w*
m_norm;
133 else (*mec)[
i]->weights().push_back(
w*
m_norm*orig );
135 return StatusCode::SUCCESS;
140 const EventContext& ctx)
const
144 rngWrapper->
setSeed( rngName, ctx );
def retrieve(aClass, aKey=None)
bool m_doShape
Attempt to flatten the pT distribution.
void setSeed(const std::string &algName, const EventContext &ctx)
Set the random seed using a string (e.g.
QCDTruthMultiJetFilter(const std::string &name, ISvcLocator *pSvcLocator)
Const iterator class for DataVector/DataList.
double m_MaxLeadJetPt
Max pT for the leading truth jet.
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Property< T > &t)
long m_ptfailed
Number of events failing the pT cuts.
static double fitFn(const double x)
std::string m_TruthJetContainerName
Name of the truth jet container.
double m_MaxEta
Max eta for the truth jets.
ServiceHandle< StoreGateSvc > & evtStore()
The standard StoreGateSvc (event store) Returns (kind of) a pointer to the StoreGateSvc.
double m_NjetMinPt
Min pT for N jets truth jets required.
Base class for event generator filtering modules.
StatusCode filterInitialize()
::StatusCode StatusCode
StatusCode definition for legacy code.
#define CHECK(...)
Evaluate an expression and check for errors.
long m_total
Total number of events tested.
ServiceHandle< IAthRNGSvc > m_rndmSvc
Random number generator.
This defines the McEventCollection, which is really just an ObjectVector of McEvent objects.
CLHEP::HepRandomEngine * getRandomEngine(const std::string &streamName, const EventContext &ctx) const
A wrapper class for event-slot-local random engines.
StatusCode filterFinalize()
CLHEP::HepRandomEngine * getEngine(const EventContext &ctx) const
Retrieve the random engine corresponding to the provided EventContext.
double m_high
High-side function level.
double m_MinLeadJetPt
Min pT for the leading truth jet.
#define ATH_MSG_WARNING(x)
long m_nJetsFailed
Number of events failing the nJets cuts.
int m_Njet
Number of truth jets required above m_NjetMinPt.
double m_norm
Normalization for weights.
size_type size() const noexcept
Returns the number of elements in the collection.
long m_passed
Number of events passing all cuts.