当前位置: 首页>>代码示例>>C++>>正文


C++ TGraph::SetMaximum方法代码示例

本文整理汇总了C++中TGraph::SetMaximum方法的典型用法代码示例。如果您正苦于以下问题:C++ TGraph::SetMaximum方法的具体用法?C++ TGraph::SetMaximum怎么用?C++ TGraph::SetMaximum使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在TGraph的用法示例。


在下文中一共展示了TGraph::SetMaximum方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: title

//Return a graph of the llscan
TGraph * LLscanResult::GetGraph() 
{
	double*  pvs = new double[parameterValues.size()] ;
	double* llvs = new double[parameterValues.size()] ;
	double llmax = 0 ;	
	for(unsigned int i=0; i< parameterValues.size() ; ++i ){
		pvs[i] = parameterValues[i] ;
		llvs[i] = llvalues_offset[i] ;
		if( llvs[i] > llmax ) llmax = llvs[i] ;
	}	

	TGraph* gr = new TGraph( Int_t(parameterValues.size()), pvs, llvs ) ;
	//gr->SetTitle("LL Scan for Parameter xxx");	
	gr->SetMarkerStyle(1);
	gr->SetLineWidth(2);
	gr->SetMarkerColor(4);
	gr->SetLineColor(4);
	gr->GetYaxis()->SetRangeUser( 0., llmax*1.2 );
	gr->GetYaxis()->SetLimits( 0., llmax*1.2 );
	gr->SetMinimum( 0.0 );
	gr->SetMaximum( llmax*1.2 );
	gr->Draw("ALP");
	string title("LL Scan for Parameter ") ;
	title+=parameterName.c_str();
	gr->SetTitle(title.c_str());	
	gr->GetXaxis()->SetTitle(parameterName.c_str());

	return gr ;
}
开发者ID:abmorris,项目名称:RapidFit,代码行数:30,代码来源:LLscanResult.cpp

示例2: histos_pde_two

void histos_pde_two(){
	std::string material[3] = {"lxe","lxe_tpb","lyso"};
	std::string interaction[3] = {"","_noCher","_noScint"};

	double sigmas[3][3][20]; // [mat][inter][pde]
	double pdeValues[20];
	char pde[5];

	TCanvas *c1 = new TCanvas("c1","multipads",900,700);


	for(int mat=0; mat<3;mat++){
		for(int inter=0; inter<2;inter++){
			for(int i=5;i<=100;i+=5){
				pdeValues[i/5-1] = i;

				//There is an error with lsyo noScint pde 0.05
				if((mat==2 && inter==2) && i==5)){
					continue;
				}

				sprintf(pde, "%.2lf", i/100.0);
				if(i==100){
					sprintf(pde, "0%.2lf", i/100.0);
				}

				std::string path = "/home/jmbenlloch/next/petalo/work/histo/pde/";
				std::string fileName = path + material[mat] + interaction[inter] + std::string("_PHYS_QE_") + std::string(pde) + std::string("_SPTR_0_ASIC_0_DT300_histos.root"); std::string(Form("%d", 1));
				std::cout << fileName << std::endl;

				TFile *fIn = new TFile(fileName.c_str(), "read");

				TH1F *h1 = (TH1F*) fIn->Get("DTOF.DTOF3");
				TF1* gauF1 = new TF1("gauF1","gaus",-20,20);
				TF1* gauF2 = new TF1("gauF2","gaus",-60,60);

				TF1 *total = new TF1("total","gaus(0)+gaus(3)",-50,50);

				h1->Scale(1/h1->Integral(), "width");

				Double_t par[6];
				h1->Fit(gauF1,"R");
				h1->Fit(gauF2,"R+");
				//Do not plot
				h1->GetFunction("gauF1")->SetBit(TF1::kNotDraw);
				h1->GetFunction("gauF2")->SetBit(TF1::kNotDraw);
				gauF1->GetParameters(&par[0]);
				gauF2->GetParameters(&par[3]);
				total->SetParameters(par);
				h1->Fit(total,"R+");
				h1->Draw();

				std::string histo = path + material[mat] + interaction[inter] + std::string("_pde_") + pde + std::string(".png");
				std::cout << histo << std::endl;
				c1->Print(histo.c_str());

				std::cout << "PDE: " << pde << "sigma: "  << h1->GetFunction("gauF1")->GetParameter(2) << std::endl;
				sigmas[mat][inter][i/5-1] = h1->GetFunction("gauF1")->GetParameter(2);

				fIn->Close();
			}
		}
	}
	c1->Close();

	TCanvas *c2 = new TCanvas("c2","multipads",900,700);
	TGraph *gLxe = new TGraph(20, pdeValues, sigmas[0][0]);
	gLxe->SetLineColor(kRed);
	gLxe->SetLineWidth(2);

	TGraph *gTpb = new TGraph(20, pdeValues, sigmas[1][0]);
	gTpb->SetLineColor(kBlue);
	gTpb->SetLineWidth(2);

	TGraph *gLyso = new TGraph(20, pdeValues, sigmas[2][0]);
	gLyso->SetLineColor(kGreen);
	gLyso->SetLineWidth(2);

	gLyso->Draw();
	gLyso->SetTitle("");
	gLyso->GetXaxis().SetTitle("PDE (%)");
	gLyso->GetXaxis()->SetLimits(0.,100.);
	gLyso->GetYaxis().SetTitle("CRT (ps)");
	gLyso->SetMinimum(0.);
	gLyso->SetMaximum(50.);
	gTpb->Draw("same");
	gLxe->Draw("same");

	TLegend *leg = new TLegend(0.7, 0.7, 0.9, 0.9);
	leg->SetFillColor(0);
	leg->AddEntry(gLxe, "LXe", "lp");
	leg->AddEntry(gTpb, "LXe-TPB", "lp");
	leg->AddEntry(gLyso, "LYSO", "lp");
	leg->Draw("same");

	c2->Print("/home/jmbenlloch/next/petalo/work/histo/pde/pde.png");


	TCanvas *c3 = new TCanvas("c3","multipads",900,700);
	TGraph *gLxe_noCher = new TGraph(20, pdeValues, sigmas[0][1]);
//.........这里部分代码省略.........
开发者ID:jjgomezcadenas,项目名称:PESOA,代码行数:101,代码来源:histos_pde_two.c

示例3: plotFittedValueHPOL

