Logo ROOT  
Reference Guide
RooRealMPFE.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Project: RooFit *
3  * Package: RooFitCore *
4  * File: $Id: RooRealMPFE.h,v 1.7 2007/05/11 09:11:30 verkerke Exp $
5  * Authors: *
6  * WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu *
7  * DK, David Kirkby, UC Irvine, dkirkby@uci.edu *
8  * *
9  * Copyright (c) 2000-2005, Regents of the University of California *
10  * and Stanford University. All rights reserved. *
11  * *
12  * Redistribution and use in source and binary forms, *
13  * with or without modification, are permitted according to the terms *
14  * listed in LICENSE (http://roofit.sourceforge.net/license.txt) *
15  *****************************************************************************/
16 #ifndef ROO_REAL_MPFE
17 #define ROO_REAL_MPFE
18 
19 #include "RooAbsReal.h"
20 #include "RooRealProxy.h"
21 #include "RooListProxy.h"
22 #include "RooArgList.h"
23 #include "RooMPSentinel.h"
24 #include "TStopwatch.h"
25 #include <vector>
26 
27 class RooArgSet ;
28 namespace RooFit { class BidirMMapPipe; }
29 
30 class RooRealMPFE : public RooAbsReal {
31 public:
32  // Constructors, assignment etc
33  RooRealMPFE(const char *name, const char *title, RooAbsReal& arg, Bool_t calcInline=kFALSE) ;
34  RooRealMPFE(const RooRealMPFE& other, const char* name=0);
35  virtual TObject* clone(const char* newname) const { return new RooRealMPFE(*this,newname); }
36  virtual ~RooRealMPFE();
37 
38  void calculate() const ;
39  virtual Double_t getValV(const RooArgSet* nset=0) const ;
40  void standby() ;
41 
42  void setVerbose(Bool_t clientFlag=kTRUE, Bool_t serverFlag=kTRUE) ;
43 
44  void applyNLLWeightSquared(Bool_t flag) ;
45 
46  void enableOffsetting(Bool_t flag) ;
47 
48  void followAsSlave(RooRealMPFE& master) { _updateMaster = &master ; }
49 
50  protected:
51 
52  // Function evaluation
53  virtual Double_t evaluate() const ;
54  friend class RooAbsTestStatistic ;
55  virtual void constOptimizeTestStatistic(ConstOpCode opcode, Bool_t doAlsoTracking=kTRUE) ;
56  virtual Double_t getCarry() const;
57 
60 
63 
64  void initialize() ;
65  void initVars() ;
66  void serverLoop() ;
67 
68  void doApplyNLLW2(Bool_t flag) ;
69 
70  RooRealProxy _arg ; // Function to calculate in parallel process
71  RooListProxy _vars ; // Variables
72  RooArgList _saveVars ; // Copy of variables
77  mutable Bool_t _forceCalc ;
79 
80  RooFit::BidirMMapPipe *_pipe; //! connection to child
81 
82  mutable std::vector<Bool_t> _valueChanged ; //! Flags if variable needs update on server-side
83  mutable std::vector<Bool_t> _constChanged ; //! Flags if variable needs update on server-side
84  RooRealMPFE* _updateMaster ; //! Update master
86  mutable Double_t _evalCarry; //!
87 
89 
90  ClassDef(RooRealMPFE,2) // Multi-process front-end for parallel calculation of a real valued function
91 };
92 
93 #endif
RooRealMPFE::CalculateNoOffset
@ CalculateNoOffset
Definition: RooRealMPFE.h:62
RooRealMPFE::SendCat
@ SendCat
Definition: RooRealMPFE.h:61
RooRealMPFE::clone
virtual TObject * clone(const char *newname) const
Definition: RooRealMPFE.h:35
RooRealMPFE::_pipe
RooFit::BidirMMapPipe * _pipe
Definition: RooRealMPFE.h:80
RooRealMPFE
RooRealMPFE is the multi-processor front-end for parallel calculation of RooAbsReal objects.
Definition: RooRealMPFE.h:30
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
RooAbsReal.h
RooRealMPFE::initialize
void initialize()
Initialize the remote process and message passing pipes between current process and remote process.
Definition: RooRealMPFE.cxx:184
RooRealMPFE::initVars
void initVars()
Initialize list of variables of front-end argument 'arg'.
Definition: RooRealMPFE.cxx:145
RooRealMPFE::Terminate
@ Terminate
Definition: RooRealMPFE.h:61
BidirMMapPipe
BidirMMapPipe creates a bidirectional channel between the current process and a child it forks.
Definition: BidirMMapPipe.h:378
RooRealMPFE::_inlineMode
Bool_t _inlineMode
Definition: RooRealMPFE.h:76
RooRealMPFE::calculate
void calculate() const
Client-side function that instructs server process to start asynchronuous (re)calculation of function...
Definition: RooRealMPFE.cxx:406
RooRealMPFE::_updateMaster
RooRealMPFE * _updateMaster
Flags if variable needs update on server-side.
Definition: RooRealMPFE.h:84
RooRealMPFE::_verboseServer
Bool_t _verboseServer
Definition: RooRealMPFE.h:75
TStopwatch.h
RooArgList
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgList.h:21
RooRealMPFE::LogEvalError
@ LogEvalError
Definition: RooRealMPFE.h:62
RooRealMPFE::_verboseClient
Bool_t _verboseClient
Definition: RooRealMPFE.h:74
RooRealMPFE::~RooRealMPFE
virtual ~RooRealMPFE()
Destructor.
Definition: RooRealMPFE.cxx:134
RooRealMPFE::followAsSlave
void followAsSlave(RooRealMPFE &master)
Definition: RooRealMPFE.h:48
RooRealMPFE::Message
Message
Definition: RooRealMPFE.h:61
RooRealMPFE::_state
State _state
Definition: RooRealMPFE.h:59
RooAbsReal
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:61
RooRealMPFE::_retrieveDispatched
Bool_t _retrieveDispatched
Update master.
Definition: RooRealMPFE.h:85
RooRealMPFE::_calcInProgress
Bool_t _calcInProgress
Definition: RooRealMPFE.h:73
RooRealMPFE::EnableOffset
@ EnableOffset
Definition: RooRealMPFE.h:62
bool
RooRealMPFE::applyNLLWeightSquared
void applyNLLWeightSquared(Bool_t flag)
Control verbose messaging related to inter process communication on both client and server side.
Definition: RooRealMPFE.cxx:703
RooRealMPFE::Initialize
@ Initialize
Definition: RooRealMPFE.h:58
RooRealMPFE::_constChanged
std::vector< Bool_t > _constChanged
Flags if variable needs update on server-side.
Definition: RooRealMPFE.h:83
RooAbsTestStatistic
RooAbsTestStatistic is the abstract base class for all test statistics.
Definition: RooAbsTestStatistic.h:37
RooRealMPFE::getCarry
virtual Double_t getCarry() const
Definition: RooRealMPFE.cxx:169
RooRealMPFE::Calculate
@ Calculate
Definition: RooRealMPFE.h:61
RooRealMPFE::_arg
RooRealProxy _arg
Definition: RooRealMPFE.h:70
RooRealMPFE::_saveVars
RooArgList _saveVars
Definition: RooRealMPFE.h:72
RooRealMPFE::Inline
@ Inline
Definition: RooRealMPFE.h:58
RooRealMPFE::setVerbose
void setVerbose(Bool_t clientFlag=kTRUE, Bool_t serverFlag=kTRUE)
Control verbose messaging related to inter process communication on both client and server side.
Definition: RooRealMPFE.cxx:685
RooRealMPFE::ConstOpt
@ ConstOpt
Definition: RooRealMPFE.h:62
RooAbsReal::ErrorLoggingMode
ErrorLoggingMode
Definition: RooAbsReal.h:301
RooRealMPFE::Retrieve
@ Retrieve
Definition: RooRealMPFE.h:61
RooRealMPFE::ReturnValue
@ ReturnValue
Definition: RooRealMPFE.h:61
RooRealMPFE::_vars
RooListProxy _vars
Definition: RooRealMPFE.h:71
RooMPSentinel
RooMPSentinel is a singleton class that keeps track of all parellel execution processes for goodness-...
Definition: RooMPSentinel.h:23
RooFit
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
Definition: RooCFunction1Binding.h:29
RooAbsArg::RooRealMPFE
friend class RooRealMPFE
Definition: RooAbsArg.h:632
RooRealMPFE::State
State
Definition: RooRealMPFE.h:58
RooRealMPFE::ApplyNLLW2
@ ApplyNLLW2
Definition: RooRealMPFE.h:62
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
RooRealMPFE::serverLoop
void serverLoop()
Server loop of remote processes.
Definition: RooRealMPFE.cxx:229
RooRealProxy.h
RooMPSentinel.h
RooRealMPFE::_valueChanged
std::vector< Bool_t > _valueChanged
connection to child
Definition: RooRealMPFE.h:82
RooRealMPFE::enableOffsetting
void enableOffsetting(Bool_t flag)
Control verbose messaging related to inter process communication on both client and server side.
Definition: RooRealMPFE.cxx:732
RooListProxy
RooListProxy is the concrete proxy for RooArgList objects.
Definition: RooListProxy.h:24
RooRealMPFE::Client
@ Client
Definition: RooRealMPFE.h:58
RooRealMPFE::Server
@ Server
Definition: RooRealMPFE.h:58
RooListProxy.h
RooTemplateProxy< RooAbsReal >
Double_t
double Double_t
Definition: RtypesCore.h:59
RooRealMPFE::standby
void standby()
Terminate remote server process and return front-end class to standby mode.
Definition: RooRealMPFE.cxx:619
RooRealMPFE::_forceCalc
Bool_t _forceCalc
Definition: RooRealMPFE.h:77
TObject
Mother of all ROOT objects.
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
RooRealMPFE::_remoteEvalErrorLoggingState
RooAbsReal::ErrorLoggingMode _remoteEvalErrorLoggingState
Definition: RooRealMPFE.h:78
name
char name[80]
Definition: TGX11.cxx:110
RooRealMPFE::_sentinel
static RooMPSentinel _sentinel
Definition: RooRealMPFE.h:88
RooRealMPFE::doApplyNLLW2
void doApplyNLLW2(Bool_t flag)
Definition: RooRealMPFE.cxx:719
RooRealMPFE::evaluate
virtual Double_t evaluate() const
Send message to server process to retrieve output value If error were logged use logEvalError() on re...
Definition: RooRealMPFE.cxx:538
RooRealMPFE::constOptimizeTestStatistic
virtual void constOptimizeTestStatistic(ConstOpCode opcode, Bool_t doAlsoTracking=kTRUE)
Intercept call to optimize constant term in test statistics and forward it to object on server side.
Definition: RooRealMPFE.cxx:659
RooRealMPFE::Verbose
@ Verbose
Definition: RooRealMPFE.h:62
RooAbsArg::ConstOpCode
ConstOpCode
Definition: RooAbsArg.h:386
RooRealMPFE::getValV
virtual Double_t getValV(const RooArgSet *nset=0) const
If value needs recalculation and calculation has not beed started with a call to calculate() start it...
Definition: RooRealMPFE.cxx:510
RooArgList.h
RooRealMPFE::_evalCarry
Double_t _evalCarry
Definition: RooRealMPFE.h:86
RooArgSet
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:29
RooRealMPFE::SendReal
@ SendReal
Definition: RooRealMPFE.h:61