{ // Setting plots range and style int temp_bin=60; int temp_min=18; int temp_max=24; int p_bin=40; int p_min=945; int p_max=980; int rh_bin=80; int rh_min=20; int rh_max=80; int histo_bin=50; int histo_min=0; int histo_max=10000; int eff_bin=10; int eff_min=0; int eff_max=100; int charge_bin=50; int charge_min=0; int charge_max=500; float label_font=0.025; float axis_offset=1.1; float time_bin=5; float label_size=0.02; int wp_min=0; int wp_max=20; int wp_bin=200; // Time binning (Unixtime) int unixtime_bin=100; // Setting a nice style palette gStyle->SetPalette(1); gStyle->SetOptStat(0); gStyle->SetMarkerSize(1); gStyle->SetMarkerStyle(20); // Text positioning Double_t x1=0.75,y1=0.37,x2=x1+0.23,y2=0.41; // Defining variable already present in the dst file Int_t Unixtime; Int_t Channel; Int_t Avalanche; Int_t Streamer; Float_t Ratio; Float_t Charge; Float_t Efficiency; Float_t temp1; Float_t temp2; Float_t rh1; Float_t rh2; Float_t p1; Float_t p2; Float_t env_t; Float_t env_rh; Float_t env_p; Int_t i,start,finish; // Opening the DSTiles FILE *fp = fopen("timeline.txt","r"); TFile *hfile = 0; hfile = TFile::Open("ggm_plot.root","RECREATE"); // Tree and Branch definitions TTree *tree = new TTree("GGM","Gas Gain Monitoring System - PLOTS"); GGM->Branch("Unixtime",&Unixtime,"Unixtime/I"); GGM->Branch("Channel",&Channel,"Channel/I"); GGM->Branch("Avalanche",&Avalanche,"Avalanche/I"); GGM->Branch("Streamer",&Streamer,"Streamer/I"); GGM->Branch("Ratio",&Ratio,"Ratio/F"); GGM->Branch("Charge",&Charge,"Charge/F"); GGM->Branch("Efficiency",&Efficiency,"Efficiency/F"); GGM->Branch("temp1",&temp1,"temp1/F"); GGM->Branch("temp2",&temp2,"temp2/F"); GGM->Branch("rh1",&rh1,"rh1/F"); GGM->Branch("rh2",&rh2,"rh2/F"); GGM->Branch("p1",&p1,"p1/F"); GGM->Branch("p2",&p2,"p2/F"); GGM->Branch("env_t",&env_t,"env_t/F"); GGM->Branch("env_rh",&env_rh,"env_rh/F"); GGM->Branch("env_p",&env_p,"env_p/F"); // Scanning the dst file and filling the Tree while (!feof(fp)) { fscanf(fp,"%d %d %d %d %f %f %f",&Unixtime,&Channel,&Avalanche,&Streamer,&Ratio,&Charge,&Efficiency); fscanf(fp,"%f %f %f %f %f %f %f %f %f\n",&temp1,&temp2,&rh1,&rh2,&p1,&p2,&env_rh,&env_t,&env_p); p1=p1+env_p; p2=p2+env_p; GGM->Fill(); if (i == 1) { start=Unixtime; } i=i+1; finish=Unixtime; } fclose(fp); GGM->Write(); // PLOTS Chamber8_wp = new TCanvas("Chamber8_wp","GGM timeline plots CH8 wp",0,0,800,700); TH2F *frame8wp = new TH2F("frame8wp","",unixtime_bin,start,finish,wp_bin,wp_min,wp_max); frame8wp->SetTitle("Gas Gain Monitoring System CH8 wp"); frame8wp->GetXaxis()->SetTitleOffset(axis_offset); frame8wp->GetXaxis()->SetTimeDisplay(1); frame8wp->GetXaxis()->SetTimeFormat("%Y %m %d %H:%M %F 1970-01-01 00:00:00"); frame8wp->GetXaxis()->SetNdivisions(time_bin); frame8wp->GetXaxis()->SetLabelSize(label_size); frame8wp->GetXaxis()->SetTitle("time"); frame8wp->GetYaxis()->SetTitleOffset(axis_offset); frame8wp->GetYaxis()->SetLabelSize(label_size); frame8wp->GetYaxis()->SetTitle("WP Charge"); GGM->Draw("Charge:Unixtime>>hcharge_ch8(1000,1303900000,1304100000,100,0,200)","Channel==8"); GGM->Draw("Charge:Unixtime>>hcharge_ch2(1000,1303900000,1304100000,100,0,200)","Channel==2"); frame8wp->Draw(); TH2F working_point8 = (*hcharge_ch8); working_point8->Divide(hcharge_ch2); working_point8->Draw(); working_point8->SetMarkerSize(3); working_point8->SetMarkerStyle(50); }