| BayesianCalculator.h | | BayesianCalculator.h | |
|
| // @(#)root/roostats:$Id: BayesianCalculator.h 33228 2010-04-27 07:09:42Z m
oneta $ | | // @(#)root/roostats:$Id: BayesianCalculator.h 34109 2010-06-24 15:00:16Z m
oneta $ | |
| // Author: Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke | | // Author: Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| #ifndef ROOSTATS_BayesianCalculator | | #ifndef ROOSTATS_BayesianCalculator | |
| #define ROOSTATS_BayesianCalculator | | #define ROOSTATS_BayesianCalculator | |
| | | | |
| #include "TNamed.h" | | #include "TNamed.h" | |
| | | | |
|
| | | #include "Math/IFunctionfwd.h" | |
| | | | |
| #ifndef ROO_ARG_SET | | #ifndef ROO_ARG_SET | |
| #include "RooArgSet.h" | | #include "RooArgSet.h" | |
| #endif | | #endif | |
| | | | |
| #ifndef ROOSTATS_IntervalCalculator | | #ifndef ROOSTATS_IntervalCalculator | |
| #include "RooStats/IntervalCalculator.h" | | #include "RooStats/IntervalCalculator.h" | |
| #endif | | #endif | |
| | | | |
| #ifndef ROOSTATS_SimpleInterval | | #ifndef ROOSTATS_SimpleInterval | |
| #include "RooStats/SimpleInterval.h" | | #include "RooStats/SimpleInterval.h" | |
| #endif | | #endif | |
| | | | |
| class RooAbsData; | | class RooAbsData; | |
| class RooAbsPdf; | | class RooAbsPdf; | |
| class RooPlot; | | class RooPlot; | |
| class RooAbsReal; | | class RooAbsReal; | |
|
| | | class TF1; | |
| | | | |
| namespace RooStats { | | namespace RooStats { | |
| | | | |
| class ModelConfig; | | class ModelConfig; | |
| class SimpleInterval; | | class SimpleInterval; | |
| | | | |
| class BayesianCalculator : public IntervalCalculator, public TNamed { | | class BayesianCalculator : public IntervalCalculator, public TNamed { | |
| | | | |
| public: | | public: | |
| | | | |
| | | | |
| skipping to change at line 57 | | skipping to change at line 60 | |
| const RooArgSet& POI, | | const RooArgSet& POI, | |
| RooAbsPdf& priorPOI, | | RooAbsPdf& priorPOI, | |
| const RooArgSet* nuisanceParameters = 0 ); | | const RooArgSet* nuisanceParameters = 0 ); | |
| | | | |
| BayesianCalculator( RooAbsData& data, | | BayesianCalculator( RooAbsData& data, | |
| ModelConfig& model ); | | ModelConfig& model ); | |
| | | | |
| // destructor | | // destructor | |
| virtual ~BayesianCalculator(); | | virtual ~BayesianCalculator(); | |
| | | | |
|
| RooPlot* GetPosteriorPlot() const; | | // get the plot with option to get it normalized | |
| | | RooPlot* GetPosteriorPlot(bool norm = false, double precision = 0.01) | |
| | | const; | |
| | | | |
| // return posterior pdf (object is managed by the BayesianCalculator
class) | | // return posterior pdf (object is managed by the BayesianCalculator
class) | |
| RooAbsPdf* GetPosteriorPdf() const; | | RooAbsPdf* GetPosteriorPdf() const; | |
|
| | | // return posterior function (object is managed by the BayesianCalcul | |
| | | ator class) | |
| | | RooAbsReal* GetPosteriorFunction() const; | |
| | | | |
|
| | | // compute the interval. By Default a central interval is computed | |
| | | // By using SetLeftTileFraction can control if central/ upper/lower i | |
| | | nterval | |
| | | // For shortest interval use SetShortestInterval(true) | |
| virtual SimpleInterval* GetInterval() const ; | | virtual SimpleInterval* GetInterval() const ; | |
| | | | |
| virtual void SetData( RooAbsData & data ) { | | virtual void SetData( RooAbsData & data ) { | |
| fData = &data; | | fData = &data; | |
| ClearAll(); | | ClearAll(); | |
| } | | } | |
| | | | |
|
| | | // set the model via the ModelConfig | |
| virtual void SetModel( const ModelConfig& model ); | | virtual void SetModel( const ModelConfig& model ); | |
| | | | |
| // set the size of the test (rate of Type I error) ( Eg. 0.05 for a 9
5% Confidence Interval) | | // set the size of the test (rate of Type I error) ( Eg. 0.05 for a 9
5% Confidence Interval) | |
| virtual void SetTestSize( Double_t size ) { | | virtual void SetTestSize( Double_t size ) { | |
| fSize = size; | | fSize = size; | |
| fValidInterval = false; | | fValidInterval = false; | |
| } | | } | |
| // set the confidence level for the interval (eg. 0.95 for a 95% Conf
idence Interval) | | // set the confidence level for the interval (eg. 0.95 for a 95% Conf
idence Interval) | |
| virtual void SetConfidenceLevel( Double_t cl ) { SetTestSize(1.-cl);
} | | virtual void SetConfidenceLevel( Double_t cl ) { SetTestSize(1.-cl);
} | |
| // Get the size of the test (eg. rate of Type I error) | | // Get the size of the test (eg. rate of Type I error) | |
| virtual Double_t Size() const { return fSize; } | | virtual Double_t Size() const { return fSize; } | |
| // Get the Confidence level for the test | | // Get the Confidence level for the test | |
| virtual Double_t ConfidenceLevel() const { return 1.-fSize; } | | virtual Double_t ConfidenceLevel() const { return 1.-fSize; } | |
| | | | |
|
| | | // set the fraction of probability content on the left tail | |
| | | // Central limits use 0.5 (default case) | |
| | | // for upper limits it is 0 and 1 for lower limit | |
| | | // For shortest intervals a negative value (i.e. -1) must be given | |
| | | void SetLeftSideTailFraction(Double_t leftSideFraction ) {fLeftSideF | |
| | | raction = leftSideFraction;} | |
| | | | |
| | | // set the Bayesian calculator to compute the shorest interval (defau | |
| | | lt is central interval) | |
| | | // to switch off SetLeftSideTailFraction to the rght value | |
| | | void SetShortestInterval() { fLeftSideFraction = -1; } | |
| | | | |
| | | // set the precision of the Root Finder | |
| | | void SetBrfPrecision( double precision ) { fBrfPrecision = precision; | |
| | | } | |
| | | | |
| | | // use directly the approximate posterior function obtained by binnin | |
| | | g it in nbins | |
| | | // by default the cdf is used by integrating the posterior | |
| | | // if a value of nbin <= 0 the cdf function will be used | |
| | | void SetScanOfPosterior(int nbin = 100) { fNScanBins = nbin; } | |
| | | | |
| | | // set the integration type (possible type are) | |
| | | // 1D: adaptive, gauss, nonadaptive | |
| | | // multidim: adaptive, vegas, miser, plain. These last 3 are based on | |
| | | MC integration | |
| | | void SetIntegrationType(const char * type); | |
| | | | |
| | | // return the mode (most probable value of the posterior function) | |
| | | double GetMode() const; | |
| | | | |
| protected: | | protected: | |
| | | | |
| void ClearAll() const; | | void ClearAll() const; | |
| | | | |
|
| | | void ApproximatePosterior() const; | |
| | | | |
| | | void ComputeIntervalFromApproxPosterior(double c1, double c2) const; | |
| | | | |
| | | void ComputeIntervalFromCdf(double c1, double c2) const; | |
| | | | |
| | | void ComputeIntervalUsingRooFit(double c1, double c2) const; | |
| | | | |
| | | void ComputeShortestInterval() const; | |
| | | | |
| private: | | private: | |
| | | | |
|
| // compute the most probable value: move to public once implemented | | | |
| // returns a RooArgSet | | | |
| RooArgSet* GetMode( RooArgSet* parameters ) const; | | | |
| // plan to replace the above: return a SimpleInterval integrating | | // plan to replace the above: return a SimpleInterval integrating | |
| // over all other parameters except the one specified as argument | | // over all other parameters except the one specified as argument | |
| //virtual SimpleInterval* GetInterval( RooRealVar* parameter ) const
{ return 0; } | | //virtual SimpleInterval* GetInterval( RooRealVar* parameter ) const
{ return 0; } | |
| | | | |
| RooAbsData* fData; | | RooAbsData* fData; | |
| RooAbsPdf* fPdf; | | RooAbsPdf* fPdf; | |
| RooArgSet fPOI; | | RooArgSet fPOI; | |
| RooAbsPdf* fPriorPOI; | | RooAbsPdf* fPriorPOI; | |
| RooArgSet fNuisanceParameters; | | RooArgSet fNuisanceParameters; | |
| | | | |
|
| mutable RooAbsPdf* fProductPdf; | | mutable RooAbsPdf* fProductPdf; // internal pointer to m | |
| mutable RooAbsReal* fLogLike; | | odel * prior | |
| mutable RooAbsReal* fLikelihood; | | mutable RooAbsReal* fLogLike; // internal pointer to l | |
| mutable RooAbsReal* fIntegratedLikelihood; | | og likelihood function | |
| mutable RooAbsPdf* fPosteriorPdf; | | mutable RooAbsReal* fLikelihood; // internal pointer to l | |
| mutable Double_t fLower; | | ikelihood function | |
| mutable Double_t fUpper; | | mutable RooAbsReal* fIntegratedLikelihood; // integrated likelihood | |
| | | function, i.e - unnormalized posterior function | |
| | | mutable RooAbsPdf* fPosteriorPdf; // normalized (on the p | |
| | | oi) posterior pdf | |
| | | mutable ROOT::Math::IGenFunction * fPosteriorFunction; // function | |
| | | representing the posterior | |
| | | mutable TF1 * fApproxPosterior; // TF1 representing the scanned po | |
| | | sterior function | |
| | | mutable Double_t fLower; // computer lower interval bound | |
| | | mutable Double_t fUpper; // upper interval bound | |
| | | double fSize; // size used for getting the interval | |
| | | double fLeftSideFraction; // fraction of probability content on le | |
| | | ft side of interval | |
| | | double fBrfPrecision; // root finder precision | |
| | | int fNScanBins; // number of bins to scan, if = -1 no scan | |
| | | is done (default) | |
| mutable Bool_t fValidInterval; | | mutable Bool_t fValidInterval; | |
| | | | |
|
| double fSize; // size used for getting the interval | | TString fIntegrationType; | |
| | | | |
| protected: | | protected: | |
| | | | |
| ClassDef(BayesianCalculator,1) // BayesianCalculator class | | ClassDef(BayesianCalculator,1) // BayesianCalculator class | |
| | | | |
| }; | | }; | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 12 change blocks. |
| 13 lines changed or deleted | | 79 lines changed or added | |
|
| DataSetFactory.h | | DataSetFactory.h | |
|
| // @(#)root/tmva $Id: DataSetFactory.h 31466 2009-11-30 16:23:35Z stelzer $ | | // @(#)root/tmva $Id: DataSetFactory.h 33928 2010-06-15 16:19:31Z stelzer $ | |
| // Author: Andreas Hoecker, Peter Speckmayer, Joerg Stelzer, Eckhard von To
erne, Helge Voss | | // Author: Andreas Hoecker, Peter Speckmayer, Joerg Stelzer, Eckhard von To
erne, Helge Voss | |
| | | | |
| /**************************************************************************
******** | | /**************************************************************************
******** | |
| * Project: TMVA - a Root-integrated toolkit for multivariate data analysis
* | | * Project: TMVA - a Root-integrated toolkit for multivariate data analysis
* | |
| * Package: TMVA
* | | * Package: TMVA
* | |
| * Class : DataSetFactory
* | | * Class : DataSetFactory
* | |
| * Web : http://tmva.sourceforge.net
* | | * Web : http://tmva.sourceforge.net
* | |
| *
* | | *
* | |
| * Description:
* | | * Description:
* | |
| * Contains all the data information
* | | * Contains all the data information
* | |
| | | | |
| skipping to change at line 29 | | skipping to change at line 29 | |
| *
* | | *
* | |
| * Copyright (c) 2006:
* | | * Copyright (c) 2006:
* | |
| * CERN, Switzerland
* | | * CERN, Switzerland
* | |
| * MPI-K Heidelberg, Germany
* | | * MPI-K Heidelberg, Germany
* | |
| *
* | | *
* | |
| * Redistribution and use in source and binary forms, with or without
* | | * Redistribution and use in source and binary forms, with or without
* | |
| * modification, are permitted according to the terms listed in LICENSE
* | | * modification, are permitted according to the terms listed in LICENSE
* | |
| * (http://tmva.sourceforge.net/LICENSE)
* | | * (http://tmva.sourceforge.net/LICENSE)
* | |
| **************************************************************************
********/ | | **************************************************************************
********/ | |
| | | | |
|
| #define ALTERNATIVE_EVENT_VECTOR_BUILDING 1 | | | |
| | | | |
| #ifndef ROOT_TMVA_DataSetFactory | | #ifndef ROOT_TMVA_DataSetFactory | |
| #define ROOT_TMVA_DataSetFactory | | #define ROOT_TMVA_DataSetFactory | |
| | | | |
| ////////////////////////////////////////////////////////////////////////// | | ////////////////////////////////////////////////////////////////////////// | |
| // // | | // // | |
| // DataSetFactory // | | // DataSetFactory // | |
| // // | | // // | |
| // Class that contains all the data information // | | // Class that contains all the data information // | |
| // // | | // // | |
| ////////////////////////////////////////////////////////////////////////// | | ////////////////////////////////////////////////////////////////////////// | |
| | | | |
| skipping to change at line 229 | | skipping to change at line 227 | |
| protected: | | protected: | |
| | | | |
| ~DataSetFactory(); | | ~DataSetFactory(); | |
| | | | |
| DataSetFactory(); | | DataSetFactory(); | |
| static DataSetFactory *fgInstance; | | static DataSetFactory *fgInstance; | |
| | | | |
| DataSet* BuildInitialDataSet( DataSetInfo&, TMVA::DataInputHandler&
); | | DataSet* BuildInitialDataSet( DataSetInfo&, TMVA::DataInputHandler&
); | |
| DataSet* BuildDynamicDataSet( DataSetInfo& ); | | DataSet* BuildDynamicDataSet( DataSetInfo& ); | |
| | | | |
|
| #ifndef ALTERNATIVE_EVENT_VECTOR_BUILDING | | | |
| | | | |
| void BuildEventVector ( DataSetInfo& dsi, | | | |
| DataInputHandler& dataInput, | | | |
| std::vector< std::vector< Event* > >& | | | |
| tmpEventVector, | | | |
| std::vector<Double_t>& sumOfWeights, | | | |
| std::vector<Double_t>& nTempEvents, | | | |
| std::vector<Double_t>& renormFactor, | | | |
| std::vector< std::vector< std::pair< L | | | |
| ong64_t, Types::ETreeType > > >& userDefinedEventTypes ); | | | |
| | | | |
| DataSet* MixEvents ( DataSetInfo& dsi, | | | |
| std::vector< std::vector< Event* > >& | | | |
| tmpEventVector, | | | |
| std::vector< std::pair< Int_t, Int_t > | | | |
| >& nTrainTestEvents, | | | |
| const TString& splitMode, UInt_t split | | | |
| Seed, | | | |
| std::vector<Double_t>& renormFactor, | | | |
| std::vector< std::vector< std::pair< L | | | |
| ong64_t, Types::ETreeType > > >& userDefinedEventTypes ); | | | |
| | | | |
| void InitOptions ( DataSetInfo& dsi, | | | |
| std::vector< std::pair< Int_t, Int_t > | | | |
| >& nTrainTestEvents, | | | |
| TString& normMode, UInt_t& splitSeed, | | | |
| TString& splitMode ); | | | |
| | | | |
| #else | | | |
| // ---------- new versions | | // ---------- new versions | |
| void BuildEventVector ( DataSetInfo& dsi, | | void BuildEventVector ( DataSetInfo& dsi, | |
| DataInputHandler& dataInput, | | DataInputHandler& dataInput, | |
| EventVectorOfClassesOfTreeType& tmpEv
entVector); | | EventVectorOfClassesOfTreeType& tmpEv
entVector); | |
| | | | |
| DataSet* MixEvents ( DataSetInfo& dsi, | | DataSet* MixEvents ( DataSetInfo& dsi, | |
| EventVectorOfClassesOfTreeType& tmpEv
entVector, | | EventVectorOfClassesOfTreeType& tmpEv
entVector, | |
| NumberPerClassOfTreeType& nTrainTestE
vents, | | NumberPerClassOfTreeType& nTrainTestE
vents, | |
| const TString& splitMode, | | const TString& splitMode, | |
| const TString& mixMode, | | const TString& mixMode, | |
| | | | |
| skipping to change at line 273 | | skipping to change at line 249 | |
| | | | |
| void RenormEvents ( DataSetInfo& dsi, | | void RenormEvents ( DataSetInfo& dsi, | |
| EventVectorOfClassesOfTreeType& tmpEv
entVector, | | EventVectorOfClassesOfTreeType& tmpEv
entVector, | |
| const TString& normMode ); | | const TString& normMode ); | |
| | | | |
| void InitOptions ( DataSetInfo& dsi, | | void InitOptions ( DataSetInfo& dsi, | |
| NumberPerClassOfTreeType& nTrainTestE
vents, | | NumberPerClassOfTreeType& nTrainTestE
vents, | |
| TString& normMode, UInt_t& splitSeed,
TString& splitMode, TString& mixMode ); | | TString& normMode, UInt_t& splitSeed,
TString& splitMode, TString& mixMode ); | |
| | | | |
| // ------------------------ | | // ------------------------ | |
|
| #endif | | | |
| | | | |
| // auxiliary functions to compute correlations | | // auxiliary functions to compute correlations | |
| TMatrixD* CalcCorrelationMatrix( DataSet*, const UInt_t classNumber )
; | | TMatrixD* CalcCorrelationMatrix( DataSet*, const UInt_t classNumber )
; | |
| TMatrixD* CalcCovarianceMatrix ( DataSet*, const UInt_t classNumber )
; | | TMatrixD* CalcCovarianceMatrix ( DataSet*, const UInt_t classNumber )
; | |
| void CalcMinMax ( DataSet*, DataSetInfo& dsi ); | | void CalcMinMax ( DataSet*, DataSetInfo& dsi ); | |
| | | | |
| // resets branch addresses to current event | | // resets branch addresses to current event | |
| void ResetBranchAndEventAddresses( TTree* ); | | void ResetBranchAndEventAddresses( TTree* ); | |
| void ResetCurrentTree() { fCurrentTree = 0; } | | void ResetCurrentTree() { fCurrentTree = 0; } | |
| void ChangeToNewTree( TreeInfo&, const DataSetInfo & ); | | void ChangeToNewTree( TreeInfo&, const DataSetInfo & ); | |
| | | | |
End of changes. 4 change blocks. |
| 34 lines changed or deleted | | 1 lines changed or added | |
|
| DataSetInfo.h | | DataSetInfo.h | |
|
| // // @(#)root/tmva $Id: DataSetInfo.h 31458 2009-11-30 13:58:20Z stelzer $ | | // // @(#)root/tmva $Id: DataSetInfo.h 33928 2010-06-15 16:19:31Z stelzer $ | |
| // Author: Andreas Hoecker, Joerg Stelzer, Helge Voss | | // Author: Andreas Hoecker, Peter Speckmayer, Joerg Stelzer, Helge Voss | |
| | | | |
| /**************************************************************************
******** | | /**************************************************************************
******** | |
| * Project: TMVA - a Root-integrated toolkit for multivariate data analysis
* | | * Project: TMVA - a Root-integrated toolkit for multivariate data analysis
* | |
| * Package: TMVA
* | | * Package: TMVA
* | |
| * Class : DataSetInfo
* | | * Class : DataSetInfo
* | |
| * Web : http://tmva.sourceforge.net
* | | * Web : http://tmva.sourceforge.net
* | |
| *
* | | *
* | |
| * Description:
* | | * Description:
* | |
| * Contains all the data information
* | | * Contains all the data information
* | |
| *
* | | *
* | |
| | | | |
| skipping to change at line 76 | | skipping to change at line 76 | |
| #include "TMVA/Event.h" | | #include "TMVA/Event.h" | |
| #endif | | #endif | |
| | | | |
| class TH2; | | class TH2; | |
| | | | |
| namespace TMVA { | | namespace TMVA { | |
| | | | |
| class DataSet; | | class DataSet; | |
| class VariableTransformBase; | | class VariableTransformBase; | |
| class MsgLogger; | | class MsgLogger; | |
|
| | | class DataSetManager; | |
| | | | |
| class DataSetInfo : public TObject { | | class DataSetInfo : public TObject { | |
| | | | |
| public: | | public: | |
| | | | |
| DataSetInfo(const TString& name = "Default"); | | DataSetInfo(const TString& name = "Default"); | |
| virtual ~DataSetInfo(); | | virtual ~DataSetInfo(); | |
| | | | |
| virtual const char* GetName() const { return fName.Data(); } | | virtual const char* GetName() const { return fName.Data(); } | |
| | | | |
| | | | |
| skipping to change at line 140 | | skipping to change at line 141 | |
| const TString& GetNormalization() const { return fN
ormalization; } | | const TString& GetNormalization() const { return fN
ormalization; } | |
| void SetNormalization( const TString& nor
m ) { fNormalization = norm; } | | void SetNormalization( const TString& nor
m ) { fNormalization = norm; } | |
| | | | |
| // classification information | | // classification information | |
| Int_t GetClassNameMaxLength() const; | | Int_t GetClassNameMaxLength() const; | |
| ClassInfo* GetClassInfo( Int_t clNum ) const; | | ClassInfo* GetClassInfo( Int_t clNum ) const; | |
| ClassInfo* GetClassInfo( const TString& name ) const; | | ClassInfo* GetClassInfo( const TString& name ) const; | |
| void PrintClasses() const; | | void PrintClasses() const; | |
| UInt_t GetNClasses() const { return fClasses.size(); } | | UInt_t GetNClasses() const { return fClasses.size(); } | |
| Bool_t IsSignal( const Event* ev ) const; | | Bool_t IsSignal( const Event* ev ) const; | |
|
| | | std::vector<Float_t>* GetTargetsForMulticlass( const Event* ev ); | |
| | | | |
| // by variable | | // by variable | |
| Int_t FindVarIndex( const TString& ) const; | | Int_t FindVarIndex( const TString& ) const; | |
| | | | |
| // weights | | // weights | |
| const TString GetWeightExpression(Int_t i) const { return G
etClassInfo(i)->GetWeight(); } | | const TString GetWeightExpression(Int_t i) const { return G
etClassInfo(i)->GetWeight(); } | |
| void SetWeightExpression( const TString& exp, const TSt
ring& className = "" ); | | void SetWeightExpression( const TString& exp, const TSt
ring& className = "" ); | |
| | | | |
| // cuts | | // cuts | |
| const TCut& GetCut (Int_t i) const { r
eturn GetClassInfo(i)->GetCut(); } | | const TCut& GetCut (Int_t i) const { r
eturn GetClassInfo(i)->GetCut(); } | |
| | | | |
| skipping to change at line 175 | | skipping to change at line 177 | |
| // options | | // options | |
| void SetSplitOptions(const TString& so) { fSplitOptions
= so; fNeedsRebuilding = kTRUE; } | | void SetSplitOptions(const TString& so) { fSplitOptions
= so; fNeedsRebuilding = kTRUE; } | |
| const TString& GetSplitOptions() const { return fSplitOptions; } | | const TString& GetSplitOptions() const { return fSplitOptions; } | |
| | | | |
| // root dir | | // root dir | |
| void SetRootDir(TDirectory* d) { fOwnRootDir = d; } | | void SetRootDir(TDirectory* d) { fOwnRootDir = d; } | |
| TDirectory* GetRootDir() const { return fOwnRootDir; } | | TDirectory* GetRootDir() const { return fOwnRootDir; } | |
| | | | |
| private: | | private: | |
| | | | |
|
| | | TMVA::DataSetManager* fDataSetManager; // DSMTEST | |
| | | void SetDataSetManager( DataSetManager* dsm ) { | |
| | | fDataSetManager = dsm; } // DSMTEST | |
| | | friend class DataSetManager; // DSMTEST (datasetmanager test) | |
| | | | |
| DataSetInfo( const DataSetInfo& ) : TObject() {} | | DataSetInfo( const DataSetInfo& ) : TObject() {} | |
| | | | |
| void PrintCorrelationMatrix( TTree* theTree ); | | void PrintCorrelationMatrix( TTree* theTree ); | |
| | | | |
| TString fName; //! name of the datase
t info object | | TString fName; //! name of the datase
t info object | |
| | | | |
| mutable DataSet* fDataSet; //! dataset, owned by
this datasetinfo object | | mutable DataSet* fDataSet; //! dataset, owned by
this datasetinfo object | |
| mutable Bool_t fNeedsRebuilding; //! flag if rebuilding
of dataset is needed (after change of cuts, vars, etc.) | | mutable Bool_t fNeedsRebuilding; //! flag if rebuilding
of dataset is needed (after change of cuts, vars, etc.) | |
| | | | |
| // expressions/formulas | | // expressions/formulas | |
| | | | |
| skipping to change at line 200 | | skipping to change at line 206 | |
| mutable std::vector<ClassInfo*> fClasses; //! name and other inf
os of the classes | | mutable std::vector<ClassInfo*> fClasses; //! name and other inf
os of the classes | |
| | | | |
| TString fNormalization; //! | | TString fNormalization; //! | |
| TString fSplitOptions; //! | | TString fSplitOptions; //! | |
| | | | |
| TDirectory* fOwnRootDir; //! ROOT output dir | | TDirectory* fOwnRootDir; //! ROOT output dir | |
| Bool_t fVerbose; //! Verbosity | | Bool_t fVerbose; //! Verbosity | |
| | | | |
| UInt_t fSignalClass; //! index of the class
with the name signal | | UInt_t fSignalClass; //! index of the class
with the name signal | |
| | | | |
|
| | | std::vector<Float_t>* fTargetsForMulticlass; //! all targe | |
| | | ts 0 except the one with index==classNumber | |
| | | | |
| mutable MsgLogger* fLogger; //! message logger | | mutable MsgLogger* fLogger; //! message logger | |
| MsgLogger& Log() const { return *fLogger; } | | MsgLogger& Log() const { return *fLogger; } | |
| | | | |
| }; | | }; | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 5 change blocks. |
| 2 lines changed or deleted | | 12 lines changed or added | |
|
| DataSetManager.h | | DataSetManager.h | |
|
| // @(#)root/tmva $Id: DataSetManager.h 29205 2009-06-24 19:33:19Z brun $ | | // @(#)root/tmva $Id: DataSetManager.h 33928 2010-06-15 16:19:31Z stelzer $ | |
| // Author: Andreas Hoecker, Joerg Stelzer, Helge Voss | | // Author: Andreas Hoecker, Peter Speckmayer, Joerg Stelzer, Helge Voss | |
| | | | |
| /**************************************************************************
******** | | /**************************************************************************
******** | |
| * Project: TMVA - a Root-integrated toolkit for multivariate data analysis
* | | * Project: TMVA - a Root-integrated toolkit for multivariate data analysis
* | |
| * Package: TMVA
* | | * Package: TMVA
* | |
| * Class : DataSetManager
* | | * Class : DataSetManager
* | |
| * Web : http://tmva.sourceforge.net
* | | * Web : http://tmva.sourceforge.net
* | |
| *
* | | *
* | |
| * Description:
* | | * Description:
* | |
| * Singleton class for dataset management
* | | * Singleton class for dataset management
* | |
| *
* | | *
* | |
| * Authors (alphabetical):
* | | * Authors (alphabetical):
* | |
| * Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland
* | | * Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland
* | |
| * Joerg Stelzer <Joerg.Stelzer@cern.ch> - CERN, Switzerland
* | | * Joerg Stelzer <Joerg.Stelzer@cern.ch> - CERN, Switzerland
* | |
|
| | | * Peter Speckmayer <Peter.Speckmayer@cern.ch> - CERN, Switzerland
* | |
| * Helge Voss <Helge.Voss@cern.ch> - MPI-K Heidelberg, German
y * | | * Helge Voss <Helge.Voss@cern.ch> - MPI-K Heidelberg, German
y * | |
| *
* | | *
* | |
| * Copyright (c) 2006:
* | | * Copyright (c) 2006:
* | |
| * CERN, Switzerland
* | | * CERN, Switzerland
* | |
| * MPI-K Heidelberg, Germany
* | | * MPI-K Heidelberg, Germany
* | |
| *
* | | *
* | |
| * Redistribution and use in source and binary forms, with or without
* | | * Redistribution and use in source and binary forms, with or without
* | |
| * modification, are permitted according to the terms listed in LICENSE
* | | * modification, are permitted according to the terms listed in LICENSE
* | |
| * (http://tmva.sourceforge.net/LICENSE)
* | | * (http://tmva.sourceforge.net/LICENSE)
* | |
| **************************************************************************
********/ | | **************************************************************************
********/ | |
| | | | |
| skipping to change at line 50 | | skipping to change at line 51 | |
| #endif | | #endif | |
| #ifndef ROOT_TString | | #ifndef ROOT_TString | |
| #include "TString.h" | | #include "TString.h" | |
| #endif | | #endif | |
| | | | |
| namespace TMVA { | | namespace TMVA { | |
| | | | |
| class DataSet; | | class DataSet; | |
| class DataSetInfo; | | class DataSetInfo; | |
| class DataInputHandler; | | class DataInputHandler; | |
|
| | | class DataSetFactory; // DSMTEST | |
| class MsgLogger; | | class MsgLogger; | |
| | | | |
| class DataSetManager { | | class DataSetManager { | |
| | | | |
| public: | | public: | |
| | | | |
| // singleton class | | // singleton class | |
|
| static DataSetManager& Instance(); | | // static DataSetManager& Instance(); | |
| static void CreateInstance( DataInputHandler& dataInput ); | | // static void CreateInstance( DataInputHandler& dataInput | |
| static void DestroyInstance(); | | ); | |
| | | // static void DestroyInstance(); | |
| | | | |
| | | // private default constructor | |
| | | DataSetManager(); // DSMTEST | |
| | | DataSetManager( DataInputHandler& dataInput ); //DSMTEST | |
| | | ~DataSetManager(); // DSMTEST | |
| | | | |
| // ownership stays with this handler | | // ownership stays with this handler | |
| DataSet* CreateDataSet ( const TString& dsiName ); | | DataSet* CreateDataSet ( const TString& dsiName ); | |
| DataSetInfo* GetDataSetInfo( const TString& dsiName ); | | DataSetInfo* GetDataSetInfo( const TString& dsiName ); | |
| | | | |
| // makes a local copy of the dataset info object | | // makes a local copy of the dataset info object | |
| DataSetInfo& AddDataSetInfo( DataSetInfo& dsi ); | | DataSetInfo& AddDataSetInfo( DataSetInfo& dsi ); | |
| | | | |
| private: | | private: | |
| | | | |
|
| ~DataSetManager(); | | // ~DataSetManager(); // DSMTEST moved to public | |
| | | | |
|
| static DataSetManager* fgDSManager; | | // static DataSetManager* fgDSManager; // removed DSMTEST | |
| | | | |
| // private default constructor | | // private default constructor | |
|
| DataSetManager(); | | /* DataSetManager(); */ // DSMTEST | |
| DataSetManager( DataInputHandler& dataInput ); | | /* DataSetManager( DataInputHandler& dataInput ); */ // DSMTEST | |
| | | | |
| | | // // TMVA::DataSetFactory* fDatasetFactory; // DSMTEST | |
| | | | |
| // access to input data | | // access to input data | |
| DataInputHandler& DataInput() { return fDataInput; } | | DataInputHandler& DataInput() { return fDataInput; } | |
| | | | |
| DataInputHandler& fDataInput; //! source of inpu
t data | | DataInputHandler& fDataInput; //! source of inpu
t data | |
| TList fDataSetInfoCollection; //! all registered
dataset definitions | | TList fDataSetInfoCollection; //! all registered
dataset definitions | |
| mutable MsgLogger* fLogger; // message logger | | mutable MsgLogger* fLogger; // message logger | |
| MsgLogger& Log() const { return *fLogger; } | | MsgLogger& Log() const { return *fLogger; } | |
| }; | | }; | |
| } | | } | |
| | | | |
End of changes. 7 change blocks. |
| 9 lines changed or deleted | | 19 lines changed or added | |
|
| DecisionTree.h | | DecisionTree.h | |
|
| // @(#)root/tmva $Id: DecisionTree.h 29122 2009-06-22 06:51:30Z brun $ | | // @(#)root/tmva $Id: DecisionTree.h 33928 2010-06-15 16:19:31Z stelzer $ | |
| // Author: Andreas Hoecker, Joerg Stelzer, Helge Voss, Kai Voss | | // Author: Andreas Hoecker, Joerg Stelzer, Helge Voss, Kai Voss | |
| | | | |
| /**************************************************************************
******** | | /**************************************************************************
******** | |
| * Project: TMVA - a Root-integrated toolkit for multivariate data analysis
* | | * Project: TMVA - a Root-integrated toolkit for multivariate data analysis
* | |
| * Package: TMVA
* | | * Package: TMVA
* | |
| * Class : DecisionTree
* | | * Class : DecisionTree
* | |
| * Web : http://tmva.sourceforge.net
* | | * Web : http://tmva.sourceforge.net
* | |
| *
* | | *
* | |
| * Description:
* | | * Description:
* | |
| * Implementation of a Decision Tree
* | | * Implementation of a Decision Tree
* | |
| | | | |
| skipping to change at line 85 | | skipping to change at line 85 | |
| public: | | public: | |
| | | | |
| typedef std::vector<TMVA::Event*> EventList; | | typedef std::vector<TMVA::Event*> EventList; | |
| | | | |
| // the constructur needed for the "reading" of the decision tree from
weight files | | // the constructur needed for the "reading" of the decision tree from
weight files | |
| DecisionTree( void ); | | DecisionTree( void ); | |
| | | | |
| // the constructur needed for constructing the decision tree via trai
ning with events | | // the constructur needed for constructing the decision tree via trai
ning with events | |
| DecisionTree( SeparationBase *sepType, Int_t minSize, | | DecisionTree( SeparationBase *sepType, Int_t minSize, | |
| Int_t nCuts, | | Int_t nCuts, | |
|
| | | UInt_t cls =0, | |
| Bool_t randomisedTree=kFALSE, Int_t useNvars=0, | | Bool_t randomisedTree=kFALSE, Int_t useNvars=0, | |
| UInt_t nNodesMax=999999, UInt_t nMaxDepth=9999999, | | UInt_t nNodesMax=999999, UInt_t nMaxDepth=9999999, | |
| Int_t iSeed=fgRandomSeed, Float_t purityLimit=0.5, | | Int_t iSeed=fgRandomSeed, Float_t purityLimit=0.5, | |
| Int_t treeID = 0); | | Int_t treeID = 0); | |
| | | | |
| // copy constructor | | // copy constructor | |
| DecisionTree (const DecisionTree &d); | | DecisionTree (const DecisionTree &d); | |
| | | | |
| virtual ~DecisionTree( void ); | | virtual ~DecisionTree( void ); | |
| | | | |
| virtual Node * CreateNode(UInt_t) const { return new DecisionTreeNode
(); } | | virtual Node * CreateNode(UInt_t) const { return new DecisionTreeNode
(); } | |
| virtual BinaryTree* CreateTree() const { return new DecisionTree(); } | | virtual BinaryTree* CreateTree() const { return new DecisionTree(); } | |
| virtual const char* ClassName() const { return "DecisionTree"; } | | virtual const char* ClassName() const { return "DecisionTree"; } | |
| | | | |
| // building of a tree by recursivly splitting the nodes | | // building of a tree by recursivly splitting the nodes | |
| | | | |
| UInt_t BuildTree( const EventList & eventSample, | | UInt_t BuildTree( const EventList & eventSample, | |
|
| DecisionTreeNode *node = NULL); | | DecisionTreeNode *node = NULL); | |
| // determine the way how a node is split (which variable, which cut v
alue) | | // determine the way how a node is split (which variable, which cut v
alue) | |
| | | | |
| Float_t TrainNode( const EventList & eventSample, DecisionTreeNode *
node ) { return TrainNodeFast( eventSample, node ); } | | Float_t TrainNode( const EventList & eventSample, DecisionTreeNode *
node ) { return TrainNodeFast( eventSample, node ); } | |
| Float_t TrainNodeFast( const EventList & eventSample, DecisionTreeNo
de *node ); | | Float_t TrainNodeFast( const EventList & eventSample, DecisionTreeNo
de *node ); | |
| Float_t TrainNodeFull( const EventList & eventSample, DecisionTreeNo
de *node ); | | Float_t TrainNodeFull( const EventList & eventSample, DecisionTreeNo
de *node ); | |
| | | | |
| // fill at tree with a given structure already (just see how many sig
na/bkgr | | // fill at tree with a given structure already (just see how many sig
na/bkgr | |
| // events end up in each node | | // events end up in each node | |
| | | | |
| void FillTree( EventList & eventSample); | | void FillTree( EventList & eventSample); | |
| | | | |
| skipping to change at line 221 | | skipping to change at line 222 | |
| | | | |
| Bool_t fRandomisedTree; // choose at each node splitting a random
set of variables | | Bool_t fRandomisedTree; // choose at each node splitting a random
set of variables | |
| Int_t fUseNvars; // the number of variables used in randomi
sed trees; | | Int_t fUseNvars; // the number of variables used in randomi
sed trees; | |
| | | | |
| TRandom3 *fMyTrandom; // random number generator for randomised
trees | | TRandom3 *fMyTrandom; // random number generator for randomised
trees | |
| | | | |
| std::vector< Double_t > fVariableImportance; // the relative importan
ce of the different variables | | std::vector< Double_t > fVariableImportance; // the relative importan
ce of the different variables | |
| | | | |
| UInt_t fNNodesMax; // max # of nodes | | UInt_t fNNodesMax; // max # of nodes | |
| UInt_t fMaxDepth; // max depth | | UInt_t fMaxDepth; // max depth | |
|
| | | UInt_t fClass; // class which is treated as signal when b
uilding the tree | |
| | | | |
| static const Int_t fgDebugLevel = 0; // debug level determining
some printout/control plots etc. | | static const Int_t fgDebugLevel = 0; // debug level determining
some printout/control plots etc. | |
| Int_t fTreeID; // just an ID number given to the tree.. ma
kes debugging easier as tree knows who he is. | | Int_t fTreeID; // just an ID number given to the tree.. ma
kes debugging easier as tree knows who he is. | |
| | | | |
| Types::EAnalysisType fAnalysisType; // kClassification(=0=false) o
r kRegression(=1=true) | | Types::EAnalysisType fAnalysisType; // kClassification(=0=false) o
r kRegression(=1=true) | |
| | | | |
| ClassDef(DecisionTree,0) // implementation of a Decisio
n Tree | | ClassDef(DecisionTree,0) // implementation of a Decisio
n Tree | |
| }; | | }; | |
| | | | |
| } // namespace TMVA | | } // namespace TMVA | |
| | | | |
End of changes. 4 change blocks. |
| 2 lines changed or deleted | | 4 lines changed or added | |
|
| DecisionTreeNode.h | | DecisionTreeNode.h | |
|
| // @(#)root/tmva $Id: DecisionTreeNode.h 31458 2009-11-30 13:58:20Z stelzer | | // @(#)root/tmva $Id: DecisionTreeNode.h 33928 2010-06-15 16:19:31Z stelzer | |
| $ | | $ | |
| // Author: Andreas Hoecker, Joerg Stelzer, Helge Voss, Kai Voss | | // Author: Andreas Hoecker, Joerg Stelzer, Helge Voss, Kai Voss, Eckhard vo | |
| | | n Toerne | |
| | | | |
| /**************************************************************************
******** | | /**************************************************************************
******** | |
| * Project: TMVA - a Root-integrated toolkit for multivariate data analysis
* | | * Project: TMVA - a Root-integrated toolkit for multivariate data analysis
* | |
| * Package: TMVA
* | | * Package: TMVA
* | |
| * Class : DecisionTreeNode
* | | * Class : DecisionTreeNode
* | |
| * Web : http://tmva.sourceforge.net
* | | * Web : http://tmva.sourceforge.net
* | |
| *
* | | *
* | |
| * Description:
* | | * Description:
* | |
| * Node for the Decision Tree
* | | * Node for the Decision Tree
* | |
| *
* | | *
* | |
| * Authors (alphabetical):
* | | * Authors (alphabetical):
* | |
| * Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland
* | | * Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland
* | |
| * Helge Voss <Helge.Voss@cern.ch> - MPI-K Heidelberg, German
y * | | * Helge Voss <Helge.Voss@cern.ch> - MPI-K Heidelberg, German
y * | |
| * Kai Voss <Kai.Voss@cern.ch> - U. of Victoria, Canada
* | | * Kai Voss <Kai.Voss@cern.ch> - U. of Victoria, Canada
* | |
|
| | | * Eckhard von Toerne <evt@physik.uni-bonn.de> - U. of Bonn, Germany
* | |
| *
* | | *
* | |
|
| * Copyright (c) 2005:
* | | * Copyright (c) 2009:
* | |
| * CERN, Switzerland
* | | * CERN, Switzerland
* | |
| * U. of Victoria, Canada
* | | * U. of Victoria, Canada
* | |
| * MPI-K Heidelberg, Germany
* | | * MPI-K Heidelberg, Germany
* | |
|
| | | * U. of Bonn, Germany
* | |
| *
* | | *
* | |
| * Redistribution and use in source and binary forms, with or without
* | | * Redistribution and use in source and binary forms, with or without
* | |
| * modification, are permitted according to the terms listed in LICENSE
* | | * modification, are permitted according to the terms listed in LICENSE
* | |
| * (http://tmva.sourceforge.net/LICENSE)
* | | * (http://tmva.sourceforge.net/LICENSE)
* | |
| **************************************************************************
********/ | | **************************************************************************
********/ | |
| | | | |
| #ifndef ROOT_TMVA_DecisionTreeNode | | #ifndef ROOT_TMVA_DecisionTreeNode | |
| #define ROOT_TMVA_DecisionTreeNode | | #define ROOT_TMVA_DecisionTreeNode | |
| | | | |
| ////////////////////////////////////////////////////////////////////////// | | ////////////////////////////////////////////////////////////////////////// | |
| | | | |
| skipping to change at line 51 | | skipping to change at line 53 | |
| #endif | | #endif | |
| | | | |
| #ifndef ROOT_TMVA_Version | | #ifndef ROOT_TMVA_Version | |
| #include "TMVA/Version.h" | | #include "TMVA/Version.h" | |
| #endif | | #endif | |
| | | | |
| #include <vector> | | #include <vector> | |
| #include <map> | | #include <map> | |
| namespace TMVA { | | namespace TMVA { | |
| | | | |
|
| | | class DTNodeTrainingInfo | |
| | | { | |
| | | public: | |
| | | DTNodeTrainingInfo():fSampleMin(), | |
| | | fSampleMax(), | |
| | | fNodeR(0),fSubTreeR(0),fAlpha(0),fG(0),fNTermina | |
| | | l(0), | |
| | | fNB(0),fNS(0),fSumTarget(0),fSumTarget2(0),fCC(0 | |
| | | ), | |
| | | fNSigEvents ( 0 ), fNBkgEvents ( 0 ), | |
| | | fNEvents ( -1 ), | |
| | | fNSigEvents_unweighted ( 0 ), | |
| | | fNBkgEvents_unweighted ( 0 ), | |
| | | fNEvents_unweighted ( 0 ), | |
| | | fSeparationIndex (-1 ), | |
| | | fSeparationGain ( -1 ) | |
| | | { | |
| | | } | |
| | | std::vector< Float_t > fSampleMin; // the minima for each ivar of th | |
| | | e sample on the node during training | |
| | | std::vector< Float_t > fSampleMax; // the maxima for each ivar of th | |
| | | e sample on the node during training | |
| | | Double_t fNodeR; // node resubstitution estimate, R(t) | |
| | | Double_t fSubTreeR; // R(T) = Sum(R(t) : t in ~T) | |
| | | Double_t fAlpha; // critical alpha for this node | |
| | | Double_t fG; // minimum alpha in subtree rooted at this | |
| | | node | |
| | | Int_t fNTerminal; // number of terminal nodes in subtree roo | |
| | | ted at this node | |
| | | Double_t fNB; // sum of weights of background events fro | |
| | | m the pruning sample in this node | |
| | | Double_t fNS; // ditto for the signal events | |
| | | Float_t fSumTarget; // sum of weight*target used for the calc | |
| | | ulatio of the variance (regression) | |
| | | Float_t fSumTarget2; // sum of weight*target^2 used for the cal | |
| | | culatio of the variance (regression) | |
| | | Double_t fCC; // debug variable for cost complexity pruning .. | |
| | | | |
| | | Float_t fNSigEvents; // sum of weights of signal event in the n | |
| | | ode | |
| | | Float_t fNBkgEvents; // sum of weights of backgr event in the n | |
| | | ode | |
| | | Float_t fNEvents; // number of events in that entered the no | |
| | | de (during training) | |
| | | Float_t fNSigEvents_unweighted; // sum of signal event in the n | |
| | | ode | |
| | | Float_t fNBkgEvents_unweighted; // sum of backgr event in the n | |
| | | ode | |
| | | Float_t fNEvents_unweighted; // number of events in that ent | |
| | | ered the node (during training) | |
| | | Float_t fSeparationIndex; // measure of "purity" (separation between | |
| | | S and B) AT this node | |
| | | Float_t fSeparationGain; // measure of "purity", separation, or inf | |
| | | ormation gained BY this nodes selection | |
| | | | |
| | | // copy constructor | |
| | | DTNodeTrainingInfo(const DTNodeTrainingInfo& n) : | |
| | | fSampleMin(),fSampleMax(), // Samplemin and max are reset in copy | |
| | | constructor | |
| | | fNodeR(n.fNodeR), fSubTreeR(n.fSubTreeR), | |
| | | fAlpha(n.fAlpha), fG(n.fG), | |
| | | fNTerminal(n.fNTerminal), | |
| | | fNB(n.fNB), fNS(n.fNS), | |
| | | fSumTarget(0),fSumTarget2(0), // SumTarget reset in copy construct | |
| | | or | |
| | | fCC(0), | |
| | | fNSigEvents ( n.fNSigEvents ), fNBkgEvents ( n.fNBkgEvents ), | |
| | | fNEvents ( n.fNEvents ), | |
| | | fNSigEvents_unweighted ( n.fNSigEvents_unweighted ), | |
| | | fNBkgEvents_unweighted ( n.fNBkgEvents_unweighted ), | |
| | | fNEvents_unweighted ( n.fNEvents_unweighted ), | |
| | | fSeparationIndex( n.fSeparationIndex ), | |
| | | fSeparationGain ( n.fSeparationGain ) | |
| | | { } | |
| | | }; | |
| | | | |
| class Event; | | class Event; | |
| class MsgLogger; | | class MsgLogger; | |
| | | | |
| class DecisionTreeNode: public Node { | | class DecisionTreeNode: public Node { | |
| | | | |
| public: | | public: | |
| | | | |
| // constructor of an essentially "empty" node floating in space | | // constructor of an essentially "empty" node floating in space | |
| DecisionTreeNode (); | | DecisionTreeNode (); | |
| // constructor of a daughter node as a daughter of 'p' | | // constructor of a daughter node as a daughter of 'p' | |
| | | | |
| skipping to change at line 112 | | skipping to change at line 171 | |
| //return the response of the node (for regression) | | //return the response of the node (for regression) | |
| Float_t GetResponse( void ) const { return fResponse;} | | Float_t GetResponse( void ) const { return fResponse;} | |
| | | | |
| //set the RMS of the response of the node (for regression) | | //set the RMS of the response of the node (for regression) | |
| void SetRMS( Float_t r ) { fRMS = r;} | | void SetRMS( Float_t r ) { fRMS = r;} | |
| | | | |
| //return the RMS of the response of the node (for regression) | | //return the RMS of the response of the node (for regression) | |
| Float_t GetRMS( void ) const { return fRMS;} | | Float_t GetRMS( void ) const { return fRMS;} | |
| | | | |
| // set the sum of the signal weights in the node | | // set the sum of the signal weights in the node | |
|
| void SetNSigEvents( Float_t s ) { fNSigEvents = s; } | | void SetNSigEvents( Float_t s ) { fTrainInfo->fNSigEvents = s; } | |
| | | | |
| // set the sum of the backgr weights in the node | | // set the sum of the backgr weights in the node | |
|
| void SetNBkgEvents( Float_t b ) { fNBkgEvents = b; } | | void SetNBkgEvents( Float_t b ) { fTrainInfo->fNBkgEvents = b; } | |
| | | | |
| // set the number of events that entered the node (during training) | | // set the number of events that entered the node (during training) | |
|
| void SetNEvents( Float_t nev ){ fNEvents =nev ; } | | void SetNEvents( Float_t nev ){ fTrainInfo->fNEvents =nev ; } | |
| | | | |
| // set the sum of the unweighted signal events in the node | | // set the sum of the unweighted signal events in the node | |
|
| void SetNSigEvents_unweighted( Float_t s ) { fNSigEvents_unweighted =
s; } | | void SetNSigEvents_unweighted( Float_t s ) { fTrainInfo->fNSigEvents_
unweighted = s; } | |
| | | | |
| // set the sum of the unweighted backgr events in the node | | // set the sum of the unweighted backgr events in the node | |
|
| void SetNBkgEvents_unweighted( Float_t b ) { fNBkgEvents_unweighted =
b; } | | void SetNBkgEvents_unweighted( Float_t b ) { fTrainInfo->fNBkgEvents_
unweighted = b; } | |
| | | | |
| // set the number of unweighted events that entered the node (during
training) | | // set the number of unweighted events that entered the node (during
training) | |
|
| void SetNEvents_unweighted( Float_t nev ){ fNEvents_unweighted =nev ;
} | | void SetNEvents_unweighted( Float_t nev ){ fTrainInfo->fNEvents_unwei
ghted =nev ; } | |
| | | | |
| // increment the sum of the signal weights in the node | | // increment the sum of the signal weights in the node | |
|
| void IncrementNSigEvents( Float_t s ) { fNSigEvents += s; } | | void IncrementNSigEvents( Float_t s ) { fTrainInfo->fNSigEvents += s;
} | |
| | | | |
| // increment the sum of the backgr weights in the node | | // increment the sum of the backgr weights in the node | |
|
| void IncrementNBkgEvents( Float_t b ) { fNBkgEvents += b; } | | void IncrementNBkgEvents( Float_t b ) { fTrainInfo->fNBkgEvents += b;
} | |
| | | | |
| // increment the number of events that entered the node (during train
ing) | | // increment the number of events that entered the node (during train
ing) | |
|
| void IncrementNEvents( Float_t nev ){ fNEvents +=nev ; } | | void IncrementNEvents( Float_t nev ){ fTrainInfo->fNEvents +=nev ; } | |
| | | | |
| // increment the sum of the signal weights in the node | | // increment the sum of the signal weights in the node | |
|
| void IncrementNSigEvents_unweighted( ) { fNSigEvents_unweighted += 1;
} | | void IncrementNSigEvents_unweighted( ) { fTrainInfo->fNSigEvents_unwe
ighted += 1; } | |
| | | | |
| // increment the sum of the backgr weights in the node | | // increment the sum of the backgr weights in the node | |
|
| void IncrementNBkgEvents_unweighted( ) { fNBkgEvents_unweighted += 1;
} | | void IncrementNBkgEvents_unweighted( ) { fTrainInfo->fNBkgEvents_unwe
ighted += 1; } | |
| | | | |
| // increment the number of events that entered the node (during train
ing) | | // increment the number of events that entered the node (during train
ing) | |
|
| void IncrementNEvents_unweighted( ){ fNEvents_unweighted +=1 ; } | | void IncrementNEvents_unweighted( ){ fTrainInfo->fNEvents_unweighted
+=1 ; } | |
| | | | |
| // return the sum of the signal weights in the node | | // return the sum of the signal weights in the node | |
|
| Float_t GetNSigEvents( void ) const { return fNSigEvents; } | | Float_t GetNSigEvents( void ) const { return fTrainInfo->fNSigEvents
; } | |
| | | | |
| // return the sum of the backgr weights in the node | | // return the sum of the backgr weights in the node | |
|
| Float_t GetNBkgEvents( void ) const { return fNBkgEvents; } | | Float_t GetNBkgEvents( void ) const { return fTrainInfo->fNBkgEvents
; } | |
| | | | |
| // return the number of events that entered the node (during trainin
g) | | // return the number of events that entered the node (during trainin
g) | |
|
| Float_t GetNEvents( void ) const { return fNEvents; } | | Float_t GetNEvents( void ) const { return fTrainInfo->fNEvents; } | |
| | | | |
| // return the sum of unweighted signal weights in the node | | // return the sum of unweighted signal weights in the node | |
|
| Float_t GetNSigEvents_unweighted( void ) const { return fNSigEvents_
unweighted; } | | Float_t GetNSigEvents_unweighted( void ) const { return fTrainInfo->
fNSigEvents_unweighted; } | |
| | | | |
| // return the sum of unweighted backgr weights in the node | | // return the sum of unweighted backgr weights in the node | |
|
| Float_t GetNBkgEvents_unweighted( void ) const { return fNBkgEvents_
unweighted; } | | Float_t GetNBkgEvents_unweighted( void ) const { return fTrainInfo->
fNBkgEvents_unweighted; } | |
| | | | |
| // return the number of unweighted events that entered the node (dur
ing training) | | // return the number of unweighted events that entered the node (dur
ing training) | |
|
| Float_t GetNEvents_unweighted( void ) const { return fNEvents_unweig
hted; } | | Float_t GetNEvents_unweighted( void ) const { return fTrainInfo->fNE
vents_unweighted; } | |
| | | | |
| // set the choosen index, measure of "purity" (separation between S a
nd B) AT this node | | // set the choosen index, measure of "purity" (separation between S a
nd B) AT this node | |
|
| void SetSeparationIndex( Float_t sep ){ fSeparationIndex =sep ; } | | void SetSeparationIndex( Float_t sep ){ fTrainInfo->fSeparationIndex
=sep ; } | |
| // return the separation index AT this node | | // return the separation index AT this node | |
|
| Float_t GetSeparationIndex( void ) const { return fSeparationIndex;
} | | Float_t GetSeparationIndex( void ) const { return fTrainInfo->fSepar
ationIndex; } | |
| | | | |
| // set the separation, or information gained BY this nodes selection | | // set the separation, or information gained BY this nodes selection | |
|
| void SetSeparationGain( Float_t sep ){ fSeparationGain =sep ; } | | void SetSeparationGain( Float_t sep ){ fTrainInfo->fSeparationGain =s
ep ; } | |
| // return the gain in separation obtained by this nodes selection | | // return the gain in separation obtained by this nodes selection | |
|
| Float_t GetSeparationGain( void ) const { return fSeparationGain; } | | Float_t GetSeparationGain( void ) const { return fTrainInfo->fSepara
tionGain; } | |
| | | | |
| // printout of the node | | // printout of the node | |
| virtual void Print( ostream& os ) const; | | virtual void Print( ostream& os ) const; | |
| | | | |
| // recursively print the node and its daughters (--> print the 'tree'
) | | // recursively print the node and its daughters (--> print the 'tree'
) | |
| virtual void PrintRec( ostream& os ) const; | | virtual void PrintRec( ostream& os ) const; | |
| | | | |
| virtual void AddAttributesToNode(void* node) const; | | virtual void AddAttributesToNode(void* node) const; | |
| virtual void AddContentToNode(std::stringstream& s) const; | | virtual void AddContentToNode(std::stringstream& s) const; | |
| | | | |
| | | | |
| skipping to change at line 200 | | skipping to change at line 259 | |
| inline DecisionTreeNode* GetMother( ) { return dynamic_cast<DecisionT
reeNode*>(GetParent()); } | | inline DecisionTreeNode* GetMother( ) { return dynamic_cast<DecisionT
reeNode*>(GetParent()); } | |
| inline const DecisionTreeNode* GetLeftDaughter( ) const { return dyna
mic_cast<DecisionTreeNode*>(GetLeft()); } | | inline const DecisionTreeNode* GetLeftDaughter( ) const { return dyna
mic_cast<DecisionTreeNode*>(GetLeft()); } | |
| inline const DecisionTreeNode* GetRightDaughter( ) const { return dyn
amic_cast<DecisionTreeNode*>(GetRight()); } | | inline const DecisionTreeNode* GetRightDaughter( ) const { return dyn
amic_cast<DecisionTreeNode*>(GetRight()); } | |
| inline const DecisionTreeNode* GetMother( ) const { return dynamic_ca
st<DecisionTreeNode*>(GetParent()); } | | inline const DecisionTreeNode* GetMother( ) const { return dynamic_ca
st<DecisionTreeNode*>(GetParent()); } | |
| | | | |
| ULong_t GetSequence() const {return fSequence;} | | ULong_t GetSequence() const {return fSequence;} | |
| | | | |
| void SetSequence(ULong_t s) {fSequence=s;} | | void SetSequence(ULong_t s) {fSequence=s;} | |
| | | | |
| // the node resubstitution estimate, R(t), for Cost Complexity prunin
g | | // the node resubstitution estimate, R(t), for Cost Complexity prunin
g | |
|
| inline void SetNodeR( Double_t r ) { fNodeR = r; } | | inline void SetNodeR( Double_t r ) { fTrainInfo->fNodeR = r; } | |
| inline Double_t GetNodeR( ) const { return fNodeR; } | | inline Double_t GetNodeR( ) const { return fTrainInfo->fNodeR; } | |
| | | | |
| // the resubstitution estimate, R(T_t), of the tree rooted at this no
de | | // the resubstitution estimate, R(T_t), of the tree rooted at this no
de | |
|
| inline void SetSubTreeR( Double_t r ) { fSubTreeR = r; } | | inline void SetSubTreeR( Double_t r ) { fTrainInfo->fSubTreeR = r; | |
| inline Double_t GetSubTreeR( ) const { return fSubTreeR; } | | } | |
| | | inline Double_t GetSubTreeR( ) const { return fTrainInfo->fSubTreeR; | |
| | | } | |
| | | | |
| // R(t) - R(T_t) | | // R(t) - R(T_t) | |
| // the critical point alpha = ------------- | | // the critical point alpha = ------------- | |
| // |~T_t| - 1 | | // |~T_t| - 1 | |
|
| inline void SetAlpha( Double_t alpha ) { fAlpha = alpha; } | | inline void SetAlpha( Double_t alpha ) { fTrainInfo->fAlpha = alpha; | |
| inline Double_t GetAlpha( ) const { return fAlpha; } | | } | |
| | | inline Double_t GetAlpha( ) const { return fTrainInfo->fAlpha; | |
| | | } | |
| | | | |
| // the minimum alpha in the tree rooted at this node | | // the minimum alpha in the tree rooted at this node | |
|
| inline void SetAlphaMinSubtree( Double_t g ) { fG = g; } | | inline void SetAlphaMinSubtree( Double_t g ) { fTrainInfo->fG = g; | |
| inline Double_t GetAlphaMinSubtree( ) const { return fG; } | | } | |
| | | inline Double_t GetAlphaMinSubtree( ) const { return fTrainInfo->fG; | |
| | | } | |
| | | | |
| // number of terminal nodes in the subtree rooted here | | // number of terminal nodes in the subtree rooted here | |
|
| inline void SetNTerminal( Int_t n ) { fNTerminal = n; } | | inline void SetNTerminal( Int_t n ) { fTrainInfo->fNTerminal = n; | |
| inline Int_t GetNTerminal( ) const { return fNTerminal; } | | } | |
| | | inline Int_t GetNTerminal( ) const { return fTrainInfo->fNTerminal; | |
| | | } | |
| | | | |
| // number of background/signal events from the pruning validation sam
ple | | // number of background/signal events from the pruning validation sam
ple | |
|
| inline void SetNBValidation( Double_t b ) { fNB = b; } | | inline void SetNBValidation( Double_t b ) { fTrainInfo->fNB = b; } | |
| inline void SetNSValidation( Double_t s ) { fNS = s; } | | inline void SetNSValidation( Double_t s ) { fTrainInfo->fNS = s; } | |
| inline Double_t GetNBValidation( ) const { return fNB; } | | inline Double_t GetNBValidation( ) const { return fTrainInfo->fNB; } | |
| inline Double_t GetNSValidation( ) const { return fNS; } | | inline Double_t GetNSValidation( ) const { return fTrainInfo->fNS; } | |
| | | | |
|
| inline void SetSumTarget(Float_t t) {fSumTarget = t; } | | inline void SetSumTarget(Float_t t) {fTrainInfo->fSumTarget = t; } | |
| inline void SetSumTarget2(Float_t t2){fSumTarget2 = t2; } | | inline void SetSumTarget2(Float_t t2){fTrainInfo->fSumTarget2 = t2; } | |
| | | | |
|
| inline void AddToSumTarget(Float_t t) {fSumTarget += t; } | | inline void AddToSumTarget(Float_t t) {fTrainInfo->fSumTarget += t; | |
| inline void AddToSumTarget2(Float_t t2){fSumTarget2 += t2; } | | } | |
| | | inline void AddToSumTarget2(Float_t t2){fTrainInfo->fSumTarget2 += t2 | |
| | | ; } | |
| | | | |
|
| inline Float_t GetSumTarget() const {return fSumTarget; } | | inline Float_t GetSumTarget() const {return fTrainInfo? fTrainInfo-> | |
| inline Float_t GetSumTarget2() const {return fSumTarget2; } | | fSumTarget : -9999;} | |
| | | inline Float_t GetSumTarget2() const {return fTrainInfo? fTrainInfo-> | |
| | | fSumTarget2: -9999;} | |
| | | | |
| // reset the pruning validation data | | // reset the pruning validation data | |
| void ResetValidationData( ); | | void ResetValidationData( ); | |
| | | | |
| // flag indicates whether this node is terminal | | // flag indicates whether this node is terminal | |
| inline Bool_t IsTerminal() const { return fIsTerminalNode;
} | | inline Bool_t IsTerminal() const { return fIsTerminalNode;
} | |
| inline void SetTerminal( Bool_t s = kTRUE ) { fIsTerminalNode = s;
} | | inline void SetTerminal( Bool_t s = kTRUE ) { fIsTerminalNode = s;
} | |
| void PrintPrune( ostream& os ) const ; | | void PrintPrune( ostream& os ) const ; | |
| void PrintRecPrune( ostream& os ) const; | | void PrintRecPrune( ostream& os ) const; | |
| | | | |
|
| void SetCC(Double_t cc) {fCC = cc;}; | | void SetCC(Double_t cc); | |
| Double_t GetCC() const {return fCC;}; | | Double_t GetCC() const {return (fTrainInfo? fTrainInfo->fCC : -1.);} | |
| | | | |
| Float_t GetSampleMin(UInt_t ivar) const; | | Float_t GetSampleMin(UInt_t ivar) const; | |
| Float_t GetSampleMax(UInt_t ivar) const; | | Float_t GetSampleMax(UInt_t ivar) const; | |
| void SetSampleMin(UInt_t ivar, Float_t xmin); | | void SetSampleMin(UInt_t ivar, Float_t xmin); | |
| void SetSampleMax(UInt_t ivar, Float_t xmax); | | void SetSampleMax(UInt_t ivar, Float_t xmax); | |
| | | | |
|
| | | static bool fgIsTraining; // static variable to flag training phase i | |
| | | n which we need fTrainInfo | |
| | | | |
| private: | | private: | |
| | | | |
| virtual void ReadAttributes(void* node, UInt_t tmva_Version_Code = TM
VA_VERSION_CODE ); | | virtual void ReadAttributes(void* node, UInt_t tmva_Version_Code = TM
VA_VERSION_CODE ); | |
| virtual Bool_t ReadDataRecord( istream& is, UInt_t tmva_Version_Code
= TMVA_VERSION_CODE ); | | virtual Bool_t ReadDataRecord( istream& is, UInt_t tmva_Version_Code
= TMVA_VERSION_CODE ); | |
| virtual void ReadContent(std::stringstream& s); | | virtual void ReadContent(std::stringstream& s); | |
| | | | |
|
| Double_t fNodeR; // node resubstitution estimate, R(t) | | | |
| Double_t fSubTreeR; // R(T) = Sum(R(t) : t in ~T) | | | |
| Double_t fAlpha; // critical alpha for this node | | | |
| Double_t fG; // minimum alpha in subtree rooted at this | | | |
| node | | | |
| Int_t fNTerminal; // number of terminal nodes in subtree roo | | | |
| ted at this node | | | |
| Double_t fNB; // sum of weights of background events fro | | | |
| m the pruning sample in this node | | | |
| Double_t fNS; // ditto for the signal events | | | |
| | | | |
| Float_t fSumTarget; // sum of weight*target used for the calc | | | |
| ulatio of the variance (regression) | | | |
| Float_t fSumTarget2; // sum of weight*target^2 used for the cal | | | |
| culatio of the variance (regression) | | | |
| | | | |
| Float_t fCutValue; // cut value appplied on this node to disc
riminate bkg against sig | | Float_t fCutValue; // cut value appplied on this node to disc
riminate bkg against sig | |
| Bool_t fCutType; // true: if event variable > cutValue ==>
signal , false otherwise | | Bool_t fCutType; // true: if event variable > cutValue ==>
signal , false otherwise | |
| Short_t fSelector; // index of variable used in node selectio
n (decision tree) | | Short_t fSelector; // index of variable used in node selectio
n (decision tree) | |
| | | | |
|
| Float_t fNSigEvents; // sum of weights of signal event in the n | | | |
| ode | | | |
| Float_t fNBkgEvents; // sum of weights of backgr event in the n | | | |
| ode | | | |
| Float_t fNEvents; // number of events in that entered the no | | | |
| de (during training) | | | |
| | | | |
| Float_t fNSigEvents_unweighted; // sum of signal event in the n | | | |
| ode | | | |
| Float_t fNBkgEvents_unweighted; // sum of backgr event in the n | | | |
| ode | | | |
| Float_t fNEvents_unweighted; // number of events in that ent | | | |
| ered the node (during training) | | | |
| | | | |
| Float_t fSeparationIndex; // measure of "purity" (separation between | | | |
| S and B) AT this node | | | |
| Float_t fSeparationGain; // measure of "purity", separation, or inf | | | |
| ormation gained BY this nodes selection | | | |
| Float_t fResponse; // response value in case of regression | | Float_t fResponse; // response value in case of regression | |
| Float_t fRMS; // response RMS of the regression node | | Float_t fRMS; // response RMS of the regression node | |
| Int_t fNodeType; // Type of node: -1 == Bkg-leaf, 1 == Sign
al-leaf, 0 = internal | | Int_t fNodeType; // Type of node: -1 == Bkg-leaf, 1 == Sign
al-leaf, 0 = internal | |
| | | | |
| ULong_t fSequence; // bit coded left right sequence to reach
the node | | ULong_t fSequence; // bit coded left right sequence to reach
the node | |
| | | | |
| Bool_t fIsTerminalNode; //! flag to set node as terminal (i.e.,
without deleting its descendants) | | Bool_t fIsTerminalNode; //! flag to set node as terminal (i.e.,
without deleting its descendants) | |
| | | | |
|
| Double_t fCC; // debug variable for cost complexity prui | | | |
| ng .. temporary bla | | | |
| | | | |
| std::vector< Float_t > fSampleMin; // the minima for each ivar of th | | | |
| e sample on the node during training | | | |
| std::vector< Float_t > fSampleMax; // the maxima for each ivar of th | | | |
| e sample on the node during training | | | |
| | | | |
| static MsgLogger* fgLogger; // static because there is a huge numb
er of nodes... | | static MsgLogger* fgLogger; // static because there is a huge numb
er of nodes... | |
|
| | | mutable DTNodeTrainingInfo* fTrainInfo; | |
| | | | |
| ClassDef(DecisionTreeNode,0) // Node for the Decision Tree | | ClassDef(DecisionTreeNode,0) // Node for the Decision Tree | |
| | | | |
| }; | | }; | |
| } // namespace TMVA | | } // namespace TMVA | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 42 change blocks. |
| 90 lines changed or deleted | | 143 lines changed or added | |
|
| Event.h | | Event.h | |
|
| // @(#)root/tmva $Id: Event.h 31800 2009-12-10 15:04:44Z stelzer $ | | // @(#)root/tmva $Id: Event.h 33928 2010-06-15 16:19:31Z stelzer $ | |
| // Author: Andreas Hoecker, Joerg Stelzer, Helge Voss | | // Author: Andreas Hoecker, Peter Speckmayer, Joerg Stelzer, Helge Voss | |
| | | | |
| /**************************************************************************
******** | | /**************************************************************************
******** | |
| * Project: TMVA - a Root-integrated toolkit for multivariate data analysis
* | | * Project: TMVA - a Root-integrated toolkit for multivariate data analysis
* | |
| * Package: TMVA
* | | * Package: TMVA
* | |
| * Class : Event
* | | * Class : Event
* | |
| * Web : http://tmva.sourceforge.net
* | | * Web : http://tmva.sourceforge.net
* | |
| *
* | | *
* | |
| * Description:
* | | * Description:
* | |
| * Event container
* | | * Event container
* | |
| *
* | | *
* | |
| * Authors (alphabetical):
* | | * Authors (alphabetical):
* | |
| * Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland
* | | * Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland
* | |
| * Joerg Stelzer <Joerg.Stelzer@cern.ch> - CERN, Switzerland
* | | * Joerg Stelzer <Joerg.Stelzer@cern.ch> - CERN, Switzerland
* | |
|
| | | * Peter Speckmayer <Peter.Speckmayer@cern.ch> - CERN, Switzerland
* | |
| * Helge Voss <Helge.Voss@cern.ch> - MPI-K Heidelberg, German
y * | | * Helge Voss <Helge.Voss@cern.ch> - MPI-K Heidelberg, German
y * | |
| *
* | | *
* | |
| * Copyright (c) 2005:
* | | * Copyright (c) 2005:
* | |
| * CERN, Switzerland
* | | * CERN, Switzerland
* | |
| * U. of Victoria, Canada
* | | * U. of Victoria, Canada
* | |
| * MPI-K Heidelberg, Germany
* | | * MPI-K Heidelberg, Germany
* | |
| * LAPP, Annecy, France
* | | * LAPP, Annecy, France
* | |
| *
* | | *
* | |
| * Redistribution and use in source and binary forms, with or without
* | | * Redistribution and use in source and binary forms, with or without
* | |
| * modification, are permitted according to the terms listed in LICENSE
* | | * modification, are permitted according to the terms listed in LICENSE
* | |
| | | | |
| skipping to change at line 73 | | skipping to change at line 74 | |
| explicit Event( const std::vector<Float_t>& values, | | explicit Event( const std::vector<Float_t>& values, | |
| const std::vector<Float_t>& targetValues, | | const std::vector<Float_t>& targetValues, | |
| UInt_t theClass = 0, Float_t weight = 1.0, Float_t bo
ostweight = 1.0 ); | | UInt_t theClass = 0, Float_t weight = 1.0, Float_t bo
ostweight = 1.0 ); | |
| explicit Event( const std::vector<Float_t>&, | | explicit Event( const std::vector<Float_t>&, | |
| UInt_t theClass, Float_t weight = 1.0, Float_t boostw
eight = 1.0 ); | | UInt_t theClass, Float_t weight = 1.0, Float_t boostw
eight = 1.0 ); | |
| explicit Event( const std::vector<Float_t*>*&, UInt_t nvar ); | | explicit Event( const std::vector<Float_t*>*&, UInt_t nvar ); | |
| | | | |
| ~Event(); | | ~Event(); | |
| | | | |
| // accessors | | // accessors | |
|
| Bool_t IsSignal() const { return (fClass==fSignalClass); }
// deprecated: use <DataSetInfo>.IsSignal( Event* ) | | | |
| Bool_t IsDynamic() const {return fDynamic; } | | Bool_t IsDynamic() const {return fDynamic; } | |
| | | | |
| Float_t GetWeight() const { return fWeight*fBoostWeight; } | | Float_t GetWeight() const { return fWeight*fBoostWeight; } | |
| Float_t GetOriginalWeight() const { return fWeight; } | | Float_t GetOriginalWeight() const { return fWeight; } | |
| Float_t GetBoostWeight() const { return TMath::Max(Float_t(0.0001)
,fBoostWeight); } | | Float_t GetBoostWeight() const { return TMath::Max(Float_t(0.0001)
,fBoostWeight); } | |
| UInt_t GetClass() const { return fClass; } | | UInt_t GetClass() const { return fClass; } | |
|
| Int_t GetSignalClass() const { return fSignalClass; } // interme
diate solution to keep IsSignal() of Event working | | | |
| | | | |
| UInt_t GetNVariables() const; | | UInt_t GetNVariables() const; | |
| UInt_t GetNTargets() const; | | UInt_t GetNTargets() const; | |
| UInt_t GetNSpectators() const; | | UInt_t GetNSpectators() const; | |
| | | | |
| const std::vector<UInt_t>* GetVariableArrangement() const { return fV
ariableArrangement; } | | const std::vector<UInt_t>* GetVariableArrangement() const { return fV
ariableArrangement; } | |
| | | | |
| Float_t GetValue( UInt_t ivar) const; | | Float_t GetValue( UInt_t ivar) const; | |
| const std::vector<Float_t>& GetValues() const; | | const std::vector<Float_t>& GetValues() const; | |
| | | | |
| | | | |
| skipping to change at line 104 | | skipping to change at line 103 | |
| Float_t GetSpectator( UInt_t ivar) const; | | Float_t GetSpectator( UInt_t ivar) const; | |
| std::vector<Float_t>& GetSpectators() const { return fSpectators; } | | std::vector<Float_t>& GetSpectators() const { return fSpectators; } | |
| | | | |
| void ScaleWeight ( Float_t s ) { fWeight*=s; } | | void ScaleWeight ( Float_t s ) { fWeight*=s; } | |
| void SetWeight ( Float_t w ) { fWeight=w; } | | void SetWeight ( Float_t w ) { fWeight=w; } | |
| void SetBoostWeight ( Float_t w ) { fBoostWeight=w; } | | void SetBoostWeight ( Float_t w ) { fBoostWeight=w; } | |
| void ScaleBoostWeight ( Float_t s ) { fBoostWeight *= s; } | | void ScaleBoostWeight ( Float_t s ) { fBoostWeight *= s; } | |
| void SetClass ( UInt_t t ) { fClass=t; } | | void SetClass ( UInt_t t ) { fClass=t; } | |
| void SetVal ( UInt_t ivar, Float_t val ); | | void SetVal ( UInt_t ivar, Float_t val ); | |
| void SetTarget ( UInt_t itgt, Float_t value ); | | void SetTarget ( UInt_t itgt, Float_t value ); | |
|
| void SetSignalClass ( UInt_t cls ){ fSignalClass = cls; } /
/ intermediate solution to keep IsSignal() of Event working. TODO: remove I
sSignal() from Event | | | |
| void SetSpectator ( UInt_t ivar, Float_t value ); | | void SetSpectator ( UInt_t ivar, Float_t value ); | |
| void SetVariableArrangement( std::vector<UInt_t>* const m ) const; | | void SetVariableArrangement( std::vector<UInt_t>* const m ) const; | |
| | | | |
| static void ClearDynamicVariables(); | | static void ClearDynamicVariables(); | |
| | | | |
| void CopyVarValues( const Event& other ); | | void CopyVarValues( const Event& other ); | |
| void Print ( std::ostream & o ) const; | | void Print ( std::ostream & o ) const; | |
| | | | |
| private: | | private: | |
| | | | |
| mutable std::vector<Float_t> fValues; // the event va
lues | | mutable std::vector<Float_t> fValues; // the event va
lues | |
| static std::vector<Float_t*>* fgValuesDynamic; // the event va
lues | | static std::vector<Float_t*>* fgValuesDynamic; // the event va
lues | |
| mutable std::vector<Float_t> fTargets; // target value
s for regression | | mutable std::vector<Float_t> fTargets; // target value
s for regression | |
| mutable std::vector<Float_t> fSpectators; // "visisting"
variables which are never used for any calculation | | mutable std::vector<Float_t> fSpectators; // "visisting"
variables which are never used for any calculation | |
| mutable std::vector<UInt_t>* fVariableArrangement; // needed for M
ethodCategories, where we can train on other than the main variables | | mutable std::vector<UInt_t>* fVariableArrangement; // needed for M
ethodCategories, where we can train on other than the main variables | |
| | | | |
| UInt_t fClass; // signal or backgro
und type: signal=1, background=0 | | UInt_t fClass; // signal or backgro
und type: signal=1, background=0 | |
| Float_t fWeight; // event weight (pro
duct of global and individual weights) | | Float_t fWeight; // event weight (pro
duct of global and individual weights) | |
| Float_t fBoostWeight; // internal weight t
o be set by boosting algorithm | | Float_t fBoostWeight; // internal weight t
o be set by boosting algorithm | |
| Bool_t fDynamic; // is set when the d
ynamic values are taken | | Bool_t fDynamic; // is set when the d
ynamic values are taken | |
|
| UInt_t fSignalClass; // intermediate solu
tion to keep IsSignal() of Event working. TODO: remove IsSignal() from Even
t | | | |
| | | | |
| static Int_t fgCount; // count instances o
f Event | | static Int_t fgCount; // count instances o
f Event | |
| }; | | }; | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 6 change blocks. |
| 6 lines changed or deleted | | 3 lines changed or added | |
|
| FeldmanCousins.h | | FeldmanCousins.h | |
|
| // @(#)root/roostats:$Id: FeldmanCousins.h 31276 2009-11-18 15:06:42Z monet
a $ | | // @(#)root/roostats:$Id: FeldmanCousins.h 34109 2010-06-24 15:00:16Z monet
a $ | |
| // Author: Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke | | // Author: Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| #ifndef ROOSTATS_FeldmanCousins | | #ifndef ROOSTATS_FeldmanCousins | |
| | | | |
| skipping to change at line 23 | | skipping to change at line 23 | |
| | | | |
| #ifndef ROOT_Rtypes | | #ifndef ROOT_Rtypes | |
| #include "Rtypes.h" | | #include "Rtypes.h" | |
| #endif | | #endif | |
| | | | |
| #ifndef ROOSTATS_IntervalCalculator | | #ifndef ROOSTATS_IntervalCalculator | |
| #include "RooStats/IntervalCalculator.h" | | #include "RooStats/IntervalCalculator.h" | |
| #endif | | #endif | |
| | | | |
| #include "RooStats/ToyMCSampler.h" | | #include "RooStats/ToyMCSampler.h" | |
|
| | | //#include "RooStats/ToyMCSampler2.h" | |
| #include "RooStats/ConfidenceBelt.h" | | #include "RooStats/ConfidenceBelt.h" | |
| | | | |
| #include "RooAbsData.h" | | #include "RooAbsData.h" | |
| #include "RooAbsPdf.h" | | #include "RooAbsPdf.h" | |
| #include "RooArgSet.h" | | #include "RooArgSet.h" | |
| #include "TList.h" | | #include "TList.h" | |
| | | | |
| class RooAbsData; | | class RooAbsData; | |
| | | | |
| namespace RooStats { | | namespace RooStats { | |
| | | | |
| class ConfInterval; | | class ConfInterval; | |
| | | | |
|
| class FeldmanCousins : public IntervalCalculator, public TNamed { | | class FeldmanCousins : public IntervalCalculator { | |
| | | | |
| public: | | public: | |
| | | | |
|
| FeldmanCousins(); | | // FeldmanCousins(); | |
| | | | |
| | | // Common constructor | |
| | | FeldmanCousins(RooAbsData& data, ModelConfig& model); | |
| | | | |
| virtual ~FeldmanCousins(); | | virtual ~FeldmanCousins(); | |
| | | | |
| // Main interface to get a ConfInterval (will be a PointSetInterval) | | // Main interface to get a ConfInterval (will be a PointSetInterval) | |
| virtual ConfInterval* GetInterval() const; | | virtual ConfInterval* GetInterval() const; | |
| | | | |
| // Get the size of the test (eg. rate of Type I error) | | // Get the size of the test (eg. rate of Type I error) | |
| virtual Double_t Size() const {return fSize;} | | virtual Double_t Size() const {return fSize;} | |
| // Get the Confidence level for the test | | // Get the Confidence level for the test | |
| virtual Double_t ConfidenceLevel() const {return 1.-fSize;} | | virtual Double_t ConfidenceLevel() const {return 1.-fSize;} | |
| // Set the DataSet | | // Set the DataSet | |
|
| virtual void SetData(RooAbsData& data) { fData = &data; } | | virtual void SetData(RooAbsData& /*data*/) { | |
| | | cout << "DEPRECATED, set data in constructor" << endl; | |
| | | } | |
| // Set the Pdf | | // Set the Pdf | |
|
| virtual void SetPdf(RooAbsPdf& pdf) { fPdf = &pdf; } | | virtual void SetPdf(RooAbsPdf& /*pdf*/) { | |
| | | cout << "DEPRECATED, use ModelConfig" << endl; | |
| | | } | |
| | | | |
| // specify the parameters of interest in the interval | | // specify the parameters of interest in the interval | |
|
| virtual void SetParameters(const RooArgSet& set) { fPOI.removeAll(); | | virtual void SetParameters(const RooArgSet& /*set*/) { | |
| fPOI.add(set); } | | cout << "DEPRECATED, use ModelConfig" << endl; | |
| | | } | |
| | | | |
| // specify the nuisance parameters (eg. the rest of the parameters) | | // specify the nuisance parameters (eg. the rest of the parameters) | |
|
| virtual void SetNuisanceParameters(const RooArgSet& set) {fNuisParams | | virtual void SetNuisanceParameters(const RooArgSet& /*set*/) { | |
| .removeAll(); fNuisParams.add(set);} | | cout << "DEPRECATED, use ModelConfig" << endl; | |
| | | } | |
| | | | |
| // set the size of the test (rate of Type I error) ( Eg. 0.05 for a 9
5% Confidence Interval) | | // set the size of the test (rate of Type I error) ( Eg. 0.05 for a 9
5% Confidence Interval) | |
| virtual void SetTestSize(Double_t size) {fSize = size;} | | virtual void SetTestSize(Double_t size) {fSize = size;} | |
| // set the confidence level for the interval (eg. 0.95 for a 95% Conf
idence Interval) | | // set the confidence level for the interval (eg. 0.95 for a 95% Conf
idence Interval) | |
| virtual void SetConfidenceLevel(Double_t cl) {fSize = 1.-cl;} | | virtual void SetConfidenceLevel(Double_t cl) {fSize = 1.-cl;} | |
| | | | |
| virtual void SetModel(const ModelConfig &); | | virtual void SetModel(const ModelConfig &); | |
| | | | |
| RooAbsData* GetPointsToScan() { | | RooAbsData* GetPointsToScan() { | |
| if(!fPointsToTest) CreateParameterPoints(); | | if(!fPointsToTest) CreateParameterPoints(); | |
| return fPointsToTest; | | return fPointsToTest; | |
| } | | } | |
| | | | |
| ConfidenceBelt* GetConfidenceBelt() {return fConfBelt;} | | ConfidenceBelt* GetConfidenceBelt() {return fConfBelt;} | |
| | | | |
| void UseAdaptiveSampling(bool flag=true){fAdaptiveSampling=flag;} | | void UseAdaptiveSampling(bool flag=true){fAdaptiveSampling=flag;} | |
| | | | |
|
| | | void AdditionalNToysFactor(double fact){fAdditionalNToysFactor = fact | |
| | | ;} | |
| | | | |
| void SetNBins(Int_t bins) {fNbins = bins;} | | void SetNBins(Int_t bins) {fNbins = bins;} | |
| | | | |
| void FluctuateNumDataEntries(bool flag=true){fFluctuateData = flag;} | | void FluctuateNumDataEntries(bool flag=true){fFluctuateData = flag;} | |
| | | | |
| void SaveBeltToFile(bool flag=true){ | | void SaveBeltToFile(bool flag=true){ | |
| fSaveBeltToFile = flag; | | fSaveBeltToFile = flag; | |
| if(flag) fCreateBelt = true; | | if(flag) fCreateBelt = true; | |
| } | | } | |
| void CreateConfBelt(bool flag=true){fCreateBelt = flag;} | | void CreateConfBelt(bool flag=true){fCreateBelt = flag;} | |
| | | | |
| private: | | private: | |
| | | | |
| // initializes fPointsToTest data member (mutable) | | // initializes fPointsToTest data member (mutable) | |
| void CreateParameterPoints() const; | | void CreateParameterPoints() const; | |
| | | | |
| // initializes fTestStatSampler data member (mutable) | | // initializes fTestStatSampler data member (mutable) | |
| void CreateTestStatSampler() const; | | void CreateTestStatSampler() const; | |
| | | | |
| Double_t fSize; // size of the test (eg. specified rate of Type I err
or) | | Double_t fSize; // size of the test (eg. specified rate of Type I err
or) | |
|
| | | ModelConfig &fModel; | |
| | | RooAbsData & fData; // data set | |
| | | | |
| | | /* | |
| RooAbsPdf * fPdf; // common PDF | | RooAbsPdf * fPdf; // common PDF | |
|
| RooAbsData * fData; // data set | | | |
| RooArgSet fPOI; // RooArgSet specifying parameters of interest for i
nterval | | RooArgSet fPOI; // RooArgSet specifying parameters of interest for i
nterval | |
| RooArgSet fNuisParams;// RooArgSet specifying nuisance parameters fo
r interval | | RooArgSet fNuisParams;// RooArgSet specifying nuisance parameters fo
r interval | |
|
| | | RooArgSet fObservables;// RooArgSet specifying nuisance parameters f | |
| | | or interval | |
| | | */ | |
| | | | |
| mutable ToyMCSampler* fTestStatSampler; // the test statistic sampler | | mutable ToyMCSampler* fTestStatSampler; // the test statistic sampler | |
| mutable RooAbsData* fPointsToTest; // points to perform the construct
ion | | mutable RooAbsData* fPointsToTest; // points to perform the construct
ion | |
| mutable ConfidenceBelt* fConfBelt; | | mutable ConfidenceBelt* fConfBelt; | |
|
| bool fAdaptiveSampling; // controls use of adaptive sampling algorith | | Bool_t fAdaptiveSampling; // controls use of adaptive sampling algori | |
| m | | thm | |
| | | Double_t fAdditionalNToysFactor; // give user ability to ask for more | |
| | | toys | |
| Int_t fNbins; // number of samples per variable | | Int_t fNbins; // number of samples per variable | |
| Bool_t fFluctuateData; // tell ToyMCSampler to fluctuate number of e
ntries in dataset | | Bool_t fFluctuateData; // tell ToyMCSampler to fluctuate number of e
ntries in dataset | |
| Bool_t fDoProfileConstruction; // instead of full construction over n
uisance parametrs, do profile | | Bool_t fDoProfileConstruction; // instead of full construction over n
uisance parametrs, do profile | |
|
| bool fSaveBeltToFile; // controls use if ConfidenceBelt should be sav | | Bool_t fSaveBeltToFile; // controls use if ConfidenceBelt should be s | |
| ed to a TFile | | aved to a TFile | |
| bool fCreateBelt; // controls use if ConfidenceBelt should be saved t | | Bool_t fCreateBelt; // controls use if ConfidenceBelt should be saved | |
| o a TFile | | to a TFile | |
| | | | |
| protected: | | protected: | |
| ClassDef(FeldmanCousins,1) // Interface for tools setting limits (p
roducing confidence intervals) | | ClassDef(FeldmanCousins,1) // Interface for tools setting limits (p
roducing confidence intervals) | |
| }; | | }; | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 14 change blocks. |
| 16 lines changed or deleted | | 38 lines changed or added | |
|
| FitResult.h | | FitResult.h | |
|
| // @(#)root/mathcore:$Id: FitResult.h 31604 2009-12-07 19:04:33Z moneta $ | | // @(#)root/mathcore:$Id: FitResult.h 33587 2010-05-20 07:27:00Z moneta $ | |
| // Author: L. Moneta Wed Aug 30 11:05:34 2006 | | // Author: L. Moneta Wed Aug 30 11:05:34 2006 | |
| | | | |
| /********************************************************************** | | /********************************************************************** | |
| * * | | * * | |
| * Copyright (c) 2006 LCG ROOT Math Team, CERN/PH-SFT * | | * Copyright (c) 2006 LCG ROOT Math Team, CERN/PH-SFT * | |
| * * | | * * | |
| * * | | * * | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| // Header file for class FitResult | | // Header file for class FitResult | |
| | | | |
| skipping to change at line 154 | | skipping to change at line 154 | |
| /// parameter errors (return const pointer) | | /// parameter errors (return const pointer) | |
| const double * GetErrors() const { return &fErrors.front(); } | | const double * GetErrors() const { return &fErrors.front(); } | |
| | | | |
| /// parameter values (return std::vector) | | /// parameter values (return std::vector) | |
| const std::vector<double> & Parameters() const { return fParams; } | | const std::vector<double> & Parameters() const { return fParams; } | |
| /// parameter values (return const pointer) | | /// parameter values (return const pointer) | |
| const double * GetParams() const { return &fParams.front();} | | const double * GetParams() const { return &fParams.front();} | |
| | | | |
| /// parameter value by index | | /// parameter value by index | |
| double Value(unsigned int i) const { return fParams[i]; } | | double Value(unsigned int i) const { return fParams[i]; } | |
|
| | | /// parameter value by index | |
| | | double Parameter(unsigned int i) const { return fParams[i]; } | |
| | | | |
| /// parameter error by index | | /// parameter error by index | |
|
| | | // (NOTE: this due to conflict with TObject::Error cannot used in derive | |
| | | d class which | |
| | | // inherits from TObject. Use instead ParError (or Errors()[i] ) | |
| double Error(unsigned int i) const { | | double Error(unsigned int i) const { | |
| return (i < fErrors.size() ) ? fErrors[i] : 0; | | return (i < fErrors.size() ) ? fErrors[i] : 0; | |
| } | | } | |
|
| | | /// parameter error by index | |
| | | double ParError(unsigned int i) const { | |
| | | return (i < fErrors.size() ) ? fErrors[i] : 0; | |
| | | } | |
| | | | |
| | | /// name of the parameter | |
| | | std::string ParName(unsigned int i) const; | |
| | | | |
| /// set the Minos errors for parameter i (called by the Fitter class whe
n running Minos) | | /// set the Minos errors for parameter i (called by the Fitter class whe
n running Minos) | |
| void SetMinosError(unsigned int i, double elow, double eup); | | void SetMinosError(unsigned int i, double elow, double eup); | |
| | | | |
| /// lower Minos error. If Minos has not run for parameter i return the p
arabolic error | | /// lower Minos error. If Minos has not run for parameter i return the p
arabolic error | |
| double LowerError(unsigned int i) const; | | double LowerError(unsigned int i) const; | |
| | | | |
| /// upper Minos error. If Minos has not run for parameter i return the p
arabolic error | | /// upper Minos error. If Minos has not run for parameter i return the p
arabolic error | |
| double UpperError(unsigned int i) const; | | double UpperError(unsigned int i) const; | |
| | | | |
| | | | |
| skipping to change at line 262 | | skipping to change at line 273 | |
| | | | |
| ///print error matrix and correlations | | ///print error matrix and correlations | |
| void PrintCovMatrix(std::ostream & os) const; | | void PrintCovMatrix(std::ostream & os) const; | |
| | | | |
| /// query if a parameter is bound | | /// query if a parameter is bound | |
| bool IsParameterBound(unsigned int ipar) const; | | bool IsParameterBound(unsigned int ipar) const; | |
| | | | |
| /// query if a parameter is fixed | | /// query if a parameter is fixed | |
| bool IsParameterFixed(unsigned int ipar) const; | | bool IsParameterFixed(unsigned int ipar) const; | |
| | | | |
|
| /// get name of parameter | | /// get name of parameter (deprecated) | |
| std::string GetParameterName(unsigned int ipar) const; | | std::string GetParameterName(unsigned int ipar) const { | |
| | | return ParName(ipar); | |
| protected: | | } | |
| | | | |
| protected: | | protected: | |
| | | | |
| /// Return pointer non const pointer to model (fit) function with fitted
parameter values. | | /// Return pointer non const pointer to model (fit) function with fitted
parameter values. | |
| /// used by Fitter class | | /// used by Fitter class | |
| IModelFunction * ModelFunction() { return fFitFunc; } | | IModelFunction * ModelFunction() { return fFitFunc; } | |
| void SetModelFunction(IModelFunction * func) { fFitFunc = func; } | | void SetModelFunction(IModelFunction * func) { fFitFunc = func; } | |
| | | | |
| friend class Fitter; | | friend class Fitter; | |
| | | | |
| | | | |
| skipping to change at line 295 | | skipping to change at line 306 | |
| double fChi2; // fit chi2 value (different than fval in case
of chi2 fits) | | double fChi2; // fit chi2 value (different than fval in case
of chi2 fits) | |
| IModelFunction * fFitFunc; //! model function resulting from the fit. I
t is given by Fitter but it is managed by FitResult | | IModelFunction * fFitFunc; //! model function resulting from the fit. I
t is given by Fitter but it is managed by FitResult | |
| std::vector<unsigned int> fFixedParams; // list of fixed parameters | | std::vector<unsigned int> fFixedParams; // list of fixed parameters | |
| std::vector<unsigned int> fBoundParams; // list of limited parameters | | std::vector<unsigned int> fBoundParams; // list of limited parameters | |
| std::vector<double> fParams; // parameter values. Size is total
number of parameters | | std::vector<double> fParams; // parameter values. Size is total
number of parameters | |
| std::vector<double> fErrors; // errors | | std::vector<double> fErrors; // errors | |
| std::vector<double> fCovMatrix; // covariance matrix (size is n
par*(npar+1)/2) where npar is total parameters | | std::vector<double> fCovMatrix; // covariance matrix (size is n
par*(npar+1)/2) where npar is total parameters | |
| std::vector<double> fGlobalCC; // global Correlation coefficie
nt | | std::vector<double> fGlobalCC; // global Correlation coefficie
nt | |
| std::map<unsigned int, std::pair<double,double> > fMinosErrors; // map
contains the two Minos errors | | std::map<unsigned int, std::pair<double,double> > fMinosErrors; // map
contains the two Minos errors | |
| std::string fMinimType; // string indicating type of minimi
zer | | std::string fMinimType; // string indicating type of minimi
zer | |
|
| std::vector<std::string> fParNames; // parameter names (only with FCN o
nly fites, when fFitFunc=0) | | std::vector<std::string> fParNames; // parameter names (only with FCN o
nly fits, when fFitFunc=0) | |
| | | | |
| }; | | }; | |
| | | | |
| } // end namespace Fit | | } // end namespace Fit | |
| | | | |
| } // end namespace ROOT | | } // end namespace ROOT | |
| | | | |
| #endif /* ROOT_Fit_FitResult */ | | #endif /* ROOT_Fit_FitResult */ | |
| | | | |
End of changes. 6 change blocks. |
| 6 lines changed or deleted | | 18 lines changed or added | |
|
| HybridCalculator.h | | HybridCalculator.h | |
|
| // @(#)root/roostats:$Id: HybridCalculator.h 31741 2009-12-09 17:27:53Z mon | | // @(#)root/roostats:$Id: HybridCalculator.h 34109 2010-06-24 15:00:16Z mon | |
| eta $ | | eta $ | |
| | | // Author: Kyle Cranmer, Sven Kreiss 23/05/10 | |
| /************************************************************************* | | /************************************************************************* | |
|
| * Project: RooStats * | | | |
| * Package: RooFit/RooStats * | | | |
| * Authors: * | | | |
| * Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke * | | | |
| ************************************************************************* | | | |
| * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| #ifndef ROOSTATS_HybridCalculator | | #ifndef ROOSTATS_HybridCalculator | |
| #define ROOSTATS_HybridCalculator | | #define ROOSTATS_HybridCalculator | |
| | | | |
|
| | | #ifndef ROOT_Rtypes | |
| | | #include "Rtypes.h" // necessary for TNamed | |
| | | #endif | |
| | | | |
| #ifndef ROOSTATS_HypoTestCalculator | | #ifndef ROOSTATS_HypoTestCalculator | |
| #include "RooStats/HypoTestCalculator.h" | | #include "RooStats/HypoTestCalculator.h" | |
| #endif | | #endif | |
| | | | |
|
| #include <vector> | | #ifndef ROOSTATS_ModelConfig | |
| | | #include "RooStats/ModelConfig.h" | |
| | | #endif | |
| | | | |
|
| #ifndef ROOSTATS_HybridResult | | #ifndef ROOSTATS_TestStatistic | |
| #include "RooStats/HybridResult.h" | | #include "RooStats/TestStatistic.h" | |
| #endif | | #endif | |
| | | | |
|
| #ifndef ROOSTATS_ModelConfig | | #ifndef ROOSTATS_TestStatSampler | |
| #include "RooStats/ModelConfig.h" | | #include "RooStats/TestStatSampler.h" | |
| #endif | | #endif | |
| | | | |
|
| class TH1; | | #ifndef ROOSTATS_SamplingDistribution | |
| | | #include "RooStats/SamplingDistribution.h" | |
| | | #endif | |
| | | | |
|
| namespace RooStats { | | #ifndef ROOSTATS_HypoTestResult | |
| | | #include "RooStats/HypoTestResult.h" | |
| | | #endif | |
| | | | |
|
| class HybridResult; | | namespace RooStats { | |
| | | | |
|
| class HybridCalculator : public HypoTestCalculator , public TNamed { | | class HybridCalculator: public HypoTestCalculator { | |
| | | | |
| public: | | public: | |
|
| | | HybridCalculator( | |
| | | RooAbsData &data, | |
| | | ModelConfig &altModel, | |
| | | ModelConfig &nullModel, | |
| | | TestStatSampler* sampler=0 | |
| | | ); | |
| | | | |
|
| /// Dummy Constructor with only name | | ~HybridCalculator(); | |
| explicit HybridCalculator(const char *name = 0); | | | |
| | | | |
| /// Constructor for HybridCalculator from pdf instances but without a | | | |
| data-set | | | |
| HybridCalculator(RooAbsPdf& sb_model, | | | |
| RooAbsPdf& b_model, | | | |
| RooArgList& observables, | | | |
| const RooArgSet* nuisance_parameters = 0, | | | |
| RooAbsPdf* prior_pdf = 0, | | | |
| bool GenerateBinned = false, int testStatistics = 1, | | | |
| int ntoys = 1000 ); | | | |
| | | | |
| /// Constructor for HybridCalculator using a data set and pdf instan | | | |
| ces | | | |
| HybridCalculator(RooAbsData& data, | | | |
| RooAbsPdf& sb_model, | | | |
| RooAbsPdf& b_model, | | | |
| const RooArgSet* nuisance_parameters = 0, | | | |
| RooAbsPdf* prior_pdf = 0, | | | |
| bool GenerateBinned = false, int testStatistics = 1, | | | |
| int ntoys = 1000 ); | | | |
| | | | |
| /// Constructor passing a ModelConfig for the SBmodel and a ModelConf | | | |
| ig for the B Model | | | |
| HybridCalculator(RooAbsData& data, | | | |
| const ModelConfig& sb_model, | | | |
| const ModelConfig& b_model, | | | |
| bool GenerateBinned = false, int testStatistics = 1, | | | |
| int ntoys = 1000 ); | | | |
| | | | |
| public: | | public: | |
| | | | |
|
| /// Destructor of HybridCalculator | | | |
| virtual ~HybridCalculator(); | | | |
| | | | |
| /// inherited methods from HypoTestCalculator interface | | /// inherited methods from HypoTestCalculator interface | |
|
| virtual HybridResult* GetHypoTest() const; | | virtual HypoTestResult* GetHypoTest() const; | |
| | | | |
| // inherited setter methods from HypoTestCalculator | | | |
| | | | |
| // set the model for the null hypothesis (only B) | | // set the model for the null hypothesis (only B) | |
|
| virtual void SetNullModel(const ModelConfig & ); | | virtual void SetNullModel(const ModelConfig &nullModel) { fNullModel
= nullModel; } | |
| // set the model for the alternate hypothesis (S+B) | | // set the model for the alternate hypothesis (S+B) | |
|
| virtual void SetAlternateModel(const ModelConfig & ); | | virtual void SetAlternateModel(const ModelConfig &altModel) { fAltMod | |
| | | el = altModel; } | |
| // Set a common PDF for both the null and alternate | | | |
| virtual void SetCommonPdf(RooAbsPdf & pdf) { fSbModel = &pdf; } | | | |
| // Set the PDF for the null (only B) | | | |
| virtual void SetNullPdf(RooAbsPdf& pdf) { fBModel = &pdf; } | | | |
| // Set the PDF for the alternate hypothesis ( i.e. S+B) | | | |
| virtual void SetAlternatePdf(RooAbsPdf& pdf) { fSbModel = &pdf; } | | | |
| | | | |
| // Set the DataSet | | // Set the DataSet | |
|
| virtual void SetData(RooAbsData& data) { fData = &data; } | | virtual void SetData(RooAbsData &data) { fData = data; } | |
| | | | |
|
| // set parameter values for the null if using a common PDF | | // Override the distribution used for marginalizing nuisance paramete | |
| virtual void SetNullParameters(const RooArgSet& ) { } // not needed | | rs that is infered from ModelConfig | |
| // set parameter values for the alternate if using a common PDF | | virtual void ForcePriorNuisanceNull(RooAbsPdf& priorNuisance) { fPrio | |
| virtual void SetAlternateParameters(const RooArgSet&) {} // not need | | rNuisanceNull = &priorNuisance; } | |
| ed | | virtual void ForcePriorNuisanceAlt(RooAbsPdf& priorNuisance) { fPrior | |
| | | NuisanceAlt = &priorNuisance; } | |
| // additional methods specific for HybridCalculator | | | |
| // set a prior pdf for the nuisance parameters | | // Returns instance of TestStatSampler. Use to change properties of | |
| void SetNuisancePdf(RooAbsPdf & prior_pdf) { | | // TestStatSampler, e.g. GetTestStatSampler.SetTestSize(Double_t size | |
| fPriorPdf = &prior_pdf; | | ); | |
| fUsePriorPdf = true; // if set by default turn it on | | TestStatSampler* GetTestStatSampler(void) { return fTestStatSampler; | |
| } | | } | |
| | | | |
| // set the nuisance parameters to be marginalized | | | |
| void SetNuisanceParameters(const RooArgSet & params) { fNuisanceParam | | | |
| eters = ¶ms; } | | | |
| | | | |
| // set number of toy MC (Default is 1000) | | | |
| void SetNumberOfToys(unsigned int ntoys) { fNToys = ntoys; } | | | |
| unsigned int GetNumberOfToys() { return fNToys; } | | | |
| | | | |
| // return number of toys used | | | |
| unsigned int GetNumberOfToys() const { return fNToys; } | | | |
| | | | |
| // control use of the pdf for the nuisance parameter and marginalize | | | |
| them | | | |
| void UseNuisance(bool on = true) { fUsePriorPdf = on; } | | | |
| | | | |
| // control to use bin data generation | | | |
| void SetGenerateBinned(bool on = true) { fGenerateBinned = on; } | | | |
| | | | |
| /// set the desired test statistics: | | | |
| /// index=1 : 2 * log( L_sb / L_b ) (DEFAULT) | | | |
| /// index=2 : number of generated events | | | |
| /// index=3 : profiled likelihood ratio | | | |
| /// if the index is different to any of those values, the default is | | | |
| used | | | |
| void SetTestStatistic(int index); | | | |
| | | | |
| HybridResult* Calculate(TH1& data, unsigned int nToys, bool usePriors | | | |
| ) const; | | | |
| HybridResult* Calculate(RooAbsData& data, unsigned int nToys, bool us | | | |
| ePriors) const; | | | |
| HybridResult* Calculate(unsigned int nToys, bool usePriors) const; | | | |
| void PrintMore(const char* options) const; | | | |
| | | | |
| private: | | private: | |
|
| | | ModelConfig &fAltModel; | |
| | | ModelConfig &fNullModel; | |
| | | RooAbsData &fData; | |
| | | RooAbsPdf *fPriorNuisanceNull; | |
| | | RooAbsPdf *fPriorNuisanceAlt; | |
| | | TestStatSampler* fTestStatSampler; | |
| | | TestStatSampler* fDefaultSampler; | |
| | | TestStatistic* fDefaultTestStat; | |
| | | | |
|
| void RunToys(std::vector<double>& bVals, std::vector<double>& sbVals, | | void SetupSampler(ModelConfig& model) const; | |
| unsigned int nToys, bool usePriors) const; | | | |
| | | | |
| // check input parameters before performing the calculation | | | |
| bool DoCheckInputs() const; | | | |
| | | | |
| unsigned int fTestStatisticsIdx; // Index of the test statistics to u | | | |
| se | | | |
| unsigned int fNToys; // number of Toys MC | | | |
| RooAbsPdf* fSbModel; // The pdf of the signal+background model | | | |
| RooAbsPdf* fBModel; // The pdf of the background model | | | |
| mutable RooArgList* fObservables; // Collection of the observables of | | | |
| the model | | | |
| const RooArgSet* fNuisanceParameters; // Collection of the nuisance | | | |
| parameters in the model | | | |
| RooAbsPdf* fPriorPdf; // Prior PDF of the nuisance parameters | | | |
| RooAbsData * fData; // pointer to the data sets | | | |
| bool fGenerateBinned; //Flag to control binned generation | | | |
| bool fUsePriorPdf; // use a prior for nuisance paramet | | | |
| ers | | | |
| | | | |
| // TString fSbModelName; // name of pdf of the signal+background mo | | | |
| del | | | |
| // TString fBModelName; // name of pdf of the background model | | | |
| // TString fPriorPdfName; // name of pdf of the background model | | | |
| // TString fDataName; // name of the dataset in the workspace | | | |
| | | | |
| protected: | | protected: | |
|
| ClassDef(HybridCalculator,1) // Hypothesis test calculator using a B | | ClassDef(HybridCalculator,1) | |
| ayesian-frequentist hybrid method | | }; | |
| }; | | | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 21 change blocks. |
| 138 lines changed or deleted | | 57 lines changed or added | |
|
| HypoTestResult.h | | HypoTestResult.h | |
|
| // @(#)root/roostats:$Id: HypoTestResult.h 31276 2009-11-18 15:06:42Z monet | | // @(#)root/roostats:$Id: HypoTestResult.h 34109 2010-06-24 15:00:16Z monet | |
| a $ | | a $ | |
| // Author: Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke | | // Author: Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke, S | |
| | | ven Kreiss | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| #ifndef ROOSTATS_HypoTestResult | | #ifndef ROOSTATS_HypoTestResult | |
| #define ROOSTATS_HypoTestResult | | #define ROOSTATS_HypoTestResult | |
| | | | |
| #ifndef ROOT_TNamed | | #ifndef ROOT_TNamed | |
| #include "TNamed.h" | | #include "TNamed.h" | |
| #endif | | #endif | |
| | | | |
| #ifndef ROOSTATS_RooStatsUtils | | #ifndef ROOSTATS_RooStatsUtils | |
| #include "RooStats/RooStatsUtils.h" | | #include "RooStats/RooStatsUtils.h" | |
| #endif | | #endif | |
| | | | |
|
| | | #ifndef ROOSTATS_SamplingDistribution | |
| | | #include "RooStats/SamplingDistribution.h" | |
| | | #endif | |
| | | | |
| namespace RooStats { | | namespace RooStats { | |
| | | | |
| class HypoTestResult : public TNamed { | | class HypoTestResult : public TNamed { | |
| | | | |
| public: | | public: | |
| | | | |
| // default constructor | | // default constructor | |
| explicit HypoTestResult(const char* name = 0); | | explicit HypoTestResult(const char* name = 0); | |
| | | | |
| // constructor from name, null and alternate p values | | // constructor from name, null and alternate p values | |
| HypoTestResult(const char* name, Double_t nullp, Double_t altp); | | HypoTestResult(const char* name, Double_t nullp, Double_t altp); | |
| | | | |
| // destructor | | // destructor | |
| virtual ~HypoTestResult(); | | virtual ~HypoTestResult(); | |
| | | | |
|
| | | // add values from another HypoTestResult | |
| | | virtual void Append(const HypoTestResult *other); | |
| | | | |
| // Return p-value for null hypothesis | | // Return p-value for null hypothesis | |
|
| virtual Double_t NullPValue() const {return fNullPValue;} | | virtual Double_t NullPValue() const { return fNullPValue; } | |
| | | | |
| // Return p-value for alternate hypothesis | | // Return p-value for alternate hypothesis | |
|
| virtual Double_t AlternatePValue() const {return fAlternatePValue;} | | virtual Double_t AlternatePValue() const { return fAlternatePValue; } | |
| | | | |
| // Convert NullPValue into a "confidence level" | | // Convert NullPValue into a "confidence level" | |
|
| virtual Double_t CLb() const {return 1.-NullPValue();} | | virtual Double_t CLb() const { return 1.-NullPValue(); } | |
| | | | |
| // Convert AlternatePValue into a "confidence level" | | // Convert AlternatePValue into a "confidence level" | |
|
| virtual Double_t CLsplusb() const {return AlternatePValue();} | | virtual Double_t CLsplusb() const { return AlternatePValue(); } | |
| | | | |
| // CLs is simply CLs+b/CLb (not a method, but a quantity) | | // CLs is simply CLs+b/CLb (not a method, but a quantity) | |
| virtual Double_t CLs() const { | | virtual Double_t CLs() const { | |
|
| double thisCLb = CLb(); | | double thisCLb = CLb(); | |
| if (thisCLb==0) { | | if (thisCLb == 0) { | |
| std::cout << "Error: Cannot compute CLs because CLb = 0. Returnin | | std::cout << "Error: Cannot compute CLs because CLb = 0. Return | |
| g CLs = -1\n"; | | ing CLs = -1\n"; | |
| return -1; | | return -1; | |
| } | | } | |
| double thisCLsb = CLsplusb(); | | double thisCLsb = CLsplusb(); | |
| return thisCLsb/thisCLb; | | return thisCLsb / thisCLb; | |
| } | | } | |
| | | | |
| // familiar name for the Null p-value in terms of 1-sided Gaussian si
gnificance | | // familiar name for the Null p-value in terms of 1-sided Gaussian si
gnificance | |
| virtual Double_t Significance() const {return RooStats::PValueToSigni
ficance( NullPValue() ); } | | virtual Double_t Significance() const {return RooStats::PValueToSigni
ficance( NullPValue() ); } | |
| | | | |
|
| | | SamplingDistribution* GetNullDistribution(void) const { return fNullD | |
| | | istr; } | |
| | | SamplingDistribution* GetAltDistribution(void) const { return fAltDis | |
| | | tr; } | |
| | | Double_t GetTestStatisticData(void) const { return fTestStatisticData | |
| | | ; } | |
| | | Bool_t HasTestStatisticData(void) const; | |
| | | | |
| | | void SetAltDistribution(SamplingDistribution *alt); | |
| | | void SetNullDistribution(SamplingDistribution *null); | |
| | | void SetTestStatisticData(const Double_t tsd); | |
| | | | |
| | | void SetPValueIsRightTail(Bool_t pr); | |
| | | Bool_t GetPValueIsRightTail(void) { return fPValueIsRightTail; } | |
| | | | |
| | | /// The error on the "confidence level" of the null hypothesis | |
| | | Double_t CLbError() const; | |
| | | | |
| | | /// The error on the "confidence level" of the alternative hypothesis | |
| | | Double_t CLsplusbError() const; | |
| | | | |
| | | /// The error on the ratio CLs+b/CLb | |
| | | Double_t CLsError() const; | |
| | | | |
| | | void Print(const Option_t* ) const { | |
| | | // Print out some information about the results | |
| | | | |
| | | cout << endl << "Results " << GetName() << ": " << endl; | |
| | | cout << " - Null p-value = " << NullPValue() << endl; | |
| | | cout << " - Significance = " << Significance() << " sigma" << endl; | |
| | | if(fAltDistr) | |
| | | cout << " - Number of S+B toys: " << fAltDistr->GetSize() << st | |
| | | d::endl; | |
| | | if(fNullDistr) | |
| | | cout << " - Number of B toys: " << fNullDistr->GetSize() << std | |
| | | ::endl; | |
| | | if(HasTestStatisticData()) | |
| | | cout << " - Test statistic evaluated on data: " << fTestStatist | |
| | | icData << std::endl; | |
| | | if(HasTestStatisticData() && fNullDistr) | |
| | | cout << " - CL_b: " << CLb() << " +/- " << CLbError() << std::e | |
| | | ndl; | |
| | | if(HasTestStatisticData() && fAltDistr) | |
| | | cout << " - CL_s+b: " << CLsplusb() << " +/- " << CLsplusbError | |
| | | () << std::endl; | |
| | | if(HasTestStatisticData() && fAltDistr && fNullDistr) | |
| | | cout << " - CL_s: " << CLs() << " +/- " << CLsError() << std:: | |
| | | endl; | |
| | | | |
| | | return; | |
| | | } | |
| | | | |
| | | private: | |
| | | void UpdatePValue(const SamplingDistribution* distr, Double_t *pvalue | |
| | | , Bool_t pIsRightTail); | |
| | | | |
| protected: | | protected: | |
| | | | |
| mutable Double_t fNullPValue; // p-value for the null hypothesis (sma
ll number means disfavored) | | mutable Double_t fNullPValue; // p-value for the null hypothesis (sma
ll number means disfavored) | |
| mutable Double_t fAlternatePValue; // p-value for the alternate hypot
hesis (small number means disfavored) | | mutable Double_t fAlternatePValue; // p-value for the alternate hypot
hesis (small number means disfavored) | |
|
| | | Double_t fTestStatisticData; // result of the test statistic evaluate | |
| | | d on data | |
| | | SamplingDistribution *fNullDistr; | |
| | | SamplingDistribution *fAltDistr; | |
| | | Bool_t fPValueIsRightTail; | |
| | | | |
| ClassDef(HypoTestResult,1) // Base class to represent results of a h
ypothesis test | | ClassDef(HypoTestResult,1) // Base class to represent results of a h
ypothesis test | |
| | | | |
| }; | | }; | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 10 change blocks. |
| 15 lines changed or deleted | | 84 lines changed or added | |
|
| MCMCCalculator.h | | MCMCCalculator.h | |
|
| // @(#)root/roostats:$Id: MCMCCalculator.h 31276 2009-11-18 15:06:42Z monet
a $ | | // @(#)root/roostats:$Id: MCMCCalculator.h 34109 2010-06-24 15:00:16Z monet
a $ | |
| // Authors: Kevin Belasco 17/06/2009 | | // Authors: Kevin Belasco 17/06/2009 | |
| // Authors: Kyle Cranmer 17/06/2009 | | // Authors: Kyle Cranmer 17/06/2009 | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| | | | |
| skipping to change at line 34 | | skipping to change at line 34 | |
| #endif | | #endif | |
| #ifndef ROO_ABS_DATA | | #ifndef ROO_ABS_DATA | |
| #include "RooAbsData.h" | | #include "RooAbsData.h" | |
| #endif | | #endif | |
| #ifndef ROO_ARG_SET | | #ifndef ROO_ARG_SET | |
| #include "RooArgSet.h" | | #include "RooArgSet.h" | |
| #endif | | #endif | |
| #ifndef ROO_ARG_LIST | | #ifndef ROO_ARG_LIST | |
| #include "RooArgList.h" | | #include "RooArgList.h" | |
| #endif | | #endif | |
|
| // #ifndef ROO_WORKSPACE | | | |
| // #include "RooWorkspace.h" | | | |
| // #endif | | | |
| #ifndef ROOSTATS_ProposalFunction | | #ifndef ROOSTATS_ProposalFunction | |
| #include "RooStats/ProposalFunction.h" | | #include "RooStats/ProposalFunction.h" | |
| #endif | | #endif | |
| #ifndef ROOSTATS_IntervalCalculator | | #ifndef ROOSTATS_IntervalCalculator | |
| #include "RooStats/IntervalCalculator.h" | | #include "RooStats/IntervalCalculator.h" | |
| #endif | | #endif | |
| #ifndef RooStats_MCMCInterval | | #ifndef RooStats_MCMCInterval | |
| #include "RooStats/MCMCInterval.h" | | #include "RooStats/MCMCInterval.h" | |
| #endif | | #endif | |
| | | | |
| namespace RooStats { | | namespace RooStats { | |
| | | | |
| class ModelConfig; | | class ModelConfig; | |
| | | | |
| class MCMCCalculator : public IntervalCalculator, public TNamed { | | class MCMCCalculator : public IntervalCalculator, public TNamed { | |
| | | | |
| public: | | public: | |
| // default constructor | | // default constructor | |
| MCMCCalculator(); | | MCMCCalculator(); | |
| | | | |
|
| // This constructor will set up a basic settings package including a | | // Constructor for automatic configuration with basic settings and a | |
| // ProposalFunction, number of iterations, burn in steps, confidence | | // ModelConfig. Uses a UniformProposal, 10,000 iterations, 40 burn i | |
| // level, and interval determination method. Any of these basic | | n | |
| // settings can be overridden by calling one of the Set...() methods. | | // steps, 50 bins for each RooRealVar, determines interval by histogr | |
| // Force to pass the a prior PDF for the parameter of interest | | am, | |
| MCMCCalculator(RooAbsData& data, RooAbsPdf& pdf, const RooArgSet& par | | // and finds a 95% confidence interval. Any of these basic settings | |
| amsOfInterest, RooAbsPdf & priorPdf ); | | can | |
| | | // be overridden by calling one of the Set...() methods. | |
| // Constructor as before but without a prior. | | | |
| // In this case it is assumed the prior is already included in the mo | | | |
| del | | | |
| // This constructor will set up a basic settings package including a | | | |
| // ProposalFunction, number of iterations, burn in steps, confidence | | | |
| // level, and interval determination method. Any of these basic | | | |
| // settings can be overridden by calling one of the Set...() methods. | | | |
| MCMCCalculator(RooAbsData& data, RooAbsPdf& pdf, const RooArgSet& par | | | |
| amsOfInterest ); | | | |
| | | | |
| // Constructor from a ModelConfig class. | | | |
| // This constructor will set up a basic settings package including a | | | |
| // ProposalFunction, number of iterations, burn in steps, confidence | | | |
| // level, and interval determination method. Any of these basic | | | |
| // settings can be overridden by calling one of the Set...() methods. | | | |
| MCMCCalculator(RooAbsData& data, const ModelConfig& model); | | MCMCCalculator(RooAbsData& data, const ModelConfig& model); | |
| | | | |
|
| // alternate constructor, no automatic basic settings | | | |
| MCMCCalculator(RooAbsData& data, const ModelConfig& model, ProposalFu | | | |
| nction& proposalFunction, | | | |
| Int_t numIters, RooArgList* axes = NULL, Double_t size | | | |
| = 0.05); | | | |
| // MCMCCalculator(RooWorkspace& ws, RooAbsData& data, RooAbsPdf& pdf | | | |
| , | | | |
| // const RooArgSet& paramsOfInterest, ProposalFunction& proposalFu | | | |
| nction, | | | |
| // Int_t numIters, RooArgList* axes = NULL, Double_t size = 0.05); | | | |
| | | | |
| // alternate constructor, no automatic basic settings | | | |
| MCMCCalculator(RooAbsData& data, RooAbsPdf& pdf, | | | |
| const RooArgSet& paramsOfInterest, RooAbsPdf & priorPd | | | |
| f, ProposalFunction& proposalFunction, | | | |
| Int_t numIters, RooArgList* axes = NULL, Double_t size = 0.05); | | | |
| | | | |
| virtual ~MCMCCalculator() {} | | virtual ~MCMCCalculator() {} | |
| | | | |
| // Main interface to get a ConfInterval | | // Main interface to get a ConfInterval | |
| virtual MCMCInterval* GetInterval() const; | | virtual MCMCInterval* GetInterval() const; | |
| | | | |
| // Get the size of the test (eg. rate of Type I error) | | // Get the size of the test (eg. rate of Type I error) | |
| virtual Double_t Size() const {return fSize;} | | virtual Double_t Size() const {return fSize;} | |
| // Get the Confidence level for the test | | // Get the Confidence level for the test | |
| virtual Double_t ConfidenceLevel() const {return 1.-fSize;} | | virtual Double_t ConfidenceLevel() const {return 1.-fSize;} | |
| | | | |
| | | | |
| skipping to change at line 148 | | skipping to change at line 118 | |
| virtual void SetNumBins(Int_t numBins) { fNumBins = numBins; } | | virtual void SetNumBins(Int_t numBins) { fNumBins = numBins; } | |
| // set which variables to put on each axis | | // set which variables to put on each axis | |
| virtual void SetAxes(RooArgList& axes) | | virtual void SetAxes(RooArgList& axes) | |
| { fAxes = &axes; } | | { fAxes = &axes; } | |
| // set whether to use kernel estimation to determine the interval | | // set whether to use kernel estimation to determine the interval | |
| virtual void SetUseKeys(Bool_t useKeys) { fUseKeys = useKeys; } | | virtual void SetUseKeys(Bool_t useKeys) { fUseKeys = useKeys; } | |
| // set whether to use sparse histogram (if using histogram at all) | | // set whether to use sparse histogram (if using histogram at all) | |
| virtual void SetUseSparseHist(Bool_t useSparseHist) | | virtual void SetUseSparseHist(Bool_t useSparseHist) | |
| { fUseSparseHist = useSparseHist; } | | { fUseSparseHist = useSparseHist; } | |
| | | | |
|
| | | // set what type of interval to have the MCMCInterval represent | |
| | | virtual void SetIntervalType(enum MCMCInterval::IntervalType interval | |
| | | Type) | |
| | | { fIntervalType = intervalType; } | |
| | | | |
| | | // Set the left side tail fraction. This will automatically configure | |
| | | the | |
| | | // MCMCInterval to find a tail-fraction interval. | |
| | | // Note: that `a' must be in the range 0 <= a <= 1 | |
| | | // or the user will be notified of the error | |
| | | virtual void SetLeftSideTailFraction(Double_t a); | |
| | | | |
| | | // Set the desired level of confidence-level accuracy for Keys inter | |
| | | val | |
| | | // determination. | |
| | | // | |
| | | // When determining the cutoff PDF height that gives the | |
| | | // desired confidence level (C_d), the algorithm will consider accept | |
| | | able | |
| | | // any found confidence level c such that Abs(c - C_d) < epsilon. | |
| | | // | |
| | | // Any value of this "epsilon" > 0 is considered acceptable, though i | |
| | | t is | |
| | | // advisable to not use a value too small, because the integration of | |
| | | the | |
| | | // Keys PDF sometimes does not have extremely high accuracy. | |
| | | virtual void SetKeysConfidenceAccuracy(Double_t epsilon) | |
| | | { | |
| | | if (epsilon < 0) | |
| | | coutE(InputArguments) << "MCMCInterval::SetEpsilon will not all | |
| | | ow " | |
| | | << "negative epsilon value" << endl; | |
| | | else | |
| | | fEpsilon = epsilon; | |
| | | } | |
| | | | |
| | | // When the shortest interval using Keys PDF could not be found to ha | |
| | | ve | |
| | | // the desired confidence level +/- the accuracy (see | |
| | | // SetKeysConfidenceAccuracy()), the interval determination algorithm | |
| | | // will have to terminate with an unsatisfactory confidence level whe | |
| | | n | |
| | | // the bottom and top of the cutoff search range are very close to be | |
| | | ing | |
| | | // equal. This scenario comes into play when there seems to be an er | |
| | | ror | |
| | | // in the accuracy of the Keys PDF integration, so the search range | |
| | | // continues to shrink without converging to a cutoff value that will | |
| | | // give an acceptable confidence level. To choose how small to allow | |
| | | the | |
| | | // search range to be before terminating, set the fraction delta such | |
| | | // that the search will terminate when topCutoff (a) and bottomCutoff | |
| | | (b) | |
| | | // satisfy this condition: | |
| | | // | |
| | | // TMath::Abs(a - b) < TMath::Abs(delta * (a + b)/2) | |
| | | virtual void SetKeysTerminationThreshold(Double_t delta) | |
| | | { | |
| | | if (delta < 0.) | |
| | | coutE(InputArguments) << "MCMCInterval::SetDelta will not allow | |
| | | " | |
| | | << "negative delta value" << endl; | |
| | | else | |
| | | fDelta = delta; | |
| | | } | |
| | | | |
| protected: | | protected: | |
| | | | |
|
| Double_t fSize; // size of the test (eg. specified rate of T
ype I error) | | Double_t fSize; // size of the test (eg. specified rate of Type I e
rror) | |
| RooArgSet fPOI; // parameters of interest for interval | | RooArgSet fPOI; // parameters of interest for interval | |
| RooArgSet fNuisParams; // nuisance parameters for interval (not rea
lly used) | | RooArgSet fNuisParams; // nuisance parameters for interval (not rea
lly used) | |
| mutable ProposalFunction* fPropFunc; // Proposal function for MCMC in
tegration | | mutable ProposalFunction* fPropFunc; // Proposal function for MCMC in
tegration | |
| RooAbsPdf * fPdf; // pointer to common PDF (owned by the works
pace) | | RooAbsPdf * fPdf; // pointer to common PDF (owned by the works
pace) | |
| RooAbsPdf * fPriorPdf; // pointer to prior PDF (owned by the works
pace) | | RooAbsPdf * fPriorPdf; // pointer to prior PDF (owned by the works
pace) | |
| RooAbsData * fData; // pointer to the data (owned by the workspac
e) | | RooAbsData * fData; // pointer to the data (owned by the workspac
e) | |
| Int_t fNumIters; // number of iterations to run metropolis algorithm | | Int_t fNumIters; // number of iterations to run metropolis algorithm | |
| Int_t fNumBurnInSteps; // number of iterations to discard as burn-in,
starting from the first | | Int_t fNumBurnInSteps; // number of iterations to discard as burn-in,
starting from the first | |
| Int_t fNumBins; // set the number of bins to create for each | | Int_t fNumBins; // set the number of bins to create for each | |
| // axis when constructing the interval | | // axis when constructing the interval | |
| RooArgList * fAxes; // which variables to put on each axis | | RooArgList * fAxes; // which variables to put on each axis | |
| Bool_t fUseKeys; // whether to use kernel estimation to determine int
erval | | Bool_t fUseKeys; // whether to use kernel estimation to determine int
erval | |
| Bool_t fUseSparseHist; // whether to use sparse histogram (if using h
ist at all) | | Bool_t fUseSparseHist; // whether to use sparse histogram (if using h
ist at all) | |
|
| | | Double_t fLeftSideTF; // left side tail-fraction for interval | |
| | | Double_t fEpsilon; // acceptable error for Keys interval determinatio | |
| | | n | |
| | | | |
| | | Double_t fDelta; // acceptable error for Keys cutoffs being equal | |
| | | // topCutoff (a) considered == bottomCutoff (b) iff | |
| | | // (TMath::Abs(a - b) < TMath::Abs(fDelta * (a + b)/ | |
| | | 2)); | |
| | | // Theoretically, the Abs is not needed here, but | |
| | | // floating-point arithmetic does not always work | |
| | | // perfectly, and the Abs doesn't hurt | |
| | | enum MCMCInterval::IntervalType fIntervalType; // type of interval to | |
| | | find | |
| | | | |
| void SetupBasicUsage(); | | void SetupBasicUsage(); | |
| void SetBins(const RooAbsCollection& coll, Int_t numBins) const | | void SetBins(const RooAbsCollection& coll, Int_t numBins) const | |
| { | | { | |
| TIterator* it = coll.createIterator(); | | TIterator* it = coll.createIterator(); | |
| RooAbsArg* r; | | RooAbsArg* r; | |
| while ((r = (RooAbsArg*)it->Next()) != NULL) | | while ((r = (RooAbsArg*)it->Next()) != NULL) | |
| if (dynamic_cast<RooRealVar*>(r)) | | if (dynamic_cast<RooRealVar*>(r)) | |
| ((RooRealVar*)r)->setBins(numBins); | | ((RooRealVar*)r)->setBins(numBins); | |
| delete it; | | delete it; | |
| | | | |
End of changes. 7 change blocks. |
| 45 lines changed or deleted | | 89 lines changed or added | |
|
| MCMCInterval.h | | MCMCInterval.h | |
|
| // @(#)root/roostats:$Id: MCMCInterval.h 31276 2009-11-18 15:06:42Z moneta
$ | | // @(#)root/roostats:$Id: MCMCInterval.h 34109 2010-06-24 15:00:16Z moneta
$ | |
| // Authors: Kevin Belasco 17/06/2009 | | // Authors: Kevin Belasco 17/06/2009 | |
| // Authors: Kyle Cranmer 17/06/2009 | | // Authors: Kyle Cranmer 17/06/2009 | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| | | | |
| skipping to change at line 28 | | skipping to change at line 28 | |
| | | | |
| #ifndef ROOSTATS_ConfInterval | | #ifndef ROOSTATS_ConfInterval | |
| #include "RooStats/ConfInterval.h" | | #include "RooStats/ConfInterval.h" | |
| #endif | | #endif | |
| #ifndef ROO_ARG_SET | | #ifndef ROO_ARG_SET | |
| #include "RooArgSet.h" | | #include "RooArgSet.h" | |
| #endif | | #endif | |
| #ifndef ROO_ARG_LIST | | #ifndef ROO_ARG_LIST | |
| #include "RooArgList.h" | | #include "RooArgList.h" | |
| #endif | | #endif | |
|
| // #ifndef ROO_DATA_HIST | | | |
| // #include "RooDataHist.h" | | | |
| // #endif | | | |
| // #ifndef ROO_DATA_SET | | | |
| // #include "RooDataSet.h" | | | |
| // #endif | | | |
| // #ifndef ROO_REAL_VAR | | | |
| // #include "RooRealVar.h" | | | |
| // #endif | | | |
| // #ifndef ROO_KEYS_PDF | | | |
| // #include "RooNDKeysPdf.h" | | | |
| // #endif | | | |
| #ifndef ROOSTATS_MarkovChain | | #ifndef ROOSTATS_MarkovChain | |
| #include "RooStats/MarkovChain.h" | | #include "RooStats/MarkovChain.h" | |
| #endif | | #endif | |
|
| // #ifndef ROOT_TH1 | | | |
| // #include "TH1.h" | | | |
| // #endif | | | |
| // #ifndef ROO_PRODUCT | | | |
| // #include "RooProduct.h" | | | |
| // #endif | | | |
| // #ifndef RooStats_Heavyside | | | |
| // #include "RooStats/Heavyside.h" | | | |
| // #endif | | | |
| // #ifndef ROO_PRODUCT | | | |
| // #include "RooProduct.h" | | | |
| // #endif | | | |
| // #ifndef ROOT_THnSparse | | | |
| // #include "THnSparse.h" | | | |
| // #endif | | | |
| | | | |
| class RooNDKeysPdf; | | class RooNDKeysPdf; | |
| class RooProduct; | | class RooProduct; | |
| | | | |
| namespace RooStats { | | namespace RooStats { | |
| | | | |
|
| class Heavyside; | | class Heaviside; | |
| | | | |
| class MCMCInterval : public ConfInterval { | | class MCMCInterval : public ConfInterval { | |
| | | | |
| public: | | public: | |
| | | | |
| // default constructor | | // default constructor | |
| explicit MCMCInterval(const char* name = 0); | | explicit MCMCInterval(const char* name = 0); | |
| | | | |
| // constructor from parameter of interest and Markov chain object | | // constructor from parameter of interest and Markov chain object | |
| MCMCInterval(const char* name, const RooArgSet& parameters, | | MCMCInterval(const char* name, const RooArgSet& parameters, | |
| MarkovChain& chain); | | MarkovChain& chain); | |
| | | | |
| enum {DEFAULT_NUM_BINS = 50}; | | enum {DEFAULT_NUM_BINS = 50}; | |
|
| | | enum IntervalType {kShortest, kTailFraction}; | |
| | | | |
| virtual ~MCMCInterval(); | | virtual ~MCMCInterval(); | |
| | | | |
| // determine whether this point is in the confidence interval | | // determine whether this point is in the confidence interval | |
| virtual Bool_t IsInInterval(const RooArgSet& point) const; | | virtual Bool_t IsInInterval(const RooArgSet& point) const; | |
| | | | |
| // set the desired confidence level (see GetActualConfidenceLevel()) | | // set the desired confidence level (see GetActualConfidenceLevel()) | |
| // Note: calling this function triggers the algorithm that determines | | // Note: calling this function triggers the algorithm that determines | |
| // the interval, so call this after initializing all other aspects | | // the interval, so call this after initializing all other aspects | |
| // of this IntervalCalculator | | // of this IntervalCalculator | |
| | | | |
| skipping to change at line 111 | | skipping to change at line 85 | |
| virtual Double_t GetHistCutoff(); | | virtual Double_t GetHistCutoff(); | |
| | | | |
| // get the cutoff RooNDKeysPdf value for being considered in the | | // get the cutoff RooNDKeysPdf value for being considered in the | |
| // confidence interval | | // confidence interval | |
| virtual Double_t GetKeysPdfCutoff(); | | virtual Double_t GetKeysPdfCutoff(); | |
| //virtual Double_t GetKeysPdfCutoff() { return fKeysCutoff; } | | //virtual Double_t GetKeysPdfCutoff() { return fKeysCutoff; } | |
| | | | |
| // get the actual value of the confidence level for this interval. | | // get the actual value of the confidence level for this interval. | |
| virtual Double_t GetActualConfidenceLevel(); | | virtual Double_t GetActualConfidenceLevel(); | |
| | | | |
|
| // get the sum of all bin weights | | | |
| virtual Double_t GetSumOfWeights() const; | | | |
| | | | |
| // whether the specified confidence level is a floor for the actual | | // whether the specified confidence level is a floor for the actual | |
| // confidence level (strict), or a ceiling (not strict) | | // confidence level (strict), or a ceiling (not strict) | |
|
| virtual void SetHistStrict(Bool_t isHistStrict) { fIsHistStrict = isH | | virtual void SetHistStrict(Bool_t isHistStrict) | |
| istStrict; } | | { fIsHistStrict = isHistStrict; } | |
| | | | |
| // check if parameters are correct. (dummy implementation to start) | | // check if parameters are correct. (dummy implementation to start) | |
| Bool_t CheckParameters(const RooArgSet& point) const; | | Bool_t CheckParameters(const RooArgSet& point) const; | |
| | | | |
| // Set the parameters of interest for this interval | | // Set the parameters of interest for this interval | |
| // and change other internal data members accordingly | | // and change other internal data members accordingly | |
| virtual void SetParameters(const RooArgSet& parameters); | | virtual void SetParameters(const RooArgSet& parameters); | |
| | | | |
| // Set the MarkovChain that this interval is based on | | // Set the MarkovChain that this interval is based on | |
| virtual void SetChain(MarkovChain& chain) { fChain = &chain; } | | virtual void SetChain(MarkovChain& chain) { fChain = &chain; } | |
| | | | |
| skipping to change at line 143 | | skipping to change at line 115 | |
| // return a list of RooRealVars representing the axes | | // return a list of RooRealVars representing the axes | |
| // you own the returned RooArgList | | // you own the returned RooArgList | |
| virtual RooArgList* GetAxes() | | virtual RooArgList* GetAxes() | |
| { | | { | |
| RooArgList* axes = new RooArgList(); | | RooArgList* axes = new RooArgList(); | |
| for (Int_t i = 0; i < fDimension; i++) | | for (Int_t i = 0; i < fDimension; i++) | |
| axes->addClone(*fAxes[i]); | | axes->addClone(*fAxes[i]); | |
| return axes; | | return axes; | |
| } | | } | |
| | | | |
|
| // get the lower limit of param in the confidence interval | | // get the lowest value of param that is within the confidence interv | |
| | | al | |
| | | virtual Double_t LowerLimit(RooRealVar& param); | |
| | | | |
| | | // determine lower limit of the lower confidence interval | |
| | | virtual Double_t LowerLimitTailFraction(RooRealVar& param); | |
| | | | |
| | | // get the lower limit of param in the shortest confidence interval | |
| // Note that this works better for some distributions (ones with exac
tly | | // Note that this works better for some distributions (ones with exac
tly | |
| // one maximum) than others, and sometimes has little value. | | // one maximum) than others, and sometimes has little value. | |
|
| virtual Double_t LowerLimit(RooRealVar& param); | | virtual Double_t LowerLimitShortest(RooRealVar& param); | |
| | | | |
|
| // determine lower limit using keys pdf | | // determine lower limit in the shortest interval by using keys pdf | |
| virtual Double_t LowerLimitByKeys(RooRealVar& param); | | virtual Double_t LowerLimitByKeys(RooRealVar& param); | |
| | | | |
|
| // determine upper limit using keys pdf | | | |
| virtual Double_t UpperLimitByKeys(RooRealVar& param); | | | |
| | | | |
| // determine lower limit using histogram | | // determine lower limit using histogram | |
| virtual Double_t LowerLimitByHist(RooRealVar& param); | | virtual Double_t LowerLimitByHist(RooRealVar& param); | |
| | | | |
| // determine lower limit using histogram | | // determine lower limit using histogram | |
| virtual Double_t LowerLimitBySparseHist(RooRealVar& param); | | virtual Double_t LowerLimitBySparseHist(RooRealVar& param); | |
| | | | |
| // determine lower limit using histogram | | // determine lower limit using histogram | |
| virtual Double_t LowerLimitByDataHist(RooRealVar& param); | | virtual Double_t LowerLimitByDataHist(RooRealVar& param); | |
| | | | |
|
| | | // get the highest value of param that is within the confidence inter | |
| | | val | |
| | | virtual Double_t UpperLimit(RooRealVar& param); | |
| | | | |
| | | // determine upper limit of the lower confidence interval | |
| | | virtual Double_t UpperLimitTailFraction(RooRealVar& param); | |
| | | | |
| | | // get the upper limit of param in the confidence interval | |
| | | // Note that this works better for some distributions (ones with exac | |
| | | tly | |
| | | // one maximum) than others, and sometimes has little value. | |
| | | virtual Double_t UpperLimitShortest(RooRealVar& param); | |
| | | | |
| | | // determine upper limit in the shortest interval by using keys pdf | |
| | | virtual Double_t UpperLimitByKeys(RooRealVar& param); | |
| | | | |
| // determine upper limit using histogram | | // determine upper limit using histogram | |
| virtual Double_t UpperLimitByHist(RooRealVar& param); | | virtual Double_t UpperLimitByHist(RooRealVar& param); | |
| | | | |
| // determine upper limit using histogram | | // determine upper limit using histogram | |
| virtual Double_t UpperLimitBySparseHist(RooRealVar& param); | | virtual Double_t UpperLimitBySparseHist(RooRealVar& param); | |
| | | | |
| // determine upper limit using histogram | | // determine upper limit using histogram | |
| virtual Double_t UpperLimitByDataHist(RooRealVar& param); | | virtual Double_t UpperLimitByDataHist(RooRealVar& param); | |
| | | | |
|
| // get the upper limit of param in the confidence interval | | // Determine the approximate maximum value of the Keys PDF | |
| // Note that this works better for some distributions (ones with exac | | Double_t GetKeysMax(); | |
| tly | | | |
| // one maximum) than others, and sometimes has little value. | | | |
| virtual Double_t UpperLimit(RooRealVar& param); | | | |
| | | | |
| // set the number of steps in the chain to discard as burn-in, | | // set the number of steps in the chain to discard as burn-in, | |
| // starting from the first | | // starting from the first | |
| virtual void SetNumBurnInSteps(Int_t numBurnInSteps) | | virtual void SetNumBurnInSteps(Int_t numBurnInSteps) | |
| { fNumBurnInSteps = numBurnInSteps; } | | { fNumBurnInSteps = numBurnInSteps; } | |
| | | | |
| // set whether to use kernel estimation to determine the interval | | // set whether to use kernel estimation to determine the interval | |
| virtual void SetUseKeys(Bool_t useKeys) { fUseKeys = useKeys; } | | virtual void SetUseKeys(Bool_t useKeys) { fUseKeys = useKeys; } | |
| | | | |
| // set whether to use a sparse histogram. you MUST also call | | // set whether to use a sparse histogram. you MUST also call | |
| | | | |
| skipping to change at line 208 | | skipping to change at line 195 | |
| | | | |
| // set the number of bins to use (same for all axes, for now) | | // set the number of bins to use (same for all axes, for now) | |
| //virtual void SetNumBins(Int_t numBins); | | //virtual void SetNumBins(Int_t numBins); | |
| | | | |
| // Get a clone of the histogram of the posterior | | // Get a clone of the histogram of the posterior | |
| virtual TH1* GetPosteriorHist(); | | virtual TH1* GetPosteriorHist(); | |
| | | | |
| // Get a clone of the keys pdf of the posterior | | // Get a clone of the keys pdf of the posterior | |
| virtual RooNDKeysPdf* GetPosteriorKeysPdf(); | | virtual RooNDKeysPdf* GetPosteriorKeysPdf(); | |
| | | | |
|
| // Get a clone of the (keyspdf * heavyside) product of the posterior | | // Get a clone of the (keyspdf * heaviside) product of the posterior | |
| virtual RooProduct* GetPosteriorKeysProduct(); | | virtual RooProduct* GetPosteriorKeysProduct(); | |
| | | | |
| // Get the number of parameters of interest in this interval | | // Get the number of parameters of interest in this interval | |
| virtual Int_t GetDimension() const { return fDimension; } | | virtual Int_t GetDimension() const { return fDimension; } | |
| | | | |
| // Get the markov chain on which this interval is based | | // Get the markov chain on which this interval is based | |
| // You do not own the returned MarkovChain* | | // You do not own the returned MarkovChain* | |
| virtual const MarkovChain* GetChain() { return fChain; } | | virtual const MarkovChain* GetChain() { return fChain; } | |
| | | | |
| // Get a clone of the markov chain on which this interval is based | | // Get a clone of the markov chain on which this interval is based | |
| | | | |
| skipping to change at line 239 | | skipping to change at line 226 | |
| // as a RooDataHist. You own the returned RooDataHist* | | // as a RooDataHist. You own the returned RooDataHist* | |
| virtual RooDataHist* GetChainAsDataHist(RooArgSet* whichVars = NULL) | | virtual RooDataHist* GetChainAsDataHist(RooArgSet* whichVars = NULL) | |
| { return fChain->GetAsDataHist(whichVars); } | | { return fChain->GetAsDataHist(whichVars); } | |
| | | | |
| // Get a clone of the markov chain on which this interval is based | | // Get a clone of the markov chain on which this interval is based | |
| // as a THnSparse. You own the returned THnSparse* | | // as a THnSparse. You own the returned THnSparse* | |
| virtual THnSparse* GetChainAsSparseHist(RooArgSet* whichVars = NULL) | | virtual THnSparse* GetChainAsSparseHist(RooArgSet* whichVars = NULL) | |
| { return fChain->GetAsSparseHist(whichVars); } | | { return fChain->GetAsSparseHist(whichVars); } | |
| | | | |
| // Get a clone of the NLL variable from the markov chain | | // Get a clone of the NLL variable from the markov chain | |
|
| virtual RooRealVar* GetNLLVar() const { return fChain->GetNLLVar(); } | | virtual RooRealVar* GetNLLVar() const | |
| | | { return fChain->GetNLLVar(); } | |
| | | | |
| // Get a clone of the weight variable from the markov chain | | // Get a clone of the weight variable from the markov chain | |
|
| virtual RooRealVar* GetWeightVar() const { return fChain->GetWeightVa | | virtual RooRealVar* GetWeightVar() const | |
| r(); } | | { return fChain->GetWeightVar(); } | |
| | | | |
| // set the acceptable level or error for Keys interval determination | | // set the acceptable level or error for Keys interval determination | |
| virtual void SetEpsilon(Double_t epsilon) | | virtual void SetEpsilon(Double_t epsilon) | |
| { | | { | |
| if (epsilon < 0) | | if (epsilon < 0) | |
| coutE(InputArguments) << "MCMCInterval::SetEpsilon will not all
ow " | | coutE(InputArguments) << "MCMCInterval::SetEpsilon will not all
ow " | |
| << "negative epsilon value" << endl; | | << "negative epsilon value" << endl; | |
| else | | else | |
| fEpsilon = epsilon; | | fEpsilon = epsilon; | |
| } | | } | |
| | | | |
|
| | | // Set the type of interval to find. This will only have an effect f | |
| | | or | |
| | | // 1-D intervals. If is more than 1 parameter of interest, then a | |
| | | // "shortest" interval will always be used, since it generalizes dire | |
| | | ctly | |
| | | // to N dimensions | |
| | | virtual void SetIntervalType(enum IntervalType intervalType) | |
| | | { fIntervalType = intervalType; } | |
| | | | |
| | | // Return the type of this interval | |
| | | virtual enum IntervalType GetIntervalType() { return fIntervalType; } | |
| | | | |
| | | // set the left-side tail fraction for a tail-fraction interval | |
| | | virtual void SetLeftSideTailFraction(Double_t a) { fLeftSideTF = a; } | |
| | | | |
| | | // kbelasco: The inner-workings of the class really should not be exp | |
| | | osed | |
| | | // like this in a comment, but it seems to be the only way to give | |
| | | // the user any control over this process, if he desires it | |
| | | // | |
| | | // Set the fraction delta such that | |
| | | // topCutoff (a) is considered == bottomCutoff (b) iff | |
| | | // (TMath::Abs(a - b) < TMath::Abs(fDelta * (a + b)/2)) | |
| | | // when determining the confidence interval by Keys | |
| | | virtual void SetDelta(Double_t delta) | |
| | | { | |
| | | if (delta < 0.) | |
| | | coutE(InputArguments) << "MCMCInterval::SetDelta will not allow | |
| | | " | |
| | | << "negative delta value" << endl; | |
| | | else | |
| | | fDelta = delta; | |
| | | } | |
| | | | |
| private: | | private: | |
| inline Bool_t AcceptableConfLevel(Double_t confLevel); | | inline Bool_t AcceptableConfLevel(Double_t confLevel); | |
|
| | | inline Bool_t WithinDeltaFraction(Double_t a, Double_t b); | |
| | | | |
| protected: | | protected: | |
| // data members | | // data members | |
| RooArgSet fParameters; // parameters of interest for this interval | | RooArgSet fParameters; // parameters of interest for this interval | |
| MarkovChain* fChain; // the markov chain | | MarkovChain* fChain; // the markov chain | |
|
| | | Double_t fConfidenceLevel; // Requested confidence level (eg. 0.95 fo | |
| | | r 95% CL) | |
| | | | |
| RooDataHist* fDataHist; // the binned Markov Chain data | | RooDataHist* fDataHist; // the binned Markov Chain data | |
|
| RooNDKeysPdf* fKeysPdf; // the kernel estimation pdf | | | |
| RooProduct* fProduct; // the (keysPdf * heavyside) product | | | |
| Heavyside* fHeavyside; // the Heavyside function | | | |
| RooDataHist* fKeysDataHist; // data hist representing product | | | |
| TH1* fHist; // the binned Markov Chain data | | | |
| THnSparse* fSparseHist; // the binned Markov Chain data | | THnSparse* fSparseHist; // the binned Markov Chain data | |
|
| Double_t fConfidenceLevel; // Requested confidence level (eg. 0.95 fo
r 95% CL) | | | |
| Double_t fHistConfLevel; // the actual conf level determined by hist | | Double_t fHistConfLevel; // the actual conf level determined by hist | |
|
| Double_t fKeysConfLevel; // the actual conf level determined by keys | | | |
| Double_t fHistCutoff; // cutoff bin size to be in interval | | Double_t fHistCutoff; // cutoff bin size to be in interval | |
|
| | | | |
| | | RooNDKeysPdf* fKeysPdf; // the kernel estimation pdf | |
| | | RooProduct* fProduct; // the (keysPdf * heaviside) product | |
| | | Heaviside* fHeaviside; // the Heaviside function | |
| | | RooDataHist* fKeysDataHist; // data hist representing product | |
| | | RooRealVar* fCutoffVar; // cutoff variable to use for integrating key | |
| | | s pdf | |
| | | Double_t fKeysConfLevel; // the actual conf level determined by keys | |
| Double_t fKeysCutoff; // cutoff keys pdf value to be in interval | | Double_t fKeysCutoff; // cutoff keys pdf value to be in interval | |
| Double_t fFull; // Value of intergral of fProduct | | Double_t fFull; // Value of intergral of fProduct | |
|
| RooRealVar* fCutoffVar; // cutoff variable to use for integrating key | | | |
| s pdf | | Double_t fLeftSideTF; // left side tail-fraction for interval | |
| | | Double_t fTFConfLevel; // the actual conf level of tail-fraction inte | |
| | | rval | |
| | | vector<Int_t> fVector; // vector containing the Markov chain data | |
| | | Double_t fVecWeight; // sum of weights of all entries in fVector | |
| | | Double_t fTFLower; // lower limit of the tail-fraction interval | |
| | | Double_t fTFUpper; // upper limit of the tail-fraction interval | |
| | | | |
| | | TH1* fHist; // the binned Markov Chain data | |
| | | | |
| Bool_t fUseKeys; // whether to use kernel estimation | | Bool_t fUseKeys; // whether to use kernel estimation | |
| Bool_t fUseSparseHist; // whether to use sparse hist (vs. RooDataHist
) | | Bool_t fUseSparseHist; // whether to use sparse hist (vs. RooDataHist
) | |
|
| Bool_t fIsHistStrict; // whether the specified confidence level is a | | Bool_t fIsHistStrict; // whether the specified confidence level is a | |
| floor | | // floor for the actual confidence level (stric | |
| // for the actual confidence level (strict), or | | t), | |
| a | | // or a ceiling (not strict) for determination | |
| // ceiling (not strict) for determination by hi | | by | |
| stogram | | // histogram | |
| Int_t fDimension; // number of variables | | Int_t fDimension; // number of variables | |
|
| Int_t fNumBurnInSteps; // number of steps to discard as burn in, star | | Int_t fNumBurnInSteps; // number of steps to discard as burn in, star | |
| ting from the first | | ting | |
| | | // from the first | |
| Double_t fIntervalSum; // sum of heights of bins in the interval | | Double_t fIntervalSum; // sum of heights of bins in the interval | |
| RooRealVar** fAxes; // array of pointers to RooRealVars representing | | RooRealVar** fAxes; // array of pointers to RooRealVars representing | |
| // the axes of the histogram | | // the axes of the histogram | |
| // fAxes[0] represents x-axis, [1] y, [2] z, etc | | // fAxes[0] represents x-axis, [1] y, [2] z, etc | |
|
| | | | |
| Double_t fEpsilon; // acceptable error for Keys interval determinatio
n | | Double_t fEpsilon; // acceptable error for Keys interval determinatio
n | |
| | | | |
|
| | | Double_t fDelta; // topCutoff (a) considered == bottomCutoff (b) iff | |
| | | // (TMath::Abs(a - b) < TMath::Abs(fDelta * (a + b)/ | |
| | | 2)); | |
| | | // Theoretically, the Abs is not needed here, but | |
| | | // floating-point arithmetic does not always work | |
| | | // perfectly, and the Abs doesn't hurt | |
| | | enum IntervalType fIntervalType; | |
| | | | |
| // functions | | // functions | |
| virtual void DetermineInterval(); | | virtual void DetermineInterval(); | |
|
| | | virtual void DetermineShortestInterval(); | |
| | | virtual void DetermineTailFractionInterval(); | |
| virtual void DetermineByHist(); | | virtual void DetermineByHist(); | |
| virtual void DetermineBySparseHist(); | | virtual void DetermineBySparseHist(); | |
| virtual void DetermineByDataHist(); | | virtual void DetermineByDataHist(); | |
| virtual void DetermineByKeys(); | | virtual void DetermineByKeys(); | |
| virtual void CreateHist(); | | virtual void CreateHist(); | |
| virtual void CreateSparseHist(); | | virtual void CreateSparseHist(); | |
| virtual void CreateDataHist(); | | virtual void CreateDataHist(); | |
| virtual void CreateKeysPdf(); | | virtual void CreateKeysPdf(); | |
| virtual void CreateKeysDataHist(); | | virtual void CreateKeysDataHist(); | |
|
| | | virtual void CreateVector(RooRealVar* param); | |
| inline virtual Double_t CalcConfLevel(Double_t cutoff, Double_t full)
; | | inline virtual Double_t CalcConfLevel(Double_t cutoff, Double_t full)
; | |
| | | | |
| ClassDef(MCMCInterval,1) // Concrete implementation of a ConfInterva
l based on MCMC calculation | | ClassDef(MCMCInterval,1) // Concrete implementation of a ConfInterva
l based on MCMC calculation | |
| | | | |
| }; | | }; | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 30 change blocks. |
| 66 lines changed or deleted | | 116 lines changed or added | |
|
| MethodANNBase.h | | MethodANNBase.h | |
|
| // @(#)root/tmva $Id: MethodANNBase.h 31574 2009-12-05 18:23:21Z stelzer $ | | // @(#)root/tmva $Id: MethodANNBase.h 33928 2010-06-15 16:19:31Z stelzer $ | |
| // Author: Andreas Hoecker, Matt Jachowski | | // Author: Andreas Hoecker, Peter Speckmayer, Matt Jachowski | |
| | | | |
| /**************************************************************************
******** | | /**************************************************************************
******** | |
| * Project: TMVA - a Root-integrated toolkit for multivariate data analysis
* | | * Project: TMVA - a Root-integrated toolkit for multivariate data analysis
* | |
| * Package: TMVA
* | | * Package: TMVA
* | |
| * Class : MethodANNBase
* | | * Class : MethodANNBase
* | |
| * Web : http://tmva.sourceforge.net
* | | * Web : http://tmva.sourceforge.net
* | |
| *
* | | *
* | |
| * Description:
* | | * Description:
* | |
| * Artificial neural network base class for the discrimination of sign
al * | | * Artificial neural network base class for the discrimination of sign
al * | |
| * from background.
* | | * from background.
* | |
| *
* | | *
* | |
| * Authors (alphabetical):
* | | * Authors (alphabetical):
* | |
| * Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland
* | | * Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland
* | |
| * Matt Jachowski <jachowski@stanford.edu> - Stanford University, US
A * | | * Matt Jachowski <jachowski@stanford.edu> - Stanford University, US
A * | |
|
| | | * Peter Speckmayer <Peter.Speckmayer@cern.ch> - CERN, Switzerland
* | |
| * Joerg Stelzer <Joerg.Stelzer@cern.ch> - CERN, Switzerland
* | | * Joerg Stelzer <Joerg.Stelzer@cern.ch> - CERN, Switzerland
* | |
| *
* | | *
* | |
| * Small changes (regression):
* | | * Small changes (regression):
* | |
| * Krzysztof Danielowski <danielow@cern.ch> - IFJ PAN & AGH, Poland
* | | * Krzysztof Danielowski <danielow@cern.ch> - IFJ PAN & AGH, Poland
* | |
| * Kamil Kraszewski <kalq@cern.ch> - IFJ PAN & UJ , Poland
* | | * Kamil Kraszewski <kalq@cern.ch> - IFJ PAN & UJ , Poland
* | |
| * Maciej Kruk <mkruk@cern.ch> - IFJ PAN & AGH, Poland
* | | * Maciej Kruk <mkruk@cern.ch> - IFJ PAN & AGH, Poland
* | |
| *
* | | *
* | |
| * Copyright (c) 2005:
* | | * Copyright (c) 2005:
* | |
| * CERN, Switzerland
* | | * CERN, Switzerland
* | |
| *
* | | *
* | |
| | | | |
| skipping to change at line 126 | | skipping to change at line 127 | |
| void ReadWeightsFromXML( void* wghtnode ); | | void ReadWeightsFromXML( void* wghtnode ); | |
| | | | |
| // read weights from file | | // read weights from file | |
| virtual void ReadWeightsFromStream( istream& istr ); | | virtual void ReadWeightsFromStream( istream& istr ); | |
| | | | |
| // calculate the MVA value | | // calculate the MVA value | |
| virtual Double_t GetMvaValue( Double_t* err = 0 ); | | virtual Double_t GetMvaValue( Double_t* err = 0 ); | |
| | | | |
| virtual const std::vector<Float_t> &GetRegressionValues(); | | virtual const std::vector<Float_t> &GetRegressionValues(); | |
| | | | |
|
| | | virtual const std::vector<Float_t> &GetMulticlassValues(); | |
| | | | |
| // write method specific histos to target file | | // write method specific histos to target file | |
| virtual void WriteMonitoringHistosToFile() const; | | virtual void WriteMonitoringHistosToFile() const; | |
| | | | |
| // ranking of input variables | | // ranking of input variables | |
| const Ranking* CreateRanking(); | | const Ranking* CreateRanking(); | |
| | | | |
| // the option handling methods | | // the option handling methods | |
| virtual void DeclareOptions(); | | virtual void DeclareOptions(); | |
| virtual void ProcessOptions(); | | virtual void ProcessOptions(); | |
| | | | |
|
| Bool_t Debug() const { return fgDEBUG; } | | Bool_t Debug() const; | |
| | | | |
| | | enum EEstimator { kMSE=0,kCE}; | |
| | | | |
| protected: | | protected: | |
| | | | |
| virtual void MakeClassSpecific( std::ostream&, const TString& ) const
; | | virtual void MakeClassSpecific( std::ostream&, const TString& ) const
; | |
| | | | |
| std::vector<Int_t>* ParseLayoutString( TString layerSpec ); | | std::vector<Int_t>* ParseLayoutString( TString layerSpec ); | |
| virtual void BuildNetwork( std::vector<Int_t>* layout, std::ve
ctor<Double_t>* weights=NULL, | | virtual void BuildNetwork( std::vector<Int_t>* layout, std::ve
ctor<Double_t>* weights=NULL, | |
| Bool_t fromFile = kFALSE ); | | Bool_t fromFile = kFALSE ); | |
| void ForceNetworkInputs( const Event* ev, Int_t ignoreIndex = -1
); | | void ForceNetworkInputs( const Event* ev, Int_t ignoreIndex = -1
); | |
| Double_t GetNetworkOutput() { return GetOutputNeuron()->GetActivation
Value(); } | | Double_t GetNetworkOutput() { return GetOutputNeuron()->GetActivation
Value(); } | |
| | | | |
| skipping to change at line 162 | | skipping to change at line 167 | |
| | | | |
| // accessors | | // accessors | |
| Int_t NumCycles() { return fNcycles; } | | Int_t NumCycles() { return fNcycles; } | |
| TNeuron* GetInputNeuron(Int_t index) { return (TNeuron*)fInputL
ayer->At(index); } | | TNeuron* GetInputNeuron(Int_t index) { return (TNeuron*)fInputL
ayer->At(index); } | |
| TNeuron* GetOutputNeuron( Int_t index = 0) { return fOutputNeurons.at
(index); } | | TNeuron* GetOutputNeuron( Int_t index = 0) { return fOutputNeurons.at
(index); } | |
| | | | |
| // protected variables | | // protected variables | |
| TObjArray* fNetwork; // TObjArray of TObjArrays representi
ng network | | TObjArray* fNetwork; // TObjArray of TObjArrays representi
ng network | |
| TObjArray* fSynapses; // array of pointers to synapses, no
structural data | | TObjArray* fSynapses; // array of pointers to synapses, no
structural data | |
| TActivation* fActivation; // activation function to be used for
hidden layers | | TActivation* fActivation; // activation function to be used for
hidden layers | |
|
| | | TActivation* fOutput; // activation function to be used for
output layers, depending on estimator | |
| TActivation* fIdentity; // activation for input and output la
yers | | TActivation* fIdentity; // activation for input and output la
yers | |
| TRandom3* frgen; // random number generator for variou
s uses | | TRandom3* frgen; // random number generator for variou
s uses | |
| TNeuronInput* fInputCalculator; // input calculator for all neurons | | TNeuronInput* fInputCalculator; // input calculator for all neurons | |
| | | | |
|
| | | std::vector<Int_t> fRegulatorIdx; //index to different priors | |
| | | from every synapses | |
| | | std::vector<Double_t> fRegulators; //the priors as regulator | |
| | | EEstimator fEstimator; | |
| | | TString fEstimatorS; | |
| | | | |
| // monitoring histograms | | // monitoring histograms | |
| TH1F* fEstimatorHistTrain; // monitors convergence of training sample | | TH1F* fEstimatorHistTrain; // monitors convergence of training sample | |
| TH1F* fEstimatorHistTest; // monitors convergence of independent tes
t sample | | TH1F* fEstimatorHistTest; // monitors convergence of independent tes
t sample | |
| | | | |
| // monitoring histograms (not available for regression) | | // monitoring histograms (not available for regression) | |
| void CreateWeightMonitoringHists( const TString& bulkname, std::vecto
r<TH1*>* hv = 0 ) const; | | void CreateWeightMonitoringHists( const TString& bulkname, std::vecto
r<TH1*>* hv = 0 ) const; | |
| std::vector<TH1*> fEpochMonHistS; // epoch monitoring hitograms for s
ignal | | std::vector<TH1*> fEpochMonHistS; // epoch monitoring hitograms for s
ignal | |
| std::vector<TH1*> fEpochMonHistB; // epoch monitoring hitograms for b
ackground | | std::vector<TH1*> fEpochMonHistB; // epoch monitoring hitograms for b
ackground | |
| std::vector<TH1*> fEpochMonHistW; // epoch monitoring hitograms for w
eights | | std::vector<TH1*> fEpochMonHistW; // epoch monitoring hitograms for w
eights | |
| | | | |
|
| | | // general | |
| | | TMatrixD fInvHessian; // zjh | |
| | | bool fUseRegulator; // zjh | |
| | | | |
| private: | | private: | |
| | | | |
| // helper functions for building network | | // helper functions for building network | |
| void BuildLayers(std::vector<Int_t>* layout, Bool_t from_file = false
); | | void BuildLayers(std::vector<Int_t>* layout, Bool_t from_file = false
); | |
| void BuildLayer(Int_t numNeurons, TObjArray* curLayer, TObjArray* pre
vLayer, | | void BuildLayer(Int_t numNeurons, TObjArray* curLayer, TObjArray* pre
vLayer, | |
| Int_t layerIndex, Int_t numLayers, Bool_t from_file =
false); | | Int_t layerIndex, Int_t numLayers, Bool_t from_file =
false); | |
| void AddPreLinks(TNeuron* neuron, TObjArray* prevLayer); | | void AddPreLinks(TNeuron* neuron, TObjArray* prevLayer); | |
| | | | |
| // helper functions for weight initialization | | // helper functions for weight initialization | |
| void InitWeights(); | | void InitWeights(); | |
| | | | |
| skipping to change at line 203 | | skipping to change at line 218 | |
| void PrintLayer(TObjArray* layer) const; | | void PrintLayer(TObjArray* layer) const; | |
| void PrintNeuron(TNeuron* neuron) const; | | void PrintNeuron(TNeuron* neuron) const; | |
| | | | |
| // private variables | | // private variables | |
| Int_t fNcycles; // number of epochs to trai
n | | Int_t fNcycles; // number of epochs to trai
n | |
| TString fNeuronType; // name of neuron activatio
n function class | | TString fNeuronType; // name of neuron activatio
n function class | |
| TString fNeuronInputType; // name of neuron input cal
culator class | | TString fNeuronInputType; // name of neuron input cal
culator class | |
| TObjArray* fInputLayer; // cache this for fast acce
ss | | TObjArray* fInputLayer; // cache this for fast acce
ss | |
| std::vector<TNeuron*> fOutputNeurons; // cache this for fast acce
ss | | std::vector<TNeuron*> fOutputNeurons; // cache this for fast acce
ss | |
| TString fLayerSpec; // layout specification opt
ion | | TString fLayerSpec; // layout specification opt
ion | |
|
| | | Int_t fRandomSeed; // random seed for initial
synapse weights | |
| | | | |
| // some static flags | | // some static flags | |
| static const Bool_t fgDEBUG = kTRUE; // debug flag | | static const Bool_t fgDEBUG = kTRUE; // debug flag | |
|
| static const Bool_t fgFIXED_SEED = kFALSE; // fix rand generator see
d | | | |
| | | | |
| ClassDef(MethodANNBase,0) // Base class for TMVA ANNs | | ClassDef(MethodANNBase,0) // Base class for TMVA ANNs | |
| }; | | }; | |
| | | | |
| } // namespace TMVA | | } // namespace TMVA | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 9 change blocks. |
| 4 lines changed or deleted | | 20 lines changed or added | |
|
| MethodBDT.h | | MethodBDT.h | |
|
| // @(#)root/tmva $Id: MethodBDT.h 31574 2009-12-05 18:23:21Z stelzer $ | | // @(#)root/tmva $Id: MethodBDT.h 33939 2010-06-16 09:44:12Z rdm $ | |
| // Author: Andreas Hoecker, Joerg Stelzer, Helge Voss, Kai Voss | | // Author: Andreas Hoecker, Joerg Stelzer, Helge Voss, Kai Voss | |
| | | | |
| /**************************************************************************
******** | | /**************************************************************************
******** | |
| * Project: TMVA - a Root-integrated toolkit for multivariate data analysis
* | | * Project: TMVA - a Root-integrated toolkit for multivariate data analysis
* | |
| * Package: TMVA
* | | * Package: TMVA
* | |
| * Class : MethodBDT (Boosted Decision Trees)
* | | * Class : MethodBDT (Boosted Decision Trees)
* | |
| * Web : http://tmva.sourceforge.net
* | | * Web : http://tmva.sourceforge.net
* | |
| *
* | | *
* | |
| * Description:
* | | * Description:
* | |
| * Analysis of Boosted Decision Trees
* | | * Analysis of Boosted Decision Trees
* | |
| | | | |
| skipping to change at line 103 | | skipping to change at line 103 | |
| // read weights from file | | // read weights from file | |
| void ReadWeightsFromStream( istream& istr ); | | void ReadWeightsFromStream( istream& istr ); | |
| void ReadWeightsFromXML(void* parent); | | void ReadWeightsFromXML(void* parent); | |
| | | | |
| // write method specific histos to target file | | // write method specific histos to target file | |
| void WriteMonitoringHistosToFile( void ) const; | | void WriteMonitoringHistosToFile( void ) const; | |
| | | | |
| // calculate the MVA value | | // calculate the MVA value | |
| Double_t GetMvaValue( Double_t* err = 0); | | Double_t GetMvaValue( Double_t* err = 0); | |
| Double_t GetMvaValue( Double_t* err , UInt_t useNTrees ); | | Double_t GetMvaValue( Double_t* err , UInt_t useNTrees ); | |
|
| | | const std::vector<Float_t>& GetMulticlassValues(); | |
| | | | |
| // regression response | | // regression response | |
| const std::vector<Float_t>& GetRegressionValues(); | | const std::vector<Float_t>& GetRegressionValues(); | |
| | | | |
| // apply the boost algorithm to a tree in the collection | | // apply the boost algorithm to a tree in the collection | |
|
| Double_t Boost( std::vector<TMVA::Event*>, DecisionTree *dt, Int_t iT
ree ); | | Double_t Boost( std::vector<TMVA::Event*>, DecisionTree *dt, Int_t iT
ree, UInt_t cls = 0); | |
| | | | |
| // ranking of input variables | | // ranking of input variables | |
| const Ranking* CreateRanking(); | | const Ranking* CreateRanking(); | |
| | | | |
| // the option handling methods | | // the option handling methods | |
| void DeclareOptions(); | | void DeclareOptions(); | |
| void ProcessOptions(); | | void ProcessOptions(); | |
| | | | |
| // get the forest | | // get the forest | |
| inline const std::vector<TMVA::DecisionTree*> & GetForest() const; | | inline const std::vector<TMVA::DecisionTree*> & GetForest() const; | |
| | | | |
| skipping to change at line 164 | | skipping to change at line 165 | |
| | | | |
| // boosting special for regression | | // boosting special for regression | |
| Double_t RegBoost( std::vector<TMVA::Event*>, DecisionTree *dt ); | | Double_t RegBoost( std::vector<TMVA::Event*>, DecisionTree *dt ); | |
| | | | |
| // adaboost adapted to regression | | // adaboost adapted to regression | |
| Double_t AdaBoostR2( std::vector<TMVA::Event*>, DecisionTree *dt ); | | Double_t AdaBoostR2( std::vector<TMVA::Event*>, DecisionTree *dt ); | |
| | | | |
| // binomial likelihood gradient boost for classification | | // binomial likelihood gradient boost for classification | |
| // (see Friedman: "Greedy Function Approximation: a Gradient Boosting
Machine" | | // (see Friedman: "Greedy Function Approximation: a Gradient Boosting
Machine" | |
| // Technical report, Dept. of Statistics, Stanford University) | | // Technical report, Dept. of Statistics, Stanford University) | |
|
| Double_t GradBoost( std::vector<TMVA::Event*>, DecisionTree *dt ); | | Double_t GradBoost( std::vector<TMVA::Event*>, DecisionTree *dt, UInt
_t cls = 0); | |
| Double_t GradBoostRegression(std::vector<TMVA::Event*>, DecisionTree
*dt ); | | Double_t GradBoostRegression(std::vector<TMVA::Event*>, DecisionTree
*dt ); | |
| void InitGradBoost( std::vector<TMVA::Event*>); | | void InitGradBoost( std::vector<TMVA::Event*>); | |
|
| void UpdateTargets( std::vector<TMVA::Event*>); | | void UpdateTargets( std::vector<TMVA::Event*>, UInt_t cls = 0); | |
| void UpdateTargetsRegression( std::vector<TMVA::Event*>,Bool_t first=
kFALSE); | | void UpdateTargetsRegression( std::vector<TMVA::Event*>,Bool_t first=
kFALSE); | |
| Double_t GetGradBoostMVA(TMVA::Event& e, UInt_t nTrees); | | Double_t GetGradBoostMVA(TMVA::Event& e, UInt_t nTrees); | |
| void GetRandomSubSample(); | | void GetRandomSubSample(); | |
|
| Double_t GetWeightedQuantile(std::vector<std::vector<Double_t> > &vec
, const Double_t quantile, const Double_t SumOfWeights = 0.0); | | Double_t GetWeightedQuantile(std::vector<std::pair<Double_t, Double_t
> > vec, const Double_t quantile, const Double_t SumOfWeights = 0.0); | |
| | | | |
| std::vector<TMVA::Event*> fEventSample; // the training eve
nts | | std::vector<TMVA::Event*> fEventSample; // the training eve
nts | |
| std::vector<TMVA::Event*> fValidationSample;// the Validation e
vents | | std::vector<TMVA::Event*> fValidationSample;// the Validation e
vents | |
| std::vector<TMVA::Event*> fSubSample; // subsample for ba
gged grad boost | | std::vector<TMVA::Event*> fSubSample; // subsample for ba
gged grad boost | |
|
| | | | |
| Int_t fNTrees; // number of decisi
on trees requested | | Int_t fNTrees; // number of decisi
on trees requested | |
| std::vector<DecisionTree*> fForest; // the collection o
f decision trees | | std::vector<DecisionTree*> fForest; // the collection o
f decision trees | |
| std::vector<double> fBoostWeights; // the weights appl
ied in the individual boosts | | std::vector<double> fBoostWeights; // the weights appl
ied in the individual boosts | |
|
| std::vector<double> fInitialWeights; // the initial even | | | |
| t weights | | | |
| std::vector<double> fRegResiduals; // temporary storag | | | |
| e for regression residuals | | | |
| TString fBoostType; // string specifyin
g the boost type | | TString fBoostType; // string specifyin
g the boost type | |
|
| Double_t fSumOfWeights; // total sum of all
event weights | | | |
| Double_t fAdaBoostBeta; // beta parameter f
or AdaBoost algorithm | | Double_t fAdaBoostBeta; // beta parameter f
or AdaBoost algorithm | |
| TString fAdaBoostR2Loss; // loss type used i
n AdaBoostR2 (Linear,Quadratic or Exponential) | | TString fAdaBoostR2Loss; // loss type used i
n AdaBoostR2 (Linear,Quadratic or Exponential) | |
| Double_t fTransitionPoint; // break-down point
for gradient regression | | Double_t fTransitionPoint; // break-down point
for gradient regression | |
| Double_t fShrinkage; // learning rate fo
r gradient boost; | | Double_t fShrinkage; // learning rate fo
r gradient boost; | |
| Bool_t fBaggedGradBoost; // turn bagging in
combination with grad boost on/off | | Bool_t fBaggedGradBoost; // turn bagging in
combination with grad boost on/off | |
| Double_t fSampleFraction; // fraction of even
ts used for bagged grad boost | | Double_t fSampleFraction; // fraction of even
ts used for bagged grad boost | |
|
| | | Double_t fSumOfWeights; // sum of all event | |
| | | weights | |
| | | std::vector<std::pair<Double_t, Double_t> > fWeightedResiduals; | |
| | | // weighted regression residuals | |
| | | std::map< TMVA::Event*,std::vector<double> > fResiduals; // individua | |
| | | l event residuals for gradient boost | |
| | | | |
| //options for the decision Tree | | //options for the decision Tree | |
| SeparationBase *fSepType; // the separation u
sed in node splitting | | SeparationBase *fSepType; // the separation u
sed in node splitting | |
| TString fSepTypeS; // the separation (
option string) used in node splitting | | TString fSepTypeS; // the separation (
option string) used in node splitting | |
| Int_t fNodeMinEvents; // min number of ev
ents in node | | Int_t fNodeMinEvents; // min number of ev
ents in node | |
| | | | |
| Int_t fNCuts; // grid used in cut
applied in node splitting | | Int_t fNCuts; // grid used in cut
applied in node splitting | |
| Bool_t fUseYesNoLeaf; // use sig or bkg c
lassification in leave nodes or sig/bkg | | Bool_t fUseYesNoLeaf; // use sig or bkg c
lassification in leave nodes or sig/bkg | |
| Double_t fNodePurityLimit; // purity limit for
sig/bkg nodes | | Double_t fNodePurityLimit; // purity limit for
sig/bkg nodes | |
| Bool_t fUseWeightedTrees;// use average clas
sification from the trees, or have the individual trees trees in the forest
weighted (e.g. log(boostweight) from AdaBoost | | Bool_t fUseWeightedTrees;// use average clas
sification from the trees, or have the individual trees trees in the forest
weighted (e.g. log(boostweight) from AdaBoost | |
| | | | |
End of changes. 10 change blocks. |
| 11 lines changed or deleted | | 12 lines changed or added | |
|
| MethodBase.h | | MethodBase.h | |
|
| // @(#)root/tmva $Id: MethodBase.h 31574 2009-12-05 18:23:21Z stelzer $ | | // @(#)root/tmva $Id: MethodBase.h 34022 2010-06-21 15:52:50Z stelzer $ | |
| // Author: Andreas Hoecker, Joerg Stelzer, Helge Voss, Kai Voss | | // Author: Andreas Hoecker, Peter Speckmayer, Joerg Stelzer, Helge Voss, Ka | |
| | | i Voss | |
| | | | |
| /**************************************************************************
******** | | /**************************************************************************
******** | |
| * Project: TMVA - a Root-integrated toolkit for multivariate data analysis
* | | * Project: TMVA - a Root-integrated toolkit for multivariate data analysis
* | |
| * Package: TMVA
* | | * Package: TMVA
* | |
| * Class : MethodBase
* | | * Class : MethodBase
* | |
| * Web : http://tmva.sourceforge.net
* | | * Web : http://tmva.sourceforge.net
* | |
| *
* | | *
* | |
| * Description:
* | | * Description:
* | |
| * Virtual base class for all MVA method
* | | * Virtual base class for all MVA method
* | |
| *
* | | *
* | |
| | | | |
| skipping to change at line 129 | | skipping to change at line 129 | |
| void SetTrainTime( Double_t trainTime ) { fTrainTime = tr
ainTime; } | | void SetTrainTime( Double_t trainTime ) { fTrainTime = tr
ainTime; } | |
| Double_t GetTrainTime() const { return fTrainTime; } | | Double_t GetTrainTime() const { return fTrainTime; } | |
| | | | |
| // store and retrieve time used for testing | | // store and retrieve time used for testing | |
| void SetTestTime ( Double_t testTime ) { fTestTime = test
Time; } | | void SetTestTime ( Double_t testTime ) { fTestTime = test
Time; } | |
| Double_t GetTestTime () const { return fTestTime; } | | Double_t GetTestTime () const { return fTestTime; } | |
| | | | |
| // performs classifier testing | | // performs classifier testing | |
| virtual void TestClassification(); | | virtual void TestClassification(); | |
| | | | |
|
| | | // performs multiclass classifier testing | |
| | | virtual void TestMulticlass(); | |
| | | | |
| // performs regression testing | | // performs regression testing | |
| virtual void TestRegression( Double_t& bias, Double_t& biasT, | | virtual void TestRegression( Double_t& bias, Double_t& biasT, | |
| Double_t& dev, Double_t& devT, | | Double_t& dev, Double_t& devT, | |
| Double_t& rms, Double_t& rmsT, | | Double_t& rms, Double_t& rmsT, | |
| Double_t& mInf, Double_t& mInfT, //
mutual information | | Double_t& mInf, Double_t& mInfT, //
mutual information | |
| Double_t& corr, | | Double_t& corr, | |
| Types::ETreeType type ); | | Types::ETreeType type ); | |
| | | | |
|
| // classifier response - some methods may return a per-event error es | | | |
| timate (unless: *err = -1) | | | |
| virtual Double_t GetMvaValue( Double_t* err = 0 ) = 0; | | | |
| | | | |
| Double_t GetMvaValue( const TMVA::Event* const ev, Double_t* err = 0 | | | |
| ); | | | |
| | | | |
| // options treatment | | // options treatment | |
| virtual void Init() = 0; | | virtual void Init() = 0; | |
| virtual void DeclareOptions() = 0; | | virtual void DeclareOptions() = 0; | |
| virtual void ProcessOptions() = 0; | | virtual void ProcessOptions() = 0; | |
| virtual void DeclareCompatibilityOptions(); // declaration of pas
t options | | virtual void DeclareCompatibilityOptions(); // declaration of pas
t options | |
| | | | |
|
| | | // classifier response - some methods may return a per-event error es | |
| | | timate (unless: *err = -1) | |
| | | virtual Double_t GetMvaValue( Double_t* err = 0 ) = 0; | |
| | | | |
| | | //zjh=> | |
| | | virtual Double_t GetMvaValues( Double_t& errUpper, Double_t& errLower | |
| | | ) | |
| | | {Double_t mva=GetMvaValue(&errUpper); errLower=errUpper;re | |
| | | turn mva;} | |
| | | //<=zjh | |
| | | | |
| | | // signal/background classification response | |
| | | Double_t GetMvaValue( const TMVA::Event* const ev, Double_t* err = 0 | |
| | | ); | |
| | | | |
| // regression response | | // regression response | |
| virtual const std::vector<Float_t>& GetRegressionValues() { | | virtual const std::vector<Float_t>& GetRegressionValues() { | |
| std::vector<Float_t>* ptr = new std::vector<Float_t>(0); | | std::vector<Float_t>* ptr = new std::vector<Float_t>(0); | |
| return (*ptr); | | return (*ptr); | |
| } | | } | |
| | | | |
|
| | | // multiclass classification response | |
| | | virtual const std::vector<Float_t>& GetMulticlassValues() { | |
| | | std::vector<Float_t>* ptr = new std::vector<Float_t>(0); | |
| | | return (*ptr); | |
| | | } | |
| | | | |
| // probability of classifier response (mvaval) to be signal (requires
"CreateMvaPdf" option set) | | // probability of classifier response (mvaval) to be signal (requires
"CreateMvaPdf" option set) | |
| virtual Double_t GetProba( Double_t mvaVal, Double_t ap_sig ); | | virtual Double_t GetProba( Double_t mvaVal, Double_t ap_sig ); | |
| | | | |
| // Rarity of classifier response (signal or background (default) is u
niform in [0,1]) | | // Rarity of classifier response (signal or background (default) is u
niform in [0,1]) | |
| virtual Double_t GetRarity( Double_t mvaVal, Types::ESBType reftype =
Types::kBackground ) const; | | virtual Double_t GetRarity( Double_t mvaVal, Types::ESBType reftype =
Types::kBackground ) const; | |
| | | | |
| // create ranking | | // create ranking | |
| virtual const Ranking* CreateRanking() = 0; | | virtual const Ranking* CreateRanking() = 0; | |
| | | | |
| // perfrom extra actions during the boosting at different stages | | // perfrom extra actions during the boosting at different stages | |
| | | | |
| skipping to change at line 194 | | skipping to change at line 209 | |
| virtual void ReadWeightsFromStream( TFile& ) {} // bac
kward compatibility | | virtual void ReadWeightsFromStream( TFile& ) {} // bac
kward compatibility | |
| | | | |
| private: | | private: | |
| friend class MethodCategory; | | friend class MethodCategory; | |
| friend class MethodCommittee; | | friend class MethodCommittee; | |
| friend class MethodCompositeBase; | | friend class MethodCompositeBase; | |
| void WriteStateToXML ( void* parent ) const; | | void WriteStateToXML ( void* parent ) const; | |
| void ReadStateFromXML ( void* parent ); | | void ReadStateFromXML ( void* parent ); | |
| void WriteStateToStream ( std::ostream& tf ) const; // needed for
MakeClass | | void WriteStateToStream ( std::ostream& tf ) const; // needed for
MakeClass | |
| void WriteVarsToStream ( std::ostream& tf, const TString& prefix =
"" ) const; // needed for MakeClass | | void WriteVarsToStream ( std::ostream& tf, const TString& prefix =
"" ) const; // needed for MakeClass | |
|
| | | | |
| | | public: // these two need to be public, they are used to read in-memory | |
| | | weight-files | |
| void ReadStateFromStream ( std::istream& tf ); // backward c
ompatibility | | void ReadStateFromStream ( std::istream& tf ); // backward c
ompatibility | |
| void ReadStateFromStream ( TFile& rf ); // backward c
ompatibility | | void ReadStateFromStream ( TFile& rf ); // backward c
ompatibility | |
|
| | | void ReadStateFromXMLString( const char* xmlstr ); // for readin
g from memory | |
| | | | |
|
| | | private: | |
| // the variable information | | // the variable information | |
| void AddVarsXMLTo ( void* parent ) const; | | void AddVarsXMLTo ( void* parent ) const; | |
| void AddSpectatorsXMLTo ( void* parent ) const; | | void AddSpectatorsXMLTo ( void* parent ) const; | |
| void AddTargetsXMLTo ( void* parent ) const; | | void AddTargetsXMLTo ( void* parent ) const; | |
| void ReadVariablesFromXML ( void* varnode ); | | void ReadVariablesFromXML ( void* varnode ); | |
| void ReadSpectatorsFromXML( void* specnode); | | void ReadSpectatorsFromXML( void* specnode); | |
| void ReadTargetsFromXML ( void* tarnode ); | | void ReadTargetsFromXML ( void* tarnode ); | |
| void ReadVarsFromStream ( std::istream& istr ); // backward c
ompatibility | | void ReadVarsFromStream ( std::istream& istr ); // backward c
ompatibility | |
| | | | |
| public: | | public: | |
| | | | |
| skipping to change at line 323 | | skipping to change at line 342 | |
| // the reference cut "xC" is taken to be where | | // the reference cut "xC" is taken to be where | |
| // Int_[-oo,xC] { PDF_S(x) dx } = Int_[xC,+oo] { PDF_B(x) dx } | | // Int_[-oo,xC] { PDF_S(x) dx } = Int_[xC,+oo] { PDF_B(x) dx } | |
| virtual Bool_t IsSignalLike() { return GetMvaValue() > GetSign
alReferenceCut() ? kTRUE : kFALSE; } | | virtual Bool_t IsSignalLike() { return GetMvaValue() > GetSign
alReferenceCut() ? kTRUE : kFALSE; } | |
| | | | |
| DataSet* Data() const { return DataInfo().GetDataSet(); } | | DataSet* Data() const { return DataInfo().GetDataSet(); } | |
| | | | |
| Bool_t HasMVAPdfs() const { return fHasMVAPdfs; } | | Bool_t HasMVAPdfs() const { return fHasMVAPdfs; } | |
| virtual void SetAnalysisType( Types::EAnalysisType type ) {
fAnalysisType = type; } | | virtual void SetAnalysisType( Types::EAnalysisType type ) {
fAnalysisType = type; } | |
| Types::EAnalysisType GetAnalysisType() const { return fAnalysisType;
} | | Types::EAnalysisType GetAnalysisType() const { return fAnalysisType;
} | |
| Bool_t DoRegression() const { return fAnalysisType ==
Types::kRegression; } | | Bool_t DoRegression() const { return fAnalysisType ==
Types::kRegression; } | |
|
| | | Bool_t DoMulticlass() const { return fAnalysisType ==
Types::kMulticlass; } | |
| | | | |
| // setter method for suppressing writing to XML and writing of standa
lone classes | | // setter method for suppressing writing to XML and writing of standa
lone classes | |
| void DisableWriting(Bool_t setter){ fDisableWriting
= setter; } | | void DisableWriting(Bool_t setter){ fDisableWriting
= setter; } | |
| | | | |
| protected: | | protected: | |
| | | | |
| // ---------- protected acccessors ----------------------------------
--------- | | // ---------- protected acccessors ----------------------------------
--------- | |
| | | | |
| //TDirectory* LocalTDir() const { return Data().LocalRootDir(); } | | //TDirectory* LocalTDir() const { return Data().LocalRootDir(); } | |
| | | | |
| | | | |
| skipping to change at line 370 | | skipping to change at line 390 | |
| | | | |
| protected: | | protected: | |
| | | | |
| // make ROOT-independent C++ class for classifier response (classifie
r-specific implementation) | | // make ROOT-independent C++ class for classifier response (classifie
r-specific implementation) | |
| virtual void MakeClassSpecific( std::ostream&, const TString& = "
" ) const {} | | virtual void MakeClassSpecific( std::ostream&, const TString& = "
" ) const {} | |
| | | | |
| // header and auxiliary classes | | // header and auxiliary classes | |
| virtual void MakeClassSpecificHeader( std::ostream&, const TStrin
g& = "" ) const {} | | virtual void MakeClassSpecificHeader( std::ostream&, const TStrin
g& = "" ) const {} | |
| | | | |
| // static pointer to this object - required for ROOT finder (to be so
lved differently) | | // static pointer to this object - required for ROOT finder (to be so
lved differently) | |
|
| static MethodBase* GetThisBase() { return fgThisBase; } | | static MethodBase* GetThisBase(); | |
| | | | |
| // some basic statistical analysis | | // some basic statistical analysis | |
| void Statistics( Types::ETreeType treeType, const TString& theVarName
, | | void Statistics( Types::ETreeType treeType, const TString& theVarName
, | |
| Double_t&, Double_t&, Double_t&, | | Double_t&, Double_t&, Double_t&, | |
| Double_t&, Double_t&, Double_t& ); | | Double_t&, Double_t&, Double_t& ); | |
| | | | |
| // if TRUE, write weights only to text files | | // if TRUE, write weights only to text files | |
| Bool_t TxtWeightsOnly() const { return kTRUE; } | | Bool_t TxtWeightsOnly() const { return kTRUE; } | |
| | | | |
| protected: | | protected: | |
| | | | |
| skipping to change at line 410 | | skipping to change at line 430 | |
| void DeclareBaseOptions(); | | void DeclareBaseOptions(); | |
| void ProcessBaseOptions(); | | void ProcessBaseOptions(); | |
| | | | |
| // used in efficiency computation | | // used in efficiency computation | |
| enum ECutOrientation { kNegative = -1, kPositive = +1 }; | | enum ECutOrientation { kNegative = -1, kPositive = +1 }; | |
| ECutOrientation GetCutOrientation() const { return fCutOrientation;
} | | ECutOrientation GetCutOrientation() const { return fCutOrientation;
} | |
| | | | |
| // ---------- private acccessors ------------------------------------
--------- | | // ---------- private acccessors ------------------------------------
--------- | |
| | | | |
| // reset required for RootFinder | | // reset required for RootFinder | |
|
| void ResetThisBase() { fgThisBase = this; } | | void ResetThisBase(); | |
| | | | |
| // ---------- private auxiliary methods -----------------------------
--------- | | // ---------- private auxiliary methods -----------------------------
--------- | |
| | | | |
| // PDFs for classifier response (required to compute signal probabili
ty and Rarity) | | // PDFs for classifier response (required to compute signal probabili
ty and Rarity) | |
| void CreateMVAPdfs(); | | void CreateMVAPdfs(); | |
| | | | |
| // for root finder | | // for root finder | |
| static Double_t IGetEffForRoot( Double_t ); // interface | | static Double_t IGetEffForRoot( Double_t ); // interface | |
| Double_t GetEffForRoot ( Double_t ); // implementation | | Double_t GetEffForRoot ( Double_t ); // implementation | |
| | | | |
| // used for file parsing | | // used for file parsing | |
| Bool_t GetLine( std::istream& fin, char * buf ); | | Bool_t GetLine( std::istream& fin, char * buf ); | |
| | | | |
| // fill test tree with classification or regression results | | // fill test tree with classification or regression results | |
| virtual void AddClassifierOutput ( Types::ETreeType type ); | | virtual void AddClassifierOutput ( Types::ETreeType type ); | |
| virtual void AddClassifierOutputProb( Types::ETreeType type ); | | virtual void AddClassifierOutputProb( Types::ETreeType type ); | |
| virtual void AddRegressionOutput ( Types::ETreeType type ); | | virtual void AddRegressionOutput ( Types::ETreeType type ); | |
|
| | | virtual void AddMulticlassOutput ( Types::ETreeType type ); | |
| | | | |
| private: | | private: | |
| | | | |
| void AddInfoItem( void* gi, const TString& name, const TS
tring& value) const; | | void AddInfoItem( void* gi, const TString& name, const TS
tring& value) const; | |
| void CreateVariableTransforms(const TString& trafoDefinit
ion ); | | void CreateVariableTransforms(const TString& trafoDefinit
ion ); | |
| | | | |
| // ========== class members =========================================
========= | | // ========== class members =========================================
========= | |
| | | | |
| protected: | | protected: | |
| | | | |
| // direct accessors | | // direct accessors | |
| Ranking* fRanking; // pointer to ranking ob
ject (created by derived classifiers) | | Ranking* fRanking; // pointer to ranking ob
ject (created by derived classifiers) | |
| std::vector<TString>* fInputVars; // vector of input varia
bles used in MVA | | std::vector<TString>* fInputVars; // vector of input varia
bles used in MVA | |
| | | | |
| // histogram binning | | // histogram binning | |
| Int_t fNbins; // number of bins in rep
resentative histograms | | Int_t fNbins; // number of bins in rep
resentative histograms | |
| Int_t fNbinsH; // number of bins in eva
luation histograms | | Int_t fNbinsH; // number of bins in eva
luation histograms | |
| | | | |
| Types::EAnalysisType fAnalysisType; // method-mode : true --
> regression, false --> classification | | Types::EAnalysisType fAnalysisType; // method-mode : true --
> regression, false --> classification | |
| | | | |
|
| std::vector<Float_t>* fRegressionReturnVal; // holds the return-valu | | std::vector<Float_t>* fRegressionReturnVal; // holds the return-valu | |
| e for the regression | | es for the regression | |
| | | std::vector<Float_t>* fMulticlassReturnVal; // holds the return-valu | |
| | | es for the multiclass classification | |
| | | | |
| private: | | private: | |
| | | | |
| // MethodCuts redefines some of the evaluation variables and histogra
ms -> must access private members | | // MethodCuts redefines some of the evaluation variables and histogra
ms -> must access private members | |
| friend class MethodCuts; | | friend class MethodCuts; | |
| | | | |
| Bool_t fDisableWriting; //! set to true in order to s
uppress writing to XML | | Bool_t fDisableWriting; //! set to true in order to s
uppress writing to XML | |
| | | | |
| // data sets | | // data sets | |
| DataSetInfo& fDataSetInfo; //! the data set information (
sometimes needed) | | DataSetInfo& fDataSetInfo; //! the data set information (
sometimes needed) | |
| | | | |
| skipping to change at line 557 | | skipping to change at line 579 | |
| mutable std::vector<const std::vector<TMVA::Event*>*> fEventCollectio
ns; // if the method needs the complete event-collection, the transformed e
vent coll. ist stored here. | | mutable std::vector<const std::vector<TMVA::Event*>*> fEventCollectio
ns; // if the method needs the complete event-collection, the transformed e
vent coll. ist stored here. | |
| | | | |
| public: | | public: | |
| Bool_t fSetupCompleted; // is method setup | | Bool_t fSetupCompleted; // is method setup | |
| | | | |
| private: | | private: | |
| | | | |
| // this carrier | | // this carrier | |
| static MethodBase* fgThisBase; // this pointer | | static MethodBase* fgThisBase; // this pointer | |
| | | | |
|
| // ===== depriciated options, kept for backward compatibility ===== | | // ===== depreciated options, kept for backward compatibility ===== | |
| private: | | private: | |
| | | | |
| Bool_t fNormalise; // normalise input var
iables | | Bool_t fNormalise; // normalise input var
iables | |
| Bool_t fUseDecorr; // synonymous for deco
rrelation | | Bool_t fUseDecorr; // synonymous for deco
rrelation | |
| TString fVariableTransformTypeString; // labels variable tra
nsform type | | TString fVariableTransformTypeString; // labels variable tra
nsform type | |
| Bool_t fTxtWeightsOnly; // if TRUE, write weig
hts only to text files | | Bool_t fTxtWeightsOnly; // if TRUE, write weig
hts only to text files | |
| Int_t fNbinsMVAPdf; // number of bins used
in histogram that creates PDF | | Int_t fNbinsMVAPdf; // number of bins used
in histogram that creates PDF | |
| Int_t fNsmoothMVAPdf; // number of times a h
istogram is smoothed before creating the PDF | | Int_t fNsmoothMVAPdf; // number of times a h
istogram is smoothed before creating the PDF | |
| | | | |
| protected: | | protected: | |
| | | | |
End of changes. 14 change blocks. |
| 14 lines changed or deleted | | 41 lines changed or added | |
|
| MethodFDA.h | | MethodFDA.h | |
|
| // @(#)root/tmva $Id: MethodFDA.h 31458 2009-11-30 13:58:20Z stelzer $ | | // @(#)root/tmva $Id: MethodFDA.h 33928 2010-06-15 16:19:31Z stelzer $ | |
| // Author: Andreas Hoecker, Peter Speckmayer | | // Author: Andreas Hoecker, Peter Speckmayer | |
| | | | |
| /**************************************************************************
******** | | /**************************************************************************
******** | |
| * Project: TMVA - a Root-integrated toolkit for multivariate data analysis
* | | * Project: TMVA - a Root-integrated toolkit for multivariate data analysis
* | |
| * Package: TMVA
* | | * Package: TMVA
* | |
| * Class : MethodFDA
* | | * Class : MethodFDA
* | |
| * Web : http://tmva.sourceforge.net
* | | * Web : http://tmva.sourceforge.net
* | |
| *
* | | *
* | |
| * Description:
* | | * Description:
* | |
| * Function discriminant analysis (FDA). This simple classifier
* | | * Function discriminant analysis (FDA). This simple classifier
* | |
| * fits any user-defined TFormula (via option configuration string) to
* | | * fits any user-defined TFormula (via option configuration string) to
* | |
| * the training data by requiring a formula response of 1 (0) to signa
l * | | * the training data by requiring a formula response of 1 (0) to signa
l * | |
| * (background) events. The parameter fitting is done via the abstract
* | | * (background) events. The parameter fitting is done via the abstract
* | |
| * class FitterBase, featuring Monte Carlo sampling, Genetic
* | | * class FitterBase, featuring Monte Carlo sampling, Genetic
* | |
| * Algorithm, Simulated Annealing, MINUIT and combinations of these.
* | | * Algorithm, Simulated Annealing, MINUIT and combinations of these.
* | |
| *
* | | *
* | |
| * Authors (alphabetical):
* | | * Authors (alphabetical):
* | |
| * Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland
* | | * Andreas Hoecker <Andreas.Hocker@cern.ch> - CERN, Switzerland
* | |
| * Peter Speckmayer <speckmay@mail.cern.ch> - CERN, Switzerland
* | | * Peter Speckmayer <speckmay@mail.cern.ch> - CERN, Switzerland
* | |
| *
* | | *
* | |
|
| * Copyright (c) 2005-2006:
* | | * Copyright (c) 2005-2010:
* | |
| * CERN, Switzerland
* | | * CERN, Switzerland
* | |
| * MPI-K Heidelberg, Germany
* | | * MPI-K Heidelberg, Germany
* | |
| *
* | | *
* | |
| * Redistribution and use in source and binary forms, with or without
* | | * Redistribution and use in source and binary forms, with or without
* | |
| * modification, are permitted according to the terms listed in LICENSE
* | | * modification, are permitted according to the terms listed in LICENSE
* | |
| * (http://tmva.sourceforge.net/LICENSE)
* | | * (http://tmva.sourceforge.net/LICENSE)
* | |
| **************************************************************************
********/ | | **************************************************************************
********/ | |
| | | | |
| #ifndef ROOT_TMVA_MethodFDA | | #ifndef ROOT_TMVA_MethodFDA | |
| #define ROOT_TMVA_MethodFDA | | #define ROOT_TMVA_MethodFDA | |
| | | | |
| skipping to change at line 95 | | skipping to change at line 95 | |
| using MethodBase::ReadWeightsFromStream; | | using MethodBase::ReadWeightsFromStream; | |
| | | | |
| void AddWeightsXMLTo ( void* parent ) const; | | void AddWeightsXMLTo ( void* parent ) const; | |
| | | | |
| void ReadWeightsFromStream( std::istream & i ); | | void ReadWeightsFromStream( std::istream & i ); | |
| void ReadWeightsFromXML ( void* wghtnode ); | | void ReadWeightsFromXML ( void* wghtnode ); | |
| | | | |
| // calculate the MVA value | | // calculate the MVA value | |
| Double_t GetMvaValue( Double_t* err = 0 ); | | Double_t GetMvaValue( Double_t* err = 0 ); | |
| | | | |
|
| std::vector<Float_t>& GetRegressionValues(); | | virtual const std::vector<Float_t>& GetRegressionValues(); | |
| | | virtual const std::vector<Float_t>& GetMulticlassValues(); | |
| | | | |
| void Init( void ); | | void Init( void ); | |
| | | | |
| // ranking of input variables | | // ranking of input variables | |
| const Ranking* CreateRanking() { return 0; } | | const Ranking* CreateRanking() { return 0; } | |
| | | | |
| Double_t EstimatorFunction( std::vector<Double_t>& ); | | Double_t EstimatorFunction( std::vector<Double_t>& ); | |
| | | | |
| // no check of options at this place | | // no check of options at this place | |
| void CheckSetup() {} | | void CheckSetup() {} | |
| | | | |
| skipping to change at line 117 | | skipping to change at line 118 | |
| protected: | | protected: | |
| | | | |
| // make ROOT-independent C++ class for classifier response (classifie
r-specific implementation) | | // make ROOT-independent C++ class for classifier response (classifie
r-specific implementation) | |
| void MakeClassSpecific( std::ostream&, const TString& ) const; | | void MakeClassSpecific( std::ostream&, const TString& ) const; | |
| | | | |
| // get help message text | | // get help message text | |
| void GetHelpMessage() const; | | void GetHelpMessage() const; | |
| | | | |
| private: | | private: | |
| | | | |
|
| | | // compute multiclass values | |
| | | void CalculateMulticlassValues( const TMVA::Event*& evt, std::vector< | |
| | | Double_t>& parameters, std::vector<Float_t>& values); | |
| | | | |
| // create and interpret formula expression and compute estimator | | // create and interpret formula expression and compute estimator | |
| void CreateFormula (); | | void CreateFormula (); | |
|
| Double_t InterpretFormula( const Event*, std::vector<Double_t>& pars
); | | Double_t InterpretFormula( const Event*, std::vector<Double_t>::itera
tor begin, std::vector<Double_t>::iterator end ); | |
| | | | |
| // clean up | | // clean up | |
| void ClearAll(); | | void ClearAll(); | |
| | | | |
| // print fit results | | // print fit results | |
| void PrintResults( const TString&, std::vector<Double_t>&, const Doub
le_t ) const; | | void PrintResults( const TString&, std::vector<Double_t>&, const Doub
le_t ) const; | |
| | | | |
| // the option handling methods | | // the option handling methods | |
| void DeclareOptions(); | | void DeclareOptions(); | |
| void ProcessOptions(); | | void ProcessOptions(); | |
| | | | |
| TString fFormulaStringP; // string with function | | TString fFormulaStringP; // string with function | |
| TString fParRangeStringP; // string with ranges of
parameters | | TString fParRangeStringP; // string with ranges of
parameters | |
| TString fFormulaStringT; // string with function | | TString fFormulaStringT; // string with function | |
| TString fParRangeStringT; // string with ranges of
parameters | | TString fParRangeStringT; // string with ranges of
parameters | |
| | | | |
| TFormula* fFormula; // the discrimination fun
ction | | TFormula* fFormula; // the discrimination fun
ction | |
|
| Int_t fNPars; // number of parameters | | UInt_t fNPars; // number of parameters | |
| std::vector<Interval*> fParRange; // ranges of parameters | | std::vector<Interval*> fParRange; // ranges of parameters | |
| std::vector<Double_t> fBestPars; // the pars that optimise
(minimise) the estimator | | std::vector<Double_t> fBestPars; // the pars that optimise
(minimise) the estimator | |
| TString fFitMethod; // estimator optimisation
method | | TString fFitMethod; // estimator optimisation
method | |
| TString fConverger; // fitmethod uses fConver
ger as intermediate step to converge into local minimas | | TString fConverger; // fitmethod uses fConver
ger as intermediate step to converge into local minimas | |
| FitterBase* fFitter; // the fitter used in the
training | | FitterBase* fFitter; // the fitter used in the
training | |
| IFitterTarget* fConvergerFitter; // intermediate fitter | | IFitterTarget* fConvergerFitter; // intermediate fitter | |
| | | | |
| // sum of weights (this should become centrally available through the
dataset) | | // sum of weights (this should become centrally available through the
dataset) | |
| Double_t fSumOfWeightsSig; // sum of weights (signal
) | | Double_t fSumOfWeightsSig; // sum of weights (signal
) | |
| Double_t fSumOfWeightsBkg; // sum of weights (backgr
ound) | | Double_t fSumOfWeightsBkg; // sum of weights (backgr
ound) | |
| Double_t fSumOfWeights; // sum of weights | | Double_t fSumOfWeights; // sum of weights | |
| | | | |
|
| | | // | |
| | | Int_t fOutputDimensions; // number of output value | |
| | | s | |
| | | | |
| ClassDef(MethodFDA,0) // Function Discriminant Analysis | | ClassDef(MethodFDA,0) // Function Discriminant Analysis | |
| }; | | }; | |
| | | | |
| } // namespace TMVA | | } // namespace TMVA | |
| | | | |
| #endif // MethodFDA_H | | #endif // MethodFDA_H | |
| | | | |
End of changes. 7 change blocks. |
| 5 lines changed or deleted | | 14 lines changed or added | |
|
| MethodMLP.h | | MethodMLP.h | |
|
| // @(#)root/tmva $Id: MethodMLP.h 31458 2009-11-30 13:58:20Z stelzer $ | | // @(#)root/tmva $Id: MethodMLP.h 33928 2010-06-15 16:19:31Z stelzer $ | |
| // Author: Andreas Hoecker, Matt Jachowski | | // Author: Andreas Hoecker, Peter Speckmayer, Matt Jachowski | |
| | | | |
| /**************************************************************************
******** | | /**************************************************************************
******** | |
| * Project: TMVA - a Root-integrated toolkit for multivariate data analysis
* | | * Project: TMVA - a Root-integrated toolkit for multivariate data analysis
* | |
| * Package: TMVA
* | | * Package: TMVA
* | |
| * Class : MethodMLP
* | | * Class : MethodMLP
* | |
| * Web : http://tmva.sourceforge.net
* | | * Web : http://tmva.sourceforge.net
* | |
| *
* | | *
* | |
| * Description:
* | | * Description:
* | |
| * ANN Multilayer Perceptron class for the discrimination of signal
* | | * ANN Multilayer Perceptron class for the discrimination of signal
* | |
| * from background. BFGS implementation based on TMultiLayerPerceptro
n * | | * from background. BFGS implementation based on TMultiLayerPerceptro
n * | |
| | | | |
| skipping to change at line 114 | | skipping to change at line 114 | |
| | | | |
| void Train() { Train(NumCycles()); } | | void Train() { Train(NumCycles()); } | |
| | | | |
| // for GA | | // for GA | |
| Double_t ComputeEstimator ( std::vector<Double_t>& parameters ); | | Double_t ComputeEstimator ( std::vector<Double_t>& parameters ); | |
| Double_t EstimatorFunction( std::vector<Double_t>& parameters ); | | Double_t EstimatorFunction( std::vector<Double_t>& parameters ); | |
| | | | |
| enum ETrainingMethod { kBP=0, kBFGS, kGA }; | | enum ETrainingMethod { kBP=0, kBFGS, kGA }; | |
| enum EBPTrainingMode { kSequential=0, kBatch }; | | enum EBPTrainingMode { kSequential=0, kBatch }; | |
| | | | |
|
| | | Double_t GetMvaValues( Double_t& errUpper, Double_t& errLower ); | |
| | | //zjh | |
| | | | |
| protected: | | protected: | |
| | | | |
| // make ROOT-independent C++ class for classifier response (classifie
r-specific implementation) | | // make ROOT-independent C++ class for classifier response (classifie
r-specific implementation) | |
| void MakeClassSpecific( std::ostream&, const TString& ) const; | | void MakeClassSpecific( std::ostream&, const TString& ) const; | |
| | | | |
| // get help message text | | // get help message text | |
| void GetHelpMessage() const; | | void GetHelpMessage() const; | |
| | | | |
| private: | | private: | |
| | | | |
| | | | |
| skipping to change at line 143 | | skipping to change at line 145 | |
| // used as a measure of success in all minimization techniques | | // used as a measure of success in all minimization techniques | |
| Double_t CalculateEstimator( Types::ETreeType treeType = Types::kTrai
ning, Int_t iEpoch = -1 ); | | Double_t CalculateEstimator( Types::ETreeType treeType = Types::kTrai
ning, Int_t iEpoch = -1 ); | |
| | | | |
| // BFGS functions | | // BFGS functions | |
| void BFGSMinimize( Int_t nEpochs ); | | void BFGSMinimize( Int_t nEpochs ); | |
| void SetGammaDelta( TMatrixD &Gamma, TMatrixD &Delta, std::vector
<Double_t> &Buffer ); | | void SetGammaDelta( TMatrixD &Gamma, TMatrixD &Delta, std::vector
<Double_t> &Buffer ); | |
| void SteepestDir( TMatrixD &Dir ); | | void SteepestDir( TMatrixD &Dir ); | |
| Bool_t GetHessian( TMatrixD &Hessian, TMatrixD &Gamma, TMatrixD &De
lta ); | | Bool_t GetHessian( TMatrixD &Hessian, TMatrixD &Gamma, TMatrixD &De
lta ); | |
| void SetDir( TMatrixD &Hessian, TMatrixD &Dir ); | | void SetDir( TMatrixD &Hessian, TMatrixD &Dir ); | |
| Double_t DerivDir( TMatrixD &Dir ); | | Double_t DerivDir( TMatrixD &Dir ); | |
|
| Bool_t LineSearch( TMatrixD &Dir, std::vector<Double_t> &Buffer ); | | Bool_t LineSearch( TMatrixD &Dir, std::vector<Double_t> &Buffer, Do
uble_t* dError=0 ); //zjh | |
| void ComputeDEDw(); | | void ComputeDEDw(); | |
| void SimulateEvent( const Event* ev ); | | void SimulateEvent( const Event* ev ); | |
| void SetDirWeights( std::vector<Double_t> &Origin, TMatrixD &Dir,
Double_t alpha ); | | void SetDirWeights( std::vector<Double_t> &Origin, TMatrixD &Dir,
Double_t alpha ); | |
| Double_t GetError(); | | Double_t GetError(); | |
|
| Double_t GetSqrErr( const Event* ev, UInt_t index = 0 ); | | Double_t GetMSEErr( const Event* ev, UInt_t index = 0 ); //zjh | |
| | | Double_t GetCEErr( const Event* ev, UInt_t index = 0 ); //zjh | |
| | | | |
| // backpropagation functions | | // backpropagation functions | |
| void BackPropagationMinimize( Int_t nEpochs ); | | void BackPropagationMinimize( Int_t nEpochs ); | |
| void TrainOneEpoch(); | | void TrainOneEpoch(); | |
| void Shuffle( Int_t* index, Int_t n ); | | void Shuffle( Int_t* index, Int_t n ); | |
| void DecaySynapseWeights(Bool_t lateEpoch ); | | void DecaySynapseWeights(Bool_t lateEpoch ); | |
| void TrainOneEvent( Int_t ievt); | | void TrainOneEvent( Int_t ievt); | |
| Double_t GetDesiredOutput( const Event* ev ); | | Double_t GetDesiredOutput( const Event* ev ); | |
| void UpdateNetwork( Double_t desired, Double_t eventWeight=1.0 ); | | void UpdateNetwork( Double_t desired, Double_t eventWeight=1.0 ); | |
| void UpdateNetwork(std::vector<Float_t>& desired, Double_t eventW
eight=1.0); | | void UpdateNetwork(std::vector<Float_t>& desired, Double_t eventW
eight=1.0); | |
| | | | |
| skipping to change at line 172 | | skipping to change at line 175 | |
| | | | |
| // faster backpropagation | | // faster backpropagation | |
| void TrainOneEventFast( Int_t ievt, Float_t*& branchVar, Int_t& t
ype ); | | void TrainOneEventFast( Int_t ievt, Float_t*& branchVar, Int_t& t
ype ); | |
| | | | |
| // genetic algorithm functions | | // genetic algorithm functions | |
| void GeneticMinimize(); | | void GeneticMinimize(); | |
| | | | |
| #ifdef MethodMLP_UseMinuit__ | | #ifdef MethodMLP_UseMinuit__ | |
| // minuit functions -- commented out because they rely on a static po
inter | | // minuit functions -- commented out because they rely on a static po
inter | |
| void MinuitMinimize(); | | void MinuitMinimize(); | |
|
| static MethodMLP* GetThisPtr() { return fgThis; } | | static MethodMLP* GetThisPtr(); | |
| static void IFCN( Int_t& npars, Double_t* grad, Double_t &f, Double_t
* fitPars, Int_t ifl ); | | static void IFCN( Int_t& npars, Double_t* grad, Double_t &f, Double_t
* fitPars, Int_t ifl ); | |
| void FCN( Int_t& npars, Double_t* grad, Double_t &f, Double_t* fitPar
s, Int_t ifl ); | | void FCN( Int_t& npars, Double_t* grad, Double_t &f, Double_t* fitPar
s, Int_t ifl ); | |
| #endif | | #endif | |
| | | | |
| // general | | // general | |
|
| | | bool fUseRegulator; // zjh | |
| | | Double_t fPrior; // zjh | |
| | | std::vector<Double_t> fPriorDev; // zjh | |
| | | void GetApproxInvHessian ( TMatrixD& InvHessian, bool r | |
| | | egulate=true ); //rank-1 approximation, neglect 2nd derivatives. //zjh | |
| | | void UpdateRegulators(); // zjh | |
| | | void UpdatePriors(); // zjh | |
| | | Int_t fUpdateLimit; // zjh | |
| | | | |
| ETrainingMethod fTrainingMethod; // method of training, BP or GA | | ETrainingMethod fTrainingMethod; // method of training, BP or GA | |
| TString fTrainMethodS; // training method option param | | TString fTrainMethodS; // training method option param | |
| | | | |
| Float_t fSamplingFraction; // fraction of events which is sa
mpled for training | | Float_t fSamplingFraction; // fraction of events which is sa
mpled for training | |
| Float_t fSamplingEpoch; // fraction of epochs where sampl
ing is used | | Float_t fSamplingEpoch; // fraction of epochs where sampl
ing is used | |
| Float_t fSamplingWeight; // changing factor for event weig
hts when sampling is turned on | | Float_t fSamplingWeight; // changing factor for event weig
hts when sampling is turned on | |
| Bool_t fSamplingTraining; // The training sample is sampled | | Bool_t fSamplingTraining; // The training sample is sampled | |
| Bool_t fSamplingTesting; // The testing sample is sampled | | Bool_t fSamplingTesting; // The testing sample is sampled | |
| | | | |
| // BFGS variables | | // BFGS variables | |
| | | | |
End of changes. 6 change blocks. |
| 5 lines changed or deleted | | 18 lines changed or added | |
|
| Minuit2Minimizer.h | | Minuit2Minimizer.h | |
| | | | |
| skipping to change at line 147 | | skipping to change at line 147 | |
| virtual bool Minimize(); | | virtual bool Minimize(); | |
| | | | |
| /// return minimum function value | | /// return minimum function value | |
| virtual double MinValue() const { return fState.Fval(); } | | virtual double MinValue() const { return fState.Fval(); } | |
| | | | |
| /// return expected distance reached from the minimum | | /// return expected distance reached from the minimum | |
| virtual double Edm() const { return fState.Edm(); } | | virtual double Edm() const { return fState.Edm(); } | |
| | | | |
| /// return pointer to X values at the minimum | | /// return pointer to X values at the minimum | |
| virtual const double * X() const { | | virtual const double * X() const { | |
|
| // need to copy them since MnUserParameterState returns them by value | | fValues = fState.Params(); | |
| fValues=fState.Params(); | | return (fValues.size() ) ? &fValues.front() : 0; | |
| return &fValues.front(); | | | |
| } | | } | |
| | | | |
| /// return pointer to gradient values at the minimum | | /// return pointer to gradient values at the minimum | |
| virtual const double * MinGradient() const { return 0; } // not availab
le in Minuit2 | | virtual const double * MinGradient() const { return 0; } // not availab
le in Minuit2 | |
| | | | |
| /// number of function calls to reach the minimum | | /// number of function calls to reach the minimum | |
| virtual unsigned int NCalls() const { return fState.NFcn(); } | | virtual unsigned int NCalls() const { return fState.NFcn(); } | |
| | | | |
| /// this is <= Function().NDim() which is the total | | /// this is <= Function().NDim() which is the total | |
| /// number of variables (free+ constrained ones) | | /// number of variables (free+ constrained ones) | |
| virtual unsigned int NDim() const { return fDim; } | | virtual unsigned int NDim() const { return fDim; } | |
| | | | |
| /// number of free variables (real dimension of the problem) | | /// number of free variables (real dimension of the problem) | |
| /// this is <= Function().NDim() which is the total | | /// this is <= Function().NDim() which is the total | |
| virtual unsigned int NFree() const { return fState.VariableParameters();
} | | virtual unsigned int NFree() const { return fState.VariableParameters();
} | |
| | | | |
| /// minimizer provides error and error matrix | | /// minimizer provides error and error matrix | |
| virtual bool ProvidesError() const { return true; } | | virtual bool ProvidesError() const { return true; } | |
| | | | |
| /// return errors at the minimum | | /// return errors at the minimum | |
|
| virtual const double * Errors() const { | | virtual const double * Errors() const; | |
| fErrors = fState.Errors(); | | | |
| return &fErrors.front(); | | | |
| } | | | |
| | | | |
| /** | | /** | |
| return covariance matrices elements | | return covariance matrices elements | |
| if the variable is fixed or const the value is zero | | if the variable is fixed or const the value is zero | |
| The ordering of the variables is the same as in errors and parameter
value. | | The ordering of the variables is the same as in errors and parameter
value. | |
| This is different from the direct interface of Minuit2 or TMinuit wh
ere the | | This is different from the direct interface of Minuit2 or TMinuit wh
ere the | |
| values were obtained only to variable parameters | | values were obtained only to variable parameters | |
| */ | | */ | |
| virtual double CovMatrix(unsigned int i, unsigned int j) const; | | virtual double CovMatrix(unsigned int i, unsigned int j) const; | |
| | | | |
| | | | |
| skipping to change at line 243 | | skipping to change at line 239 | |
| status += 100*hesseStatus where hesse status is: | | status += 100*hesseStatus where hesse status is: | |
| status = 1 : hesse failed | | status = 1 : hesse failed | |
| status = 2 : matrix inversion failed | | status = 2 : matrix inversion failed | |
| status = 3 : matrix is not pos defined | | status = 3 : matrix is not pos defined | |
| */ | | */ | |
| virtual bool Hesse(); | | virtual bool Hesse(); | |
| | | | |
| /// return reference to the objective function | | /// return reference to the objective function | |
| ///virtual const ROOT::Math::IGenFunction & Function() const; | | ///virtual const ROOT::Math::IGenFunction & Function() const; | |
| | | | |
|
| | | /// print result of minimization | |
| | | virtual void PrintResults(); | |
| | | | |
| protected: | | protected: | |
| | | | |
| // protected function for accessing the internal Minuit2 object. Needed
for derived classes | | // protected function for accessing the internal Minuit2 object. Needed
for derived classes | |
| | | | |
| virtual const ROOT::Minuit2::ModularFunctionMinimizer * GetMinimizer() c
onst { return fMinimizer; } | | virtual const ROOT::Minuit2::ModularFunctionMinimizer * GetMinimizer() c
onst { return fMinimizer; } | |
| | | | |
| virtual void SetMinimizer( ROOT::Minuit2::ModularFunctionMinimizer * m)
{ fMinimizer = m; } | | virtual void SetMinimizer( ROOT::Minuit2::ModularFunctionMinimizer * m)
{ fMinimizer = m; } | |
| | | | |
| void SetMinimizerType( ROOT::Minuit2::EMinimizerType type); | | void SetMinimizerType( ROOT::Minuit2::EMinimizerType type); | |
| | | | |
| virtual const ROOT::Minuit2::FCNBase * GetFCN() const { return fMinuitF
CN; } | | virtual const ROOT::Minuit2::FCNBase * GetFCN() const { return fMinuitF
CN; } | |
| | | | |
| /// examine the minimum result | | /// examine the minimum result | |
| bool ExamineMinimum(const ROOT::Minuit2::FunctionMinimum & min); | | bool ExamineMinimum(const ROOT::Minuit2::FunctionMinimum & min); | |
| | | | |
| private: | | private: | |
| | | | |
|
| // dimension of the function to be minimized | | unsigned int fDim; // dimension of the function to be minimized | |
| unsigned int fDim; | | | |
| // error code | | | |
| int fErrorCode; | | | |
| bool fUseFumili; | | bool fUseFumili; | |
| | | | |
| ROOT::Minuit2::MnUserParameterState fState; | | ROOT::Minuit2::MnUserParameterState fState; | |
| // std::vector<ROOT::Minuit2::MinosError> fMinosErrors; | | // std::vector<ROOT::Minuit2::MinosError> fMinosErrors; | |
| ROOT::Minuit2::ModularFunctionMinimizer * fMinimizer; | | ROOT::Minuit2::ModularFunctionMinimizer * fMinimizer; | |
| ROOT::Minuit2::FCNBase * fMinuitFCN; | | ROOT::Minuit2::FCNBase * fMinuitFCN; | |
| ROOT::Minuit2::FunctionMinimum * fMinimum; | | ROOT::Minuit2::FunctionMinimum * fMinimum; | |
| mutable std::vector<double> fValues; | | mutable std::vector<double> fValues; | |
| mutable std::vector<double> fErrors; | | mutable std::vector<double> fErrors; | |
| | | | |
| | | | |
End of changes. 4 change blocks. |
| 11 lines changed or deleted | | 7 lines changed or added | |
|
| ModelConfig.h | | ModelConfig.h | |
|
| // @(#)root/roostats:$Id: ModelConfig.h 33228 2010-04-27 07:09:42Z moneta $ | | // @(#)root/roostats:$Id: ModelConfig.h 34109 2010-06-24 15:00:16Z moneta $ | |
| // Author: Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke | | // Author: Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| #ifndef ROOSTATS_ModelConfig | | #ifndef ROOSTATS_ModelConfig | |
| | | | |
| skipping to change at line 30 | | skipping to change at line 30 | |
| #endif | | #endif | |
| | | | |
| #ifndef ROO_ARG_SET | | #ifndef ROO_ARG_SET | |
| #include "RooArgSet.h" | | #include "RooArgSet.h" | |
| #endif | | #endif | |
| | | | |
| #ifndef ROO_WORKSPACE | | #ifndef ROO_WORKSPACE | |
| #include "RooWorkspace.h" | | #include "RooWorkspace.h" | |
| #endif | | #endif | |
| | | | |
|
| | | #ifndef ROOT_TRef | |
| | | #include "TRef.h" | |
| | | #endif | |
| | | | |
| #include <string> | | #include <string> | |
| | | | |
| //_________________________________________________ | | //_________________________________________________ | |
| /* | | /* | |
| BEGIN_HTML | | BEGIN_HTML | |
| <p> | | <p> | |
| ModelConfig is a simple class that holds configuration information specifyi
ng how a model | | ModelConfig is a simple class that holds configuration information specifyi
ng how a model | |
| should be used in the context of various RooStats tools. A single model ca
n be used | | should be used in the context of various RooStats tools. A single model ca
n be used | |
| in different ways, and this class should carry all that is needed to specif
y how it should be used. | | in different ways, and this class should carry all that is needed to specif
y how it should be used. | |
|
| | | ModelConfig requires a workspace to be set | |
| </p> | | </p> | |
| END_HTML | | END_HTML | |
| */ | | */ | |
| // | | // | |
| | | | |
| namespace RooStats { | | namespace RooStats { | |
| | | | |
| class ModelConfig : public TNamed { | | class ModelConfig : public TNamed { | |
| | | | |
| public: | | public: | |
| | | | |
|
| ModelConfig() : TNamed(), fWS(0), fOwnsWorkspace(false) { | | ModelConfig(RooWorkspace * ws = 0) : | |
| } | | TNamed(), | |
| | | fWS(ws) | |
| ModelConfig(const char* name) : TNamed(name, name), fWS(0), fOwnsWorkspa | | //fOwnsWorkspace(false) | |
| ce(false) { | | { | |
| } | | if (ws) fWSName = ws->GetName(); | |
| | | } | |
| ModelConfig(const char* name, const char* title) : TNamed(name, title), | | | |
| fWS(0), fOwnsWorkspace(false) { | | ModelConfig(const char* name, RooWorkspace *ws = 0) : | |
| fWS = 0; | | TNamed(name, name), | |
| fOwnsWorkspace = false; | | fWS(ws) | |
| | | //fOwnsWorkspace(false) | |
| | | { | |
| | | if (ws) fWSName = ws->GetName(); | |
| | | } | |
| | | | |
| | | ModelConfig(const char* name, const char* title, RooWorkspace *ws = 0) : | |
| | | TNamed(name, title), | |
| | | fWS(ws) | |
| | | //fOwnsWorkspace(false) | |
| | | { | |
| | | if (ws) fWSName = ws->GetName(); | |
| } | | } | |
| | | | |
| // destructor. | | // destructor. | |
| virtual ~ModelConfig(); | | virtual ~ModelConfig(); | |
| | | | |
|
| | | // clone | |
| | | virtual ModelConfig * Clone(const char * name = "ModelConfig") const { | |
| | | ModelConfig * mc = new ModelConfig(*this); | |
| | | mc->SetName(name); | |
| | | return mc; | |
| | | } | |
| | | | |
| // set a workspace that owns all the necessary components for the analys
is | | // set a workspace that owns all the necessary components for the analys
is | |
| virtual void SetWorkspace(RooWorkspace & ws); | | virtual void SetWorkspace(RooWorkspace & ws); | |
| | | | |
| // Set the proto DataSet, add to the the workspace if not already there | | // Set the proto DataSet, add to the the workspace if not already there | |
| virtual void SetProtoData(RooAbsData & data) { | | virtual void SetProtoData(RooAbsData & data) { | |
| ImportDataInWS(data); | | ImportDataInWS(data); | |
| SetProtoData( data.GetName() ); | | SetProtoData( data.GetName() ); | |
| } | | } | |
| | | | |
| // Set the Pdf, add to the the workspace if not already there | | // Set the Pdf, add to the the workspace if not already there | |
|
| virtual void SetPdf(RooAbsPdf& pdf) { | | virtual void SetPdf(const RooAbsPdf& pdf) { | |
| ImportPdfInWS(pdf); | | ImportPdfInWS(pdf); | |
| SetPdf( pdf.GetName() ); | | SetPdf( pdf.GetName() ); | |
| } | | } | |
| | | | |
| // Set the Prior Pdf, add to the the workspace if not already there | | // Set the Prior Pdf, add to the the workspace if not already there | |
|
| virtual void SetPriorPdf(RooAbsPdf& pdf) { | | virtual void SetPriorPdf(const RooAbsPdf& pdf) { | |
| ImportPdfInWS(pdf); | | ImportPdfInWS(pdf); | |
| SetPriorPdf( pdf.GetName() ); | | SetPriorPdf( pdf.GetName() ); | |
| } | | } | |
| | | | |
| // specify the parameters of interest in the interval | | // specify the parameters of interest in the interval | |
|
| virtual void SetParameters(RooArgSet& set) { | | virtual void SetParameters(const RooArgSet& set) { | |
| fPOIName=std::string(GetName()) + "_POI"; | | fPOIName=std::string(GetName()) + "_POI"; | |
| DefineSetInWS(fPOIName.c_str(), set); | | DefineSetInWS(fPOIName.c_str(), set); | |
| } | | } | |
|
| virtual void SetParametersOfInterest(RooArgSet& set) { | | virtual void SetParametersOfInterest(const RooArgSet& set) { | |
| SetParameters(set); | | SetParameters(set); | |
| } | | } | |
| | | | |
| // specify the nuisance parameters (eg. the rest of the parameters) | | // specify the nuisance parameters (eg. the rest of the parameters) | |
|
| virtual void SetNuisanceParameters(RooArgSet& set) { | | virtual void SetNuisanceParameters(const RooArgSet& set) { | |
| fNuisParamsName=std::string(GetName()) + "_NuisParams"; | | fNuisParamsName=std::string(GetName()) + "_NuisParams"; | |
| DefineSetInWS(fNuisParamsName.c_str(), set); | | DefineSetInWS(fNuisParamsName.c_str(), set); | |
| } | | } | |
| | | | |
| // specify the constraint parameters | | // specify the constraint parameters | |
|
| virtual void SetConstraintParameters(RooArgSet& set) { | | virtual void SetConstraintParameters(const RooArgSet& set) { | |
| fConstrParamsName=std::string(GetName()) + "_ConstrainedParams"; | | fConstrParamsName=std::string(GetName()) + "_ConstrainedParams"; | |
| DefineSetInWS(fConstrParamsName.c_str(), set); | | DefineSetInWS(fConstrParamsName.c_str(), set); | |
| } | | } | |
| | | | |
| // specify the observables | | // specify the observables | |
|
| virtual void SetObservables(RooArgSet& set) { | | virtual void SetObservables(const RooArgSet& set) { | |
| fObservablesName=std::string(GetName()) + "_Observables"; | | fObservablesName=std::string(GetName()) + "_Observables"; | |
| DefineSetInWS(fObservablesName.c_str(), set); | | DefineSetInWS(fObservablesName.c_str(), set); | |
| } | | } | |
| | | | |
| // specify the conditional observables | | // specify the conditional observables | |
|
| virtual void SetConditionalObservables(RooArgSet& set) { | | virtual void SetConditionalObservables(const RooArgSet& set) { | |
| fConditionalObsName=std::string(GetName()) + "_ConditionalObservables
"; | | fConditionalObsName=std::string(GetName()) + "_ConditionalObservables
"; | |
| DefineSetInWS(fConditionalObsName.c_str(), set); | | DefineSetInWS(fConditionalObsName.c_str(), set); | |
| } | | } | |
| | | | |
|
| // set parameter values for the null if using a common PDF | | // specify the conditional observables | |
| virtual void SetSnapshot(RooArgSet& set) { | | virtual void SetGlobalObservables(const RooArgSet& set) { | |
| fSnapshotName=std::string(GetName()) + "_Snapshot"; | | fGlobalObsName=std::string(GetName()) + "_GlobalObservables"; | |
| DefineSetInWS(fSnapshotName.c_str(), set); | | DefineSetInWS(fGlobalObsName.c_str(), set); | |
| } | | } | |
| | | | |
|
| | | // set parameter values for a particular hypothesis if using a common PD | |
| | | F | |
| | | // by saving a snapshot in the workspace | |
| | | virtual void SetSnapshot(const RooArgSet& set); | |
| | | | |
| // specify the name of the PDF in the workspace to be used | | // specify the name of the PDF in the workspace to be used | |
| virtual void SetPdf(const char* name) { | | virtual void SetPdf(const char* name) { | |
| if(!fWS){ | | if(!fWS){ | |
| coutE(ObjectHandling) << "workspace not set" << endl; | | coutE(ObjectHandling) << "workspace not set" << endl; | |
| return; | | return; | |
| } | | } | |
| if(fWS->pdf(name)) | | if(fWS->pdf(name)) | |
| fPdfName = name; | | fPdfName = name; | |
| else | | else | |
| coutE(ObjectHandling) << "pdf "<<name<< " does not exist in worksp
ace"<<endl; | | coutE(ObjectHandling) << "pdf "<<name<< " does not exist in worksp
ace"<<endl; | |
| | | | |
| skipping to change at line 177 | | skipping to change at line 206 | |
| | | | |
| /// get RooArgSet containing the nuisance parameters (return NULL if not
existing) | | /// get RooArgSet containing the nuisance parameters (return NULL if not
existing) | |
| const RooArgSet * GetNuisanceParameters() const { return (fWS) ? fWS->se
t(fNuisParamsName.c_str()) : 0; } | | const RooArgSet * GetNuisanceParameters() const { return (fWS) ? fWS->se
t(fNuisParamsName.c_str()) : 0; } | |
| | | | |
| /// get RooArgSet containing the constraint parameters (return NULL if n
ot existing) | | /// get RooArgSet containing the constraint parameters (return NULL if n
ot existing) | |
| const RooArgSet * GetConstraintParameters() const { return (fWS) ? fWS->
set(fConstrParamsName.c_str()) : 0; } | | const RooArgSet * GetConstraintParameters() const { return (fWS) ? fWS->
set(fConstrParamsName.c_str()) : 0; } | |
| | | | |
| /// get parameters prior pdf (return NULL if not existing) | | /// get parameters prior pdf (return NULL if not existing) | |
| RooAbsPdf * GetPriorPdf() const { return (fWS) ? fWS->pdf(fPriorPdfName.
c_str()) : 0; } | | RooAbsPdf * GetPriorPdf() const { return (fWS) ? fWS->pdf(fPriorPdfName.
c_str()) : 0; } | |
| | | | |
|
| /// get RooArgSet for observales (return NULL if not existing) | | /// get RooArgSet for observables (return NULL if not existing) | |
| const RooArgSet * GetObservables() const { return (fWS) ? fWS->set(fObse
rvablesName.c_str()) : 0; } | | const RooArgSet * GetObservables() const { return (fWS) ? fWS->set(fObse
rvablesName.c_str()) : 0; } | |
| | | | |
|
| /// get RooArgSet for conditional observales (return NULL if not existi
ng) | | /// get RooArgSet for conditional observables (return NULL if not exist
ing) | |
| const RooArgSet * GetConditionalObservables() const { return (fWS) ? fWS
->set(fConditionalObsName.c_str()) : 0; } | | const RooArgSet * GetConditionalObservables() const { return (fWS) ? fWS
->set(fConditionalObsName.c_str()) : 0; } | |
| | | | |
|
| | | /// get RooArgSet for global observables (return NULL if not existing) | |
| | | const RooArgSet * GetGlobalObservables() const { return (fWS) ? fWS->set | |
| | | (fGlobalObsName.c_str()) : 0; } | |
| | | | |
| /// get Proto data set (return NULL if not existing) | | /// get Proto data set (return NULL if not existing) | |
| RooAbsData * GetProtoData() const { return (fWS) ? fWS->data(fProtoDat
aName.c_str()) : 0; } | | RooAbsData * GetProtoData() const { return (fWS) ? fWS->data(fProtoDat
aName.c_str()) : 0; } | |
| | | | |
| /// get RooArgSet for parameters for a particular hypothesis (return NU
LL if not existing) | | /// get RooArgSet for parameters for a particular hypothesis (return NU
LL if not existing) | |
|
| const RooArgSet * GetSnapshot() const { return (fWS) ? fWS->set(fSnapsho
tName.c_str()) : 0; } | | const RooArgSet * GetSnapshot() const; | |
| | | | |
|
| const RooWorkspace * GetWS() const { return fWS; } | | void LoadSnapshot() const; | |
| | | | |
|
| protected: | | RooWorkspace * GetWS() const; | |
| | | | |
|
| | | /// guesses Observables and ParametersOfInterest if not already set | |
| | | void GuessObsAndNuisance(const RooAbsData& data); | |
| | | | |
| | | protected: | |
| // helper functions to define a set in the WS | | // helper functions to define a set in the WS | |
|
| void DefineSetInWS(const char* name, RooArgSet& set); | | void DefineSetInWS(const char* name, const RooArgSet& set); | |
| | | | |
| // internal function to import Pdf in WS | | // internal function to import Pdf in WS | |
|
| void ImportPdfInWS(RooAbsPdf & pdf); | | void ImportPdfInWS(const RooAbsPdf & pdf); | |
| | | | |
| // internal function to import data in WS | | // internal function to import data in WS | |
| void ImportDataInWS(RooAbsData & data); | | void ImportDataInWS(RooAbsData & data); | |
| | | | |
|
| RooWorkspace* fWS; // a workspace that owns all the components to be use | | mutable RooWorkspace* fWS; //! a workspace that owns all the compone | |
| d by the calculator | | nts to be used by the calculator (transient member) | |
| Bool_t fOwnsWorkspace; | | TRef fRefWS; // WS reference used in the file | |
| | | | |
| | | //Bool_t fOwnsWorkspace; | |
| | | | |
| | | std::string fWSName; // name of the WS | |
| | | | |
| std::string fPdfName; // name of PDF in workspace | | std::string fPdfName; // name of PDF in workspace | |
| std::string fDataName; // name of data set in workspace | | std::string fDataName; // name of data set in workspace | |
| std::string fPOIName; // name for RooArgSet specifying parameters of int
erest | | std::string fPOIName; // name for RooArgSet specifying parameters of int
erest | |
| | | | |
| std::string fNuisParamsName; // name for RooArgSet specifying nuisance p
arameters | | std::string fNuisParamsName; // name for RooArgSet specifying nuisance p
arameters | |
| std::string fConstrParamsName; // name for RooArgSet specifying constrai
ned parameters | | std::string fConstrParamsName; // name for RooArgSet specifying constrai
ned parameters | |
| std::string fPriorPdfName; // name for RooAbsPdf specifying a prior on t
he parameters | | std::string fPriorPdfName; // name for RooAbsPdf specifying a prior on t
he parameters | |
| | | | |
| std::string fConditionalObsName; // name for RooArgSet specifying condit
ional observables | | std::string fConditionalObsName; // name for RooArgSet specifying condit
ional observables | |
|
| | | std::string fGlobalObsName; // name for RooArgSet specifying global obse
rvables | |
| std::string fProtoDataName; // name for RooArgSet specifying dataset tha
t should be used as protodata | | std::string fProtoDataName; // name for RooArgSet specifying dataset tha
t should be used as protodata | |
| | | | |
| std::string fSnapshotName; // name for RooArgSet that specifies a partic
ular hypothesis | | std::string fSnapshotName; // name for RooArgSet that specifies a partic
ular hypothesis | |
| | | | |
| std::string fObservablesName; // name for RooArgSet specifying observabl
e parameters. | | std::string fObservablesName; // name for RooArgSet specifying observabl
e parameters. | |
| | | | |
|
| ClassDef(ModelConfig,1) // A class that holds configuration information
for a model using a workspace as a store | | ClassDef(ModelConfig,3) // A class that holds configuration information
for a model using a workspace as a store | |
| | | | |
| }; | | }; | |
| | | | |
| } // end namespace RooStats | | } // end namespace RooStats | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 27 change blocks. |
| 35 lines changed or deleted | | 76 lines changed or added | |
|
| NeymanConstruction.h | | NeymanConstruction.h | |
|
| // @(#)root/roostats:$Id: NeymanConstruction.h 31276 2009-11-18 15:06:42Z m
oneta $ | | // @(#)root/roostats:$Id: NeymanConstruction.h 34109 2010-06-24 15:00:16Z m
oneta $ | |
| // Author: Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke | | // Author: Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| #ifndef ROOSTATS_NeymanConstruction | | #ifndef ROOSTATS_NeymanConstruction | |
| | | | |
| skipping to change at line 23 | | skipping to change at line 23 | |
| | | | |
| #ifndef ROOT_Rtypes | | #ifndef ROOT_Rtypes | |
| #include "Rtypes.h" | | #include "Rtypes.h" | |
| #endif | | #endif | |
| | | | |
| #ifndef ROOSTATS_IntervalCalculator | | #ifndef ROOSTATS_IntervalCalculator | |
| #include "RooStats/IntervalCalculator.h" | | #include "RooStats/IntervalCalculator.h" | |
| #endif | | #endif | |
| | | | |
| #include "RooStats/TestStatSampler.h" | | #include "RooStats/TestStatSampler.h" | |
|
| | | #include "RooStats/ModelConfig.h" | |
| #include "RooStats/ConfidenceBelt.h" | | #include "RooStats/ConfidenceBelt.h" | |
| | | | |
| #include "RooAbsData.h" | | #include "RooAbsData.h" | |
| #include "RooAbsPdf.h" | | #include "RooAbsPdf.h" | |
| #include "RooArgSet.h" | | #include "RooArgSet.h" | |
| #include "TList.h" | | #include "TList.h" | |
| | | | |
| class RooAbsData; | | class RooAbsData; | |
| | | | |
| namespace RooStats { | | namespace RooStats { | |
| | | | |
| class ConfInterval; | | class ConfInterval; | |
| | | | |
|
| class NeymanConstruction : public IntervalCalculator, public TNamed { | | class NeymanConstruction : public IntervalCalculator{ | |
| | | | |
| public: | | public: | |
| | | | |
|
| NeymanConstruction(); | | // NeymanConstruction(); | |
| | | NeymanConstruction(RooAbsData& data, ModelConfig& model); | |
| | | | |
| virtual ~NeymanConstruction(); | | virtual ~NeymanConstruction(); | |
| | | | |
| // Main interface to get a ConfInterval (will be a PointSetInterval) | | // Main interface to get a ConfInterval (will be a PointSetInterval) | |
| virtual ConfInterval* GetInterval() const; | | virtual ConfInterval* GetInterval() const; | |
|
| virtual ConfInterval* GetIntervalUsingList() const; | | | |
| | | | |
| // Interface extended with I/O support | | | |
| virtual ConfInterval* GetInterval(const char* asciiFilePat) const; | | | |
| | | | |
| // Actually generate teh sampling distribution | | | |
| virtual TList* GenSamplingDistribution(const char* asciiFilePa | | | |
| t = 0) const; | | | |
| virtual ConfInterval* Run(TList *SamplingList) const; | | | |
| | | | |
| // in addition to interface we also need: | | // in addition to interface we also need: | |
| // Set the TestStatSampler (eg. ToyMC or FFT, includes choice of Test
Statistic) | | // Set the TestStatSampler (eg. ToyMC or FFT, includes choice of Test
Statistic) | |
|
| void SetTestStatSampler(TestStatSampler& distCreator) {fTestStatSampl
er = &distCreator;} | | void SetTestStatSampler(TestStatSampler& sampler) {fTestStatSampler =
&sampler;} | |
| // fLeftSideTailFraction*fSize defines lower edge of acceptance regio
n. | | // fLeftSideTailFraction*fSize defines lower edge of acceptance regio
n. | |
| // Unified limits use 0, central limits use 0.5, | | // Unified limits use 0, central limits use 0.5, | |
| // for upper/lower limits it is 0/1 depends on sign of test statistic
w.r.t. parameter | | // for upper/lower limits it is 0/1 depends on sign of test statistic
w.r.t. parameter | |
| void SetLeftSideTailFraction(Double_t leftSideFraction = 0.) {fLeftSi
deFraction = leftSideFraction;} | | void SetLeftSideTailFraction(Double_t leftSideFraction = 0.) {fLeftSi
deFraction = leftSideFraction;} | |
| | | | |
| // User-defined set of points to test | | // User-defined set of points to test | |
| void SetParameterPointsToTest(RooAbsData& pointsToTest) { | | void SetParameterPointsToTest(RooAbsData& pointsToTest) { | |
| fPointsToTest = &pointsToTest; | | fPointsToTest = &pointsToTest; | |
| fConfBelt = new ConfidenceBelt("ConfBelt",pointsToTest); | | fConfBelt = new ConfidenceBelt("ConfBelt",pointsToTest); | |
| } | | } | |
| | | | |
| skipping to change at line 81 | | skipping to change at line 75 | |
| // This class can make regularly spaced scans based on range stored i
n RooRealVars. | | // This class can make regularly spaced scans based on range stored i
n RooRealVars. | |
| // Choose number of steps for a rastor scan (specific for each dimens
ion) | | // Choose number of steps for a rastor scan (specific for each dimens
ion) | |
| // void SetNumSteps(map<RooAbsArg, Int_t>) | | // void SetNumSteps(map<RooAbsArg, Int_t>) | |
| | | | |
| // Get the size of the test (eg. rate of Type I error) | | // Get the size of the test (eg. rate of Type I error) | |
| virtual Double_t Size() const {return fSize;} | | virtual Double_t Size() const {return fSize;} | |
| | | | |
| // Get the Confidence level for the test | | // Get the Confidence level for the test | |
| virtual Double_t ConfidenceLevel() const {return 1.-fSize;} | | virtual Double_t ConfidenceLevel() const {return 1.-fSize;} | |
| | | | |
|
| virtual void SetModel(const ModelConfig &); | | // Set ModelConfig | |
| | | virtual void SetModel(const ModelConfig &model) {fModel = model;} | |
| | | | |
| // Set the DataSet | | // Set the DataSet | |
|
| virtual void SetData(RooAbsData& data) { fData = &data; } | | virtual void SetData(RooAbsData& data) { fData = data; } | |
| | | | |
| // Set the Pdf, add to the the workspace if not already there | | // Set the Pdf, add to the the workspace if not already there | |
|
| virtual void SetPdf(RooAbsPdf& pdf) { fPdf = &pdf; } | | virtual void SetPdf(RooAbsPdf& /*pdf*/) { | |
| | | cout << "DEPRECATED, use ModelConfig"<<endl; | |
| | | } | |
| | | | |
| // specify the parameters of interest in the interval | | // specify the parameters of interest in the interval | |
|
| virtual void SetParameters(const RooArgSet& set) { fPOI.removeAll(); | | virtual void SetParameters(const RooArgSet& /*set*/) { | |
| fPOI.add(set); } | | cout << "DEPRECATED, use ModelConfig"<<endl; | |
| | | } | |
| | | | |
| // specify the nuisance parameters (eg. the rest of the parameters) | | // specify the nuisance parameters (eg. the rest of the parameters) | |
|
| virtual void SetNuisanceParameters(const RooArgSet& set) {fNuisParams | | virtual void SetNuisanceParameters(const RooArgSet& /*set*/) { | |
| .removeAll(); fNuisParams.add(set);} | | cout << "DEPRECATED, use ModelConfig"<<endl; | |
| | | } | |
| | | | |
| // set the size of the test (rate of Type I error) ( Eg. 0.05 for a 9
5% Confidence Interval) | | // set the size of the test (rate of Type I error) ( Eg. 0.05 for a 9
5% Confidence Interval) | |
| virtual void SetTestSize(Double_t size) {fSize = size;} | | virtual void SetTestSize(Double_t size) {fSize = size;} | |
| // set the confidence level for the interval (eg. 0.95 for a 95% Conf
idence Interval) | | // set the confidence level for the interval (eg. 0.95 for a 95% Conf
idence Interval) | |
| virtual void SetConfidenceLevel(Double_t cl) {fSize = 1.-cl;} | | virtual void SetConfidenceLevel(Double_t cl) {fSize = 1.-cl;} | |
| | | | |
|
| | | // get confidence belt | |
| ConfidenceBelt* GetConfidenceBelt() {return fConfBelt;} | | ConfidenceBelt* GetConfidenceBelt() {return fConfBelt;} | |
| | | | |
|
| | | // adaptive sampling algorithm to speed up interval caculation | |
| void UseAdaptiveSampling(bool flag=true){fAdaptiveSampling=flag;} | | void UseAdaptiveSampling(bool flag=true){fAdaptiveSampling=flag;} | |
| | | | |
|
| | | // give user ability to ask for more toys | |
| | | void AdditionalNToysFactor(double fact){fAdditionalNToysFactor = fact | |
| | | ;} | |
| | | | |
| | | // save teh confidence belt to a file | |
| void SaveBeltToFile(bool flag=true){ | | void SaveBeltToFile(bool flag=true){ | |
| fSaveBeltToFile = flag; | | fSaveBeltToFile = flag; | |
| if(flag) fCreateBelt = true; | | if(flag) fCreateBelt = true; | |
| } | | } | |
|
| | | // should create confidence belt | |
| void CreateConfBelt(bool flag=true){fCreateBelt = flag;} | | void CreateConfBelt(bool flag=true){fCreateBelt = flag;} | |
| | | | |
| private: | | private: | |
| | | | |
| Double_t fSize; // size of the test (eg. specified rate of Type I err
or) | | Double_t fSize; // size of the test (eg. specified rate of Type I err
or) | |
|
| | | RooAbsData& fData; // data set | |
| | | ModelConfig &fModel; | |
| | | /* | |
| RooAbsPdf * fPdf; // common PDF | | RooAbsPdf * fPdf; // common PDF | |
|
| RooAbsData * fData; // data set | | mutable RooArgSet fPOI; // RooArgSet specifying parameters of intere | |
| RooArgSet fPOI; // RooArgSet specifying parameters of interest for i | | st for interval | |
| nterval | | | |
| RooArgSet fNuisParams;// RooArgSet specifying nuisance parameters fo
r interval | | RooArgSet fNuisParams;// RooArgSet specifying nuisance parameters fo
r interval | |
|
| | | */ | |
| | | | |
| TestStatSampler* fTestStatSampler; | | TestStatSampler* fTestStatSampler; | |
| RooAbsData* fPointsToTest; | | RooAbsData* fPointsToTest; | |
| Double_t fLeftSideFraction; | | Double_t fLeftSideFraction; | |
| ConfidenceBelt* fConfBelt; | | ConfidenceBelt* fConfBelt; | |
| bool fAdaptiveSampling; // controls use of adaptive sampling algorith
m | | bool fAdaptiveSampling; // controls use of adaptive sampling algorith
m | |
|
| | | Double_t fAdditionalNToysFactor; // give user ability to ask for more
toys | |
| bool fSaveBeltToFile; // controls use if ConfidenceBelt should be sav
ed to a TFile | | bool fSaveBeltToFile; // controls use if ConfidenceBelt should be sav
ed to a TFile | |
| bool fCreateBelt; // controls use if ConfidenceBelt should be saved t
o a TFile | | bool fCreateBelt; // controls use if ConfidenceBelt should be saved t
o a TFile | |
| | | | |
| protected: | | protected: | |
| ClassDef(NeymanConstruction,1) // Interface for tools setting limit
s (producing confidence intervals) | | ClassDef(NeymanConstruction,1) // Interface for tools setting limit
s (producing confidence intervals) | |
| }; | | }; | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 19 change blocks. |
| 23 lines changed or deleted | | 34 lines changed or added | |
|
| ProbFuncMathCore.h | | ProbFuncMathCore.h | |
|
| // @(#)root/mathcore:$Id: ProbFuncMathCore.h 21129 2007-11-30 14:41:10Z mon
eta $ | | // @(#)root/mathcore:$Id: ProbFuncMathCore.h 34095 2010-06-24 07:31:19Z mon
eta $ | |
| // Authors: L. Moneta, A. Zsenei 06/2005 | | // Authors: L. Moneta, A. Zsenei 06/2005 | |
| | | | |
| /********************************************************************** | | /********************************************************************** | |
| * * | | * * | |
| * Copyright (c) 2005 , LCG ROOT MathLib Team * | | * Copyright (c) 2005 , LCG ROOT MathLib Team * | |
| * * | | * * | |
| * * | | * * | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| #if defined(__CINT__) && !defined(__MAKECINT__) | | #if defined(__CINT__) && !defined(__MAKECINT__) | |
| | | | |
| skipping to change at line 52 | | skipping to change at line 52 | |
| * | | * | |
| * \f[ D(x) = \int_{x}^{+\infty} p(x') dx' \f] | | * \f[ D(x) = \int_{x}^{+\infty} p(x') dx' \f] | |
| * | | * | |
| * | | * | |
| * <strong>NOTE:</strong> In the old releases (< 5.14) the <em>_cdf</em>
functions were called | | * <strong>NOTE:</strong> In the old releases (< 5.14) the <em>_cdf</em>
functions were called | |
| * <em>_quant</em> and the <em>_cdf_c</em> functions were called | | * <em>_quant</em> and the <em>_cdf_c</em> functions were called | |
| * <em>_prob</em>. | | * <em>_prob</em>. | |
| * These names are currently kept for backward compatibility, but | | * These names are currently kept for backward compatibility, but | |
| * their usage is deprecated. | | * their usage is deprecated. | |
| * | | * | |
|
| | | * These functions are defined in the header file <em>Math/ProbFunc.h<em | |
| | | > or in the global one | |
| | | * including all statistical dunctions <em>Math/DistFunc.h<em> | |
| * | | * | |
| */ | | */ | |
| | | | |
| /** | | /** | |
| | | | |
| Complement of the cumulative distribution function of the beta distribut
ion. | | Complement of the cumulative distribution function of the beta distribut
ion. | |
| Upper tail of the integral of the #beta_pdf | | Upper tail of the integral of the #beta_pdf | |
| | | | |
| @ingroup ProbFunc | | @ingroup ProbFunc | |
| | | | |
| | | | |
| skipping to change at line 287 | | skipping to change at line 289 | |
| */ | | */ | |
| | | | |
| double gamma_cdf(double x, double alpha, double theta, double x0 = 0); | | double gamma_cdf(double x, double alpha, double theta, double x0 = 0); | |
| | | | |
| /** | | /** | |
| | | | |
| Cumulative distribution function of the Landau | | Cumulative distribution function of the Landau | |
| distribution (lower tail). | | distribution (lower tail). | |
| | | | |
| \f[ D(x) = \int_{-\infty}^{x} p(x) dx \f] | | \f[ D(x) = \int_{-\infty}^{x} p(x) dx \f] | |
|
| Where p(x) is the Landau probability density function : | | | |
| | | | |
|
| \f[ p(x) = \frac{1}{2 \pi i}\int_{c-i\infty}^{c+i\infty} e^{x s + s \lo | | where \f$p(x)\f$ is the Landau probability density function : | |
| g{s}} ds\f] | | \f[ p(x) = \frac{1}{\xi} \phi (\lambda) \f] | |
| | | with | |
| Where s = (x-x0)/sigma. For detailed description see | | \f[ \phi(\lambda) = \frac{1}{2 \pi i}\int_{c-i\infty}^{c+i\infty} e^{\l | |
| | | ambda s + s \log{s}} ds\f] | |
| | | with \f$\lambda = (x-x_0)/\xi\f$. For a detailed description see | |
| | | K.S. Kölbig and B. Schorr, A program package for the Landau distrib | |
| | | ution, | |
| | | <A HREF="http://dx.doi.org/10.1016/0010-4655(84)90085-7">Computer Phys. | |
| | | Comm. 31 (1984) 97-111</A> | |
| | | <A HREF="http://dx.doi.org/10.1016/j.cpc.2008.03.002">[Erratum-ibid. 178 | |
| | | (2008) 972]</A>. | |
| | | The same algorithms as in | |
| <A HREF="http://wwwasdoc.web.cern.ch/wwwasdoc/shortwrupsdir/g110/top.htm
l"> | | <A HREF="http://wwwasdoc.web.cern.ch/wwwasdoc/shortwrupsdir/g110/top.htm
l"> | |
|
| CERNLIB</A>. The same algorithms as in CERNLIB (DISLAN) is used. | | CERNLIB</A> (DISLAN) is used. | |
| | | | |
| | | @param x The argument \f$x\f$ | |
| | | @param xi The width parameter \f$\xi\f$ | |
| | | @param x0 The location parameter \f$x_0\f$ | |
| | | | |
| @ingroup ProbFunc | | @ingroup ProbFunc | |
| | | | |
| */ | | */ | |
| | | | |
|
| double landau_cdf(double x, double sigma = 1, double x0 = 0); | | double landau_cdf(double x, double xi = 1, double x0 = 0); | |
| | | | |
| /** | | /** | |
| | | | |
| Complement of the distribution function of the Landau | | Complement of the distribution function of the Landau | |
| distribution (upper tail). | | distribution (upper tail). | |
| | | | |
| \f[ D(x) = \int_{x}^{+\infty} p(x) dx \f] | | \f[ D(x) = \int_{x}^{+\infty} p(x) dx \f] | |
| | | | |
| where p(x) is the Landau probability density function. | | where p(x) is the Landau probability density function. | |
| It is implemented simply as 1. - #landau_cdf | | It is implemented simply as 1. - #landau_cdf | |
|
| | | | |
| | | @param x The argument \f$x\f$ | |
| | | @param xi The width parameter \f$\xi\f$ | |
| | | @param x0 The location parameter \f$x_0\f$ | |
| | | | |
| | | @ingroup ProbFunc | |
| | | | |
| */ | | */ | |
|
| inline double landau_cdf_c(double x, double sigma = 1, double x0 = 0) { | | inline double landau_cdf_c(double x, double xi = 1, double x0 = 0) { | |
| return 1. - landau_cdf(x,sigma,x0); | | return 1. - landau_cdf(x,xi,x0); | |
| } | | } | |
| | | | |
| /** | | /** | |
| | | | |
| Complement of the cumulative distribution function of the lognormal dist
ribution | | Complement of the cumulative distribution function of the lognormal dist
ribution | |
| (upper tail). | | (upper tail). | |
| | | | |
| \f[ D(x) = \int_{x}^{+\infty} {1 \over x' \sqrt{2 \pi s^2} } e^{-(\ln{x'
} - m)^2/2 s^2} dx' \f] | | \f[ D(x) = \int_{x}^{+\infty} {1 \over x' \sqrt{2 \pi s^2} } e^{-(\ln{x'
} - m)^2/2 s^2} dx' \f] | |
| | | | |
| For detailed description see | | For detailed description see | |
| | | | |
| skipping to change at line 585 | | skipping to change at line 603 | |
| inline double tdistribution_prob(double x, double r, double x0 = 0) { | | inline double tdistribution_prob(double x, double r, double x0 = 0) { | |
| return tdistribution_cdf_c (x, r, x0); | | return tdistribution_cdf_c (x, r, x0); | |
| } | | } | |
| | | | |
| inline double tdistribution_quant(double x, double r, double x0 = 0) { | | inline double tdistribution_quant(double x, double r, double x0 = 0) { | |
| return tdistribution_cdf (x, r, x0); | | return tdistribution_cdf (x, r, x0); | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
|
| | | /** @defgroup TruncFunc Statistical functions from truncated distributio | |
| | | ns | |
| | | | |
| | | @ingroup StatFunc | |
| | | | |
| | | Statistical functions for the truncated distributions. Examples of such | |
| | | functions are the | |
| | | first or the second momentum of the truncated distribution. | |
| | | In the case of the Landau, first and second momentum functions are provi | |
| | | ded for the Landau | |
| | | distribution truncated only on the right side. | |
| | | These functions are defined in the header file <em>Math/ProbFunc.h<em> o | |
| | | r in the global one | |
| | | including all statistical dunctions <em>Math/StatFunc.h<em> | |
| | | | |
| | | */ | |
| | | | |
| | | /** | |
| | | | |
| | | First moment (mean) of the truncated Landau distribution. | |
| | | \f[ \frac{1}{D (x)} \int_{-\infty}^{x} t\, p(t) d t \f] | |
| | | where \f$p(x)\f$ is the Landau distribution | |
| | | and \f$D(x)\f$ its cumulative distribution function. | |
| | | | |
| | | For detailed description see | |
| | | K.S. Kölbig and B. Schorr, A program package for the Landau distrib | |
| | | ution, | |
| | | <A HREF="http://dx.doi.org/10.1016/0010-4655(84)90085-7">Computer Phys. | |
| | | Comm. 31 (1984) 97-111</A> | |
| | | <A HREF="http://dx.doi.org/10.1016/j.cpc.2008.03.002">[Erratum-ibid. 178 | |
| | | (2008) 972]</A>. | |
| | | The same algorithms as in | |
| | | <A HREF="http://wwwasdoc.web.cern.ch/wwwasdoc/shortwrupsdir/g110/top.htm | |
| | | l"> | |
| | | CERNLIB</A> (XM1LAN) is used | |
| | | | |
| | | @param x The argument \f$x\f$ | |
| | | @param xi The width parameter \f$\xi\f$ | |
| | | @param x0 The location parameter \f$x_0\f$ | |
| | | | |
| | | @ingroup TruncFunc | |
| | | | |
| | | */ | |
| | | | |
| | | double landau_xm1(double x, double xi = 1, double x0 = 0); | |
| | | | |
| | | /** | |
| | | | |
| | | Second moment of the truncated Landau distribution. | |
| | | \f[ \frac{1}{D (x)} \int_{-\infty}^{x} t^2\, p(t) d t \f] | |
| | | where \f$p(x)\f$ is the Landau distribution | |
| | | and \f$D(x)\f$ its cumulative distribution function. | |
| | | | |
| | | For detailed description see | |
| | | K.S. Kölbig and B. Schorr, A program package for the Landau distrib | |
| | | ution, | |
| | | <A HREF="http://dx.doi.org/10.1016/0010-4655(84)90085-7">Computer Phys. | |
| | | Comm. 31 (1984) 97-111</A> | |
| | | <A HREF="http://dx.doi.org/10.1016/j.cpc.2008.03.002">[Erratum-ibid. 178 | |
| | | (2008) 972]</A>. | |
| | | The same algorithms as in | |
| | | <A HREF="http://wwwasdoc.web.cern.ch/wwwasdoc/shortwrupsdir/g110/top.htm | |
| | | l"> | |
| | | CERNLIB</A> (XM1LAN) is used | |
| | | | |
| | | @param x The argument \f$x\f$ | |
| | | @param xi The width parameter \f$\xi\f$ | |
| | | @param x0 The location parameter \f$x_0\f$ | |
| | | | |
| | | @ingroup TruncFunc | |
| | | | |
| | | */ | |
| | | | |
| | | double landau_xm2(double x, double xi = 1, double x0 = 0); | |
| | | | |
| } // namespace Math | | } // namespace Math | |
| } // namespace ROOT | | } // namespace ROOT | |
| | | | |
| #endif // ROOT_Math_ProbFuncMathCore | | #endif // ROOT_Math_ProbFuncMathCore | |
| | | | |
| #endif // if defined (__CINT__) && !defined(__MAKECINT__) | | #endif // if defined (__CINT__) && !defined(__MAKECINT__) | |
| | | | |
End of changes. 9 change blocks. |
| 10 lines changed or deleted | | 107 lines changed or added | |
|
| ProfileLikelihoodTestStat.h | | ProfileLikelihoodTestStat.h | |
|
| // @(#)root/roostats:$Id: ProfileLikelihoodTestStat.h 31529 2009-12-03 14:5
7:25Z moneta $ | | // @(#)root/roostats:$Id: ProfileLikelihoodTestStat.h 34109 2010-06-24 15:0
0:16Z moneta $ | |
| // Author: Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke | | // Author: Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| #ifndef ROOSTATS_ProfileLikelihoodTestStat | | #ifndef ROOSTATS_ProfileLikelihoodTestStat | |
| | | | |
| skipping to change at line 68 | | skipping to change at line 68 | |
| } | | } | |
| virtual ~ProfileLikelihoodTestStat() { | | virtual ~ProfileLikelihoodTestStat() { | |
| // delete fRand; | | // delete fRand; | |
| // delete fTestStatistic; | | // delete fTestStatistic; | |
| if(fProfile) delete fProfile; | | if(fProfile) delete fProfile; | |
| if(fNll) delete fNll; | | if(fNll) delete fNll; | |
| if(fCachedBestFitParams) delete fCachedBestFitParams; | | if(fCachedBestFitParams) delete fCachedBestFitParams; | |
| } | | } | |
| | | | |
| // Main interface to evaluate the test statistic on a dataset | | // Main interface to evaluate the test statistic on a dataset | |
|
| virtual Double_t Evaluate(RooAbsData& data, RooArgSet& paramsOfInteres | | virtual Double_t Evaluate(RooAbsData& data, RooArgSet& paramsOfInteres | |
| t) { | | t) { | |
| if(!&data){ cout << "problem with data" << endl;} | | if (!&data) { | |
| | | cout << "problem with data" << endl; | |
| RooMsgService::instance().setGlobalKillBelow(RooFit::FATAL) ; | | | |
| bool needToRebuild = true; // try to avoid rebuilding if possible | | | |
| | | | |
| if(fLastData == &data) // simple pointer comparison for now (note NL | | | |
| L makes COPY of data) | | | |
| needToRebuild=false; | | | |
| else | | | |
| fLastData = &data; // keep a copy of pointer to original data | | | |
| | | | |
| // pointer comparison causing problems. See multiple datasets with | | | |
| same value of pointer | | | |
| // but actually a new dataset | | | |
| needToRebuild = true; | | | |
| | | | |
| // check mem leak in NLL or Profile. Should remove. | | | |
| // if(fProfile) needToRebuild = false; | | | |
| | | | |
| if(needToRebuild){ | | | |
| if(fProfile) delete fProfile; | | | |
| if (fNll) delete fNll; | | | |
| | | | |
| /* | | | |
| RooNLLVar* nll = new RooNLLVar("nll","",*fPdf,data, RooFit::Extende | | | |
| d()); | | | |
| fNll = nll; | | | |
| fProfile = new RooProfileLL("pll","",*nll, paramsOfInterest); | | | |
| */ | | | |
| RooArgSet* constrainedParams = fPdf->getParameters(data); | | | |
| RemoveConstantParameters(constrainedParams); | | | |
| | | | |
| RooNLLVar* nll = (RooNLLVar*) fPdf->createNLL(data, RooFit::CloneDa | | | |
| ta(kFALSE),RooFit::Constrain(*constrainedParams)); | | | |
| fNll=nll; | | | |
| fProfile = (RooProfileLL*) nll->createProfile(paramsOfInterest); | | | |
| delete constrainedParams; | | | |
| | | | |
| // paramsOfInterest.Print("v"); | | | |
| | | | |
| // set parameters to previous best fit params, to speed convergence | | | |
| // and to avoid local minima | | | |
| if(fCachedBestFitParams){ | | | |
| // store original values, since minimization will change them. | | | |
| RooArgSet* origParamVals = (RooArgSet*) paramsOfInterest.snapshot | | | |
| (); | | | |
| | | | |
| // these parameters are not guaranteed to be the best for this da | | | |
| ta | | | |
| SetParameters(fCachedBestFitParams, fProfile->getParameters(data) | | | |
| ); | | | |
| // now evaluate to force this profile to evaluate and store | | | |
| // best fit parameters for this data | | | |
| fProfile->getVal(); | | | |
| | | | |
| // possibly store last MLE for reference | | | |
| // Double mle = fNll->getVal(); | | | |
| | | | |
| // restore parameters | | | |
| SetParameters(origParamVals, ¶msOfInterest ); | | | |
| | | | |
| // cleanup | | | |
| delete origParamVals; | | | |
| | | | |
| } else { | | | |
| | | | |
| // store best fit parameters | | | |
| // RooProfileLL::bestFitParams returns best fit of nuisance param | | | |
| eters only | | | |
| // fCachedBestFitParams = (RooArgSet*) (fProfile->bestFitPar | | | |
| ams().clone("lastBestFit")); | | | |
| // ProfileLL::getParameters returns current value of the paramete | | | |
| rs | | | |
| // fCachedBestFitParams = (RooArgSet*) (fProfile->getParamet | | | |
| ers(data)->clone("lastBestFit")); | | | |
| //cout << "making fCachedBestFitParams: " << fCachedBestFitParams | | | |
| << fCachedBestFitParams->getSize() << endl; | | | |
| | | | |
| // store original values, since minimization will change them. | | | |
| RooArgSet* origParamVals = (RooArgSet*) paramsOfInterest.snapshot | | | |
| (); | | | |
| | | | |
| // find minimum - add these extra lines to avoid calling first SE | | | |
| T WARN in RooMinuit constructor | | | |
| Bool_t smode = RooMsgService::instance().silentMode() ; | | | |
| RooMsgService::instance().setSilentMode(kTRUE) ; | | | |
| RooMinuit minuit(*nll); | | | |
| if (!smode) RooMsgService::instance().setSilentMode(kFALSE) ; | | | |
| minuit.setPrintLevel(-999); | | | |
| minuit.setNoWarn(); | | | |
| minuit.migrad(); | | | |
| | | | |
| // store the best fit values for future use | | | |
| fCachedBestFitParams = (RooArgSet*) (nll->getParameters(data)->sn | | | |
| apshot()); | | | |
| | | | |
| // restore parameters | | | |
| SetParameters(origParamVals, ¶msOfInterest ); | | | |
| | | | |
| // evaluate to force this profile to evaluate and store | | | |
| // best fit parameters for this data | | | |
| fProfile->getVal(); | | | |
| | | | |
| // cleanup | | | |
| delete origParamVals; | | | |
| | | | |
| } | | | |
| | | | |
| } | | } | |
|
| // issue warning if problems | | | |
| if(!fProfile){ cout << "problem making profile" << endl;} | | | |
| | | | |
| // set parameters to point being requested | | | |
| SetParameters(¶msOfInterest, fProfile->getParameters(data) ); | | | |
| | | | |
| Double_t value = fProfile->getVal(); | | | |
| | | | |
|
| /* | | RooFit::MsgLevel msglevel = RooMsgService::instance().globalKillBelo | |
| // for debugging caching | | w(); | |
| cout << "current value of input params: " << endl; | | RooMsgService::instance().setGlobalKillBelow(RooFit::FATAL); | |
| paramsOfInterest.Print("verbose"); | | | |
| | | | |
| cout << "current value of params in profile: " << endl; | | | |
| fProfile->getParameters(data)->Print("verbose"); | | | |
| | | | |
| cout << "cached last best fit: " << endl; | | | |
| fCachedBestFitParams->Print("verbose"); | | | |
| */ | | | |
| | | | |
| // catch false minimum | | | |
| if(value<0){ | | | |
| // cout << "ProfileLikelihoodTestStat: problem that profileLL | | | |
| = " << value | | | |
| // << " < 0, indicates false min. Try again."<<endl; | | | |
| delete fNll; | | | |
| delete fProfile; | | | |
| /* | | | |
| RooNLLVar* nll = new RooNLLVar("nll","",*fPdf,data, RooFit::Extende | | | |
| d()); | | | |
| fNll = nll; | | | |
| fProfile = new RooProfileLL("pll","",*nll, paramsOfInterest); | | | |
| */ | | | |
| | | | |
| RooArgSet* constrainedParams = fPdf->getParameters(data); | | | |
| RemoveConstantParameters(constrainedParams); | | | |
| | | | |
| RooNLLVar* nll = (RooNLLVar*) fPdf->createNLL(data, RooFit::CloneDa | | | |
| ta(kFALSE),RooFit::Constrain(*constrainedParams)); | | | |
| fNll=nll; | | | |
| fProfile = (RooProfileLL*) nll->createProfile(paramsOfInterest); | | | |
| delete constrainedParams; | | | |
| | | | |
|
| // set parameters to point being requested | | // simple | |
| SetParameters(¶msOfInterest, fProfile->getParameters(data) ); | | RooAbsReal* nll = fPdf->createNLL(data, RooFit::CloneData(kFALSE)); | |
| | | RooAbsReal* profile = nll->createProfile(paramsOfInterest); | |
| value = fProfile->getVal(); | | double ret = profile->getVal(); | |
| //cout << "now profileLL = " << value << endl; | | // paramsOfInterest.Print("v"); | |
| } | | delete nll; | |
| // cout << "now profileLL = " << value << endl; | | nll = 0; | |
| RooMsgService::instance().setGlobalKillBelow(RooFit::DEBUG) ; | | delete profile; | |
| return value; | | RooMsgService::instance().setGlobalKillBelow(msglevel); | |
| } | | // cout << "ret = " << ret << endl; | |
| | | return ret; | |
| // Get the TestStatistic | | | |
| virtual const RooAbsArg* GetTestStatistic() const {return fProfile;} | | // OLD version with some handling for local minima | |
| | | | |
| | | bool needToRebuild = true; // try to avoid rebuilding if possible | |
| | | | |
| | | if (fLastData == &data) // simple pointer comparison for now (note | |
| | | NLL makes COPY of data) | |
| | | needToRebuild = false; | |
| | | else fLastData = &data; // keep a copy of pointer to original data | |
| | | | |
| | | // pointer comparison causing problems. See multiple datasets wit | |
| | | h same value of pointer | |
| | | // but actually a new dataset | |
| | | needToRebuild = true; | |
| | | | |
| | | // check mem leak in NLL or Profile. Should remove. | |
| | | // if(fProfile) needToRebuild = false; | |
| | | | |
| | | if (needToRebuild) { | |
| | | if (fProfile) delete fProfile; | |
| | | if (fNll) delete fNll; | |
| | | | |
| | | /* | |
| | | RooNLLVar* nll = new RooNLLVar("nll","",*fPdf,data, RooFit::Ex | |
| | | tended()); | |
| | | fNll = nll; | |
| | | fProfile = new RooProfileLL("pll","",*nll, paramsOfInterest); | |
| | | */ | |
| | | RooArgSet* constrainedParams = fPdf->getParameters(data); | |
| | | RemoveConstantParameters(constrainedParams); | |
| | | //cout << "cons: " << endl; | |
| | | //constrainedParams->Print("v"); | |
| | | | |
| | | RooNLLVar * nll2 = (RooNLLVar*) fPdf->createNLL( | |
| | | data, RooFit::CloneData(kFALSE), RooFit::Constrain(*constrai | |
| | | nedParams) | |
| | | ); | |
| | | fNll = nll2; | |
| | | fProfile = (RooProfileLL*) nll2->createProfile(paramsOfInterest | |
| | | ); | |
| | | delete constrainedParams; | |
| | | | |
| | | // paramsOfInterest.Print("v"); | |
| | | | |
| | | // set parameters to previous best fit params, to speed converg | |
| | | ence | |
| | | // and to avoid local minima | |
| | | if (fCachedBestFitParams) { | |
| | | // store original values, since minimization will change the | |
| | | m. | |
| | | RooArgSet* origParamVals = (RooArgSet*) paramsOfInterest.sna | |
| | | pshot(); | |
| | | | |
| | | // these parameters are not guaranteed to be the best for th | |
| | | is data | |
| | | SetParameters(fCachedBestFitParams, fProfile->getParameters( | |
| | | data)); | |
| | | // now evaluate to force this profile to evaluate and store | |
| | | // best fit parameters for this data | |
| | | fProfile->getVal(); | |
| | | | |
| | | // possibly store last MLE for reference | |
| | | // Double mle = fNll->getVal(); | |
| | | | |
| | | // restore parameters | |
| | | SetParameters(origParamVals, ¶msOfInterest); | |
| | | | |
| | | // cleanup | |
| | | delete origParamVals; | |
| | | | |
| | | } else { | |
| | | | |
| | | // store best fit parameters | |
| | | // RooProfileLL::bestFitParams returns best fit of nuisance | |
| | | parameters only | |
| | | // fCachedBestFitParams = (RooArgSet*) (fProfile->be | |
| | | stFitParams().clone("lastBestFit")); | |
| | | // ProfileLL::getParameters returns current value of the par | |
| | | ameters | |
| | | // fCachedBestFitParams = (RooArgSet*) (fProfile->ge | |
| | | tParameters(data)->clone("lastBestFit")); | |
| | | //cout << "making fCachedBestFitParams: " << fCachedBestFitP | |
| | | arams << fCachedBestFitParams->getSize() << endl; | |
| | | | |
| | | // store original values, since minimization will change the | |
| | | m. | |
| | | RooArgSet* origParamVals = (RooArgSet*) paramsOfInterest.sna | |
| | | pshot(); | |
| | | | |
| | | // find minimum | |
| | | RooMinuit minuit(*nll); | |
| | | minuit.setPrintLevel(-999); | |
| | | minuit.setNoWarn(); | |
| | | minuit.migrad(); | |
| | | | |
| | | // store the best fit values for future use | |
| | | fCachedBestFitParams = (RooArgSet*) (nll->getParameters(data | |
| | | )->snapshot()); | |
| | | | |
| | | // restore parameters | |
| | | SetParameters(origParamVals, ¶msOfInterest); | |
| | | | |
| | | // evaluate to force this profile to evaluate and store | |
| | | // best fit parameters for this data | |
| | | fProfile->getVal(); | |
| | | | |
| | | // cleanup | |
| | | delete origParamVals; | |
| | | | |
| | | } | |
| | | | |
| | | } | |
| | | // issue warning if problems | |
| | | if (!fProfile) { | |
| | | cout << "problem making profile" << endl; | |
| | | } | |
| | | | |
| | | // set parameters to point being requested | |
| | | SetParameters(¶msOfInterest, fProfile->getParameters(data)); | |
| | | | |
| | | Double_t value = fProfile->getVal(); | |
| | | | |
| | | /* | |
| | | // for debugging caching | |
| | | cout << "current value of input params: " << endl; | |
| | | paramsOfInterest.Print("verbose"); | |
| | | | |
| | | cout << "current value of params in profile: " << endl; | |
| | | fProfile->getParameters(data)->Print("verbose"); | |
| | | | |
| | | cout << "cached last best fit: " << endl; | |
| | | fCachedBestFitParams->Print("verbose"); | |
| | | */ | |
| | | | |
| | | // catch false minimum | |
| | | if (value < 0) { | |
| | | // cout << "ProfileLikelihoodTestStat: problem that profileLL | |
| | | = " << value | |
| | | // << " < 0, indicates false min. Try again."<<endl; | |
| | | delete fNll; | |
| | | delete fProfile; | |
| | | /* | |
| | | RooNLLVar* nll = new RooNLLVar("nll","",*fPdf,data, RooFit::Ex | |
| | | tended()); | |
| | | fNll = nll; | |
| | | fProfile = new RooProfileLL("pll","",*nll, paramsOfInterest); | |
| | | */ | |
| | | | |
| | | RooArgSet* constrainedParams = fPdf->getParameters(data); | |
| | | RemoveConstantParameters(constrainedParams); | |
| | | | |
| | | RooNLLVar * nll2 = (RooNLLVar*) fPdf->createNLL(data, RooFit::C | |
| | | loneData(kFALSE), RooFit::Constrain( | |
| | | *constrainedParams)); | |
| | | fNll = nll2; | |
| | | fProfile = (RooProfileLL*) nll2->createProfile(paramsOfInterest | |
| | | ); | |
| | | delete constrainedParams; | |
| | | | |
| | | // set parameters to point being requested | |
| | | SetParameters(¶msOfInterest, fProfile->getParameters(data)) | |
| | | ; | |
| | | | |
| | | value = fProfile->getVal(); | |
| | | //cout << "now profileLL = " << value << endl; | |
| | | } | |
| | | // cout << "now profileLL = " << value << endl; | |
| | | RooMsgService::instance().setGlobalKillBelow(RooFit::DEBUG); | |
| | | return value; | |
| | | } | |
| | | | |
| virtual const TString GetVarName() const {return "Profile Likelihood
Ratio";} | | virtual const TString GetVarName() const {return "Profile Likelihood
Ratio";} | |
| | | | |
|
| | | // const bool PValueIsRightTail(void) { return false; } // overw | |
| | | rites default | |
| | | | |
| private: | | private: | |
| RooProfileLL* fProfile; | | RooProfileLL* fProfile; | |
| RooAbsPdf* fPdf; | | RooAbsPdf* fPdf; | |
| RooNLLVar* fNll; | | RooNLLVar* fNll; | |
| const RooArgSet* fCachedBestFitParams; | | const RooArgSet* fCachedBestFitParams; | |
| RooAbsData* fLastData; | | RooAbsData* fLastData; | |
| // Double_t fLastMLE; | | // Double_t fLastMLE; | |
| | | | |
| protected: | | protected: | |
| ClassDef(ProfileLikelihoodTestStat,1) // implements the profile lik
elihood ratio as a test statistic to be used with several tools | | ClassDef(ProfileLikelihoodTestStat,1) // implements the profile lik
elihood ratio as a test statistic to be used with several tools | |
| }; | | }; | |
|
| | | | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 7 change blocks. |
| 166 lines changed or deleted | | 192 lines changed or added | |
|
| QuantFuncMathCore.h | | QuantFuncMathCore.h | |
|
| // @(#)root/mathcore:$Id: QuantFuncMathCore.h 25195 2008-08-21 08:26:59Z mo
neta $ | | // @(#)root/mathcore:$Id: QuantFuncMathCore.h 34095 2010-06-24 07:31:19Z mo
neta $ | |
| // Authors: L. Moneta, A. Zsenei 08/2005 | | // Authors: L. Moneta, A. Zsenei 08/2005 | |
| | | | |
| // Authors: Andras Zsenei & Lorenzo Moneta 08/2005 | | // Authors: Andras Zsenei & Lorenzo Moneta 08/2005 | |
| | | | |
| /********************************************************************** | | /********************************************************************** | |
| * * | | * * | |
| * Copyright (c) 2005 , LCG ROOT MathLib Team * | | * Copyright (c) 2005 , LCG ROOT MathLib Team * | |
| * * | | * * | |
| * * | | * * | |
| **********************************************************************/ | | **********************************************************************/ | |
| | | | |
| skipping to change at line 53 | | skipping to change at line 53 | |
| * \f$D^{-1}(z)\f$ where | | * \f$D^{-1}(z)\f$ where | |
| * | | * | |
| * \f[ D(x) = \int_{-\infty}^{x} p(x') dx' \f] | | * \f[ D(x) = \int_{-\infty}^{x} p(x') dx' \f] | |
| * | | * | |
| * while those with the <em>_quantile_c</em> extension calculate the | | * while those with the <em>_quantile_c</em> extension calculate the | |
| * inverse of the <em>_cdf_c</em> functions, the upper tail integral of
the probability | | * inverse of the <em>_cdf_c</em> functions, the upper tail integral of
the probability | |
| * density function \f$D^{-1}(z) \f$ where | | * density function \f$D^{-1}(z) \f$ where | |
| * | | * | |
| * \f[ D(x) = \int_{x}^{+\infty} p(x') dx' \f] | | * \f[ D(x) = \int_{x}^{+\infty} p(x') dx' \f] | |
| * | | * | |
|
| * The implementation used is that of | | * These functions are defined in the header file <em>Math/ProbFunc.h<em | |
| * <A HREF="http://www.gnu.org/software/gsl/manual/html_node/Random-Numbe | | > or in the global one | |
| r-Distributions.html">GSL</A>. | | * including all statistical dunctions <em>Math/DistFunc.h<em> | |
| | | * | |
| * | | * | |
| * <strong>NOTE:</strong> In the old releases (< 5.14) the <em>_quantile<
/em> functions were called | | * <strong>NOTE:</strong> In the old releases (< 5.14) the <em>_quantile<
/em> functions were called | |
| * <em>_quant_inv</em> and the <em>_quantile_c</em> functions were called | | * <em>_quant_inv</em> and the <em>_quantile_c</em> functions were called | |
| * <em>_prob_inv</em>. | | * <em>_prob_inv</em>. | |
| * These names are currently kept for backward compatibility, but | | * These names are currently kept for backward compatibility, but | |
| * their usage is deprecated. | | * their usage is deprecated. | |
|
| | | * | |
| */ | | */ | |
| | | | |
| /** @name Quantile Functions from MathCore | | /** @name Quantile Functions from MathCore | |
|
| * The implementation used is that of | | * The implementation is provided in MathCore and for the majority of the | |
| * <A HREF="http://www.gnu.org/software/gsl/manual/html_node/Random-Numbe | | function comes from | |
| r-Distributions.html">GSL</A>. | | * <A HREF="http://www.netlib.org/cephes">Cephes</A>. | |
| | | | |
| */ | | */ | |
| | | | |
| //@{ | | //@{ | |
| | | | |
| /** | | /** | |
| | | | |
| Inverse (\f$D^{-1}(z)\f$) of the cumulative distribution | | Inverse (\f$D^{-1}(z)\f$) of the cumulative distribution | |
| function of the upper tail of the beta distribution | | function of the upper tail of the beta distribution | |
| (#beta_cdf_c). | | (#beta_cdf_c). | |
| It is implemented using the function incbi from <A HREF="http://www.ne
tlib.org/cephes">Cephes</A>. | | It is implemented using the function incbi from <A HREF="http://www.ne
tlib.org/cephes">Cephes</A>. | |
| | | | |
| skipping to change at line 458 | | skipping to change at line 461 | |
| (#uniform_cdf). For detailed description see | | (#uniform_cdf). For detailed description see | |
| <A HREF="http://mathworld.wolfram.com/UniformDistribution.html"> | | <A HREF="http://mathworld.wolfram.com/UniformDistribution.html"> | |
| Mathworld</A>. | | Mathworld</A>. | |
| | | | |
| @ingroup QuantFunc | | @ingroup QuantFunc | |
| | | | |
| */ | | */ | |
| | | | |
| double uniform_quantile(double z, double a, double b); | | double uniform_quantile(double z, double a, double b); | |
| | | | |
|
| | | /** | |
| | | | |
| | | Inverse (\f$D^{-1}(z)\f$) of the cumulative distribution | |
| | | function of the lower tail of the Landau distribution | |
| | | (#landau_cdf). | |
| | | | |
| | | For detailed description see | |
| | | K.S. Kölbig and B. Schorr, A program package for the Landau distrib | |
| | | ution, | |
| | | <A HREF="http://dx.doi.org/10.1016/0010-4655(84)90085-7">Computer Phys. | |
| | | Comm. 31 (1984) 97-111</A> | |
| | | <A HREF="http://dx.doi.org/10.1016/j.cpc.2008.03.002">[Erratum-ibid. 178 | |
| | | (2008) 972]</A>. | |
| | | The same algorithms as in | |
| | | <A HREF="http://wwwasdoc.web.cern.ch/wwwasdoc/shortwrupsdir/g110/top.htm | |
| | | l"> | |
| | | CERNLIB</A> (RANLAN) is used. | |
| | | | |
| | | @param z The argument \f$z\f$ | |
| | | @param xi The width parameter \f$\xi\f$ | |
| | | | |
| | | @ingroup QuantFunc | |
| | | | |
| | | */ | |
| | | | |
| | | double landau_quantile(double z, double xi = 1); | |
| | | | |
| | | /** | |
| | | | |
| | | Inverse (\f$D^{-1}(z)\f$) of the cumulative distribution | |
| | | function of the upper tail of the landau distribution | |
| | | (#landau_cdf_c). | |
| | | Implemented using #landau_quantile | |
| | | | |
| | | @param z The argument \f$z\f$ | |
| | | @param xi The width parameter \f$\xi\f$ | |
| | | | |
| | | @ingroup QuantFunc | |
| | | | |
| | | */ | |
| | | | |
| | | double landau_quantile_c(double z, double xi = 1); | |
| | | | |
| #ifdef HAVE_OLD_STAT_FUNC | | #ifdef HAVE_OLD_STAT_FUNC | |
| | | | |
| //@} | | //@} | |
| /** @name Backward compatible functions */ | | /** @name Backward compatible functions */ | |
| | | | |
| inline double breitwigner_prob_inv(double x, double gamma) { | | inline double breitwigner_prob_inv(double x, double gamma) { | |
| return breitwigner_quantile_c(x,gamma); | | return breitwigner_quantile_c(x,gamma); | |
| } | | } | |
| inline double breitwigner_quant_inv(double x, double gamma) { | | inline double breitwigner_quant_inv(double x, double gamma) { | |
| return breitwigner_quantile(x,gamma); | | return breitwigner_quantile(x,gamma); | |
| | | | |
End of changes. 5 change blocks. |
| 7 lines changed or deleted | | 53 lines changed or added | |
|
| RConfigOptions.h | | RConfigOptions.h | |
| #ifndef ROOT_RConfigOptions | | #ifndef ROOT_RConfigOptions | |
| #define ROOT_RConfigOptions | | #define ROOT_RConfigOptions | |
| | | | |
|
| #define R__CONFIGUREOPTIONS "QTDIR=/afs/cern.ch/sw/lcg/external/qt/4.4.2/ | | #define R__CONFIGUREOPTIONS "QTDIR=/afs/cern.ch/sw/lcg/external/qt/4.4.2/ | |
| i686-slc5-gcc43-opt PYTHONDIR=/afs/cern.ch/sw/lcg/external/Python/2.5.4p2/i | | i686-slc5-gcc43-opt PYTHONDIR=/afs/cern.ch/sw/lcg/external/Python/2.5.4p2/i | |
| 686-slc5-gcc43-opt --fail-on-missing --enable-cintex --enable-explicitlink | | 686-slc5-gcc43-opt --fail-on-missing --enable-cintex --enable-explicitlink | |
| --enable-gdml --enable-genvector --enable-krb5 --enable-mathmore --enable-m | | --enable-gdml --enable-genvector --enable-krb5 --enable-mathmore --enable-m | |
| inuit2 --enable-mysql --enable-oracle --enable-python --enable-qt --enable- | | inuit2 --enable-mysql --enable-oracle --enable-python --enable-qt --enable- | |
| qtgsi --enable-reflex --enable-roofit --enable-table --enable-unuran --with | | qtgsi --enable-reflex --enable-roofit --enable-table --enable-unuran --with | |
| -castor-incdir=/afs/cern.ch/sw/lcg/external/castor/2.1.8-10/i686-slc5-gcc43 | | -castor-incdir=/afs/cern.ch/sw/lcg/external/castor/2.1.8-10/i686-slc5-gcc43 | |
| -opt/usr/include/shift --with-castor-libdir=/afs/cern.ch/sw/lcg/external/ca | | -opt/usr/include/shift --with-castor-libdir=/afs/cern.ch/sw/lcg/external/ca | |
| stor/2.1.8-10/i686-slc5-gcc43-opt/usr/lib --with-cern-libdir=/afs/cern.ch/s | | stor/2.1.8-10/i686-slc5-gcc43-opt/usr/lib --with-cern-libdir=/afs/cern.ch/s | |
| w/lcg/external/cernlib/2006a/i686-slc5-gcc43-opt/lib --with-dcap-libdir=/af | | w/lcg/external/cernlib/2006a/i686-slc5-gcc43-opt/lib --with-dcap-libdir=/af | |
| s/cern.ch/sw/lcg/external/dcache_client/1.9.3p1/i686-slc5-gcc43-opt/dcap/li | | s/cern.ch/sw/lcg/external/dcache_client/1.9.3p1/i686-slc5-gcc43-opt/dcap/li | |
| b --with-dcap-incdir=/afs/cern.ch/sw/lcg/external/dcache_client/1.9.3p1/i68 | | b --with-dcap-incdir=/afs/cern.ch/sw/lcg/external/dcache_client/1.9.3p1/i68 | |
| 6-slc5-gcc43-opt/dcap/include --with-fftw3-incdir=/afs/cern.ch/sw/lcg/exter | | 6-slc5-gcc43-opt/dcap/include --with-fftw3-incdir=/afs/cern.ch/sw/lcg/exter | |
| nal/fftw3/3.1.2/i686-slc5-gcc43-opt/include --with-fftw3-libdir=/afs/cern.c | | nal/fftw3/3.1.2/i686-slc5-gcc43-opt/include --with-fftw3-libdir=/afs/cern.c | |
| h/sw/lcg/external/fftw3/3.1.2/i686-slc5-gcc43-opt/lib --with-gccxml=/afs/ce | | h/sw/lcg/external/fftw3/3.1.2/i686-slc5-gcc43-opt/lib --with-gccxml=/afs/ce | |
| rn.ch/sw/lcg/external/gccxml/0.9.0_20100114/i686-slc5-gcc43-opt/bin --with- | | rn.ch/sw/lcg/external/gccxml/0.9.0_20100114/i686-slc5-gcc43-opt/bin --with- | |
| gfal-libdir=/afs/cern.ch/sw/lcg/external/Grid/gfal/1.11.8-3/i686-slc5-gcc43 | | gfal-libdir=/afs/cern.ch/sw/lcg/external/Grid/gfal/1.11.7-1/i686-slc5-gcc43 | |
| -opt/lib --with-gfal-incdir=/afs/cern.ch/sw/lcg/external/Grid/gfal/1.11.8-3 | | -opt/lib --with-gfal-incdir=/afs/cern.ch/sw/lcg/external/Grid/gfal/1.11.7-1 | |
| /i686-slc5-gcc43-opt/include --with-globus-incdir=/afs/cern.ch/sw/lcg/exter | | /i686-slc5-gcc43-opt/include --with-gsl-incdir=/afs/cern.ch/sw/lcg/external | |
| nal/Grid/globus/4.0.3-VDT-1.6.0/i686-slc5-gcc43-opt/globus/include --with-g | | /GSL/1.10/i686-slc5-gcc43-opt/include --with-gsl-libdir=/afs/cern.ch/sw/lcg | |
| lobus-libdir=/afs/cern.ch/sw/lcg/external/Grid/globus/4.0.3-VDT-1.6.0/i686- | | /external/GSL/1.10/i686-slc5-gcc43-opt/lib --with-mysql-incdir=/afs/cern.ch | |
| slc5-gcc43-opt/globus/lib --with-gsl-incdir=/afs/cern.ch/sw/lcg/external/GS | | /sw/lcg/external/mysql/5.0.18/i686-slc5-gcc43-opt/include --with-mysql-libd | |
| L/1.10/i686-slc5-gcc43-opt/include --with-gsl-libdir=/afs/cern.ch/sw/lcg/ex | | ir=/afs/cern.ch/sw/lcg/external/mysql/5.0.18/i686-slc5-gcc43-opt/lib --with | |
| ternal/GSL/1.10/i686-slc5-gcc43-opt/lib --with-mysql-incdir=/afs/cern.ch/sw | | -oracle-incdir=/afs/cern.ch/sw/lcg/external/oracle/11.2.0.1.0p1/i686-slc5-g | |
| /lcg/external/mysql/5.0.18/i686-slc5-gcc43-opt/include --with-mysql-libdir= | | cc43-opt/include --with-oracle-libdir=/afs/cern.ch/sw/lcg/external/oracle/1 | |
| /afs/cern.ch/sw/lcg/external/mysql/5.0.18/i686-slc5-gcc43-opt/lib --with-or | | 1.2.0.1.0p1/i686-slc5-gcc43-opt/lib --with-shift-incdir=/afs/cern.ch/sw/lcg | |
| acle-incdir=/afs/cern.ch/sw/lcg/external/oracle/11.2.0.1.0p1/i686-slc5-gcc4 | | /external/castor/2.1.8-10/i686-slc5-gcc43-opt/usr/include/shift --with-shif | |
| 3-opt/include --with-oracle-libdir=/afs/cern.ch/sw/lcg/external/oracle/11.2 | | t-libdir=/afs/cern.ch/sw/lcg/external/castor/2.1.8-10/i686-slc5-gcc43-opt/u | |
| .0.1.0p1/i686-slc5-gcc43-opt/lib --with-shift-incdir=/afs/cern.ch/sw/lcg/ex | | sr/lib --with-pythia6-libdir=/afs/cern.ch/user/b/bellenot/scratch0/dist/pyt | |
| ternal/castor/2.1.8-10/i686-slc5-gcc43-opt/usr/include/shift --with-shift-l | | hia6/i686-slc5-gcc43-opt --with-pythia8-incdir=/afs/cern.ch/user/b/bellenot | |
| ibdir=/afs/cern.ch/sw/lcg/external/castor/2.1.8-10/i686-slc5-gcc43-opt/usr/ | | /scratch0/dist/pythia8/i686-slc5-gcc43-opt/include --with-pythia8-libdir=/a | |
| lib --with-pythia6-libdir=/afs/cern.ch/user/b/bellenot/scratch0/dist/pythia | | fs/cern.ch/user/b/bellenot/scratch0/dist/pythia8/i686-slc5-gcc43-opt/lib -- | |
| 6/i686-slc5-gcc43-opt --with-pythia8-incdir=/afs/cern.ch/user/b/bellenot/sc | | with-gviz-incdir=/build/bellenot/libraries/i686-slc5-gcc43-opt/graphviz-2.2 | |
| ratch0/dist/pythia8/i686-slc5-gcc43-opt/include --with-pythia8-libdir=/afs/ | | 4.0/include/graphviz --with-gviz-libdir=/build/bellenot/libraries/i686-slc5 | |
| cern.ch/user/b/bellenot/scratch0/dist/pythia8/i686-slc5-gcc43-opt/lib --wit | | -gcc43-opt/graphviz-2.24.0/lib" | |
| h-gviz-incdir=/build/bellenot/libraries/i686-slc5-gcc43-opt/graphviz-2.24.0 | | #define R__CONFIGUREFEATURES "asimage astiff builtin_afterimage builtin_ft | |
| /include/graphviz --with-gviz-libdir=/build/bellenot/libraries/i686-slc5-gc | | gl builtin_glew castor cintex editline dcache exceptions explicitlink fftw3 | |
| c43-opt/graphviz-2.24.0/lib" | | gviz gdml genvector gfal krb5 ldap mathmore memstat minuit2 mysql opengl o | |
| #define R__CONFIGUREFEATURES "asimage astiff builtin_afterimage builtin_ft | | racle pythia6 pythia8 python qt qtgsi reflex roofit rfio shadowpw shared ss | |
| gl builtin_freetype builtin_glew builtin_pcre builtin_zlib castor cintex ed | | l table tmva unuran xft xml xrootd thread" | |
| itline dcache exceptions explicitlink fftw3 gviz gdml genvector gfal globus | | | |
| krb5 ldap mathmore memstat minuit2 mysql opengl oracle pythia6 pythia8 pyt | | | |
| hon qt qtgsi reflex roofit rfio shadowpw shared ssl table tmva unuran xft x | | | |
| ml xrootd thread" | | | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 1 change blocks. |
| 44 lines changed or deleted | | 40 lines changed or added | |
|
| Reader.h | | Reader.h | |
|
| // @(#)root/tmva $Id: Reader.h 31458 2009-11-30 13:58:20Z stelzer $ | | // @(#)root/tmva $Id: Reader.h 34022 2010-06-21 15:52:50Z stelzer $ | |
| // Author: Andreas Hoecker, Joerg Stelzer, Helge Voss, Kai Voss | | // Author: Andreas Hoecker, Peter Speckmayer, Joerg Stelzer, Helge Voss, Ka | |
| | | i Voss | |
| | | | |
| /**************************************************************************
******** | | /**************************************************************************
******** | |
| * Project: TMVA - a Root-integrated toolkit for multivariate data analysis
* | | * Project: TMVA - a Root-integrated toolkit for multivariate data analysis
* | |
| * Package: TMVA
* | | * Package: TMVA
* | |
| * Class : Reader
* | | * Class : Reader
* | |
| * Web : http://tmva.sourceforge.net
* | | * Web : http://tmva.sourceforge.net
* | |
| *
* | | *
* | |
| * Description:
* | | * Description:
* | |
| * Reader class to be used in the user application to interpret the tr
ained * | | * Reader class to be used in the user application to interpret the tr
ained * | |
| * MVAs in an analysis context
* | | * MVAs in an analysis context
* | |
| | | | |
| skipping to change at line 89 | | skipping to change at line 89 | |
| Reader( const std::string& varNames, const TString& theOption, Bool_t
verbose = 0 ); // format: "var1:var2:..." | | Reader( const std::string& varNames, const TString& theOption, Bool_t
verbose = 0 ); // format: "var1:var2:..." | |
| | | | |
| // Root types | | // Root types | |
| Reader( std::vector<TString>& varNames, const TString& theOption = ""
, Bool_t verbose = 0 ); | | Reader( std::vector<TString>& varNames, const TString& theOption = ""
, Bool_t verbose = 0 ); | |
| Reader( const TString& varNames, const TString& theOption, Bool_t ver
bose = 0 ); // format: "var1:var2:..." | | Reader( const TString& varNames, const TString& theOption, Bool_t ver
bose = 0 ); // format: "var1:var2:..." | |
| | | | |
| virtual ~Reader( void ); | | virtual ~Reader( void ); | |
| | | | |
| // book MVA method via weight file | | // book MVA method via weight file | |
| IMethod* BookMVA( const TString& methodTag, const TString& weightfile
); | | IMethod* BookMVA( const TString& methodTag, const TString& weightfile
); | |
|
| | | IMethod* BookMVA( TMVA::Types::EMVA methodType, const char* xmlstr ); | |
| IMethod* FindMVA( const TString& methodTag ); | | IMethod* FindMVA( const TString& methodTag ); | |
| // special function for Cuts to avoid dynamic_casts in ROOT macros, | | // special function for Cuts to avoid dynamic_casts in ROOT macros, | |
| // which are not properly handled by CINT | | // which are not properly handled by CINT | |
| MethodCuts* FindCutsMVA( const TString& methodTag ); | | MethodCuts* FindCutsMVA( const TString& methodTag ); | |
| | | | |
| // returns the MVA response for given event | | // returns the MVA response for given event | |
| Double_t EvaluateMVA( const std::vector<Float_t> &, const TString& me
thodTag, Double_t aux = 0 ); | | Double_t EvaluateMVA( const std::vector<Float_t> &, const TString& me
thodTag, Double_t aux = 0 ); | |
| Double_t EvaluateMVA( const std::vector<Double_t>&, const TString& me
thodTag, Double_t aux = 0 ); | | Double_t EvaluateMVA( const std::vector<Double_t>&, const TString& me
thodTag, Double_t aux = 0 ); | |
| Double_t EvaluateMVA( MethodBase* method, Double_t aux = 0
); | | Double_t EvaluateMVA( MethodBase* method, Double_t aux = 0
); | |
| Double_t EvaluateMVA( const TString& methodTag, Double_t aux = 0
); | | Double_t EvaluateMVA( const TString& methodTag, Double_t aux = 0
); | |
| | | | |
| // returns error on MVA response for given event | | // returns error on MVA response for given event | |
| // NOTE: must be called AFTER "EvaluateMVA(...)" call ! | | // NOTE: must be called AFTER "EvaluateMVA(...)" call ! | |
| Double_t GetMVAError() const { return fMvaEventError; } | | Double_t GetMVAError() const { return fMvaEventError; } | |
|
| | | Double_t GetMVAError2() const { return fMvaEventError2; } //zj
h | |
| | | | |
|
| | | // regression response | |
| const std::vector< Float_t >& EvaluateRegression( const TString& meth
odTag, Double_t aux = 0 ); | | const std::vector< Float_t >& EvaluateRegression( const TString& meth
odTag, Double_t aux = 0 ); | |
| const std::vector< Float_t >& EvaluateRegression( MethodBase* method,
Double_t aux = 0 ); | | const std::vector< Float_t >& EvaluateRegression( MethodBase* method,
Double_t aux = 0 ); | |
| Float_t EvaluateRegression( UInt_t tgtNumber, const TString& methodT
ag, Double_t aux = 0 ); | | Float_t EvaluateRegression( UInt_t tgtNumber, const TString& methodT
ag, Double_t aux = 0 ); | |
| | | | |
|
| | | // multiclass response | |
| | | const std::vector< Float_t >& EvaluateMulticlass( const TString& meth | |
| | | odTag, Double_t aux = 0 ); | |
| | | const std::vector< Float_t >& EvaluateMulticlass( MethodBase* method, | |
| | | Double_t aux = 0 ); | |
| | | Float_t EvaluateMulticlass( UInt_t clsNumber, const TString& methodT | |
| | | ag, Double_t aux = 0 ); | |
| | | | |
| // probability and rarity accessors (see Users Guide for definition o
f Rarity) | | // probability and rarity accessors (see Users Guide for definition o
f Rarity) | |
| Double_t GetProba ( const TString& methodTag, Double_t ap_sig=0.5, Do
uble_t mvaVal=-9999999 ); | | Double_t GetProba ( const TString& methodTag, Double_t ap_sig=0.5, Do
uble_t mvaVal=-9999999 ); | |
| Double_t GetRarity( const TString& methodTag, Double_t mvaVal=-999999
9 ); | | Double_t GetRarity( const TString& methodTag, Double_t mvaVal=-999999
9 ); | |
| | | | |
| // accessors | | // accessors | |
| virtual const char* GetName() const { return "Reader"; } | | virtual const char* GetName() const { return "Reader"; } | |
| Bool_t Verbose( void ) const { return fVerbose; } | | Bool_t Verbose( void ) const { return fVerbose; } | |
| void SetVerbose( Bool_t v ) { fVerbose = v; } | | void SetVerbose( Bool_t v ) { fVerbose = v; } | |
| | | | |
| const DataSetInfo& DataInfo() const { return fDataSetInfo; } | | const DataSetInfo& DataInfo() const { return fDataSetInfo; } | |
| DataSetInfo& DataInfo() { return fDataSetInfo; } | | DataSetInfo& DataInfo() { return fDataSetInfo; } | |
| | | | |
| void AddVariable( const TString& expression, Float_t* ); | | void AddVariable( const TString& expression, Float_t* ); | |
| void AddVariable( const TString& expression, Int_t* ); | | void AddVariable( const TString& expression, Int_t* ); | |
| | | | |
| void AddSpectator( const TString& expression, Float_t* ); | | void AddSpectator( const TString& expression, Float_t* ); | |
| void AddSpectator( const TString& expression, Int_t* ); | | void AddSpectator( const TString& expression, Int_t* ); | |
| | | | |
| private: | | private: | |
| | | | |
|
| | | DataSetManager* fDataSetManager; // DSMTEST | |
| | | | |
| TString GetMethodTypeFromFile( const TString& filename ); | | TString GetMethodTypeFromFile( const TString& filename ); | |
| | | | |
| // this booking method is internal | | // this booking method is internal | |
| IMethod* BookMVA( Types::EMVA method, const TString& weightfile ); | | IMethod* BookMVA( Types::EMVA method, const TString& weightfile ); | |
| | | | |
| DataSetInfo fDataSetInfo; // the data set | | DataSetInfo fDataSetInfo; // the data set | |
| | | | |
| DataInputHandler fDataInputHandler; | | DataInputHandler fDataInputHandler; | |
| | | | |
| // Init Reader class | | // Init Reader class | |
| | | | |
| skipping to change at line 151 | | skipping to change at line 161 | |
| void DecodeVarNames( const std::string& varNames ); | | void DecodeVarNames( const std::string& varNames ); | |
| void DecodeVarNames( const TString& varNames ); | | void DecodeVarNames( const TString& varNames ); | |
| | | | |
| void DeclareOptions(); | | void DeclareOptions(); | |
| | | | |
| Bool_t fVerbose; // verbosity | | Bool_t fVerbose; // verbosity | |
| Bool_t fSilent; // silent mode | | Bool_t fSilent; // silent mode | |
| Bool_t fColor; // color mode | | Bool_t fColor; // color mode | |
| | | | |
| Double_t fMvaEventError; // per-event error returned by MVA (unless:
-1) | | Double_t fMvaEventError; // per-event error returned by MVA (unless:
-1) | |
|
| | | Double_t fMvaEventError2; // per-event error returned by MVA (unless
: -1) //zjh | |
| | | | |
| std::map<TString, IMethod*> fMethodMap; // map of methods | | std::map<TString, IMethod*> fMethodMap; // map of methods | |
| | | | |
|
| | | std::vector<Float_t> fTmpEvalVec; // temporary evaluation vect | |
| | | or (if user input is v<double>) | |
| | | | |
| mutable MsgLogger* fLogger; // message logger | | mutable MsgLogger* fLogger; // message logger | |
| MsgLogger& Log() const { return *fLogger; } | | MsgLogger& Log() const { return *fLogger; } | |
| | | | |
| ClassDef(Reader,0) // Interpret the trained MVAs in an analysis conte
xt | | ClassDef(Reader,0) // Interpret the trained MVAs in an analysis conte
xt | |
| }; | | }; | |
| | | | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 8 change blocks. |
| 2 lines changed or deleted | | 20 lines changed or added | |
|
| RooProdPdf.h | | RooProdPdf.h | |
| | | | |
| skipping to change at line 27 | | skipping to change at line 27 | |
| #define ROO_PROD_PDF | | #define ROO_PROD_PDF | |
| | | | |
| #include "Riosfwd.h" | | #include "Riosfwd.h" | |
| #include "RooAbsPdf.h" | | #include "RooAbsPdf.h" | |
| #include "RooListProxy.h" | | #include "RooListProxy.h" | |
| #include "RooLinkedList.h" | | #include "RooLinkedList.h" | |
| #include "RooAICRegistry.h" | | #include "RooAICRegistry.h" | |
| #include "RooCacheManager.h" | | #include "RooCacheManager.h" | |
| #include "RooObjCacheManager.h" | | #include "RooObjCacheManager.h" | |
| #include "RooCmdArg.h" | | #include "RooCmdArg.h" | |
|
| | | #include <vector> | |
| | | | |
| typedef RooArgList* pRooArgList ; | | typedef RooArgList* pRooArgList ; | |
| typedef RooLinkedList* pRooLinkedList ; | | typedef RooLinkedList* pRooLinkedList ; | |
| | | | |
| class RooProdPdf : public RooAbsPdf { | | class RooProdPdf : public RooAbsPdf { | |
| public: | | public: | |
| RooProdPdf() ; | | RooProdPdf() ; | |
| RooProdPdf(const char *name, const char *title, Double_t cutOff=0); | | RooProdPdf(const char *name, const char *title, Double_t cutOff=0); | |
| RooProdPdf(const char *name, const char *title, | | RooProdPdf(const char *name, const char *title, | |
| RooAbsPdf& pdf1, RooAbsPdf& pdf2, Double_t cutOff=0) ; | | RooAbsPdf& pdf1, RooAbsPdf& pdf2, Double_t cutOff=0) ; | |
| | | | |
| skipping to change at line 63 | | skipping to change at line 64 | |
| virtual TObject* clone(const char* newname) const { return new RooProdPdf
(*this,newname) ; } | | virtual TObject* clone(const char* newname) const { return new RooProdPdf
(*this,newname) ; } | |
| virtual ~RooProdPdf() ; | | virtual ~RooProdPdf() ; | |
| | | | |
| virtual Double_t getVal(const RooArgSet* set=0) const ; | | virtual Double_t getVal(const RooArgSet* set=0) const ; | |
| Double_t evaluate() const ; | | Double_t evaluate() const ; | |
| virtual Bool_t checkObservables(const RooArgSet* nset) const ; | | virtual Bool_t checkObservables(const RooArgSet* nset) const ; | |
| | | | |
| virtual Bool_t forceAnalyticalInt(const RooAbsArg& dep) const ; | | virtual Bool_t forceAnalyticalInt(const RooAbsArg& dep) const ; | |
| Int_t getAnalyticalIntegralWN(RooArgSet& allVars, RooArgSet& numVars, con
st RooArgSet* normSet, const char* rangeName=0) const ; | | Int_t getAnalyticalIntegralWN(RooArgSet& allVars, RooArgSet& numVars, con
st RooArgSet* normSet, const char* rangeName=0) const ; | |
| Double_t analyticalIntegralWN(Int_t code, const RooArgSet* normSet, const
char* rangeName=0) const ; | | Double_t analyticalIntegralWN(Int_t code, const RooArgSet* normSet, const
char* rangeName=0) const ; | |
|
| virtual Bool_t selfNormalized() const { return kTRUE ; } | | virtual Bool_t selfNormalized() const { return _selfNorm ; } | |
| | | | |
| virtual ExtendMode extendMode() const ; | | virtual ExtendMode extendMode() const ; | |
| virtual Double_t expectedEvents(const RooArgSet* nset) const ; | | virtual Double_t expectedEvents(const RooArgSet* nset) const ; | |
| virtual Double_t expectedEvents(const RooArgSet& nset) const { return exp
ectedEvents(&nset) ; } | | virtual Double_t expectedEvents(const RooArgSet& nset) const { return exp
ectedEvents(&nset) ; } | |
| | | | |
| const RooArgList& pdfList() const { return _pdfList ; } | | const RooArgList& pdfList() const { return _pdfList ; } | |
| | | | |
| virtual Int_t getGenerator(const RooArgSet& directVars, RooArgSet &genera
teVars, Bool_t staticInitOK=kTRUE) const; | | virtual Int_t getGenerator(const RooArgSet& directVars, RooArgSet &genera
teVars, Bool_t staticInitOK=kTRUE) const; | |
| virtual void initGenerator(Int_t code) ; | | virtual void initGenerator(Int_t code) ; | |
| virtual void generateEvent(Int_t code); | | virtual void generateEvent(Int_t code); | |
| virtual Bool_t isDirectGenSafe(const RooAbsArg& arg) const ; | | virtual Bool_t isDirectGenSafe(const RooAbsArg& arg) const ; | |
| | | | |
| // Constraint management | | // Constraint management | |
| virtual RooArgSet* getConstraints(const RooArgSet& observables, const Roo
ArgSet& constrainedParams, Bool_t stripDisconnected) const ; | | virtual RooArgSet* getConstraints(const RooArgSet& observables, const Roo
ArgSet& constrainedParams, Bool_t stripDisconnected) const ; | |
| | | | |
| virtual std::list<Double_t>* plotSamplingHint(RooAbsRealLValue& obs, Doub
le_t xlo, Double_t xhi) const ; | | virtual std::list<Double_t>* plotSamplingHint(RooAbsRealLValue& obs, Doub
le_t xlo, Double_t xhi) const ; | |
| | | | |
| void printMetaArgs(ostream& os) const ; | | void printMetaArgs(ostream& os) const ; | |
| | | | |
|
| | | virtual void selectNormalizationRange(const char* rangeName=0, Bool_t for | |
| | | ce=kFALSE) ; | |
| | | void fixRefRange(const char* rangeName) ; | |
| | | | |
| | | void setSelfNormalized(Bool_t flag) { _selfNorm = flag ; } | |
| | | void setDefNormSet(const RooArgSet& nset) { _defNormSet.removeAll() ; _de | |
| | | fNormSet.addClone(nset) ; } | |
| | | | |
| protected: | | protected: | |
| | | | |
|
| | | RooAbsReal* makeCondPdfRatioCorr(RooAbsReal& term, const RooArgSet& termN | |
| | | set, const RooArgSet& termImpSet, const char* normRange, const char* refRan | |
| | | ge) const ; | |
| | | | |
| virtual void getParametersHook(const RooArgSet* /*nset*/, RooArgSet* /*li
st*/, Bool_t stripDisconnected) const ; | | virtual void getParametersHook(const RooArgSet* /*nset*/, RooArgSet* /*li
st*/, Bool_t stripDisconnected) const ; | |
| | | | |
| void initializeFromCmdArgList(const RooArgSet& fullPdfSet, const RooLinke
dList& l) ; | | void initializeFromCmdArgList(const RooArgSet& fullPdfSet, const RooLinke
dList& l) ; | |
| | | | |
| void factorizeProduct(const RooArgSet& normSet, const RooArgSet& intSet, | | void factorizeProduct(const RooArgSet& normSet, const RooArgSet& intSet, | |
| RooLinkedList& termList, RooLinkedList& normList, | | RooLinkedList& termList, RooLinkedList& normList, | |
| RooLinkedList& impDepList, RooLinkedList& crossDepL
ist, | | RooLinkedList& impDepList, RooLinkedList& crossDepL
ist, | |
| RooLinkedList& intList) const; | | RooLinkedList& intList) const; | |
| const char* makeRGPPName(const char* pfx, const RooArgSet& term, const Ro
oArgSet& iset, const RooArgSet& nset, const char* isetRangeName) const ; | | const char* makeRGPPName(const char* pfx, const RooArgSet& term, const Ro
oArgSet& iset, const RooArgSet& nset, const char* isetRangeName) const ; | |
| void groupProductTerms(RooLinkedList& groupedTerms, RooArgSet& outerIntDe
ps, | | void groupProductTerms(RooLinkedList& groupedTerms, RooArgSet& outerIntDe
ps, | |
| const RooLinkedList& terms, const RooLinkedList& n
orms, | | const RooLinkedList& terms, const RooLinkedList& n
orms, | |
| const RooLinkedList& imps, const RooLinkedList& in
ts, const RooLinkedList& cross) const ; | | const RooLinkedList& imps, const RooLinkedList& in
ts, const RooLinkedList& cross) const ; | |
| | | | |
|
| Double_t calculate(const RooArgList* partIntList, const RooLinkedList* no | | | |
| rmSetList) const ; | | | |
| | | | |
| void getPartIntList(const RooArgSet* nset, const RooArgSet* iset, pRooArg
List& partList, pRooLinkedList& nsetList, | | void getPartIntList(const RooArgSet* nset, const RooArgSet* iset, pRooArg
List& partList, pRooLinkedList& nsetList, | |
| Int_t& code, const char* isetRangeName=0) const ; | | Int_t& code, const char* isetRangeName=0) const ; | |
|
| RooAbsReal* processProductTerm(const RooArgSet* nset, const RooArgSet* is | | | |
| et, const char* isetRangeName, | | std::vector<RooAbsReal*> processProductTerm(const RooArgSet* nset, const | |
| const RooArgSet* term,const RooArgSet& ter | | RooArgSet* iset, const char* isetRangeName, | |
| mNSet, const RooArgSet& termISet, | | const RooArgSet* term,const Ro | |
| Bool_t& isOwned, Bool_t forceWrap=kFALSE) | | oArgSet& termNSet, const RooArgSet& termISet, | |
| const ; | | Bool_t& isOwned, Bool_t forceW | |
| | | rap=kFALSE) const ; | |
| | | | |
| // The cache object | | // The cache object | |
| class CacheElem : public RooAbsCacheElement { | | class CacheElem : public RooAbsCacheElement { | |
| public: | | public: | |
|
| | | CacheElem() : _isRearranged(kFALSE), _rearrangedNum(0), _rearrangedDen(
0) {} | |
| virtual ~CacheElem() ; | | virtual ~CacheElem() ; | |
| // Payload | | // Payload | |
| RooArgList _partList ; | | RooArgList _partList ; | |
|
| | | RooArgList _numList ; | |
| | | RooArgList _denList ; | |
| RooArgList _ownedList ; | | RooArgList _ownedList ; | |
| RooLinkedList _normList ; | | RooLinkedList _normList ; | |
|
| | | Bool_t _isRearranged ; | |
| | | RooAbsReal* _rearrangedNum ; | |
| | | RooAbsReal* _rearrangedDen ; | |
| // Cache management functions | | // Cache management functions | |
| virtual RooArgList containedArgs(Action) ; | | virtual RooArgList containedArgs(Action) ; | |
| virtual void printCompactTreeHook(std::ostream&, const char *, Int_t, I
nt_t) ; | | virtual void printCompactTreeHook(std::ostream&, const char *, Int_t, I
nt_t) ; | |
|
| | | private: | |
| | | CacheElem(const CacheElem&) ; | |
| } ; | | } ; | |
| mutable RooObjCacheManager _cacheMgr ; // The cache manager | | mutable RooObjCacheManager _cacheMgr ; // The cache manager | |
| | | | |
|
| | | void rearrangeProduct(CacheElem&) const; | |
| | | RooAbsReal* specializeIntegral(RooAbsReal& orig, const char* targetRangeN | |
| | | ame) const ; | |
| | | RooAbsReal* specializeRatio(RooFormulaVar& input, const char* targetRange | |
| | | Name) const ; | |
| | | Double_t calculate(const RooProdPdf::CacheElem& cache, Bool_t verbose=kFA | |
| | | LSE) const ; | |
| | | Double_t calculate(const RooArgList* partIntList, const RooLinkedList* no | |
| | | rmSetList) const ; | |
| | | | |
| friend class RooProdGenContext ; | | friend class RooProdGenContext ; | |
| virtual RooAbsGenContext* genContext(const RooArgSet &vars, const RooData
Set *prototype=0, | | virtual RooAbsGenContext* genContext(const RooArgSet &vars, const RooData
Set *prototype=0, | |
| const RooArgSet *auxProto=0, Bool_t v
erbose= kFALSE) const ; | | const RooArgSet *auxProto=0, Bool_t v
erbose= kFALSE) const ; | |
| | | | |
| RooArgSet* findPdfNSet(RooAbsPdf& pdf) const ; | | RooArgSet* findPdfNSet(RooAbsPdf& pdf) const ; | |
| | | | |
| mutable RooAICRegistry _genCode ; //! Registry of composite direct genera
tor codes | | mutable RooAICRegistry _genCode ; //! Registry of composite direct genera
tor codes | |
| | | | |
| mutable RooArgSet* _curNormSet ; //! | | mutable RooArgSet* _curNormSet ; //! | |
| Double_t _cutOff ; // Cutoff parameter for running product | | Double_t _cutOff ; // Cutoff parameter for running product | |
| RooListProxy _pdfList ; // List of PDF components | | RooListProxy _pdfList ; // List of PDF components | |
| RooLinkedList _pdfNSetList ; // List of PDF component normalization sets | | RooLinkedList _pdfNSetList ; // List of PDF component normalization sets | |
| TIterator* _pdfIter ; //! Iterator of PDF list | | TIterator* _pdfIter ; //! Iterator of PDF list | |
| Int_t _extendedIndex ; // Index of extended PDF (if any) | | Int_t _extendedIndex ; // Index of extended PDF (if any) | |
| | | | |
| void useDefaultGen(Bool_t flag=kTRUE) { _useDefaultGen = flag ; } | | void useDefaultGen(Bool_t flag=kTRUE) { _useDefaultGen = flag ; } | |
| Bool_t _useDefaultGen ; // Use default or distributed event generator | | Bool_t _useDefaultGen ; // Use default or distributed event generator | |
| | | | |
|
| | | mutable TNamed* _refRangeName ; // Reference range name for interpretatio | |
| | | n of conditional products | |
| | | | |
| | | Bool_t _selfNorm ; // Is self-normalized | |
| | | RooArgSet _defNormSet ; // Default normalization set | |
| | | | |
| private: | | private: | |
| | | | |
|
| ClassDef(RooProdPdf,1) // PDF representing a product of PDFs | | ClassDef(RooProdPdf,4) // PDF representing a product of PDFs | |
| }; | | }; | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 13 change blocks. |
| 11 lines changed or deleted | | 46 lines changed or added | |
|
| SamplingDistPlot.h | | SamplingDistPlot.h | |
|
| // @(#)root/roostats:$Id: SamplingDistPlot.h 31276 2009-11-18 15:06:42Z mon | | // @(#)root/roostats:$Id: SamplingDistPlot.h 34109 2010-06-24 15:00:16Z mon | |
| eta $ | | eta $ | |
| | | // Authors: Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke | |
| /************************************************************************* | | /************************************************************************* | |
|
| * Project: RooStats * | | | |
| * Package: RooFit/RooStats * | | | |
| * Authors: * | | | |
| * Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke * | | | |
| ************************************************************************* | | | |
| * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| #ifndef ROOSTATS_SamplingDistPlot | | #ifndef ROOSTATS_SamplingDistPlot | |
| #define ROOSTATS_SamplingDistPlot | | #define ROOSTATS_SamplingDistPlot | |
| | | | |
| #include "RooList.h" | | #include "RooList.h" | |
| #include "RooPrintable.h" | | #include "RooPrintable.h" | |
| #include "TNamed.h" | | #include "TNamed.h" | |
| #include "TIterator.h" | | #include "TIterator.h" | |
| #include "TH1F.h" | | #include "TH1F.h" | |
|
| | | #include "TLegend.h" | |
| | | | |
|
| | | #ifndef ROOSTATS_SamplingDistribution | |
| #include "RooStats/SamplingDistribution.h" | | #include "RooStats/SamplingDistribution.h" | |
|
| | | #endif | |
| | | | |
| | | #ifndef ROO_PLOT | |
| | | #include "RooPlot.h" | |
| | | #endif | |
| | | | |
| namespace RooStats { | | namespace RooStats { | |
| | | | |
| class SamplingDistPlot : public TNamed, public RooPrintable { | | class SamplingDistPlot : public TNamed, public RooPrintable { | |
| | | | |
| public: | | public: | |
|
| SamplingDistPlot(); | | | |
| | | | |
| // Constructors for SamplingDistribution | | // Constructors for SamplingDistribution | |
|
| SamplingDistPlot(const Int_t nbins); | | SamplingDistPlot(const Int_t nbins = 100); | |
| SamplingDistPlot(const char* name, const char* title, Int_t nbins, Doub
le_t xmin, Double_t xmax); | | SamplingDistPlot(const char* name, const char* title, Int_t nbins, Doub
le_t xmin, Double_t xmax); | |
| | | | |
| // Destructor of SamplingDistribution | | // Destructor of SamplingDistribution | |
| virtual ~SamplingDistPlot(); | | virtual ~SamplingDistPlot(); | |
| | | | |
|
| void AddSamplingDistribution(const SamplingDistribution *samplingDist, | | // adds the sampling distribution and returns the scale factor | |
| Option_t *drawOptions=0); | | Double_t AddSamplingDistribution(const SamplingDistribution *samplingDi | |
| | | st, Option_t *drawOptions=0); | |
| | | // Like AddSamplingDistribution, but also sets a shaded area in the | |
| | | // minShaded and maxShaded boundaries. | |
| | | Double_t AddSamplingDistributionShaded(const SamplingDistribution *samp | |
| | | lingDist, Double_t minShaded, Double_t maxShaded, Option_t *drawOptions); | |
| | | | |
| | | // add a line | |
| | | void AddLine(Double_t x1, Double_t y1, Double_t x2, Double_t y2, const | |
| | | char* title = NULL); | |
| | | | |
| void Draw(const Option_t *options=0); | | void Draw(const Option_t *options=0); | |
| | | | |
|
| | | // Applies a predefined style if fApplyStyle is kTRUE (default). | |
| | | void ApplyDefaultStyle(void); | |
| | | | |
| void SetLineColor(const Color_t color, const SamplingDistribution *samp
lDist = 0); | | void SetLineColor(const Color_t color, const SamplingDistribution *samp
lDist = 0); | |
| void SetLineWidth(const Width_t lwidth, const SamplingDistribution *sam
plDist = 0); | | void SetLineWidth(const Width_t lwidth, const SamplingDistribution *sam
plDist = 0); | |
| void SetLineStyle(const Style_t style, const SamplingDistribution *samp
lDist = 0); | | void SetLineStyle(const Style_t style, const SamplingDistribution *samp
lDist = 0); | |
| | | | |
| void SetMarkerColor(const Color_t color, const SamplingDistribution *sa
mplDist = 0); | | void SetMarkerColor(const Color_t color, const SamplingDistribution *sa
mplDist = 0); | |
| void SetMarkerStyle(const Style_t style, const SamplingDistribution *sa
mplDist = 0); | | void SetMarkerStyle(const Style_t style, const SamplingDistribution *sa
mplDist = 0); | |
| void SetMarkerSize(const Size_t size, const SamplingDistribution *sampl
Dist = 0); | | void SetMarkerSize(const Size_t size, const SamplingDistribution *sampl
Dist = 0); | |
| | | | |
| void RebinDistribution(const Int_t rebinFactor, const SamplingDistribut
ion *samplDist = 0); | | void RebinDistribution(const Int_t rebinFactor, const SamplingDistribut
ion *samplDist = 0); | |
| | | | |
|
| void SetAxisTitle(char *varName) {fVarName = TString(varName);} | | void SetAxisTitle(char *varName) { fVarName = TString(varName); } | |
| | | | |
|
| private: | | // If you do not want SamplingDistPlot to interfere with your style set | |
| | | tings, call this | |
| | | // function with "false" before Draw(). | |
| | | void SetApplyStyle(const Bool_t s) { fApplyStyle = s; } | |
| | | | |
| | | // Returns the TH1F associated with the give SamplingDistribution. | |
| | | // Intended use: Access to member functions of TH1F like GetMean(), | |
| | | // GetRMS() etc. | |
| | | TH1F* GetTH1F(const SamplingDistribution *samplDist); | |
| | | | |
| | | // changes plot to log scale on x axis | |
| | | void SetLogXaxis(const Bool_t lx) { fLogXaxis = lx; } | |
| | | // changes plot to log scale on y axis | |
| | | void SetLogYaxis(const Bool_t ly) { fLogYaxis = ly; } | |
| | | | |
| | | // write to Root file | |
| | | void DumpToFile(const char* RootFileName, Option_t *option="", const ch | |
| | | ar *ftitle="", Int_t compress=1); | |
| | | | |
|
| | | private: | |
| std::vector<Double_t> fSamplingDistr; | | std::vector<Double_t> fSamplingDistr; | |
| std::vector<Double_t> fSampleWeights; | | std::vector<Double_t> fSampleWeights; | |
| | | | |
| Bool_t fIsWeighted; | | Bool_t fIsWeighted; | |
| | | | |
|
| Int_t fbins; | | Int_t fBins; | |
| Int_t fMarkerType; | | Int_t fMarkerType; | |
| Int_t fColor; | | Int_t fColor; | |
| | | | |
| TString fVarName; | | TString fVarName; | |
| | | | |
| protected: | | protected: | |
| | | | |
|
| TH1F* fhist; | | TH1F* fHist; | |
| | | TLegend *fLegend; | |
| | | | |
| | | RooList fItems; // holds TH1Fs only | |
| | | RooList fOtherItems; // other objects to be drawn like TLine etc. | |
| | | TIterator* fIterator; // TODO remove class variable and instantiate loc | |
| | | ally as necessary | |
| | | RooPlot* fRooPlot; | |
| | | Bool_t fLogXaxis; | |
| | | Bool_t fLogYaxis; | |
| | | | |
|
| RooList fItems; | | Bool_t fApplyStyle; | |
| TIterator* fIterator; | | Style_t fFillStyle; | |
| | | | |
| void SetSampleWeights(const SamplingDistribution *samplingDist); | | void SetSampleWeights(const SamplingDistribution *samplingDist); | |
| | | | |
|
| void addObject(TObject *obj, Option_t *drawOptions=0); | | void addObject(TObject *obj, Option_t *drawOptions=0); // for TH1Fs onl | |
| | | y | |
| | | void addOtherObject(TObject *obj, Option_t *drawOptions=0); | |
| void GetAbsoluteInterval(Float_t &theMin, Float_t &theMax, Float_t &the
YMax) const; | | void GetAbsoluteInterval(Float_t &theMin, Float_t &theMax, Float_t &the
YMax) const; | |
| | | | |
| ClassDef(SamplingDistPlot,1) // Class containing the results of the Hy
bridCalculator | | ClassDef(SamplingDistPlot,1) // Class containing the results of the Hy
bridCalculator | |
| }; | | }; | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 16 change blocks. |
| 20 lines changed or deleted | | 61 lines changed or added | |
|
| SpecFuncMathMore.h | | SpecFuncMathMore.h | |
|
| // @(#)root/mathmore:$Id: SpecFuncMathMore.h 21129 2007-11-30 14:41:10Z mon
eta $ | | // @(#)root/mathmore:$Id: SpecFuncMathMore.h 34054 2010-06-22 12:27:30Z mon
eta $ | |
| // Authors: L. Moneta, A. Zsenei 08/2005 | | // Authors: L. Moneta, A. Zsenei 08/2005 | |
| | | | |
| // Authors: Andras Zsenei & Lorenzo Moneta 06/2005 | | // Authors: Andras Zsenei & Lorenzo Moneta 06/2005 | |
| | | | |
| /********************************************************************** | | /********************************************************************** | |
| * * | | * * | |
| * Copyright (c) 2004 ROOT Foundation, CERN/PH-SFT * | | * Copyright (c) 2004 ROOT Foundation, CERN/PH-SFT * | |
| * * | | * * | |
| * This library is free software; you can redistribute it and/or * | | * This library is free software; you can redistribute it and/or * | |
| * modify it under the terms of the GNU General Public License * | | * modify it under the terms of the GNU General Public License * | |
| | | | |
| skipping to change at line 539 | | skipping to change at line 539 | |
| Mathworld</A>. The implementation used is that of | | Mathworld</A>. The implementation used is that of | |
| <A HREF="http://www.gnu.org/software/gsl/manual/gsl-ref_7.html#SEC74">GSL
</A>. | | <A HREF="http://www.gnu.org/software/gsl/manual/gsl-ref_7.html#SEC74">GSL
</A>. | |
| | | | |
| @ingroup SpecFunc | | @ingroup SpecFunc | |
| | | | |
| */ | | */ | |
| // [5.2.1.23] spherical Neumann functions | | // [5.2.1.23] spherical Neumann functions | |
| | | | |
| double sph_neumann(unsigned n, double x); | | double sph_neumann(unsigned n, double x); | |
| | | | |
|
| | | /** | |
| | | | |
| | | Calculates the Airy function Ai | |
| | | | |
| | | \f[ Ai(x) = \frac{1}{\pi} \int\limits_{0}^{\infty} \cos(xt + t^3/3) dt \f | |
| | | ] | |
| | | | |
| | | For detailed description see | |
| | | <A HREF="http://mathworld.wolfram.com/AiryFunctions.html"> | |
| | | Mathworld</A> | |
| | | and <A HREF="http://www.nrbook.com/abramowitz_and_stegun/page_446.htm">Ab | |
| | | ramowitz&Stegun, Sect. 10.4</A>. | |
| | | The implementation used is that of | |
| | | <A HREF="http://www.gnu.org/software/gsl/manual/html_node/Airy-Functions. | |
| | | html">GSL</A>. | |
| | | | |
| | | @ingroup SpecFunc | |
| | | | |
| | | */ | |
| | | // Airy function Ai | |
| | | | |
| | | double airy_Ai(double x); | |
| | | | |
| | | /** | |
| | | | |
| | | Calculates the Airy function Bi | |
| | | | |
| | | \f[ Bi(x) = \frac{1}{\pi} \int\limits_{0}^{\infty} [\exp(xt-t^3/3) + \cos | |
| | | (xt + t^3/3)] dt \f] | |
| | | | |
| | | For detailed description see | |
| | | <A HREF="http://mathworld.wolfram.com/AiryFunctions.html"> | |
| | | Mathworld</A> | |
| | | and <A HREF="http://www.nrbook.com/abramowitz_and_stegun/page_446.htm">Ab | |
| | | ramowitz&Stegun, Sect. 10.4</A>. | |
| | | The implementation used is that of | |
| | | <A HREF="http://www.gnu.org/software/gsl/manual/html_node/Airy-Functions. | |
| | | html">GSL</A>. | |
| | | | |
| | | @ingroup SpecFunc | |
| | | | |
| | | */ | |
| | | // Airy function Bi | |
| | | | |
| | | double airy_Bi(double x); | |
| | | | |
| | | /** | |
| | | | |
| | | Calculates the derivative of the Airy function Ai | |
| | | | |
| | | \f[ Ai(x) = \frac{1}{\pi} \int\limits_{0}^{\infty} \cos(xt + t^3/3) dt \f | |
| | | ] | |
| | | | |
| | | For detailed description see | |
| | | <A HREF="http://mathworld.wolfram.com/AiryFunctions.html"> | |
| | | Mathworld</A> | |
| | | and <A HREF="http://www.nrbook.com/abramowitz_and_stegun/page_446.htm">Ab | |
| | | ramowitz&Stegun, Sect. 10.4</A>. | |
| | | The implementation used is that of | |
| | | <A HREF="http://www.gnu.org/software/gsl/manual/html_node/Derivatives-of- | |
| | | Airy-Functions.html">GSL</A>. | |
| | | | |
| | | @ingroup SpecFunc | |
| | | | |
| | | */ | |
| | | // Derivative of the Airy function Ai | |
| | | | |
| | | double airy_Ai_deriv(double x); | |
| | | | |
| | | /** | |
| | | | |
| | | Calculates the derivative of the Airy function Bi | |
| | | | |
| | | \f[ Bi(x) = \frac{1}{\pi} \int\limits_{0}^{\infty} [\exp(xt-t^3/3) + \cos | |
| | | (xt + t^3/3)] dt \f] | |
| | | | |
| | | For detailed description see | |
| | | <A HREF="http://mathworld.wolfram.com/AiryFunctions.html"> | |
| | | Mathworld</A> | |
| | | and <A HREF="http://www.nrbook.com/abramowitz_and_stegun/page_446.htm">Ab | |
| | | ramowitz&Stegun, Sect. 10.4</A>. | |
| | | The implementation used is that of | |
| | | <A HREF="http://www.gnu.org/software/gsl/manual/html_node/Derivatives-of- | |
| | | Airy-Functions.html">GSL</A>. | |
| | | | |
| | | @ingroup SpecFunc | |
| | | | |
| | | */ | |
| | | // Derivative of the Airy function Bi | |
| | | | |
| | | double airy_Bi_deriv(double x); | |
| | | | |
| | | /** | |
| | | | |
| | | Calculates the zeroes of the Airy function Ai | |
| | | | |
| | | \f[ Ai(x) = \frac{1}{\pi} \int\limits_{0}^{\infty} \cos(xt + t^3/3) dt \f | |
| | | ] | |
| | | | |
| | | For detailed description see | |
| | | <A HREF="http://mathworld.wolfram.com/AiryFunctionZeros.html"> | |
| | | Mathworld</A> | |
| | | and <A HREF="http://www.nrbook.com/abramowitz_and_stegun/page_446.htm">Ab | |
| | | ramowitz&Stegun, Sect. 10.4</A>. | |
| | | The implementation used is that of | |
| | | <A HREF="http://www.gnu.org/software/gsl/manual/html_node/Zeros-of-Airy-F | |
| | | unctions.html">GSL</A>. | |
| | | | |
| | | @ingroup SpecFunc | |
| | | | |
| | | */ | |
| | | // s-th zero of the Airy function Ai | |
| | | | |
| | | double airy_zero_Ai(unsigned int s); | |
| | | | |
| | | /** | |
| | | | |
| | | Calculates the zeroes of the Airy function Bi | |
| | | | |
| | | \f[ Bi(x) = \frac{1}{\pi} \int\limits_{0}^{\infty} [\exp(xt-t^3/3) + \cos | |
| | | (xt + t^3/3)] dt \f] | |
| | | | |
| | | For detailed description see | |
| | | <A HREF="http://mathworld.wolfram.com/AiryFunctionZeros.html"> | |
| | | Mathworld</A> | |
| | | and <A HREF="http://www.nrbook.com/abramowitz_and_stegun/page_446.htm">Ab | |
| | | ramowitz&Stegun, Sect. 10.4</A>. | |
| | | The implementation used is that of | |
| | | <A HREF="http://www.gnu.org/software/gsl/manual/html_node/Zeros-of-Airy-F | |
| | | unctions.html">GSL</A>. | |
| | | | |
| | | @ingroup SpecFunc | |
| | | | |
| | | */ | |
| | | // s-th zero of the Airy function Bi | |
| | | | |
| | | double airy_zero_Bi(unsigned int s); | |
| | | | |
| | | /** | |
| | | | |
| | | Calculates the zeroes of the derivative of the Airy function Ai | |
| | | | |
| | | \f[ Ai(x) = \frac{1}{\pi} \int\limits_{0}^{\infty} \cos(xt + t^3/3) dt \f | |
| | | ] | |
| | | | |
| | | For detailed description see | |
| | | <A HREF="http://mathworld.wolfram.com/AiryFunctionZeros.html"> | |
| | | Mathworld</A> | |
| | | and <A HREF="http://www.nrbook.com/abramowitz_and_stegun/page_446.htm">Ab | |
| | | ramowitz&Stegun, Sect. 10.4</A>. | |
| | | The implementation used is that of | |
| | | <A HREF="http://www.gnu.org/software/gsl/manual/html_node/Zeros-of-Deriva | |
| | | tives-of-Airy-Functions.html">GSL</A>. | |
| | | | |
| | | @ingroup SpecFunc | |
| | | | |
| | | */ | |
| | | // s-th zero of the derivative of the Airy function Ai | |
| | | | |
| | | double airy_zero_Ai_deriv(unsigned int s); | |
| | | | |
| | | /** | |
| | | | |
| | | Calculates the zeroes of the derivative of the Airy function Bi | |
| | | | |
| | | \f[ Bi(x) = \frac{1}{\pi} \int\limits_{0}^{\infty} [\exp(xt-t^3/3) + \cos | |
| | | (xt + t^3/3)] dt \f] | |
| | | | |
| | | For detailed description see | |
| | | <A HREF="http://mathworld.wolfram.com/AiryFunctionZeros.html"> | |
| | | Mathworld</A> | |
| | | and <A HREF="http://www.nrbook.com/abramowitz_and_stegun/page_446.htm">Ab | |
| | | ramowitz&Stegun, Sect. 10.4</A>. | |
| | | The implementation used is that of | |
| | | <A HREF="http://www.gnu.org/software/gsl/manual/html_node/Zeros-of-Deriva | |
| | | tives-of-Airy-Functions.html">GSL</A>. | |
| | | | |
| | | @ingroup SpecFunc | |
| | | | |
| | | */ | |
| | | // s-th zero of the derivative of the Airy function Bi | |
| | | | |
| | | double airy_zero_Bi_deriv(unsigned int s); | |
| | | | |
| } // namespace Math | | } // namespace Math | |
| } // namespace ROOT | | } // namespace ROOT | |
| | | | |
| #endif //ROOT_Math_SpecFuncMathMore | | #endif //ROOT_Math_SpecFuncMathMore | |
| | | | |
| #endif // if defined (__CINT__) && !defined(__MAKECINT__) | | #endif // if defined (__CINT__) && !defined(__MAKECINT__) | |
| | | | |
End of changes. 2 change blocks. |
| 1 lines changed or deleted | | 185 lines changed or added | |
|
| TDataSetManager.h | | TDataSetManager.h | |
|
| // @(#)root/proof:$Id: TDataSetManager.h 33209 2010-04-26 10:27:40Z ganis $ | | // @(#)root/proof:$Id: TDataSetManager.h 33447 2010-05-10 13:26:51Z ganis $ | |
| // Author: Jan Fiete Grosse-Oetringhaus, 08.08.07 | | // Author: Jan Fiete Grosse-Oetringhaus, 08.08.07 | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| | | | |
| skipping to change at line 101 | | skipping to change at line 101 | |
| kCheckQuota = BIT(15), // quota checking enabled | | kCheckQuota = BIT(15), // quota checking enabled | |
| kAllowRegister = BIT(16), // allow registration of a new dataset | | kAllowRegister = BIT(16), // allow registration of a new dataset | |
| kAllowVerify = BIT(17), // allow verification of a dataset (requi
res registration permit) | | kAllowVerify = BIT(17), // allow verification of a dataset (requi
res registration permit) | |
| kTrustInfo = BIT(18), // during registration, trust the availab
le information provided by the user | | kTrustInfo = BIT(18), // during registration, trust the availab
le information provided by the user | |
| kIsSandbox = BIT(19), // dataset dir is in the user sandbox (si
mplified naming) | | kIsSandbox = BIT(19), // dataset dir is in the user sandbox (si
mplified naming) | |
| kUseCache = BIT(20), // force the usage of cache | | kUseCache = BIT(20), // force the usage of cache | |
| kDoNotUseCache = BIT(21) // disable the cache | | kDoNotUseCache = BIT(21) // disable the cache | |
| }; | | }; | |
| | | | |
| enum EDataSetWorkOpts { // General (bits 1-8) | | enum EDataSetWorkOpts { // General (bits 1-8) | |
|
| kDebug = 1, kShowDefault = 2, kPrint = 4, kExpor | | kDebug = 0x1, kShowDefault = 0x2, kPrint = 0x4, | |
| t = 8, | | kExport = 0x8, | |
| kQuotaUpdate = 16, kSetDefaultTree = 32, kForceS | | kQuotaUpdate = 0x10, kSetDefaultTree = 0x20, kFo | |
| can = 64, | | rceScan = 0x40, | |
| kNoHeaderPrint = 128, | | kNoHeaderPrint = 0x80, | |
| // File-based specific (bits 9-16) | | // File-based specific (bits 9-16) | |
|
| kReopen = 256, kTouch = 512, kMaxFiles = 1024, k | | kReopen = 0x100, kTouch = 0x200, kMaxFiles = 0x4 | |
| ReadShort = 2048, | | 00, kReadShort = 0x800, | |
| kFileMustExist = 4096, | | kFileMustExist = 0x1000, | |
| | | kNoAction = 0x2000, kLocateOnly = 0x4000, kStage | |
| | | Only = 0x8000, | |
| // Auxilliary bits (bits 17-) | | // Auxilliary bits (bits 17-) | |
|
| kNoCacheUpdate = 65536, kRefreshLs = 131072, kLi | | kNoCacheUpdate = 0x10000, kRefreshLs = 0x20000, | |
| st = 262144 | | kList = 0x40000, | |
| | | kAllFiles = 0x80000, kStagedFiles = 0x100000, kN | |
| | | oStagedCheck = 0x200000 | |
| }; | | }; | |
| | | | |
| TDataSetManager(const char *group = 0, const char *user = 0, const char
*options = 0); | | TDataSetManager(const char *group = 0, const char *user = 0, const char
*options = 0); | |
| virtual ~TDataSetManager(); | | virtual ~TDataSetManager(); | |
| | | | |
| virtual Int_t ClearCache(const char *uri); | | virtual Int_t ClearCache(const char *uri); | |
| virtual Long64_t GetAvgFileSize() const { return fAvgFileSize; } | | virtual Long64_t GetAvgFileSize() const { return fAvgFileSize; } | |
| virtual TFileCollection *GetDataSet(const char *uri, const char *server
= 0); | | virtual TFileCollection *GetDataSet(const char *uri, const char *server
= 0); | |
| virtual TMap *GetDataSets(const char *uri, UInt_t /*option*/
= TDataSetManager::kExport); | | virtual TMap *GetDataSets(const char *uri, UInt_t /*option*/
= TDataSetManager::kExport); | |
| virtual TMap *GetSubDataSets(const char *uri, const char *exc
ludeservers); | | virtual TMap *GetSubDataSets(const char *uri, const char *exc
ludeservers); | |
| | | | |
| skipping to change at line 133 | | skipping to change at line 135 | |
| virtual Bool_t ExistsDataSet(const char *uri); | | virtual Bool_t ExistsDataSet(const char *uri); | |
| virtual void MonitorUsedSpace(TVirtualMonitoringWriter *moni
toring); | | virtual void MonitorUsedSpace(TVirtualMonitoringWriter *moni
toring); | |
| virtual Int_t NotifyUpdate(const char *group = 0, const char
*user = 0, | | virtual Int_t NotifyUpdate(const char *group = 0, const char
*user = 0, | |
| const char *dspath = 0, Long_t mti
me = 0, const char *checksum = 0); | | const char *dspath = 0, Long_t mti
me = 0, const char *checksum = 0); | |
| Bool_t ParseUri(const char *uri, TString *dsGroup = 0,
TString *dsUser = 0, | | Bool_t ParseUri(const char *uri, TString *dsGroup = 0,
TString *dsUser = 0, | |
| TString *dsName = 0, TString *dsTree =
0, | | TString *dsName = 0, TString *dsTree =
0, | |
| Bool_t onlyCurrent = kFALSE, Bool_t wi
ldcards = kFALSE); | | Bool_t onlyCurrent = kFALSE, Bool_t wi
ldcards = kFALSE); | |
| virtual void ParseInitOpts(const char *opts); | | virtual void ParseInitOpts(const char *opts); | |
| virtual Bool_t RemoveDataSet(const char *uri); | | virtual Bool_t RemoveDataSet(const char *uri); | |
| virtual Int_t RegisterDataSet(const char *uri, TFileCollectio
n *dataSet, const char *opt); | | virtual Int_t RegisterDataSet(const char *uri, TFileCollectio
n *dataSet, const char *opt); | |
|
| virtual Int_t ScanDataSet(const char *uri, UInt_t option = 0) | | Int_t ScanDataSet(const char *uri, const char *opt); | |
| ; | | virtual Int_t ScanDataSet(const char *uri, UInt_t option = kR | |
| | | eopen | kDebug); | |
| void SetScanCounters(Int_t t = -1, Int_t o = -1, Int
_t d = -1); | | void SetScanCounters(Int_t t = -1, Int_t o = -1, Int
_t d = -1); | |
| virtual Int_t ShowCache(const char *uri); | | virtual Int_t ShowCache(const char *uri); | |
| virtual void ShowQuota(const char *opt); | | virtual void ShowQuota(const char *opt); | |
| | | | |
| virtual void ShowDataSets(const char *uri = "*", const char
*opt = ""); | | virtual void ShowDataSets(const char *uri = "*", const char
*opt = ""); | |
| | | | |
| static TString CreateUri(const char *dsGroup = 0, const char *
dsUser = 0, | | static TString CreateUri(const char *dsGroup = 0, const char *
dsUser = 0, | |
| const char *dsName = 0, const char *d
sTree = 0); | | const char *dsName = 0, const char *d
sTree = 0); | |
| static Bool_t CheckDataSetSrvMaps(TUrl *furl, TString &fn, TL
ist *srvmaplist = 0); | | static Bool_t CheckDataSetSrvMaps(TUrl *furl, TString &fn, TL
ist *srvmaplist = 0); | |
| static TList *GetDataSetSrvMaps(); | | static TList *GetDataSetSrvMaps(); | |
| static TList *ParseDataSetSrvMaps(const TString &srvmaps); | | static TList *ParseDataSetSrvMaps(const TString &srvmaps); | |
|
| static Int_t ScanDataSet(TFileCollection *dataset, Int_t fop | | static Int_t ScanDataSet(TFileCollection *dataset, Int_t fop | |
| enopt, Bool_t notify = kFALSE, | | t, Int_t sopt = 0, Int_t ropt = 0, | |
| Int_t scanfopt = 0, TList *flist = | | Bool_t dbg = kFALSE, | |
| 0, Long64_t avgsize = -1, | | Int_t *touched = 0, Int_t *opened = | |
| const char *mssurl = 0, Int_t files | | 0, Int_t *disappeared = 0, | |
| max = -1, | | TList *flist = 0, Long64_t avgsz = | |
| Int_t *touched = 0, Int_t *opened = | | -1, const char *mss = 0, | |
| 0, Int_t *disappeared = 0); | | Int_t maxfiles = -1, const char *st | |
| | | ageopts = 0); | |
| static Int_t ScanFile(TFileInfo *fileinfo, Bool_t notify); | | static Int_t ScanFile(TFileInfo *fileinfo, Bool_t notify); | |
|
| | | static Int_t FillMetaData(TFileInfo *fi, TDirectory *d, cons
t char *rdir = "/"); | |
| | | | |
| ClassDef(TDataSetManager, 0) // Abstract data set manager class | | ClassDef(TDataSetManager, 0) // Abstract data set manager class | |
| }; | | }; | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 7 change blocks. |
| 21 lines changed or deleted | | 28 lines changed or added | |
|
| TDataSetManagerFile.h | | TDataSetManagerFile.h | |
|
| // @(#)root/proof:$Id: TDataSetManagerFile.h 33156 2010-04-23 12:46:14Z gan
is $ | | // @(#)root/proof:$Id: TDataSetManagerFile.h 33357 2010-05-04 06:56:18Z gan
is $ | |
| // Author: Jan Fiete Grosse-Oetringhaus, 08.08.07 | | // Author: Jan Fiete Grosse-Oetringhaus, 08.08.07 | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| | | | |
| skipping to change at line 37 | | skipping to change at line 37 | |
| | | | |
| const char* const kDataSet_LocalCache = "dataset.cache"; // default cache
subdirectory | | const char* const kDataSet_LocalCache = "dataset.cache"; // default cache
subdirectory | |
| const char* const kDataSet_DataSetList = "dataset.list"; // file with inf
o about all datasets | | const char* const kDataSet_DataSetList = "dataset.list"; // file with inf
o about all datasets | |
| const char* const kDataSet_LockLocation = "lock.location"; // location of t
he lock file | | const char* const kDataSet_LockLocation = "lock.location"; // location of t
he lock file | |
| | | | |
| class TDataSetManagerFile : public TDataSetManager { | | class TDataSetManagerFile : public TDataSetManager { | |
| | | | |
| private: | | private: | |
| TString fDataSetDir; // Location of datasets | | TString fDataSetDir; // Location of datasets | |
| TString fMSSUrl; // URL for the Mass Storage System | | TString fMSSUrl; // URL for the Mass Storage System | |
|
| | | TString fStageOpts; // Option string to be used in issuing stagi
ng requests | |
| TString fDataSetLockFile; // Dataset lock file | | TString fDataSetLockFile; // Dataset lock file | |
| Int_t fLockFileTimeLimit; // Limit in seconds after a lock automatical
ly expires | | Int_t fLockFileTimeLimit; // Limit in seconds after a lock automatical
ly expires | |
| TString fListFile; // File to check repository updates | | TString fListFile; // File to check repository updates | |
| Bool_t fIsRemote; // True if the repository is remote | | Bool_t fIsRemote; // True if the repository is remote | |
| Bool_t fUseCache; // True if the cache is used for browsing re
mote repositories | | Bool_t fUseCache; // True if the cache is used for browsing re
mote repositories | |
| TString fLocalCacheDir; // Local cache when the repository is remote | | TString fLocalCacheDir; // Local cache when the repository is remote | |
| Int_t fCacheUpdatePeriod; // Period for checking for new updated infor
mation | | Int_t fCacheUpdatePeriod; // Period for checking for new updated infor
mation | |
| | | | |
| // Local cache handling | | // Local cache handling | |
| void InitLocalCache(); | | void InitLocalCache(); | |
| | | | |
| skipping to change at line 60 | | skipping to change at line 61 | |
| const char *GetDataSetPath(const char *group, const char *user, const ch
ar *dsName); | | const char *GetDataSetPath(const char *group, const char *user, const ch
ar *dsName); | |
| const char *GetDataSetPath(const char *group, const char *user, const ch
ar *dsName, | | const char *GetDataSetPath(const char *group, const char *user, const ch
ar *dsName, | |
| TString &md5path, Bool_t local = kFALSE); | | TString &md5path, Bool_t local = kFALSE); | |
| void Init(); | | void Init(); | |
| Bool_t BrowseDataSets(const char *group, const char *user, const char *d
sName, | | Bool_t BrowseDataSets(const char *group, const char *user, const char *d
sName, | |
| UInt_t option, TObject *target); | | UInt_t option, TObject *target); | |
| | | | |
| Bool_t RemoveDataSet(const char *group, const char *user, const char *ds
Name); | | Bool_t RemoveDataSet(const char *group, const char *user, const char *ds
Name); | |
| Bool_t ExistsDataSet(const char *group, const char *user, const char *ds
Name); | | Bool_t ExistsDataSet(const char *group, const char *user, const char *ds
Name); | |
| | | | |
|
| Int_t ScanDataSet(const char *group, const char *user, const char *dsNa
me, UInt_t option); | | Int_t ScanDataSet(const char *group, const char *user, const char *dsNa
me, UInt_t option = kReopen | kDebug); | |
| | | | |
| Int_t ChecksumDataSet(const char *path, const char *md5path, TString &c
hecksum); | | Int_t ChecksumDataSet(const char *path, const char *md5path, TString &c
hecksum); | |
| | | | |
| Int_t CreateLsFile(const char *group, const char *user, Long_t &mtime,
TString &checksum); | | Int_t CreateLsFile(const char *group, const char *user, Long_t &mtime,
TString &checksum); | |
| Int_t FillLsDataSet(const char *group, const char *user, const char *ds
Name, TList *out, UInt_t option); | | Int_t FillLsDataSet(const char *group, const char *user, const char *ds
Name, TList *out, UInt_t option); | |
| | | | |
| void UpdateUsedSpace(); | | void UpdateUsedSpace(); | |
| | | | |
| public: | | public: | |
| TDataSetManagerFile() : TDataSetManager(0, 0, 0) { } | | TDataSetManagerFile() : TDataSetManager(0, 0, 0) { } | |
| TDataSetManagerFile(const char *group, const char *user, const char *ins
); | | TDataSetManagerFile(const char *group, const char *user, const char *ins
); | |
| TDataSetManagerFile(const char *ins); | | TDataSetManagerFile(const char *ins); | |
| virtual ~TDataSetManagerFile() { } | | virtual ~TDataSetManagerFile() { } | |
| | | | |
|
| void ParseInitOpts(const char *opts); | | void ParseInitOpts(const char *opts); | |
| | | | |
|
| Int_t ClearCache(const char *uri = 0); | | Int_t ClearCache(const char *uri = 0); | |
| TFileCollection *GetDataSet(const char *uri, const char *srv = 0); | | TFileCollection *GetDataSet(const char *uri, const char *srv = 0); | |
| TMap *GetDataSets(const char *uri, UInt_t option = TDataSetMa
nager::kExport); | | TMap *GetDataSets(const char *uri, UInt_t option = TDataSetMa
nager::kExport); | |
| Bool_t ExistsDataSet(const char *uri); | | Bool_t ExistsDataSet(const char *uri); | |
| Bool_t RemoveDataSet(const char *uri); | | Bool_t RemoveDataSet(const char *uri); | |
| | | | |
| Int_t RegisterDataSet(const char *uri, TFileCollection *dataS
et, const char *opt); | | Int_t RegisterDataSet(const char *uri, TFileCollection *dataS
et, const char *opt); | |
|
| Int_t ScanDataSet(const char *uri, UInt_t option = 0); | | Int_t ScanDataSet(const char *uri, UInt_t option = kReopen | | |
| Int_t NotifyUpdate(const char *group, const char *user, | | kDebug); | |
| const char *dspath, Long_t mtime, const char *checks | | Int_t NotifyUpdate(const char *group, const char *user, | |
| um = 0); | | const char *dspath, Long_t mtime, const ch | |
| Int_t ShowCache(const char *uri = 0); | | ar *checksum = 0); | |
| | | Int_t ShowCache(const char *uri = 0); | |
| | | | |
| // These should / could be private but they are used directly by the ext
ernal daemon | | // These should / could be private but they are used directly by the ext
ernal daemon | |
| TFileCollection *GetDataSet(const char *group, const char *user, const c
har *dsName, | | TFileCollection *GetDataSet(const char *group, const char *user, const c
har *dsName, | |
| UInt_t option = 0, TMD5 **checksum = 0); | | UInt_t option = 0, TMD5 **checksum = 0); | |
| TMap *GetDataSets(const char *group, const char *user, const
char *dsName = 0, | | TMap *GetDataSets(const char *group, const char *user, const
char *dsName = 0, | |
| UInt_t option = 0); | | UInt_t option = 0); | |
| const char *GetMSSUrl() const { return fMSSUrl; } | | const char *GetMSSUrl() const { return fMSSUrl; } | |
|
| | | const char *GetStageOpts() const { return fStageOpts; } | |
| Int_t WriteDataSet(const char *group, const char *user, const
char *dsName, | | Int_t WriteDataSet(const char *group, const char *user, const
char *dsName, | |
| TFileCollection *dataset, UInt_t option =
0, TMD5 *checksum = 0); | | TFileCollection *dataset, UInt_t option =
0, TMD5 *checksum = 0); | |
| | | | |
| ClassDef(TDataSetManagerFile, 0) // DataSet manager for files | | ClassDef(TDataSetManagerFile, 0) // DataSet manager for files | |
| }; | | }; | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 7 change blocks. |
| 9 lines changed or deleted | | 12 lines changed or added | |
|
| TEveCalo.h | | TEveCalo.h | |
|
| // @(#)root/eve:$Id: TEveCalo.h 33198 2010-04-26 08:40:04Z matevz $ | | // @(#)root/eve:$Id: TEveCalo.h 34066 2010-06-22 17:48:40Z matevz $ | |
| // Author: Matevz Tadel 2007 | | // Author: Matevz Tadel 2007 | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| | | | |
| skipping to change at line 82 | | skipping to change at line 82 | |
| | | | |
| virtual TEveElement* ForwardSelection(); | | virtual TEveElement* ForwardSelection(); | |
| virtual TEveElement* ForwardEdit(); | | virtual TEveElement* ForwardEdit(); | |
| | | | |
| virtual void Paint(Option_t* option=""); | | virtual void Paint(Option_t* option=""); | |
| | | | |
| virtual TClass* ProjectedClass(const TEveProjection* p) const; | | virtual TClass* ProjectedClass(const TEveProjection* p) const; | |
| virtual Float_t GetValToHeight() const; | | virtual Float_t GetValToHeight() const; | |
| virtual void CellSelectionChanged() {} | | virtual void CellSelectionChanged() {} | |
| | | | |
|
| | | virtual void SetScaleAbs(Bool_t x) { fScaleAbs = x; } | |
| | | | |
| TEveCaloData* GetData() const { return fData; } | | TEveCaloData* GetData() const { return fData; } | |
| void SetData(TEveCaloData* d); | | void SetData(TEveCaloData* d); | |
| void DataChanged(); | | void DataChanged(); | |
| Float_t GetMaxVal() const; | | Float_t GetMaxVal() const; | |
| | | | |
| Bool_t AssertCellIdCache() const; | | Bool_t AssertCellIdCache() const; | |
| void InvalidateCellIdCache() { fCellIdCacheOK=kFALSE; ResetBBox(); }; | | void InvalidateCellIdCache() { fCellIdCacheOK=kFALSE; ResetBBox(); }; | |
| | | | |
| Float_t GetDataSliceThreshold(Int_t slice) const; | | Float_t GetDataSliceThreshold(Int_t slice) const; | |
| void SetDataSliceThreshold(Int_t slice, Float_t val); | | void SetDataSliceThreshold(Int_t slice, Float_t val); | |
| | | | |
| skipping to change at line 105 | | skipping to change at line 107 | |
| Float_t GetBarrelRadius() const { return fBarrelRadius; } | | Float_t GetBarrelRadius() const { return fBarrelRadius; } | |
| void SetBarrelRadius(Float_t r) { fBarrelRadius = r; ResetBBox(); } | | void SetBarrelRadius(Float_t r) { fBarrelRadius = r; ResetBBox(); } | |
| Float_t GetEndCapPos () const { return fEndCapPos; } | | Float_t GetEndCapPos () const { return fEndCapPos; } | |
| void SetEndCapPos (Float_t z) { fEndCapPos = z; ResetBBox(); } | | void SetEndCapPos (Float_t z) { fEndCapPos = z; ResetBBox(); } | |
| | | | |
| Bool_t GetPlotEt() const { return fPlotEt; } | | Bool_t GetPlotEt() const { return fPlotEt; } | |
| void SetPlotEt(Bool_t x); | | void SetPlotEt(Bool_t x); | |
| | | | |
| void SetMaxTowerH(Float_t x) { fMaxTowerH = x; } | | void SetMaxTowerH(Float_t x) { fMaxTowerH = x; } | |
| Float_t GetMaxTowerH() const { return fMaxTowerH; } | | Float_t GetMaxTowerH() const { return fMaxTowerH; } | |
|
| void SetScaleAbs(Bool_t x) { fScaleAbs = x; } | | | |
| Bool_t GetScaleAbs() const { return fScaleAbs; } | | Bool_t GetScaleAbs() const { return fScaleAbs; } | |
| void SetMaxValAbs(Float_t x) { fMaxValAbs = x; } | | void SetMaxValAbs(Float_t x) { fMaxValAbs = x; } | |
| Float_t GetMaxValAbs() const { return fMaxValAbs; } | | Float_t GetMaxValAbs() const { return fMaxValAbs; } | |
| | | | |
| Float_t GetTransitionEta() const; | | Float_t GetTransitionEta() const; | |
| Float_t GetTransitionTheta() const; | | Float_t GetTransitionTheta() const; | |
| | | | |
| TEveRGBAPalette* GetPalette() const { return fPalette; } | | TEveRGBAPalette* GetPalette() const { return fPalette; } | |
| void SetPalette(TEveRGBAPalette* p); | | void SetPalette(TEveRGBAPalette* p); | |
| | | | |
| | | | |
| skipping to change at line 159 | | skipping to change at line 160 | |
| TEveCalo3D(const TEveCalo3D&); // Not implemented | | TEveCalo3D(const TEveCalo3D&); // Not implemented | |
| TEveCalo3D& operator=(const TEveCalo3D&); // Not implemented | | TEveCalo3D& operator=(const TEveCalo3D&); // Not implemented | |
| | | | |
| protected: | | protected: | |
| TEveCaloData::vCellId_t fCellList; | | TEveCaloData::vCellId_t fCellList; | |
| | | | |
| Bool_t fRnrEndCapFrame; | | Bool_t fRnrEndCapFrame; | |
| Bool_t fRnrBarrelFrame; | | Bool_t fRnrBarrelFrame; | |
| | | | |
| Color_t fFrameColor; | | Color_t fFrameColor; | |
|
| UChar_t fFrameTransparency; | | Char_t fFrameTransparency; | |
| | | | |
| virtual void BuildCellIdCache(); | | virtual void BuildCellIdCache(); | |
| | | | |
| public: | | public: | |
| TEveCalo3D(TEveCaloData* d=0, const char* n="TEveCalo3D", const char* t=
"xx"); | | TEveCalo3D(TEveCaloData* d=0, const char* n="TEveCalo3D", const char* t=
"xx"); | |
| virtual ~TEveCalo3D() {} | | virtual ~TEveCalo3D() {} | |
| virtual void ComputeBBox(); | | virtual void ComputeBBox(); | |
| | | | |
|
| virtual Bool_t CanEditMainColor() const { return kTRUE; } | | | |
| virtual Bool_t CanEditMainTransparency() const { return kTRUE; } | | | |
| | | | |
| void SetRnrFrame(Bool_t e, Bool_t b) { fRnrEndCapFrame = e; fRnr
BarrelFrame = b; } | | void SetRnrFrame(Bool_t e, Bool_t b) { fRnrEndCapFrame = e; fRnr
BarrelFrame = b; } | |
| void GetRnrFrame(Bool_t &e, Bool_t &b) const { e = fRnrEndCapFrame; b =
fRnrBarrelFrame; } | | void GetRnrFrame(Bool_t &e, Bool_t &b) const { e = fRnrEndCapFrame; b =
fRnrBarrelFrame; } | |
| | | | |
|
| void SetFrameTransparency(UChar_t x) { fFrameTransparency = x; } | | void SetFrameTransparency(Char_t x) { fFrameTransparency = x; } | |
| UChar_t GetFrameTransparency() const { return fFrameTransparency; } | | Char_t GetFrameTransparency() const { return fFrameTransparency; } | |
| | | | |
| ClassDef(TEveCalo3D, 0); // Class for 3D visualization of calorimeter ev
ent data. | | ClassDef(TEveCalo3D, 0); // Class for 3D visualization of calorimeter ev
ent data. | |
| }; | | }; | |
| | | | |
| /**************************************************************************
/ | | /**************************************************************************
/ | |
| /**************************************************************************
/ | | /**************************************************************************
/ | |
| | | | |
| class TEveCalo2D : public TEveCaloViz, | | class TEveCalo2D : public TEveCaloViz, | |
| public TEveProjected | | public TEveProjected | |
| { | | { | |
| | | | |
| skipping to change at line 221 | | skipping to change at line 219 | |
| public: | | public: | |
| TEveCalo2D(const char* n="TEveCalo2D", const char* t=""); | | TEveCalo2D(const char* n="TEveCalo2D", const char* t=""); | |
| virtual ~TEveCalo2D(); | | virtual ~TEveCalo2D(); | |
| | | | |
| virtual void SetProjection(TEveProjectionManager* proj, TEveProjectable*
model); | | virtual void SetProjection(TEveProjectionManager* proj, TEveProjectable*
model); | |
| virtual void UpdateProjection(); | | virtual void UpdateProjection(); | |
| virtual void ComputeBBox(); | | virtual void ComputeBBox(); | |
| | | | |
| virtual void CellSelectionChanged(); | | virtual void CellSelectionChanged(); | |
| | | | |
|
| | | virtual void SetScaleAbs(Bool_t); | |
| | | | |
| virtual Float_t GetValToHeight() const; | | virtual Float_t GetValToHeight() const; | |
| | | | |
| ClassDef(TEveCalo2D, 0); // Class for visualization of projected calorim
eter event data. | | ClassDef(TEveCalo2D, 0); // Class for visualization of projected calorim
eter event data. | |
| }; | | }; | |
| /**************************************************************************
/ | | /**************************************************************************
/ | |
| /**************************************************************************
/ | | /**************************************************************************
/ | |
| | | | |
| class TEveCaloLego : public TEveCaloViz | | class TEveCaloLego : public TEveCaloViz | |
| { | | { | |
| friend class TEveCaloLegoGL; | | friend class TEveCaloLegoGL; | |
| | | | |
| skipping to change at line 248 | | skipping to change at line 248 | |
| private: | | private: | |
| TEveCaloLego(const TEveCaloLego&); // Not implemented | | TEveCaloLego(const TEveCaloLego&); // Not implemented | |
| TEveCaloLego& operator=(const TEveCaloLego&); // Not implemented | | TEveCaloLego& operator=(const TEveCaloLego&); // Not implemented | |
| | | | |
| protected: | | protected: | |
| TEveCaloData::vCellId_t fCellList; | | TEveCaloData::vCellId_t fCellList; | |
| | | | |
| Color_t fFontColor; | | Color_t fFontColor; | |
| Color_t fGridColor; | | Color_t fGridColor; | |
| Color_t fPlaneColor; | | Color_t fPlaneColor; | |
|
| UChar_t fPlaneTransparency; | | Char_t fPlaneTransparency; | |
| | | | |
| Int_t fNZSteps; // Z axis label step in GeV | | Int_t fNZSteps; // Z axis label step in GeV | |
| Float_t fZAxisStep; | | Float_t fZAxisStep; | |
| | | | |
| Bool_t fAutoRebin; | | Bool_t fAutoRebin; | |
| Int_t fPixelsPerBin; | | Int_t fPixelsPerBin; | |
| Bool_t fNormalizeRebin; | | Bool_t fNormalizeRebin; | |
| | | | |
| EProjection_e fProjection; | | EProjection_e fProjection; | |
| E2DMode_e f2DMode; | | E2DMode_e f2DMode; | |
| EBoxMode_e fBoxMode; // additional scale info | | EBoxMode_e fBoxMode; // additional scale info | |
| | | | |
| Bool_t fDrawHPlane; | | Bool_t fDrawHPlane; | |
| Float_t fHPlaneVal; | | Float_t fHPlaneVal; | |
| | | | |
|
| | | Bool_t fHasFixedHeightIn2DMode; | |
| | | Float_t fFixedHeightValIn2DMode; // 1% of whole height | |
| | | | |
| Int_t fDrawNumberCellPixels; | | Int_t fDrawNumberCellPixels; | |
| Int_t fCellPixelFontSize; | | Int_t fCellPixelFontSize; | |
| | | | |
| virtual void BuildCellIdCache(); | | virtual void BuildCellIdCache(); | |
| | | | |
| public: | | public: | |
| TEveCaloLego(TEveCaloData* data=0, const char* n="TEveCaloLego", const c
har* t=""); | | TEveCaloLego(TEveCaloData* data=0, const char* n="TEveCaloLego", const c
har* t=""); | |
| virtual ~TEveCaloLego(){} | | virtual ~TEveCaloLego(){} | |
| | | | |
| virtual void ComputeBBox(); | | virtual void ComputeBBox(); | |
| | | | |
| skipping to change at line 285 | | skipping to change at line 288 | |
| | | | |
| Color_t GetFontColor() const { return fFontColor; } | | Color_t GetFontColor() const { return fFontColor; } | |
| void SetFontColor(Color_t ci) { fFontColor=ci; } | | void SetFontColor(Color_t ci) { fFontColor=ci; } | |
| | | | |
| Color_t GetGridColor() const { return fGridColor; } | | Color_t GetGridColor() const { return fGridColor; } | |
| void SetGridColor(Color_t ci) { fGridColor=ci; } | | void SetGridColor(Color_t ci) { fGridColor=ci; } | |
| | | | |
| Color_t GetPlaneColor() const { return fPlaneColor; } | | Color_t GetPlaneColor() const { return fPlaneColor; } | |
| void SetPlaneColor(Color_t ci) { fPlaneColor=ci; } | | void SetPlaneColor(Color_t ci) { fPlaneColor=ci; } | |
| | | | |
|
| UChar_t GetPlaneTransparency() const { return fPlaneTransparency; } | | Char_t GetPlaneTransparency() const { return fPlaneTransparency; } | |
| void SetPlaneTransparency(UChar_t t) { fPlaneTransparency=t; } | | void SetPlaneTransparency(Char_t t) { fPlaneTransparency=t; } | |
| | | | |
| Int_t GetNZSteps() const { return fNZSteps; } | | Int_t GetNZSteps() const { return fNZSteps; } | |
| void SetNZSteps(Int_t s) { fNZSteps = s;} | | void SetNZSteps(Int_t s) { fNZSteps = s;} | |
| | | | |
| Int_t GetPixelsPerBin() const { return fPixelsPerBin; } | | Int_t GetPixelsPerBin() const { return fPixelsPerBin; } | |
| void SetPixelsPerBin(Int_t bw) { fPixelsPerBin = bw; } | | void SetPixelsPerBin(Int_t bw) { fPixelsPerBin = bw; } | |
| | | | |
| Bool_t GetAutoRebin() const { return fAutoRebin; } | | Bool_t GetAutoRebin() const { return fAutoRebin; } | |
| void SetAutoRebin(Bool_t s) { fAutoRebin = s;} | | void SetAutoRebin(Bool_t s) { fAutoRebin = s;} | |
| | | | |
| Bool_t GetNormalizeRebin() const { return fNormalizeRebin; } | | Bool_t GetNormalizeRebin() const { return fNormalizeRebin; } | |
| void SetNormalizeRebin(Bool_t s) { fNormalizeRebin = s; fCellIdCache
OK=kFALSE;} | | void SetNormalizeRebin(Bool_t s) { fNormalizeRebin = s; fCellIdCache
OK=kFALSE;} | |
| | | | |
|
| | | EProjection_e GetProjection() const { return fProjection; } | |
| void SetProjection(EProjection_e p) { fProjection = p; } | | void SetProjection(EProjection_e p) { fProjection = p; } | |
|
| EProjection_e GetProjection() { return fProjection; } | | | |
| | | | |
| void Set2DMode(E2DMode_e p) { f2DMode = p; } | | void Set2DMode(E2DMode_e p) { f2DMode = p; } | |
| E2DMode_e Get2DMode() { return f2DMode; } | | E2DMode_e Get2DMode() { return f2DMode; } | |
| | | | |
|
| | | bool GetHasFixedHeightIn2DMode() const { return fHasFixedHeightIn2 | |
| | | DMode; } | |
| | | void SetHasFixedHeightIn2DMode(bool x) { fHasFixedHeightIn2DMode = | |
| | | x; } | |
| | | | |
| | | float GetFixedHeightValIn2DMode() const { return fFixedHeightValIn | |
| | | 2DMode; } | |
| | | void SetFixedHeightValIn2DMode(float x) { fFixedHeightValIn2DMode | |
| | | = x; } | |
| | | | |
| void SetBoxMode(EBoxMode_e p) { fBoxMode = p; } | | void SetBoxMode(EBoxMode_e p) { fBoxMode = p; } | |
| EBoxMode_e GetBoxMode() { return fBoxMode; } | | EBoxMode_e GetBoxMode() { return fBoxMode; } | |
| | | | |
| Bool_t GetDrawHPlane() const { return fDrawHPlane; } | | Bool_t GetDrawHPlane() const { return fDrawHPlane; } | |
| void SetDrawHPlane(Bool_t s) { fDrawHPlane = s;} | | void SetDrawHPlane(Bool_t s) { fDrawHPlane = s;} | |
| | | | |
| Float_t GetHPlaneVal() const { return fHPlaneVal; } | | Float_t GetHPlaneVal() const { return fHPlaneVal; } | |
| void SetHPlaneVal(Float_t s) { fHPlaneVal = s;} | | void SetHPlaneVal(Float_t s) { fHPlaneVal = s;} | |
| | | | |
| Int_t GetDrawNumberCellPixels() { return fDrawNumberCellPixels; } | | Int_t GetDrawNumberCellPixels() { return fDrawNumberCellPixels; } | |
| | | | |
End of changes. 13 change blocks. |
| 12 lines changed or deleted | | 25 lines changed or added | |
|
| TEveCaloData.h | | TEveCaloData.h | |
|
| // @(#)root/eve:$Id: TEveCaloData.h 33198 2010-04-26 08:40:04Z matevz $ | | // @(#)root/eve:$Id: TEveCaloData.h 33955 2010-06-17 11:33:13Z matevz $ | |
| // Author: Matevz Tadel 2007 | | // Author: Matevz Tadel 2007 | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| #ifndef ROOT_TEveCaloData | | #ifndef ROOT_TEveCaloData | |
| #define ROOT_TEveCaloData | | #define ROOT_TEveCaloData | |
| | | | |
| #include <vector> | | #include <vector> | |
| #include "TEveElement.h" | | #include "TEveElement.h" | |
| | | | |
|
| | | class TGLSelectRecord; | |
| | | | |
| class TH2F; | | class TH2F; | |
| class TAxis; | | class TAxis; | |
| class THStack; | | class THStack; | |
| | | | |
| class TEveCaloData: public TEveElement, | | class TEveCaloData: public TEveElement, | |
| public TNamed | | public TNamed | |
| { | | { | |
| public: | | public: | |
| struct SliceInfo_t | | struct SliceInfo_t | |
| { | | { | |
| TString fName; // Name of the slice, eg. ECAL, HCAL. | | TString fName; // Name of the slice, eg. ECAL, HCAL. | |
| Float_t fThreshold; // Only display towers with higher energy. | | Float_t fThreshold; // Only display towers with higher energy. | |
| Color_t fColor; // Color used to draw this longitudinal slice. | | Color_t fColor; // Color used to draw this longitudinal slice. | |
|
| | | Color_t fTransparency; // Transparency used to draw this longitudina
l slice. | |
| | | | |
|
| SliceInfo_t(): fName(""), fThreshold(0), fColor(kRed) {} | | SliceInfo_t(): fName(""), fThreshold(0), fColor(kRed), fTransparency(
0) {} | |
| | | | |
| virtual ~SliceInfo_t() {} | | virtual ~SliceInfo_t() {} | |
| | | | |
|
| void Setup(const char* name, Float_t threshold, Color_t col) | | void Setup(const char* name, Float_t threshold, Color_t col, Char_t t
ransp = 101) | |
| { | | { | |
| fName = name; | | fName = name; | |
| fThreshold = threshold; | | fThreshold = threshold; | |
| fColor = col; | | fColor = col; | |
|
| | | if (transp <= 100) fTransparency = transp; | |
| }; | | }; | |
| | | | |
| ClassDef(SliceInfo_t, 0); // Slice info for histogram stack. | | ClassDef(SliceInfo_t, 0); // Slice info for histogram stack. | |
| }; | | }; | |
| | | | |
| typedef std::vector<SliceInfo_t> vSliceInfo_t; | | typedef std::vector<SliceInfo_t> vSliceInfo_t; | |
| typedef std::vector<SliceInfo_t>::iterator vSliceInfo_i; | | typedef std::vector<SliceInfo_t>::iterator vSliceInfo_i; | |
| | | | |
| /***********************************************************************
***/ | | /***********************************************************************
***/ | |
| | | | |
| struct CellId_t | | struct CellId_t | |
| { | | { | |
| // Cell ID inner structure. | | // Cell ID inner structure. | |
| | | | |
| Int_t fTower; | | Int_t fTower; | |
| Int_t fSlice; | | Int_t fSlice; | |
| | | | |
| Float_t fFraction; | | Float_t fFraction; | |
| | | | |
|
| CellId_t(Int_t t, Int_t s, Float_t fr=1.f):fTower(t), fSlice(s), fFra | | CellId_t(Int_t t, Int_t s, Float_t f=1.0f) : fTower(t), fSlice(s), fF | |
| ction(fr){} | | raction(f) {} | |
| | | | |
| | | bool operator<(const CellId_t& o) const | |
| | | { return (fTower == o.fTower) ? fSlice < o.fSlice : fTower < o.fTower | |
| | | ; } | |
| }; | | }; | |
| | | | |
| struct CellGeom_t | | struct CellGeom_t | |
| { | | { | |
| // Cell geometry inner structure. | | // Cell geometry inner structure. | |
| | | | |
| Float_t fPhiMin; | | Float_t fPhiMin; | |
| Float_t fPhiMax; | | Float_t fPhiMax; | |
| Float_t fEtaMin; | | Float_t fEtaMin; | |
| Float_t fEtaMax; | | Float_t fEtaMax; | |
| | | | |
| skipping to change at line 175 | | skipping to change at line 182 | |
| | | | |
| virtual void FillImpliedSelectedSet(Set_t& impSelSet); | | virtual void FillImpliedSelectedSet(Set_t& impSelSet); | |
| | | | |
| virtual void GetCellList(Float_t etaMin, Float_t etaMax, | | virtual void GetCellList(Float_t etaMin, Float_t etaMax, | |
| Float_t phi, Float_t phiRng, | | Float_t phi, Float_t phiRng, | |
| vCellId_t &out) const = 0; | | vCellId_t &out) const = 0; | |
| | | | |
| vCellId_t& GetCellsSelected() { return fCellsSelected; } | | vCellId_t& GetCellsSelected() { return fCellsSelected; } | |
| vCellId_t& GetCellsHighlighted() { return fCellsHighlighted; } | | vCellId_t& GetCellsHighlighted() { return fCellsHighlighted; } | |
| void PrintCellsSelected(); | | void PrintCellsSelected(); | |
|
| | | void ProcessSelection(vCellId_t& sel_cells, TGLSelectRecord& rec); | |
| | | | |
| virtual void Rebin(TAxis *ax, TAxis *ay, vCellId_t &in, Bool_t et, Re
binData_t &out) const = 0; | | virtual void Rebin(TAxis *ax, TAxis *ay, vCellId_t &in, Bool_t et, Re
binData_t &out) const = 0; | |
| | | | |
| virtual void GetCellData(const CellId_t &id, CellData_t& data) const
= 0; | | virtual void GetCellData(const CellId_t &id, CellData_t& data) const
= 0; | |
| | | | |
| virtual void InvalidateUsersCellIdCache(); | | virtual void InvalidateUsersCellIdCache(); | |
| virtual void DataChanged(); | | virtual void DataChanged(); | |
| virtual void CellSelectionChanged(); | | virtual void CellSelectionChanged(); | |
| | | | |
| Int_t GetNSlices() const { return fSliceInfos.size(); } | | Int_t GetNSlices() const { return fSliceInfos.size(); } | |
| SliceInfo_t& RefSliceInfo(Int_t s) { return fSliceInfos[s]; } | | SliceInfo_t& RefSliceInfo(Int_t s) { return fSliceInfos[s]; } | |
| void SetSliceThreshold(Int_t slice, Float_t threshold); | | void SetSliceThreshold(Int_t slice, Float_t threshold); | |
| Float_t GetSliceThreshold(Int_t slice) const; | | Float_t GetSliceThreshold(Int_t slice) const; | |
| void SetSliceColor(Int_t slice, Color_t col); | | void SetSliceColor(Int_t slice, Color_t col); | |
| Color_t GetSliceColor(Int_t slice) const; | | Color_t GetSliceColor(Int_t slice) const; | |
|
| | | void SetSliceTransparency(Int_t slice, Char_t t); | |
| | | Char_t GetSliceTransparency(Int_t slice) const; | |
| | | | |
| virtual void GetEtaLimits(Double_t &min, Double_t &max) const = 0; | | virtual void GetEtaLimits(Double_t &min, Double_t &max) const = 0; | |
| | | | |
| virtual void GetPhiLimits(Double_t &min, Double_t &max) const = 0; | | virtual void GetPhiLimits(Double_t &min, Double_t &max) const = 0; | |
| | | | |
| virtual Float_t GetMaxVal(Bool_t et) const { return et ? fMaxValEt : fMa
xValE; } | | virtual Float_t GetMaxVal(Bool_t et) const { return et ? fMaxValEt : fMa
xValE; } | |
| Bool_t Empty() const { return fMaxValEt < 1e-5; } | | Bool_t Empty() const { return fMaxValEt < 1e-5; } | |
| | | | |
| virtual TAxis* GetEtaBins() const { return fEtaAxis; } | | virtual TAxis* GetEtaBins() const { return fEtaAxis; } | |
| virtual void SetEtaBins(TAxis* ax) { fEtaAxis=ax; } | | virtual void SetEtaBins(TAxis* ax) { fEtaAxis=ax; } | |
| | | | |
| skipping to change at line 233 | | skipping to change at line 243 | |
| TEveCaloDataVec& operator=(const TEveCaloDataVec&); // Not implemented | | TEveCaloDataVec& operator=(const TEveCaloDataVec&); // Not implemented | |
| | | | |
| protected: | | protected: | |
| typedef std::vector<Float_t> vFloat_t; | | typedef std::vector<Float_t> vFloat_t; | |
| typedef std::vector<Float_t>::iterator vFloat_i; | | typedef std::vector<Float_t>::iterator vFloat_i; | |
| | | | |
| typedef std::vector<vFloat_t> vvFloat_t; | | typedef std::vector<vFloat_t> vvFloat_t; | |
| typedef std::vector<vFloat_t>::iterator vvFloat_i; | | typedef std::vector<vFloat_t>::iterator vvFloat_i; | |
| | | | |
| vvFloat_t fSliceVec; | | vvFloat_t fSliceVec; | |
|
| vFloat_t fValVec; | | | |
| vCellGeom_t fGeomVec; | | vCellGeom_t fGeomVec; | |
| | | | |
| Int_t fTower; // current tower | | Int_t fTower; // current tower | |
| | | | |
| Float_t fEtaMin; | | Float_t fEtaMin; | |
| Float_t fEtaMax; | | Float_t fEtaMax; | |
| | | | |
| Float_t fPhiMin; | | Float_t fPhiMin; | |
| Float_t fPhiMax; | | Float_t fPhiMax; | |
| | | | |
| public: | | public: | |
| TEveCaloDataVec(Int_t nslices); | | TEveCaloDataVec(Int_t nslices); | |
| virtual ~TEveCaloDataVec(); | | virtual ~TEveCaloDataVec(); | |
| | | | |
|
| | | Int_t AddSlice(); | |
| Int_t AddTower(Float_t etaMin, Float_t etaMax, Float_t phiMin, Float_t p
hiMax); | | Int_t AddTower(Float_t etaMin, Float_t etaMax, Float_t phiMin, Float_t p
hiMax); | |
| void FillSlice(Int_t slice, Float_t value); | | void FillSlice(Int_t slice, Float_t value); | |
| void FillSlice(Int_t slice, Int_t tower, Float_t value); | | void FillSlice(Int_t slice, Int_t tower, Float_t value); | |
| | | | |
| Int_t GetNCells() { return fGeomVec.size(); } | | Int_t GetNCells() { return fGeomVec.size(); } | |
|
| | | std::vector<Float_t>& GetSliceVals(Int_t slice) { return fSliceVec[slic | |
| | | e]; } | |
| | | std::vector<TEveCaloData::CellGeom_t>& GetCellGeom() { return fGeomVec; | |
| | | } | |
| | | | |
| virtual void GetCellList(Float_t etaMin, Float_t etaMax, | | virtual void GetCellList(Float_t etaMin, Float_t etaMax, | |
| Float_t phi, Float_t phiRng, | | Float_t phi, Float_t phiRng, | |
| vCellId_t &out) const; | | vCellId_t &out) const; | |
| | | | |
| virtual void Rebin(TAxis *ax, TAxis *ay, vCellId_t &in, Bool_t et, Rebin
Data_t &out) const; | | virtual void Rebin(TAxis *ax, TAxis *ay, vCellId_t &in, Bool_t et, Rebin
Data_t &out) const; | |
| | | | |
| virtual void GetCellData(const TEveCaloData::CellId_t &id, TEveCaloData:
:CellData_t& data) const; | | virtual void GetCellData(const TEveCaloData::CellId_t &id, TEveCaloData:
:CellData_t& data) const; | |
| virtual void GetEtaLimits(Double_t &min, Double_t &max) const { min=fEta
Min, max=fEtaMax;} | | virtual void GetEtaLimits(Double_t &min, Double_t &max) const { min=fEta
Min, max=fEtaMax;} | |
| virtual void GetPhiLimits(Double_t &min, Double_t &max) const { min=fPhi
Min; max=fPhiMax;} | | virtual void GetPhiLimits(Double_t &min, Double_t &max) const { min=fPhi
Min; max=fPhiMax;} | |
| | | | |
End of changes. 12 change blocks. |
| 6 lines changed or deleted | | 21 lines changed or added | |
|
| TEveDigitSet.h | | TEveDigitSet.h | |
|
| // @(#)root/eve:$Id: TEveDigitSet.h 33124 2010-04-21 20:04:42Z matevz $ | | // @(#)root/eve:$Id: TEveDigitSet.h 33864 2010-06-14 09:47:19Z matevz $ | |
| // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007 | | // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007 | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| | | | |
| skipping to change at line 63 | | skipping to change at line 63 | |
| void *fUserData; // user-data for given digit | | void *fUserData; // user-data for given digit | |
| | | | |
| DigitBase_t(Int_t v=0) : fValue(v), fUserData(0) {} | | DigitBase_t(Int_t v=0) : fValue(v), fUserData(0) {} | |
| }; | | }; | |
| | | | |
| TRefArray *fDigitIds; // Array holding references to exter
nal objects. | | TRefArray *fDigitIds; // Array holding references to exter
nal objects. | |
| | | | |
| Int_t fDefaultValue; // Default signal value. | | Int_t fDefaultValue; // Default signal value. | |
| Bool_t fValueIsColor; // Interpret signal value as RGBA co
lor. | | Bool_t fValueIsColor; // Interpret signal value as RGBA co
lor. | |
| Bool_t fSingleColor; // Use the same color for all digits
. | | Bool_t fSingleColor; // Use the same color for all digits
. | |
|
| | | Bool_t fAntiFlick; // Make extra render pass to avoid fl
ickering when quads are too small. | |
| Bool_t fOwnIds; // Flag specifying if id-objects are
owned by the TEveDigitSet. | | Bool_t fOwnIds; // Flag specifying if id-objects are
owned by the TEveDigitSet. | |
| TEveChunkManager fPlex; // Container of digit data. | | TEveChunkManager fPlex; // Container of digit data. | |
| DigitBase_t* fLastDigit; //! The last / current digit added to
collection. | | DigitBase_t* fLastDigit; //! The last / current digit added to
collection. | |
| Int_t fLastIdx; //! The last / current idx added to c
ollection. | | Int_t fLastIdx; //! The last / current idx added to c
ollection. | |
| | | | |
| Color_t fColor; // Color used for frame (or all digi
s with single-color). | | Color_t fColor; // Color used for frame (or all digi
s with single-color). | |
| TEveFrameBox* fFrame; // Pointer to frame structure. | | TEveFrameBox* fFrame; // Pointer to frame structure. | |
| TEveRGBAPalette* fPalette; // Pointer to signal-color palette. | | TEveRGBAPalette* fPalette; // Pointer to signal-color palette. | |
| ERenderMode_e fRenderMode; // Render mode: as-is / line / fille
d. | | ERenderMode_e fRenderMode; // Render mode: as-is / line / fille
d. | |
| Bool_t fDisableLigting; // Disable lighting for rendering. | | Bool_t fDisableLigting; // Disable lighting for rendering. | |
| | | | |
| skipping to change at line 86 | | skipping to change at line 87 | |
| Callback_foo fCallbackFoo; //! Additional function to call on se
condary-select. | | Callback_foo fCallbackFoo; //! Additional function to call on se
condary-select. | |
| TooltipCB_foo fTooltipCBFoo; //! Function providing highlight tool
tips when always-sec-select is active. | | TooltipCB_foo fTooltipCBFoo; //! Function providing highlight tool
tips when always-sec-select is active. | |
| | | | |
| DigitBase_t* NewDigit(); | | DigitBase_t* NewDigit(); | |
| void ReleaseIds(); | | void ReleaseIds(); | |
| | | | |
| public: | | public: | |
| TEveDigitSet(const char* n="TEveDigitSet", const char* t=""); | | TEveDigitSet(const char* n="TEveDigitSet", const char* t=""); | |
| virtual ~TEveDigitSet(); | | virtual ~TEveDigitSet(); | |
| | | | |
|
| void UseSingleColor(); | | void UseSingleColor(); | |
| | | | |
|
| virtual Bool_t CanEditMainColor() const { return kTRUE; } | | Bool_t GetAntiFlick() const { return fAntiFlick; } | |
| virtual void SetMainColor(Color_t color); | | void SetAntiFlick(Bool_t f) { fAntiFlick = f; } | |
| | | | |
|
| virtual Bool_t CanEditMainTransparency() const { return kTRUE; } | | virtual void SetMainColor(Color_t color); | |
| | | | |
| virtual void UnSelected(); | | virtual void UnSelected(); | |
| virtual void UnHighlighted(); | | virtual void UnHighlighted(); | |
| | | | |
| virtual TString GetHighlightTooltip(); | | virtual TString GetHighlightTooltip(); | |
| | | | |
| // Implemented in sub-classes: | | // Implemented in sub-classes: | |
| // virtual void Reset(EQuadType_e quadType, Bool_t valIsCol, Int_t chunk
Size); | | // virtual void Reset(EQuadType_e quadType, Bool_t valIsCol, Int_t chunk
Size); | |
| | | | |
| void RefitPlex(); | | void RefitPlex(); | |
| void ScanMinMaxValues(Int_t& min, Int_t& max); | | void ScanMinMaxValues(Int_t& min, Int_t& max); | |
| | | | |
| // -------------------------------- | | // -------------------------------- | |
| | | | |
| void SetCurrentDigit(Int_t idx); | | void SetCurrentDigit(Int_t idx); | |
| | | | |
| void DigitValue(Int_t value); | | void DigitValue(Int_t value); | |
| void DigitColor(Color_t ci); | | void DigitColor(Color_t ci); | |
|
| void DigitColor(Color_t ci, UChar_t transparency); | | void DigitColor(Color_t ci, Char_t transparency); | |
| void DigitColor(UChar_t r, UChar_t g, UChar_t b, UChar_t a=255); | | void DigitColor(UChar_t r, UChar_t g, UChar_t b, UChar_t a=255); | |
| void DigitColor(UChar_t* rgba); | | void DigitColor(UChar_t* rgba); | |
| | | | |
| Bool_t GetOwnIds() const { return fOwnIds; } | | Bool_t GetOwnIds() const { return fOwnIds; } | |
| void SetOwnIds(Bool_t o) { fOwnIds = o; } | | void SetOwnIds(Bool_t o) { fOwnIds = o; } | |
| | | | |
| void DigitId(TObject* id); | | void DigitId(TObject* id); | |
| void DigitUserData(void* ud); | | void DigitUserData(void* ud); | |
| | | | |
| void DigitId(Int_t n, TObject* id); | | void DigitId(Int_t n, TObject* id); | |
| | | | |
End of changes. 6 change blocks. |
| 6 lines changed or deleted | | 7 lines changed or added | |
|
| TEveElement.h | | TEveElement.h | |
|
| // @(#)root/eve:$Id: TEveElement.h 33135 2010-04-22 10:36:40Z matevz $ | | // @(#)root/eve:$Id: TEveElement.h 33864 2010-06-14 09:47:19Z matevz $ | |
| // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007 | | // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007 | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| | | | |
| skipping to change at line 89 | | skipping to change at line 89 | |
| List_t fChildren; // List of children. | | List_t fChildren; // List of children. | |
| TEveCompound *fCompound; // Compound this object belongs
to. | | TEveCompound *fCompound; // Compound this object belongs
to. | |
| TEveElement *fVizModel; //! Element used as model from V
izDB. | | TEveElement *fVizModel; //! Element used as model from V
izDB. | |
| TString fVizTag; // Tag used to query VizDB for
model element. | | TString fVizTag; // Tag used to query VizDB for
model element. | |
| | | | |
| Int_t fParentIgnoreCnt; //! Counter for parents that are
ignored in ref-counting. | | Int_t fParentIgnoreCnt; //! Counter for parents that are
ignored in ref-counting. | |
| Int_t fTopItemCnt; //! Counter for top-level list-t
ree items that prevent automatic destruction. | | Int_t fTopItemCnt; //! Counter for top-level list-t
ree items that prevent automatic destruction. | |
| Int_t fDenyDestroy; //! Deny-destroy count. | | Int_t fDenyDestroy; //! Deny-destroy count. | |
| Bool_t fDestroyOnZeroRefCnt; // Auto-destruct when ref-count
reaches zero. | | Bool_t fDestroyOnZeroRefCnt; // Auto-destruct when ref-count
reaches zero. | |
| | | | |
|
| Bool_t fRnrSelf; // Render this element. | | Bool_t fRnrSelf; // Render this element. | |
| Bool_t fRnrChildren; // Render children of this elem | | Bool_t fRnrChildren; // Render children of this e | |
| ent. | | lement. | |
| Bool_t fCanEditMainTrans; // Allow editing of main transf | | Bool_t fCanEditMainColor; // Allow editing of main col | |
| ormation. | | or. | |
| | | Bool_t fCanEditMainTransparency; // Allow editing of main tra | |
| | | nsparency. | |
| | | Bool_t fCanEditMainTrans; // Allow editing of main tra | |
| | | nsformation. | |
| | | | |
|
| UChar_t fMainTransparency; // Main-transparency variable. | | Char_t fMainTransparency; // Main-transparency variable. | |
| Color_t *fMainColorPtr; // Pointer to main-color variab
le. | | Color_t *fMainColorPtr; // Pointer to main-color variab
le. | |
| TEveTrans *fMainTrans; // Pointer to main transformati
on matrix. | | TEveTrans *fMainTrans; // Pointer to main transformati
on matrix. | |
| | | | |
| sLTI_t fItems; //! Set of list-tree-items. | | sLTI_t fItems; //! Set of list-tree-items. | |
| | | | |
| TRef fSource; // External object that is repr
esented by this element. | | TRef fSource; // External object that is repr
esented by this element. | |
| void *fUserData; //! Externally assigned and cont
rolled user data. | | void *fUserData; //! Externally assigned and cont
rolled user data. | |
| | | | |
| virtual void PreDeleteElement(); | | virtual void PreDeleteElement(); | |
| virtual void RemoveElementsInternal(); | | virtual void RemoveElementsInternal(); | |
| | | | |
| skipping to change at line 256 | | skipping to change at line 258 | |
| virtual Bool_t GetRnrSelf() const { return fRnrSelf; } | | virtual Bool_t GetRnrSelf() const { return fRnrSelf; } | |
| virtual Bool_t GetRnrChildren() const { return fRnrChildren; } | | virtual Bool_t GetRnrChildren() const { return fRnrChildren; } | |
| virtual Bool_t GetRnrState() const { return fRnrSelf && fRnrChildren;
} | | virtual Bool_t GetRnrState() const { return fRnrSelf && fRnrChildren;
} | |
| virtual Bool_t GetRnrAnything() const { return fRnrSelf || (fRnrChildren
&& HasChildren()); } | | virtual Bool_t GetRnrAnything() const { return fRnrSelf || (fRnrChildren
&& HasChildren()); } | |
| virtual Bool_t SetRnrSelf(Bool_t rnr); | | virtual Bool_t SetRnrSelf(Bool_t rnr); | |
| virtual Bool_t SetRnrChildren(Bool_t rnr); | | virtual Bool_t SetRnrChildren(Bool_t rnr); | |
| virtual Bool_t SetRnrSelfChildren(Bool_t rnr_self, Bool_t rnr_children); | | virtual Bool_t SetRnrSelfChildren(Bool_t rnr_self, Bool_t rnr_children); | |
| virtual Bool_t SetRnrState(Bool_t rnr); | | virtual Bool_t SetRnrState(Bool_t rnr); | |
| virtual void PropagateRnrStateToProjecteds(); | | virtual void PropagateRnrStateToProjecteds(); | |
| | | | |
|
| virtual Bool_t CanEditMainColor() const { return kFALSE; } | | virtual Bool_t CanEditMainColor() const { return fCanEditMainColor; } | |
| Color_t* GetMainColorPtr() const { return fMainColorPtr; } | | void SetEditMainColor(Bool_t x) { fCanEditMainColor = x; } | |
| void SetMainColorPtr(Color_t* color) { fMainColorPtr = color; } | | Color_t* GetMainColorPtr() const { return fMainColorPtr; } | |
| | | void SetMainColorPtr(Color_t* color) { fMainColorPtr = color; } | |
| | | | |
| virtual Bool_t HasMainColor() const { return fMainColorPtr != 0; } | | virtual Bool_t HasMainColor() const { return fMainColorPtr != 0; } | |
| virtual Color_t GetMainColor() const { return fMainColorPtr ? *fMainColo
rPtr : 0; } | | virtual Color_t GetMainColor() const { return fMainColorPtr ? *fMainColo
rPtr : 0; } | |
| virtual void SetMainColor(Color_t color); | | virtual void SetMainColor(Color_t color); | |
| void SetMainColorPixel(Pixel_t pixel); | | void SetMainColorPixel(Pixel_t pixel); | |
| void SetMainColorRGB(UChar_t r, UChar_t g, UChar_t b); | | void SetMainColorRGB(UChar_t r, UChar_t g, UChar_t b); | |
| void SetMainColorRGB(Float_t r, Float_t g, Float_t b); | | void SetMainColorRGB(Float_t r, Float_t g, Float_t b); | |
| virtual void PropagateMainColorToProjecteds(Color_t color, Color_t ol
d_color); | | virtual void PropagateMainColorToProjecteds(Color_t color, Color_t ol
d_color); | |
| | | | |
|
| virtual Bool_t CanEditMainTransparency() const { return kFALSE; } | | virtual Bool_t CanEditMainTransparency() const { return fCanEditMainT | |
| virtual UChar_t GetMainTransparency() const { return fMainTransparen | | ransparency; } | |
| cy; } | | void SetEditMainTransparency(Bool_t x) { fCanEditMainTranspar | |
| virtual void SetMainTransparency(UChar_t t); | | ency = x; } | |
| | | virtual Char_t GetMainTransparency() const { return fMainTransparen | |
| | | cy; } | |
| | | virtual void SetMainTransparency(Char_t t); | |
| void SetMainAlpha(Float_t alpha); | | void SetMainAlpha(Float_t alpha); | |
|
| | | virtual void PropagateMainTransparencyToProjecteds(Char_t t, Char_t o
ld_t); | |
| | | | |
| virtual Bool_t CanEditMainTrans() const { return fCanEditMainTrans;
} | | virtual Bool_t CanEditMainTrans() const { return fCanEditMainTrans;
} | |
| virtual Bool_t HasMainTrans() const { return fMainTrans != 0;
} | | virtual Bool_t HasMainTrans() const { return fMainTrans != 0;
} | |
| virtual TEveTrans* PtrMainTrans(Bool_t create=kTRUE); | | virtual TEveTrans* PtrMainTrans(Bool_t create=kTRUE); | |
| virtual TEveTrans& RefMainTrans(); | | virtual TEveTrans& RefMainTrans(); | |
| virtual void InitMainTrans(Bool_t can_edit=kTRUE); | | virtual void InitMainTrans(Bool_t can_edit=kTRUE); | |
| virtual void DestroyMainTrans(); | | virtual void DestroyMainTrans(); | |
| | | | |
| virtual void SetTransMatrix(Double_t* carr); | | virtual void SetTransMatrix(Double_t* carr); | |
| virtual void SetTransMatrix(const TGeoMatrix& mat); | | virtual void SetTransMatrix(const TGeoMatrix& mat); | |
| | | | |
| skipping to change at line 309 | | skipping to change at line 314 | |
| Bool_t fSelected; //! | | Bool_t fSelected; //! | |
| Bool_t fHighlighted; //! | | Bool_t fHighlighted; //! | |
| Short_t fImpliedSelected; //! | | Short_t fImpliedSelected; //! | |
| Short_t fImpliedHighlighted; //! | | Short_t fImpliedHighlighted; //! | |
| | | | |
| enum ECompoundSelectionColorBits | | enum ECompoundSelectionColorBits | |
| { | | { | |
| kCSCBImplySelectAllChildren = BIT(0), // compound will sele
ct all children | | kCSCBImplySelectAllChildren = BIT(0), // compound will sele
ct all children | |
| kCSCBTakeAnyParentAsMaster = BIT(1), // element will take
any compound parent as master | | kCSCBTakeAnyParentAsMaster = BIT(1), // element will take
any compound parent as master | |
| kCSCBApplyMainColorToAllChildren = BIT(2), // compound will appl
y color change to all children | | kCSCBApplyMainColorToAllChildren = BIT(2), // compound will appl
y color change to all children | |
|
| kCSCBApplyMainColorToMatchingChildren = BIT(3) // compound will appl | | kCSCBApplyMainColorToMatchingChildren = BIT(3), // compound will appl | |
| y color change to all children with matching color | | y color change to all children with matching color | |
| | | kCSCBApplyMainTransparencyToAllChildren = BIT(4), // compound wi | |
| | | ll apply transparency change to all children | |
| | | kCSCBApplyMainTransparencyToMatchingChildren = BIT(5) // compound wi | |
| | | ll apply transparency change to all children with matching color | |
| }; | | }; | |
| | | | |
| UChar_t fCSCBits; | | UChar_t fCSCBits; | |
| | | | |
| public: | | public: | |
| typedef void (TEveElement::* Select_foo) (Bool_t); | | typedef void (TEveElement::* Select_foo) (Bool_t); | |
| typedef void (TEveElement::* ImplySelect_foo) (); | | typedef void (TEveElement::* ImplySelect_foo) (); | |
| | | | |
| Bool_t IsPickable() const { return fPickable; } | | Bool_t IsPickable() const { return fPickable; } | |
| void SetPickable(Bool_t p) { fPickable = p; } | | void SetPickable(Bool_t p) { fPickable = p; } | |
| | | | |
| skipping to change at line 338 | | skipping to change at line 345 | |
| | | | |
| virtual void HighlightElement(Bool_t state); | | virtual void HighlightElement(Bool_t state); | |
| virtual void IncImpliedHighlighted(); | | virtual void IncImpliedHighlighted(); | |
| virtual void DecImpliedHighlighted(); | | virtual void DecImpliedHighlighted(); | |
| virtual void UnHighlighted(); | | virtual void UnHighlighted(); | |
| | | | |
| virtual void FillImpliedSelectedSet(Set_t& impSelSet); | | virtual void FillImpliedSelectedSet(Set_t& impSelSet); | |
| | | | |
| virtual UChar_t GetSelectedLevel() const; | | virtual UChar_t GetSelectedLevel() const; | |
| | | | |
|
| void RecheckImpliedSelections(); | | void RecheckImpliedSelections(); | |
| | | | |
| void SetCSCBits(UChar_t f) { fCSCBits |= f; } | | void SetCSCBits(UChar_t f) { fCSCBits |= f; } | |
| void ResetCSCBits(UChar_t f) { fCSCBits &= ~f; } | | void ResetCSCBits(UChar_t f) { fCSCBits &= ~f; } | |
| Bool_t TestCSCBits(UChar_t f) const { return (fCSCBits & f) != 0; } | | Bool_t TestCSCBits(UChar_t f) const { return (fCSCBits & f) != 0; } | |
| | | | |
| void ResetAllCSCBits() { fCSCBits = 0; } | | void ResetAllCSCBits() { fCSCBits = 0; } | |
| void CSCImplySelectAllChildren() { fCSCBits |= kCSCBImplySel
ectAllChildren; } | | void CSCImplySelectAllChildren() { fCSCBits |= kCSCBImplySel
ectAllChildren; } | |
| void CSCTakeAnyParentAsMaster() { fCSCBits |= kCSCBTakeAnyP
arentAsMaster; } | | void CSCTakeAnyParentAsMaster() { fCSCBits |= kCSCBTakeAnyP
arentAsMaster; } | |
| void CSCApplyMainColorToAllChildren() { fCSCBits |= kCSCBApplyMai
nColorToAllChildren; } | | void CSCApplyMainColorToAllChildren() { fCSCBits |= kCSCBApplyMai
nColorToAllChildren; } | |
| void CSCApplyMainColorToMatchingChildren() { fCSCBits |= kCSCBApplyMai
nColorToMatchingChildren; } | | void CSCApplyMainColorToMatchingChildren() { fCSCBits |= kCSCBApplyMai
nColorToMatchingChildren; } | |
|
| | | void CSCApplyMainTransparencyToAllChildren() { fCSCBits |= kCSCBA | |
| | | pplyMainTransparencyToAllChildren; } | |
| | | void CSCApplyMainTransparencyToMatchingChildren() { fCSCBits |= kCSCBA | |
| | | pplyMainTransparencyToMatchingChildren; } | |
| | | | |
| // Change-stamping and change bits | | // Change-stamping and change bits | |
| //--------------------------------- | | //--------------------------------- | |
| | | | |
| enum EChangeBits | | enum EChangeBits | |
| { | | { | |
| kCBColorSelection = BIT(0), // Main color or select/hilite state cha
nged. | | kCBColorSelection = BIT(0), // Main color or select/hilite state cha
nged. | |
| kCBTransBBox = BIT(1), // Transformation matrix or bounding-box
changed. | | kCBTransBBox = BIT(1), // Transformation matrix or bounding-box
changed. | |
| kCBObjProps = BIT(2), // Object changed, requires dropping its
display-lists. | | kCBObjProps = BIT(2), // Object changed, requires dropping its
display-lists. | |
| kCBVisibility = BIT(3) // Rendering of self/children changed. | | kCBVisibility = BIT(3) // Rendering of self/children changed. | |
| | | | |
| skipping to change at line 439 | | skipping to change at line 448 | |
| /**************************************************************************
****/ | | /**************************************************************************
****/ | |
| | | | |
| class TEveElementList : public TEveElement, | | class TEveElementList : public TEveElement, | |
| public TNamed, | | public TNamed, | |
| public TEveProjectable | | public TEveProjectable | |
| { | | { | |
| private: | | private: | |
| TEveElementList& operator=(const TEveElementList&); // Not implemented | | TEveElementList& operator=(const TEveElementList&); // Not implemented | |
| | | | |
| protected: | | protected: | |
|
| Color_t fColor; // Color of the object. | | Color_t fColor; // Color of the object. | |
| Bool_t fDoColor; // Should serve fColor as the main color of the | | TClass *fChildClass; // Class of acceptable children, others are r | |
| object. | | ejected. | |
| TClass *fChildClass; // Class of acceptable children, others are reje | | | |
| cted. | | | |
| | | | |
| public: | | public: | |
| TEveElementList(const char* n="TEveElementList", const char* t="", | | TEveElementList(const char* n="TEveElementList", const char* t="", | |
|
| Bool_t doColor=kFALSE); | | Bool_t doColor=kFALSE, Bool_t doTransparency=kFALSE); | |
| TEveElementList(const TEveElementList& e); | | TEveElementList(const TEveElementList& e); | |
| virtual ~TEveElementList() {} | | virtual ~TEveElementList() {} | |
| | | | |
| virtual TEveElementList* CloneElement() const; | | virtual TEveElementList* CloneElement() const; | |
| | | | |
| virtual const char* GetElementName() const { return GetName(); } | | virtual const char* GetElementName() const { return GetName(); } | |
| virtual const char* GetElementTitle() const { return GetTitle(); } | | virtual const char* GetElementTitle() const { return GetTitle(); } | |
| | | | |
| virtual void SetElementName (const char* name) | | virtual void SetElementName (const char* name) | |
| { TNamed::SetName(name); NameTitleChanged(); } | | { TNamed::SetName(name); NameTitleChanged(); } | |
| | | | |
| virtual void SetElementTitle(const char* title) | | virtual void SetElementTitle(const char* title) | |
| { TNamed::SetTitle(title); NameTitleChanged(); } | | { TNamed::SetTitle(title); NameTitleChanged(); } | |
| | | | |
| virtual void SetElementNameTitle(const char* name, const char* title) | | virtual void SetElementNameTitle(const char* name, const char* title) | |
| { TNamed::SetNameTitle(name, title); NameTitleChanged(); } | | { TNamed::SetNameTitle(name, title); NameTitleChanged(); } | |
| | | | |
|
| virtual Bool_t CanEditMainColor() const { return fDoColor; } | | | |
| | | | |
| TClass* GetChildClass() const { return fChildClass; } | | TClass* GetChildClass() const { return fChildClass; } | |
| void SetChildClass(TClass* c) { fChildClass = c; } | | void SetChildClass(TClass* c) { fChildClass = c; } | |
| | | | |
| virtual Bool_t AcceptElement(TEveElement* el); | | virtual Bool_t AcceptElement(TEveElement* el); | |
| | | | |
| virtual TClass* ProjectedClass(const TEveProjection* p) const; | | virtual TClass* ProjectedClass(const TEveProjection* p) const; | |
| | | | |
| ClassDef(TEveElementList, 0); // List of TEveElement objects with a poss
ibility to limit the class of accepted elements. | | ClassDef(TEveElementList, 0); // List of TEveElement objects with a poss
ibility to limit the class of accepted elements. | |
| }; | | }; | |
| | | | |
| | | | |
End of changes. 12 change blocks. |
| 25 lines changed or deleted | | 38 lines changed or added | |
|
| TEveProjections.h | | TEveProjections.h | |
|
| // @(#)root/eve:$Id: TEveProjections.h 32528 2010-03-10 17:02:54Z matevz $ | | // @(#)root/eve:$Id: TEveProjections.h 33864 2010-06-14 09:47:19Z matevz $ | |
| // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007 | | // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007 | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| | | | |
| skipping to change at line 132 | | skipping to change at line 132 | |
| Float_t GetFixZ() const { return fFixZ; } | | Float_t GetFixZ() const { return fFixZ; } | |
| void SetFixR(Float_t x); | | void SetFixR(Float_t x); | |
| void SetFixZ(Float_t x); | | void SetFixZ(Float_t x); | |
| Float_t GetPastFixRFac() const { return fPastFixRFac; } | | Float_t GetPastFixRFac() const { return fPastFixRFac; } | |
| Float_t GetPastFixZFac() const { return fPastFixZFac; } | | Float_t GetPastFixZFac() const { return fPastFixZFac; } | |
| void SetPastFixRFac(Float_t x); | | void SetPastFixRFac(Float_t x); | |
| void SetPastFixZFac(Float_t x); | | void SetPastFixZFac(Float_t x); | |
| Float_t GetMaxTrackStep() const { return fMaxTrackStep; } | | Float_t GetMaxTrackStep() const { return fMaxTrackStep; } | |
| void SetMaxTrackStep(Float_t x) { fMaxTrackStep = TMath::Max(x, 1.0f
); } | | void SetMaxTrackStep(Float_t x) { fMaxTrackStep = TMath::Max(x, 1.0f
); } | |
| | | | |
|
| virtual Bool_t AcceptSegment(TEveVector&, TEveVector&, Float_t /*to | | virtual Bool_t HasSeveralSubSpaces() const { return kFALSE; } | |
| lerance*/) const { return kTRUE; } | | virtual Bool_t AcceptSegment(TEveVector&, TEveVector&, Float_t /*to | |
| virtual Int_t SubSpaceId(const TEveVector&) const { return 0; } | | lerance*/) const { return kTRUE; } | |
| virtual void SetDirectionalVector(Int_t screenAxis, TEveVector& v | | virtual Int_t SubSpaceId(const TEveVector&) const { return 0; } | |
| ec); | | virtual void BisectBreakPoint(TEveVector& vL, TEveVector& vR, Flo | |
| | | at_t eps_sqr=1e-10f); | |
| | | virtual void SetDirectionalVector(Int_t screenAxis, TEveVector& v | |
| | | ec); | |
| | | | |
| // utils to draw axis | | // utils to draw axis | |
| virtual Float_t GetValForScreenPos(Int_t ax, Float_t value); | | virtual Float_t GetValForScreenPos(Int_t ax, Float_t value); | |
| virtual Float_t GetScreenVal(Int_t ax, Float_t value); | | virtual Float_t GetScreenVal(Int_t ax, Float_t value); | |
| Float_t GetLimit(Int_t i, Bool_t pos) { return pos ? fUpLimi
t[i] : fLowLimit[i]; } | | Float_t GetLimit(Int_t i, Bool_t pos) { return pos ? fUpLimi
t[i] : fLowLimit[i]; } | |
| | | | |
| static Float_t fgEps; // resolution of projected points | | static Float_t fgEps; // resolution of projected points | |
| static Float_t fgEpsSqr; // square of resolution of projected point
s | | static Float_t fgEpsSqr; // square of resolution of projected point
s | |
| | | | |
| ClassDef(TEveProjection, 0); // Base for specific classes that implement
non-linear projections. | | ClassDef(TEveProjection, 0); // Base for specific classes that implement
non-linear projections. | |
| | | | |
| skipping to change at line 168 | | skipping to change at line 170 | |
| virtual ~TEveRhoZProjection() {} | | virtual ~TEveRhoZProjection() {} | |
| | | | |
| virtual Bool_t Is2D() const { return kTRUE; } | | virtual Bool_t Is2D() const { return kTRUE; } | |
| virtual Bool_t Is3D() const { return kFALSE; } | | virtual Bool_t Is3D() const { return kFALSE; } | |
| | | | |
| virtual void ProjectPoint(Float_t& x, Float_t& y, Float_t& z, Flo
at_t d, EPProc_e proc = kPP_Full); | | virtual void ProjectPoint(Float_t& x, Float_t& y, Float_t& z, Flo
at_t d, EPProc_e proc = kPP_Full); | |
| | | | |
| virtual void SetCenter(TEveVector& center); | | virtual void SetCenter(TEveVector& center); | |
| virtual Float_t* GetProjectedCenter() { return fProjectedCenter.Arr()
; } | | virtual Float_t* GetProjectedCenter() { return fProjectedCenter.Arr()
; } | |
| | | | |
|
| virtual void UpdateLimit(); | | virtual void UpdateLimit(); | |
| | | | |
|
| virtual Bool_t AcceptSegment(TEveVector& v1, TEveVector& v2, Float_ | | virtual Bool_t HasSeveralSubSpaces() const { return kTRUE; } | |
| t tolerance) const; | | virtual Bool_t AcceptSegment(TEveVector& v1, TEveVector& v2, Float_ | |
| virtual Int_t SubSpaceId(const TEveVector& v) const; | | t tolerance) const; | |
| virtual void SetDirectionalVector(Int_t screenAxis, TEveVector& v | | virtual Int_t SubSpaceId(const TEveVector& v) const; | |
| ec); | | virtual void SetDirectionalVector(Int_t screenAxis, TEveVector& v | |
| | | ec); | |
| | | | |
| ClassDef(TEveRhoZProjection, 0); // Rho/Z non-linear projection. | | ClassDef(TEveRhoZProjection, 0); // Rho/Z non-linear projection. | |
| }; | | }; | |
| | | | |
| //=========================================================================
===== | | //=========================================================================
===== | |
| // TEveRPhiProjection | | // TEveRPhiProjection | |
| //=========================================================================
===== | | //=========================================================================
===== | |
| | | | |
| class TEveRPhiProjection : public TEveProjection | | class TEveRPhiProjection : public TEveProjection | |
| { | | { | |
| | | | |
End of changes. 4 change blocks. |
| 12 lines changed or deleted | | 16 lines changed or added | |
|
| TEveStraightLineSet.h | | TEveStraightLineSet.h | |
|
| // @(#)root/eve:$Id: TEveStraightLineSet.h 30840 2009-10-23 09:03:14Z matev
z $ | | // @(#)root/eve:$Id: TEveStraightLineSet.h 33864 2010-06-14 09:47:19Z matev
z $ | |
| // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007 | | // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007 | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| | | | |
| skipping to change at line 49 | | skipping to change at line 49 | |
| public TAttMarker, | | public TAttMarker, | |
| public TAttBBox | | public TAttBBox | |
| { | | { | |
| private: | | private: | |
| TEveStraightLineSet(const TEveStraightLineSet&); // Not imple
mented | | TEveStraightLineSet(const TEveStraightLineSet&); // Not imple
mented | |
| TEveStraightLineSet& operator=(const TEveStraightLineSet&); // Not imple
mented | | TEveStraightLineSet& operator=(const TEveStraightLineSet&); // Not imple
mented | |
| | | | |
| public: | | public: | |
| struct Line_t | | struct Line_t | |
| { | | { | |
|
| | | Int_t fId; | |
| Float_t fV1[3]; | | Float_t fV1[3]; | |
| Float_t fV2[3]; | | Float_t fV2[3]; | |
| TRef fRef; | | TRef fRef; | |
| | | | |
| Line_t(Float_t x1, Float_t y1, Float_t z1, | | Line_t(Float_t x1, Float_t y1, Float_t z1, | |
|
| Float_t x2, Float_t y2, Float_t z2) | | Float_t x2, Float_t y2, Float_t z2) : fId(-1), fRef() | |
| { | | { | |
| fV1[0] = x1, fV1[1] = y1, fV1[2] = z1; | | fV1[0] = x1, fV1[1] = y1, fV1[2] = z1; | |
| fV2[0] = x2, fV2[1] = y2, fV2[2] = z2; | | fV2[0] = x2, fV2[1] = y2, fV2[2] = z2; | |
| } | | } | |
| }; | | }; | |
| | | | |
| struct Marker_t | | struct Marker_t | |
| { | | { | |
|
| Int_t fLineID; | | Float_t fV[3]; | |
| Float_t fPos; | | Int_t fLineId; | |
| TRef fRef; | | TRef fRef; | |
| | | | |
|
| Marker_t(Int_t lineID, Float_t pos) : fLineID(lineID), fPos(pos) {}; | | Marker_t(Float_t x, Float_t y, Float_t z, Int_t line_id) : fLineId(li | |
| | | ne_id), fRef() | |
| | | { | |
| | | fV[0] = x, fV[1] = y, fV[2] = z; | |
| | | } | |
| }; | | }; | |
| | | | |
| protected: | | protected: | |
| TEveChunkManager fLinePlex; | | TEveChunkManager fLinePlex; | |
| TEveChunkManager fMarkerPlex; | | TEveChunkManager fMarkerPlex; | |
| | | | |
|
| Bool_t fOwnLinesIds; // Flag specifying if id-objects are | | Bool_t fOwnLinesIds; // Flag specifying if id-objects are | |
| owned by the TEveQuadSet | | owned by the line-set | |
| Bool_t fOwnMarkersIds; // Flag specifying if id-objects are | | Bool_t fOwnMarkersIds; // Flag specifying if id-objects are | |
| owned by the TEveQuadSet | | owned by the line-set | |
| | | | |
| Bool_t fRnrMarkers; | | Bool_t fRnrMarkers; | |
| Bool_t fRnrLines; | | Bool_t fRnrLines; | |
| | | | |
| Bool_t fDepthTest; | | Bool_t fDepthTest; | |
| | | | |
| Line_t* fLastLine; //! | | Line_t* fLastLine; //! | |
| | | | |
| public: | | public: | |
| TEveStraightLineSet(const char* n="StraightLineSet", const char* t=""); | | TEveStraightLineSet(const char* n="StraightLineSet", const char* t=""); | |
| virtual ~TEveStraightLineSet() {} | | virtual ~TEveStraightLineSet() {} | |
| | | | |
| virtual void SetLineColor(Color_t col) { SetMainColor(col); } | | virtual void SetLineColor(Color_t col) { SetMainColor(col); } | |
| | | | |
|
| void AddLine(Float_t x1, Float_t y1, Float_t z1, Float_t x2, Float_t y2, | | Line_t* AddLine(Float_t x1, Float_t y1, Float_t z1, Float_t x2, Float_ | |
| Float_t z2); | | t y2, Float_t z2); | |
| void AddMarker(Int_t lineID, Float_t pos); | | Line_t* AddLine(const TEveVector& p1, const TEveVector& p2); | |
| | | Marker_t* AddMarker(Float_t x, Float_t y, Float_t z, Int_t line_id=-1); | |
| | | Marker_t* AddMarker(const TEveVector& p, Int_t line_id=-1); | |
| | | Marker_t* AddMarker(Int_t line_id, Float_t pos); | |
| | | | |
| TEveChunkManager& GetLinePlex() { return fLinePlex; } | | TEveChunkManager& GetLinePlex() { return fLinePlex; } | |
| TEveChunkManager& GetMarkerPlex() { return fMarkerPlex; } | | TEveChunkManager& GetMarkerPlex() { return fMarkerPlex; } | |
| | | | |
| virtual Bool_t GetRnrMarkers() { return fRnrMarkers; } | | virtual Bool_t GetRnrMarkers() { return fRnrMarkers; } | |
| virtual Bool_t GetRnrLines() { return fRnrLines; } | | virtual Bool_t GetRnrLines() { return fRnrLines; } | |
| virtual Bool_t GetDepthTest() { return fDepthTest; } | | virtual Bool_t GetDepthTest() { return fDepthTest; } | |
| | | | |
| virtual void SetRnrMarkers(Bool_t x) { fRnrMarkers = x; } | | virtual void SetRnrMarkers(Bool_t x) { fRnrMarkers = x; } | |
| virtual void SetRnrLines(Bool_t x) { fRnrLines = x; } | | virtual void SetRnrLines(Bool_t x) { fRnrLines = x; } | |
| | | | |
End of changes. 7 change blocks. |
| 12 lines changed or deleted | | 20 lines changed or added | |
|
| TEveTrack.h | | TEveTrack.h | |
|
| // @(#)root/eve:$Id: TEveTrack.h 32933 2010-04-09 17:28:46Z matevz $ | | // @(#)root/eve:$Id: TEveTrack.h 33864 2010-06-14 09:47:19Z matevz $ | |
| // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007 | | // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007 | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| | | | |
| skipping to change at line 46 | | skipping to change at line 46 | |
| friend class TEveTrackGL; | | friend class TEveTrackGL; | |
| | | | |
| private: | | private: | |
| TEveTrack& operator=(const TEveTrack&); // Not implemented | | TEveTrack& operator=(const TEveTrack&); // Not implemented | |
| | | | |
| public: | | public: | |
| typedef std::vector<TEvePathMark> vPathMark_t; | | typedef std::vector<TEvePathMark> vPathMark_t; | |
| typedef vPathMark_t::iterator vPathMark_i; | | typedef vPathMark_t::iterator vPathMark_i; | |
| typedef vPathMark_t::const_iterator vPathMark_ci; | | typedef vPathMark_t::const_iterator vPathMark_ci; | |
| | | | |
|
| | | // Deprecated -- to be removed. | |
| enum EBreakProjectedTracks_e { kBPTDefault, kBPTAlways, kBPTNever }; | | enum EBreakProjectedTracks_e { kBPTDefault, kBPTAlways, kBPTNever }; | |
| | | | |
| protected: | | protected: | |
| TEveVector fV; // Starting vertex | | TEveVector fV; // Starting vertex | |
| TEveVector fP; // Starting momentum | | TEveVector fP; // Starting momentum | |
| TEveVector fPEnd; // Momentum at the last point of extrapo
lation | | TEveVector fPEnd; // Momentum at the last point of extrapo
lation | |
| Double_t fBeta; // Relativistic beta factor | | Double_t fBeta; // Relativistic beta factor | |
| Int_t fPdg; // PDG code | | Int_t fPdg; // PDG code | |
| Int_t fCharge; // Charge in units of e0 | | Int_t fCharge; // Charge in units of e0 | |
| Int_t fLabel; // Simulation label | | Int_t fLabel; // Simulation label | |
| Int_t fIndex; // Reconstruction index | | Int_t fIndex; // Reconstruction index | |
| Int_t fStatus; // Status-word, user-defined. | | Int_t fStatus; // Status-word, user-defined. | |
| Bool_t fLockPoints; // Lock points that are currently in - d
o nothing in MakeTrack(). | | Bool_t fLockPoints; // Lock points that are currently in - d
o nothing in MakeTrack(). | |
| vPathMark_t fPathMarks; // TEveVector of known points along the
track | | vPathMark_t fPathMarks; // TEveVector of known points along the
track | |
| Int_t fLastPMIdx; //!Last path-mark index tried in track-p
ropagation. | | Int_t fLastPMIdx; //!Last path-mark index tried in track-p
ropagation. | |
| | | | |
| TEveTrackPropagator *fPropagator; // Pointer to shared render-style | | TEveTrackPropagator *fPropagator; // Pointer to shared render-style | |
| | | | |
|
| UChar_t fBreakProjectedTracks; // How to handle breaks durin | | | |
| g projection - track specific settings. | | | |
| | | | |
| static Bool_t fgDefaultBreakProjectedTracks; // How to handle break | | | |
| s during projection - global setting. | | | |
| | | | |
| public: | | public: | |
| TEveTrack(); | | TEveTrack(); | |
| TEveTrack(TParticle* t, Int_t label, TEveTrackPropagator* prop=0); | | TEveTrack(TParticle* t, Int_t label, TEveTrackPropagator* prop=0); | |
| TEveTrack(TEveMCTrack* t, TEveTrackPropagator* prop=0); | | TEveTrack(TEveMCTrack* t, TEveTrackPropagator* prop=0); | |
| TEveTrack(TEveRecTrack* t, TEveTrackPropagator* prop=0); | | TEveTrack(TEveRecTrack* t, TEveTrackPropagator* prop=0); | |
| TEveTrack(const TEveTrack& t); | | TEveTrack(const TEveTrack& t); | |
| virtual ~TEveTrack(); | | virtual ~TEveTrack(); | |
| | | | |
|
| | | virtual void ComputeBBox(); | |
| | | | |
| virtual void SetStdTitle(); | | virtual void SetStdTitle(); | |
| | | | |
| virtual void SetTrackParams(const TEveTrack& t); | | virtual void SetTrackParams(const TEveTrack& t); | |
| virtual void SetPathMarks (const TEveTrack& t); | | virtual void SetPathMarks (const TEveTrack& t); | |
| | | | |
| virtual void MakeTrack(Bool_t recurse=kTRUE); | | virtual void MakeTrack(Bool_t recurse=kTRUE); | |
| | | | |
| TEveTrackPropagator* GetPropagator() const { return fPropagator; } | | TEveTrackPropagator* GetPropagator() const { return fPropagator; } | |
| Int_t GetLastPMIdx() const { return fLastPMIdx; } | | Int_t GetLastPMIdx() const { return fLastPMIdx; } | |
| void SetPropagator(TEveTrackPropagator* prop); | | void SetPropagator(TEveTrackPropagator* prop); | |
| | | | |
| skipping to change at line 124 | | skipping to change at line 123 | |
| | | | |
| virtual void SecSelected(TEveTrack*); // *SIGNAL* | | virtual void SecSelected(TEveTrack*); // *SIGNAL* | |
| | | | |
| virtual const TGPicture* GetListTreeIcon(Bool_t open=kFALSE); | | virtual const TGPicture* GetListTreeIcon(Bool_t open=kFALSE); | |
| | | | |
| virtual void CopyVizParams(const TEveElement* el); | | virtual void CopyVizParams(const TEveElement* el); | |
| virtual void WriteVizParams(ostream& out, const TString& var); | | virtual void WriteVizParams(ostream& out, const TString& var); | |
| | | | |
| virtual TClass* ProjectedClass(const TEveProjection* p) const; | | virtual TClass* ProjectedClass(const TEveProjection* p) const; | |
| | | | |
|
| Bool_t ShouldBreakTrack() const; | | // These functions are deprecated -- use TEveTrackPropagator functions. | |
| | | // Will be removed after 5.28. | |
| UChar_t GetBreakProjectedTracks() const { return fBreakProjectedTrac | | Bool_t ShouldBreakTrack() const; | |
| ks; } | | UChar_t GetBreakProjectedTracks() const; | |
| void SetBreakProjectedTracks(UChar_t bt) { fBreakProjectedTracks = bt | | void SetBreakProjectedTracks(UChar_t bt); | |
| ; } | | | |
| | | | |
| static Bool_t GetDefaultBreakProjectedTracks(); | | static Bool_t GetDefaultBreakProjectedTracks(); | |
| static void SetDefaultBreakProjectedTracks(Bool_t bt); | | static void SetDefaultBreakProjectedTracks(Bool_t bt); | |
| | | | |
| ClassDef(TEveTrack, 1); // Track with given vertex, momentum and optiona
l referece-points (path-marks) along its path. | | ClassDef(TEveTrack, 1); // Track with given vertex, momentum and optiona
l referece-points (path-marks) along its path. | |
| }; | | }; | |
| | | | |
| /**************************************************************************
****/ | | /**************************************************************************
****/ | |
| // TEveTrackList | | // TEveTrackList | |
| /**************************************************************************
****/ | | /**************************************************************************
****/ | |
| | | | |
| | | | |
End of changes. 5 change blocks. |
| 14 lines changed or deleted | | 9 lines changed or added | |
|
| TEveTrackPropagator.h | | TEveTrackPropagator.h | |
|
| // @(#)root/eve:$Id: TEveTrackPropagator.h 32933 2010-04-09 17:28:46Z matev
z $ | | // @(#)root/eve:$Id: TEveTrackPropagator.h 33627 2010-05-27 19:19:58Z matev
z $ | |
| // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007 | | // Authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007 | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| | | | |
| skipping to change at line 156 | | skipping to change at line 156 | |
| void UpdateHelix(const TEveVector & p, const TEveVector& b, Bool_t fu
ll_update, Bool_t enforce_max_step); | | void UpdateHelix(const TEveVector & p, const TEveVector& b, Bool_t fu
ll_update, Bool_t enforce_max_step); | |
| void UpdateRK (const TEveVector & p, const TEveVector& b); | | void UpdateRK (const TEveVector & p, const TEveVector& b); | |
| | | | |
| void Step(const TEveVector4& v, const TEveVector& p, TEveVector4& vOu
t, TEveVector& pOut); | | void Step(const TEveVector4& v, const TEveVector& p, TEveVector4& vOu
t, TEveVector& pOut); | |
| | | | |
| Float_t GetStep() { return fLStep * TMath::Sqrt(1 + fLam*fLam); } | | Float_t GetStep() { return fLStep * TMath::Sqrt(1 + fLam*fLam); } | |
| Float_t GetStep2() { return fLStep * fLStep * (1 + fLam*fLam); } | | Float_t GetStep2() { return fLStep * fLStep * (1 + fLam*fLam); } | |
| }; | | }; | |
| | | | |
| enum EStepper_e { kHelix, kRungeKutta }; | | enum EStepper_e { kHelix, kRungeKutta }; | |
|
| | | | |
| | | enum EProjTrackBreaking_e { kPTB_Break, kPTB_UseFirstPointPos, kPTB_UseL | |
| | | astPointPos }; | |
| | | | |
| private: | | private: | |
| TEveTrackPropagator(const TEveTrackPropagator&); // Not imple
mented | | TEveTrackPropagator(const TEveTrackPropagator&); // Not imple
mented | |
| TEveTrackPropagator& operator=(const TEveTrackPropagator&); // Not imple
mented | | TEveTrackPropagator& operator=(const TEveTrackPropagator&); // Not imple
mented | |
| | | | |
| protected: | | protected: | |
| EStepper_e fStepper; | | EStepper_e fStepper; | |
| | | | |
| TEveMagField* fMagFieldObj; | | TEveMagField* fMagFieldObj; | |
|
| | | Bool_t fOwnMagFiledObj; | |
| | | | |
| // Track extrapolation limits | | // Track extrapolation limits | |
| Float_t fMaxR; // Max radius for track extrapo
lation | | Float_t fMaxR; // Max radius for track extrapo
lation | |
| Float_t fMaxZ; // Max z-coordinate for track e
xtrapolation. | | Float_t fMaxZ; // Max z-coordinate for track e
xtrapolation. | |
| Int_t fNMax; // Max steps | | Int_t fNMax; // Max steps | |
| // Helix limits | | // Helix limits | |
| Float_t fMaxOrbs; // Maximal angular path of trac
ks' orbits (1 ~ 2Pi). | | Float_t fMaxOrbs; // Maximal angular path of trac
ks' orbits (1 ~ 2Pi). | |
| | | | |
| // Path-mark / first-vertex control | | // Path-mark / first-vertex control | |
| Bool_t fEditPathMarks; // Show widgets for path-mark c
ontrol in GUI editor. | | Bool_t fEditPathMarks; // Show widgets for path-mark c
ontrol in GUI editor. | |
| | | | |
| skipping to change at line 186 | | skipping to change at line 190 | |
| Bool_t fFitDecay; // Pass through decay point whe
n extrapolating a track. | | Bool_t fFitDecay; // Pass through decay point whe
n extrapolating a track. | |
| Bool_t fFitCluster2Ds; // Pass through 2D-clusters whe
n extrapolating a track. | | Bool_t fFitCluster2Ds; // Pass through 2D-clusters whe
n extrapolating a track. | |
| Bool_t fRnrDaughters; // Render daughter path-marks. | | Bool_t fRnrDaughters; // Render daughter path-marks. | |
| Bool_t fRnrReferences; // Render track-reference path-
marks. | | Bool_t fRnrReferences; // Render track-reference path-
marks. | |
| Bool_t fRnrDecay; // Render decay path-marks. | | Bool_t fRnrDecay; // Render decay path-marks. | |
| Bool_t fRnrCluster2Ds; // Render 2D-clusters. | | Bool_t fRnrCluster2Ds; // Render 2D-clusters. | |
| Bool_t fRnrFV; // Render first vertex. | | Bool_t fRnrFV; // Render first vertex. | |
| TMarker fPMAtt; // Marker attributes for render
ing of path-marks. | | TMarker fPMAtt; // Marker attributes for render
ing of path-marks. | |
| TMarker fFVAtt; // Marker attributes for fits v
ertex. | | TMarker fFVAtt; // Marker attributes for fits v
ertex. | |
| | | | |
|
| | | // Handling of discontinuities in projections | |
| | | UChar_t fProjTrackBreaking; // Handling of projected-tr | |
| | | ack breaking. | |
| | | Bool_t fRnrPTBMarkers; // Render break-points on t | |
| | | racks. | |
| | | TMarker fPTBAtt; // Marker attributes for tr | |
| | | ack break-points. | |
| | | | |
| // ---------------------------------------------------------------- | | // ---------------------------------------------------------------- | |
| | | | |
| // Propagation, state of current track | | // Propagation, state of current track | |
| std::vector<TEveVector4> fPoints; // Calculated point. | | std::vector<TEveVector4> fPoints; // Calculated point. | |
| TEveVector fV; // Start vertex. | | TEveVector fV; // Start vertex. | |
| Helix_t fH; // Helix. | | Helix_t fH; // Helix. | |
| | | | |
| void RebuildTracks(); | | void RebuildTracks(); | |
| void Update(const TEveVector4& v, const TEveVector& p, Bool_t full_up
date=kFALSE, Bool_t enforce_max_step=kFALSE); | | void Update(const TEveVector4& v, const TEveVector& p, Bool_t full_up
date=kFALSE, Bool_t enforce_max_step=kFALSE); | |
| void Step(const TEveVector4 &v, const TEveVector &p, TEveVector4 &vOu
t, TEveVector &pOut); | | void Step(const TEveVector4 &v, const TEveVector &p, TEveVector4 &vOu
t, TEveVector &pOut); | |
| | | | |
| skipping to change at line 214 | | skipping to change at line 223 | |
| | | | |
| Bool_t HelixIntersectPlane(const TEveVector& p, const TEveVector& point
, const TEveVector& normal, | | Bool_t HelixIntersectPlane(const TEveVector& p, const TEveVector& point
, const TEveVector& normal, | |
| TEveVector& itsect); | | TEveVector& itsect); | |
| Bool_t LineIntersectPlane(const TEveVector& p, const TEveVector& point,
const TEveVector& normal, | | Bool_t LineIntersectPlane(const TEveVector& p, const TEveVector& point,
const TEveVector& normal, | |
| TEveVector& itsect); | | TEveVector& itsect); | |
| | | | |
| Bool_t PointOverVertex(const TEveVector4& v0, const TEveVector4& v, Floa
t_t* p=0); | | Bool_t PointOverVertex(const TEveVector4& v0, const TEveVector4& v, Floa
t_t* p=0); | |
| | | | |
| public: | | public: | |
| TEveTrackPropagator(const char* n="TEveTrackPropagator", const char* t="
", | | TEveTrackPropagator(const char* n="TEveTrackPropagator", const char* t="
", | |
|
| TEveMagField* field=0); | | TEveMagField* field=0, Bool_t own_field=kTRUE); | |
| virtual ~TEveTrackPropagator(); | | virtual ~TEveTrackPropagator(); | |
| | | | |
| virtual void OnZeroRefCount(); | | virtual void OnZeroRefCount(); | |
| | | | |
| virtual void CheckReferenceCount(const TEveException& eh="TEveElement::C
heckReferenceCount "); | | virtual void CheckReferenceCount(const TEveException& eh="TEveElement::C
heckReferenceCount "); | |
| | | | |
| virtual void ElementChanged(Bool_t update_scenes=kTRUE, Bool_t redraw=kF
ALSE); | | virtual void ElementChanged(Bool_t update_scenes=kTRUE, Bool_t redraw=kF
ALSE); | |
| | | | |
| // propagation | | // propagation | |
| void InitTrack(TEveVector& v, Int_t charge); | | void InitTrack(TEveVector& v, Int_t charge); | |
| | | | |
| skipping to change at line 238 | | skipping to change at line 247 | |
| | | | |
| Bool_t IntersectPlane(const TEveVector& p, const TEveVector& point, cons
t TEveVector& normal, | | Bool_t IntersectPlane(const TEveVector& p, const TEveVector& point, cons
t TEveVector& normal, | |
| TEveVector& itsect); | | TEveVector& itsect); | |
| | | | |
| void FillPointSet(TEvePointSet* ps) const; | | void FillPointSet(TEvePointSet* ps) const; | |
| | | | |
| void SetStepper(EStepper_e s) { fStepper = s; } | | void SetStepper(EStepper_e s) { fStepper = s; } | |
| | | | |
| void SetMagField(Float_t bX, Float_t bY, Float_t bZ); | | void SetMagField(Float_t bX, Float_t bY, Float_t bZ); | |
| void SetMagField(Float_t b) { SetMagField(0.f, 0.f, b); } | | void SetMagField(Float_t b) { SetMagField(0.f, 0.f, b); } | |
|
| void SetMagFieldObj(TEveMagField * x); | | void SetMagFieldObj(TEveMagField* field, Bool_t own_field=kTRUE); | |
| | | | |
| void SetMaxR(Float_t x); | | void SetMaxR(Float_t x); | |
| void SetMaxZ(Float_t x); | | void SetMaxZ(Float_t x); | |
| void SetMaxOrbs(Float_t x); | | void SetMaxOrbs(Float_t x); | |
| void SetMinAng(Float_t x); | | void SetMinAng(Float_t x); | |
| void SetMaxAng(Float_t x); | | void SetMaxAng(Float_t x); | |
| void SetMaxStep(Float_t x); | | void SetMaxStep(Float_t x); | |
| void SetDelta(Float_t x); | | void SetDelta(Float_t x); | |
| | | | |
| void SetEditPathMarks(Bool_t x) { fEditPathMarks = x; } | | void SetEditPathMarks(Bool_t x) { fEditPathMarks = x; } | |
| void SetRnrDaughters(Bool_t x); | | void SetRnrDaughters(Bool_t x); | |
| void SetRnrReferences(Bool_t x); | | void SetRnrReferences(Bool_t x); | |
| void SetRnrDecay(Bool_t x); | | void SetRnrDecay(Bool_t x); | |
| void SetRnrCluster2Ds(Bool_t x); | | void SetRnrCluster2Ds(Bool_t x); | |
| void SetFitDaughters(Bool_t x); | | void SetFitDaughters(Bool_t x); | |
| void SetFitReferences(Bool_t x); | | void SetFitReferences(Bool_t x); | |
| void SetFitDecay(Bool_t x); | | void SetFitDecay(Bool_t x); | |
| void SetFitCluster2Ds(Bool_t x); | | void SetFitCluster2Ds(Bool_t x); | |
|
| void SetRnrFV(Bool_t x) { fRnrFV = x; } | | void SetRnrFV(Bool_t x); | |
| | | void SetProjTrackBreaking(UChar_t x); | |
| | | void SetRnrPTBMarkers(Bool_t x); | |
| | | | |
| TEveVector GetMagField(Float_t x, Float_t y, Float_t z) { return fMagFie
ldObj->GetField(x, y, z); } | | TEveVector GetMagField(Float_t x, Float_t y, Float_t z) { return fMagFie
ldObj->GetField(x, y, z); } | |
| void PrintMagField(Float_t x, Float_t y, Float_t z) const; | | void PrintMagField(Float_t x, Float_t y, Float_t z) const; | |
| | | | |
| EStepper_e GetStepper() const { return fStepper;} | | EStepper_e GetStepper() const { return fStepper;} | |
| | | | |
| Float_t GetMaxR() const { return fMaxR; } | | Float_t GetMaxR() const { return fMaxR; } | |
| Float_t GetMaxZ() const { return fMaxZ; } | | Float_t GetMaxZ() const { return fMaxZ; } | |
| Float_t GetMaxOrbs() const { return fMaxOrbs; } | | Float_t GetMaxOrbs() const { return fMaxOrbs; } | |
| Float_t GetMinAng() const; | | Float_t GetMinAng() const; | |
| | | | |
| skipping to change at line 282 | | skipping to change at line 293 | |
| Bool_t GetEditPathMarks() const { return fEditPathMarks; } | | Bool_t GetEditPathMarks() const { return fEditPathMarks; } | |
| Bool_t GetRnrDaughters() const { return fRnrDaughters; } | | Bool_t GetRnrDaughters() const { return fRnrDaughters; } | |
| Bool_t GetRnrReferences() const { return fRnrReferences; } | | Bool_t GetRnrReferences() const { return fRnrReferences; } | |
| Bool_t GetRnrDecay() const { return fRnrDecay; } | | Bool_t GetRnrDecay() const { return fRnrDecay; } | |
| Bool_t GetRnrCluster2Ds() const { return fRnrCluster2Ds; } | | Bool_t GetRnrCluster2Ds() const { return fRnrCluster2Ds; } | |
| Bool_t GetFitDaughters() const { return fFitDaughters; } | | Bool_t GetFitDaughters() const { return fFitDaughters; } | |
| Bool_t GetFitReferences() const { return fFitReferences; } | | Bool_t GetFitReferences() const { return fFitReferences; } | |
| Bool_t GetFitDecay() const { return fFitDecay; } | | Bool_t GetFitDecay() const { return fFitDecay; } | |
| Bool_t GetFitCluster2Ds() const { return fFitCluster2Ds; } | | Bool_t GetFitCluster2Ds() const { return fFitCluster2Ds; } | |
| Bool_t GetRnrFV() const { return fRnrFV; } | | Bool_t GetRnrFV() const { return fRnrFV; } | |
|
| | | UChar_t GetProjTrackBreaking() const { return fProjTrackBreaking; } | |
| | | Bool_t GetRnrPTBMarkers() const { return fRnrPTBMarkers; } | |
| | | | |
|
| TMarker& RefPMAtt() { return fPMAtt; } | | TMarker& RefPMAtt() { return fPMAtt; } | |
| TMarker& RefFVAtt() { return fFVAtt; } | | TMarker& RefFVAtt() { return fFVAtt; } | |
| | | TMarker& RefPTBAtt() { return fPTBAtt; } | |
| | | | |
| static Bool_t IsOutsideBounds(const TEveVector& point, Float_t maxRsqr,
Float_t maxZ); | | static Bool_t IsOutsideBounds(const TEveVector& point, Float_t maxRsqr,
Float_t maxZ); | |
| | | | |
| static Float_t fgDefMagField; // Default value for constant
solenoid magnetic field. | | static Float_t fgDefMagField; // Default value for constant
solenoid magnetic field. | |
| static const Float_t fgkB2C; // Constant for conversion of
momentum to curvature. | | static const Float_t fgkB2C; // Constant for conversion of
momentum to curvature. | |
| static TEveTrackPropagator fgDefault; // Default track propagator. | | static TEveTrackPropagator fgDefault; // Default track propagator. | |
| | | | |
| static Float_t fgEditorMaxR; // Max R that can be set in GU
I editor. | | static Float_t fgEditorMaxR; // Max R that can be set in GU
I editor. | |
| static Float_t fgEditorMaxZ; // Max Z that can be set in GU
I editor. | | static Float_t fgEditorMaxZ; // Max Z that can be set in GU
I editor. | |
| | | | |
| | | | |
End of changes. 9 change blocks. |
| 6 lines changed or deleted | | 24 lines changed or added | |
|
| TGFileBrowser.h | | TGFileBrowser.h | |
|
| // @(#)root/gui:$Id: TGFileBrowser.h 29885 2009-08-24 14:19:56Z bellenot $ | | // @(#)root/gui:$Id: TGFileBrowser.h 33618 2010-05-27 06:51:26Z bellenot $ | |
| // Author: Bertrand Bellenot 26/09/2007 | | // Author: Bertrand Bellenot 26/09/2007 | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2007, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| | | | |
| skipping to change at line 23 | | skipping to change at line 23 | |
| #define ROOT_TGFileBrowser | | #define ROOT_TGFileBrowser | |
| | | | |
| #ifndef ROOT_TGFrame | | #ifndef ROOT_TGFrame | |
| #include "TGFrame.h" | | #include "TGFrame.h" | |
| #endif | | #endif | |
| | | | |
| #ifndef ROOT_TBrowserImp | | #ifndef ROOT_TBrowserImp | |
| #include "TBrowserImp.h" | | #include "TBrowserImp.h" | |
| #endif | | #endif | |
| | | | |
|
| | | #include <list> | |
| | | | |
| class TGCanvas; | | class TGCanvas; | |
| class TGListTree; | | class TGListTree; | |
| class TGListTreeItem; | | class TGListTreeItem; | |
| class TGPicture; | | class TGPicture; | |
| class TGComboBox; | | class TGComboBox; | |
| class TContextMenu; | | class TContextMenu; | |
| class TRegexp; | | class TRegexp; | |
| class TString; | | class TString; | |
| class TRootBrowser; | | class TRootBrowser; | |
| class TSystemDirectory; | | class TSystemDirectory; | |
| class TSystemFile; | | class TSystemFile; | |
| | | | |
| class TGFileBrowser : public TGMainFrame, public TBrowserImp { | | class TGFileBrowser : public TGMainFrame, public TBrowserImp { | |
| | | | |
|
| | | public: | |
| | | typedef std::list<TGListTreeItem*> sLTI_t; | |
| | | typedef sLTI_t::iterator sLTI_i; | |
| | | typedef sLTI_t::reverse_iterator sLTI_ri; | |
| | | | |
| protected: | | protected: | |
| TRootBrowser *fNewBrowser; // Pointer back to the Browser | | TRootBrowser *fNewBrowser; // Pointer back to the Browser | |
| TGHorizontalFrame *fTopFrame; // Top horizontal frame | | TGHorizontalFrame *fTopFrame; // Top horizontal frame | |
| TGHorizontalFrame *fBotFrame; // Bottom horizontal frame | | TGHorizontalFrame *fBotFrame; // Bottom horizontal frame | |
| TGCanvas *fCanvas; // Canvas for the list tree | | TGCanvas *fCanvas; // Canvas for the list tree | |
| TGListTree *fListTree; // Main list tree | | TGListTree *fListTree; // Main list tree | |
| TGListTreeItem *fListLevel; // Current list tree level | | TGListTreeItem *fListLevel; // Current list tree level | |
| TGListTreeItem *fCurrentDir; // Current (list tree) directory | | TGListTreeItem *fCurrentDir; // Current (list tree) directory | |
| TGListTreeItem *fRootDir; // Root (list tree) directory | | TGListTreeItem *fRootDir; // Root (list tree) directory | |
| TGComboBox *fDrawOption; // Draw options combobox | | TGComboBox *fDrawOption; // Draw options combobox | |
| TGComboBox *fFileType; // File type combobox | | TGComboBox *fFileType; // File type combobox | |
| TContextMenu *fContextMenu; // pointer to context menu | | TContextMenu *fContextMenu; // pointer to context menu | |
|
| | | TGPictureButton *fSortButton; // "Sort" button | |
| | | TGPictureButton *fRefreshButton; // "Refresh" button | |
| const TGPicture *fRootIcon; // Root files icon | | const TGPicture *fRootIcon; // Root files icon | |
| const TGPicture *fFileIcon; // System files icon | | const TGPicture *fFileIcon; // System files icon | |
| const TGPicture *fCachedPic; // Cached picture | | const TGPicture *fCachedPic; // Cached picture | |
| TString fCachedPicName; // Cached picture name | | TString fCachedPicName; // Cached picture name | |
| TRegexp *fFilter; // Regular expression used to fil
ter files | | TRegexp *fFilter; // Regular expression used to fil
ter files | |
| TSystemDirectory *fDir; // Actual (selected) system direc
tory | | TSystemDirectory *fDir; // Actual (selected) system direc
tory | |
| TSystemFile *fFile; // Actual (selected) system file | | TSystemFile *fFile; // Actual (selected) system file | |
| Int_t fGroupSize; // total number of items when ico
n box switched to "global view" mode | | Int_t fGroupSize; // total number of items when ico
n box switched to "global view" mode | |
| Long_t fNKeys, fCnt; // Counters for keys inside a Roo
t file | | Long_t fNKeys, fCnt; // Counters for keys inside a Roo
t file | |
| Bool_t fGrouped; // kTRUE if Root file content (ke
ys) is grouped | | Bool_t fGrouped; // kTRUE if Root file content (ke
ys) is grouped | |
| Bool_t fShowHidden; // kTRUE to display hidden files | | Bool_t fShowHidden; // kTRUE to display hidden files | |
| Bool_t fDblClick; // kTRUE if user double-clicked o
n a list tree item | | Bool_t fDblClick; // kTRUE if user double-clicked o
n a list tree item | |
| | | | |
|
| | | sLTI_t fSortedItems; // List of sorted list-tree items | |
| | | . | |
| | | | |
| void CreateBrowser(); | | void CreateBrowser(); | |
| | | | |
| public: | | public: | |
| TGFileBrowser(const TGWindow *p, TBrowser* b=0, UInt_t w=200, UInt_t h=4
00); | | TGFileBrowser(const TGWindow *p, TBrowser* b=0, UInt_t w=200, UInt_t h=4
00); | |
| virtual ~TGFileBrowser(); | | virtual ~TGFileBrowser(); | |
| | | | |
| virtual void Add(TObject *obj, const char *name = 0, Int_t check = -1); | | virtual void Add(TObject *obj, const char *name = 0, Int_t check = -1); | |
| virtual void BrowseObj(TObject *obj); | | virtual void BrowseObj(TObject *obj); | |
| virtual void RecursiveRemove(TObject *obj); | | virtual void RecursiveRemove(TObject *obj); | |
| virtual void Refresh(Bool_t force = kFALSE); | | virtual void Refresh(Bool_t force = kFALSE); | |
| | | | |
| skipping to change at line 85 | | skipping to change at line 96 | |
| TRootBrowser *GetNewBrowser() const { return fNewBrowser; } | | TRootBrowser *GetNewBrowser() const { return fNewBrowser; } | |
| void SetNewBrowser(TRootBrowser* b) { fNewBrowser = b; } | | void SetNewBrowser(TRootBrowser* b) { fNewBrowser = b; } | |
| | | | |
| void AddFSDirectory(const char* entry, const char* path=0, Option
_t *opt=""); | | void AddFSDirectory(const char* entry, const char* path=0, Option
_t *opt=""); | |
| void AddKey(TGListTreeItem *itm, TObject *obj, const char *name =
0); | | void AddKey(TGListTreeItem *itm, TObject *obj, const char *name =
0); | |
| void AddRemoteFile(TObject *obj); | | void AddRemoteFile(TObject *obj); | |
| void ApplyFilter(Int_t id); | | void ApplyFilter(Int_t id); | |
| void Chdir(TGListTreeItem *item); | | void Chdir(TGListTreeItem *item); | |
| void Checked(TObject *obj, Bool_t check); | | void Checked(TObject *obj, Bool_t check); | |
| void CheckRemote(TGListTreeItem *item); | | void CheckRemote(TGListTreeItem *item); | |
|
| | | Bool_t CheckSorted(TGListTreeItem *item, Bool_t but = kFALSE); | |
| void Clicked(TGListTreeItem *item, Int_t btn, Int_t x, Int_t y); | | void Clicked(TGListTreeItem *item, Int_t btn, Int_t x, Int_t y); | |
| TString DirName(TGListTreeItem* item); | | TString DirName(TGListTreeItem* item); | |
| TString FullPathName(TGListTreeItem* item); | | TString FullPathName(TGListTreeItem* item); | |
| void DoubleClicked(TGListTreeItem *item, Int_t btn); | | void DoubleClicked(TGListTreeItem *item, Int_t btn); | |
| Long_t XXExecuteDefaultAction(TObject *obj); | | Long_t XXExecuteDefaultAction(TObject *obj); | |
| char *FormatFileInfo(const char *fname, Long64_t size, Long_t modt
ime); | | char *FormatFileInfo(const char *fname, Long64_t size, Long_t modt
ime); | |
| void GetFilePictures(const TGPicture **pic, Int_t file_type, Bool
_t is_link, const char *name); | | void GetFilePictures(const TGPicture **pic, Int_t file_type, Bool
_t is_link, const char *name); | |
| void GetObjPicture(const TGPicture **pic, TObject *obj); | | void GetObjPicture(const TGPicture **pic, TObject *obj); | |
| void GotoDir(const char *path); | | void GotoDir(const char *path); | |
| void PadModified(); | | void PadModified(); | |
| void Selected(char *); | | void Selected(char *); | |
|
| | | void ToggleSort(); | |
| void Update(); | | void Update(); | |
| | | | |
| ClassDef(TGFileBrowser, 0) // File browser. | | ClassDef(TGFileBrowser, 0) // File browser. | |
| }; | | }; | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 7 change blocks. |
| 1 lines changed or deleted | | 15 lines changed or added | |
|
| TGLCamera.h | | TGLCamera.h | |
|
| // @(#)root/gl:$Id: TGLCamera.h 30366 2009-09-23 09:23:32Z matevz $ | | // @(#)root/gl:$Id: TGLCamera.h 34006 2010-06-21 10:36:05Z matevz $ | |
| // Author: Richard Maunder 25/05/2005 | | // Author: Richard Maunder 25/05/2005 | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| | | | |
| skipping to change at line 78 | | skipping to change at line 78 | |
| | | | |
| // Non-copyable class | | // Non-copyable class | |
| TGLCamera(const TGLCamera &); | | TGLCamera(const TGLCamera &); | |
| TGLCamera & operator=(const TGLCamera &); | | TGLCamera & operator=(const TGLCamera &); | |
| | | | |
| protected: | | protected: | |
| // Fields | | // Fields | |
| TGLMatrix fCamBase; //! tranformation to center and rotation f
rom up to x vector | | TGLMatrix fCamBase; //! tranformation to center and rotation f
rom up to x vector | |
| TGLMatrix fCamTrans; //! transformation relative to fCamTrans | | TGLMatrix fCamTrans; //! transformation relative to fCamTrans | |
| Bool_t fExternalCenter; //! use external center insead of scene ce
nter | | Bool_t fExternalCenter; //! use external center insead of scene ce
nter | |
|
| | | Bool_t fFixDefCenter; //! use fixed default center | |
| TGLVector3 fExtCenter; //! external camera center | | TGLVector3 fExtCenter; //! external camera center | |
| TGLVector3 fDefCenter; //! deafult camera center | | TGLVector3 fDefCenter; //! deafult camera center | |
|
| | | TGLVector3 fFDCenter; //! fixed deafult camera center | |
| TGLVector3 *fCenter; //! current camera center | | TGLVector3 *fCenter; //! current camera center | |
| | | | |
| mutable Double_t fNearClip; //! last applied near-clip | | mutable Double_t fNearClip; //! last applied near-clip | |
| mutable Double_t fFarClip; //! last applied far-clip | | mutable Double_t fFarClip; //! last applied far-clip | |
| | | | |
| // Set in Setup() | | // Set in Setup() | |
| Double_t fDollyDefault; //! default distnce from viewing centre | | Double_t fDollyDefault; //! default distnce from viewing centre | |
| Double_t fDollyDistance; //! unit distance for camera movement in f
wd/bck direction | | Double_t fDollyDistance; //! unit distance for camera movement in f
wd/bck direction | |
| Float_t fVAxisMinAngle; //! minimal allowed angle between up and fC
amTrans Z vector | | Float_t fVAxisMinAngle; //! minimal allowed angle between up and fC
amTrans Z vector | |
| | | | |
| | | | |
| skipping to change at line 123 | | skipping to change at line 125 | |
| | | | |
| virtual Bool_t IsOrthographic() const { return kFALSE; } | | virtual Bool_t IsOrthographic() const { return kFALSE; } | |
| virtual Bool_t IsPerspective() const { return kFALSE; } | | virtual Bool_t IsPerspective() const { return kFALSE; } | |
| | | | |
| const TGLMatrix& RefModelViewMatrix() const { return fModVM; } | | const TGLMatrix& RefModelViewMatrix() const { return fModVM; } | |
| | | | |
| Bool_t IsCacheDirty() const { return fCacheDirty; } | | Bool_t IsCacheDirty() const { return fCacheDirty; } | |
| void IncTimeStamp() { fCacheDirty = kTRUE; ++fTimeStamp; } | | void IncTimeStamp() { fCacheDirty = kTRUE; ++fTimeStamp; } | |
| UInt_t TimeStamp() const { return fTimeStamp; } | | UInt_t TimeStamp() const { return fTimeStamp; } | |
| | | | |
|
| void SetViewport(const TGLRect & viewport); | | void SetViewport(const TGLRect & viewport); | |
| TGLRect& RefViewport() { return fViewport; } | | TGLRect& RefViewport() { return fViewport; } | |
| | | const TGLRect& RefViewport() const { return fViewport; } | |
| | | | |
| // Camera manipulation interface (GL coord - origin bottom left) | | // Camera manipulation interface (GL coord - origin bottom left) | |
| virtual void Setup(const TGLBoundingBox & box, Bool_t reset=kTRUE) = 0
; | | virtual void Setup(const TGLBoundingBox & box, Bool_t reset=kTRUE) = 0
; | |
| virtual void Reset() = 0; | | virtual void Reset() = 0; | |
| | | | |
| virtual Bool_t Dolly(Int_t delta, Bool_t mod1, Bool_t mod2); | | virtual Bool_t Dolly(Int_t delta, Bool_t mod1, Bool_t mod2); | |
| virtual Bool_t Zoom (Int_t delta, Bool_t mod1, Bool_t mod2) = 0; | | virtual Bool_t Zoom (Int_t delta, Bool_t mod1, Bool_t mod2) = 0; | |
| virtual Bool_t Truck(Double_t xDelta, Double_t yDelta); | | virtual Bool_t Truck(Double_t xDelta, Double_t yDelta); | |
| virtual Bool_t Truck(Int_t xDelta, Int_t yDelta, Bool_t mod1, Bool_t mod
2) = 0; | | virtual Bool_t Truck(Int_t xDelta, Int_t yDelta, Bool_t mod1, Bool_t mod
2) = 0; | |
| virtual Bool_t Rotate(Int_t xDelta, Int_t yDelta, Bool_t mod1, Bool_t mo
d2); | | virtual Bool_t Rotate(Int_t xDelta, Int_t yDelta, Bool_t mod1, Bool_t mo
d2); | |
| | | | |
| skipping to change at line 152 | | skipping to change at line 155 | |
| Double_t AdjustDelta(Double_t screenShift, Double_t deltaFactor, | | Double_t AdjustDelta(Double_t screenShift, Double_t deltaFactor, | |
| Bool_t mod1, Bool_t mod2) const; | | Bool_t mod1, Bool_t mod2) const; | |
| | | | |
| void SetExternalCenter(Bool_t x); | | void SetExternalCenter(Bool_t x); | |
| Bool_t GetExternalCenter(){ return fExternalCenter; } | | Bool_t GetExternalCenter(){ return fExternalCenter; } | |
| | | | |
| void SetCenterVec(Double_t x, Double_t y, Double_t z); | | void SetCenterVec(Double_t x, Double_t y, Double_t z); | |
| void SetCenterVecWarp(Double_t x, Double_t y, Double_t z); | | void SetCenterVecWarp(Double_t x, Double_t y, Double_t z); | |
| Double_t* GetCenterVec() { return fCenter->Arr(); } | | Double_t* GetCenterVec() { return fCenter->Arr(); } | |
| | | | |
|
| | | void SetFixDefCenter(Bool_t x) { fFixDefCenter = x; } | |
| | | void SetFixDefCenterVec(Double_t x, Double_t y, Double_t z) { fFDCent | |
| | | er.Set(x, y, z); } | |
| | | Double_t* GetFixDefCenterVec() { return fFDCenter.Arr(); } | |
| | | | |
| Double_t GetNearClip() const { return fNearClip; } | | Double_t GetNearClip() const { return fNearClip; } | |
| Double_t GetFarClip() const { return fFarClip; } | | Double_t GetFarClip() const { return fFarClip; } | |
| | | | |
| const TGLMatrix& GetCamBase() const { return fCamBase; } | | const TGLMatrix& GetCamBase() const { return fCamBase; } | |
| const TGLMatrix& GetCamTrans() const { return fCamTrans; } | | const TGLMatrix& GetCamTrans() const { return fCamTrans; } | |
| // If you manipulate camera ... also call IncTimeStamp() before redraw. | | // If you manipulate camera ... also call IncTimeStamp() before redraw. | |
| TGLMatrix& RefCamBase() { return fCamBase; } | | TGLMatrix& RefCamBase() { return fCamBase; } | |
| TGLMatrix& RefCamTrans() { return fCamTrans; } | | TGLMatrix& RefCamTrans() { return fCamTrans; } | |
| | | | |
| Double_t GetTheta() const; | | Double_t GetTheta() const; | |
| | | | |
| skipping to change at line 192 | | skipping to change at line 199 | |
| TGLVector3 ViewportDeltaToWorld(const TGLVertex3 & worldRef, Double_t vi
ewportXDelta, Double_t viewportYDelta, TGLMatrix* modviewMat=0) const; | | TGLVector3 ViewportDeltaToWorld(const TGLVertex3 & worldRef, Double_t vi
ewportXDelta, Double_t viewportYDelta, TGLMatrix* modviewMat=0) const; | |
| std::pair<Bool_t, TGLVertex3> ViewportPlaneIntersection(Double_t viewpor
tX, Double_t viewportY, const TGLPlane & worldPlane) const; | | std::pair<Bool_t, TGLVertex3> ViewportPlaneIntersection(Double_t viewpor
tX, Double_t viewportY, const TGLPlane & worldPlane) const; | |
| std::pair<Bool_t, TGLVertex3> ViewportPlaneIntersection(const TPoint & v
iewport, const TGLPlane & worldPlane) const; | | std::pair<Bool_t, TGLVertex3> ViewportPlaneIntersection(const TPoint & v
iewport, const TGLPlane & worldPlane) const; | |
| | | | |
| // Window to GL viewport conversion - invert Y | | // Window to GL viewport conversion - invert Y | |
| void WindowToViewport(Int_t & /* x */, Int_t & y) const { y = fViewport.
Height() - y; } | | void WindowToViewport(Int_t & /* x */, Int_t & y) const { y = fViewport.
Height() - y; } | |
| void WindowToViewport(TPoint & point) const { point.SetY(fVi
ewport.Height() - point.GetY()); } | | void WindowToViewport(TPoint & point) const { point.SetY(fVi
ewport.Height() - point.GetY()); } | |
| void WindowToViewport(TGLRect & rect) const { rect.Y() = fVi
ewport.Height() - rect.Y(); } | | void WindowToViewport(TGLRect & rect) const { rect.Y() = fVi
ewport.Height() - rect.Y(); } | |
| void WindowToViewport(TGLVertex3 & vertex) const { vertex.Y() = f
Viewport.Height() - vertex.Y(); } | | void WindowToViewport(TGLVertex3 & vertex) const { vertex.Y() = f
Viewport.Height() - vertex.Y(); } | |
| | | | |
|
| const TGLRect& RefViewport() const { return fViewport; } | | | |
| | | | |
| Float_t GetVAxisMinAngle(){return fVAxisMinAngle;} | | Float_t GetVAxisMinAngle(){return fVAxisMinAngle;} | |
| void SetVAxisMinAngle(Float_t x){fVAxisMinAngle = x;} | | void SetVAxisMinAngle(Float_t x){fVAxisMinAngle = x;} | |
| | | | |
| virtual void Configure(Double_t zoom, Double_t dolly, Double_t center[3]
, | | virtual void Configure(Double_t zoom, Double_t dolly, Double_t center[3]
, | |
| Double_t hRotate, Double_t vRotate) = 0; | | Double_t hRotate, Double_t vRotate) = 0; | |
| // Cameras expanded-frustum interest box | | // Cameras expanded-frustum interest box | |
| Bool_t OfInterest(const TGLBoundingBox & box, Bool_t ignoreSize) const; | | Bool_t OfInterest(const TGLBoundingBox & box, Bool_t ignoreSize) const; | |
| Bool_t UpdateInterest(Bool_t force); | | Bool_t UpdateInterest(Bool_t force); | |
| void ResetInterest(); | | void ResetInterest(); | |
| | | | |
| | | | |
End of changes. 6 change blocks. |
| 5 lines changed or deleted | | 11 lines changed or added | |
|
| TGLUtil.h | | TGLUtil.h | |
|
| // @(#)root/gl:$Id: TGLUtil.h 32785 2010-03-26 15:42:03Z matevz $ | | // @(#)root/gl:$Id: TGLUtil.h 34006 2010-06-21 10:36:05Z matevz $ | |
| // Author: Richard Maunder 25/05/2005 | | // Author: Richard Maunder 25/05/2005 | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| | | | |
| skipping to change at line 970 | | skipping to change at line 970 | |
| static void SetDrawQuality(UInt_t dq); | | static void SetDrawQuality(UInt_t dq); | |
| static void ResetDrawQuality(); | | static void ResetDrawQuality(); | |
| static UInt_t GetDefaultDrawQuality(); | | static UInt_t GetDefaultDrawQuality(); | |
| static void SetDefaultDrawQuality(UInt_t dq); | | static void SetDefaultDrawQuality(UInt_t dq); | |
| | | | |
| static UInt_t LockColor(); | | static UInt_t LockColor(); | |
| static UInt_t UnlockColor(); | | static UInt_t UnlockColor(); | |
| static Bool_t IsColorLocked(); | | static Bool_t IsColorLocked(); | |
| | | | |
| static void Color(const TGLColor& color); | | static void Color(const TGLColor& color); | |
|
| static void Color(const TGLColor& color, UChar_t alpha); | | static void ColorAlpha(const TGLColor& color, UChar_t alpha); | |
| static void Color(const TGLColor& color, Float_t alpha); | | static void ColorAlpha(const TGLColor& color, Float_t alpha); | |
| static void Color(Color_t color_index, Float_t alpha=1); | | static void ColorAlpha(Color_t color_index, Float_t alpha=1); | |
| static void ColorTransparency(Color_t color_index, Char_t transparency=0
); | | static void ColorTransparency(Color_t color_index, Char_t transparency=0
); | |
| static void Color3ub(UChar_t r, UChar_t g, UChar_t b); | | static void Color3ub(UChar_t r, UChar_t g, UChar_t b); | |
| static void Color4ub(UChar_t r, UChar_t g, UChar_t b, UChar_t a); | | static void Color4ub(UChar_t r, UChar_t g, UChar_t b, UChar_t a); | |
| static void Color3ubv(const UChar_t* rgb); | | static void Color3ubv(const UChar_t* rgb); | |
| static void Color4ubv(const UChar_t* rgba); | | static void Color4ubv(const UChar_t* rgba); | |
| static void Color3f(Float_t r, Float_t g, Float_t b); | | static void Color3f(Float_t r, Float_t g, Float_t b); | |
| static void Color4f(Float_t r, Float_t g, Float_t b, Float_t a); | | static void Color4f(Float_t r, Float_t g, Float_t b, Float_t a); | |
| static void Color3fv(const Float_t* rgb); | | static void Color3fv(const Float_t* rgb); | |
| static void Color4fv(const Float_t* rgba); | | static void Color4fv(const Float_t* rgba); | |
| | | | |
| | | | |
| skipping to change at line 997 | | skipping to change at line 997 | |
| | | | |
| static void PointSize(Float_t point_size); | | static void PointSize(Float_t point_size); | |
| static void LineWidth(Float_t line_width); | | static void LineWidth(Float_t line_width); | |
| | | | |
| static Float_t PointSize(); | | static Float_t PointSize(); | |
| static Float_t LineWidth(); | | static Float_t LineWidth(); | |
| | | | |
| static void BeginExtendPickRegion(Float_t scale); | | static void BeginExtendPickRegion(Float_t scale); | |
| static void EndExtendPickRegion(); | | static void EndExtendPickRegion(); | |
| | | | |
|
| static void RenderPolyMarkers(const TAttMarker& marker, Float_t* p, Int_ | | static void RenderPolyMarkers(const TAttMarker& marker, Char_t transp, | |
| t n, | | Float_t* p, Int_t n, | |
| Int_t pick_radius=0, Bool_t selection=kFAL
SE, | | Int_t pick_radius=0, Bool_t selection=kFAL
SE, | |
| Bool_t sec_selection=kFALSE); | | Bool_t sec_selection=kFALSE); | |
|
| static void RenderPoints(const TAttMarker& marker, Float_t* p, Int_t n, | | | |
| | | static void RenderPoints(const TAttMarker& marker, | |
| | | Float_t* p, Int_t n, | |
| Int_t pick_radius=0, Bool_t selection=kFALSE, | | Int_t pick_radius=0, Bool_t selection=kFALSE, | |
| Bool_t sec_selection=kFALSE); | | Bool_t sec_selection=kFALSE); | |
|
| static void RenderCrosses(const TAttMarker& marker, Float_t* p, Int_t n, | | | |
| | | static void RenderCrosses(const TAttMarker& marker, | |
| | | Float_t* p, Int_t n, | |
| Bool_t sec_selection=kFALSE); | | Bool_t sec_selection=kFALSE); | |
|
| static void RenderPolyLine(const TAttLine& aline, Float_t* p, Int_t n, | | | |
| | | static void RenderPolyLine(const TAttLine& aline, Char_t transp, | |
| | | Float_t* p, Int_t n, | |
| Int_t pick_radius=0, Bool_t selection=kFALSE)
; | | Int_t pick_radius=0, Bool_t selection=kFALSE)
; | |
| | | | |
|
| static void BeginAttLine(const TAttLine& aline, Int_t pick_radius=0, Boo | | static void BeginAttLine(const TAttLine& aline, Char_t transp, | |
| l_t selection=kFALSE); | | Int_t pick_radius=0, Bool_t selection=kFALSE); | |
| static void EndAttLine(Int_t pick_radius=0, Bool_t selection=kFALSE); | | static void EndAttLine(Int_t pick_radius=0, Bool_t selection=kFALSE); | |
| | | | |
| // TODO: These draw routines should take LOD hints | | // TODO: These draw routines should take LOD hints | |
|
| static void SetDrawColors(const Float_t rgba[4]); | | static void SetDrawColors(const UChar_t rgba[4]); | |
| static void DrawSphere(const TGLVertex3 & position, Double_t radius, con | | static void DrawSphere(const TGLVertex3 & position, Double_t radius, con | |
| st Float_t rgba[4]); | | st UChar_t rgba[4]); | |
| static void DrawLine(const TGLLine3 & line, ELineHeadShape head, Double_ | | static void DrawLine(const TGLLine3 & line, ELineHeadShape head, Double_ | |
| t size, const Float_t rgba[4]); | | t size, const UChar_t rgba[4]); | |
| static void DrawLine(const TGLVertex3 & start, const TGLVector3 & vector
, ELineHeadShape head, | | static void DrawLine(const TGLVertex3 & start, const TGLVector3 & vector
, ELineHeadShape head, | |
|
| Double_t size, const Float_t rgba[4]); | | Double_t size, const UChar_t rgba[4]); | |
| static void DrawRing(const TGLVertex3 & center, const TGLVector3 & norma
l, | | static void DrawRing(const TGLVertex3 & center, const TGLVector3 & norma
l, | |
|
| Double_t radius, const Float_t* rgba); | | Double_t radius, const UChar_t* rgba); | |
| | | | |
| static void DrawReferenceMarker(const TGLCamera & camera, | | static void DrawReferenceMarker(const TGLCamera & camera, | |
| const TGLVertex3 & pos, | | const TGLVertex3 & pos, | |
| Float_t radius = 3, | | Float_t radius = 3, | |
|
| const Float_t * rgba = 0); | | const UChar_t * rgba = 0); | |
| static void DrawSimpleAxes(const TGLCamera & camera, | | static void DrawSimpleAxes(const TGLCamera & camera, | |
| const TGLBoundingBox & bbox, | | const TGLBoundingBox & bbox, | |
| Int_t axesType); | | Int_t axesType); | |
| static void DrawNumber(const TString & num, | | static void DrawNumber(const TString & num, | |
| const TGLVertex3 & pos, | | const TGLVertex3 & pos, | |
| Bool_t center = kFALSE); | | Bool_t center = kFALSE); | |
| | | | |
|
| | | // Frequently used colors. | |
| | | static const UChar_t fgRed[4]; | |
| | | static const UChar_t fgGreen[4]; | |
| | | static const UChar_t fgBlue[4]; | |
| | | static const UChar_t fgYellow[4]; | |
| | | static const UChar_t fgWhite[4]; | |
| | | static const UChar_t fgGrey[4]; | |
| | | | |
| ClassDef(TGLUtil,0); // Wrapper class for misc GL pieces | | ClassDef(TGLUtil,0); // Wrapper class for misc GL pieces | |
| }; | | }; | |
| | | | |
| /**************************************************************************
/ | | /**************************************************************************
/ | |
| | | | |
| class TGLCapabilitySwitch | | class TGLCapabilitySwitch | |
| { | | { | |
| private: | | private: | |
| TGLCapabilitySwitch(const TGLCapabilitySwitch &); | | TGLCapabilitySwitch(const TGLCapabilitySwitch &); | |
| TGLCapabilitySwitch &operator = (const TGLCapabilitySwitch &); | | TGLCapabilitySwitch &operator = (const TGLCapabilitySwitch &); | |
| | | | |
| skipping to change at line 1053 | | skipping to change at line 1069 | |
| Bool_t fState; | | Bool_t fState; | |
| Bool_t fFlip; | | Bool_t fFlip; | |
| | | | |
| void SetState(Bool_t s); | | void SetState(Bool_t s); | |
| | | | |
| public: | | public: | |
| TGLCapabilitySwitch(Int_t what, Bool_t state); | | TGLCapabilitySwitch(Int_t what, Bool_t state); | |
| ~TGLCapabilitySwitch(); | | ~TGLCapabilitySwitch(); | |
| }; | | }; | |
| | | | |
|
| | | class TGLCapabilityEnabler | |
| | | { | |
| | | private: | |
| | | TGLCapabilityEnabler(const TGLCapabilityEnabler &); | |
| | | TGLCapabilityEnabler &operator = (const TGLCapabilityEnabler &); | |
| | | | |
| | | Int_t fWhat; | |
| | | Bool_t fFlip; | |
| | | | |
| | | public: | |
| | | TGLCapabilityEnabler(Int_t what, Bool_t state); | |
| | | ~TGLCapabilityEnabler(); | |
| | | }; | |
| | | | |
| class TGLFloatHolder | | class TGLFloatHolder | |
| { | | { | |
| TGLFloatHolder(const TGLFloatHolder&); // Not implemented | | TGLFloatHolder(const TGLFloatHolder&); // Not implemented | |
| TGLFloatHolder& operator=(const TGLFloatHolder&); // Not implemented | | TGLFloatHolder& operator=(const TGLFloatHolder&); // Not implemented | |
| | | | |
| Int_t fWhat; | | Int_t fWhat; | |
| Float_t fState; | | Float_t fState; | |
| Bool_t fFlip; | | Bool_t fFlip; | |
| void (*fFoo)(Float_t); | | void (*fFoo)(Float_t); | |
| | | | |
| | | | |
End of changes. 13 change blocks. |
| 19 lines changed or deleted | | 47 lines changed or added | |
|
| TGSlider.h | | TGSlider.h | |
|
| // @(#)root/gui:$Id: TGSlider.h 27642 2009-02-27 16:11:02Z bellenot $ | | // @(#)root/gui:$Id: TGSlider.h 33776 2010-06-08 12:16:54Z bellenot $ | |
| // Author: Fons Rademakers 14/01/98 | | // Author: Fons Rademakers 14/01/98 | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| | | | |
| skipping to change at line 77 | | skipping to change at line 77 | |
| | | | |
| protected: | | protected: | |
| Int_t fPos; // logical position between fVmin and f
Vmax | | Int_t fPos; // logical position between fVmin and f
Vmax | |
| Int_t fRelPos; // slider position in pixel coordinates | | Int_t fRelPos; // slider position in pixel coordinates | |
| Int_t fVmin; // logical lower limit of slider | | Int_t fVmin; // logical lower limit of slider | |
| Int_t fVmax; // logical upper limit of slider | | Int_t fVmax; // logical upper limit of slider | |
| Int_t fType; // slider type bits | | Int_t fType; // slider type bits | |
| Int_t fScale; // tick mark scale | | Int_t fScale; // tick mark scale | |
| Bool_t fDragging; // true if in dragging mode | | Bool_t fDragging; // true if in dragging mode | |
| const TGPicture *fSliderPic; // picture to draw slider | | const TGPicture *fSliderPic; // picture to draw slider | |
|
| | | const TGPicture *fDisabledPic; // picture to draw disabled slider | |
| | | | |
| TString GetTypeString() const; // used in SavePrimitive | | TString GetTypeString() const; // used in SavePrimitive | |
|
| | | virtual void CreateDisabledPicture(); | |
| | | | |
| private: | | private: | |
| TGSlider(const TGSlider&); // not implemented | | TGSlider(const TGSlider&); // not implemented | |
| TGSlider& operator=(const TGSlider&); // not implemented | | TGSlider& operator=(const TGSlider&); // not implemented | |
| | | | |
| public: | | public: | |
| TGSlider(const TGWindow *p = 0, UInt_t w = 1, UInt_t h = 1, | | TGSlider(const TGWindow *p = 0, UInt_t w = 1, UInt_t h = 1, | |
| UInt_t type = kSlider1 | kScaleBoth, Int_t id = -1, | | UInt_t type = kSlider1 | kScaleBoth, Int_t id = -1, | |
| UInt_t options = kChildFrame, | | UInt_t options = kChildFrame, | |
| Pixel_t back = GetDefaultFrameBackground()); | | Pixel_t back = GetDefaultFrameBackground()); | |
| | | | |
| virtual ~TGSlider() { } | | virtual ~TGSlider() { } | |
| | | | |
| virtual Bool_t HandleButton(Event_t *event) = 0; | | virtual Bool_t HandleButton(Event_t *event) = 0; | |
| virtual Bool_t HandleConfigureNotify(Event_t* event) = 0; | | virtual Bool_t HandleConfigureNotify(Event_t* event) = 0; | |
| virtual Bool_t HandleMotion(Event_t *event) = 0; | | virtual Bool_t HandleMotion(Event_t *event) = 0; | |
| | | | |
|
| | | virtual void SetEnabled(Bool_t flag = kTRUE) { SetState( flag ); } | |
| | | //*TOGGLE* *GETTER=IsEnabled | |
| | | virtual void SetState(Bool_t state); | |
| virtual void SetScale(Int_t scale) { fScale = scale; }
//*MENU* | | virtual void SetScale(Int_t scale) { fScale = scale; }
//*MENU* | |
| virtual void SetRange(Int_t min, Int_t max) { fVmin = min; fVmax = max;
} //*MENU* | | virtual void SetRange(Int_t min, Int_t max) { fVmin = min; fVmax = max;
} //*MENU* | |
| virtual void SetPosition(Int_t pos) { fPos = pos; fClient->NeedRedraw(t
his); } //*MENU* | | virtual void SetPosition(Int_t pos) { fPos = pos; fClient->NeedRedraw(t
his); } //*MENU* | |
| virtual Int_t GetPosition() const { return fPos; } | | virtual Int_t GetPosition() const { return fPos; } | |
| virtual Int_t GetMinPosition() const { return fVmin; } | | virtual Int_t GetMinPosition() const { return fVmin; } | |
| virtual Int_t GetMaxPosition() const { return fVmax; } | | virtual Int_t GetMaxPosition() const { return fVmax; } | |
| virtual Int_t GetScale() const { return fScale; } | | virtual Int_t GetScale() const { return fScale; } | |
| virtual void MapSubwindows() { TGWindow::MapSubwindows(); } | | virtual void MapSubwindows() { TGWindow::MapSubwindows(); } | |
| virtual void ChangeSliderPic(const char *name) { | | virtual void ChangeSliderPic(const char *name) { | |
| if (fSliderPic) fClient->FreePicture(fSliderPic); | | if (fSliderPic) fClient->FreePicture(fSliderPic); | |
| | | | |
End of changes. 4 change blocks. |
| 1 lines changed or deleted | | 6 lines changed or added | |
|
| TGeoArb8.h | | TGeoArb8.h | |
|
| // @(#)root/geom:$Id: TGeoArb8.h 27731 2009-03-09 17:40:56Z brun $ | | // @(#)root/geom:$Id: TGeoArb8.h 34058 2010-06-22 12:59:51Z agheata $ | |
| // Author: Andrei Gheata 24/10/01 | | // Author: Andrei Gheata 24/10/01 | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| | | | |
| skipping to change at line 83 | | skipping to change at line 83 | |
| Double_t DistToPlane(Double_t *point, Double_t *dir, Int_t
ipl, Bool_t in) const; | | Double_t DistToPlane(Double_t *point, Double_t *dir, Int_t
ipl, Bool_t in) const; | |
| virtual Double_t DistFromInside(Double_t *point, Double_t *dir, Int
_t iact=1, | | virtual Double_t DistFromInside(Double_t *point, Double_t *dir, Int
_t iact=1, | |
| Double_t step=TGeoShape::Big(), Double_t
*safe=0) const; | | Double_t step=TGeoShape::Big(), Double_t
*safe=0) const; | |
| virtual Double_t DistFromOutside(Double_t *point, Double_t *dir, In
t_t iact=1, | | virtual Double_t DistFromOutside(Double_t *point, Double_t *dir, In
t_t iact=1, | |
| Double_t step=TGeoShape::Big(), Double_t
*safe=0) const; | | Double_t step=TGeoShape::Big(), Double_t
*safe=0) const; | |
| virtual TGeoVolume *Divide(TGeoVolume *voldiv, const char *divname, In
t_t iaxis, Int_t ndiv, | | virtual TGeoVolume *Divide(TGeoVolume *voldiv, const char *divname, In
t_t iaxis, Int_t ndiv, | |
| Double_t start, Double_t step); | | Double_t start, Double_t step); | |
| virtual Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t
&xhi) const; | | virtual Double_t GetAxisRange(Int_t iaxis, Double_t &xlo, Double_t
&xhi) const; | |
| virtual void GetBoundingCylinder(Double_t *param) const; | | virtual void GetBoundingCylinder(Double_t *param) const; | |
| virtual Int_t GetByteCount() const {return 100;} | | virtual Int_t GetByteCount() const {return 100;} | |
|
| | | Double_t GetClosestEdge(Double_t *point, Double_t *vert, In
t_t &isegment) const; | |
| virtual Bool_t GetPointsOnFacet(Int_t /*index*/, Int_t /*npoints*
/, Double_t * /*array*/) const; | | virtual Bool_t GetPointsOnFacet(Int_t /*index*/, Int_t /*npoints*
/, Double_t * /*array*/) const; | |
| Double_t GetDz() const {return fDz;} | | Double_t GetDz() const {return fDz;} | |
| virtual Int_t GetFittingBox(const TGeoBBox *parambox, TGeoMatrix
*mat, Double_t &dx, Double_t &dy, Double_t &dz) const; | | virtual Int_t GetFittingBox(const TGeoBBox *parambox, TGeoMatrix
*mat, Double_t &dx, Double_t &dy, Double_t &dz) const; | |
| virtual TGeoShape *GetMakeRuntimeShape(TGeoShape * /*mother*/, TGeoMa
trix * /*mat*/) const {return 0;} | | virtual TGeoShape *GetMakeRuntimeShape(TGeoShape * /*mother*/, TGeoMa
trix * /*mat*/) const {return 0;} | |
| static void GetPlaneNormal(Double_t *p1, Double_t *p2, Double_
t *p3, Double_t *norm); | | static void GetPlaneNormal(Double_t *p1, Double_t *p2, Double_
t *p3, Double_t *norm); | |
| Double_t *GetVertices() {return &fXY[0][0];} | | Double_t *GetVertices() {return &fXY[0][0];} | |
| Double_t GetTwist(Int_t iseg) const; | | Double_t GetTwist(Int_t iseg) const; | |
| virtual Bool_t IsCylType() const {return kFALSE;} | | virtual Bool_t IsCylType() const {return kFALSE;} | |
| static Bool_t IsSamePoint(Double_t *p1, Double_t *p2) {return (T
Math::Abs(p1[0]-p2[0])<1.E-16 && TMath::Abs(p1[1]-p2[1])<1.E-16)?kTRUE:kFAL
SE;} | | static Bool_t IsSamePoint(Double_t *p1, Double_t *p2) {return (T
Math::Abs(p1[0]-p2[0])<1.E-16 && TMath::Abs(p1[1]-p2[1])<1.E-16)?kTRUE:kFAL
SE;} | |
| static Bool_t InsidePolygon(Double_t x, Double_t y, Double_t *pt
s); | | static Bool_t InsidePolygon(Double_t x, Double_t y, Double_t *pt
s); | |
| | | | |
End of changes. 2 change blocks. |
| 1 lines changed or deleted | | 2 lines changed or added | |
|
| TProof.h | | TProof.h | |
|
| // @(#)root/proof:$Id: TProof.h 33209 2010-04-26 10:27:40Z ganis $ | | // @(#)root/proof:$Id: TProof.h 34101 2010-06-24 12:12:59Z ganis $ | |
| // Author: Fons Rademakers 13/02/97 | | // Author: Fons Rademakers 13/02/97 | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| | | | |
| skipping to change at line 125 | | skipping to change at line 125 | |
| // 19 -> 20: Fix the asynchronous mode (required changes in some messages) | | // 19 -> 20: Fix the asynchronous mode (required changes in some messages) | |
| // 20 -> 21: Add support for session queuing | | // 20 -> 21: Add support for session queuing | |
| // 21 -> 22: Add support for switching from sync to async while running ('C
trl-Z' functionality) | | // 21 -> 22: Add support for switching from sync to async while running ('C
trl-Z' functionality) | |
| // 22 -> 23: New dataset features (default tree name; classification per fi
leserver) | | // 22 -> 23: New dataset features (default tree name; classification per fi
leserver) | |
| // 23 -> 24: Merging optimization | | // 23 -> 24: Merging optimization | |
| // 24 -> 25: Handling of 'data' dir; group information | | // 24 -> 25: Handling of 'data' dir; group information | |
| // 25 -> 26: Use new TProofProgressInfo class | | // 25 -> 26: Use new TProofProgressInfo class | |
| // 26 -> 27: Use new file for updating the session status | | // 26 -> 27: Use new file for updating the session status | |
| // 27 -> 28: Support for multi-datasets, fix global pack dirs, fix AskStati
stics, | | // 27 -> 28: Support for multi-datasets, fix global pack dirs, fix AskStati
stics, | |
| // package download, dataset caching | | // package download, dataset caching | |
|
| | | // 28 -> 29: Support for config parameters in EnablePackage, idle-timeout | |
| | | | |
| // PROOF magic constants | | // PROOF magic constants | |
|
| const Int_t kPROOF_Protocol = 28; // protocol versi
on number | | const Int_t kPROOF_Protocol = 29; // protocol versi
on number | |
| const Int_t kPROOF_Port = 1093; // IANA registere
d PROOF port | | const Int_t kPROOF_Port = 1093; // IANA registere
d PROOF port | |
| const char* const kPROOF_ConfFile = "proof.conf"; // default config
file | | const char* const kPROOF_ConfFile = "proof.conf"; // default config
file | |
| const char* const kPROOF_ConfDir = "/usr/local/root"; // default c
onfig dir | | const char* const kPROOF_ConfDir = "/usr/local/root"; // default c
onfig dir | |
| const char* const kPROOF_WorkDir = ".proof"; // default workin
g directory | | const char* const kPROOF_WorkDir = ".proof"; // default workin
g directory | |
| const char* const kPROOF_CacheDir = "cache"; // file cache dir
, under WorkDir | | const char* const kPROOF_CacheDir = "cache"; // file cache dir
, under WorkDir | |
| const char* const kPROOF_PackDir = "packages"; // package dir, u
nder WorkDir | | const char* const kPROOF_PackDir = "packages"; // package dir, u
nder WorkDir | |
| const char* const kPROOF_PackDownloadDir = "downloaded"; // subdir with do
wnloaded PARs, under PackDir | | const char* const kPROOF_PackDownloadDir = "downloaded"; // subdir with do
wnloaded PARs, under PackDir | |
| const char* const kPROOF_QueryDir = "queries"; // query dir, und
er WorkDir | | const char* const kPROOF_QueryDir = "queries"; // query dir, und
er WorkDir | |
| const char* const kPROOF_DataSetDir = "datasets"; // dataset dir, u
nder WorkDir | | const char* const kPROOF_DataSetDir = "datasets"; // dataset dir, u
nder WorkDir | |
| const char* const kPROOF_DataDir = "data"; // dir for produc
ed data, under WorkDir | | const char* const kPROOF_DataDir = "data"; // dir for produc
ed data, under WorkDir | |
| const char* const kPROOF_CacheLockFile = "proof-cache-lock-"; // cache
lock file | | const char* const kPROOF_CacheLockFile = "proof-cache-lock-"; // cache
lock file | |
| const char* const kPROOF_PackageLockFile = "proof-package-lock-"; // packag
e lock file | | const char* const kPROOF_PackageLockFile = "proof-package-lock-"; // packag
e lock file | |
| const char* const kPROOF_QueryLockFile = "proof-query-lock-"; // query
lock file | | const char* const kPROOF_QueryLockFile = "proof-query-lock-"; // query
lock file | |
| const char* const kPROOF_TerminateWorker = "+++ terminating +++"; // signal
worker termination in MarkBad | | const char* const kPROOF_TerminateWorker = "+++ terminating +++"; // signal
worker termination in MarkBad | |
|
| | | const char* const kPROOF_WorkerIdleTO = "+++ idle-timeout +++"; // signa
l worker idle timeout in MarkBad | |
| const char* const kPROOF_InputDataFile = "inputdata.root"; // Defaul
t input data file name | | const char* const kPROOF_InputDataFile = "inputdata.root"; // Defaul
t input data file name | |
| | | | |
| #ifndef R__WIN32 | | #ifndef R__WIN32 | |
| const char* const kCP = "/bin/cp -fp"; | | const char* const kCP = "/bin/cp -fp"; | |
| const char* const kRM = "/bin/rm -rf"; | | const char* const kRM = "/bin/rm -rf"; | |
| const char* const kLS = "/bin/ls -l"; | | const char* const kLS = "/bin/ls -l"; | |
| const char* const kUNTAR = "%s -c %s/%s | (cd %s; tar xf -)"; | | const char* const kUNTAR = "%s -c %s/%s | (cd %s; tar xf -)"; | |
| const char* const kUNTAR2 = "%s -c %s | (cd %s; tar xf -)"; | | const char* const kUNTAR2 = "%s -c %s | (cd %s; tar xf -)"; | |
| const char* const kUNTAR3 = "%s -c %s | (tar xf -)"; | | const char* const kUNTAR3 = "%s -c %s | (tar xf -)"; | |
| const char* const kGUNZIP = "gunzip"; | | const char* const kGUNZIP = "gunzip"; | |
| | | | |
| skipping to change at line 344 | | skipping to change at line 346 | |
| friend class TXProofMgr; // to access EUrgent | | friend class TXProofMgr; // to access EUrgent | |
| friend class TXProofServ; // to access EUrgent | | friend class TXProofServ; // to access EUrgent | |
| | | | |
| public: | | public: | |
| // PROOF status bits | | // PROOF status bits | |
| enum EStatusBits { | | enum EStatusBits { | |
| kUsingSessionGui = BIT(14), | | kUsingSessionGui = BIT(14), | |
| kNewInputData = BIT(15), | | kNewInputData = BIT(15), | |
| kIsClient = BIT(16), | | kIsClient = BIT(16), | |
| kIsMaster = BIT(17), | | kIsMaster = BIT(17), | |
|
| kIsTopMaster = BIT(18) | | kIsTopMaster = BIT(18), | |
| | | kUseProgressDialog = BIT(19) | |
| }; | | }; | |
| enum EQueryMode { | | enum EQueryMode { | |
| kSync = 0, | | kSync = 0, | |
| kAsync = 1 | | kAsync = 1 | |
| }; | | }; | |
| enum EUploadOpt { | | enum EUploadOpt { | |
| kAppend = 0x1, | | kAppend = 0x1, | |
| kOverwriteDataSet = 0x2, | | kOverwriteDataSet = 0x2, | |
| kNoOverwriteDataSet = 0x4, | | kNoOverwriteDataSet = 0x4, | |
| kOverwriteAllFiles = 0x8, | | kOverwriteAllFiles = 0x8, | |
| | | | |
| skipping to change at line 587 | | skipping to change at line 590 | |
| private: | | private: | |
| TProof(const TProof &); // not implemented | | TProof(const TProof &); // not implemented | |
| void operator=(const TProof &); // idem | | void operator=(const TProof &); // idem | |
| | | | |
| void CleanGDirectory(TList *ol); | | void CleanGDirectory(TList *ol); | |
| | | | |
| Int_t Exec(const char *cmd, ESlaves list, Bool_t plusMaster); | | Int_t Exec(const char *cmd, ESlaves list, Bool_t plusMaster); | |
| Int_t SendCommand(const char *cmd, ESlaves list = kActive); | | Int_t SendCommand(const char *cmd, ESlaves list = kActive); | |
| Int_t SendCurrentState(ESlaves list = kActive); | | Int_t SendCurrentState(ESlaves list = kActive); | |
| Bool_t CheckFile(const char *file, TSlave *sl, Long_t modtime, Int_t c
popt = (kCp | kCpBin)); | | Bool_t CheckFile(const char *file, TSlave *sl, Long_t modtime, Int_t c
popt = (kCp | kCpBin)); | |
|
| Int_t SendFile(const char *file, Int_t opt = (kBinary | kForward | kC | | | |
| p | kCpBin), | | | |
| const char *rfile = 0, TSlave *sl = 0); | | | |
| Int_t SendObject(const TObject *obj, ESlaves list = kActive); | | Int_t SendObject(const TObject *obj, ESlaves list = kActive); | |
| Int_t SendGroupView(); | | Int_t SendGroupView(); | |
| Int_t SendInitialState(); | | Int_t SendInitialState(); | |
| Int_t SendPrint(Option_t *option=""); | | Int_t SendPrint(Option_t *option=""); | |
| Int_t Ping(ESlaves list); | | Int_t Ping(ESlaves list); | |
| void Interrupt(EUrgent type, ESlaves list = kActive); | | void Interrupt(EUrgent type, ESlaves list = kActive); | |
| void AskStatistics(); | | void AskStatistics(); | |
| void AskParallel(); | | void AskParallel(); | |
| Int_t GoParallel(Int_t nodes, Bool_t accept = kFALSE, Bool_t random =
kFALSE); | | Int_t GoParallel(Int_t nodes, Bool_t accept = kFALSE, Bool_t random =
kFALSE); | |
| Int_t SetParallelSilent(Int_t nodes, Bool_t random = kFALSE); | | Int_t SetParallelSilent(Int_t nodes, Bool_t random = kFALSE); | |
| void RecvLogFile(TSocket *s, Int_t size); | | void RecvLogFile(TSocket *s, Int_t size); | |
| void NotifyLogMsg(const char *msg, const char *sfx = "\n"); | | void NotifyLogMsg(const char *msg, const char *sfx = "\n"); | |
| Int_t BuildPackage(const char *package, EBuildPackageOpt opt = kBuild
All); | | Int_t BuildPackage(const char *package, EBuildPackageOpt opt = kBuild
All); | |
| Int_t BuildPackageOnClient(const char *package, Int_t opt = 0, TStrin
g *path = 0); | | Int_t BuildPackageOnClient(const char *package, Int_t opt = 0, TStrin
g *path = 0); | |
|
| Int_t LoadPackage(const char *package, Bool_t notOnClient = kFALSE); | | Int_t LoadPackage(const char *package, Bool_t notOnClient = kFALSE, T | |
| Int_t LoadPackageOnClient(const char *package); | | List *loadopts = 0); | |
| | | Int_t LoadPackageOnClient(const char *package, TList *loadopts = 0); | |
| Int_t UnloadPackage(const char *package); | | Int_t UnloadPackage(const char *package); | |
| Int_t UnloadPackageOnClient(const char *package); | | Int_t UnloadPackageOnClient(const char *package); | |
| Int_t UnloadPackages(); | | Int_t UnloadPackages(); | |
| Int_t UploadPackageOnClient(const char *package, EUploadPackageOpt op
t, TMD5 *md5); | | Int_t UploadPackageOnClient(const char *package, EUploadPackageOpt op
t, TMD5 *md5); | |
| Int_t DisablePackage(const char *package); | | Int_t DisablePackage(const char *package); | |
| Int_t DisablePackageOnClient(const char *package); | | Int_t DisablePackageOnClient(const char *package); | |
| Int_t DisablePackages(); | | Int_t DisablePackages(); | |
| | | | |
| void Activate(TList *slaves = 0); | | void Activate(TList *slaves = 0); | |
| Int_t Broadcast(const TMessage &mess, TList *slaves); | | Int_t Broadcast(const TMessage &mess, TList *slaves); | |
| | | | |
| skipping to change at line 723 | | skipping to change at line 724 | |
| Int_t Collect(TList *slaves, Long_t timeout = -1, Int_t endtype = -1)
; | | Int_t Collect(TList *slaves, Long_t timeout = -1, Int_t endtype = -1)
; | |
| | | | |
| void SetDSet(TDSet *dset) { fDSet = dset; } | | void SetDSet(TDSet *dset) { fDSet = dset; } | |
| virtual void ValidateDSet(TDSet *dset); | | virtual void ValidateDSet(TDSet *dset); | |
| | | | |
| TPluginHandler *GetProgressDialog() const { return fProgressDialog; } | | TPluginHandler *GetProgressDialog() const { return fProgressDialog; } | |
| | | | |
| Int_t AssertPath(const char *path, Bool_t writable); | | Int_t AssertPath(const char *path, Bool_t writable); | |
| | | | |
| void PrepareInputDataFile(TString &dataFile); | | void PrepareInputDataFile(TString &dataFile); | |
|
| virtual void SendInputDataFile(); | | virtual void SendInputDataFile(); | |
| | | Int_t SendFile(const char *file, Int_t opt = (kBinary | kForward | kCp | | |
| | | kCpBin), | |
| | | const char *rfile = 0, TSlave *sl = 0); | |
| | | | |
| static void *SlaveStartupThread(void *arg); | | static void *SlaveStartupThread(void *arg); | |
| | | | |
| static Int_t AssertDataSet(TDSet *dset, TList *input, | | static Int_t AssertDataSet(TDSet *dset, TList *input, | |
| TDataSetManager *mgr, TString &emsg); | | TDataSetManager *mgr, TString &emsg); | |
| // Input data handling | | // Input data handling | |
| static Int_t GetInputData(TList *input, const char *cachedir, TString &e
msg); | | static Int_t GetInputData(TList *input, const char *cachedir, TString &e
msg); | |
| static Int_t SaveInputData(TQueryResult *qr, const char *cachedir, TStri
ng &emsg); | | static Int_t SaveInputData(TQueryResult *qr, const char *cachedir, TStri
ng &emsg); | |
| static Int_t SendInputData(TQueryResult *qr, TProof *p, TString &emsg); | | static Int_t SendInputData(TQueryResult *qr, TProof *p, TString &emsg); | |
| | | | |
| | | | |
| skipping to change at line 794 | | skipping to change at line 797 | |
| void StopProcess(Bool_t abort, Int_t timeout = -1); | | void StopProcess(Bool_t abort, Int_t timeout = -1); | |
| void Browse(TBrowser *b); | | void Browse(TBrowser *b); | |
| | | | |
| Int_t SetParallel(Int_t nodes = 9999, Bool_t random = kFALSE); | | Int_t SetParallel(Int_t nodes = 9999, Bool_t random = kFALSE); | |
| void SetLogLevel(Int_t level, UInt_t mask = TProofDebug::kAll); | | void SetLogLevel(Int_t level, UInt_t mask = TProofDebug::kAll); | |
| | | | |
| void Close(Option_t *option=""); | | void Close(Option_t *option=""); | |
| virtual void Print(Option_t *option="") const; | | virtual void Print(Option_t *option="") const; | |
| | | | |
| //-- cache and package management | | //-- cache and package management | |
|
| virtual void ShowCache(Bool_t all = kFALSE); | | virtual void ShowCache(Bool_t all = kFALSE); | |
| virtual void ClearCache(const char *file = 0); | | virtual void ClearCache(const char *file = 0); | |
| TList *GetListOfPackages(); | | TList *GetListOfPackages(); | |
| TList *GetListOfEnabledPackages(); | | TList *GetListOfEnabledPackages(); | |
| void ShowPackages(Bool_t all = kFALSE, Bool_t redirlog = kFALSE); | | void ShowPackages(Bool_t all = kFALSE, Bool_t redirlog = kFALSE | |
| void ShowEnabledPackages(Bool_t all = kFALSE); | | ); | |
| Int_t ClearPackages(); | | void ShowEnabledPackages(Bool_t all = kFALSE); | |
| Int_t ClearPackage(const char *package); | | Int_t ClearPackages(); | |
| Int_t DownloadPackage(const char *par, const char *dstdir = 0); | | Int_t ClearPackage(const char *package); | |
| Int_t EnablePackage(const char *package, Bool_t notOnClient = kFAL | | Int_t DownloadPackage(const char *par, const char *dstdir = 0); | |
| SE); | | Int_t EnablePackage(const char *package, Bool_t notOnClient = kF | |
| Int_t UploadPackage(const char *par, EUploadPackageOpt opt = kUnta | | ALSE); | |
| r); | | Int_t EnablePackage(const char *package, const char *loadopts, | |
| Int_t Load(const char *macro, Bool_t notOnClient = kFALSE, Bool_t | | Bool_t notOnClient = kFALSE); | |
| uniqueOnly = kTRUE, | | Int_t EnablePackage(const char *package, TList *loadopts, | |
| TList *wrks = 0); | | Bool_t notOnClient = kFALSE); | |
| | | Int_t UploadPackage(const char *par, EUploadPackageOpt opt = kUn | |
| | | tar); | |
| | | virtual Int_t Load(const char *macro, Bool_t notOnClient = kFALSE, Bool_ | |
| | | t uniqueOnly = kTRUE, | |
| | | TList *wrks = 0); | |
| | | | |
| Int_t AddDynamicPath(const char *libpath, Bool_t onClient = kFALSE
, TList *wrks = 0); | | Int_t AddDynamicPath(const char *libpath, Bool_t onClient = kFALSE
, TList *wrks = 0); | |
| Int_t AddIncludePath(const char *incpath, Bool_t onClient = kFALSE
, TList *wrks = 0); | | Int_t AddIncludePath(const char *incpath, Bool_t onClient = kFALSE
, TList *wrks = 0); | |
| Int_t RemoveDynamicPath(const char *libpath, Bool_t onClient = kFA
LSE); | | Int_t RemoveDynamicPath(const char *libpath, Bool_t onClient = kFA
LSE); | |
| Int_t RemoveIncludePath(const char *incpath, Bool_t onClient = kFA
LSE); | | Int_t RemoveIncludePath(const char *incpath, Bool_t onClient = kFA
LSE); | |
| | | | |
| //-- dataset management | | //-- dataset management | |
| Int_t UploadDataSet(const char *dataset, | | Int_t UploadDataSet(const char *dataset, | |
| TList *files, | | TList *files, | |
| const char *dest = 0, | | const char *dest = 0, | |
| | | | |
| skipping to change at line 838 | | skipping to change at line 845 | |
| TList *skippedFiles = 0); | | TList *skippedFiles = 0); | |
| virtual Bool_t RegisterDataSet(const char *name, | | virtual Bool_t RegisterDataSet(const char *name, | |
| TFileCollection *dataset, const char* optStr
= ""); | | TFileCollection *dataset, const char* optStr
= ""); | |
| virtual TMap *GetDataSets(const char *uri = "", const char* optStr = "")
; | | virtual TMap *GetDataSets(const char *uri = "", const char* optStr = "")
; | |
| virtual void ShowDataSets(const char *uri = "", const char* optStr = ""
); | | virtual void ShowDataSets(const char *uri = "", const char* optStr = ""
); | |
| | | | |
| TMap *GetDataSetQuota(const char* optStr = ""); | | TMap *GetDataSetQuota(const char* optStr = ""); | |
| void ShowDataSetQuota(Option_t* opt = 0); | | void ShowDataSetQuota(Option_t* opt = 0); | |
| | | | |
| virtual Bool_t ExistsDataSet(const char *dataset); | | virtual Bool_t ExistsDataSet(const char *dataset); | |
|
| void ShowDataSet(const char *dataset = "", const char* opt = "M") | | void ShowDataSet(const char *dataset = "", const char* opt = " | |
| ; | | M"); | |
| virtual Int_t RemoveDataSet(const char *dataset, const char* optStr = "" | | virtual Int_t RemoveDataSet(const char *dataset, const char* optStr = " | |
| ); | | "); | |
| virtual Int_t VerifyDataSet(const char *dataset, const char* optStr = "" | | virtual Int_t VerifyDataSet(const char *dataset, const char* optStr = " | |
| ); | | "); | |
| virtual TFileCollection *GetDataSet(const char *dataset, const char* opt
Str = ""); | | virtual TFileCollection *GetDataSet(const char *dataset, const char* opt
Str = ""); | |
|
| TList *FindDataSets(const char *searchString, const char* optStr =
""); | | TList *FindDataSets(const char *searchString, const char* optStr
= ""); | |
| | | | |
| virtual Int_t SetDataSetTreeName( const char *dataset, const char *treen
ame); | | virtual Int_t SetDataSetTreeName( const char *dataset, const char *treen
ame); | |
| | | | |
| virtual void ShowDataSetCache(const char *dataset = 0); | | virtual void ShowDataSetCache(const char *dataset = 0); | |
| virtual void ClearDataSetCache(const char *dataset = 0); | | virtual void ClearDataSetCache(const char *dataset = 0); | |
| | | | |
| void ShowData(); | | void ShowData(); | |
| void ClearData(UInt_t what = kUnregistered, const char *dsname =
0); | | void ClearData(UInt_t what = kUnregistered, const char *dsname =
0); | |
| | | | |
| const char *GetMaster() const { return fMaster; } | | const char *GetMaster() const { return fMaster; } | |
| | | | |
| skipping to change at line 990 | | skipping to change at line 997 | |
| void SetManager(TProofMgr *mgr); | | void SetManager(TProofMgr *mgr); | |
| | | | |
| void ActivateWorker(const char *ord); | | void ActivateWorker(const char *ord); | |
| void DeactivateWorker(const char *ord); | | void DeactivateWorker(const char *ord); | |
| | | | |
| const char *GetDataPoolUrl() const { return fDataPoolUrl; } | | const char *GetDataPoolUrl() const { return fDataPoolUrl; } | |
| void SetDataPoolUrl(const char *url) { fDataPoolUrl = url; } | | void SetDataPoolUrl(const char *url) { fDataPoolUrl = url; } | |
| | | | |
| void SetPrintProgress(PrintProgress_t pp) { fPrintProgress = pp;
} | | void SetPrintProgress(PrintProgress_t pp) { fPrintProgress = pp;
} | |
| | | | |
|
| | | void SetProgressDialog(Bool_t on = kTRUE); | |
| | | | |
| // Opening and managing PROOF connections | | // Opening and managing PROOF connections | |
| static TProof *Open(const char *url = 0, const char *conffile = 0, | | static TProof *Open(const char *url = 0, const char *conffile = 0, | |
| const char *confdir = 0, Int_t loglevel = 0); | | const char *confdir = 0, Int_t loglevel = 0); | |
| static void LogViewer(const char *url = 0, Int_t sessionidx = 0
); | | static void LogViewer(const char *url = 0, Int_t sessionidx = 0
); | |
| static TProofMgr *Mgr(const char *url); | | static TProofMgr *Mgr(const char *url); | |
| static void Reset(const char *url, Bool_t hard = kFALSE); | | static void Reset(const char *url, Bool_t hard = kFALSE); | |
| | | | |
| static void AddEnvVar(const char *name, const char *value); | | static void AddEnvVar(const char *name, const char *value); | |
| static void DelEnvVar(const char *name); | | static void DelEnvVar(const char *name); | |
| static const TList *GetEnvVars(); | | static const TList *GetEnvVars(); | |
| | | | |
End of changes. 12 change blocks. |
| 32 lines changed or deleted | | 43 lines changed or added | |
|
| TProofLite.h | | TProofLite.h | |
|
| // @(#)root/proof:$Id: TProofLite.h 33209 2010-04-26 10:27:40Z ganis $ | | // @(#)root/proof:$Id: TProofLite.h 33692 2010-06-01 11:15:30Z ganis $ | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| #ifndef ROOT_TProofLite | | #ifndef ROOT_TProofLite | |
| #define ROOT_TProofLite | | #define ROOT_TProofLite | |
| | | | |
| skipping to change at line 36 | | skipping to change at line 36 | |
| #endif | | #endif | |
| | | | |
| class TDSet; | | class TDSet; | |
| class TList; | | class TList; | |
| class TQueryResultManager; | | class TQueryResultManager; | |
| class TDataSetManager; | | class TDataSetManager; | |
| class TProofLockPath; | | class TProofLockPath; | |
| class TProofMgr; | | class TProofMgr; | |
| class TProofQueryResult; | | class TProofQueryResult; | |
| class TServerSocket; | | class TServerSocket; | |
|
| | | class TSelector; | |
| | | | |
| class TProofLite : public TProof { | | class TProofLite : public TProof { | |
| | | | |
| friend class TProofPlayerLite; | | friend class TProofPlayerLite; | |
| | | | |
| private: | | private: | |
| Int_t fNWorkers; // Number of workers | | Int_t fNWorkers; // Number of workers | |
|
| | | TString fSandbox; // PROOF sandbox root dir | |
| TString fCacheDir; // Directory containing cache of user files | | TString fCacheDir; // Directory containing cache of user files | |
| TString fQueryDir; // Directory containing query results and status | | TString fQueryDir; // Directory containing query results and status | |
| TString fDataSetDir; // Directory containing info about known data set
s | | TString fDataSetDir; // Directory containing info about known data set
s | |
| TString fSockPath; // UNIX socket path for communication with worker
s | | TString fSockPath; // UNIX socket path for communication with worker
s | |
| TServerSocket *fServSock; // Server socket to accept call backs | | TServerSocket *fServSock; // Server socket to accept call backs | |
| Bool_t fForkStartup; // Startup N-1 workers forking the first worker | | Bool_t fForkStartup; // Startup N-1 workers forking the first worker | |
| | | | |
|
| TProofLockPath *fCacheLock; //cache dir locker | | TProofLockPath *fCacheLock; // Cache dir locker | |
| TProofLockPath *fQueryLock; // Query dir locker | | TProofLockPath *fQueryLock; // Query dir locker | |
| TQueryResultManager *fQMgr; // Query-result manager | | TQueryResultManager *fQMgr; // Query-result manager | |
| | | | |
|
| TDataSetManager* fDataSetManager; // dataset manager | | TDataSetManager *fDataSetManager; // Dataset manager | |
| | | | |
| static Int_t fgWrksMax; // Max number of workers | | static Int_t fgWrksMax; // Max number of workers | |
| | | | |
| TProofLite(const TProofLite &); // not implemented | | TProofLite(const TProofLite &); // not implemented | |
|
| void operator=(const TProofLite &); // idem | | void operator=(const TProofLite &); // idem | |
| | | | |
| Int_t CleanupSandbox(); | | Int_t CleanupSandbox(); | |
| Int_t CreateSandbox(); | | Int_t CreateSandbox(); | |
| void NotifyStartUp(const char *action, Int_t done, Int_t tot); | | void NotifyStartUp(const char *action, Int_t done, Int_t tot); | |
| Int_t SetProofServEnv(const char *ord); | | Int_t SetProofServEnv(const char *ord); | |
| Int_t InitDataSetManager(); | | Int_t InitDataSetManager(); | |
| void ResolveKeywords(TString &s, const char *logfile); | | void ResolveKeywords(TString &s, const char *logfile); | |
| | | | |
| void SendInputDataFile(); | | void SendInputDataFile(); | |
| | | | |
| protected: | | protected: | |
| TProofLite() : TProof() { } // For derived classes to use | | TProofLite() : TProof() { } // For derived classes to use | |
| | | | |
|
| Int_t CreateSymLinks(TList *files); | | Int_t CreateSymLinks(TList *files); | |
| Int_t Init(const char *masterurl, const char *conffile, | | Int_t Init(const char *masterurl, const char *conffile, | |
| const char *confdir, Int_t loglevel, | | const char *confdir, Int_t loglevel, | |
| const char *alias = 0); | | const char *alias = 0); | |
| TProofQueryResult *MakeQueryResult(Long64_t nent, const char *opt, | | TProofQueryResult *MakeQueryResult(Long64_t nent, const char *opt, | |
| Long64_t fst, TDSet *dset, | | Long64_t fst, TDSet *dset, | |
| const char *selec); | | const char *selec); | |
| void SetQueryRunning(TProofQueryResult *pq); | | void SetQueryRunning(TProofQueryResult *pq); | |
| Int_t SetupWorkers(Int_t opt = 0, TList *wrks = 0); | | Int_t SetupWorkers(Int_t opt = 0, TList *wrks = 0); | |
|
| | | Int_t CopyMacroToCache(const char *macro, Int_t headerRequired = 0, | |
| | | TSelector **selector = 0, Int_t opt = 0); | |
| | | | |
| public: | | public: | |
| TProofLite(const char *masterurl, const char *conffile = kPROOF_ConfFile
, | | TProofLite(const char *masterurl, const char *conffile = kPROOF_ConfFile
, | |
| const char *confdir = kPROOF_ConfDir, Int_t loglevel = 0, | | const char *confdir = kPROOF_ConfDir, Int_t loglevel = 0, | |
| const char *alias = 0, TProofMgr *mgr = 0); | | const char *alias = 0, TProofMgr *mgr = 0); | |
| virtual ~TProofLite(); | | virtual ~TProofLite(); | |
| | | | |
| void Print(Option_t *option="") const; | | void Print(Option_t *option="") const; | |
| | | | |
| Long64_t DrawSelect(TDSet *dset, const char *varexp, | | Long64_t DrawSelect(TDSet *dset, const char *varexp, | |
| | | | |
| skipping to change at line 107 | | skipping to change at line 111 | |
| Long64_t Process(TFileCollection *fc, const char *sel, Option_t *o = "", | | Long64_t Process(TFileCollection *fc, const char *sel, Option_t *o = "", | |
| Long64_t nent = -1, Long64_t fst = 0) | | Long64_t nent = -1, Long64_t fst = 0) | |
| { return TProof::Process(fc, sel, o, nent, fst); } | | { return TProof::Process(fc, sel, o, nent, fst); } | |
| Long64_t Process(const char *dsname, const char *sel, Option_t *o = "", | | Long64_t Process(const char *dsname, const char *sel, Option_t *o = "", | |
| Long64_t nent = -1, Long64_t fst = 0, TObject *enl = 0) | | Long64_t nent = -1, Long64_t fst = 0, TObject *enl = 0) | |
| { return TProof::Process(dsname, sel, o, nent, fst, enl
); } | | { return TProof::Process(dsname, sel, o, nent, fst, enl
); } | |
| Long64_t Process(const char *sel, Long64_t nent, Option_t *o = "") | | Long64_t Process(const char *sel, Long64_t nent, Option_t *o = "") | |
| { return TProof::Process(sel, nent, o); } | | { return TProof::Process(sel, nent, o); } | |
| | | | |
| // Cache management | | // Cache management | |
|
| void ShowCache(Bool_t all = kFALSE); | | void ShowCache(Bool_t all = kFALSE); | |
| void ClearCache(const char *file = 0); | | void ClearCache(const char *file = 0); | |
| | | Int_t Load(const char *macro, Bool_t notOnClient = kFALSE, Bool_t unique | |
| | | Only = kTRUE, | |
| | | TList *wrks = 0); | |
| | | | |
| // Query management | | // Query management | |
| TList *GetListOfQueries(Option_t *opt = ""); | | TList *GetListOfQueries(Option_t *opt = ""); | |
| Int_t Remove(const char *ref, Bool_t all); | | Int_t Remove(const char *ref, Bool_t all); | |
| | | | |
| // Dataset handling | | // Dataset handling | |
| Bool_t RegisterDataSet(const char *dsName, TFileCollection *ds, const
char *opt = ""); | | Bool_t RegisterDataSet(const char *dsName, TFileCollection *ds, const
char *opt = ""); | |
| Bool_t ExistsDataSet(const char *uri); | | Bool_t ExistsDataSet(const char *uri); | |
| TMap *GetDataSets(const char *uri = "", const char * = 0); | | TMap *GetDataSets(const char *uri = "", const char * = 0); | |
| void ShowDataSets(const char *uri = "", const char * = 0); | | void ShowDataSets(const char *uri = "", const char * = 0); | |
| | | | |
| skipping to change at line 131 | | skipping to change at line 137 | |
| Int_t VerifyDataSet(const char *uri, const char * = 0); | | Int_t VerifyDataSet(const char *uri, const char * = 0); | |
| Int_t SetDataSetTreeName( const char *dataset, const char *treename); | | Int_t SetDataSetTreeName( const char *dataset, const char *treename); | |
| void ShowDataSetCache(const char *dataset = 0); | | void ShowDataSetCache(const char *dataset = 0); | |
| void ClearDataSetCache(const char *dataset = 0); | | void ClearDataSetCache(const char *dataset = 0); | |
| | | | |
| // Browsing | | // Browsing | |
| TTree *GetTreeHeader(TDSet *tdset); | | TTree *GetTreeHeader(TDSet *tdset); | |
| | | | |
| static Int_t GetNumberOfWorkers(const char *url = 0); | | static Int_t GetNumberOfWorkers(const char *url = 0); | |
| | | | |
|
| ClassDef(TProofLite,0) //PROOF control class | | ClassDef(TProofLite,0) //PROOF-Lite control class | |
| }; | | }; | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 10 change blocks. |
| 8 lines changed or deleted | | 15 lines changed or added | |
|
| TProofPlayer.h | | TProofPlayer.h | |
|
| // @(#)root/proofplayer:$Id: TProofPlayer.h 31505 2009-12-02 13:20:06Z brun
$ | | // @(#)root/proofplayer:$Id: TProofPlayer.h 34081 2010-06-23 10:59:01Z gani
s $ | |
| // Author: Maarten Ballintijn 07/01/02 | | // Author: Maarten Ballintijn 07/01/02 | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2001, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2001, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| | | | |
| skipping to change at line 124 | | skipping to change at line 124 | |
| | | | |
| protected: | | protected: | |
| class TCleanup { | | class TCleanup { | |
| private: | | private: | |
| TProofPlayer *fPlayer; | | TProofPlayer *fPlayer; | |
| public: | | public: | |
| TCleanup(TProofPlayer *p) : fPlayer(p) { } | | TCleanup(TProofPlayer *p) : fPlayer(p) { } | |
| ~TCleanup() { fPlayer->StopFeedback(); } | | ~TCleanup() { fPlayer->StopFeedback(); } | |
| }; | | }; | |
| | | | |
|
| | | void MapOutputListToDataMembers() const; | |
| | | | |
| public: | | public: | |
| enum EStatusBits { kDispatchOneEvent = BIT(15), kIsProcessing = BIT(16)
}; | | enum EStatusBits { kDispatchOneEvent = BIT(15), kIsProcessing = BIT(16)
}; | |
| | | | |
| TProofPlayer(TProof *proof = 0); | | TProofPlayer(TProof *proof = 0); | |
| virtual ~TProofPlayer(); | | virtual ~TProofPlayer(); | |
| | | | |
| Long64_t Process(TDSet *set, | | Long64_t Process(TDSet *set, | |
| const char *selector, Option_t *option = "", | | const char *selector, Option_t *option = "", | |
| Long64_t nentries = -1, Long64_t firstentry = 0); | | Long64_t nentries = -1, Long64_t firstentry = 0); | |
| TVirtualPacketizer *GetPacketizer() const { return 0; } | | TVirtualPacketizer *GetPacketizer() const { return 0; } | |
| | | | |
| skipping to change at line 265 | | skipping to change at line 267 | |
| Bool_t fMergeFiles; // is True when merging output files
centrally is needed | | Bool_t fMergeFiles; // is True when merging output files
centrally is needed | |
| TDSet *fDSet; //!tdset for current processing | | TDSet *fDSet; //!tdset for current processing | |
| ErrorHandlerFunc_t fErrorHandler; // Store previous handler when redir
ecting output | | ErrorHandlerFunc_t fErrorHandler; // Store previous handler when redir
ecting output | |
| | | | |
| virtual Bool_t HandleTimer(TTimer *timer); | | virtual Bool_t HandleTimer(TTimer *timer); | |
| Int_t InitPacketizer(TDSet *dset, Long64_t nentries, | | Int_t InitPacketizer(TDSet *dset, Long64_t nentries, | |
| Long64_t first, const char *defpackunit, | | Long64_t first, const char *defpackunit, | |
| const char *defpackdata); | | const char *defpackdata); | |
| TList *MergeFeedback(); | | TList *MergeFeedback(); | |
| Bool_t MergeOutputFiles(); | | Bool_t MergeOutputFiles(); | |
|
| | | void NotifyMemory(TObject *obj); | |
| virtual Bool_t SendSelector(const char *selector_file); //send selector
to slaves | | virtual Bool_t SendSelector(const char *selector_file); //send selector
to slaves | |
| TProof *GetProof() const { return fProof; } | | TProof *GetProof() const { return fProof; } | |
| void SetupFeedback(); // specialized setup | | void SetupFeedback(); // specialized setup | |
| void StopFeedback(); // specialized teardown | | void StopFeedback(); // specialized teardown | |
|
| | | void SetSelectorDataMembersFromOutputList(); | |
| | | | |
| public: | | public: | |
| TProofPlayerRemote(TProof *proof = 0) : fProof(proof), fOutputLists(0),
fFeedback(0), | | TProofPlayerRemote(TProof *proof = 0) : fProof(proof), fOutputLists(0),
fFeedback(0), | |
| fFeedbackLists(0), fPacketizer(0
), | | fFeedbackLists(0), fPacketizer(0
), | |
| fMergeFiles(kFALSE), fDSet(0), f
ErrorHandler(0) | | fMergeFiles(kFALSE), fDSet(0), f
ErrorHandler(0) | |
| { fProgressStatus = new TProofPr
ogressStatus(); } | | { fProgressStatus = new TProofPr
ogressStatus(); } | |
| virtual ~TProofPlayerRemote(); // Owns the fOutput list | | virtual ~TProofPlayerRemote(); // Owns the fOutput list | |
| virtual Long64_t Process(TDSet *set, const char *selector, | | virtual Long64_t Process(TDSet *set, const char *selector, | |
| Option_t *option = "", Long64_t nentries = -1, | | Option_t *option = "", Long64_t nentries = -1, | |
| Long64_t firstentry = 0); | | Long64_t firstentry = 0); | |
| | | | |
End of changes. 4 change blocks. |
| 1 lines changed or deleted | | 5 lines changed or added | |
|
| TProofServ.h | | TProofServ.h | |
|
| // @(#)root/proof:$Id: TProofServ.h 31683 2009-12-08 16:12:08Z ganis $ | | // @(#)root/proof:$Id: TProofServ.h 34101 2010-06-24 12:12:59Z ganis $ | |
| // Author: Fons Rademakers 16/02/97 | | // Author: Fons Rademakers 16/02/97 | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| | | | |
| skipping to change at line 57 | | skipping to change at line 57 | |
| class TVirtualProofPlayer; | | class TVirtualProofPlayer; | |
| class TProofLockPath; | | class TProofLockPath; | |
| class TQueryResultManager; | | class TQueryResultManager; | |
| class TSocket; | | class TSocket; | |
| class THashList; | | class THashList; | |
| class TList; | | class TList; | |
| class TDSetElement; | | class TDSetElement; | |
| class TMessage; | | class TMessage; | |
| class TShutdownTimer; | | class TShutdownTimer; | |
| class TReaperTimer; | | class TReaperTimer; | |
|
| | | class TIdleTOTimer; | |
| class TMutex; | | class TMutex; | |
| class TFileCollection; | | class TFileCollection; | |
| class TDataSetManager; | | class TDataSetManager; | |
| class TFileHandler; | | class TFileHandler; | |
| class TMonitor; | | class TMonitor; | |
| class TServerSocket; | | class TServerSocket; | |
| | | | |
| // Hook to external function setting up authentication related stuff | | // Hook to external function setting up authentication related stuff | |
| // for old versions. | | // for old versions. | |
| // For backward compatibility | | // For backward compatibility | |
| | | | |
| skipping to change at line 142 | | skipping to change at line 143 | |
| TMutex *fQMtx; // To protect async msg queue | | TMutex *fQMtx; // To protect async msg queue | |
| | | | |
| TList *fQueuedMsg; //list of messages waiting to be proces
sed | | TList *fQueuedMsg; //list of messages waiting to be proces
sed | |
| | | | |
| TString fPrefix; //Prefix identifying the node | | TString fPrefix; //Prefix identifying the node | |
| | | | |
| Bool_t fRealTimeLog; //TRUE if log messages should be send b
ack in real-time | | Bool_t fRealTimeLog; //TRUE if log messages should be send b
ack in real-time | |
| | | | |
| TShutdownTimer *fShutdownTimer; // Timer used to shutdown out-of-contro
l sessions | | TShutdownTimer *fShutdownTimer; // Timer used to shutdown out-of-contro
l sessions | |
| TReaperTimer *fReaperTimer; // Timer used to control children state | | TReaperTimer *fReaperTimer; // Timer used to control children state | |
|
| | | TIdleTOTimer *fIdleTOTimer; // Timer used to control children state | |
| | | | |
| Int_t fInflateFactor; // Factor in 1/1000 to inflate the CPU
time | | Int_t fInflateFactor; // Factor in 1/1000 to inflate the CPU
time | |
| | | | |
| Int_t fCompressMsg; // Compression level for messages | | Int_t fCompressMsg; // Compression level for messages | |
| | | | |
| TDataSetManager* fDataSetManager; // dataset manager | | TDataSetManager* fDataSetManager; // dataset manager | |
| | | | |
|
| Bool_t fLogToSysLog; //true if logs should be sent to syslog
too | | | |
| Bool_t fSendLogToMaster; // On workers, controls logs sending to
master | | Bool_t fSendLogToMaster; // On workers, controls logs sending to
master | |
| | | | |
| TServerSocket *fMergingSocket; // Socket used for merging outputs if su
bmerger | | TServerSocket *fMergingSocket; // Socket used for merging outputs if su
bmerger | |
| TMonitor *fMergingMonitor; // Monitor for merging sockets | | TMonitor *fMergingMonitor; // Monitor for merging sockets | |
| Int_t fMergedWorkers; // Number of workers merged | | Int_t fMergedWorkers; // Number of workers merged | |
| | | | |
| // Quotas (-1 to disable) | | // Quotas (-1 to disable) | |
| Int_t fMaxQueries; //Max number of queries fully kept | | Int_t fMaxQueries; //Max number of queries fully kept | |
| Long64_t fMaxBoxSize; //Max size of the sandbox | | Long64_t fMaxBoxSize; //Max size of the sandbox | |
| Long64_t fHWMBoxSize; //High-Water-Mark on the sandbox size | | Long64_t fHWMBoxSize; //High-Water-Mark on the sandbox size | |
| | | | |
| skipping to change at line 171 | | skipping to change at line 172 | |
| // Memory limits (-1 to disable) set by envs ROOTPROOFASSOFT and RPPTPRO
FOASHARD | | // Memory limits (-1 to disable) set by envs ROOTPROOFASSOFT and RPPTPRO
FOASHARD | |
| Long_t fVirtMemHWM; //Above this we terminate gently (in kB
) | | Long_t fVirtMemHWM; //Above this we terminate gently (in kB
) | |
| Long_t fVirtMemMax; //Hard limit enforced by the system (in
kB) | | Long_t fVirtMemMax; //Hard limit enforced by the system (in
kB) | |
| | | | |
| // In bytes; default is 1MB | | // In bytes; default is 1MB | |
| Long64_t fMsgSizeHWM; //High-Water-Mark on the size of messag
es with results | | Long64_t fMsgSizeHWM; //High-Water-Mark on the size of messag
es with results | |
| | | | |
| static FILE *fgErrorHandlerFile; // File where to log | | static FILE *fgErrorHandlerFile; // File where to log | |
| static Int_t fgRecursive; // Keep track of recursive inputs durin
g processing | | static Int_t fgRecursive; // Keep track of recursive inputs durin
g processing | |
| | | | |
|
| | | // Control sending information to syslog | |
| | | static Int_t fgLogToSysLog; // >0 sent to syslog too | |
| | | static TString fgSysLogService; // name of the syslog service (eg: pro | |
| | | ofm-0, proofw-0.67) | |
| | | static TString fgSysLogEntity; // logging entity (<user>:<group>) | |
| | | | |
| void RedirectOutput(const char *dir = 0, const char *mode = "w"
); | | void RedirectOutput(const char *dir = 0, const char *mode = "w"
); | |
| Int_t CatMotd(); | | Int_t CatMotd(); | |
| Int_t UnloadPackage(const char *package); | | Int_t UnloadPackage(const char *package); | |
| Int_t UnloadPackages(); | | Int_t UnloadPackages(); | |
| Int_t OldAuthSetup(TString &wconf); | | Int_t OldAuthSetup(TString &wconf); | |
| Int_t GetPriority(); | | Int_t GetPriority(); | |
| | | | |
| // Query handlers | | // Query handlers | |
| TProofQueryResult *MakeQueryResult(Long64_t nentries, const char *opt, | | TProofQueryResult *MakeQueryResult(Long64_t nentries, const char *opt, | |
| TList *inl, Long64_t first, TDSet *ds
et, | | TList *inl, Long64_t first, TDSet *ds
et, | |
| | | | |
| skipping to change at line 199 | | skipping to change at line 205 | |
| | | | |
| // Waiting queries handlers | | // Waiting queries handlers | |
| void SetIdle(Bool_t st = kTRUE); | | void SetIdle(Bool_t st = kTRUE); | |
| Bool_t IsWaiting(); | | Bool_t IsWaiting(); | |
| Int_t WaitingQueries(); | | Int_t WaitingQueries(); | |
| Int_t QueueQuery(TProofQueryResult *pq); | | Int_t QueueQuery(TProofQueryResult *pq); | |
| TProofQueryResult *NextQuery(); | | TProofQueryResult *NextQuery(); | |
| Int_t CleanupWaitingQueries(Bool_t del = kTRUE, TList *qls = 0); | | Int_t CleanupWaitingQueries(Bool_t del = kTRUE, TList *qls = 0); | |
| | | | |
| protected: | | protected: | |
|
| virtual void HandleArchive(TMessage *mess); | | virtual void HandleArchive(TMessage *mess, TString *slb = 0); | |
| virtual Int_t HandleCache(TMessage *mess); | | virtual Int_t HandleCache(TMessage *mess, TString *slb = 0); | |
| virtual void HandleCheckFile(TMessage *mess); | | virtual void HandleCheckFile(TMessage *mess, TString *slb = 0); | |
| virtual Int_t HandleDataSets(TMessage *mess); | | virtual Int_t HandleDataSets(TMessage *mess, TString *slb = 0); | |
| virtual void HandleSubmerger(TMessage *mess); | | virtual void HandleSubmerger(TMessage *mess); | |
| virtual void HandleFork(TMessage *mess); | | virtual void HandleFork(TMessage *mess); | |
| virtual void HandleLibIncPath(TMessage *mess); | | virtual void HandleLibIncPath(TMessage *mess); | |
|
| virtual void HandleProcess(TMessage *mess); | | virtual void HandleProcess(TMessage *mess, TString *slb = 0); | |
| virtual void HandleQueryList(TMessage *mess); | | virtual void HandleQueryList(TMessage *mess); | |
|
| virtual void HandleRemove(TMessage *mess); | | virtual void HandleRemove(TMessage *mess, TString *slb = 0); | |
| virtual void HandleRetrieve(TMessage *mess); | | virtual void HandleRetrieve(TMessage *mess, TString *slb = 0); | |
| virtual void HandleWorkerLists(TMessage *mess); | | virtual void HandleWorkerLists(TMessage *mess); | |
| | | | |
|
| virtual void ProcessNext(); | | virtual void ProcessNext(TString *slb = 0); | |
| virtual Int_t Setup(); | | virtual Int_t Setup(); | |
| Int_t SetupCommon(); | | Int_t SetupCommon(); | |
| virtual void MakePlayer(); | | virtual void MakePlayer(); | |
| virtual void DeletePlayer(); | | virtual void DeletePlayer(); | |
| | | | |
| virtual Int_t Fork(); | | virtual Int_t Fork(); | |
| Int_t GetSessionStatus(); | | Int_t GetSessionStatus(); | |
| Bool_t IsIdle(); | | Bool_t IsIdle(); | |
|
| | | Bool_t UnlinkDataDir(const char *path); | |
| | | | |
| public: | | public: | |
| TProofServ(Int_t *argc, char **argv, FILE *flog = 0); | | TProofServ(Int_t *argc, char **argv, FILE *flog = 0); | |
| virtual ~TProofServ(); | | virtual ~TProofServ(); | |
| | | | |
| virtual Int_t CreateServer(); | | virtual Int_t CreateServer(); | |
| | | | |
| TProof *GetProof() const { return fProof; } | | TProof *GetProof() const { return fProof; } | |
| const char *GetService() const { return fService; } | | const char *GetService() const { return fService; } | |
| const char *GetConfDir() const { return fConfDir; } | | const char *GetConfDir() const { return fConfDir; } | |
| | | | |
| skipping to change at line 301 | | skipping to change at line 308 | |
| TObject *Get(const char *namecycle); | | TObject *Get(const char *namecycle); | |
| TDSetElement *GetNextPacket(Long64_t totalEntries = -1); | | TDSetElement *GetNextPacket(Long64_t totalEntries = -1); | |
| virtual void ReleaseWorker(const char *) { } | | virtual void ReleaseWorker(const char *) { } | |
| void Reset(const char *dir); | | void Reset(const char *dir); | |
| Int_t ReceiveFile(const char *file, Bool_t bin, Long64_t size); | | Int_t ReceiveFile(const char *file, Bool_t bin, Long64_t size); | |
| virtual Int_t SendAsynMessage(const char *msg, Bool_t lf = kTRUE); | | virtual Int_t SendAsynMessage(const char *msg, Bool_t lf = kTRUE); | |
| virtual void SendLogFile(Int_t status = 0, Int_t start = -1, Int_t end
= -1); | | virtual void SendLogFile(Int_t status = 0, Int_t start = -1, Int_t end
= -1); | |
| void SendStatistics(); | | void SendStatistics(); | |
| void SendParallel(Bool_t async = kFALSE); | | void SendParallel(Bool_t async = kFALSE); | |
| | | | |
|
| | | Int_t UpdateSessionStatus(Int_t xst = -1); | |
| | | | |
| // Disable / Enable read timeout | | // Disable / Enable read timeout | |
| virtual void DisableTimeout() { } | | virtual void DisableTimeout() { } | |
| virtual void EnableTimeout() { } | | virtual void EnableTimeout() { } | |
| | | | |
| virtual void Terminate(Int_t status); | | virtual void Terminate(Int_t status); | |
| | | | |
| // Log control | | // Log control | |
|
| Bool_t LogToSysLog() { return fLogToSysLog; } | | | |
| void LogToMaster(Bool_t on = kTRUE) { fSendLogToMaster = on; } | | void LogToMaster(Bool_t on = kTRUE) { fSendLogToMaster = on; } | |
| | | | |
| static FILE *SetErrorHandlerFile(FILE *ferr); | | static FILE *SetErrorHandlerFile(FILE *ferr); | |
| static void ErrorHandler(Int_t level, Bool_t abort, const char *locat
ion, | | static void ErrorHandler(Int_t level, Bool_t abort, const char *locat
ion, | |
| const char *msg); | | const char *msg); | |
| | | | |
| static void ResolveKeywords(TString &fname, const char *path = 0); | | static void ResolveKeywords(TString &fname, const char *path = 0); | |
| | | | |
| static Bool_t IsActive(); | | static Bool_t IsActive(); | |
| static TProofServ *This(); | | static TProofServ *This(); | |
| | | | |
| skipping to change at line 358 | | skipping to change at line 366 | |
| //----- Handles output from commands executed externally via a pipe. ------
---// | | //----- Handles output from commands executed externally via a pipe. ------
---// | |
| //----- The output is redirected one level up (i.e., to master or client).
---// | | //----- The output is redirected one level up (i.e., to master or client).
---// | |
| //_________________________________________________________________________
_____ | | //_________________________________________________________________________
_____ | |
| class TProofServLogHandler : public TFileHandler { | | class TProofServLogHandler : public TFileHandler { | |
| private: | | private: | |
| TSocket *fSocket; // Socket where to redirect the message | | TSocket *fSocket; // Socket where to redirect the message | |
| FILE *fFile; // File connected with the open pipe | | FILE *fFile; // File connected with the open pipe | |
| TString fPfx; // Prefix to be prepended to messages | | TString fPfx; // Prefix to be prepended to messages | |
| | | | |
| static TString fgPfx; // Default prefix to be prepended to messages | | static TString fgPfx; // Default prefix to be prepended to messages | |
|
| | | static Int_t fgCmdRtn; // Return code of the command execution (availa | |
| | | ble only | |
| | | // after closing the pipe) | |
| public: | | public: | |
| enum EStatusBits { kFileIsPipe = BIT(23) }; | | enum EStatusBits { kFileIsPipe = BIT(23) }; | |
| TProofServLogHandler(const char *cmd, TSocket *s, const char *pfx = ""); | | TProofServLogHandler(const char *cmd, TSocket *s, const char *pfx = ""); | |
| TProofServLogHandler(FILE *f, TSocket *s, const char *pfx = ""); | | TProofServLogHandler(FILE *f, TSocket *s, const char *pfx = ""); | |
| virtual ~TProofServLogHandler(); | | virtual ~TProofServLogHandler(); | |
| | | | |
| Bool_t IsValid() { return ((fFile && fSocket) ? kTRUE : kFALSE); } | | Bool_t IsValid() { return ((fFile && fSocket) ? kTRUE : kFALSE); } | |
| | | | |
| Bool_t Notify(); | | Bool_t Notify(); | |
| Bool_t ReadNotify() { return Notify(); } | | Bool_t ReadNotify() { return Notify(); } | |
| | | | |
| static void SetDefaultPrefix(const char *pfx); | | static void SetDefaultPrefix(const char *pfx); | |
|
| | | static Int_t GetCmdRtn(); | |
| }; | | }; | |
| | | | |
| //--- Guard class: close pipe, deactivatethe related descriptor -----------
---// | | //--- Guard class: close pipe, deactivatethe related descriptor -----------
---// | |
| //_________________________________________________________________________
_____ | | //_________________________________________________________________________
_____ | |
| class TProofServLogHandlerGuard { | | class TProofServLogHandlerGuard { | |
| | | | |
| private: | | private: | |
| TProofServLogHandler *fExecHandler; | | TProofServLogHandler *fExecHandler; | |
| | | | |
| public: | | public: | |
| | | | |
| skipping to change at line 413 | | skipping to change at line 424 | |
| TList *fChildren; // List of children (forked) processes | | TList *fChildren; // List of children (forked) processes | |
| | | | |
| public: | | public: | |
| TReaperTimer(Long_t frequency = 1000) : TTimer(frequency, kTRUE), fChild
ren(0) { } | | TReaperTimer(Long_t frequency = 1000) : TTimer(frequency, kTRUE), fChild
ren(0) { } | |
| virtual ~TReaperTimer(); | | virtual ~TReaperTimer(); | |
| | | | |
| void AddPid(Int_t pid); | | void AddPid(Int_t pid); | |
| Bool_t Notify(); | | Bool_t Notify(); | |
| }; | | }; | |
| | | | |
|
| | | //--- Special timer to terminate idle sessions | |
| | | //_________________________________________________________________________ | |
| | | _____ | |
| | | class TIdleTOTimer : public TTimer { | |
| | | private: | |
| | | TProofServ *fProofServ; | |
| | | | |
| | | public: | |
| | | TIdleTOTimer(TProofServ *p, Int_t delay) : TTimer(delay, kTRUE), fProofS | |
| | | erv(p) { } | |
| | | | |
| | | Bool_t Notify(); | |
| | | }; | |
| | | //_________________________________________________________________________ | |
| | | _____ | |
| | | class TIdleTOTimerGuard { | |
| | | | |
| | | private: | |
| | | TIdleTOTimer *fIdleTOTimer; | |
| | | | |
| | | public: | |
| | | TIdleTOTimerGuard(TIdleTOTimer *t) : fIdleTOTimer(t) { if (fIdleTOTimer) | |
| | | fIdleTOTimer->Stop(); } | |
| | | virtual ~TIdleTOTimerGuard() { if (fIdleTOTimer) fIdleTOTimer->Start(-1, | |
| | | kTRUE); } | |
| | | }; | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 15 change blocks. |
| 11 lines changed or deleted | | 51 lines changed or added | |
|
| TQtClientFilter.h | | TQtClientFilter.h | |
|
| // @(#)root/qt:$Id: TQtClientFilter.h 32141 2010-01-28 16:42:30Z bellenot $ | | // @(#)root/qt:$Id: TQtClientFilter.h 33707 2010-06-02 06:27:34Z brun $ | |
| // Author: Valeri Fine 21/01/2002 | | // Author: Valeri Fine 21/01/2002 | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. * | |
| * Copyright (C) 2002 by Valeri Fine. * | | * Copyright (C) 2002 by Valeri Fine. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| #ifndef ROOT_TQClientFilter | | #ifndef ROOT_TQClientFilter | |
| #define ROOT_TQClientFilter | | #define ROOT_TQClientFilter | |
| | | | |
| #include "GuiTypes.h" | | #include "GuiTypes.h" | |
| #include "Rtypes.h" | | #include "Rtypes.h" | |
| | | | |
| #ifndef __CINT__ | | #ifndef __CINT__ | |
|
| # include <qobject.h> | | # include <QEvent> | |
| # if (QT_VERSION > 0x039999) | | # include <QMouseEvent> | |
| // Added by qt3to4: | | # include <QList> | |
| # include <QEvent> | | # include <QApplication> | |
| # include <QMouseEvent> | | | |
| # include <QList> | | | |
| # else | | | |
| # include <qptrqueue.h> | | | |
| # include <qptrlist.h> | | | |
| # include <qintdict.h> | | | |
| # endif /* QT_VERSION */ | | | |
| # include <qapplication.h> | | | |
| #else | | #else | |
| class TQtClientWidget; | | class TQtClientWidget; | |
| class QObject; | | class QObject; | |
|
| # if (QT_VERSION > 0x039999) | | class QList<TQtClientWidget*>; | |
| class QList<TQtClientWidget*>; | | | |
| # else /* QT_VERSION */ | | | |
| class QPtrList<TQtClientWidget>; | | | |
| # endif /* QT_VERSION */ | | | |
| #endif /* CINT */ | | #endif /* CINT */ | |
| | | | |
| #include "TQtClientWidget.h" | | #include "TQtClientWidget.h" | |
| | | | |
| //________________________________________________________________________ | | //________________________________________________________________________ | |
| // | | // | |
| // TQtClientFilter is Qt "eventFilter" to map Qt event to ROOT event | | // TQtClientFilter is Qt "eventFilter" to map Qt event to ROOT event | |
| //________________________________________________________________________ | | //________________________________________________________________________ | |
| | | | |
| class TQtNextEventMessage; | | class TQtNextEventMessage; | |
| | | | |
| skipping to change at line 67 | | skipping to change at line 55 | |
| #endif | | #endif | |
| friend class TGQt; | | friend class TGQt; | |
| friend class TQtClientWidget; | | friend class TQtClientWidget; | |
| private: | | private: | |
| void operator=(const TQtClientFilter &); | | void operator=(const TQtClientFilter &); | |
| TQtClientFilter(const TQtClientFilter &); | | TQtClientFilter(const TQtClientFilter &); | |
| protected: | | protected: | |
| TQtEventQueue *fRootEventQueue; | | TQtEventQueue *fRootEventQueue; | |
| TQtNextEventMessage *fNotifyClient; | | TQtNextEventMessage *fNotifyClient; | |
| #ifndef __CINT__ | | #ifndef __CINT__ | |
|
| #if (QT_VERSION > 0x039999) | | | |
| QList<TQtClientWidget*> fButtonGrabList; | | QList<TQtClientWidget*> fButtonGrabList; | |
|
| #else /* QT_VERSION */ | | | |
| QPtrList<TQtClientWidget> fButtonGrabList; | | | |
| #endif /* QT_VERSION */ | | | |
| #endif | | #endif | |
| static TQtClientWidget *fgPointerGrabber; | | static TQtClientWidget *fgPointerGrabber; | |
| static TQtClientWidget *fgButtonGrabber; | | static TQtClientWidget *fgButtonGrabber; | |
| static TQtClientWidget *fgActiveGrabber; | | static TQtClientWidget *fgActiveGrabber; | |
| TQtClientWidget *fKeyGrabber; | | TQtClientWidget *fKeyGrabber; | |
| UInt_t fInputEventMask; | | UInt_t fInputEventMask; | |
| static UInt_t fgGrabPointerEventMask; | | static UInt_t fgGrabPointerEventMask; | |
| static Bool_t fgGrabPointerOwner; | | static Bool_t fgGrabPointerOwner; | |
| static QCursor *fgGrabPointerCursor; | | static QCursor *fgGrabPointerCursor; | |
| // static Bool_t fIsGrabbing; | | // static Bool_t fIsGrabbing; | |
| | | | |
| skipping to change at line 106 | | skipping to change at line 90 | |
| static TQtClientWidget *GetButtonGrabber(); | | static TQtClientWidget *GetButtonGrabber(); | |
| static void SetButtonGrabber(TQtClientWidget *grabber); | | static void SetButtonGrabber(TQtClientWidget *grabber); | |
| static void GrabPointer(TQtClientWidget *grabber, UInt_t evmask, Window_
t confine, | | static void GrabPointer(TQtClientWidget *grabber, UInt_t evmask, Window_
t confine, | |
| QCursor *cursor, Bool_t grab = kTRUE, | | QCursor *cursor, Bool_t grab = kTRUE, | |
| Bool_t owner_events = kTRUE); | | Bool_t owner_events = kTRUE); | |
| static TQtPointerGrabber *PointerGrabber(); | | static TQtPointerGrabber *PointerGrabber(); | |
| public slots: | | public slots: | |
| void AppendButtonGrab (TQtClientWidget *); | | void AppendButtonGrab (TQtClientWidget *); | |
| void RemoveButtonGrab (QObject *); | | void RemoveButtonGrab (QObject *); | |
| #ifndef Q_MOC_RUN | | #ifndef Q_MOC_RUN | |
|
| //MOC_SKIP_BEGIN | | | |
| ClassDef(TQtClientFilter,0) // Map Qt and ROOT event | | ClassDef(TQtClientFilter,0) // Map Qt and ROOT event | |
|
| //MOC_SKIP_END | | | |
| #endif | | #endif | |
| }; | | }; | |
| | | | |
| // | | // | |
| // TQtClientFilter is a Qt "eventFilter" to map Qt event to ROOT event | | // TQtClientFilter is a Qt "eventFilter" to map Qt event to ROOT event | |
| // | | // | |
| class QWidget; | | class QWidget; | |
| class QCursor; | | class QCursor; | |
| | | | |
| class TQtPointerGrabber { | | class TQtPointerGrabber { | |
| | | | |
End of changes. 7 change blocks. |
| 24 lines changed or deleted | | 6 lines changed or added | |
|
| TQtMarker.h | | TQtMarker.h | |
|
| // @(#)root/qt:$Id: TQtMarker.h 30386 2009-09-23 19:06:28Z brun $ | | // @(#)root/qt:$Id: TQtMarker.h 33707 2010-06-02 06:27:34Z brun $ | |
| // Author: Valeri Fine 21/01/2002 | | // Author: Valeri Fine 21/01/2002 | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. * | |
| * Copyright (C) 2002 by Valeri Fine. * | | * Copyright (C) 2002 by Valeri Fine. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| skipping to change at line 45 | | skipping to change at line 45 | |
| //////////////////////////////////////////////////////////////////////// | | //////////////////////////////////////////////////////////////////////// | |
| | | | |
| class TQtMarker { | | class TQtMarker { | |
| | | | |
| private: | | private: | |
| | | | |
| int fNumNode; // Number of chain in the marker shape | | int fNumNode; // Number of chain in the marker shape | |
| QPolygon fChain; // array of the n chains to build a shaped marke
r | | QPolygon fChain; // array of the n chains to build a shaped marke
r | |
| Color_t fCindex; // Color index of the marker; | | Color_t fCindex; // Color index of the marker; | |
| int fMarkerType; // Type of the current marker | | int fMarkerType; // Type of the current marker | |
|
| | | int fLineWidth; // The width of the line used to outline the mar | |
| | | kers | |
| | | int fLineOption; // Connect the markers with the segments | |
| | | | |
| public: | | public: | |
| | | | |
| TQtMarker(int n=0, TPoint *xy=0,int type=0); | | TQtMarker(int n=0, TPoint *xy=0,int type=0); | |
| TQtMarker &operator=(const TQtMarker&); | | TQtMarker &operator=(const TQtMarker&); | |
| TQtMarker(const TQtMarker&); | | TQtMarker(const TQtMarker&); | |
| TQtMarker &operator=(const TAttMarker&); | | TQtMarker &operator=(const TAttMarker&); | |
| TQtMarker(const TAttMarker&); | | TQtMarker(const TAttMarker&); | |
| virtual ~TQtMarker(); | | virtual ~TQtMarker(); | |
| void DrawPolyMarker(QPainter &p, int n, TPoint *xy); | | void DrawPolyMarker(QPainter &p, int n, TPoint *xy); | |
| void SetMarkerAttributes(const TAttMarker& markerAttributes); | | void SetMarkerAttributes(const TAttMarker& markerAttributes); | |
| void SetColor(Color_t mcolor); | | void SetColor(Color_t mcolor); | |
|
| | | void SetPenAttributes(int type); | |
| Color_t GetColor() const; | | Color_t GetColor() const; | |
| | | | |
| int GetNumber() const; | | int GetNumber() const; | |
| const QPolygon &GetNodes() const; | | const QPolygon &GetNodes() const; | |
| int GetType() const; | | int GetType() const; | |
|
| | | int GetWidth() const; | |
| void SetMarker(int n, TPoint *xy, int type); | | void SetMarker(int n, TPoint *xy, int type); | |
| ClassDef(TQtMarker,0) // Convert ROOT TMarker objects on to QPointArra
y | | ClassDef(TQtMarker,0) // Convert ROOT TMarker objects on to QPointArra
y | |
| }; | | }; | |
| | | | |
| //_________________________________________________________ | | //_________________________________________________________ | |
| inline TQtMarker &TQtMarker::operator=(const TQtMarker&m) | | inline TQtMarker &TQtMarker::operator=(const TQtMarker&m) | |
| { | | { | |
| fNumNode = m.fNumNode; | | fNumNode = m.fNumNode; | |
| fChain = m.fChain; | | fChain = m.fChain; | |
| fCindex = m.fCindex; | | fCindex = m.fCindex; | |
| fMarkerType=m.fMarkerType; | | fMarkerType=m.fMarkerType; | |
|
| | | fLineWidth =m.fLineWidth; | |
| return *this; | | return *this; | |
| } | | } | |
| //_________________________________________________________ | | //_________________________________________________________ | |
| inline TQtMarker::TQtMarker(const TQtMarker&m) : fNumNode(m.fNumNode), | | inline TQtMarker::TQtMarker(const TQtMarker&m) : fNumNode(m.fNumNode), | |
|
| fChain(m.fChain), fCindex(m.fCindex),fMarkerType(m.fMarkerType) {} | | fChain(m.fChain), fCindex(m.fCindex),fMarkerType(m.fMarkerType),fLineWidth( | |
| | | m.fLineWidth) | |
| | | {} | |
| | | | |
| //_________________________________________________________ | | //_________________________________________________________ | |
| inline void TQtMarker::SetColor(Color_t mcolor) { fCindex = mcolor; } | | inline void TQtMarker::SetColor(Color_t mcolor) { fCindex = mcolor; } | |
| //_________________________________________________________ | | //_________________________________________________________ | |
| inline Color_t TQtMarker::GetColor() const { return fCindex; } | | inline Color_t TQtMarker::GetColor() const { return fCindex; } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 6 change blocks. |
| 2 lines changed or deleted | | 10 lines changed or added | |
|
| TQtWidget.h | | TQtWidget.h | |
|
| // @(#)root/qt:$Id: TQtWidget.h 32417 2010-02-27 03:42:53Z brun $ | | // @(#)root/qt:$Id: TQtWidget.h 33707 2010-06-02 06:27:34Z brun $ | |
| // Author: Valeri Fine 21/01/2002 | | // Author: Valeri Fine 21/01/2002 | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2004, Rene Brun and Fons Rademakers. * | |
| * Copyright (C) 2003 by Valeri Fine. * | | * Copyright (C) 2003 by Valeri Fine. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| skipping to change at line 24 | | skipping to change at line 24 | |
| #define ROOT_TQtWidget | | #define ROOT_TQtWidget | |
| | | | |
| // Definition of TQtWidget class | | // Definition of TQtWidget class | |
| // "double-buffered" widget | | // "double-buffered" widget | |
| | | | |
| #include <assert.h> | | #include <assert.h> | |
| #include "Rtypes.h" | | #include "Rtypes.h" | |
| #include "TCanvas.h" | | #include "TCanvas.h" | |
| | | | |
| #ifndef __CINT__ | | #ifndef __CINT__ | |
|
| # include <qwidget.h> | | # include <QtGui/QWidget> | |
| # if (QT_VERSION > 0x039999) | | # include <QtGui/QMouseEvent> | |
| # include <QMouseEvent> | | # include <QtGui/QShowEvent> | |
| # include <QCustomEvent> | | # include <QtGui/QFocusEvent> | |
| # include <QShowEvent> | | # include <QtGui/QKeyEvent> | |
| # include <QFocusEvent> | | # include <QtGui/QResizeEvent> | |
| # include <QKeyEvent> | | # include <QtCore/QEvent> | |
| # include <QResizeEvent> | | # include <QtGui/QPaintEvent> | |
| # include <QEvent> | | # include <QtGui/QPaintDevice> | |
| # include <QPaintEvent> | | # include <QtCore/QSize> | |
| # include <QPaintDevice> | | # include <QtCore/QPoint> | |
| # include <QSize> | | # include <QtCore/QPointer> | |
| # include <QPoint> | | # include <QtGui/QPixmap> | |
| # endif | | # include "TQtCanvasPainter.h" | |
| # include <qpixmap.h> | | | |
| #else | | #else | |
|
| // List of the fake classes to the fake RootCint happy. | | // List of the fake classes to make RootCint happy. | |
| class QWidget; | | class QWidget; | |
| class QPixmap; | | class QPixmap; | |
| class QMouseEvent; | | class QMouseEvent; | |
| class QFocusEvent; | | class QFocusEvent; | |
| class QCustomEvent; | | class QCustomEvent; | |
| class QKeyEvent; | | class QKeyEvent; | |
| class QShowEvent; | | class QShowEvent; | |
| class QPaintEvent; | | class QPaintEvent; | |
| class QPaintDevice; | | class QPaintDevice; | |
| class QResizeEvent; | | class QResizeEvent; | |
| class QSize; | | class QSize; | |
| class QString; | | class QString; | |
| class QEvent; | | class QEvent; | |
| class QSizePolicy; | | class QSizePolicy; | |
| class QContextMenuEvent; | | class QContextMenuEvent; | |
| class QSize; | | class QSize; | |
| class QPoint; | | class QPoint; | |
|
| | | class TQtCanvasPainter; | |
| #endif | | #endif | |
| class QTimer; | | class QTimer; | |
| class TApplication; | | class TApplication; | |
| // | | // | |
| // TQtWidget is a custom QWidget to back ROOT TCanvas. | | // TQtWidget is a custom QWidget to back ROOT TCanvas. | |
| // | | // | |
| // It can be used within Qt-based program and with Qt Designer as a "regula
r" | | // It can be used within Qt-based program and with Qt Designer as a "regula
r" | |
| // Qt QWidget to create the Qt widget wihe builtin TCanvas' | | // Qt QWidget to create the Qt widget wihe builtin TCanvas' | |
| // | | // | |
| enum EEventTrackingBits { | | enum EEventTrackingBits { | |
| | | | |
| skipping to change at line 104 | | skipping to change at line 104 | |
| int Width () const { return fBuffer ? fBuffer->width() : 0; } | | int Width () const { return fBuffer ? fBuffer->width() : 0; } | |
| }; | | }; | |
| | | | |
| //___________________________________________________________________ | | //___________________________________________________________________ | |
| class TQtWidget : public QWidget { | | class TQtWidget : public QWidget { | |
| #ifndef __CINT__ | | #ifndef __CINT__ | |
| Q_OBJECT | | Q_OBJECT | |
| friend class TQtSynchPainting; | | friend class TQtSynchPainting; | |
| #endif | | #endif | |
| private: | | private: | |
|
| | | | |
| TQtWidget(const TQtWidget&); | | TQtWidget(const TQtWidget&); | |
| void operator=(const TQtWidget&); | | void operator=(const TQtWidget&); | |
| //----- Private bits, clients can only test but not change them | | //----- Private bits, clients can only test but not change them | |
| UInt_t fBits; //bit field status word | | UInt_t fBits; //bit field status word | |
| enum { | | enum { | |
| kBitMask = 0x00ffffff | | kBitMask = 0x00ffffff | |
| }; | | }; | |
| bool fNeedStretch; | | bool fNeedStretch; | |
|
| | | #ifndef __CINT__ | |
| | | QPointer<TQtCanvasPainter> fCanvasDecorator; //< The object to paint on | |
| | | to the TQtWidget on the top of TCanvas image | |
| | | #endif | |
| protected: | | protected: | |
| void Init(); | | void Init(); | |
| void ResetCanvas() { fCanvas = 0;} | | void ResetCanvas() { fCanvas = 0;} | |
| | | | |
| public: | | public: | |
| enum { | | enum { | |
| kEXITSIZEMOVE, | | kEXITSIZEMOVE, | |
| kENTERSIZEMOVE, | | kENTERSIZEMOVE, | |
| kFORCESIZE | | kFORCESIZE | |
| }; | | }; | |
| | | | |
| skipping to change at line 171 | | skipping to change at line 175 | |
| QWidget *GetRootID() const; | | QWidget *GetRootID() const; | |
| virtual void EmitCanvasPainted() { emit CanvasPainted(); } | | virtual void EmitCanvasPainted() { emit CanvasPainted(); } | |
| TCanvas *Canvas(); | | TCanvas *Canvas(); | |
| bool paintFlag(bool mode=TRUE); | | bool paintFlag(bool mode=TRUE); | |
| void AdjustBufferSize(); | | void AdjustBufferSize(); | |
| | | | |
| bool PaintingActive () const; | | bool PaintingActive () const; | |
| void SetIgnoreLeaveEnter(int ignore=1); | | void SetIgnoreLeaveEnter(int ignore=1); | |
| | | | |
| virtual void enterEvent ( QEvent * ); | | virtual void enterEvent ( QEvent * ); | |
|
| #if (QT_VERSION > 0x039999) | | | |
| virtual void customEvent ( QEvent * ); | | virtual void customEvent ( QEvent * ); | |
|
| #else | | | |
| virtual void customEvent ( QCustomEvent *); | | | |
| #endif | | | |
| virtual void contextMenuEvent ( QContextMenuEvent *); | | virtual void contextMenuEvent ( QContextMenuEvent *); | |
| virtual void focusInEvent ( QFocusEvent * ); | | virtual void focusInEvent ( QFocusEvent * ); | |
| virtual void focusOutEvent ( QFocusEvent * ); | | virtual void focusOutEvent ( QFocusEvent * ); | |
| virtual void leaveEvent ( QEvent * ); | | virtual void leaveEvent ( QEvent * ); | |
| virtual void mouseDoubleClickEvent(QMouseEvent* ); | | virtual void mouseDoubleClickEvent(QMouseEvent* ); | |
| virtual void mouseMoveEvent ( QMouseEvent * ); | | virtual void mouseMoveEvent ( QMouseEvent * ); | |
| virtual void mousePressEvent ( QMouseEvent * ); | | virtual void mousePressEvent ( QMouseEvent * ); | |
| virtual void mouseReleaseEvent( QMouseEvent * ); | | virtual void mouseReleaseEvent( QMouseEvent * ); | |
| virtual void keyPressEvent ( QKeyEvent * ); | | virtual void keyPressEvent ( QKeyEvent * ); | |
| virtual void keyReleaseEvent ( QKeyEvent * ); | | virtual void keyReleaseEvent ( QKeyEvent * ); | |
| | | | |
| skipping to change at line 199 | | skipping to change at line 199 | |
| // Layout methods: | | // Layout methods: | |
| virtual void SetSizeHint (const QSize &size); | | virtual void SetSizeHint (const QSize &size); | |
| public: | | public: | |
| virtual QSize sizeHint () const; // returns the preferred s
ize of the widget. | | virtual QSize sizeHint () const; // returns the preferred s
ize of the widget. | |
| virtual QSize minimumSizeHint () const; // returns the smallest si
ze the widget can have. | | virtual QSize minimumSizeHint () const; // returns the smallest si
ze the widget can have. | |
| virtual QSizePolicy sizePolicy () const; // returns a QSizePolicy;
a value describing the space requirements of the | | virtual QSizePolicy sizePolicy () const; // returns a QSizePolicy;
a value describing the space requirements of the | |
| protected: | | protected: | |
| // -- A special event handler | | // -- A special event handler | |
| virtual void exitSizeEvent (); | | virtual void exitSizeEvent (); | |
| virtual void stretchWidget(QResizeEvent *e); | | virtual void stretchWidget(QResizeEvent *e); | |
|
| | | TQtCanvasPainter *CanvasDecorator(); | |
| public: | | public: | |
| //----- bit manipulation (a'la TObject ) | | //----- bit manipulation (a'la TObject ) | |
| void SetBit (UInt_t f, Bool_t set); | | void SetBit (UInt_t f, Bool_t set); | |
| void SetBit (UInt_t f); | | void SetBit (UInt_t f); | |
| void ResetBit (UInt_t f); | | void ResetBit (UInt_t f); | |
| Bool_t TestBit (UInt_t f) const; | | Bool_t TestBit (UInt_t f) const; | |
| Int_t TestBits (UInt_t f) const; | | Int_t TestBits (UInt_t f) const; | |
| void InvertBit (UInt_t f); | | void InvertBit (UInt_t f); | |
| void EmitSignal (UInt_t f); | | void EmitSignal (UInt_t f); | |
| void EmitTestedSignal(); | | void EmitTestedSignal(); | |
| UInt_t GetAllBits() const; | | UInt_t GetAllBits() const; | |
| void SetAllBits(UInt_t f); | | void SetAllBits(UInt_t f); | |
|
| | | void SetCanvasDecorator( TQtCanvasPainter *decorator); | |
| | | | |
| public: | | public: | |
| // Static method to immitate ROOT as needed | | // Static method to immitate ROOT as needed | |
| static TApplication *InitRint(Bool_t prompt=kFALSE, const char *appClass
Name="QtRint", int *argc=0, char **argv=0, | | static TApplication *InitRint(Bool_t prompt=kFALSE, const char *appClass
Name="QtRint", int *argc=0, char **argv=0, | |
| void *options = 0, int numOptions = 0, Bool_t noLogo = kTRUE); | | void *options = 0, int numOptions = 0, Bool_t noLogo = kTRUE); | |
| // Proxy methods to access the TCanvas selected TObject | | // Proxy methods to access the TCanvas selected TObject | |
| // and last processed ROOT TCanvas event | | // and last processed ROOT TCanvas event | |
| Int_t GetEvent() const; | | Int_t GetEvent() const; | |
| Int_t GetEventX() const; | | Int_t GetEventX() const; | |
| Int_t GetEventY() const; | | Int_t GetEventY() const; | |
| | | | |
| skipping to change at line 307 | | skipping to change at line 309 | |
| | | | |
| //----- bit manipulation | | //----- bit manipulation | |
| inline UInt_t TQtWidget::GetAllBits() const { return fBits;
} | | inline UInt_t TQtWidget::GetAllBits() const { return fBits;
} | |
| inline void TQtWidget::SetAllBits(UInt_t f) { fBits = f;
} | | inline void TQtWidget::SetAllBits(UInt_t f) { fBits = f;
} | |
| inline void TQtWidget::SetBit(UInt_t f) { fBits |= f & kBitMask;
} | | inline void TQtWidget::SetBit(UInt_t f) { fBits |= f & kBitMask;
} | |
| inline void TQtWidget::ResetBit(UInt_t f) { fBits &= ~(f & kBitMask
); } | | inline void TQtWidget::ResetBit(UInt_t f) { fBits &= ~(f & kBitMask
); } | |
| inline Bool_t TQtWidget::TestBit(UInt_t f) const { return (Bool_t) ((fBits
& f) != 0); } | | inline Bool_t TQtWidget::TestBit(UInt_t f) const { return (Bool_t) ((fBits
& f) != 0); } | |
| inline Int_t TQtWidget::TestBits(UInt_t f) const { return (Int_t) (fBits &
f); } | | inline Int_t TQtWidget::TestBits(UInt_t f) const { return (Int_t) (fBits &
f); } | |
| inline void TQtWidget::InvertBit(UInt_t f) { fBits ^= f & kBitMask;
} | | inline void TQtWidget::InvertBit(UInt_t f) { fBits ^= f & kBitMask;
} | |
| | | | |
|
| | | inline TQtCanvasPainter *TQtWidget::CanvasDecorator() { return fCanvasDecor | |
| | | ator; } | |
| | | inline void TQtWidget::SetCanvasDecorator( TQtCanvasPainter *decorator) { | |
| | | fCanvasDecorator = decorator;} | |
| | | | |
| inline void TQtWidget::EnableSignalEvents (UInt_t f){ SetBit (f); } | | inline void TQtWidget::EnableSignalEvents (UInt_t f){ SetBit (f); } | |
| inline void TQtWidget::DisableSignalEvents (UInt_t f){ ResetBit(f); } | | inline void TQtWidget::DisableSignalEvents (UInt_t f){ ResetBit(f); } | |
| inline Bool_t TQtWidget::IsSignalEventEnabled(UInt_t f) const { return Test
Bit (f); } | | inline Bool_t TQtWidget::IsSignalEventEnabled(UInt_t f) const { return Test
Bit (f); } | |
| inline void TQtWidget::EmitSignal(UInt_t f) {if (IsSignalEventEnabled(f)
) EmitTestedSignal();} | | inline void TQtWidget::EmitSignal(UInt_t f) {if (IsSignalEventEnabled(f)
) EmitTestedSignal();} | |
| inline void TQtWidget::SetIgnoreLeaveEnter(int ignore) { fIgnoreLeaveEnte
r = ignore; } | | inline void TQtWidget::SetIgnoreLeaveEnter(int ignore) { fIgnoreLeaveEnte
r = ignore; } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 11 change blocks. |
| 21 lines changed or deleted | | 29 lines changed or added | |
|
| TSpectrum2Painter.h | | TSpectrum2Painter.h | |
| | | | |
| skipping to change at line 34 | | skipping to change at line 34 | |
| // // | | // // | |
| // TSpectrum2Painter Algorithms // | | // TSpectrum2Painter Algorithms // | |
| // // | | // // | |
| // 3D graphics representations package. // | | // 3D graphics representations package. // | |
| // // | | // // | |
| ////////////////////////////////////////////////////////////////////////// | | ////////////////////////////////////////////////////////////////////////// | |
| | | | |
| class TSpectrum2Painter: public TNamed { | | class TSpectrum2Painter: public TNamed { | |
| | | | |
| public: | | public: | |
|
| TSpectrum2Painter(TH2* h2); | | TSpectrum2Painter(TH2* h2, Int_t bs); | |
| virtual ~TSpectrum2Painter(); | | virtual ~TSpectrum2Painter(); | |
| | | | |
| void GetAngles(Int_t &alpha,Int_t &beta,Int_t &view); | | void GetAngles(Int_t &alpha,Int_t &beta,Int_t &view); | |
| void GetBezier(Int_t &bezier); | | void GetBezier(Int_t &bezier); | |
| void GetChanGrid(Int_t &enable,Int_t &color); | | void GetChanGrid(Int_t &enable,Int_t &color); | |
| void GetChanMarks(Int_t &enable,Int_t &color,Int_t &width,Int_t &height,
Int_t &style); | | void GetChanMarks(Int_t &enable,Int_t &color,Int_t &width,Int_t &height,
Int_t &style); | |
| void GetColorAlgorithm(Int_t &colorAlgorithm); | | void GetColorAlgorithm(Int_t &colorAlgorithm); | |
| void GetColorIncrements(Double_t &r,Double_t &g,Double_t &b); | | void GetColorIncrements(Double_t &r,Double_t &g,Double_t &b); | |
| void GetContourWidth(Int_t &width); | | void GetContourWidth(Int_t &width); | |
| void GetDisplayMode(Int_t &modeGroup,Int_t &displayMode); | | void GetDisplayMode(Int_t &modeGroup,Int_t &displayMode); | |
| | | | |
| skipping to change at line 67 | | skipping to change at line 67 | |
| void SetColorIncrements(Double_t r,Double_t g,Double_t b); | | void SetColorIncrements(Double_t r,Double_t g,Double_t b); | |
| void SetContourWidth(Int_t width); | | void SetContourWidth(Int_t width); | |
| void SetDisplayMode(Int_t modeGroup,Int_t displayMode); | | void SetDisplayMode(Int_t modeGroup,Int_t displayMode); | |
| void SetLightHeightWeight(Double_t weight); | | void SetLightHeightWeight(Double_t weight); | |
| void SetLightPosition(Int_t x,Int_t y,Int_t z); | | void SetLightPosition(Int_t x,Int_t y,Int_t z); | |
| void SetNodes(Int_t nodesx,Int_t nodesy); | | void SetNodes(Int_t nodesx,Int_t nodesy); | |
| void SetPenAttr(Int_t color,Int_t style,Int_t width); | | void SetPenAttr(Int_t color,Int_t style,Int_t width); | |
| void SetShading(Int_t shading,Int_t shadow); | | void SetShading(Int_t shading,Int_t shadow); | |
| void SetZScale(Int_t scale); | | void SetZScale(Int_t scale); | |
| | | | |
|
| static void PaintSpectrum(TH2* h2, Option_t *option=""); | | static void PaintSpectrum(TH2* h2, Option_t *option="",Int_t bs=1600); | |
| | | | |
| enum { | | enum { | |
| kModeGroupSimple=0, | | kModeGroupSimple=0, | |
| kModeGroupHeight=1, | | kModeGroupHeight=1, | |
| kModeGroupLight=2, | | kModeGroupLight=2, | |
| kModeGroupLightHeight=3, | | kModeGroupLightHeight=3, | |
| kDisplayModePoints=1, | | kDisplayModePoints=1, | |
| kDisplayModeGrid=2, | | kDisplayModeGrid=2, | |
| kDisplayModeContours=3, | | kDisplayModeContours=3, | |
| kDisplayModeBars=4, | | kDisplayModeBars=4, | |
| | | | |
| skipping to change at line 118 | | skipping to change at line 118 | |
| kChannelMarksNotDrawn=0, | | kChannelMarksNotDrawn=0, | |
| kChannelMarksDrawn=1, | | kChannelMarksDrawn=1, | |
| kChannelMarksStyleDot=1, | | kChannelMarksStyleDot=1, | |
| kChannelMarksStyleCross=2, | | kChannelMarksStyleCross=2, | |
| kChannelMarksStyleStar=3, | | kChannelMarksStyleStar=3, | |
| kChannelMarksStyleRectangle=4, | | kChannelMarksStyleRectangle=4, | |
| kChannelMarksStyleX=5, | | kChannelMarksStyleX=5, | |
| kChannelMarksStyleDiamond=6, | | kChannelMarksStyleDiamond=6, | |
| kChannelMarksStyleTriangle=7, | | kChannelMarksStyleTriangle=7, | |
| kChannelGridNotDrawn=0, | | kChannelGridNotDrawn=0, | |
|
| kChannelGridDrawn=1, | | kChannelGridDrawn=1 | |
| kMaximumXScreenResolution=1600 | | | |
| }; | | }; | |
| | | | |
| protected: | | protected: | |
| TH2 *fH2; //pointer to 2D histogram TH2 | | TH2 *fH2; //pointer to 2D histogram TH2 | |
| Int_t fXmin; //x-starting channel of spectrum | | Int_t fXmin; //x-starting channel of spectrum | |
| Int_t fXmax; //x-end channel of spectrum | | Int_t fXmax; //x-end channel of spectrum | |
| Int_t fYmin; //y-starting channel of spectrum | | Int_t fYmin; //y-starting channel of spectrum | |
| Int_t fYmax; //y-end channel of spectrum | | Int_t fYmax; //y-end channel of spectrum | |
| Double_t fZmin; //base counts | | Double_t fZmin; //base counts | |
| Double_t fZmax; //counts full scale | | Double_t fZmax; //counts full scale | |
| | | | |
| skipping to change at line 185 | | skipping to change at line 184 | |
| Double_t fTyx; | | Double_t fTyx; | |
| Double_t fTyy; | | Double_t fTyy; | |
| Double_t fTyz; | | Double_t fTyz; | |
| Double_t fVx; | | Double_t fVx; | |
| Double_t fVy; | | Double_t fVy; | |
| Double_t fNuSli; | | Double_t fNuSli; | |
| | | | |
| //auxiliary internal variables, working place | | //auxiliary internal variables, working place | |
| Double_t fZ,fZeq,fGbezx,fGbezy,fDxspline,fDyspline,fZPresetValue; | | Double_t fZ,fZeq,fGbezx,fGbezy,fDxspline,fDyspline,fZPresetValue; | |
| Int_t fXt,fYt,fXs,fYs,fXe,fYe,fLine; | | Int_t fXt,fYt,fXs,fYs,fXe,fYe,fLine; | |
|
| Short_t *fEnvelope; //! | | Short_t *fEnvelope; //! | |
| Short_t *fEnvelopeContour; //! | | Short_t *fEnvelopeContour; //! | |
| TColor *fNewColor; //! | | TColor *fNewColor; //! | |
| | | Int_t fMaximumXScreenResolution; //!buffers' size | |
| Int_t fNewColorIndex; | | Int_t fNewColorIndex; | |
| Int_t fBzX[4]; | | Int_t fBzX[4]; | |
| Int_t fBzY[4]; | | Int_t fBzY[4]; | |
| | | | |
| Int_t BezC(Int_t i); | | Int_t BezC(Int_t i); | |
| Double_t BezierBlend(Int_t i,Double_t bezf); | | Double_t BezierBlend(Int_t i,Double_t bezf); | |
| void BezierSmoothing(Double_t bezf); | | void BezierSmoothing(Double_t bezf); | |
| Double_t ColorCalculation(Double_t dx1,Double_t dy1,Double_t z1,Double_t
dx2,Double_t dy2,Double_t z2,Double_t dx3,Double_t dy3,Double_t z3);//calc
ulation of new color | | Double_t ColorCalculation(Double_t dx1,Double_t dy1,Double_t z1,Double_t
dx2,Double_t dy2,Double_t z2,Double_t dx3,Double_t dy3,Double_t z3);//calc
ulation of new color | |
| void ColorModel(unsigned ui,unsigned ui1,unsigned ui2,unsigned ui3);
//calculation of color according to chosen algorithm | | void ColorModel(unsigned ui,unsigned ui1,unsigned ui2,unsigned ui3);
//calculation of color according to chosen algorithm | |
| void CopyEnvelope(Double_t xr,Double_t xs,Double_t yr,Double_t ys); | | void CopyEnvelope(Double_t xr,Double_t xs,Double_t yr,Double_t ys); | |
| | | | |
End of changes. 4 change blocks. |
| 7 lines changed or deleted | | 7 lines changed or added | |
|
| TUnfold.h | | TUnfold.h | |
| // Author: Stefan Schmitt | | // Author: Stefan Schmitt | |
| // DESY, 13/10/08 | | // DESY, 13/10/08 | |
| | | | |
|
| // Version 13, new methods for derived classes | | // Version 15, simplified L-curve scan, new tau definition, new eror calc. | |
| // | | // | |
| // History: | | // History: | |
|
| | | // Version 14, with changes in TUnfoldSys.cxx | |
| | | // Version 13, new methods for derived classes | |
| // Version 12, with support for preconditioned matrix inversion | | // Version 12, with support for preconditioned matrix inversion | |
| // Version 11, regularisation methods have return values | | // Version 11, regularisation methods have return values | |
| // Version 10, with bug-fix in TUnfold.cxx | | // Version 10, with bug-fix in TUnfold.cxx | |
| // Version 9, implements method for optimized inversion of sparse matrix | | // Version 9, implements method for optimized inversion of sparse matrix | |
| // Version 8, replace all TMatrixSparse matrix operations by private cod
e | | // Version 8, replace all TMatrixSparse matrix operations by private cod
e | |
| // Version 7, fix problem with TMatrixDSparse,TMatrixD multiplication | | // Version 7, fix problem with TMatrixDSparse,TMatrixD multiplication | |
| // Version 6, completely remove definition of class XY | | // Version 6, completely remove definition of class XY | |
| // Version 5, move definition of class XY from TUnfold.C to this file | | // Version 5, move definition of class XY from TUnfold.C to this file | |
| // Version 4, with bug-fix in TUnfold.C | | // Version 4, with bug-fix in TUnfold.C | |
| // Version 3, with bug-fix in TUnfold.C | | // Version 3, with bug-fix in TUnfold.C | |
| | | | |
| skipping to change at line 29 | | skipping to change at line 31 | |
| // Version 0, stable version of basic unfolding algorithm | | // Version 0, stable version of basic unfolding algorithm | |
| | | | |
| #ifndef ROOT_TUnfold | | #ifndef ROOT_TUnfold | |
| #define ROOT_TUnfold | | #define ROOT_TUnfold | |
| | | | |
| ////////////////////////////////////////////////////////////////////////// | | ////////////////////////////////////////////////////////////////////////// | |
| // // | | // // | |
| // // | | // // | |
| // TUnfold solves the inverse problem // | | // TUnfold solves the inverse problem // | |
| // // | | // // | |
|
| // T T // | | // T -1 2 T // | |
| // chi**2 = 1/2 * (y-Ax) V (y-Ax) + tau (L(x-x0)) L(x-x0) // | | // chi**2 = (y-Ax) Vyy (y-Ax) + tau (L(x-x0)) L(x-x0) // | |
| // // | | // // | |
| // Monte Carlo input // | | // Monte Carlo input // | |
| // y: vector of measured quantities (dimension ny) // | | // y: vector of measured quantities (dimension ny) // | |
|
| // V: inverse of covariance matrix for y (dimension ny x ny) // | | // Vyy: covariance matrix for y (dimension ny x ny) // | |
| // A: migration matrix (dimension ny x nx) // | | // A: migration matrix (dimension ny x nx) // | |
| // x: unknown underlying distribution (dimension nx) // | | // x: unknown underlying distribution (dimension nx) // | |
| // Regularisation // | | // Regularisation // | |
| // tau: parameter, defining the regularisation strength // | | // tau: parameter, defining the regularisation strength // | |
| // L: matrix of regularisation conditions (dimension nl x nx) // | | // L: matrix of regularisation conditions (dimension nl x nx) // | |
| // x0: underlying distribution bias // | | // x0: underlying distribution bias // | |
| // // | | // // | |
| // where chi**2 is minimized as a function of x // | | // where chi**2 is minimized as a function of x // | |
| // // | | // // | |
| // The algorithm is based on "standard" matrix inversion, with the // | | // The algorithm is based on "standard" matrix inversion, with the // | |
| | | | |
| skipping to change at line 63 | | skipping to change at line 65 | |
| | | | |
| #include <TH1D.h> | | #include <TH1D.h> | |
| #include <TH2D.h> | | #include <TH2D.h> | |
| #include <TObject.h> | | #include <TObject.h> | |
| #include <TArrayI.h> | | #include <TArrayI.h> | |
| #include <TSpline.h> | | #include <TSpline.h> | |
| #include <TMatrixDSparse.h> | | #include <TMatrixDSparse.h> | |
| #include <TMatrixD.h> | | #include <TMatrixD.h> | |
| #include <TObjArray.h> | | #include <TObjArray.h> | |
| | | | |
|
| class TUnfold:public TObject { | | class TUnfold : public TObject { | |
| private: | | private: | |
| void InitTUnfold(void); // initialize all data members | | void InitTUnfold(void); // initialize all data members | |
|
| | | public: | |
| | | enum EConstraint { | |
| | | kEConstraintNone =0, // use no extra constraint | |
| | | kEConstraintArea =1 // enforce preservation of the area | |
| | | }; | |
| | | enum ERegMode { // regularisation scheme | |
| | | kRegModeNone = 0, // no regularisation | |
| | | kRegModeSize = 1, // regularise the size of the output | |
| | | kRegModeDerivative = 2, // regularize the 1st derivative of the out | |
| | | put | |
| | | kRegModeCurvature = 3, // regularize the 2nd derivative of the out | |
| | | put | |
| | | kRegModeMixed = 4 // mixed regularisation pattern | |
| | | }; | |
| protected: | | protected: | |
|
| TMatrixDSparse * fA; // Input: matrix | | TMatrixDSparse * fA; // Input: matrix | |
| TMatrixDSparse *fLsquared; // Input: regularisation conditions squared | | TMatrixDSparse *fLsquared; // Input: regularisation conditions squared | |
|
| TMatrixDSparse *fV; // Input: covariance matrix for y | | TMatrixDSparse *fVyy; // Input: covariance matrix for y | |
| TMatrixD *fY; // Input: y | | TMatrixD *fY; // Input: y | |
| TMatrixD *fX0; // Input: x0 | | TMatrixD *fX0; // Input: x0 | |
|
| Double_t fTau; // Input: regularisation parameter | | Double_t fTauSquared; // Input: regularisation parameter | |
| Double_t fBiasScale; // Input: scale factor for the bias | | Double_t fBiasScale; // Input: scale factor for the bias | |
| TArrayI fXToHist; // Input: matrix indices -> histogram bins | | TArrayI fXToHist; // Input: matrix indices -> histogram bins | |
| TArrayI fHistToX; // Input: histogram bins -> matrix indices | | TArrayI fHistToX; // Input: histogram bins -> matrix indices | |
| TArrayD fSumOverY; // Input: sum of all columns | | TArrayD fSumOverY; // Input: sum of all columns | |
|
| TMatrixDSparse *fEinv; // Result: inverse error matrix | | EConstraint fConstraint; // Input: type of constraint to use | |
| TMatrixDSparse *fAtV; // Result: fA# times fV | | ERegMode fRegMode; // Input: type of regularisation | |
| TMatrixD *fE; // Result: error matrix | | private: | |
| TMatrixD *fX; // Result: x | | TMatrixD *fX; // Result: x | |
|
| | | TMatrixDSparse *fVxx; // Result: covariance matrix on x | |
| TMatrixDSparse *fAx; // Result: Ax | | TMatrixDSparse *fAx; // Result: Ax | |
| Double_t fChi2A; // Result: chi**2 contribution from (y-Ax)V
(y-Ax) | | Double_t fChi2A; // Result: chi**2 contribution from (y-Ax)V
(y-Ax) | |
|
| Double_t fChi2L; // Result: chi**2 contribution from tau(x-s
*x0)Lsquared(x-s*x0) | | Double_t fLXsquared; // Result: chi**2 contribution from (x-s*x0
)Lsquared(x-s*x0) | |
| Double_t fRhoMax; // Result: maximum global correlation | | Double_t fRhoMax; // Result: maximum global correlation | |
| Double_t fRhoAvg; // Result: average global correlation | | Double_t fRhoAvg; // Result: average global correlation | |
| Int_t fNdf; // Result: number of degrees of freedom | | Int_t fNdf; // Result: number of degrees of freedom | |
|
| | | TMatrixDSparse *fDXDAM[2]; // Result: part of derivative dx_k/dA_ij | |
| | | TMatrixDSparse *fDXDAZ[2]; // Result: part of derivative dx_k/dA_ij | |
| | | TMatrixDSparse *fDXDtauSquared; // Result: derivative dx/dtau | |
| | | TMatrixDSparse *fDXDY; // Result: derivative dx/dy | |
| protected: | | protected: | |
| TUnfold(void); // for derived classes | | TUnfold(void); // for derived classes | |
| virtual Double_t DoUnfold(void); // the unfolding algorithm | | virtual Double_t DoUnfold(void); // the unfolding algorithm | |
|
| virtual void CalculateChi2Rho(void); // supplementory calculations | | | |
| virtual void ClearResults(void); // clear all results | | virtual void ClearResults(void); // clear all results | |
| | | | |
|
| static TMatrixDSparse *MultiplyMSparseM(TMatrixDSparse const &a,TMatrixD | | TMatrixDSparse *MultiplyMSparseM(TMatrixDSparse const *a,TMatrixD const | |
| const &b); // multiply sparse and non-sparse matrix | | *b) const; // multiply sparse and non-sparse matrix | |
| static TMatrixDSparse *MultiplyMSparseMSparse(TMatrixDSparse const &a,TM | | TMatrixDSparse *MultiplyMSparseMSparse(TMatrixDSparse const *a,TMatrixDS | |
| atrixDSparse const &b); // multiply sparse and sparse matrix | | parse const *b) const; // multiply sparse and sparse matrix | |
| static TMatrixDSparse *MultiplyMSparseTranspMSparse(TMatrixDSparse const | | TMatrixDSparse *MultiplyMSparseTranspMSparse(TMatrixDSparse const *a,TMa | |
| &a,TMatrixDSparse const &b); // multiply transposed sparse and sparse matr | | trixDSparse const *b) const; // multiply transposed sparse and sparse matri | |
| ix | | x | |
| static Double_t MultiplyVecMSparseVec(TMatrixDSparse const &a,TMatrixD c | | TMatrixDSparse *MultiplyMSparseMSparseTranspVector | |
| onst &v); // scalar product of v and Av | | (TMatrixDSparse const *m1,TMatrixDSparse const *m2, | |
| static TMatrixD *InvertMSparse(TMatrixDSparse const &A); // invert spars | | TMatrixTBase<Double_t> const *v) const; // calculate M_ij = sum_k [m | |
| e matrix | | 1_ik*m2_jk*v[k] ]. the pointer v may be zero (means no scaling). | |
| static Bool_t InvertMConditioned(TMatrixD &A); // invert matrix includin | | TMatrixD *InvertMSparse(TMatrixDSparse const *A) const; // invert sparse | |
| g preconditioning | | matrix | |
| static void AddMSparse(TMatrixDSparse &dest,Double_t const &f,TMatrixDSp | | static Bool_t InvertMConditioned(TMatrixD *A); // invert matrix includin | |
| arse const &src); // replacement for dest += f*src | | g preconditioning | |
| | | void AddMSparse(TMatrixDSparse *dest,Double_t const &f,TMatrixDSparse co | |
| | | nst *src); // replacement for dest += f*src | |
| | | TMatrixDSparse *CreateSparseMatrix(Int_t nrow,Int_t ncol,Int_t nele,Int_ | |
| | | t *row,Int_t *col,Double_t *data) const; // create a TMatrixDSparse from an | |
| | | array | |
| inline Int_t GetNx(void) const { | | inline Int_t GetNx(void) const { | |
| return fA->GetNcols(); | | return fA->GetNcols(); | |
| } // number of non-zero output bins | | } // number of non-zero output bins | |
| inline Int_t GetNy(void) const { | | inline Int_t GetNy(void) const { | |
| return fA->GetNrows(); | | return fA->GetNrows(); | |
| } // number of input bins | | } // number of input bins | |
|
| void ErrorMatrixToHist(TH2 *ematrix,TMatrixD const *emat,Int_t const *bi
nMap, | | void ErrorMatrixToHist(TH2 *ematrix,TMatrixDSparse const *emat,Int_t con
st *binMap, | |
| Bool_t doClear) const; // return an error matrix
as histogram | | Bool_t doClear) const; // return an error matrix
as histogram | |
|
| public: | | inline TMatrixDSparse const *GetDXDY(void) { return fDXDY; } // access d | |
| | | erivative dx/dy | |
| | | inline TMatrixDSparse const *GetDXDAM(int i) { return fDXDAM[i]; } // ac | |
| | | cess matrix parts of the derivative dx/dA | |
| | | inline TMatrixDSparse const *GetDXDAZ(int i) { return fDXDAZ[i]; } // ac | |
| | | cess vector parts of the derivative dx/dA | |
| | | inline TMatrixDSparse const *GetDXDtauSquared(void) { return fDXDtauSqua | |
| | | red; } // get derivative dx/dtauSquared | |
| | | inline TMatrixDSparse const *GetAx(void) { return fAx; } // get vector A | |
| | | x | |
| | | public: | |
| enum EHistMap { // mapping between unfolding matrix and TH2
axes | | enum EHistMap { // mapping between unfolding matrix and TH2
axes | |
| kHistMapOutputHoriz = 0, // map unfolding output to x-axis of TH2 ma
trix | | kHistMapOutputHoriz = 0, // map unfolding output to x-axis of TH2 ma
trix | |
| kHistMapOutputVert = 1 // map unfolding output to y-axis of TH2 ma
trix | | kHistMapOutputVert = 1 // map unfolding output to y-axis of TH2 ma
trix | |
| }; | | }; | |
| | | | |
|
| enum ERegMode { // regularisation scheme | | TUnfold(TH2 const *hist_A, EHistMap histmap, | |
| kRegModeNone = 0, // no regularisation | | ERegMode regmode = kRegModeSize, | |
| kRegModeSize = 1, // regularise the size of the output | | EConstraint constraint=kEConstraintArea); // constructor | |
| kRegModeDerivative = 2, // regularize the 1st derivative of the out | | | |
| put | | | |
| kRegModeCurvature = 3 // regularize the 2nd derivative of the out | | | |
| put | | | |
| }; | | | |
| TUnfold(TH2 const *hist_A, EHistMap histmap, ERegMode regmode = kRegMode | | | |
| Size); // constructor | | | |
| virtual ~ TUnfold(void); // delete data members | | virtual ~ TUnfold(void); // delete data members | |
| static void DeleteMatrix(TMatrixD **m); // delete and invalidate pointer | | static void DeleteMatrix(TMatrixD **m); // delete and invalidate pointer | |
| static void DeleteMatrix(TMatrixDSparse **m); // delete and invalidate p
ointer | | static void DeleteMatrix(TMatrixDSparse **m); // delete and invalidate p
ointer | |
| void SetBias(TH1 const *bias); // set alternative bias | | void SetBias(TH1 const *bias); // set alternative bias | |
|
| | | void SetConstraint(EConstraint constraint); // set type of constraint fo
r the next unfolding | |
| Int_t RegularizeSize(int bin, Double_t const &scale = 1.0); // regular
ise the size of one output bin | | Int_t RegularizeSize(int bin, Double_t const &scale = 1.0); // regular
ise the size of one output bin | |
| Int_t RegularizeDerivative(int left_bin, int right_bin, Double_t const &
scale = 1.0); // regularize difference of two output bins (1st derivative) | | Int_t RegularizeDerivative(int left_bin, int right_bin, Double_t const &
scale = 1.0); // regularize difference of two output bins (1st derivative) | |
| Int_t RegularizeCurvature(int left_bin, int center_bin, int right_bin, D
ouble_t const &scale_left = 1.0, Double_t const &scale_right = 1.0); // re
gularize curvature of three output bins (2nd derivative) | | Int_t RegularizeCurvature(int left_bin, int center_bin, int right_bin, D
ouble_t const &scale_left = 1.0, Double_t const &scale_right = 1.0); // re
gularize curvature of three output bins (2nd derivative) | |
| Int_t RegularizeBins(int start, int step, int nbin, ERegMode regmode);
// regularize a 1-dimensional curve | | Int_t RegularizeBins(int start, int step, int nbin, ERegMode regmode);
// regularize a 1-dimensional curve | |
| Int_t RegularizeBins2D(int start_bin, int step1, int nbin1, int step2, i
nt nbin2, ERegMode regmode); // regularize a 2-dimensional grid | | Int_t RegularizeBins2D(int start_bin, int step1, int nbin1, int step2, i
nt nbin2, ERegMode regmode); // regularize a 2-dimensional grid | |
| Double_t DoUnfold(Double_t const &tau, | | Double_t DoUnfold(Double_t const &tau, | |
| TH1 const *hist_y, Double_t const &scaleBias=0.0); //
do the unfolding | | TH1 const *hist_y, Double_t const &scaleBias=0.0); //
do the unfolding | |
|
| Int_t SetInput(TH1 const *hist_y, Double_t const &scaleBias=0.0,Double_t
oneOverZeroError=0.0); // define input distribution for ScanLCurve | | virtual Int_t SetInput(TH1 const *hist_y, Double_t const &scaleBias=0.0,
Double_t oneOverZeroError=0.0); // define input distribution for ScanLCurve | |
| virtual Double_t DoUnfold(Double_t const &tau); // Unfold with given cho
ice of tau | | virtual Double_t DoUnfold(Double_t const &tau); // Unfold with given cho
ice of tau | |
| virtual Int_t ScanLcurve(Int_t nPoint,Double_t const &tauMin, | | virtual Int_t ScanLcurve(Int_t nPoint,Double_t const &tauMin, | |
| Double_t const &tauMax,TGraph **lCurve, | | Double_t const &tauMax,TGraph **lCurve, | |
| TSpline **logTauX=0,TSpline **logTauY=0); // sca
n the L curve using successive calls to DoUnfold(Double_t) | | TSpline **logTauX=0,TSpline **logTauY=0); // sca
n the L curve using successive calls to DoUnfold(Double_t) | |
| TH1D *GetOutput(char const *name, char const *title, Double_t x0 = 0.0,
Double_t x1 = 0.0) const; // get unfolding result | | TH1D *GetOutput(char const *name, char const *title, Double_t x0 = 0.0,
Double_t x1 = 0.0) const; // get unfolding result | |
| TH1D *GetBias(char const *name, char const *title, Double_t x0 = 0.0, Do
uble_t x1 = 0.0) const; // get bias | | TH1D *GetBias(char const *name, char const *title, Double_t x0 = 0.0, Do
uble_t x1 = 0.0) const; // get bias | |
| TH1D *GetFoldedOutput(char const *name, char const *title, Double_t y0 =
0.0, Double_t y1 = 0.0) const; // get folded unfolding result | | TH1D *GetFoldedOutput(char const *name, char const *title, Double_t y0 =
0.0, Double_t y1 = 0.0) const; // get folded unfolding result | |
| TH1D *GetInput(char const *name, char const *title, Double_t y0 = 0.0, D
ouble_t y1 = 0.0) const; // get unfolding input | | TH1D *GetInput(char const *name, char const *title, Double_t y0 = 0.0, D
ouble_t y1 = 0.0) const; // get unfolding input | |
| TH2D *GetRhoIJ(char const *name, char const *title, Double_t x0 = 0.0, D
ouble_t x1 = 0.0) const; // get correlation coefficients | | TH2D *GetRhoIJ(char const *name, char const *title, Double_t x0 = 0.0, D
ouble_t x1 = 0.0) const; // get correlation coefficients | |
| TH2D *GetEmatrix(char const *name, char const *title, Double_t x0 = 0.0,
Double_t x1 = 0.0) const; // get error matrix | | TH2D *GetEmatrix(char const *name, char const *title, Double_t x0 = 0.0,
Double_t x1 = 0.0) const; // get error matrix | |
| TH1D *GetRhoI(char const *name, char const *title, Double_t x0 = 0.0, Do
uble_t x1 = 0.0) const; // get global correlation coefficients | | TH1D *GetRhoI(char const *name, char const *title, Double_t x0 = 0.0, Do
uble_t x1 = 0.0) const; // get global correlation coefficients | |
| TH2D *GetLsquared(char const *name, char const *title, Double_t x0 = 0.0
, Double_t x1 = 0.0) const; // get regularisation conditions squared | | TH2D *GetLsquared(char const *name, char const *title, Double_t x0 = 0.0
, Double_t x1 = 0.0) const; // get regularisation conditions squared | |
| | | | |
| void GetOutput(TH1 *output,Int_t const *binMap=0) const; // get output d
istribution, averaged over bins | | void GetOutput(TH1 *output,Int_t const *binMap=0) const; // get output d
istribution, averaged over bins | |
| void GetEmatrix(TH2 *ematrix,Int_t const *binMap=0) const; // get error
matrix, averaged over bins | | void GetEmatrix(TH2 *ematrix,Int_t const *binMap=0) const; // get error
matrix, averaged over bins | |
| Double_t GetRhoI(TH1 *rhoi,TH2 *ematrixinv=0,Int_t const *binMap=0) cons
t; // get global correlation coefficients and inverse of error matrix, aver
aged over bins | | Double_t GetRhoI(TH1 *rhoi,TH2 *ematrixinv=0,Int_t const *binMap=0) cons
t; // get global correlation coefficients and inverse of error matrix, aver
aged over bins | |
| void GetRhoIJ(TH2 *rhoij,Int_t const *binMap=0) const; // get correlatio
n coefficients, averaged over bins | | void GetRhoIJ(TH2 *rhoij,Int_t const *binMap=0) const; // get correlatio
n coefficients, averaged over bins | |
|
| Double_t const &GetTau(void) const; // regularisation parameter | | Double_t GetTau(void) const; // regularisation parameter | |
| Double_t const &GetRhoMax(void) const; // maximum global correlati | | Double_t GetRhoMax(void) const; // maximum global correlation | |
| on | | Double_t GetRhoAvg(void) const; // average global correlation | |
| Double_t const &GetRhoAvg(void) const; // average global correlati | | Double_t GetChi2A(void) const; // chi**2 contribution from A | |
| on | | Double_t GetChi2L(void) const; // chi**2 contribution from L | |
| Double_t const &GetChi2A(void) const; // chi**2 contribution from | | virtual Double_t GetLcurveX(void) const; // x axis of L curve | |
| A | | virtual Double_t GetLcurveY(void) const; // y axis of L curve | |
| Double_t const &GetChi2L(void) const; // chi**2 contribution from | | | |
| L | | | |
| Double_t GetLcurveX(void) const; // x axis of L curve | | | |
| Double_t GetLcurveY(void) const; // y axis of L curve | | | |
| Int_t GetNdf(void) const; // number of degrees of freedom | | Int_t GetNdf(void) const; // number of degrees of freedom | |
| Int_t GetNpar(void) const; // number of parameters | | Int_t GetNpar(void) const; // number of parameters | |
| | | | |
| ClassDef(TUnfold, 0) //Unfolding with support for L-curve analysis | | ClassDef(TUnfold, 0) //Unfolding with support for L-curve analysis | |
| }; | | }; | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 21 change blocks. |
| 52 lines changed or deleted | | 77 lines changed or added | |
|
| TUnfoldSys.h | | TUnfoldSys.h | |
| // Author: Stefan Schmitt | | // Author: Stefan Schmitt | |
| // DESY, 23/01/09 | | // DESY, 23/01/09 | |
| | | | |
|
| // Version 13, support for systematic errors | | // Version 15, fix bugs with uncorr. uncertainties, add backgnd subtraction | |
| | | // | |
| | | // History: | |
| | | // Version 14, with changes in TUnfoldSys.cxx | |
| | | // Version 13, support for systematic errors | |
| | | | |
| #ifndef ROOT_TUnfoldSys | | #ifndef ROOT_TUnfoldSys | |
| #define ROOT_TUnfoldSys | | #define ROOT_TUnfoldSys | |
| | | | |
| #include <TUnfold.h> | | #include <TUnfold.h> | |
| | | | |
| class TMap; | | class TMap; | |
| | | | |
| class TUnfoldSys : public TUnfold { | | class TUnfoldSys : public TUnfold { | |
| private: | | private: | |
| void InitTUnfoldSys(void); // initialize all data members | | void InitTUnfoldSys(void); // initialize all data members | |
| protected: | | protected: | |
|
| TMatrixDSparse * fDA2; // Input: uncorrelated errors on fA (square | | TMatrixDSparse *fDAinRelSq; // Input: normalized errors from input matr | |
| d) | | ix | |
| TMatrixD* fDAcol; // Input: normalized column errors on fA | | TMatrixD* fDAinColRelSq; // Input: normalized column err.sq. (inp.ma | |
| | | tr.) | |
| TMatrixD* fAoutside; // Input: underflow/overflow bins | | TMatrixD* fAoutside; // Input: underflow/overflow bins | |
| TMap *fSysIn; // Input: correlated errors | | TMap *fSysIn; // Input: correlated errors | |
|
| TMatrixDSparse *fESparse; // Result: sparse version of fE | | TMap *fBgrIn; // Input: size of background sources | |
| TMatrixDSparse *fVYAx; // Result: V(y-Ax) for syst.errors | | TMap *fBgrErrUncorrIn; // Input: uncorrelated error from bgr sourc | |
| TMatrixDSparse *fEAtV; // Result: EA#V for syst.errors | | es | |
| TMatrixDSparse *fAE; // Result: AE for chi**2 | | TMap *fBgrErrCorrIn; // Input: background sources correlated err | |
| TMatrixDSparse *fAEAtV_one; // Result: AEA#V-1 for chi**2 | | or | |
| TMatrixD *fErrorUncorrX; // Result: syst.error from fDA2 on fX | | Double_t fDtau; // Input: error on tau | |
| TMatrixD *fErrorUncorrAx; // Result: syst.error from fDA2 on fAx | | TMatrixD *fYData; // Input: fY prior to bgr subtraction | |
| TMap *fErrorCorrX; // Result: syst.error from fSysIn | | TMatrixDSparse *fVyyData; // Input: error on fY prior to bgr subtract | |
| TMap *fErrorCorrAx; // Result: syst.error from fSysIn | | ion | |
| | | TMatrixDSparse *fEmatUncorrX; // Result: syst.error from fDA2 on fX | |
| | | TMatrixDSparse *fEmatUncorrAx; // Result: syst.error from fDA2 on fA | |
| | | x | |
| | | TMap *fDeltaCorrX; // Result: syst.shift from fSysIn on fX | |
| | | TMap *fDeltaCorrAx; // Result: syst.shift from fSysIn on fAx | |
| | | TMatrixDSparse *fDeltaSysTau; // Result: systematic shift from tau | |
| protected: | | protected: | |
| TUnfoldSys(void); // for derived classes | | TUnfoldSys(void); // for derived classes | |
| virtual void ClearResults(void); // clear all results | | virtual void ClearResults(void); // clear all results | |
| virtual void PrepareSysError(void); // common calculations for syst.erro
rs | | virtual void PrepareSysError(void); // common calculations for syst.erro
rs | |
|
| virtual TMatrixD *PrepareUncorrEmat(TMatrixDSparse const *m1,TMatrixDSpa | | virtual TMatrixDSparse *PrepareUncorrEmat(TMatrixDSparse const *m1,TMatr | |
| rse const *m2); // calculate uncorrelated error matrix | | ixDSparse const *m2); // calculate uncorrelated error matrix | |
| virtual TMatrixD *PrepareCorrEmat(TMatrixDSparse const *m1,TMatrixDSpars | | virtual TMatrixDSparse *PrepareCorrEmat(TMatrixDSparse const *m1,TMatrix | |
| e const *m2,TMatrixDSparse const *dsys); // calculate correlated error matr | | DSparse const *m2,TMatrixDSparse const *dsys); // calculate correlated erro | |
| ix | | r matrix | |
| | | void ScaleColumnsByVector(TMatrixDSparse *m,TMatrixTBase<Double_t> const | |
| | | *v) const; // scale columns of m by the corresponding rows of v | |
| | | void VectorMapToHist(TH1 *hist_delta,TMatrixDSparse const *delta,Int_t c | |
| | | onst *binMap); // map and sum vector delta, save in hist_delta | |
| | | void GetEmatrixFromVyy(TMatrixDSparse const *vyy,TH2 *ematrix,Int_t cons | |
| | | t *binMap,Bool_t clearEmat); // propagate error matrix vyy to the result | |
| | | void DoBackgroundSubtraction(void); | |
| public: | | public: | |
| enum ESysErrMode { // meaning of the argument to AddSysError() | | enum ESysErrMode { // meaning of the argument to AddSysError() | |
| kSysErrModeMatrix=0, // matrix is an alternative to the default matrix
, the errors are the difference to the original matrix | | kSysErrModeMatrix=0, // matrix is an alternative to the default matrix
, the errors are the difference to the original matrix | |
| kSysErrModeShift=1, // matrix gives the absolute shifts | | kSysErrModeShift=1, // matrix gives the absolute shifts | |
| kSysErrModeRelative=2 // matrix gives the relative shifts | | kSysErrModeRelative=2 // matrix gives the relative shifts | |
| }; | | }; | |
|
| TUnfoldSys(TH2 const *hist_A, EHistMap histmap, ERegMode regmode = kRegM | | TUnfoldSys(TH2 const *hist_A, EHistMap histmap, ERegMode regmode = kRegM | |
| odeSize); // constructor | | odeSize, | |
| | | EConstraint constraint=kEConstraintNone); // constructor | |
| virtual ~ TUnfoldSys(void); // delete data members | | virtual ~ TUnfoldSys(void); // delete data members | |
| void AddSysError(TH2 const *sysError,char const *name, EHistMap histmap, | | void AddSysError(TH2 const *sysError,char const *name, EHistMap histmap, | |
| ESysErrMode mode); // add a systematic error source | | ESysErrMode mode); // add a systematic error source | |
|
| void GetEmatrixSysUncorr(TH2 *ematrix,Int_t const *binMap=0,Bool_t clear | | void GetDeltaSysSource(TH1 *hist_delta,char const *source, | |
| Emat=kTRUE); // get error matrix contribution from statistical errors on th | | Int_t const *binMap=0); // get systematic shifts | |
| e matrix A | | from one systematic source | |
| | | void SubtractBackground(TH1 const *hist_bgr,char const *name, | |
| | | Double_t const &scale=1.0, | |
| | | Double_t const &scale_error=0.0); // subtract ba | |
| | | ckground prior to unfolding | |
| | | virtual Int_t SetInput(TH1 const *hist_y, Double_t const &scaleBias=0.0, | |
| | | Double_t oneOverZeroError=0.0); // define input consistently in case of bac | |
| | | kground subtraction | |
| | | void GetDeltaSysBackgroundScale(TH1 *delta,char const *source, | |
| | | Int_t const *binMap=0); // get correlated u | |
| | | ncertainty induced by the scale uncertainty of a background source | |
| | | void SetTauError(Double_t const &delta_tau); // set uncertainty on tau | |
| | | void GetDeltaSysTau(TH1 *delta,Int_t const *binMap=0); // get correlated | |
| | | uncertainty from varying tau | |
| | | void GetEmatrixSysUncorr(TH2 *ematrix,Int_t const *binMap=0,Bool_t clear | |
| | | Emat=kTRUE); // get error matrix contribution from uncorrelated errors on t | |
| | | he matrix A | |
| void GetEmatrixSysSource(TH2 *ematrix,char const *source, | | void GetEmatrixSysSource(TH2 *ematrix,char const *source, | |
| Int_t const *binMap=0,Bool_t clearEmat=kTRUE);
// get error matrix from one systematic source | | Int_t const *binMap=0,Bool_t clearEmat=kTRUE);
// get error matrix from one systematic source | |
|
| | | void GetEmatrixSysBackgroundUncorr(TH2 *ematrix,char const *source, | |
| void GetEmatrixSysTotal(TH2 *ematrix,Int_t const *binMap=0,Bool_t clearE | | Int_t const *binMap=0,Bool_t clearEmat=k | |
| mat=kTRUE); // get total systematic error | | TRUE); // get error matrix from uncorrelated error of one background source | |
| void GetEmatrixTotal(TH2 *ematrix,Int_t const *binMap=0); // get total e | | void GetEmatrixSysBackgroundScale(TH2 *ematrix,char const *source, | |
| rror including statistical error | | Int_t const *binMap=0,Bool_t clearEmat=kT | |
| | | RUE); // get error matrix from the scale error of one background source | |
| Double_t GetChi2Sys(void); | | void GetEmatrixSysTau(TH2 *ematrix, | |
| | | Int_t const *binMap=0,Bool_t clearEmat=kTRUE); // get | |
| | | error matrix from tau variation | |
| | | void GetEmatrixInput(TH2 *ematrix,Int_t const *binMap=0,Bool_t clearEmat | |
| | | =kTRUE); // get error contribution from input vector | |
| | | void GetEmatrixTotal(TH2 *ematrix,Int_t const *binMap=0); // get total e | |
| | | rror including systematic,statistical,background,tau errors | |
| | | Double_t GetChi2Sys(void); // get total chi**2 including all systematic | |
| | | errors | |
| | | | |
| ClassDef(TUnfoldSys, 0) //Unfolding with support for systematic error pr
opagation | | ClassDef(TUnfoldSys, 0) //Unfolding with support for systematic error pr
opagation | |
| }; | | }; | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 7 change blocks. |
| 30 lines changed or deleted | | 73 lines changed or added | |
|
| TVirtualX.interface.h | | TVirtualX.interface.h | |
|
| // @(#)root/base:$Id: TVirtualX.interface.h 30386 2009-09-23 19:06:28Z brun
$ | | // @(#)root/base:$Id: TVirtualX.interface.h 33707 2010-06-02 06:27:34Z brun
$ | |
| // Author: Valeri Fine 28/07/2004 | | // Author: Valeri Fine 28/07/2004 | |
| | | | |
| // | | // | |
| // This is a copy of the all "abstract" TVirtualX methods to make sure | | // This is a copy of the all "abstract" TVirtualX methods to make sure | |
| // we don't miss it with the implementation | | // we don't miss it with the implementation | |
| // | | // | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| | | | |
| skipping to change at line 247 | | skipping to change at line 247 | |
| virtual void FreeFontNames(char **fontlist); | | virtual void FreeFontNames(char **fontlist); | |
| virtual Drawable_t CreateImage(UInt_t width, UInt_t height); | | virtual Drawable_t CreateImage(UInt_t width, UInt_t height); | |
| virtual void GetImageSize(Drawable_t id, UInt_t &width, UInt_t &
height); | | virtual void GetImageSize(Drawable_t id, UInt_t &width, UInt_t &
height); | |
| virtual void PutPixel(Drawable_t id, Int_t x, Int_t y, ULong_t p
ixel); | | virtual void PutPixel(Drawable_t id, Int_t x, Int_t y, ULong_t p
ixel); | |
| virtual void PutImage(Drawable_t id, GContext_t gc, Drawable_t i
mg, | | virtual void PutImage(Drawable_t id, GContext_t gc, Drawable_t i
mg, | |
| Int_t dx, Int_t dy, Int_t x, Int_t y, | | Int_t dx, Int_t dy, Int_t x, Int_t y, | |
| UInt_t w, UInt_t h); | | UInt_t w, UInt_t h); | |
| virtual void DeleteImage(Drawable_t img); | | virtual void DeleteImage(Drawable_t img); | |
| // The method to support ASImage (by V.Onuchine | | // The method to support ASImage (by V.Onuchine | |
| unsigned char *GetColorBits(Drawable_t wid, Int_t x = 0, Int_t y = 0, UI
nt_t w = 0, UInt_t h = 0); | | unsigned char *GetColorBits(Drawable_t wid, Int_t x = 0, Int_t y = 0, UI
nt_t w = 0, UInt_t h = 0); | |
|
| Pixmap_t CreatePixmapFromData(unsigned char *bits, UInt_t width, U | | virtual Pixmap_t CreatePixmapFromData(unsigned char *bits, UInt_t wi | |
| Int_t height); | | dth, UInt_t height); | |
| Window_t GetCurrentWindow() const; | | virtual Window_t GetCurrentWindow() const; | |
| | | | |
| | | virtual Int_t SupportsExtension(const char *ext) const; | |
| | | | |
| //---- Drag and Drop ----- | | //---- Drag and Drop ----- | |
| virtual void DeleteProperty(Window_t, Atom_t&); | | virtual void DeleteProperty(Window_t, Atom_t&); | |
| virtual Int_t GetProperty(Window_t, Atom_t, Long_t, Long_t, Bool_
t, Atom_t, | | virtual Int_t GetProperty(Window_t, Atom_t, Long_t, Long_t, Bool_
t, Atom_t, | |
| Atom_t*, Int_t*, ULong_t*, ULong_t*, un
signed char**); | | Atom_t*, Int_t*, ULong_t*, ULong_t*, un
signed char**); | |
| virtual void ChangeActivePointerGrab(Window_t, UInt_t, Cursor_t)
; | | virtual void ChangeActivePointerGrab(Window_t, UInt_t, Cursor_t)
; | |
| virtual void ConvertSelection(Window_t, Atom_t&, Atom_t&, Atom_t
&, Time_t&); | | virtual void ConvertSelection(Window_t, Atom_t&, Atom_t&, Atom_t
&, Time_t&); | |
| virtual Bool_t SetSelectionOwner(Window_t, Atom_t&); | | virtual Bool_t SetSelectionOwner(Window_t, Atom_t&); | |
| virtual void ChangeProperties(Window_t id, Atom_t property, Atom
_t type, | | virtual void ChangeProperties(Window_t id, Atom_t property, Atom
_t type, | |
| Int_t format, UChar_t *data, Int_t
len); | | Int_t format, UChar_t *data, Int_t
len); | |
| | | | |
End of changes. 2 change blocks. |
| 4 lines changed or deleted | | 6 lines changed or added | |
|
| TestStatSampler.h | | TestStatSampler.h | |
|
| // @(#)root/roostats:$Id: TestStatSampler.h 31276 2009-11-18 15:06:42Z mone
ta $ | | // @(#)root/roostats:$Id: TestStatSampler.h 34109 2010-06-24 15:00:16Z mone
ta $ | |
| // Author: Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke | | // Author: Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| #ifndef ROOSTATS_TestStatSampler | | #ifndef ROOSTATS_TestStatSampler | |
| | | | |
| skipping to change at line 37 | | skipping to change at line 37 | |
| #endif | | #endif | |
| | | | |
| class RooAbsArg; | | class RooAbsArg; | |
| class RooAbsData; | | class RooAbsData; | |
| class RooArgSet; | | class RooArgSet; | |
| class RooAbsPdf; | | class RooAbsPdf; | |
| | | | |
| namespace RooStats { | | namespace RooStats { | |
| | | | |
| class SamplingDistribution; | | class SamplingDistribution; | |
|
| | | class TestStatistic; | |
| | | | |
| class TestStatSampler { | | class TestStatSampler { | |
| | | | |
| public: | | public: | |
| // TestStatSampler(); | | // TestStatSampler(); | |
| virtual ~TestStatSampler() {} | | virtual ~TestStatSampler() {} | |
| | | | |
| // Main interface to get a ConfInterval, pure virtual | | // Main interface to get a ConfInterval, pure virtual | |
| virtual SamplingDistribution* GetSamplingDistribution(RooArgSet& para
msOfInterest) = 0; | | virtual SamplingDistribution* GetSamplingDistribution(RooArgSet& para
msOfInterest) = 0; | |
| | | | |
| // Main interface to evaluate the test statistic on a dataset | | // Main interface to evaluate the test statistic on a dataset | |
| virtual Double_t EvaluateTestStatistic(RooAbsData& data, RooArgSet& p
aramsOfInterest) = 0; | | virtual Double_t EvaluateTestStatistic(RooAbsData& data, RooArgSet& p
aramsOfInterest) = 0; | |
| | | | |
| // Get the TestStatistic | | // Get the TestStatistic | |
|
| virtual const RooAbsArg* GetTestStatistic() const = 0; | | virtual TestStatistic* GetTestStatistic() const = 0; | |
| | | | |
| // Get the Confidence level for the test | | // Get the Confidence level for the test | |
| virtual Double_t ConfidenceLevel() const = 0; | | virtual Double_t ConfidenceLevel() const = 0; | |
| | | | |
| // Common Initialization | | // Common Initialization | |
| virtual void Initialize(RooAbsArg& testStatistic, RooArgSet& paramsOf
Interest, RooArgSet& nuisanceParameters) = 0; | | virtual void Initialize(RooAbsArg& testStatistic, RooArgSet& paramsOf
Interest, RooArgSet& nuisanceParameters) = 0; | |
| | | | |
| // Set the Pdf, add to the the workspace if not already there | | // Set the Pdf, add to the the workspace if not already there | |
| virtual void SetPdf(RooAbsPdf&) = 0; | | virtual void SetPdf(RooAbsPdf&) = 0; | |
|
| | | // How to randomize the prior. Set to NULL to deactivate randomizatio | |
| | | n. | |
| | | virtual void SetPriorNuisance(RooAbsPdf*) = 0; | |
| | | | |
|
| | | // specify the values of parameters used when evaluating test statist | |
| | | ic | |
| | | virtual void SetParametersForTestStat(const RooArgSet& /*nullpoi*/) = | |
| | | 0; | |
| | | | |
| | | // REMOVE THIS | |
| // specify the parameters of interest in the interval | | // specify the parameters of interest in the interval | |
|
| virtual void SetParameters(RooArgSet&) = 0; | | // virtual void SetParameters(const RooArgSet&) = 0; | |
| | | | |
| // specify the nuisance parameters (eg. the rest of the parameters) | | // specify the nuisance parameters (eg. the rest of the parameters) | |
|
| virtual void SetNuisanceParameters(RooArgSet&) = 0; | | virtual void SetNuisanceParameters(const RooArgSet&) = 0; | |
| // specify the observables in the dataset (needed to evaluate the tes
t statistic) | | // specify the observables in the dataset (needed to evaluate the tes
t statistic) | |
|
| virtual void SetObservables(RooArgSet& ) = 0; | | virtual void SetObservables(const RooArgSet& ) = 0; | |
| | | // specify the conditional observables | |
| | | virtual void SetGlobalObservables(const RooArgSet& ) = 0; | |
| | | | |
| // set the size of the test (rate of Type I error) ( Eg. 0.05 for a 9
5% Confidence Interval) | | // set the size of the test (rate of Type I error) ( Eg. 0.05 for a 9
5% Confidence Interval) | |
| virtual void SetTestSize(Double_t size) = 0; | | virtual void SetTestSize(Double_t size) = 0; | |
| // set the confidence level for the interval (eg. 0.95 for a 95% Conf
idence Interval) | | // set the confidence level for the interval (eg. 0.95 for a 95% Conf
idence Interval) | |
| virtual void SetConfidenceLevel(Double_t cl) = 0; | | virtual void SetConfidenceLevel(Double_t cl) = 0; | |
| | | | |
| // Set the TestStatistic (want the argument to be a function of the d
ata & parameter points | | // Set the TestStatistic (want the argument to be a function of the d
ata & parameter points | |
|
| virtual void SetTestStatistic(RooAbsArg&) const = 0; | | virtual void SetTestStatistic(TestStatistic* testStatistic) = 0; | |
| | | | |
| | | // Set the name of the sampling distribution used for plotting | |
| | | virtual void SetSamplingDistName(const char* name) = 0; | |
| | | | |
| protected: | | protected: | |
| ClassDef(TestStatSampler,1) // Interface for tools setting limits (
producing confidence intervals) | | ClassDef(TestStatSampler,1) // Interface for tools setting limits (
producing confidence intervals) | |
| }; | | }; | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 9 change blocks. |
| 6 lines changed or deleted | | 22 lines changed or added | |
|
| Tools.h | | Tools.h | |
|
| // @(#)root/tmva $Id: Tools.h 31574 2009-12-05 18:23:21Z stelzer $ | | // @(#)root/tmva $Id: Tools.h 33928 2010-06-15 16:19:31Z stelzer $ | |
| // Author: Andreas Hoecker, Joerg Stelzer, Helge Voss, Kai Voss | | // Author: Andreas Hoecker, Joerg Stelzer, Helge Voss, Kai Voss | |
| | | | |
| /**************************************************************************
******** | | /**************************************************************************
******** | |
| * Project: TMVA - a Root-integrated toolkit for multivariate data analysis
* | | * Project: TMVA - a Root-integrated toolkit for multivariate data analysis
* | |
| * Package: TMVA
* | | * Package: TMVA
* | |
| * Class : Tools
* | | * Class : Tools
* | |
| * Web : http://tmva.sourceforge.net
* | | * Web : http://tmva.sourceforge.net
* | |
| *
* | | *
* | |
| * Description:
* | | * Description:
* | |
| * Global auxiliary applications and data treatment routines
* | | * Global auxiliary applications and data treatment routines
* | |
| | | | |
| skipping to change at line 60 | | skipping to change at line 60 | |
| #endif | | #endif | |
| | | | |
| #ifndef ROOT_TMatrixDfwd | | #ifndef ROOT_TMatrixDfwd | |
| #include "TMatrixDfwd.h" | | #include "TMatrixDfwd.h" | |
| #endif | | #endif | |
| | | | |
| #ifndef ROOT_TVectorDfwd | | #ifndef ROOT_TVectorDfwd | |
| #include "TVectorDfwd.h" | | #include "TVectorDfwd.h" | |
| #endif | | #endif | |
| | | | |
|
| | | #ifndef ROOT_TVectorDfwd | |
| | | #include "TVectorDfwd.h" | |
| | | #endif | |
| | | | |
| #ifndef ROOT_TMVA_Types | | #ifndef ROOT_TMVA_Types | |
| #include "TMVA/Types.h" | | #include "TMVA/Types.h" | |
| #endif | | #endif | |
| | | | |
| class TList; | | class TList; | |
| class TTree; | | class TTree; | |
| class TString; | | class TString; | |
| class TH1; | | class TH1; | |
| class TH2; | | class TH2; | |
| class TH2F; | | class TH2F; | |
| class TSpline; | | class TSpline; | |
|
| | | class TXMLEngine; | |
| | | | |
| namespace TMVA { | | namespace TMVA { | |
| | | | |
| class Event; | | class Event; | |
| class PDF; | | class PDF; | |
| class MsgLogger; | | class MsgLogger; | |
| | | | |
| class Tools { | | class Tools { | |
| | | | |
| private: | | private: | |
| | | | |
| skipping to change at line 94 | | skipping to change at line 99 | |
| public: | | public: | |
| | | | |
| // destructor | | // destructor | |
| ~Tools(); | | ~Tools(); | |
| | | | |
| // accessor to single instance | | // accessor to single instance | |
| static Tools& Instance(); | | static Tools& Instance(); | |
| static void DestroyInstance(); | | static void DestroyInstance(); | |
| | | | |
| // simple statistics operations on tree entries | | // simple statistics operations on tree entries | |
|
| void ComputeStat( const std::vector<TMVA::Event*>&, std::vector<Floa | | void ComputeStat( const std::vector<TMVA::Event*>&, | |
| t_t>*, | | std::vector<Float_t>*, | |
| Double_t&, Double_t&, Double_t&, | | Double_t&, Double_t&, Double_t&, | |
|
| Double_t&, Double_t&, Double_t&, Int_t signalClass | | Double_t&, Double_t&, Double_t&, Int_t signalClass | |
| , Bool_t norm = kFALSE ); | | , | |
| | | Bool_t norm = kFALSE ); | |
| | | | |
| // compute variance from sums | | // compute variance from sums | |
| inline Double_t ComputeVariance( Double_t sumx2, Double_t sumx, Int_t
nx ); | | inline Double_t ComputeVariance( Double_t sumx2, Double_t sumx, Int_t
nx ); | |
| | | | |
| // creates histograms normalized to one | | // creates histograms normalized to one | |
| TH1* projNormTH1F( TTree* theTree, const TString& theVarName, | | TH1* projNormTH1F( TTree* theTree, const TString& theVarName, | |
| const TString& name, Int_t nbins, | | const TString& name, Int_t nbins, | |
| Double_t xmin, Double_t xmax, const TString& cut )
; | | Double_t xmin, Double_t xmax, const TString& cut )
; | |
| | | | |
| // normalize histogram by its integral | | // normalize histogram by its integral | |
| | | | |
| skipping to change at line 219 | | skipping to change at line 226 | |
| // xml tools | | // xml tools | |
| | | | |
| TString StringFromInt ( Long_t i ); | | TString StringFromInt ( Long_t i ); | |
| TString StringFromDouble ( Double_t d ); | | TString StringFromDouble ( Double_t d ); | |
| void WriteTMatrixDToXML ( void* node, const char* name, TMatri
xD* mat ); | | void WriteTMatrixDToXML ( void* node, const char* name, TMatri
xD* mat ); | |
| void WriteTVectorDToXML ( void* node, const char* name, TVecto
rD* vec ); | | void WriteTVectorDToXML ( void* node, const char* name, TVecto
rD* vec ); | |
| void ReadTMatrixDFromXML( void* node, const char* name, TMatri
xD* mat ); | | void ReadTMatrixDFromXML( void* node, const char* name, TMatri
xD* mat ); | |
| void ReadTVectorDFromXML( void* node, const char* name, TVecto
rD* vec ); | | void ReadTVectorDFromXML( void* node, const char* name, TVecto
rD* vec ); | |
| Bool_t HistoHasEquidistantBins(const TH1& h); | | Bool_t HistoHasEquidistantBins(const TH1& h); | |
| | | | |
|
| | | Bool_t HasAttr ( void* node, const char* attrname ); | |
| template<typename T> | | template<typename T> | |
|
| inline void ReadAttr( void* node, const char* , T& value ); | | inline void ReadAttr ( void* node, const char* , T& value ); | |
| | | void ReadAttr ( void* node, const char* attrname, TString& | |
| inline void ReadAttr( void* node, const char* attrname, TString& valu | | value ); | |
| e ); | | | |
| | | | |
| template<typename T> | | template<typename T> | |
| void AddAttr ( void* node, const char* , const T& value, I
nt_t precision = 16 ); | | void AddAttr ( void* node, const char* , const T& value, I
nt_t precision = 16 ); | |
|
| | | void AddAttr ( void* node, const char* attrname, const cha
r* value ); | |
| void* AddChild ( void* parent, const char* childname, const
char* content = 0 ); | | void* AddChild ( void* parent, const char* childname, const
char* content = 0 ); | |
|
| | | Bool_t AddRawLine ( void* node, const char * raw ); | |
| | | Bool_t AddComment ( void* node, const char* comment ); | |
| | | | |
| void* GetChild ( void* parent, const char* childname=0 ); | | void* GetChild ( void* parent, const char* childname=0 ); | |
| void* GetNextChild( void* prevchild, const char* childname=0 ); | | void* GetNextChild( void* prevchild, const char* childname=0 ); | |
| const char* GetContent ( void* node ); | | const char* GetContent ( void* node ); | |
|
| | | const char* GetName ( void* node ); | |
| | | | |
| TXMLEngine& xmlengine() { return *fXMLEngine; } | | TXMLEngine& xmlengine() { return *fXMLEngine; } | |
| TXMLEngine* fXMLEngine; | | TXMLEngine* fXMLEngine; | |
| | | | |
| private: | | private: | |
| | | | |
| // utilities for correlation ratio | | // utilities for correlation ratio | |
| Double_t GetYMean_binX( const TH2& , Int_t bin_x ); | | Double_t GetYMean_binX( const TH2& , Int_t bin_x ); | |
| | | | |
| }; // Common tools | | }; // Common tools | |
| | | | |
| Tools& gTools(); // global accessor | | Tools& gTools(); // global accessor | |
| | | | |
| } // namespace TMVA | | } // namespace TMVA | |
| | | | |
| //_______________________________________________________________________ | | //_______________________________________________________________________ | |
| template<typename T> | | template<typename T> | |
| void TMVA::Tools::ReadAttr( void* node, const char* attrname, T& value ) | | void TMVA::Tools::ReadAttr( void* node, const char* attrname, T& value ) | |
| { | | { | |
|
| // add attribute from xml | | // read attribute from xml | |
| const char* val = xmlengine().GetAttr(node, attrname); | | TString val; | |
| std::stringstream s(val); | | ReadAttr( node, attrname, val ); | |
| | | std::stringstream s(val.Data()); | |
| s >> value; | | s >> value; | |
| } | | } | |
| | | | |
| //_______________________________________________________________________ | | //_______________________________________________________________________ | |
|
| void TMVA::Tools::ReadAttr( void* node, const char* attrname, TString& valu | | | |
| e ) | | | |
| { | | | |
| // add attribute from xml | | | |
| const char* val = xmlengine().GetAttr(node, attrname); | | | |
| value = TString(val); | | | |
| } | | | |
| | | | |
| //_______________________________________________________________________ | | | |
| template<typename T> | | template<typename T> | |
| void TMVA::Tools::AddAttr( void* node, const char* attrname, const T& value
, Int_t precision ) | | void TMVA::Tools::AddAttr( void* node, const char* attrname, const T& value
, Int_t precision ) | |
| { | | { | |
| // add attribute to xml | | // add attribute to xml | |
| std::stringstream s; | | std::stringstream s; | |
| s.precision( precision ); | | s.precision( precision ); | |
| s << std::scientific << value; | | s << std::scientific << value; | |
|
| gTools().xmlengine().NewAttr(node, 0, attrname, s.str().c_str()); | | AddAttr( node, attrname, s.str().c_str() ); | |
| } | | } | |
| | | | |
| //_______________________________________________________________________ | | //_______________________________________________________________________ | |
| inline Double_t TMVA::Tools::ComputeVariance( Double_t sumx2, Double_t sumx
, Int_t nx ) | | inline Double_t TMVA::Tools::ComputeVariance( Double_t sumx2, Double_t sumx
, Int_t nx ) | |
| { | | { | |
| // compute variance from given sums | | // compute variance from given sums | |
| if (nx<2) return 0; | | if (nx<2) return 0; | |
| return (sumx2 - ((sumx*sumx)/static_cast<Double_t>(nx)))/static_cast<Dou
ble_t>(nx-1); | | return (sumx2 - ((sumx*sumx)/static_cast<Double_t>(nx)))/static_cast<Dou
ble_t>(nx-1); | |
| } | | } | |
| | | | |
| | | | |
End of changes. 13 change blocks. |
| 23 lines changed or deleted | | 25 lines changed or added | |
|
| ToyMCSampler.h | | ToyMCSampler.h | |
|
| // @(#)root/roostats:$Id: ToyMCSampler.h 33206 2010-04-26 09:59:06Z moneta
$ | | // @(#)root/roostats:$Id: ToyMCSampler.h 34109 2010-06-24 15:00:16Z moneta
$ | |
| // Author: Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke | | // Author: Kyle Cranmer, Lorenzo Moneta, Gregory Schott, Wouter Verkerke | |
| // Additions and modifications by Mario Pelliccioni | | // Additions and modifications by Mario Pelliccioni | |
| /************************************************************************* | | /************************************************************************* | |
| * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. * | | * Copyright (C) 1995-2008, Rene Brun and Fons Rademakers. * | |
| * All rights reserved. * | | * All rights reserved. * | |
| * * | | * * | |
| * For the licensing terms see $ROOTSYS/LICENSE. * | | * For the licensing terms see $ROOTSYS/LICENSE. * | |
| * For the list of contributors see $ROOTSYS/README/CREDITS. * | | * For the list of contributors see $ROOTSYS/README/CREDITS. * | |
| *************************************************************************/ | | *************************************************************************/ | |
| | | | |
| #ifndef ROOSTATS_ToyMCSampler | | #ifndef ROOSTATS_ToyMCSampler | |
| #define ROOSTATS_ToyMCSampler | | #define ROOSTATS_ToyMCSampler | |
| | | | |
| //_________________________________________________ | | //_________________________________________________ | |
| /* | | /* | |
| BEGIN_HTML | | BEGIN_HTML | |
| <p> | | <p> | |
|
| ToyMCSampler is a simple implementation of the TestStatSampler interface. | | ToyMCSampler is an implementation of the TestStatSampler interface. | |
| It generates Toy Monte Carlo for a given parameter point, and evaluates a | | It generates Toy Monte Carlo for a given parameter point and evaluates a | |
| test statistic that the user specifies (passed via the RooStats::TestStatis | | TestStatistic. | |
| tic interface). | | | |
| | | | |
| Development notes: We need to provide a nice way for the user to: | | | |
| <ul> | | | |
| <li>specify the number of toy experiments (needed to probe a given confid | | | |
| ence level)</li> | | | |
| <li>specify if the number of events per toy experiment should be fixed (c | | | |
| onditioning) or floating (unconditional)</li> | | | |
| <li>specify if any auxiliary observations should be fixed (conditioning) | | | |
| or floating (unconditional)</li> | | | |
| <li>specify if nuisance paramters should be part of the toy MC: eg: integ | | | |
| rated out (Bayesian marginalization)</li> | | | |
| </ul> | | | |
| | | | |
| All of these should be made fairly explicit in the interface. | | | |
| </p> | | </p> | |
| END_HTML | | END_HTML | |
| */ | | */ | |
| // | | // | |
| | | | |
| #ifndef ROOT_Rtypes | | #ifndef ROOT_Rtypes | |
| #include "Rtypes.h" | | #include "Rtypes.h" | |
| #endif | | #endif | |
| | | | |
| #include <vector> | | #include <vector> | |
| #include <sstream> | | #include <sstream> | |
| | | | |
| #include "RooStats/TestStatSampler.h" | | #include "RooStats/TestStatSampler.h" | |
| #include "RooStats/SamplingDistribution.h" | | #include "RooStats/SamplingDistribution.h" | |
| #include "RooStats/TestStatistic.h" | | #include "RooStats/TestStatistic.h" | |
|
| #include "RooStats/RooStatsUtils.h" | | #include "RooStats/ModelConfig.h" | |
| | | | |
| #include "RooWorkspace.h" | | #include "RooWorkspace.h" | |
| #include "RooMsgService.h" | | #include "RooMsgService.h" | |
| #include "RooAbsPdf.h" | | #include "RooAbsPdf.h" | |
|
| #include "TRandom.h" | | | |
| | | | |
| #include "RooDataSet.h" | | #include "RooDataSet.h" | |
| | | | |
| namespace RooStats { | | namespace RooStats { | |
| | | | |
|
| class ToyMCSampler : public TestStatSampler { | | class ToyMCSampler: public TestStatSampler { | |
| | | | |
| public: | | | |
| ToyMCSampler(TestStatistic &ts) { | | | |
| fTestStat = &ts; | | | |
| fWS = new RooWorkspace(); | | | |
| fOwnsWorkspace = true; | | | |
| fDataName = ""; | | | |
| fPdfName = ""; | | | |
| fPOI = 0; | | | |
| fNuisParams=0; | | | |
| fObservables=0; | | | |
| fExtended = kTRUE; | | | |
| fRand = new TRandom(); | | | |
| fCounter=0; | | | |
| fVarName = fTestStat->GetVarName(); | | | |
| fLastDataSet = 0; | | | |
| } | | | |
| | | | |
| virtual ~ToyMCSampler() { | | | |
| if(fOwnsWorkspace) delete fWS; | | | |
| if(fRand) delete fRand; | | | |
| if(fLastDataSet) delete fLastDataSet; | | | |
| } | | | |
| | | | |
| // Extended interface to append to sampling distribution more samples | | | |
| virtual SamplingDistribution* AppendSamplingDistribution(RooArgSet& all | | | |
| Parameters, | | | |
| SamplingDistrib | | | |
| ution* last, | | | |
| Int_t additiona | | | |
| lMC) { | | | |
| | | | |
| Int_t tmp = fNtoys; | | | |
| fNtoys = additionalMC; | | | |
| SamplingDistribution* newSamples = GetSamplingDistribution(allParamet | | | |
| ers); | | | |
| fNtoys = tmp; | | | |
| | | | |
| if(last){ | | | |
| last->Add(newSamples); | | | |
| delete newSamples; | | | |
| return last; | | | |
| } | | | |
| | | | |
|
| return newSamples; | | public: | |
| } | | ToyMCSampler(TestStatistic &ts, Int_t ntoys) : | |
| | | fTestStat(&ts), fSamplingDistName("temp"), fNToys(ntoys) | |
| | | { | |
| | | fPdf = NULL; | |
| | | fPriorNuisance = NULL; | |
| | | fNullPOI = NULL; | |
| | | fNuisancePars = NULL; | |
| | | fObservables = NULL; | |
| | | fGlobalObservables = NULL; | |
| | | | |
| | | fSize = 0.05; | |
| | | fNEvents = 0; | |
| | | fGenerateBinned = kFALSE; | |
| | | fExpectedNuisancePar = kFALSE; | |
| | | } | |
| | | | |
| | | virtual ~ToyMCSampler() { | |
| | | } | |
| | | | |
| | | // main interface | |
| | | virtual SamplingDistribution* GetSamplingDistribution(RooArgSet& para | |
| | | mPoint); | |
| | | | |
| | | // generates toy data | |
| | | virtual RooAbsData* GenerateToyData(RooArgSet& /*paramPoint*/) const; | |
| | | | |
| | | // Extended interface to append to sampling distribution more samples | |
| | | virtual SamplingDistribution* AppendSamplingDistribution(RooArgSet& a | |
| | | llParameters, | |
| | | SamplingDistr | |
| | | ibution* last, | |
| | | Int_t additio | |
| | | nalMC) { | |
| | | | |
| | | Int_t tmp = fNToys; | |
| | | fNToys = additionalMC; | |
| | | SamplingDistribution* newSamples = GetSamplingDistribution(allParame | |
| | | ters); | |
| | | fNToys = tmp; | |
| | | | |
| | | if(last){ | |
| | | last->Add(newSamples); | |
| | | delete newSamples; | |
| | | return last; | |
| | | } | |
| | | | |
|
| // Main interface to get a SamplingDistribution | | return newSamples; | |
| virtual SamplingDistribution* GetSamplingDistribution(RooArgSet& allPar | | | |
| ameters) { | | | |
| std::vector<Double_t> testStatVec; | | | |
| // cout << " about to generate sampling dist " << endl; | | | |
| | | | |
| RooMsgService::instance().setGlobalKillBelow(RooFit::ERROR) ; | | | |
| | | | |
| for(Int_t i=0; i<fNtoys; ++i){ | | | |
| //cout << " on toy number " << i << endl; | | | |
| // RooAbsData* toydata = (RooAbsData*)GenerateToyData(allParame | | | |
| ters); | | | |
| // testStatVec.push_back( fTestStat->Evaluate(*toydata, allPara | | | |
| meters) ); | | | |
| // delete toydata; | | | |
| | | | |
| RooDataSet* toydata = (RooDataSet*)GenerateToyData(allParameters); | | | |
| testStatVec.push_back( fTestStat->Evaluate(*toydata, allParameters) | | | |
| ); | | | |
| | | | |
| // want to clean up memory, but delete toydata causes problem with | | | |
| // nll->setData(data, noclone) because pointer to last data set is n | | | |
| o longer valid | | | |
| // delete toydata; | | | |
| | | | |
| // instead, delete previous data set | | | |
| if(fLastDataSet) delete fLastDataSet; | | | |
| fLastDataSet = toydata; | | | |
| } | | } | |
| | | | |
|
| // cout << " generated sampling dist " << endl; | | | |
| return new SamplingDistribution( "temp",//MakeName(allParameters).c_s | | | |
| tr(), | | | |
| "Sampling Distribution of Test Statis | | | |
| tic", testStatVec, fVarName ); | | | |
| } | | | |
| | | | |
| virtual RooAbsData* GenerateToyData(RooArgSet& allParameters) const { | | | |
| // This method generates a toy dataset for the given parameter point | | | |
| . | | | |
| | | | |
| // cout << "fNevents = " << fNevents << endl; | | | |
| RooAbsPdf* pdf = fWS->pdf(fPdfName); | | | |
| if(!fObservables){ | | | |
| cout << "Observables not specified in ToyMCSampler, will try to det | | | |
| ermine. " | | | |
| << "Will ignore all constant parameters, parameters of interes | | | |
| t, and nuisance parameters." << endl; | | | |
| RooArgSet* observables = pdf->getVariables(); | | | |
| RemoveConstantParameters(observables); // observables might be set | | | |
| constant, this is just a guess | | | |
| | | | |
| if(fPOI) observables->remove(*fPOI, kFALSE, kTRUE); | | | |
| if(fNuisParams) observables->remove(*fNuisParams, kFALSE, kTRUE); | | | |
| cout << "will use the following as observables when generating data | | | |
| " << endl; | | | |
| observables->Print(); | | | |
| fObservables=observables; | | | |
| } | | | |
| | | | |
| //fluctuate the number of events if fExtended is on. | | | |
| // This is a bit slippery for number counting expts. where entry in | | | |
| data and | | | |
| // model is number of events, and so number of entries in data alway | | | |
| s =1. | | | |
| Int_t nEvents = fNevents; | | | |
| if(fExtended) { | | | |
| if( pdf->expectedEvents(*fObservables) > 0){ | | | |
| // if PDF knows expected events use it instead | | | |
| nEvents = fRand->Poisson(pdf->expectedEvents(*fObservables)); | | | |
| } else{ | | | |
| nEvents = fRand->Poisson(fNevents); | | | |
| } | | | |
| } | | | |
| | | | |
| // Set the parameters to desired values for generating toys | | | |
| RooArgSet* parameters = pdf->getParameters(fObservables); | | | |
| RooStats::SetParameters(&allParameters, parameters); | | | |
| | | | |
| /* | | | |
| cout << "expected events = " << pdf->expectedEvents(*observables) | | | |
| << "fExtended = " << fExtended | | | |
| << "fNevents = " << fNevents << " fNevents " | | | |
| << "generating" << nEvents << " events " << endl; | | | |
| */ | | | |
| | | | |
| RooFit::MsgLevel level = RooMsgService::instance().globalKillBelow() | | | |
| ; | | | |
| RooMsgService::instance().setGlobalKillBelow(RooFit::ERROR) ; | | | |
| | | | |
| // cout << "nEvents = " << nEvents << endl; | | | |
| RooAbsData* data = (RooAbsData*)pdf->generate(*fObservables, nEvents | | | |
| ); | | | |
| | | | |
| RooMsgService::instance().setGlobalKillBelow(level) ; | | | |
| delete parameters; | | | |
| return data; | | | |
| } | | | |
| | | | |
| // helper method to create meaningful names for sampling dist | | | |
| string MakeName(RooArgSet& /*params*/){ | | | |
| std::stringstream str; | | | |
| str<<"SamplingDist_"<< fCounter; | | | |
| fCounter++; | | | |
| | | | |
| // WVE -- Return pointer to static buffer | | | |
| static char buf[1024] ; | | | |
| strcpy(buf,str.str().c_str()) ; | | | |
| | | | |
| return buf ; | | | |
| } | | | |
| | | | |
| // Main interface to evaluate the test statistic on a dataset | | // Main interface to evaluate the test statistic on a dataset | |
|
| virtual Double_t EvaluateTestStatistic(RooAbsData& data, RooArgSet& al | | virtual Double_t EvaluateTestStatistic(RooAbsData& data, RooArgSet& n | |
| lParameters) { | | ullPOI) { | |
| return fTestStat->Evaluate(data, allParameters); | | return fTestStat->Evaluate(data, nullPOI); | |
| } | | | |
| | | | |
| // Get the TestStatistic | | | |
| virtual const RooAbsArg* GetTestStatistic() const { | | | |
| return fTestStat->GetTestStatistic();} | | | |
| | | | |
| // Get the Confidence level for the test | | | |
| virtual Double_t ConfidenceLevel() const {return 1.-fSize;} | | | |
| | | | |
| // Common Initialization | | | |
| virtual void Initialize(RooAbsArg& /*testStatistic*/, | | | |
| RooArgSet& /*paramsOfInterest*/, | | | |
| RooArgSet& /*nuisanceParameters*/) {} | | | |
| | | | |
| //set the parameters for the toyMC generation | | | |
| virtual void SetNToys(const Int_t ntoy) { | | | |
| fNtoys = ntoy; | | | |
| } | | } | |
| | | | |
|
| virtual void SetNEventsPerToy(const Int_t nevents) { | | virtual TestStatistic* GetTestStatistic() const { return fTestStat; } | |
| fNevents = nevents; | | virtual Double_t ConfidenceLevel() const { return 1. - fSize; } | |
| } | | virtual void Initialize( | |
| | | RooAbsArg& /*testStatistic*/, | |
| | | RooArgSet& /*paramsOfInterest*/, | |
| | | RooArgSet& /*nuisanceParameters*/ | |
| | | ) {} | |
| | | | |
|
| virtual void SetExtended(const Bool_t isExtended) { | | virtual void SetNToys(const Int_t ntoy) { fNToys = ntoy; } | |
| fExtended = isExtended; | | virtual void SetNEventsPerToy(const Int_t nevents) { | |
| | | // Forces n events even for extended PDFs. Set NEvents=0 to | |
| | | // use the Poisson distributed events from the extended PDF. | |
| | | fNEvents = nevents; | |
| } | | } | |
| | | | |
|
| // Set the DataSet, add to the the workspace if not already there | | // specify the values of parameters used when evaluating test statist | |
| virtual void SetData(RooAbsData& data) { | | ic | |
| if(&data){ | | virtual void SetParametersForTestStat(const RooArgSet& nullpoi) { fNu | |
| fWS->import(data); | | llPOI = (RooArgSet*)nullpoi.snapshot(); } | |
| fDataName = data.GetName(); | | | |
| fWS->Print(); | | | |
| } | | | |
| } | | | |
| // Set the Pdf, add to the the workspace if not already there | | // Set the Pdf, add to the the workspace if not already there | |
|
| virtual void SetPdf(RooAbsPdf& pdf) { | | virtual void SetPdf(RooAbsPdf& pdf) { fPdf = &pdf; } | |
| if(&pdf){ | | // How to randomize the prior. Set to NULL to deactivate randomizatio | |
| fWS->import(pdf); | | n. | |
| fPdfName = pdf.GetName(); | | virtual void SetPriorNuisance(RooAbsPdf* pdf) { fPriorNuisance = pdf; | |
| } | | } | |
| } | | | |
| | | | |
| // specify the name of the dataset in the workspace to be used | | | |
| virtual void SetData(const char* name) {fDataName = name;} | | | |
| // specify the name of the PDF in the workspace to be used | | | |
| virtual void SetPdf(const char* name) {fPdfName = name;} | | | |
| | | | |
| // specify the parameters of interest in the interval | | | |
| virtual void SetParameters(RooArgSet& set) {fPOI = &set;} | | | |
| // specify the nuisance parameters (eg. the rest of the parameters) | | // specify the nuisance parameters (eg. the rest of the parameters) | |
|
| virtual void SetNuisanceParameters(RooArgSet& set) {fNuisParams = &se
t;} | | virtual void SetNuisanceParameters(const RooArgSet& np) { fNuisancePa
rs = &np; } | |
| // specify the observables in the dataset (needed to evaluate the tes
t statistic) | | // specify the observables in the dataset (needed to evaluate the tes
t statistic) | |
|
| virtual void SetObservables(RooArgSet& set) {fObservables = &set;} | | virtual void SetObservables(const RooArgSet& o) { fObservables = &o; | |
| | | } | |
| | | // specify the conditional observables | |
| | | virtual void SetGlobalObservables(const RooArgSet& o) { fGlobalObserv | |
| | | ables = &o; } | |
| | | | |
| // set the size of the test (rate of Type I error) ( Eg. 0.05 for a 9
5% Confidence Interval) | | // set the size of the test (rate of Type I error) ( Eg. 0.05 for a 9
5% Confidence Interval) | |
|
| virtual void SetTestSize(Double_t size) {fSize = size;} | | virtual void SetTestSize(Double_t size) { fSize = size; } | |
| // set the confidence level for the interval (eg. 0.95 for a 95% Conf
idence Interval) | | // set the confidence level for the interval (eg. 0.95 for a 95% Conf
idence Interval) | |
|
| virtual void SetConfidenceLevel(Double_t cl) {fSize = 1.-cl;} | | virtual void SetConfidenceLevel(Double_t cl) { fSize = 1. - cl; } | |
| | | | |
| // Set the TestStatistic (want the argument to be a function of the d
ata & parameter points | | // Set the TestStatistic (want the argument to be a function of the d
ata & parameter points | |
|
| virtual void SetTestStatistic(RooAbsArg&) const {} | | virtual void SetTestStatistic(TestStatistic *testStatistic) { fTestSt
at = testStatistic; } | |
| | | | |
|
| private: | | // SetModel does not load the snapshot. Use LoadSnapshot if necessary | |
| Double_t fSize; | | . | |
| RooWorkspace* fWS; // a workspace that owns all the components to be | | virtual void SetExpectedNuisancePar(Bool_t i) { fExpectedNuisancePar | |
| used by the calculator | | = i; cout << "WILL NOT WORK YET" << endl; } // TODO | |
| Bool_t fOwnsWorkspace; // flag if this object owns its workspace | | virtual void SetAsimovNuisancePar(Bool_t i) { fExpectedNuisancePar = | |
| const char* fPdfName; // name of common PDF in workspace | | i; cout << "WILL NOT WORK YET" << endl; } // TODO | |
| const char* fDataName; // name of data set in workspace | | | |
| RooArgSet* fPOI; // RooArgSet specifying parameters of interest for | | | |
| interval | | | |
| RooArgSet* fNuisParams;// RooArgSet specifying nuisance parameters f | | | |
| or interval | | | |
| mutable RooArgSet* fObservables; // RooArgSet specifying the observab | | | |
| les in the dataset (needed to evaluate the test statistic) | | | |
| TestStatistic* fTestStat; // pointer to the test statistic that is be | | | |
| ing sampled | | | |
| Int_t fNtoys; // number of toys to generate | | | |
| Int_t fNevents; // number of events per toy (may be ignored depending | | | |
| on settings) | | | |
| Bool_t fExtended; // if nEvents should fluctuate | | | |
| TRandom* fRand; // random generator | | | |
| TString fVarName; // name of test statistic | | | |
| | | | |
|
| Int_t fCounter; // counter for naming sampling dist objects | | // Checks for sufficient information to do a GetSamplingDistribution( | |
| | | ...). | |
| | | Bool_t CheckConfig(void); | |
| | | | |
|
| RooDataSet* fLastDataSet; // work around for memory issues in nllvar- | | // control to use bin data generation | |
| >setData(data, noclone) | | void SetGenerateBinned(bool binned = true) { fGenerateBinned = binned | |
| | | ; } | |
| | | | |
| | | // Set the name of the sampling distribution used for plotting | |
| | | void SetSamplingDistName(const char* name) { if(name) fSamplingDistNa | |
| | | me = name; } | |
| | | | |
| | | protected: | |
| | | | |
| | | TestStatistic *fTestStat; // test statistic that is being sampled | |
| | | RooAbsPdf *fPdf; // model | |
| | | string fSamplingDistName; // name of the model | |
| | | RooAbsPdf *fPriorNuisance; // prior pdf for nuisance parameters | |
| | | RooArgSet *fNullPOI; // parameters of interest | |
| | | const RooArgSet *fNuisancePars; | |
| | | const RooArgSet *fObservables; | |
| | | const RooArgSet *fGlobalObservables; | |
| | | Int_t fNToys; // number of toys to generate | |
| | | Int_t fNEvents; // number of events per toy (may be ignored depending | |
| | | on settings) | |
| | | Double_t fSize; | |
| | | Bool_t fExpectedNuisancePar; // whether to use expectation values for | |
| | | nuisance parameters (ie Asimov data set) | |
| | | Bool_t fGenerateBinned; | |
| | | | |
| protected: | | protected: | |
|
| ClassDef(ToyMCSampler,1) // A simple implementation of the TestStat | | ClassDef(ToyMCSampler,1) // A simple implementation of the TestStatSampl | |
| Sampler interface | | er interface | |
| }; | | }; | |
| } | | } | |
| | | | |
| #endif | | #endif | |
| | | | |
End of changes. 22 change blocks. |
| 256 lines changed or deleted | | 123 lines changed or added | |
|