TWiki
>
LHCb Web
>
LHCbTrigger
>
LHCbTriggerForUsers
>
RunningMooreOnMC
(2015-02-13,
NikitaKazeev
)
(raw view)
E
dit
A
ttach
P
DF
---+!![[RunningMooreOnMC][How to (re)run the Hlt]] %TOC% ---++ Think about your input! * Moore expects to be running on L0-data * Moore expects to be running *before* reconstruction * Moore expects to be running on a full DST or RAW(MDF) file * Moore expects the raw event to be located at *DAQ/RawEvent* * Moore does not expect to be running on top of a previous Moore's output Think carefully about what is there on your input. * RawEventJuggler: to move around the raw event back how Moore expects it, a prerequisite for running Moore * L0App: to add the correct L0 to your file, a prerequisite for running Moore ---++ Think about your Trigger conditions! * Moore for 2012 data which ran in the pit on 2012 data will only make sense to apply to 2012 simulation * Moore for 2011 data which ran in the pit on 2011 data will only make sense to apply to 2011 simulation * ... and so on. ---++ Multiple Trigger Results into one file? * Yes, this is possible, see examples on the RawEventJuggler wiki ---++ Running Moore Moore is the trigger software, as run in the pit. It is available through the usual SetupProject command. ---+++ Default Moore options This is a collection of options files that perform common tasks. If you have a use case you think is also useful for others, add your *commented* options here with a brief description of what they do. ----++++ Options for untriggered data A skeleton script that should work on Moore v23r2 and later that runs on real raw data looks like this: <verbatim> #!/usr/bin/env gaudirun.py import Gaudi.Configuration from Moore.Configuration import Moore #Configure L0 emulation Moore().ForceSingleL0Configuration = True Moore().CheckOdin = False # How are we configuring the trigger? TCK or settings? #Moore().ThresholdSettings = 'SomeThresholdSettings' # Only use ThresholdSettings when developing Hlt lines. Moore().UseTCK = True # Use a TCK in all other cases. Moore().InitialTCK = '0x00a10045' # Change me to the TCK you want to use Moore().WriterRequires=['HltDecsionSequence'] # What sequence must pass for the events to be written out? Moore().DataType = "2012" Moore().Simulation = False Moore().UseDBSnapshot = False Moore().DDDBtag = "head-20120126" #Change me to the DB tag you want Moore().CondDBtag = "head-20120607" #Change me to the DB tag you want Moore().inputFiles = [ 'castor:/castor/cern.ch/user/e/evh/114774/114774_0x003D_NB_L0Phys_00.raw' ] #Your input files go here Moore().Verbose = False Moore().EvtMax = 100 Moore().outputFile = 'mymooreout.raw' # If the input file is DST (raw) file, this should be a DST (raw) file from Configurables import EventSelector EventSelector().PrintFreq = 100 </verbatim> ---++ TCK or Settings? As a user running Moore on MC, you should *always* use a TCK instead of configuring using settings. This is at present the only way to guarantee that you will get the same trigger decisions as would have been obtained in the pit. If you are developing new Hlt lines, you should run from ThresholdSettings. Please note that in this case, the resulting DST *cannot* be processed with DaVinci. Any monitoring of quantities that you want to do as part of the development must be done in the same job. You could for example use GaudiPython and create an NTuple. ---++ Running from a TCK ---+++ Which TCK? When a new TCK is made to be used in the pit, a new MC TCK is also made. The difference between the two is that prescales are turned off in the MC TCK. As of late this year, all MC TCKs will start with a "4", so if 0x00XXXXXX was run in the pit, 0x40XXXXXX is the MC TCK to use. You can explore the contents and differences of these TCKs using TCKsh. If the MC version is unavailable contact the HLT experts to get it made for you. If you want to find out what TCKs were used for a given run, look it up in the rundb: http://lbrundb.cern.ch To find out what TCKs at-a-glance were used for a given year, take a look at the summary from the <a href="https://lbweb.cern.ch/groups/online/OperationsPlots/index.htm">Operations Plots page</a> ---+++ Version-specific configs Moore is highly version dependent. You need to run the Moore version your TCK was designed for. Do *not* just take the latest version. You can find out which version of Moore is needed by which TCK using the TCKsh command <pre>getTCKInfo(%TCK%)</pre> ---+++ Multiple TCKs: adding a new TCK to a pre-existing dataset Lets say you have MC that has been produced with one TCK, and you want to get trigger decisions for a different one. To do this you need to move the old TCK out of the default location before re-running Moore. The RawEventJuggler ([[RawEventJuggler][see the twiki page]]) is what you need. The following script will do this for you: <verbatim> from Gaudi.Configuration import * from LHCbKernel.Configuration import * from Configurables import GaudiSequencer,RawEventJuggler from Configurables import LHCbApp LHCbApp() tck = "0xORIGINALTCK" MySeq=GaudiSequencer("MoveTCKtoNewLocation") MyWriter=InputCopyStream("CopyToFile") RawEventJuggler().GenericReplacePatterns={"Averyunlikelystringtohaveinaraweventlocation99": "idontcarebecausethiswillneverbeused"} #BUGFIX: This is needed until LHCb > v36r2 RawEventJuggler().TCK=tck RawEventJuggler().Input=0.0 RawEventJuggler().Output=3.0 RawEventJuggler().Sequencer=MySeq RawEventJuggler().WriterOptItemList=MyWriter RawEventJuggler().KillInputBanksAfter="L0*|Hlt*" RawEventJuggler().KillExtraNodes=True #remove DAQ/RawEvent completely ApplicationMgr().TopAlg = [MySeq] LHCbApp().EvtMax=-1 from GaudiConf import IOHelper IOHelper().inputFiles([ "myInputDataSet.dst" ]) IOHelper().outStream("myOutputDataSet.dst",MyWriter) </verbatim> To run it, set up the latest version of LHCb: <verbatim> SetupProject LHCb </verbatim> Copy the script from here and modify it to point to your input dataset. Change the tck=0xORIGINALTCK to the one contained in the file that you want moved out of the way. You may also need to change the RawEventJuggler().Input=0.0 line to a different input event format depending on the way in which the input file was produced. See <a href="https://svnweb.cern.ch/trac/lhcb/browser/DBASE/trunk/RawEventFormat/python/RawEventFormat/__init__.py">here</a> for information on what the formats and their corresponding numbers look like. Now run the script: <verbatim> gaudirun.py movetck.py </verbatim> You can check this has worked using Dst_Explorer: <verbatim> SetupProject bender Dst_Explorer myOutputDataSet.dst ls('/Event/Trigger') </verbatim> If your move worked, you should see the following: <verbatim> >>> ls('/Event/Trigger') /Event/Trigger DataObject /Event/Trigger/0xORIGINALTCK /Event/Trigger/RawEvent LHCb::RawEvent </verbatim> You can now run Moore using the script shown earlier, which will write your new TCK to the modified output dst. You can do this several times, moving and writing new TCKs each time, until you have several TCKs saved to Event/Trigger/TCK1, Event/Trigger/TCK2, etc. If you don't move the last TCK you write to the file, you don't need to do anything special to access it- All LHCb applications will see its trigger decisions by default. ---+++ Multiple TCKs: recovering an old TCK from a file with several If you want to access the old TCK after adding new ones as described above, SetupProject your application with the additional option: <verbatim> SetupProject <Application> --use RawEventFormat </verbatim> Where <Application> is DaVinci or whatever. The RawEventJuggler ([[RawEventJuggler][see the twiki page]]) is what you need. Add the following lines to your application at the start of your options. Everything after this will see the TCK you requested, assuming it was written to the file: <verbatim> RawEventJuggler().Input=3.0 RawEventJuggler().Output=2.0 RawEventJuggler().DataOnDemand=True RawEventJuggler().TCK=0xTCKYOUWANT </verbatim> Easy as that! ---++ Using Moore v23r4 with new (as of February 2015) style trigger lines 1. lb-dev Moore v23r4 2. Get head versions of following packages: * Hlt/HltTracking * Hlt/Hlt1Lines * Hlt/Hlt2Lines * Hlt/HltConf * Hlt/HltSettings * Tf/PatAlgorithms * Tr/TrackTools * Tr/TrackInterfaces * Tr/PatPV 3. make configure && make 4. Skeleton Moore.py: <verbatim> #!/usr/bin/env gaudirun.py import Gaudi.Configuration from Moore.Configuration import Moore Moore().ThresholdSettings = 'Physics_September2012' Moore().UseTCK = False Moore().EvtMax = 100 Moore().outputFile = 'mymooreout.raw' # In this example, we run on 2012 raw data. Not MC. from PRConfig.TestFileDB import test_file_db input = test_file_db['2012_raw_default'] input.run(configurable=Moore()) </verbatim> 5. ./run gauditun Moore.py ---++ Running from ThresholdSettings When running from ThresholdSettings to develop and Hlt line, use <verbatim> $> TCKsh >>> listConfigurations() MOORE_v23r2 Hlt_PassThrough 0x809d0000 : d55392174b99e00234c02e4c31050e51 : 2014 PassThrough Physics_September2012 0x0a000044 : 0524406614869d6d9813cba5ccaca6f0 : 2012 Physics, September default, less charm, Hlt2HighPTJets fixed 0x0a010046 : 49bfcfac7e695ba1d94b8bd4e1226ff0 : As 0x00a90046 for november 2014 commissioning tests. </verbatim> In the example output above, the name of the ThresholdSettings is listed between the Moore version and the TCKs, in this case e.g. *Physics_September2012*. Set this in the script listed above: <verbatim> Moore().ThresholdSettings = 'SomeThresholdSettings' # Only use ThresholdSettings when developing Hlt lines. Moore().UseTCK = False # Don't use a TCK in this case. </verbatim> ---+++ Adding an Additional Hlt2 line. There are two ways to add an additional Hlt2 line to Hlt/Hlt2Lines. 1. In an existing Hlt2XXXLines.py file 1. In a new Hlt2XXXLines.py file When creating a new HLT2XXXLines.py file, have a look at the existing Hlt2XXXXLines.py files and copy the skeleton. The class that build the lines and inherits from HltLinesConfigurableUser *must* be called Hlt2XXXXLinesConf, where XXXX is the same as in the file name. Don't forget to add an ID for your line to the HltANNSvc by picking a number larger than 65000 that isn't taken yet. Instantiate you Hlt2 line inside the <verbatim>__apply_configuration__</verbatim> method of your configurable of choice and then add the following to the script: <verbatim> from Configurables import HltConf HltConf().AdditionalHlt2Lines = ['TheNameOfYourLine'] # The name of your line is given to the constructor of Hlt2Line in your configurable of choice. </verbatim>
E
dit
|
A
ttach
|
Watch
|
P
rint version
|
H
istory
: r14
<
r13
<
r12
<
r11
<
r10
|
B
acklinks
|
V
iew topic
|
WYSIWYG
|
M
ore topic actions
Topic revision: r14 - 2015-02-13
-
NikitaKazeev
Log In
LHCb
LHCb Web
LHCb Web Home
Changes
Index
Search
LHCb webs
LHCbComputing
LHCb FAQs
LHCbOnline
LHCbPhysics
LHCbVELO
LHCbST
LHCbOT
LHCbPlume
LHCbRICH
LHCbMuon
LHCbTrigger
LHCbDetectorAlignment
LHCbTechnicalCoordination
LHCbUpgrade
Public webs
Public webs
ABATBEA
ACPP
ADCgroup
AEGIS
AfricaMap
AgileInfrastructure
ALICE
AliceEbyE
AliceSPD
AliceSSD
AliceTOF
AliFemto
ALPHA
Altair
ArdaGrid
ASACUSA
AthenaFCalTBAna
Atlas
AtlasLBNL
AXIALPET
CAE
CALICE
CDS
CENF
CERNSearch
CLIC
Cloud
CloudServices
CMS
Controls
CTA
CvmFS
DB
DefaultWeb
DESgroup
DPHEP
DM-LHC
DSSGroup
EGEE
EgeePtf
ELFms
EMI
ETICS
FIOgroup
FlukaTeam
Frontier
Gaudi
GeneratorServices
GuidesInfo
HardwareLabs
HCC
HEPIX
ILCBDSColl
ILCTPC
IMWG
Inspire
IPv6
IT
ItCommTeam
ITCoord
ITdeptTechForum
ITDRP
ITGT
ITSDC
LAr
LCG
LCGAAWorkbook
Leade
LHCAccess
LHCAtHome
LHCb
LHCgas
LHCONE
LHCOPN
LinuxSupport
Main
Medipix
Messaging
MPGD
NA49
NA61
NA62
NTOF
Openlab
PDBService
Persistency
PESgroup
Plugins
PSAccess
PSBUpgrade
R2Eproject
RCTF
RD42
RFCond12
RFLowLevel
ROXIE
Sandbox
SocialActivities
SPI
SRMDev
SSM
Student
SuperComputing
Support
SwfCatalogue
TMVA
TOTEM
TWiki
UNOSAT
Virtualization
VOBox
WITCH
XTCA
Welcome Guest
Login
or
Register
Cern Search
TWiki Search
Google Search
LHCb
All webs
Copyright &© 2008-2022 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