EEMC Calibration tips

Random items about EEMC calibration code, etc.

Notes on Calibration Scheme

  1. http://www.star.bnl.gov/public/eemc/calibration/run4/calibUnits/  has physics background
  2. http://web.mit.edu/rhic-spin/public/eemc-bnl/calibration/ has lots of links, perhaps the most useful is http://web.mit.edu/rhic-spin/public/eemc-bnl/calibration/run4/smdMip00xx00/
  3. http://www.star.bnl.gov/public/eemc/calibration/run5/absMipCal/ for run 5 is pretty useful
  4. Scott's talk at calorimeter workshop is attached.

 Some other useful references on particle detectors are the pdg reviews below:

  1. http://pdg.lbl.gov/2009/reviews/rpp2009-rev-passage-particles-matter.pdf
  2. http://pdg.lbl.gov/2009/reviews/rpp2009-rev-particle-detectors-accel.pdf

 

 

New Instructions!

make a clean directory somewhere

89 /star/data01/pwg/aliceb $ mkdir cal

 

90 /star/data01/pwg/aliceb $ cd cal/

 

cp the tar file located at /star/u/aliceb/Calibration/2010-may-18/eemc_calibration.tar and unpack it

 /star/data01/pwg/aliceb/cal $ cp /star/u/aliceb/Calibration/2010-may-18/eemc_calibration.tar .

/star/data01/pwg/aliceb/cal $ tar -xvf eemc_calibration.tar

Note: if you have not done so, make a directory for yourself on the valpo disk by mkdir /star/institutions/valpo/<user_name>.  Then make a directory there called EEMC_cal with mkdir /star/institutitions/valpo/<user_name>/EEMC_cal

Now, run the perl script createLinks.pl

128 /star/data01/pwg/aliceb/cal $ createLinks.pl
User is aliceb
Your output directory on valpo disk exits!
129 /star/data01/pwg/aliceb/cal $ ls
createLinks.pl*  EEMC_cal@  eemc_calibration.tar  lists/  macros@  Sched/  StRoot/
 

Setup star version SL10c and compile

/star/data01/pwg/aliceb/cal $ starver SL10c

/star/data01/pwg/aliceb/cal $ cons

To submit a bunch of jobs go to Sched directory

Then run the perl script submit.pl <argument> <iteration>

<argument> can either be an individual run number - valid runs are the lists/ directory, or all for all runs.  Iteration will allow you to keep directories separate - start with 0.  For example:

138 /star/data01/pwg/aliceb/cal $ cd Sched/
139 /star/data01/pwg/aliceb/cal/Sched $ ls lists/
allRuns.lis         R10122083.lis  R10135052.lis  R10149074.lis  R10162022.lis  R10172047.lis
get_run_lists.pl*   R10123051.lis  R10136009.lis  R10150004.lis  R10163004.lis  R10172075.lis
get_run_lists.pl~*  R10123084.lis  R10136056.lis  R10150048.lis  R10163046.lis  R10173003.lis
query.txt           R10124035.lis  R10136091.lis  R10151014.lis  R10164007.lis  R10173028.lis
query.txt~          R10124108.lis  R10137029.lis  R10151033.lis  R10164023.lis  R10173074.lis
R10112016.lis       R10125052.lis  R10138003.lis  R10151055.lis  R10164055.lis  R10174008.lis
R10113008.lis       R10125074.lis  R10138045.lis  R10152021.lis  R10165005.lis  R10174042.lis
R10113053.lis       R10125090.lis  R10138073.lis  R10154059.lis  R10165038.lis  R10174065.lis
R10114015.lis       R10126039.lis  R10139032.lis  R10154082.lis  R10165068.lis  R10174091.lis
R10114069.lis       R10126062.lis  R10139037.lis  R10155094.lis  R10166010.lis  R10175036.lis
R10115015.lis       R10127005.lis  R10139100.lis  R10156021.lis  R10166053.lis  R10176014.lis
R10115065.lis       R10127042.lis  R10141007.lis  R10156030.lis  R10167005.lis  R10177005.lis
R10116008.lis       R10128040.lis  R10142010.lis  R10156085.lis  R10167046.lis  R10177054.lis
R10116029.lis       R10128093.lis  R10142078.lis  R10157013.lis  R10169003.lis  R10178016.lis
R10116039.lis       R10129026.lis  R10143004.lis  R10157048.lis  R10169028.lis  R10178054.lis
R10117025.lis       R10129046.lis  R10143041.lis  R10158009.lis  R10169063.lis  R10179030.lis
R10117084.lis       R10130009.lis  R10143074.lis  R10158041.lis  R10170009.lis  R10179057.lis
R10120005.lis       R10131007.lis  R10144019.lis  R10158073.lis  R10170043.lis  R10179083.lis
R10120058.lis       R10131027.lis  R10144064.lis  R10159005.lis  R10170073.lis  R10180014.lis
R10120077.lis       R10131074.lis  R10145007.lis  R10159038.lis  R10170087.lis  uniqueRuns.lis
R10120092.lis       R10131081.lis  R10145068.lis  R10160003.lis  R10171007.lis
R10121015.lis       R10134007.lis  R10146010.lis  R10160023.lis  R10171010.lis
R10121087.lis       R10134019.lis  R10146068.lis  R10160066.lis  R10171030.lis
R10122004.lis       R10134083.lis  R10147123.lis  R10161004.lis  R10171058.lis
R10122046.lis       R10135023.lis  R10148065.lis  R10162004.lis  R10172012.lis
140 /star/data01/pwg/aliceb/cal/Sched $ submit.pl 10112016 0
You are in directory /star/data01/pwg/aliceb/cal/Sched!
But your parent directory is /star/data01/pwg/aliceb/cal/!
Results will be stored in existing directory ../EEMC_cal/iter-0
Directory contents:
histo  log  ps  table
star-submit-template -template sub.xml  -entities 'RUN=10112016,ITER=0,PARENT=/star/data01/pwg/aliceb/cal/'
STAR Template Scheduler 0.1 (/afs/rhic.bnl.gov/star/packages/scripts/star-submit)

STAR Scheduler 1.10.1
*** Note: The default directory in which jobs start has be fix to $SCRATCH ***
Your Log file can be found at: /afs/rhic.bnl.gov/star/doc/www/html/tmp/pub/scheduler/aliceb.log
Reading request description file : schedTemplateExp.xml
Analyzing XML...XML OK
Testing queue (bnl_condor_short@STAR - Local Access Method) ...Done(passed)
Testing queue (BNL_condor_medium@STAR - Local Access Method) ...(passed)
Testing queue (bnl_condor_rcas_long@STAR - Local Access Method) ...(passed)
Dispatching process 95E7E89CE076D566C2E670130A1E03F4_0................. done.
Wrote scheduling report to : /star/data01/pwg/aliceb/cal/Sched/sched95E7E89CE076D566C2E670130A1E03F4.report
Reporting statistics... done.

Running UCM logger member...done.
Scheduling successful
 

You can check that your job is running with condor_q -submitter $USER

 /star/data01/pwg/aliceb/cal/Sched $ condor_q -submitter $USER

-- Submitter: aliceb@bnl.gov : <130.199.206.67:37299> : rcas6017.rcf.bnl.gov
 ID      OWNER            SUBMITTED     RUN_TIME ST PRI SIZE CMD
274921.0   aliceb          6/4  16:02   0+00:00:00 I  10  0.0  sched95E7E89CE076D

1 jobs; 1 idle, 0 running, 0 held
 

When the job is done the sched<blah>.condor.log will tell you something like "job terminated with normal termination value."  You should see R<run_number>.hist.root files in your EEMC_cal/iter-<iter>/histo directory:

ls EEMC_cal/iter-0/histo/
R10121087.hist.root

Next step is to move add histograms from multiple files (if needed), redirect their output to different files for each sector and start fitting slopes.  You can do all this with: the bigSectloop.sh script, which takes one argument - the iteration you are on

/star/data01/pwg/aliceb/cal $ macros/bigSectloop.sh 0

 

when that is all done you should find some pdf files of the filts in your EEMC_cal/iter-<iter>/ps directory and .dat text files in your EEMC_cal/iter-<iter>/tables directory

Let me know if you have problems.

 

 

Code Notes