void plotFittedValueHPOL(){


  AnitaGeomTool *myGeomTool = AnitaGeomTool::Instance();

  double x[MAX_ANTENNAS] = {0.};
  double y[MAX_ANTENNAS] = {0.};
  double z[MAX_ANTENNAS] = {0.};
  double r[MAX_ANTENNAS] = {0.};
  double phi[MAX_ANTENNAS] = {0.};

  double zFit[MAX_ANTENNAS] = {0.};
  double rFit[MAX_ANTENNAS] = {0.};
  double phiFit[MAX_ANTENNAS] = {0.};

  double zFit2[MAX_ANTENNAS] = {0.};
  double rFit2[MAX_ANTENNAS] = {0.};
  double phiFit2[MAX_ANTENNAS] = {0.};

  Double_t deltaR[MAX_ANTENNAS]={0};  
  Double_t deltaZ[MAX_ANTENNAS]={0};  
  Double_t deltaPhi[MAX_ANTENNAS]={0};  
  Double_t deltaCableDelays[MAX_ANTENNAS]={0};

  Double_t antArray[MAX_ANTENNAS] = {0.};
  Double_t cableDelays[MAX_ANTENNAS]={0};

  AnitaPol::AnitaPol_t pol = AnitaPol::kHorizontal;

   for (unsigned int ant=0; ant<MAX_ANTENNAS; ++ant){
     antArray[ant] = (ant+1)*1.;
     // myGeomTool->getAntXYZ(ant, x[ant], y[ant], z[ant], pol);
     
     // r[ant] = myGeomTool->getAntR(ant, pol);
     // phi[ant] = myGeomTool->getAntPhiPosition(ant, pol);

   }

  TLegend *leg = new TLegend(0.6, 0.75, 0.89, 0.89);
  leg->SetFillColor(kWhite);

 
  TGraph *gphotoR = new TGraph(48, antArray, r);
  gphotoR->SetMarkerStyle(22);
  TGraph *gphotoZ = new TGraph(48, antArray, z);
  gphotoZ->SetMarkerStyle(22);
  TGraph *gphotoPHI = new TGraph(48, antArray, phi);
  gphotoPHI->SetMarkerStyle(22);
  TGraph *gphotoCableDelay = new TGraph(48, antArray, cableDelays);
  gphotoCableDelay->SetMarkerStyle(22);

  const int numfile = 2;

  //  string filename[numfile]={"newLindaNumbers_4steps_zDisplaced_VPOL_10kVSeavey_2015_11_05_time_19_47_53.txt", "newLindaNumbers_4steps_zDisplaced_VPOL_10kVSeavey_2015_11_06_time_10_42_48.txt", "newLindaNumbers_4steps_zDisplaced_VPOL_10kVSeavey_2015_11_11_time_15_38_30.txt", "newLindaNumbers_4steps_2015_10_13_time_14_30_54.txt"};
  string filename[numfile]={"final/newLindaNumbers_4steps_HPOL_2015_11_13_time_17_19_58.txt", "newLindaNumbers_4steps_LDBHPOL_10kVSeavey_2015_11_19_time_10_16_23.txt"};

  string which[numfile] = {"FIT WAIS H-POL", "FIT LDB H-POL"};

  
  TCanvas *c1 = new TCanvas("c1", "", 1200, 750);
  gphotoR->SetTitle(";Antenna;#Delta r [m]");  
  gphotoR->Draw("Ap");
  gphotoR->SetMinimum(-0.2);
  gphotoR->SetMaximum(+0.2);
  gphotoR->Draw("Ap");

  TCanvas *c2 = new TCanvas("c2", "", 1200, 750);
  gphotoZ->SetTitle(";Antenna;#Delta z [m]");
  gphotoZ->Draw("Ap");
  gphotoZ->SetMinimum(-0.2);
  gphotoZ->SetMaximum(+0.2);
  gphotoZ->Draw("Ap");

  TCanvas *c3 = new TCanvas("c3", "", 1200, 750);
  gphotoPHI->SetTitle(";Antenna;#Delta phi [rad]");  
  gphotoPHI->Draw("Ap");
  gphotoPHI->SetMinimum(-0.2);
  gphotoPHI->SetMaximum(+0.2);
  gphotoPHI->Draw("Ap");

  TCanvas *c4 = new TCanvas("c4", "", 1200, 750);
  gphotoCableDelay->SetTitle(";Antenna;Time offset [ns]");
  gphotoCableDelay->Draw("Ap");
  gphotoCableDelay->SetMinimum(-0.5);
  gphotoCableDelay->SetMaximum(+0.5);
  gphotoCableDelay->Draw("Ap");

  leg->AddEntry(gphotoR, "Photogrammetry", "p");

  Color_t colors[5]={kRed, kOrange, kGreen, kBlue, kCyan};

  for (int i=0;i<numfile;i++){
    
    ifstream myInput(Form("/home/lindac/ANITA/Software/EventCorrelator/macros/lindaMacros/%s", filename[i].c_str()));
    
    if (myInput.is_open()){
      for (int i=0;i<48;i++){
	myInput >> antArray[i] >> deltaR[i] >> deltaZ[i] >> deltaPhi[i] >> deltaCableDelays[i];
	cout << antArray[i] << " " << deltaR[i] << endl;
      }
//.........这里部分代码省略.........
开发者ID:strutt,项目名称:antennaPositionCalib,代码行数:101,代码来源:plotFittedValueHPOL.C

示例4: ExtractSignalYield


//.........这里部分代码省略.........
      float BR_W_to_lv = 0.327;
      float BR_W_to_jj = 0.674;
      float BR_Z_to_jj = 0.6991;
      br[i] = getBranchingRatioToWW(ModelName,m_xs[i])*std::pow(BR_W_to_jj,2)*2 + getBranchingRatioToZZ(ModelName,m_xs[i])*std::pow(BR_Z_to_jj,2)*2;
      if(decayMode.find("lvjj")!=std::string::npos)
	{
	  br[i] = getBranchingRatioToWW(ModelName,m_xs[i])*2*BR_W_to_lv*BR_W_to_jj;
	}
      std::cout << m_xs[i] << " "<< br[i] << std::endl;
    }
  std::cout << lumi <<std::endl;
  std::cout << " N expected : "<<std::endl;
  for(int i=0;i<10;i++)
    {
      std::cout << m_xs[i] << " "<<N_expected[i] << " " <<xs[i]*lumi*br[i]*acceptance[i] << std::endl;
    }

  
  TGraph* N = new TGraph(10,m_xs,N_expected);
  //N->SetName("expected signal yield");
  grgreen->GetXaxis()->SetTitle("m_{VV} [GeV]");
  grgreen->GetYaxis()->SetTitle("number signal events");
  grgreen->GetYaxis()->SetTitleOffset(1.3);
  grgreen->SetTitle("");
  TCanvas* c_N = new TCanvas("c_N","c_N",600,400);
  gPad->SetRightMargin(0.1);
  gPad->SetLeftMargin(0.1);
  limit->SetLineColor(kBlue);
  limit->SetLineWidth(3);
  c_N->SetLogy();
  N->SetLineColor(kRed);
  N->SetLineWidth(2);
  //N->Draw("A");
  grgreen->SetMaximum(1000);
  grgreen->Draw("AF");
  gryellow->Draw("Fsame");
  limit->Draw("Csame");
  N->Draw("Lsame");
  TLegend* leg = new TLegend(0.59,0.65,0.95,0.89);
  leg->SetFillColor(kWhite);
  leg->SetFillStyle(0);
  leg->SetTextSize(0.04);
  leg->SetBorderSize(0);
  
  string title = "Preliminary";
  string cms = "#font[62]{CMS} #font[52]{"+string(title)+"} ";
  string lumitext = "2.6 fb^{-1}, #sqrt{s} = 13 TeV";
  string cmstext = "CMS ,2.6 fb^{-1}, #sqrt{s} = 13 TeV";
  if(decayMode.find("had")==string::npos){lumitext = "2.1 fb^{-1}, #sqrt{s} = 13 TeV";}
  string theory = "G #rightarrow WW, #Gamma = "+swidth;
  if(dependsOnKtilde)
  {
    theory = "G #rightarrow WW, #tilde{k} = "+sktilde;
  }
  if(ModelName.find("RSGrav")!=string::npos)
  {
   theory = "RS #rightarrow WW, #Gamma = "+swidth;
   if(dependsOnKtilde)
    {
      theory = "RS #rightarrow WW, #tilde{k} = "+sktilde;
    }
  }
  
  leg->AddEntry(grgreen,"Expected (95%)","f");
  leg->AddEntry(gryellow,"Expected (68%)","f");
  leg->AddEntry(limit,"observed","L");
开发者ID:daniSchaefer,项目名称:AdditionToExoDiBosonAnalysis-,代码行数:67,代码来源:ExtractSignalYield.C

示例5: makePlots


//.........这里部分代码省略.........
  }
  
  TString cname = TString("Ratio") + TString("_") + TString(model) +  TString("_") + TString(config);
  
  TCanvas * c1 = new TCanvas( cname.Data(), "track/shower ratio", 206,141,722,575); 

  c1->SetBorderSize(2);
    
  TLegend * leg = new TLegend(0.18,0.64,0.44,0.87);
  
  leg->SetBorderSize(0);
  leg->SetTextFont(22);
  leg->SetTextSize(0.062);
  leg->SetLineColor(1);
  leg->SetLineStyle(1);
  leg->SetLineWidth(1);
  leg->SetFillColor(0);
  leg->SetFillStyle(0);

  int labelpos = 0;
  
  for( int k = 0; k < max; ++k ) 
  {

    TGraph * gg = (TGraph*)v_Graphs->At(k);

    gg->SetMarkerStyle(25);
    gg->SetFillColor(10);

    gg->SetLineColor(linecolor[k]);
    gg->SetLineWidth(linewidth[k]);
    gg->SetLineStyle(linestyle[k]);

    gg->SetMaximum(MAXY);
    gg->SetMinimum(1.6);

    gg->GetXaxis()->SetLimits( 0.0, 0.055 );

    gg->GetXaxis()->SetTitle("sin^{2}#theta_{13}");
    gg->GetXaxis()->CenterTitle(true);
    gg->GetXaxis()->SetLabelFont(42);
    gg->GetXaxis()->SetLabelOffset(0.006);
    gg->GetXaxis()->SetLabelSize(0.06);
    gg->GetXaxis()->SetTitleSize(0.06);
    gg->GetXaxis()->SetTickLength(0.05);
    gg->GetXaxis()->SetTitleOffset(1.07);
    gg->GetXaxis()->SetTitleFont(42);
    gg->GetXaxis()->SetNdivisions(509);
    gg->GetYaxis()->SetTitle("R");
    gg->GetYaxis()->CenterTitle(true);
    gg->GetYaxis()->SetNdivisions(509);
    gg->GetYaxis()->SetLabelFont(42);
    gg->GetYaxis()->SetLabelOffset(0.007);
    gg->GetYaxis()->SetLabelSize(0.06);
    gg->GetYaxis()->SetTitleSize(0.06);
    gg->GetYaxis()->SetTitleOffset(0.93);
    gg->GetYaxis()->SetTitleFont(42);

    if ( ((k+1) % 2) == 0 )
    {
      TString alpha = ((TObjString*)v_Labels->At(labelpos))->GetString();      
      leg->AddEntry( gg, alpha.Data(),"l");
      labelpos+=1;
    }
    
    c1->cd();
开发者ID:andres0sorio,项目名称:GRBsWork,代码行数:67,代码来源:make_plots_paper02_sin2theta_02.C

示例6: makeDeadEcalEff

// -------------------------
// -- Functions           --
// -------------------------
void makeDeadEcalEff() {
   
  gStyle->SetOptStat(0);  
  TCanvas *c1 = new TCanvas("c1","A Simple Graph with error bars",200,10,700,500);
  
  const Int_t nbins = 6;

  TString lifetime = "0.5";
  //   TString lifetime = "1";
   //   TString lifetime = "5";

   Float_t masses      [nbins] = {103, 164, 246, 328, 408, 488};  
   Float_t effOld0p5ns [nbins] = {0.884, 0.958, 0.889, 0.895, 0.897, 0.909}; 
   Float_t effDPG0p5ns [nbins] = {0.877, 0.958, 0.894, 0.884, 0.901, 0.888};  // Federico's DPG map 

   Float_t effOld1ns   [nbins] = {0.896, 0.93, 0.912, 0.944, 0.918, 0.914}; 
   Float_t effDPG1ns   [nbins] = {0.899, 0.92, 0.912, 0.926, 0.90, 0.901};  // Federico's DPG map 

   Float_t effOld5ns   [nbins] = {0.921, 0.938, 0.942, 0.92, 0.936, 0.942}; 
   Float_t effDPG5ns   [nbins] = {0.909, 0.913, 0.934, 0.911, 0.93, 0.936};  // Federico's DPG map 

   Float_t* effOld;
   Float_t* effDPG; 

   if (lifetime=="0p5") {
     effOld = effOld0p5ns;
     effDPG = effDPG0p5ns;
   }

   if (lifetime=="1") {
     effOld = effOld1ns;
     effDPG = effDPG1ns;
   }

   if (lifetime=="5") {
     effOld = effOld5ns;
     effDPG = effDPG5ns;
   }

   for (int i=0; i<nbins; i++) {
     effOld[i] = 1.0 - effOld[i];
     effDPG[i] = 1.0 - effDPG[i];
   }

   TGraph *grEffOld = new TGraph(nbins, masses, effOld);  
   TGraph *grEffDPG = new TGraph(nbins, masses, effDPG);  

   grEffOld->SetMarkerStyle(21); // 21:  square  
   grEffOld->SetMarkerSize(0.8);
   grEffOld->SetMarkerColor(kBlue);
   grEffOld->SetLineWidth(2);  
   grEffOld->SetMinimum(0);
   grEffOld->SetMaximum(0.25);
   //  grEffOld->SetTitle(";chargino mass;efficiency of dead ECAL veto"); 
   grEffOld->SetTitle(";chargino mass;1 - #epsilon"); 
   grEffOld->Draw("AP");
   //   grEffOld->Draw("P");

   grEffDPG->SetMarkerStyle(26); // 26:  hollow triangle 
   grEffDPG->SetMarkerSize(0.8);
   grEffDPG->SetMarkerColor(kRed);
   grEffDPG->SetLineWidth(2);  
   grEffDPG->Draw("P, same");

  TLine l;
  l.SetLineColor(kRed);
  l.DrawLine(2.5,1.0,6.5,1.0); 
  TLegend leg2(0.50,0.6,0.85,0.8);
  leg2.AddEntry(grEffOld, "old map ("      + lifetime + " ns)", "pl");  
  leg2.AddEntry(grEffDPG, "ECAL DPG map (" + lifetime + " ns)", "pl");  
  leg2.SetBorderSize(0);
  leg2.SetFillStyle(1001);
  leg2.SetFillColor(kWhite);
  leg2.SetBorderSize(0);
  leg2.SetTextFont(gStyle->GetTitleFont());
  leg2.Draw();


  TPaveText* pt = new TPaveText(0.50, 0.82, 0.90, 0.88, "NDC");
  pt->SetFillStyle(0);
  pt->SetBorderSize(0);
  pt->SetTextFont(gStyle->GetTitleFont());
  pt->AddText("CMS Preliminary, #sqrt{s} = 8 TeV");
  //  pt->Draw();


  c1->SetLogy(0);
  c1->Print("deadEcalEff" + lifetime + "ns.pdf");  
  c1->Clear();

  return;

} 
开发者ID:srimanob,项目名称:DisappTrks,代码行数:96,代码来源:makeDeadEcalEff.C

示例7: makePlots


//.........这里部分代码省略.........
    ProbANu[1]->SetPoint( i, xx, yy);
  }

  ///Pet

  PetTreeNu->SetBranchAddress("Ex",&xx);
  PetTreeNu->SetBranchAddress("Pb",&yy);

  nentries = PetTreeNu->GetEntries();
  
  for (Long64_t i=0;i<nentries;i++) {
    PetTreeNu->GetEntry(i);
    ProbNu[2]->SetPoint( i, xx, yy);
  }
  
  PetTreeANu->SetBranchAddress("Ex",&xx);
  PetTreeANu->SetBranchAddress("Pb",&yy);
  
  nentries = PetTreeANu->GetEntries();
  
  for (Long64_t i=0;i<nentries;i++) {
    PetTreeANu->GetEntry(i);
    ProbANu[2]->SetPoint( i, xx, yy);
  }

  for( int k=0; k < 3; ++k) 
  {
    
    ProbNu[k]->SetLineColor(4);
    ProbNu[k]->SetMarkerColor(4);
    ProbNu[k]->SetMarkerStyle(7);
    
    ProbNu[k]->SetFillColor(10);
    ProbNu[k]->SetMaximum(1.0);
    ProbNu[k]->SetMinimum(0.0);
    
    TString yaxis = ((TObjString*)v_Labels->At(k))->GetString();
    ProbNu[k]->GetYaxis()->SetTitle( yaxis.Data() );
    ProbNu[k]->GetXaxis()->SetTitle("E [eV]");
    ProbNu[k]->GetYaxis()->CenterTitle(true); 
    ProbNu[k]->GetXaxis()->CenterTitle(true); 
    ProbNu[k]->GetXaxis()->SetLabelOffset(0.007);
    ProbNu[k]->GetXaxis()->SetLabelSize(0.08);
    ProbNu[k]->GetXaxis()->SetTitleSize(0.07);
    ProbNu[k]->GetXaxis()->SetTitleOffset(0.9);
    ProbNu[k]->GetXaxis()->SetLabelFont(42);
    ProbNu[k]->GetYaxis()->SetLabelOffset(0.007);
    ProbNu[k]->GetYaxis()->SetLabelSize(0.08);
    ProbNu[k]->GetYaxis()->SetLabelFont(42);
    ProbNu[k]->GetYaxis()->SetTitleSize(0.09);
    ProbNu[k]->GetYaxis()->SetTitleOffset(0.45);
    ProbNu[k]->GetYaxis()->SetTitleFont(42);
    
    ProbANu[k]->SetMarkerColor(42);
    ProbANu[k]->SetMarkerStyle(23);
    ProbANu[k]->SetMarkerSize(0.3);
    
    ProbANu[k]->SetFillColor(10);
    ProbANu[k]->SetMaximum(1.0);
    ProbANu[k]->SetMinimum(0.0);
    

  }
  
  leg->AddEntry( ProbNu[0], "#nu");
  leg->AddEntry( ProbANu[0], "#bar{#nu}");
开发者ID:andres0sorio,项目名称:GRBsWork,代码行数:67,代码来源:make_plots_paper01_3xsingle_Psum.C

示例8: noAveBounceStdy


//.........这里部分代码省略.........
#ifdef DEBUG_SHIFTS
            TCanvas* cdbgsh = new TCanvas;
            cdbgsh->cd();
            Float_t xsm[NSnConstants::kNsamps], rsmp[NSnConstants::kNsamps];
            for (Int_t i=0; i<NSnConstants::kNsamps; ++i) {
               xsm[i] = i;
               rsmp[i] = samples[ch][i];
            }
            TGraph* gsmp = new TGraph(NSnConstants::kNsamps, xsm, rsmp);
            TGraph* gps  = new TGraph(NSnConstants::kNsamps, xsm, 
                                      &(pedsubs[ch][0]));
            TGraph* gph  = new TGraph(NSnConstants::kNsamps, xsm,
                                      &(psshift[ch][0]));
            TGraph* gfl  = new TGraph(NSnConstants::kNsamps, xsm,
                                      &(filtered[ch][0]));
            TGraph* gen  = new TGraph(NSnConstants::kNsamps, xsm,
                                      &(envelope[ch][0]));
            gsmp->SetMarkerStyle(7);
            gsmp->SetMarkerColor(kBlack);
            gsmp->SetLineColor(kBlack);
            gps->SetMarkerStyle(7);
            gps->SetMarkerColor(kRed);
            gps->SetLineColor(kRed);
            gph->SetMarkerStyle(7);
            gph->SetMarkerColor(kAzure-7);
            gph->SetLineColor(kAzure-7);
            gfl->SetMarkerStyle(7);
            gfl->SetMarkerColor(kGreen+2);
            gfl->SetLineColor(kGreen+2);
            gen->SetMarkerStyle(7);
            gen->SetMarkerColor(kViolet-1);
            gen->SetLineColor(kViolet-1);
            gsmp->SetMinimum(-1500);
            gsmp->SetMaximum(2500);
            Printf("ch%d: shift=%d, len=%d",
                   ch, shift[ch], len[ch]);
            gsmp->Draw("apc");
            gps->Draw("pc");
            gph->Draw("pc");
            gfl->Draw("pc");
            gen->Draw("pc");
            cdbgsh->WaitPrimitive();
            delete gsmp; delete gps; delete gph; delete gfl; delete gen;
            delete cdbgsh;
#endif
         }
         
         if (shiftmaxb!=shiftminb) {
            maxdt = (shiftmaxb - shiftminb) / (2.0*kSmpRate);
         } else {
            maxdt =  NSnConstants::kNsamps  / (2.0*kSmpRate);
         }
         
         const Float_t* chdat(0), * xcdat(0);
         for (Int_t ch=0; ch<NSnConstants::kNchans; ++ch) {
            if (fitOpt==0) {
               chdat = &(filtered[ch][0]);
            } else if (fitOpt==10) {
               chdat = &(envelope[ch][0]);
            } else {
               Fatal("noAveBounceStdy","Unknown fitOpt [%d]",fitOpt);
            }
            for (Int_t xc=0; xc<ch; ++xc) {
               if (fitOpt==0) {
                  xcdat = &(filtered[xc][0]);
               } else if (fitOpt==10) {
开发者ID:jetatar,项目名称:snowShovel,代码行数:67,代码来源:noAveBounceStdy.C

示例9: plotLinearityMAT_ERUpgrade


//.........这里部分代码省略.........
       gMATUp->SetPoint(i, e/GeV, (e-eVarMATUp)/eVarMATUp); 
       gMATDown->SetPoint(i, e/GeV, (e-eVarMATDown)/eVarMATDown); 
       
       gPSUp->SetPoint(i, e/GeV, (e-eVarPSUp)/eVarPSUp); 
       gPSDown->SetPoint(i, e/GeV, (e-eVarPSDown)/eVarPSDown); 
       
       gLowUp->SetPoint(i, e/GeV, (e-eVarLowUp)/eVarLowUp); 
       gLowDown->SetPoint(i, e/GeV, (e-eVarLowDown)/eVarLowDown); 
       
     } else {
       
       gNom->SetPoint(i, e/GeV, (e-eNominal)/eNominal - alpha); 
     
       gZeeAllUp->SetPoint(i, e/GeV, (e-eVarZeeAllUp)/eVarZeeAllUp - alpha); 
       gZeeAllDown->SetPoint(i, e/GeV, (e-eVarZeeAllDown)/eVarZeeAllDown - alpha); 
       
       gZeeUp->SetPoint(i, e/GeV, (e-eVarZeeUp)/eVarZeeUp - alpha); 
       gZeeDown->SetPoint(i, e/GeV, (e-eVarZeeDown)/eVarZeeDown - alpha); 
       
       gZeeGenUp->SetPoint(i, e/GeV, (e-eVarGenUp)/eVarGenUp - alpha); 
       gZeeGenDown->SetPoint(i, e/GeV, (e-eVarGenDown)/eVarGenDown - alpha); 
       
       gMATUp->SetPoint(i, e/GeV, (e-eVarMATUp)/eVarMATUp - alpha); 
       gMATDown->SetPoint(i, e/GeV, (e-eVarMATDown)/eVarMATDown - alpha); 
       
       gPSUp->SetPoint(i, e/GeV, (e-eVarPSUp)/eVarPSUp - alpha); 
       gPSDown->SetPoint(i, e/GeV, (e-eVarPSDown)/eVarPSDown - alpha); 
       
       gLowUp->SetPoint(i, e/GeV, (e-eVarLowUp)/eVarLowUp - alpha); 
       gLowDown->SetPoint(i, e/GeV, (e-eVarLowDown)/eVarLowDown - alpha); 
       
     }

     i++;

     if( logx )
       e *= exp(eStep);
     else
       e += eStep;

   }
 
   TCanvas* canvas = new TCanvas();
   if( logx )
     canvas->SetLogx();

   if( !subtractAverage ) {
     gMATUp->SetMaximum(alpha+.005);
     gMATUp->SetMinimum(alpha+-.007);
   } else {
     gMATUp->SetMaximum(.005);
     gMATUp->SetMinimum(-.007);
   }

   char grafname[99];
   if( ptype==0 )
     sprintf(grafname,"ES  Linearity (%s), #eta = %4.2f, Electrons", year.c_str(), eta);
   else if( ptype==1 )
     sprintf(grafname,"ES  Linearity (%s), #eta = %4.2f, Unconverted photons", year.c_str(), eta);
   else if( ptype==2 )
     sprintf(grafname,"ES  Linearity (%s), #eta = %4.2f, Converted photons", year.c_str(), eta);
   gMATUp->SetTitle(grafname);
   
   gMATUp->GetXaxis()->SetTitleOffset(1.2*gNom->GetXaxis()->GetTitleOffset());
   gMATUp->GetYaxis()->SetTitleOffset(1.2*gNom->GetYaxis()->GetTitleOffset());
   gMATUp->GetXaxis()->SetTitle("E [GeV]");
   gMATUp->GetYaxis()->SetTitle("#alpha(E)");
   gMATUp->SetLineWidth(2);
   gMATUp->SetLineStyle(2);
   gMATUp->SetLineColor(4);
   gMATUp->Draw("AL");

   gMATDown->SetLineWidth(2);
   gMATDown->SetLineStyle(3);
   gMATDown->SetLineColor(4);
   gMATDown->Draw("L");

   gNom->SetLineWidth(2);
   gNom->SetLineColor(4);
   gNom->Draw("L");

   gZee->SetMarkerStyle(20);
   gZee->Draw("P");

   TLegend* leg1 = new TLegend(.7,.15,.89,.3);
   leg1->SetBorderSize(0);
   leg1->SetFillColor(0);
   leg1->AddEntry(gZee,"#alpha, Z peak", "p");
   leg1->AddEntry(gNom,"PS, central", "l");
   leg1->AddEntry(gMATUp,"PS, up", "l");
   leg1->AddEntry(gMATDown,"PS, down", "l");

   leg1->Draw("same");

   // char plotname[99];
   // sprintf(plotname,"linearity_%d_%2.1f.png",ptype,eta);
   //   canvas->Print("overlay.ps");
  
   return canvas;
}
开发者ID:cjohnson-phys,项目名称:ProofAna,代码行数:101,代码来源:plotLinearityMAT_ERUpgrade.C

