Carpere Format
From tigwiki
The information below was cut-and-pasted with a bare minimum of formatting from the main carpere web site.
Contents |
[edit] carpere7 summary
See the carpere library page for instructions on how to compile carpere7.
carpere7 was designed to allow you to display and compare multiple histograms simulatiously. The histograms can originate from multiple sources (including MIDAS analyzers and ROOT files written to disk).
This program also provides some basic analysis, including support for graphical cuts, projections, and basic fits. See the two images below for examples of what the carpere7 user interface looks like.
Which histograms carpere7 displays is largely decided by the input file passed via the command line. The syntax used for the input file is unique to carpere7 but is straight forward. The 'load config' button in the graphical user interface allows you to load any changes made to input file after the program has been loaded.
Figure 1: snapshot of the carpere7 interface (to be included)
Figure 2: snapshot of histograms shown by carpere7 (to be included)
[edit] key concepts
carpere7 is built around the linking of sources and pads. A source is either a MIDAS analyzer or existing root file. A pad is a section on a ROOT canvas predefined for drawing histograms.
The default source for carpere7 is a MIDAS analyzer running on the localhost at port 9090. This source can be ignored or overridden a number of ways. The command line (see below) can change the default source to another machine or port, or even to a offline file. The command line can also instruct carpere7 to ignore the default source entirely.
The association between the sources and the pads to be displayed is completed within the carpere7 input file. This is also where the details of how each histogram is displayed can be altered.
Each 'display' (a single pad) or 'screen' (multiple pads) are group together into histogram groups.
[edit] command line
Like most programs created by CSM you can see the command line parameters for carpere7 by typing the program name (with no parameters) on the command line. If you do so you'll see:
Program Usage: -delay <delays between updates 100=1s> -folder <folder name> (for offline files, default=histos) -histos <histogram file> -host <host name> (default = localhost) -nodefault (ignores the default source) -offline <root file>(replaces online connection) -optstat <histogram statistics options> -port <host port> (default = 9090)
Example:
carpere7 -histos ic.carpere7 -host isdaq04
Example:
carpere7 -histos ic.carpere7 -offline last.root
example
Test these files by downloading them and using the command: carpere7 -histos demo.carpere7 -offline demo.root
(needs MIDAS analyzer output file, rossum input file)
[edit] input files
The input file is broken into blocks of settings contained within open and close tags. See below for a list of blocks supported.
open tag contained by description canvas custom canvas with size, position and pads cut a graphical cut based on a root script file display presents one or more 'histo' blocks on the default canvas (single pad) folder include every histogram in a source folder histo pad or display parameters for displaying a histogram to a 'pad' or 'display' include include another carpere7 input file within this one offline ROOT file on disk to access for histograms pad screen combines one or more 'histo' blocks to display on a pad screen combines multiple pads on a custom canvas source additional ROOT analyzer to connect to
And here is a more complete description of the syntax for each block:
[edit] canvas
custom canvas with size, position and pads
tag parameters description
canvas open tag
name <canvas name> name of this custom canvas
divide <columns> <rows> divide the canvas into multiple pads
size <width> <height> size of the canvas in pixels
position <x> <y> position of the canvas in pixels
end closing tag
Example:
canvas name canvas1 divide 1 5 size 600 950 position 200 10 end
[edit] cut
A graphical cut based on a root script file. This token should be contained by a 'display' or 'screen' block.
tag parameters description
cut open tag
lineColor <number> (optional) line color (0=kWhite, 1=kBlack, 2=kRed, etc.)
lineStyle <number> (optional) line style
lineWidth <number> (optional) line width in pixels
name <name> name to refer to this cut within the carpere7 input file
object <name> name given to the TCutG object in the script
script <file name> filename for a root script defining a graphical cut
end closing tag
Example for declaring a cut:
cut script recoils.C object Y88-1 name Y88 end
Example of using a cut:
#---------- Y88 ------------------ display name Background w/1.5MeV thresholds maxx 500 maxy 250 cut Y88 histo path BgoSingles name hsBgoE0BgoE1 source background_1.5MeV end end
Example of a root script file containing a graphical cut:
{
//========= Macro generated from object: CUTG/Graph
//========= by ROOT version5.18/00
TCutG *cutg = new TCutG("Y88-1",12);
cutg->SetVarX("Y88-1");
cutg->SetVarY("");
cutg->SetTitle("Graph");
cutg->SetFillColor(1);
cutg->SetPoint(0,182.43,135.071);
cutg->SetPoint(1,163.041,114.373);
cutg->SetPoint(2,165.148,10.3975);
cutg->SetPoint(3,177.794,-7.41305);
cutg->SetPoint(4,344.712,-6.45031);
cutg->SetPoint(5,374.218,34.4658);
cutg->SetPoint(6,372.11,84.0466);
cutg->SetPoint(7,340.497,102.82);
cutg->SetPoint(8,284.015,125.444);
cutg->SetPoint(9,237.227,138.441);
cutg->SetPoint(10,182.009,136.034);
cutg->SetPoint(11,182.43,135.071);
cutg->Draw("");
}
[edit] display
presents one or more 'histo' blocks on the default canvas (single pad)
tag parameters description
display open tag
autoRange <x> <y> (optional) set the axis <x> and <y> standard deviations wide around the mean.
cut <cut name> (optional) graphical cut to apply to this pad
group <group name> (optional) how to group this display in the interface (default=USER)
histo open tag for 'histo' block (see below)
log <axis> <axis> <axis> (optional) present the histograms on log scale on one or more axis (x, y or z)
maximum <value> (optional) maximum value presented
minimum <value> (optional) minimum value presented
maxx <value> (optional) upper limit of x axis
maxy <value> (optional) upper limit of y axis
minx <value> (optional) lower limit of x axis
miny <value> (optional) lower limit of y axis
name <name> name for this display appears in histogram list
end closing tag
Example:
display name SbE0 4.4T (projected) maxx 1800 group Surface Barrier log y histo path SbSingles project x 0 1 source Mg24_429AkeV_6plus_4.4T_recoils name hsSbE fillColor 0 lineColor 1 scale 1 end end
Example:
display name Y88 0.5MeV (overlay) group Y88 cut Y88 maxx 500 maxy 250 histo path BgoSingles name hsBgoE0BgoE1 source background_0.5MeV end histo path BgoSingles name hsBgoE0BgoE1 source Y88_0.5MeV drawOption SCAT markerColor 2 end end
[edit] folder
include every histogram in a source folder
tag parameters description
folder open tag
autoRange <x> <y> (optional) set the axis <x> and <y> standard deviations wide around the mean (all histograms).
group <name> (optional) how to group this display in the interface (default=USER)
maxx <value> (optional) upper limit of x axis (all histograms)
maxy <value> (optional) upper limit of y axis (all histograms)
minx <value> (optional) lower limit of x axis (all histograms)
miny <value> (optional) lower limit of y axis (all histograms)
path <name> source folder to check for histograms
prefix <name> (optional) change the histogram name to have leading characters
source <name> (optional) source name for this histogram (overriding default source)
end closing tag
Example:
folder path IcSingles end
[edit] histo
parameters for displaying a histogram to a 'pad' or 'display'
tag parameters description
histo open tag
drawOption <option> (optional) any of the supported ROOT histograph draw options (e.g. SCAT or SURF)
fillColor <number> (optional) fill color for 1D histogram (0=kWhite, 1=kBlack, 2=kRed, etc.)
fit <function> <option> <graphoption> <minimum> <maximum> (optional) fit a 1D histogram with built in functions, use 'none' for null options
fitColor <number> (optional) color for fit line (0=kWhite, 1=kBlack, 2=kRed, etc.)
fitWidth <pixels> (optional) width of the fit line in pixels
lineColor <number> (optional) line color for 1D histogram (0=kWhite, 1=kBlack, 2=kRed, etc.)
markerColor <number> (optional) marker color for the 2D or 3D histogram (0=kWhite, 1=kBlack, 2=kRed, etc.)
markerSize <number> (optional) marker size for the 2D or 3D histogram
markerStyle <number> (optional) marker style for the 2D or 3D histogram
name <name> histogram name in source folder
path <path> source folder containing this histo
project <axis> <min> <max> (optional) project the histogram upon an axis (restricted to min and max range)
scale <value> (optional) scale histogram so maximum = value
source <name> (optional) source name for this histogram (overriding default source)
end closing tag
Example:
histo path IcSingles name hsIcE end
Example:
histo path IcSingles name hsIcSumVsTAC source Mg24_429AkeV_6plus_6.5T_recoils drawOption SCAT markerStyle 20 markerSize 0.5 markerColor 2 end
Example:
histo path McpSingles name hsMcpTOF source Mg24_429AkeV_6plus_4.4T_recoils fillColor 0 lineColor 2 fit gaus Q same 400 700 fitWidth 2 fitColor 2 end
[edit] include
allows you to reuse such things as histogram definitions across input files
tag parameters description include file name includes another carpere7 input file
Example:
include canvas.carpere7
[edit] offline
ROOT file on disk to access for histograms
tag parameters description
offline open tag
file <file name> ROOT filename
name <name> name to refer to this source within the carpere7 input file
folder <name> base folder to locate histograms
end closing tag
Example:
offline file media/Mg24_429AkeV_6plus_4.4T_recoils.root name Mg24_429AkeV_6plus_4.4T_recoils folder histos end
[edit] pad
combines one or more 'histo' blocks to display on a pad (used within a 'screen' block)
Aside from the new opening tag ('pad') the syntax is identical to the 'display' block.
Example:
pad name IC energy (projected) maxx 1500 histo project X 1 1 path IcSingles name hsIcE end histo project X 2 2 path IcSingles name hsIcE lineColor 2 end histo project X 3 3 path IcSingles name hsIcE lineColor 3 end histo project X 4 4 path IcSingles name hsIcE lineColor 4 end histo project X 5 5 path IcSingles name hsIcE lineColor 6 end end
[edit] screen
combines multiple pads on a custom canvas
tag parameters description
screen open tag
canvas <canvas name> custom canvas to display these pads
group <name> (optional) how to group this display in the interface (default=USER)
name <name> name to refer to this source within the carpere7 input file
pad open tag for 'pad' block
end closing tag
Example:
screen name IC & MCP coincidences canvas dragon1 pad maxx 4000 histo path IcCoincidences name hcIcSum fillColor 2 end end pad name MCP TOF histo path McpCoincidences name hcMcpTOF fillColor 2 end end pad name IC_sum vs. MCP_TOF miny 2000 maxy 3300 histo path IcCoincidences name hcIcSumVsTAC drawOption SCAT markerStyle 21 markerSize 0.5 end end end
contact: ugreife@mines.edu
author: luke erikson
©2008

