Project VIPER

The intention of this package is to provide examples of how to work with the IT code in python and ROOT. The scripts are not well maintained and will degrade with time. Use at your own risk. I also put some fragments of python for useful tasks.

Nota Bene

  • wikimat is anti-python and therefore changed the names of all the scripts from xxx.py to xxx.py.txt
  • Useful how to guides and some scripts can be found here

ST performances (LHCb-INT-2014-015)

All the scripts needed to reproduce these results can be found here. README files are available for further technical details.

Tracker vertical alignment (LHCb-INT-2014-016)

All the scripts needed to reproduce these results can be found here. README files are available for further technical details.

Example Python Scripts

Script Purpose Comments
itDet_example.py.txt Using the IT detector element  
ttDet_example.py.txt Using the TT detector element  
names_example.py.txt Channels to strings with IT/TTNames  
dq_example.py.txt Running the piquet DQ algorithm  
decoding_example.py.txt Running the IT decoding  
ttChargeCalib_example.py.txt TT charge calibration Needs ttcal.txt, Needs pretty.xsl
chargeCalib_example.py.txt IT charge calibration Needs itcalib.txt , Needs pretty.xsl
magnetProbe.py.txt Example of getting the magnetic field  
fitit.py.txt Example of getting tracks in the IT and making a refit  
occ_example.py.txt Example of making the IT/TT occupancy plots Macros to analyse output available below
fitit.py.txt Example of dumping the IT/TT geometry  
fitit.py.txt Running the STPerformanceMonitor  
status.py.txt Writing out the ST status conditions Needs pretty.xsl
maskBeetle.py.txt Disabling a Beetle Needs pretty.xsl
lazarus.py.txt Flipping state of set of Beetles Needs pretty.xsl
killVCSELs.py.txt Killing set of VCSELs Needs pretty.xsl

Python Fragments

Configuring the position tool via python

# early data
from STTools import STOfflineConf 
STOfflineConf.EarlyDataConf().configureTools()
# default conf
from STTools import STOfflineConf 
STOfflineConf.DefaultConf().configureTools()

Filtering clusters on status of Beetles

# configure an IT cluster killer
itLiteKiller = STLiteClusterKiller('ITLiteKiller')
itLiteKiller.DetType = "IT"
itLiteKiller.SelectorType = "STSelectChannelIDByStatus"

itLiteKillerTool = STSelectChannelIDByStatus("ToolSvc.ITLiteKiller")
itLiteKillerTool.DetType = "IT"
itLiteKillerTool.allowedStatus = ["ReadoutProblems"]

Filtering clusters on S/N

Plug this after the ST clusters have been created (either by the RawBankToSTClusterAlg or the STClusterCreator):
# configure an IT cluster killer
itClusterKiller = STClusterKiller('ITKillerAlg')
itClusterKiller.DetType = "IT"
itClusterKiller.SelectorType = "STSelectBySN"
itKillerTool = STSelectBySN('ToolSvc.ITKiller')
itKillerTool.minSN = 0
itKillerTool.maxSN = 5
itKillerTool.DetType = "IT"
Clusters failing the criteria will be deleted from the container

Using rootlogon in pyROOT

import ROOT, os
ROOT.gROOT.Macro( os.path.expanduser( '~/rootlogon.C' ) )

Accessing methods in a base class

In the C++ I have a DeTTDetector that derives from DeSTDetector, I want to use a method findSector that is a member of DeSTSector. Unfortunately in the derived class there is a method with the same name but different signature which python has difficultly with. To work around
TT   = det['/dd/Structure/LHCb/BeforeMagnetRegion/TT']
sec = TT.__class__.__bases__[0].findSector(TT,stid)
Alternatively:
TT   = det['/dd/Structure/LHCb/BeforeMagnetRegion/TT']
TT_base = super( TT.__class__, TT )
sec = TT_base.findSector( stid )

Example ROOT macros

Occupancy related

Manipulate histograms made by ITClusterOccupancy, TTClusterOccupancy etc

