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);
59 vector<string> v_filename;
60 ifstream fileList (
"./dataADSTlist.txt");
62 while (fileList >> filename) {
63 v_filename.push_back(filename);
66 const TVector3 vmag(-884.62,-19699.87,+14154.43);
67 RecEventFile *
file =
new RecEventFile(v_filename);
68 RecEvent* theevent=
new RecEvent();
69 int nevents=file->GetNEvents();
70 cout << nevents << endl;
71 file->SetBuffers(&theevent);
72 DetectorGeometry *geo =
new DetectorGeometry();
73 file->ReadDetectorGeometry(*geo);
75 ofstream File_data(
"Amplitude_data.txt");
78 float distance_before=0;
79 int distance_stadtion_id=0;
83 const RdEvent& theradio= theevent->GetRdEvent();
84 const RdRecShower& rshow=theradio.GetRdRecShower();
86 if (!theradio.HasRdStations())
continue ;
87 const std::vector<RdRecStation>& vecRstat=theradio.GetRdStationVector();
88 const SDEvent& sdev=theevent->GetSDEvent();
89 const SdRecShower& sshow= sdev.GetSdRecShower();
91 const TVector3& score=sshow.GetCoreSiteCS();
92 const TVector3& rcore=rshow.GetCoreSiteCS();
93 const TVector3& saxis=sshow.GetAxisSiteCS();
95 double rtheta=TMath::RadToDeg()*rshow.GetZenith();
96 double rphi=TMath::RadToDeg()*rshow.GetAzimuth();
97 double stheta=TMath::RadToDeg()*sshow.GetZenith();
98 double sphi=TMath::RadToDeg()*sshow.GetAzimuth();
99 TVector3 raxis=rshow.GetAxisSiteCS();
100 float scal=saxis.Dot(raxis);
101 float snrm=saxis.Mag();
103 scal=saxis.Dot(vmag);
104 float mnrm=vmag.Mag();
107 const int minRecLevel=3;
108 const int minCandidateStations=4;
109 const int T4Trigger=2;
110 const int T5Trigger=3;
112 const float minZenithSD=62;
113 const float maxZenithSD=80;
115 if (sdev.GetRecLevel()<minRecLevel)
continue;
116 if (sdev.GetNumberOfCandidates()<minCandidateStations)
continue;
117 if (sdev.GetT4Trigger()<T4Trigger)
continue;
118 if (sdev.GetT5Trigger()<T5Trigger)
continue;
119 if (stheta>maxZenithSD)
continue;
120 if (stheta<minZenithSD)
continue;
125 for (
int i=0; i<160; i++) {
129 for (
int i=0; i<160; i++) {
130 if(theradio.HasRdStation(101+i)) {
131 arr[i].
dist_axis=geo->GetRdStationAxisDistance(101+i,raxis,rcore);
136 int how_many_stations_participate=0;
137 for (
int i=0; i<160; i++) {
138 if(arr[i].dist_axis < 10000000) {
139 how_many_stations_participate++;
143 distance_stadtion_id=arr[0].
id;
150 double minDist2 = -1;
151 unsigned int closestRdStationId = 0;
155 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};
157 for (vector<RdRecStation>::const_iterator stiter=vecRstat.begin(); stiter!=vecRstat.end(); ++stiter) {
159 for(
int i=0; i<46; i++) {
160 if(((stiter->GetId())-100)==dutch_stations[i]) {
165 TVector3 rd_station_coordinate=geo->GetRdStationPosition(stiter->GetId());
166 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());
168 if (closestRdStationId == 0 ||
sqrt(dist2) < minDist2) {
169 closestRdStationId = stiter->GetId();
170 minDist2 =
sqrt(dist2);
173 double distance_to_closest_rd_station=minDist2;
175 if(distance_to_closest_rd_station<= 500.0) {
182 for (vector<RdRecStation>::const_iterator stiter=vecRstat.begin(); stiter!=vecRstat.end(); ++stiter) {
184 if (stiter->IsRejected()) {
188 float axis_distance_to_sd=geo->GetStationAxisDistance(geo->GetRdStationPosition(stiter->GetId()), saxis , score);
190 if(stiter->GetParameter(revt::eSignalToNoise)>10.0) {
191 File_data << theradio.GetRdRunNumber() <<
" "
192 << theradio.GetRdEventId() <<
" "
193 << stiter->GetId() <<
" "
194 << stiter->GetParameter(revt::ePeakAmplitudeMag)*1e6 <<
" "
195 << stheta <<
" " << TMath::Log10(sshow.GetEnergy()) <<
" "
196 << contained <<
" " << axis_distance_to_sd << 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)