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


C++ TCanvas::SetCrosshair方法代码示例

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


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

示例1: VetoThres2

void VetoThres2(Int_t Lo, Int_t Hi)
{
  TCanvas* Window;
  TTimer* Refresh;
  TH1F* Energy;
  Char_t Buff[256];
  Char_t* Keyb;
  Double_t Pos[438];

  Window = new TCanvas();
  Window->SetCrosshair();
  Window->ToggleEventStatus();
  Refresh = new TTimer("Flush()", 50, kFALSE);
  for(Int_t ch=Lo; ch<Hi+1; ch++)
  {
    sprintf(Buff, "Veto_Energy%d", ch);
    Energy = (TH1F*)gROOT->FindObject(Buff);
    Energy->GetXaxis()->SetRange(0, 250);
    Energy->Draw();
    Window->Update();
    sprintf(Buff, "Threshold for %d: ", ch);
    Refresh->TurnOn();
    Refresh->Reset();
    Keyb = Getline(Buff);
    Refresh->TurnOff();
    Pos[ch] = atof(Keyb);
  }
  for(Int_t ch=Lo; ch<Hi+1; ch++)
    printf("%5.1f\n", Pos[ch]);
}
开发者ID:A2-Collaboration,项目名称:acqu,代码行数:30,代码来源:LadderTimes.cpp

示例2: VetoEnergy2

void VetoEnergy2(Int_t Lo, Int_t Hi)
{
  TCanvas* Window;
  TTimer* Refresh;
  TH1F* Energy;
  Char_t Buff[256];
  Char_t* Keyb;
  Double_t Pos[438];
  Double_t MaxVal;
  Int_t MaxBin;
  Int_t Start;

  Window = new TCanvas();
  Window->SetCrosshair();
  Window->ToggleEventStatus();
  Refresh = new TTimer("Flush()", 50, kFALSE);
  for(Int_t ch=Lo; ch<Hi+1; ch++)
  {
    sprintf(Buff, "Veto_Energy%d", ch);
    Energy = (TH1F*)gROOT->FindObject(Buff);
    Energy->GetXaxis()->SetRange(0, 500);
    Energy->Draw();
    Window->Update();
    sprintf(Buff, "Lower bound for %d: ", ch);
    Refresh->TurnOn();
    Refresh->Reset();
    Keyb = Getline(Buff);
    Refresh->TurnOff();
    Start = atoi(Keyb);
    MaxVal = 0.0;
    Pos[ch] = 0.0;
    for(Int_t bn=Start; bn<2048; bn++)
      if(Energy->GetBinContent(bn) > MaxVal)
      {
        MaxVal = Energy->GetBinContent(bn);
        Pos[ch] = 1.0*bn;
      }
  }
  for(Int_t ch=Lo; ch<Hi+1; ch++)
    printf("%4.0f\n", Pos[ch]);
}
开发者ID:A2-Collaboration,项目名称:acqu,代码行数:41,代码来源:LadderTimes.cpp

示例3: VetoEnergy3

void VetoEnergy3(Int_t Lo, Int_t Hi)
{
  TCanvas* Window;
  TTimer* Refresh;
  TH1F* Energy;
  TF1* Fit;
  Char_t Buff[256];
  Char_t* Keyb;
  Double_t Pos[438];
  Double_t Lower;
  Double_t Param[3];
  Int_t OK;

  Window = new TCanvas();
  Window->SetCrosshair();
  Window->ToggleEventStatus();
  Refresh = new TTimer("Flush()", 50, kFALSE);
  for(Int_t ch=Lo; ch<Hi+1; ch++)
  {
    sprintf(Buff, "Veto_Energy%d", ch);
    Energy = (TH1F*)gROOT->FindObject(Buff);
    Energy->Draw();
    Window->Update();

    Fit = new TF1("F1", "gaus", 0.7, 2.0);
    Energy->Fit("F1", "RQ");
    Fit->Draw("same");
    Window->Update();
    Fit->GetParameters(Param);

    Refresh->TurnOn();
    Refresh->Reset();
    sprintf(Buff, "OK for %d? ", ch);
    Keyb = Getline(Buff);
    Refresh->TurnOff();
    OK = atoi(Keyb);
    if(OK) goto Done;

Refit:
    Refresh->TurnOn();
    Refresh->Reset();
    sprintf(Buff, "Lower bound for %d: ", ch);
    Keyb = Getline(Buff);
    Refresh->TurnOff();
    Lower = atof(Keyb);

    Fit = new TF1("F1", "gaus", Lower, 2.0);
    Energy->Fit("F1", "RQ");
    Fit->Draw("same");
    Window->Update();
    Fit->GetParameters(Param);

    Refresh->TurnOn();
    Refresh->Reset();
    sprintf(Buff, "OK for %d? ", ch);
    Keyb = Getline(Buff);
    Refresh->TurnOff();
    OK = atoi(Keyb);
    if(!OK) goto Refit;

Done:
    Pos[ch] = Param[1];
  }
  for(Int_t ch=Lo; ch<Hi+1; ch++)
    printf("%8.6f\n", Pos[ch]);
}
开发者ID:A2-Collaboration,项目名称:acqu,代码行数:66,代码来源:LadderTimes.cpp


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