nscl root user manual

29
NSCL S800 ROOT data analysis March 14, 2011 K. Wimmer Abstract: Documentation for the NSCL S800 ROOT data analysis programs. This code can be used to analyze data taken with the S800 and Caesar, SeGA or Hira. 1

Upload: fiore-carpino

Post on 07-Oct-2014

134 views

Category:

Documents


1 download

TRANSCRIPT

Page 1: NSCL ROOT User Manual

NSCL S800 ROOT data analysis

March 14, 2011

K. Wimmer

Abstract: Documentation for the NSCL S800 ROOT data analysis programs. This codecan be used to analyze data taken with the S800 and Caesar, SeGA or Hira.

1

Page 2: NSCL ROOT User Manual

Contents

1 Introduction 3

2 The unpacking code 42.1 S800 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 42.2 Caesar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52.3 Hira . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62.4 SeGA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.5 Scaler data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.6 Additional run information . . . . . . . . . . . . . . . . . . . . . . . . . . . 82.7 Histogramming of the unpacked data . . . . . . . . . . . . . . . . . . . . . 8

3 Calibration and reconstruction 93.1 Calibrated S800 data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93.2 Calibrated Caesar data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113.3 Calibrated Hira data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123.4 Calibrated SeGA data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 143.5 Further run information . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153.6 Histogramming and gating . . . . . . . . . . . . . . . . . . . . . . . . . . . 15

4 The GUI 164.1 The main window . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164.2 Defining histograms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

4.2.1 The Histo class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164.3 Gates, Cuts and Condition . . . . . . . . . . . . . . . . . . . . . . . . . . . 164.4 Changing the settings . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

5 The histogram viewer 165.1 Creating gates and cuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . 165.2 Fitting . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

6 Additional Programs 166.1 Graphical cuts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 166.2 CRDC sample viewer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176.3 Calibration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

6.3.1 The ion chamber . . . . . . . . . . . . . . . . . . . . . . . . . . . . 186.3.2 The CRDC pad amplitudes . . . . . . . . . . . . . . . . . . . . . . 196.3.3 The CRDC positions (mask calibration) . . . . . . . . . . . . . . . 206.3.4 Caesar energy calibration . . . . . . . . . . . . . . . . . . . . . . . 206.3.5 Timing calibration for the γ detectors . . . . . . . . . . . . . . . . . 216.3.6 Hira calibration, the Silicon strip detectors . . . . . . . . . . . . . . 216.3.7 Hira calibration, the CsI crystals . . . . . . . . . . . . . . . . . . . 226.3.8 Energy calibration for SeGA cores . . . . . . . . . . . . . . . . . . . 226.3.9 SeGA Segment calibration . . . . . . . . . . . . . . . . . . . . . . . 22

6.4 Corrections . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23

2

Page 3: NSCL ROOT User Manual

6.4.1 Time-of-flight corrections . . . . . . . . . . . . . . . . . . . . . . . . 236.4.2 Ion chamber corrections . . . . . . . . . . . . . . . . . . . . . . . . 246.4.3 Corrections for the angle at the intermediate image . . . . . . . . . 246.4.4 Acceptance corrections . . . . . . . . . . . . . . . . . . . . . . . . . 25

6.5 Useful scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256.5.1 makeCuts.C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256.5.2 converter.C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 256.5.3 FitPeaks.C . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

7 Installation 25

3

Page 4: NSCL ROOT User Manual

1 Introduction

The NSCL S800 ROOT program package is used for the analysis of experiments with theS800 spectrograph at NSCL/MSU. It allows for online and offline analysis and histogram-ming. It can be configured for SeGA, Caesar or Hira experiments. It consists of two mainprograms for unpacking, calibration and reconstruction of physical events, a graphicalinterface, a histogram viewing program, and several helper programs for calibration.The analysis of the data proceeds in two steps. In the first step the data are are extractedfrom the evt-files written by the NSCL data acquisition program and converted to rootfiles. This step is done by the Unpacker part of program. In this step the data are sortedinto Objects of type ”S800”, ”Caesar”, ”SeGA” or ”Hira” which are derived from themain root class TObject. The structure of these objects are described in section 2. Inthe second step the calibration is applied to all detector subsystems, and physical eventsare created with the help of the inverse map for ejectile reconstruction with the S800, theSeGA segment position information or ∆E −E identification of light particles with Hira(section 3). This allows to obtain ejectile momentum distributions, Doppler-corrected γ

energies and angular distributions of light charged particles detected by the Hira array.After each step Histogram files can be created. When histograms of calibrated data arecreated it is possible to impose gates and windows on the data, to obtain for exampleγ-gated momentum distributions.The flow chart in Fig. 1 shows the process of the data analysis with the NSCL S800ROOT analysis package.

Unpack_Histos.root fileraw data

Unpack

binary

Calculate

.root filecal data

.root filecuts

.dat filesettings

Cal_histos

.root filecal hists

.root fileraw hists

.evt file

Figure 1: Flow chart representing the data analysis process. Blue boxes mark in- andoutput files, red programs and green additional information needed by the programs.

Each program is called by typing its name on the commandline followed by flags defining

4

Page 5: NSCL ROOT User Manual

the programs parameters. If the program is started without any flags, a description of allflags and the expected format is printed.In the following the individual steps are described. In addition to the commandline basedprograms described in the next sections a graphical user interface has been developed.This is described in section 4. Both the unpacking as well as the calculation code areimplemented into the GUI and histograms and cuts can be defined by a few mouse clicks.However, this program is still under development, and even the final functionality will belimited to more or less what is possible with SpecTcl. For a more sophisticated analysisincluding automatic acceptance or efficiency corrections, weighting events, and especiallythe Hira particle identification the use of the commandline based programs is highlyrecommended. A basic knowledge of ROOT and object oriented programming is requiredif you want to successfully use the package, however examples are provided, which can beeasily modified to customize the code.For the S800 part as well as for SeGA the results obtained with this code have beencompared with the corresponding SpecTcl analysis. Except for rounding errors exactagreement for all parameters has been found.

2 The unpacking code

The unpacking part of the code takes a binary “.evt” file and transform it into a “.root”file. No calibrations, calculations or corrections are done in this step. The resulting “.root”file contains a tree called “tr” with two branches, one for the S800 data and one for thesecondary detector chosen. The unpacking routines are collected in the “UnpackedEvent”class. This code is very similar to the SpecTcl/ScintiSpec codes. The unpacking code iscalled by typing

Unpack -i INPUTFILE -o OUTPUTFILE (-lb NUM)

in the commandline, where “INPUTFILE” is the “.evt” file to be unpacked and “OUT-PUTFILE” the resulting root file. The optional flag “-lb NUM” can be used to unpackonly the first “NUM” buffers. This can be useful for testing.The information needed by the unpacking code are given in the “defs.h” files. Here thepacket identifiers and channel numbers are defined. With very few exceptions describedlater these files should not change unless there is a significant change in the electronicsor the readout code. For example the “S800defs.h” file contains the packet identifiers forall sub detectors in hexadecimal numbers as well as the number of channels in the CRDCand ion chamber detectors.In the following the structure of the objects written to the unpacked tree is described.Additional information can be found in the source code, i.e. “S800.hh”, “Caesar.hh” etc.and the reference at http://www.nscl.msu.edu/~wimmer/referenceguide.

2.1 S800

