Cross Talk


This page was created to explain what we did to create the ADC v. TOT fits, the process we followed, and the scripts we used.   We've made every effort to explain the little things that crept up, and how we dealt with them.  This is intended for those who are trying to re-create our steps, and who may need help troubleshooting.  Any mistakes and/or omissions are certainly unintended, but are certainly our own.  Ignacio is the real expert: any major inquiries should be directed to him.

With that said.....

The How-To of Crosstalk Cleaning


0.    Make sure these programs/scripts and the files that they need are in the same directory.  Sometimes specifying locations within a script won't work: things simply need to be in the same place (folder).  If nothing else, it will save some time and energy.  


0.5    Be sure you've checked the website  http://amanda.wisc.edu/aheffwong  for any programs/files you may need to download.  This How-To has been more or less written assuming you've checked this site, and/or are familiar with what you need.


1.    Find acceptable data runs. We chose data by looking at the events per second histograms of the runs. If the data is relatively flat (with no weird dips in the middle), then the data is ok. There will be a dip in the last bin. These histograms can be found on the Amanda monitoring website, http://butler.physik.uni-mainz.de/~amanda/monitoring/ .  Choose the main menu and then the run browser.  Select a run number and then click on global data where you will find lots of histograms.


2.    Pick out 6-10 data files from acceptable runs. We did 6 files each for 2002 and 2003 data. These raw files have names like ab_2003_065_6961_022.data.mu.min_bias.gz


3.    Run these files through Reader. A perl script,  run_reader.pl,  was written to run the reader on several files at once. Adapt this file to fit the exact year and data run and have it retrieve and save the information in the correct directories. Then run the perl script from the command line.

    (If you were doing this one file at a time, you would type:

    ab_2003_052_6929_065.data.mu.min_bias.gz. ~/reader/bin/reader -f ~/crosstalk/2003/ab_2003_052_6929_065.data.mu.min_bias.f2k -i  /data/disk5/amanda/2003/mu-daq/6929/ab_2003_052_6929_065.data.mu.min_bias.gz -r 2002 -p

    {{{program_to_run -f outfile -i infile -r year -p}}}

     The files that you get from this step will be in f2000 format. Hence, they should have the extension  .f2k, not  .gz.


4.    Next, using another perl script,  partcalib4xtalk.pl,  several steps are done at once.  First, this script performs a VME calibration.  Then, it assigns ADC's where it can.  Third, it uncalibrates everything, so that lastly, it can calibrate only the TDC's.  This is an important point: the ADC's and TOT's must be left uncalibrated for the purposes of cutting out cross talk.  So, to run  partcalib4xtalk.pl,  just make sure you've adapted the script for the the correct locations of the files produced in step 3.  This 4th step takes awhile, so consider either starting this at the end of your day, or going out for coffee.  (Or both!)


5.    The next step involves the program called  deff,  from the siegmund software package. Watch out that you have a good version. Someone changed deff and removed the -S flag necessary to break the data into strings. The perl script  sep_strings.pl  can do this step for you if you have the right deff version. Again, make sure the correct directories are identified in the script. Since only strings 5 through 10 have crosstalk problems, these are the only strings of information we will keep.

    This would be the way to run deff on one file and keep only the data on string 5: see that string 5 has been ommitted from the -S flag list.  However, it would be advantageous to use  sep_strings.pl  to do this since it will run through all of the data files and make a new, separate file for each of the strings (5-10) in each of the original files.

    /home/hodges/bin/deff_3.2-011009 -S1 -S2 -S3 -S4 -S6 -S7 -S8 -S9 -S10 -S11 -S12 -S13 -S14 -S15 -S16 -S17 -S18 -S19 infile > outfile


6.    Then, fint_it!  This takes  .f2k  files and converts them to hbook format, what paw++ can read (step 7).  It's pretty simple.  Use the  fint_it.pl  script from Ignacio's xt_2000.tar.gz (or, for our usage, we adapted it and called it  fint_it_ahw061403.pl).  Make a list of the files you want to convert, and name it something like "list."  Make sure "list" is in the same directory as your fint_it script.  Once you're finished adapting the script as you need for correct file locations and such, just type on the command line, "fint_it_ahw061403.pl list" and the list of files will be converted.


7.    PLEASE read all of this section before you perform this last step!  This one is tricky (and annoying! =) )

    The last step in this initial procedure is to run the data through Paw++.

    For starters, you MUST open Paw from the directory that the adc_tot_fit* files are in. A kumac has already been written... for example   man_fit_ahwJun1603.kumac  was the adapted version (of man_fit.kumac) we used on 2002, 2003 data. When this macro is run in Paw, a graph will pop up that shows the raw ADC vs. TOT for a specific OM.  The graph contains data from each of the files you initially chose. You then left click points along the curve and right click when finished with that graph. A red curve will pop up that (hopefully) fits the data. The green/dotted curve to the left of the red curve is a safety margin where the actual cut will occur.  The kumac then continues to cycle through all of the OMs on that particular string.

    You might want to adapt the kumac so that you are not doing all 36 OM positions on a string all at once: the program tends to lock-up frequently (whenever you are almost finished) and there is nothing to do but start over.  You can do a smaller subset of files at once by adapting the kumac to just look at certain OM positions.

    Also, make sure the kumac is reading in the correct files, and putting the finished files in the desired place.

    It is best to choose/click 8-10 points for each fit.  It would be useful to set up a specific set of rules about choosing your points. Make decisions like "I will put all points on the edge of the data, not above them."

    There are two types of OMs that you have to be aware of as you go through crosstalk cleaning. There are standard OMs and there are hybrids.  (For a list of which OMs are what, see http://amanda.wisc.edu/aheffwong.)  In the master file produced when finished (a .result file), a 1.0 denotes standard and a 0.0 denotes hybrid. (Watch out... this label is switched in other files, programs, databases, websites, etc!)  Visible in the ADC v. TOT plots, the hybrids tend to have less steep curves and are harder to fit: the program only uses two parameters to fit hybrid data, whereas standard OMs have a four parameter fit.  It is best to get points to the left of where the data will be cut off. (Crosstalk generally appears in the bottom left-hand corner.)  For hybrids, the default cut value for the OMs is 200ns, so be SURE to put your lowest point at TOT=175ns. For standard OMs, put your lowest point at 100ns, because the default cut value is 125ns.

    When finished with one set of OMs in paw++, the kumac gives you a master file (.result extension) which shows all of the OMs you just worked with.  Sometimes something screws up and a fit has to be redone.  Or maybe there was a fit you weren't happy with.  Either way, just go back into the kumac and choose the OM positions you wish to redo.  IMPORTANT! When you do a new run through Paw, make sure that you have changed the output file name in the kumac. Otherwise, your old data will be lost forever.

    From the command line, you can view an image of a fit.  Each fit is made into a gif, maybe named "blah."  So, just type  "xview blah.gif"

    The columns in the master file are:

            OM#  parameter1  parameter2  hybrid(1or0)  parameter3  parameter4  low_TOT_boundary  high_TOT_boundary

            Hybrids should have zeroes for parameters 3 and 4.

    Once you have nice fits for all of the OMs, you can take the different master files that list the OMs and their fit parameters and paste together the lines of good data into one big .result file for the string.


Written by Jessica Hodges and Amanda Heffner-Wong, June 23, 2003



Back to Cross Talk page

-- created June 23, 2003
-- updated June 25, 2003