Difference: DaVinciTutorial8 (1 vs. 57)

Revision 572014-11-04 - GiulioDujany

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.

Revision 562013-11-18 - GiulioDujany

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 297 to 297
  # decision filter test from Configurables import LoKi__HDRFilter
Changed:
<
<
sf = Loki__HDRFilter( 'StripPassFilter', Code="HLT_PASS('Stripping"+line+"Decision')", Location="/Event/Strip/Phys/DecReports" )
>
>
sf = LoKi__HDRFilter( 'StripPassFilter', Code="HLT_PASS('Stripping"+line+"Decision')", Location="/Event/Strip/Phys/DecReports" )
 MySequencer.Members = [ sf ]

# TES explorer

Revision 552013-09-30 - PatrickSKoppenburg

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 333 to 333
 
META FILEATTACHMENT attachment="J_psi_detached_TOS.png" attr="h" comment="" date="1380548978" name="J_psi_detached_TOS.png" path="J_psi_detached_TOS.png" size="23568" user="pkoppenb" version="1"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v33r7"
Changed:
<
<
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v10r5"
>
>
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v10r6"
 |*META PREFERENCE*|name="SYNTAXHIGHLIGHTINGPLUGIN_FORMAT_PREPEND" title="SYNTAXHIGHLIGHTINGPLUGIN_FORMAT_PREPEND" type="Set" value="
"|

Revision 542013-09-30 - PatrickSKoppenburg

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 103 to 103
 
  1. TisTos your candidate
  2. Store (or fit) it somehow. That could be done directly in python, or via a microDST, or in DecayTreeTuple. For simplicity, we'll use this option.
Changed:
<
<

J/psi to mu mu analysis

>
>

J/ψ → μμ analysis

 

Where is the candidate?

Changed:
<
<
We can, logically, look for the J/psi to dimuon decay in the Dimuon stream. Examining the list of dimuon streams in this documentation, we find that there are two lines StrippingBetaSJPsi2MuMuDetachedLine and StrippingBetaSJPsi2MuMuLine, the former of which has some tighter cuts (check this). By looking at the builders for the Dimuon stream (see above), clearly this line belongs was created by the BetaS builder. So, we can find the output location for the line using
>
>
We can, logically, look for the J/ψ to dimuon decay in the Dimuon stream. Examining the list of dimuon streams in this documentation, we find that there are two lines StrippingBetaSJPsi2MuMuDetachedLine and StrippingBetaSJPsi2MuMuLine, the former of which has some tighter cuts (check this). By looking at the builders for the Dimuon stream (see above), clearly this line belongs was created by the BetaS builder. So, we can find the output location for the line using
  %SYNTAX{ syntax="python"}%SetupProject DaVinci v33r7 python
Line: 180 to 180
 

How to refine candidates

Changed:
<
<
To refine candidates, the important point is to start from your candidate and apply further cuts. The main tool for this task is the ParticleSelection framework (follow the link for more information). The following is a simple example that applies a mass cut to the J/psi candidates:
>
>
To refine candidates, the important point is to start from your candidate and apply further cuts. The main tool for this task is the ParticleSelection framework (follow the link for more information). The following is a simple example that applies a mass cut to the J/ψ candidates:
  %SYNTAX{ syntax="python"}% # get classes to build the SelectionSequence
Line: 211 to 211
 %SYNTAX{ syntax="python"}% from Configurables import DecayTreeTuple, TupleToolTrigger, TupleToolDecay, TupleToolTISTOS tuple = DecayTreeTuple("Jpsi_Tuple")
Changed:
<
<
tuple.ToolList += [ "TupleToolGeometry" , "TupleToolKinematic" , "TupleToolPrimaries" , "TupleToolEventInfo" , "TupleToolTrackInfo" , "TupleToolTISTOS" , "TupleToolAngles" , "TupleToolPid" , "TupleToolPropertime" ]
>
>
# tuple.addTupleTool( "TupleToolGeometry") // already default # tuple.addTupleTool( "TupleToolKinematic")// already default tuple.addTupleTool( "TupleToolPropertime") tuple.addTupleTool( "TupleToolPrimaries") # tuple.addTupleTool( "TupleToolEventInfo")// already default tuple.addTupleTool( "TupleToolTrackInfo")
 tuple.Decay = "J/psi(1S) -> ^mu+ ^mu-" tuple.Inputs = [ JpsiSeq.outputLocation() ]
Changed:
<
<
tuple.addTool(TupleToolTISTOS) tuple.TupleToolTISTOS.TriggerList = [ "Hlt2DiMuonJPsiDecision" ]
>
>
tuple.addTupleTool(TupleToolTISTOS) tuple.TupleToolTISTOS.TriggerList = [ "Hlt2DiMuonJPsiDecision", "Hlt2DiMuonJPsiHighPTDecision", "Hlt2DiMuonDetachedJPsiDecision" ]
 tuple.TupleToolTISTOS.VerboseHlt2 = True
Added:
>
>
DaVinci().appendToMainSequence( [ JpsiSeq.sequence(), tuple ] )
 DaVinci().appendToMainSequence( [ tuple ] ) DaVinci().TupleFile = "Tutorial8.root" %ENDSYNTAX%
Line: 320 to 316
 DaVinci().PrintFreq = 100 %ENDSYNTAX%
Changed:
<
<
Opening the ROOT file (which can be done from within ganga using peek('Tutorial8.root')), you can produce examine the histograms saved by the tuple tools included in the above script. In particular, J J/psi mass should look something like this:
  • Psi mass:
    hh.png
>
>
Opening the ROOT file (which can be done from within ganga using peek('Tutorial8.root')), you can produce examine the histograms saved by the tuple tools included in the above script. In particular, the J/ψ mass should look something like this:

J_psi_detached_TOS.png

Here the red points are all candidates passing the selection and the clue ones only those that are Hlt2DiMuonDetachedJPsi TOS.

 

Next

Line: 331 to 329
  -- PatrickSKoppenburg - 08-Jun-2010 -- PatrickSKoppenburg - 16-Oct-2012
Added:
>
>
-- PatrickSKoppenburg - 30-Sep-2013
 
Changed:
<
<
META FILEATTACHMENT attachment="hh.png" attr="" comment="" date="1350400028" name="hh.png" path="hh.png" size="23971" user="pkoppenb" version="5"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v33r5"
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v10r4"
>
>
META FILEATTACHMENT attachment="J_psi_detached_TOS.png" attr="h" comment="" date="1380548978" name="J_psi_detached_TOS.png" path="J_psi_detached_TOS.png" size="23568" user="pkoppenb" version="1"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v33r7"
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v10r5"
 |*META PREFERENCE*|name="SYNTAXHIGHLIGHTINGPLUGIN_FORMAT_PREPEND" title="SYNTAXHIGHLIGHTINGPLUGIN_FORMAT_PREPEND" type="Set" value="
"|

Revision 532013-09-12 - NathanaelFarley

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

Deleted:
<
<
 How to run on a stripped DST.

Line: 37 to 34
  Open a new shell and call SetupProject DaVinci directly:
Changed:
<
<
%SYNTAX{ syntax="python"}% SetupProject DaVinci v33r7 python from StrippingArchive import Utils help(Utils) from StrippingSettings import Utils as SettingUtils help(SettingUtils)
>
>
%SYNTAX{ syntax="python"}% SetupProject DaVinci v33r7 python from StrippingArchive import Utils help(Utils) from StrippingSettings import Utils as SettingUtils help(SettingUtils)
 %ENDSYNTAX%

If the DaVinci version is not available try

Changed:
<
<
%SYNTAX{ syntax="python"}% SetupProject DaVinci --list-versions
>
>
%SYNTAX{ syntax="python"}% SetupProject DaVinci --list-versions
 %ENDSYNTAX%

Finding out about a stream

The most recent stripping is Stripping20 (Stripping13, 14, etc. contain older definitions of the stripping lines). The following

Changed:
<
<
%SYNTAX{ syntax="python"}% print Utils.streamNames("stripping20")
>
>
%SYNTAX{ syntax="python"}% print Utils.streamNames("stripping20")
 %ENDSYNTAX%

prints a list of the StrippingStreams that appear in Stripping20, including, for example, "Bhadron", "Semileptonic", "Dimuon", etc.

Line: 57 to 62
  Each stream contains different line builders used to construct stripping lines. The following
Changed:
<
<
%SYNTAX{ syntax="python"}% SettingUtils.printBuildersByStream("stripping20")
>
>
%SYNTAX{ syntax="python"}% SettingUtils.printBuildersByStream("stripping20")
 %ENDSYNTAX%

will print a list of the names of the builders appearing in Stripping20, grouped by the stream they appear in. Meanwhile,

Changed:
<
<
%SYNTAX{ syntax="python"}% SettingUtils.printBuildersByWG("stripping20")
>
>
%SYNTAX{ syntax="python"}% SettingUtils.printBuildersByWG("stripping20")
 %ENDSYNTAX%

will print the same information, but this time grouped by the working group (WG) in charge of the builder.

For example, one of the builders belonging to the "Semileptonic stream" is B0q2DplusMuX. We can examine this line builder using the lineBuilderAndConf method of the StrippingArchive.Utils module:

Changed:
<
<
%SYNTAX{ syntax="python"}% line,conf=Utils.lineBuilderAndConf("stripping20","B0q2DplusMuX") help(line) print conf
>
>
%SYNTAX{ syntax="python"}% line,conf=Utils.lineBuilderAndConf("stripping20","B0q2DplusMuX") help(line) print conf
 %ENDSYNTAX%

The object conf is the python dictionary that was used to configure the LineBuilder for the B0q2DplusMuX stripping lines in Stripping20, while line is a copy of the line builder. The name B0q2DplusMuX is important. It's the name the LineBuilder was associated with in the Stripping. This name is usually (but not always) the name that appears after `Stripping' in the filename containing the LineBuilder in StrippingSelections.

Line: 78 to 88
  When the analysis application is run it will be passed the location of the stripping data (a collection of .DST files) to be processed; this output location is the location of the line inside the stripping data store. The output location in the stripping can be found using
Changed:
<
<
%SYNTAX{ syntax="python"}% print Utils.outputLocations("stripping20","B0q2DplusMuX")
>
>
%SYNTAX{ syntax="python"}% print Utils.outputLocations("stripping20","B0q2DplusMuX")
 %ENDSYNTAX%

As you can see, there are several output locations. The LineBuilder B0q2DplusMuX was used to produce several related lines in the stripping, as is common.

Line: 85 to 96
  More information can also be obtained using the STCKsh executable= (after running SetupDaVinci).
Added:
>
>
 

Generic workflow for a particle reconstruction analysis

Changed:
<
<
  1. Read your candidates
  2. Refine your candidates (more cuts)
  3. TisTos your candidate
  4. Store (or fit) it somehow. That could be done directly in python, or via a microDST, or in DecayTreeTuple. For simplicity, we'll use this option.
>
>
  1. Read your candidates
  2. Refine your candidates (more cuts)
  3. TisTos your candidate
  4. Store (or fit) it somehow. That could be done directly in python, or via a microDST, or in DecayTreeTuple. For simplicity, we'll use this option.
 

J/psi to mu mu analysis

Line: 97 to 109
  We can, logically, look for the J/psi to dimuon decay in the Dimuon stream. Examining the list of dimuon streams in this documentation, we find that there are two lines StrippingBetaSJPsi2MuMuDetachedLine and StrippingBetaSJPsi2MuMuLine, the former of which has some tighter cuts (check this). By looking at the builders for the Dimuon stream (see above), clearly this line belongs was created by the BetaS builder. So, we can find the output location for the line using
Changed:
<
<
<!-- SyntaxHighlightingPlugin -->
SetupProject DaVinci v33r7 python from StrippingArchive import Utils print Utils.outputLocations("stripping20","BetaS") 
<!-- end SyntaxHighlightingPlugin -->
This prints out the locations for all the lines created by the BetaS builder. Looking through it, the location of the StrippingBetaSJPsi2MuMuDetachedLine line is /Event/Dimuon/Phys/BetaSJpsi2MuMuDetachedLine/Particles.
>
>
<!-- SyntaxHighlightingPlugin -->
SetupProject DaVinci  v33r7
python
from StrippingArchive import Utils
print Utils.outputLocations("stripping20","BetaS")
<!-- end SyntaxHighlightingPlugin -->
This prints out the locations for all the lines created by the BetaS builder. Looking through it, the location of the StrippingBetaSJPsi2MuMuDetachedLine line is /Event/Dimuon/Phys/BetaSJpsi2MuMuDetachedLine/Particles.
 
Deleted:
<
<

Is this really the line I want?

 
Added:
>
>

Is this really the line I want?

 It is, or the tutorial wouldn't have told you so. But let's pretend you're not sure. You can check that with PrintDecayTree. There is more information on this tool in DaVinciTutorial5. Essentially, this algorithm will print the reconstructed decay tree for reconstructed events.

Create the following python options file

Changed:
<
<
<!-- SyntaxHighlightingPlugin -->
from Gaudi.Configuration import * line = "BetaSJpsi2MuMuDetachedLine" location = "/Event/Dimuon/Phys/"+line+"/Particles" from Configurables import DaVinci, PrintDecayTree pt = PrintDecayTree(Inputs = [ location ]) DaVinci().appendToMainSequence( [ pt ] ) DaVinci().DataType = "2012" DaVinci().EvtMax = -1
<!-- end SyntaxHighlightingPlugin -->
>
>
<!-- SyntaxHighlightingPlugin -->
from Gaudi.Configuration import *
line = "BetaSJpsi2MuMuDetachedLine"
location = "/Event/Dimuon/Phys/"+line+"/Particles"
from Configurables import DaVinci, PrintDecayTree
pt = PrintDecayTree(Inputs = [ location ])
DaVinci().appendToMainSequence( [ pt ] )
DaVinci().DataType = "2012"
DaVinci().EvtMax = -1
<!-- end SyntaxHighlightingPlugin -->
  You can run this DaVinci job in any of the possible ways described so far (through ganga, gaudirun.py, or cmt run gaudirun.py). The output will include PrintDecayTree output that will look something like
Changed:
<
<
%SYNTAX{ syntax="python"}% PrintDecayTree.... INFO <---------------------------------- Particle ----------------------------------> Name E M P Pt phi Vz MeV MeV MeV MeV mrad mm J/psi(1S) 67092.32 3096.92 67020.81 17339.45 -2095.73 -29.40 +-->mu+ 36447.87 105.66 36447.71 8322.81 -1978.59 -41.79 +-->mu- 30703.64 105.66 30703.46 9140.31 -2202.21 -38.35
>
>
%SYNTAX{ syntax="python"}%
PrintDecayTree....   INFO 
<---------------------------------- Particle ----------------------------------> 
           Name         E         M         P        Pt       phi        Vz 
                       MeV       MeV       MeV       MeV      mrad        mm 
J/psi(1S)            67092.32   3096.92  67020.81  17339.45  -2095.73    -29.40 
+-->
mu+ 36447.87 105.66 36447.71 8322.81 -1978.59 -41.79 +-->mu- 30703.64 105.66 30703.46 9140.31 -2202.21 -38.35
 %ENDSYNTAX%

But Tutorial 8, not all the events have candidates!

Line: 123 to 153
  The first of these tools is GaudiSequencer. This tool lets you create a sequence of algorithms which halts after one of the algorithms fails (read more in its documentation). For the first algorithm, you can select events which pass the stripping line using an HltDecReports filter. Then you can add PrintDecayTree as the second algorithm. Then PrintDecayTree will run only on events that pass the appropriate filter.
Changed:
<
<
<!-- SyntaxHighlightingPlugin -->
from Gaudi.Configuration import * line = "BetaSJpsi2MuMuDetachedLine" location = "/Event/Dimuon/Phys/"+line+"/Particles" from Configurables import DaVinci, PrintDecayTree, GaudiSequencer from Configurables import LoKi __HDRFilter MySequencer = GaudiSequencer('Sequence') pt = PrintDecayTree(Inputs = [ location ]) sf = LoKi __HDRFilter( 'StripPassFilter', Code="HLT_PASS('Stripping"+line+"Decision')", Location="/Event/Strip/Phys/DecReports" ) MySequencer.Members = [ sf, pt ] DaVinci().appendToMainSequence( [ MySequencer ] ) DaVinci().DataType = "2012" DaVinci().EvtMax = -1
<!-- end SyntaxHighlightingPlugin -->
>
>
<!-- SyntaxHighlightingPlugin -->
from Gaudi.Configuration import *
line = "BetaSJpsi2MuMuDetachedLine"
location = "/Event/Dimuon/Phys/"+line+"/Particles" 
from Configurables import DaVinci, PrintDecayTree, GaudiSequencer
from Configurables import LoKi__HDRFilter
MySequencer = GaudiSequencer('Sequence')
pt = PrintDecayTree(Inputs = [ location ])
sf = LoKi__HDRFilter( 'StripPassFilter', Code="HLT_PASS('Stripping"+line+"Decision')", Location="/Event/Strip/Phys/DecReports" )
MySequencer.Members = [ sf, pt ]
DaVinci().appendToMainSequence( [ MySequencer ] )
DaVinci().DataType = "2012"
DaVinci().EvtMax = -1
<!-- end SyntaxHighlightingPlugin -->
  The output will now include a counter named StripPassFilter which counts how many events passed this filter.
Line: 128 to 169
 The output will now include a counter named StripPassFilter which counts how many events passed this filter.

What about trigger lines?

Deleted:
<
<
 The same can be done to count how many of the events pass a high level trigger. Add the following code before MySequencer is appended to the main sequence:
Changed:
<
<
%SYNTAX{ syntax="python"}% tf = LoKi __HDRFilter( 'HltPassFilter', Code="HLT_PASS('Hlt1.*Muon.*Decision')" ) MySequencer.Members += [ tf ]
>
>
%SYNTAX{ syntax="python"}% tf = LoKi__HDRFilter( 'HltPassFilter', Code="HLT_PASS('Hlt1.*Muon.*Decision')" ) MySequencer.Members += [ tf ]
 %ENDSYNTAX%

This will add a counter which counts how many of the events that pass the stripping line decision also pass these high level muon triggers. To really understand what the trigger does to your signal, though, you should use the TriggerTisTos tools. See also HltEfficiency.

Line: 140 to 182
  To refine candidates, the important point is to start from your candidate and apply further cuts. The main tool for this task is the ParticleSelection framework (follow the link for more information). The following is a simple example that applies a mass cut to the J/psi candidates:
Changed:
<
<
%SYNTAX{ syntax="python"}% # get classes to build the SelectionSequence from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence # Get the Candidates from the DST. AutomaticData is for data on the DST JpsiSel = AutomaticData(Location = location) # Filter the Candidate. Let's throw away everything above 4 GeV from Configurables import FilterDesktop _jpsiFilter = FilterDesktop('jpsiFilter', Code = '(M>2500*MeV) & (M<4000*MeV)')

# make a Selection JpsiFilterSel = Selection(name = 'JpsiFilterSel', Algorithm = _jpsiFilter, RequiredSelections = [ JpsiSel ])

# build the SelectionSequence JpsiSeq = SelectionSequence('SeqJpsi', TopSelection = JpsiFilterSel, )

>
>
%SYNTAX{ syntax="python"}% # get classes to build the SelectionSequence from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence # Get the Candidates from the DST. AutomaticData is for data on the DST JpsiSel = AutomaticData(Location = location) # Filter the Candidate. Let's throw away everything above 4 GeV from Configurables import FilterDesktop _jpsiFilter = FilterDesktop('jpsiFilter', Code = '(M>2500*MeV) & (M<4000*MeV)')

# make a Selection JpsiFilterSel = Selection(name = 'JpsiFilterSel', Algorithm = _jpsiFilter, RequiredSelections = [ JpsiSel ])

# build the SelectionSequence JpsiSeq = SelectionSequence('SeqJpsi', TopSelection = JpsiFilterSel, )

  DaVinci().appendToMainSequence( [ JpsiSeq.sequence() ] ) %ENDSYNTAX%
Line: 153 to 208
  This task is the focus of DaVinciTutorial6, and for more information look there. The following code snippet writes typical interesting variables into a ROOT file named Tutorial8.root.
Changed:
<
<
%SYNTAX{ syntax="python"}% from Configurables import DecayTreeTuple, TupleToolTrigger, TupleToolDecay, TupleToolTISTOS tuple = DecayTreeTuple("Jpsi_Tuple") tuple.ToolList += [ "TupleToolGeometry" , "TupleToolKinematic" , "TupleToolPrimaries" , "TupleToolEventInfo" , "TupleToolTrackInfo" , "TupleToolTISTOS" , "TupleToolAngles" , "TupleToolPid" , "TupleToolPropertime" ] tuple.Decay = "J/psi(1S) -> ^mu+ ^mu-" tuple.Inputs = [ JpsiSeq.outputLocation() ] tuple.addTool(TupleToolTISTOS) tuple.TupleToolTISTOS.TriggerList = [ "Hlt2DiMuonJPsiDecision" ] tuple.TupleToolTISTOS.VerboseHlt2 = True DaVinci().appendToMainSequence( [ tuple ] ) DaVinci().TupleFile = "Tutorial8.root"
>
>
%SYNTAX{ syntax="python"}% from Configurables import DecayTreeTuple, TupleToolTrigger, TupleToolDecay, TupleToolTISTOS tuple = DecayTreeTuple("Jpsi_Tuple") tuple.ToolList += [ "TupleToolGeometry" , "TupleToolKinematic" , "TupleToolPrimaries" , "TupleToolEventInfo" , "TupleToolTrackInfo" , "TupleToolTISTOS" , "TupleToolAngles" , "TupleToolPid" , "TupleToolPropertime" ] tuple.Decay = "J/psi(1S) -> ^mu+ ^mu-" tuple.Inputs = [ JpsiSeq.outputLocation() ] tuple.addTool(TupleToolTISTOS) tuple.TupleToolTISTOS.TriggerList = [ "Hlt2DiMuonJPsiDecision" ] tuple.TupleToolTISTOS.VerboseHlt2 = True DaVinci().appendToMainSequence( [ tuple ] ) DaVinci().TupleFile = "Tutorial8.root"
 %ENDSYNTAX%

