Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
soft:root [2021/07/30 04:49] – [TF1] Ce Zhangsoft:root [2023/05/24 09:51] (current) – [ROOT study] Ce Zhang
Line 1: Line 1:
 =====ROOT study===== =====ROOT study=====
 +==== Divide ====
 +<code>
 +hHitTime_Ratio[i] = new TH1F(*hHitTime_Num[i]); 
 +hHitTime_Ratio[i]->SetName("hFRSignal"); 
 +hHitTime_Ratio[i]->Divide(hHitTime_Den[i]);
 +</code>
 +==== Sub Canvas and Pads ====
 +<code>
 +TCanvas *c1 = new TCanvas(“c1”, “c1”, w, h);
 +c1->SetWindowSize( w+(w-c1->GetWw()), h+(h-c1->GetWh()) );
 +c1->Divide(2, 1); // … or … gPad->Divide(2, 1);
 +
 +TVirtualPad *c1_1 = c1->cd(1); // enter the first pad
 +gPad->Divide(2, 2); // … or … c1_1->Divide(2, 2);
 +// enter the 4 sub-pads and do stuff
 +c1_1->cd(1); // … or … (c1->cd(1))->cd(1);
 +(new TText(0.1, 0.5, “c1 … 1 … 1”))->Draw(); gPad->Update();
 +c1_1->cd(2); // … or … (c1->cd(1))->cd(2);
 +(new TText(0.1, 0.5, “c1 … 1 … 2”))->Draw(); gPad->Update();
 +c1_1->cd(3); // … or … (c1->cd(1))->cd(3);
 +(new TText(0.1, 0.5, “c1 … 1 … 3”))->Draw(); gPad->Update();
 +c1_1->cd(4); // … or … (c1->cd(1))->cd(4);
 +(new TText(0.1, 0.5, “c1 … 1 … 4”))->Draw(); gPad->Update();
 +</code>
  
 ==== TF1 ==== ==== TF1 ====