SemiLepRun

Class from TopMiniNtup-11-00-00-05 package.

  • Dependency on:
    • TopMiniNtuple/MiniSL.h
      TopD3PDSelection/SemiLeptonic.h
      TopD3PDSelection/CutCount.h
      TopD3PDCorrections/StandardTtCorrections.h
      FakesMacros/MuJetsMatrixMethodA.h
      TopD3PDSelection/WhichPeriodSvc.h

  • Public SemiLepRun members:
    • SemiLepRun class constructor (StandardTtCorrections *_corr, bool _el, MiniSL *_out):
      • slCuts(&count), <a CutCount class variable>
      • corr(_corr), <a StandardTtCorrections class variable>
      • out(_out), <a MiniSL class variable: this creates and writes the output ntuple>
      • weights_ran(0), <a double>
      • weights_pass(0), <a double>
      • el(_el) <a bool: true for electron channel>
        {
        if ( _out ) out = new MiniSL(new TFile("tmp.root", "recreate"));
        dataDir = "";
        char *rootcoreDir = getenv("ROOTCOREDIR");
        if(rootcoreDir) {
        dataDir = std::string(rootcoreDir) + "/";
        }
        MJMMA = 0;
        }
    • SemiLepRun class destructor.
    • SemiLepRun members:
    • SemiLepRun member functions:
      • void initialize(bool loose=false); <MiniSL::initialize() - see MiniSL HERE>
      • void finalize(bool closeFile=false); <if one wants to close the output file closeFile=true>
      • void finalizeFile() {(out->m_tfile)->Close(); delete (out->m_tfile);} <to close the output file>
      • void runEd(EventData *ed, bool passGRL, bool loose=false, bool tag=false); <to run the selection and corrections on each event>

void SemiLepRun::runEd(EventData *ed, bool GRL, bool loose, bool tag)

1. Check which period:

2. Get event weight:

  • float weight = ed->eventInfo()->mcevt_weight();
  • std::vector<double> weights; <weights is a vector with the first entry=1, second entry=MCweight, third entry=McWeight x McPileUpWeight>

3. If event doesn't pass GRL, skip this event; weights are stored anyway.

  • if(passGRL) return;

4. Make a copy of event data and run corrections over it:

  • EventData *thisEd = new EventData(*ed);
  • if(corr->applyCorrections(thisEd)) {
  • delete thisEd;
  • return; }

5. Stuff for cuts + stuff for loose.

6. Run event selection and check if event passes the minimal cut requirements to be written out.

  • bool pass(el ? slCuts.passElectronChannel(thisEd,&weights,loose,tag) : slCuts.passMuonChannel(thisEd,&weights,loose));
  • if(pass) {
  • more stuff
  • stuff for muons only for data samples
  • stuff for electrons only for data samples
  • stuff for MC samples

7. Writes the output ntuple

  • out->write(thisEd,&slCuts,el,!el)
  • see MiniSL::write().



see how runEd() is changed to runMC() in SemiLepRunTruth

Edit | Attach | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r3 - 2013-09-05 - PatriciaFernandez
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Sandbox All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2020 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use Discourse or Send feedback