Putting it all together

The following shows how put all these tasks together into an analysis sequence. This is taken (with a few modifications) from a solution options file available in Tutorial/Analysis/solutions/DaVinci8 from tag v10r6.

Changed:
<
<
%SYNTAX{ syntax="python"}% ######################################################################## # # Options for exercise 8 # # @author Patrick Koppenburg # @date 2010-06-07 # ########################################################################

from Gaudi.Configuration import * from Configurables import DaVinci

######### Candidate location line = 'BetaSJpsi2MuMuDetachedLine' location = '/Event/Dimuon/Phys/'+line+'/Particles'

######### Refining the candidate # get classes to build the SelectionSequence from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence # Get the Candidates from the DST. AutomaticData is for data on the DST JpsiSel = AutomaticData(Location = location) # Filter the Candidate. Let's throw away everything above 4 GeV from Configurables import FilterDesktop _jpsiFilter = FilterDesktop('jpsiFilter', Code = '(M>2500*MeV) & (M<4000*MeV)')

# make a Selection JpsiFilterSel = Selection(name = 'JpsiFilterSel', Algorithm = _jpsiFilter, RequiredSelections = [ JpsiSel ])

# build the SelectionSequence JpsiSeq = SelectionSequence('SeqJpsi', TopSelection = JpsiFilterSel, ) DaVinci().appendToMainSequence( [ JpsiSeq.sequence() ] )

############# DecayTreeTuple from Configurables import DecayTreeTuple, TupleToolTrigger, TupleToolDecay, TupleToolTISTOS tuple = DecayTreeTuple("Jpsi_Tuple") tuple.ToolList += [ "TupleToolGeometry" , "TupleToolKinematic" , "TupleToolPrimaries" , "TupleToolEventInfo" , "TupleToolTrackInfo" , "TupleToolTISTOS" , "TupleToolAngles" , "TupleToolPid" , "TupleToolPropertime" ] tuple.Decay = "J/psi(1S) -> ^mu+ ^mu-" tuple.Inputs = [ JpsiSeq.outputLocation() ] tuple.addTool(TupleToolTISTOS) tuple.TupleToolTISTOS.TriggerList = [ "Hlt2DiMuonJPsiDecision" ] tuple.TupleToolTISTOS.VerboseHlt2 = True DaVinci().appendToMainSequence( [ tuple ] ) DaVinci().TupleFile = "Tutorial8.root" ##################

######### Debugging from Configurables import GaudiSequencer MySequencer = GaudiSequencer('Sequence')

# decision filter test from Configurables import LoKi __HDRFilter sf = Loki__HDRFilter( 'StripPassFilter', Code="HLT_PASS('Stripping"+line+"Decision')", Location="/Event/Strip/Phys/DecReports" ) MySequencer.Members = [ sf ]

# TES explorer # from Configurables import StoreExplorerAlg # MySequencer.Members += [ StoreExplorerAlg(PrintEvt=100) ]

>
>
%SYNTAX{ syntax="python"}% ######################################################################## # # Options for exercise 8 # # @author Patrick Koppenburg # @date 2010-06-07 # ########################################################################

from Gaudi.Configuration import * from Configurables import DaVinci

######### Candidate location line = 'BetaSJpsi2MuMuDetachedLine' location = '/Event/Dimuon/Phys/'+line+'/Particles'

######### Refining the candidate # get classes to build the SelectionSequence from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence # Get the Candidates from the DST. AutomaticData is for data on the DST JpsiSel = AutomaticData(Location = location) # Filter the Candidate. Let's throw away everything above 4 GeV from Configurables import FilterDesktop _jpsiFilter = FilterDesktop('jpsiFilter', Code = '(M>2500*MeV) & (M<4000*MeV)')

# make a Selection JpsiFilterSel = Selection(name = 'JpsiFilterSel', Algorithm = _jpsiFilter, RequiredSelections = [ JpsiSel ])

# build the SelectionSequence JpsiSeq = SelectionSequence('SeqJpsi', TopSelection = JpsiFilterSel, ) DaVinci().appendToMainSequence( [ JpsiSeq.sequence() ] )

 
Changed:
<
<
# Print decay tree # from Configurables import PrintDecayTree # MySequencer.Members += [ PrintDecayTree( 'PrintDiMuons', Inputs = [ location ] ) ]
>
>
############# DecayTreeTuple from Configurables import DecayTreeTuple, TupleToolTrigger, TupleToolDecay, TupleToolTISTOS tuple = DecayTreeTuple("Jpsi_Tuple") tuple.ToolList += [ "TupleToolGeometry" , "TupleToolKinematic" , "TupleToolPrimaries" , "TupleToolEventInfo" , "TupleToolTrackInfo" , "TupleToolTISTOS" , "TupleToolAngles" , "TupleToolPid" , "TupleToolPropertime" ] tuple.Decay = "J/psi(1S) -> ^mu+ ^mu-" tuple.Inputs = [ JpsiSeq.outputLocation() ] tuple.addTool(TupleToolTISTOS) tuple.TupleToolTISTOS.TriggerList = [ "Hlt2DiMuonJPsiDecision" ] tuple.TupleToolTISTOS.VerboseHlt2 = True DaVinci().appendToMainSequence( [ tuple ] ) DaVinci().TupleFile = "Tutorial8.root" ##################

######### Debugging from Configurables import GaudiSequencer MySequencer = GaudiSequencer('Sequence')

# decision filter test from Configurables import LoKi__HDRFilter sf = Loki__HDRFilter( 'StripPassFilter', Code="HLT_PASS('Stripping"+line+"Decision')", Location="/Event/Strip/Phys/DecReports" ) MySequencer.Members = [ sf ]

# TES explorer # from Configurables import StoreExplorerAlg # MySequencer.Members += [ StoreExplorerAlg(PrintEvt=100) ]

# Print decay tree # from Configurables import PrintDecayTree # MySequencer.Members += [ PrintDecayTree( 'PrintDiMuons', Inputs = [ location ] ) ]

  DaVinci().appendToMainSequence( [ MySequencer ] )
Changed:
<
<
######### Options DaVinci().DataType = "2012" DaVinci().EvtMax = 100000 DaVinci().PrintFreq = 100
>
>
######### Options DaVinci().DataType = "2012" DaVinci().EvtMax = 100000 DaVinci().PrintFreq = 100
 %ENDSYNTAX%

Opening the ROOT file (which can be done from within ganga using peek('Tutorial8.root')), you can produce examine the histograms saved by the tuple tools included in the above script. In particular, J J/psi mass should look something like this:

Changed:
<
<
  • Psi mass:
    hh.png
>
>
  • Psi mass:
    hh.png
 

Next

Go back to any of the other DaVinciTutorial s, then clean up and get ready for your new analysis following: DaVinciTutorialTips.

Changed:
<
<
-- PatrickSKoppenburg - 08-Jun-2010 -- PatrickSKoppenburg - 16-Oct-2012
>
>
-- PatrickSKoppenburg - 08-Jun-2010 -- PatrickSKoppenburg - 16-Oct-2012
 
META FILEATTACHMENT attachment="hh.png" attr="" comment="" date="1350400028" name="hh.png" path="hh.png" size="23971" user="pkoppenb" version="5"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v33r5"

Revision 522013-09-12 - NathanaelFarley

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

Added:
>
>
 How to run on a stripped DST.

Line: 34 to 37
  Open a new shell and call SetupProject DaVinci directly:
Changed:
<
<
%SYNTAX{ syntax="python"}% SetupProject DaVinci v33r7 python from StrippingArchive import Utils help(Utils) from StrippingSettings import Utils as SettingUtils help(SettingUtils)
>
>
%SYNTAX{ syntax="python"}% SetupProject DaVinci v33r7 python from StrippingArchive import Utils help(Utils) from StrippingSettings import Utils as SettingUtils help(SettingUtils)
 %ENDSYNTAX%

If the DaVinci version is not available try

Changed:
<
<
%SYNTAX{ syntax="python"}% SetupProject DaVinci --list-versions
>
>
%SYNTAX{ syntax="python"}% SetupProject DaVinci --list-versions
 %ENDSYNTAX%

Finding out about a stream

The most recent stripping is Stripping20 (Stripping13, 14, etc. contain older definitions of the stripping lines). The following

Changed:
<
<
%SYNTAX{ syntax="python"}% print Utils.streamNames("stripping20")
>
>
%SYNTAX{ syntax="python"}% print Utils.streamNames("stripping20")
 %ENDSYNTAX%

prints a list of the StrippingStreams that appear in Stripping20, including, for example, "Bhadron", "Semileptonic", "Dimuon", etc.

Line: 62 to 57
  Each stream contains different line builders used to construct stripping lines. The following
Changed:
<
<
%SYNTAX{ syntax="python"}% SettingUtils.printBuildersByStream("stripping20")
>
>
%SYNTAX{ syntax="python"}% SettingUtils.printBuildersByStream("stripping20")
 %ENDSYNTAX%

will print a list of the names of the builders appearing in Stripping20, grouped by the stream they appear in. Meanwhile,

Changed:
<
<
%SYNTAX{ syntax="python"}% SettingUtils.printBuildersByWG("stripping20")
>
>
%SYNTAX{ syntax="python"}% SettingUtils.printBuildersByWG("stripping20")
 %ENDSYNTAX%

will print the same information, but this time grouped by the working group (WG) in charge of the builder.

For example, one of the builders belonging to the "Semileptonic stream" is B0q2DplusMuX. We can examine this line builder using the lineBuilderAndConf method of the StrippingArchive.Utils module:

Changed:
<
<
%SYNTAX{ syntax="python"}% line,conf=Utils.lineBuilderAndConf("stripping20","B0q2DplusMuX") help(line) print conf
>
>
%SYNTAX{ syntax="python"}% line,conf=Utils.lineBuilderAndConf("stripping20","B0q2DplusMuX") help(line) print conf
 %ENDSYNTAX%

The object conf is the python dictionary that was used to configure the LineBuilder for the B0q2DplusMuX stripping lines in Stripping20, while line is a copy of the line builder. The name B0q2DplusMuX is important. It's the name the LineBuilder was associated with in the Stripping. This name is usually (but not always) the name that appears after `Stripping' in the filename containing the LineBuilder in StrippingSelections.

Line: 88 to 78
  When the analysis application is run it will be passed the location of the stripping data (a collection of .DST files) to be processed; this output location is the location of the line inside the stripping data store. The output location in the stripping can be found using
Changed:
<
<
%SYNTAX{ syntax="python"}% print Utils.outputLocations("stripping20","B0q2DplusMuX")
>
>
%SYNTAX{ syntax="python"}% print Utils.outputLocations("stripping20","B0q2DplusMuX")
 %ENDSYNTAX%

As you can see, there are several output locations. The LineBuilder B0q2DplusMuX was used to produce several related lines in the stripping, as is common.

Line: 96 to 85
  More information can also be obtained using the STCKsh executable= (after running SetupDaVinci).
Deleted:
<
<
 

Generic workflow for a particle reconstruction analysis

Changed:
<
<
  1. Read your candidates
  2. Refine your candidates (more cuts)
  3. TisTos your candidate
  4. Store (or fit) it somehow. That could be done directly in python, or via a microDST, or in DecayTreeTuple. For simplicity, we'll use this option.
>
>
  1. Read your candidates
  2. Refine your candidates (more cuts)
  3. TisTos your candidate
  4. Store (or fit) it somehow. That could be done directly in python, or via a microDST, or in DecayTreeTuple. For simplicity, we'll use this option.
 

J/psi to mu mu analysis

Line: 109 to 97
  We can, logically, look for the J/psi to dimuon decay in the Dimuon stream. Examining the list of dimuon streams in this documentation, we find that there are two lines StrippingBetaSJPsi2MuMuDetachedLine and StrippingBetaSJPsi2MuMuLine, the former of which has some tighter cuts (check this). By looking at the builders for the Dimuon stream (see above), clearly this line belongs was created by the BetaS builder. So, we can find the output location for the line using
Changed:
<
<
<!-- SyntaxHighlightingPlugin -->
SetupProject DaVinci  v33r7
python
from StrippingArchive import Utils
print Utils.outputLocations("stripping20","BetaS")
<!-- end SyntaxHighlightingPlugin -->
This prints out the locations for all the lines created by the BetaS builder. Looking through it, the location of the StrippingBetaSJPsi2MuMuDetachedLine line is /Event/Dimuon/Phys/BetaSJpsi2MuMuDetachedLine/Particles.
>
>
<!-- SyntaxHighlightingPlugin -->
SetupProject DaVinci v33r7 python from StrippingArchive import Utils print Utils.outputLocations("stripping20","BetaS") 
<!-- end SyntaxHighlightingPlugin -->
This prints out the locations for all the lines created by the BetaS builder. Looking through it, the location of the StrippingBetaSJPsi2MuMuDetachedLine line is /Event/Dimuon/Phys/BetaSJpsi2MuMuDetachedLine/Particles.
 

Is this really the line I want?

Added:
>
>
 It is, or the tutorial wouldn't have told you so. But let's pretend you're not sure. You can check that with PrintDecayTree. There is more information on this tool in DaVinciTutorial5. Essentially, this algorithm will print the reconstructed decay tree for reconstructed events.

Create the following python options file

Line: 122 to 106
  Create the following python options file
Changed:
<
<
<!-- SyntaxHighlightingPlugin -->
from Gaudi.Configuration import *
line = "BetaSJpsi2MuMuDetachedLine"
location = "/Event/Dimuon/Phys/"+line+"/Particles"
from Configurables import DaVinci, PrintDecayTree
pt = PrintDecayTree(Inputs = [ location ])
DaVinci().appendToMainSequence( [ pt ] )
DaVinci().DataType = "2012"
DaVinci().EvtMax = -1
<!-- end SyntaxHighlightingPlugin -->
>
>
<!-- SyntaxHighlightingPlugin -->
from Gaudi.Configuration import * line = "BetaSJpsi2MuMuDetachedLine" location = "/Event/Dimuon/Phys/"+line+"/Particles" from Configurables import DaVinci, PrintDecayTree pt = PrintDecayTree(Inputs = [ location ]) DaVinci().appendToMainSequence( [ pt ] ) DaVinci().DataType = "2012" DaVinci().EvtMax = -1
<!-- end SyntaxHighlightingPlugin -->
  You can run this DaVinci job in any of the possible ways described so far (through ganga, gaudirun.py, or cmt run gaudirun.py). The output will include PrintDecayTree output that will look something like
Changed:
<
<
%SYNTAX{ syntax="python"}%
PrintDecayTree....   INFO 
<---------------------------------- Particle ----------------------------------> 
           Name         E         M         P        Pt       phi        Vz 
                       MeV       MeV       MeV       MeV      mrad        mm 
J/psi(1S)            67092.32   3096.92  67020.81  17339.45  -2095.73    -29.40 
+-->
mu+ 36447.87 105.66 36447.71 8322.81 -1978.59 -41.79 +-->mu- 30703.64 105.66 30703.46 9140.31 -2202.21 -38.35
>
>
%SYNTAX{ syntax="python"}% PrintDecayTree.... INFO <---------------------------------- Particle ----------------------------------> Name E M P Pt phi Vz MeV MeV MeV MeV mrad mm J/psi(1S) 67092.32 3096.92 67020.81 17339.45 -2095.73 -29.40 +-->mu+ 36447.87 105.66 36447.71 8322.81 -1978.59 -41.79 +-->mu- 30703.64 105.66 30703.46 9140.31 -2202.21 -38.35
 %ENDSYNTAX%

But Tutorial 8, not all the events have candidates!

Line: 153 to 123
  The first of these tools is GaudiSequencer. This tool lets you create a sequence of algorithms which halts after one of the algorithms fails (read more in its documentation). For the first algorithm, you can select events which pass the stripping line using an HltDecReports filter. Then you can add PrintDecayTree as the second algorithm. Then PrintDecayTree will run only on events that pass the appropriate filter.
Changed:
<
<
<!-- SyntaxHighlightingPlugin -->
from Gaudi.Configuration import *
line = "BetaSJpsi2MuMuDetachedLine"
location = '/Event/Dimuon/Phys/"+line+"/Particles' 
from Configurables import DaVinci, PrintDecayTree, GaudiSequencer
from Configurables import LoKi__HDRFilter
MySequencer = GaudiSequencer('Sequence')
pt = PrintDecayTree(Inputs = [ location ])
sf = LoKi__HDRFilter( 'StripPassFilter', Code="HLT_PASS('Stripping"+line+"Decision')", Location="/Event/Strip/Phys/DecReports" )
MySequencer.Members = [ sf, pt ]
DaVinci().appendToMainSequence( [ MySequencer ] )
DaVinci().DataType = "2012"
DaVinci().EvtMax = -1
<!-- end SyntaxHighlightingPlugin -->
>
>
<!-- SyntaxHighlightingPlugin -->
from Gaudi.Configuration import * line = "BetaSJpsi2MuMuDetachedLine" location = "/Event/Dimuon/Phys/"+line+"/Particles" from Configurables import DaVinci, PrintDecayTree, GaudiSequencer from Configurables import LoKi __HDRFilter MySequencer = GaudiSequencer('Sequence') pt = PrintDecayTree(Inputs = [ location ]) sf = LoKi __HDRFilter( 'StripPassFilter', Code="HLT_PASS('Stripping"+line+"Decision')", Location="/Event/Strip/Phys/DecReports" ) MySequencer.Members = [ sf, pt ] DaVinci().appendToMainSequence( [ MySequencer ] ) DaVinci().DataType = "2012" DaVinci().EvtMax = -1
<!-- end SyntaxHighlightingPlugin -->
  The output will now include a counter named StripPassFilter which counts how many events passed this filter.
Line: 169 to 128
 The output will now include a counter named StripPassFilter which counts how many events passed this filter.

What about trigger lines?

Added:
>
>
 The same can be done to count how many of the events pass a high level trigger. Add the following code before MySequencer is appended to the main sequence:
Changed:
<
<
%SYNTAX{ syntax="python"}% tf = LoKi__HDRFilter( 'HltPassFilter', Code="HLT_PASS('Hlt1.*Muon.*Decision')" ) MySequencer.Members += [ tf ]
>
>
%SYNTAX{ syntax="python"}% tf = LoKi __HDRFilter( 'HltPassFilter', Code="HLT_PASS('Hlt1.*Muon.*Decision')" ) MySequencer.Members += [ tf ]
 %ENDSYNTAX%

This will add a counter which counts how many of the events that pass the stripping line decision also pass these high level muon triggers. To really understand what the trigger does to your signal, though, you should use the TriggerTisTos tools. See also HltEfficiency.

Line: 182 to 140
  To refine candidates, the important point is to start from your candidate and apply further cuts. The main tool for this task is the ParticleSelection framework (follow the link for more information). The following is a simple example that applies a mass cut to the J/psi candidates:
Changed:
<
<
%SYNTAX{ syntax="python"}% # get classes to build the SelectionSequence from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence # Get the Candidates from the DST. AutomaticData is for data on the DST JpsiSel = AutomaticData(Location = location) # Filter the Candidate. Let's throw away everything above 4 GeV from Configurables import FilterDesktop _jpsiFilter = FilterDesktop('jpsiFilter', Code = '(M>2500*MeV) & (M<4000*MeV)')

# make a Selection JpsiFilterSel = Selection(name = 'JpsiFilterSel', Algorithm = _jpsiFilter, RequiredSelections = [ JpsiSel ])

# build the SelectionSequence JpsiSeq = SelectionSequence('SeqJpsi', TopSelection = JpsiFilterSel, )

>
>
%SYNTAX{ syntax="python"}% # get classes to build the SelectionSequence from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence # Get the Candidates from the DST. AutomaticData is for data on the DST JpsiSel = AutomaticData(Location = location) # Filter the Candidate. Let's throw away everything above 4 GeV from Configurables import FilterDesktop _jpsiFilter = FilterDesktop('jpsiFilter', Code = '(M>2500*MeV) & (M<4000*MeV)')

# make a Selection JpsiFilterSel = Selection(name = 'JpsiFilterSel', Algorithm = _jpsiFilter, RequiredSelections = [ JpsiSel ])

# build the SelectionSequence JpsiSeq = SelectionSequence('SeqJpsi', TopSelection = JpsiFilterSel, )

  DaVinci().appendToMainSequence( [ JpsiSeq.sequence() ] ) %ENDSYNTAX%
Line: 208 to 153
  This task is the focus of DaVinciTutorial6, and for more information look there. The following code snippet writes typical interesting variables into a ROOT file named Tutorial8.root.
Changed:
<
<
%SYNTAX{ syntax="python"}% from Configurables import DecayTreeTuple, TupleToolTrigger, TupleToolDecay, TupleToolTISTOS tuple = DecayTreeTuple("Jpsi_Tuple") tuple.ToolList += [ "TupleToolGeometry" , "TupleToolKinematic" , "TupleToolPrimaries" , "TupleToolEventInfo" , "TupleToolTrackInfo" , "TupleToolTISTOS" , "TupleToolAngles" , "TupleToolPid" , "TupleToolPropertime" ] tuple.Decay = "J/psi(1S) -> ^mu+ ^mu-" tuple.Inputs = [ JpsiSeq.outputLocation() ] tuple.addTool(TupleToolTISTOS) tuple.TupleToolTISTOS.TriggerList = [ "Hlt2DiMuonJPsiDecision" ] tuple.TupleToolTISTOS.VerboseHlt2 = True DaVinci().appendToMainSequence( [ tuple ] ) DaVinci().TupleFile = "Tutorial8.root"
>
>
%SYNTAX{ syntax="python"}% from Configurables import DecayTreeTuple, TupleToolTrigger, TupleToolDecay, TupleToolTISTOS tuple = DecayTreeTuple("Jpsi_Tuple") tuple.ToolList += [ "TupleToolGeometry" , "TupleToolKinematic" , "TupleToolPrimaries" , "TupleToolEventInfo" , "TupleToolTrackInfo" , "TupleToolTISTOS" , "TupleToolAngles" , "TupleToolPid" , "TupleToolPropertime" ] tuple.Decay = "J/psi(1S) -> ^mu+ ^mu-" tuple.Inputs = [ JpsiSeq.outputLocation() ] tuple.addTool(TupleToolTISTOS) tuple.TupleToolTISTOS.TriggerList = [ "Hlt2DiMuonJPsiDecision" ] tuple.TupleToolTISTOS.VerboseHlt2 = True DaVinci().appendToMainSequence( [ tuple ] ) DaVinci().TupleFile = "Tutorial8.root"
 %ENDSYNTAX%

