QA Documentation

New embedding Base QA instructions

  Instructions how to run the QA codes, make QA plots (pdf file) for Embedding Helpers
 

    Current Embedding Coordinator (EC): Xianglei Zhu (zhux@tsinghua.edu.cn)

    Current Embedding Deputy (ED): Derek Anderson (derekwigwam9@tamu.edu)

    Current NERSC Point Of Contact (POC): Jeff Porter (RJPorter@lbl.gov) and Jan Balewski (balewski@lbl.gov)

 
 
Last updated on Apr/19/2013 by Patrick Huck

 
Revised history
  • Jan/9/2015: Update trigger selection on real data histogram making
  • Apr/19/2013: update responsible persons and add note about Omega mis-labeling issue
  • Apr/12/2011: Update NOTE in Section1
  • Feb/17/2011: Update NOTE in Section1, and for checking out StAssociationMaker
  • Jan/27/2011: Update the Section 3 for some special decay daughters
  • Oct/25/2010: Added minimc reproduction in Section 1 and StAssociationMaker in Section 
  • Jul/23/2010: Update the real data QA
  • May/21/2010: Minor style change, added "contents" and "Links" for "Embedding instructions for Embedding Helpers"
  • May/14/2010: Update rapidity/trigger selections for real data
  • Apr/07/2010: Update the instructions on "drawEmbeddingQA.C"
  • Feb/22/2010: Added how to change the z-vertex cut and about 'isEmbeddingOnly' flag in "drawEmbeddingQA.C" 
  • Jan/29/2010: Update the NOTE for "doEmbeddingQAMaker" (see below)
  • Jan/22/2010: Update the documentation for the latest QA code
  • Sep/21/2009: Add how to plot the QA histograms in the Section 3
  • Sep/18/2009:  Modify codes to "StEmbeddingQA*", and macro to "doEmbeddingQAMaker.C" (Please have a look at the instructions below carefully).
  • Sep/17/2009:  Modify Section 2.1
  • Sep/15/2009:  Add new embedding QA instructions
e-mail the coordinator/deputies or embedding hyper-news if you have any questions and suggestions
 

Contents

IMPORTANT NOTE: 
- Please make sure that you've used the latest codes/macros.
  If "cvs update StRoot/StEmbeddingUtilities" and
  "cvs update StRoot/macros/embedding" return nothing,
  you have the latest codes in your working directory.
 
  If you run the QA by old "doEmbeddingQAMaker.C", you will
  miss some new QA histograms and the "drawEmbeddingQA.C" may crash.
 
  Sometime, I forget to send an e-mail about the update of QA codes,
  Please do "cvs update" and try again if you encounter some unknown issues.
  If this doesn't solve the problem, please contact me (Hiroshi).
 
- Check out StRoot/StEmbeddingUtilities for the embedding QA
 
- QA codes are supposed to work for DEV so they might be crashed in other libraries 
 
- If the MC geantid >= 50, it is most likely the particle that is
  specifically defined for the STAR simulation.
  If this is the case, please check out "StRoot/StarClassLibrary"
  in your local working directory and recompile.  

1. Produce minimc files 

 

NOTE1: From Run9, you don't need to reproduce the minimc files.
Please use the minimc produced together by the embedding productions for the base QA

 

NOTE1-1: Sometimes you might need to reproduce minimc even if the embedding is done for Run9
or above. Please contact production helpers, or deputies if you are not clear enough to reproduce
the minimc files
 
NOTE2: If the embedding production is done (1) by the library prior to SL10j and
(2) for particles with user defined geantid that is larger than 65535/2 = 32767,
the geantid in the minimc will be some negative value or compeletely different from
what you expect. In that case, please check out the latest "StRoot/StMiniMcEvent"
and "StRoot/StMiniMcMaker" from CVS and recompile
 
 
> cvs co StRoot/StMiniMcEvent 
> cvs co StRoot/StMiniMcMaker
> cons
 
 
NOTE3: Prior to SL10j library, StTrack doesn't have "mSeedQuality" so the cons will complain
when you compile StRoot/StMiniMcMaker like

 

