Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
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 "TStopwatch.h"
24#include <vector>
25
26class RooArgSet ;
27namespace RooFit { class BidirMMapPipe; }
28
29class RooRealMPFE : public RooAbsReal {
30public:
31 // Constructors, assignment etc
32 RooRealMPFE(const char *name, const char *title, RooAbsReal& arg, bool calcInline=false) ;
33 RooRealMPFE(const RooRealMPFE& other, const char* name=nullptr);
34 TObject* clone(const char* newname) const override { return new RooRealMPFE(*this,newname); }
35 ~RooRealMPFE() override;
36
37 void calculate() const ;
38 double getValV(const RooArgSet* nset=nullptr) const override ;
39 void standby() ;
40
41 void setVerbose(bool clientFlag=true, bool serverFlag=true) ;
42
43 void applyNLLWeightSquared(bool flag) ;
44
45 void enableOffsetting(bool flag) override ;
46
47 void followAsSlave(RooRealMPFE& master) { _updateMaster = &master ; }
48
49 protected:
50
51 // Function evaluation
52 double evaluate() const override ;
53 friend class RooAbsTestStatistic ;
54 void constOptimizeTestStatistic(ConstOpCode opcode, bool doAlsoTracking=true) override ;
55 virtual double getCarry() const;
56
59
62
63 void initialize() ;
64 void initVars() ;
65 void serverLoop() ;
66
67 void doApplyNLLW2(bool flag) ;
68
69 RooRealProxy _arg ; ///< Function to calculate in parallel process
70 RooListProxy _vars ; ///< Variables
71 RooArgList _saveVars ; ///< Copy of variables
72 mutable bool _calcInProgress ;
76 mutable bool _forceCalc ;
78
79 RooFit::BidirMMapPipe *_pipe; ///<! connection to child
80
81 mutable std::vector<bool> _valueChanged ; ///<! Flags if variable needs update on server-side
82 mutable std::vector<bool> _constChanged ; ///<! Flags if variable needs update on server-side
83 RooRealMPFE* _updateMaster ; ///<! Update master
84 mutable bool _retrieveDispatched ; ///<!
85 mutable double _evalCarry; ///<!
86
87 ClassDefOverride(RooRealMPFE,2) // Multi-process front-end for parallel calculation of a real valued function
88};
89
90#endif
#define ClassDefOverride(name, id)
Definition Rtypes.h:341
char name[80]
Definition TGX11.cxx:110
RooAbsReal is the common abstract base class for objects that represent a real value and implements f...
Definition RooAbsReal.h:62
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:55
BidirMMapPipe creates a bidirectional channel between the current process and a child it forks.
RooRealMPFE is the multi-processor front-end for parallel calculation of RooAbsReal objects.
Definition RooRealMPFE.h:29
RooFit::BidirMMapPipe * _pipe
! connection to child
Definition RooRealMPFE.h:79
RooArgList _saveVars
Copy of variables.
Definition RooRealMPFE.h:71
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.
bool _calcInProgress
Definition RooRealMPFE.h:72
RooListProxy _vars
Variables.
Definition RooRealMPFE.h:70
double _evalCarry
!
Definition RooRealMPFE.h:85
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:83
void doApplyNLLW2(bool flag)
bool _retrieveDispatched
!
Definition RooRealMPFE.h:84
bool _verboseClient
Definition RooRealMPFE.h:73
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:76
std::vector< bool > _constChanged
! Flags if variable needs update on server-side
Definition RooRealMPFE.h:82
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:34
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.
virtual double getCarry() const
std::vector< bool > _valueChanged
! Flags if variable needs update on server-side
Definition RooRealMPFE.h:81
void enableOffsetting(bool flag) override
Control verbose messaging related to inter process communication on both client and server side.
bool _verboseServer
Definition RooRealMPFE.h:74
RooRealProxy _arg
Function to calculate in parallel process.
Definition RooRealMPFE.h:69
bool _inlineMode
Definition RooRealMPFE.h:75
~RooRealMPFE() override
Destructor.
void followAsSlave(RooRealMPFE &master)
Definition RooRealMPFE.h:47
RooAbsReal::ErrorLoggingMode _remoteEvalErrorLoggingState
Definition RooRealMPFE.h:77
double getValV(const RooArgSet *nset=nullptr) const override
If value needs recalculation and calculation has not beed started with a call to calculate() start it...
Mother of all ROOT objects.
Definition TObject.h:41
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
Definition Common.h:18