Putting it all together

The following shows how put all these tasks together into an analysis sequence. This is taken (with a few modifications) from a solution options file available in Tutorial/Analysis/solutions/DaVinci8 from tag v10r6.

Changed:
<
<
%SYNTAX{ syntax="python"}% ######################################################################## # # Options for exercise 8 # # @author Patrick Koppenburg # @date 2010-06-07 # ########################################################################

from Gaudi.Configuration import * from Configurables import DaVinci

######### Candidate location line = 'BetaSJpsi2MuMuDetachedLine' location = '/Event/Dimuon/Phys/'+line+'/Particles'

######### Refining the candidate # get classes to build the SelectionSequence from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence # Get the Candidates from the DST. AutomaticData is for data on the DST JpsiSel = AutomaticData(Location = location) # Filter the Candidate. Let's throw away everything above 4 GeV from Configurables import FilterDesktop _jpsiFilter = FilterDesktop('jpsiFilter', Code = '(M>2500*MeV) & (M<4000*MeV)')

# make a Selection JpsiFilterSel = Selection(name = 'JpsiFilterSel', Algorithm = _jpsiFilter, RequiredSelections = [ JpsiSel ])

# build the SelectionSequence JpsiSeq = SelectionSequence('SeqJpsi', TopSelection = JpsiFilterSel, ) DaVinci().appendToMainSequence( [ JpsiSeq.sequence() ] )

>
>
%SYNTAX{ syntax="python"}% ######################################################################## # # Options for exercise 8 # # @author Patrick Koppenburg # @date 2010-06-07 # ########################################################################

from Gaudi.Configuration import * from Configurables import DaVinci

######### Candidate location line = 'BetaSJpsi2MuMuDetachedLine' location = '/Event/Dimuon/Phys/'+line+'/Particles'

######### Refining the candidate # get classes to build the SelectionSequence from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence # Get the Candidates from the DST. AutomaticData is for data on the DST JpsiSel = AutomaticData(Location = location) # Filter the Candidate. Let's throw away everything above 4 GeV from Configurables import FilterDesktop _jpsiFilter = FilterDesktop('jpsiFilter', Code = '(M>2500*MeV) & (M<4000*MeV)')

# make a Selection JpsiFilterSel = Selection(name = 'JpsiFilterSel', Algorithm = _jpsiFilter, RequiredSelections = [ JpsiSel ])

 
Changed:
<
<
############# DecayTreeTuple from Configurables import DecayTreeTuple, TupleToolTrigger, TupleToolDecay, TupleToolTISTOS tuple = DecayTreeTuple("Jpsi_Tuple") tuple.ToolList += [ "TupleToolGeometry" , "TupleToolKinematic" , "TupleToolPrimaries" , "TupleToolEventInfo" , "TupleToolTrackInfo" , "TupleToolTISTOS" , "TupleToolAngles" , "TupleToolPid" , "TupleToolPropertime" ] tuple.Decay = "J/psi(1S) -> ^mu+ ^mu-" tuple.Inputs = [ JpsiSeq.outputLocation() ] tuple.addTool(TupleToolTISTOS) tuple.TupleToolTISTOS.TriggerList = [ "Hlt2DiMuonJPsiDecision" ] tuple.TupleToolTISTOS.VerboseHlt2 = True DaVinci().appendToMainSequence( [ tuple ] ) DaVinci().TupleFile = "Tutorial8.root" ##################

######### Debugging from Configurables import GaudiSequencer MySequencer = GaudiSequencer('Sequence')

# decision filter test from Configurables import LoKi__HDRFilter sf = Loki__HDRFilter( 'StripPassFilter', Code="HLT_PASS('Stripping"+line+"Decision')", Location="/Event/Strip/Phys/DecReports" ) MySequencer.Members = [ sf ]

# TES explorer # from Configurables import StoreExplorerAlg # MySequencer.Members += [ StoreExplorerAlg(PrintEvt=100) ]

# Print decay tree # from Configurables import PrintDecayTree # MySequencer.Members += [ PrintDecayTree( 'PrintDiMuons', Inputs = [ location ] ) ]

>
>
# build the SelectionSequence JpsiSeq = SelectionSequence('SeqJpsi', TopSelection = JpsiFilterSel, ) DaVinci().appendToMainSequence( [ JpsiSeq.sequence() ] )

############# DecayTreeTuple from Configurables import DecayTreeTuple, TupleToolTrigger, TupleToolDecay, TupleToolTISTOS tuple = DecayTreeTuple("Jpsi_Tuple") tuple.ToolList += [ "TupleToolGeometry" , "TupleToolKinematic" , "TupleToolPrimaries" , "TupleToolEventInfo" , "TupleToolTrackInfo" , "TupleToolTISTOS" , "TupleToolAngles" , "TupleToolPid" , "TupleToolPropertime" ] tuple.Decay = "J/psi(1S) -> ^mu+ ^mu-" tuple.Inputs = [ JpsiSeq.outputLocation() ] tuple.addTool(TupleToolTISTOS) tuple.TupleToolTISTOS.TriggerList = [ "Hlt2DiMuonJPsiDecision" ] tuple.TupleToolTISTOS.VerboseHlt2 = True DaVinci().appendToMainSequence( [ tuple ] ) DaVinci().TupleFile = "Tutorial8.root" ##################

######### Debugging from Configurables import GaudiSequencer MySequencer = GaudiSequencer('Sequence')

# decision filter test from Configurables import LoKi __HDRFilter sf = Loki__HDRFilter( 'StripPassFilter', Code="HLT_PASS('Stripping"+line+"Decision')", Location="/Event/Strip/Phys/DecReports" ) MySequencer.Members = [ sf ]

# TES explorer # from Configurables import StoreExplorerAlg # MySequencer.Members += [ StoreExplorerAlg(PrintEvt=100) ]

# Print decay tree # from Configurables import PrintDecayTree # MySequencer.Members += [ PrintDecayTree( 'PrintDiMuons', Inputs = [ location ] ) ]

  DaVinci().appendToMainSequence( [ MySequencer ] )
Changed:
<
<
######### Options DaVinci().DataType = "2012" DaVinci().EvtMax = 100000 DaVinci().PrintFreq = 100
>
>
######### Options DaVinci().DataType = "2012" DaVinci().EvtMax = 100000 DaVinci().PrintFreq = 100
 %ENDSYNTAX%

Opening the ROOT file (which can be done from within ganga using peek('Tutorial8.root')), you can produce examine the histograms saved by the tuple tools included in the above script. In particular, J J/psi mass should look something like this:

Changed:
<
<
  • Psi mass:
    hh.png
>
>
  • Psi mass:
    hh.png
 

Next

Go back to any of the other DaVinciTutorial s, then clean up and get ready for your new analysis following: DaVinciTutorialTips.

Changed:
<
<
-- PatrickSKoppenburg - 08-Jun-2010 -- PatrickSKoppenburg - 16-Oct-2012
>
>
-- PatrickSKoppenburg - 08-Jun-2010 -- PatrickSKoppenburg - 16-Oct-2012
 
META FILEATTACHMENT attachment="hh.png" attr="" comment="" date="1350400028" name="hh.png" path="hh.png" size="23971" user="pkoppenb" version="5"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v33r5"

Revision 512013-09-12 - NathanaelFarley

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 172 to 172
 The same can be done to count how many of the events pass a high level trigger. Add the following code before MySequencer is appended to the main sequence:

%SYNTAX{ syntax="python"}%

Changed:
<
<
tf = LoKi__HDRFilter( 'HltPassFilter', Code="HLT_PASS('Hlt1.*Muon.*Decision')" ) ]
>
>
tf = LoKi__HDRFilter( 'HltPassFilter', Code="HLT_PASS('Hlt1.*Muon.*Decision')" )
 MySequencer.Members += [ tf ] %ENDSYNTAX%

Revision 502013-07-04 - PatrickSKoppenburg

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 43 to 43
 help(SettingUtils) %ENDSYNTAX%
Added:
>
>
If the DaVinci version is not available try
<!-- SyntaxHighlightingPlugin -->
SetupProject DaVinci --list-versions
<!-- end SyntaxHighlightingPlugin -->
 Finding out about a stream

The most recent stripping is Stripping20 (Stripping13, 14, etc. contain older definitions of the stripping lines). The following

Line: 129 to 134
 You can run this DaVinci job in any of the possible ways described so far (through ganga, gaudirun.py, or cmt run gaudirun.py). The output will include PrintDecayTree output that will look something like
Changed:
<
<
PrintDecayTree....   INFO 
<---------------------------------- Particle ---------------------------------->
Name E M P Pt phi Vz
MeV MeV MeV MeV mrad mm
J/psi(1S) 67092.32 3096.92 67020.81 17339.45 -2095.73 -29.40
+-->
mu+ 36447.87 105.66 36447.71 8322.81 -1978.59 -41.79
+-->mu- 30703.64 105.66 30703.46 9140.31 -2202.21 -38.35
>
>
<!-- SyntaxHighlightingPlugin -->
PrintDecayTree....   INFO 
<---------------------------------- Particle ----------------------------------> 
           Name         E         M         P        Pt       phi        Vz 
                       MeV       MeV       MeV       MeV      mrad        mm 
J/psi(1S)            67092.32   3096.92  67020.81  17339.45  -2095.73    -29.40 
+-->mu+              36447.87    105.66  36447.71   8322.81  -1978.59    -41.79 
+-->mu-              30703.64    105.66  30703.46   9140.31  -2202.21    -38.35 
<!-- end SyntaxHighlightingPlugin -->
 

But Tutorial 8, not all the events have candidates!

Yes, that is true. The configurable parameter DaVinci().EvtMax sets how many events to look at in the .DST file. Look again at the logical location of the stripping line in the stripping file:
Line: 327 to 333
 -- PatrickSKoppenburg - 16-Oct-2012

META FILEATTACHMENT attachment="hh.png" attr="" comment="" date="1350400028" name="hh.png" path="hh.png" size="23971" user="pkoppenb" version="5"
Changed:
<
<
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v33r0p1"
>
>
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v33r5"
 
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v10r4"
|*META PREFERENCE*|name="SYNTAXHIGHLIGHTINGPLUGIN_FORMAT_PREPEND" title="SYNTAXHIGHLIGHTINGPLUGIN_FORMAT_PREPEND" type="Set" value="
"|

Revision 482013-01-08 - JackWimberley

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 90 to 90
 More information can also be obtained using the STCKsh executable= (after running SetupDaVinci).
Changed:
<
<

The workflow

>
>

Generic workflow for a particle reconstruction analysis

 
  1. Read your candidates
  2. Refine your candidates (more cuts)
  3. TisTos your candidate
Line: 111 to 111
 

Is this really the line I want?

Changed:
<
<
It is, or the tutorial wouldn't have told you so. But let's pretend you're not sure. You can check that with PrintDecayTree. There is more information on this tool in DaVinciTutorial5. Essentially, this algorithm will print the reconstructed decay tree for events that pass th
>
>
It is, or the tutorial wouldn't have told you so. But let's pretend you're not sure. You can check that with PrintDecayTree. There is more information on this tool in DaVinciTutorial5. Essentially, this algorithm will print the reconstructed decay tree for reconstructed events.
  Create the following python options file
Line: 169 to 169
  This will add a counter which counts how many of the events that pass the stripping line decision also pass these high level muon triggers. To really understand what the trigger does to your signal, though, you should use the TriggerTisTos tools. See also HltEfficiency.
Changed:
<
<

How to refine your Candidates?

Use for instance the ParticleSelection framework, or anything else as you wish. The important point is to start from your candidate and apply further cuts. The following would apply a mass cut to your candidates.
>
>

How to refine candidates

 
Changed:
<
<
These options are available in Tutorial/Analysis/solutions/DaVinci8 from tag v10r6.
>
>
To refine candidates, the important point is to start from your candidate and apply further cuts. The main tool for this task is the ParticleSelection framework (follow the link for more information). The following is a simple example that applies a mass cut to the J/psi candidates:

<!-- SyntaxHighlightingPlugin -->
# get classes to build the SelectionSequence
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
# Get the Candidates from the DST. AutomaticData is for data on the DST
JpsiSel = AutomaticData(Location = location)
# Filter the Candidate.  Let's throw away everything above 4 GeV
from Configurables import FilterDesktop
_jpsiFilter = FilterDesktop('jpsiFilter', Code = '(M>2500*MeV) & (M<4000*MeV)')

# make a Selection
JpsiFilterSel = Selection(name = 'JpsiFilterSel',
                          Algorithm = _jpsiFilter,
                          RequiredSelections = [ JpsiSel ])

# build the SelectionSequence
JpsiSeq = SelectionSequence('SeqJpsi',
                             TopSelection = JpsiFilterSel,
                            )

DaVinci().appendToMainSequence( [ JpsiSeq.sequence() ] ) 
<!-- end SyntaxHighlightingPlugin -->

How to write particle information into a ROOT tuple

This task is the focus of DaVinciTutorial6, and for more information look there. The following code snippet writes typical interesting variables into a ROOT file named Tutorial8.root.

<!-- SyntaxHighlightingPlugin -->
from Configurables import DecayTreeTuple, TupleToolTrigger, TupleToolDecay, TupleToolTISTOS
tuple = DecayTreeTuple("Jpsi_Tuple")
tuple.ToolList +=  [
    "TupleToolGeometry"
    , "TupleToolKinematic"
    , "TupleToolPrimaries"
    , "TupleToolEventInfo"
    , "TupleToolTrackInfo"
    , "TupleToolTISTOS"
    , "TupleToolAngles"
    , "TupleToolPid"
    , "TupleToolPropertime"
    ]
tuple.Decay = "J/psi(1S) -> ^mu+ ^mu-"
tuple.Inputs = [ JpsiSeq.outputLocation() ]
tuple.addTool(TupleToolTISTOS)
tuple.TupleToolTISTOS.TriggerList = [ "Hlt2DiMuonJPsiDecision" ]
tuple.TupleToolTISTOS.VerboseHlt2 = True
DaVinci().appendToMainSequence( [ tuple ] )
DaVinci().TupleFile = "Tutorial8.root"
<!-- end SyntaxHighlightingPlugin -->

Putting it all together

The following shows how put all these tasks together into an analysis sequence. This is taken (with a few modifications) from a solution options file available in Tutorial/Analysis/solutions/DaVinci8 from tag v10r6.

  %SYNTAX{ syntax="python"}% ########################################################################
Line: 185 to 237
 ########################################################################

from Gaudi.Configuration import *

Added:
>
>
from Configurables import DaVinci
 
Added:
>
>
######### Candidate location
 line = 'BetaSJpsi2MuMuDetachedLine' location = '/Event/Dimuon/Phys/'+line+'/Particles'
Changed:
<
<
MessageSvc().Format = "% F%80WPICK7W%R%T %0W%M" from Configurables import DaVinci
>
>
######### Refining the candidate
 # get classes to build the SelectionSequence from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence # Get the Candidates from the DST. AutomaticData is for data on the DST
Line: 209 to 261
 JpsiSeq = SelectionSequence('SeqJpsi', TopSelection = JpsiFilterSel, )
Added:
>
>
DaVinci().appendToMainSequence( [ JpsiSeq.sequence() ] )
  ############# DecayTreeTuple from Configurables import DecayTreeTuple, TupleToolTrigger, TupleToolDecay, TupleToolTISTOS
Line: 229 to 282
 tuple.addTool(TupleToolTISTOS) tuple.TupleToolTISTOS.TriggerList = [ "Hlt2DiMuonJPsiDecision" ] tuple.TupleToolTISTOS.VerboseHlt2 = True
Changed:
<
<
DaVinci().appendToMainSequence( [ JpsiSeq.sequence(), tuple ] )
>
>
DaVinci().appendToMainSequence( [ tuple ] ) DaVinci().TupleFile = "Tutorial8.root"
 ##################

######### Debugging

Added:
>
>
from Configurables import GaudiSequencer MySequencer = GaudiSequencer('Sequence')
 # decision filter test
Changed:
<
<
from Configurables import LoKi__HDRFilter as StripFilter DaVinci().appendToMainSequence( [ StripFilter( 'StripPassFilter', Code="HLT_PASS('Stripping"+line+"Decision')", Location="/Event/Strip/Phys/DecReports" ) ])
>
>
from Configurables import LoKi__HDRFilter sf = Loki__HDRFilter( 'StripPassFilter', Code="HLT_PASS('Stripping"+line+"Decision')", Location="/Event/Strip/Phys/DecReports" ) MySequencer.Members = [ sf ]
  # TES explorer # from Configurables import StoreExplorerAlg
Changed:
<
<
# DaVinci().appendToMainSequence( [ StoreExplorerAlg(PrintEvt=100) ] )
>
>
# MySequencer.Members += [ StoreExplorerAlg(PrintEvt=100) ]
  # Print decay tree # from Configurables import PrintDecayTree
Changed:
<
<
# DaVinci().appendToMainSequence( [ PrintDecayTree( 'PrintDiMuons', Inputs = [ location ] ) ] )
>
>
# MySequencer.Members += [ PrintDecayTree( 'PrintDiMuons', Inputs = [ location ] ) ]
 
Added:
>
>
DaVinci().appendToMainSequence( [ MySequencer ] )

######### Options

 DaVinci().DataType = "2012" DaVinci().EvtMax = 100000 DaVinci().PrintFreq = 100
Deleted:
<
<
DaVinci().TupleFile = "Tutorial8.root"
 %ENDSYNTAX%

Opening the ROOT file (which can be done from within ganga using peek('Tutorial8.root')), you can produce examine the histograms saved by the tuple tools included in the above script. In particular, J J/psi mass should look something like this:

Revision 472013-01-08 - JackWimberley

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 67 to 67
  will print the same information, but this time grouped by the working group (WG) in charge of the builder.
Changed:
<
<
For example, one of the builders belonging to the "Semileptonic stream" is B0q2DplusMuX. We can examine this line builder using the lineBuilderAndConf method of the StrippinArchive.Utils module:
>
>
For example, one of the builders belonging to the "Semileptonic stream" is B0q2DplusMuX. We can examine this line builder using the lineBuilderAndConf method of the StrippingArchive.Utils module:
  %SYNTAX{ syntax="python"}% line,conf=Utils.lineBuilderAndConf("stripping20","B0q2DplusMuX")
Line: 157 to 157
 DaVinci().DataType = "2012" DaVinci().EvtMax = -1%ENDSYNTAX%
Added:
>
>
The output will now include a counter named StripPassFilter which counts how many events passed this filter.
 

What about trigger lines?

Changed:
<
<
The same can be done with trigger lines. Do the same as above but replace the stripping filter sf with the following trigger filter tf:
>
>
The same can be done to count how many of the events pass a high level trigger. Add the following code before MySequencer is appended to the main sequence:
  %SYNTAX{ syntax="python"}% tf = LoKi__HDRFilter( 'HltPassFilter', Code="HLT_PASS('Hlt1.*Muon.*Decision')" ) ]
Added:
>
>
MySequencer.Members += [ tf ]
 %ENDSYNTAX%
Changed:
<
<
Then PrintDecayTree will run only on events that pass these triggers. But to really understand what the trigger does to your signal, use the TriggerTisTos tools. See also HltEfficiency.
>
>
This will add a counter which counts how many of the events that pass the stripping line decision also pass these high level muon triggers. To really understand what the trigger does to your signal, though, you should use the TriggerTisTos tools. See also HltEfficiency.
 

How to refine your Candidates?

Use for instance the ParticleSelection framework, or anything else as you wish. The important point is to start from your candidate and apply further cuts. The following would apply a mass cut to your candidates.

Revision 462013-01-07 - JackWimberley

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 32 to 32
  Open a new shell and call SetupProject DaVinci directly:
Changed:
<
<
%SYNTAX{ syntax="python"}%SetupProject DaVinci v33r7
>
>
%SYNTAX{ syntax="python"}% SetupProject DaVinci v33r7
 python from StrippingArchive import Utils help(Utils)
Line: 78 to 79
  Where is the line stored in the stripping?
Changed:
<
<
When the analysis application is run it will be passed the location of the stripping data store (a collection of .DST files) to be processed; this output location is the location of the line inside the stripping data store. The output location in the stripping can be found using
>
>
When the analysis application is run it will be passed the location of the stripping data (a collection of .DST files) to be processed; this output location is the location of the line inside the stripping data store. The output location in the stripping can be found using
  %SYNTAX{ syntax="python"}% print Utils.outputLocations("stripping20","B0q2DplusMuX")
Line: 97 to 98
 

J/psi to mu mu analysis

Changed:
<
<

Where is the candidate?

>
>

Where is the candidate?

  We can, logically, look for the J/psi to dimuon decay in the Dimuon stream. Examining the list of dimuon streams in this documentation, we find that there are two lines StrippingBetaSJPsi2MuMuDetachedLine and StrippingBetaSJPsi2MuMuLine, the former of which has some tighter cuts (check this). By looking at the builders for the Dimuon stream (see above), clearly this line belongs was created by the BetaS builder. So, we can find the output location for the line using
Line: 110 to 111
 

Is this really the line I want?

Changed:
<
<
It is, or the tutorial wouldn't have told you so. But let's pretend you're not sure. You can check that with PrintDecayTree. There is more information on this tool in DaVinciTutorial5. Use the latest DaVinci from now on:
<!-- SyntaxHighlightingPlugin -->
SetupProject DaVinci v33r7 
<!-- end SyntaxHighlightingPlugin -->
. Then do :
>
>
It is, or the tutorial wouldn't have told you so. But let's pretend you're not sure. You can check that with PrintDecayTree. There is more information on this tool in DaVinciTutorial5. Essentially, this algorithm will print the reconstructed decay tree for events that pass th

