Skip to content
This repository was archived by the owner on Jun 4, 2021. It is now read-only.

Commit 093d5fd

Browse files
committed
Merge pull request #5 from kreczko/tau-svd-unfolding
Tau svd unfolding
2 parents 5e00dbe + 35f41bd commit 093d5fd

25 files changed

+2374
-47
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,6 @@ Makefile
1616
*~
1717
*Dict.cxx
1818
*Dict_rdict.pcm
19-
Test*
19+
Test/*
20+
/Test/
21+
*.pyc

ci/test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ echo "Checking PyROOT installation"
1111
time python -c 'import ROOT; ROOT.TBrowser()'
1212

1313
# Check that RooUnfold can be imported
14-
echo "Checking RooUnfold library"
14+
echo "Checking RooUnfold library in PyROOT"
1515
time python -c 'from ROOT import gSystem; gSystem.Load("libRooUnfold.so");from ROOT import RooUnfoldResponse'
16-
16+
time python test/test_pyroot.py
1717
echo "Executing unit tests"
1818
make test

examples/RooUnfoldDagostini.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#ifndef ROOUNFOLDDAGOSTINI_H_
1414
#define ROOUNFOLDDAGOSTINI_H_
1515

16-
#include "RooUnfold.h"
16+
#include "../include/RooUnfold.h"
1717

1818
class RooUnfoldResponse;
1919
class TH1;

examples/RooUnfoldExample.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ using std::endl;
1717
#include "TRandom.h"
1818
#include "TH1D.h"
1919

20-
#include "RooUnfoldResponse.h"
21-
#include "RooUnfoldBayes.h"
20+
#include "../include/RooUnfoldResponse.h"
21+
#include "../include/RooUnfoldBayes.h"
2222
//#include "RooUnfoldSvd.h"
2323
//#include "RooUnfoldTUnfold.h"
2424
#endif

examples/RooUnfoldTestHarness.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
#if !defined(__CINT__) || defined(__MAKECINT__)
1717
#include "TNamed.h"
1818
#include "TString.h"
19-
#include "RooUnfold.h"
19+
#include "../include/RooUnfold.h"
2020
#if ROOT_VERSION_CODE >= ROOT_VERSION(5,0,0)
2121
#include "TVectorDfwd.h"
2222
#include "TMatrixDfwd.h"

examples/RooUnfoldTestHarness.icc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,11 @@
3737
#include "TLine.h"
3838
#include "TNtuple.h"
3939
#include "TProfile.h"
40-
#include "RooUnfoldErrors.h"
41-
#include "RooUnfoldParms.h"
42-
#include "RooUnfoldResponse.h"
43-
#include "RooUnfold.h"
44-
#include "RooUnfoldSvd.h"
40+
#include "../include/RooUnfoldErrors.h"
41+
#include "../include/RooUnfoldParms.h"
42+
#include "../include/RooUnfoldResponse.h"
43+
#include "../include/RooUnfold.h"
44+
#include "../include/RooUnfoldSvd.h"
4545
#ifdef USE_TUNFOLD_H
4646
#include "RooUnfoldTUnfold.h"
4747
#endif

examples/RooUnfoldTestHarness2D.icc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
#include "TVectorD.h"
3030
#include "TLine.h"
3131

32-
#include "RooUnfoldResponse.h"
32+
#include "../include/RooUnfoldResponse.h"
3333
#endif
3434

3535
#include "ArgVars.h"

examples/RooUnfoldTestHarness3D.icc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
#include "TVectorD.h"
2828
#include "TLine.h"
2929

30-
#include "RooUnfoldResponse.h"
30+
#include "../include/RooUnfoldResponse.h"
3131
#endif
3232

3333
#include "ArgVars.h"

include/RooUnfoldSvd.h

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class RooUnfoldResponse;
1818
class TH1;
1919
class TH1D;
2020
class TH2D;
21-
class TSVDUnfold;
21+
class TSVDUnfold_local;
2222

2323
class RooUnfoldSvd : public RooUnfold {
2424

@@ -38,16 +38,20 @@ class RooUnfoldSvd : public RooUnfold {
3838

3939
RooUnfoldSvd (const RooUnfoldResponse* res, const TH1* meas, Int_t kreg= 0, Int_t ntoyssvd= 1000,
4040
const char* name= 0, const char* title= 0);
41+
RooUnfoldSvd (const RooUnfoldResponse* res, const TH1* meas, double taureg, Int_t ntoyssvd= 1000,
42+
const char* name= 0, const char* title= 0);
4143

4244
void SetKterm (Int_t kreg);
45+
void SetTauTerm (double taureg);
4346
void SetNtoysSVD (Int_t ntoyssvd);
4447
Int_t GetKterm() const;
48+
double GetTauTerm() const;
4549
Int_t GetNtoysSVD() const;
4650

4751
virtual void SetRegParm (Double_t parm);
4852
virtual Double_t GetRegParm() const;
4953
virtual void Reset();
50-
TSVDUnfold* Impl();
54+
TSVDUnfold_local* Impl();
5155

5256
protected:
5357
void Assign (const RooUnfoldSvd& rhs); // implementation of assignment operator
@@ -62,8 +66,10 @@ class RooUnfoldSvd : public RooUnfold {
6266

6367
protected:
6468
// instance variables
65-
TSVDUnfold* _svd; //! Implementation in TSVDUnfold object (no streamer)
69+
TSVDUnfold_local* _svd; //! Implementation in TSVDUnfold object (no streamer)
6670
Int_t _kreg;
71+
double _taureg;
72+
bool _use_tau_unfolding;
6773
Int_t _nb;
6874
Int_t _ntoyssvd;
6975

@@ -155,7 +161,10 @@ inline
155161
Double_t RooUnfoldSvd::GetRegParm() const
156162
{
157163
// Return regularisation parameter
158-
return GetKterm();
164+
if (_use_tau_unfolding)
165+
return _taureg;
166+
else
167+
return _kreg;
159168
}
160169

161170
#endif

include/RooUnfoldUtils.h

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
/*
2+
* RooUnfoldUtils.h
3+
*
4+
* Created on: 24 Feb 2015
5+
* Author: kreczko
6+
*/
7+
8+
#ifndef INCLUDE_ROOUNFOLDUTILS_H
9+
#define INCLUDE_ROOUNFOLDUTILS_H
10+
11+
#include "TVectorD.h"
12+
namespace RooUnfoldUtils {
13+
14+
/**
15+
* Calculates equidistant points on a logarithmic scale
16+
*
17+
* parameters:
18+
* - tau_min: minimal tau value (> 0)
19+
* - tau_max: maximal tau value
20+
* - n_points: number of points (> 3)
21+
*/
22+
TVectorD* calculate_tau_scan_points(double tau_min, double tau_max, unsigned int n_points);
23+
}
24+
#endif /* INCLUDE_ROOUNFOLDUTILS_H */

0 commit comments

Comments
 (0)