source: fact/tools/rootmacros/PulseTemplates/Sample.h@ 20115

Last change on this file since 20115 was 14951, checked in by Jens Buss, 12 years ago
added SetVerbLevel, out histo reseted in Bootstrap histogramm
  • Property svn:executable set to *
File size: 2.5 KB
Line 
1/*
2 Ideas for random sampling:
3
4 Bootstrapping: pull with pu back
5 generate a random list of Eventnumbers, induvidual number can occure certain
6 times in list, put numbers in List sorted.
7 read eventnumbers to process from list
8 USE: STL multiset
9
10 sampling: pull random evtn numbers without putting back
11 generate a random list with subset of eventlist. pull random number and put
12 it in list sorted. if number occurs again skip it. and try next number
13 USE: STL set
14 */
15
16#ifndef SAMPLE_H
17#define SAMPLE_H
18
19/** A one line description of the class.
20 *
21 * #include "XX.h" <BR>
22 * -llib
23 *
24 * A longer description.
25 *
26 * @see something
27 */
28
29
30// SYSTEM INCLUDES
31#include <iostream>
32#include <vector>
33#include <set>
34#include <utility>
35//
36
37// PROJECT INCLUDES
38#include <TRandom3.h>
39#include <TH1.h>
40//
41
42//Evt data types
43//
44
45// LOCAL INCLUDES
46//
47
48// FORWARD REFERENCES
49//
50using namespace std;
51
52class Sample
53{
54public:
55 // LIFECYCLE
56
57 /** Default constructor.
58 */
59 Sample();
60 Sample(int size);
61 Sample(vector<int> *RndNumList);
62 Sample(vector<int> *RndNumList, int size);
63
64 ~Sample(void);
65 // OPERATORS
66
67 // /** Assignment operator.
68 // *
69 // * @param from THe value to assign to this object.
70 // *
71 // * @return A reference to this object.
72 // */
73 // MonteCarlo& operator=(const XX& from);
74
75 // OPERATIONS
76 void InitMembers();
77
78 int GenerateRandomInt();
79 int GenerateRandomInt(int min, int max);
80 void GenerateSample();
81 void GenerateSample(vector<int>* sampleVector, int min, int max, int size);
82 void BootstrapSample();
83 int BootstrapVector(vector<double> *inVector, vector<double> *outVector);
84 int BootstrapTH1(TH1* inputHisto, TH1 *outHisto);
85 void BootstrapSample(vector<int>* sampleVector, int min, int max, int size);
86
87
88 // ACCESS
89 void SetMinNumber(int min);
90 void SetMaxNumber(int max);
91 void SetSampleSize(int size);
92 void SetSeed(int seed);
93 void SetVerbosityLvl(int VerbosityLvl);
94 int GetMinNumber();
95 int GetMaxNumber();
96 int GetSampleSize();
97 int GetSeed();
98 void GetRndListValues(vector<int> *RndNumList);
99 vector<int>* GetRndListPtr();
100
101 // INQUIRY
102private:
103 vector<int>* mpRndNumList;
104 int mMinNumber;
105 int mMaxNumber;
106 int mSampleSize;
107 int mSeed;
108 TRandom3 mRandom;
109 int mVerbosityLvl;
110
111};
112
113// INLINE METHODS
114//
115
116// EXTERNAL REFERENCES
117//
118
119#endif // SAMPLE_H
120
Note: See TracBrowser for help on using the repository browser.