13 #include <TTimeStamp.h>
18 #include "RecEventFile.h"
21 #include "DetectorGeometry.h"
23 #include "DetectorGeometry.h"
24 #include "SdRecStation.h"
32 TH2F* Multiplicity =
new TH2F(
"Muliplicity",
"Multiplicity", 15 , 60, 90, 75, 0, 75);
33 TProfile* Multiplicity_prof =
new TProfile(
"Multiplicity_prof",
"Multiplicity_prof", 15, 60, 90, 0, 75);
35 TGraph* FurthestStation =
new TGraph();
36 TGraph* FurthestStationWithCuts =
new TGraph();
37 TProfile* FurthestStation_prof =
new TProfile(
"FurthestStation_prof",
"FurthestStation_prof", 15, 60, 90, 0, 3000,
"S");
39 TGraph* FurthestStationEnergy =
new TGraph();
40 TGraph* FurthestStationEnergyWithCuts =
new TGraph();
41 TProfile* FurthestStationEnergy_prof =
new TProfile(
"FurthestStationEnergy_prof",
"FurthestStationEnergy_prof", 10, 17.5, 19.5, 0, 2000,
"S");
43 TH2F* FurthestStationEnergyTheta =
new TH2F(
"FurthestStationEnergyTheta",
"FurthestStationEnergyTheta", 20, 10, 360, 2000, 0, 2000);
44 TProfile* FurthestStationEnergyTheta_prof =
new TProfile(
"FurthestStationEnergyTheta_prof",
"FurthestStationEnergyTheta_prof", 20, 10, 360, 0, 2000,
"S");
46 TH1F* NumberOfStations =
new TH1F(
"NumberOfStations",
"NumberOfStations", 75 , 0, 75);
48 int dutch_stations[46]= {102, 104, 105, 108, 109, 112, 134, 135, 136, 143,
49 144, 149, 158, 159, 160, 169, 170, 183, 184, 185,
50 188, 192, 193, 194, 200, 201, 202, 203, 210, 211,
51 212, 213, 222, 223, 224, 225, 226, 235, 236, 237,
52 244, 245, 246, 251, 252, 257};
54 vector<string> v_filename;
55 ifstream fileList (
"./filelist.txt");
57 while (fileList >> filename) {
58 v_filename.push_back(filename);
61 RecEventFile *
file =
new RecEventFile(v_filename);
62 RecEvent* theevent=
new RecEvent();
63 int nevents=file->GetNEvents();
64 cout << nevents << endl;
65 file->SetBuffers(&theevent);
66 DetectorGeometry *geo =
new DetectorGeometry();
67 file->ReadDetectorGeometry(*geo);
71 const RdEvent& theradio= theevent->GetRdEvent();
72 const RdRecShower& rshow=theradio.GetRdRecShower();
74 if (!theradio.HasRdStations())
continue ;
75 const std::vector<RdRecStation>& vecRstat=theradio.GetRdStationVector();
76 const SDEvent& sdev=theevent->GetSDEvent();
77 const SdRecShower& sshow= sdev.GetSdRecShower();
79 const TVector3& score=sshow.GetCoreSiteCS();
80 const TVector3& rcore=rshow.GetCoreSiteCS();
82 const TVector3& saxis=sshow.GetAxisSiteCS();
84 double rtheta=TMath::RadToDeg()*rshow.GetZenith();
85 double rphi=TMath::RadToDeg()*rshow.GetAzimuth();
86 double stheta=TMath::RadToDeg()*sshow.GetZenith();
87 double sphi=TMath::RadToDeg()*sshow.GetAzimuth();
89 if (stheta<60 || stheta>84)
92 double RdZenith = rshow.GetZenith();
93 double RdAzimuth = rshow.GetAzimuth();
94 double SdZenith = sshow.GetZenith();
95 double SdAzimuth = sshow.GetAzimuth();
96 const double xr = sin(RdZenith)*cos(RdAzimuth);
97 const double yr = sin(RdZenith)*sin(RdAzimuth);
98 const double zr = cos(RdZenith);
99 const double xs = sin(SdZenith)*cos(SdAzimuth);
100 const double ys = sin(SdZenith)*sin(SdAzimuth);
101 const double zs = cos(SdZenith);
102 const double phi = 180./TMath::Pi()*acos((xr*xs+yr*ys+zr*zs)/(
103 sqrt(xr*xr+yr*yr+zr*zr)*
sqrt(xs*xs+ys*ys+zs*zs)));
105 cout <<
"opening angle SD RD greater 20 degree. Skipping event" << endl;
110 if(rshow.HasParameter(revt::eNumberOfStationsWithPulseFound)) {
111 Multiplicity->Fill(stheta,rshow.GetParameter(
112 revt::eNumberOfStationsWithPulseFound));
113 Multiplicity_prof->Fill(stheta,rshow.GetParameter(
114 revt::eNumberOfStationsWithPulseFound), 1);
118 double furthestDistance = 0.0;
119 for (vector<RdRecStation>::const_iterator stiter=vecRstat.begin();
120 stiter!=vecRstat.end(); ++stiter) {
126 if (stiter->IsRejected())
129 double axis_distance_to_sd=geo->GetStationAxisDistance(
130 geo->GetRdStationPosition(stiter->GetId()), saxis , score);
132 if(stiter->GetParameter(revt::eSignalToNoise)>10.0)
133 if (axis_distance_to_sd > furthestDistance)
134 furthestDistance = axis_distance_to_sd;
142 if(theradio.GetRdRunNumber() == 100809 && theradio.GetRdEventId() == 114253){
146 FurthestStation_prof->Fill(stheta,furthestDistance,1);
148 double energy_sd = sshow.GetEnergy();
149 FurthestStationEnergy_prof->Fill(log10(energy_sd),furthestDistance,1);
151 FurthestStationEnergyTheta->Fill(log10(energy_sd)/cos(stheta*TMath::DegToRad()),
153 FurthestStationEnergyTheta_prof->Fill(log10(energy_sd)/cos(stheta*TMath::DegToRad()),
156 NumberOfStations->Fill(rshow.GetParameter(revt::eNumberOfStationsWithPulseFound));
159 const int minRecLevel = 3;
160 const int minCandidateStations = 4;
161 const int T4Trigger = 2;
162 const int T5Trigger = 3;
164 const float minZenithSD = 60;
165 const float maxZenithSD = 84;
167 if(sdev.GetRecLevel()<minRecLevel ||
168 sdev.GetNumberOfCandidates()<minCandidateStations ||
169 sdev.GetT4Trigger()<T4Trigger || sdev.GetT5Trigger()<T5Trigger ||
170 stheta>maxZenithSD || stheta<minZenithSD ||
171 log10(sshow.GetEnergy()) < 18.5){
172 FurthestStation->SetPoint(FurthestStation->GetN(),
173 stheta,furthestDistance);
174 FurthestStationEnergy->SetPoint(FurthestStation->GetN(),
175 log10(energy_sd),furthestDistance);
177 FurthestStationWithCuts->SetPoint(FurthestStationWithCuts->GetN(),
178 stheta,furthestDistance);
179 FurthestStationEnergyWithCuts->SetPoint(FurthestStation->GetN(),
180 log10(energy_sd),furthestDistance);
184 cout <<
"number of entries, min, max" << endl;
185 cout << FurthestStation_prof->GetEntries() << endl;
186 cout << TMath::MinElement(FurthestStation->GetN(),FurthestStation->GetX()) << endl;
187 cout << TMath::MaxElement(FurthestStation->GetN(),FurthestStation->GetX()) << endl;
190 TCanvas Histos(
"Histos",
"Histos",1800,1000);
191 Histos.SetLeftMargin(0.14);
192 Histos.SetRightMargin(0.05);
193 Histos.SetTopMargin(0.06);
194 Histos.SetBottomMargin(0.14);
196 FurthestStation->SetTitle(
";#theta_{SD} / #circ;Axis distance of furthest station / m");
197 FurthestStation->SetMarkerStyle(33);
198 FurthestStation->SetMarkerSize(2.);
199 FurthestStation->SetMarkerColor(38);
200 FurthestStation->GetXaxis()->SetTitleSize(0.055);
201 FurthestStation->GetXaxis()->SetTitleOffset(1.2);
202 FurthestStation->GetXaxis()->SetRangeUser(59, 90);
203 FurthestStation->GetXaxis()->SetLabelFont(42);
204 FurthestStation->GetXaxis()->SetLabelSize(0.05);
205 FurthestStation->GetXaxis()->SetLabelOffset(0.01);
206 FurthestStation->GetYaxis()->SetTitleSize(0.055);
207 FurthestStation->GetYaxis()->SetTitleOffset(1.1);
208 FurthestStation->GetYaxis()->SetLabelFont(42);
209 FurthestStation->GetYaxis()->SetLabelSize(0.05);
210 FurthestStation->GetYaxis()->SetLabelOffset(0.01);
211 FurthestStation->Draw(
"AP");
213 FurthestStationWithCuts->SetMarkerStyle(20);
214 FurthestStationWithCuts->SetMarkerSize(1.5);
215 FurthestStationWithCuts->SetMarkerColor(kBlack);
216 FurthestStationWithCuts->Draw(
"P SAMES");
218 FurthestStation_prof->SetStats(kFALSE);
219 FurthestStation_prof->SetMarkerStyle(34);
220 FurthestStation_prof->SetMarkerSize(1.8);
221 FurthestStation_prof->SetLineWidth(2);
222 FurthestStation_prof->SetLineColor(kRed);
223 FurthestStation_prof->SetMarkerColor(kRed);
224 FurthestStation_prof->Draw(
"P SAMES");
226 Histos.SaveAs(
"furtheststation_noCuts.pdf");
228 TCanvas Histos2(
"Histos",
"Histos",1800,1000);
229 Histos2.SetLeftMargin(0.14);
230 Histos2.SetRightMargin(0.05);
231 Histos2.SetTopMargin(0.06);
232 Histos2.SetBottomMargin(0.14);
234 FurthestStationEnergy->SetTitle(
";log_{10}(E_{SD} / eV);Axis distance of furthest station / m");
235 FurthestStationEnergy->SetMarkerStyle(33);
236 FurthestStationEnergy->SetMarkerSize(2.);
237 FurthestStationEnergy->SetMarkerColor(38);
238 FurthestStationEnergy->GetXaxis()->SetTitleSize(0.055);
239 FurthestStationEnergy->GetXaxis()->SetTitleOffset(1.2);
240 FurthestStationEnergy->GetXaxis()->SetRangeUser(17.5, 19.5);
241 FurthestStationEnergy->GetXaxis()->SetLabelFont(42);
242 FurthestStationEnergy->GetXaxis()->SetLabelSize(0.05);
243 FurthestStationEnergy->GetXaxis()->SetLabelOffset(0.01);
244 FurthestStationEnergy->GetYaxis()->SetTitleSize(0.055);
245 FurthestStationEnergy->GetYaxis()->SetTitleOffset(1.1);
246 FurthestStationEnergy->GetYaxis()->SetLabelFont(42);
247 FurthestStationEnergy->GetYaxis()->SetLabelSize(0.05);
248 FurthestStationEnergy->GetYaxis()->SetLabelOffset(0.01);
249 FurthestStationEnergy->Draw(
"AP");
251 FurthestStationEnergyWithCuts->SetMarkerStyle(20);
252 FurthestStationEnergyWithCuts->SetMarkerSize(1.5);
253 FurthestStationEnergyWithCuts->SetMarkerColor(kBlack);
254 FurthestStationEnergyWithCuts->Draw(
"P SAMES");
256 FurthestStationEnergy_prof->SetStats(kFALSE);
257 FurthestStationEnergy_prof->SetMarkerStyle(34);
258 FurthestStationEnergy_prof->SetMarkerSize(1.8);
259 FurthestStationEnergy_prof->SetLineWidth(2);
260 FurthestStationEnergy_prof->SetLineColor(kRed);
261 FurthestStationEnergy_prof->SetMarkerColor(kRed);
262 FurthestStationEnergy_prof->Draw(
"P SAMES");
264 Histos2.SaveAs(
"FurthestStationEnergy_noCuts.pdf");
266 FurthestStationEnergyTheta->GetXaxis()->SetTitle(
"log10(Energy/eV)/cos(#theta)");
267 FurthestStationEnergyTheta->GetYaxis()->SetTitle(
"Axis distance of furthest station [m]");
268 FurthestStationEnergyTheta->SetMarkerStyle(20);
269 FurthestStationEnergyTheta->SetMarkerSize(0.4);
270 FurthestStationEnergyTheta->SetMarkerColor(kBlack);
271 FurthestStationEnergyTheta->GetXaxis()->SetTitleOffset(1.2);
272 FurthestStationEnergyTheta->GetYaxis()->SetTitleOffset(1.2);
273 FurthestStationEnergyTheta->Draw(
"P");
275 FurthestStationEnergyTheta_prof->SetStats(kFALSE);
276 FurthestStationEnergyTheta_prof->SetMarkerStyle(34);
277 FurthestStationEnergyTheta_prof->SetMarkerSize(1.4);
278 FurthestStationEnergyTheta_prof->SetLineColor(kRed);
279 FurthestStationEnergyTheta_prof->SetMarkerColor(kBlue);
280 FurthestStationEnergyTheta_prof->Draw(
"P SAME");
282 Histos.SaveAs(
"furtheststationenergytheta_noCuts.pdf");
int main(int argc, char *argv[])