示例10: DrawWalk

//------------------------------------------------------------------------
void DrawWalk()
{
  Int_t npeaks = 20;
  Int_t sigma=3.;
  Bool_t down = false;

  Int_t index[20];
  Char_t buf1[10], buf2[10];
  
  TCanvas *c1 = new TCanvas("c1", "c1",0,48,1280,951);
  gStyle->SetOptStat(0);
  c1->Divide(4,3);
  
  for (Int_t i=0; i<12; i++)
    {
      c1->cd(i+1);
      sprintf(buf1,"T0_C_%i_CFD",i+1);
      sprintf(buf2,"CFDvsQTC%i",i+1);
      cout<<buf1<<" "<<buf2<<endl;
      TH2F *qtc_cfd = (TH2F*) gFile->Get(buf2);
      TH1F *cfd = (TH1F*) gFile->Get(buf1);
      //       cfd->Draw();
      TSpectrum *s = new TSpectrum(2*npeaks,1);
      Int_t nfound = s->Search(cfd,sigma," ",0.05);
      cout<<"Found "<<nfound<<" peaks sigma "<<sigma<<endl;;
      if(nfound!=0){
	Float_t *xpeak = s->GetPositionX();
  	TMath::Sort(nfound, xpeak, index,down);
  	Float_t xp = xpeak[index[0]];
	Int_t xbin = cfd->GetXaxis()->FindBin(xp);
	Float_t yp = cfd->GetBinContent(xbin);
	cout<<"xbin = "<<xbin<<"\txpeak = "<<xpeak[1]<<"\typeak = "<<yp<<endl;
	Float_t hmax = xp+10*sigma;
	Float_t hmin = xp-10*sigma;
	cout<<hmin<< " "<<hmax<<endl;
	//	    cfd->GetXaxis()->SetRange(hmin,hmax);
	//	    TF1 *g1 = new TF1("g1", "gaus", hmin, hmax);
	// cfd->Fit("g1","R");
	Int_t hminbin=  qtc_cfd->GetXaxis()->GetFirst();
	Int_t hmaxbin=  qtc_cfd->GetXaxis()->GetLast();
	Int_t nbins= qtc_cfd->GetXaxis()->GetNbins();
	cout<<"  qtc_cfd "<<hminbin<<" "<<hmaxbin<<" "<<nbins<<endl;
	//  qtc_cfd->Draw();
	TProfile *pr_y = qtc_cfd->ProfileX();
	Float_t maxHr=pr_y->GetBinCenter(hmaxbin);
	
	pr_y->SetMaximum(hmax);
	pr_y->SetMinimum(hmin);
	Int_t np=nbins/20;
	Double_t *xx = new Double_t[np];
	Double_t *yy = new Double_t[np];
	Int_t ng=0;
	Double_t yg=0;
	for (Int_t ip=1; ip<nbins; ip++)
	  {
	    if(ip%20 != 0 ) {
	      if (pr_y->GetBinContent(ip) !=0)
		yg +=pr_y->GetBinContent(ip);
	      //	cout<<ng<<" "<<pr_y->GetBinContent(ip)<<" "<<yg<<endl;
	      ng++;}
	    else {
	      xx[ip/20] = Float_t (pr_y->GetBinCenter(ip));
	      yy[ip/20] = yg/ng;
	      yg=0;
	      ng=0;
	     	      cout<<ip<<" "<<ip/20<<" "<< xx[ip/20]<<" "<< yy[ip/20]<<endl;
	    }
	  }
	TH2F *hr = new TH2F("hr"," ",np,0,maxHr, np, hmin, hmax);
	hr->Draw();
	TGraph *gr = new TGraph(np,xx,yy);
	gr->SetMinimum(hmin);
	gr->SetMaximum(hmax);
	gr->SetMarkerStyle(20);
	gr->Draw("P");
	//	delete [] xx;
	//	delete [] yy;
	
	// pr_y->Rebin(10);
		   //  pr_y->Draw();
	    
      }
      
    }
  

}
开发者ID:alisw,项目名称:AliRoot,代码行数:88,代码来源:AliT0CalibViewer.C

