To Run Embedding
Maintained by Wei-Ming Zhang

To run EEMC embedding please follow the steps below. (NOT in CVS yet -Jan)

  1. Check out two macros:
    cvs co StRoot/StEEmcUtil/StEmbedding/macros/doEEmcEmbedOnly.C or
    cvs co StRoot/StEEmcUtil/StEmbedding/macros/doEEmcEmbedUser.C
  2. edit input file names
  3. add your analysis maker
  4. modify UserMatchMaker as (if) needed
  5. cross fingers and run


EEmc embedding program is implemented in the similar way as BEmc embedding. However certain steps were omitted as not necessary. Below is a picture of its flow chart.


EEmc embedding embeds EEmc hits of a MC event from geant.root to EEmc hits of a data event of StEvent. Its implementation is based on the scheme of BEmc embedding.


A macro doEEmcEmbedOnly.C that runs just embedding can be checked out from $STAR/StRoot/StEEmcUtil/StEmbedding/macros/ The basic chain of the macro includes
  1. StIOMaker-1 - To open primary event.root file (real or M-C)

  2. StIOMaker-2 - To open geant.root file with probes to be embedded

  3. St_db_Maker - STAR database (time stemp definded by StIOMaker-1)

  4. StEEmcDbMaker - EEmc database

  5. StMcEventMaker - To build a StMcEvent object in the memory. StMcEventMaker->currentEvent()->eemcHitCollection(), eprsHitCollection(), esmduHitCollection(), and esmdvHitCollection() are the four methods to get EEmc Hits from the memory.
    Note, this maker uses StEEmcFastSimuMaker::unpackGeantHits(g2t_tile, g2t_smd) to unpack GEANT volume IDs.

  6. StEEmcFastSimuMaker - This maker gets EEmc hits from g2t tables in geant.root, does a fast simulation of the detector, and preserves GEANT energy loss in a private EmcCollection. Collection is destroyed by ::Clear();

    After this step, we have two StEmcCollections in the memory.

    • A real one from StEvent->emcCollection()
    • A simulated one created in step 6, which could be obtained with StEEmcFastSimuMaker->getEmcCollection()

  7. StEEmcMixerMaker - This maker gets the two described StEmcCollections and adds the simulated one to the real data by simply adding ADC values for each subdetector. It is assumed file-1 hits still contain pedestals. Only simulated hits of good channels from file-2 (identified by the database are added) to file-1 . No hits are removed from file-1.

    Special attention should be paid to switch DB flavor to 'sim' if primery events (file-1) are M-C. Also sampling fraction should be different if file-1 is M-C.

    At this point StEvent contains raw ADC from sum from 2 events from file 1+2. Mixing is done.
    One can process StEvent as is it was oryginal input StEvent file-1.


A macro doEEmcEmbedUser.C that runs embedding, example of user analysi, and Association maker can be checked out from $STAR/StRoot/StEEmcUtil/StEmbedding/macros/ The added elements of this chain are:
  1. StEEmcA2EMaker - To recalculate energy from ADC after embedding

  2. StEEmcClusterMaker - EEmc cluster builder

  3. StEEmcPointTreeMaker - EEmc point builder

  4. StAssociationMaker - TPC association

  5. StEEmcAssociationMaker - EEmc association to build 4 maps as BEmc

  6. StEEmcUserMatchMaker - User's analysis maker to match StMcTracks with EEmc hits with the 4 maps.


Auxiliary information

Monte Carlo hits are embeded to those of real data in StEEmcMixerMaker. The following four multimaps are built with mixed hits for each of the four subdetectors (Etow, Eprs, Esmdu, and Esmdv) in StEEmcAssociationMaker.

  1. multiEEmcTrackCluster which correlates MC tracks with clusters
  2. multiEEmcClusterTrack which correlates clusters with MC tracks
  3. multiEEmcTrackPoint which correlates MC tracks with EEMC points
  4. multiEEmcPointTrack which correlates points with MC tracks
There are three energies calculated in StEEmcAssociationMaker.
  1. E_track: Energy deposit to a subdetector by a StMcTrack
  2. E_(cluster/point): Total energy of a cluster/point
  3. E_hits: Summed energy of all hits associated with a pair of correlated StMcTrack and cluster/point
Ratios of E_hits/E_track and E_hits/E_(cluster/point) are stored in the first two multimaps. They could be used for efficiency study. Prior to using them for effciency study, hit-ADC should be well calibrated.

For details of the usage of multimap, please check the WEB of StAssociationMaker, as well as its "User's Guide & Reference Manual"