.sl53_gcc432/obj/StRoot/StMiniMcMaker/StMiniMcMaker.cxx: In member function 'void StMiniMcMaker::fillRcTrackInfo(StTinyRcTrack*, const StTrack*, const StTrack*, Int_t)':

.sl53_gcc432/obj/StRoot/StMiniMcMaker/StMiniMcMaker.cxx:1622: error: 'const class StTrack' has no member named 'seedQuality'
 
Please comment out the line 1622 and recompile if you see this error.
 
 

1.1 Check out the relevant codes and macros in your working directory (suppose your working directory is ${work})

 > cp /eliza8/rnc/hmasui/embedding/QA/StMiniHijing.C ${work}

   - If the eliza8 is down, you can also copy the macro from the link below
   - The current "StMiniHijing.C" has been slightly modified from the original version
      to obtain a proper minimc filename based on the input geant.root file, see line 159-162 in
"StMiniHijing.C"
159 TString filename = MainFile; 
160 // int fileBeginIndex = filename.Index(filePrefix,0); 
161 // filename.Remove(0,fileBeginIndex); 
162 filename.Remove(0, filename.Last('/')+1); 

   - You don't need to modify the argument "filePrefix".
 
  You also need to check out "StAssociationMaker" and compile them in order to fix the problem
  of all East TPC hits. See details in the following bug report.
 
> cvs co StRoot/StAssociationMaker
> cons 
  NOTE: If you are working for the QA under SL10j (or above), SL10c_emb, or SL10h_emb,
  you don't need to check out StAssociationMaker.
  Below is copy of the latest StAssociationMaker.cxx.
 

 

1.2 Run "StMiniHijing.C"

Suppose your input file is
 
"/eliza9/starprod/embedding/P08ie/dAu/Piplus_201_1233091546/
Piplus_st_physics_adc_9020060_raw_2060010_201/st_physics_adc_9020060_raw_2060010.geant.root"

   Either
> root4star -b -q StMiniHijing.C'(1000, "/eliza9/starprod/embedding/P08ie/dAu/Piplus_201_1233091546/Piplus_st_physics_adc_9020060_raw_2060010_201/st_physics_adc_9020060_raw_2060010.geant.root", "./")' 

   or

> root4star -b
[0] .L StMiniHijing.C
[1] StMiniHijing(1000, "/eliza9/starprod/embedding/P08ie/dAu/Piplus_201_1233091546/Piplus_st_physics_adc_9020060_raw_2060010_201/st_physics_adc_9020060_raw_2060010.geant.root", "./");
 ....
 ....
 ....
 [2].q

   - The 1st argument is maximum number of events.
   - The 2nd argument is your input geant.root file.
   - The 3rd argument is your output directory. For example, if you would like to put the output into
      "./output" directory, you can set the 3rd argument as "./output/".

  
    NOTE: You must separate the outputs in different directories from different groups,
              such as PiPlus_201_1233091546, PiPlus_202_1233091546 etc.
              Since the filename of input geant.root's are usually identical among different groups,
              you will overwrite your minimc.root if you put the minimc outputs under the same directory.

 
 

1.3 Make sure MC geantid is correct

 

  This step is not always necessary but may help to reduce your time if we did something wrong for geantid.
  Before running the QA code, you can easily check whether MC geant id is correct or not. 
  Suppose we have one minimc file, "st_physics_adc_9020060_raw_2060010.minimc.root" in the current directory, then you can do

 

> root4star st_physics_adc_9020060_raw_2060010.minimc.root
[0] StMiniMcTree->Draw("mMcTracks.mGeantId") 
 
or
  
 [0] StMiniMcTree->Scan("mMcTracks.mGeantId") 
 [1].q
 
 
  Please make sure that the geant id is identical with the requested particle.
  If you don't know the geantid for the requested particles, please take a look at the 
  manual of GEANT3, or ask other Embedding Helpers/Deputy/Coordinator. 
  For unstable (decay) particles, we mostly use some special geantid which was 
  defined for the STAR simulation only. In that case, the geantid should be 
  different from the original one in the GEANT manual.
 

 

