CMS 3D CMS Logo

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

#include <DebugProposal.h>

Inheritance diagram for DebugProposal:

Public Member Functions

 DebugProposal ()
 
 DebugProposal (RooStats::ProposalFunction *p, RooAbsPdf *pdf, RooAbsData *data, int tries)
 
virtual Double_t GetProposalDensity (RooArgSet &x1, RooArgSet &x2)
 
virtual Bool_t IsSymmetric (RooArgSet &x1, RooArgSet &x2)
 
virtual void Propose (RooArgSet &xPrime, RooArgSet &x)
 
void tracePdf (RooAbsReal *pdf)
 
virtual ~DebugProposal ()
 

Public Attributes

ClassDef(DebugProposal,
1) private std::auto_ptr
< RooAbsReal > 
nll_
 
RooArgSet params_
 
RooAbsPdf * pdf_
 
int tries_
 

Detailed Description

Definition at line 14 of file DebugProposal.h.

Constructor & Destructor Documentation

DebugProposal::DebugProposal ( )
inline

Definition at line 17 of file DebugProposal.h.

17 : RooStats::ProposalFunction(), prop_(0), nll_(0), params_(), tries_(0) {}
RooArgSet params_
Definition: DebugProposal.h:40
ClassDef(DebugProposal, 1) private std::auto_ptr< RooAbsReal > nll_
Definition: DebugProposal.h:34
DebugProposal::DebugProposal ( RooStats::ProposalFunction *  p,
RooAbsPdf *  pdf,
RooAbsData *  data,
int  tries 
)

Definition at line 8 of file DebugProposal.cc.

References nll_, and params_.

8  :
9  RooStats::ProposalFunction(), prop_(p), pdf_(pdf), tries_(tries)
10 {
11  if (pdf && data) {
12  nll_.reset(pdf->createNLL(*data));
13  RooArgSet *par = pdf->getParameters(*data);
14  RooStats::RemoveConstantParameters(par);
15  params_.add(*par);
16  delete par;
17  }
18  if (tries) {
19  p->Print("V");
20  }
21 }
RooAbsPdf * pdf_
Definition: DebugProposal.h:39
RooArgSet params_
Definition: DebugProposal.h:40
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
ClassDef(DebugProposal, 1) private std::auto_ptr< RooAbsReal > nll_
Definition: DebugProposal.h:34
virtual DebugProposal::~DebugProposal ( )
inlinevirtual

Definition at line 32 of file DebugProposal.h.

32 {}

Member Function Documentation

Double_t DebugProposal::GetProposalDensity ( RooArgSet &  x1,
RooArgSet &  x2 
)
virtual

Definition at line 51 of file DebugProposal.cc.

References gather_cfg::cout, run_regression::ret, and tries_.

53 {
54  if (tries_ > 0) {
55  std::cout << "DebugProposal::GetProposalDensity: x1" << std::endl; x1.Print("V");
56  std::cout << "DebugProposal::GetProposalDensity: x2" << std::endl; x2.Print("V");
57  }
58  Double_t ret = prop_->GetProposalDensity(x1,x2);
59  if (tries_ > 0) { std::cout << "DebugProposal::GetProposalDensity: return " << ret << std::endl; }
60  return ret;
61 }
tuple cout
Definition: gather_cfg.py:121
Bool_t DebugProposal::IsSymmetric ( RooArgSet &  x1,
RooArgSet &  x2 
)
virtual

Definition at line 64 of file DebugProposal.cc.

References gather_cfg::cout, run_regression::ret, and tries_.

64  {
65  if (tries_ > 0) {
66  std::cout << "DebugProposal::IsSymmetric: x1" << std::endl; x1.Print("V");
67  std::cout << "DebugProposal::IsSymmetric: x2" << std::endl; x2.Print("V");
68  }
69  Bool_t ret = prop_->IsSymmetric(x1,x2);
70  if (tries_ > 0) { std::cout << "DebugProposal::IsSymmetric: return " << ret << std::endl; }
71  return ret;
72 }
tuple cout
Definition: gather_cfg.py:121
void DebugProposal::Propose ( RooArgSet &  xPrime,
RooArgSet &  x 
)
virtual

Definition at line 24 of file DebugProposal.cc.

References gather_cfg::cout, create_public_lumi_plots::exp, nll_, params_, tracePdf(), and tries_.

25 {
26  prop_->Propose(xPrime,x);
27  if (tries_ > 0) {
28  std::cout << "DebugProposal::Propose: x'" << std::endl; xPrime.Print("V");
29  std::cout << "DebugProposal::Propose: x " << std::endl; x.Print("V");
30  if (nll_.get()) {
31  RooStats::SetParameters(&xPrime, &params_);
32  double nllXP = nll_->getVal();
33  RooStats::SetParameters(&x, &params_);
34  double nllX = nll_->getVal();
35  std::cout << "DebugProposal::Propose: NLL(x) = " << nllX << std::endl;
36  std::cout << "DebugProposal::Propose: NLL(x') = " << nllXP << std::endl;
37  std::cout << "DebugProposal::Propose: uncorrected acc prob. = " << exp(nllX - nllXP) << std::endl;
38  std::cout << "DebugProposal::Propose: tracing NLL(x')" << std::endl;
39  RooStats::SetParameters(&xPrime, &params_);
40  tracePdf(nll_.get());
41  std::cout << "DebugProposal::Propose: tracing NLL(x)" << std::endl;
42  RooStats::SetParameters(&x, &params_);
43  tracePdf(nll_.get());
44  }
45  --tries_;
46  }
47 }
void tracePdf(RooAbsReal *pdf)
RooArgSet params_
Definition: DebugProposal.h:40
tuple cout
Definition: gather_cfg.py:121
ClassDef(DebugProposal, 1) private std::auto_ptr< RooAbsReal > nll_
Definition: DebugProposal.h:34
Definition: DDAxes.h:10
void DebugProposal::tracePdf ( RooAbsReal *  pdf)

Definition at line 74 of file DebugProposal.cc.

References gather_cfg::cout, i, and n.

Referenced by Propose().

74  {
75  RooArgList deps;
76  deps.add(*pdf);
77  pdf->treeNodeServerList(&deps);
78  for (int i = 0, n = deps.getSize(); i < n; ++i) {
79  RooAbsReal *rar = dynamic_cast<RooAbsReal *>(deps.at(i));
80  if (typeid(*rar) == typeid(RooRealVar) || rar->isConstant()) continue;
81  if (rar != 0) {
82  std::cout << " " << rar->GetName() << " = " << rar->getVal() << std::endl;
83  }
84  }
85 }
int i
Definition: DBlmapReader.cc:9
tuple cout
Definition: gather_cfg.py:121

Member Data Documentation

ClassDef (DebugProposal,1) private std::auto_ptr<RooAbsReal> DebugProposal::nll_

Definition at line 34 of file DebugProposal.h.

Referenced by DebugProposal(), and Propose().

RooArgSet DebugProposal::params_

Definition at line 40 of file DebugProposal.h.

Referenced by DebugProposal(), and Propose().

RooAbsPdf* DebugProposal::pdf_

Definition at line 39 of file DebugProposal.h.

int DebugProposal::tries_

Definition at line 41 of file DebugProposal.h.

Referenced by GetProposalDensity(), IsSymmetric(), and Propose().