Create the following python options file

 %SYNTAX{ syntax="python"}%from Gaudi.Configuration import * line = "BetaSJpsi2MuMuDetachedLine" location = "/Event/Dimuon/Phys/"+line+"/Particles"
Line: 122 to 124
 DaVinci().DataType = "2012" DaVinci().EvtMax = -1%ENDSYNTAX%
Changed:
<
<

And If I have no candidates?

Still stick to your stripping line. You can select events which passed your stripping line using and HltDecReports filter.
>
>
You can run this DaVinci job in any of the possible ways described so far (through ganga, gaudirun.py, or cmt run gaudirun.py). The output will include PrintDecayTree output that will look something like

PrintDecayTree.... INFO
<---------------------------------- Particle ---------------------------------->
Name E M P Pt phi Vz
MeV MeV MeV MeV mrad mm
J/psi(1S) 67092.32 3096.92 67020.81 17339.45 -2095.73 -29.40
+-->

mu+ 36447.87 105.66 36447.71 8322.81 -1978.59 -41.79
+-->mu- 30703.64 105.66 30703.46 9140.31 -2202.21 -38.35

But Tutorial 8, not all the events have candidates!

Yes, that is true. The configurable parameter DaVinci().EvtMax sets how many events to look at in the .DST file. Look again at the logical location of the stripping line in the stripping file:

/Event/Dimuon/Phys/BetaSJpsi2MuMuDetachedLine/Particles

The stripping file is logically sorted event first, rather than line first. Not every event passes the filter for every line. The code above this still calls PrintDecayTree for every event processed, which leads to a performance penalty. This penalty is small, but we can introduce a couple of important tools while showing how to avoid this.

The first of these tools is GaudiSequencer. This tool lets you create a sequence of algorithms which halts after one of the algorithms fails (read more in its documentation). For the first algorithm, you can select events which pass the stripping line using an HltDecReports filter. Then you can add PrintDecayTree as the second algorithm. Then PrintDecayTree will run only on events that pass the appropriate filter.

 %SYNTAX{ syntax="python"}%from Gaudi.Configuration import *
Added:
>
>
line = "BetaSJpsi2MuMuDetachedLine"
 location = '/Event/Dimuon/Phys/"+line+"/Particles' from Configurables import DaVinci, PrintDecayTree, GaudiSequencer
Changed:
<
<
from Configurables import LoKi__HDRFilter as StripFilter
>
>
from Configurables import LoKi__HDRFilter
 MySequencer = GaudiSequencer('Sequence') pt = PrintDecayTree(Inputs = [ location ])
Changed:
<
<
sf = StripFilter( 'StripPassFilter', Code="HLT_PASS('Stripping"+line+"Decision')", Location="/Event/Strip/Phys/DecReports" )
>
>
sf = LoKi__HDRFilter( 'StripPassFilter', Code="HLT_PASS('Stripping"+line+"Decision')", Location="/Event/Strip/Phys/DecReports" )
 MySequencer.Members = [ sf, pt ] DaVinci().appendToMainSequence( [ MySequencer ] ) DaVinci().DataType = "2012" DaVinci().EvtMax = -1%ENDSYNTAX%
Deleted:
<
<
The above would run PrintDecayTree only on events selected by the appropriate line.
 
Changed:
<
<

What about trigger lines?

The same can be done with trigger lines
<!-- SyntaxHighlightingPlugin -->
from Configurables import LoKi__HDRFilter   as HltFilter
MySequencer = GaudiSequencer('Sequence')
MySequencer.Members += [ HltFilter( 'HltPassFilter', 
            Code="HLT_PASS('Hlt1.*Muon.*Decision')" ) ]
<!-- end SyntaxHighlightingPlugin -->
But to really understand what the trigger does to your signal, use the TriggerTisTos tools. See also HltEfficiency.
>
>

What about trigger lines?

The same can be done with trigger lines. Do the same as above but replace the stripping filter sf with the following trigger filter tf:

<!-- SyntaxHighlightingPlugin -->
tf = LoKi__HDRFilter( 'HltPassFilter', Code="HLT_PASS('Hlt1.*Muon.*Decision')" ) ]
<!-- end SyntaxHighlightingPlugin -->

Then PrintDecayTree will run only on events that pass these triggers. But to really understand what the trigger does to your signal, use the TriggerTisTos tools. See also HltEfficiency.

 

How to refine your Candidates?

Use for instance the ParticleSelection framework, or anything else as you wish. The important point is to start from your candidate and apply further cuts. The following would apply a mass cut to your candidates.

Revision 452013-01-04 - JackWimberley

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 30 to 30
  The StrippingSettings and StrippingArchive python packages have tools that give the lines and configurations used by the strippings.
Changed:
<
<
Open a new shell and call SetupProject DaVinci directly:
>
>
Open a new shell and call SetupProject DaVinci directly:
  %SYNTAX{ syntax="python"}%SetupProject DaVinci v33r7 python
Line: 109 to 109
 This prints out the locations for all the lines created by the BetaS builder. Looking through it, the location of the StrippingBetaSJPsi2MuMuDetachedLine line is /Event/Dimuon/Phys/BetaSJpsi2MuMuDetachedLine/Particles.
Changed:
<
<

Check it!

You can check that with PrintDecayTree. Use the latest DaVinci from now on:
>
>

Is this really the line I want?

It is, or the tutorial wouldn't have told you so. But let's pretend you're not sure. You can check that with PrintDecayTree. There is more information on this tool in DaVinciTutorial5. Use the latest DaVinci from now on:
 
<!-- SyntaxHighlightingPlugin -->
SetupProject DaVinci v33r7 
<!-- end SyntaxHighlightingPlugin -->
. Then do : %SYNTAX{ syntax="python"}%from Gaudi.Configuration import *

Revision 442013-01-03 - JackWimberley

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 26 to 26
 

Tools and help

Changed:
<
<
Each Stripping line probably has its own Twiki, describing the selection, how it was optimised and how it should be used. Each line probably has it's own python help, if you can get a handle on the line itself in python, help will hopefully .... help.
>
>
This documentation in the LHCb release area lists all the stripping20 streams and lines and gives a complete (and somewhat cryptic) list of the filters used to define the lines.
 
Changed:
<
<
The StrippingSettings and StrippingArchive packages have the tools to return you the lines and configurations used by the strippings.
>
>
The StrippingSettings and StrippingArchive python packages have tools that give the lines and configurations used by the strippings.
 
Changed:
<
<
For this you need a new shell, and for maybe even the first time, call SetupProject DaVinci directly%SYNTAX{ syntax="python"}%SetupProject DaVinci v33r7
>
>
Open a new shell and call SetupProject DaVinci directly:

%SYNTAX{ syntax="python"}%SetupProject DaVinci v33r7

 python
Added:
>
>
from StrippingArchive import Utils help(Utils) from StrippingSettings import Utils as SettingUtils help(SettingUtils)
 %ENDSYNTAX%
Added:
>
>
Finding out about a stream
 
Changed:
<
<
finding out about a line %SYNTAX{ syntax="python"}%from StrippingArchive import Utils help(Utils) line,conf=Utils.lineBuilderAndConf("stripping20","B0q2DplusMuX") help(line) print conf
>
>
The most recent stripping is Stripping20 (Stripping13, 14, etc. contain older definitions of the stripping lines). The following

%SYNTAX{ syntax="python"}% print Utils.streamNames("stripping20")

 %ENDSYNTAX%
Changed:
<
<
The object conf is the python dictionary that was used to configure the LineBuilder for the B0q2DplusMuX lines in Stripping20. The name B0q2DplusMuX is important. It's the name the LineBuilder was associated with in the Stripping. This name is usually (but not always) the name that appears after `Stripping' in the filename containing the LineBuilder in StrippingSelections.
>
>
prints a list of the StrippingStreams that appear in Stripping20, including, for example, "Bhadron", "Semileptonic", "Dimuon", etc.
 
Changed:
<
<
finding out about a stream
>
>
Finding out about a line
 
Changed:
<
<
%SYNTAX{ syntax="python"}%from StrippingArchive import Utils print Utils.streamNames("stripping20")
>
>
Each stream contains different line builders used to construct stripping lines. The following

%SYNTAX{ syntax="python"}% SettingUtils.printBuildersByStream("stripping20")

 %ENDSYNTAX%
Changed:
<
<
will print a list of the StrippingStreams that appear in a Stripping.
>
>
will print a list of the names of the builders appearing in Stripping20, grouped by the stream they appear in. Meanwhile,

<!-- SyntaxHighlightingPlugin -->
SettingUtils.printBuildersByWG("stripping20")
<!-- end SyntaxHighlightingPlugin -->

will print the same information, but this time grouped by the working group (WG) in charge of the builder.

For example, one of the builders belonging to the "Semileptonic stream" is B0q2DplusMuX. We can examine this line builder using the lineBuilderAndConf method of the StrippinArchive.Utils module:

  %SYNTAX{ syntax="python"}%
Changed:
<
<
from StrippingSettings import Utils as Utils2 help(Utils2) Utils2.printBuildersByStream("stripping20")
>
>
line,conf=Utils.lineBuilderAndConf("stripping20","B0q2DplusMuX") help(line) print conf
 %ENDSYNTAX%
Changed:
<
<
will print a list of the names of the LineBuilders appearing in Stripping20, grouped by the StrippingStream they appear in:
>
>
The object conf is the python dictionary that was used to configure the LineBuilder for the B0q2DplusMuX stripping lines in Stripping20, while line is a copy of the line builder. The name B0q2DplusMuX is important. It's the name the LineBuilder was associated with in the Stripping. This name is usually (but not always) the name that appears after `Stripping' in the filename containing the LineBuilder in StrippingSelections.

Where is the line stored in the stripping?

When the analysis application is run it will be passed the location of the stripping data store (a collection of .DST files) to be processed; this output location is the location of the line inside the stripping data store. The output location in the stripping can be found using

  %SYNTAX{ syntax="python"}%
Changed:
<
<
from StrippingSettings import Utils as Utils2 Utils2.printBuildersByWG("stripping20")
>
>
print Utils.outputLocations("stripping20","B0q2DplusMuX")
 %ENDSYNTAX%
Changed:
<
<
will print the same information, but this time grouped by the WG the LineBuilder is associated with.
>
>
As you can see, there are several output locations. The LineBuilder B0q2DplusMuX was used to produce several related lines in the stripping, as is common.

More information can also be obtained using the STCKsh executable= (after running SetupDaVinci).

 

The workflow

  1. Read your candidates
Line: 74 to 95
 
  1. TisTos your candidate
  2. Store (or fit) it somehow. That could be done directly in python, or via a microDST, or in DecayTreeTuple. For simplicity, we'll use this option.
Changed:
<
<

Where's your candidate?

>
>

J/psi to mu mu analysis

 
Changed:
<
<
For more recent versions of the stripping, things have changed a bit. You can use the StrippingArchive Do
>
>

Where is the candidate?

We can, logically, look for the J/psi to dimuon decay in the Dimuon stream. Examining the list of dimuon streams in this documentation, we find that there are two lines StrippingBetaSJPsi2MuMuDetachedLine and StrippingBetaSJPsi2MuMuLine, the former of which has some tighter cuts (check this). By looking at the builders for the Dimuon stream (see above), clearly this line belongs was created by the BetaS builder. So, we can find the output location for the line using

  %SYNTAX{ syntax="python"}%SetupProject DaVinci v33r7 python from StrippingArchive import Utils
Changed:
<
<
print Utils.outputLocations("stripping20","B0q2DplusMuX")
>
>
print Utils.outputLocations("stripping20","BetaS")
 %ENDSYNTAX%
Added:
>
>
This prints out the locations for all the lines created by the BetaS builder. Looking through it, the location of the StrippingBetaSJPsi2MuMuDetachedLine line is /Event/Dimuon/Phys/BetaSJpsi2MuMuDetachedLine/Particles.
 
Deleted:
<
<
More information can also be obtained using the STCKsh executable (after SetupDaVinci).
 

Check it!

You can check that with PrintDecayTree. Use the latest DaVinci from now on:
Line: 125 to 148
 

How to refine your Candidates?

Use for instance the ParticleSelection framework, or anything else as you wish. The important point is to start from your candidate and apply further cuts. The following would apply a mass cut to your candidates.
Added:
>
>
These options are available in Tutorial/Analysis/solutions/DaVinci8 from tag v10r6.
 %SYNTAX{ syntax="python"}% ######################################################################## #
Line: 137 to 162
  from Gaudi.Configuration import *
Changed:
<
<
line = 'NeuroBayesMuMuLine'
>
>
line = 'BetaSJpsi2MuMuDetachedLine'
 location = '/Event/Dimuon/Phys/'+line+'/Particles'
Added:
>
>
MessageSvc().Format = "% F%80WPICK7W%R%T %0W%M"
 from Configurables import DaVinci

# get classes to build the SelectionSequence from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence

Changed:
<
<
# Get the Candidates from the DST. # AutomaticData is for data on the DST
>
>
# Get the Candidates from the DST. AutomaticData is for data on the DST
 JpsiSel = AutomaticData(Location = location) # Filter the Candidate. Let's throw away everything above 4 GeV from Configurables import FilterDesktop
Line: 162 to 187
  )

############# DecayTreeTuple

Changed:
<
<
from DecayTreeTuple.Configuration import *
>
>
from Configurables import DecayTreeTuple, TupleToolTrigger, TupleToolDecay, TupleToolTISTOS
 tuple = DecayTreeTuple("Jpsi_Tuple") tuple.ToolList += [ "TupleToolGeometry"
Line: 170 to 195
  , "TupleToolPrimaries" , "TupleToolEventInfo" , "TupleToolTrackInfo"
Added:
>
>
, "TupleToolTISTOS"
  , "TupleToolAngles" , "TupleToolPid" , "TupleToolPropertime" ] tuple.Decay = "J/psi(1S) -> ^mu+ ^mu-" tuple.Inputs = [ JpsiSeq.outputLocation() ]
Changed:
<
<
tttt=tuple.addTupleTool("TupleToolTISTOS") # Presence of trigger lines depends on the data's TCK. There are for 2011 data. # Use TCKsh or talk to someone knowledgeable for more info tttt.TriggerList = [ "Hlt1TrackAllL0Decision", "Hlt1TrackMuonDecision", "Hlt1DiMuonLowMassDecision", "Hlt1DiMuonHighMassDecision", "Hlt2DiMuonDetachedJPsiDecision", "Hlt2DiMuonJPsiDecision" ] tttt.VerboseHlt1 = True tttt.VerboseHlt2 = True
>
>
tuple.addTool(TupleToolTISTOS) tuple.TupleToolTISTOS.TriggerList = [ "Hlt2DiMuonJPsiDecision" ] tuple.TupleToolTISTOS.VerboseHlt2 = True DaVinci().appendToMainSequence( [ JpsiSeq.sequence(), tuple ] )
 ##################
Changed:
<
<
DaVinci().appendToMainSequence( [ JpsiSeq.sequence(), tuple ] )
>
>
######### Debugging # decision filter test from Configurables import LoKi__HDRFilter as StripFilter DaVinci().appendToMainSequence( [ StripFilter( 'StripPassFilter', Code="HLT_PASS('Stripping"+line+"Decision')", Location="/Event/Strip/Phys/DecReports" ) ])
 
Changed:
<
<
DaVinci().DataType = "2011" DaVinci().EvtMax = -1
>
>
# TES explorer # from Configurables import StoreExplorerAlg # DaVinci().appendToMainSequence( [ StoreExplorerAlg(PrintEvt=100) ] )

# Print decay tree # from Configurables import PrintDecayTree # DaVinci().appendToMainSequence( [ PrintDecayTree( 'PrintDiMuons', Inputs = [ location ] ) ] )

DaVinci().DataType = "2012" DaVinci().EvtMax = 100000

 DaVinci().PrintFreq = 100
Changed:
<
<
DaVinci().TupleFile = "Jpsi.root"
>
>
DaVinci().TupleFile = "Tutorial8.root"
 %ENDSYNTAX%
Changed:
<
<
These options are available in Tutorial/Analysis/solutions/DaVinci8 from tag v10r6.
>
>
Opening the ROOT file (which can be done from within ganga using peek('Tutorial8.root')), you can produce examine the histograms saved by the tuple tools included in the above script. In particular, J J/psi mass should look something like this:
 
  • Psi mass:
    hh.png

Revision 432012-12-19 - JackWimberley

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 54 to 54
 will print a list of the StrippingStreams that appear in a Stripping.

%SYNTAX{ syntax="python"}%

Changed:
<
<
from StrippingSettings import Utils help(Utils) Utils.printBuildersByStream("stripping20")
>
>
from StrippingSettings import Utils as Utils2 help(Utils2) Utils2.printBuildersByStream("stripping20")
 %ENDSYNTAX%

will print a list of the names of the LineBuilders appearing in Stripping20, grouped by the StrippingStream they appear in:

%SYNTAX{ syntax="python"}%

Changed:
<
<
from StrippingSettings import Utils Utils.printBuildersByWG("stripping20")
>
>
from StrippingSettings import Utils as Utils2 Utils2.printBuildersByWG("stripping20")
 %ENDSYNTAX%

will print the same information, but this time grouped by the WG the LineBuilder is associated with.

Revision 422012-10-24 - RobLambert

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 30 to 30
  The StrippingSettings and StrippingArchive packages have the tools to return you the lines and configurations used by the strippings.
Added:
>
>
For this you need a new shell, and for maybe even the first time, call SetupProject DaVinci directly
<!-- SyntaxHighlightingPlugin -->
SetupProject DaVinci v33r7
python
<!-- end SyntaxHighlightingPlugin -->
 finding out about a line %SYNTAX{ syntax="python"}%from StrippingArchive import Utils help(Utils)
Line: 71 to 76
 

Where's your candidate?

Deleted:
<
<
From Stripping13 onwards, DaVinci can tell you. You may have to revert to an older version of DaVinci if you want a very old stripping.

Stripping13 and up

 For more recent versions of the stripping, things have changed a bit. You can use the StrippingArchive Do

%SYNTAX{ syntax="python"}%SetupProject DaVinci v33r7

Line: 89 to 91
 
<!-- SyntaxHighlightingPlugin -->
SetupProject DaVinci v33r7 
<!-- end SyntaxHighlightingPlugin -->
. Then do : %SYNTAX{ syntax="python"}%from Gaudi.Configuration import *
Changed:
<
<
line = BetaSJpsi2MuMuDetachedLine
>
>
line = "BetaSJpsi2MuMuDetachedLine"
 location = "/Event/Dimuon/Phys/"+line+"/Particles" from Configurables import DaVinci, PrintDecayTree pt = PrintDecayTree(Inputs = [ location ])

Revision 412012-10-24 - PatrickSKoppenburg

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 205 to 205
 -- PatrickSKoppenburg - 16-Oct-2012

META FILEATTACHMENT attachment="hh.png" attr="" comment="" date="1350400028" name="hh.png" path="hh.png" size="23971" user="pkoppenb" version="5"
Changed:
<
<
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v33r0"
>
>
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v33r0p1"
 
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v10r4"
|*META PREFERENCE*|name="SYNTAXHIGHLIGHTINGPLUGIN_FORMAT_PREPEND" title="SYNTAXHIGHLIGHTINGPLUGIN_FORMAT_PREPEND" type="Set" value="
"|

Revision 402012-10-23 - RobLambert

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 6 to 6
 This has been last shown on 24/10/2012. See the slides.

Prerequisites

Changed:
<
<
This assumes you know how to tun DaVinci and know a bit about DecayTreeTuple. Do DaVinciTutorial0 before. Have a look at (or do) DaVinciTutorial6.
>
>
This assumes you know how to tun DaVinci and know a bit about DecayTreeTuple. Do DaVinciTutorial0 and DaVinciTutorial0p5 before. Have a look at (or do) DaVinciTutorial6.
 

Think!

Before you start analysing anything you should think! We assume you know

Revision 392012-10-16 - PatrickSKoppenburg

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 33 to 33
 finding out about a line %SYNTAX{ syntax="python"}%from StrippingArchive import Utils help(Utils)
Changed:
<
<
line,conf=Utils.lineBuilderAndConf("stripping16","B0q2DplusMuX")
>
>
line,conf=Utils.lineBuilderAndConf("stripping20","B0q2DplusMuX")
 help(line) print conf %ENDSYNTAX%
Changed:
<
<
The object conf is the python dictionary that was used to configure the LineBuilder for the B0q2DplusMuX lines in Stripping16. The name B0q2DplusMuX is important. It's the name the LineBuilder was associated with in the Stripping. This name is usually (but not always) the name that appears after `Stripping' in the filename containing the LineBuilder in StrippingSelections.
>
>
The object conf is the python dictionary that was used to configure the LineBuilder for the B0q2DplusMuX lines in Stripping20. The name B0q2DplusMuX is important. It's the name the LineBuilder was associated with in the Stripping. This name is usually (but not always) the name that appears after `Stripping' in the filename containing the LineBuilder in StrippingSelections.
  finding out about a stream

%SYNTAX{ syntax="python"}%from StrippingArchive import Utils

Changed:
<
<
print Utils.streamNames("stripping16")
>
>
print Utils.streamNames("stripping20")
 %ENDSYNTAX%

will print a list of the StrippingStreams that appear in a Stripping.

Line: 51 to 51
 %SYNTAX{ syntax="python"}% from StrippingSettings import Utils help(Utils)
Changed:
<
<
Utils.printBuildersByStream("stripping16")
>
>
Utils.printBuildersByStream("stripping20")
 %ENDSYNTAX%
Changed:
<
<
will print a list of the names of the LineBuilders appearing in Stripping16, grouped by the StrippingStream they appear in:
>
>
will print a list of the names of the LineBuilders appearing in Stripping20, grouped by the StrippingStream they appear in:
  %SYNTAX{ syntax="python"}% from StrippingSettings import Utils