示例11: EnergyDependentCorrections


//.........这里部分代码省略.........
  }

  infile.close();

  infile.open(TString::Format("%s/Asymmetries/AllCorr_OctetAsymmetries_AnaChC_Octets_%i-%i_BinByBin.txt",getenv("ANALYSIS_RESULTS"),60,121));
  
  while (infile >> en >> val >> err) {
    AllCorr2012.push_back(val);
  }

  infile.close();


  
  
  
  

  std::vector <Double_t> en_Th;
  std::vector <Double_t> corr_Th;
  std::vector <Double_t> en_MC2011;
  std::vector <Double_t> corr_MC2011;
  std::vector <Double_t> en_MC2012;
  std::vector <Double_t> corr_MC2012;
  
  
  for (int i=2;i<80;++i) {

    if (UnCorr2011[i]!=0.) en_Th.push_back(energy[i]), corr_Th.push_back(100.*(TheoryCorr2011[i]/UnCorr2011[i]-1.));
    if (TheoryCorr2011[i]!=0.) en_MC2011.push_back(energy[i]), corr_MC2011.push_back(100.*(AllCorr2011[i]/TheoryCorr2011[i]-1.));
    if (TheoryCorr2012[i]!=0.) en_MC2012.push_back(energy[i]), corr_MC2012.push_back(100.*(AllCorr2012[i]/TheoryCorr2012[i]-1.));
  }

  

  TCanvas *c2 = new TCanvas("c2","c2",1200,800);
  c2->Divide(2,1);

  c2->cd(1);

  TGraph *gTheory = new TGraph(en_Th.size(),&en_Th[0],&corr_Th[0]);
  gTheory->SetTitle("Theory Corrections vs. Energy");
  gTheory->SetMarkerStyle(kFullCircle);
  gTheory->SetMinimum(-5.);
  gTheory->SetMaximum(0.);
  gTheory->SetLineWidth(3);
  gTheory->SetLineColor(kBlack);
  gTheory->GetYaxis()->SetTitle("#DeltaA/A (%)");
  gTheory->GetYaxis()->CenterTitle();
  gTheory->GetXaxis()->SetTitle("Energy (keV)");
  gTheory->GetXaxis()->CenterTitle();
  gTheory->Draw("AL");
  
  c2->cd(2);

  TMultiGraph *mg = new TMultiGraph();
  mg->SetTitle("MC Corrections vs. Energy");
  
  TGraph *gMC2011 = new TGraph(en_MC2011.size(),&en_MC2011[0],&corr_MC2011[0]);
  gMC2011->SetMarkerStyle(kFullCircle);
  //gMC2011->SetMinimum(-10.);
  //gMC2011->SetMaximum(6.);
  gMC2011->SetLineWidth(3);
  gMC2011->SetLineColor(kBlue);
  gMC2011->GetYaxis()->SetTitle("#DeltaA/A (%)");
  gMC2011->GetYaxis()->CenterTitle();
  gMC2011->GetXaxis()->SetTitle("Energy (keV)");
  gMC2011->GetXaxis()->CenterTitle();
  //gMC2011->Draw("AC");

  TGraph *gMC2012 = new TGraph(en_MC2012.size(),&en_MC2012[0],&corr_MC2012[0]);
  gMC2012->SetMarkerStyle(kFullCircle);
  //gMC2012->SetMinimum(-10.);
  //gMC2012->SetMaximum(6.);
  gMC2012->SetLineWidth(3);
  gMC2012->SetLineColor(kGreen);
  //gMC2012->GetYaxis()->SetTitle("#DeltaA/A (%)");
  //gMC2012->GetYaxis()->CenterTitle();
  //gMC2012->GetXaxis()->SetTitle("Energy (keV)");
  //gMC2012->GetXaxis()->CenterTitle();
  //gMC2012->Draw("AC");
  
  mg->Add(gMC2011);
  mg->Add(gMC2012);
  mg->SetMinimum(-8.);
  mg->SetMaximum(6.);
  
  mg->Draw("AC");
  mg->GetYaxis()->SetTitle("#DeltaA/A (%)");
  mg->GetYaxis()->CenterTitle();
  mg->GetXaxis()->SetTitle("Energy (keV)");
  mg->GetXaxis()->CenterTitle();
  gPad->Modified();

  TLegend *leg = new TLegend(0.55,0.75,0.85,0.85);
  leg->AddEntry(gMC2011,"2011-2012","l");
  leg->AddEntry(gMC2012,"2012-2013","l");
  leg->SetTextSize(0.05);
  leg->Draw("SAME");
}
开发者ID:mabrow05,项目名称:ParallelAnalyzer-1,代码行数:101,代码来源:EnergyDependentCorrections.C

