• rename patternToReplace replacingPattern fileConcerned

  • chat
write username@!cmslpcnr... return

  • recursive grep
find . | xargs grep whatever

  • when writing a script, to be able to execute it : chmod +x machin.sh

  • sh / csh
csh : > & ! log
sh : >& log 
(no guarantee)

  • CMSSW_4_X_Y
setenv SCRAM_ARCH slc5_amd64_gcc434 
export SCRAM_ARCH=slc5_amd64_gcc434 

  • sed
 sed 's|status|getoutput|' getcrabstuff.log

  • awk
cat log | awk '{print "/pnfs/cms/WAX/11/store/data/Run2011B/L1EGHPF/RAW/v1/000/178/208/" $1}' >log2

  • dbs (obsolete, just keep it for the record of something that was slow but working) :
    find dataset where dataset like */*/RAW and site like *fnal* and run =160497==
    dbsql "find run,block where dataset = /*/Run2011A-PromptReco-v1/RECO and run = 161311"

  • das (just as slow as dbs used to be, even more painful and moody....)
    • webpage
    • command line
            curl -k https://cmsweb.cern.ch/das/cli > das_client.py   (get the scripts wherever you fancy)
            chmod a+x das_client.py 
            ./das_client.py --query="dataset = */Run2011B-09Dec2011-GR_R_44_V11-v1/RECO" --limit=20
    • more details @FAQ
    • a clumsy way to get the script available anywhere :
      • put it under ~
      • edit .aliases (if you have one wink , called by a setup.(c)sh, or something alike, source $HOME/.aliases) : alias das_client.py 'python ~/das_client.py'
Have fun ! stick out tongue

  • pnfs
dccp dcap://cmsgridftp.fnal.gov:24125/pnfs/fnal.gov/usr/cms/WAX/11/store/username/myfile.data $PWD
dccp dcap://cmsgridftp.fnal.gov:24125/pnfs/fnal.gov/usr/cms/WAX/resilient/lucieg/ $PWD
    • read root file on pnfs :
TFile *_file0 = TFile::Open("dcache:/pnfs/cms/WAX/11/store/mc/Fall11/TTJets_TuneZ2_7TeV-madgraph-tauola/AODSIM/RecoTest_PU_S5_START44_V4-v1/0000/5A0021CB-DECF-E011-942F-0018F3D095FA.root")
    • read root files on eos :
TFile *f = TFile::Open("root://eoscms//eos/cms/store/..

    • recursive ls on eos : xrd eoscms dirlistrec /eos/cms/store/...


  • submit batch jobs
bsub -q 1nd -J job1 < runJobTrigger.sh

  • start crab on lxplus
source /afs/cern.ch/cms/ccs/wm/scripts/Crab/crab.sh

  • kill all jobs
bkill 0 -u username

  • multiple output files for crab : output_file = file0.root, file1.root ...

  • input sandbox size is larger than the allowed input sandbox limit : crab doesn't like sitting in test, prod... directories, crab feels better in its own directory, e.g., unders $CMSSW_BASE/src (or anywhere else you like) :
mkdir crab
cd crab
put there : the cfg.py to run, crab.cfg, json file to use = the bare minimum crab needs to run ! 

cmssw &co

check what does this do...?
edmConfigFromDB --orcoff --configName /cdaq/physics/Run2010/v2.2/HLT_4E29_PRE2/V1 |hltDumpStream >cdaq-physics-Run2010-v2.2-HLT_4E29_PRE2-V1
edmConfigFromDB --orcoff --configName /cdaq/physics/Run2010/v2.2/HLT_4E29_PRE5/V2 |hltDumpStream > cdaq-physics-Run2010-v2.2-HLT_4E29_PRE5-V2
find /pnfs/cms/WAX/resilient/lucieg/Commish2010/r148819__MuOnia_Run2010B-v1__20101111_1421/ -mtime +2 -exec ls -all {} \;

  • dump event content within cfg : = process.dump = cms.EDAnalyzer("EventContentAnalyzer") =

  • read 2 sets of files with different datatiers (from there)
process.source = cms.Source("PoolSource",

    # main data tier to run on (e.g. RECO)
    fileNames = cms.untracked.vstring(...),
    # these should be a 'parent' data tier
    # e.g. simhits when the other files are rechits
    secondaryFileNames = cms.untracked.vstring(...),


  • figure out tag used for prod : logger.py logger.tgz...


  • merge root files
hadd result.root file1.root file2.root file3.root ...
  • two stat boxes : sames


  • "forcing" emacs syntax
Esc+x MODE-mode (MODE = python, etc...)



  • File transfer, uscms...


migrate-cvsroot . /local/reps/CMSSW

-- LucieGAUTHIER - 25-Mar-2011

Edit | Attach | Watch | Print version | History: r20 < r19 < r18 < r17 < r16 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r20 - 2013-07-22 - LucieGAUTHIER
    • 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