lm_access_pkg provides a framework wrapper for the lm_access scripts. It only works for input data which are in sam as it has to use the file parentage to find the luminosity information. Executive summary: To use LmAccess from the framework requires 3 steps: 1) use lm_access script makeDatasetParentageList.py to generate the lbn list for your dataset. This takes about 1 minute per input file but only needs to be done once per file. These files can be used reused by anyone interested in the same datafiles. 2) put lm_access_pkg into your framework executable and tailor the rcp file LmAccess.rcp to your needs. 3) reject any events for a given trigger if isGoodLBN(trigger) is false. The output is a file summary.lumwhich summarizes the luminosity for each trigger in your analysis as well as the number of events rejected by the isGoodLBN criterion. Details: ------------------------------------------------------------------------- External Inputs: For any input file you want to normalize, you must have made a file . which is in the directory set by which you can find in the the lm_access_pkg/rcp/LmAccess rcp. is currently "parentage" but it will change as the format of the parentage information evolves. You can choose the format just by changing the "parentage_tag" string in the rcp. (Like any other input files, these need to have absolute paths to work with d0tools, lm_access supports environmentals so you can define $SRT_PRIVATE_CONTEXT/lbns or other similar paths.) You can create parentage files by using the lm_access python scripts. cvs checkout lm_access/scripts setenv PATH "lm_access/scripts":$PATH python lm_access/scripts/makeDatasetParentageList.py (or makeDimensionParentageList.py "") this produces a set of .parentage files which the framework needs. It takes some time to do this but once it has been done once for a file, rerunning makeDatasetParentageList skips that file and only does new ones. Your physics group may already have made such files for official skims, find out if such a set is available. Files for wz group are in d0mino:~schellma/wzparentage for example. If you copy them to a subdirectory under $SRT_PRIVATE_CONTEXT, your code should work on clued0, d0mino and the cab. -------------------------------------------------------------------------- If you are not running on a Fermilab system, you will also need the stage3 files which make up the lbn database. Your d0 system people should have set this up at some location - at FNAL it's /prj_root/500/com/offline/stage3 and the code defaults to that. You can change it to your local location by using the lm_access_stage_dir parameter in LmAccess.rcp We used the rcp method instead of an environmental because most batch systems don't pass on environmentals by default. -------------------------------------------------------------------------- Coding: Getting code: addpkg -h lm_access_pkg addpkg -h lm_access Putting it in your executable: Add RegLmAccess to your bin/OBJECTS Add "lum" to Packages after "read" in your framework RCP Add RCP lum= or a variation to your framework RCP. You use this rcp to set the location for the parentage files, rename the output from lm_access_pkg, choose different types of luminosity checks and the triggers you want. Look at the rcp file in lm_access_pkg/rcp/LmAccess.rcp to see what the various parameters are: ----------------------------------------------------------------------- IMPORTANT!!! To get an event sample that matches the luminosity, you need to cut out events which have no luminosity information: In Analyse, Process or Filter event, put in code similar to the following #include "lm_access_pkg/LmAccessData.hpp" #include "analysis_utilities/D0TriggerDecoder.hpp" // make a trigger decoder object: D0TriggerDecoder* _selectTriggers = D0TriggerDecoder::Instance(); std::vector fired_triggers = _selectTriggers->GetFiredTriggers(); std::vector valid_fired_triggers; int ntriggers = fired_triggers.size(); // make a LmAccessData object to ask about luminosity lm_access::LmAccessData* local = lm_access::LmAccessData::Instance(); // check to see that you have initialized it - you may want to turn off luminosity, in which case you want to know to skip this code, the initialized hook tells you if you have actually set up the LmAccess package in the framework. If yoy've removed 'lum' from the packages list, initialized will be false and the goodlbn cut will not be made. if(local->initialized()){ // loop over the fired triggers and see if this is a good lbn for any for (int i = 0; i < ntriggers; i++){ string trigger = fired_triggers[i]; ++_triggered_events; cout << " check for trigger " << trigger << endl; bool check = local->isGoodLBN(event,trigger); if(check){ valid_fired_triggers.push_back(trigger); } cout << " result was " << check << endl; } } // here if you don't want to do lum check, just let em all through else valid_fired_triggers = fired_triggers; // valid_fired_triggers will contain the list of normalizable trigger for this event if the LmAccess code is enabled. ---------------------------------------------------------------------------- Outputs: At the end of the job you will automatically get a printout of the list of input files and a luminosity summary. You can change the name of this summary via the LmAccess.rcp RCP parameter lumfile.