Using TisTos software with MicroDSTs (DaVinci v26r3p2 or higher)

Introduction

If you are looking for code example how to use TupleToolTISTOS in DecayTreeTupe with Stripping MDSTs please go to a page for TisTos with Stripping MDSTs and skip content of this page. If you are working with private MDSTs you may want to read this page which gives you more background information.

Using TisTos software with MicroDSTs is tricky since it depends on exact content of MicoDST and on how TisTos tools are used and set-up by the user. Therefore, it is not possible to give universal instructions how to do it. This page is intended to provide users with background information, so they can customize their code to particular MicroDST content and particular use of TisTos software.

TisTos software classifies trigger candidates and decisions with respect to offline selected signal (Particle) looking at overlaps between detector hits (LHCbIDs) related to the trigger and offline candidates. Thus, both trigger and offline LHCbIDs have to be available to the TisTos software together with their association to the trigger candidates and decisions and to the offline Particles. We discuss the trigger and offline inputs separately.

Trigger Reports

The LHCbIDs for the Hlt trigger candidates are saved in HltSelReports. Hlt trigger decision are saved in HltDecReports which is also needed. Both of these reports are made by Hlt itself and persisted as RawBanks in RawEvent. These raw banks must be decoded into appropriate TES locations when analyzing the data. DaVinci sets up such decoding for you when analyzing DSTs. When making MicroDSTs these RawBanks should be saved (both Stripping11 and Stripping12 MicroDSTs have them). When reading MicroDST the user is responsible for the decoding, thus for configuring HltDecReportsDecoder and HltSelReportsDecoder. Some privately made MicroDSTs persisted HltDecReports in TES location which eliminates need for its decoding, but is very inefficient in storage, thus I do not recommend doing that.

Situation is more complicated for TisTos of L0 decisions. L0 hardware saves their reports in a form of various RawBanks, which need to be decoded into several different classes in various TES locations. Such decoding is handled by L0Conf() Configurable and set-up by DaVinci for DST input (but not for MicroDST input). Some of these classes are needed for TisTos. In Stripping11 these classes where persisted on MicroDSTs in TES locations and do not require decoding. In Stripping12 L0 RawBanks were persisted instead, which is more storage efficient, however requires the user to set-up the decoding. In addition, the native L0 report classes need to be translated into HltDecReports and HltSelReports format before TisTos tools can be used. This is accomplished by executing L0DecReportsMaker and L0SelReportsMaker algorithms. For DST input this is again set up by DaVinci. For MicroDST input user must take care of set-up.

Trigger Reports Decoding

Standard DSTs have information saved in standard TES locations, which makes standard decoding possible. The latter is set-up automatically when using DaVinci. MicroDSTs have information saved in non-standard locations, which shifts burden of setting up the decoding of the Hlt and L0 reports to the user.

For example, for Stripping MicroDSTs the information is saved under ‘/Event/stream_name/’. The decoders of RawBanks must be redirected to non-standard RawEvent location. The output locations from the decoders can be either standard or non-standard depending on how TisTos tools are used.

All Gaudi Algorithms and Tools are equipped with RootInTES property which by default is set to ‘/Event/’. If RootInTES is set to non-standard location (e.g. ‘/Event/stream_name’) then all “get” and “put” operations (used to read/write from/to TES) will be redirected to the non-standard location. Tools used by Algorithms inherit RootInTES property from the Algorithms. If Algorithm is made a member of the sequence then it will inherit its RootInTES location from the sequence unless RootInTES is set explicitly.

When using TisTos tools directly in GaudiPython, then default location of Hlt and L0 reports is expected, thus decoding should be set-up for output at the standard TES locations. Alternatively, TisTos tools can be told to use non-standard locations by either setting their RootInTES property or by setting their HltDecReportsLocation and HltSelReportsLocation properties. When you use TisTos tools indirectly, e.g. via DecayTreeTuple, then the expected location of the Hlt and L0 reports depends on the value of RootInTES value of the Algorithm (e.g. DecayTreeTuple) which calls these tools.