2. Run QA codes

 2.1 Check out the QA codes from CVS

 

    NOTE: For the macro, please use "doEmbeddingQAMaker.C" instead of "doMiniMcAnalyzer.C".
              doMiniMcAnalyzer.C will be deleted from CVS sometime in a future.

 

   QA macro

   > cvs checkout StRoot/macros/embedding/doEmbeddingQAMaker.C 

 

   QA codes

     > cvs checkout StRoot/StEmbeddingUtilities

 

2.2 Run the QA macro

2.2.1 QA for embedding outputs 

  Suppose you've prepared the minimc.root filelist "minimc.list"
   and the output filename for your QA histograms is
"embedding.root"
 
   NOTE: you don't need to specify your input particle name (or geantid).
             The QA code will automatically find out the input geant id from the minimc files.

 

   Either

   >  root4star -b -q doEmbeddingQAMaker.C'(2008, "P08ie", "minimc.list", "embedding.root")' 

   or

 > root4star -b 
 [0] .L doEmbeddingQAMaker.C 
 [1] doEmbeddingQAMaker(2008, "P08ie", "minimc.list", "embedding.root"); 
 ...
 ...
 ...
 [2] .q

 

   The details of arguments can be found in the "doEmbeddingQAMaker.C"

  

  NOTE:
   - Output file name (4th argument, in this case "embedding.root") will be
     automatically detemined according to the "year", "production"
     and "particle name" if you leave it blank.
 
   The default z-vertex cut is 30cm. If you would like to change the z-vertex cut,
    you can modify the 6th argument like
 
 
> roo4star -b
[0] .L doEmbeddingQAMaker.C
[1] doEmbeddingQAMaker(2008, "P08ie", "minimc.list", "", kTRUE, 60.0); ... ... ... [2] .q


where the 5th argument is the switch to analyze embedding (kTRUE) or real data (kFALSE).

 

 

2.2.2 QA for real data

You also need to run the "doEmbeddingQAMaker.C" to obtain the same histograms from the real data by

 

> roo4star -b
[0] .L doEmbeddingQAMaker.C
[1] doEmbeddingQAMaker(2008, "P08ie", "mudst.list", "", kFALSE); ... ... ... [2] .q
where mudst.list is the file list for muDst.
 
  NOTE: You must use muDst from the original production, not from embedding production.
  Because the muDst's in the embedding production contain both real data tracks and embedding tracks.
  Please contact POC for the location of muDst's from original production at PDSF.
  

2.2.3  Trigger selections and rapidity cuts for real data

  In order to compare the real data with the embedding outputs with the same event and track conditions,
  you may need to apply the primary z-vertex, trigger and rapidity cuts in the real data. Please find the 
  z-vertex cut selection in the Section 2.2.1.
 

    - The trigger id can be also selected by 

  

	
		
		
	
	
		

StEmbeddingQAUtilities::addTriggerIdCut(const UInt_t id)

     StEmbeddingQAUtilities accept multiple trigger id's while current code assumes 1 trigger id per event,

     The trigger id cut only affects the real data, not for the embedding outputs.

 

     - You can also apply rapidity cut by 

  StEmbeddingQAUtilities::setRapidityCut(const Double_t ycut)

     It would be good to have the same rapidity cut in the real data as the embedding production.

     Please have a look at the simulation request page for rapidity cut or ask embedding helpers

     what rapidity cuts they used for the productions.

 


 

3. Draw your QA results, compare with the real data
 

  You can make the QA plots by "drawEmbeddingQA.C" under "StRoot/macros/embedding".

  > cvs checkout StRoot/macros/embedding/drawEmbeddingQA.C

 

  Suppose you have output ROOT files in your current directory: "qa_embedding_2007_P08ic.root",
  and "qa_real_2007_P08ic.root" (the output file format is automatically
  determined like this if you leave the output filename blank in StEmbeddingQA).

 

