TWiki
>
LHCb Web
>
LHCbComputing
>
RichSoftware
>
RichSoftwareCalib
>
PIDSamplePrepare
(revision 7) (raw view)
Edit
Attach
PDF
---+!! Instructions on Preparing PIDCalib Samples This page provides information on how to create PIDCalib samples. It is for experts only. %TOC% ---+++ Latest PIDCalib setup instructions Please follow the instructions on [[PIDCalibPackage][PIDCalib Package]] webpage. Besides the above, you also need to %CODE{ lang="bash" num="off" }% getpack PIDCalib/CalibDataSel head %ENDCODE% ---+++ CalibDatSel Package: Produce tuples from DST The files you need now boil down to: Src/TupleToolPIDCalib.cpp TupleToolPIDCalib.h EvtTupleToolPIDCalib.cpp EvtTupleToolPIDCalib.h These are places to put Tuple variables. And dev/makePIDCalibNtuples.ganga.py makePIDCalibNtuples_Run2.py makePIDCalibNtuples.py makePIDCalibNtuples.py is for Run 1 where the input is various stripping lines makePIDCalibNtuples_Run2.py is for Run2 where the input is various trigger lines and this matching needs to be done too. makePIDCalibNtuples.ganga.py simply runs the jobs. (I think you will need to update the DV version listed). In dev/makePIDCalibNtuples.ganga.py, add %CODE{ lang="bash" num="off" }% S5TeVdn = PIDCalibJob( year = "2015" , stripVersion = "5TeV" , magPol = "MagDown" , maxFiles = -1 , filesPerJob = 1 , simulation = False , EvtMax = -1 , bkkQuery ="LHCb/Collision15/Beam2510GeV-VeloClosed-MagDown/Real Data/Reco15a/Turbo01aEM/95100000/FULLTURBO.DST" , bkkFlag = "OK" , stream = "Turbo" , backend = Dirac() ) %ENDCODE% Then execute the file inside ganga: %CODE{ lang="bash" num="off" }% In [5]:execfile('makePIDCalibNtuples.ganga.py') Preconfigured jobs you can just submit: . PIDCalib.up11.submit() . PIDCalib.validation2015.submit() . PIDCalib.up12.submit() . PIDCalib.down11.submit() . PIDCalib.S23r1Up.submit() . PIDCalib.down12.submit() . PIDCalib.S5TeVdn.submit() . PIDCalib.test.submit() . PIDCalib.S23r1Dn.submit() --------------------- In [6]:PIDCalib.S5TeVdn.submit() %ENDCODE% After all jobs finished, you may need to download them to local directory (not sure if needed) %CODE{ lang="bash" num="off" }% In [6]:for js in j.subjobs: ...: if js.status == 'completed': ...: js.backend.getOutputData() %ENDCODE% ---+++ CaibDataScripts: Produce tuples for each particles The RICH performance changes as a function of time (depends on conditions and alignment changes). A RooDataSet can only hold so many events and variables before it becomes too large and wont save correctly. Both of these facts leads us to have a) more than one file per decay channel and b) the numerical index of each file ascends with run number. This is useful so that if someone wants to run over a specific run period they can just select the few relevant files. Hence this means that the workflow goes like this: Ntuples finish making --> Run ranges are defined -- > Data split into those specific run ranges -- > any additional selection applied -- >mass fit performed in each run range for each charge -- > data is sWeighted --> spectator variables are added to the data set --> both charge datasets are merged . The same set of steps is repeated for each decay channel. For the protons, since there is more than one momentum range the fit is done separately in each range and then merged. For D*->D(Kpi)pi the data the definition of the run range and the data splitting is a common step for both K and pi, however the mass fits and are done twice (even though it is the same fit). First, get the package: %CODE{ lang="bash" num="off" }% getpack PIDCalib/CalibDataScripts head %ENDCODE% Inside, There are 3 src directories Src for S20/S0r1 data Src_S21 for S21 Src_Run2 for S22/23 The reason for different directories is due to changes in the ntuple format/naming conventions and changes in stripping cuts, which changed the selection cuts subsequently applied. Also the variables stored in the calibration datasets has also changed as a function of time. E.g for Run 2 we save online and offline variables. In cmt/requirements The first step is to choose the correct src directory to compile. This is just done by changing src directory to your corresponding one (except that of SetSpectatorVars.cpp) Then the usual %CODE{ lang="bash" num="off" }% cmt br cat make %ENDCODE% Then go to jobs/Stripping23 and modify configureGangaJobs.sh Before submitting jobs to PBS, you need to do the following to make it recognize you: add the following lines in ~/.gangarc %CODE{ lang="bash" num="off" }% preexecute = import os env = os.environ jobid = env["PBS_JOBID"] tmpdir = None if "TMPDIR" in env: tmpdir = env["TMPDIR"].rstrip("/") else: tmpdir = "/scratch/{0}".format(jobid) os.chdir(tmpdir) os.environ["PATH"]+=":{0}".format(tmpdir) postexecute = import os env = os.environ jobid = env["PBS_JOBID"] tmpdir = None if "TMPDIR" in env: tmpdir = env["TMPDIR"].rstrip("/") else: tmpdir = "/scratch/{0}".format(jobid) os.chdir(tmpdir) %ENDCODE% make sure you have the above lines everytime you run jobs. and then go to GetRunRanges/ Here you will see a set of scripts, one for each polarity, one for each particle species. You shouldnt need to change anything it will look inside your .gangarc file to find your gangadir location etc etc. the output of these jobs gets sent to the jobs/Stripping23/ChopTrees directory as a .pkl file. This file contains the run number ranges that the script which this script calls defines. The file that is actually run by the ganga job is $CALIBDATASCRIPTSROOT/scripts/sh/GetRunRanges.sh which in turn calls $CALIBDATASCRIPTSROOT/scripts/python/getRunRanges.py for Dst and Jpsi. All this script does is look at your tuples, see how the candidates are distributed by runnumber and then split into an number of ranges such that each range contains about a million candidates but avoids the last dataset having too few. do %CODE{ lang="bash" num="off" }% ganga ganga_gp_getRunRanges_Dst_MagDown.py %ENDCODE% Please change Stripping version accordingly. This is just a one-subjob ganga job. The ganga version works is v600r44, please check if there are other versions. after that, go to ../ChopTrees and do %CODE{ lang="bash" num="off" }% ganga ganga_gp_chopTrees_Dst_MagDown.py %ENDCODE% Please also change stripping version if needed. This will create a list of jobs on batch and could be viewed by qstat All this script does is call $CALIBDATASCRIPTSROOT/scripts/sh/ChopTrees.sh which in turn calls $CALIBDATASCRIPTSROOT/scripts/python/ChopTrees.py. All this does is look at the .pkl file in ChopTrees from the previous step. It then goes into your gangadir/jobdir. It loops over all the subjobs. In each subjob it creates a different file for each run range. So for example before you do this the only root file in directory would be PIDCalib.root. Once youve finished this stage it will look more like this: PID_0_dst_k_and_pi.root etc. Youll notice that most of the files are empty since that ganga sub jobs didnt contain any runs that fall into run range x etc. Thats not a problem, but this is why you need to run the job at oxford since there is a lot of diskspace. ---+++ Fit, sWeight and final tuples In CalibDataScripts/jobs/Stripping5TeV/Dst, Lam0, Jpsi, so run corresponding codes to get calibration samples. The produced file is in the location setting in configureGangaJobs.sh and it looks like: CalibData_2015/MagDown/K, pi, Mum p etc. ---+++ User scripts The corresponding PID production should be added into user scripts so that they can be recognized. ---+++ Upload files The file used is $CALIBDATASCRIPTSROOT/scripts/python/uploadData.py The following things are needed to be changed: prefix, test change to user scripts -- Main.WenbinQian - 2016-03-17
Edit
|
Attach
|
Watch
|
P
rint version
|
H
istory
:
r23
|
r9
<
r8
<
r7
<
r6
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r7 - 2016-03-21
-
WenbinQian
Log In
LHCb
LHCb Web
LHCb Web Home
Changes
Index
Search
LHCb webs
LHCbComputing
LHCb FAQs
LHCbOnline
LHCbPhysics
LHCbVELO
LHCbST
LHCbOT
LHCbRICH
LHCbMuon
LHCbTrigger
LHCbDetectorAlignment
LHCbTechnicalCoordination
LHCbUpgrade
Public webs
Public webs
ABATBEA
ACPP
ADCgroup
AEGIS
AfricaMap
AgileInfrastructure
ALICE
AliceEbyE
AliceSPD
AliceSSD
AliceTOF
AliFemto
ALPHA
ArdaGrid
ASACUSA
AthenaFCalTBAna
Atlas
AtlasLBNL
AXIALPET
CAE
CALICE
CDS
CENF
CERNSearch
CLIC
Cloud
CloudServices
CMS
Controls
CTA
CvmFS
DB
DefaultWeb
DESgroup
DPHEP
DM-LHC
DSSGroup
EGEE
EgeePtf
ELFms
EMI
ETICS
FIOgroup
FlukaTeam
Frontier
Gaudi
GeneratorServices
GuidesInfo
HardwareLabs
HCC
HEPIX
ILCBDSColl
ILCTPC
IMWG
Inspire
IPv6
IT
ItCommTeam
ITCoord
ITdeptTechForum
ITDRP
ITGT
ITSDC
LAr
LCG
LCGAAWorkbook
Leade
LHCAccess
LHCAtHome
LHCb
LHCgas
LHCONE
LHCOPN
LinuxSupport
Main
Medipix
Messaging
MPGD
NA49
NA61
NA62
NTOF
Openlab
PDBService
Persistency
PESgroup
Plugins
PSAccess
PSBUpgrade
R2Eproject
RCTF
RD42
RFCond12
RFLowLevel
ROXIE
Sandbox
SocialActivities
SPI
SRMDev
SSM
Student
SuperComputing
Support
SwfCatalogue
TMVA
TOTEM
TWiki
UNOSAT
Virtualization
VOBox
WITCH
XTCA
Welcome Guest
Login
or
Register
Cern Search
TWiki Search
Google Search
LHCb
All webs
Copyright &© 2008-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