Examples of various decoding set-ups for Stripping11 MicroDSTs are included in the Nov. 1, 2010 presentation on TisTos software. It appears that Stripping11 MDSTs are missing L0MuonCandidates, thus only L0 calo triggers can be TisTossed. In any case, you should be using Stripping12 data which do not have this problem.

For Striping12 MicroDSTs the user must also configure decoding of the L0 RawBanks. This can be accomplished with following options which must be placed AFTER any DaVinci() options:

locationRoot = "/Event/Leptonic/"  # depends on your stream! 
from Configurables import DataOnDemandSvc, L0Conf
L0Conf().FullL0MuonDecoding = True
L0Conf().EnableL0DecodingOnDemand = True
from Configurables import L0MuonCandidatesFromRaw, L0CaloCandidatesFromRaw, L0DUFromRawAlg
DataOnDemandSvc().AlgMap[locationRoot+"Trig/L0/MuonBCSU"] = L0MuonCandidatesFromRaw("L0MuonFromRaw",
                                                                                    RootInTES = locationRoot)
DataOnDemandSvc().AlgMap[locationRoot+"Trig/L0/FullCalo"] = L0CaloCandidatesFromRaw("L0CaloFromRaw", 
                                                                                    RootInTES = locationRoot)
DataOnDemandSvc().AlgMap[locationRoot+"Trig/L0/L0DUReport"] = L0DUFromRawAlg("L0DUFromRaw", 
                                                                             RootInTES = locationRoot)
which put L0 reports in native format under "/Event/Leptonic/" root. Thus, translation of these reports to Hlt format should be set-up as:
from Configurables import L0DecReportsMaker, L0SelReportsMaker
DataOnDemandSvc().AlgMap[locationRoot+"HltLikeL0/DecReports"] = L0DecReportsMaker(RootInTES = locationRoot)
DataOnDemandSvc().AlgMap[locationRoot+"HltLikeL0/SelReports"] = L0SelReportsMaker(RootInTES = locationRoot)

and L0TriggerTisTos tool used directly by user in GaudiPython set-up as:

from Configurables import L0TriggerTisTos
L0TriggerTisTos().HltDecReportsLocation = locationRoot+"HltLikeL0/DecReports"
L0TriggerTisTos().HltSelReportsLocation = locationRoot+"HltLikeL0/SelReports"

Any Algorithm using this tool, e.g. DecayTreeTuple, should use RootInTES = locationRoot instead of explicit tool configuration.

Hlt decoding for Stripping12 MicroDSTs is the same as for Stripping11.

Here is an example of a complete set-up for use of DecayTreeTuple with TupleToolTISTOS when reading Stripping12 MicroDST:

locationRoot = "/Event/Dimuon/"    # This depends on input stream!
  
from Configurables import DecayTreeTuple, TupleToolTISTOS
tuple = DecayTreeTuple("blabla")
tuple.RootInTES      = locationRoot
 
tttt = TupleToolTISTOS()
from Configurables import L0TriggerTisTos, TriggerTisTos
tttt.addTool( L0TriggerTisTos() )
tttt.addTool( TriggerTisTos() )
 
tuple.addTool(tttt)
tuple.TupleToolTISTOS.L0TriggerTisTos.UseParticle2LHCbIDsMap = 2
tuple.TupleToolTISTOS.TriggerTisTos.UseParticle2LHCbIDsMap = 2

from Configurables import DaVinci
DaVinci().UserAlgorithms = [tuple]
# .... all other DaVinci() options here ...

# ------- decoding set-up start ----------
from Configurables import HltDecReportsDecoder, HltSelReportsDecoder, DataOnDemandSvc, ANNDispatchSvc
 
rawEventLoc = locationRoot + "DAQ/RawEvent"
decReportLoc = locationRoot + "Hlt/DecReports"
selReportLoc = locationRoot + "Hlt/SelReports"
 
ANNDispatchSvc().RawEventLocation = rawEventLoc
ApplicationMgr().ExtSvc +=  [ DataOnDemandSvc(),ANNDispatchSvc() ]
 