示例12: plotLinearityPS_AllTypes_ERUpgrade


//.........这里部分代码省略.........
     } else {
       
       gNom->SetPoint(i, eT/GeV, (e-eNominal)/eNominal - alpha); 
     
       gPSUp->SetPoint(i, eT/GeV, (e-eVarPSUp)/eVarPSUp - alpha); 
       gPSDown->SetPoint(i, eT/GeV, (e-eVarPSDown)/eVarPSDown - alpha); 
       
       gNom_UC->SetPoint(i, eT/GeV, (e-eNominal_UC)/eNominal_UC - alpha); 
       
       gPSUp_UC->SetPoint(i, eT/GeV, (e-eVarPSUp_UC)/eVarPSUp_UC - alpha); 
       gPSDown_UC->SetPoint(i, eT/GeV, (e-eVarPSDown_UC)/eVarPSDown_UC - alpha); 
       
       gNom_CV->SetPoint(i, eT/GeV, (e-eNominal_CV)/eNominal_CV - alpha); 
       
       gPSUp_CV->SetPoint(i, eT/GeV, (e-eVarPSUp_CV)/eVarPSUp_CV - alpha); 
       gPSDown_CV->SetPoint(i, eT/GeV, (e-eVarPSDown_CV)/eVarPSDown_CV - alpha); 
       
     }

     i++;

     if( logx )
       e *= exp(eStep);
     else
       e += eStep;

   }
 
   TCanvas* canvas = new TCanvas();
   if( logx )
     canvas->SetLogx();

   if( !subtractAverage ) {
     gPSUp->SetMaximum(alpha+.005);
     gPSUp->SetMinimum(alpha+-.007);
   } else {
     gPSUp->SetMaximum(.005);
     gPSUp->SetMinimum(-.007);
   }

   char grafname[99];
   sprintf(grafname,"Linearity (%s), PS contribution, #eta = %4.2f", year.c_str(), eta);
   gPSUp->SetTitle(grafname);

   // Electrons
   
   gPSUp->GetXaxis()->SetTitleOffset(1.2*gNom->GetXaxis()->GetTitleOffset());
   gPSUp->GetYaxis()->SetTitleOffset(1.2*gNom->GetYaxis()->GetTitleOffset());
   gPSUp->GetXaxis()->SetTitle("E_{T} [GeV]");
   gPSUp->GetYaxis()->SetTitle("#alpha(E_{T})");
   gPSUp->SetLineWidth(2);
   gPSUp->SetLineStyle(2);
   gPSUp->SetLineColor(4);
   gPSUp->Draw("AL");

   gPSDown->SetLineWidth(2);
   gPSDown->SetLineStyle(3);
   gPSDown->SetLineColor(4);
   gPSDown->Draw("L");

   gNom->SetLineWidth(2);
   gNom->SetLineColor(4);
   gNom->Draw("L");

   // Unconverted
