Kalanand's November 2009 Log
November 13th
Editing Twiki files in Emacs
Charles Plager has found a way to edit CERN twiki files in emacs instead of the web browser.
Unfortunately, his recipe works for Windows machnies only :(
See details here.
http://home.fnal.gov/~cplager/log/0911/log.html#091113_Editing_Twikis_in_Emacs
November 20th
How to replace special chars like " ' " (Apostrophe) in sed/awk
I have a file called "aaa.txt" with the following content:
... kalanand ' ' ' ' ' ' ' oli ''''' '''' Dave '''''''''' jim
When I try,
sed s/"'"/" "/g aaa.txt
I get:
... kalanand oli Dave jim
The syntax is:
sed s/ / /g
Here the option "/s" tells the sed command to replace a string, and
the option "/g" tells it to make the replacement globally, i.e.,
everywhere in the file.
November 23rd
Dijet mass ratio (central jets/ forward jets)
hc = tfile.Get("CentralDijetMass")
hf = tfile.Get("ForwardDijetMass")
hc.Divide(hf)
hc.GetXaxis().SetRangeUser(453.0,2332.0)
hc.GetYaxis().SetRangeUser(0.0,1.0)
cname = "ratio"
canv = ROOT.TCanvas(cname,cname,400,400)
hc.Draw()
canv.SaveAs(outdir+canv.GetName()+".eps")
canv.SaveAs(outdir+canv.GetName()+".gif")
November 27th
Skim a few data events for display in Fireworks
import FWCore.ParameterSet.Config as cms
process = cms.Process("PICKEVENTS")
process.source = cms.Source ("PoolSource",
fileNames = cms.untracked.vstring(
'file:mydatafile.root'
),
eventsToProcess = cms.untracked.VEventRange('140331:384695957') #run:event
)
process.Out = cms.OutputModule("PoolOutputModule",
outputCommands = cms.untracked.vstring('keep *'),
fileName = cms.untracked.string('select.root')
)
process.e = cms.EndPath(process.Out)
process.maxEvents = cms.untracked.PSet( input = cms.untracked.int32(-1) )
Go to October's log
Last modified: Tue Nov 27 19:47:58 CST 2009