decReportsDecoder = HltDecReportsDecoder( InputRawEventLocation = rawEventLoc,
                                          OutputHltDecReportsLocation = decReportLoc)
selReportsDecoder = HltSelReportsDecoder( InputRawEventLocation = rawEventLoc,
                                          OutputHltSelReportsLocation = selReportLoc,
                                          HltDecReportsLocation = decReportLoc
                                          )
 
DataOnDemandSvc().AlgMap[selReportLoc] = selReportsDecoder
DataOnDemandSvc().AlgMap[decReportLoc] = decReportsDecoder

from Configurables import L0DecReportsMaker, L0SelReportsMaker
DataOnDemandSvc().AlgMap[locationRoot+"HltLikeL0/DecReports"] = L0DecReportsMaker(RootInTES = locationRoot)
DataOnDemandSvc().AlgMap[locationRoot+"HltLikeL0/SelReports"] = L0SelReportsMaker(RootInTES = locationRoot)

from Configurables import L0Conf
L0Conf().FullL0MuonDecoding = True
L0Conf().EnableL0DecodingOnDemand = True
from Configurables import L0MuonCandidatesFromRaw, L0CaloCandidatesFromRaw, L0DUFromRawAlg
DataOnDemandSvc().AlgMap[locationRoot+"Trig/L0/MuonBCSU"] = L0MuonCandidatesFromRaw("L0MuonFromRaw",
                                                                                    RootInTES = locationRoot)
DataOnDemandSvc().AlgMap[locationRoot+"Trig/L0/FullCalo"] = L0CaloCandidatesFromRaw("L0CaloFromRaw", 
                                                                                    RootInTES = locationRoot)
DataOnDemandSvc().AlgMap[locationRoot+"Trig/L0/L0DUReport"] = L0DUFromRawAlg("L0DUFromRaw", 
                                                                             RootInTES = locationRoot)
# ------- decoding set-up end ----------

Juan Palacios has encapsulated the above decoding options for Striping12 mdsts in a python function. To use it replace everything in between the lines

# ------- decoding set-up start ----------
# ------- decoding set-up end ----------
with
from MicroDSTConf.TriggerConfUtils import configureL0AndHltDecoding
configureL0AndHltDecoding(locationRoot)
Again, this must be placed AFTER any DaVinci() options, otherwise you will get warnings about missing Trig/L0/MuonBCSU.

Unless you are using DaVinci release higher than v26r3p2 you will need to "getpack MicroDST/MicroDSTConf r114654" to be able to use this function.

Offline Signal Set-up

Usually selected Particle is passed as signal to TisTos tool. The tool will then try to extract LHCbIDs corresponding to all components (daughters) of the signal Particle. In quest for the LHCbIDs the tool will follow pointers to ProtoParticles, Tracks, CaloClusters, muon Tracks etc. It is difficult to save all these objects on MicroDSTs. Thus, when running on MicoDSTs the tool is likely to end-up with incomplete set of signal LHCbIDs and therefore wrong TisTos results.

To overcome this problem for Stripping MicroDSTs LHCbIDs were extracted from the stripping candidates in the Stripping job and persisted in a special way in MicroDSTs. The user does not need to know details of this mechanism, however, it should tell the TisTos tools to look for such saved LHCbIDs by setting UseParticle2LHCbIDsMap=2 - please see examples here. In Stripping11 this was implemented only for the top level signal Particles, thus their daughters cannot be independently TisTossed. In Stripping12 also the daughters have their LHCbID persisted.

If you are trying to write your own MicroDST, follow $APPCONFIGOPTS/DaVinci/DV-Stripping12-Stripping.py example.

-- TomaszSkwarnicki - 01-Dec-2010; Last update 24-Jan-2011

Edit | Attach | Watch | Print version | History: r11 < r10 < r9 < r8 < r7 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r11 - 2011-11-01 - TomaszSkwarnicki
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    LHCb 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.
Ideas, requests, problems regarding TWiki? Send feedback