1 #include <fwk/CentralConfig.h>
2 #include <fwk/LocalCoordinateSystem.h>
3 #include <fwk/CoordinateSystemRegistry.h>
5 #include <evt/Header.h>
7 #include <evt/ShowerRecData.h>
8 #include <evt/ShowerSRecData.h>
9 #include <utl/TimeStamp.h>
10 #include <utl/AugerUnits.h>
11 #include <det/Detector.h>
12 #include <rdet/RDetector.h>
13 #include <boost/tokenizer.hpp>
20 #include <rdet/Station.h>
27 typedef boost::tokenizer<boost::char_separator<char> >
mytok;
32 fHeraldFilePath(
"/localdata/melissas/NewSimParams/shower_parameter_test_file.txt"),
45 ShowerMaker::~ShowerMaker() {
58 foutfile=
new TFile(
"out.root",
"RECREATE");
59 fH2_GroundMap =
new TH2F(
"GroundMap",
"GroundMap",700,-500,6500,350,-200,+3300);
60 fH2_Skymap =
new TH2F(
"skymap",
"sky",180,-2*TMath::Pi(),2*TMath::Pi(),180,-2*TMath::Pi(),2*TMath::Pi());
61 fH_phi =
new TH1F(
"phi",
"phi",180,0,360);
62 fH_theta =
new TH1F(
"theta",
"theta",45,0,90);
63 fH_energy =
new TH1F(
"nrj",
"nrj",30,17,20);
66 boost::char_separator<char> sep(
" ");
70 for(mytok::const_iterator titer=tok.begin();titer!=tok.end();++titer) {
71 if (*titer==
"#")
continue;
75 unsigned int seed=46150;
82 INFO(
"End Of File Reached");
92 boost::char_separator<char> sep(
" ");
93 mytok tok(zeline,sep);
94 vector<string> zetokens;
95 for(mytok::const_iterator titer=tok.begin();titer!=tok.end();++titer) {
96 zetokens.push_back(*titer);
101 if (zetokens.size()<12) {
103 for (
unsigned int i=0;i<zetokens.size();++i) cout <<
" " << zetokens[i];
106 Detector& Det = Detector::GetInstance();
115 float coreX=atof(zetokens[
fm_index[
"fXCore"]].c_str())*
m;
116 float coreY=atof(zetokens[
fm_index[
"fYCore"]].c_str())*
m;
117 float coreZ=refpos.
GetZ(coordsys);
119 Point core(coreX,coreY,coreZ,coordsys);
120 cout <<
"X : " << core.
GetX(coordsys)/
m <<
" Y: " << core.
GetY(coordsys)/
m <<
" Z : " << core.
GetZ(coordsys)/
m << endl;
135 for (vector<int>::const_iterator stiter=v_stid.begin();stiter!=v_stid.end();++stiter) {
188 float energy=atof(zetokens[
fm_index[
"Energy(CICINFILL)"]].c_str())*
EeV;
193 cout <<
" MM :: Energy ==" << zetokens[
fm_index[
"Energy(CICINFILL)"]] <<
"UTCTime " << zetokens[
fm_index[
"UTCTime"]].c_str() <<endl ;
205 cout <<
" MM :: " << theta/
degree <<
" ph "<< phi/
degree <<endl;
210 utl::Vector axis(cos(phi)*sin(theta),sin(phi)*sin(theta),cos(theta),coordsys);
214 TimeStamp ts(atoi(zetokens[fm_index[
"UTCTime"]].c_str()),atoi(zetokens[fm_index[
"fRec.fT0"]].c_str()));
216 det::Detector::GetInstance().Update(head.
GetTime());
230 void ShowerMaker::Diskgen(TRandom2& rnd,
double& x,
double& y,
double r) {
231 double phi = rnd.Rndm()*TMath::TwoPi();
232 double radius=rnd.Rndm()*r;
233 x = radius*TMath::Cos(phi);
234 y= radius*TMath::Sin(phi);
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.
evt::Header & GetHeader()
Interface class to access to the SD Reconstruction of a Shower.
Interface class to access Shower Reconstructed parameters.
CoordinateSystemPtr GetCoordinateSystem() const
Get the coordinate system of the current internal representation.
Skip remaining modules in the current loop and continue with next iteration of the loop...
ShowerRecData & GetRecShower()
const std::vector< int > & GetFullStationList() const
Get list of ID's for all stations available in the database or configuration file.
#define INFO(message)
Macro for logging informational messages.
void Init()
Initialise the registry.
std::string fHeraldFilePath
ShowerSRecData & GetSRecShower()
A TimeStamp holds GPS second and nanosecond for some event.
Detector description interface for RDetector-related data.
boost::shared_ptr< const CoordinateTransformer > CoordinateSystemPtr
Shared pointer for coordinate systems.
Break current loop. It works for nested loops too!
double GetX(const CoordinateSystemPtr &coordinateSystem) const
void SetEnergy(const double energy, const double error)
std::ifstream * fHeraldStream
void SetAxis(const utl::Vector &axis)
Top of the hierarchy of the detector description interface.
double GetY(const CoordinateSystemPtr &coordinateSystem) const
ResultFlag
Flag returned by module methods to the RunController.
boost::tokenizer< boost::char_separator< char > > mytok
utl::CoordinateSystemPtr GetReferenceCoordinateSystem() const
Get the reference coordinate system used for analysis (usually PampaAmarilla for Auger) ...
TimeStamp GetCurrentSystemTime()
get current time as reported by system
const utl::Point & GetCorePosition() const
void SetCorePosition(const utl::Point &core)
const rdet::RDetector & GetRDetector() const
void SetEnergy(const double energy, const double error)
double GetZ(const CoordinateSystemPtr &coordinateSystem) const
utl::Point GetPosition() const
Tank position in Site Cartesian Coordinates.
static Policy::type Create(const utl::Point &theOrigin)
Create the standard local coordinate system for a Point.
const Station & GetStation(const int stationId) const
Get station by Station Id.
std::map< std::string, unsigned int > fm_index