nclus.C Compare # of clusters in data/MC MC reference histograms , Data reference histograms
occanalysis.C Making IT/TT occupancy plot for layer MC reference histograms , Data reference histograms
itoccall.C Making a ps of IT occupancy maps in data and MC MC reference histograms , [https://twiki.cern.ch/twiki/pub/LHCb/LHCbSTViper/datafile.root][Data reference histograms]] , Example output

Resolution related

Manipulate histograms made by ITTrackMonitor, TTTrackMonitor etc

biasplot.C IT sector bias plots Example root file
resplot.C IT sector resolution plots Example root file
ttbias.C TT sector bias plots Example root file
ttres.C TT sector resolution plots Example root file

Performance

plotITA.C IT Status versus time [June 2010]
plotTTA.C TT Status versus time [June 2010]

Manipulate histograms made by STPerformanceMonitor

itactiveplot.C IT Status perf.root
ttactiveplot.C TT Status perf.root

-- MatthewNeedham - 22-Apr-2010

Topic attachments
I Attachment History Action Size Date Who Comment
Unknown file formatgz STTrackMonitor-HitEfficiency.tar.gz r1 manage 25.6 K 2014-07-04 - 15:04 FredericDupertuis STTrackMonitor-HitEfficiency (Frederic Dupertuis)
Unknown file formatgz TrackerYAlignment.tar.gz r1 manage 921.7 K 2014-07-04 - 15:05 FredericDupertuis TrackerYAlignment (Frederic Dupertuis)
C source code filec biasplot.C r1 manage 3.9 K 2010-06-15 - 10:34 MatthewNeedham  
Texttxt chargeCalib_example.py.txt r1 manage 2.1 K 2010-04-22 - 17:30 MatthewNeedham  
Unknown file formatroot datafile.root r1 manage 1378.2 K 2010-06-20 - 09:45 MatthewNeedham  
Texttxt decode_example.py.txt r1 manage 2.1 K 2010-04-22 - 17:29 MatthewNeedham  
Texttxt dq_example.py.txt r1 manage 3.0 K 2010-04-22 - 17:29 MatthewNeedham  
Texttxt fitit.py.txt r1 manage 7.7 K 2010-05-02 - 10:47 MatthewNeedham  
Texttxt geomDump.py.txt r1 manage 1.5 K 2010-05-06 - 15:29 MatthewNeedham  
Unknown file formatroot it5.root r1 manage 2727.3 K 2010-06-15 - 10:34 MatthewNeedham  
Texttxt itDet_example.py.txt r1 manage 0.7 K 2010-04-22 - 17:27 MatthewNeedham  
C source code filec itactiveplot.C r1 manage 1.8 K 2010-06-18 - 15:08 MatthewNeedham  
Texttxt itcalib.txt r1 manage 5.2 K 2010-04-22 - 17:31 MatthewNeedham  
Postscriptps itocc.ps r1 manage 527.9 K 2010-05-30 - 09:23 MatthewNeedham  
C source code filec itoccall.C r1 manage 3.4 K 2010-05-22 - 10:56 MatthewNeedham  
Texttxt killVCSELs.py.txt r1 manage 2.1 K 2010-07-12 - 15:28 MatthewNeedham  
Texttxt lazarus.py.txt r1 manage 2.0 K 2010-07-12 - 15:28 MatthewNeedham  
Texttxt magnetProbe.py.txt r1 manage 2.5 K 2010-04-29 - 13:54 JeroenVanTilburg Example of getting the magnetic field
Texttxt maskBeetle.py.txt r1 manage 2.6 K 2010-07-09 - 11:43 MatthewNeedham  
Unknown file formatroot myfile.root r1 manage 1393.7 K 2010-05-25 - 13:57 MatthewNeedham  
Texttxt names_example.py.txt r1 manage 1.1 K 2010-04-22 - 17:29 MatthewNeedham  
C source code filec nclus.C r1 manage 2.1 K 2010-06-20 - 09:46 MatthewNeedham  
Texttxt occ_example.py.txt r1 manage 4.8 K 2010-05-06 - 15:30 MatthewNeedham  
C source code filec occanalysis.C r1 manage 2.4 K 2010-06-20 - 09:46 MatthewNeedham  
Unknown file formatroot perf.root r1 manage 19.6 K 2010-06-18 - 15:14 MatthewNeedham  
Texttxt performance.py.txt r1 manage 1.6 K 2010-05-06 - 15:30 MatthewNeedham  
C source code filec plotITA.C r1 manage 1.7 K 2010-06-15 - 11:31 MatthewNeedham  
C source code filec plotTTA.C r1 manage 1.6 K 2010-06-15 - 11:31 MatthewNeedham  
XSL (XML style sheet)xsl pretty.xsl r1 manage 0.3 K 2010-06-01 - 11:01 MatthewNeedham  
C source code filec resplot.C r1 manage 4.7 K 2010-06-15 - 10:34 MatthewNeedham  
Texttxt status.py.txt r1 manage 1.6 K 2010-06-01 - 11:02 MatthewNeedham  
Unknown file formatroot tt5.root r1 manage 3324.2 K 2010-06-15 - 16:52 MatthewNeedham  
Texttxt ttDet_example.py.txt r1 manage 0.9 K 2010-04-22 - 17:28 MatthewNeedham  
C source code filec ttactiveplot.C r1 manage 3.6 K 2010-06-18 - 15:09 MatthewNeedham  
C source code filec ttbias.C r1 manage 2.3 K 2010-06-15 - 16:55 MatthewNeedham  
Texttxt ttcal.txt r1 manage 4.5 K 2010-04-22 - 17:31 MatthewNeedham  
Texttxt ttchargeCalib_example.py.txt r1 manage 2.1 K 2010-04-22 - 17:30 MatthewNeedham  
C source code filec ttres.C r2 r1 manage 2.7 K 2010-06-15 - 16:51 MatthewNeedham  
Edit | Attach | Watch | Print version | History: r23 < r22 < r21 < r20 < r19 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r23 - 2014-07-04 - FredericDupertuis
 
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    LHCb All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-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