Misc. Software anc computing notes / howtos


  • Avoid autogeneration of Dict: since version 5.22

CINT can now autmatically generate dictionary for templated classes, e.g. A < B > if the header file for A and B is known. This allows to interpret vector by transparently generating a dictionary for it. This feature can be toggeled on or off by ".autodict".


  • Installing CMSSW instruction

source $VO_CMS_SW_DIR/$SCRAM_ARCH/external/apt/0.5.15lorg3.2-CMS3/etc/profile.d/init.csh apt-get update apt-get install cms+cmssw+CMSSW_2_1_8

  • CAF
bsub -Is -q cmsinter bash
  • reco::BeamSpot process.load("RecoVertex.BeamSpotProducer.BeamSpot_cfi") e aggiungi process.offlineBeamSpot alla Sequence
  • Find the name of a product edmDumpEventContent [file.root] | grep PixelDigi
  • Dump Full Cfg Add these lines at the end of your py
temp = process.dumpPython() outputfile = file("merdaputtanatroia.py",'w') outputfile.write(temp) outputfile.close() and then python [your_cfg.py]
  • lib in symlink There is a way with SCRAM to put your lib/ directory in another area and then use symlinks. One makes a file like this:
[ewv@vaandering ~]$ cat ~/.scramrc/symlinks lib:/uscms_data/d1/$(USER)/$(SCRAM_PROJECTNAME)/$(SCRAM_PROJECTVERSION) tmp:/uscms_data/d1/$(USER)/$(SCRAM_PROJECTNAME)/$(SCRAM_PROJECTVERSION) bin:/uscms_data/d1/$(USER)/$(SCRAM_PROJECTNAME)/$(SCRAM_PROJECTVERSION) and then uses the -s option on scram
  • PAT: per produrle guarda in PhysicsTools/PatAlgos/test/*py, in praticolare patLayer1_fromAOD_full.cfg.py, che produce uno skim con i PAT dentro. Poi puoi runnare sui PATtuple, con un cfg tipo quello in PhysicsTools/StarterKit/test
import ParameterSet.Config as cms process = cms.Process("StarterKit") process.source = cms.Source("PoolSource", fileNames = cms.untracked.vstring( 'file:./PATLayer1_Output.fromAOD_full.root') ) process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(200) )

process.load("PhysicsTools.StarterKit.PatAnalyzerSkeleton_cfi") process.TFileService = cms.Service("TFileService", fileName = cms.string('PatAnalyzerSkeletonHistosFromSkim.root') ) process.p = cms.Path(process.patAnalyzerSkeleton) et voila'

  • Private histogram output file
// Create the root file theFile = new TFile(theRootFileName.c_str(), "RECREATE"); bool dirStat=TH1::AddDirectoryStatus(); TH1::AddDirectory(kTRUE);

// book histogram


  • Iguana py di esempio in : VisDocumentation/VisTutorial/cmssw-ZprimeMuMu_cfg.py
  • EDFilter in outputPath
process.filterPath = cms.Path(process.wfilter * process.wanalyzerFilter ) process.ep = cms.EndPath(process.output) process.output.SelectEvents = cms.untracked.PSet( SelectEvents = cms.vstring('filterPath') )
  • Reconstruction includes Just to be sure that all include are properly set, use
  • Propagator To work with a propagator need also to add include for that service
  • Select Event/Run by range: add the following EDFilter from DPGAnalysis/Skims/ NB: PickEvents (in src) has the path hardcoded!!! edm::FileInPath listruneventstmp("DPGAnalysis/Skims/data/"+listruneventsinpath_);
Fuck! process.pickEvents = cms.EDFilter( "PickEvents", RunEventList = cms.untracked.string("listrunev") ) where "listrunev" is a file as follows: # Format of select file: # # ############################################## # # is either "+" (i.e. keep run/event) or "-" (i.e. reject) # is of type "aaaaaa:bbbbbb". bbbbbb can be also "infty" # is of type "cccccc:dddddd". dddddd can be also "infty" # # By defaults event are rejected. This is equivalent to a # "- 0:infty 0:infty" # at the beginning of the file # # all actions are applied in order, so if an action at line 6 # is in contraddiction to action in line 5, line 6 will be retained and executed. # # All lines with an unrecognized structure will be considered as a comment.

+ 122314:122314 16952773:16952773

  • Which tag have been used to produce a root file?
edmProvDump fileName.root | grep -i globaltag
  • GlobalTag: description can be found Global_Tags_for_Global_Run_data
  • Printout of #events processed static int j=1; if ((_ev%j)==0) { if ((_ev/j)==9) j*=10; cout << "Run:Event analyzed " << event.id().run() << ":" << event.id().event() << " Num " << _ev << endl; }

*Get Integrated Lumi

If you use CRAB: crab -report will tells you just that (if using my private version) or gives you a lumisumamry.json file to be used with lumiCalc.py -i lumiSummary.json delivered If you run interactively, alsays use cmsRun -j fjr.xml ... and then pass the produced fjr.xml to the following script lumiJobReport.py: lumiJobReport.py fjr.xml that will return the integrated luminosity as well as a lumiSummary.json to be used with the previous method. Addendum: you must get the head (or a recent tag) of cvs co RecoLuminosity/LumiDB/

  • How to get the HLT trigger inside one Primary Dataset
This is far from trivial, that's how far I got so far.

    • Select a run you want to know, eg 148822
    • Run
edmConfigFromDB --runNumber 148822 and look at the output: at the beginning you'll see something like: process.streams = cms.PSet( A = cms.vstring( 'BTau', 'Commissioning', ... plus other Stream. You are interested in Stream: A.
    • Suppose you wan to know what is inside PD: Jet
edmConfigFromDB --runNumber 148822 --format streams.list:A.Jet You'll get a list of the HLT path associated to that stream/PD.

  • How to run HLT simulation:
You must start from RAW (or possibly DIGI, to be checked) and run L1 and HLT simulation. The simple way to have a working cfg is to use

cmsDriver , as, eg, like this cmsDriver.py test -s DIGI,L1,HLT:GRun,RECO --conditions START38_V14::All --processName test --no_exec , then you modify your input, add your analysis and you are happy.


* Location from Phedex in [CMSSW] dls_phedex_url = http://cmsweb.cern.ch/phedex/datasvc/xml/prod/


  • Working with CE
    • ls lcg-ls srm://t2-srm-02.lnl.infn.it////pnfs/lnl.infn.it/data/cms/store/user/slacapra/EWK
    • rm (file) lcg-del --nolfc srm://t2-srm-02.lnl.infn.it////pnfs/lnl.infn.it/data/cms/store/user/slacapra/EWK/file
    • rm (multiple files) private script srm-rmdir. Example:
srm-rmdir srm://t2-srm-02.lnl.infn.it:8443/srm/managerv2?SFN=/pnfs/lnl.infn.it/data/cms/store/user/slacapra/EWK_Wanalysis_300_pass2/
    • rm (directory) srmrmdir -recursive=true srm://t2-srm-02.lnl.infn.it:8443/srm/managerv2?SFN=/pnfs/lnl.infn.it/data/cms/store/user/slacapra/EWK
Serve JAVA
    • create directory srmmkdir srm://t2-srm-02.lnl.infn.it:8443/srm/managerv2?SFN=/pnfs/lnl.infn.it/data/cms/store/user/slacapra/EWK
Serve JAVA
  • Come trovare i dati: on DBS you find the LFN, and the name of the site.
Then go to SiteDB go to the hosting site, then [Site Configuration in CVS] then [PhEDEx] and then open storage.xml file. Search in there for lfn-to-pfn protocol="srmv2" and that should be the path to be added in front of LFN to get PFN.
    • Dove sono i dati al CERN lcg-ls srm://srm-cms.cern.ch////castor/cern.ch/cms/store/data/
    • Dove sono i dati al T2_DE_RWTH (Aachen) lcg-ls srm://grid-srm.physik.rwth-aachen.de//pnfs/physik.rwth-aachen.de/cms/phedex/
    • Dove sono i dati al T2_US_MIT srm://se01.cmsaf.mit.edu:8443/pnfs/cmsaf.mit.edu/t2bat/cms/
    • T2_ES_CIEMAT srm://srm.ciemat.es:8443/srm/managerv2?SFN=/pnfs/ciemat.es/data/cms/prod/
    • T2_UK_London_Brunel srm://dc2-grid-64.brunel.ac.uk:8446/srm/managerv2?SFN=/dpm/brunel.ac.uk/home/cms/
    • T1_ES_PIC srm://srmcms.pic.es:8443/srm/managerv2?SFN=/pnfs/pic.es/data/cms/
  • Convert certificate from PEM to P12 openssl pkcs12 -export -in usercert.pem -inkey userkey.pem -out cert.p12 Docs
    • Convert from p12 to pem The first password asked is the one used to save the p12 (from your browser), the second (to be repeated twice in the first command) is the one you'll use to get a certificate
    • openssl pkcs12 -nocerts -in Certificato_2013.p12 -out userkey.pem
    • openssl pkcs12 -clcerts -nokeys -in Certificato_2013.p12 -out usercert.pem
  • Get a certificate proxy: voms-proxy-init --voms cms
  • Query su tag pubblicati da un CE: ldapsearch -x -H ldap://grid-ce5.desy.de:2170 -b mds-vo-name=resource,o=grid

  • Eos dalla grid: lcg-ls srm://srm-eoscms.cern.ch:8443/srm/v2/server?SFN=/eos/cms/store/


  • Java on CMSpd cluster Si pesca da afs . /afs/cern.ch/sw/lcg/external/Java/bin/setup.sh




  • STDout and err modprobe $MODULE >/dev/null 2>&1
  • Set title and prompt in bash:
BLUE="\[\033[0;34m\]" RED="\[\033[0;31m\]" LIGHT_RED="\[\033[1;31m\]" WHITE="\[\033[1;37m\]" NO_COLOUR="\[\033[0m\]" case $TERM in xterm*) TITLEBAR='\[\033]0;\u@\h:\w\007\]' ;; *) TITLEBAR="" ;; esac



  • Mic on EVO The key is to select the correct source from [AV controls]->[Audio]: Live [plughw:1.0]
  • Sound on EVO Close amarok and restart audio
  • Convert PDF 1.4 to 1.3
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.3 -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf


* openafs apt-get install openafs-client openafs-krb5 krb5-user krb5-config apt-get install module-assistant module-assistant prepare openafs-modules module-assistant auto-build openafs-modules dpkg -i /usr/src/openafs-modules-2.6.27-7-generic_1.4.7.dfsg1-6+2.6.27-7.16_i386.deb ./openafs-client start

klog.afs slacapra -cell cern.ch

Edit | Attach | Watch | Print version | History: r2 < r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r2 - 2013-03-25 - StefanoLacaprara
    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    Main All webs login

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