The S800 class contains several subclasses which are associated with the correspondingdetector systems in the S800 spectrograph. The structure is shown in Fig. 2. It is impor-

5

Page 6: NSCL ROOT User Manual

ScintillatorfIDfde_upfde_downftime_upftime_down

Crdc IonChamber TppacTimeOfFlightfrffobjfxfpftarftac_objftac_xfp

Triggerfregistrfs800fexternal1fexternal2fsecondary

fIDfdatafsample

fchannels

fdatafIDfanode

fwidth

fsamplefchannels

ftac

fchannels

fdata

fTPpacfIonChamberfCrdc[2]fScintillator[3]fToffTrigger

S800

Figure 2: Structure of the unpacked S800 data.

tant to remember that these are raw data, i.e. for example “fobj” of the TimeOfFlightis the raw time, the master trigger time “fs800” in not subtracted yet, the CRDC dataare the samples in time, pedestals are not removed. Data from the unpacked tree can beplotted from the root command line by for example:

tr->Draw("fTof.fobj-fs800")

for the OBJ time, or

tr->Draw("fTof.ftac_obj-fs800:fTof.ftac_xfp-fs800","","colz")

for a two-dimensional particle identification plot for the incoming beam using the timesrecorded with the TACs.Some variables are stored as vectors. This saves memory and computation time, butmakes it a bit difficult to plot them directly from the command line. The “Unpack histos”program can be used to histogram the CRDC and ion chamber data for calibration. ThePPAC and CRDC data can also be viewed with the “Trace” program described in 6.2.

2.2 Caesar

The Caesar data essentially consists of the energy and time information for each Fera VSNand channel stored in two-dimensional arrays “ftime[vsn][ch]” and “fenergy[vsn][ch]” (seeFig. 3). Most of the time the multiplicity of the time events is very different from theenergy events. In order to avoid looping over all 12 × 16 elements of the array whencorrelating the times with the energies the data of either the time or the energy are alsostored as vectors (“fenti”, “fvvsn” and “fvch”). The method is chosen in “Caesardefs.h”.

6

Page 7: NSCL ROOT User Manual

ftrigbit

fenergy[vsn][ch]ftmultfemultfenti

Caesar

fvvsnfvchn

ftime[vsn][ch]

Figure 3: Structure of the unpacked Caesar data.

#define FERA_TIME 1

If “FERA TIME 1” is chosen, the times are stored in the vector, and the correspondingenergies are taken from the two-dimensional array. This is faster if there are less time datathan energies. The faster method can be determined by looking at the average numberof “ftmult” and “femult”. The code will print out a warning message if the less efficientmethod is chosen. The data of a specific detector (i.e. “VSN” and “CH” combination)can be accessed on the root commandline by

tr->Draw("fenergy[VSN][CH]")

2.3 Hira

Each Hira telescope consists of a Silicon detector stack and four CsI crystals, their dataare identified by the number of the electronics tower, the slot number and the channelnumber. The Hira object itself contains vectors of Si and CsI objects as shown in Fig.4. Since the Hira data structure only contains vectors the histogramming on the root

fCsIfSi

Hira

Si

ftower

fen

fchip

fstrip

ftime

CsIfslotfchfen

Figure 4: Structure of the unpacked Hira data.

commandline is not recommended. Examples how to plot Hira data are given in the“Unpack histos.cc” source code.

7

Page 8: NSCL ROOT User Manual

2.4 SeGA

The SeGA data structure is shown in Fig. 5. It consists of the hitpattern and a vectorof Core objects. These in turn contain the energy, time and channel information of thecentral core signal as well as a hitpattern for the segments and vectors of the segmentdata.

fcorefhitpattern

SeGA

Corefhitpattern

fen

fch

ftime

fsegch

fsegen

Figure 5: Structure of the unpacked SeGA data.

2.5 Scaler data

In addition to the event data, every two second the scaler values are written to the “.evt”file. This data is also unpacked and written to a separate tree in the “.root” file called“sc”. The structure of the Scaler object is shown in Fig. 6. “NSCALER” is the number

Scalerfvalues[NSCALER]

fstartTime

fendTime

Figure 6: Structure of the Scaler data.

of scaler channels defined in “Scalerdefs.h”, this number should be larger or equal to thenumber of channels. If thats not the case an error message with every scaler event willprinted. “fstartTime” and “fendTime” are the times in seconds when the scaler numberwas reseted or read out, respectively, so their difference should be 2, if the scaler readoutis set to two seconds. The Scaler object has method to calculate the rate automatically.For the analysis of the scaler data the program “ScalerAnalysis” is used. It produces ratehistograms for each channel. It is called by:

ScalerAnalysis -i INPUTFILES -o OUTPUTFILE -s SETTINGSFILE

8

Page 9: NSCL ROOT User Manual

where “INPUTFILE” is the “.root” file containing the unpacked data and “OUTPUT-FILE” the resulting histogram root file. The settings file “SETTINGSFILE” con-tains the names of the scaler channels and has to be provided by the user. The firstline is the number of channels, followed by one line for each channel with the scalerchannel number and its name. An example is provided with the default settings athttp://www.nscl.msu.edu/~wimmer. The program can also be used to analyze the datafrom several runs by using more than one input file, for example

ScalerAnalysis -i run0[45]*.root -o scaler_040_059.root -s scalerset.dat

would analyze runs 40 to 59 and write the result to “scaler 040 059.root”. Before doingso you should check the size and the binning of the histograms in the “ScalerAnalysis.cc”source code.

2.6 Additional run information

For each run additional information on the run is written to the “.root” output file. Theclass “Runinfo” contains information like the run number, the runtime, the life time of theacquisition and the efficiencies of the detector subsystems. This information is updatedin each analysis step. The unpacking code writes the number of buffers, scaler buffers,the run number, the start and end-time of the run, as well as the scaler integrals to theclass. For a list of the members check the “Info.hh” source code. Note that some scalerchannels are hard-coded (sorry), so if the scaler channel of the raw and live clock or theXFP and OBJ scintillators changes, the code has to be updated.

2.7 Histogramming of the unpacked data

For display of the unpacked data the “Unpack histos.cc” code is called by

Unpack_histos -i INPUTFILES -o OUTPUTFILE

where “INPUTFILE” is the “.root” file containing the unpacked data and “OUTPUT-FILE” the resulting histogram root file. The program can also be used to analyze thedata from several runs by using more than one input file, for example

Unpack_histos -i run10*.root run110.root -o hrun100_110.root

would make histograms for runs 100 to 110 and write to the file “hrun100 110.root”.The data is accessed by the “getter” methods of the unpacked objects, for example if“my s800” is an instance of S800, “my S800->GetIonChamber()->GetChannels()[i]” and“my S800->GetIonChamber()->GetData()[i]” give the channel number and raw energyof channel “i” of the ion chamber. An example for each detector system is provided withthe source code.

9

Page 10: NSCL ROOT User Manual

3 Calibration and reconstruction

In the second step all calibrations of the detectors are performed. With the inverse mapfor the S800 the momenta, angles and positions of the ejectiles at the target position arereconstructed. From the position of the γ detectors the Doppler corrected energies canbe obtained. The calibration code is called by typing

Calculate -i INPUTFILE -o OUTPUTFILE -s SETTINGSFILE (-t NUM)

