Exemple #1
0
seg13()
{   
   const int n = 18;

   float x[n];
   float ex[n];
   float ey[n] = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,38,97,76,197};
   float y[n]  = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,158,442,508,633};
   float z[n]  = {0,0,0,0,0,0,0,0,0,0,0,0,0,0,44,124,101,183};
   

   for(int i=0; i<18; i++){
     x[i] =(i+1)*5; //the angle
     ex[i]=0;
     
  }
  
   
   TGraph *gr = new TGraph(n,x,z);
   TGraphErrors *gre = new TGraphErrors(n,x,y,ex,ey);
  
   TMultiGraph *mg = new TMultiGraph();
   mg->Add(gr,"lp");
   mg->Add(gre,"cp");

//   mg->GetXaxis()->SetTitle("angle");
//   mg->GetYaxis()->SetTitle("#envents/Sigma"); 

   mg->Draw("a");
}
void Master_test( ){//main programme
    TChain* t = new TChain("rd51tbgeo");
    t->Add("../CRC-Run0308_Muon_10k_MSPL4_HVScan_710pt7_710pt1_710pt0_T20_T20_T20_Lat21-141010_224141-0.root");
    
    ClassReadTree CRC(t);

    TCanvas * c1 = new TCanvas("c1","",1);
    TGraphErrors *gr1 = new TGraphErrors(t->GetEntries());
    TGraphErrors *gr2 = new TGraphErrors(t->GetEntries());
    TGraphErrors *gr3 = new TGraphErrors(t->GetEntries());

    //for( int iEv = 0 ; iEv < t->GetEntries() ; iEv++){//
    for( int iEv = 0 ; iEv < 8 ; iEv++){//	Event Loop Starts
	t->GetEntry(iEv);

	//cout<<"===>  "<<CRC.g1xcl_geoposX[0]<<endl;
	//cout<<"===>  "<<CRC.g2xcl_geoposX[0]<<endl;
	//cout<<"===>  "<<CRC.g3xcl_geoposX[0]<<endl;
	if (CRC.g1xcl_geoposX[0]>0)
	    gr1->SetPoint(iEv*3, 100, CRC.g1xcl_geoposX[0]);
//	else
//	    gr1->SetPoint(iEv*3, 100, -10);
	if (CRC.g2xcl_geoposX[0]>0)
	    gr1->SetPoint(iEv*3+1, 380, CRC.g2xcl_geoposX[0]);
//	else
//	    gr1->SetPoint(iEv*3+1, 380, -10);
	if (CRC.g3xcl_geoposX[0]>0)
	    gr1->SetPoint(iEv*3+2, 830, CRC.g3xcl_geoposX[0]);
//	else
//	    gr1->SetPoint(iEv*3+2, 830, -10);

	
    }// End Event Loop
    gr1->SetMarkerColor(kBlue);
    gr1->SetMarkerStyle(21);
    gr2->SetMarkerColor(kRed);
    gr2->SetMarkerStyle(21);
    gr3->SetMarkerColor(kGreen);
    gr3->SetMarkerStyle(21);
    gr1->GetXaxis()->SetRangeUser(50., 900.);
    gr2->GetXaxis()->SetRangeUser(50., 900.);
    gr3->GetXaxis()->SetRangeUser(50., 900.);
    gr1->Draw("AP");
    //gr3->Draw("AP");
    //gr2->Draw("samesP*");
    //gr3->Draw("samesP*");
    TMultiGraph *mg = new TMultiGraph();
    mg->Add(gr1);
    mg->Add(gr2);
    mg->Add(gr3);
    //mg->Draw("APL");
    c1->SaveAs("Hit_Distribution.pdf");
}
void Pulse_shape_int_graph(){		// name of file

using namespace std;

double bias=0;
int i=0;

TCanvas *c1 = new TCanvas("c1","c1", 600, 400);
TPad *pad1 = new TPad("pad1","",0,0,1,1);

TGraph *gr1[5];			// defines array to number of TGraphs

TMultiGraph *mg = new TMultiGraph();		// create multigraph

for (double bias=2;bias<=10;bias+=2){		// loop to create of graph for select bias values

	TString str1 =TString::Format("%.1f V",bias);		// creates string with bias value
	TString str2 =TString::Format("/afs/cern.ch/user/m/mbucklan/TCAD_Analysis/SimpleCMOS_2d/1pixel/Test_CC_Simple_Pixel_bias=%.0f.txt",bias);		// does some magic, creates string with name of file
	
	gr1[i] = new TGraph(str2,"%lE %lE");		// creates graph called gr and reads file
		
	gr1[i]->SetTitle(str1);			// sets title to string
	gr1[i]->SetLineColor(i+1);		// sets line colour, changes for each graph
	//gr1[i]->SetLineWidth(1);
	//gr1[i]->SetMarkerSize(0.9);
	//gr1[i]->SetMarkerStyle(21);
		
	mg->Add(gr1[i]);				// adds graph to multigraph
	i+=1;
	
}

pad1->Draw();
pad1->cd();
pad1->SetTickx(1);		//draws ticks on top side x axis
pad1->SetTicky(1);		//draws ticks on right hand side y axis

gPad->Update();

mg->Draw("AC");		// draws graph

// Make the graph look fancy...ish
mg->GetXaxis()->SetTitle("Time (s)");
mg->GetYaxis()->SetTitle("Collected Charge (C)");
mg->GetHistogram()->SetTitle("Colled Charge for 1 Pixel 100#mum Thick Sensor, Resistivity=100#Omegacm");

//mg->GetXaxis()->SetLimits(1.0e-8,11.5e-8);

TLegend *leg = new TLegend(.80,.70,.85,.87);
leg->AddEntry(gr1[0],"2V","l");
leg->AddEntry(gr1[1],"4V","l");
leg->AddEntry(gr1[2],"6V","l");
leg->AddEntry(gr1[3],"8V","l");
leg->AddEntry(gr1[4],"10V","l");

leg->SetTextSize(0.03);
leg->Draw();


}
Exemple #4
0
void plotEffCurveMulti(const char* canvas,
		       int ngraph, int npts, const double* signalEff, 
		       const char classifiers[][200],
		       const double* bgrndEff, const double* bgrndErr,
		       double ymax, bool setMax=false)
{
  TCanvas *c
    = new TCanvas(canvas,"SPR BgrndEff vs SignalEff",200,10,600,400);
  TMultiGraph *mg = new TMultiGraph();
  if( setMax ) mg->SetMaximum(ymax);
  TLegend *leg = new TLegend(0.1,0.85,0.5,1.,
			     "SPR BackgroundEff vs SignalEff","NDC");
  for( int i=0;i<ngraph;i++ ) {
    TGraph *gr = new TGraphErrors(npts,signalEff,
				  bgrndEff+(i*npts),0,bgrndErr+(i*npts));
    gr->SetMarkerStyle(21);
    gr->SetLineColor(i+1);
    gr->SetLineWidth(3);
    gr->SetMarkerColor(i+1);
    mg->Add(gr);
    leg->AddEntry(gr,classifiers[i],"P");
  }
  mg->Draw("ALP");
  leg->Draw();
}
Exemple #5
0
TMultiGraph *time_series( TGraph *g[], TString legend[], TString ptitle, TString ytitle, Int_t nsensor ) {
  TMultiGraph *mg = new TMultiGraph( "mg", "mg" );
  TLegend *leg = new TLegend(0.8680651,0.7870257,0.9982345,0.9987,NULL,"brNDC");
  
  Int_t icolor = 1;
  
  for ( Int_t i = 0; i < nsensor; i++ ) {
    g[i]->SetMarkerColor( icolor );
    g[i]->SetLineColor( icolor++ );
    leg->AddEntry( g[i], legend[i], "L" );
    mg->Add( g[i], "p" );
  }
  
  mg->Draw("a");
   
  // Make changes to axis after drawing, otherwise they don't exist
  mg->SetTitle( ptitle );
  mg->GetYaxis()->SetTitle( ytitle );

  mg->GetXaxis()->SetTimeDisplay(1);
  mg->GetXaxis()->SetNdivisions(-504); 
  mg->GetXaxis()->SetTitleOffset( 0.4 );
  mg->GetXaxis()->SetLabelOffset( 0.05 );
  mg->GetXaxis()->SetTimeFormat("#splitline{%m/%d/%y}{%H:%M:%S}");
  mg->GetXaxis()->SetTimeOffset(0); 
  leg->SetFillColor(0);
  leg->Draw();
  
  return mg;
}
Exemple #6
0
TCanvas* multigraph()
{
   gStyle->SetOptFit();
   TCanvas *c1 = new TCanvas("c1","multigraph",700,500);
   c1->SetGrid();

   // draw a frame to define the range
   TMultiGraph *mg = new TMultiGraph();

   // create first graph
   const Int_t n1 = 10;
   Double_t px1[] = {-0.1, 0.05, 0.25, 0.35, 0.5, 0.61,0.7,0.85,0.89,0.95};
   Double_t py1[] = {-1,2.9,5.6,7.4,9,9.6,8.7,6.3,4.5,1};
   Double_t ex1[] = {.05,.1,.07,.07,.04,.05,.06,.07,.08,.05};
   Double_t ey1[] = {.8,.7,.6,.5,.4,.4,.5,.6,.7,.8};
   TGraphErrors *gr1 = new TGraphErrors(n1,px1,py1,ex1,ey1);
   gr1->SetMarkerColor(kBlue);
   gr1->SetMarkerStyle(21);
   gr1->Fit("pol6","q");
   mg->Add(gr1);

   // create second graph
   const Int_t n2 = 10;
   Float_t x2[]  = {-0.28, 0.005, 0.19, 0.29, 0.45, 0.56,0.65,0.80,0.90,1.01};
   Float_t y2[]  = {2.1,3.86,7,9,10,10.55,9.64,7.26,5.42,2};
   Float_t ex2[] = {.04,.12,.08,.06,.05,.04,.07,.06,.08,.04};
   Float_t ey2[] = {.6,.8,.7,.4,.3,.3,.4,.5,.6,.7};
   TGraphErrors *gr2 = new TGraphErrors(n2,x2,y2,ex2,ey2);
   gr2->SetMarkerColor(kRed);
   gr2->SetMarkerStyle(20);
   gr2->Fit("pol5","q");

   mg->Add(gr2);

   mg->Draw("ap");

   //force drawing of canvas to generate the fit TPaveStats
   c1->Update();
   TPaveStats *stats1 = (TPaveStats*)gr1->GetListOfFunctions()->FindObject("stats");
   TPaveStats *stats2 = (TPaveStats*)gr2->GetListOfFunctions()->FindObject("stats");
   stats1->SetTextColor(kBlue);
   stats2->SetTextColor(kRed);
   stats1->SetX1NDC(0.12); stats1->SetX2NDC(0.32); stats1->SetY1NDC(0.75);
   stats2->SetX1NDC(0.72); stats2->SetX2NDC(0.92); stats2->SetY1NDC(0.78);
   c1->Modified();
   return c1;
}
Exemple #7
0
TCanvas *exclusiongraph() {
   // Draw three graphs with an exclusion zone.
   //Author: Olivier Couet
   
   TCanvas *c1 = new TCanvas("c1","Exclusion graphs examples",200,10,600,400);
   c1->SetGrid();

   TMultiGraph *mg = new TMultiGraph();
   mg->SetTitle("Exclusion graphs");

   const Int_t n = 35;
   Double_t x1[n], x2[n], x3[n], y1[n], y2[n], y3[n];
   for (Int_t i=0;i<n;i++) {
     x1[i]  = i*0.1;
     x2[i]  = x1[i];
     x3[i]  = x1[i]+.5;
     y1[i] = 10*sin(x1[i]);
     y2[i] = 10*cos(x1[i]);
     y3[i] = 10*sin(x1[i])-2;
   }

   TGraph *gr1 = new TGraph(n,x1,y1);
   gr1->SetLineColor(2);
   gr1->SetLineWidth(1504);
   gr1->SetFillStyle(3005);

   TGraph *gr2 = new TGraph(n,x2,y2);
   gr2->SetLineColor(4);
   gr2->SetLineWidth(-2002);
   gr2->SetFillStyle(3004);
   gr2->SetFillColor(9);

   TGraph *gr3 = new TGraph(n,x3,y3);
   gr3->SetLineColor(5);
   gr3->SetLineWidth(-802);
   gr3->SetFillStyle(3002);
   gr3->SetFillColor(2);

   mg->Add(gr1);
   mg->Add(gr2);
   mg->Add(gr3);
   mg->Draw("AC");

   return c1;
}
void CreateSinglePlotFromTable(TString filename,TString XTitle="", TString YTitle="", bool boolLog=true){
  //  TString filename_=filename;
  ifstream infile;
  infile.open(filename.Data());
  if (!infile.is_open())
    return;

  cout << "filename " << filename << endl;

  char line[1024];
  int count=0;
  while (infile.good()){
    infile.getline(line,1024);
    //cout << line << endl;
    char * pch = strtok (line," ");
    while (pch != NULL){
      if (count){
	values.push_back(atof(pch));
      }else{
	labels.push_back(pch);
      }
      pch = strtok (NULL, " ");
    }
    count++;
  }
  TCanvas *c1 = new TCanvas();
  const size_t m = labels.size();
  int n = values.size()/labels.size();
  TGraph* gr[m];
  TMultiGraph *mg = new TMultiGraph();
  TLegend *tleg = new TLegend(0.9,1.,1.,0.80);
  double* x = (double*) malloc(m*n*sizeof(double));
  for (size_t i=0;i<n;++i) {
    for (size_t j=1;j<m;++j) {
    if (!i){
      gr[j-1]= new TGraph(n);
      gr[j-1]->SetMarkerStyle(19+j);
      gr[j-1]->SetMarkerColor(j);
      mg->Add(gr[j-1],"p");
      tleg->AddEntry(gr[j-1],labels[j],"p");
    }
    gr[j-1]->SetPoint(i,*(&values[0]+i*m),*(&values[0]+i*m+j));
    //cout << *(&values[0]+i*m)<< " " << *(&values[0]+i*m+j) << endl;
   }
  }
  if (boolLog)
    c1->SetLogy();
  mg->Draw("a");
  mg->GetXaxis()->SetTitle(XTitle);
  mg->GetYaxis()->SetTitle(YTitle);
  tleg->Draw();
  gPad->Update();
  c1->Print(filename.ReplaceAll(".dat",".gif"));
};
Exemple #9
0
void ExpManager::DrawMap(TString NameTitle, double xmin, double xmax, double ymin, double ymax, double zmin, double zmax) {

    TMultiGraph *mg = new TMultiGraph();
    
    //Draw a cross
    TGraphErrors *frame = new TGraphErrors(); //= new TGraph2DErrors(np, x_array, y_array, bz_array, ex, ey, ez);
    frame->SetPoint(0,+0,+100);
    frame->SetPoint(1,+0,-100);
    frame->SetPoint(2,0,0); 
    frame->SetPoint(3,-100,0); 
    frame->SetPoint(4,+100,0);
    frame->SetPoint(5,+0,+0); 
    frame->SetPoint(6,+0,-100);
    frame->SetMarkerColor(kWhite);
    frame->SetDrawOption("ap");
    
    //Draw the map 
    TGraphErrors *fGraph = new TGraphErrors(); //= new TGraph2DErrors(np, x_array, y_array, bz_array, ex, ey, ez);
    fGraph->SetMarkerSize(1.2);
    fGraph->SetMarkerStyle(20);
    fGraph->SetMarkerColor(kBlue);
    fGraph->SetLineColor(kBlue);
    fGraph->SetLineWidth(1);
    //fGraph->SetDrawOption("ap");
    
    int graph_counter = 0 ; 
   for (unsigned i=0; i< fExpY.size(); i++)   {
        if( (fExpX.at(i) >= xmin && fExpX.at(i) <= xmax) && (fExpY.at(i) >= ymin && fExpY.at(i) <= ymax) && (fExpZ.at(i) >= zmin && fExpZ.at(i) <= zmax) ) {
            fGraph->SetPoint(graph_counter,fExpX.at(i),fExpY.at(i));    
            fGraph->SetPointError(graph_counter,fExpXErr.at(i),fExpYErr.at(i)); 
            graph_counter++;
        } 
   }

    //fGraph->Write();
    mg->SetTitle(NameTitle+Form(" Map : %.2f < X < %.2f mm    %.2f < Y < %.2f mm    %.2f < Z < %.2f mm;X (mm);Y (mm)",xmin,xmax,ymin,ymax,zmin,zmax));
    mg->SetName(NameTitle+Form("_Map__X_%.2f_%.2fmm__Y_%.2f_%.2fmm__Z_%.2f_%.2fmm",xmin,xmax,ymin,ymax,zmin,zmax));
    mg->Add(frame); 
    mg->Add(fGraph);
    mg->Write();
}
Exemple #10
0
TMultiGraph *entry(const char *y_vs_x="help", TCut case1="", TCut case2="", TCut common="", Int_t entryNo=0
      , Int_t marker=7, Int_t color1=2, Int_t color2=4)
{
   if (strcmp(y_vs_x,"help")==0) {
      cout<< "Draws:    y vs x for tree with name \"t\" for conditions case1 and case2" <<endl;
      cout<< "Usage:    entry(y_vs_x, TCut case1, TCut case2, TCut common, Int_t entryNo, Int_t marker=7, Int_t color1=2, Int_t color2=4)" <<endl;
      cout<< "Example:  entry(\"y:x\", \"ch==1\", \"ch==2\", \"x>0&&x<20\", 9)" <<endl;
      return 0;
   }

   TTree *t = (TTree*) gDirectory->Get("t");
   if (!t) {
      cout<< "No tree \"t\" found" <<endl;
      return 0;
   }

   Long64_t nselected = 0;
   nselected = t->Draw(y_vs_x, common+case1, "", 1, entryNo);
   if (nselected == 0) {
      cout<< "--> case1 " << case1.GetTitle() << ": nselected == 0" <<endl;
      return 0;
   }
   TGraph* gr1 = gtempClone("gr1");
   gr1->SetMarkerStyle(marker);
   gr1->SetMarkerColor(color1);
   gr1->SetLineColor(color1);

   nselected = t->Draw(y_vs_x, common+case2, "", 1, entryNo);
   if (nselected == 0) {
      cout<< "--> case2 " << case2.GetTitle() << ": nselected == 0" <<endl;
      return 0;
   }
   TGraph* gr2 = gtempClone("gr2");
   gr2->SetMarkerStyle(marker);
   gr2->SetMarkerColor(color2);
   gr2->SetLineColor(color2);

   if (gROOT->GetListOfCanvases()->Last()) gPad->Clear();
   TMultiGraph* mg = new TMultiGraph();
   mg->SetTitle(Form("entry %d for %s and %s   %s",entryNo,case1.GetTitle(),case2.GetTitle(),common.GetTitle()));
   mg->Add(gr1,"pl");
   mg->Add(gr2,"pl");
   mg->Draw("aw");

   gPad->Modified();
   gPad->Update();

   return mg;
}
Exemple #11
0
//g++ allDataPrint.cpp `root-config --cflags --glibs`
int main(int argc, char** argv)
#endif
{
  int colore = 2;
  TMultiGraph *mg = new TMultiGraph("potenziale","Potenziali");
  cout<<"Carico i dati\n";
  ifstream filenames("infonamelist.txt");
  string filename = "settings.set";
  if(argc>1)
    filename  = argv[1];
  //carico il file di impostazioni, per ricompilare meno spesso
  while(!filenames.eof()){
    string fname;
    filenames >> fname;//fname non deve contenere spazi e ".txt"
    if(fname.find(".set")==string::npos)
      fname+=".set";
    if(fname!=".set"){
      impostazioni info("gauss.set", fname.c_str(),filename.c_str());
      cout << fname << ":" << endl;
      int ns = info.NL(), skip = info.spaceSkip();
      double step = info.spaceStep();
      TGraph *gV = new TGraph();
      int j=0;
      for(int i=0;i<ns;i+=skip){
	double x =  i*step;
	gV->SetPoint(j++,x,info.potenziale(i));
      }

      gV->SetTitle(("Potenziale per " +fname).c_str());    
      gV->SetLineColor(colore++);
      mg->Add(gV);
    }
  }
  TCanvas c1("c1","Confronto Potenziali",600,450);
  // c1.Divide(2,1);
  //c1.cd(1);
  // merr->Draw("apl");
    mg->Draw("apl");
  c1.BuildLegend();
  /*
    c1.cd(2);
    merr->Draw("apl");
    c1.BuildLegend();
  */
#ifndef __CINT__
  theApp.Run(true);
  return 0;
#endif
}
void drawZShiftsOmega(){
  TCanvas* c1 = new TCanvas("c1","c1",600,600);

  TMultiGraph* mgr = new TMultiGraph();
  mgr->SetTitle("Omega: dz_{0}");

  TGraphErrors* gr_dz0_sig = new TGraphErrors("ZShiftSigOmega.txt","%lg %*lg %lg %lg");
  gr_dz0_sig->SetMarkerStyle(21);
  gr_dz0_sig->SetMarkerColor(kBlue);
  mgr->Add(gr_dz0_sig);

  TGraphErrors* gr_dz0_asc = new TGraphErrors("ZShiftAscOmega.txt","%lg %*lg %lg %lg");
  gr_dz0_asc->SetMarkerStyle(21);
  gr_dz0_asc->SetMarkerColor(kRed);
  mgr->Add(gr_dz0_asc);

  mgr->Draw("ASP");

  c1->Update();
  c1->Print("c1.png");
  c1->Print("c1.root");

  return;
}
Exemple #13
0
//g++ allDataPrint.cpp `root-config --cflags --glibs`
int main(int argc, char** argv)
#endif
{
  TCanvas c3("c3","Grafico",640,512);
  TCanvas c1("c1","Confronto",1280,512);
  c1.Divide(2,1);
  
  preparedraw myData (argv[1],
		      // preparedraw::doMax |
		      preparedraw::doFh |
		      preparedraw::doSh |
		      preparedraw::doErr);
  
  TGraph2D *g = myData.data();
  TGraph *gb = myData.firsthalf();//before
  TGraph *ga = myData.secondhalf();//after
  TGraph *gerrs = myData.errs();
  //  TGraph *maxs = myData.maximum();
  
  c3.cd();
  g->GetXaxis()->SetTitle("X");
  g->GetYaxis()->SetTitle("T");
  //g->Draw("cont1");
  g->Draw("pcol");
  //g->Draw();
  //grafo.Draw("surf1");

  cout<<"Disegno i grafici\n";
  TMultiGraph *mg = new TMultiGraph("integrali","Integrali prima e dopo la barriera");
  
  ga->SetLineColor(2);
  mg->Add(gb);
  mg->Add(ga);
  c1.cd(1);
  mg->Draw("apl");
    

  gerrs->SetTitle("Andamento degli errori");
  c1.cd(2);
  gerrs->Draw("apl");
#ifndef __CINT__
  theApp.Run(true);
  return 0;
#endif
}
// make graphs for the project
void graph_project(plot_args args, bool adjust_time) {

  // declare canvas, graphs, multigraph, legend
  TCanvas *c1 = new TCanvas("c1", "Thermal Profile", 200, 10, 700, 500);
  TGraph *graphs[args.num_channels];
  TMultiGraph *mg = new TMultiGraph();
  string mg_title = args.title + ";" + "Time elapsed (min); Temperature (C)";
  mg->SetTitle(mg_title.c_str());

  // make legend
  TLegend *leg = make_legend();

  // make graphs and add to multigraph
  string directory = "./THERM_TESTS/" + args.projects[0] + "/" + args.projects[0] + "_ch";
  for(int i=0; i<args.num_channels; i++) {

    // file to open: time_adjusted or raw
    string file;
    if (args.time_shifts[0]==0 && args.time_cut==0) {
      file = directory + to_string(i) + ".txt";
      cout << file << endl;
    }
    else {
      file = "./THERM_TESTS/TEMP/temp_ch" + to_string(i) + ".txt";
    }
    // make graph from the obtained file
    graphs[i] = new TGraph(file.c_str());
    graphs[i]->SetLineWidth(2);
    graphs[i]->SetMarkerColorAlpha(i+1, 0);
    graphs[i]->SetLineColor(i+1);
    graphs[i]->SetFillColor(0);

    //add to multigraph and legend
    mg->Add(graphs[i]);
    leg->AddEntry(graphs[i], (args.leg_labels[i]).c_str()); 
  }

  // draw multigraph and legend; return.
  mg->Draw("ACP");
  leg->Draw();
  return;
}
Exemple #15
0
void plotter(Int_t octant=1){

gROOT->Reset();
gROOT->SetStyle("Plain");

TString runNums[5] = {"14296","15736","16654","17635","18875"};

TCanvas *c1 = new TCanvas();

TGraphErrors *gPos = new TGraphErrors(Form("md%dpos.dat",octant),"%lg %lg %lg");
TGraphErrors *gNeg = new TGraphErrors(Form("md%dneg.dat",octant),"%lg %lg %lg");

gPos->SetMarkerColor(kBlue);
gNeg->SetMarkerColor(kRed);
gPos->SetLineColor(kBlue);
gNeg->SetLineColor(kRed);
gPos->SetFillStyle(0);
gNeg->SetFillStyle(0);
gPos->SetTitle(Form("MD%dPOS",octant));
gNeg->SetTitle(Form("MD%dNEG",octant));

TMultiGraph *gm = new TMultiGraph("gm",Form("1/Yield for MD%d",octant));
gm->Add(gPos);
gm->Add(gNeg);

gm->Draw("ap");

gm->GetYaxis()->SetTitle("1/Yield (uA/V)");
gm->GetXaxis()->SetTitle("Run Number");

gm->GetXaxis()->SetNdivisions(505,kTRUE);

for(Int_t i=0; i<5; i++){
	gm->GetXaxis()->SetBinLabel(gm->GetXaxis()->FindBin(150000+i*10000),runNums[i].Data());

}
gm->GetXaxis()->SetTitleOffset(1.4);

c1->BuildLegend();


}
void rateStudy() {
  const int NRUNS = 25;
  const int NCH = 32;
  const int NBINS = 32;

  TCanvas* c1 = new TCanvas("c1", "c1", 800, 600);

  TMultiGraph *mg = new TMultiGraph();

  TLegend *legend=new TLegend(0.65,0.15,0.88,0.55);
  legend->SetNColumns(4);
  legend->SetFillColor(0);

  TH1F* hRate = new TH1F("hRate", "hist", 32.0, 0, 8.0);

  //Color buffer
  const int NCOLORS = 32;
  int color[NCOLORS] = {73, 2, 3, 4, 99, 6, 7, 8, 9, 12, 28, 32, 34,
                        28, 50, 51, 56, 58, 88, 99, 1, 208, 209,
                        218, 212, 210, 221, 224, 225, 226, 227, 228 };

  ifstream fin;
  //fin.open("runlist.txt");
  fin.open("filter_runlist.txt");

  string line = "";

  TFile* out = new TFile("outtemp.root", "REACREATE");
  TH1F* h = new TH1F("h","hist", NBINS, 0, NBINS);
  TF1* pois = new TF1("pois","[0]*TMath::Poisson(x,[1])",0,50);
  TF1* ppp = new TF1("ppp","[0]*TMath::Power(0.5,x*[1])",0.01,1.0);


  for (int ch = 0; ch < NCH; ++ch) {

    //if ( ch==26 || ch==27 )
    //continue;

    //Graph points and errors
    Double_t x[NRUNS];
    Double_t y[NRUNS];
    Double_t errX[NRUNS] = {0};
    Double_t errY[NRUNS] = {0};

    int fileCounter = 0;
    while(getline(fin, line)) {
      vector<double> data = parse(line);
      stringstream filePath;
      filePath << "pmtratestudy/run" << data[0] << "*.root";
      cout << "opening file at " << filePath.str() << endl;
      cout << "file counter: " << fileCounter << " channel=" << ch << endl;
      //TFile* f = new TFile(filePath.str().c_str());
      //TTree* t = (TTree *)f->Get("eventtree");
      TChain* t = new TChain("eventtree");
      t->Add( filePath.str().c_str() );
      out->cd();

      x[fileCounter] = data[1];

      int nfires[NCH] = {0};
      int samples = 0;
      float chmax = 0.0;
      t->SetBranchAddress("nfires", &nfires);
      t->SetBranchAddress("samples", &samples);
      t->SetBranchAddress("chmax", &chmax);
      
      h->Reset();
      
      int nentries = t->GetEntries();
      for (int entry = 0; entry < nentries; ++entry) {
        t->GetEntry(entry);
        if (chmax < 100.0) {
          h->Fill(nfires[ch]);
        }
      }


      
      pois->SetParameter(0,1);
      pois->SetParameter(1, h->GetMean());

      h->Fit(pois,"RQ","",0,50);
      //TF1 *myfit = (TF1 *)h->GetFunction("pois");
      TF1 *myfit = (TF1 *)pois;
      Double_t lambda = myfit->GetParameter(1);  
      h->Draw();
      stringstream histFileName;
      histFileName << "hist/h" << data[0] << "_ch" << ch << ".png";
      c1->SaveAs(histFileName.str().c_str());
      //Graph with poisson method
#if 1
      y[fileCounter] = lambda / ((samples - 1) * 15.625E-6);
      errY[fileCounter] = myfit->GetParError(1) / ((samples - 1) * 15.625E-6);
#endif
      //Graph with mean method
#if 0
      y[fileCounter] = h->GetMean() / ((samples - 1) * 15.625E-6);
      errY[fileCounter] = h->GetMeanError() / ((samples - 1) * 15.625E-6);
#endif
      cout << x[fileCounter] << ", " << y[fileCounter] 
           << " | " << (samples - 1) << endl;
      delete t;
      //f->Close();
      fileCounter++;
    } 

    ppp->SetParameter(0,1);
    ppp->SetParameter(1,0.4);
     
    TGraphErrors* gr = new TGraphErrors(NRUNS, x, y, errX, errY);
    gr->SetLineColor(color[ch % NCOLORS]);
    cout << "color: " << color[ch % NCOLORS] << endl;
    gr->SetLineWidth(2);
    gr->SetMarkerStyle(7);
    gr->Fit("ppp","R0","Q0",0.045,2.0);
    TF1 *afit = (TF1 *)gr->GetFunction("ppp");
    Double_t aRate = 1/afit->GetParameter(1);  
    if (aRate > 0) {
      hRate->Fill(aRate);
    }
    gr->GetXaxis()->SetTitle("Run Date");
    gr->GetYaxis()->SetTitle("Rate [kHz]");

    stringstream entryName, fileName;
    entryName << "Channel" << ch;
    gr->SetTitle(entryName.str().c_str());
    fileName << "plots/" << ch << ".png";
    legend->AddEntry(gr, entryName.str().c_str());
    gr->Draw("alp");
    c1->SaveAs(fileName.str().c_str());
    mg->Add(gr);
    cout << "added plot to mg\n";
    fin.clear();
    fin.seekg(0, ios::beg);
  } // loop over channel
  hRate->Draw();
  hRate->Fit("gaus");
  c1->SaveAs("hrate.pdf");
  mg->Draw("alp");
  mg->GetXaxis()->SetTitle("Days since first run");
  mg->GetYaxis()->SetTitle("Rate [kHz]");
  mg->SetTitle("All channels: Rate vs. Days since first Run");

  legend->Draw();
  c1->SaveAs("mg.pdf");
  
}
void draw_cross(){


  Double_t Ecounter[20],yeild[20],flux[20],cross[20];
   Double_t  yerr1[20],yerr2[20],yerr3[20]; 
  // static Int_t n=3;
/*
  Double_t fit(Double_t *x,Double_t *par){
    return par[0]+par[1]*x[0];
  }

  TF1 *fitf = new TF1("fitf",fit,-10,25,2);
*/
   
 	y1[0]= 16.86/2.359;
	y1[1]= 22.16/4.063;
	y1[2]= 27.37/6.23;
	y1[3]= 32.83/8.854;
	y1[4]= 3.797/1.194;
	y1[5]= 5.886/2.89;
	y1[6]= 7.973/5.32;


E[0]= 0.8; 
	y2[0]= 0.7432/2.359*2;
E[1]= 1.05; 
	y2[1]= 0.9432/4.063*2;
E[2]= 1.25;
	y2[2]= 1.17/6.23*2;
E[3]= 1.55;	
	y2[3]= 1.39/8.854*2.0;
E[4]= 1.8;
	y2[4]= 0.16/1.194*2;
E[5]= 2.8;
	y2[5]= 0.2506/2.89*2;
E[6]= 3.8;
	y2[6]= 0.339/5.32*2;



/*
x[0]= 35;
	y1[0]= 0.3178;
	y1[1]= (207.0*100.0/26083.0)*0.8726;
	y1[2]= (445.0*100.0/26083.0)*0.8726;
	y1[3]= (638.0*100.0/26083.0)*0.8726;
	y1[4]= (1444.0*100.0/26083.0)*0.8726;
	y1[5]= (3139.0*100.0/26083.0)*0.8726;
x[1]= 45;
	y2[0]= 0.1356;
	y2[1]= (36.0*100.0/14580.0)*0.8726;
	y2[2]= (81.0*100.0/14580.0)*0.8726;
	y2[3]= (107.0*100.0/14580.0)*0.8726;
	y2[4]= (269.0*100.0/14580.0)*0.8726;
	y2[5]= (666.0*100.0/14580.0)*0.8726;
x[2]= 55;
	y3[0]= 0.0595;
	y3[1]= (13.0*100.0/9960.0)*0.8726;
	y3[2]= (31.0*100.0/9960.0)*0.8726;
	y3[3]= (37.0*100.0/9960.0)*0.8726;
	y3[4]= (74.0*100.0/9960.0)*0.8726;
	y3[5]= (190.0*100.0/9960.0)*0.8726;
x[3]= 60;
x[4]= 75;
x[5]= 95;



*/

/*
     yerr1[0] = 0.0085;
     yerr1[1] = 0.0092;
     yerr1[2] = 0.0099;
     yerr1[3] = 0.0080;
     yerr1[4] = 0.0124;
     yerr1[5] = 0.0127;
   
yerr2[0] = 0.097;
yerr2[1] = 0.071;
yerr2[2] = 0.0617;
yerr2[3] = 0.0313;
yerr2[4] = 0.0292;
yerr2[5] = 0.0264;
	yerr3[0] = 0.0174;
	yerr3[1] = 0.0362;
	yerr3[2] = 0.0559;
	yerr3[3] = 0.0611;
	yerr3[4] = 0.0864;
	yerr3[5] = 0.1384;

*/


   TMultiGraph *mg = new TMultiGraph("mg","Q2 resolution");
   TGraphErrors *g1 = new TGraphErrors(7,x,y1,0,0);
   TGraphErrors *g2 = new TGraphErrors(7,x,y2,0,0);	
//   TGraphErrors *g3 = new TGraphErrors(6,x,y3,0,yerr3);

  TCanvas *c11 = new TCanvas("c11","counts vs T",600,600);

//  g1->Draw("A*");
g1->SetName("g1");
g1->SetTitle("");  
g1->SetMarkerStyle(21);
g1->SetMarkerColor(1);
g1->SetMarkerSize(1.0);
g1->SetDrawOption("AP");
g1->SetLineColor(1);
g1->SetLineWidth(0);
g1->SetFillStyle(0);
g1->GetYaxis()->SetTitle("Q2 resolution (%)");
g1->GetXaxis()->SetTitle("Angle bin (deg)");


g2->SetName("g2");
g2->SetTitle("");
g2->SetMarkerStyle(22); 
g2->SetMarkerSize(1.5);
g2->SetMarkerColor(4);
g2->SetDrawOption("P");
g2->SetLineColor(2);
g2->SetLineWidth(0);
g2->SetFillStyle(0);



/*
g3->SetName("g3");
g3->SetMarkerStyle(22);
g3->SetMarkerSize(0.8);
g3->SetMarkerColor(4);
g3->SetDrawOption("P");
g3->SetLineColor(7);
g3->SetLineWidth(2);
g3->SetFillStyle(0);

*/

//mg->Add(g3);
mg->Add(g1);
mg->Add(g2);

//g1->Draw("ALP");
mg->Draw("AP");
mg->GetXaxis()->SetTitle(" Angle bin (deg)");
mg->GetYaxis()->SetTitle(" Q2 resolution (%)");
gPad->Modified();


//mg->GetYaxis()->SetLimits(0,1);




leg = new TLegend(0.1,0.7,0.48,0.9);
leg->AddEntry("g1","Hycal Q2 resolution ");
leg->AddEntry("g2","Gem Q2 resolution");
//leg->AddEntry("g3","1.30-1.55deg angle bin");
leg->Draw();






  //g1->GetXaxis()->SetRange(0,1400);
/*
  g1->Fit("fitf","","",0,0);
  Double_t parameter[2];

  fitf->GetParameters(parameter);
  cout<<"y[500]="<<parameter[0] + parameter[1] * 500<<endl;

*/



 }