开发者ID:cjohnson-phys,项目名称:ProofAna,代码行数:66,代码来源:plotLinearityPS_AllTypes_ERUpgrade.C

示例13: Loop


//.........这里部分代码省略.........
                 <<" ntrkreco[i] = " << ntrkreco[i]
                 <<" ntrkrecor[i] = " << ntrkrecor[i]
                 <<" ntrk[i] = " << ntrk[i]
                 <<" eff = " << trkeff[i] << endl;
            //       	    <<" responce = " << responceVSptF[i] << endl;
        }
    }
    // calculate efficiency vs Eta and full graph
    cout <<" Efficiency vs Eta " << endl;
    for(Int_t i = 0; i < netabins; i++) {
        if(ntrketa[i] > 0) {
            trketaeff[i] = 1.*ntrketareco[i]/ntrketa[i];
            etrketaeff[i] = sqrt( trketaeff[i]*(1.-trketaeff[i])/ntrketa[i] );
            responceVSetaF[i] = responceVSeta[i]/ntrketarecor[i];
            cout <<" i = " << i
                 <<" eta interval = " << eta[i] <<" - " << eta[i+1]
                 <<" ntrketareco[i] = " << ntrketareco[i]
                 <<" ntrketa[i] = " << ntrketa[i]
                 <<" eff = " << trketaeff[i]
                 <<" responce = " << responceVSetaF[i] << endl;
        }
    }

    // create graph
    //  vs pT
    setTDRStyle(1,0);
    TCanvas* c1 = new TCanvas("X","Y",1);
    TGraph *grpt  = new TGraphErrors(nptbins,ptgr,trkeff,eptgr,etrkeff);
    TAxis* xaxis = grpt->GetXaxis();
    grpt->GetXaxis()->SetTitle("p_{T}, GeV");
    grpt->GetYaxis()->SetTitle("track finding efficiency");
    xaxis->SetLimits(0.8,50.);
    grpt->SetMarkerStyle(21);
    grpt->SetMaximum(0.9);
    grpt->SetMinimum(0.6);
    grpt->Draw("AP");
    TLatex *t = new TLatex();
    t->SetTextSize(0.042);
    //   TLegend *leg = new TLegend(0.5,0.2,0.7,0.35,NULL,"brNDC");
    //   leg->SetFillColor(10);
    //   leg->AddEntry(grpt,"#pi ^{+} and #pi ^{-}","P");
    //   leg->Draw();
    t->DrawLatex(1.,0.85,"CMSSW169, single #pi ^{+} and #pi ^{-}. |#eta ^{#pi}|< 2.5");
    c1->SaveAs("trkeff_vs_pt.gif");
    c1->SaveAs("trkeff_vs_pt.eps");

    setTDRStyle(0,0);
    //  vs Eta
    TCanvas* c2 = new TCanvas("X","Y",1);
    TGraph *greta = new TGraphErrors(netabins,etagr,trketaeff,eetagr,etrketaeff);
    TAxis* xaxis = greta->GetXaxis();
    greta->GetXaxis()->SetTitle("#eta");
    greta->GetYaxis()->SetTitle("track finding efficiency");
    xaxis->SetLimits(0.0,2.4);
    greta->SetMarkerStyle(21);
    greta->SetMaximum(1.0);
    greta->SetMinimum(0.50);
    greta->Draw("AP");
    TLatex *t = new TLatex();
    t->SetTextSize(0.042);
    //   TLegend *leg = new TLegend(0.5,0.2,0.7,0.35,NULL,"brNDC");
    //   leg->SetFillColor(10);
    //   leg->AddEntry(greta,"#pi ^{+} and #pi ^{-}","P");
    //   leg->Draw();
    t->DrawLatex(0.3,0.87,"CMSSW217, single #pi ^{+} and #pi ^{-}");
    t->DrawLatex(0.8,0.85,"1 < p^{#pi^{#pm}} < 50 GeV");