> root4star -l drawEmbeddingQA.C'("./", "qa_embedding_2007_P08ic.root", "qa_real_2007_P08ic.root", 8, 10.0)' 

 
  First argument is the directory where the output PDF file is printed.
  The default output directory is the current directory.

  The fourth argument is the geantid that you want to look at. Actually, the code will try to find out
  the geantid from the output histograms including the decay daughters so it doesn't matter if you put the wrong geantid.
 
 
  NOTE: I recommend to produce the output ROOT files for QA histograms as described above
            i.e. produce outputs without specifying the output filename in StEmbeddingQA
            Otherwise you have to put the year, production and particle name by had as you'll see below (Hiroshi)
 
 
  The fifth argument is the maximum pt cut off (GeV/c) for all histograms.
  The default pt cut off is 5 GeV/c. If the requested maximum pt is different from 5, then you need to 
  put another value, in this case 10 GeV/c, in this argument.
 

  You can now check the QA histograms from embedding outputs only by

    > root4star -l drawEmbeddingQA.C'("./", "qa_embedding_2007_P08ic.root", "qa_real_2007_P08ic.root", 8, 10.0, kTRUE)' 

  where the last argument 'isEmbeddingOnly' (default is kFALSE) is the switch

  to draw the QA histograms for embedding outputs only if it is true. 


  If you name the output ROOT files by hand, you need to put the year and
  production by yourself since those are used
  for the output figure name and to print those informations in 
  the legend for each QA plot.
  Suppose you have output ROOT files in your current directory: "qa_embedding.root" and
"qa_real.root"

 
    > root4star -l drawEmbeddingQA.C'("./", "qa_embedding.root", "qa_real.root", 2005, "P08ic", 8, 10.0, kFALSE)' 
  where there are additional arguments "2005" and "P08ic" in the 5th and 6th arguments.
  The arguments are basically the same compared to previous example, except for the input filename's.
  NOTE:
    - In this case, you have to put all arguments by hand (no default arguments in the function)
    - You may notice that the order of arguments are slightly different from the example above.
      This should be fine since we define the two functions "drawEmbeddingQA" with the same
      function name but different arguments in "drawEmbeddingQA.C" (you can directly check the macro how it works)
   
  If you are going to do the base QA for the daughter particles produced by one of the daughter from input MC,
  for example "D* -> D0 -> pi K", we have to specify the geantid for D0 in the macro like
 
> root4star -l drawEmbeddingQA.C'("./", "qa_embedding_2007_P08ic.root", "qa_real_2007_P08ic.root", 8, 10, kFALSE, 37)'
  where the last argument (37) is the D0 geantid. The relevant function to set parent geant id can be
found in the drawEmbeddingQA.C

 

  maker->setParentGeantId(parentGeantId) ;
 
NOTE: Omegas are labelled as Ant-Omegas and vice versa. This is a known issue due to
the wrong Geant Ids for those two particles in STAR libaries SL13b and earlier. Future updates
of these libraries might fix it. For now, it has not been considered necessary to update all
embedding libraries to fix this issue. Please take note of this in all presentations regarding
(Anti-)Omega embedding.

 
 

4. Links

 

End of New embedding QA instructions


 

 

 

------------------------------------------------------------------------------------
This document is intended to describe the macros used during the quality assurance(Q/A) studies. This page is being updated today April 19 2009

 
* Macro : scan_embed_mc.C

After knowing the location of the minimc.root files use this macro to generate and output files with extension .root, in which all the histogramas for a basic QA had been filled. New histogramas had been added, ofr instacne a 3D histogram for Dca (pt, eta, dca) will give the distribution of dca as a function of pt and eta simultaneously. Same is done for the number of fit points (pr, eta, nfit). Also histograms to evaluate the randomness of the embedding  files had been added to this macro.

 

* Macros: scan_embed_mudst.C

This macro hopefully you won't have to use it unless is requested. This macro is meant to generate and output  root file with distributions coming from the MuDst (MuDst from Lidia) for a particular production. You will need just the location of the output file.


* Macro : plot_embed.C


This macro will take both outputs ( the one coming from minimc and that one coming from MuDst) and plot all the basic qa distributions for a particular production.