Changed:
<
<
Utils.printBuildersByWG("stripping16")
>
>
Utils.printBuildersByWG("stripping20")
 %ENDSYNTAX%

will print the same information, but this time grouped by the WG the LineBuilder is associated with.

Line: 73 to 71
 

Where's your candidate?

Changed:
<
<
From Stripping13 onwards, DaVinci can tell you. For stripping12 only v26r3p2 can tell you. You can also look into the DST directly by running the algorithm "store explorer" on the DST itself, or examining the contents interactively in GaudiPython.

Exploring the DST

This is one of the ways to find your candidate if you don't want to instantiate the line which selected it.

<!-- SyntaxHighlightingPlugin -->
from Configurables import StoreExplorerAlg
DaVinci().appendToMainSequence( [ StoreExplorerAlg(PrintEvt=1, ExploreRelations=
True, Load=True) ] )
<!-- end SyntaxHighlightingPlugin -->

Run DaVinci over a few events and you will see a big list of locations.... your line will be hiding in there somewhere.

Stripping12

Suppose you use the 2010 data stripped with Stripping12. Let's look for J/psi candidates. Try the following:
<!-- SyntaxHighlightingPlugin -->
SetupProject DaVinci  v26r3p2
python
from StrippingSettings.Stripping12.StreamDimuon import stream
locations = {}
for line in stream.lines :
   locations[ line.name()] = stream.name() + '/' + line.outputLocation()

for line, loc in locations.iteritems() :
   print line, loc
<!-- end SyntaxHighlightingPlugin -->

Note that here you are instantiating the lines in order to find their outputLocation. Since instatiation of lines involves setting up certain configurables, it can only be done once.

This will tell you that line StrippingNeuroBayesMuMuLine puts candidates in Dimuon/Phys/NeuroBayesMuMuLine.

During the stripping the candidates are moved to /Event/Dimuon/Phys/NeuroBayesMuMuLine, just replace with the appropriate the stream name.

>
>
From Stripping13 onwards, DaVinci can tell you. You may have to revert to an older version of DaVinci if you want a very old stripping.
 

Stripping13 and up

For more recent versions of the stripping, things have changed a bit. You can use the StrippingArchive Do
Line: 113 to 79
 %SYNTAX{ syntax="python"}%SetupProject DaVinci v33r7 python from StrippingArchive import Utils
Changed:
<
<
print Utils.outputLocations("stripping13","B0q2DplusMuX")
>
>
print Utils.outputLocations("stripping20","B0q2DplusMuX")
 %ENDSYNTAX%

More information can also be obtained using the STCKsh executable (after SetupDaVinci).

Deleted:
<
<
Note that here you are instantiating the lines in order to find their outputLocation. Since instatiation of lines involves setting up certain configurables, it can only be done once. So if you also want to get a handle on the line directly (because you want to run it elsewhere, refine the selection, or want to ask for its help) you should pass it into the outputLocation function:

<!-- SyntaxHighlightingPlugin -->
SetupProject DaVinci  v33r7
python
from StrippingArchive import Utils
strip="Stripping13"
lineName="B0q2DplusMuX"
builder,conf=Utils.lineBuilderAndConf(strip,lineName)
#construct the builder just like it was done in the stripping
line=builder(lineName,conf)
#then find its outputLocations afterwards
print Utils.outputLocations(strip, lineName, line.lines())
<!-- end SyntaxHighlightingPlugin -->
 

Check it!

You can check that with PrintDecayTree. Use the latest DaVinci from now on:
<!-- SyntaxHighlightingPlugin -->
SetupProject DaVinci v33r7 
<!-- end SyntaxHighlightingPlugin -->
. Then do : %SYNTAX{ syntax="python"}%from Gaudi.Configuration import *
Changed:
<
<
location = "/Event/Dimuon/Phys/NeuroBayesMuMuJPsiNBLine/Particles"
>
>
line = BetaSJpsi2MuMuDetachedLine location = "/Event/Dimuon/Phys/"+line+"/Particles"
 from Configurables import DaVinci, PrintDecayTree pt = PrintDecayTree(Inputs = [ location ]) DaVinci().appendToMainSequence( [ pt ] )
Changed:
<
<
DaVinci().DataType = "2011"
>
>
DaVinci().DataType = "2012"
 DaVinci().EvtMax = -1%ENDSYNTAX%

And If I have no candidates?

Still stick to your stripping line. You can select events which passed your stripping line using and HltDecReports filter. %SYNTAX{ syntax="python"}%from Gaudi.Configuration import *
Changed:
<
<
location = '/Event/Dimuon/Phys/NeuroBayesMuMuJPsiNBLine/Particles'
>
>
location = '/Event/Dimuon/Phys/"+line+"/Particles'
 from Configurables import DaVinci, PrintDecayTree, GaudiSequencer from Configurables import LoKi__HDRFilter as StripFilter MySequencer = GaudiSequencer('Sequence') pt = PrintDecayTree(Inputs = [ location ])
Changed:
<
<
sf = StripFilter( 'StripPassFilter', Code="HLT_PASS('NeuroBayesMuMuLineDecision')", Location="/Event/Strip/Phys/DecReports" )
>
>
sf = StripFilter( 'StripPassFilter', Code="HLT_PASS('Stripping"+line+"Decision')", Location="/Event/Strip/Phys/DecReports" )
 MySequencer.Members = [ sf, pt ] DaVinci().appendToMainSequence( [ MySequencer ] )
Changed:
<
<
DaVinci().DataType = "2011"
>
>
DaVinci().DataType = "2012"
 DaVinci().EvtMax = -1%ENDSYNTAX% The above would run PrintDecayTree only on events selected by the appropriate line.
Line: 243 to 195
 
  • Psi mass:
    hh.png
Deleted:
<
<
  • Who will be the first to find the psi(2S) ?:
    psi_and_psiprime.png
 

Next

Line: 254 to 204
 -- PatrickSKoppenburg - 08-Jun-2010 -- PatrickSKoppenburg - 16-Oct-2012
Changed:
<
<
META FILEATTACHMENT attachment="hh.png" attr="" comment="" date="1300974781" name="hh.png" path="hh.png" size="20358" stream="hh.png" tmpFilename="/usr/tmp/CGItemp43991" user="pkoppenb" version="4"
META FILEATTACHMENT attachment="B_Psi_Tos.png" attr="" comment="" date="1300974766" name="B_Psi_Tos.png" path="B_Psi_Tos.png" size="12268" stream="B_Psi_Tos.png" tmpFilename="/usr/tmp/CGItemp44629" user="pkoppenb" version="3"
META FILEATTACHMENT attachment="psi_and_psiprime.png" attr="" comment="" date="1300974794" name="psi_and_psiprime.png" path="psi_and_psiprime.png" size="26636" stream="psi_and_psiprime.png" tmpFilename="/usr/tmp/CGItemp45492" user="pkoppenb" version="3"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v30r2"
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v10r2p1"
>
>
META FILEATTACHMENT attachment="hh.png" attr="" comment="" date="1350400028" name="hh.png" path="hh.png" size="23971" user="pkoppenb" version="5"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v33r0"
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v10r4"
 |*META PREFERENCE*|name="SYNTAXHIGHLIGHTINGPLUGIN_FORMAT_PREPEND" title="SYNTAXHIGHLIGHTINGPLUGIN_FORMAT_PREPEND" type="Set" value="
"|

Revision 382012-10-16 - PatrickSKoppenburg

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Changed:
<
<
This has been last shown on 25/03/2011. See the slides.
>
>
This has been last shown on 24/10/2012. See the slides.
 

Prerequisites

This assumes you know how to tun DaVinci and know a bit about DecayTreeTuple. Do DaVinciTutorial0 before. Have a look at (or do) DaVinciTutorial6.
Line: 252 to 252
 

-- PatrickSKoppenburg - 08-Jun-2010

Added:
>
>
-- PatrickSKoppenburg - 16-Oct-2012
 
META FILEATTACHMENT attachment="hh.png" attr="" comment="" date="1300974781" name="hh.png" path="hh.png" size="20358" stream="hh.png" tmpFilename="/usr/tmp/CGItemp43991" user="pkoppenb" version="4"
META FILEATTACHMENT attachment="B_Psi_Tos.png" attr="" comment="" date="1300974766" name="B_Psi_Tos.png" path="B_Psi_Tos.png" size="12268" stream="B_Psi_Tos.png" tmpFilename="/usr/tmp/CGItemp44629" user="pkoppenb" version="3"

Revision 372012-04-23 - PatrickSKoppenburg

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 152 to 152
 from Configurables import DaVinci, PrintDecayTree, GaudiSequencer from Configurables import LoKi__HDRFilter as StripFilter MySequencer = GaudiSequencer('Sequence')
Changed:
<
<
pt = PrintDecayTree(InputLocations = [ location ])
>
>
pt = PrintDecayTree(Inputs = [ location ])
 sf = StripFilter( 'StripPassFilter', Code="HLT_PASS('NeuroBayesMuMuLineDecision')", Location="/Event/Strip/Phys/DecReports" ) MySequencer.Members = [ sf, pt ] DaVinci().appendToMainSequence( [ MySequencer ] )
Line: 221 to 221
  , "TupleToolPropertime" ] tuple.Decay = "J/psi(1S) -> ^mu+ ^mu-"
Changed:
<
<
tuple.InputLocations = [ JpsiSeq.outputLocation() ]
>
>
tuple.Inputs = [ JpsiSeq.outputLocation() ]
 tttt=tuple.addTupleTool("TupleToolTISTOS") # Presence of trigger lines depends on the data's TCK. There are for 2011 data. # Use TCKsh or talk to someone knowledgeable for more info

Revision 362012-03-20 - PatrickSKoppenburg

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 256 to 256
 
META FILEATTACHMENT attachment="hh.png" attr="" comment="" date="1300974781" name="hh.png" path="hh.png" size="20358" stream="hh.png" tmpFilename="/usr/tmp/CGItemp43991" user="pkoppenb" version="4"
META FILEATTACHMENT attachment="B_Psi_Tos.png" attr="" comment="" date="1300974766" name="B_Psi_Tos.png" path="B_Psi_Tos.png" size="12268" stream="B_Psi_Tos.png" tmpFilename="/usr/tmp/CGItemp44629" user="pkoppenb" version="3"
META FILEATTACHMENT attachment="psi_and_psiprime.png" attr="" comment="" date="1300974794" name="psi_and_psiprime.png" path="psi_and_psiprime.png" size="26636" stream="psi_and_psiprime.png" tmpFilename="/usr/tmp/CGItemp45492" user="pkoppenb" version="3"
Changed:
<
<
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v30r0p1"
>
>
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v30r2"
 
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v10r2p1"
|*META PREFERENCE*|name="SYNTAXHIGHLIGHTINGPLUGIN_FORMAT_PREPEND" title="SYNTAXHIGHLIGHTINGPLUGIN_FORMAT_PREPEND" type="Set" value="
"|

Revision 352012-03-09 - PatrickSKoppenburg

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 256 to 256
 
META FILEATTACHMENT attachment="hh.png" attr="" comment="" date="1300974781" name="hh.png" path="hh.png" size="20358" stream="hh.png" tmpFilename="/usr/tmp/CGItemp43991" user="pkoppenb" version="4"
META FILEATTACHMENT attachment="B_Psi_Tos.png" attr="" comment="" date="1300974766" name="B_Psi_Tos.png" path="B_Psi_Tos.png" size="12268" stream="B_Psi_Tos.png" tmpFilename="/usr/tmp/CGItemp44629" user="pkoppenb" version="3"
META FILEATTACHMENT attachment="psi_and_psiprime.png" attr="" comment="" date="1300974794" name="psi_and_psiprime.png" path="psi_and_psiprime.png" size="26636" stream="psi_and_psiprime.png" tmpFilename="/usr/tmp/CGItemp45492" user="pkoppenb" version="3"
Changed:
<
<
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v28r4"
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v10r1"
>
>
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v30r0p1"
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v10r2p1"
 |*META PREFERENCE*|name="SYNTAXHIGHLIGHTINGPLUGIN_FORMAT_PREPEND" title="SYNTAXHIGHLIGHTINGPLUGIN_FORMAT_PREPEND" type="Set" value="
"|

Revision 342011-09-26 - RoelAaij

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 225 to 225
 tttt=tuple.addTupleTool("TupleToolTISTOS") # Presence of trigger lines depends on the data's TCK. There are for 2011 data. # Use TCKsh or talk to someone knowledgeable for more info
Changed:
<
<
tttt.TriggerList = [ "Hlt1TrackAllL0Decision", "Hlt1TrackMuonDecision", "Hlt1DiMuonLowMassDecision", "Hlt1DiMuonHighMassDecision", "Hlt2DiMuonDetachedJPsiDecision", "Hlt2DiMuonJPsiDecision" ]
>
>
tttt.TriggerList = [ "Hlt1TrackAllL0Decision", "Hlt1TrackMuonDecision", "Hlt1DiMuonLowMassDecision", "Hlt1DiMuonHighMassDecision", "Hlt2DiMuonDetachedJPsiDecision", "Hlt2DiMuonJPsiDecision" ] tttt.VerboseHlt1 = True
 tttt.VerboseHlt2 = True ##################

Revision 332011-09-25 - RoelAaij

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 223 to 223
 tuple.Decay = "J/psi(1S) -> ^mu+ ^mu-" tuple.InputLocations = [ JpsiSeq.outputLocation() ] tttt=tuple.addTupleTool("TupleToolTISTOS")
Changed:
<
<
tttt.TriggerList = [ "Hlt2DiMuonUnbiasedJPsiDecision" ] # depends on the data's TCK. Talk to someone knowledgeable.
>
>
# Presence of trigger lines depends on the data's TCK. There are for 2011 data. # Use TCKsh or talk to someone knowledgeable for more info tttt.TriggerList = [ "Hlt1TrackAllL0Decision", "Hlt1TrackMuonDecision", "Hlt1DiMuonLowMassDecision", "Hlt1DiMuonHighMassDecision", "Hlt2DiMuonDetachedJPsiDecision", "Hlt2DiMuonJPsiDecision" ]
 tttt.VerboseHlt2 = True ##################

Revision 322011-09-22 - ThomasBlake

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 20 to 20
  What is a StrippingLine? : A line is the sequence of selections used to create candidates and select the event
Changed:
<
<
Where are the lines and cuts? : Stripping Selections live in the package Phys/StrippingSelections, they usually hard-code some fiducial cuts and soft-code the majority of cuts which are defined at run-time by passing a dictionary into each LineBuilder when it is constructed in python. The cuts used in the strippings are stored in a database, like a TCK, but for the stripping which lives in the Phys/StrippingSettings package. Since quite often lines are changed in non-backward compatible ways, removed or added, the Phys/StrippingArchive package stores the python classes actually used in the stripping from Stripping13 onwards.
>
>
Where are the lines and cuts? : Stripping Selections live in the package Phys/StrippingSelections, they usually hard-code some fiducial cuts and soft-code the majority of cuts which are defined at run-time by passing a dictionary into each LineBuilder when it is constructed in python. The LineBuilder is a simple python object that knows how to construct a set of Stripping Lines. The cuts used in the strippings are stored in a database, like a TCK, but for the stripping which lives in the Phys/StrippingSettings package. Since quite often lines are changed in non-backward compatible ways, removed or added, the Phys/StrippingArchive package stores the python classes actually used in the stripping from Stripping13 onwards.
  What is a Stream? : A stream is a group of selections of a similar type, selecting similar events. Ideally no analysis should have to work with the output of more than one stream. Streams usually have a corresponding working group which approves the lines within it. Each stream writes out a different DST with the selected events and candidates from that stream.
Line: 33 to 33
 finding out about a line %SYNTAX{ syntax="python"}%from StrippingArchive import Utils help(Utils)
Changed:
<
<
line,conf=lineBuilderAndConf("Stripping13","B0q2DplusMuNuX")
>
>
line,conf=Utils.lineBuilderAndConf("stripping16","B0q2DplusMuX")
 help(line) print conf %ENDSYNTAX%
Added:
>
>
The object conf is the python dictionary that was used to configure the LineBuilder for the B0q2DplusMuX lines in Stripping16. The name B0q2DplusMuX is important. It's the name the LineBuilder was associated with in the Stripping. This name is usually (but not always) the name that appears after `Stripping' in the filename containing the LineBuilder in StrippingSelections.
 finding out about a stream
Added:
>
>
 %SYNTAX{ syntax="python"}%from StrippingArchive import Utils
Changed:
<
<
print Utils.streamNames("Stripping13") from StrippingSelections import Utils
>
>
print Utils.streamNames("stripping16") %ENDSYNTAX%

will print a list of the StrippingStreams that appear in a Stripping.

%SYNTAX{ syntax="python"}% from StrippingSettings import Utils

 help(Utils)
Changed:
<
<
Utils.printBuildersByStream("Stripping13")
>
>
Utils.printBuildersByStream("stripping16")
 %ENDSYNTAX%
Added:
>
>
will print a list of the names of the LineBuilders appearing in Stripping16, grouped by the StrippingStream they appear in:

<!-- SyntaxHighlightingPlugin -->
from StrippingSettings import Utils
Utils.printBuildersByWG("stripping16")
<!-- end SyntaxHighlightingPlugin -->

will print the same information, but this time grouped by the WG the LineBuilder is associated with.

 

The workflow

  1. Read your candidates
Line: 95 to 113
 %SYNTAX{ syntax="python"}%SetupProject DaVinci v33r7 python from StrippingArchive import Utils
Changed:
<
<
print Utils.outputLocations("Stripping13","B0q2DplusMuX")
>
>
print Utils.outputLocations("stripping13","B0q2DplusMuX")
 %ENDSYNTAX%

More information can also be obtained using the STCKsh executable (after SetupDaVinci).

Revision 312011-07-08 - PatrickSKoppenburg

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 120 to 120
 
<!-- SyntaxHighlightingPlugin -->
SetupProject DaVinci v33r7 
<!-- end SyntaxHighlightingPlugin -->
. Then do : %SYNTAX{ syntax="python"}%from Gaudi.Configuration import *
Changed:
<
<
location = "/Event/Dimuon/Phys/NeuroBayesMuMuLine/Particles"
>
>
location = "/Event/Dimuon/Phys/NeuroBayesMuMuJPsiNBLine/Particles"
 from Configurables import DaVinci, PrintDecayTree pt = PrintDecayTree(Inputs = [ location ]) DaVinci().appendToMainSequence( [ pt ] )
Line: 130 to 130
 

And If I have no candidates?

Still stick to your stripping line. You can select events which passed your stripping line using and HltDecReports filter. %SYNTAX{ syntax="python"}%from Gaudi.Configuration import *
Changed:
<
<
location = '/Event/Dimuon/Phys/NeuroBayesMuMuLine/Particles'
>
>
location = '/Event/Dimuon/Phys/NeuroBayesMuMuJPsiNBLine/Particles'
 from Configurables import DaVinci, PrintDecayTree, GaudiSequencer from Configurables import LoKi__HDRFilter as StripFilter MySequencer = GaudiSequencer('Sequence')

Revision 302011-07-04 - PatrickSKoppenburg

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 71 to 71
 

Stripping12

Suppose you use the 2010 data stripped with Stripping12. Let's look for J/psi candidates. Try the following:
Changed:
<
<
%SYNTAX{ syntax="python"}%SetupProject DaVinci v26r3p2.
>
>
%SYNTAX{ syntax="python"}%SetupProject DaVinci v26r3p2
 python from StreamDimuon import stream locations = {}
Line: 124 to 124
 from Configurables import DaVinci, PrintDecayTree pt = PrintDecayTree(Inputs = [ location ]) DaVinci().appendToMainSequence( [ pt ] )
Changed:
<
<
DaVinci().DataType = "2010"
>
>
DaVinci().DataType = "2011"
 DaVinci().EvtMax = -1%ENDSYNTAX%

And If I have no candidates?

Line: 138 to 138
 sf = StripFilter( 'StripPassFilter', Code="HLT_PASS('NeuroBayesMuMuLineDecision')", Location="/Event/Strip/Phys/DecReports" ) MySequencer.Members = [ sf, pt ] DaVinci().appendToMainSequence( [ MySequencer ] )
Changed:
<
<
DaVinci().DataType = "2010"
>
>
DaVinci().DataType = "2011"
 DaVinci().EvtMax = -1%ENDSYNTAX% The above would run PrintDecayTree only on events selected by the appropriate line.
Line: 205 to 205
 tuple.Decay = "J/psi(1S) -> ^mu+ ^mu-" tuple.InputLocations = [ JpsiSeq.outputLocation() ] tttt=tuple.addTupleTool("TupleToolTISTOS")
Changed:
<
<
tttt.TriggerList = [ "Hlt2DiMuonUnbiasedJPsiDecision" ]
>
>
tttt.TriggerList = [ "Hlt2DiMuonUnbiasedJPsiDecision" ] # depends on the data's TCK. Talk to someone knowledgeable.
 tttt.VerboseHlt2 = True ##################

DaVinci().appendToMainSequence( [ JpsiSeq.sequence(), tuple ] )

Changed:
<
<
DaVinci().DataType = "2010"
>
>
DaVinci().DataType = "2011"
 DaVinci().EvtMax = -1 DaVinci().PrintFreq = 100 DaVinci().TupleFile = "Jpsi.root"

Revision 292011-07-01 - RobLambert

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 235 to 235
 
META FILEATTACHMENT attachment="hh.png" attr="" comment="" date="1300974781" name="hh.png" path="hh.png" size="20358" stream="hh.png" tmpFilename="/usr/tmp/CGItemp43991" user="pkoppenb" version="4"
META FILEATTACHMENT attachment="B_Psi_Tos.png" attr="" comment="" date="1300974766" name="B_Psi_Tos.png" path="B_Psi_Tos.png" size="12268" stream="B_Psi_Tos.png" tmpFilename="/usr/tmp/CGItemp44629" user="pkoppenb" version="3"
META FILEATTACHMENT attachment="psi_and_psiprime.png" attr="" comment="" date="1300974794" name="psi_and_psiprime.png" path="psi_and_psiprime.png" size="26636" stream="psi_and_psiprime.png" tmpFilename="/usr/tmp/CGItemp45492" user="pkoppenb" version="3"
Changed:
<
<
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v28r1p2"
>
>
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v28r4"
 
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v10r1"
|*META PREFERENCE*|name="SYNTAXHIGHLIGHTINGPLUGIN_FORMAT_PREPEND" title="SYNTAXHIGHLIGHTINGPLUGIN_FORMAT_PREPEND" type="Set" value="
"|