in the commandline, where “INPUTFILE” is the “.root” file containing the unpacked dataand “OUTPUTFILE” the resulting calibrated root file with the tree “caltr”. The settingsfile “SETTINGSFILE” contains all relevant information, such as the path to calibrationfiles, the inverse map and various other variables which are described in the followingsections. The optional flag “-t NUM” is used to indicate whether it is a source run, i.e.no valid S800 event required, or it can be used to choose a software coincidence condition.The meaning of “NUM” depends on the secondary detector system and is described inthe corresponding section. In general if “NUM” is set to zero, events are only writtenif the S800Calc is valid, i.e. the event has been recorded in the ion chamber and bothCRDCs. For source runs, or if an offline coincidence condition is imposed this value willbe different from 0. The default value of “NUM” is 0.The settings file is read as a TEnv object. General settings, which are independent ofthe secondary detector are the verbose level for testing and debugging and the number ofevents to be read. If “LastEvent” is zero all events are analyzed. Example settings filescan be found at http://www.nscl.msu.edu/~wimmer, they are not intended to be used,but to give an example of the input format of the settings and the various calibrationfiles.

3.1 Calibrated S800 data

The S800Calc class contains contains the calibrated S800 data, it consists of several sub-classes for the individual detector subsystems. The general structure shown in Fig. 7 isvery similar to the unpacked data. During the calibration several intermediate variablesare calculated which are not needed for the further analysis, however can be helpful forcalibration or to check the calibration. For example the CRDC pad with the maximumamplitude “fmaxpad” is not needed anymore once the position “fx” has been calculatedin units of cm. With a switch in the “Makefile” the storage of such parameters in the“.root” file can be suppressed. If the “Makefile” contains a line:

SWITCH += -DS800_DETAILEDTREE

the parameters indicated in blue in Fig. 7 are written to the tree. For

SWITCH += -US800_DETAILEDTREE

the output is suppressed, this saves disc space and computation time. Similar switchescan be found for the secondary detectors.The “TOF” class contains the time of flight information, in contrast to the unpackeddata, here the master trigger time “ftimes800” is subtracted. Furthermore it contains the

10

Page 11: NSCL ROOT User Manual

PADfidfxfy

PPACfid

IITRACKfxiifaiifyiifbiifazitafscatter

fIITRACKfPPAC[2]fTRACK

fICfSCINT[3]fTOF

S800Calc

ftimes800

fPAD[2]

TOFfrffobjfxfpfrfcfobjcfxfpcftac_objftac_xfpftac_objcftac_xfpc

SCINTfdeftime

IC

fdefsum

TRACKfxfpfafpfyfpfbfpfatafytafbtafdtafazitafscatterfptotfpparfptrafetot

fxfy

fcalfchanfmaxpadfpadmaxfx_gravityfx_fit

fxstripfystripfxmultfymultfxmaxfymax

fcalfchan

fdeupfdedownftimeupftimedown

Figure 7: Structure of the calibrated S800 data.

corrected time-of-flights “fobjc” etc. which are needed for the particle identification afterthe secondary target. Since the time-of-flight depends on the trajectory trough the S800,these times are corrected depending on the angles in the focal plane (“fafp” memberof TRACK) and the position on CRDC 0 (“fx” member of PAD[0]). The correctionparameters are given in the settings file by “OBJe1.Corr” for the dependence on angleand “OBJ.Corr” for the position dependence. Similar for the XFP scintillator time andthe TAC measurement. Typical values are around 1 for the angle and around 0.1 for theposition correction. Correction parameters can be obtained with the calibration procedureof the HistView program (section 5) or a fitting script described in section 6.The “fsum” member of the “IC” class is the sum of all 16 channels of the ion chamber,while “fde” is additionally corrected depending on the position of the particle in theCRDCs, since the energy loss in the ion chamber depends slightly on it (“IC.Y.Corr”,“IC.X.Corr” and “IC.X0.Corr”).For the CRDCs the calibrated charge signals of each pad are stored in the vectors “fcal”and “fchan” for the pad number. For calibration first default pedestals are subtracted

11

Page 12: NSCL ROOT User Manual

from each sample point. The pedestals are given in the “Crdc.Ped.File” file specified inthe settings file. Then for each event the pad with the maximum charge deposition isfound (“fmaxpad”) and its signal hight, as well as the two adjacent pads are saved in“fpadmax” (vector of size 3). In an iterative calibration the offsets and gains of all padsare determined by gating on several particle species identified with the ion chamber andthe time-of-flight. Calibration parameters are stored in the file “Crdc.File” defined in thesettings file. The procedure to obtain the calibration file is described in section 6. Onceall channels are calibrated the position of the particle is determined by either the centerof gravity of by a fit of the charge distribution. The method is chosen in the settingsfile by setting “Crdc.Method.N” (N = 0, 1 for CRDC 0 or 1) to 0 for center of gravity or2 for fit. After that the position in x and y in mm is obtained from runs with a maskin front of the CRDCs. The calibration parameters “Crdc.X.Offset.N”, “Crdc.X.Gain.N”are defined in the settings file. Like all calibration parameters they can be calculatedusing the calibration procedures of the HistView program (section 5).From the positions in both CRDCs the angles and position of each particle are calculated(“fxfp”,“fafp”,“fyfp” and “fbfp” members of TRACK) and with the help of the inversemap the corresponding angles at the target position are reconstructed. The file for theinverse map is defined in the settings file where “Map.File” gives the path to the inversemap file. If the distribution of angles “fata” and “fbta” are not centered around 0 thiscan be corrected with “Angle.a” and “Angle.b” in the settings file. The TRACK classfurther contains the scattering angles ϑ “fscatter” and ϕ “fazita” as well as the momenta(“fptot”, “fppar” and “fptra”) and energies “fetot” of the particle.In case the tracking PPACs are used, the calibrated S800 also contains the classes “PPAC”and “IITRACK” for the intermediate image tracking. These are very similar to the focalplane CRDCs.

3.2 Calibrated Caesar data

The CaesarCalc class contains contains the calibrated Caesar data. In addition to thecalibrated energies and times for each ring and detector of Caesar, the energies afterthe addback routine are stored as well. After correlating the energies with the timesin the Fera, the raw energies and times as well as the multiplicity are stored for latercalibration. The difference between “frawmult” and “fmult” is a software window onthe energies and times (“Caesar.Min.Energy” and “Caesar.Max.Energy” and similar fortime in the settings file). In order to correlate the Fera VSN and channel number withthe actual ring and detector number of each Caesar crystal a mapping file is needed(“Caesar.VSN.Map”). For energy and time calibration two additional files are needed(“Caesar.ECal” and “Caesar.TCal”), these contain parameters for up to a third orderpolynom for the energy and a time offset. The time can be additionally shifted by a fixedamount “Caesar.Time.Shift”. After time calibration the difference to a reference timeis taken. This is in the settings file “SeGA.Time.Method” since it is the same for theSeGA calibration. Here 0 means raw time without reference, 1 with the calibrated OBJscintillator time as reference, 4 with the calibrated RF time as reference and 5 with themaster trigger time (E1 scintillator) as reference. Methods 2 and 3 are not implementedyet. Once the energies are calibrated they can be Doppler corrected with the positions

12

Page 13: NSCL ROOT User Manual

CaesarCalc

frawmultftimesrawfenergyrawfmultfringfdetftimefenergyfdcenergyfabmultfringabfdetabfenergyabfdcenergyab

Figure 8: Structure of the calibrated Caesar data.

