Thursday, May 12, 2011

diff two commands

Sometimes it's useful to grep a piece of a file, or tail the end, and compare that with a piece of another file.

The syntax is:
diff <(command1) <(command2)

For example,
diff <(grep float myCode1.C) <(grep float myCode2.C)
Will diff the outputs of the respective commands
grep float myCode1.C and grep float myCode2.C

Adding pdfs at the command line

gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=finished.pdf file1.pdf file2.pdf

Monday, November 22, 2010

CRAB output to group's /store/user space

This CRAB config shows how to output your task for publishing to a group /store/user space instead of your personal /store/user space. There was poor documentation here. But this is the working config I have now.

Notice lpcgg is the group space name at FNAL.
This file outputs to this directory (the parts in red are automagically created, and I have no control over them):
/pnfs/cms/WAX/11/store/user/lpcgg/miceli/Photon/PhotonSkim_Run2010B-Nov4ReReco_v1_146240-147829/3c009990a403ffefbef1d67824f3333a/


[CRAB]
jobtype = cmssw    
#scheduler = glidein
scheduler = glite
use_server = 0


[CMSSW]
#lumi_mask = July4.json
datasetpath = /Photon/Run2010B-Nov4ReReco_v1/RECO
pset = monophoton_skimmer_38x_cfg.py
#total_number_of_events = -1
#events_per_job = 10000
total_number_of_lumis = -1
number_of_jobs = 400
output_file = phoskim.root
runselection = 146240-147829


[USER]
srm_version = srmv2
debug_wrapper = 1
storage_path            = /srm/managerv2?SFN=/11
user_remote_dir = /store/user/lpcgg
ui_working_dir = /uscms/home/miceli/scratch/data/PhotonSkim_Run2010B-Nov4ReReco_v1_146240-147829_good
return_data = 0
copy_data = 1
eMail = miceli@fnal.gov
storage_element = cmssrm.fnal.gov
publish_data = 1
publish_data_name = PhotonSkim_Run2010B-Nov4ReReco_v1_146240-147829
dbs_url_for_publication = https://cmsdbsprod.cern.ch:8443/cms_dbs_ph_analysis_01_writer/servlet/DBSServlet

Adding Classes to ROOT Macros

This is an example of the things one needs to do to write classes to compile with your root macros. This is how to add a class to ROOT.

test.C is an example macro. It uses MyClass.C and MyClass.h.

In the case this causes you problems, feel free to let me know of your solution.
I'm using ROOT version 5.25/04 on Mac OS X 10.6.5.

Monday, November 15, 2010

Space usage at FNAL store/user space

dcdu -sh /pnfs/cms/WAX/11/store/user/miceli
will give how much space miceli is using.

Monday, November 8, 2010

2d histogram with projections

This ROOT macro takes in a 2d histogram and plots it with the projections all on one canvas then saves it as a pdf.

It also uses this style macro from CMS.