|
virtual void | produce (edm::Event &event, const edm::EventSetup &setup) override |
|
| SmearedJetProducerT (const edm::ParameterSet &cfg) |
|
| EDProducer ()=default |
|
| EDProducerBase () |
|
ModuleDescription const & | moduleDescription () const |
|
virtual | ~EDProducerBase () |
|
void | callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func) |
|
std::vector< edm::ProductResolverIndex > const & | indiciesForPutProducts (BranchType iBranchType) const |
|
| ProducerBase () |
|
void | registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &) |
|
std::function< void(BranchDescription const &)> | registrationCallback () const |
| used by the fwk to register list of products More...
|
|
void | resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel) |
|
virtual | ~ProducerBase () noexcept(false) |
|
std::vector< ConsumesInfo > | consumesInfo () const |
|
void | convertCurrentProcessAlias (std::string const &processName) |
| Convert "@currentProcess" in InputTag process names to the actual current process name. More...
|
|
| EDConsumerBase () |
|
| EDConsumerBase (EDConsumerBase const &)=delete |
|
| EDConsumerBase (EDConsumerBase &&)=default |
|
ProductResolverIndexAndSkipBit | indexFrom (EDGetToken, BranchType, TypeID const &) const |
|
void | itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const |
|
void | itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const |
|
std::vector< ProductResolverIndexAndSkipBit > const & | itemsToGetFrom (BranchType iType) const |
|
void | labelsForToken (EDGetToken iToken, Labels &oLabels) const |
|
void | modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const |
|
EDConsumerBase const & | operator= (EDConsumerBase const &)=delete |
|
EDConsumerBase & | operator= (EDConsumerBase &&)=default |
|
bool | registeredToConsume (ProductResolverIndex, bool, BranchType) const |
|
bool | registeredToConsumeMany (TypeID const &, BranchType) const |
|
void | updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet) |
|
virtual | ~EDConsumerBase () noexcept(false) |
|
|
typedef CacheContexts< T... > | CacheTypes |
|
typedef CacheTypes::GlobalCache | GlobalCache |
|
typedef AbilityChecker< T... > | HasAbility |
|
typedef CacheTypes::LuminosityBlockCache | LuminosityBlockCache |
|
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache > | LuminosityBlockContext |
|
typedef CacheTypes::LuminosityBlockSummaryCache | LuminosityBlockSummaryCache |
|
typedef CacheTypes::RunCache | RunCache |
|
typedef RunContextT< RunCache, GlobalCache > | RunContext |
|
typedef CacheTypes::RunSummaryCache | RunSummaryCache |
|
typedef EDProducerAdaptorBase | ModuleType |
|
typedef ProductRegistryHelper::TypeLabelList | TypeLabelList |
|
typedef ProductLabels | Labels |
|
template<typename ProductType , BranchType B = InEvent> |
EDGetTokenT< ProductType > | consumes (edm::InputTag const &tag) |
|
EDGetToken | consumes (const TypeToGet &id, edm::InputTag const &tag) |
|
template<BranchType B> |
EDGetToken | consumes (TypeToGet const &id, edm::InputTag const &tag) |
|
ConsumesCollector | consumesCollector () |
| Use a ConsumesCollector to gather consumes information from helper functions. More...
|
|
template<typename ProductType , BranchType B = InEvent> |
void | consumesMany () |
|
void | consumesMany (const TypeToGet &id) |
|
template<BranchType B> |
void | consumesMany (const TypeToGet &id) |
|
template<typename ProductType , BranchType B = InEvent> |
EDGetTokenT< ProductType > | mayConsume (edm::InputTag const &tag) |
|
EDGetToken | mayConsume (const TypeToGet &id, edm::InputTag const &tag) |
|
template<BranchType B> |
EDGetToken | mayConsume (const TypeToGet &id, edm::InputTag const &tag) |
|
template<typename T>
class SmearedJetProducerT< T >
Produce collection of "smeared" jets.
The aim of this correction is to account for the difference in jet energy resolution between Monte Carlo simulation and Data.
- Author
- Sébastien Brochet
Definition at line 99 of file SmearedJetProducerT.h.
Definition at line 179 of file SmearedJetProducerT.h.
References gather_cfg::cout, edmIntegrityCheck::d, reco::LeafCandidate::energy(), reco::LeafCandidate::eta(), JME::JetResolution::get(), JME::JetResolutionScaleFactor::get(), JME::JetResolution::getResolution(), JME::JetResolutionScaleFactor::getScaleFactor(), edm::EventBase::isRealData(), metsig::jet, JME::JetEta, JME::JetPt, fwrapper::jets, eostools::move(), reco::LeafCandidate::phi(), reco::LeafCandidate::pt(), fftjetproducer_cfi::resolution, JME::Rho, SurveyInfoScenario_cff::seed, and mathSSE::sqrt().
209 unsigned int runNum_uint = static_cast <
unsigned int> (
event.id().run());
210 unsigned int lumiNum_uint = static_cast <
unsigned int> (
event.id().luminosityBlock());
211 unsigned int evNum_uint = static_cast <
unsigned int> (
event.id().event());
212 unsigned int jet0eta = uint32_t(jets.empty() ? 0 : jets[0].eta()/0.01);
213 std::uint32_t
seed = jet0eta +
m_nomVar + (lumiNum_uint<<10) + (runNum_uint<<20) + evNum_uint;
221 auto smearedJets = std::make_unique<JetCollection>();
223 for (
const auto&
jet: jets) {
227 smearedJets->push_back(
jet);
236 std::cout <<
"jet: pt: " <<
jet.pt() <<
" eta: " <<
jet.eta() <<
" phi: " <<
jet.phi() <<
" e: " <<
jet.energy() << std::endl;
237 std::cout <<
"resolution: " << jet_resolution << std::endl;
238 std::cout <<
"resolution scale factor: " << jer_sf << std::endl;
245 double smearFactor = 1.;
253 std::cout <<
"gen jet: pt: " << genJet->
pt() <<
" eta: " << genJet->
eta() <<
" phi: " << genJet->
phi() <<
" e: " << genJet->
energy() << std::endl;
256 double dPt =
jet.pt() - genJet->
pt();
257 smearFactor = 1 +
m_nomVar*(jer_sf - 1.) * dPt /
jet.pt();
259 }
else if (jer_sf > 1) {
264 double sigma = jet_resolution *
std::sqrt(jer_sf * jer_sf - 1);
266 std::cout <<
"gaussian width: " << sigma << std::endl;
269 std::normal_distribution<>
d(0, sigma);
272 std::cout <<
"Impossible to smear this jet" << std::endl;
281 std::cout <<
"The smearing factor (" << smearFactor <<
") is either negative or too small. Fixing it to " << newSmearFactor <<
" to avoid change of direction." << std::endl;
283 smearFactor = newSmearFactor;
287 smearedJet.scaleEnergy(smearFactor);
290 std::cout <<
"smeared jet (" << smearFactor <<
"): pt: " << smearedJet.pt() <<
" eta: " << smearedJet.eta() <<
" phi: " << smearedJet.phi() <<
" e: " << smearedJet.energy() << std::endl;
293 smearedJets->push_back(smearedJet);
edm::EDGetTokenT< JetCollection > m_jets_token
virtual double pt() const final
transverse momentum
float getResolution(const JetParameters ¶meters) const
static const JetResolution get(const edm::EventSetup &, const std::string &)
virtual double eta() const final
momentum pseudorapidity
GreaterByPt< T > jetPtComparator
virtual double phi() const final
momentum azimuthal angle
std::unique_ptr< JME::JetResolution > m_resolution_from_file
std::vector< T > JetCollection
std::string m_jets_algo_pt
bool m_useDeterministicSeed
virtual double energy() const final
energy
Jets made from MC generator particles.
edm::EDGetTokenT< double > m_rho_token
static const double MIN_JET_ENERGY
std::mt19937 m_random_generator
float getScaleFactor(const JetParameters ¶meters, Variation variation=Variation::NOMINAL) const
Variation m_systematic_variation
static const JetResolutionScaleFactor get(const edm::EventSetup &, const std::string &)
std::shared_ptr< pat::GenJetMatcher > m_genJetMatcher
std::unique_ptr< JME::JetResolutionScaleFactor > m_scale_factor_from_file