test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
VertexWeighter Class Reference

#include <VertexWeighter.h>

Public Member Functions

 VertexWeighter ()
 
 VertexWeighter (const double &sigma_init, const double &mean_init, const double &sigma_final, const bool &usemainvtx)
 
 VertexWeighter (const edm::ParameterSet &iConfig)
 
const double weight (const std::vector< float > &zpositions, const float &zmain) const
 

Private Attributes

const bool m_dummy
 
const double m_mean_init
 
const double m_sigma_final
 
const double m_sigma_init
 
const bool m_usemain
 

Detailed Description

Definition at line 8 of file VertexWeighter.h.

Constructor & Destructor Documentation

VertexWeighter::VertexWeighter ( )

Definition at line 7 of file VertexWeighter.cc.

7  :
8  m_sigma_init(1.), m_mean_init(0.), m_sigma_final(1.), m_usemain(false), m_dummy(true) { }
const bool m_dummy
const bool m_usemain
const double m_sigma_init
const double m_mean_init
const double m_sigma_final
VertexWeighter::VertexWeighter ( const double &  sigma_init,
const double &  mean_init,
const double &  sigma_final,
const bool &  usemainvtx 
)

Definition at line 10 of file VertexWeighter.cc.

10  :
11  m_sigma_init(sigma_init), m_mean_init(mean_init), m_sigma_final(sigma_final), m_usemain(usemainvtx), m_dummy(false) { }
const bool m_dummy
const bool m_usemain
const double m_sigma_init
const double m_mean_init
const double m_sigma_final
VertexWeighter::VertexWeighter ( const edm::ParameterSet iConfig)

Definition at line 13 of file VertexWeighter.cc.

13  :
14  m_sigma_init(iConfig.getParameter<double>("initSigma")),
15  m_mean_init(iConfig.getParameter<double>("initMean")),
16  m_sigma_final(iConfig.getParameter<double>("finalSigma")),
17  m_usemain(iConfig.getParameter<bool>("useMainVertex")),
18  m_dummy(false) { }
T getParameter(std::string const &) const
const bool m_dummy
const bool m_usemain
const double m_sigma_init
const double m_mean_init
const double m_sigma_final

Member Function Documentation

const double VertexWeighter::weight ( const std::vector< float > &  zpositions,
const float &  zmain 
) const

Definition at line 20 of file VertexWeighter.cc.

References create_public_lumi_plots::exp, m_dummy, m_mean_init, m_sigma_final, m_sigma_init, m_usemain, and funct::pow().

Referenced by cuy.ValElement::__init__(), cuy.additionElement::__init__(), cuy.superimposeElement::__init__(), cuy.graphElement::__init__(), and MCVerticesWeight::filter().

20  {
21 
22  double final_weight = 1.;
23 
24  if(!m_dummy) {
25 
26  for(std::vector<float>::const_iterator zpos = zpositions.begin() ; zpos != zpositions.end() ; ++zpos) {
27 
28  final_weight *= (m_sigma_init/m_sigma_final) * exp(-pow((*zpos-m_mean_init),2)/2.*(1./pow(m_sigma_final,2)-1./pow(m_sigma_init,2)));
29 
30  }
31 
32  if(m_usemain) {
33  final_weight *= (m_sigma_init/m_sigma_final) * exp(-pow((zmain-m_mean_init),2)/2.*(1./pow(m_sigma_final,2)-1./pow(m_sigma_init,2)));
34  }
35 
36  }
37 
38  return final_weight;
39 
40 
41 }
const bool m_dummy
const bool m_usemain
const double m_sigma_init
const double m_mean_init
const double m_sigma_final
Power< A, B >::type pow(const A &a, const B &b)
Definition: Power.h:40

Member Data Documentation

const bool VertexWeighter::m_dummy
private

Definition at line 24 of file VertexWeighter.h.

Referenced by weight().

const double VertexWeighter::m_mean_init
private

Definition at line 21 of file VertexWeighter.h.

Referenced by weight().

const double VertexWeighter::m_sigma_final
private

Definition at line 22 of file VertexWeighter.h.

Referenced by weight().

const double VertexWeighter::m_sigma_init
private

Definition at line 20 of file VertexWeighter.h.

Referenced by weight().

const bool VertexWeighter::m_usemain
private

Definition at line 23 of file VertexWeighter.h.

Referenced by weight().