source: JEM-EUSO/esaf_cc_at_lal/packages/simulation/lightsources/src/LightSourceFactory.cc @ 114

Last change on this file since 114 was 114, checked in by moretto, 11 years ago

actual version of ESAF at CCin2p3

File size: 1.4 KB
Line 
1// ESAF : Euso Simulation and Analysis Framework
2// $Id: LightSourceFactory.cc 2037 2005-07-13 10:59:06Z berat $
3// Anne Stutz created Mar, 23 2004
4
5#include <string>
6#include "LightSourceFactory.hh"
7#include "KakimotoFluoCalculator.hh"
8#include "NaganoFluoCalculator.hh"
9#include "N2dataFluoCalculator.hh"
10#include "SimpleCrkCalculator.hh"
11
12ClassImp(LightSourceFactory)
13
14LightSourceFactory *LightSourceFactory::fMe = NULL;
15
16// ctor
17LightSourceFactory::LightSourceFactory() {
18}
19
20// dtor
21LightSourceFactory::~LightSourceFactory() {
22}
23
24// instance
25LightSourceFactory* LightSourceFactory::Get() {
26    if ( fMe == NULL )
27        fMe = new LightSourceFactory();
28    return fMe;
29}
30
31// call ctor of appropriate Fluorescence Calculator
32FluoCalculator* LightSourceFactory::GetFluoCalculator( const string& name ) {
33    if ( name == "kakimoto" )
34        return new KakimotoFluoCalculator();
35    else if ( name == "nagano" )
36       return new NaganoFluoCalculator();
37    else if ( name == "N2data" )
38       return new N2dataFluoCalculator();
39    else throw invalid_argument("invalid FluoCalculator object : " + name);
40    return NULL;
41}
42
43// call ctor of appropriate Cerenkov Calculator
44CrkCalculator* LightSourceFactory::GetCrkCalculator( const string& name ) {
45    if ( name == "simple" )
46        return new SimpleCrkCalculator();
47    else throw invalid_argument("invalid CrkCalculator object : " + name);
48    return NULL;
49}
Note: See TracBrowser for help on using the repository browser.