- Timestamp:
- 07/15/04 11:23:59 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mtemp/mifae/macros/lightcurve.C
r4377 r4387 1 Bool_t debug = kFALSE;2 3 4 1 Double_t ChiSquareNDof(TH1D *h1, TH1D *h2) 5 2 { … … 61 58 { 62 59 60 gROOT->Reset(); 61 gStyle->SetTimeOffset(-3600); 62 63 // Configuration 64 const Bool_t debug = kFALSE; 65 const Double_t timebin = 480.; //[sec] 66 TString psname = "./20040422_Mrk421." + timebin + "s.ps"; 67 cout << psname << endl; 68 return; 69 63 70 //Constanst 64 const Double_t ConvDegToRad = TMath::ACos(-1)/180.; 65 66 // Time binning 67 const Double_t timebin = 500.; //[sec] 71 const Double_t kConvDegToRad = TMath::ACos(-1)/180.; 68 72 const Double_t kSec = 1e6; //[sec/microsec] 69 73 const Double_t kDay = 24.*60.*60.; //[Day/sec] … … 114 118 //alpha plot integration for gammas 115 119 Double_t sigexccmin = 0.; 116 Double_t sigexccmax = 30.;120 Double_t sigexccmax = 20.; 117 121 Double_t bkgnormmin = 40.; 118 122 Double_t bkgnormmax = 80.; … … 186 190 plist_on.AddToList(&hAlpha_on_abs); 187 191 MBinning binsAlpha_on_abs("BinningAlpha_on_abs"); 188 Int_t nbins_abs = 9;192 Int_t nbins_abs = 18; 189 193 Double_t minalpha_abs = 0.; 190 194 Double_t maxalpha_abs =90.; … … 528 532 hAlpha_on_abs_timebin->Fill(TMath::Abs(alpha)); 529 533 hSrcPos_on_timebin->Fill(srcposx,srcposy); 530 hCosZenith_on_timebin->Fill(TMath::Cos(zenith* ConvDegToRad));534 hCosZenith_on_timebin->Fill(TMath::Cos(zenith*kConvDegToRad)); 531 535 532 536 if (zenith != 0 && zenith < zenithMinimumOn[numberTimeBins-1]) … … 618 622 619 623 for (UInt_t bin=0; bin<numberTimeBins; bin++) 620 cout << bin << " timeOn " << timeOn[bin] << " min-max zenithOn " << zenithMinimumOn[bin] << "-" << zenithMaximumOn[bin] << " min-max cos(zenithOn) " << TMath::Cos(zenithMinimumOn[bin]* ConvDegToRad) << "-" << TMath::Cos(zenithMaximumOn[bin]*ConvDegToRad) << " numberOnEvents " << numberOnEvents[bin] << endl;624 cout << bin << " timeOn " << timeOn[bin] << " min-max zenithOn " << zenithMinimumOn[bin] << "-" << zenithMaximumOn[bin] << " min-max cos(zenithOn) " << TMath::Cos(zenithMinimumOn[bin]*kConvDegToRad) << "-" << TMath::Cos(zenithMaximumOn[bin]*kConvDegToRad) << " numberOnEvents " << numberOnEvents[bin] << endl; 621 625 622 626 … … 881 885 // } 882 886 887 888 TArrayD meanTimeBinOnInSec(numberTimeBins); 889 TArrayD widthTimeBinOnInSec(numberTimeBins); 890 883 891 for (UInt_t bin=0; bin<numberTimeBins; bin++) 884 892 { 893 894 meanTimeBinOnInSec[bin] = (meanTimeBinOn[bin]-(Int_t)meanTimeBinOn[bin]); 895 if (meanTimeBinOnInSec[bin] > 0.5) 896 meanTimeBinOnInSec[bin] = meanTimeBinOnInSec[bin] - 1 ; 897 meanTimeBinOnInSec[bin] *= kDay; 898 899 widthTimeBinOnInSec[bin] = widthTimeBinOn[bin]*kDay; 900 885 901 numberOffEvents[bin] = (Double_t) ((TH1F*)alphaHistoOff[bin])->Integral((Int_t)sigexccmin*nbins_abs/90+1,(Int_t)sigexccmax*nbins_abs/90+1); 886 902 numberBkgEventsToNormOff[bin] = (Double_t) ((TH1F*)alphaHistoOff[bin])->Integral((Int_t)bkgnormmin*nbins_abs/90+1,(Int_t)bkgnormmax*nbins_abs/90+1); … … 911 927 912 928 913 TString psname = "./prueba.ps"; 929 914 930 TString openpsname = psname + "("; 915 931 TString closepsname = psname + ")"; … … 917 933 TCanvas *c1 = new TCanvas; 918 934 c1->cd(1); 919 TGraphErrors* lightcurvegraph = new TGraphErrors(numberTimeBins,meanTimeBinOn .GetArray(),numberExcessEventsPerMin.GetArray(),widthTimeBinOn.GetArray(),errorNumberExcessEventsPerMin.GetArray());935 TGraphErrors* lightcurvegraph = new TGraphErrors(numberTimeBins,meanTimeBinOnInSec.GetArray(),numberExcessEventsPerMin.GetArray(),widthTimeBinOnInSec.GetArray(),errorNumberExcessEventsPerMin.GetArray()); 920 936 lightcurvegraph->SetTitle("LightCurve"); 921 937 lightcurvegraph->SetMinimum(0.); … … 923 939 lightcurvegraph->SetMarkerSize(0.03); 924 940 lightcurvegraph->Draw("AP"); 941 lightcurvegraph->GetXaxis()->SetTimeDisplay(1); 925 942 c1->Print(openpsname); 926 943
Note:
See TracChangeset
for help on using the changeset viewer.