Revision 282011-07-01 - RobLambert

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 11 to 13
 
  • Which stripping lines select your candidates
  • Which trigger lines select your candidates
"I'll take all" is not a valid answer. Talk to your supervisor.
Added:
>
>

Foreword

What is the Stripping? : Stripping is the centralized selection of interesting events run after the reconstruction. Stripped DSTs, stripped events, and stripping selections are the only selections which are run centrally, and therefore the only events and selections which are available for the entire LHCb dataset.

What is a StrippingLine? : A line is the sequence of selections used to create candidates and select the event

Where are the lines and cuts? : Stripping Selections live in the package Phys/StrippingSelections, they usually hard-code some fiducial cuts and soft-code the majority of cuts which are defined at run-time by passing a dictionary into each LineBuilder when it is constructed in python. The cuts used in the strippings are stored in a database, like a TCK, but for the stripping which lives in the Phys/StrippingSettings package. Since quite often lines are changed in non-backward compatible ways, removed or added, the Phys/StrippingArchive package stores the python classes actually used in the stripping from Stripping13 onwards.

What is a Stream? : A stream is a group of selections of a similar type, selecting similar events. Ideally no analysis should have to work with the output of more than one stream. Streams usually have a corresponding working group which approves the lines within it. Each stream writes out a different DST with the selected events and candidates from that stream.

Tools and help

Each Stripping line probably has its own Twiki, describing the selection, how it was optimised and how it should be used. Each line probably has it's own python help, if you can get a handle on the line itself in python, help will hopefully .... help.

The StrippingSettings and StrippingArchive packages have the tools to return you the lines and configurations used by the strippings.

finding out about a line

<!-- SyntaxHighlightingPlugin -->
from StrippingArchive import Utils
help(Utils)
line,conf=lineBuilderAndConf("Stripping13","B0q2DplusMuNuX")
help(line)
print conf
<!-- end SyntaxHighlightingPlugin -->

finding out about a stream

<!-- SyntaxHighlightingPlugin -->
from StrippingArchive import Utils
print Utils.streamNames("Stripping13")
from StrippingSelections import Utils
help(Utils)
Utils.printBuildersByStream("Stripping13")
<!-- end SyntaxHighlightingPlugin -->
 

The workflow

  1. Read your candidates
  2. Refine your candidates (more cuts)
Line: 16 to 52
 
  1. Refine your candidates (more cuts)
  2. TisTos your candidate
  3. Store (or fit) it somehow. That could be done directly in python, or via a microDST, or in DecayTreeTuple. For simplicity, we'll use this option.
Added:
>
>
 

Where's your candidate?

Changed:
<
<
DaVinci can tell you, but only the version that was actually used to do the stripping. So make sure you use the version of DaVinci that produced the stripping when doing that. For Stripping 12 it was v26r3p2.
>
>
From Stripping13 onwards, DaVinci can tell you. For stripping12 only v26r3p2 can tell you. You can also look into the DST directly by running the algorithm "store explorer" on the DST itself, or examining the contents interactively in GaudiPython.

Exploring the DST

This is one of the ways to find your candidate if you don't want to instantiate the line which selected it.

<!-- SyntaxHighlightingPlugin -->
from Configurables import StoreExplorerAlg
DaVinci().appendToMainSequence( [ StoreExplorerAlg(PrintEvt=1, ExploreRelations=
True, Load=True) ] )
<!-- end SyntaxHighlightingPlugin -->

Run DaVinci over a few events and you will see a big list of locations.... your line will be hiding in there somewhere.

 

Stripping12

Suppose you use the 2010 data stripped with Stripping12. Let's look for J/psi candidates. Try the following: %SYNTAX{ syntax="python"}%SetupProject DaVinci v26r3p2.
Line: 31 to 82
  print line, loc

%ENDSYNTAX%

Added:
>
>
Note that here you are instantiating the lines in order to find their outputLocation. Since instatiation of lines involves setting up certain configurables, it can only be done once.
 This will tell you that line StrippingNeuroBayesMuMuLine puts candidates in Dimuon/Phys/NeuroBayesMuMuLine.

During the stripping the candidates are moved to /Event/Dimuon/Phys/NeuroBayesMuMuLine, just replace with the appropriate the stream name.

Changed:
<
<

Stripping13

For more recent versions of the stripping, things have changed a bit. Do
>
>

Stripping13 and up

For more recent versions of the stripping, things have changed a bit. You can use the StrippingArchive Do
 %SYNTAX{ syntax="python"}%SetupProject DaVinci v33r7 python
Changed:
<
<
from StrippingSelections.Utils import buildStream stream = buildStream('Stripping13.tmp', 'Dimuon')

locations = {} for line in stream.lines : locations[ line.name()] = stream.name() + '/' + line.outputLocation()

>
>
from StrippingArchive import Utils print Utils.outputLocations("Stripping13","B0q2DplusMuX") %ENDSYNTAX%
 
Changed:
<
<
for line, loc in locations.iteritems() : print line, loc
>
>
More information can also be obtained using the STCKsh executable (after SetupDaVinci).
 
Changed:
<
<
%ENDSYNTAX%
>
>
Note that here you are instantiating the lines in order to find their outputLocation. Since instatiation of lines involves setting up certain configurables, it can only be done once. So if you also want to get a handle on the line directly (because you want to run it elsewhere, refine the selection, or want to ask for its help) you should pass it into the outputLocation function:
 
Deleted:
<
<
This only works if all lines in your stream produce candidates. Otherwise the following code will return the names:
 %SYNTAX{ syntax="python"}%SetupProject DaVinci v33r7 python
Changed:
<
<
from StrippingSelections.Utils import buildStream stream = buildStream('Stripping13.tmp', 'EW')

locations = {} for line in stream.lines : print line.name()

>
>
from StrippingArchive import Utils strip="Stripping13" lineName="B0q2DplusMuX" builder,conf=Utils.lineBuilderAndConf(strip,lineName) #construct the builder just like it was done in the stripping line=builder(lineName,conf) #then find its outputLocations afterwards print Utils.outputLocations(strip, lineName, line.lines())
 %ENDSYNTAX%
Deleted:
<
<
More information can be obtained using the STCKsh executable (after SetupDaVinci).
 
Deleted:
<
<
-- AlbertBursche - 09-Jun-2011
 

Check it!

You can check that with PrintDecayTree. Use the latest DaVinci from now on:
<!-- SyntaxHighlightingPlugin -->
SetupProject DaVinci v33r7 
<!-- end SyntaxHighlightingPlugin -->
.
Line: 138 to 190
  )

############# DecayTreeTuple

Changed:
<
<
from Configurables import DecayTreeTuple, TupleToolTrigger, TupleToolDecay, TupleToolTISTOS
>
>
from DecayTreeTuple.Configuration import *
 tuple = DecayTreeTuple("Jpsi_Tuple") tuple.ToolList += [ "TupleToolGeometry"
Line: 146 to 198
  , "TupleToolPrimaries" , "TupleToolEventInfo" , "TupleToolTrackInfo"
Deleted:
<
<
, "TupleToolTISTOS"
  , "TupleToolAngles" , "TupleToolPid" , "TupleToolPropertime" ] tuple.Decay = "J/psi(1S) -> ^mu+ ^mu-"
Changed:
<
<
tuple.InputLocations = [ pt, JpsiSeq.outputLocation() ] tuple.addTool(TupleToolTISTOS) tuple.TupleToolTISTOS.TriggerList = [ "Hlt2DiMuonUnbiasedJPsiDecision" ] tuple.TupleToolTISTOS.VerboseHlt2 = True
>
>
tuple.InputLocations = [ JpsiSeq.outputLocation() ] tttt=tuple.addTupleTool("TupleToolTISTOS") tttt.TriggerList = [ "Hlt2DiMuonUnbiasedJPsiDecision" ] tttt.VerboseHlt2 = True
 ##################
Changed:
<
<
DaVinci().appendToMainSequence( [ JpsiSeq.sequence(), tuple ] ) # pt
>
>
DaVinci().appendToMainSequence( [ JpsiSeq.sequence(), tuple ] )
  DaVinci().DataType = "2010" DaVinci().EvtMax = -1

Revision 272011-06-09 - AlbertBursche

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 51 to 51
  %ENDSYNTAX%
Added:
>
>
This only works if all lines in your stream produce candidates. Otherwise the following code will return the names:
<!-- SyntaxHighlightingPlugin -->
SetupProject DaVinci  v33r7
python
from StrippingSelections.Utils import buildStream
stream = buildStream('Stripping13.tmp', 'EW')

locations = {}
for line in stream.lines :
      print line.name()
<!-- end SyntaxHighlightingPlugin -->

More information can be obtained using the STCKsh executable (after SetupDaVinci).

-- AlbertBursche - 09-Jun-2011

 

Check it!

You can check that with PrintDecayTree. Use the latest DaVinci from now on:
<!-- SyntaxHighlightingPlugin -->
SetupProject DaVinci v33r7 
<!-- end SyntaxHighlightingPlugin -->
.

Revision 262011-03-25 - PatrickSKoppenburg

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 52 to 52
 %ENDSYNTAX%

Check it!

Changed:
<
<
You can check that with PrintDecayTree:
>
>
You can check that with PrintDecayTree. Use the latest DaVinci from now on:
<!-- SyntaxHighlightingPlugin -->
SetupProject DaVinci v33r7 
<!-- end SyntaxHighlightingPlugin -->
. Then do :
 %SYNTAX{ syntax="python"}%from Gaudi.Configuration import * location = "/Event/Dimuon/Phys/NeuroBayesMuMuLine/Particles" from Configurables import DaVinci, PrintDecayTree
Changed:
<
<
pt = PrintDecayTree(InputLocations = [ location ])
>
>
pt = PrintDecayTree(Inputs = [ location ])
 DaVinci().appendToMainSequence( [ pt ] ) DaVinci().DataType = "2010" DaVinci().EvtMax = -1%ENDSYNTAX%

Revision 252011-03-25 - PatrickSKoppenburg

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Changed:
<
<
This has been shown on 03/12/2010. See the slides.
>
>
This has been last shown on 25/03/2011. See the slides.
 

Prerequisites

This assumes you know how to tun DaVinci and know a bit about DecayTreeTuple. Do DaVinciTutorial0 before. Have a look at (or do) DaVinciTutorial6.

Think!

Line: 169 to 169
 
META FILEATTACHMENT attachment="B_Psi_Tos.png" attr="" comment="" date="1300974766" name="B_Psi_Tos.png" path="B_Psi_Tos.png" size="12268" stream="B_Psi_Tos.png" tmpFilename="/usr/tmp/CGItemp44629" user="pkoppenb" version="3"
META FILEATTACHMENT attachment="psi_and_psiprime.png" attr="" comment="" date="1300974794" name="psi_and_psiprime.png" path="psi_and_psiprime.png" size="26636" stream="psi_and_psiprime.png" tmpFilename="/usr/tmp/CGItemp45492" user="pkoppenb" version="3"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v28r1p2"
Changed:
<
<
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v10r0"
>
>
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v10r1"
 |*META PREFERENCE*|name="SYNTAXHIGHLIGHTINGPLUGIN_FORMAT_PREPEND" title="SYNTAXHIGHLIGHTINGPLUGIN_FORMAT_PREPEND" type="Set" value="
"|

Revision 242011-03-25 - PatrickSKoppenburg

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 109 to 109
 JpsiSel = AutomaticData(Location = location) # Filter the Candidate. Let's throw away everything above 4 GeV from Configurables import FilterDesktop
Changed:
<
<
_jpsiFilter = FilterDesktop('jpsiFilter', Code = 'MM<4000')
>
>
_jpsiFilter = FilterDesktop('jpsiFilter', Code = '(M>2500*MeV) & (M<4000*MeV)')
  # make a Selection JpsiFilterSel = Selection(name = 'JpsiFilterSel',

Revision 232011-03-24 - PatrickSKoppenburg

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 17 to 17
 
  1. TisTos your candidate
  2. Store (or fit) it somehow. That could be done directly in python, or via a microDST, or in DecayTreeTuple. For simplicity, we'll use this option.

Where's your candidate?

Changed:
<
<
DaVinci can tell you, but only the version that was actually used to do the stripping. So Make sure you use the version of DaVinci that produced the stripping when doing that. For Stripping 12 it was v26r3p2.
>
>
DaVinci can tell you, but only the version that was actually used to do the stripping. So make sure you use the version of DaVinci that produced the stripping when doing that. For Stripping 12 it was v26r3p2.
 

Stripping12

Suppose you use the 2010 data stripped with Stripping12. Let's look for J/psi candidates. Try the following: %SYNTAX{ syntax="python"}%SetupProject DaVinci v26r3p2.
Line: 50 to 50
  print line, loc

%ENDSYNTAX%

Deleted:
<
<
This will tell you that line StrippingNeuroBayesMuMuLine puts candidates in Dimuon/Phys/NeuroBayesMuMuLine. Make sure you use the version of DaVinci that produced the stripping when doing that.

During the stripping the candidates are moved to /Event/Dimuon/Phys/NeuroBayesMuMuLine, just replace with the appropriate the stream name.

 
Added:
>
>

Check it!

 You can check that with PrintDecayTree: %SYNTAX{ syntax="python"}%from Gaudi.Configuration import * location = "/Event/Dimuon/Phys/NeuroBayesMuMuLine/Particles"
Line: 168 to 165
  -- PatrickSKoppenburg - 08-Jun-2010
Changed:
<
<
META FILEATTACHMENT attachment="hh.png" attr="" comment="" date="1291384711" name="hh.png" path="hh.png" size="20954" stream="hh.png" tmpFilename="/usr/tmp/CGItemp10215" user="pkoppenb" version="3"
META FILEATTACHMENT attachment="B_Psi_Tos.png" attr="" comment="" date="1291107816" name="B_Psi_Tos.png" path="B_Psi_Tos.png" size="15297" stream="B_Psi_Tos.png" tmpFilename="/usr/tmp/CGItemp60666" user="pkoppenb" version="2"
META FILEATTACHMENT attachment="psi_and_psiprime.png" attr="" comment="" date="1291384783" name="psi_and_psiprime.png" path="psi_and_psiprime.png" size="23272" stream="psi_and_psiprime.png" tmpFilename="/usr/tmp/CGItemp10283" user="pkoppenb" version="2"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v26r3p2"
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v8r8"
>
>
META FILEATTACHMENT attachment="hh.png" attr="" comment="" date="1300974781" name="hh.png" path="hh.png" size="20358" stream="hh.png" tmpFilename="/usr/tmp/CGItemp43991" user="pkoppenb" version="4"
META FILEATTACHMENT attachment="B_Psi_Tos.png" attr="" comment="" date="1300974766" name="B_Psi_Tos.png" path="B_Psi_Tos.png" size="12268" stream="B_Psi_Tos.png" tmpFilename="/usr/tmp/CGItemp44629" user="pkoppenb" version="3"
META FILEATTACHMENT attachment="psi_and_psiprime.png" attr="" comment="" date="1300974794" name="psi_and_psiprime.png" path="psi_and_psiprime.png" size="26636" stream="psi_and_psiprime.png" tmpFilename="/usr/tmp/CGItemp45492" user="pkoppenb" version="3"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v28r1p2"
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v10r0"
 |*META PREFERENCE*|name="SYNTAXHIGHLIGHTINGPLUGIN_FORMAT_PREPEND" title="SYNTAXHIGHLIGHTINGPLUGIN_FORMAT_PREPEND" type="Set" value="
"|

Revision 222011-03-24 - PatrickSKoppenburg

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 17 to 17
 
  1. TisTos your candidate
  2. Store (or fit) it somehow. That could be done directly in python, or via a microDST, or in DecayTreeTuple. For simplicity, we'll use this option.

Where's your candidate?

Changed:
<
<
Let's look for J/psi candidates. Try the following: %SYNTAX{ syntax="python"}%SetupProject DaVinci v33r7
>
>
DaVinci can tell you, but only the version that was actually used to do the stripping. So Make sure you use the version of DaVinci that produced the stripping when doing that. For Stripping 12 it was v26r3p2.

Stripping12

Suppose you use the 2010 data stripped with Stripping12. Let's look for J/psi candidates. Try the following: %SYNTAX{ syntax="python"}%SetupProject DaVinci v26r3p2.
 python from StreamDimuon import stream locations = {}
Line: 29 to 31
  print line, loc

%ENDSYNTAX%

Added:
>
>
This will tell you that line StrippingNeuroBayesMuMuLine puts candidates in Dimuon/Phys/NeuroBayesMuMuLine.

During the stripping the candidates are moved to /Event/Dimuon/Phys/NeuroBayesMuMuLine, just replace with the appropriate the stream name.

Stripping13

For more recent versions of the stripping, things have changed a bit. Do
<!-- SyntaxHighlightingPlugin -->
SetupProject DaVinci  v33r7
python
from StrippingSelections.Utils import buildStream
stream = buildStream('Stripping13.tmp', 'Dimuon')

locations = {}
for line in stream.lines :
   locations[ line.name()] = stream.name() + '/' + line.outputLocation()

for line, loc in locations.iteritems() :
   print line, loc
<!-- end SyntaxHighlightingPlugin -->
 This will tell you that line StrippingNeuroBayesMuMuLine puts candidates in Dimuon/Phys/NeuroBayesMuMuLine. Make sure you use the version of DaVinci that produced the stripping when doing that.

During the stripping the candidates are moved to /Event/Dimuon/Phys/NeuroBayesMuMuLine, just replace with the appropriate the stream name.

Revision 212011-03-23 - PatrickSKoppenburg

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 35 to 35
  You can check that with PrintDecayTree: %SYNTAX{ syntax="python"}%from Gaudi.Configuration import *
Changed:
<
<
location = "/Event/Dimuon/Phys/NeuroBayesMuMuLine"
>
>
location = "/Event/Dimuon/Phys/NeuroBayesMuMuLine/Particles"
 from Configurables import DaVinci, PrintDecayTree pt = PrintDecayTree(InputLocations = [ location ]) DaVinci().appendToMainSequence( [ pt ] )
Line: 44 to 44
 

And If I have no candidates?

Still stick to your stripping line. You can select events which passed your stripping line using and HltDecReports filter. %SYNTAX{ syntax="python"}%from Gaudi.Configuration import *
Changed:
<
<
location = '/Event/Dimuon/Phys/NeuroBayesMuMuLine'
>
>
location = '/Event/Dimuon/Phys/NeuroBayesMuMuLine/Particles'
 from Configurables import DaVinci, PrintDecayTree, GaudiSequencer from Configurables import LoKi__HDRFilter as StripFilter MySequencer = GaudiSequencer('Sequence')
Line: 79 to 79
 from Gaudi.Configuration import *

line = 'NeuroBayesMuMuLine'

Changed:
<
<
location = '/Event/Dimuon/Phys/'+line
>
>
location = '/Event/Dimuon/Phys/'+line+'/Particles'
  from Configurables import DaVinci

Revision 202011-01-01 - AndreasJaeger

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 60 to 60
 %SYNTAX{ syntax="python"}%from Configurables import LoKi__HDRFilter as HltFilter MySequencer = GaudiSequencer('Sequence') MySequencer.Members += [ HltFilter( 'HltPassFilter',
Changed:
<
<
Code="HLT_PASS('Hlt1.*Muon.*Decision')" ]%ENDSYNTAX%
>
>
Code="HLT_PASS('Hlt1.*Muon.*Decision')" ) ]%ENDSYNTAX%
 But to really understand what the trigger does to your signal, use the TriggerTisTos tools. See also HltEfficiency.

How to refine your Candidates?

Revision 192010-12-03 - PatrickSKoppenburg

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 136 to 136
 
  • Psi mass:
    hh.png
Deleted:
<
<
  • Tos events in blue, compared to all in red:
    B_Psi_Tos.png
 
  • Who will be the first to find the psi(2S) ?:
    psi_and_psiprime.png
Line: 149 to 146
  -- PatrickSKoppenburg - 08-Jun-2010
Changed:
<
<
META FILEATTACHMENT attachment="hh.png" attr="" comment="" date="1291107796" name="hh.png" path="hh.png" size="20669" stream="hh.png" tmpFilename="/usr/tmp/CGItemp60592" user="pkoppenb" version="2"
>
>
META FILEATTACHMENT attachment="hh.png" attr="" comment="" date="1291384711" name="hh.png" path="hh.png" size="20954" stream="hh.png" tmpFilename="/usr/tmp/CGItemp10215" user="pkoppenb" version="3"
 
META FILEATTACHMENT attachment="B_Psi_Tos.png" attr="" comment="" date="1291107816" name="B_Psi_Tos.png" path="B_Psi_Tos.png" size="15297" stream="B_Psi_Tos.png" tmpFilename="/usr/tmp/CGItemp60666" user="pkoppenb" version="2"
Changed:
<
<
META FILEATTACHMENT attachment="psi_and_psiprime.png" attr="" comment="" date="1291107733" name="psi_and_psiprime.png" path="psi_and_psiprime.png" size="25960" stream="psi_and_psiprime.png" tmpFilename="/usr/tmp/CGItemp60552" user="pkoppenb" version="1"
>
>
META FILEATTACHMENT attachment="psi_and_psiprime.png" attr="" comment="" date="1291384783" name="psi_and_psiprime.png" path="psi_and_psiprime.png" size="23272" stream="psi_and_psiprime.png" tmpFilename="/usr/tmp/CGItemp10283" user="pkoppenb" version="2"
 
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v26r3p2"
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v8r8"
|*META PREFERENCE*|name="SYNTAXHIGHLIGHTINGPLUGIN_FORMAT_PREPEND" title="SYNTAXHIGHLIGHTINGPLUGIN_FORMAT_PREPEND" type="Set" value="
"|

