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
27class RooArgSet ;
28namespace RooFit { class BidirMMapPipe; }
29
30class RooRealMPFE : public RooAbsReal {
31public:
32 // Constructors, assignment etc
33 RooRealMPFE(const char *name, const char *title, RooAbsReal& arg, bool calcInline=false) ;
34 RooRealMPFE(const RooRealMPFE& other, const char* name=0);
35 TObject* clone(const char* newname) const override { return new RooRealMPFE(*this,newname); }
36 ~RooRealMPFE() override;
37
38 void calculate() const ;
39 double getValV(const RooArgSet* nset=0) const override ;
40 void standby() ;
41
42 void setVerbose(bool clientFlag=true, bool serverFlag=true) ;
43
44 void applyNLLWeightSquared(bool flag) ;
45
46 void enableOffsetting(bool flag) override ;
47
48 void followAsSlave(RooRealMPFE& master) { _updateMaster = &master ; }
49
50 protected:
51
52 // Function evaluation
53 double evaluate() const override ;
54 friend class RooAbsTestStatistic ;
55 void constOptimizeTestStatistic(ConstOpCode opcode, bool doAlsoTracking=true) override ;
56 virtual double getCarry() const;
57
60
63
64 void initialize() ;
65 void initVars() ;
66 void serverLoop() ;
67
68 void doApplyNLLW2(bool flag) ;
69
70 RooRealProxy _arg ; ///< Function to calculate in parallel process
71 RooListProxy _vars ; ///< Variables
72 RooArgList _saveVars ; ///< Copy of variables
73 mutable bool _calcInProgress ;
77 mutable bool _forceCalc ;
79
80 RooFit::BidirMMapPipe *_pipe; ///<! connection to child
81
82 mutable std::vector<bool> _valueChanged ; ///<! Flags if variable needs update on server-side
83 mutable std::vector<bool> _constChanged ; ///<! Flags if variable needs update on server-side
84 RooRealMPFE* _updateMaster ; ///<! Update master
85 mutable bool _retrieveDispatched ; ///<!
86 mutable double _evalCarry; ///<!
87
89
90 ClassDefOverride(RooRealMPFE,2) // Multi-process front-end for parallel calculation of a real valued function
91};
92
93#endif
#define ClassDefOverride(name, id)
Definition: Rtypes.h:339
char name[80]
Definition: TGX11.cxx:110
friend class RooRealMPFE
Definition: RooAbsArg.h:691
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition: RooAbsReal.h:64
RooAbsTestStatistic is the abstract base class for all test statistics.
RooArgList is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgList.h:22
RooArgSet is a container object that can hold multiple RooAbsArg objects.
Definition: RooArgSet.h:57
BidirMMapPipe creates a bidirectional channel between the current process and a child it forks.
RooMPSentinel is a singleton class that keeps track of all parellel execution processes for goodness-...
Definition: RooMPSentinel.h:23
RooRealMPFE is the multi-processor front-end for parallel calculation of RooAbsReal objects.
Definition: RooRealMPFE.h:30
State _state
Definition: RooRealMPFE.h:59
RooFit::BidirMMapPipe * _pipe
! connection to child
Definition: RooRealMPFE.h:80
RooArgList _saveVars
Copy of variables.
Definition: RooRealMPFE.h:72
void calculate() const
Client-side function that instructs server process to start asynchronuous (re)calculation of function...
void initialize()
Initialize the remote process and message passing pipes between current process and remote process.
void serverLoop()
Server loop of remote processes.
void standby()
Terminate remote server process and return front-end class to standby mode.
@ CalculateNoOffset
Definition: RooRealMPFE.h:62
static RooMPSentinel _sentinel
Definition: RooRealMPFE.h:88
bool _calcInProgress
Definition: RooRealMPFE.h:73
RooListProxy _vars
Variables.
Definition: RooRealMPFE.h:71
double _evalCarry
!
Definition: RooRealMPFE.h:86
void applyNLLWeightSquared(bool flag)
Control verbose messaging related to inter process communication on both client and server side.
void initVars()
Initialize list of variables of front-end argument 'arg'.
RooRealMPFE * _updateMaster
! Update master
Definition: RooRealMPFE.h:84
void doApplyNLLW2(bool flag)
bool _retrieveDispatched
!
Definition: RooRealMPFE.h:85
bool _verboseClient
Definition: RooRealMPFE.h:74
void setVerbose(bool clientFlag=true, bool serverFlag=true)
Control verbose messaging related to inter process communication on both client and server side.
bool _forceCalc
Definition: RooRealMPFE.h:77
std::vector< bool > _constChanged
! Flags if variable needs update on server-side
Definition: RooRealMPFE.h:83
double evaluate() const override
Send message to server process to retrieve output value If error were logged use logEvalError() on re...
TObject * clone(const char *newname) const override
Definition: RooRealMPFE.h:35
void constOptimizeTestStatistic(ConstOpCode opcode, bool doAlsoTracking=true) override
Intercept call to optimize constant term in test statistics and forward it to object on server side.
double getValV(const RooArgSet *nset=0) const override
If value needs recalculation and calculation has not beed started with a call to calculate() start it...
virtual double getCarry() const
std::vector< bool > _valueChanged
! Flags if variable needs update on server-side
Definition: RooRealMPFE.h:82
void enableOffsetting(bool flag) override
Control verbose messaging related to inter process communication on both client and server side.
bool _verboseServer
Definition: RooRealMPFE.h:75
RooRealProxy _arg
Function to calculate in parallel process.
Definition: RooRealMPFE.h:70
bool _inlineMode
Definition: RooRealMPFE.h:76
~RooRealMPFE() override
Destructor.
void followAsSlave(RooRealMPFE &master)
Definition: RooRealMPFE.h:48
RooAbsReal::ErrorLoggingMode _remoteEvalErrorLoggingState
Definition: RooRealMPFE.h:78
Mother of all ROOT objects.
Definition: TObject.h:37
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
Definition: Common.h:18