void ExportImageDialog::previewImage() { updateLegendSettings(); const Legend *legend = m_ImageExporter->getLegend(); // Preview current legend settings on sky map m_KStars->map()->setLegend( Legend( *legend ) ); m_KStars->map()->setPreviewLegend(true); // Update sky map m_KStars->map()->forceUpdate(true); // Hide export dialog hide(); }
void COpenGL::DrawLegend () { //## begin COpenGL::DrawLegend%40E265430330.body preserve=yes //void COpenGL::DrawLegend() { glPopMatrix(); glPushMatrix(); glTranslated(0.0, 0.0, m_pDS->m_zTrans); RECT rt; ::GetClientRect(m_hWnd, &rt); gluOrtho2D ((float)(rt.left + (rt.right - rt.left) / 20.), (float)(rt.right + (rt.right - rt.left) / 20.), (float)rt.top, (float)rt.bottom); Legend(rt); } //## end COpenGL::DrawLegend%40E265430330.body }
/* * Display routine */ void Doit3D(void) { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); Make2DLook(); glColor3f(1.0, 1.0, 0.0); glPuts(15, 15, "CPU Activity", font1); Legend(); Make3DLook(); glPushMatrix(); glTranslatef(-15.0, -15.0, -50.0); glRotatef (lastx, 0.0, 1.0, 0.0); glRotatef (lasty, 1.0, 0.0, 0.0); DrawGrid(); Draw3DStatistics(); glFlush(); glPopMatrix(); glutSwapBuffers(); }
void Plots::Plots() { gROOT->Reset(); gROOT->Clear(); gStyle->SetNdivisions(10); gStyle->SetCanvasBorderMode(0); gStyle->SetPadBorderMode(1); gStyle->SetOptTitle(1); gStyle->SetStatFont(42); gStyle->SetCanvasColor(10); gStyle->SetPadColor(0); gStyle->SetTitleFont(62,"xy"); gStyle->SetLabelFont(62,"xy"); gStyle->SetTitleFontSize(0.05); gStyle->SetTitleSize(0.039,"xy"); gStyle->SetLabelSize(0.046,"xy"); // gStyle->SetTitleFillColor(0); gStyle->SetHistFillStyle(1001); gStyle->SetHistFillColor(0); gStyle->SetHistLineStyle(1); gStyle->SetHistLineWidth(2); gStyle->SetHistLineColor(2); gStyle->SetTitleXOffset(1.15); gStyle->SetTitleYOffset(1.3); gStyle->SetOptStat(1110); gStyle->SetOptStat(kFALSE); // gStyle->SetOptFit(0111); gStyle->SetStatH(0.1); gStyle->SetOptFit(1011); TCanvas *c1 = new TCanvas("c1","c1",129,17,926,703); c1->SetBorderSize(2); c1->SetFrameFillColor(0); c1->SetLogy(0); c1->cd(); TFile *f[6]; TTree *MyTree[6]; f[0]= new TFile("../../Z/MisalignmentIdeal.root"); MyTree[0]=Tracks; f[1]=new TFile("../../SurveyLAS/zmumu/Misalignment_SurveyLASOnlyScenario_refitter_zmumu.root"); MyTree[1]=Tracks; f[2]=new TFile("Misalignment_SurveyLASOnlyScenario_refitter_zmumuSurveyLASCosmics.root"); MyTree[2]=Tracks; f[3]=new TFile("../../Z/Misalignment10.root"); MyTree[3]=Tracks; f[4]=new TFile("../../Z/Misalignment100.root"); MyTree[4]=Tracks; f[5]=new TFile("../../Z/Misalignment_NOAPE_2.root"); //f[5]=new TFile("../../SurveyLAS/zmumu65To100/Misalignment_SurveyLASOnlyScenario_refitter_zmumu_NOAPE.root"); MyTree[5]=Tracks; ////&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& //&&&&&&&&&&&&&&&&&&&&&&&&&&&&& /// EFFICIENCIES VS ETA ALIGNED //&&&&&&&&&&&&&&&&&&&&&&&&&&&&& hframe = new TH2F("hframe","m_{Z}",100,70.,110.,32,0.,0.075); hframe->SetXTitle("m_{Z} [GeV/c^{2}]"); hframe->SetYTitle("N. ev. / 0.4"); hframe->Draw(); char histoname[128]; char name[128]; TH1F *mZmu[6]; //Double_t lorentzianPeak(Double_t *x, Double_t *par) { // return (0.5*par[0]*par[1]/TMath::Pi()) / // TMath::Max( 1.e-10,(x[0]-par[2])*(x[0]-par[2]) + .25*par[1]*par[1]); //} //TF1 *fitFcn = new TF1("fitFcn",lorentzianPeak,70,110,3); //fitFcn->SetParameters(100,3,90); //fitFcn->SetParNames("Ftop","Fwidth","Fmass"); //fitFcn->SetLineWidth(2); for(int i=0; i<6; i++){ sprintf(name,"mZmu[%d]",i); mZmu[i] = new TH1F(name,name,100,70.,110.); sprintf(histoname,"mZmu[%d]",i); MyTree[i]->Project(histoname,"recmzmu","eff==1 && recmzmu>0."); cout << "Entries " << mZmu[i]->GetEntries() <<endl; mZmu[i]->Scale(1/mZmu[i]->GetEntries()); mZmu[i]->SetTitle("Z->#mu#mu mass from Z->#mu#mu"); mZmu[i]->SetXTitle(" GeV/c2"); mZmu[i]->SetYTitle("arb. units"); mZmu[i]->SetLineColor(i+2); // mZmu[i]->SetLineStyle(i+1); // mZmu[i]->SetLineWidth(i+2); if (i==0) { // mZmu[i]->Fit("fitFcn","0","",70,110); //const Int_t kNotDraw = 1<<9; //mZmu[i]->GetFunction("fitFcn")->ResetBit(kNotDraw); mZmu[i]->Draw("same"); } else { //mZmu[i]->Fit("fitFcn","0","",70,110); //const Int_t kNotDraw = 1<<9; //mZmu[i]->GetFunction("fitFcn")->ResetBit(kNotDraw); mZmu[i]->Draw("same"); } // c1->WaitPrimitive(); c1->Update(); } Legend("mZmu[0]","mZmu[1]","mZmu[2]","mZmu[3]","mZmu[4]","mZmu[5]",mZmu[0],mZmu[1],mZmu[2],mZmu[3],mZmu[4],mZmu[5]); c1->SaveAs("mZ_mu.gif"); c1->SaveAs("mZ_mu.eps"); gROOT->Reset(); gROOT->Clear(); delete c1; }
Policy *LoadPolicy(EvalContext *ctx, GenericAgentConfig *config) { StringSet *parsed_files_and_checksums = StringSetNew(); StringSet *failed_files = StringSetNew(); Banner("Loading policy"); Policy *policy = LoadPolicyFile(ctx, config, config->input_file, parsed_files_and_checksums, failed_files); if (StringSetSize(failed_files) > 0) { Log(LOG_LEVEL_ERR, "There are syntax errors in policy files"); exit(EXIT_FAILURE); } StringSetDestroy(parsed_files_and_checksums); StringSetDestroy(failed_files); { Seq *errors = SeqNew(100, PolicyErrorDestroy); if (PolicyCheckPartial(policy, errors)) { if (!config->bundlesequence && (PolicyIsRunnable(policy) || config->check_runnable)) { Log(LOG_LEVEL_VERBOSE, "Running full policy integrity checks"); PolicyCheckRunnable(ctx, policy, errors, config->ignore_missing_bundles); } } if (SeqLength(errors) > 0) { Writer *writer = FileWriter(stderr); for (size_t i = 0; i < errors->length; i++) { PolicyErrorWrite(writer, errors->data[i]); } WriterClose(writer); exit(EXIT_FAILURE); // TODO: do not exit } SeqDestroy(errors); } if (LogGetGlobalLevel() >= LOG_LEVEL_VERBOSE) { Legend(); ShowContext(ctx); } if (config->agent_type == AGENT_TYPE_AGENT) { Banner("Preliminary variable/class-context convergence"); } if (policy) { for (size_t i = 0; i < SeqLength(policy->bundles); i++) { Bundle *bp = SeqAt(policy->bundles, i); EvalContextStackPushBundleFrame(ctx, bp, NULL, false); for (size_t j = 0; j < SeqLength(bp->promise_types); j++) { PromiseType *sp = SeqAt(bp->promise_types, j); EvalContextStackPushPromiseTypeFrame(ctx, sp); for (size_t ppi = 0; ppi < SeqLength(sp->promises); ppi++) { Promise *pp = SeqAt(sp->promises, ppi); ExpandPromise(ctx, pp, CommonEvalPromise, NULL); } EvalContextStackPopFrame(ctx); } EvalContextStackPopFrame(ctx); } PolicyResolve(ctx, policy, config); // TODO: need to move this inside PolicyCheckRunnable eventually. if (!config->bundlesequence && config->check_runnable) { // only verify policy-defined bundlesequence for cf-agent, cf-promises if ((config->agent_type == AGENT_TYPE_AGENT) || (config->agent_type == AGENT_TYPE_COMMON)) { if (!VerifyBundleSequence(ctx, policy, config)) { FatalError(ctx, "Errors in promise bundles: could not verify bundlesequence"); } } } } JsonElement *validated_doc = ReadReleaseIdFileFromInputs(); if (validated_doc) { const char *release_id = JsonObjectGetAsString(validated_doc, "releaseId"); if (release_id) { policy->release_id = xstrdup(release_id); } JsonDestroy(validated_doc); } return policy; }
void Plots::Plots() { gROOT->Reset(); gROOT->Clear(); gStyle->SetNdivisions(10); gStyle->SetCanvasBorderMode(0); gStyle->SetPadBorderMode(1); gStyle->SetOptTitle(1); gStyle->SetStatFont(42); gStyle->SetCanvasColor(10); gStyle->SetPadColor(0); gStyle->SetTitleFont(62,"xy"); gStyle->SetLabelFont(62,"xy"); gStyle->SetTitleFontSize(0.05); gStyle->SetTitleSize(0.039,"xy"); gStyle->SetLabelSize(0.046,"xy"); // gStyle->SetTitleFillColor(0); gStyle->SetHistFillStyle(1001); gStyle->SetHistFillColor(0); gStyle->SetHistLineStyle(1); gStyle->SetHistLineWidth(2); gStyle->SetHistLineColor(2); gStyle->SetTitleXOffset(1.25); gStyle->SetTitleYOffset(1.3); gStyle->SetOptStat(1110); gStyle->SetOptStat(kFALSE); gStyle->SetOptFit(0111); gStyle->SetStatH(0.1); TCanvas *c1 = new TCanvas("c1","c1",129,17,926,703); c1->SetBorderSize(2); c1->SetFrameFillColor(0); c1->SetLogy(0); c1->cd(); TFile *f[5]; TTree *MyTree[5]; f[0]= new TFile("ValidationMisalignedTracker_singlemu100_merged.root"); MyTree[0]=EffTracks; f[1]=new TFile("../../SurveyLAS/singlemu/Misalignment_SurveyLASOnlyScenario_refitter_singlemu.root"); MyTree[1]=Tracks; f[2]=new TFile("Misalignment_SurveyLASOnlyScenario_refitter_zmumu_singlemuSurveyLASCosmics.root"); MyTree[2]=Tracks; f[3]=new TFile("../../singlemu_310607/Misalignment10.root"); MyTree[3]=Tracks; f[4]=new TFile("../../singlemu_310607/Misalignment100.root"); MyTree[4]=Tracks; ////&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& //&&&&&&&&&&&&&&&&&&&&&&&&&&&&& /// EFFICIENCIES VS ETA ALIGNED //&&&&&&&&&&&&&&&&&&&&&&&&&&&&& hframe = new TH2F("hframe","#Delta(#phi)",100,-0.0015,0.0015,32,0.,0.17); hframe->SetXTitle("#Delta(#phi) [rad]"); hframe->SetYTitle("N. ev. / 0.00003"); hframe->Draw(); char histoname[128]; char name[128]; TH1F *Resphi[5]; for(int i=0; i<5; i++){ sprintf(name,"Resphi[%d]",i); Resphi[i] = new TH1F(name,name,100,-0.0015,0.0015); sprintf(histoname,"Resphi[%d]",i); MyTree[i]->Project(histoname,"resphi","eff==1 && TrackID==13"); cout << "Entries " << Resphi[i]->GetEntries() <<endl; Resphi[i]->Scale(1/Resphi[i]->GetEntries()); Resphi[i]->SetTitle("#Delta(#phi)"); Resphi[i]->SetXTitle("#Delta(#phi) "); Resphi[i]->SetYTitle("arb. units"); Resphi[i]->SetLineColor(i+2); Resphi[i]->SetLineStyle(i+1); Resphi[i]->SetLineWidth(i+2); if (i==0) Resphi[i]->Draw("same"); else Resphi[i]->Draw("same"); // c1->WaitPrimitive(); c1->Update(); } Legend("Resphi[0]","Resphi[1]","Resphi[2]","Resphi[3]","Resphi[4]", Resphi[0],Resphi[1],Resphi[2],Resphi[3],Resphi[4]); c1->SaveAs("Residualphi_mu.eps"); c1->SaveAs("Residualphi_mu.gif"); gROOT->Reset(); gROOT->Clear(); delete c1; }
void Plots::Plots() { gROOT->Reset(); gROOT->Clear(); gStyle->SetNdivisions(10); gStyle->SetCanvasBorderMode(0); gStyle->SetPadBorderMode(1); gStyle->SetOptTitle(1); gStyle->SetStatFont(42); gStyle->SetCanvasColor(10); gStyle->SetPadColor(0); gStyle->SetTitleFont(62,"xy"); gStyle->SetLabelFont(62,"xy"); gStyle->SetTitleFontSize(0.05); gStyle->SetTitleSize(0.039,"xy"); gStyle->SetLabelSize(0.046,"xy"); // gStyle->SetTitleFillColor(0); gStyle->SetHistFillStyle(1001); gStyle->SetHistFillColor(0); gStyle->SetHistLineStyle(1); gStyle->SetHistLineWidth(2); gStyle->SetHistLineColor(2); gStyle->SetTitleXOffset(1.15); gStyle->SetTitleYOffset(1.15); gStyle->SetOptStat(1110); gStyle->SetOptStat(kFALSE); gStyle->SetOptFit(0111); gStyle->SetStatH(0.1); TCanvas *c1 = new TCanvas("c1","c1",129,17,926,703); c1->SetBorderSize(2); c1->SetFrameFillColor(0); c1->SetLogy(0); c1->cd(); TFile *f[4]; TTree *MyTree[4]; f[0]= new TFile("/tmp/ndefilip/ValidationMisalignedTracker_singlemu100_merged.root"); MyTree[0]=EffTracks; f[1]=new TFile("/tmp/ndefilip/ValidationMisalignedTracker_singlemu100_SurveyLASCosmics_merged.root"); MyTree[1]=EffTracks; f[2]=new TFile("/tmp/ndefilip/ValidationMisalignedTracker_singlemu100_10pb_merged.root"); MyTree[2]=EffTracks; f[3]=new TFile("/tmp/ndefilip/ValidationMisalignedTracker_singlemu100_100pb_merged.root"); MyTree[3]=EffTracks; ////&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&& //&&&&&&&&&&&&&&&&&&&&&&&&&&&&& /// EFFICIENCIES VS ETA ALIGNED //&&&&&&&&&&&&&&&&&&&&&&&&&&&&& char histoname[128]; char name[128]; TH1F *pullz0[4]; for(int i=0; i<4; i++){ sprintf(name,"pullz0[%d]",i); pullz0[i] = new TH1F(name,name,140,-10,10); sprintf(histoname,"pullz0[%d]",i); MyTree[i]->Project(histoname,"pullz0","eff==1 && TrackID==13"); cout << "Entries " << pullz0[i]->GetEntries() <<endl; pullz0[i]->Scale(1/pullz0[i]->GetEntries()); pullz0[i]->SetTitle("pull(z_{0})"); pullz0[i]->SetXTitle("pull(z_{0}) "); pullz0[i]->SetYTitle("arb. units"); pullz0[i]->SetLineColor(i+2); pullz0[i]->SetLineStyle(i+1); pullz0[i]->SetLineWidth(i+2); if (i==0) pullz0[i]->Draw(); else pullz0[i]->Draw("same"); // c1->WaitPrimitive(); c1->Update(); } Legend("pullz0[0]","pullz0[1]","pullz0[2]","pullz0[3]",pullz0[0],pullz0[1],pullz0[2],pullz0[3]); c1->SaveAs("pullz0_mu.eps"); c1->SaveAs("pullz0_mu.gif"); gROOT->Reset(); gROOT->Clear(); delete c1; }
Legend::Legend(int i, QColor tc, QColor bc) { Legend(i,tc,bc,false,false,false); }
Legend::Legend(int i) { Legend(i,QColor(0,0,0),QColor(255,255,255)); }