Revision 182010-12-02 - PatrickSKoppenburg

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 20 to 20
 Let's look for J/psi candidates. Try the following: %SYNTAX{ syntax="python"}%SetupProject DaVinci v33r7 python
Changed:
<
<
from from StreamDimuon import stream
>
>
from StreamDimuon import stream
 locations = {} for line in stream.lines : locations[ line.name()] = stream.name() + '/' + line.outputLocation()
Line: 153 to 153
 
META FILEATTACHMENT attachment="B_Psi_Tos.png" attr="" comment="" date="1291107816" name="B_Psi_Tos.png" path="B_Psi_Tos.png" size="15297" stream="B_Psi_Tos.png" tmpFilename="/usr/tmp/CGItemp60666" user="pkoppenb" version="2"
META FILEATTACHMENT attachment="psi_and_psiprime.png" attr="" comment="" date="1291107733" name="psi_and_psiprime.png" path="psi_and_psiprime.png" size="25960" stream="psi_and_psiprime.png" tmpFilename="/usr/tmp/CGItemp60552" user="pkoppenb" version="1"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v26r3p2"
Changed:
<
<
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v8r7"
>
>
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v8r8"
 |*META PREFERENCE*|name="SYNTAXHIGHLIGHTINGPLUGIN_FORMAT_PREPEND" title="SYNTAXHIGHLIGHTINGPLUGIN_FORMAT_PREPEND" type="Set" value="
"|

Revision 172010-12-02 - PatrickSKoppenburg

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 20 to 20
 Let's look for J/psi candidates. Try the following: %SYNTAX{ syntax="python"}%SetupProject DaVinci v33r7 python
Changed:
<
<
from StreamDimuon import stream
>
>
from from StreamDimuon import stream
 locations = {} for line in stream.lines : locations[ line.name()] = stream.name() + '/' + line.outputLocation()
Line: 28 to 29
  print line, loc

%ENDSYNTAX%

Changed:
<
<
This will tell you that line StrippingDiMuonIncLine puts candidates in Dimuon/Phys/DiMuonIncLine. Make sure you use the version of DaVinci that produced the stripping when doing that.
>
>
This will tell you that line StrippingNeuroBayesMuMuLine puts candidates in Dimuon/Phys/NeuroBayesMuMuLine. Make sure you use the version of DaVinci that produced the stripping when doing that.
 
Changed:
<
<
During the stripping the candidates are moved to /Event/Dimuon/Phys/DiMuonIncLine, just replace with the appropriate the stream name.
>
>
During the stripping the candidates are moved to /Event/Dimuon/Phys/NeuroBayesMuMuLine, just replace with the appropriate the stream name.
  You can check that with PrintDecayTree: %SYNTAX{ syntax="python"}%from Gaudi.Configuration import *
Changed:
<
<
location = "/Event/Dimuon/Phys/DiMuonIncLine"
>
>
location = "/Event/Dimuon/Phys/NeuroBayesMuMuLine"
 from Configurables import DaVinci, PrintDecayTree pt = PrintDecayTree(InputLocations = [ location ]) DaVinci().appendToMainSequence( [ pt ] )
Line: 43 to 44
 

And If I have no candidates?

Still stick to your stripping line. You can select events which passed your stripping line using and HltDecReports filter. %SYNTAX{ syntax="python"}%from Gaudi.Configuration import *
Changed:
<
<
location = '/Event/Dimuon/Phys/DiMuonIncLine'
>
>
location = '/Event/Dimuon/Phys/NeuroBayesMuMuLine'
 from Configurables import DaVinci, PrintDecayTree, GaudiSequencer from Configurables import LoKi__HDRFilter as StripFilter MySequencer = GaudiSequencer('Sequence') pt = PrintDecayTree(InputLocations = [ location ])
Changed:
<
<
sf = StripFilter( 'StripPassFilter', Code="HLT_PASS('DiMuonIncLineDecision')", Location="/Event/Strip/Phys/DecReports" )
>
>
sf = StripFilter( 'StripPassFilter', Code="HLT_PASS('NeuroBayesMuMuLineDecision')", Location="/Event/Strip/Phys/DecReports" )
 MySequencer.Members = [ sf, pt ] DaVinci().appendToMainSequence( [ MySequencer ] ) DaVinci().DataType = "2010"
Line: 77 to 78
  from Gaudi.Configuration import *
Changed:
<
<
line = 'DiMuonIncLine'
>
>
line = 'NeuroBayesMuMuLine'
 location = '/Event/Dimuon/Phys/'+line

from Configurables import DaVinci

Revision 162010-12-01 - RobLambert

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.

This has been shown on 03/12/2010. See the slides.

Prerequisites

Changed:
<
<
This assumes you know how to tun DaVinci and know a bit about DecayTreeTuple. Do Tutorial 0 before. Have a look at (or do) 6.
>
>
This assumes you know how to tun DaVinci and know a bit about DecayTreeTuple. Do DaVinciTutorial0 before. Have a look at (or do) DaVinciTutorial6.
 

Think!

Before you start analysing anything you should think! We assume you know
  • Which stripping lines select your candidates

Revision 152010-11-30 - PatrickSKoppenburg

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 130 to 130
 DaVinci().TupleFile = "Jpsi.root" %ENDSYNTAX%
Deleted:
<
<

Make sure the database is up to date

If you run on very recent data the xml version of the conditions database will not yet know about the run you analyse. In that case you'll get such an error:
EventSelector                                                                   SUCCESS Reading Event record 1. Record number within stream 1: 1
ONLINE_201009                                                                     ERROR Database not up-to-date. Latest known update is at 2010-09-06 16:30:01.0 UTC, event time is 2010-09-28 07:05:54.742656 UTC
XmlParserSvc                                                                      ERROR DOM>> File , line 0, column 0: unable to open primary document entity '/afs/cern.ch/user/p/pkoppenb/cmtuser/DaVinci_v26r1/Tutorial/conddb:/Conditions/Online/LHCb/Magnet/Measured'
XmlGenericCnv                                                                     FATAL XmlParser failed, can't convert /Measured!
XmlGenericCnv                                                                     ERROR Cannot create the new object to update the existing one
DetectorDataSvc                                                                   ERROR Could not update DataObject
UpdateManagerSvc                                                                  FATAL ***** The update failed. I schedule a stop of the run *****
EventLoopMgr                                                                    SUCCESS Terminating event processing loop due to a stop scheduled by an incident listener
You must get the oracle database. For that do in Ganga:
<!-- SyntaxHighlightingPlugin -->
j.application.setupProjectOptions='--use-grid'
env=j.application.getenv()
dir=env['APPCONFIGROOT']
j.applications.optsfile.append(dir+'/options/UseOracle.py')
<!-- end SyntaxHighlightingPlugin -->
which is the same as on the command line:
<!-- SyntaxHighlightingPlugin -->
SetupProject DaVinci --use-grid
gaudirun.py MyOpts.py $APPCONFIGROOT/options/UseOracle.py
<!-- end SyntaxHighlightingPlugin -->

for which you must have a valid grid proxy.

 These options are available in Tutorial/Analysis/solutions/DaVinci8 from tag v10r6.

  • Psi mass:

Revision 142010-11-30 - RobLambert

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 142 to 142
 UpdateManagerSvc FATAL *** The update failed. I schedule a stop of the run *** EventLoopMgr SUCCESS Terminating event processing loop due to a stop scheduled by an incident listener
Changed:
<
<
You must get the oracle database. For that do
>
>
You must get the oracle database. For that do in Ganga:
<!-- SyntaxHighlightingPlugin -->
j.application.setupProjectOptions='--use-grid'
env=j.application.getenv()
dir=env['APPCONFIGROOT']
j.applications.optsfile.append(dir+'/options/UseOracle.py')
<!-- end SyntaxHighlightingPlugin -->
which is the same as on the command line:
 %SYNTAX{ syntax="sh" }% SetupProject DaVinci --use-grid gaudirun.py MyOpts.py $APPCONFIGROOT/options/UseOracle.py
Line: 160 to 169
 
  • Who will be the first to find the psi(2S) ?:
    psi_and_psiprime.png
Changed:
<
<
-- PatrickSKoppenburg - 08-Jun-2010
>
>

Next

Go back to any of the other DaVinciTutorial s, then clean up and get ready for your new analysis following: DaVinciTutorialTips.

 
Added:
>
>
-- PatrickSKoppenburg - 08-Jun-2010
 
META FILEATTACHMENT attachment="hh.png" attr="" comment="" date="1291107796" name="hh.png" path="hh.png" size="20669" stream="hh.png" tmpFilename="/usr/tmp/CGItemp60592" user="pkoppenb" version="2"
META FILEATTACHMENT attachment="B_Psi_Tos.png" attr="" comment="" date="1291107816" name="B_Psi_Tos.png" path="B_Psi_Tos.png" size="15297" stream="B_Psi_Tos.png" tmpFilename="/usr/tmp/CGItemp60666" user="pkoppenb" version="2"
META FILEATTACHMENT attachment="psi_and_psiprime.png" attr="" comment="" date="1291107733" name="psi_and_psiprime.png" path="psi_and_psiprime.png" size="25960" stream="psi_and_psiprime.png" tmpFilename="/usr/tmp/CGItemp60552" user="pkoppenb" version="1"

Revision 132010-11-30 - PatrickSKoppenburg

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 85 to 85
 # get classes to build the SelectionSequence from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence # Get the Candidates from the DST.
Changed:
<
<
# Treat particles already on the DST as data-on-demand, but give the full path.
>
>
# AutomaticData is for data on the DST
 JpsiSel = AutomaticData(Location = location)
Changed:
<
<
# Filter the Candidate. Replace 'ALL' by some cuts.
>
>
# Filter the Candidate. Let's throw away everything above 4 GeV
 from Configurables import FilterDesktop _jpsiFilter = FilterDesktop('jpsiFilter', Code = 'MM<4000')

Revision 122010-11-30 - PatrickSKoppenburg

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Changed:
<
<
This has been shown on 01/10/2010. See the slides.
>
>
This has been shown on 03/12/2010. See the slides.
 

Prerequisites

This assumes you know how to tun DaVinci and know a bit about DecayTreeTuple. Do Tutorial 0 before. Have a look at (or do) 6.

Think!

Line: 157 to 157
 
  • Tos events in blue, compared to all in red:
    B_Psi_Tos.png
Added:
>
>
  • Who will be the first to find the psi(2S) ?:
    psi_and_psiprime.png
 -- PatrickSKoppenburg - 08-Jun-2010
Changed:
<
<
META FILEATTACHMENT attachment="hh.png" attr="" comment="Psi mass" date="1285927301" name="hh.png" path="hh.png" size="21487" stream="hh.png" tmpFilename="/usr/tmp/CGItemp28456" user="pkoppenb" version="1"
META FILEATTACHMENT attachment="B_Psi_Tos.png" attr="" comment="Tos events" date="1285927349" name="B_Psi_Tos.png" path="B_Psi_Tos.png" size="16818" stream="B_Psi_Tos.png" tmpFilename="/usr/tmp/CGItemp31625" user="pkoppenb" version="1"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v26r1"
>
>
META FILEATTACHMENT attachment="hh.png" attr="" comment="" date="1291107796" name="hh.png" path="hh.png" size="20669" stream="hh.png" tmpFilename="/usr/tmp/CGItemp60592" user="pkoppenb" version="2"
META FILEATTACHMENT attachment="B_Psi_Tos.png" attr="" comment="" date="1291107816" name="B_Psi_Tos.png" path="B_Psi_Tos.png" size="15297" stream="B_Psi_Tos.png" tmpFilename="/usr/tmp/CGItemp60666" user="pkoppenb" version="2"
META FILEATTACHMENT attachment="psi_and_psiprime.png" attr="" comment="" date="1291107733" name="psi_and_psiprime.png" path="psi_and_psiprime.png" size="25960" stream="psi_and_psiprime.png" tmpFilename="/usr/tmp/CGItemp60552" user="pkoppenb" version="1"
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v26r3p2"
 
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v8r7"
|*META PREFERENCE*|name="SYNTAXHIGHLIGHTINGPLUGIN_FORMAT_PREPEND" title="SYNTAXHIGHLIGHTINGPLUGIN_FORMAT_PREPEND" type="Set" value="
"|

Revision 112010-11-30 - PatrickSKoppenburg

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.

This has been shown on 01/10/2010. See the slides.

Prerequisites

Changed:
<
<
This assumes you know how to tun DaVinci and know a bit about DecayTreeTuple. Do Tutorials 0, 6 before.
>
>
This assumes you know how to tun DaVinci and know a bit about DecayTreeTuple. Do Tutorial 0 before. Have a look at (or do) 6.
 

Think!

Before you start analysing anything you should think! We assume you know
  • Which stripping lines select your candidates

Revision 102010-10-01 - PatrickSKoppenburg

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 80 to 80
 line = 'DiMuonIncLine' location = '/Event/Dimuon/Phys/'+line
Changed:
<
<
from Configurables import DaVinci, GaudiSequencer from Configurables import LoKi__HDRFilter as StripFilter MySequencer = GaudiSequencer('Sequence')
>
>
from Configurables import DaVinci
  # get classes to build the SelectionSequence from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
Line: 151 to 149
 %ENDSYNTAX% for which you must have a valid grid proxy.
Changed:
<
<
These options are available in Tutorial/Analysis/solutions/DaVinci8 from tag v8r7.
>
>
These options are available in Tutorial/Analysis/solutions/DaVinci8 from tag v10r6.

  • Psi mass:
    hh.png

  • Tos events in blue, compared to all in red:
    B_Psi_Tos.png
  -- PatrickSKoppenburg - 08-Jun-2010
Added:
>
>
META FILEATTACHMENT attachment="hh.png" attr="" comment="Psi mass" date="1285927301" name="hh.png" path="hh.png" size="21487" stream="hh.png" tmpFilename="/usr/tmp/CGItemp28456" user="pkoppenb" version="1"
META FILEATTACHMENT attachment="B_Psi_Tos.png" attr="" comment="Tos events" date="1285927349" name="B_Psi_Tos.png" path="B_Psi_Tos.png" size="16818" stream="B_Psi_Tos.png" tmpFilename="/usr/tmp/CGItemp31625" user="pkoppenb" version="1"
 
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v26r1"
Changed:
<
<
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v8r6"
>
>
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v8r7"
 |*META PREFERENCE*|name="SYNTAXHIGHLIGHTINGPLUGIN_FORMAT_PREPEND" title="SYNTAXHIGHLIGHTINGPLUGIN_FORMAT_PREPEND" type="Set" value="
"|

Revision 92010-10-01 - PatrickSKoppenburg

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.

This has been shown on 01/10/2010. See the slides.

Prerequisites

Changed:
<
<
This assumes you know how to tun DaVinci and know a bit about DecayTreeTuple. Do Tutorials 0, 4, 6 before.
>
>
This assumes you know how to tun DaVinci and know a bit about DecayTreeTuple. Do Tutorials 0, 6 before.
 

Think!

Before you start analysing anything you should think! We assume you know
  • Which stripping lines select your candidates
Line: 34 to 34
  You can check that with PrintDecayTree: %SYNTAX{ syntax="python"}%from Gaudi.Configuration import *
Changed:
<
<
location = ''/Event/Dimuon/Phys/DiMuonIncLine"
>
>
location = "/Event/Dimuon/Phys/DiMuonIncLine"
 from Configurables import DaVinci, PrintDecayTree pt = PrintDecayTree(InputLocations = [ location ]) DaVinci().appendToMainSequence( [ pt ] )
Line: 63 to 63
 But to really understand what the trigger does to your signal, use the TriggerTisTos tools. See also HltEfficiency.

How to refine your Candidates?

Changed:
<
<
Use for instance the ParticleSelection framework, or anything else as you wish. The important point is to start from your candidate and apply further cuts. The following would apply a 1 GeV PT cut to your candidates.
>
>
Use for instance the ParticleSelection framework, or anything else as you wish. The important point is to start from your candidate and apply further cuts. The following would apply a mass cut to your candidates.
  %SYNTAX{ syntax="python"}%
Changed:
<
<
# dd the following to the options above...
>
>
######################################################################## # # Options for exercise 8 # # @author Patrick Koppenburg # @date 2010-06-07 # ########################################################################

from Gaudi.Configuration import *

line = 'DiMuonIncLine' location = '/Event/Dimuon/Phys/'+line

from Configurables import DaVinci, GaudiSequencer from Configurables import LoKi__HDRFilter as StripFilter MySequencer = GaudiSequencer('Sequence')

 # get classes to build the SelectionSequence from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence # Get the Candidates from the DST.
Changed:
<
<
# Treat particles already on the DST as data-on-demand, but give the full path
>
>
# Treat particles already on the DST as data-on-demand, but give the full path.
 JpsiSel = AutomaticData(Location = location) # Filter the Candidate. Replace 'ALL' by some cuts. from Configurables import FilterDesktop
Changed:
<
<
_jpsiFilter = FilterDesktop('kstgammaFilter', Code = 'PT>1*GeV')
>
>
_jpsiFilter = FilterDesktop('jpsiFilter', Code = 'MM<4000')
  # make a Selection JpsiFilterSel = Selection(name = 'JpsiFilterSel',
Line: 84 to 101
 # build the SelectionSequence JpsiSeq = SelectionSequence('SeqJpsi', TopSelection = JpsiFilterSel,
Changed:
<
<
EventPreSelector = [ sf ]) DaVinci().appendToMainSequence( [ JpsiSeq.sequence() ] ) ##instead of MySequencer%ENDSYNTAX%

And fill it in an nTuple

That;s obviously not the smartest thing to do, but the quickest. Here are some options for DecayTreeTuple: %SYNTAX{ syntax="python"}%############# DecayTreeTuple
>
>
)

############# DecayTreeTuple

 from Configurables import DecayTreeTuple, TupleToolTrigger, TupleToolDecay, TupleToolTISTOS
Changed:
<
<
tuple = DecayTreeTuple("KstarGamma_Tuple")
>
>
tuple = DecayTreeTuple("Jpsi_Tuple")
 tuple.ToolList += [ "TupleToolGeometry" , "TupleToolKinematic" , "TupleToolPrimaries" , "TupleToolEventInfo" , "TupleToolTrackInfo"
Deleted:
<
<
, "TupleToolTrigger"
  , "TupleToolTISTOS" , "TupleToolAngles" , "TupleToolPid" , "TupleToolPropertime" ]
Changed:
<
<
tuple.Decay = "J/psi -> ^mu+ ^mu-" tuple.InputLocations = [ 'JpsiFilterSel' ] tuple.addTool(TupleToolTrigger) tuple.TupleToolTrigger.VerboseL0 = True tuple.TupleToolTrigger.VerboseHlt1 = True tuple.TupleToolTrigger.UseAutomaticTriggerList = True
>
>
tuple.Decay = "J/psi(1S) -> ^mu+ ^mu-" tuple.InputLocations = [ pt, JpsiSeq.outputLocation() ]
 tuple.addTool(TupleToolTISTOS) tuple.TupleToolTISTOS.TriggerList = [ "Hlt2DiMuonUnbiasedJPsiDecision" ]
Changed:
<
<
tuple.TupleToolTISTOS.VerboseHlt1 = True
>
>
tuple.TupleToolTISTOS.VerboseHlt2 = True
 ##################
Added:
>
>
DaVinci().appendToMainSequence( [ JpsiSeq.sequence(), tuple ] ) # pt
 DaVinci().DataType = "2010" DaVinci().EvtMax = -1
Changed:
<
<
DaVinci().PrintFreq = 10
>
>
DaVinci().PrintFreq = 100
 DaVinci().TupleFile = "Jpsi.root" %ENDSYNTAX%
Changed:
<
<
Note that here we configured TupleToolTrigger to get all trigger decisions (huge!) but restricted the TriggerTisTos to a few well selected lines.
>
>

Make sure the database is up to date

If you run on very recent data the xml version of the conditions database will not yet know about the run you analyse. In that case you'll get such an error:
EventSelector                                                                   SUCCESS Reading Event record 1. Record number within stream 1: 1
ONLINE_201009                                                                     ERROR Database not up-to-date. Latest known update is at 2010-09-06 16:30:01.0 UTC, event time is 2010-09-28 07:05:54.742656 UTC
XmlParserSvc                                                                      ERROR DOM>> File , line 0, column 0: unable to open primary document entity '/afs/cern.ch/user/p/pkoppenb/cmtuser/DaVinci_v26r1/Tutorial/conddb:/Conditions/Online/LHCb/Magnet/Measured'
XmlGenericCnv                                                                     FATAL XmlParser failed, can't convert /Measured!
XmlGenericCnv                                                                     ERROR Cannot create the new object to update the existing one
DetectorDataSvc                                                                   ERROR Could not update DataObject
UpdateManagerSvc                                                                  FATAL ***** The update failed. I schedule a stop of the run *****
EventLoopMgr                                                                    SUCCESS Terminating event processing loop due to a stop scheduled by an incident listener
You must get the oracle database. For that do
<!-- SyntaxHighlightingPlugin -->
SetupProject DaVinci --use-grid
gaudirun.py MyOpts.py $APPCONFIGROOT/options/UseOracle.py
<!-- end SyntaxHighlightingPlugin -->
for which you must have a valid grid proxy.
 
Changed:
<
<
These options are available in Tutorial/Analysis/solutions/DaVinci8 from tag pkoppenb_20100608.
>
>
These options are available in Tutorial/Analysis/solutions/DaVinci8 from tag v8r7.
  -- PatrickSKoppenburg - 08-Jun-2010

Revision 82010-09-30 - PatrickSKoppenburg

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Changed:
<
<
This has been shown on 10/6/2010. See the slides.
>
>
This has been shown on 01/10/2010. See the slides.
 

Prerequisites

This assumes you know how to tun DaVinci and know a bit about DecayTreeTuple. Do Tutorials 0, 4, 6 before.

Think!

Line: 17 to 17
 
  1. TisTos your candidate
  2. Store (or fit) it somehow. That could be done directly in python, or via a microDST, or in DecayTreeTuple. For simplicity, we'll use this option.

