CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
WeakEffectsWeightProducer Class Reference
Inheritance diagram for WeakEffectsWeightProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void beginJob () override
 
void endJob () override
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 WeakEffectsWeightProducer (const edm::ParameterSet &pset)
 
 ~WeakEffectsWeightProducer () override
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
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, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

double alphaQED (double q2)
 
double sigma0_qqbarll (unsigned int quark_type, double Q, double rho)
 

Private Attributes

edm::EDGetTokenT< reco::GenParticleCollectiongenParticlesToken_
 
double rhoParameter_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag 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 ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 6 of file WeakEffectsWeightProducer.cc.

Constructor & Destructor Documentation

◆ WeakEffectsWeightProducer()

WeakEffectsWeightProducer::WeakEffectsWeightProducer ( const edm::ParameterSet pset)

Definition at line 31 of file WeakEffectsWeightProducer.cc.

32  : // genParticlesToken_(consumes<reco::GenParticleCollection>(pset.getUntrackedParameter<edm::InputTag> ("GenParticlesTag", edm::InputTag("genParticles")))),
33  genParticlesToken_(consumes<reco::GenParticleCollection>(edm::InputTag("genParticles"))),
34  rhoParameter_(pset.getUntrackedParameter<double>("RhoParameter", 1.004)) {
35  produces<double>();
36 }

◆ ~WeakEffectsWeightProducer()

WeakEffectsWeightProducer::~WeakEffectsWeightProducer ( )
override

Definition at line 39 of file WeakEffectsWeightProducer.cc.

39 {}

Member Function Documentation

◆ alphaQED()

double WeakEffectsWeightProducer::alphaQED ( double  q2)
private

Definition at line 86 of file WeakEffectsWeightProducer.cc.

86  {
87  double pigaga = -0.010449239475366825 - 0.0023228196282246765 * log(q2) - 0.0288 -
88  0.002980 * (log(q2 / 8464.) + 0.006307 * (q2 / 8464. - 1.));
89  return (1. / 137.0359895) / (1. + pigaga);
90 }

References dqm-mbProfile::log, and q2.

Referenced by sigma0_qqbarll().

◆ beginJob()

void WeakEffectsWeightProducer::beginJob ( void  )
overridevirtual

Reimplemented from edm::EDProducer.

Definition at line 42 of file WeakEffectsWeightProducer.cc.

42 {}

◆ endJob()

void WeakEffectsWeightProducer::endJob ( void  )
overridevirtual

Reimplemented from edm::EDProducer.

Definition at line 45 of file WeakEffectsWeightProducer.cc.

45 {}

◆ produce()

void WeakEffectsWeightProducer::produce ( edm::Event iEvent,
const edm::EventSetup  
)
overridevirtual

Implements edm::EDProducer.

Definition at line 48 of file WeakEffectsWeightProducer.cc.

48  {
49  if (iEvent.isRealData())
50  return;
51 
54  unsigned int gensize = genParticles->size();
55 
56  std::unique_ptr<double> weight(new double);
57 
58  // Set default weight
59  (*weight) = 1.;
60 
61  // Only DY implemented for the time being
62  for (unsigned int i = 0; i < gensize; ++i) {
63  const reco::GenParticle& part = (*genParticles)[i];
64  int status = part.status();
65  if (status != 3)
66  break;
67  int id = part.pdgId();
68  if (id != 23)
69  continue;
70  double Q = part.mass();
71  unsigned int nmothers = part.numberOfMothers();
72  if (nmothers <= 0)
73  continue;
74  size_t key = part.motherRef(0).key();
75  unsigned int quark_id = abs((*genParticles)[key].pdgId());
76  if (quark_id > 0 && quark_id < 6) {
77  (*weight) *= sigma0_qqbarll(quark_id, Q, rhoParameter_) / sigma0_qqbarll(quark_id, Q, 1.0);
78  }
79  break;
80  }
81 
82  //printf(" \t >>>>> WeakEffectsWeightProducer: Final weight = %f\n", (*weight));
83  iEvent.put(std::move(weight));
84 }

References funct::abs(), genParticles2HepMC_cfi::genParticles, genParticlesToken_, mps_fire::i, iEvent, crabWrapper::key, eostools::move(), EgammaValidation_cff::pdgId, class-composition::Q, rhoParameter_, sigma0_qqbarll(), mps_update::status, and mps_merge::weight.

◆ sigma0_qqbarll()

double WeakEffectsWeightProducer::sigma0_qqbarll ( unsigned int  quark_type,
double  Q,
double  rho 
)
private

Definition at line 92 of file WeakEffectsWeightProducer.cc.

