thepeg
is hosted by
Hepforge
,
IPPP Durham
ThePEG
2.3.0
Analysis
FactoryBase.h
1
// -*- C++ -*-
2
//
3
// FactoryBase.h is a part of ThePEG - Toolkit for HEP Event Generation
4
// Copyright (C) 1999-2019 Leif Lonnblad
5
//
6
// ThePEG is licenced under version 3 of the GPL, see COPYING for details.
7
// Please respect the MCnet academic guidelines, see GUIDELINES for details.
8
//
9
#ifndef THEPEG_FactoryBase_H
10
#define THEPEG_FactoryBase_H
11
//
12
// This is the declaration of the FactoryBase class.
13
//
14
15
#include "ThePEG/Interface/Interfaced.h"
16
#include "FactoryBase.fh"
17
18
namespace
AIDA {
19
class
IHistogram1D;
20
class
IHistogram2D;
21
class
IDataPointSet;
22
class
IAnalysisFactory;
23
class
ITree;
24
class
IHistogramFactory;
25
class
IDataPointSetFactory;
26
}
27
28
namespace
ThePEG
{
29
47
class
FactoryBase
:
public
Interfaced
{
48
49
public
:
50
54
typedef
AIDA::IHistogram1D *
tH1DPtr
;
55
59
typedef
const
AIDA::IHistogram1D *
tcH1DPtr
;
60
64
typedef
AIDA::IHistogram2D *
tH2DPtr
;
65
69
typedef
const
AIDA::IHistogram2D *
tcH2DPtr
;
70
74
typedef
AIDA::IDataPointSet *
tDSetPtr
;
75
79
typedef
const
AIDA::IDataPointSet *
tcDSetPtr
;
80
81
public
:
82
90
class
DataFiller
{
91
92
public
:
93
97
DataFiller
(AIDA::IDataPointSet * dps) :
dset
(dps) {}
98
102
DataFiller
(
const
DataFiller
& df) :
dset
(df.
dset
) {}
103
108
~DataFiller
();
109
113
DataFiller
&
operator<<
(
double
x) {
114
v
.push_back(x);
115
return
*
this
;
116
}
117
121
operator
AIDA::IDataPointSet * () {
return
dset
; }
122
123
private
:
124
128
AIDA::IDataPointSet *
dset
;
129
133
deque<double>
v
;
134
135
};
136
137
public
:
138
144
FactoryBase
();
145
149
FactoryBase
(
const
FactoryBase
&);
150
154
virtual
~FactoryBase
();
156
157
public
:
158
166
const
string
&
filename
()
const
{
return
theFilename
; }
167
172
const
string
&
suffix
()
const
{
return
theSuffix
; }
173
177
const
string
&
storeType
()
const
{
return
theStoreType
; }
179
187
virtual
void
188
normalizeToXSec
(
tH1DPtr
histogram,
CrossSection
unit = picobarn)
const
= 0;
189
195
virtual
void
196
normalizeToXSec
(
tH2DPtr
histogram,
CrossSection
unit = picobarn)
const
= 0;
197
203
virtual
void
normalizeToXSecFraction
(
tH1DPtr
histogram)
const
= 0;
204
210
virtual
void
normalizeToXSecFraction
(
tH2DPtr
histogram)
const
= 0;
211
216
virtual
void
normalizeToUnity
(
tH1DPtr
histogram)
const
= 0;
217
222
virtual
void
normalizeToUnity
(
tH2DPtr
histogram)
const
= 0;
224
230
AIDA::IAnalysisFactory &
analysisFactory
()
const
{
231
return
*
theAnalysisFactory
;
232
}
233
237
AIDA::ITree &
tree
()
const
;
238
242
AIDA::IHistogramFactory &
histogramFactory
()
const
;
243
247
AIDA::IDataPointSetFactory &
dataSetFactory
()
const
;
248
252
void
mkdir
(
const
string
&
path
);
253
257
void
mkdirs
(
const
string
&
path
);
258
262
void
cd
(
const
string
&
path
);
263
279
tH1DPtr
createHistogram1D
(
const
string
&
path
,
int
nb,
double
lo,
double
up);
280
296
tH1DPtr
createHistogram1D
(
const
string
&
path
,
const
string
& title,
int
nb,
297
double
lo,
double
up);
298
312
tH1DPtr
createHistogram1D
(
const
string
&
path
,
const
string
& title,
313
const
std::vector<double> & edges);
314
333
tH2DPtr
createHistogram2D
(
const
string
&
path
,
334
int
nbx,
double
xlo,
double
xup,
335
int
nby,
double
ylo,
double
yup);
336
355
tH2DPtr
createHistogram2D
(
const
string
&
path
,
const
string
& title,
356
int
nbx,
double
xlo,
double
xup,
357
int
nby,
double
ylo,
double
yup);
358
373
tH2DPtr
createHistogram2D
(
const
string
&
path
,
const
string
& title,
374
const
std::vector<double> & xedges,
375
const
std::vector<double> & yedges);
376
384
DataFiller
createDataSet
(
const
string
&
path
,
const
string
& title,
int
dim);
385
393
void
registerClient
(
tIPtr
client);
395
396
protected
:
397
406
void
analysisFactory
(AIDA::IAnalysisFactory * x) {
407
theAnalysisFactory
= x;
408
}
409
414
void
clear
();
415
416
417
public
:
418
425
void
persistentOutput
(
PersistentOStream
& os)
const
;
426
432
void
persistentInput
(
PersistentIStream
& is,
int
version);
434
441
static
void
Init
();
442
443
protected
:
444
451
virtual
void
doinitrun
();
452
457
virtual
void
dofinish
();
459
460
private
:
461
467
string
theFilename
;
468
473
string
theSuffix
;
474
478
string
theStoreType
;
479
483
AIDA::IAnalysisFactory *
theAnalysisFactory
;
484
488
AIDA::ITree *
theTree
;
489
493
AIDA::IHistogramFactory *
theHistogramFactory
;
494
498
AIDA::IDataPointSetFactory *
theDataSetFactory
;
499
504
set<IPtr>
clients
;
505
506
private
:
507
512
static
AbstractClassDescription<FactoryBase>
initFactoryBase
;
513
518
FactoryBase
&
operator=
(
const
FactoryBase
&) =
delete
;
519
520
};
521
522
}
523
524
#include "ThePEG/Utilities/ClassTraits.h"
525
526
namespace
ThePEG
{
527
532
template
<>
533
struct
BaseClassTrait<FactoryBase,1> {
535
typedef
Interfaced
NthBase
;
536
};
537
540
template
<>
541
struct
ClassTraits<FactoryBase>
542
:
public
ClassTraitsBase<FactoryBase> {
544
static
string
className
() {
return
"ThePEG::FactoryBase"
; }
545
};
546
549
}
550
551
#endif
/* THEPEG_FactoryBase_H */
ThePEG::AbstractClassDescription
A concreate implementation of ClassDescriptionBase describing an abstract class with persistent data.
Definition:
ClassDescription.h:282
ThePEG::FactoryBase::DataFiller
DataFiller is a helper class to facilitate adding data to a DataPointSet.
Definition:
FactoryBase.h:90
ThePEG::FactoryBase::DataFiller::v
deque< double > v
The collected numbers to be committed to the IDataPointSet.
Definition:
FactoryBase.h:133
ThePEG::FactoryBase::DataFiller::DataFiller
DataFiller(const DataFiller &df)
Copy constructor.
Definition:
FactoryBase.h:102
ThePEG::FactoryBase::DataFiller::~DataFiller
~DataFiller()
Destructor.
ThePEG::FactoryBase::DataFiller::DataFiller
DataFiller(AIDA::IDataPointSet *dps)
The standard constructor needs a IDataPointSet as argument.
Definition:
FactoryBase.h:97
ThePEG::FactoryBase::DataFiller::operator<<
DataFiller & operator<<(double x)
Add a number to measurement currently being read.
Definition:
FactoryBase.h:113
ThePEG::FactoryBase::DataFiller::dset
AIDA::IDataPointSet * dset
The underlying IDataPointSet.
Definition:
FactoryBase.h:128
ThePEG::FactoryBase
Here is the documentation of the FactoryBase class.
Definition:
FactoryBase.h:47
ThePEG::FactoryBase::analysisFactory
void analysisFactory(AIDA::IAnalysisFactory *x)
Set the underlying AIDA::IAnalysisFactory object.
Definition:
FactoryBase.h:406
ThePEG::FactoryBase::storeType
const string & storeType() const
The format in which the histograms are stored in the output file.
Definition:
FactoryBase.h:177
ThePEG::FactoryBase::normalizeToXSecFraction
virtual void normalizeToXSecFraction(tH1DPtr histogram) const =0
Rescale the given histogram so that the integral over the bins gives the fraction of the total cross ...
ThePEG::FactoryBase::cd
void cd(const string &path)
Set the default working directory for the underlying AIDA tree.
ThePEG::FactoryBase::filename
const string & filename() const
Together with suffix(), the name of the file where the resulting histograms will be stored.
Definition:
FactoryBase.h:166
ThePEG::FactoryBase::createHistogram2D
tH2DPtr createHistogram2D(const string &path, const string &title, const std::vector< double > &xedges, const std::vector< double > &yedges)
Create and return a AIDA::IHistogram2D object in the underlying AIDA histogram factory.
ThePEG::FactoryBase::theTree
AIDA::ITree * theTree
A pointer to the underlying AIDA::ITree object.
Definition:
FactoryBase.h:488
ThePEG::FactoryBase::tH1DPtr
AIDA::IHistogram1D * tH1DPtr
Convenient typedef for pointer to AIDA::IHistogram1D.
Definition:
FactoryBase.h:54
ThePEG::FactoryBase::createHistogram2D
tH2DPtr createHistogram2D(const string &path, const string &title, int nbx, double xlo, double xup, int nby, double ylo, double yup)
Create and return a AIDA::IHistogram2D object in the underlying AIDA histogram factory.
ThePEG::FactoryBase::theAnalysisFactory
AIDA::IAnalysisFactory * theAnalysisFactory
A pointer to the underlying AIDA::IAnalysisFactory object.
Definition:
FactoryBase.h:483
ThePEG::FactoryBase::analysisFactory
AIDA::IAnalysisFactory & analysisFactory() const
Access the underlying AIDA::IAnalysisFactory object.
Definition:
FactoryBase.h:230
ThePEG::FactoryBase::FactoryBase
FactoryBase(const FactoryBase &)
The copy constructor.
ThePEG::FactoryBase::clear
void clear()
Delete all associated AIDA objects.
ThePEG::FactoryBase::clients
set< IPtr > clients
A set of client objects which have required histograms from this factory.
Definition:
FactoryBase.h:504
ThePEG::FactoryBase::theSuffix
string theSuffix
Together with theFilename, the name of the file where the resulting histograms will be stored.
Definition:
FactoryBase.h:473
ThePEG::FactoryBase::Init
static void Init()
The standard Init function used to initialize the interfaces.
ThePEG::FactoryBase::histogramFactory
AIDA::IHistogramFactory & histogramFactory() const
A pointer to the underlying AIDA::IHistogramFactory object.
ThePEG::FactoryBase::normalizeToXSec
virtual void normalizeToXSec(tH1DPtr histogram, CrossSection unit=picobarn) const =0
Rescale the given histogram so that the integral over the bins will give the correct integrated cross...
ThePEG::FactoryBase::initFactoryBase
static AbstractClassDescription< FactoryBase > initFactoryBase
The static object used to initialize the description of this class.
Definition:
FactoryBase.h:512
ThePEG::FactoryBase::persistentInput
void persistentInput(PersistentIStream &is, int version)
Function used to read in object persistently.
ThePEG::FactoryBase::normalizeToXSec
virtual void normalizeToXSec(tH2DPtr histogram, CrossSection unit=picobarn) const =0
Rescale the given histogram so that the integral over the bins will give the correct integrated cross...
ThePEG::FactoryBase::mkdirs
void mkdirs(const string &path)
Create a new directory in the underlying AIDA tree.
ThePEG::FactoryBase::persistentOutput
void persistentOutput(PersistentOStream &os) const
Function used to write out object persistently.
ThePEG::FactoryBase::~FactoryBase
virtual ~FactoryBase()
The destructor.
ThePEG::FactoryBase::createDataSet
DataFiller createDataSet(const string &path, const string &title, int dim)
Create a IDataPointSet with the given path and title and containing points with the given number of d...
ThePEG::FactoryBase::tree
AIDA::ITree & tree() const
Access the underlying AIDA::ITree object.
ThePEG::FactoryBase::dataSetFactory
AIDA::IDataPointSetFactory & dataSetFactory() const
A pointer to the underlying AIDA::IDataPointSetFactory object.
ThePEG::FactoryBase::tDSetPtr
AIDA::IDataPointSet * tDSetPtr
Convenient typedef for pointer to AIDA::IHistogram1D.
Definition:
FactoryBase.h:74
ThePEG::FactoryBase::registerClient
void registerClient(tIPtr client)
Used by a client object to indicate that he has required histograms from this factory.
ThePEG::FactoryBase::createHistogram1D
tH1DPtr createHistogram1D(const string &path, const string &title, const std::vector< double > &edges)
Create and return a AIDA::IHistogram1D object in the underlying AIDA histogram factory.
ThePEG::FactoryBase::doinitrun
virtual void doinitrun()
Initialize this object.
ThePEG::FactoryBase::tH2DPtr
AIDA::IHistogram2D * tH2DPtr
Convenient typedef for pointer to AIDA::IHistogram2D.
Definition:
FactoryBase.h:64
ThePEG::FactoryBase::createHistogram1D
tH1DPtr createHistogram1D(const string &path, int nb, double lo, double up)
Create and return a AIDA::IHistogram1D object in the underlying AIDA histogram factory.
ThePEG::FactoryBase::tcH2DPtr
const AIDA::IHistogram2D * tcH2DPtr
Convenient typedef for pointer to const AIDA::IHistogram2D.
Definition:
FactoryBase.h:69
ThePEG::FactoryBase::dofinish
virtual void dofinish()
Finalize this object.
ThePEG::FactoryBase::operator=
FactoryBase & operator=(const FactoryBase &)=delete
The assignment operator is private and must never be called.
ThePEG::FactoryBase::tcH1DPtr
const AIDA::IHistogram1D * tcH1DPtr
Convenient typedef for pointer to const AIDA::IHistogram1D.
Definition:
FactoryBase.h:59
ThePEG::FactoryBase::normalizeToUnity
virtual void normalizeToUnity(tH1DPtr histogram) const =0
Rescale the given histogram so that the integral over the bins gives one.
ThePEG::FactoryBase::theStoreType
string theStoreType
The format in which the histograms are stored in the output file.
Definition:
FactoryBase.h:478
ThePEG::FactoryBase::theFilename
string theFilename
Together with theSuffix, the name of the file where the resulting histograms will be stored.
Definition:
FactoryBase.h:467
ThePEG::FactoryBase::tcDSetPtr
const AIDA::IDataPointSet * tcDSetPtr
Convenient typedef for pointer to const AIDA::IHistogram1D.
Definition:
FactoryBase.h:79
ThePEG::FactoryBase::createHistogram2D
tH2DPtr createHistogram2D(const string &path, int nbx, double xlo, double xup, int nby, double ylo, double yup)
Create and return a AIDA::IHistogram2D object in the underlying AIDA histogram factory.
ThePEG::FactoryBase::theDataSetFactory
AIDA::IDataPointSetFactory * theDataSetFactory
A pointer to the underlying AIDA::IDataPointSetFactory object.
Definition:
FactoryBase.h:498
ThePEG::FactoryBase::suffix
const string & suffix() const
Together with filename(), the name of the file where the resulting histograms will be stored.
Definition:
FactoryBase.h:172
ThePEG::FactoryBase::mkdir
void mkdir(const string &path)
Create a new directory in the underlying AIDA tree.
ThePEG::FactoryBase::theHistogramFactory
AIDA::IHistogramFactory * theHistogramFactory
A pointer to the underlying AIDA::IHistogramFactory object.
Definition:
FactoryBase.h:493
ThePEG::FactoryBase::normalizeToXSecFraction
virtual void normalizeToXSecFraction(tH2DPtr histogram) const =0
Rescale the given histogram so that the integral over the bins gives the fraction of the total cross ...
ThePEG::FactoryBase::createHistogram1D
tH1DPtr createHistogram1D(const string &path, const string &title, int nb, double lo, double up)
Create and return a AIDA::IHistogram1D object in the underlying AIDA histogram factory.
ThePEG::FactoryBase::FactoryBase
FactoryBase()
The default constructor.
ThePEG::FactoryBase::normalizeToUnity
virtual void normalizeToUnity(tH2DPtr histogram) const =0
Rescale the given histogram so that the integral over the bins gives one.
ThePEG::InterfacedBase::path
string path() const
Returns the path to this object including the trailing '/'.
Definition:
InterfacedBase.h:96
ThePEG::Interfaced
The Interfaced class is derived from the InterfacedBase class adding a couple of things particular to...
Definition:
Interfaced.h:38
ThePEG::PersistentIStream
PersistentIStream is used to read persistent objects from a stream where they were previously written...
Definition:
PersistentIStream.h:48
ThePEG::PersistentOStream
PersistentOStream is used to write objects persistently to a stream from which they can be read in ag...
Definition:
PersistentOStream.h:51
ThePEG::Pointer::TransientRCPtr
TransientRCPtr is a simple wrapper around a bare pointer which can be assigned to and from an RCPtr a...
Definition:
RCPtr.h:519
ThePEG::Qty< std::ratio< L, DL >, std::ratio< E, DE >, std::ratio< Q, DQ > >
Definition:
PhysicalQty.h:77
ThePEG
This is the main namespace within which all identifiers in ThePEG are declared.
Definition:
FactoryBase.h:28
ThePEG::BaseClassTrait::NthBase
int NthBase
The type of the BaseN'th base class (int means there are no further base classes).
Definition:
ClassTraits.h:161
ThePEG::ClassTraitsBase::className
static string className()
Return the name of class T.
Definition:
ClassTraits.h:66
Generated on Thu Jun 20 2024 14:47:00 for ThePEG by
1.9.6