开发者ID:nsahoo,项目名称:cmssw-1,代码行数:67,代码来源:SinglePionEfficiencyNewVSpT.C

示例14: Loop


//.........这里部分代码省略.........
   for(Int_t ih=0; ih < netabins; ih++) { 
     //     hEnTrkNotInter[ih]->Write();
     //     hEnTrkInter[ih]->Write();

     MeanNotInter[ih]      = hEnTrkNotInter[ih]->GetMean();
     MeanErrorNotInter[ih] = hEnTrkNotInter[ih]->GetMeanError();
     MeanInter[ih]         = hEnTrkInter[ih]->GetMean();
     MeanErrorInter[ih]    = hEnTrkInter[ih]->GetMeanError();
     leakage[ih] = MeanInter[ih]/MeanNotInter[ih];
     eleakage[ih] = leakage[ih] *
       sqrt( (MeanErrorNotInter[ih]/MeanNotInter[ih])*(MeanErrorNotInter[ih]/MeanNotInter[ih]) +
             (MeanErrorInter[ih]/MeanInter[ih])*(MeanErrorInter[ih]/MeanInter[ih]));

     cout <<" ieta = " << ih <<" MeanNotInter = " << MeanNotInter[ih] <<" +/- " << MeanErrorNotInter[ih]
	  <<" MeanInter = " << MeanInter[ih] <<" +/- " << MeanErrorInter[ih]  
	  <<" leakage = " << leakage[ih] <<" +/- " << eleakage[ih] << endl; 
   }

   TGraph *gleak = new TGraphErrors(netabins,etagr,leakage, eetagr,eleakage);
   TGraph *eMeanNotInter = new TGraphErrors(netabins,etagr,MeanNotInter, eetagr,MeanErrorNotInter);
   TGraph *eMeanInter = new TGraphErrors(netabins,etagr,MeanInter, eetagr,MeanErrorInter);
   //  vs Eta
   setTDRStyle(0,0);
   TCanvas* c3 = new TCanvas("X","Y",1);
   c3->Divide(1,2);
   c3->cd(1);
   TAxis* xaxis = eMeanNotInter->GetXaxis();
   eMeanNotInter->GetXaxis()->SetTitle("#eta");
   eMeanNotInter->GetYaxis()->SetTitle("calo E_{T}^{raw reco} in cone 0.5/p_{T}^{MC}");
   xaxis->SetLimits(0.0,2.4);
   eMeanNotInter->SetMarkerStyle(21);
   //   eMeanNotInter->SetMaximum(0.95);
   //   eMeanNotInter->SetMinimum(0.55);
   eMeanNotInter->SetMaximum(1.);
   eMeanNotInter->SetMinimum(0.);
   eMeanNotInter->Draw("AP");
   eMeanInter->SetMarkerStyle(24);
   eMeanInter->Draw("P");
   TLatex *t = new TLatex();
   t->SetTextSize(0.08);
   t->DrawLatex(0.2,0.9,"CMSSW_1_6_9");
   TLegend *leg = new TLegend(0.2,0.2,0.8,0.4,NULL,"brNDC");
   leg->SetFillColor(10);
   leg->AddEntry(eMeanNotInter,"recontructed tracks 2 < p_{T}^{#pi^{#pm}} < 10 GeV","P");
   leg->AddEntry(eMeanInter,"not reconstructed tracks 2 < p_{T}^{#pi^{#pm}} < 10 GeV","P");
   leg->Draw();

   c3->cd(2);
   TAxis* xaxis = gleak->GetXaxis();
   gleak->GetXaxis()->SetTitle("#eta");
   gleak->GetYaxis()->SetTitle("ratio = <E_{T for lost tracks}^{raw reco} / E_{T for found tracks}^{raw reco}>");
   xaxis->SetLimits(0.0,2.4);
   gleak->SetMarkerStyle(21);
   gleak->SetMaximum(1.0);
   //  leak->SetMinimum(0.7);
   gleak->SetMinimum(0.5);
   gleak->Draw("AP");
   TLatex *t = new TLatex();
   t->SetTextSize(0.08);
   //   t->DrawLatex(0.1,0.75,"<E_{T for lost tracks}^{raw reco} / E_{T for found tracks}^{raw reco}> for p_{T}^{#pi^{#pm}} >2 GeV");
   c3->SaveAs("eMean_vs_eta_pt2-10.gif");
   c3->SaveAs("eMean_vs_eta_pt2-10.eps");

   //  original distribtions
   setTDRStyle(0,0);
   gStyle->SetOptFit(0);
