source: JEM-EUSO/esaf_cc_at_lal/packages/simulation/radiativetransfer/src/RadiativeFactory.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: 3.7 KB
Line 
1// ESAF : Euso Simulation and Analysis Framework
2// $Id: RadiativeFactory.cc 2676 2006-04-28 15:22:49Z moreggia $
3// S. Moreggia created 27 October 2003
4
5#include <stdexcept>
6#include "RadiativeFactory.hh"
7#include "Config.hh"
8#include "TestGround.hh"
9#include "LowtranRadiativeProcessesCalculator.hh"
10#include "FastRadiativeProcessesCalculator.hh"
11#include "O1_ClearSkyPropagator.hh"
12#include "O2_ClearSkyPropagator.hh"
13#include "AlongTrack_CSPropagator.hh"
14#include "TestCloudsPropagator.hh"
15#include "NoCloudsPropagator.hh"
16
17ClassImp(RadiativeFactory)
18
19RadiativeFactory* RadiativeFactory::fMe = NULL;
20
21//______________________________________________________________________________
22RadiativeFactory::RadiativeFactory() : EsafConfigurable(), EsafMsgSource() {
23    //
24    // ctor
25    //
26}
27
28//______________________________________________________________________________
29RadiativeFactory::~RadiativeFactory() {
30    //
31    // dtor
32    //
33}
34
35//______________________________________________________________________________
36RadiativeFactory* RadiativeFactory::Get() {
37    //
38    // get the instance
39    //
40    if (fMe == NULL) {
41        fMe = new RadiativeFactory();
42        if (fMe == NULL)
43            cout << "PANIC : No new RadiativeFactory, memory pb" << MsgDispatch;
44    }
45    return fMe;
46}
47
48//______________________________________________________________________________
49RadiativeProcessesCalculator* RadiativeFactory::GetRadiativeProcessesCalculator() const {
50    //
51    // build appropriate RadiativeProcessesCalculator object
52    //
53    string type = Conf()->GetStr("RadiativeFactory.RadiativeProcessesCalculator");
54   
55    if(type == "fast")
56        return new FastRadiativeProcessesCalculator();
57
58    else if(type == "lowtran")
59        return new LowtranRadiativeProcessesCalculator();
60
61    else
62        Msg(EsafMsg::Panic) << "invalid RadiativeProcessesCalculator object" << MsgDispatch;
63
64    return NULL;
65}
66
67//______________________________________________________________________________
68Ground* RadiativeFactory::GetGround() const {
69    //
70    // build appropriate Ground object
71    //
72    string type = Conf()->GetStr("RadiativeFactory.Ground");
73   
74    if(type == "test")
75        return new TestGround();
76
77    else Msg(EsafMsg::Panic) << "invalid Ground object " << MsgDispatch;
78
79    return NULL;
80
81}
82
83//______________________________________________________________________________
84ClearSkyPropagator* RadiativeFactory::GetClearSkyPropagator(const Ground* g) const {
85    //
86    //build appropriate ClearSkyPropagator object
87    //
88    string type = Conf()->GetStr("RadiativeFactory.ClearSkyPropagator");
89   
90    // Fluo directly to Euso
91    // Ckov towrad ground then reflected
92    if(type == "order1")
93        return new O1_ClearSkyPropagator(g);
94
95    // order1 + Ckov backscattered when going downward
96    else if(type == "order2")
97        return new O2_ClearSkyPropagator(g);
98   
99    // order2 but bunches assumed propagating along a track
100    else if(type == "alongtrack")
101        return new AlongTrack_CSPropagator(g);
102
103    else Msg(EsafMsg::Panic) << "invalid ClearSkyPropagator object"  << MsgDispatch;
104    return NULL;
105}
106
107//______________________________________________________________________________
108InCloudsPropagator* RadiativeFactory::GetInCloudsPropagator(const Ground* g) const {
109    //
110    // build appropriate InCloudsPropagator object
111    //
112    ConfigFileParser* pConfig = Config::Get()->GetCF("Atmosphere","AtmosphereFactory");
113    string type = pConfig->GetStr("AtmosphereFactory.Clouds.type");
114   
115    if(type == "test")
116        return new TestCloudsPropagator(g);
117   
118    else if(type == "none")
119        return new NoCloudsPropagator();
120   
121    else Msg(EsafMsg::Panic) << "invalid InCloudsPropagator object" << MsgDispatch;
122    return NULL;
123
124}
125
126
127
Note: See TracBrowser for help on using the repository browser.