defined in “Caesar.Pos”. For the Doppler correction also the target position with respectto the S800 pivot point needs to be known. The values of “Target.X”, “Target.Y” and“Target.Z” in the settings file define the center of the target. The Doppler corrected energy“fdcenergy” is then calculated using the velocity β at the target position “Target.Beta”of the settings file.In the addback routine the energies of neighboring crystals are added and the position ofthe crystal with the highest energy deposition is taken as the first interaction point forthe Doppler correction. In the “Caesar.Neigh” for each detector the number of neighborsand their ring and detector number are defined. In a few cases the addback routine mightfail, due to too high detector multiplicity or wrongly defended neighbors. The calibrationcode counts the number of addback fails and prints out their percentage at the end ofthe run. If the amount of failures during the addback becomes to large, the code and thesettings file should be checked for errors.For source runs the “-t NUM” flag has to be set to any value larger than 0, as otherwiseonly events with a valid S800 subevent are written to the output tree.

3.3 Calibrated Hira data

The data written to the calibrated Hira branch contains the telescope multiplicity “fmult”and a vector of Telescopes (see Fig. 9). The structure of the Telescoped class is very similarto the unpacked Hira data. The objects “Si” and “CsI” themselves contain vectors ofenergies and channel numbers, in case of the Silicon detector also the time information,as well as the maximum energy deposited and is strip or channel number. Similar tothe other classes, uncalibrated data is also written to the branch if the switch in theMakefile is set to detailed tree. Each telescope contains three silicons, fSi[0] is the thin∆E detector, fSi[1] the front and fSi[2] the backside of the double sided strip detector.

13

Page 14: NSCL ROOT User Manual

fSi[3]ftelenum

Telescope

fCsI

fTelefmult

HiraCalc

fmultfchfenfmaxenfmaxchfenraw

CsICalcSiCalc

fmultfstripNr

ftimefmaxen

fenergy

fenrawfmaxstrip

Figure 9: Structure of the calibrated Hira data.

For the calibration of the Silicon detectors a mapping table to identify the tower and chipnumbers with the telescope number and the type of the Silicon detector is needed. Themapping table is defined in the settings “Si.Map”. A similar map is needed for the CsImapping (“CsI.Map”). For the backsides of the Silicon detectors the polarity is inverted,thus the raw energy is subtracted from the value of “Si.B.MaxEn” to obtain the correctvalue. The paths for the calibration files are the values of “Si.Cal” and “CsI.Cal” in thesettings file.Depending on the flag “-t NUM” on calling the Calculate program events are only writtento the tree if the following conditions are met. If “NUM” is set to 0 only the validity ofthe S800 part is requested, for 1 the S800 must be valid and both a ∆E and the CsI Edetector of the same telescope must have a signal above threshold. For calibration run,i.e. with the α source or a proton beam, there is no S800 trigger. If “NUM” is set to 10both ∆E and the E detector must be valid, for 11 it is sufficient if the ∆E detector isvalid, while for 12 events with a single E hit are also written to the output tree.The further analysis of Hira data like identification of the light particles, their emissionangle, the calculation of solid angle and the cross section is done in a separate step. Thecode for this which also includes some fancy methods for S800 events can be providedupon request.

14

Page 15: NSCL ROOT User Manual

3.4 Calibrated SeGA data

The structure of the calibrated SeGA data is shown in Fig. 10. Similar to the unpackeddata the “SeGACalc” contains a vector of “CoreCalc” which in turn contains the relevantinformation for each SeGA hit. In addition to detector number “fdet”, energy “fen” and

fcore

SeGACalc

fmult

CoreCalcfdet

fen

fDCen

ftime

fsegch

fsegen

fPosition

fmaxseg

Figure 10: Structure of the calibrated SeGA data.

time “ftime” the Doppler corrected energy “fDCen” and the position of the segment withthe maximum energy deposition, a TVector3 “fPosition” are written to the data. Thesegment energies are only written to file if the switch in the Makefile is set to detailedtree.The path to the calibration file for SeGA is given by the value of “SeGA.Cal.File” inthe settings file. This file contains the energy calibration parameters up to third or-der, individual time offsets for each core and the angles ϑ and ϕ of each crystal centerwith respect to the beam axis. For the time reference point the method is chosen by“SeGA.Time.Method” in the settings file. Here 0 means raw time without reference, 1with the calibrated OBJ scintillator time as reference, 4 with the calibrated RF time asreference and 5 with the master trigger time (E1 scintillator) as reference. Methods 2 and3 are not implemented yet.The positions of the segments are calculated from the angle of the center of the crys-tal with respect to the beam axis and the angle between two neighboring segments“Doppler.DeltaTheta”. A routine to read the actual position of each segment from a fileis currently under development. For the Doppler correction also the target position withrespect to the S800 pivot point needs to be known. The values of “Target.X”, “Target.Y”and “Target.Z” in the settings file define the center of the target, while “Doppler.Distance”gives the average distance of the crystal centers from the target position. The Dopplercorrected energy “fDCen” is then calculated using the velocity β at the target position“Target.Beta” of the settings file.When histogramming the SeGA data the Doppler corrected energy can be accessed withseveral get methods.

15

Page 16: NSCL ROOT User Manual

• “GetDCEnergy()” gives the energy based on the velocity β and the positions asdefined in the settings file

• with “GetDCEnergy(double beta)” the Doppler correction is recalculated with adifferent beta

• if the angle α = alpha between the γ and the ejectile is known the Doppler correctioncan be done on an event-by-event basis with “GetDCEnergy(double beta, doublealpha)”.

As for the Caesar data, for source runs the “-t NUM” flag has to be set to any value largerthan 0, as otherwise only events with a valid S800 subevent are written to the outputtree.

3.5 Further run information

In the calibration step the run information “Runinfo” is updated. Furthermore the set-tings itself are written to the output file. The settings of the inverse map, mass andcharge of the ejectile and its Bρ value, the number of entries in the unpacked tree as wellas the number of valid entries written to the output tree. The number of events in allS800 sub detector systems is counted and their respective efficiency relative to the ionchamber is calculated. At the end of the Calculate program run time a summary of therun information will be printed out.

3.6 Histogramming and gating

After the calibration steps histograms are created with the “Cal histos” program. It iscalled with

Cal_histos -i INPUTFILE -o OUTPUTFILE (-c CUTSFILE -t TAC -cal CAL)

where “INPUTFILE” is the “.root” file containing the calibrated data and “OUTPUT-FILE” the resulting histogram root file. The program can also be used to analyze thedata from several runs by using more than one input file, for example

Cal_histos -i run10*.root run110.root -o hrun100_110.root

would make histograms for runs 100 to 110 and write to the file “hrun100 110.root”.The optional flags are “CUTSFILE”, a root file containing particle identification cutsfor the incoming and outgoing beam, “TAC” to indicate whether these cuts have beencreated with the TAC (0) or TDC (1) measurement of the time (default is 0) and “CAL”to produce histograms which are used for the calibration of the detectors. In that casethe calibrated data has to include the raw parameters (i.e. the corresponding “DE-TAILEDTREE” switch has to be set). The value of “CAL” is a binary number, 1 standsfor CRDC calibration, 2 for ion chamber calibration, 4 for Hira calibration and 8 for Hirastrip calibration. Combinations of the above are possible, i.e. 3 would produce histogramsfor the CRDC and the ion chamber calibration. For the γ detectors histograms of the raw

16

Page 17: NSCL ROOT User Manual

