12 #include <TTimeStamp.h>
13 #define AUGER_RADIO_ENABLED
14 #include "RecEventFile.h"
17 #include "DetectorGeometry.h"
19 #include "DetectorGeometry.h"
20 #include "SdRecStation.h"
37 const Int_t NRGBs = 5;
38 const Int_t NCont = 255;
39 Double_t stops[NRGBs] = { 0.00, 0.34, 0.61, 0.84, 1.00 };
40 Double_t
red[NRGBs] = { 0.00, 0.00, 0.87, 1.00, 0.51 };
41 Double_t
green[NRGBs] = { 0.00, 0.81, 1.00, 0.20, 0.00 };
42 Double_t
blue[NRGBs] = { 0.51, 1.00, 0.12, 0.00, 0.00 };
43 TColor::CreateGradientColorTable(NRGBs, stops, red, green, blue, NCont);
44 gStyle->SetNumberContours(NCont);
60 vector<string> v_filename;
61 ifstream filelist(
"./simADSTlist.txt");
63 while(filelist >> filename){
64 v_filename.push_back(filename);
67 const TVector3 vmag(-884.62,-19699.87,+14154.43);
68 RecEventFile *
file =
new RecEventFile(v_filename);
69 RecEvent* theevent=
new RecEvent();
70 int nevents=file->GetNEvents();
71 cout << nevents << endl;
72 file->SetBuffers(&theevent);
73 DetectorGeometry *geo =
new DetectorGeometry();
74 file->ReadDetectorGeometry(*geo);
76 ofstream File_data(
"Amplitude_sim.txt");
79 float distance_before=0;
80 int distance_stadtion_id=0;
84 const RdEvent& theradio= theevent->GetRdEvent();
85 const RdRecShower& rshow=theradio.GetRdRecShower();
87 if (!theradio.HasRdStations())
continue ;
88 const std::vector<RdRecStation>& vecRstat=theradio.GetRdStationVector();
89 const SDEvent& sdev=theevent->GetSDEvent();
91 const SdRecShower& sshow= sdev.GetSdRecShower();
92 const TVector3& score=sshow.GetCoreSiteCS();
93 const TVector3& rcore=rshow.GetCoreSiteCS();
94 const TVector3& saxis=sshow.GetAxisSiteCS();
96 double rtheta=TMath::RadToDeg()*rshow.GetZenith();
97 double rphi=TMath::RadToDeg()*rshow.GetAzimuth();
98 double stheta=TMath::RadToDeg()*sshow.GetZenith();
99 double sphi=TMath::RadToDeg()*sshow.GetAzimuth();
100 TVector3 raxis=rshow.GetAxisSiteCS();
101 float scal=saxis.Dot(raxis);
102 float snrm=saxis.Mag();
104 scal=saxis.Dot(vmag);
105 float mnrm=vmag.Mag();
110 for (
int i=0; i<160; i++) {
114 for (
int i=0; i<160; i++) {
115 if(theradio.HasRdStation(101+i)) {
116 arr[i].
dist_axis=geo->GetRdStationAxisDistance(101+i,raxis,rcore);
121 int how_many_stations_participate=0;
122 for (
int i=0; i<160; i++) {
123 if(arr[i].dist_axis < 10000000) {
124 how_many_stations_participate++;
128 int stations_with_signal=0;
129 distance_stadtion_id=arr[0].
id;
136 double minDist2 = -1;
137 unsigned int closestRdStationId = 0;
141 int dutch_stations[46]= {102, 104, 105, 108, 109, 112, 134, 135, 136, 143, 144, 149, 158, 159, 160, 169, 170, 183, 184, 185, 188, 192, 193, 194, 200, 201, 202, 203, 210, 211, 212, 213, 222, 223, 224, 225, 226, 235, 236, 237, 244, 245, 246, 251, 252, 257};
143 for (vector<RdRecStation>::const_iterator stiter=vecRstat.begin(); stiter!=vecRstat.end(); ++stiter) {
145 for(
int i=0; i<46; i++) {
146 if(((stiter->GetId())-100)==dutch_stations[i]) {
151 TVector3 rd_station_coordinate=geo->GetRdStationPosition(stiter->GetId());
152 double dist2 = (rd_station_coordinate.X()-score.X())*(rd_station_coordinate.X()-score.X()) + (rd_station_coordinate.Y()-score.Y())*(rd_station_coordinate.Y()-score.Y());
154 if (closestRdStationId == 0 ||
sqrt(dist2) < minDist2) {
155 closestRdStationId = stiter->GetId();
156 minDist2 =
sqrt(dist2);
159 double distance_to_closest_rd_station=minDist2;
161 if(distance_to_closest_rd_station<= 500.0) {
169 for (vector<RdRecStation>::const_iterator stiter=vecRstat.begin(); stiter!=vecRstat.end(); ++stiter) {
171 if (stiter->IsRejected()) {
175 const Shower& mcev=theevent->GetGenShower();
176 const TVector3& mccore=theevent->GetGenShower().GetCoreSiteCS();
177 const TVector3& mcaxis=theevent->GetGenShower().GetAxisSiteCS();
179 float axis_distance_to_mc=geo->GetStationAxisDistance(geo->GetRdStationPosition(stiter->GetId()), mcaxis , mccore);
181 if(stiter->GetParameter(revt::eSignalToNoise)>10.0) {
182 File_data << theradio.GetRdRunNumber() <<
" "
183 << theradio.GetRdEventId() <<
" "
184 << stiter->GetId() <<
" "
185 << stiter->GetParameter(revt::ePeakAmplitudeMag)*1e6 <<
" "
187 << TMath::Log10(theevent->GetGenShower().GetEnergy()) <<
" "
188 << contained <<
" " << axis_distance_to_mc << endl;
static const G4Colour green(0.0, 1.0, 0.0)
bool compDist(antenna i, antenna j)
int main(int argc, char *argv[])
static const G4Colour red(1.0, 0.0, 0.0)
const int kGPS_UTC_Offset
static const G4Colour blue(0.0, 0.0, 1.0)