ReadMolecularHL.cc
Go to the documentation of this file.
1 #include <sstream>
2 
3 #include "ReadMolecularHL.h"
4 #include <utl/ErrorLogger.h>
5 
6 #include <evt/Event.h>
7 #include <det/Detector.h>
8 #include <utl/TimeStamp.h>
9 #include <utl/UTCDateTime.h>
10 
11 #include <atm/AerosolDB.h>
12 #include <atm/AerosolZone.h>
13 #include <atm/ProfileResult.h>
14 
15 #include <atm/MonthlyAvgDBProfileModel.h>
16 
17 using namespace std;
18 using namespace utl;
19 using namespace fwk;
20 using namespace det;
21 using namespace atm;
22 
23 using namespace ReadMolecularHLNS;
24 
25 ReadMolecularHL::ReadMolecularHL(){}
26 
27 ReadMolecularHL::~ReadMolecularHL(){}
28 
30  //
31  //
32  INFO("ReadMolecularHL::Init()");
33  return eSuccess;
34 }
35 
36 VModule::ResultFlag ReadMolecularHL::Run(evt::Event& event){
37  //
38  //
39  INFO("ReadMolecularHL::Run()");
40 
41  Detector& det = Detector::GetInstance();
42 
43  // Set detector time to something
44  //
45  det.Update(UTCDateTime(2005,3,21,15,15).GetTimeStamp());
46 
47  const Atmosphere& theAtm = Detector::GetInstance().GetAtmosphere();
48 
49  ProfileResult depthVsHeight = theAtm.EvaluateDepthVsHeight();
50  ProfileResult densityVsHeight = theAtm.EvaluateDensityVsHeight();
51  ProfileResult tempVsHeight = theAtm.EvaluateTemperatureVsHeight();
52 
53  // dump out some profile parameters every 300m
54  //
55  double minHeight =
56  max( tempVsHeight.MinX(),
57  max( depthVsHeight.MinX(),
58  densityVsHeight.MinX()));
59  double maxHeight =
60  min( tempVsHeight.MaxX(),
61  max( depthVsHeight.MaxX(),
62  densityVsHeight.MaxX()));
63  double deltaH = 300*m;
64 
65  for (double height = minHeight; height < maxHeight; height += deltaH) {
66  cout << "height = " << height/m << " m " << endl;
67  cout << " depth = " << depthVsHeight.Y(height)/(g/cm/cm) << " g/cm^2" << endl;
68  cout << " density = " << densityVsHeight.Y(height)/(g/cm/cm/cm) << " g/cm^3" << endl;
69  cout << " temp = " << tempVsHeight.Y(height)/kelvin << " deg k " << endl;
70  }
71 
72  return eSuccess;
73 }
74 
75 VModule::ResultFlag ReadMolecularHL::Finish(){
76  //
77  //
78  INFO("ReadMolecularHL::Finish()");
79  return eSuccess;
80 }
void Update(const utl::TimeStamp &time, const bool invData=true, const bool invComp=true, const bool forceRadio=false)
Update detector: deletes currently constructed stations and sets new time.
Definition: Detector.cc:179
Top of the interface to Atmosphere information.
const atm::ProfileResult & EvaluateDensityVsHeight() const
Tabulated function giving Y=density as a function of X=height.
#define INFO(message)
Macro for logging informational messages.
Definition: ErrorLogger.h:161
void Init()
Initialise the registry.
double Y(const double x) const
Get the Y value (coordinate) for given X (ordinate)
#define max(a, b)
Class describing the Atmospheric profile.
Definition: ProfileResult.h:25
Top of the hierarchy of the detector description interface.
Definition: Detector.h:81
const atm::ProfileResult & EvaluateDepthVsHeight() const
Tabulated function giving Y=depth as a function of X=height.
constexpr double g
Definition: AugerUnits.h:200
constexpr double kelvin
Definition: AugerUnits.h:259
double MinX() const
Return the minimum value for X (ordinate) stored in the profile.
ResultFlag
Flag returned by module methods to the RunController.
Definition: VModule.h:60
constexpr double cm
Definition: AugerUnits.h:117
constexpr double m
Definition: AugerUnits.h:121
const atm::ProfileResult & EvaluateTemperatureVsHeight() const
Tabulated function giving Y=temperature as a function of X=height.
double MaxX() const
Return the maximum value for X (ordinate) stored in the profile.

, generated on Tue Sep 26 2023.