data are obtained by using an empty calibration file, as default the gain of all detectorsis set to 1 and the offset to 0.Graphical cuts for the particle identification are created with the “makeCuts.C” script(see section 6.1 for the use of the script and the naming convention of cuts). For each cutgated histograms are created and filled. The cuts as well as the run information “runinfo”and the settings “set” from the input file are then also written to the output root file.The example “Cal histos.cc” source code provided is not meant to be a full analysis.Rather an example for each detector system of how to get data from the tree and fillhistograms is provided.

4 The GUI

4.1 The main window

4.2 Defining histograms

4.2.1 The Histo class

4.3 Gates, Cuts and Condition

4.4 Changing the settings

5 The histogram viewer

5.1 Creating gates and cuts

5.2 Fitting

6 Additional Programs

This section describes several additional programs and scripts needed for the calibrationand to determine correction parameters.

6.1 Graphical cuts

The script “makeCuts.C” allows to create graphical cuts (TCutG objects) and save themto a root file. A typical root session to create a cut on the particle identification with theion chamber and the corrected OBJ time-of-flight would look as follows.

root -l

root [0] TFile f("run025_calc.root")

root [1] caltr->Draw("fIC.fde:fTOF.ftac_objc","","colz")

root [2] .x makeCuts.C

--------------------------------------

Draw and save 2D cuts in ROOT

--------------------------------------

17

Page 18: NSCL ROOT User Manual

- set output filename by calling "setFile("YOURFILE.root")"

default name is "cutfile.root"

- start cut by calling "cut("YOURNAME")"

--------------------------------------

root [3] setFile("cuts.root")

setting filename to cuts.root

root [4] cut("in28Mgout27Na")

You can draw a cut by clicking View->Toolbar->Graphical Cut

Double-click to close cut

Cut in28Mgout27Na with 8 points

1807.47 539.725

1794.9 484.11

1804.78 441.737

1820.04 428.496

1831.72 476.165

1834.41 545.021

1819.15 587.394

1807.47 539.725

Cut in28Mgout27Na will be saved to file cuts.root

TFile** cuts.root

TFile* cuts.root

KEY: TCutG in28Mg;1 Graph

KEY: TCutG in28Mgout27Na;1 Graph

root [5]

The same can be done with histograms:

root -l

root [0] TFile h("hrun025_calc.root")

root [1] xfp_vs_obj->Draw("colz")

root [2] .x makeCuts.C

...

The cut is initialized by clicking on View→Toolbar and then on the scissor symbol on thetop right of the canvas. A cuts is closed with a double-click.For the “Cal histos” program cuts have to called “inXYZ” for the incoming beam XYZand “inXYZoutABC” for an outgoing beam ABC produced from the incoming XYZ beam.So “inXYZ” has to be created first, then the ion chamber - corrected OBJ 2D histogramsare produced with a gate on XYZ and the “inXYZoutABC” cuts are created with thishistogram. The created cuts are automatically saved to the file specified, and this file isupdated, i.e. the “inXYZoutABC” cuts should be written to a file which already containsthe corresponding “inXYZ” cut.

6.2 CRDC sample viewer

The Trace program displays the samples for the S800 CRDCs and the tracking PPACs.It is started by the command “Trace”. Fig. 11 shows the main window. The file should

18

Page 19: NSCL ROOT User Manual

Figure 11: Trace GUI

be an unpacked run, containing the raw S800 data. There are four plotting options.

• the projection for one event, this is used to see what pads have fired in the event,and to get a value for the gravity width used in the calculation step.

• projection for several events

• sample data for one event and one pad (use the projection for this event to find outwhat pads have fired)

• sample data for one event and up to ten pads

In case the PPAC is chosen, pad refers to strip number.

6.3 Calibration

In this section a few calibration programs are presented. The output format of theseprograms is such that the “.dat” files containing the calibration parameters can be di-rectly used in the settings file. For fitting most of the programs use the shared library“libPeaks.so” so make sure that this is installed.

6.3.1 The ion chamber

The “Cal histos” program as provided with the package creates a histogram for eachchannel of the ion chamber and each particle id gate in the ion chamber. The histogramscalled “ICde vs ch[ou][ch]” for outgoing beam gate number “ou” and ion chamber channel“ch” are created for “first” incoming beam only, so make sure that the incoming beamcut is on the most intense beam, and then create cuts (section 6.1) for the outgoing beamafter the target. These cuts do not have to be perfect, use approximate values for theOBJ time correction, or gate on the Z of the nucleus only. At least two particle id cuts(“blobs”) are needed for the calibration of the ion chamber with

ICCal -i INPUTFILE -o OUTPUTFILE -b NBLOBS -m MATCHINGCH

where “INPUTFILE” is the “.root” file containing the calibrated data and “OUTPUT-FILE” is the name of the output file without any extension. The program will createa calibration file “OUTPUTFILE.dat” and plot the fit result to “OUTPUTFILE.ps” to

19

Page 20: NSCL ROOT User Manual

check the quality of the fits. “int NBLOBS” is the number of particle id cuts, blobs, the de-fault value is 2. Each channel and blob histogram is then fitted with a Gaussian function.There is no absolute calibration of the ion chamber, so all channels are calibrated relativeto channel “int MATCHINGCH”. If “MATCHINGCH” is negative, then no calibrationis performed, just the result of the individual fits in printed to the “OUTPUTFILE.dat”file.

6.3.2 The CRDC pad amplitudes

The “PadCal” program is used to calibrate the CRDC pads. This is an iterative procedure,so the steps described in the following have to be repeated a few times as a new calibrationcan change for which the maximum amplitude is found. Run the “Calculate” programwith an empty calibration file for the CRDCs, but with the default pedestal settings. Thenthe “Cal histos” program is used to create histograms called “crdcpad X Y inABCoutZ”and “crdcpad0 X Y inABCoutZ” for CRDC “X”, pad “Y” and particle id cuts “inAB-CoutZ”. As for the ion chamber calibration rough cuts are sufficient, choose three outgoingbeam which are spread over the whole range of the CRDC. The “crdcpad” histograms arefilled with the value of the pad with the maximum amplitude, while for the “crdcpad0”histograms the two neighboring pad are also filled. The calibration is called by

PadCal -i INPUTFILE -o OUTPUTFILE -n NITER -m MATCHINGCH -h HIST

where “INPUTFILE” is the “.root” file containing the calibrated histograms and “OUT-PUTFILE” is the name of the output file without any extension. The program will createa calibration file “OUTPUTFILE.dat”. If ‘int HIST” is not 0 (default is 0) then the fitresult is written to “OUTPUTFILE.root” in order to check the quality of the fits. Thereis no absolute calibration of the CRDCs, so all pads are calibrated relative to pad “intMATCHINGCH”. “int NITER” is the number of the current iteration of the calibration.If “NITER = 0” then a new calibration file for the CRDCs is created, if it is larger than0 then the gains and offsets are read from “OUTPUTFILE.dat” and after the calibrationthe file is updated and the new calibration parameters are written to it. There are a fewthings which have to be adjusted in the source code itself. The name of the histograms ishard-coded, you have to choose three “blobs” which are distributed over the whole rangeof interest in the CRDC. The calibration can also be done with only one or two blobs,but then the source code has to be changed. The histogram names are defined in line 44and following of the code:

string hname[3];

hname[0] = "in28Mgout22F";

hname[1] = "in28Mgout25Ne";

