-
Notifications
You must be signed in to change notification settings - Fork 0
/
CorFactorsFactory.h
43 lines (38 loc) · 983 Bytes
/
CorFactorsFactory.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
//! \brief Container class for jet correction factors
//
// $Id: CorFactorsFactory.h,v 1.3 2011/02/15 12:53:14 stadie Exp $
//
#ifndef CORFACTORSFACTORY_H
#define CORFACTORSFACTORY_H
#include <map>
#include <string>
class Jet;
class CorFactors;
class CorFactorsFactory
{
public:
CorFactorsFactory(const std::string& name);
virtual ~CorFactorsFactory();
virtual CorFactors* create(const Jet* j,int nPV = 1, double rho=-9999., double jetA=0.) = 0;
virtual CorFactorsFactory* clone() const = 0;
static CorFactorsFactory* get(std::string name) {
CorFactorsFactory* ccf = map[name];
return ccf ? ccf->clone() : 0;
}
private:
std::string name_;
static std::map<std::string,CorFactorsFactory*> map;
class Cleaner
{
public:
Cleaner() {}
~Cleaner()
{
for( std::map<std::string,CorFactorsFactory*>::iterator i = map.begin();
i != map.end() ; ++i) delete i->second;
map.clear();
}
};
friend class Cleaner;
};
#endif