---+ How do I redo stripping? The stripping is implemented in [[https://gitlab.cern.ch/lhcb/Stripping][this]] package. Some of it can be modified from the DaVinci script, but other things require modifications in DaVinci. Therefore one has to checkout the right version of DaVinci, modify it and run the ntuple production with it. ----+ What DaVinci version to use For: * *Data*: Use the latest version. This is not relevant here because data is stored in _MDST_ files which for which restripping is not possible. * *Simulation:* Use the version of DaVinci used for processing the corresponding data. The latest stripping version for the data is [[http://lhcbdoc.web.cern.ch/lhcbdoc/stripping/][here]]. So, if you are using 2017 data and the latest stripping available is _29r2p1_ you check [[https://twiki.cern.ch/twiki/bin/view/Main/ProcessingPasses][here]] and find that the DaVinci version used was _v42r9p2_. ----+ Checking out DaVinci Follow these instructions: <sticky> %CODE{ lang="bash" num="0" numstep="2" }% #disable default login touch ~/.nogrouplogin #set LHCb environment source /cvmfs/lhcb.cern.ch/lib/LbEnv #what platforms have a specific DaVinci version? lb-sdb-query p DaVinci v42r9p2 #set platform lb-set-platform x86_64-centos7-gcc62-opt #pick a directory where all your DaVinci versions will be cd /afs/cern.ch/work/a/acampove/RK/DaVinci/ #Create DaVinci skeleton lb-dev DaVinci/v42r9p2 cd DaVinciDev_v42r9p2/ #Declare what packages you will be modifying git lb-use Phys git lb-use Stripping %ENDCODE% </sticky> each DaVinci version is associated with a specific version of the other packages. Here we need to know the version of =Phys= and =Stripping=, which can be found [[http://lhcbdoc.web.cern.ch/lhcbdoc/davinci/releases/][here]]. <sticky> %CODE{ lang="bash" num="0" numstep="2" }% #Place where PID cut on electrons are set, when building dielectron objects git lb-checkout Phys/v23r10 Phys/CommonParticles #Place where stripping lines are defined git lb-checkout Stripping/v14r5p2 Phys/StrippingArchive #build make configure make #Edit code where PID is set for electrons cd Phys/CommonParticles/python/CommonParticles/ vim StdLooseDiElectron.py %ENDCODE% </sticky> The change needed for =StdLooseDiElectron.py= is below: <sticky> %CODE{ lang="python" num="51" numstep="2" }% #dieLL.Electron.Selection = ["RequiresDet='CALO' CombDLL(e-pi)>'-2'"] dieLL.Electron.Selection = [""] %ENDCODE% </sticky> Then modify =StdLooseDiMuon.py= as indicated below: <sticky> %CODE{ lang="python" num="30" numstep="2" }% #StdLooseDiMuon.Inputs = ["Phys/StdAllLooseMuons/Particles"] StdLooseDiMuon.Inputs = ["Phys/StdAllNoPIDsMuons/Particles"] %ENDCODE% </sticky> Then implement changes in the file where the stripping line is defined: <sticky> %CODE{ lang="bash" num="0" numstep="2" }% cd Phys/StrippingArchive/python/StrippingArchive/Stripping29r2p1/StrippingRD/ vim StrippingB2LLXBDT.py %ENDCODE% </sticky> by changing: <sticky> %CODE{ lang="python" num="229" numstep="2" }% #from StandardParticles import StdLooseANNPions, StdLooseANNKaons, StdLooseANNProtons from StandardParticles import StdAllNoPIDsPions, StdAllNoPIDsKaons, StdAllNoPIDsProtons %ENDCODE% </sticky> and <sticky> %CODE{ lang="python" num="232" numstep="2" }% self.SelPions = self.createSubSel( OutputList=self.name + "SelPions", #InputList=StdLooseANNPions, InputList=StdAllNoPIDsPions, Cuts=config['PionCuts']) self.SelKaons = self.createSubSel( OutputList=self.name + "SelKaons", #InputList=StdLooseANNKaons, InputList=StdAllNoPIDsKaons, Cuts=config['KaonCuts']) self.SelProtons = self.createSubSel( OutputList=self.name + "SelProtons", #InputList=StdLooseANNProtons, InputList=StdAllNoPIDsProtons, Cuts=config['ProtonCuts']) %ENDCODE% </sticky> ---+ Adding or modifying tools Stripping =42r9p2= is meant to be used with 2017 data and =44r10p5= with 2016 data. However =TupleToolCorrectedMass= does not exist in the former version but it does in the latter. Therefore you need to add that tool by doing: <sticky> %CODE{ lang="bash" num="0" numstep="2" }% git lb-use Analysis git checkout Analysis/v18r9 Phys/DecayTreeTuple %ENDCODE% </sticky> Now from gitlab you should be able to see the missing tool in =Analysis/v20r9p3= [[https://gitlab.cern.ch/lhcb/Analysis/-/blob/v20r9p3/Phys/DecayTreeTuple/src/TupleToolCorrectedMass.cpp][here]]. Download the =.cpp= and =.h= files and put them in the corresponding folder. Click on the =History= button and see the first commit [[https://gitlab.cern.ch/lhcb/Analysis/-/commit/98d4b5dcb2aaaaf3d77896075e5b7fda63fadda9][here]] You see that not only the file with the class was added, but also the =CMakeLists.txt= was modified to link a library against the =Physics= library in ROOT. So, that modification is also needed. After that change do: <sticky> %CODE{ lang="bash" num="0" numstep="2" }% make configure make %ENDCODE% </sticky> this should build the final version of the code. ---+ Modifying the DaVinci options A working example of an option file that works with the software set up above is [[https://gitlab.cern.ch/r_k/ntupling/-/blob/master/python_r1r2/MCEE/DV_B2Kee_2017.py][here]]. The relevant lines are: <sticky> %CODE{ lang="python" num="27" numstep="2" }% # Imports the stripping builder and the configuration dictionary from the right stripping version and stripping line. from StrippingArchive.Stripping29r2p1.StrippingRD.StrippingB2LLXBDT import B2LLXBDTConf as builder from StrippingArchive.Stripping29r2p1.StrippingRD.StrippingB2LLXBDT import default_config as config #Picks the dictionary with the stripping cuts conf= config['CONFIG'] print(conf) print("---------------") print("---------------") #redefine stripping cuts if RESTRIP and LINE == "bdt": conf['DiElectronCuts']=""" (HASVERTEX) & (VFASPF(VCHI2)<16) & (MM<5.0*GeV) & (INTREE( (ID=='e+') & (PT>200*MeV) & (MIPCHI2DV(PRIMARY)>1.) & (TRGHOSTPROB<0.5) )) & (INTREE( (ID=='e-') & (PT>200*MeV) & (MIPCHI2DV(PRIMARY)>1.) & (TRGHOSTPROB<0.5) )) """ conf['PionCuts' ] ="(PROBNNpi> -1000) & (PT>250*MeV) & (TRGHOSTPROB<0.4)" conf['KaonCuts' ] ="(PROBNNk > -1000) & (PT>300*MeV) & (TRGHOSTPROB<0.4)" conf['ProtonCuts'] ="(PROBNNp > -1000) & (PT>300*MeV) & (TRGHOSTPROB<0.4)" elif RESTRIP and LINE == "cut": conf['PIDe'] = -1000 print(conf) print("---------------") print("---------------") #Create a new stripping from StrippingConf.Configuration import StrippingConf, StrippingStream MyStream = StrippingStream("MyStream") if LINE == "bdt": lb = builder('B2LLXBDT', conf) else: lb = builder('Bu2LLK' , conf) #pick up the old line with redefined selection for line in lb.lines(): if line.name() == 'Stripping' + STR_LINE: print("Appending {}".format(STR_LINE)) MyStream.appendLines([line]) # Configure Stripping from Configurables import ProcStatusCheck filterBadEvents = ProcStatusCheck() sc = StrippingConf( Streams = [ MyStream ], MaxCandidates = 2000, AcceptBadEvents = False, BadEventSelection = filterBadEvents ) %ENDCODE% </sticky> and at the end of the file: <sticky> %CODE{ lang="python" num="372" numstep="2" }% from Configurables import DaVinci, CheckPV, GaudiSequencer, LoKi__HDRFilter #Need to kill old stripping from Configurables import EventNodeKiller eventNodeKiller = EventNodeKiller('Stripkiller') eventNodeKiller.Nodes = [ '/Event/AllStreams', '/Event/Strip' ] DaVinci() DaVinci().EvtMax = -1 DaVinci().PrintFreq = 1000 DaVinci().HistogramFile = 'ROOT.root' DaVinci().Simulation = True DaVinci().Lumi = False #Add killing stripping algorithm DaVinci().appendToMainSequence( [ eventNodeKiller ] ) #Add new stripping DaVinci().appendToMainSequence( [ sc.sequence() ] ) DaVinci().UserAlgorithms = [ tupleee ] DaVinci().VerboseMessages = True DaVinci().DataType = "2017" %ENDCODE% </sticky> ---+ Producing the ntuple After this, to test everything =cd= to the =DaVinciDev_v42r9p2= directory and: <sticky> %CODE{ lang="bash" num="0" numstep="2" }% ./run gaudirun.py DV_B2Kee_2017.py %ENDCODE% </sticky> this should produce the ntuple. -- Main.AngelCampoverde - 2020-04-10
E
dit
|
A
ttach
|
Watch
|
P
rint version
|
H
istory
: r2
<
r1
|
B
acklinks
|
V
iew topic
|
WYSIWYG
|
M
ore topic actions
Topic revision: r2 - 2020-04-10
-
AngelCampoverde
Home
Plugins
Sandbox for tests
Support
Alice
Atlas
CMS
LHCb
Public Webs
Sandbox Web
Create New Topic
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
P
P
P
View
Raw View
PDF version
Print version
Find backlinks
History
More topic actions
Edit
Raw edit
Attach file or image
Edit topic preference settings
Set new parent
More topic actions
Account
Log In
Cern Search
TWiki Search
Google Search
Sandbox
All webs
E
dit
A
ttach
Copyright &© 2008-2021 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
or Ideas, requests, problems regarding TWiki? use
Discourse
or
Send feedback