hname[2] = "in28Mgout27Na";

For first two iterations the “crdcpad0” histograms are used for the calibration, after thatonly the maximum pad contributes to the calibration. This can be changed in the sourcecode lines 90 and 110 (“if(niter¡2)”). After the calibration run the “Calculate” programwith the new calibration file “OUTPUTFILE.dat”, create new histograms and rerun“PadCal” with “NITER” increased by 1. Eventually this procedure converges, i.e. the

20

Page 21: NSCL ROOT User Manual

“new” gains and offsets do not differ significantly from the “old” ones (for each CRDCand pad the “old” and “new” values are printed to the screen).

6.3.3 The CRDC positions (mask calibration)

The mask calibration is very simple, just plot the y position versus the x position for eachCRDC mask calibration run

caltr->Draw("fPAD[0].fy:fPAD[0].fx","","colz")

and determine the position of the center hole and several other holes. Fig. 12 shows asketch of the mask with the y positions of the holes in mm. The center hole marked inred is located at x = 0 mm and y = 0 mm. The gains for x is just the pad size, 2.54 mm,

4

−25

010202530

50

0

1235

6

Figure 12: Sketch of the CRDC mask used for the position calibration

the offsets in x are around 300 mm, for y the gains and offsets of the two CRDCs haveopposite sign as the drift field is reversed. Absolute values are around 110 - 150 mm forthe offset and 0.1 mm/ns for the gain. In the future a graphical method to calibrate thepositions will be implemented into the HistView program (section 5).

6.3.4 Caesar energy calibration

The Caesar array is calibrated with several γ ray sources. The program for the energycalibration is called by

CaesarCal -s SETTINGSFILE -o OUTPUTFILE -a APPROX -h HIST

“SETTINGSFILE” is a file listing the runs and sources to be used for the calibration.The first line is a comment followed by one line with the path to the histogram file anda number indicating the source used in this run, for example:

#sources 0 152Eu, 1 60Co, 2 88Y, 3 137Cs, 4 226Ra, 5 22Na, 6 133Ba, 7 57Co

hrun013_calc.root 2

hrun012_calc.root 0

21

Page 22: NSCL ROOT User Manual

The program loops over all rings (“R”) and detectors (“D”) and looks for histograms called“egamraw R D” created by the “Cal histos” program with the raw γ energies. The firstrun in the list should be taken with the 88Y source, this provides a first rough calibrationused to constrain the fits on the other sources. If you don’t want this, you have to changethe source code. The “-a APPROX” flag gives the approximate gain of the detectors, thisallows for a quick peak finding. “OUTPUTFILE” is the name of the output file withoutany extension. The program will create a calibration file “OUTPUTFILE.dat” and a psfile “OUTPUTFILE.ps” with the calibration curves. The last page of the “.ps” file showsthe calibrated energy versus the detector number (“D+24·R”) for the 88Y source run toquickly check the result. If ‘int HIST” is not 0 (default is 0) then the fit result for eachpeak as well as the calibration curve is written to “OUTPUTFILE.root”. Currently thecalibration curve is fitted with a linear function, the “Calculate” code supports howeverup to third order polynomials for the energy calibration. The fit function can be changedin the code.

6.3.5 Timing calibration for the γ detectors

The times measured with the individual channels of both the Caesar and the SeGA γ

detectors are not aligned with respect to each other and the time measured with theobject scintillator. This has to be corrected. The program “TimeCal” can fit the timeoffset corrections for both detector systems.

TimeCal -i INPUTFILE -o OUTPUTFILE -d DETECTOR -s SETPOINT -h HIST

where “INPUTFILE” is the “.root” file containing the calibrated histograms. For thetime reference the object scintillator time is subtracted from each γ time. Thus before thecalibration can be performed the data have to calibrated with an empty time calibrationfile for Caesar, and with all time values in the SeGA calibration file set to 0. Also makesure that the time method in the settings file is set to 1 OBJ. If necessary a energy gatemight be applied in the “Cal histos” program. The flag “-d DETECTOR” is used tochoose between SeGA (“-d 0”) and Caesar (“-d 1”). The program then fits histogramscalled “tgamraw C” with the SeGA core number “C” or “tgamraw R D” for ring (“R”)and detector (“D”) of Caesar. The “SETPOINT” is the time zero point, all detectors willbe calibrated to that time (the default is 0). “OUTPUTFILE” is the name of the outputfile without any extension. All fit functions are written to “OUTPUTFILE.root” if the“-h HIST” flag is not 0 (default is 0). Furthermore a postscript file “OUTPUTFILE.ps”with the histograms and fits is created. The last page of the “.ps” file shows on the leftthe raw and on the right the shifted times versus the detector number (core number “C”for SeGA and “D+24·R” for Caesar). After a successful calibration all detectors shouldbe aligned. For SeGA there is one calibration file both energies and times, so either usethe already created energy calibration file as the “OUTPUTFILE” file (a TEnv does onlyupdate the file, so the energy calibration is not deleted) or copy two files together.

6.3.6 Hira calibration, the Silicon strip detectors

to be written ...

22

Page 23: NSCL ROOT User Manual

6.3.7 Hira calibration, the CsI crystals

to be written ...

6.3.8 Energy calibration for SeGA cores

For the energy calibration of the SeGA core signals the “GammaCal” program is used.

GammaCal -i INPUTFILE -o OUTPUTFILE -s SOURCE -a APPROX -h HIST

where “INPUTFILE” is the “.root” file containing the calibrated histograms and “OUT-PUTFILE” is the name of the output file without any extension. The program will createa calibration file “OUTPUTFILE.dat”. If “-h HIST” is not 0 (default is 0) then the fitresult is written to “OUTPUTFILE.root” in order to check the quality of the fits. Theprogram searches for histograms if the type “hgeraw C” with core number “C”. Theseare created with the “Unpack histos” program. For the segments the cores have to bealready calibrated.The calibration source is chosen with “-s SOURCE”, so far 152Eu (0) and 60Co (1) areavailable, but it is very easy to implement other γ ray sources. “-a APPROX” gives theapproximate gain of the detectors, this allows for a quick peak finding, especially if thebackground lines are of similar intensity as the source. The calibration curve is a firstorder polynomial, however the “Calculate” code supports up to third order for cores. Ifhigher orders are really needed, the fitting function can easily be changed for a higherorder polynomial. At the end of the fitting procedure a plot for each fitted γ raw energyspectrum and the calibration curve is saved to “OUTPUTFILE.ps”. The last page of the“.ps” file shows a summary of the calibrated energy versus the detector number to quicklycheck the result.

6.3.9 SeGA Segment calibration

After the cores are calibrated, each segment is calibrated with respect to the core energyby gating on segment multiplicity one events. In that case the full γ energy is depositedin one segment only, and the segment energy should be the same as the core energy. Forthe calibration of the segments all runs, not only the source runs, can be used. In the“Cal histos” code for each segment a TProfile of the calibrated core energy versus thesegment energy is created. The profiles are fitted with

SegCal -i INPUTFILE -o OUTPUTFILE -r LOW HIGH -h HIST

where “INPUTFILE” and “OUTPUTFILE” as usual the in and output files. The “-rLOW HIGH” flag is used to define a fitting range for the segment energy in channels. Ifnothing is given there the fit will range from channel 10 to 3000. The profiles and fit re-sults are printed to a postscript file “OUTPUTFILE.ps” and the last page the calibratedsegment energy versus the segment number (segnr+32·corenr) is plotted. If “-h HIST” isnot 0 (default is 0) then the fit result is written to “OUTPUTFILE.root”. The result ofthe calibration is written to “OUTPUTFILE.dat”. For SeGA there is only one calibrationfile containing the time offset, and the calibration for both cores and segments. So either