开发者ID:aashaqshah,项目名称:cmssw-1,代码行数:67,代码来源:SinglePionEfficiency.C

示例15: calc


//.........这里部分代码省略.........
  TH1D *h2 = new TH1D("h2","",50,0,25);
  for(int i=0; i<nbins; i++)
    {
      double A = hp5_1->GetBinContent(i+1);
      double B = hp5_2->GetBinContent(i+1);
      double content = (B-A)/(B+A);
      hp5_asymm->SetBinContent(i+1,content);
      hp5_asymm->SetBinError(i+1,0);
      // ---
      x[i] = hp5_1->GetBinCenter(i+1);
      y[i] = content;
      y1[i] = A;
      y2[i] = B;
      x[i] -= 2.0; // offset for off-panel part of scan, needs manual adjustment
      if(i>3&&i<54)
	{
	  // offset for off-panel, needs manual adjustment
	  h1->SetBinContent(i-3,A);
	  h2->SetBinContent(i-3,B);
	  h1->SetBinError(i-3,0);
	  h2->SetBinError(i-3,0);
	}
      // ---
      fout<<hp5_asymm->GetBinCenter(i+1)<<" "
	  <<hp5_asymm->GetBinContent(i+1)<<endl;
    }
  fout.close();

  hp5_asymm->SetMarkerColor(kBlack);
  hp5_asymm->SetMarkerStyle(kFullCircle);
  hp5_asymm->Draw("ex0p");
  hp5_asymm->GetYaxis()->SetTitle("Asymmetry of light yields");
  hp5_asymm->SetMinimum(-1);
  hp5_asymm->SetMaximum(1);
  TLine line(0.0,0.0,29.0,0.0);
  line.SetLineStyle(2);
  line.SetLineWidth(2);
  line.Draw();

  // generalize
  c1->Print(Form("Figures/ASYMMETRY_%s_p%d.png",basename,projnumb));
  c1->Print(Form("Figures/ASYMMETRY_%s_p%d.pdf",basename,projnumb));

  // ---

  h1->SetLineColor(kBlue);
  h2->SetLineColor(kRed);
  h1->SetLineWidth(2);
  h2->SetLineWidth(2);
  h1->SetMinimum(0);
  h2->SetMinimum(0);

  h1->GetXaxis()->SetTitle("Distance (cm)");
  h2->GetXaxis()->SetTitle("Distance (cm)");
  h1->GetYaxis()->SetTitle("Number of photoelectrons");
  h2->GetYaxis()->SetTitle("Number of photoelectrons");

  TGraph *tgy1 = new TGraph(58,x,y1);
  TGraph *tgy2 = new TGraph(58,x,y2);

  tgy1->SetLineColor(kBlue);
  tgy2->SetLineColor(kRed);
  tgy1->SetLineWidth(2);
  tgy2->SetLineWidth(2);
  tgy1->SetMinimum(0);
  tgy2->SetMinimum(0);
开发者ID:belmonrj,项目名称:TestStand,代码行数:67,代码来源:DrawAsymmetry.C


注:本文中的TGraph::SetMaximum方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。