-The library used for pp200 production was SL10c code should probably be run with this library unless we have a good reason not to.  To set it up type

starver SL10c

 

-For various reasons it is important to use data that has status tables made already.  A good set of runs to look at for this would be the zdc polarimetry data taken at the beginning of every fill (when those runs included the endcap).  You can use the file catalog to query for these runs. Do:

get_file_list.pl -keys 'runnumber' -cond 'eemc=1,library=SL10c,filetype=daq_reco_mudst,storage!~HPSS,filename~st_physics,trgsetupname~zdc_polarimetry,sanity=1'

you could redirect this output to a file called "runs.list" like:

 get_file_list.pl -keys 'runnumber' -cond 'eemc=1,library=SL10c,filetype=daq_reco_mudst,storage!~HPSS,filename~st_physics,trgsetupname~zdc_polarimetry,sanity=1' > runs.list

-The code is stored on cvs in StRoot/StEEmcPool/StEzSmdCal/  (needed several mods)

-The bit that does the work on the Mudsts is the maker StRoot/StEEmcPool/StEzSmdCal/StEEsmdCalMaker.cxx which calls other code in that directory. 

-The code that makes the histograms is run with StRoot/StEEmcPool/StEzSmdCal/macros/rdEztMuSmdCal.C  I had to make quite a few changes to this to get it to run so grab mine:

 

 

 

Code Updates 1 June 2010

I modifed the cvs code to accept more than one trigger ID - it now stores a vector instead of a single integer.  You'll need to just copy my entire directory to get the code.  This will also get you run lists and some useful scripts for submitting runs.   So do:

 

 

Updates 2 June 2010

After figuring out the error from doSmdCal.C was because the calbiration from slopes hadn't been done first, I fixed this.  Next found that for whatever reason the v plane wasn't fitting anything even though the plots looked just fine.  I went into SmdGains.cxx and added a user defined exponential function so we could have control over the initial parameters.  This seems to have fixed it.  I also cleaned up some memory issues.  Then I went back to bigSectLoop.sh and modified it so it would do the hadd and then run doSmdCal.C on each plane for each sector.  It accepts one input argument - the iteration (which is the same as the input to doSmdCal.C)  Now I'm generating lots of plots and getting somewhere.    I'm getting the first pass gain file as well.  I think next step is to update masks and then run over MuDsts again.

 

Some questions about code 

Q1: Various cut constants are set in rdEztMuSmdCal.C and we to make sure they are correct.  What I'm talking about is here:

 // MIP cut .........
  float thrMipSmdE=0.4/1000.; // was 0.5 MeV for data
  // line below added 3/12/2007 - sww
  int emptyStripCount=11;
  // int emptyStripCount=7;
  float offCenter=0.7; // fiducial area of tower =offCenter^2, was 0.8,CuCuwas0.7
  float twMipRelEneLow=0.5, twMipRelEneHigh=2.;  // was 0.5,1.5
  int thrMipPresAdc=12; // thres over pedestal for pre/post (was 12 if no energy cut)

  HList=new  TObjArray;

  int id;
  for(id=1;id<=12;id++)   {
    sectID=id;
    myMk3=new MuEzSmdCalMaker("mySmdCal","MuDst");
    myMk3->setHList(HList);
    myMk3->setEZtree(false);
    myMk3->setSector(sectID);
    myMk3->setTwCuts(twMipRelEneLow, twMipRelEneHigh,offCenter);
    myMk3->setSmdCuts(thrMipSmdE,emptyStripCount);
    myMk3->setPreCuts(thrMipPresAdc);
    myMk3->addTrigIdFilter(2);
    myMk3->addTrigIdFilter(8);
    // if(id>=3)
    //break;
  }
 

On a side note: wow that's a not so great way to allocate memory.

Q2: Another question, it looks like when we iterate we will be changing the masks and gains in the db by calling something like:

myDb->chageGains("path/to/file/blah.dat"); 

what code makes this file?  What is the format? 

Partial answer A2: From my reading it looks like plSmdCal.C makes the plots and doSmdCal.C saves a text file for the smd.  For other layers it looks like pl<Layer> does both ?  Although there is also fitTower.C which writes out to files so I'm not so sure.  What is the difference between the gain files written by these two pieces of code?