Exemple #18
0
void pointsed(TString filename = "btagpatanalyzerpy.root", TString check="") {
	TString cmssw;
	// 167
	
	cmssw = "$3.1.0_pre9$";
	
	TFile *f = TFile::Open(filename);
/////////////////////////////////////////////////////////////////////////////////////////
	std::vector< TString > checks;
	checks.push_back("");
	checks.push_back("Corr30_");
	checks.push_back("Corr30t0_");
	checks.push_back("Corr30t1_");
	checks.push_back("Corr30t2_");
	checks.push_back("Corr30t0_nConstituent_");
	checks.push_back("Corr30t1_nConstituent_");
	checks.push_back("Corr30t2_nConstituent_");
	checks.push_back("Uncor10_");
	checks.push_back("Uncor10t0_");
	checks.push_back("Uncor10t1_");
	checks.push_back("Uncor10t2_");
	checks.push_back("Uncor10t0_nConstituent_");
	checks.push_back("Uncor10t1_nConstituent_");
	checks.push_back("Uncor10t2_nConstituent_");
/////////////////////////////////////////////////////////////////////////////////////////
	std::vector< TString > taggers;
	std::vector< TString > labeltag;
        std::vector< int> colorlines;
	taggers.push_back( "TC2" );colorlines.push_back( 1 );labeltag.push_back( "TCHE");
	taggers.push_back( "TC3" );colorlines.push_back( 2 );labeltag.push_back( "TCHP");
	taggers.push_back( "TP"  );colorlines.push_back( 3 );labeltag.push_back( "JP");
	taggers.push_back( "SSV" );colorlines.push_back( 4 );labeltag.push_back( "SSV");
	taggers.push_back( "CSV" );colorlines.push_back( 5 );labeltag.push_back( "CSV");
	taggers.push_back( "MSV" );colorlines.push_back( 6 );labeltag.push_back( "CSVMVAB");
	taggers.push_back( "SMT" );colorlines.push_back( 8 );labeltag.push_back( "SMT");
	taggers.push_back( "BTP" );colorlines.push_back( 9 );labeltag.push_back( "JBP");
	taggers.push_back( "SMTbyIP3d" );colorlines.push_back( 11 );labeltag.push_back( "SMTByIP3d");
	taggers.push_back( "SMTbyPt" );colorlines.push_back( 12 );labeltag.push_back( "SMTByPt");
	taggers.push_back( "SETbyIP3d" );colorlines.push_back( 13 );labeltag.push_back( "SETByIP3d");
	taggers.push_back( "SETbyPt" );colorlines.push_back( 14 );labeltag.push_back( "SETByPt");
//	taggers.push_back( "IPM" );colorlines.push_back( 11 );labeltag.push_back( "IPMVAB");
//	taggers.push_back( "SMNIPT" );colorlines.push_back( 12 );labeltag.push_back( "SMTNoIP");

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////	
//ed	for ( size_t ichks = 0; ichks < checks.size(); ++ichks ) {
//ed		TString check = checks[ichks];
	
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////	
        TString PerfTitle= check;
        if (check == "") PerfTitle="uncorr pt>30";
	if (check == "Corr30_") PerfTitle="pt>30";
	if (check == "Corr30t0_") PerfTitle="pt>30, #tracks > 0";
	if (check == "Corr30t1_") PerfTitle="pt>30, #tracks > 1";
	if (check == "Corr30t2_") PerfTitle="pt>30, #tracks > 2";
	if (check == "Corr30t0_nConstituent_") PerfTitle="pt>30, #tracks > 0 & nConstituents >1";
	if (check == "Corr30t1_nConstituent_") PerfTitle="pt>30, #tracks > 1 & nConstituents >1";
	if (check == "Corr30t2_nConstituent_") PerfTitle="pt>30, #tracks > 2 & nConstituents >1";
	if (check == "Uncor10_") PerfTitle="uncorr pt>10";
	if (check == "Uncor10t0_") PerfTitle="uncorr pt>10 #tracks > 0";
	if (check == "Uncor10t1_") PerfTitle="uncorr pt>10 #tracks > 1";
	if (check == "Uncor10t2_") PerfTitle="uncorr pt>10 #tracks > 2";
	if (check == "Uncor10t0_nConstituent_") PerfTitle="uncorr pt>10 #tracks > 0 & nConstituents >1";
	if (check == "Uncor10t1_nConstituent_") PerfTitle="uncorr pt>10 #tracks > 1 & nConstituents >1";
	if (check == "Uncor10t2_nConstituent_") PerfTitle="uncorr pt>10 #tracks > 2 & nConstituents >1";

	std::vector< TString > discriminators;
        for ( size_t itagger = 0; itagger < taggers.size(); ++itagger ) {
  		discriminators.push_back( check+"disc"+taggers[itagger]+"_udsg" );
	}
//	discriminators.push_back( "discTC3_udsg" );
//	discriminators.push_back( "discTP_udsg" );

	TCanvas *cv = new TCanvas("cv","cv",900,900);
	TMultiGraph *mg =new TMultiGraph();
	TLegend *legend0 = new TLegend(0.68,0.12,0.88,0.32);
        // inverted axis
	TMultiGraph *mginv =new TMultiGraph();
	TLegend *legend1 = new TLegend(0.65,0.18,0.85,0.48);
	std::ofstream salida("BTagPATop3"+check+".txt");
	
	for ( size_t itagger = 0; itagger < taggers.size(); ++itagger ) {

		TString tag    = check+"g"+taggers[itagger]+"_udsg";
		TGraphErrors *agraph = (TGraphErrors*) gDirectory->Get("BTagPATAnalyzer"+taggers[itagger]+"/"+taggers[itagger]+"/"+tag);

		
		TGraph *dgraph = (TGraph*) gDirectory->Get("BTagPATAnalyzer"+taggers[itagger]+"/"+taggers[itagger]+"/"+discriminators[itagger]);
//		TGraph *udsgvsdgraph = new TGraph(dgraph->GetN(),dgraph->GetY(),dgraph->GetX());
		dgraph->Sort();
//		udsgvsdgraph->Sort();

		TGraphErrors *g = new TGraphErrors(agraph->GetN(),agraph->GetY(),agraph->GetX(),agraph->GetEY(),agraph->GetEX());
		g->Sort();
		g->SetLineColor(itagger+1);
                legend0 -> AddEntry(g,taggers[itagger],"l");
		mg->Add(g);

                //inverted axis
		TGraphErrors *ginv = new TGraphErrors(agraph->GetN(),agraph->GetX(),agraph->GetY(),agraph->GetEX(),agraph->GetEY());
		ginv->Sort();
		ginv->SetLineColor(colorlines[itagger]);
		ginv->SetMarkerStyle(8);
		ginv->SetMarkerColor(colorlines[itagger]);
                legend1 -> AddEntry(ginv,labeltag[itagger],"l");
		mginv->Add(ginv);

		std::cout << " Tagger: " << tag << std::endl;
		std::cout << " Loose(10%): " << " cut > " << std::setprecision(4) << dgraph->Eval(0.1) << " b-eff = " << g->Eval(0.1) << std::endl;
		std::cout << " Medium(1%):  " << " cut > " << std::setprecision(4) << dgraph->Eval(0.01) << " b-eff = " << g->Eval(0.01) << std::endl;
		std::cout << " Tight(0.1%) = " << " cut > " << std::setprecision(4) << dgraph->Eval(0.001) << " b-eff = " << g->Eval(0.001) << std::endl;
                salida << " " << taggers[itagger] << endl;
	        salida << " #bin \t b-eff  \t err-beff \t  non-beff \t err-non-b"<< endl;
        	for ( size_t i=0;i< agraph->GetN();i++){ 
			salida	<< "  " << (i+1) << " \t "
				<< agraph->GetX()[i] <<" \t " 
				<< agraph->GetEX()[i]<<" \t "
				<< agraph->GetY()[i] <<" \t "
				<< agraph->GetEY()[i]
                       		<< " "<< endl;
		}

	}
//	cv->SetLogx();
	mg->Draw("ALP");
	mg->GetYaxis()->SetTitle("b-eff");
	mg->GetXaxis()->SetTitle("udsg-mistagging");
	legend0 -> Draw();
        cv-> SetGrid();
	cv-> Print ("BTagPATop"+check+".eps");
	cv-> Print ("BTagPATop"+check+".png");
	cv->cd(0);
	cv->SetLogx();
	mg->Draw("ALP");
	legend0 -> Draw();
	cv-> Print ("BTagPATop1"+check+".eps");
	cv-> Print ("BTagPATop1"+check+".png");
        //inverted axis
	TCanvas *cvinv = new TCanvas("cvinv","cvinv",700,700);
        cvinv->SetLogy(0);
	mginv->Draw("ALP");
	mginv->GetXaxis()->SetTitle("b-eff");
	mginv->GetYaxis()->SetTitle("udsg-mistagging");
	legend1 -> Draw();
        cvinv->SetGrid();
	cvinv-> Print ("BTagPATop2"+check+".eps");
	cvinv-> Print ("BTagPATop2"+check+".png");
	cvinv->cd(0);
//	cvinv->Update();
//	cvinv->SetLogx();
//	mginv->SetXmin(10^-4);
//      axis range using a histogram helper
    TH2D*hpx = new TH2D("hpx",PerfTitle,200,0.0,1.005,200,0.00002,1.05);
        hpx->SetStats(kFALSE);
		hpx->Draw();
	hpx->GetXaxis()->SetTitle("b-eff");
	hpx->GetYaxis()->SetTitle("udsg-mistagging");
	cvinv->SetLogy(1);
	mginv->Draw("AP");
	legend1 -> Draw();
	cvinv-> Print ("BTagPATop3"+check+".eps");
	cvinv-> Print ("BTagPATop3"+check+".png");
	//ed}
}
Exemple #19
0
/**
The purpose of this function is to conveniently plot an event. Each event is plotted on a TCanvas. Divided into as many pads as there are panels. Each pad is a TMultiGraph with a TLegend, and shows the channels of the digitizer connected to the lines of that panel. The grouping into pads must not necessarily be according to panels, but in any other prefered way.

@param a_channels - a vector of a vector of samples, containing all 32 channels
@ param a_channelsToPadsAssociation - a map from std::string, which is the name of the panel (or group of channels) to be assigned to each pad to a vector if integers, which is the list of channels indices corresponding to indices of channels in the paramater a_channels to associate to a pad
@param sEventTitle - a string containing the title of the event (for example, the time stamp)
*/
void RangePlotter::PlotRanges(Channels_t& a_channels, Range_t& a_channelsToPadsAssociation, std::string sEventTitle)
{	
//	printf("Plotting\n");
	//m_pCanvas->Clear();
	m_pCanvas->SetTitle(sEventTitle.c_str());
	
	
	int iPadCounter = 0;
	if(0 == m_vpMultiGraph.size())
	{
		MakePads(a_channelsToPadsAssociation.size());	
		for (auto& rangeIt: a_channelsToPadsAssociation)
		{	
			TMultiGraph* pMg = new TMultiGraph();	
			m_vpMultiGraph.push_back(std::unique_ptr<TMultiGraph>(pMg));

	//		m_pCanvas->cd(iPadCounter + 1);
			ChangePad(iPadCounter);
			int i = 0;

			auto legend = new TLegend(0.8,0.8,1,1, "Channels");
			m_vpLegends.push_back(std::unique_ptr<TLegend>(legend));
			printf("printing panel %s\n", rangeIt.first.c_str());
			for (auto& chanIt: rangeIt.second)
			{
				int iNumOfSamples = a_channels[chanIt].size();
				TGraph* pGr = new TGraph(iNumOfSamples);
				std::vector<float> vTimeSeq = CommonUtils::GenerateTimeSequence(iNumOfSamples, m_fSamplingFreqGHz);
				for (int counter = 0; counter < iNumOfSamples; counter++)
				{
					pGr->SetPoint(counter, vTimeSeq[counter], TransformToVoltage(a_channels[chanIt][counter]));
				}

				m_vpGraph[chanIt] = pGr;
				pGr->SetLineColor(m_colors[i%(sizeof(m_colors)/sizeof(int))]);
				pGr->SetName((m_sInstanceName + std::string("Pan_") + rangeIt.first + std::string("chan_") + std::to_string(chanIt)).c_str());
				std::string sGraphTitle = std::string("Channel ") + std::to_string(chanIt);
				pGr->SetTitle(sGraphTitle.c_str());
				legend->AddEntry(pGr,std::to_string(chanIt).c_str(), "l");
		
				pMg->Add(pGr);
				i++;
			}

			if(Configuration::Instance().ShowTriggerInWaveformsStep())
			{
				int iNumOfSamples = a_channels[a_channels.size() - 1].size();
				m_vpGraphPrecisionTrigger = new TGraph(iNumOfSamples);
				std::vector<float> vTimeSeq = CommonUtils::GenerateTimeSequence(iNumOfSamples, m_fSamplingFreqGHz);
				for (int counter = 0; counter < iNumOfSamples; counter++)
				{
					m_vpGraphPrecisionTrigger->SetPoint(counter, vTimeSeq[counter], TransformToVoltage(a_channels[a_channels.size() - 1][counter]));
				}
				
				m_vpGraphPrecisionTrigger->SetName((m_sInstanceName + std::string("Pan_") + rangeIt.first + "_Trig").c_str());	
				m_vpGraphPrecisionTrigger->SetTitle("Trigger");
				legend->AddEntry(m_vpGraphPrecisionTrigger,"Trigger", "l");
				pMg->Add(m_vpGraphPrecisionTrigger);
			}
			
			std::string sMultiGraphTitle = std::string("Panel ") + rangeIt.first;
			pMg->SetTitle(sMultiGraphTitle.c_str());

			pMg->Draw("AL");
			pMg->GetXaxis()->SetTitle("Time [nanoseconds]");
			pMg->GetXaxis()->CenterTitle();
			pMg->GetYaxis()->SetTitle("Voltage [volts]");
			pMg->GetYaxis()->CenterTitle();

			gPad->Modified();

			pMg->SetMinimum(m_fMinVoltage);
			pMg->SetMaximum(m_fMaxVoltage);
			legend->Draw();
			iPadCounter++;
		}
		m_pCanvas->Update();
	}
	else
	{
//		printf("Plottin again\n");
		for (auto& rangeIt: a_channelsToPadsAssociation)
		{
			printf("Panel %s\n", rangeIt.first.c_str());
			m_pCanvas->cd(iPadCounter + 1);
			for (auto& chanIt: rangeIt.second)
			{
//				printf("Chanenl %d\n", chanIt);
				//TODO: num of samples is constant per run at least!
				m_vpGraph[chanIt]->SetLineWidth(1);
				int iNumOfSamples = a_channels[chanIt].size();	
				std::vector<float> vTimeSeq = CommonUtils::GenerateTimeSequence(iNumOfSamples, m_fSamplingFreqGHz);	
				for (int counter = 0; counter < iNumOfSamples; counter++)
				{
					(m_vpGraph[chanIt]->GetY())[counter] = TransformToVoltage(a_channels[chanIt][counter]);
				}

				for (int counter = 0; counter < iNumOfSamples; counter++)
				{
					(m_vpGraphPrecisionTrigger->GetY())[counter] = TransformToVoltage(a_channels[a_channels.size() - 1][counter]);
				}
	
				gPad->Modified();
			}

			m_vpMultiGraph[iPadCounter]->Draw("AC");
			m_vpLegends[iPadCounter]->Draw();
			iPadCounter++;
		}
		printf("Updating\n");
		m_pCanvas->Update();
		printf("After updating\n");
	}
	printf("done\n");
}
void Final_av_Lambda_VarCoupling_40Percent()
{
//=========Macro generated from canvas: c/c
//=========  (Sat Feb 27 17:06:04 2016) by ROOT version6.04/06
   TCanvas *c = new TCanvas("c", "c",0,0,800,700);
   c->SetHighLightColor(2);
   c->Range(-0.4813593,1.36281,3.148656,6.672724);
   c->SetFillColor(0);
   c->SetBorderMode(0);
   c->SetBorderSize(2);
   c->SetLogx();
   c->SetLogy();
   c->SetTickx(1);
   c->SetTicky(1);
   c->SetLeftMargin(0.12);
   c->SetRightMargin(0.04);
   c->SetTopMargin(0.07);
   c->SetBottomMargin(0.12);
   c->SetFrameBorderMode(0);
   c->SetFrameBorderMode(0);
   
   TMultiGraph *multigraph = new TMultiGraph();
   multigraph->SetName("");
   multigraph->SetTitle("");
   
   Double_t Graph_fx1[12] = {
   1,
   10,
   100,
   400,
   700,
   1000,
   1000,
   700,
   400,
   100,
   10,
   1};
   Double_t Graph_fy1[12] = {
   881.525,
   896.549,
   871.907,
   667.806,
   471.744,
   308.777,
   382.832,
   584.437,
   826.374,
   1079.16,
   1110.85,
   1092.23};
   TGraph *graph = new TGraph(12,Graph_fx1,Graph_fy1);
   graph->SetName("Graph");
   graph->SetTitle("");

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#ffcc00");
   graph->SetFillColor(ci);

   ci = TColor::GetColor("#ff6666");
   graph->SetLineColor(ci);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph1 = new TH1F("Graph_Graph1","",100,0.9,1099.9);
   Graph_Graph1->SetMinimum(228.5697);
   Graph_Graph1->SetMaximum(1191.057);
   Graph_Graph1->SetDirectory(0);
   Graph_Graph1->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph1->SetLineColor(ci);
   Graph_Graph1->GetXaxis()->SetLabelFont(42);
   Graph_Graph1->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph1->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph1->GetXaxis()->SetTitleFont(42);
   Graph_Graph1->GetYaxis()->SetLabelFont(42);
   Graph_Graph1->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph1->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph1->GetYaxis()->SetTitleFont(42);
   Graph_Graph1->GetZaxis()->SetLabelFont(42);
   Graph_Graph1->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph1->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph1->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph1);
   
   multigraph->Add(graph,"");
   multigraph->Draw("af");
   multigraph->GetXaxis()->SetTitle("M_{#chi} (GeV)");
   multigraph->GetXaxis()->SetRange(0,96);
   multigraph->GetXaxis()->SetLabelFont(42);
   multigraph->GetXaxis()->SetTitleSize(0.05);
   multigraph->GetXaxis()->SetTitleOffset(1.1);
   multigraph->GetXaxis()->SetTitleFont(42);
   multigraph->GetYaxis()->SetTitle("#Lambda (GeV)");
   multigraph->GetYaxis()->SetLabelFont(42);
   multigraph->GetYaxis()->SetTitleSize(0.05);
   multigraph->GetYaxis()->SetTitleOffset(1.05);
   multigraph->GetYaxis()->SetTitleFont(42);
   
   multigraph = new TMultiGraph();
   multigraph->SetName("");
   multigraph->SetTitle("");
   
   Double_t Graph_fx2[6] = {
   1,
   10,
   100,
   400,
   700,
   1000};
   Double_t Graph_fy2[6] = {
   1092.23,
   1110.85,
   1079.16,
   826.374,
   584.437,
   382.832};
   graph = new TGraph(6,Graph_fx2,Graph_fy2);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#ff6666");
   graph->SetLineColor(ci);
   
   TH1F *Graph_Graph2 = new TH1F("Graph_Graph2","Graph",100,0.9,1099.9);
   Graph_Graph2->SetMinimum(310.0302);
   Graph_Graph2->SetMaximum(1183.652);
   Graph_Graph2->SetDirectory(0);
   Graph_Graph2->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph2->SetLineColor(ci);
   Graph_Graph2->GetXaxis()->SetLabelFont(42);
   Graph_Graph2->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph2->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph2->GetXaxis()->SetTitleFont(42);
   Graph_Graph2->GetYaxis()->SetLabelFont(42);
   Graph_Graph2->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph2->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph2->GetYaxis()->SetTitleFont(42);
   Graph_Graph2->GetZaxis()->SetLabelFont(42);
   Graph_Graph2->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph2->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph2->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph2);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx3[6] = {
   1,
   10,
   100,
   400,
   700,
   1000};
   Double_t Graph_fy3[6] = {
   980.038,
   996.742,
   968.943,
   742.067,
   524.44,
   343.371};
   graph = new TGraph(6,Graph_fx3,Graph_fy3);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#ff6666");
   graph->SetLineColor(ci);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph3 = new TH1F("Graph_Graph3","Graph",100,0.9,1099.9);
   Graph_Graph3->SetMinimum(278.0339);
   Graph_Graph3->SetMaximum(1062.079);
   Graph_Graph3->SetDirectory(0);
   Graph_Graph3->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph3->SetLineColor(ci);
   Graph_Graph3->GetXaxis()->SetLabelFont(42);
   Graph_Graph3->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph3->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph3->GetXaxis()->SetTitleFont(42);
   Graph_Graph3->GetYaxis()->SetLabelFont(42);
   Graph_Graph3->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph3->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph3->GetYaxis()->SetTitleFont(42);
   Graph_Graph3->GetZaxis()->SetLabelFont(42);
   Graph_Graph3->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph3->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph3->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph3);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx4[6] = {
   1,
   10,
   100,
   400,
   700,
   1000};
   Double_t Graph_fy4[6] = {
   881.525,
   896.549,
   871.907,
   667.806,
   471.744,
   308.777};
   graph = new TGraph(6,Graph_fx4,Graph_fy4);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#ff6666");
   graph->SetLineColor(ci);
   
   TH1F *Graph_Graph4 = new TH1F("Graph_Graph4","Graph",100,0.9,1099.9);
   Graph_Graph4->SetMinimum(249.9998);
   Graph_Graph4->SetMaximum(955.3262);
   Graph_Graph4->SetDirectory(0);
   Graph_Graph4->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph4->SetLineColor(ci);
   Graph_Graph4->GetXaxis()->SetLabelFont(42);
   Graph_Graph4->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph4->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph4->GetXaxis()->SetTitleFont(42);
   Graph_Graph4->GetYaxis()->SetLabelFont(42);
   Graph_Graph4->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph4->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph4->GetYaxis()->SetTitleFont(42);
   Graph_Graph4->GetZaxis()->SetLabelFont(42);
   Graph_Graph4->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph4->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph4->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph4);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx5[6] = {
   1,
   10,
   100,
   400,
   700,
   1000};
   Double_t Graph_fy5[6] = {
   1028.6,
   1012.32,
   1016.7,
   751.989,
   524.44,
   360.443};
   graph = new TGraph(6,Graph_fx5,Graph_fy5);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#0000ff");
   graph->SetLineColor(ci);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph5 = new TH1F("Graph_Graph5","Graph",100,0.9,1099.9);
   Graph_Graph5->SetMinimum(293.6273);
   Graph_Graph5->SetMaximum(1095.416);
   Graph_Graph5->SetDirectory(0);
   Graph_Graph5->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph5->SetLineColor(ci);
   Graph_Graph5->GetXaxis()->SetLabelFont(42);
   Graph_Graph5->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph5->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph5->GetXaxis()->SetTitleFont(42);
   Graph_Graph5->GetYaxis()->SetLabelFont(42);
   Graph_Graph5->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph5->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph5->GetYaxis()->SetTitleFont(42);
   Graph_Graph5->GetZaxis()->SetLabelFont(42);
   Graph_Graph5->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph5->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph5->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph5);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx6[35] = {
   3.981,
   4.365,
   4.786,
   5.248,
   5.754,
   6.31,
   6.918,
   7.586,
   8.318,
   9.12,
   10,
   10.965,
   12.023,
   13.183,
   14.454,
   15.849,
   17.378,
   19.055,
   20.893,
   22.909,
   25.119,
   31.623,
   39.811,
   50.119,
   63.096,
   79.433,
   100,
   125.893,
   158.489,
   199.526,
   251.189,
   316.228,
   1000,
   3162.278,
   10000};
   Double_t Graph_fy6[35] = {
   19.76533,
   32.58338,
   47.96959,
   63.10164,
   79.00995,
   95.55754,
   111.9766,
   129.0118,
   146.2376,
   163.5577,
   179.3658,
   194.9584,
   209.5672,
   223.2999,
   236.0683,
   247.7404,
   258.366,
   268.0662,
   277.1383,
   285.1146,
   292.3901,
   306.3527,
   314.441,
   317.1059,
   314.8684,
   308.9039,
   300.2537,
   289.8022,
   278.2241,
   266.1082,
   253.7422,
   241.4337,
   184.6404,
   139.2985,
   104.656};
   graph = new TGraph(35,Graph_fx6,Graph_fy6);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#6666ff");
   graph->SetLineColor(ci);
   graph->SetLineStyle(6);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph6 = new TH1F("Graph_Graph6","Graph",100,3.5829,10999.6);
   Graph_Graph6->SetMinimum(17.78879);
   Graph_Graph6->SetMaximum(346.84);
   Graph_Graph6->SetDirectory(0);
   Graph_Graph6->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph6->SetLineColor(ci);
   Graph_Graph6->GetXaxis()->SetLabelFont(42);
   Graph_Graph6->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph6->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph6->GetXaxis()->SetTitleFont(42);
   Graph_Graph6->GetYaxis()->SetLabelFont(42);
   Graph_Graph6->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph6->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph6->GetYaxis()->SetTitleFont(42);
   Graph_Graph6->GetZaxis()->SetLabelFont(42);
   Graph_Graph6->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph6->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph6->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph6);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx7[33] = {
   5.050109,
   5.570498,
   6.092375,
   6.79836,
   7.629504,
   8.933253,
   10.64203,
   12.05014,
   13.68495,
   14.93901,
   17.1131,
   19.54765,
   22.0792,
   25.65551,
   29.39341,
   34.84152,
   41.41884,
   48.68491,
   59.2071,
   75.34994,
   97.26741,
   131.0246,
   163.9459,
   202.8261,
   243.2248,
   309.5828,
   383.0166,
   473.8718,
   622.2993,
   833.6,
   1028.448,
   1283.339,
   2026.806};
   Double_t Graph_fy7[33] = {
   71.77067,
   88.82209,
   110.1401,
   130.7052,
   154.2557,
   185.7482,
   213.1504,
   232.735,
   248.5277,
   258.1632,
   268.4587,
   280.1818,
   286.5229,
   293.3758,
   296.7995,
   299.6924,
   299.6947,
   297.0875,
   293.2892,
   285.6511,
   275.8293,
   262.4571,
   252.7364,
   243.3346,
   234.001,
   222.0121,
   212.1495,
   202.5032,
   189.9106,
   177.908,
   168.9168,
   159.7122,
   142.9221};
   graph = new TGraph(33,Graph_fx7,Graph_fy7);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#ff9900");
   graph->SetLineColor(ci);
   graph->SetLineStyle(2);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph7 = new TH1F("Graph_Graph7","Graph",100,4.545098,2228.982);
   Graph_Graph7->SetMinimum(48.97827);
   Graph_Graph7->SetMaximum(322.4871);
   Graph_Graph7->SetDirectory(0);
   Graph_Graph7->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph7->SetLineColor(ci);
   Graph_Graph7->GetXaxis()->SetLabelFont(42);
   Graph_Graph7->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph7->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph7->GetXaxis()->SetTitleFont(42);
   Graph_Graph7->GetYaxis()->SetLabelFont(42);
   Graph_Graph7->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph7->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph7->GetYaxis()->SetTitleFont(42);
   Graph_Graph7->GetZaxis()->SetLabelFont(42);
   Graph_Graph7->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph7->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph7->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph7);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx8[90] = {
   18.74425,
   19.90368,
   20.73627,
   21.82644,
   23.00752,
   24.07546,
   25.0827,
   25.71454,
   26.71212,
   27.99356,
   28.53122,
   29.59491,
   30.69819,
   31.93543,
   33.71249,
   35.53626,
   36.69926,
   39.48566,
   41.74415,
   44.52103,
   47.27444,
   49.54151,
   51.99283,
   54.56543,
   56.59926,
   59.57426,
   61.97591,
   64.94736,
   67.7638,
   72.165,
   77.52983,
   78.67276,
   79.25885,
   79.50015,
   79.8577,
   79.98559,
   80.10781,
   80.93361,
   82.97299,
   85.0636,
   87.3346,
   89.6657,
   93.68976,
   97.60831,
   101.0972,
   103.4923,
   107.3498,
   111.0254,
   114.4909,
   118.2376,
   120.3333,
   131.3772,
   140.9375,
   145.9754,
   148.1289,
   150.9739,
   154.3249,
   158.6761,
   165.3121,
   170.7206,
   172.2259,
   173.4824,
   174.2374,
   175.2489,
   175.7591,
   179.6599,
   186.3538,
   196.4347,
   207.6675,
   217.3037,
   228.0541,
   241.4457,
   256.7473,
   271.0309,
   292.4573,
   319.2919,
   352.6953,
   387.3116,
   421.6106,
   459.6163,
   505.4719,
   563.2603,
   635.9718,
   692.2802,
   745.897,
   789.6904,
   831.1771,
   886.4295,
   950.901,
   983.4362};
   Double_t Graph_fy8[90] = {
   190.042,
   192.3104,
   192.9376,
   195.179,
   197.2136,
   198.0799,
   199.3876,
   199.4802,
   201.01,
   204.4632,
   204.529,
   206.7971,
   208.8441,
   208.9712,
   209.8662,
   210.2649,
   211.3333,
   212.7612,
   214.3898,
   216.0449,
   217.1898,
   218.8107,
   219.1693,
   219.524,
   220.873,
   221.9988,
   223.3628,
   223.7069,
   225.3419,
   225.4478,
   225.5616,
   225.584,
   239.8787,
   256.2561,
   271.2293,
   293.7999,
   304.8973,
   307.0445,
   308.5203,
   309.6434,
   310.7722,
   310.8221,
   310.5429,
   310.2559,
   309.9569,
   309.996,
   311.8566,
   313.3588,
   314.1336,
   315.2763,
   316.7668,
   317.2607,
   317.3559,
   317.4016,
   319.264,
   319.2881,
   319.6855,
   319.7195,
   318.6591,
   318.3273,
   317.9688,
   309.2591,
   300.7849,
   289.5104,
   286.1793,
   286.2011,
   285.5743,
   285.6238,
   285.3433,
   284.0635,
   283.1184,
   281.2031,
   278.656,
   277.7288,
   275.8579,
   273.0541,
   270.9095,
   265.6796,
   261.7535,
   256.9895,
   253.7797,
   247.4406,
   240.1473,
   234.4071,
   229.3303,
   226.7081,
   224.3734,
   220.2731,
   215.7486,
   213.7682};
   graph = new TGraph(90,Graph_fx8,Graph_fy8);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#cc33ff");
   graph->SetLineColor(ci);
   graph->SetLineStyle(6);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph8 = new TH1F("Graph_Graph8","Graph",100,16.86982,1079.905);
   Graph_Graph8->SetMinimum(177.0742);
   Graph_Graph8->SetMaximum(332.6873);
   Graph_Graph8->SetDirectory(0);
   Graph_Graph8->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph8->SetLineColor(ci);
   Graph_Graph8->GetXaxis()->SetLabelFont(42);
   Graph_Graph8->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph8->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph8->GetXaxis()->SetTitleFont(42);
   Graph_Graph8->GetYaxis()->SetLabelFont(42);
   Graph_Graph8->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph8->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph8->GetYaxis()->SetTitleFont(42);
   Graph_Graph8->GetZaxis()->SetLabelFont(42);
   Graph_Graph8->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph8->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph8->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph8);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx9[5] = {
   250,
   500,
   1000,
   3000,
   5000};
   Double_t Graph_fy9[5] = {
   597.2217,
   587.5585,
   450.4588,
   245.3363,
   177.6733};
   graph = new TGraph(5,Graph_fx9,Graph_fy9);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#3399ff");
   graph->SetLineColor(ci);
   graph->SetLineStyle(4);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph9 = new TH1F("Graph_Graph9","Graph",100,225,5475);
   Graph_Graph9->SetMinimum(135.7185);
   Graph_Graph9->SetMaximum(639.1765);
   Graph_Graph9->SetDirectory(0);
   Graph_Graph9->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph9->SetLineColor(ci);
   Graph_Graph9->GetXaxis()->SetLabelFont(42);
   Graph_Graph9->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph9->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph9->GetXaxis()->SetTitleFont(42);
   Graph_Graph9->GetYaxis()->SetLabelFont(42);
   Graph_Graph9->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph9->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph9->GetYaxis()->SetTitleFont(42);
   Graph_Graph9->GetZaxis()->SetLabelFont(42);
   Graph_Graph9->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph9->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph9->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph9);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx10[518] = {
   6.04,
   6.04,
   6.04,
   6.04,
   6.05,
   6.08,
   6.11,
   6.12,
   6.12,
   6.13,
   6.16,
   6.16,
   6.16,
   6.19,
   6.2,
   6.2,
   6.2,
   6.21,
   6.24,
   6.27,
   6.28,
   6.28,
   6.28,
   6.28,
   6.28,
   6.29,
   6.34,
   6.37,
   6.37,
   6.37,
   6.37,
   6.37,
   6.38,
   6.43,
   6.45,
   6.45,
   6.45,
   6.45,
   6.45,
   6.45,
   6.46,
   6.53,
   6.54,
   6.54,
   6.54,
   6.54,
   6.54,
   6.54,
   6.62,
   6.62,
   6.62,
   6.62,
   6.62,
   6.62,
   6.64,
   6.69,
   6.71,
   6.71,
   6.71,
   6.71,
   6.71,
   6.72,
   6.78,
   6.8,
   6.8,
   6.8,
   6.8,
   6.8,
   6.81,
   6.87,
   6.89,
   6.89,
   6.89,
   6.89,
   6.89,
   6.91,
   6.94,
   6.97,
   6.98,
   6.98,
   7,
   7.05,
   7.08,
   7.09,
   7.15,
   7.17,
   7.19,
   7.24,
   7.27,
   7.28,
   7.34,
   7.37,
   7.37,
   7.45,
   7.46,
   7.47,
   7.55,
   7.56,
   7.57,
   7.65,
   7.66,
   7.67,
   7.76,
   7.77,
   7.77,
   7.86,
   7.88,
   7.95,
   7.99,
   8.05,
   8.1,
   8.15,
   8.19,
   8.24,
   8.27,
   8.31,
   8.38,
   8.43,
   8.48,
   8.52,
   8.58,
   8.61,
   8.65,
   8.71,
   8.75,
   8.81,
   8.84,
   8.88,
   8.93,
   8.97,
   9,
   9.05,
   9.12,
   9.17,
   9.24,
   9.29,
   9.36,
   9.42,
   9.49,
   9.54,
   9.62,
   9.67,
   9.74,
   9.8,
   9.87,
   9.93,
   10,
   10.2,
   10.3,
   10.5,
   10.6,
   10.8,
   10.9,
   10.9,
   11,
   11.2,
   11.2,
   11.3,
   11.5,
   11.6,
   11.8,
   11.9,
   12.1,
   12.2,
   12.4,
   12.6,
   12.7,
   12.9,
   13.1,
   13.3,
   13.5,
   13.5,
   13.6,
   13.8,
   14,
   14.2,
   14.4,
   14.5,
   14.5,
   14.8,
   15,
   15.2,
   15.3,
   15.3,
   15.6,
   15.8,
   15.9,
   16,
   16.2,
   16.5,
   16.6,
   16.9,
   17.2,
   17.3,
   17.6,
   17.9,
   18,
   18.3,
   18.6,
   18.7,
   19,
   19.3,
   19.4,
   19.5,
   19.8,
   20.6,
   21.4,
   21.8,
   22,
   22.2,
   22.6,
   22.9,
   23.2,
   23.5,
   23.8,
   24.1,
   24.5,
   24.8,
   25.1,
   25.5,
   25.8,
   26.1,
   26.5,
   26.8,
   27.2,
   27.6,
   28.1,
   28.7,
   29.1,
   29.4,
   29.8,
   30.8,
   31.7,
   32.4,
   32.9,
   34.2,
   35.3,
   35.8,
   36.4,
   36.9,
   37.4,
   38.3,
   38.9,
   39.4,
   40.4,
   41,
   41.6,
   42.6,
   43.2,
   43.8,
   44.4,
   45,
   45.6,
   46.2,
   46.8,
   47.5,
   48.1,
   48.7,
   49.4,
   50.1,
   50.7,
   51.4,
   52.1,
   53.3,
   54.8,
   55.7,
   56.4,
   57.2,
   57.9,
   58.7,
   59.5,
   60.3,
   61.1,
   61.9,
   62.7,
   63.5,
   64.4,
   65.3,
   66.3,
   67.6,
   68.8,
   69.7,
   70.7,
   71.6,
   72.8,
   74.2,
   75.5,
   76.5,
   77.5,
   78.8,
   80.3,
   81.8,
   82.8,
   84,
   85.1,
   86.4,
   88.2,
   89.7,
   90.9,
   92.1,
   93.6,
   95.5,
   97.1,
   98.4,
   100,
   102,
   104,
   105,
   108,
   110,
   112,
   114,
   115,
   118,
   120,
   122,
   124,
   127,
   130,
   132,
   134,
   137,
   139,
   142,
   145,
   147,
   150,
   152,
   155,
   157,
   161,
   164,
   167,
   170,
   173,
   176,
   179,
   182,
   187,
   190,
   194,
   197,
   200,
   205,
   208,
   213,
   216,
   222,
   225,
   231,
   234,
   240,
   244,
   253,
   262,
   267,
   272,
   278,
   283,
   289,
   295,
   301,
   307,
   312,
   317,
   323,
   329,
   334,
   341,
   347,
   353,
   358,
   367,
   374,
   381,
   387,
   395,
   403,
   411,
   419,
   427,
   436,
   445,
   454,
   463,
   475,
   485,
   494,
   504,
   514,
   528,
   545,
   564,
   583,
   603,
   615,
   628,
   639,
   649,
   662,
   675,
   689,
   701,
   712,
   726,
   741,
   756,
   771,
   786,
   802,
   818,
   833,
   846,
   863,
   878,
   892,
   910,
   935,
   964,
   992,
   1030,
   1050,
   1070,
   1090,
   1110,
   1150,
   1190,
   1210,
   1230,
   1260,
   1280,
   1310,
   1340,
   1370,
   1400,
   1430,
   1460,
   1490,
   1520,
   1550,
   1600,
   1650,
   1690,
   1720,
   1750,
   1790,
   1850,
   1910,
   1950,
   1990,
   2030,
   2070,
   2130,
   2170,
   2210,
   2260,
   2300,
   2370,
   2410,
   2460,
   2540,
   2630,
   2680,
   2730,
   2820,
   2920,
   3020,
   3120,
   3190,
   3240,
   3320,
   3370,
   3490,
   3610,
   3690,
   3750,
   3880,
   4020,
   4100,
   4180,
   4270,
   4350,
   4440,
   4530,
   4620,
   4690,
   4810,
   4880,
   5000,
   5080,
   5200,
   5310,
   5420,
   5520,
   5640,
   5750,
   5860,
   5980,
   6100,
   6220,
   6330,
   6440,
   6560,
   6700,
   6830,
   7050,
   7300,
   7450,
   7590,
   7840,
   8110,
   8380,
   8670,
   8850,
   8990,
   9210,
   9390,
   9610};
   Double_t Graph_fy10[518] = {
   10.38676,
   10.50231,
   10.59957,
   10.7015,
   10.89364,
   11.07546,
   11.20647,
   11.30821,
   11.41342,
   11.62109,
   11.82995,
   11.96215,
   12.07818,
   12.17911,
   12.30743,
   12.414,
   12.52534,
   12.76538,
   12.97118,
   13.12865,
   13.25128,
   13.37442,
   13.49524,
   13.62174,
   13.74534,
   13.99711,
   14.24146,
   14.40622,
   14.54013,
   14.67427,
   14.8083,
   14.94868,
   15.22224,
   15.47959,
   15.6669,
   15.80805,
   15.95581,
   16.10083,
   16.2527,
   16.40114,
   16.65049,
   17.00656,
   17.18103,
   17.34867,
   17.50979,
   17.663,
   17.82315,
   18.09534,
   18.48112,
   18.68225,
   18.85134,
   19.02836,
   19.21403,
   19.38419,
   19.72512,
   20.07365,
   20.32073,
   20.51337,
   20.68111,
   20.89181,
   21.0759,
   21.47197,
   21.82747,
   22.10836,
   22.30316,
   22.50687,
   22.72023,
   22.88709,
   23.32871,
   23.73763,
   24.00677,
   24.23435,
   24.45738,
   24.68282,
   24.91041,
   25.36578,
   25.78503,
   26.09729,
   26.34398,
   26.58842,
   27.06598,
   27.53896,
   27.86668,
   28.37133,
   28.86478,
   29.20029,
   29.71859,
   30.24769,
   30.60227,
   31.15273,
   31.68307,
   32.06927,
   32.5362,
   33.23597,
   33.60661,
   34.0793,
   34.82676,
   35.19988,
   35.69491,
   36.46783,
   36.87798,
   37.44003,
   38.20997,
   38.65276,
   39.20006,
   40.07932,
   40.8414,
   41.55343,
   42.4036,
   43.14178,
   44.02907,
   44.76045,
   45.25133,
   46.05417,
   46.59723,
   47.07559,
   47.84267,
   48.80958,
   49.64402,
   50.16063,
   51.06094,
   51.65136,
   52.17979,
   52.98822,
   53.58735,
   54.51024,
   55.15295,
   55.7454,
   56.61769,
   57.29215,
   57.83828,
   58.59123,
   59.58957,
   60.25911,
   61.2608,
   61.9507,
   63.01658,
   63.72388,
   64.8542,
   65.56339,
   66.64773,
   67.45883,
   68.57788,
   69.38042,
   70.52167,
   71.44279,
   73.10832,
   74.86664,
   76.70132,
   78.48531,
   80.39639,
   82.27539,
   83.96915,
   84.81317,
   86.19446,
   88.02168,
   88.90821,
   90.11315,
   92.12023,
   94.32802,
   96.50886,
   98.84577,
   100.8332,
   102.8086,
   104.7116,
   106.793,
   108.8109,
   110.7898,
   112.9515,
   115.1677,
   117.0762,
   118.1521,
   119.1161,
   120.7506,
   122.937,
   125.5722,
   127.4196,
   128.5312,
   129.6638,
   131.542,
   134.0308,
   136.1693,
   137.3979,
   138.4952,
   140.691,
   142.7079,
   144.0108,
   145.2215,
   146.8251,
   149.5702,
   150.7827,
   152.4733,
   155.2857,
   156.5944,
   158.387,
   161.2726,
   162.6707,
   164.4505,
   167.5191,
   168.8856,
   170.7937,
   172.6887,
   174.1507,
   175.4199,
   177.3078,
   182.9573,
   187.7626,
   189.8365,
   190.4369,
   191.0454,
   193.294,
   195.0114,
   196.8028,
   198.6746,
   200.6337,
   202.4317,
   204.8624,
   205.4538,
   206.0518,
   208.4005,
   210.5569,
   212.4997,
   214.5452,
   216.3183,
   218.547,
   220.4993,
   222.5493,
   224.7033,
   226.9325,
   229.2592,
   231.2259,
   233.3437,
   236.0739,
   236.692,
   237.8515,
   240.2765,
   242.669,
   242.8986,
   243.7,
   244.4396,
   245.1237,
   245.324,
   246.1552,
   246.9239,
   247.738,
   248.6028,
   249.34,
   250.183,
   251.0113,
   251.7779,
   252.4054,
   252.4402,
   252.4741,
   252.5072,
   252.5394,
   252.576,
   252.6065,
   251.8236,
   251.565,
   251.5977,
   251.9175,
   252.7618,
   252.7922,
   253.0667,
   254.0334,
   254.1442,
   254.1704,
   254.1995,
   254.2243,
   254.2519,
   254.2788,
   254.305,
   254.3305,
   254.3554,
   254.3796,
   254.4032,
   254.4291,
   254.4543,
   254.2526,
   253.4561,
   253.3367,
   253.3588,
   252.5675,
   252.295,
   252.1031,
   251.2675,
   251.223,
   250.3929,
   250.0624,
   249.8782,
   249.0786,
   249.0366,
   248.174,
   247.9263,
   247.944,
   247.6981,
   246.9351,
   246.8915,
   246.9084,
   246.0196,
   245.5296,
   244.7362,
   244.6935,
   243.8445,
   243.6187,
   242.4377,
   241.8683,
   241.295,
   240.1783,
   239.0772,
   238.001,
   237.4805,
   236.957,
   236.4553,
   236.9969,
   237.012,
   234.4527,
   232.994,
   232.0529,
   231.124,
   230.6725,
   229.7764,
   228.8918,
   227.5962,
   226.7575,
   226.3463,
   225.53,
   224.7235,
   224.3345,
   223.5489,
   222.4,
   221.6514,
   220.9151,
   220.5568,
   219.4781,
   218.4252,
   218.4349,
   217.4066,
   216.4078,
   215.7535,
   214.7888,
   214.4764,
   213.537,
   212.6227,
   211.7229,
   210.5545,
   209.6973,
   208.5851,
   207.767,
   206.7044,
   205.9222,
   204.9054,
   204.1581,
   202.7048,
   200.6119,
   199.4946,
   198.6241,
   197.7734,
   196.9394,
   195.9209,
   195.126,
   194.1531,
   193.393,
   192.6467,
   192.2811,
   191.5566,
   190.8456,
   190.4965,
   189.8054,
   189.1259,
   188.7928,
   187.9657,
   186.9986,
   186.3681,
   185.748,
   185.29,
   184.688,
   183.8008,
   183.0782,
   182.0883,
   181.3984,
   180.4531,
   179.6626,
   178.8891,
   178.132,
   176.4223,
   175.5989,
   174.7941,
   174.0077,
   173.2387,
   171.644,
   170.3208,
   168.5686,
   167.267,
   165.4898,
   164.7208,
   163.9695,
   163.8889,
   163.1556,
   162.5181,
   161.6606,
   160.976,
   160.9779,
   160.2332,
   159.5059,
   158.7245,
   158.0995,
   157.2843,
   156.6211,
   155.8431,
   155.2095,
   155.1483,
   154.4668,
   153.8004,
   153.7418,
   153.0319,
   152.3957,
   150.9962,
   149.8166,
   148.4291,
   146.8649,
   146.1595,
   145.5618,
   144.8424,
   144.2273,
   143.077,
   141.5716,
   140.9059,
   140.2935,
   139.6204,
   138.999,
   138.3208,
   137.7278,
   136.5779,
   135.9239,
   135.2852,
   134.6612,
   134.0513,
   133.455,
   132.8717,
   131.7421,
   130.3946,
   129.6185,
   129.1138,
   128.6188,
   127.8935,
   126.9576,
   125.6149,
   124.9697,
   124.5488,
   123.9302,
   123.3267,
   122.1621,
   121.6,
   121.0507,
   120.5136,
   119.9882,
   118.9705,
   118.3154,
   117.8359,
   116.905,
   115.7187,
   115.1476,
   114.5904,
   113.7792,
   112.4881,
   111.6267,
   110.4508,
   109.8856,
   109.4437,
   108.7971,
   108.3764,
   107.6595,
   106.4832,
   106.0117,
   105.4593,
   104.657,
   103.6329,
   103.0581,
   102.6571,
   102.1086,
   101.7257,
   101.2013,
   100.7625,
   100.2622,
   99.77413,
   99.29779,
   98.89833,
   98.37802,
   97.9966,
   97.43805,
   97.13459,
   96.65859,
   96.25151,
   95.79658,
   95.35219,
   94.91791,
   94.49337,
   94.02686,
   93.6217,
   93.27425,
   93.07861,
   92.78892,
   92.31587,
   91.94598,
   91.2278,
   90.24254,
   89.78968,
   89.42747,
   88.72436,
   87.79184,
   87.11485,
   86.19591,
   85.77034,
   85.35504,
   84.91885,
   84.61402,
   84.25532};
   graph = new TGraph(518,Graph_fx10,Graph_fy10);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#66ccff");
   graph->SetLineColor(ci);
   graph->SetLineStyle(5);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph10 = new TH1F("Graph_Graph10","Graph",518,5.436,10570.4);
   Graph_Graph10->SetMinimum(9.348083);
   Graph_Graph10->SetMaximum(278.861);
   Graph_Graph10->SetDirectory(0);
   Graph_Graph10->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph10->SetLineColor(ci);
   Graph_Graph10->GetXaxis()->SetLabelFont(42);
   Graph_Graph10->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph10->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph10->GetXaxis()->SetTitleFont(42);
   Graph_Graph10->GetYaxis()->SetLabelFont(42);
   Graph_Graph10->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph10->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph10->GetYaxis()->SetTitleFont(42);
   Graph_Graph10->GetZaxis()->SetLabelFont(42);
   Graph_Graph10->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph10->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph10->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph10);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx11[35] = {
   3.98,
   4.37,
   4.79,
   5.25,
   5.75,
   6.31,
   6.92,
   7.59,
   8.32,
   9.12,
   10,
   10.96,
   12.02,
   13.18,
   14.45,
   15.85,
   17.38,
   19.05,
   20.89,
   22.91,
   25.12,
   31.62,
   39.81,
   50.12,
   63.1,
   79.43,
   100,
   125.89,
   158.49,
   199.53,
   251.19,
   316.23,
   1000,
   3162.3,
   10000};
   Double_t Graph_fy11[35] = {
   64.47703,
   92.96188,
   120.9916,
   144.7661,
   171.1873,
   194.8983,
   219.9867,
   244.5213,
   267.5613,
   289.6608,
   311.7509,
   330.2783,
   345.9273,
   362.605,
   376.5173,
   387.5872,
   398.0475,
   406.9399,
   414.3522,
   421.5604,
   426.3119,
   433.1181,
   435.0014,
   429.503,
   421.4079,
   411.5566,
   398.3919,
   383.7713,
   369.2768,
   352.1727,
   335.9504,
   319.8066,
   245.9105,
   185.1913,
   139.1868};
   graph = new TGraph(35,Graph_fx11,Graph_fy11);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#66cc66");
   graph->SetLineColor(ci);
   graph->SetLineStyle(2);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph11 = new TH1F("Graph_Graph11","Graph",100,3.582,10999.6);
   Graph_Graph11->SetMinimum(27.4246);
   Graph_Graph11->SetMaximum(472.0538);
   Graph_Graph11->SetDirectory(0);
   Graph_Graph11->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph11->SetLineColor(ci);
   Graph_Graph11->GetXaxis()->SetLabelFont(42);
   Graph_Graph11->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph11->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph11->GetXaxis()->SetTitleFont(42);
   Graph_Graph11->GetYaxis()->SetLabelFont(42);
   Graph_Graph11->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph11->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph11->GetYaxis()->SetTitleFont(42);
   Graph_Graph11->GetZaxis()->SetLabelFont(42);
   Graph_Graph11->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph11->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph11->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph11);
   
   multigraph->Add(graph,"");
   
   Double_t Graph_fx12[35] = {
   4,
   5,
   6,
   7,
   8,
   9,
   10,
   12,
   14,
   16,
   18,
   20,
   24,
   28,
   32,
   36,
   40,
   44,
   48,
   52,
   56,
   60,
   65,
   70,
   75,
   80,
   85,
   90,
   95,
   100,
   150,
   200,
   300,
   400,
   500};
   Double_t Graph_fy12[35] = {
   91.75045,
   115.9467,
   132.4599,
   144.0692,
   152.856,
   159.9043,
   165.4462,
   172.653,
   177.2831,
   179.5654,
   180.8904,
   181.5836,
   181.5776,
   181.2419,
   178.737,
   176.8406,
   175.2212,
   173.4303,
   171.2294,
   169.3498,
   167.5194,
   165.3283,
   163.1921,
   161.2337,
   159.198,
   157.2876,
   155.7156,
   153.813,
   152.3262,
   150.9621,
   138.5165,
   129.9907,
   118.4184,
   110.7202,
   104.9163};
   graph = new TGraph(35,Graph_fx12,Graph_fy12);
   graph->SetName("Graph");
   graph->SetTitle("Graph");
   graph->SetFillColor(1);

   ci = TColor::GetColor("#333399");
   graph->SetLineColor(ci);
   graph->SetLineStyle(2);
   graph->SetLineWidth(3);
   
   TH1F *Graph_Graph12 = new TH1F("Graph_Graph12","Graph",100,3.6,549.6);
   Graph_Graph12->SetMinimum(82.76714);
   Graph_Graph12->SetMaximum(190.5669);
   Graph_Graph12->SetDirectory(0);
   Graph_Graph12->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph12->SetLineColor(ci);
   Graph_Graph12->GetXaxis()->SetLabelFont(42);
   Graph_Graph12->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph12->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph12->GetXaxis()->SetTitleFont(42);
   Graph_Graph12->GetYaxis()->SetLabelFont(42);
   Graph_Graph12->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph12->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph12->GetYaxis()->SetTitleFont(42);
   Graph_Graph12->GetZaxis()->SetLabelFont(42);
   Graph_Graph12->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph12->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph12->GetZaxis()->SetTitleFont(42);
   graph->SetHistogram(Graph_Graph12);
   
   multigraph->Add(graph,"");
   multigraph->Draw("L");
   
   TLegend *leg = new TLegend(0.16,0.61,0.5,0.85,NULL,"brNDC");
   leg->SetBorderSize(0);
   leg->SetTextSize(0.03);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(1);
   leg->SetFillColor(0);
   leg->SetFillStyle(1001);
   TLegendEntry *entry=leg->AddEntry("NULL","Razor-0#mu 90% CL limit: AV EFT operator","h");
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph","Expected limit, with uncertainty","lf");

   ci = TColor::GetColor("#ffcc00");
   entry->SetFillColor(ci);
   entry->SetFillStyle(1001);

   ci = TColor::GetColor("#ff6666");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph","Observed limit","l");

   ci = TColor::GetColor("#0000ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(1);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   leg->Draw();
   
   leg = new TLegend(0.67,0.61,0.92,0.9,NULL,"brNDC");
   leg->SetBorderSize(0);
   leg->SetTextSize(0.03);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(1);
   leg->SetFillColor(0);
   leg->SetFillStyle(1001);
   entry=leg->AddEntry("Graph","IceCube W^{+}W^{-}","l");

   ci = TColor::GetColor("#3399ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(4);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph","COUPP 2012","l");

   ci = TColor::GetColor("#6666ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(6);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph","SIMPLE 2012","l");

   ci = TColor::GetColor("#ff9900");
   entry->SetLineColor(ci);
   entry->SetLineStyle(2);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph","Super-K W^{+}W^{-}","l");

   ci = TColor::GetColor("#cc33ff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(6);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph","XENON 100","l");

   ci = TColor::GetColor("#66ccff");
   entry->SetLineColor(ci);
   entry->SetLineStyle(5);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph","PICO","l");

   ci = TColor::GetColor("#66cc66");
   entry->SetLineColor(ci);
   entry->SetLineStyle(2);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph","PICASSO","l");

   ci = TColor::GetColor("#333399");
   entry->SetLineColor(ci);
   entry->SetLineStyle(2);
   entry->SetLineWidth(3);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   leg->Draw();
   TLatex *   tex = new TLatex(0.955,0.945,"18.8 fb^{-1} (8 TeV)");
tex->SetNDC();
   tex->SetTextAlign(31);
   tex->SetTextFont(42);
   tex->SetTextSize(0.045);
   tex->SetLineWidth(2);
   tex->Draw();
      tex = new TLatex(0.245,0.865,"CMS");
tex->SetNDC();
   tex->SetTextAlign(31);
   tex->SetTextFont(61);
   tex->SetTextSize(0.045);
   tex->SetLineWidth(2);
   tex->Draw();
   
   TH1F *_copy__1 = new TH1F("_copy__1","",100,0.9,1049.95);
   _copy__1->SetMinimum(100);
   _copy__1->SetMaximum(2000000);
   _copy__1->SetDirectory(0);
   _copy__1->SetStats(0);

   ci = TColor::GetColor("#000099");
   _copy__1->SetLineColor(ci);
   _copy__1->GetXaxis()->SetTitle("M_{#chi} (GeV)");
   _copy__1->GetXaxis()->SetRange(0,96);
   _copy__1->GetXaxis()->SetLabelFont(42);
   _copy__1->GetXaxis()->SetTitleSize(0.05);
   _copy__1->GetXaxis()->SetTitleOffset(1.1);
   _copy__1->GetXaxis()->SetTitleFont(42);
   _copy__1->GetYaxis()->SetTitle("#Lambda (GeV)");
   _copy__1->GetYaxis()->SetLabelFont(42);
   _copy__1->GetYaxis()->SetTitleSize(0.05);
   _copy__1->GetYaxis()->SetTitleOffset(1.05);
   _copy__1->GetYaxis()->SetTitleFont(42);
   _copy__1->GetZaxis()->SetLabelFont(42);
   _copy__1->GetZaxis()->SetLabelSize(0.035);
   _copy__1->GetZaxis()->SetTitleSize(0.035);
   _copy__1->GetZaxis()->SetTitleFont(42);
   _copy__1->Draw("sameaxis");
   c->Modified();
   c->cd();
   c->SetSelected(c);
}
Exemple #21
0
void plotS11Baby() {

   const int numFiles=8;
   char filename[180];
   int antFiles[numFiles][2]={{1,17},{1,18},{1,28},{1,27},{2,7},{2,8},{5,8},{5,9}};
   int whichOpen[numFiles]={1,1,2,2,5,5,6,6};
   int plotThis[numFiles]={1,1,1,1,2,2,2,2};
   char *graphDesc[numFiles]={"Office (1)","Office (2)","Outside (1)","Outside (2)","Salt Day I (1)","Salt Day I (2)","Salt Day III (1)","Salt Day III (2)"};
   TGraph *grOpen[NUM_OPENS]; 
   TGraph *grOpenPower[NUM_OPENS];
   for(int i=0;i<NUM_OPENS;i++) {
      grOpen[i]=getOpenWave(i); 
      //      grOpenPower[i]=FFTtools::makePowerSpectrumVoltsSecondsPadded(grOpen[i],8);
      grOpenPower[i]=FFTtools::makePSVSBartlettPaddedOverlap(grOpen[i],32,1024);
      Double_t *freq=grOpenPower[i]->GetX();
      //      cout << i << "\t" << grOpenPower[i]->GetN() << "\t" <<  freq[1]-freq[0] << "\n";
   }
   
   TGraph *grAnt[numFiles];
   TGraph *grAntPower[numFiles];
   TGraph *grAntRatio[numFiles];
   TGraph *grAntTrans[numFiles];
   for(int i=0;i<numFiles;i++) {
       sprintf(filename,"/home/rjn/saltStuff/hockley2009/disk_%d/TEK%05d.txt",antFiles[i][0],antFiles[i][1]);
       grAnt[i]=getWaveFromTxt(filename);
       grAnt[i]=cropLikeOpen(grAnt[i],whichOpen[i]);
       if(i<3) {
	 //	  grAntPower[i]=FFTtools::makePowerSpectrumVoltsSecondsPadded(grAnt[i],8);
	  grAntPower[i]=FFTtools::makePSVSBartlettPaddedOverlap(grAnt[i],32,1024);
       }
       else {
	  grAntPower[i]=FFTtools::makePSVSBartlettPaddedOverlap(grAnt[i],32,1024);
	  //	  TGraph *grTemp=FFTtools::makePowerSpectrumVoltsSecondsPadded(grAnt[i],8);
	  //	  grAntPower[i]=FFTtools::smoothFFT(grTemp,2);
       }
       grAntRatio[i]=FFTtools::dbGraphs(grAntPower[i],grOpenPower[whichOpen[i]]);
       grAntTrans[i]=FFTtools::ratioSubtractOneGraphs(grAntPower[i],grOpenPower[whichOpen[i]]);
       //       Double_t *freq=grAntPower[i]->GetX();
       //       cout << i << "\t" << freq[1]-freq[0] << "\n";
       //       cout << i << "\t" << grAntPower[i]->GetN() << "\t" <<  freq[1]-freq[0] << "\n";
       //       cout << grAntRatio[i] << "\t" << grAntTrans[i] << endl;
   }


  TCanvas *canWave = new TCanvas("canBabyWave","canBabyWave",800,800);
  canWave->Divide(1,numFiles);
  for(int i=0;i<numFiles;i++) {
     canWave->cd(i+1);
     grAnt[i]->SetLineColor(getNiceColour(i));     
     grAnt[i]->Draw("al");
     grAnt[i]->SetTitle(graphDesc[i]);
     grAnt[i]->GetXaxis()->SetTitle("Time (s)");
     grAnt[i]->GetYaxis()->SetTitle("Voltage (V)");

  }

  TCanvas *can = new TCanvas("canBaby","canBaby",900,600);
  can->Divide(1,2);
  for(int subPad=1;subPad<=2;subPad++) {
    can->cd(subPad);
    TMultiGraph *mg = new TMultiGraph();
    
    TLegend *leggy = new TLegend(0.2,0.2,0.4,0.5);
    leggy->SetBorderSize(0);
    leggy->SetFillColor(0);
    leggy->SetFillStyle(0);  
    for(int i=0;i<numFiles;i++) {
      if(plotThis[i]!=subPad) continue;
      grAntRatio[i]->SetLineColor(getNiceColour(i));
      grAntRatio[i]->SetLineWidth(2);
      mg->Add(grAntRatio[i],"l");
      leggy->AddEntry(grAntRatio[i],graphDesc[i],"l");
    }
    mg->Draw("al");
    mg->SetTitle("S11 Measurements Baby");
    mg->SetMaximum(0);
    mg->SetMinimum(-20);
    mg->GetXaxis()->SetRangeUser(0,1000);
    mg->GetXaxis()->SetTitle("Frequency (MHz)");
    mg->GetYaxis()->SetTitle("Reflected Power (dB)");
    leggy->Draw();
  }


  TCanvas *canTrans = new TCanvas("canTransBaby","canTransBaby",900,600);
  canTrans->Divide(1,2);
  for(int subPad=1;subPad<=2;subPad++) {
    canTrans->cd(subPad);
    TMultiGraph *mg = new TMultiGraph();
    TLegend *leggy2 = new TLegend(0.2,0.55,0.4,0.85);
    leggy2->SetBorderSize(0);
    leggy2->SetFillColor(0);
    leggy2->SetFillStyle(0);  
    for(int i=0;i<numFiles;i++) {
      if(plotThis[i]!=subPad) continue;
      grAntTrans[i]->SetLineColor(getNiceColour(i));
      grAntTrans[i]->SetLineWidth(2);
      mg->Add(grAntTrans[i],"l");
      leggy2->AddEntry(grAntTrans[i],graphDesc[i],"l");
    }
    mg->Draw("al");
    mg->SetTitle("S11 Measurements Baby");
    mg->SetMaximum(1);
    mg->SetMinimum(0);
    mg->GetXaxis()->SetRangeUser(0,1000);
    mg->GetXaxis()->SetTitle("Frequency (MHz)");
    mg->GetYaxis()->SetTitle("Transmission (Ratio)");    
    leggy2->Draw();
  }


}
void FindConstant::drawChi2AndFitPol2(const std::vector<double>& res, const std::vector<double>& chi2)
{
  TCanvas* c1 = new TCanvas();
  std::stringstream streamForEResExtraction;
  streamForEResExtraction << scintillatorID << "_beta_" << energyResolution;

  std::vector<double> Chi2ToFit, ResToFit;
  for (size_t i = 0; i < chi2.size(); i++) {
    if (chi2[i] < bestChi2 + 50.0) {
      std::cout << chi2[i] << std::endl;
      Chi2ToFit.push_back( chi2[i] );
      ResToFit.push_back( res[i] );
    }
  }

  TMultiGraph* m = new TMultiGraph();

  TGraph* gr = new TGraph(Chi2ToFit.size(), &ResToFit[0], &Chi2ToFit[0]);
  gr->SetTitle("Chi2 vs #beta");
  gr->GetXaxis()->SetTitle("#beta (#sqrt{keV})");
  gr->GetYaxis()->SetTitle("Chi2 for best fit");
  gr->SetLineColor(2);
  gr->SetLineWidth(4);
  gr->SetMarkerColor(4);
  gr->SetMarkerStyle(21);
  gr->Draw("AP");
  gStyle->SetOptFit(1);

  quadraticFit = new TF1("quadraticFit", "[0]* (x - [1])**2 + [2]", ResToFit[0], ResToFit[ ResToFit.size() - 1 ] );
  quadraticFit->SetParName(0, "a");
  quadraticFit->SetParName(1, "x_min");
  quadraticFit->SetParName(2, "y_min");
  quadraticFit->SetParameter(1, energyResolution);
  quadraticFit->SetParameter(2, bestChi2);
  gr->Fit(quadraticFit, "R");
  quadraticFit->Draw("same");
  std::stringstream buf;
  buf << sourcePosition;
  c1->SaveAs( ("FitResults" + filePath + buf.str() + "/Chi2Plot_strip_fitRegion_" + streamForEResExtraction.str() + expHistoTitle + ".png") );

  m->Add(gr);

  energyResolution = quadraticFit->GetParameter(1);

  TGraph* grFull = new TGraph(chi2.size(), &res[0], &chi2[0]);
  grFull->SetTitle("Chi2 vs #beta");
  grFull->GetXaxis()->SetTitle("#beta (#sqrt{keV})");
  grFull->GetYaxis()->SetTitle("Chi2 for best fit");
  grFull->SetLineColor(2);
  grFull->SetLineWidth(4);
  grFull->SetMarkerColor(4);
  grFull->SetMarkerStyle(21);

  m->Add(grFull);

  m->Draw("AP");

  c1->SaveAs( ("FitResults" + filePath + buf.str() + "/Chi2Plot_strip_" + streamForEResExtraction.str() + expHistoTitle + ".png") );

  delete gr;
  delete c1;
}
void pionContaminationVeta(){
  
  
	gStyle->SetOptStat(0);
	gStyle->SetOptFit(1);
	gStyle->SetPalette(1);
	
	char hist  [100];
	char hfile [100];
  
	
	sprintf(hfile,"~/Desktop/Research/2012IFF/rootFiles/nsigma20bintest35mil.root");  
  
	TFile* file = TFile::Open(hfile,"read");
	assert(file);
	
	
  double totalYieldWhole = 0;
  double pionYieldWhole = 0;
  double kpYieldWhole = 0;
  double electYieldWhile = 0;
	
	
	double pionFrac  [20];
	double kpFrac    [20];
	double electFrac [20];
	
	double pionCent  [20];
	double kpCent    [20];
	double electCent [20];
	
	double pionMax  [20];
	double kpMax    [20];
	double electMax [20];
	
	double pionSig  [20];
	double kpSig    [20];
	double electSig [20];
	
	
	double etastart[20];
	double etaend[20];
  
	double eta[20];
	
	
	double piYield[20];
	double highestYield = 0;
	
  double totalYeild[20];
	
	
	
  TH1F* hTotal = new TH1F("hTotal","hTotal",300,-10,10);

  
	for (int ihist=0; ihist<20; ihist++)
	{
		/*
     if (ihist != 0 || ihist != 1 || ihist != 2 || ihist != 3 ||)
     {
     cou
     }
     */
		sprintf(hist,"nSigmaPionBin_%i",ihist);
		cout << hist << endl;
		
		TH1F *hNsigma = (TH1F*) file->Get(hist);
	  assert(hNsigma);
    
    hTotal->Add(hNsigma, 1);
    cout << hTotal->GetEntries() << endl;
		
		TF1 *fitFunc = new TF1("fitFunc","gaus(0)+gaus(3)+gaus(6)",-10,10);
    TF1 *piFunc = new TF1("piFunc","gaus(0)",-10,10);
    TF1 *kpFunc = new TF1("kpFunc","gaus(0)",-10,10);
    TF1  *eFunc = new TF1( "eFunc","gaus(0)",-10,10);
    fitFunc->SetParName(0, "A_{#pi}");
    fitFunc->SetParName(1, "#LTn_{#pi}#GT");
    fitFunc->SetParName(2, "#sigma_{#pi}");
    fitFunc->SetParName(3, "A_{K/p}");
    fitFunc->SetParName(4, "#LTn_{K/p}#GT");
    fitFunc->SetParName(5, "#sigma_{K/p}");
    fitFunc->SetParName(6, "A_{e}");
    fitFunc->SetParName(7, "#LTn_{e}#GT");
    fitFunc->SetParName(8, "#sigma_{e}");
		
    fitFunc->SetParameter(0, hNsigma->GetMaximum());
    fitFunc->SetParameter(1, 0.);
    fitFunc->SetParameter(2, 1.);
		
    fitFunc->SetParameter(3, 0.05*hNsigma->GetMaximum());
    fitFunc->SetParameter(4,-3.);
    fitFunc->SetParameter(5, 1.5);
		
    fitFunc->SetParameter(6, 0.05*hNsigma->GetMaximum());
    fitFunc->SetParameter(7, 4.); //was at 5. but it seems like 4. works better
    fitFunc->SetParameter(8, 3.);
		
		hNsigma->Fit("fitFunc");
    
    float  ampPi = fitFunc->GetParameter(0);
    float centPi = fitFunc->GetParameter(1);
    float  sigPi = fitFunc->GetParameter(2);
    piFunc->SetParameters(ampPi,centPi,sigPi);
    piFunc->SetLineColor(kViolet+1);
    
    float  ampKP = fitFunc->GetParameter(3);
    float centKP = fitFunc->GetParameter(4);
    float  sigKP = fitFunc->GetParameter(5);
    kpFunc->SetParameters(ampKP,centKP,sigKP);
    kpFunc->SetLineColor(kGreen+2);
    
    float  ampE  = fitFunc->GetParameter(6);
    float centE  = fitFunc->GetParameter(7);
    float  sigE  = fitFunc->GetParameter(8);
    eFunc->SetParameters(ampE,centE,sigE);
    eFunc->SetLineColor(kBlue);
    
    piFunc->Draw("same");
    kpFunc->Draw("same");
    eFunc->Draw("same");
    
    TLine *l1 = new TLine( 2.5,0, 2.5,0.9*hNsigma->GetMaximum());
    TLine *l2 = new TLine(-1.0,0,-1.0,0.9*hNsigma->GetMaximum());
    l1->SetLineColor(kOrange+2);
    l2->SetLineColor(kOrange+2);
    l1->SetLineWidth(2);
    l2->SetLineWidth(2);
    
    l1->Draw();
    l2->Draw();
		
		//*
    float  totYield = fitFunc->Integral(-1.,2.5);
    float pionYield =  piFunc->Integral(-1.,2.5);
    float   kpYield =  kpFunc->Integral(-1.,2.5);
    float    eYield =   eFunc->Integral(-1.,2.5);
		//*/
		/*
     float  totYield = fitFunc->Integral(-2.,2.);
     float pionYield =  piFunc->Integral(-2.,2.);
     float   kpYield =  kpFunc->Integral(-2.,2.);
     float    eYield =   eFunc->Integral(-2.,2.);
     //*/
    
    
    
    totalYieldWhole += totYield;
    pionYieldWhole += pionYield;
    kpYieldWhole += kpYield;
    electYieldWhile += eYield;
    
    
    printf("\nTotal Yield\tPion Yield\tK/p Yield\tElect Yield\n");
    printf("%e\t%e\t%e\t%e\n",totYield,pionYield,kpYield,eYield);
    printf("Pion Fraction = %e\n",(pionYield/totYield));
    
		
		totalYeild[ihist] = totYield;
		
		pionFrac[ihist]  = pionYield/totYield;
		kpFrac[ihist]    = kpYield/totYield;
		electFrac[ihist] = eYield/totYield;
		
		etastart[ihist] = -2+ihist*0.2;
		etaend[ihist] = -2+(ihist+1)*0.2;
    
		eta[ihist] = (etastart[ihist]+etaend[ihist])*.5;
		
		piYield[ihist] = pionYield;
		
		if (highestYield < pionYield){highestYield = pionYield;}
		
		
	}
	
	
	double normlzd_PiYield[20];
	
	double sumPiYield = 0;
  
	for (int i=0; i<20; i++)
	{
		if (pionFrac[i] != pionFrac[i])
		{
			cout << i << "  " << eta[i] << "  testFailed" << " highyeild " << highestYield << endl;
			pionFrac[i] = -.2;
		}
		else
		{
			cout << i << "  " << eta[i] << "  " << pionFrac[i] << " highyeild " << highestYield << endl;
			
		}
		
		normlzd_PiYield[i] = piYield[i]/highestYield; 
		
    
		sumPiYield += piYield[i];
		
	}
	
  double pionFracErr[20];
  double kpFracErr[20];
  double electFracErr[20];
  
  for (int i=0; i<20; i++)
  {
    pionFracErr[i] = sqrt((1-pionFrac[i])*pionFrac[i]/totalYeild[i]);
    kpFracErr[i] = sqrt((1-kpFrac[i])*kpFrac[i]/totalYeild[i]);
    electFracErr[i] = sqrt((1-electFrac[i])*electFrac[i]/totalYeild[i]);
    
  }  
  
  
  
	
	cout << "total Pion Yield = " << sumPiYield << endl;
	
	
	TGraphErrors* gPionYield = new TGraphErrors(20,eta,normlzd_PiYield,0,0);
	gPionYield->SetMarkerColor(kRed+2);
	gPionYield->SetMarkerStyle(24);
	
	TGraphErrors* gPionFrac = new TGraphErrors(20,eta,pionFrac,0,pionFracErr);
	TGraphErrors* gKpFrac   = new TGraphErrors(20,eta,kpFrac,0,kpFracErr);	
	TGraphErrors* gElecFrac = new TGraphErrors(20,eta,electFrac,0,electFracErr);
	
	
	
	
	gPionFrac->SetMarkerColor(kViolet+1);
  gPionFrac->SetLineColor(kViolet+1);
  gPionFrac->SetLineWidth(2);
	gKpFrac->SetMarkerColor(kGreen+2);
  gKpFrac->SetLineColor(kGreen+2);
  gKpFrac->SetLineWidth(2);
	gKpFrac->SetMarkerStyle(22);	
	gElecFrac->SetMarkerColor(kBlue);
	gElecFrac->SetLineColor(kBlue);
	gElecFrac->SetLineWidth(2);
	gElecFrac->SetMarkerStyle(20);
	
	
	TMultiGraph* multiFracs = new TMultiGraph();
	multiFracs->Add(gPionFrac);
	multiFracs->Add(gKpFrac);
	multiFracs->Add(gElecFrac);
	//multiFracs->Add(gPionYield);
  
	TCanvas* cMultiG = new TCanvas();
	multiFracs->Draw("AP");
	multiFracs->GetXaxis()->SetTitle("#eta^{#pi^{+}#pi^{-}}");
	multiFracs->GetYaxis()->SetTitle("particle Fractions");
	gPad->Modified();
	
	TLegend* leg = new TLegend(0.52,0.17,0.89,0.30);
	leg->AddEntry(gPionFrac,"Pion","P");
	leg->AddEntry(gKpFrac,"K/P","P");
	leg->AddEntry(gElecFrac,"Electron","P");
	//  leg->Draw();
	
	TCanvas* cPiYeild = new TCanvas();
	TGraphErrors* gPionYield = new TGraphErrors(20,eta,piYield,0,0);
	
	
	gPionYield->Draw("AP");
	gPionYield->SetMarkerColor(kRed+2);
	gPionYield->SetMarkerStyle(24);
	gPionYield->GetXaxis()->SetTitle("#eta^{#pi^{+}#pi^{-}}");
	gPionYield->GetYaxis()->SetTitle("Pion Yield");
	
	
	
	
	
	cout << pionYieldWhole/totalYieldWhole << endl;
	
	
	
	
	hTotal->Draw();
	
  TF1 *fitFunc = new TF1("fitFunc","gaus(0)+gaus(3)+gaus(6)",-10,10);
  TF1 *piFunc = new TF1("piFunc","gaus(0)",-10,10);
  TF1 *kpFunc = new TF1("kpFunc","gaus(0)",-10,10);
  TF1  *eFunc = new TF1( "eFunc","gaus(0)",-10,10);
  fitFunc->SetParName(0, "A_{#pi}");
  fitFunc->SetParName(1, "#LTn_{#pi}#GT");
  fitFunc->SetParName(2, "#sigma_{#pi}");
  fitFunc->SetParName(3, "A_{K/p}");
  fitFunc->SetParName(4, "#LTn_{K/p}#GT");
  fitFunc->SetParName(5, "#sigma_{K/p}");
  fitFunc->SetParName(6, "A_{e}");
  fitFunc->SetParName(7, "#LTn_{e}#GT");
  fitFunc->SetParName(8, "#sigma_{e}");
  
  fitFunc->SetParameter(0, hTotal->GetMaximum());
  fitFunc->SetParameter(1, 0.);
  fitFunc->SetParameter(2, 1.);
  
  fitFunc->SetParameter(3, 0.05*hTotal->GetMaximum());
  fitFunc->SetParameter(4,-3.);
  fitFunc->SetParameter(5, 1.5);
  
  fitFunc->SetParameter(6, 0.05*hTotal->GetMaximum());
  fitFunc->SetParameter(7, 4.); //was at 5. but it seems like 4. works better
  fitFunc->SetParameter(8, 3.);
  
	
	
	
  hTotal->Fit("fitFunc");
  
  float  ampPi = fitFunc->GetParameter(0);
  float centPi = fitFunc->GetParameter(1);
  float  sigPi = fitFunc->GetParameter(2);
  piFunc->SetParameters(ampPi,centPi,sigPi);
  piFunc->SetLineColor(kViolet+1);
  
  float  ampKP = fitFunc->GetParameter(3);
  float centKP = fitFunc->GetParameter(4);
  float  sigKP = fitFunc->GetParameter(5);
  kpFunc->SetParameters(ampKP,centKP,sigKP);
  kpFunc->SetLineColor(kGreen+2);
  
  float  ampE  = fitFunc->GetParameter(6);
  float centE  = fitFunc->GetParameter(7);
  float  sigE  = fitFunc->GetParameter(8);
  eFunc->SetParameters(ampE,centE,sigE);
  eFunc->SetLineColor(kBlue);
  
  piFunc->Draw("same");
  kpFunc->Draw("same");
  eFunc->Draw("same");
  
  TLine *l1 = new TLine( 2.5,0, 2.5,0.9*hNsigma->GetMaximum());
  TLine *l2 = new TLine(-1.0,0,-1.0,0.9*hNsigma->GetMaximum());
  l1->SetLineColor(kOrange+2);
  l2->SetLineColor(kOrange+2);
  l1->SetLineWidth(2);
  l2->SetLineWidth(2);
  
  l1->Draw();
  l2->Draw();
  
  //*
  float  totYield = fitFunc->Integral(-1.,2.5);
  float pionYield =  piFunc->Integral(-1.,2.5);
  float   kpYield =  kpFunc->Integral(-1.,2.5);
  float    eYield =   eFunc->Integral(-1.,2.5);
  
  double pionerr = sqrt((1-pionYield/totYield)*pionYield/totYield/totalYeild);

  
	cout << pionYield/totYield << " " << pionerr << endl;
	
	
	
	
	
	
	
	
	
	
	
  
  
  
  
}
void result_JES_akPu4PF_(refpt> 75 && refpt < 120)&&(abs(refeta)<2)_Centrality()
{
//=========Macro generated from canvas: Can_result_0/
//=========  (Mon Apr 18 02:39:41 2016) by ROOT version6.02/13
   TCanvas *Can_result_0 = new TCanvas("Can_result_0", "",18,40,700,500);
   gStyle->SetOptFit(1);
   Can_result_0->Range(-18.75,0.9236134,118.75,1.043845);
   Can_result_0->SetFillColor(0);
   Can_result_0->SetBorderMode(0);
   Can_result_0->SetBorderSize(2);
   Can_result_0->SetFrameBorderMode(0);
   Can_result_0->SetFrameBorderMode(0);
   
   TMultiGraph *multigraph = new TMultiGraph();
   multigraph->SetName("name");
   multigraph->SetTitle("JES_akPu4PF");
   
   Double_t Graph_fx1001[4] = {
   5,
   20,
   40,
   75};
   Double_t Graph_fy1001[4] = {
   1.025461,
   0.982262,
   0.9644553,
   0.970611};
   Double_t Graph_fex1001[4] = {
   5,
   10,
   10,
   25};
   Double_t Graph_fey1001[4] = {
   0.001598024,
   0.0009318739,
   0.0008002418,
   0.0004502591};
   TGraphErrors *gre = new TGraphErrors(4,Graph_fx1001,Graph_fy1001,Graph_fex1001,Graph_fey1001);
   gre->SetName("Graph");
   gre->SetTitle("some title_0");
   gre->SetFillColor(1);
   gre->SetFillStyle(0);
   
   TH1F *Graph_Graph1001 = new TH1F("Graph_Graph1001","some title_0",100,0,110);
   Graph_Graph1001->SetMinimum(0.9573146);
   Graph_Graph1001->SetMaximum(1.0334);
   Graph_Graph1001->SetDirectory(0);
   Graph_Graph1001->SetStats(0);

   Int_t ci;      // for color index setting
   TColor *color; // for color definition with alpha
   ci = TColor::GetColor("#000099");
   Graph_Graph1001->SetLineColor(ci);
   Graph_Graph1001->GetXaxis()->SetLabelFont(42);
   Graph_Graph1001->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph1001->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph1001->GetXaxis()->SetTitleFont(42);
   Graph_Graph1001->GetYaxis()->SetLabelFont(42);
   Graph_Graph1001->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph1001->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph1001->GetYaxis()->SetTitleFont(42);
   Graph_Graph1001->GetZaxis()->SetLabelFont(42);
   Graph_Graph1001->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph1001->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph1001->GetZaxis()->SetTitleFont(42);
   gre->SetHistogram(Graph_Graph1001);
   
   multigraph->Add(gre,"");
   
   Double_t Graph_fx1002[4] = {
   5,
   20,
   40,
   75};
   Double_t Graph_fy1002[4] = {
   1.025808,
   0.9823451,
   0.964104,
   0.9707841};
   Double_t Graph_fex1002[4] = {
   5,
   10,
   10,
   25};
   Double_t Graph_fey1002[4] = {
   0.001641175,
   0.0009556419,
   0.0008206184,
   0.000461058};
   gre = new TGraphErrors(4,Graph_fx1002,Graph_fy1002,Graph_fex1002,Graph_fey1002);
   gre->SetName("Graph");
   gre->SetTitle("some title_1");
   gre->SetFillColor(1);
   gre->SetFillStyle(0);
   gre->SetLineColor(2);
   gre->SetMarkerColor(2);
   
   TH1F *Graph_Graph1002 = new TH1F("Graph_Graph1002","some title_1",100,0,110);
   Graph_Graph1002->SetMinimum(0.9568668);
   Graph_Graph1002->SetMaximum(1.033866);
   Graph_Graph1002->SetDirectory(0);
   Graph_Graph1002->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph1002->SetLineColor(ci);
   Graph_Graph1002->GetXaxis()->SetLabelFont(42);
   Graph_Graph1002->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph1002->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph1002->GetXaxis()->SetTitleFont(42);
   Graph_Graph1002->GetYaxis()->SetLabelFont(42);
   Graph_Graph1002->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph1002->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph1002->GetYaxis()->SetTitleFont(42);
   Graph_Graph1002->GetZaxis()->SetLabelFont(42);
   Graph_Graph1002->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph1002->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph1002->GetZaxis()->SetTitleFont(42);
   gre->SetHistogram(Graph_Graph1002);
   
   multigraph->Add(gre,"");
   
   Double_t Graph_fx1003[4] = {
   5,
   20,
   40,
   75};
   Double_t Graph_fy1003[4] = {
   0.9944711,
   0.9453074,
   0.9619222,
   0.9556338};
   Double_t Graph_fex1003[4] = {
   5,
   10,
   10,
   25};
   Double_t Graph_fey1003[4] = {
   0.01053149,
   0.005298861,
   0.004412705,
   0.002663901};
   gre = new TGraphErrors(4,Graph_fx1003,Graph_fy1003,Graph_fex1003,Graph_fey1003);
   gre->SetName("Graph");
   gre->SetTitle("some title_2");
   gre->SetFillColor(1);
   gre->SetFillStyle(0);
   gre->SetLineColor(3);
   gre->SetMarkerColor(3);
   
   TH1F *Graph_Graph1003 = new TH1F("Graph_Graph1003","some title_2",100,0,110);
   Graph_Graph1003->SetMinimum(0.9335092);
   Graph_Graph1003->SetMaximum(1.011502);
   Graph_Graph1003->SetDirectory(0);
   Graph_Graph1003->SetStats(0);

   ci = TColor::GetColor("#000099");
   Graph_Graph1003->SetLineColor(ci);
   Graph_Graph1003->GetXaxis()->SetLabelFont(42);
   Graph_Graph1003->GetXaxis()->SetLabelSize(0.035);
   Graph_Graph1003->GetXaxis()->SetTitleSize(0.035);
   Graph_Graph1003->GetXaxis()->SetTitleFont(42);
   Graph_Graph1003->GetYaxis()->SetLabelFont(42);
   Graph_Graph1003->GetYaxis()->SetLabelSize(0.035);
   Graph_Graph1003->GetYaxis()->SetTitleSize(0.035);
   Graph_Graph1003->GetYaxis()->SetTitleFont(42);
   Graph_Graph1003->GetZaxis()->SetLabelFont(42);
   Graph_Graph1003->GetZaxis()->SetLabelSize(0.035);
   Graph_Graph1003->GetZaxis()->SetTitleSize(0.035);
   Graph_Graph1003->GetZaxis()->SetTitleFont(42);
   gre->SetHistogram(Graph_Graph1003);
   
   multigraph->Add(gre,"");
   multigraph->Draw("AP");
   multigraph->GetXaxis()->SetTitle("Centrality");
   multigraph->GetXaxis()->SetLabelFont(42);
   multigraph->GetXaxis()->SetLabelSize(0.035);
   multigraph->GetXaxis()->SetTitleSize(0.035);
   multigraph->GetXaxis()->SetTitleFont(42);
   multigraph->GetYaxis()->SetTitle("#mu_{Reco./Gen.}");
   multigraph->GetYaxis()->SetLabelFont(42);
   multigraph->GetYaxis()->SetLabelSize(0.035);
   multigraph->GetYaxis()->SetTitleSize(0.035);
   multigraph->GetYaxis()->SetTitleFont(42);
   
   TLegend *leg = new TLegend(0.68,0.7,0.88,0.85,NULL,"brNDC");
   leg->SetBorderSize(0);
   leg->SetLineColor(1);
   leg->SetLineStyle(1);
   leg->SetLineWidth(1);
   leg->SetFillColor(0);
   leg->SetFillStyle(1001);
   TLegendEntry *entry=leg->AddEntry("Graph","allJets","l");
   entry->SetLineColor(1);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph","lightJets","l");
   entry->SetLineColor(2);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   entry=leg->AddEntry("Graph","bJets","l");
   entry->SetLineColor(3);
   entry->SetLineStyle(1);
   entry->SetLineWidth(1);
   entry->SetMarkerColor(1);
   entry->SetMarkerStyle(21);
   entry->SetMarkerSize(1);
   entry->SetTextFont(42);
   leg->Draw();
   TLatex *   tex = new TLatex(0.25,0.7,"#bf{#color[2]{|#eta_{jet}|<2.0 &75<refpt<120}}");
tex->SetNDC();
   tex->SetTextFont(43);
   tex->SetTextSize(24);
   tex->SetLineWidth(2);
   tex->Draw();
   
   TPaveText *pt = new TPaveText(0.3750575,0.9365254,0.6249425,0.995,"blNDC");
   pt->SetName("title");
   pt->SetBorderSize(0);
   pt->SetFillColor(0);
   pt->SetFillStyle(0);
   pt->SetTextFont(42);
   AText = pt->AddText("JES_akPu4PF");
   pt->Draw();
   Can_result_0->Modified();
   Can_result_0->cd();
   Can_result_0->SetSelected(Can_result_0);
}
Exemple #25
0
void DeltaPlot::viewGMstar (Char_t const* title)
{
	FFactor GMS(12);
	GMS.LoadParameters(parametersFile);
	GMS.CheckParameters();
	//GMS.PrintParameters();

	const int nPoints = 2500;
	double qMin;
	double qMax;
	double qStep;
	double qA;

	double DX[nPoints], DY[nPoints], RY[nPoints];
	qMin = 0.004;
	qMax = 3.0;
	qStep = (qMax-qMin)/nPoints;
	qA = qMin;

	for (int i = 0; i < nPoints; i++) {
		qA = qMin + i*qStep;
		double qA2 = qA*qA;
		double gen = GMS.AbsGEN(-qA2);
		double gmn = GMS.AbsGMN(-qA2);
		double msq = massDi*massDi - massNucl*massNucl - qA2;
		double abq = sqrt((qA2 + msq*msq)/(4.*massDi*massDi));
		double jsc = (massDi+massNucl)/2./massNucl*(1.-qA2/4./massDi/massDi)*(1.-qA2/4./massNucl/massNucl);
		DX[i] = qA2;
		double mDip = 1. + qA2/0.71;
		double gD = 1./mDip/mDip;
		double gDmn = gD*(-muN);
		DY[i] = sqrt(2.)*2./3.*gDmn*jsc;
		double masst = qA2/(4.*massNucl*massNucl);
		double gmo = (GMS.ScalarOne(-qA2)-GMS.VectorOne(-qA2))/qA2+(GMS.ScalarTwo(-qA2)-GMS.VectorTwo(-qA2))/massN/massN/4.;
		RY[i] = sqrt(2.)*2./3.*gmn*jsc;
	}	
	
	c[k] = new TCanvas (uName("c",k), uName("Graph_",k), x0+k*s, y0+k*s, w, h);
	//c[k]->SetLogy(); // logarithmic scale

	TGraphErrors *g[5];
	TMultiGraph *mg = new TMultiGraph();
	Double_t EX0[100] = {0};

	// 1999-PRL-82-45_Frolov
	Double_t X1[] = {2.8, 4.0};
	Double_t Y1[] = {0.0859, 0.0402};
	Double_t U1[] = {0.0035, 0.0019};
	Double_t D1[] = {0.0035, 0.0019};
	g[1] = new TGraphErrors (2, X1, Y1, EX0, D1);
	g[1]->SetTitle("JLab/Hall C");
	g[1]->SetMarkerColor(2);
	g[1]->SetMarkerStyle(21);
	mg->Add(g[1]);

	// 2006-PRL-97-112003_Ungaro
	Double_t X2[] = {3.0, 3.5, 4.2, 5.0, 6.0};
	Double_t Y2[] = {0.0697, 0.0524, 0.0346, 0.0242, 0.0134};
	Double_t U2[] = {0.0010, 0.0011, 0.0012, 0.0014, 0.0014};
	Double_t D2[] = {0.0010, 0.0011, 0.0012, 0.0014, 0.0014};
	g[2] = new TGraphErrors (5, X2, Y2, EX0, D2);
	g[2]->SetTitle("JLaB/CLAS");
	g[2]->SetMarkerColor(4);
	g[2]->SetMarkerStyle(21);
	mg->Add(g[2]);

	// 1968-PL-28-148B_Bartel
	Double_t X3[] = {0.20, 0.30, 0.40, 0.47, 0.48, 0.50, 0.60, 0.63, 0.63, 0.77, 0.78, 0.79, 0.97, 0.98, 1.15, 1.34, 1.57, 2.34};
	Double_t Y3[] = {1.7700, 1.3800, 1.1700, 0.9780, 0.9610, 0.9640, 0.7660, 0.7350, 0.7190, 0.5700, 0.5720, 0.5530, 0.4460, 0.4460, 0.3260, 0.2690, 0.2090, 0.1020};
	Double_t U3[] = {0.0620, 0.0483, 0.0351, 0.0293, 0.0336, 0.0289, 0.0268, 0.0221, 0.0252, 0.0200, 0.0172, 0.0194, 0.0156, 0.0156, 0.0147, 0.0121, 0.0115, 0.0082};
	Double_t D3[] = {0.0620, 0.0483, 0.0351, 0.0293, 0.0336, 0.0289, 0.0268, 0.0221, 0.0252, 0.0200, 0.0172, 0.0194, 0.0156, 0.0156, 0.0147, 0.0121, 0.0115, 0.0082};
	g[3] = new TGraphErrors (18, X3, Y3, EX0, D3);
	g[3]->SetTitle("DESY");
	g[3]->SetMarkerColor(6);
	g[3]->SetMarkerStyle(22);
	mg->Add(g[3]);

	// 1975-PR-D12-1884_Stein
	Double_t X4[] = {0.09, 0.22, 0.46, 0.78, 1.17, 1.48, 1.82};
	Double_t Y4[] = {2.2448, 1.5824, 0.9147, 0.5007, 0.2708, 0.1728, 0.1122};
	Double_t U4[] = {0.0709, 0.0332, 0.0243, 0.0136, 0.0116, 0.0095, 0.0064};
	Double_t D4[] = {0.0709, 0.0332, 0.0243, 0.0136, 0.0116, 0.0095, 0.0064};
	g[4] = new TGraphErrors (7, X4, Y4, EX0, D4);
	g[4]->SetTitle("SLAC");
	g[4]->SetMarkerColor(4);
	g[4]->SetMarkerStyle(23);
	mg->Add(g[4]);

	for (int i=0; i<4; ++i)
	{
		g[i+1]->SetFillColor(0);
		//g[i+1]->SetLineColor(4);
		g[i+1]->SetMarkerSize(1.2);
	}

	// Formula D
	TGraph *gD = new TGraph (nPoints, DX, DY);
	gD->SetTitle("Dipole formulae");
	gD->SetFillColor(0);
	gD->SetLineWidth(3);
	gD->SetMarkerSize(0.3);
	gD->SetMarkerStyle(21);
	gD->SetMarkerColor(4);
	gD->SetLineColor(4);
	mg->Add(gD);
	
	// Formula A
	TGraph *gA = new TGraph (nPoints, DX, RY);
	gA->SetTitle("Our result");
	gA->SetFillColor(0);
	gA->SetLineWidth(3);
	gA->SetMarkerSize(0.3);
	gA->SetMarkerStyle(21);
	//gA->SetLineColor(3);
	mg->Add(gA);

	mg->Draw("AP");

	//TF1 *fg = new TF1 ("fg", "[1]*x + [0]");
	//mg->Fit("poly5","Fit"); // fg

	TAxis *aX = mg->GetXaxis();
	aX->SetTitle("Q^{2} [GeV^{2}]");
	//aX->SetLimits(0.,10.);
	aX->SetRangeUser(-0.01,7.0);
	aX->SetTitleOffset(1.2);
	aX->CenterTitle();

	TAxis *aY = mg->GetYaxis();
	aY->SetTitle("G_{M}^{*}");
	//aY->SetRangeUser(0.6,1.8);
	aY->SetTitleOffset(1.2);
	aY->CenterTitle();

	gPad->SetFillColor(kWhite);
	
	TLegend *leg = c[k]->BuildLegend();
	leg->SetFillStyle(0);

	c[k]->Modified();

	c[k]->SaveAs("imgGMstar.pdf");
	
	++k;	
}
// =================================================
void plotter::plotEffOnOneCanvas( string extension )
{
	yAxisLabel_ = "Efficiency";
	xAxisLabel_ = "Electron p_{T} (GeV)";
	
	x_[6] = 125;
	xRange_[6] = 75;
	
	setExtension( extension );
   setOutFilexPrefix( "eff" );
	setUpCanvas();
	
	TMultiGraph *mg = new TMultiGraph();
	
   for( int j = 0; j < max_-1; j++)
	{
		// Read Data input
      input.readDataEff( inputDataPath_, files1_.at(j) );
		eff1_ = input.getDataEff().first;
		eff_error1_ = input.getDataEff().second;
		
      TGraphAsymmErrors *tgaeEffData = new TGraphAsymmErrors( numOfPoints_, x_, eff1_, xRange_, xRange_, eff_error1_, eff_error1_);
      tgaeEffData->SetTitle("TGraphAsymmErrors for Data efficiencies");
      tgaeEffData->SetMarkerSize(1);
      if (j == 0) tgaeEffData->SetMarkerStyle(20);
		else if (j == 1) tgaeEffData->SetMarkerStyle(24);
      else if (j == 2) tgaeEffData->SetMarkerStyle(21);
      else tgaeEffData->SetMarkerStyle(25);
		
		tgaeEffData->SetMarkerColor(kAzure - 2*j);
      tgaeEffData->SetLineColor(kAzure - 2*j);
		
		legend_->SetX1(.60);
		legend_->SetX2(.87);
		legend_->AddEntry(tgaeEffData, etaRegionLegend_.at(j), "p");
		
		mg->Add(tgaeEffData,"p");
   } // end for j
	
	canvas->SetLogx();
	
	mg->SetMinimum(0.4);
	mg->SetMaximum(1);
	mg->Draw("A");
	mg->GetXaxis()->SetMoreLogLabels();
	mg->GetXaxis()->SetTitle( xAxisLabel_ );
   mg->GetYaxis()->SetTitle( yAxisLabel_ );
	mg->GetXaxis()->SetTitleOffset(1.3);
	mg->GetYaxis()->SetTitleOffset(1.25);
	
	legend_->Draw();
	pt_->Draw();
	texZee_->Draw();
//	texCMS_->Draw();
//	texLumi_->Draw();
	
	cout << "--------------------------------------------------------------------------------" << endl;
	TString fileName = "eff_04";
	if ( extension_ == "all" )
	{
		canvas->SaveAs( outPlotsDir_ + fileName + ".pdf" );
		canvas->SaveAs( outPlotsDir_ + fileName + ".png" );
		canvas->SaveAs( outPlotsDir_ + fileName + ".eps" );
//		canvas->SaveAs( outPlotsDir_ + fileName + ".ps"  );
		canvas->SaveAs( outPlotsDir_ + fileName + ".C"   );
		canvas->SaveAs( outPlotsDir_ + fileName + ".root");
	}
	else
		canvas->SaveAs( outPlotsDir_ + fileName + extension_ );
	cout << "--------------------------------------------------------------------------------" << endl;
	
	canvas->Destructor();
	legend_->Clear();
	
	// Clear out files vector
   outFiles_.clear();
	
} // end plotEffOnOneCanvas
void long_Ay_nu_05() {
  gROOT->SetStyle("HALLA");
  TCanvas *cn = new TCanvas("cn","cn",540,360);
  cn->Draw();
  cn->UseCurrentStyle();
  TH1F *frm = new TH1F("frm","",100,0.,10.);
  frm->GetXaxis()->SetTitle("#nu (GeV)");
  frm->GetYaxis()->SetTitle("Ay for Q2=0.456 (GeV/c)2");
  frm->SetMinimum(0);
//  frm->SetMinimum(0);
//  frm->SetMaximum(1.0);
  frm->SetMaximum(0.35);
  frm->UseCurrentStyle();
  frm->Draw();
  frm->SetAxisRange(0.120,0.350,"X");
//  frm->SetAxisRange(0.5,1.1,"X");

//  TF1* galster = new TF1("galster","x/(4.*0.938*.938)*1.91/(1.+x/.71)^2/(1.+5.6*x/(4.*.938*.938))",0.,4.);
//  galster->SetLineColor(6);
//  galster->SetLineStyle(3);
//  galster->SetLineWidth(2);


  TF1 *genf = new TF1("genf",genff,1.,10.,1);
  genf->SetLineColor(2);
  genf->SetLineStyle(2);
  genf->SetParameter(0,1.);
  // match to Madey point just below 1.5
  // genf->SetParameter(0,.0411/genf->Eval(1.45));
  genf->SetParameter(0,-0.558645);

//  TF1 *bbba05 = new TF1("BBBA05",gen_bbba05,0.,10.,0);
//  bbba05->SetLineColor(7);
//  bbba05->SetLineStyle(3);

  
  TMultiGraph* mgrDta = new TMultiGraph("Data","G_{E}^{n}");
  TLegend *legDta = new TLegend(.54,.6,.875,.90,"","brNDC");

  TMultiGraph* wgr = mgrDta;
  TLegend *wlg = legDta;

   // the data
  legDta->SetBorderSize(0); // turn off border
  legDta->SetFillStyle(0);
  
  datafile_t *f = datafiles;
  TGraph* gr=0;
  while ( f && f->filename ) {
    gr=OneGraph(f);
    if (gr) {
      if (f->lnpt) {
	mgrDta->Add(gr,f->lnpt);
	legDta->AddEntry(gr,f->label,f->lnpt);
      }
      else if (gr->GetMarkerStyle()>=20) {
	mgrDta->Add(gr,"p");
	legDta->AddEntry(gr,f->label,"p");
      }	
      else {
	mgrDta->Add(gr,"l");
	legDta->AddEntry(gr,f->label,"l");
      }
    }
    f++;
  }
    

  mgrDta->Draw("p");
//  legDta->Draw();
  TF1 *theFit = new TF1("theFit","pol0");
  gr->Fit(theFit);
  theFit->Draw("same");  
  TMultiGraph* mgrThry = new TMultiGraph("Theory","G_{E}^{n}");
  TLegend *legThry = new TLegend(.54,.3,.875,.6,"","brNDC");

  wgr = mgrThry;
  wlg = legThry;

  // the theory
  wlg->SetBorderSize(0); // turn off border
  wlg->SetFillStyle(0);
  
  f = theoryfiles1;
  gr=0;
  while ( f && f->filename ) {
    gr=OneGraph(f);
    if (gr) {
      TGraphAsymmErrors *egr = dynamic_cast<TGraphAsymmErrors*>(gr);
      if (egr && egr->GetN()>1 && egr->GetEYhigh() && egr->GetEYhigh()[1]>0) {
	gr = toerror_band(egr);
	gr->SetFillStyle(3000+f->style);
      }
      if (f->lnpt) {
	wgr->Add(gr,f->lnpt);
	wlg->AddEntry(gr,f->label,f->lnpt);
      }
      else if (gr->GetMarkerStyle()>=20) {
	wgr->Add(gr,"p");
	wlg->AddEntry(gr,f->label,"p");
      }	
      else {
	wgr->Add(gr,"l");
	wlg->AddEntry(gr,f->label,"l");
      }
    }
    f++;
  }

//  genf->Draw("same");
  mgrThry->Draw("c");
//  galster->Draw("same");
//  bbba05->Draw("same");
//  legThry->AddEntry(genf,"F_{2}/F_{1} #propto ln^{2}(Q^{2}/#Lambda^{2})/Q^{2}","l");
//  legThry->AddEntry(galster,"Galster fit","l");
//  legThry->AddEntry(bbba05,"BBBA05","l");
//  legThry->Draw();
//  legDta->Draw();
  
  // draw a line at 1
  cn->Modified();

  cn->Update();
  cn->SaveAs(Form("%s.eps",psfile));
  cn->SaveAs(Form("%s.root",psfile));
  gSystem->Exec(Form("./replace_symbols.pl %s.eps",psfile));

  return;  // LEAVING HERE

  // now an overlay, hopefully matching dimensions

  // remove everything but the graph
  cn->Update();
  TList *clist = cn->GetListOfPrimitives();
  TFrame* frame = cn->GetFrame();
  for (int i=0; i<clist->GetSize(); ) {
    if (clist->At(i) != frame) {
      clist->RemoveAt(i);
    } else i++;
  }
  // draw markers in the corners
  TMarker *mkr = new TMarker(frame->GetX1(),frame->GetY1(),2);
  mkr->Draw();
  mkr = new TMarker(frame->GetX2(),frame->GetY1(),2);
  mkr->Draw();
  mkr = new TMarker(frame->GetX1(),frame->GetY2(),2);
  mkr->Draw();
  mkr = new TMarker(frame->GetX2(),frame->GetY2(),2);
  mkr->Draw();
  frame->SetLineColor(10);
  cn->Update();

  datafile_t miller = { "figure_input/Miller/lattice.GEn.rtf","Miller",
			"[0]","[1]","[1]-[3]","[2]-[1]",0,0,1,3,"F" };

  gr = OneGraph(&miller);
  TGraphAsymmErrors* egr = dynamic_cast<TGraphAsymmErrors*>(gr);
  if (egr && egr->GetEYhigh() && egr->GetEYhigh()[egr->GetN()/2]>0) {
    gr = toerror_band(egr);
    gr->SetLineStyle(1);
    gr->SetFillColor(gr->GetLineColor());
    gr->SetFillStyle(3000+miller.style);
  }
  
  gr->Draw("F");

  cn->Update();
  cn->SaveAs("gen_Miller_Overlay.eps");
  cn->SaveAs("gen_Miller_Overlay.root");
  
}
Exemple #28
0
void Eff_Doping(){		// name of file

using namespace std;

double bias=30;
int i=0;			// used to name the TGraphs

TCanvas *c1 = new TCanvas("c1","c1",600,400);
TPad *pad1 = new TPad("pad1","",0,0,1,1);
TLegend *leg = new TLegend(.80,.70,.85,.87);

TGraph *gr[4];			// defines array to number of TGraphs

TMultiGraph *mg = new TMultiGraph();		// create multigraph

for (double fluence=13;fluence<=15;fluence+=1){		// loop to create multigraph for select bias values

	TString str =TString::Format("/afs/cern.ch/work/m/mbucklan/TCAD/SimpleCMOS/DepletionSimRemesh_3pixels_Rad/Neffextraction_3pixel_yCut_bias=%.1f_pitch=15.0_Fluence=1e+%.0f.txt",bias,fluence);		// does some magic, creates string with name of file
		
	if (i==4){
	
	i++;
	
	}

	gr[i] = new TGraph(str,"%lg %lg");		// creates graph called gr and reads file
	
	
	TString str1 =TString::Format("1e%.0f n_{eq} cm^{-2}",fluence);		// creates string with bias value
	
	gr[i]->SetTitle(str1);			// sets title to string
	gr[i]->SetLineColor(i+1);		// sets line colour, changes for each graph
	
	mg->Add(gr[i]);				// adds graph to multigraph
	leg->AddEntry(gr[i],str1,"l");
	
	i++;
	
}
	
pad1->Draw();
pad1->cd();
pad1->SetTickx(1);		//draws ticks on top side x axis
pad1->SetTicky(1);		//draws ticks on right hand side y axis

gPad->Update();
	
mg->Draw("AL");		// draws multigraph

// Make the graph look fancy...ish
mg->GetXaxis()->SetTitle("Depth (#mum)");
mg->GetYaxis()->SetTitle("Effective Doping Concentration (cm^{-3})");

TString str2 =TString::Format("Effective Doping Concentration for 3 Pixel 100#mum Thick Sensor at %.0fV, Resistivity=100#Omegacm",bias);		// does some magic, creates string with name of file

mg->GetHistogram()->SetTitle(str2);

mg->SetMinimum(-2e12);

leg->SetTextSize(0.03);
leg->Draw();

}
Exemple #29
0
void start(const char *basename, const double offset = 0.0)
{

  TFile *file1 = TFile::Open(Form("Data/ROOT/%s_VMIN_SIPM1_meanHistSub_projections.root",basename));
  TFile *file2 = TFile::Open(Form("Data/ROOT/%s_VMIN_SIPM2_meanHistSub_projections.root",basename));

  if(file1==NULL) {cout<<"cannot find file1"<<endl;return;}
  if(file2==NULL) {cout<<"cannot find file2"<<endl;return;}

  calc(file1,file2,basename,0);
  calc(file1,file2,basename,1);
  calc(file1,file2,basename,2);
  calc(file1,file2,basename,3);
  calc(file1,file2,basename,4);
  calc(file1,file2,basename,5);
  calc(file1,file2,basename,6);
  calc(file1,file2,basename,7);
  calc(file1,file2,basename,8);

  ofstream fout(Form("Data/Text/%s_Asymmetries.txt"));
  double pn[9];
  for(int i=0; i<9; i++)
    {
      fout<<frac1[i]<<" "
	  <<frac2[i]<<" "
	  <<fracAv[i]<<" "
	  <<fracAs[i]<<" "
	  <<endl;
      //pn[i] = i+0.5; // projection number
      pn[i] = -2.0 + i/2.0; // distance
      pn[i] += offset;
    }

  TGraph *tg1 = new TGraph(9,pn,frac1);
  TGraph *tg2 = new TGraph(9,pn,frac2);
  TGraph *tgAv = new TGraph(9,pn,fracAv);
  TGraph *tgAs = new TGraph(9,pn,fracAs);
  tg1->SetMarkerStyle(kFullCircle);
  tg2->SetMarkerStyle(kFullCircle);
  tgAv->SetMarkerStyle(kOpenCircle);
  tgAs->SetMarkerStyle(kFullSquare);
  tg1->SetMarkerColor(kBlue);
  tg2->SetMarkerColor(kRed);
  tgAv->SetMarkerColor(kBlack);
  tgAs->SetMarkerColor(kBlack);
  TMultiGraph *tmg = new TMultiGraph();
  tmg->Add(tgAs);
  tmg->Add(tg1);
  tmg->Add(tg2);
  tmg->Add(tgAv);
  tmg->Draw("ap");
  tmg->SetMaximum(1.0);
  tmg->SetMinimum(0.0);
  tmg->GetXaxis()->SetLimits(-2.25+offset,2.25+offset);
  //tmg->GetXaxis()->SetLimits(0.0,9.0); // projection number
  tmg->GetXaxis()->SetTitle("Distance from fiber (cm)");
  tmg->GetYaxis()->SetTitle("f_{core} from different methods");
  TLegend *leg1 = new TLegend(0.18,0.18,0.28,0.38);
  leg1->AddEntry(tg1,"SiPM1","p");
  leg1->AddEntry(tg2,"SiPM2","p");
  leg1->AddEntry(tgAv,"Average SiPM1+SiPM2","p");
  leg1->AddEntry(tgAs,"Asymmetry","p");
  leg1->SetFillStyle(0);
  leg1->SetTextSize(0.05);
  leg1->Draw();

  c1->Print(Form("Figures/%s_AsymmetryComparison.png",basename));
  c1->Print(Form("Figures/%s_AsymmetryComparison.pdf",basename));

}
Exemple #30
0
void IsovsPt(){


  TFile *f1 = new TFile("../../CutTMVATrees_Barrel.root");
 
  float ppt,peta,Sie_ie,iso_P,iso_C,iso_N,to_e,weight;
  int nvtx;

  gStyle->SetOptStat(0);



  //Signal Tree
  t_S->SetBranchAddress("Sieie",&Sie_ie);
  t_S->SetBranchAddress("isoP",&iso_P);
  t_S->SetBranchAddress("isoC",&iso_C);
  t_S->SetBranchAddress("isoN",&iso_N);
  t_S->SetBranchAddress("ToE",&to_e);
  t_S->SetBranchAddress("weighT",&weight);
  t_S->SetBranchAddress("Nvtx",&nvtx);
  t_S->SetBranchAddress("Peta",&peta);
  t_S->SetBranchAddress("Ppt",&ppt);

  //Background Tree
  t_B->SetBranchAddress("Sieie",&Sie_ie);
  t_B->SetBranchAddress("isoP",&iso_P);
  t_B->SetBranchAddress("isoC",&iso_C);
  t_B->SetBranchAddress("isoN",&iso_N);
  t_B->SetBranchAddress("ToE",&to_e);
  t_B->SetBranchAddress("weighT",&weight);
  t_B->SetBranchAddress("Nvtx",&nvtx);
  t_B->SetBranchAddress("Peta",&peta);
  t_B->SetBranchAddress("Ppt",&ppt);



  TH2F *isoCptS = new TH2F("isoCptS","Iso Charge vs Pt",100,0,200,3000,0,30);
  TH2F *isoNptS = new TH2F("isoNptS","Iso Neutral vs Pt",100,0,200,3000,0,30);
  TH2F *isoPptS = new TH2F("isoPptS","Iso Photon vs Pt",100,0,200,3000,0,30);




  for(int i  = 0; i < t_S->GetEntries();i++){

    t_S->GetEntry(i);

 
    isoCptS->Fill(ppt,iso_C);
 
    if(to_e < 0.05){
      
      isoNptS->Fill(ppt,iso_N);

    }

    isoPptS->Fill(ppt,iso_P);
  }




  // Now that we have the Iso vs pt histograms lets see the efficiency in pt bins

  double BinCch [100][3000] = {0};
  double BinCph [100][3000] = {0};
  double BinCh  [100][3000] = {0};
 
  double ptX[100] ={0};

  

  cout<<"here"<<endl;

  for(int j  = 0 ; j < 100 ; j++){
  
    double ptx = 200.0*j/100 + 1.0; 
    ptX[j] = ptx; 

    for(int i  = 0; i < 3000 ; i++){
      double isocx = 30.0*i/3000 + 0.005; 
      double isopx = 30.0*i/3000 + 0.005; 
      double isonx = 30.0*i/3000 + 0.005; 
      
      int bin =  isoCptS->FindBin(ptx,isocx);    
      BinCch[j][i] = isoCptS->GetBinContent(bin);

      bin =  isoPptS->FindBin(ptx,isopx);    
      BinCph[j][i] = isoPptS->GetBinContent(bin);

      bin =  isoNptS->FindBin(ptx,isonx);    
      BinCh[j][i] = isoNptS->GetBinContent(bin);

    
    
    }

  } 




  double ch_95[100] = {0};
  double ch_90[100] = {0}; 
  double ch_80[100] = {0}; 
  double ch_70[100] = {0}; 
  
  

  double ph_95[100] = {0};
  double ph_90[100] = {0}; 
  double ph_80[100] = {0}; 
  double ph_70[100] = {0}; 
  
  double ne_95[100] = {0};
  double ne_90[100] = {0}; 
  double ne_80[100] = {0}; 
  double ne_70[100] = {0}; 
  
  double ch_95e[100] = {0};
  double ch_90e[100] = {0}; 
  double ch_80e[100] = {0}; 
  double ch_70e[100] = {0}; 
  
  double ph_95e[100] = {0}; 
  double ph_90e[100] = {0}; 
  double ph_80e[100] = {0}; 
  double ph_70e[100] = {0}; 
  
  double ne_95e[100] = {0};
  double ne_90e[100] = {0}; 
  double ne_80e[100] = {0}; 
  double ne_70e[100] = {0}; 



  
  for(int j = 0 ; j  < 100; j ++){
    
    double totC = 0;
    double totN = 0;
    double totP = 0;
    
    for(int i = 0; i < 3000; i++) totC = totC + BinCch[j][i];
    for(int i = 0; i < 3000; i++) totN = totN + BinCh[j][i]; 
    for(int i = 0; i < 3000; i++) totP = totP + BinCph[j][i]; 

    double entrC = 0;
    double entrP = 0;
    double entrN = 0;
    
    int passc95 = 0; 
    int passc9 = 0;
    int passc8 = 0;
    int passc7 = 0;

    int passp95 = 0; 
    int passp9 = 0;
    int passp8 = 0;
    int passp7 = 0;

    int passn95 = 0; 
    int passn9 = 0;
    int passn8 = 0;
    int passn7 = 0; 

    for(int i  = 0; i < 3000 ; i++){
      
      entrC = entrC + BinCch[j][i];
      entrP = entrP + BinCph[j][i];
      entrN = entrN + BinCh[j][i];

      //------- photon
      if(passp95 == 0 && entrP*1.0/totP  > 0.95){
	
	double num = sqrt(entrP);
	double den = sqrt(totP);

	ph_95e[j] = 0.95*sqrt(pow(num/totP,2) + pow(den/entrP,2) );



	ph_95[j] = i*0.01;
	passp95= 1; 
      }

      


      if(passp9 == 0 && entrP*1.0/totP  > 0.90){
	
	double num = sqrt(entrP);
	double den = sqrt(totP);

	ph_90e[j] = 0.9*sqrt(pow(num/totP,2) + pow(den/entrP,2) );



	ph_90[j] = i*0.01;
	passp9 = 1; 
      }
      if(passp8 == 0 && entrP*1.0/totP  > 0.80){

	
	double num = sqrt(entrP);
	double den = sqrt(totP);

	ph_80e[j] = 0.8*sqrt(pow(num/totP,2) + pow(den/entrP,2) );

	
	ph_80[j] = i*0.01;
	passp8 = 1; 
      }
      if(passp7 == 0 && entrP*1.0/totP  > 0.70){

	
	double num = sqrt(entrP);
	double den = sqrt(totP);

	ph_70e[j] = 0.7*sqrt(pow(num/totP,2) + pow(den/entrP,2) );



	ph_70[j] = i*0.01;
	passp7 = 1; 
      }


      //--------- charge
      if(passc95 == 0 && entrC*1.0/totC  > 0.95){
	
	double num = sqrt(entrC);
	double den = sqrt(totC);

	ch_95e[j] = 0.95*sqrt(pow(num/totC,2) + pow(den/entrC,2) );



	ch_95[j] = i*0.01;
	passc95= 1; 
      }
      

      if(passc9 == 0 && entrC*1.0/totC  > 0.90){

	double num = sqrt(entrC);
	double den = sqrt(totC);

	ch_90e[j] = 0.9*sqrt(pow(num/totC,2) + pow(den/entrC,2) );

	ch_90[j] = i*0.01;
	passc9 = 1; 
      }
      if(passc8 == 0 && entrC*1.0/totC  > 0.80){

	double num = sqrt(entrC);
	double den = sqrt(totC);

	ch_80e[j] = 0.8*sqrt(pow(num/totC,2) + pow(den/entrC,2) );

	ch_80[j] = i*0.01;
	passc8 = 1; 
      }
      if(passc7 == 0 && entrC*1.0/totC  > 0.70){
	
	double num = sqrt(entrC);
	double den = sqrt(totC);

	ch_70e[j] = 0.7*sqrt(pow(num/totC,2) + pow(den/entrC,2) );

	ch_70[j] = i*0.01;
	passc7 = 1; 
      }

      
      //--------- neutral
      if(passn95 == 0 && entrN*1.0/totN  > 0.95){
	
	double num = sqrt(entrN);
	double den = sqrt(totN);

	ne_95e[j] = 0.95*sqrt(pow(num/totN,2) + pow(den/entrN,2) );



	ne_95[j] = i*0.01;
	passn95= 1; 
      }
    






      if(passn9 == 0 && entrN*1.0/totN  > 0.90){

	
	double num = sqrt(entrN);
	double den = sqrt(totN);

	ne_90e[j] = 0.9*sqrt(pow(num/totN,2) + pow(den/entrN,2) );



	ne_90[j] = i*0.01;
	passn9 = 1; 
      }
      if(passn8 == 0 && entrN*1.0/totN  > 0.80){

	
	double num = sqrt(entrN);
	double den = sqrt(totN);

	ne_80e[j] = 0.8*sqrt(pow(num/totN,2) + pow(den/entrN,2) );


	ne_80[j] = i*0.01; 
	passn8 = 1; 
      }
      if(passn7 == 0 && entrN*1.0/totN  > 0.70){

	
	double num = sqrt(entrN);
	double den = sqrt(totN);

	ne_70e[j] = 0.7*sqrt(pow(num/totN,2) + pow(den/entrN,2) );


	ne_70[j] = i*0.01;
	passn7 = 1; 
      }


    }
    
  }
  

  double ptXe[100] = {2};
  
  TGraph *p95 = new TGraphErrors(100,ptX,ph_95,ptXe,ph_95e);
  TGraph *p9 = new TGraphErrors(100,ptX,ph_90,ptXe,ph_90e);
  TGraph *p8 = new TGraphErrors(100,ptX,ph_80,ptXe,ph_80e);
  TGraph *p7 = new TGraphErrors(100,ptX,ph_70,ptXe,ph_70e);

  p95->SetMarkerColor(kMagenta);
  p9->SetMarkerColor(kRed);
  p8->SetMarkerColor(kOrange);
  p7->SetMarkerColor(kYellow);
 

  p95->SetMarkerSize(kMagenta);
  p9->SetMarkerSize(1);
  p8->SetMarkerSize(1);
  p7->SetMarkerSize(1);

  
  p95->SetLineColor(kMagenta);
  p9->SetLineColor(kRed);
  p8->SetLineColor(kOrange);
  p7->SetLineColor(kYellow);






  TGraph *n95 = new TGraphErrors(100,ptX,ne_95,ptXe,ne_95e);
  TGraph *n9 = new TGraphErrors(100,ptX,ne_90,ptXe,ne_90e);
  TGraph *n8 = new TGraphErrors(100,ptX,ne_80,ptXe,ne_80e);
  TGraph *n7 = new TGraphErrors(100,ptX,ne_70,ptXe,ne_70e);

  n95->SetMarkerColor(kMagenta);
  n9->SetMarkerColor(kRed);
  n8->SetMarkerColor(kOrange);
  n7->SetMarkerColor(kYellow);

  n95->SetMarkerSize(kMagenta);
  n9->SetMarkerSize(1);
  n8->SetMarkerSize(1);
  n7->SetMarkerSize(1);

  n95->SetLineColor(kMagenta);
  n9->SetLineColor(kRed);
  n8->SetLineColor(kOrange);
  n7->SetLineColor(kYellow);




  TGraph *c95 = new TGraphErrors(100,ptX,ch_95,ptXe,ch_95e);
  TGraph *c9 = new TGraphErrors(100,ptX,ch_90,ptXe,ch_90e);
  TGraph *c8 = new TGraphErrors(100,ptX,ch_80,ptXe,ch_80e);
  TGraph *c7 = new TGraphErrors(100,ptX,ch_70,ptXe,ch_70e);

  c95->SetMarkerColor(kMagenta); 
  c9->SetMarkerColor(kRed);
  c8->SetMarkerColor(kOrange);
  c7->SetMarkerColor(kYellow);


  c95->SetLineColor(kMagenta); 
  c9->SetLineColor(kRed);
  c8->SetLineColor(kOrange);
  c7->SetLineColor(kYellow);



  c95->SetMarkerSize(1);
  c9->SetMarkerSize(1);
  c8->SetMarkerSize(1);
  c7->SetMarkerSize(1);




  TMultiGraph *PhoIso = new TMultiGraph();
  TMultiGraph *ChgIso = new TMultiGraph();
  TMultiGraph *NeuIso = new TMultiGraph();


  PhoIso->Add(p95,"p");
  PhoIso->Add(p9,"p");
  PhoIso->Add(p7,"p");
  PhoIso->Add(p8,"p");


  ChgIso->Add(c95,"p");
  ChgIso->Add(c9,"p");
  ChgIso->Add(c7,"p");
  ChgIso->Add(c8,"p");

  NeuIso->Add(n95,"p");
  NeuIso->Add(n9,"p");
  NeuIso->Add(n7,"p");
  NeuIso->Add(n8,"p");

  



  TCanvas *c1 = new TCanvas("c1","Iso P vs Pt",1000,500);
  c1->Divide(2,1); 

  c1->cd(1);
  PhoIso->Draw("AP");
  PhoIso->GetXaxis()->SetTitle("Pt GeVc^{-1}");
  PhoIso->GetYaxis()->SetTitle("Isolation PF:gamma");
  

  
  c1->cd(2)->SetLogz();
  
  isoPptS->Draw("colz");  
  isoPptS->GetXaxis()->SetTitle("Pt GeVc^{-1}");
  isoPptS->GetYaxis()->SetTitle("Isolation PF:gamma");

  c1->SaveAs("PhotonIso_95.png");


  TCanvas *c2 = new TCanvas("c2","Iso C vs Pt",1000,500);
  c2->Divide(2,1);
  c2->cd(1);
  ChgIso->Draw("AP");
  ChgIso->GetXaxis()->SetTitle("Pt GeVc^{-1}");
  ChgIso->GetYaxis()->SetTitle("Isolation PF:ch hadrons");
  

  c2->cd(2)->SetLogz();
  
  isoCptS->Draw("colz");  
  isoCptS->GetXaxis()->SetTitle("Pt GeVc^{-1}");
  isoCptS->GetYaxis()->SetTitle("Isolation PF:ch hadrons");


  c2->SaveAs("ChargeIso_95.png");
  
  TCanvas *c3 = new TCanvas("c3","Iso N vs Pt",1000,500);
  c3->Divide(2,1);
  c3->cd(1);
  NeuIso->Draw("AP");
  NeuIso->GetXaxis()->SetTitle("Pt GeVc^{-1}");
  NeuIso->GetYaxis()->SetTitle("Isolation PF:h0");
  

  c3->cd(2)->SetLogz();
  
  isoNptS->Draw("colz");  
  isoNptS->GetXaxis()->SetTitle("Pt GeVc^{-1}");
  isoNptS->GetYaxis()->SetTitle("Isolation PF:h0");


  c3->SaveAs("NeutralIso_95_HoEcut.png");

  c1->Update();
  c2->Update();
  c3->Update();

}