void sipm_plotRadiometer(void) { // // Input the .csv data file from excel file into arrays for processing. // //#include #include #include gROOT->Reset(); //TTree *Bfield = (TTree *) gROOT->FindObject("Bfield"); //gROOT->LoadMacro("$ROOTSYS/test/libEvent.so"); gStyle->SetPalette(1,0); gStyle->SetOptStat(kFALSE); // gStyle->SetOptFit(kFALSE); gStyle->SetOptFit(1111); gStyle->SetPadRightMargin(0.15); gStyle->SetPadLeftMargin(0.15); gStyle->SetPadBottomMargin(0.15); gStyle->SetFillColor(0); // char line[1024]; char filename[132]; char name[10]; Double_t pi=3.14159; Int_t j,jj; # define npts1 29; Double_t f1[npts1]; Double_t radiometer1[npts1]; Double_t radiopulse1[npts1]; # define npts2 28; Double_t f2[npts2]; Double_t radiometer2[npts2]; Double_t radiopulse2[npts2]; sprintf(filename,"%s","radiometernppe.csv"); printf ("Read from filename=%s\n",filename); ifstream in1 (filename); in1.getline(line,1024,'\r'); printf ("line 1 =%s\n",line); in1.getline(line,1024,'\r'); printf ("line 2 =%s\n",line); jj = 0; // while(!in1.eof()) { for (jj=0;jj> f1[jj]; input >> radiometer1[jj]; input >> radiopulse1[jj]; printf ("frequency1=%g, radiometer1=%g, radiopulse1=%g \n",f1[jj],radiometer1[jj],radiopulse1[jj]); } in1.getline(line,1024,'\r'); printf ("line x =%s\n",line); printf ("\n\n"); for (jj=0;jj> f2[jj]; input >> radiometer2[jj]; input >> radiopulse2[jj]; printf ("frequency2=%g, radiometer2=%g, radiopulse2=%g \n",f2[jj],radiometer2[jj],radiopulse2[jj]); } for (jj=0;jjSetBorderMode(0); c1->SetFillColor(0); c1->SetGridx(); c1->SetGridy(); // normalize radiopulse1 Double_t radio_norm=3; for (jj=0;jjAddEntry(pulse1,"Radiometer LED V=3.43/-0.25, 8 ns","p"); leg2->AddEntry(pulse2,"Radiometer LED V=3.83/-0.10, 8 ns","p"); /*t1 = new TLatex(0.5,0.8,string); t1->SetTextColor(1); t1->SetNDC(); t1->Draw();*/ Double_t xmin=1e4; Double_t xmax=10e6; Double_t ymin=0; Double_t ymax=15*1e-5; c1->SetLogx(); pulse1->SetTitle(""); pulse1->GetXaxis()->SetRangeUser(xmin,xmax); pulse1->GetYaxis()->SetRangeUser(ymin,ymax); pulse1->GetXaxis()->SetTitleSize(0.05); pulse1->GetYaxis()->SetTitleSize(0.05); pulse1->GetYaxis()->SetTitleOffset(1.5); pulse1->GetYaxis()->SetTitle("Radiometer (nW s/cm2)"); pulse1->GetXaxis()->SetTitle("frequency (Hz)"); pulse1->GetXaxis()->SetNdivisions(5); pulse1->SetMarkerColor(2); pulse1->SetMarkerStyle(20); pulse1->SetMarkerSize(1.2); pulse1->Draw("AP"); leg2->Draw(); Double_t fitmin=xmin; Double_t fitmax=xmax; // pulse1->Fit("pol1","","",fitmin,fitmax); pulse2->SetMarkerColor(4); pulse2->SetMarkerStyle(20); pulse2->SetMarkerSize(1.2); pulse2->Draw("SameP"); c1->SaveAs("sipm_plotRadiometer_c1.pdf"); // close input file }