RooRealMPFE.h

Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Project: RooFit                                                           *
00003  * Package: RooFitCore                                                       *
00004  *    File: $Id: RooRealMPFE.h,v 1.7 2007/05/11 09:11:30 verkerke Exp $
00005  * Authors:                                                                  *
00006  *   WV, Wouter Verkerke, UC Santa Barbara, verkerke@slac.stanford.edu       *
00007  *   DK, David Kirkby,    UC Irvine,         dkirkby@uci.edu                 *
00008  *                                                                           *
00009  * Copyright (c) 2000-2005, Regents of the University of California          *
00010  *                          and Stanford University. All rights reserved.    *
00011  *                                                                           *
00012  * Redistribution and use in source and binary forms,                        *
00013  * with or without modification, are permitted according to the terms        *
00014  * listed in LICENSE (http://roofit.sourceforge.net/license.txt)             *
00015  *****************************************************************************/
00016 #ifndef ROO_REAL_MPFE
00017 #define ROO_REAL_MPFE
00018 
00019 #include "RooAbsReal.h"
00020 #include "RooRealProxy.h"
00021 #include "RooListProxy.h"
00022 #include "RooArgList.h"
00023 #include "RooMPSentinel.h"
00024 
00025 class RooArgSet ;
00026 
00027 class RooRealMPFE : public RooAbsReal {
00028 public:
00029   // Constructors, assignment etc
00030   RooRealMPFE(const char *name, const char *title, RooAbsReal& arg, Bool_t calcInline=kFALSE) ;
00031   RooRealMPFE(const RooRealMPFE& other, const char* name=0);
00032   virtual TObject* clone(const char* newname) const { return new RooRealMPFE(*this,newname); }
00033   virtual ~RooRealMPFE();
00034 
00035   void calculate() const ;
00036   virtual Double_t getVal(const RooArgSet* nset=0) const ;
00037   void standby() ;
00038 
00039   void setVerbose(Bool_t clientFlag=kTRUE, Bool_t serverFlag=kTRUE) ;
00040 
00041   protected:
00042 
00043   // Function evaluation
00044   virtual Double_t evaluate() const ;
00045   friend class RooAbsTestStatistic ;
00046   virtual void constOptimizeTestStatistic(ConstOpCode opcode) ;
00047 
00048   enum State { Initialize,Client,Server,Inline } ;
00049   State _state ;
00050 
00051   enum Message { SendReal=0, SendCat=1, Calculate=2, Retrieve=3, ReturnValue=4, Terminate=5, 
00052                  ConstOpt=6, Verbose=7, RetrieveErrors=8, SendError=9, LogEvalError=10 } ;
00053   
00054   void initialize() ; 
00055   void initVars() ;
00056   void serverLoop() ;
00057 
00058   RooRealProxy _arg ; // Function to calculate in parallel process
00059 
00060   RooListProxy _vars ;   // Variables
00061   RooArgList _saveVars ;  // Copy of variables
00062   mutable Bool_t _calcInProgress ;
00063   Bool_t _verboseClient ;
00064   Bool_t _verboseServer ;
00065   Bool_t _inlineMode ;
00066   mutable Bool_t _forceCalc ;
00067   mutable RooAbsReal::ErrorLoggingMode _remoteEvalErrorLoggingState ;
00068   Int_t  _pid ;            // PID of child process
00069 
00070   Int_t _pipeToClient[2] ; // Pipe to client process
00071   Int_t _pipeToServer[2] ; // Pipe to server process
00072 
00073   static RooMPSentinel _sentinel ;
00074 
00075   ClassDef(RooRealMPFE,1) // Multi-process front-end for parallel calculation of a real valued function 
00076 };
00077 
00078 #endif

Generated on Tue Jul 5 14:26:20 2011 for ROOT_528-00b_version by  doxygen 1.5.1