Alessio Sarti Data Access info Page

These pages contain the Muon ID studies summary

Muon Page and LHCb Twiki Page

Gaudi python

Environment setup

Few steps before running your python script:
  • setenvDavinci xxx
  • source Phys/DaVinci/xxx/cmt/setup.csh

TES locations

When running against a microDST, instead of DST the TES locations are beginning with microDST! E.g. MC/Particles becomes microDST/MC/Particles... E.g. if accessing data created by SelB2hh algorithm the particles are going to be found in Phys/SelB2hh/Particles for the DST and microDST/Phys/SelB2hh/Particles for the microDST

DST writer

Writing evt subsample

  • Q: I want to use the DstWriter to create a subset of the events I am processing. What I should write in my Gaudi Algorithm in order to trigger the writing (which I have disabled using the job option).
  • A: Your algorithm (call it "Myalg" for instance) that selects the events must set somewhere setFilterpassed(true) for the events that you keep and false for the rest. Then you do
DstWriter.RequireAlgs = { "Myalg" } ;
and DstWriter will only run when MyAlg has set setFilterpassed(true). There can be more than one algorithm.

Merging DSTs

The option files that can be used to make the DST merging have been provided by Angelo

//--------------------------------------------------------------------------
-                                                                           
// Job options to copy one or more event data input files onto an output    
file                                                                        
//--------------------------------------------------------------------------
-                                                                           
ApplicationMgr.HistogramPersistency = "NONE";                               
ApplicationMgr.OutStream += {"InputCopyStream/InputCopyStream"};            

EventSelector.PrintFreq = 1;

// Set up the POOL persistency for the output file and load the
// DLLs that contain the necessary dictionaries and factories  
#include "$STDOPTS/DstDicts.opts"                              

// Provide one or more input files.

#include "/home/LHCB/umarconi/filesToBeMerged.opts"

// Define the output file
InputCopyStream.Output = "DATAFILE='PFN:myFinalMiniDST.dst'
TYP='POOL_ROOTTREE' OPT='REC'";

where the filesToBeMerged.opts files is like:

EventSelector.Input = {
"DATAFILE='PFN:gangadir/workspace/Local/17/2/output/microDST.dst'
TYP='POOL_ROOTTREE' OPT='READ'",
"DATAFILE='PFN:gangadir/workspace/Local/17/3/output/microDST.dst'
TYP='POOL_ROOTTREE' OPT='READ'",
"DATAFILE='PFN:gangadir/workspace/Local/17/4/output/microDST.dst'
TYP='POOL_ROOTTREE' OPT='READ'",
"DATAFILE='PFN:gangadir/workspace/Local/17/5/output/microDST.dst'
TYP='POOL_ROOTTREE' OPT='READ'",
"DATAFILE='PFN:gangadir/workspace/Local/17/8/output/microDST.dst'
TYP='POOL_ROOTTREE' OPT='READ'",
"DATAFILE='PFN:gangadir/workspace/Local/17/9/output/microDST.dst'
TYP='POOL_ROOTTREE' OPT='READ'",
"DATAFILE='PFN:gangadir/workspace/Local/17/10/output/microDST.dst'
TYP='POOL_ROOTTREE' OPT='READ'"
};

Accessing raw data and wrint out a subsample

Writing microDST

A good link with FAQ and documentation is here

Using Options, writing MDF

ApplicationMgr.OutStream += { "LHCb::MDFWriter/Writer_2" };
Writer_2.Connection       =
"PFN:root:file:///afs/cern.ch/user/r/roel/mdfData_5.dat";
Writer_2.Compress         = 0;
Writer_2.GenerateMD5      = true;

Using options writing dst

#include "$GAUDIPOOLDBROOT/options/GaudiPoolDbRoot.opts"
ApplicationMgr.TopAlg               += { "Sequencer/SendSequence" };
SendSequence.Members                 = {"PreScaler/RAWScaler"};
RAWScaler.PercentPass                = 100; //%
ApplicationMgr.OutStream += { "RawWriter" };
RawWriter.RequireAlgs += {"SendSequence"};
RawWriter.Output = "DATAFILE='/data/calo/com1207/calo-l0_1220_0020.raw'
TYP='POOL_ROOTTREE' OPT='REC'";
RawWriter.Preload     = false;
RawWriter.ItemList = {
  "/Event#1"
, "/Event/DAQ#1"
, "/Event/DAQ/RawEvent#1"
};

Using python

I have a GaudiPython example at:

/afs/cern.ch/lhcb/group/panoramix/vol1//pvol1/GaudiPythonTutorial/Gaudi_
v19r9

Just replace
sel.open(['PFN:$AFSROOT/cern.ch/lhcb/group/tracking/vol1/Bsjpsiphi_00001
620_00000004_5.dst'])

with something like

file =
os.path.expandvars('$AFSROOT/cern.ch/lhcb/group/tracking/vol2/calo_cosmi
cs_1302_0019.mdf')
EventSelector(
    Input = ["DATA='file://"+file+"' SVC='LHCb::MDFSelector'"] )

Should come before import GaudiPython.

-- AlessioSarti - 03 Jun 2008

Edit | Attach | Watch | Print version | History: r5 < r4 < r3 < r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r5 - 2008-08-28 - AlessioSarti
 
    • 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-2021 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