An example of a line in the Hlt2 Inclusive Phi alley:

1Hlt2InclusivePhi = Hlt2Member( CombineParticles
11                                       , "Combine"
21                                       , DecayDescriptors = ["phi(1020) -> K+ K-"]
31                                       , DaughtersCuts = { "K+" : (PT>800*MeV) & (MIPDV(PRIMARY)>0.05) }
41                                       , CombinationCut =  (ADAMASS('phi(1020)')<20*MeV)" & "(AMINDOCA('LoKi::TrgDistanceCalculator') <0.2)
51                                       , MotherCut = (PT>1800*MeV)
61                                       , InputLocations  = [ GoodKaons ]
71                                       )

1line = Hlt2Line('IncPhi'
11                        , algos = [ GoodKaons,
21                                        Hlt2InclusivePhi,
31                                       ]
41                         )

## First exercise: monitor the variables of this Hlt2Line without changing the CombineParticle sequence ex. by using a VoidFilter.

1) Monitor the mass, the pt of the accepted phi candidates and the number of phi candidates which passed the selection above.

1//import the LoKi VoidFilter
11
21       from Configurables import LoKi__VoidFilter as MonFilter
31
41//start your monitoring sequence in the VoidFilter style:
51
61       moni1b = MonFilter(
71                         'MonitorPhi1'
81//behind SOURCE write the container of the particles you would like to monitor
91                         , Code = """SOURCE('/Event/Hlt2/Hlt2IncPhiCombine/Particles')
101                         >> process( monitor(MM, histoMM1, 'Mass1' ) > 0)
111                         >> process( monitor(PT, histoPT1, 'Pt1' ) > 0)
121                         >> (monitor(SIZE,histoAcc1,'Acc1')>0)"""
131//define the histograms
141                        , Preambulo = [
151                              "from LoKiCore.functions import *"
161                            , "from LoKiPhys.decorators import *"
171                            , "histoMM1 = Gaudi.Histo1DDef('Inv Mass - after Robust Cuts',1005,1035,50)"
181                            , "histoPT1  = Gaudi.Histo1DDef('Pt Phi - after Robust Cuts',0,5000)"
191                            , "histoAcc1 = Gaudi.Histo1DDef('Accepted Phi candidates - after Robust Cuts',0,10,10)"
201                           ]
211                         )

• Line monitor the mass of the particles in the container and place its value in histogram histoMM1.
• histoMM1 is defined further in Line 171.
• Note that after the word Code, everything between " " is one long sentence. You pass data on (>>) starting from the container towards the function that monitors the mass, then you pass the data on to the that monitors the momentum etc.
• In this case you need to use the streamer function "process", because you want to pass on the original container each time.
• "process" will only pass on the container if the statement between brackets, monitor(PT, histoPT1, 'Pt1' ) is true.
• "monitor" obtains the first argument (ex. mass) of each candidate in the container and passes it to the histogram returns the number of candidates that were monitored.
• NOTE: if one event has two phi candidates (event is saved because one of the two candidates passed the trigger requirements) both phi's will end up in your plots

3) Monitor the candidate phi that passed the cuts

1moni = MonFilter(
11                         'MonitorPhi1'
21//behind SOURCE write the container of the particles you would like to monitor
31                         , Code = """SOURCE('/Event/Hlt2/Hlt2IncPhiCombine/Particles')
41                          >> tee(monitor(max_value(PT), histoPTmax1, 'PtMax1' ) > 0)
51                         >> process( monitor(MM, histoMM1, 'Mass1' ) > 0)
61                         >> process( monitor(PT, histoPT1, 'Pt1' ) > 0)
71                         >> (monitor(SIZE,histoAcc1,'Acc1')>0)"""

• see line 00041: notice that you are now making a selection on the events you want to monitor. And thus you don't want to use the streamer process to pass on the
container afterwards because all the following monitoring sequences in your phrase will only be applied on the selected candidates (i.e. if you use process you will monitor the mass of the phi candidate which the highest pT in your event). Therefore use the streamer "tee". This makes first a copy of the incoming container, passes one copy on and applies the monitoring and selection on the 2nd copy.

4) Monitor daughter particles (in this case the kaons of the phi candidates): use the first or second child, or use the NINTREE

1" ...
11                  >> process(monitor(CHILD(PT,1) , histoPTK1, 'PtK1' ) > 0)
21                  >> process(monitor(MINTREE('K+'==ABSID, PT) , histoPTK1mintree, 'PtK1mintree' ) > 0)     "

5) Finally add your monitoring sequence in the Trigger line (see line 0031)

1line = Hlt2Line('IncPhi'
11                        , algos = [ GoodKaons,
21                                        Hlt2InclusivePhi,
31                                        moni
41                                       ]
51                         )

6) Turn on the monitoring in your Moore or DaVinci settings

1Moore().EnableMonitoring = True
11Moore().HistogrammingLevel = ''
21

## Second exercise: monitor the variables of this Hlt2Line inside the CombineParticle sequence.

Right now some LoKi filters can only be monitored inside the CombineParticle or FilterDesktop. These are mainly LoKi filters which have "DV" in their name. Ex. MIPDV(PRIMARY). But there are also some filters which have hidden dependencies on CombineParticle or FilterDesktop (note: with hidden I mean hidden for me, for others this might be obvious...).

The principle of monitoring inside the CombineParticles is exactly the same, but you don't need to deal with the streamers (process, tee...) so for quick checks this method is a lot easier to use. You also don't need to change anything in the definition of your line, no extra sequence need to be added.

1Hlt2InclusivePhi = Hlt2Member( CombineParticles
11                                       , "Combine"
21                                       , DecayDescriptors = ["phi(1020) -> K+ K-"]
31                                       , DaughtersCuts = { "K+" : (PT>800*MeV) & (monitor(MIPDV(PRIMARY), histoKaonIP, 'KIP')>0.05) }
41                                       , CombinationCut =  "(monitor(AMINDOCA('LoKi::TrgDistanceCalculator'),histoDOCA,'DOCA')  <0.2)"
51                                       , MotherCut = (PT>1800*MeV)
61                                       , InputLocations  = [ GoodKaons ]
71                                       , Preambulo = [
81                                         "histoDOCA = Gaudi.Histo1DDef('DOCA',0,1)",
91                                         "histoKaonIP = Gaudi.Histo1DDef('KIP',0,1)"
101                                       ]
111                                       )

Depending on where you make the bracket of (monitor end i.e. inside our outside the cut, you monitor the variable that passed the selection or all the variables resp.

-- KimVervink - 03-Jun-2010

Edit | Watch | Print version | History: r3 < r2 < r1 | Backlinks | Raw View | More topic actions
Topic revision: r3 - 2010-06-04 - unknown

Welcome Guest

 Cern Search TWiki Search Google Search LHCb All webs
Copyright &© 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