Instructions for Cedrics code in tvertexing.zip - January 2014 There are a couple steps that need to be taken first, but it shouldn't be too complicated. First, it doesn't matter where you place this /tvertexing/ directory after you extract it since all the links are relative. However, inside the /tvertexing/ directory you will find two symbolic links, /data/ and /minbiasdata/. This is just how I accessed the large .root files produced by the fullsim, since all of these files were stored in my workspace directory, located elsewhere. It is probably useful to do the same since it will shorten the length of the pathname that you'll type in the scripts. Now for a description of each of the directories inside /tvertexing/: /main/ -- this directory stores the scripts that do the "heavy lifting" of the simulation data analysis. Any necessary computations are performed in these scripts, and all the histograms are made here and stored as .root files under the directory /raw/. Each of these scripts are independent of the others. Some of them were just one-shot scripts that I only used to check things. ----> PUglance.C is probably not useful. I essentially just copied singleEvent.C and modified it to load all the minbias events and process them as if it were one event. This was just to give me an idea of how chaotic the ECAL looks in 140 pile-up. ----> resfit.C and resolutionFit.C were made to fit the tvertexing resolution plots. You wrote this code to fit 9 resolution histograms in the same plot. One of them doesn't work since it's the original copy which you fixed later. I can't remember which one is the working one though. ----> singleEvent.C -- this script does a lot. It handles identifying the interesting hits, which currently are just the two most energetic detections. Then it analytically time vertexes these two arrival events and fills the relevant histograms. It also has a smeared method which artificially adds smearing to arrival times to simulate uncertainty. There is also a method which only saves text results (and not histograms). This is used when processing many events where we aren't interested in visualizing each plot. This is useful for finding the resolution since many events need to be processed. /plotters/ -- This directory stores the scripts that deal with actually plotting the information produced in /main/. Here you will find three main categories of scripts. The first is commonMethods.C which tends to be used by all the other scripts. The second category are scripts that are just used for storing the filenames and parameters for the tvertexing. The last category contains bash scripts that are used to automatically rerun the scripts with small changes. ----> commonMethods.C -- this script takes care of everything, essentially. It interacts with singleEvent.C in the /main/ directory in order to produce data, then it creates the plots and saves them as .png files. If one wants to process many events, this script runs through all the events of interest, telling singleEvent.C to just save the textual results of the analysis. Then, a resolution plot is created. Furthermore, commonMethods.C automatically checks to see if data already exists for the plot it is asked to produce. If it is, it uses it so the plots are produced faster. If the data is not found, or if you explicitly ask it to refresh the data, this script calls singleEvent.C to generate the necessary data files which get stored in /raw/ for use and reuse. ----> HggVBF.C, for example (there are many of this type of file in this directory) -- Each one of these scripts has the same format. It includes commonMethods.C, and all the work is done in that script. Here you just edit the parameters. Only the first 6 variables are actually used by the tvertexing algorithm. The rest is used for other visualizing scripts I'm working on and are ignored by the tvertexer. You will find instructions for everything later in this email. ----> multirun.sh is used to plot many events (as opposed to just saving the textual results). /plots/ -- stores all the plots that are output. /raw/ -- stores all the raw data output by singleEvent.C. This includes all the histograms as .root, and all the text data as float vectors in .root files. /.git/ -- Just the git repository I was using as I worked on these scripts. Most likely not important for your purposes. Basic use instructions: Here is an example of how to use my scripts. Suppose you have some g4simhitsEcal_stuff.root and analysis_stuff.root full sim files and want to run my script on it. - First, navigate to /plotters/. Copy the file glugluH_V1.C (for example) to stuff.C. Essentially, we are just using glugluH_V1.C as a template for your stuff.C. In stuff.C, change the name variable to whatever is desired. It isn't that important; it's just the name of the window of the plot. The eventNumber variable is read to decide which event from the g4simhitsEcal_stuff.root is processed by default. It is not very important either since you can specify which event you want to look at later, so you might as well leave it as 1. The variable datafn is the path to g4simhitsEcal_stuff.root. The variable analysisfn is the path to analysis_stuff.root. The variables dataout and plotout should generally be the same. For these, enter the base name for the output plot. Event numbers will be appended. For example, if you have dataout = "stuff"; and you are plotting event 15, the output plot will have the name stuff_evnt15.png. Nothing else needs to be modified. - Now, still in the /plotters/ directory, start up root and load your file: root -l .L stuff.C To plot a specific event (say, event 15), type smearplot(true,15, 20) The "true" parameter is whether to refresh the tvertexing data. If you put false, it will use the data it finds with the expected pathname (so you can use this if you are just changing how the plot looks and you don't want to recreate the data). The next parameter is an integer, the event number. The last parameter is a float; it is the smearing (in picoseconds) applied to each arrival time to simulate uncertainty. That's it! You can now find the plot in ../plots/stuff_evnt15.png. Suppose you want to study resolution instead. While in the /plotters/ directory, type root -l .L stuff.C smearprocessMany(1,15,3) The parameters are: integer- starting event, integer- final event to process, float- artificial smearing on arrival time (in picoseconds). So, typing the above would process events 1 through 15, applying 3ps of smearing on all arrival times. The above would produce 2 plots, ../plots/stuff_tVertError3.png and ../plots/stuff_2DtVertError_3.png. The first plot is simply a resolution plot. It gives a histogram of all the errors (how far the tvertexing was from the actual vertex location). The second plot is a resolution vs eta separation. The x-axis is the eta separation of the two detections, and the y-axis is the error. Some of the comments in my code might be misleading since I reused a lot of code from my other scripts that sometimes don't have much to do with vertexing. Please ask me if something isn't doing what you'd expect it to, or if you want to do something more complicated.