Пример #1
0
Settings::Settings(QObject* parent)
    : QObject(parent),
      d(new SettingsPrivate)
{
    qDebug();

    d->readSettings();

    foreach (QAudioDeviceInfo deviceInfo, QAudioDeviceInfo::availableDevices(QAudio::AudioInput))
    {
        if (deviceInfo.deviceName() == d->inputDeviceName)
        {
            d->inputDevice = deviceInfo;
            break;
        }
    }

    if (d->inputDevice.isNull())
    {
        qDebug() << ": unable to find " << d->inputDeviceName;

        d->inputDevice = QAudioDeviceInfo::defaultInputDevice();

        qDebug() << ": fallen back to " << d->inputDevice.deviceName();
    }

    QDir().mkpath(outputLocation());
}
Пример #2
0
void FakedSeeding::Terminate()
{
  fFile->Write();
  fFile->Close();
  //TCanvas *c1 = new TCanvas();
  //c1->Print("./Plots/DeltaFakedSeeding_P_5Gev.pdf");
  TFile *f = new TFile("Histogram_FakeSeeding_Phigh.root","recreate");
  std::cout<<"L0 Selection efficiency \t "<<(double)m_L0Selected/m_Total<<std::endl;
  std::cout<<"L1 Selection efficiency \t "<<(double)m_L1Selected/m_Total<<std::endl;
  std::cout<<"L2 Selection Par1 efficiency \t "<<(double)m_L2_Par1_Selected/m_Total<<std::endl;
  std::cout<<"L2 Selection Par2 efficiency \t "<<(double)m_L2_Par2_Selected/m_Total<<std::endl;
  C_par->Write();
  Fitted_dRatio_VsXAtZ->Write();
  XBackProjVsChi2->Write();
  track_distance->Write();
  track_chi2->Write();
  track_pullHitsVsP->Write();
  track_pullHits->Write();
  L0_1d->Write();
  if(doFit)
  {
    //ALL
    Fitted_dRatio_VsYatZ->Write();
    Fitted_dRatio_VsYatZSel->Write();
    Fitted_dRatio_VsbyOveray->Write();
    Fitted_dRatio_VsbyatZ->Write();
    Fitted_dRatio_VsbyatZSel->Write();
    Fitted_dRatio_VsbyOveraySel->Write();


    Fitted_dRatioy->Write();
    Fitted_dRatioyVsC->Write();
    Fitted_dRatioyVsP->Write();
    Fitted_dRatioyVsXFirst->Write();
    Fitted_dRatio_Vs_p->Write();
    Fitted_dRatio->Write();
    C_Constant->Write();
    C_Constant_Vs_c->Write();
    C_Constant_Vs_b->Write();
    C_Constant_Vs_a->Write();
    C_Constant_Vs_P->Write();
    //No electron P>5 Gev
    Fitted_dRatio_Vs_p_Sel->Write();
    Fitted_dRatio_Sel->Write();
    C_Constant_Sel->Write();
    C_Constant_Vs_P_Sel->Write();
    XBackProj->Write();

  }
  TCanvas *c0 = new TCanvas();
  Hit_res->Draw();
  c0->Print("./Plots/ResidualDistribution_Generated.pdf");
  Hit_res->Write();
  x0vsTxInf->Write();
  ClSize_1->Write();
  //=================
  //L1
  //=================
  std::vector<TH2D*> L0_Histos;
  L0_Histos.push_back(L0_0);
  L0_Histos.push_back(L0_1);
  L0_Histos.push_back(L0_Corrected);
  TCanvas *c1 = new TCanvas();
  int size = L0_Histos.size();
  c1->Divide(2,2);
  for(Int_t i=0; i < L0_Histos.size(); i++)
  {
    c1->cd(1+i);
    L0_Histos[i]->Draw("colz");
    L0_Histos[i]->Write();
  }
  c1->cd(2);
  L0_1->Draw("colz");
  std::cout<<"Here_3"<<std::endl;
  L0_Upper_Bound->FixParameter(0,m_alphaCorrection);
  L0_Upper_Bound->FixParameter(1,L0_Up);
  L0_Lower_Bound->FixParameter(0,m_alphaCorrection);
  L0_Lower_Bound->FixParameter(1,L0_Down);
  L0_Upper_Bound->Draw("same");
  L0_Lower_Bound->Draw("same");
  c1->cd(4);
  //L0_Corrected_1d->Sumw2(true);
  //gPad->SetLogy();
  L0_Corrected_1d->Draw();
  L0_Corrected->Write();
  //L0_Corrected_1d->Write();

  std::string outputLocation("./Plots/");
  std::string extension (".pdf");
  std::string FileNameL0 ("L0Plots");
  std::string outL0 = outputLocation+FileNameL0+extension;
  const char *cstrL0 = outL0.c_str();
  c1->Print(cstrL0);
//====================
//L1
//====================
  L1_0_1D->Write();
  L1_0_corr->Write();
  L1_0->Write();
  L1_0_1D_Corr->Write();
  std::vector<TH2D*> L1_x0pos_Histos;
  L1_x0pos_Histos.push_back(L1_0_x0pos);
  L1_x0pos_Histos.push_back(L1_1_x0pos);
  L1_x0pos_Histos.push_back(L1_2_x0pos);
  std::vector<TH2D*> L1_x0neg_Histos;
  L1_x0neg_Histos.push_back(L1_0_x0neg);
  L1_x0neg_Histos.push_back(L1_1_x0neg);
  L1_x0neg_Histos.push_back(L1_2_x0neg);
  //Correction
  std::vector<TH2D*> L1_x0pos_Corr_Histos;
  L1_x0pos_Corr_Histos.push_back(L1_0_x0posCorr);
  L1_x0pos_Corr_Histos.push_back(L1_1_x0posCorr);
  L1_x0pos_Corr_Histos.push_back(L1_2_x0posCorr);
  std::vector<TH2D*> L1_x0neg_Corr_Histos;
  L1_x0neg_Corr_Histos.push_back(L1_0_x0negCorr);
  L1_x0neg_Corr_Histos.push_back(L1_1_x0negCorr);
  L1_x0neg_Corr_Histos.push_back(L1_2_x0negCorr);
  TCanvas *c2 = new TCanvas();
  c2->Divide(3,2);
  for(Int_t i=0; i < L1_x0pos_Histos.size(); i++)
  {
    c2->cd(1+i);
    //L1_x0pos_Histos[i]->SetMarkerColor(kBlue);
    L1_x0pos_Histos[i]->Draw("colz");
    L1_x0pos_Histos[i]->Write();
  }
  for(Int_t i=0; i < L1_x0neg_Histos.size(); i++)
  {
    c2->cd(4+i);
    //L1_x0pos_Histos[i]->SetMarkerColor(kBlue);
    L1_x0neg_Histos[i]->Draw("colz");
    L1_x0neg_Histos[i]->Write();
  }

  TCanvas *c3 = new TCanvas();
  c3->Divide(3,2);
  for(Int_t i=0; i < L1_x0pos_Corr_Histos.size(); i++)
  {
    c3->cd(1+i);
    //L1_x0pos_Histos[i]->SetMarkerColor(kBlue);
    L1_x0pos_Corr_Histos[i]->Draw("colz");
    L1_x0pos_Corr_Histos[i]->Write();
  }
  for(Int_t i=0; i < L1_x0neg_Corr_Histos.size(); i++)
  {
    c3->cd(4+i);
    //L1_x0pos_Histos[i]->SetMarkerColor(kBlue);
    L1_x0neg_Corr_Histos[i]->Draw("colz");
    L1_x0neg_Corr_Histos[i]->Write();
  }
  c3->cd(6);//
  ////X0 correction
  //x0<0 : res_Corr < m_m1(x+m_x0Offset) +m_yOff1 //Upper
  //       res_Corr > m_m2(x+m_x0Offset) +m_yOff2 //Lower
  //x0>0 : res_Corr > m_m2(x-m_x0Offset) -m_yOff2
  //       res_Corr < m_m1(x-m_x0Offset) -m_yOff1
  L1_x0Upper_x0neg->FixParameter(0,m_m1);
  L1_x0Upper_x0neg->FixParameter(1,m_x0Offset);
  L1_x0Upper_x0neg->FixParameter(2,m_yOff1);
  L1_x0Lower_x0neg->FixParameter(0,m_m2);
  L1_x0Lower_x0neg->FixParameter(1,m_x0Offset);
  L1_x0Lower_x0neg->FixParameter(2,m_yOff2);
  L1_x0Upper_x0neg->Draw("same");
  L1_x0Lower_x0neg->Draw("same");
  L1_x0Upper_x0neg->Write();
  L1_x0Lower_x0neg->Write();
  //x0>0
  L1_x0Upper_x0pos->FixParameter(0,m_m1);
  L1_x0Upper_x0pos->FixParameter(1,m_x0Offset);
  L1_x0Upper_x0pos->FixParameter(2,m_yOff1);
  L1_x0Lower_x0pos->FixParameter(0,m_m2);
  L1_x0Lower_x0pos->FixParameter(1,m_x0Offset);
  L1_x0Lower_x0pos->FixParameter(2,m_yOff2);
  c3->cd(3);
  L1_x0Upper_x0pos->Draw("same");
  L1_x0Lower_x0pos->Draw("same");
  L1_x0Lower_x0pos->Write();
  L1_x0Upper_x0pos->Write();
  std::string FileNameL1 ("L1Plots");
  std::string outL1 = outputLocation+FileNameL1+extension;
  const char *cstrL1 = outL1.c_str();
  std::string FileNameL1_Corr ("L1Plots_Corr");
  std::string outL1_Corr = outputLocation+FileNameL1_Corr+extension;
  const char *cstrL1_Corr = outL1_Corr.c_str();
  c2->Print(cstrL1);
  c3->Print(cstrL1_Corr);

  //=======================
  //L2
  //======================
  std::vector<TH1D*> L2_0_Histos;
  L2_0_Histos.push_back(L2_0_T1_par1);
  L2_0_Histos.push_back(L2_0_T1_par2);
  L2_0_Histos.push_back(L2_0_T2_par1);
  L2_0_Histos.push_back(L2_0_T2_par2);
  L2_0_Histos.push_back(L2_0_T3_par1);
  L2_0_Histos.push_back(L2_0_T3_par2);
  TCanvas *c4 = new TCanvas();
  c4->Divide(3,2);
  int j=0;
  for(Int_t i=0; i < (L2_0_Histos.size())/2; i++)
  {
    c4->cd(1+i);
    //L1_x0pos_Histos[i]->SetMarkerColor(kBlue);
    gPad->SetLogy();
    L2_0_Histos[j+1]->SetName("With Par2");
    L2_0_Histos[j+1]->SetLineColor(kBlue);
    L2_0_Histos[j+1]->Draw("");
    L2_0_Histos[j+1]->Write();
    L2_0_Histos[j]->SetLineColor(kRed);
    L2_0_Histos[j]->SetName("With Par1");
    L2_0_Histos[j]->Draw("same");
    L2_0_Histos[j]->Write();

    //gPad->BuildLegend();
    j+=2;
  }
  c4->cd(4);
  gPad->SetLogy();
  Chi2_par1->SetLineColor(kRed);
  Chi2_par1->Draw();
  Chi2_par2->SetLineColor(kBlue);
  Chi2_par2->Draw("same");
  c4->cd(5);
  Hit_res->Draw();
  Chi2_par1->Write();
  Chi2_par2->Write();
  c4->Print("./Plots/L2_0_ResidualsPlots.pdf");
  f->Close();
}