Where's your candidate?

Changed:
<
<
Let's look for Kstar Gamma candidates. Try the following: %SYNTAX{ syntax="python"}%SetupProject DaVinci v25r7
>
>
Let's look for J/psi candidates. Try the following: %SYNTAX{ syntax="python"}%SetupProject DaVinci v33r7
 python
Changed:
<
<
from StreamRadiative import stream
>
>
from StreamDimuon import stream
 locations = {} for line in stream.lines : locations[ line.name()] = stream.name() + '/' + line.outputLocation()
Line: 28 to 28
  print line, loc

%ENDSYNTAX%

Changed:
<
<
This will tell you that line StrippingBd2KstGamma puts candidates in Radiative/Phys/SelBd2KstGamma. Make sure you use the version of DaVinci that produced the stripping when doing that.
>
>
This will tell you that line StrippingDiMuonIncLine puts candidates in Dimuon/Phys/DiMuonIncLine. Make sure you use the version of DaVinci that produced the stripping when doing that.
 
Changed:
<
<
During the stripping the candidates are moved to /Event/Radiative/Phys/SelBd2KstGamma, just replace with the appropriate the stream name (this is valid from RecoStripping-04).
>
>
During the stripping the candidates are moved to /Event/Dimuon/Phys/DiMuonIncLine, just replace with the appropriate the stream name.
  You can check that with PrintDecayTree: %SYNTAX{ syntax="python"}%from Gaudi.Configuration import *
Changed:
<
<
location = '/Event/Radiative/Phys/SelBd2KstGamma'
>
>
location = ''/Event/Dimuon/Phys/DiMuonIncLine"
 from Configurables import DaVinci, PrintDecayTree pt = PrintDecayTree(InputLocations = [ location ]) DaVinci().appendToMainSequence( [ pt ] )
Line: 43 to 43
 

And If I have no candidates?

Still stick to your stripping line. You can select events which passed your stripping line using and HltDecReports filter. %SYNTAX{ syntax="python"}%from Gaudi.Configuration import *
Changed:
<
<
location = '/Event/Radiative/Phys/SelBd2KstGamma'
>
>
location = '/Event/Dimuon/Phys/DiMuonIncLine'
 from Configurables import DaVinci, PrintDecayTree, GaudiSequencer from Configurables import LoKi__HDRFilter as StripFilter MySequencer = GaudiSequencer('Sequence') pt = PrintDecayTree(InputLocations = [ location ])
Changed:
<
<
sf = StripFilter( 'StripPassFilter', Code="HLT_PASS('StrippingBd2KstGammaDecision')", Location="/Event/Strip/Phys/DecReports" )
>
>
sf = StripFilter( 'StripPassFilter', Code="HLT_PASS('DiMuonIncLineDecision')", Location="/Event/Strip/Phys/DecReports" )
 MySequencer.Members = [ sf, pt ] DaVinci().appendToMainSequence( [ MySequencer ] ) DaVinci().DataType = "2010"
Line: 59 to 59
 %SYNTAX{ syntax="python"}%from Configurables import LoKi__HDRFilter as HltFilter MySequencer = GaudiSequencer('Sequence') MySequencer.Members += [ HltFilter( 'HltPassFilter',
Changed:
<
<
Code="HLT_PASS('Hlt1Photon.*Decision')" ]%ENDSYNTAX%
>
>
Code="HLT_PASS('Hlt1.*Muon.*Decision')" ]%ENDSYNTAX%
 But to really understand what the trigger does to your signal, use the TriggerTisTos tools. See also HltEfficiency.

How to refine your Candidates?

Line: 70 to 70
 # get classes to build the SelectionSequence from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence # Get the Candidates from the DST.
Changed:
<
<
# Treat particles already on the DST as data-on-demand, but give the full path. KstgammaSel = AutomaticData(Location = location)
>
>
# Treat particles already on the DST as data-on-demand, but give the full path JpsiSel = AutomaticData(Location = location)
 # Filter the Candidate. Replace 'ALL' by some cuts. from Configurables import FilterDesktop
Changed:
<
<
_kstgammaFilter = FilterDesktop('kstgammaFilter', Code = 'PT>1*GeV')
>
>
_jpsiFilter = FilterDesktop('kstgammaFilter', Code = 'PT>1*GeV')
  # make a Selection
Changed:
<
<
KstgammaFilterSel = Selection(name = 'KstgammaFilterSel', Algorithm = _kstgammaFilter, RequiredSelections = [ KstgammaSel])
>
>
JpsiFilterSel = Selection(name = 'JpsiFilterSel', Algorithm = _jpsiFilter, RequiredSelections = [ JpsiSel ])
  # build the SelectionSequence
Changed:
<
<
KstgammaSeq = SelectionSequence('SeqKstgamma', TopSelection = KstgammaFilterSel,
>
>
JpsiSeq = SelectionSequence('SeqJpsi', TopSelection = JpsiFilterSel,
  EventPreSelector = [ sf ])
Changed:
<
<
DaVinci().appendToMainSequence( [ KstgammaSeq.sequence() ] ) ##instead of MySequencer%ENDSYNTAX%
>
>
DaVinci().appendToMainSequence( [ JpsiSeq.sequence() ] ) ##instead of MySequencer%ENDSYNTAX%
 

And fill it in an nTuple

That;s obviously not the smartest thing to do, but the quickest. Here are some options for DecayTreeTuple: %SYNTAX{ syntax="python"}%############# DecayTreeTuple
Line: 103 to 103
  , "TupleToolPid" , "TupleToolPropertime" ]
Changed:
<
<
tuple.Decay = "[B0 -> (^K*(892)0 -> ^K+ ^pi-) ^gamma]cc" tuple.InputLocations = [ 'KstgammaFilterSel' ]
>
>
tuple.Decay = "J/psi -> ^mu+ ^mu-" tuple.InputLocations = [ 'JpsiFilterSel' ]
 tuple.addTool(TupleToolTrigger) tuple.TupleToolTrigger.VerboseL0 = True tuple.TupleToolTrigger.VerboseHlt1 = True tuple.TupleToolTrigger.UseAutomaticTriggerList = True tuple.addTool(TupleToolTISTOS)
Changed:
<
<
tuple.TupleToolTISTOS.TriggerList = [ "Hlt1DiHadronDecision", "Hlt1PhotonDiTrackDecision", "Hlt1SingleHadronDecision" ]
>
>
tuple.TupleToolTISTOS.TriggerList = [ "Hlt2DiMuonUnbiasedJPsiDecision" ]
 tuple.TupleToolTISTOS.VerboseHlt1 = True ##################

DaVinci().DataType = "2010" DaVinci().EvtMax = -1 DaVinci().PrintFreq = 10

Changed:
<
<
DaVinci().TupleFile = "KstGamma.root"
>
>
DaVinci().TupleFile = "Jpsi.root"
 %ENDSYNTAX%

Note that here we configured TupleToolTrigger to get all trigger decisions (huge!) but restricted the TriggerTisTos to a few well selected lines.

Line: 126 to 126
  -- PatrickSKoppenburg - 08-Jun-2010
Changed:
<
<
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v25r5"
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v8r5"
>
>
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v26r1"
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v8r6"
 |*META PREFERENCE*|name="SYNTAXHIGHLIGHTINGPLUGIN_FORMAT_PREPEND" title="SYNTAXHIGHLIGHTINGPLUGIN_FORMAT_PREPEND" type="Set" value="
"|

Revision 72010-08-24 - PatrickSKoppenburg

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 18 to 18
 
  1. Store (or fit) it somehow. That could be done directly in python, or via a microDST, or in DecayTreeTuple. For simplicity, we'll use this option.

Where's your candidate?

Let's look for Kstar Gamma candidates. Try the following:
Changed:
<
<
%SYNTAX{ syntax="python"}%SetupProject DaVinci v25r5
>
>
%SYNTAX{ syntax="python"}%SetupProject DaVinci v25r7
 python from StreamRadiative import stream locations = {}
Line: 28 to 28
  print line, loc

%ENDSYNTAX%

Changed:
<
<
This will tell you that line StrippingBd2KstGamma puts candidates in Radiative/Phys/SelBd2KstGamma.
>
>
This will tell you that line StrippingBd2KstGamma puts candidates in Radiative/Phys/SelBd2KstGamma. Make sure you use the version of DaVinci that produced the stripping when doing that.
  During the stripping the candidates are moved to /Event/Radiative/Phys/SelBd2KstGamma, just replace with the appropriate the stream name (this is valid from RecoStripping-04).

Revision 62010-06-18 - PatrickSKoppenburg

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 60 to 60
 MySequencer = GaudiSequencer('Sequence') MySequencer.Members += [ HltFilter( 'HltPassFilter', Code="HLT_PASS('Hlt1Photon.*Decision')" ]%ENDSYNTAX%
Changed:
<
<
But to really understand what the trigger does to your signal, use the TriggerTisTos tools.
>
>
But to really understand what the trigger does to your signal, use the TriggerTisTos tools. See also HltEfficiency.
 

How to refine your Candidates?

Use for instance the ParticleSelection framework, or anything else as you wish. The important point is to start from your candidate and apply further cuts. The following would apply a 1 GeV PT cut to your candidates.

Revision 52010-06-10 - PatrickSKoppenburg

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Added:
>
>
This has been shown on 10/6/2010. See the slides.
 

Prerequisites

This assumes you know how to tun DaVinci and know a bit about DecayTreeTuple. Do Tutorials 0, 4, 6 before.

Think!

Line: 12 to 14
 

The workflow

  1. Read your candidates
  2. Refine your candidates (more cuts)
Changed:
<
<
  1. TisTos your candidate
>
>
  1. TisTos your candidate
 
  1. Store (or fit) it somehow. That could be done directly in python, or via a microDST, or in DecayTreeTuple. For simplicity, we'll use this option.

Where's your candidate?

Let's look for Kstar Gamma candidates. Try the following:
Line: 120 to 122
  Note that here we configured TupleToolTrigger to get all trigger decisions (huge!) but restricted the TriggerTisTos to a few well selected lines.
Changed:
<
<
These options are available in Tutorial/Analysis/solutions/DaVinci8.
>
>
These options are available in Tutorial/Analysis/solutions/DaVinci8 from tag pkoppenb_20100608.
  -- PatrickSKoppenburg - 08-Jun-2010

Revision 42010-06-10 - unknown

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.
Line: 18 to 18
 Let's look for Kstar Gamma candidates. Try the following: %SYNTAX{ syntax="python"}%SetupProject DaVinci v25r5 python
Changed:
<
<
from StrippingSelections import StreamRadiative for line in StreamRadiative.stream.lines: line.name(), line.outputLocation()
>
>
from StreamRadiative import stream locations = {} for line in stream.lines : locations[ line.name()] = stream.name() + '/' + line.outputLocation() for line, loc in locations.iteritems() : print line, loc
  %ENDSYNTAX%
Changed:
<
<
This will tell you that line StrippingBd2KstGamma puts candidates in Phys/SelBd2KstGamma.
>
>
This will tell you that line StrippingBd2KstGamma puts candidates in Radiative/Phys/SelBd2KstGamma.
  During the stripping the candidates are moved to /Event/Radiative/Phys/SelBd2KstGamma, just replace with the appropriate the stream name (this is valid from RecoStripping-04).

Revision 32010-06-09 - PatrickSKoppenburg

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"
Changed:
<
<

DaVinci Tutorial 8 UNDER CONSTRUCTION

>
>

DaVinci Tutorial 8

 How to run on a stripped DST.

Prerequisites

This assumes you know how to tun DaVinci and know a bit about DecayTreeTuple. Do Tutorials 0, 4, 6 before.
Line: 29 to 29
 During the stripping the candidates are moved to /Event/Radiative/Phys/SelBd2KstGamma, just replace with the appropriate the stream name (this is valid from RecoStripping-04).

You can check that with PrintDecayTree:

Deleted:
<
<
 %SYNTAX{ syntax="python"}%from Gaudi.Configuration import * location = '/Event/Radiative/Phys/SelBd2KstGamma'
Changed:
<
<
MessageSvc().Format = "% F%80WPICK7W%R%T %0W%M"
>
>
from Configurables import DaVinci, PrintDecayTree pt = PrintDecayTree(InputLocations = [ location ]) DaVinci().appendToMainSequence( [ pt ] ) DaVinci().DataType = "2010" DaVinci().EvtMax = -1%ENDSYNTAX%

And If I have no candidates?

Still stick to your stripping line. You can select events which passed your stripping line using and HltDecReports filter. %SYNTAX{ syntax="python"}%from Gaudi.Configuration import * location = '/Event/Radiative/Phys/SelBd2KstGamma'
 from Configurables import DaVinci, PrintDecayTree, GaudiSequencer from Configurables import LoKi__HDRFilter as StripFilter MySequencer = GaudiSequencer('Sequence')
Deleted:
<
<
sf = StripFilter( 'StripPassFilter', Code="HLT_PASS('StrippingBd2KstGammaDecision')", Location="/Event/Strip/Phys/DecReports" )
 pt = PrintDecayTree(InputLocations = [ location ])
Added:
>
>
sf = StripFilter( 'StripPassFilter', Code="HLT_PASS('StrippingBd2KstGammaDecision')", Location="/Event/Strip/Phys/DecReports" ) MySequencer.Members = [ sf, pt ] DaVinci().appendToMainSequence( [ MySequencer ] ) DaVinci().DataType = "2010" DaVinci().EvtMax = -1%ENDSYNTAX% The above would run PrintDecayTree only on events selected by the appropriate line.

What about trigger lines?

The same can be done with trigger lines
<!-- SyntaxHighlightingPlugin -->
from Configurables import LoKi__HDRFilter   as HltFilter
MySequencer = GaudiSequencer('Sequence')
MySequencer.Members += [ HltFilter( 'HltPassFilter', 
            Code="HLT_PASS('Hlt1Photon.*Decision')"  ]
<!-- end SyntaxHighlightingPlugin -->
But to really understand what the trigger does to your signal, use the TriggerTisTos tools.

How to refine your Candidates?

Use for instance the ParticleSelection framework, or anything else as you wish. The important point is to start from your candidate and apply further cuts. The following would apply a 1 GeV PT cut to your candidates.
 
Added:
>
>
%SYNTAX{ syntax="python"}% # dd the following to the options above...
 # get classes to build the SelectionSequence from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence # Get the Candidates from the DST.
Line: 48 to 70
 KstgammaSel = AutomaticData(Location = location) # Filter the Candidate. Replace 'ALL' by some cuts. from Configurables import FilterDesktop
Changed:
<
<
_kstgammaFilter = FilterDesktop('kstgammaFilter', Code = 'ALL')
>
>
_kstgammaFilter = FilterDesktop('kstgammaFilter', Code = 'PT>1*GeV')
  # make a Selection KstgammaFilterSel = Selection(name = 'KstgammaFilterSel',
Line: 59 to 81
 KstgammaSeq = SelectionSequence('SeqKstgamma', TopSelection = KstgammaFilterSel, EventPreSelector = [ sf ])
Changed:
<
<
############# DecayTreeTuple
>
>
DaVinci().appendToMainSequence( [ KstgammaSeq.sequence() ] ) ##instead of MySequencer%ENDSYNTAX%

And fill it in an nTuple

That;s obviously not the smartest thing to do, but the quickest. Here are some options for DecayTreeTuple: %SYNTAX{ syntax="python"}%############# DecayTreeTuple
 from Configurables import DecayTreeTuple, TupleToolTrigger, TupleToolDecay, TupleToolTISTOS tuple = DecayTreeTuple("KstarGamma_Tuple") tuple.ToolList += [
Line: 92 to 116
 DaVinci().TupleFile = "KstGamma.root" %ENDSYNTAX%
Added:
>
>
Note that here we configured TupleToolTrigger to get all trigger decisions (huge!) but restricted the TriggerTisTos to a few well selected lines.

These options are available in Tutorial/Analysis/solutions/DaVinci8.

 -- PatrickSKoppenburg - 08-Jun-2010

META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v25r5"

Revision 22010-06-08 - PatrickSKoppenburg

Line: 1 to 1
 
META TOPICPARENT name="DaVinciTutorial"
Changed:
<
<

DaVinci Tutorial 8

>
>

DaVinci Tutorial 8 UNDER CONSTRUCTION

 How to run on a stripped DST.

Prerequisites

This assumes you know how to tun DaVinci and know a bit about DecayTreeTuple. Do Tutorials 0, 4, 6 before.
Line: 9 to 9
 
  • Which stripping lines select your candidates
  • Which trigger lines select your candidates
"I'll take all" is not a valid answer. Talk to your supervisor.
Changed:
<
<

>
>

The workflow

  1. Read your candidates
  2. Refine your candidates (more cuts)
  3. TisTos your candidate
  4. Store (or fit) it somehow. That could be done directly in python, or via a microDST, or in DecayTreeTuple. For simplicity, we'll use this option.

Where's your candidate?

Let's look for Kstar Gamma candidates. Try the following:
<!-- SyntaxHighlightingPlugin -->
SetupProject DaVinci v25r5
python

from StrippingSelections import StreamRadiative
for line in StreamRadiative.stream.lines:
     line.name(), line.outputLocation()
<!-- end SyntaxHighlightingPlugin -->
This will tell you that line StrippingBd2KstGamma puts candidates in Phys/SelBd2KstGamma.

During the stripping the candidates are moved to /Event/Radiative/Phys/SelBd2KstGamma, just replace with the appropriate the stream name (this is valid from RecoStripping-04).

You can check that with PrintDecayTree:

  %SYNTAX{ syntax="python"}%from Gaudi.Configuration import * location = '/Event/Radiative/Phys/SelBd2KstGamma'
Line: 73 to 93
 %ENDSYNTAX%

-- PatrickSKoppenburg - 08-Jun-2010

Added:
>
>
META PREFERENCE name="DAVINCIVERSION" title="DAVINCIVERSION" type="Set" value="v25r5"
META PREFERENCE name="TUTORIALVERSION" title="TUTORIALVERSION" type="Set" value="v8r5"
|*META PREFERENCE*|name="SYNTAXHIGHLIGHTINGPLUGIN_FORMAT_PREPEND" title="SYNTAXHIGHLIGHTINGPLUGIN_FORMAT_PREPEND" type="Set" value="
"|

Revision 12010-06-08 - PatrickSKoppenburg

Line: 1 to 1
Added:
>
>
META TOPICPARENT name="DaVinciTutorial"

DaVinci Tutorial 8

How to run on a stripped DST.

Prerequisites

This assumes you know how to tun DaVinci and know a bit about DecayTreeTuple. Do Tutorials 0, 4, 6 before.

Think!

Before you start analysing anything you should think! We assume you know
  • Which stripping lines select your candidates
  • Which trigger lines select your candidates
"I'll take all" is not a valid answer. Talk to your supervisor.

<!-- SyntaxHighlightingPlugin -->
from Gaudi.Configuration import *
location = '/Event/Radiative/Phys/SelBd2KstGamma' 

MessageSvc().Format = "% F%80W<img src="/twiki/pub/TWiki/TWikiDocGraphics/starred.gif" alt="PICK" title="PICK" width="16" height="16" border="0" />7W%R%T %0W%M"
from Configurables import DaVinci, PrintDecayTree, GaudiSequencer
from Configurables import LoKi__HDRFilter   as StripFilter
MySequencer = GaudiSequencer('Sequence')
sf = StripFilter( 'StripPassFilter', Code="HLT_PASS('StrippingBd2KstGammaDecision')", Location="/Event/Strip/Phys/DecReports" )
pt = PrintDecayTree(InputLocations = [ location ])

# get classes to build the SelectionSequence
from PhysSelPython.Wrappers import AutomaticData, Selection, SelectionSequence
# Get the Candidates from the DST.
# Treat particles already on the DST as data-on-demand, but give the full path.
KstgammaSel = AutomaticData(Location = location)
# Filter the Candidate. Replace 'ALL' by some cuts.
from Configurables import FilterDesktop
_kstgammaFilter = FilterDesktop('kstgammaFilter', Code = 'ALL')

# make a Selection
KstgammaFilterSel = Selection(name = 'KstgammaFilterSel',
                          Algorithm = _kstgammaFilter,
                          RequiredSelections = [ KstgammaSel])

# build the SelectionSequence
KstgammaSeq = SelectionSequence('SeqKstgamma',
                                TopSelection = KstgammaFilterSel,
                                EventPreSelector = [ sf ])

############# DecayTreeTuple
from Configurables import DecayTreeTuple, TupleToolTrigger, TupleToolDecay, TupleToolTISTOS
tuple = DecayTreeTuple("KstarGamma_Tuple")
tuple.ToolList +=  [
    "TupleToolGeometry"
    , "TupleToolKinematic"
    , "TupleToolPrimaries"
    , "TupleToolEventInfo"
    , "TupleToolTrackInfo"
    , "TupleToolTrigger"
    , "TupleToolTISTOS"
    , "TupleToolAngles"
    , "TupleToolPid"
    , "TupleToolPropertime"
    ]
tuple.Decay = "[B0 -> (^K*(892)0 -> ^K+ ^pi-) ^gamma]cc"
tuple.InputLocations = [ 'KstgammaFilterSel' ]
tuple.addTool(TupleToolTrigger)
tuple.TupleToolTrigger.VerboseL0 = True
tuple.TupleToolTrigger.VerboseHlt1 = True
tuple.TupleToolTrigger.UseAutomaticTriggerList = True
tuple.addTool(TupleToolTISTOS)
tuple.TupleToolTISTOS.TriggerList = [ "Hlt1DiHadronDecision", "Hlt1PhotonDiTrackDecision", "Hlt1SingleHadronDecision" ]
tuple.TupleToolTISTOS.VerboseHlt1 = True
##################

DaVinci().DataType = "2010"
DaVinci().EvtMax = -1
DaVinci().PrintFreq = 10
DaVinci().TupleFile = "KstGamma.root"
<!-- end SyntaxHighlightingPlugin -->

-- PatrickSKoppenburg - 08-Jun-2010

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback