<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.iac.isu.edu/index.php?action=history&amp;feed=atom&amp;title=Plotter_OUT.C</id>
	<title>Plotter OUT.C - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.iac.isu.edu/index.php?action=history&amp;feed=atom&amp;title=Plotter_OUT.C"/>
	<link rel="alternate" type="text/html" href="https://wiki.iac.isu.edu/index.php?title=Plotter_OUT.C&amp;action=history"/>
	<updated>2026-05-09T14:51:12Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.2</generator>
	<entry>
		<id>https://wiki.iac.isu.edu/index.php?title=Plotter_OUT.C&amp;diff=120654&amp;oldid=prev</id>
		<title>Vanwdani: Created page with &quot;&lt;pre&gt; #include &quot;Riostream.h&quot; #include &quot;TFile.h&quot; #include &quot;TTree.h&quot; #include &quot;TCanvas.h&quot; #include &lt;TH1.h&gt; #include &lt;TH2.h&gt; #include &lt;TString.h&gt; #include &quot;TLatex.h&quot; #include &lt;TM...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.iac.isu.edu/index.php?title=Plotter_OUT.C&amp;diff=120654&amp;oldid=prev"/>
		<updated>2018-01-11T17:11:49Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;pre&amp;gt; #include &amp;quot;Riostream.h&amp;quot; #include &amp;quot;TFile.h&amp;quot; #include &amp;quot;TTree.h&amp;quot; #include &amp;quot;TCanvas.h&amp;quot; #include &amp;lt;TH1.h&amp;gt; #include &amp;lt;TH2.h&amp;gt; #include &amp;lt;TString.h&amp;gt; #include &amp;quot;TLatex.h&amp;quot; #include &amp;lt;TM...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include &amp;quot;Riostream.h&amp;quot;&lt;br /&gt;