92  {
93  double MZ = 91.188;
94  double GZ = 2.495;
95  double sin2eff = 0.232;
96 
97  double vl = -0.5 + 2. * sin2eff;
98  double al = -0.5;
99 
100  double qq = 0.;
101  double vq = 0.;
102  double aq = 0.;
103  double alphaW = 2.7e-3 * pow(log(Q * Q / 80.4 / 80.4), 2);
104  double alphaZ = 2.7e-3 * pow(log(Q * Q / MZ / MZ), 2);
105  double sudakov_factor = 1.;
106  if (quark_id % 2 == 1) {
107  qq = -1. / 3.;
108  vq = -0.5 - 2. * qq * sin2eff;
109  aq = -0.5;
110  sudakov_factor = 1 + (-2.139 + 0.864) * alphaW - 0.385 * alphaZ;
111  } else {
112  qq = 2. / 3.;
113  vq = 0.5 - 2. * qq * sin2eff;
114  aq = 0.5;
115  sudakov_factor = 1 + (-3.423 + 1.807) * alphaW - 0.557 * alphaZ;
116  }
117 
118  double alfarn = alphaQED(Q * Q);
119  double zcoupl = sqrt(2.) * 1.166389e-5 * MZ * MZ / 4. / M_PI;
120  double gll = zcoupl * MZ / 3. * (vl * vl + al * al);
121  double gdd = zcoupl * MZ / 3. * (vq * vq + aq * aq);
122  double denom = (Q * Q - MZ * MZ) * (Q * Q - MZ * MZ) + pow(Q, 4) * GZ * GZ / MZ / MZ;
123  double qed = M_PI * qq * qq * alfarn * alfarn / Q / Q;
124  double zint = rho * 2 * M_PI * zcoupl * alfarn * qq * vq * vl * (Q * Q - MZ * MZ) / denom;
125  double zonly = rho * rho * 9. * M_PI * gll * gdd / MZ / MZ * Q * Q / denom;
126 
127  return (qed + zint + zonly) * sudakov_factor;
128 }

References alphaQED(), makePileupJSON::denom, dqm-mbProfile::log, M_PI, MZ, funct::pow(), class-composition::Q, rho, and mathSSE::sqrt().

Referenced by produce().

Member Data Documentation

◆ genParticlesToken_

edm::EDGetTokenT<reco::GenParticleCollection> WeakEffectsWeightProducer::genParticlesToken_
private

Definition at line 15 of file WeakEffectsWeightProducer.cc.

Referenced by produce().

◆ rhoParameter_

double WeakEffectsWeightProducer::rhoParameter_
private

Definition at line 16 of file WeakEffectsWeightProducer.cc.

Referenced by produce().

mps_fire.i
i
Definition: mps_fire.py:355
genParticles2HepMC_cfi.genParticles
genParticles
Definition: genParticles2HepMC_cfi.py:4
makePileupJSON.denom
denom
Definition: makePileupJSON.py:147
reco::GenParticle
Definition: GenParticle.h:21
mps_update.status
status
Definition: mps_update.py:69
mps_merge.weight
weight
Definition: mps_merge.py:88
MZ
#define MZ
Definition: ZeeCalibration.cc:63
WeakEffectsWeightProducer::genParticlesToken_
edm::EDGetTokenT< reco::GenParticleCollection > genParticlesToken_
Definition: WeakEffectsWeightProducer.cc:15
edm::Handle< reco::GenParticleCollection >
class-composition.Q
Q
Definition: class-composition.py:82
part
part
Definition: HCALResponse.h:20
mathSSE::sqrt
T sqrt(T t)
Definition: SSEVec.h:19
q2
double q2[4]
Definition: TauolaWrapper.h:88
DDAxes::rho
iEvent
int iEvent
Definition: GenABIO.cc:224
M_PI
#define M_PI
Definition: BXVectorInputProducer.cc:50
WeakEffectsWeightProducer::rhoParameter_
double rhoParameter_
Definition: WeakEffectsWeightProducer.cc:16
EgammaValidation_cff.pdgId
pdgId
Definition: EgammaValidation_cff.py:118
eostools.move
def move(src, dest)
Definition: eostools.py:511
WeakEffectsWeightProducer::sigma0_qqbarll
double sigma0_qqbarll(unsigned int quark_type, double Q, double rho)
Definition: WeakEffectsWeightProducer.cc:92
WeakEffectsWeightProducer::alphaQED
double alphaQED(double q2)
Definition: WeakEffectsWeightProducer.cc:86
dqm-mbProfile.log
log
Definition: dqm-mbProfile.py:17
funct::pow
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:30
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
crabWrapper.key
key
Definition: crabWrapper.py:19
edm::InputTag
Definition: InputTag.h:15
weight
Definition: weight.py:1
muonDTDigis_cfi.pset
pset
Definition: muonDTDigis_cfi.py:27