SLAC PEP-II
BABAR
SLAC<->RAL
Babar logo CM2 logo
HEPIC E,S & H Databases PDG HEP preprints
Organization Detector Computing Physics Documentation
Personnel Glossary Sitemap Search Hypernews
next up previous
Next: Build-time configuration Up: Configuration Previous: Configuration


Compile-time configuration

There is one simple change that must be made to micro-based analysis code to allow it to run on the mini. The change is to the name of the Monte Carlo truth map. The key to be used when reading the mini is ``GHit'', not ``Default''.

The truth map should be accessed as follows

        BtaMcAssoc* truthMap = Ifd< BtaMcAssoc >::get( anEvent, ``GHit'');
Then, to associate a BtaCandidate with its Monte Carlo truth partner, do:
   HepAList<BtaCandidate>* myList = 
   Ifd<HepAList< BtaCandidate > >::get(anEvent, ``BtaMicroCandidates'');
   ...
   if (truthMap != 0) {
     HepAListIterator<BtaCandidate> recoIter(*myList);
     while (BtaCandidate* reco = recoIter()){
       BtaCandidate *mcPartner = truthMap->mcFromReco(reco);
       if (mcPartner != 0){
         // do stuff here
       }
     }
   }
Notes:
  1. The BtaMicroCandidates list is comprised of unique BtaCandidates from ChargedTracks, NeutralHadrons, CalorNeutral and CalorClusterNeutral lists. This list is available on the old micro and on minis produced in the 13-series releases or higher.
  2. Be sure to check that the BtaMcAssoc list pointer is not null. A null pointer will be returned from the method
       BtaMcAssoc* truthMap = Ifd< BtaMcAssoc >::get( anEvent, ``GHit'');
    
    if the Tru component is not available (the case for real data or when reading Monte Carlo data with MCTruth = false)
A complete example of matching Monte Carlo truth with reconstructed BtaCandidates is given in BetaMiniUser/MyMiniAnalysis.cc.

William Stephen Lockman 2004-05-08