23

Page 24: NSCL ROOT User Manual

use the file containing already the time and core calibration parameters as “OUTPUT-FILE.dat” (a TEnv does only update the file, so the energy calibration is not deleted) orcopy the files together. After that the angles of the detectors have to added to the file.

6.4 Corrections

In addition to the calibration parameter a number of corrections to the calibrated datahave to be made. These include position and angle dependence of time and energy loss inthe focal plane and intermediate image, as well as acceptance corrections to the momentumdistributions.

6.4.1 Time-of-flight corrections

Since the time-of-flight through the S800 spectrograph depends on the trajectory of theparticle, or its position and angle in the focal plane, the OBJ or XFP time has to becorrected to be used for the particle identification. First the time-of-flight is correctedfor its dependence on the dispersive angle in focal plane. This is done using the script“corrections.C”. when this script is executed in root (“.x corrections.C”) a help message isdisplayed. The corrections are determined by tilting the two dimensional histogram of theangle or the position versus the time by correction parameter, projecting the histogramonto the time axis, and determining the parameter for which the width of the resultingpeak is minimized. This is shown in Fig. 13, where the top row shows the peak width asa function of the correction parameter, and the bottom row the result for the correctedtwo dimensional two dimensional histogram of the angle in the focal plane versus the timefor “obj, xfp, objtac and xfptac”.

0.8 0.85 0.9 0.95 1 1.05 1.1 1.15

17.8

17.85

17.9

17.95

18

Graph

0.8 0.85 0.9 0.95 1 1.05 1.1 1.15

20.8

20.85

20.9

20.95

21

Graph

0.8 0.85 0.9 0.95 1 1.05 1.1 1.15

19.2

19.3

19.4

19.5

19.6

19.7

Graph

0.8 0.85 0.9 0.95 1 1.05 1.1 1.15

19.95

20

20.05

20.1

20.15

20.2

20.25

20.3

20.35

20.4

Graph

14001500160017001800190020002100220023002400−50

−40

−30

−20

−10

0

10

20

30

40

50

result0Entries 41910

Mean x 1931

Mean y −1.376

RMS x 89.34

RMS y 15.28

Integral 1.573e+06

0 0 0

6271572535 0

0 0 0

0

200

400

600

800

1000

result0Entries 41910

Mean x 1931

Mean y −1.376

RMS x 89.34

RMS y 15.28

Integral 1.573e+06

0 0 0

6271572535 0

0 0 0

result0

−500−400−300−200−100 0 100 200 300 400 500−50

−40

−30

−20

−10

0

10

20

30

40

50

result1Entries 47224

Mean x 143.5

Mean y −1.327

RMS x 97.7

RMS y 15.21

Integral 1.895e+06

0 0 0

511895369 5

0 0 0

0

200

400

600

800

1000

result1Entries 47224

Mean x 143.5

Mean y −1.327

RMS x 97.7

RMS y 15.21

Integral 1.895e+06

0 0 0

511895369 5

0 0 0

result1

14001500160017001800190020002100220023002400−50

−40

−30

−20

−10

0

10

20

30

40

50

result2Entries 36017

Mean x 1813

Mean y −1.404

RMS x 45.02

RMS y 15.26

Integral 1.884e+06

0 0 0

60731883879 0

0 0 0

0

200

400

600

800

1000

1200

result2Entries 36017

Mean x 1813

Mean y −1.404

RMS x 45.02

RMS y 15.26

Integral 1.884e+06

0 0 0

60731883879 0

0 0 0

result2

14001500160017001800190020002100220023002400−50

−40

−30

−20

−10

0

10

20

30

40

50

result3Entries 46864

Mean x 1981

Mean y −1.343

RMS x 99.74

RMS y 15.19

Integral 1.894e+06

0 0 0

3221894383 69

0 0 0

0

200

400

600

800

1000

result3Entries 46864

Mean x 1981

Mean y −1.343

RMS x 99.74

RMS y 15.19

Integral 1.894e+06

0 0 0

3221894383 69

0 0 0

result3

Figure 13: Correcting the time-of-flight for its dependence on the position and angle inthe focal plane

The correction parameter for the focal plane angle is determined by

afpcor("FILENAME", float "FROM", float "TO", int "STEPS", int "ITER")

24

Page 25: NSCL ROOT User Manual

where “FILENAME” is the name of the “.root” file containing the histograms “afp vs X”for “X = obj, xfp, objtac and xfptac”. “FROM” and “TO” define the range of parametersto be scanned, and “STEPS” is the number of steps. In addition it might be necessaryto adjust the fitting ranges “fitlow” and “fithigh” in lines 171 and following. It is rec-ommended to first do a rough scan to find the approximate position of the minimum,and then increase the number of steps around the minimum as the script is quite slow.The resulting parameters are printed to the screen, and can be saved to a settings fileby typing “saveset(”FILENAME”)”. If the value of “ITER” is larger than 0, the scriptwill use the already corrected histograms, and update the correction parameters when thesettings are saved.After correcting for the angle in the focal plane rerun “Calculate” with the new settings,create new histograms, and determine the position correction by:

xcor("FILENAME", float "FROM", float "TO", int "STEPS", int "ITER")

with “ITER” = 1. This way the already corrected histograms are used. The procedurecan be repeated since afp and x are not independent the x correction may influence theafp correction.

6.4.2 Ion chamber corrections

The energy loss detected with the ion chamber depends on the position of the particle,this has to be corrected in order to improve the particle identification.

Ecor = E · exp(p · (x− x0)) for x < x0

The script “corrections.C” already used for the time-of-flight correction can also be usedto determine the correction parameter p by typing on the root commandline:

.x corrections.C

iccor("FILENAME")

The script fits a TProfile derived from the histogram “ICde vs x0 inABCoutXYZ” withthe inverse of the above equation and plots the resulting corrected histogram as well as thecorresponding histogram gated only on the incoming beam “ICde vs x0 inABC”. The his-togram names have to be adjusted in the script in line 480 and 533. The start values for thefit parameters are defined in lines 492 and following. The resulting parameters are printedto the screen, and can be saved to a settings file by typing “saveset(”FILENAME”)”.

6.4.3 Corrections for the angle at the intermediate image

If the tracking PPAC detectors at the intermediate image are used the momentum distri-bution or “dta” has to be corrected for the incoming angle “aii”. This correction worksthe same way as the time-of-flight corrections, i.e. the two dimensional momentum ver-sus angle histogram is tilted by the correction parameter, then projected the onto thetime axis, and the parameter for which the width of the resulting peak is minimized isdetermined. The correction is determined using runs recorded with the unreacted beamsettings. The filenames of such runs have to be defined in the script in line 363 andfollowing. Then the correction script is started by:

25

Page 26: NSCL ROOT User Manual

.x corrections.C

momcor(int "TYPE", float "FROM", float "TO", int "STEPS")

where “FROM” and “TO” define the range of parameters to be scanned, and “STEPS” isthe number of steps. “TYPE” indicates the histogram to be used, most useful is 0 usingthe “dta vs aii” histograms.

6.4.4 Acceptance corrections

to be written ...