#include &amp;quot;TFile.h&amp;quot;&lt;br /&gt;
#include &amp;quot;TTree.h&amp;quot;&lt;br /&gt;
#include &amp;quot;TCanvas.h&amp;quot;&lt;br /&gt;
#include &amp;lt;TH1.h&amp;gt;&lt;br /&gt;
#include &amp;lt;TH2.h&amp;gt;&lt;br /&gt;
#include &amp;lt;TString.h&amp;gt;&lt;br /&gt;
#include &amp;quot;TLatex.h&amp;quot;&lt;br /&gt;
#include &amp;lt;TMath.h&amp;gt;&lt;br /&gt;
#include &amp;lt;math.h&amp;gt; &lt;br /&gt;
// In order to run this code as a &amp;quot;macro&amp;quot; in Root, the  main function must&lt;br /&gt;
// have the same name as the source file&lt;br /&gt;
&lt;br /&gt;
void plotter_OUT()&lt;br /&gt;
{&lt;br /&gt;
        gROOT-&amp;gt;Reset();&lt;br /&gt;
        gStyle-&amp;gt;SetStatY(0.75);&lt;br /&gt;
        gStyle-&amp;gt;SetStatX(0.75);&lt;br /&gt;
        gStyle-&amp;gt;SetStatW(0.1);&lt;br /&gt;
        gStyle-&amp;gt;SetStatH(0.12);&lt;br /&gt;
        //&lt;br /&gt;
        // Initialize input filestream and output file pointers &lt;br /&gt;
        //&lt;br /&gt;
        int SolenoidField=0;&lt;br /&gt;
        double TorusField;&lt;br /&gt;
        char ShieldStatus[10]=&amp;quot;Out&amp;quot;;&lt;br /&gt;
        int Step_Number;&lt;br /&gt;
        int i;&lt;br /&gt;
        for(i=0;i&amp;lt;2;i++)                //loop over Torus Field Variables&lt;br /&gt;
        {&lt;br /&gt;
                Step_Number=i+1;&lt;br /&gt;
                TorusField=0.5*Step_Number-1.5;&lt;br /&gt;
                printf(&amp;quot;ShieldStatus=%s\n&amp;quot;,ShieldStatus);&lt;br /&gt;
                printf(&amp;quot;Step_Number=%d\n&amp;quot;,Step_Number);&lt;br /&gt;
                char root_name[200];&lt;br /&gt;
                char conditions[50];&lt;br /&gt;
                double temp;&lt;br /&gt;
                printf(&amp;quot;TorusField=%.1f\n&amp;quot;,TorusField);&lt;br /&gt;
                temp=TorusField;&lt;br /&gt;
                        printf(&amp;quot;temp=%f\n&amp;quot;,temp);&lt;br /&gt;
                temp=fmod(temp,1.0);&lt;br /&gt;
                        printf(&amp;quot;Modulus=%f\n&amp;quot;,temp);&lt;br /&gt;
&lt;br /&gt;
                if(temp==0.0)&lt;br /&gt;
                {&lt;br /&gt;
                        sprintf(root_name,&amp;quot;/home/lds/src/CLAS/GEMC/experiments/eg12/MolrBckGrd/DV/Isotropic_study/LH2_%dSol_%dTor_11GeV_IsotropicPhi_Shield%s_v2_6/LH2_%dSol_%dTor_11GeV_IsotropicPhi_Shield%s.root&amp;quot;,SolenoidField,Tor$&lt;br /&gt;
                        sprintf(conditions,&amp;quot;%dxSol\t %dxTor\t Shield%s&amp;quot;,SolenoidField,TorusField,ShieldStatus);&lt;br /&gt;
                        &lt;br /&gt;
                }&lt;br /&gt;
                if(temp!=0.0)&lt;br /&gt;
                {&lt;br /&gt;
                        sprintf(root_name,&amp;quot;/home/lds/src/CLAS/GEMC/experiments/eg12/MolrBckGrd/DV/Isotropic_study/LH2_%dSol_%.1fTor_11GeV_IsotropicPhi_Shield%s_v2_6/LH2_%dSol_%.1fTor_11GeV_IsotropicPhi_Shield%s.root&amp;quot;,SolenoidField$&lt;br /&gt;
                        sprintf(conditions,&amp;quot;%dxSol\t %.1fxTor\t Shield%s&amp;quot;,SolenoidField,TorusField,ShieldStatus);&lt;br /&gt;
                }&lt;br /&gt;
                printf(&amp;quot;root name=%s\n&amp;quot;,root_name);&lt;br /&gt;
                TFile *file = new TFile(root_name); //load the input file&lt;br /&gt;
                TCanvas *c = new TCanvas; // make a canvas&lt;br /&gt;
                c-&amp;gt;SetRightMargin(0.18);&lt;br /&gt;
                TText *xlabel = new TText();&lt;br /&gt;
                        xlabel-&amp;gt; SetNDC();&lt;br /&gt;
                        xlabel -&amp;gt; SetTextAngle(0);&lt;br /&gt;
                        xlabel -&amp;gt; SetTextSize(0.03);&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
        //get the histograms, plot to canvas and save to file&lt;br /&gt;
                TH2F *h = (TH2F*)file-&amp;gt;Get(&amp;quot;MolEThetaLabLUND&amp;quot;);&lt;br /&gt;
                h-&amp;gt;GetZaxis()-&amp;gt;SetTitleOffset(1.2);&lt;br /&gt;
                h-&amp;gt;Draw();&lt;br /&gt;
                char png_filename[200];&lt;br /&gt;
                sprintf(png_filename,&amp;quot;/home/lds/src/CLAS/GEMC/experiments/eg12/MolrBckGrd/DV/Isotropic_study/ShieldOUT_gifs/%s_MolEThetaLabLUND/MolEThetaLabLUND_%d.png&amp;quot;,ShieldStatus,Step_Number);&lt;br /&gt;
                printf(&amp;quot;PNG File=%s\n&amp;quot;,png_filename);&lt;br /&gt;
                        xlabel -&amp;gt; DrawText(0.6, 0.8,conditions);&lt;br /&gt;
                c-&amp;gt;Print(png_filename);&lt;br /&gt;
                c-&amp;gt;Clear();  //clear the canvas for a new histogram&lt;br /&gt;
&lt;br /&gt;
                TH2F *h1 = (TH2F*)file-&amp;gt;Get(&amp;quot;MolEThetaLabHITS&amp;quot;);&lt;br /&gt;
                h1-&amp;gt;GetZaxis()-&amp;gt;SetTitleOffset(1.2);&lt;br /&gt;
                h1-&amp;gt;Draw();&lt;br /&gt;
                char png_filename1[200];&lt;br /&gt;
                sprintf(png_filename1,&amp;quot;/home/lds/src/CLAS/GEMC/experiments/eg12/MolrBckGrd/DV/Isotropic_study/ShieldOUT_gifs/%s_MolEThetaLabHITS/MolEThetaLabHITS_%d.png&amp;quot;,ShieldStatus,Step_Number);&lt;br /&gt;
                        xlabel -&amp;gt; DrawText(0.6, 0.8,conditions);&lt;br /&gt;
                c-&amp;gt;Print(png_filename1);&lt;br /&gt;
                c-&amp;gt;Clear();&lt;br /&gt;
&lt;br /&gt;
                TH2F *h2 = (TH2F*)file-&amp;gt;Get(&amp;quot;MolEThetaLabLUNDWeighted&amp;quot;);&lt;br /&gt;
                h2-&amp;gt;GetZaxis()-&amp;gt;SetTitleOffset(1.4);&lt;br /&gt;
                h2-&amp;gt;Draw();&lt;br /&gt;
                char png_filename2[200];&lt;br /&gt;
                sprintf(png_filename2,&amp;quot;/home/lds/src/CLAS/GEMC/experiments/eg12/MolrBckGrd/DV/Isotropic_study/ShieldOUT_gifs/%s_MolEThetaLabLUNDWeighted/MolEThetaLabLUNDWeighted_%d.png&amp;quot;,ShieldStatus,Step_Number);&lt;br /&gt;
                        xlabel -&amp;gt; DrawText(0.6, 0.8,conditions);&lt;br /&gt;
                c-&amp;gt;Print(png_filename2);&lt;br /&gt;
                c-&amp;gt;Clear();&lt;br /&gt;
&lt;br /&gt;
                TH2F *h3 = (TH2F*)file-&amp;gt;Get(&amp;quot;MolEThetaLabHITSWeighted&amp;quot;);&lt;br /&gt;
                h3-&amp;gt;GetZaxis()-&amp;gt;SetTitleOffset(1.2);&lt;br /&gt;
                h3-&amp;gt;Draw();&lt;br /&gt;
                char png_filename3[200];&lt;br /&gt;
                sprintf(png_filename3,&amp;quot;/home/lds/src/CLAS/GEMC/experiments/eg12/MolrBckGrd/DV/Isotropic_study/ShieldOUT_gifs/%s_MolEThetaLabHITSWeighted/MolEThetaLabHITSWeighted_%d.png&amp;quot;,ShieldStatus,Step_Number);&lt;br /&gt;
                        xlabel -&amp;gt; DrawText(0.6, 0.8,conditions);&lt;br /&gt;
                c-&amp;gt;Print(png_filename3);&lt;br /&gt;
                c-&amp;gt;Clear();&lt;br /&gt;
&lt;br /&gt;
                TH1F *h4 = (TH1F*)file-&amp;gt;Get(&amp;quot;MolEPhiLabLUND&amp;quot;);&lt;br /&gt;
                h4-&amp;gt;GetZaxis()-&amp;gt;SetTitleOffset(1.2);&lt;br /&gt;
                h4-&amp;gt;Draw();&lt;br /&gt;
                char png_filename4[200];&lt;br /&gt;
                sprintf(png_filename4,&amp;quot;/home/lds/src/CLAS/GEMC/experiments/eg12/MolrBckGrd/DV/Isotropic_study/ShieldOUT_gifs/%s_MolEPhiLabLUND/MolEPhiLabLUND_%d.png&amp;quot;,ShieldStatus,Step_Number);&lt;br /&gt;
                        xlabel -&amp;gt; DrawText(0.6, 0.8,conditions);&lt;br /&gt;
                c-&amp;gt;Print(png_filename4);&lt;br /&gt;
                c-&amp;gt;Clear();&lt;br /&gt;
&lt;br /&gt;
                TH1F *h5 = (TH1F*)file-&amp;gt;Get(&amp;quot;MolEPhiLabLUNDWeighted&amp;quot;);&lt;br /&gt;
                h5-&amp;gt;GetZaxis()-&amp;gt;SetTitleOffset(1.2);&lt;br /&gt;
                h5-&amp;gt;Draw();&lt;br /&gt;
                char png_filename5[200];&lt;br /&gt;
                sprintf(png_filename5,&amp;quot;/home/lds/src/CLAS/GEMC/experiments/eg12/MolrBckGrd/DV/Isotropic_study/ShieldOUT_gifs/%s_MolEPhiLabLUNDWeighted/MolEPhiLabLUNDWeighted_%d.png&amp;quot;,ShieldStatus,Step_Number);&lt;br /&gt;
                        xlabel -&amp;gt; DrawText(0.6, 0.8,conditions);&lt;br /&gt;
                c-&amp;gt;Print(png_filename5);&lt;br /&gt;
                c-&amp;gt;Clear();&lt;br /&gt;
&lt;br /&gt;
                TH1F *h6 = (TH1F*)file-&amp;gt;Get(&amp;quot;MolEPhiLabHITS&amp;quot;);&lt;br /&gt;
                h6-&amp;gt;GetZaxis()-&amp;gt;SetTitleOffset(1.2);&lt;br /&gt;
                h6-&amp;gt;Draw();&lt;br /&gt;
                char png_filename6[200];&lt;br /&gt;
                sprintf(png_filename6,&amp;quot;/home/lds/src/CLAS/GEMC/experiments/eg12/MolrBckGrd/DV/Isotropic_study/ShieldOUT_gifs/%s_MolEPhiLabHITS/MolEPhiLabHITS_%d.png&amp;quot;,ShieldStatus,Step_Number);&lt;br /&gt;
                        xlabel -&amp;gt; DrawText(0.6, 0.8,conditions);&lt;br /&gt;
                c-&amp;gt;Print(png_filename6);&lt;br /&gt;
                c-&amp;gt;Clear();&lt;br /&gt;
&lt;br /&gt;
                TH1F *h7 = (TH1F*)file-&amp;gt;Get(&amp;quot;MolEPhiLabHITSWeighted&amp;quot;);&lt;br /&gt;
                h7-&amp;gt;GetZaxis()-&amp;gt;SetTitleOffset(1.2);&lt;br /&gt;
                h7-&amp;gt;Draw();&lt;br /&gt;
                char png_filename7[200];&lt;br /&gt;
                sprintf(png_filename7,&amp;quot;/home/lds/src/CLAS/GEMC/experiments/eg12/MolrBckGrd/DV/Isotropic_study/ShieldOUT_gifs/%s_MolEPhiLabHITSWeighted/MolEPhiLabHITSWeighted_%d.png&amp;quot;,ShieldStatus,Step_Number);&lt;br /&gt;
                        xlabel -&amp;gt; DrawText(0.6, 0.8,conditions);&lt;br /&gt;
                c-&amp;gt;Print(png_filename7);&lt;br /&gt;
                c-&amp;gt;Clear();&lt;br /&gt;
&lt;br /&gt;
                file-&amp;gt;Close();&lt;br /&gt;
&lt;br /&gt;
        }//End of loop&lt;br /&gt;
        return 0;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Vanwdani</name></author>
	</entry>
</feed>