6.5 Useful scripts

This section describes a few scripts which are not directly related to the analysis of NSCLdata, but can be useful for other purposes as well.

6.5.1 makeCuts.C

The “makeCuts.C” script has already been described in section 6.1, it can be used forany kind of two dimensional graphical cuts.

6.5.2 converter.C

This script converts Bρ to energy, momentum, β and γ. By executing this script (“.xconverter”) a help message is displayed. Once the script is loaded type

converter(A, Z, BRho)

on the root commandline.

6.5.3 FitPeaks.C

This script is used to fit histograms with one or two Gaussian peaks and a linear back-ground. The script has been written by Oleg Ivanov, the version included here is slightlymodified. Load the program in root by typing “.L FitPeaks.C”. “GetFitPeaks()” gives alist of the available fitting functions.

7 Installation

In this section the installation procedure for the program package is described. The codehas been successfully installed on the NSCL element machines as well as on the computerin the DataU (both running Ubuntu 10.04 with g++ 4.4.3). Furthermore it has beeninstalled on an Apple MacBook, however for this installation several adjustments in theMakefile are necessary. A Makefile for Mac can be provided, however installation supportmay be limited. The package has so far not been installed on any Windows machine. Thecode has been developed and tested with the ROOT version 5.20, but it should installand run with newer ROOT versions as well.Three tarball archives have to be downloaded from http://www.nscl.msu.edu/~wimmer

26

Page 27: NSCL ROOT User Manual

• CommanLineInterface.tar.gz: the commandline interface is used to parse the inputflags (written by V. Bildstein).

• Fit.tar.gz: contains the source for a shared library of various fitting methods usedto obtain calibration parameters and to determine the CRDC positions.

• NSCL ROOT GUI.tar.gz: source code for the analysis package and the graphicaluser interface.

Create a directory for each of these and copy the tarball into the directory and unpack it.Before installing the code several path variables both in the “.rootrc” and the “.bashrc”have to be defined. Examples for these files are provided on the webpage.In the following it is assumed that the code is installed in a directory in the home directorycalled “analysis” and the sub-folders are “common”, “fit”, “gui” and “root”. Furthermorethe executables are copied to the “˜/bin” and libraries to “˜/lib” folders, these have tobe created if they do not yet exist. If you use different directories the “LIB DIR” variablein all makefiles has to be adjusted.Add the following lines to the “.bashrc” file in your home directory:

export ROOTSYS=/soft/intel/etch/root/root5.20/

export PATH=$PATH:$ROOTSYS/bin/:~/bin/

export LD_LIBRARY_PATH=$LD_LIBARYPATH:$ROOTSYS/lib/root/:~/lib/

Note that the value of “ROOTSYS” depends on your ROOT installation, this needs tobe changed accordingly if you are not working on NSCL computers.If you do not have a “.rootrc” file in your home directory, just copy the one provided withthe code. If you have one add or modify the following lines:

Unix.*.Root.DynamicPath: .:/soft/intel/etch/root/root5.20/lib/root:~/lib

Rint.Logon: ~/analysis/root/rootlogon.C

Gui.IconPath: :~/analysis/gui/icons

where again the ROOT directory might have to be changed. The “Rint.Logon” script isautomatically executed when a ROOT session is started. If you have a different logonscript, just add the libraries from the provided “rootlogon.C” script to it.Go to the commandline directory (“˜/analysis/common/”) and type “make”, then go tothe fit directory (“˜/analysis/fit/”) and type “make”. now you should have the libraries“libCommandLineInterface.so”, “libFit.so” and “libPeaks.so” in your “˜/lib/” directory.Then go to the main program directory (“˜/analysis/gui/”) and edit the “Makefile”. Thisfile is very long and a bit messy, but only a few things have to changed, and eventually Iwill clean it up and make the installation easier.

• change the “FIT DIR” and “COMMON DIR” if you use different directories in lines16 and 17

• select you secondary detector, and if you want a detailed tree by modifying the“SWTICH” variable in lines 21 to 28.

27

Page 28: NSCL ROOT User Manual

In order to create the dictionary files for ROOT, the path to the “Fit.hh” file has to beadjusted in the “SeGACalcLinkDef.h” and “CalcLinkDef.h” files. Modify the line

#pragma extra_include "/user/wimmer/analysis/Fit/Fit.hh"

in both files to the corresponding path.Now type “make”. This compiles the shared libraries, the unpacking and calibration codes,the histogramming codes as well as the graphical user interface version CoolNameHereand the “HistView” program. There may be a few warnings, especially in the compilationof the GUI, but hopefully no errors.If you have successfully installed the code, type “Unpack” on the commandline, the outputshould look like:

use Unpack with following flags:

[-lb <int >: last buffer to be read]

[-i <char*>: input file]

[-o <char*>: output file]

No input file given

Congratulations, you have mastered the installation!In order to load the libraries directly when you start a root session they are loaded with the“rootlogon.C” script. Copy the provided file to the “˜/analysis/root/” directory. In caseyou plan to use only one secondary detector, you can comment the lines corresponding tothe other.Start a new ROOT session, all libraries should load, and you can draw data from thetrees.The programs introduced in section 6 are not automatically compiled, they are compiledby typing “make PROGRAMNAME”. All fitting programs that need the “libPeaks.so”library also need the ROOT “libSpectrum.so” library for peak finding algorithms. Myversion of ROOT can not locate this library in the “$ROOTSYS/lib/root” directory eventhough it is there. Thus I made a link into my “˜/lib/” directory.

cd ~/lib/

ln -s $ROOTSYS/lib/root/libSpectrum.so .

The GUI is compiled with “make gui”. To start the main program type “Program” (noname yet, suggestions welcome), for the histogram viewer “HistView” on the command-line.

Frequently asked questions

Is it possible to run cluster files?No, and it never will be. Data from different runs are only combined in the histogrammingsteps. If you want to run a series of runs just use a shell script (example provided). If youhave access to a good computing infrastructure submitting runs to different processorscan decrease the run time of the programs by orders of magnitude.How fast in the code?

28

Page 29: NSCL ROOT User Manual

File size [Mb] step speedbinary .evt 304 Unpack 510 buffers/s

unpacked .root 194 Calculate 4300 events/scalibrated .root 255 Cal histos 18000 events/s

Table 1: Speed of the analysis programs

Slower and faster than SpecTcl. It is slower than SpecTcl, since in each individual stepa loop over all events and all subevents is executed. It is faster because the unpackingstep is performed once, the calibration step a few times. The main analysis, gating,histogramming and the extraction of physics information is done in the histogrammingstep which is very fast. For example the final analysis step of the whole e06006 experiment(S800 and Hira) takes about two minutes on the element computers (with some tricks).In addition to that the individual runs can be analyzed on different computers in parallel.Table 1 shows the file sizes and the speed of the program execution for a Caesar run withthe 152Eu source analyzed on the u5pc4 PC at NSCL. The size of the calibrated ROOTfile is larger than the unpacked, since a detailed tree was chosen, and for each event theenergy and position information before and after addback are written to the tree.

Thanks to

• D. Bazin for the original S800 and Hira unpacker

• D. Weisshaar for the Caesar and SeGA SpecTcl codes

• V. Bildstein for the CommandLineInterface code

• A. Lemasson for many suggestions and beta testing of the SeGA part

References

[1] ROOT, An Object-Oriented Data Analysis Framework, http://root.cern.ch

29