CMS Analysis Grimoire

Concepts Technicalities Particular Subjects
CMS Software Obtaining Events High Energy Physics
Monte Carlo Simulation Event Displays  
Collision Data cmsRun Configuration SUperSYmmetry
Event Reconstruction Analysis Code  
Data Tiers Running Jobs
  ROOT Tricks Miscellanea
  Common Code Faults  
  Computing At cmslpc  


CMS Software

Monte Carlo Simulation

Collision Data

Event Reconstruction

    • Various information about the detector e.g. alignment, beam spot location, jet energy scales, and other detailed calibration constants etc. are run- (time-) dependent, and must therefore be kept in a database, and require some kind of time tagging in order to look up. Selection of this database is done via the "global tag".
    • You need to use the correct global tag in your cmsRun configuration file, especially if performing any of the following tasks:
      • Re-reconstruction of objects from basic detector info (caloTowers, ...).
      • b-tagging and other tasks where alignment info is used.
      • Accessing info that depends on running conditions (geometry, jet energy corrections (JEC), ...).
    • Typically you can just take the newest global tag appropriate for data or MC (depends on the sample you're processing), and which is valid for the software version that you're using.
      • Global tags are cumulative, so a newer global tag will typically be valid even for older data runs, although the situation is more complicated for MC samples.
    • There is a specific recommendation for global tags to use for JEC.
    • Example to specify a global tag in your cmsRun config file:
    if isData:  process.GlobalTag.globaltag = 'GR_R_42_V12::All'
    else:       process.GlobalTag.globaltag = 'START42_V12::All'
    print " ++  globalTag           =", process.GlobalTag.globaltag.value()
    ( The isData value is something you have to determine yourself. )
  • Current Jet Energy Correction techniques include pile-up subtraction using L1fastjet.

Data Tiers


Obtaining Events

  • The list of all available datasets are available via the DBS data discovery page, or more recently the Data Aggregation System (DAS).
    • The file mover service lets you download any file known to DBS, via a web interface.
    • If you know the address of a storage element that hosts the file that you want, it is often much faster to download it directly from a terminal. You can do this with either the srmcp (mostly requires the v2 protocol now) or lcg-cp commands. Which one works sometimes depends on the site.
      • A list of site URLs...
      • The following is a list of known prefixes to go before the LFN name ( typically /store/... ) in order to download from various sites:
    Site Storage element prefix lcg-cp srmcp
    Aachen srm:// DONE DONE
    Gridka srm:// Question DONE
    UCSD srm:// DONE DONE
      srm:// DONE DONE
    IN2P3 srm:// Question DONE
    INFN srm:// Question DONE
    CERN srm:// DONE No
    CNAF srm:// Question DONE
    FNAL srm:// Question DONE
    DESY srm:// DONE DONE
    MAITE srm:// Question DONE
    UFL srm:// Question DONE
    BARI srm:// Question DONE
    UK (IC) srm:// Question DONE
    Florida srm:// Question DONE
    Vienna srm:// Question DONE
    RAL srm:// Question DONE
    Please help fix/add to this list -- it seems to become deprecated easily!
      • Example of downloading via srmcp -- note that local files require four (!) slashes after the URL file:////:
    srcmp -debug -2 "srm://" "file:///${PWD}/official_data.root"
    srcmp -debug -2 "srm://" "file:///${PWD}/private_data.root"
    ( srmcp might sometimes not succeed without the -debug option. Don't ask why. )
      • Example of downloading via lcgcp:
    lcg-cp -b -D srmv2 -v "srm://" "file:///${PWD}/official_data.root"
    lcg-cp -b -D srmv2 -v "srm://" "file:///${PWD}/private_data.root"
      • For downloading from FNAL dCache from a cmslpc terminal, it can be faster to use dccp (also doesn't require a GRID certificate):
    dccp /pnfs/cms/WAX/11/store/lfn/path/ $PWD
    dccp /pnfs/cms/WAX/resilient/username/ $PWD
    dccp dcap:// $PWD
  • To get a few particular events...
  • To merge EDM files...

Event Displays

  • Fireworks is an event display program that can run on your laptop.
    • The MaskedECALProducer plugin creates an EcalRecHitCollection which contains one recHit per masked channel. The "energy" of each recHit corresponds to the channel status divided by 10. You can obtain this by checking out:

      cd $CMSSW_BASE/src
      cvs co -d RecoParticleFlow/PostProcessing UserCode/RecoParticleFlow/PostProcessing

      and running the following module in a job that skims out events of interest:

      process.customProducts  = cms.Path( process.maskedECALProducer )

      You have to save the products in your event content to be able to load it in Fireworks:

      process.out.outputCommands.append('keep *_maskedECALProducer_*_*')

cmsRun Configuration

Analysis Code

Running Jobs

ROOT Tricks

  • For debugging purposes, it is often useful to see whether your ROOT file actually contains filled branches, and whether the contents of those branches make sense. This is especially true if you're trying to create and save your own products.

    First of all, the EDM products probably require some dictionaries to be loaded before ROOT can interpret their contents. You can do this by ensuring that you have a rootlogon.C macro in the current directory with at least the following contents:

    Of course this means that you must have performed cmsenv in an appropriate CMSSW location.

    You can then load your EDM file in an interactive session:

    root -b myrootfile.root

    If you execute the .ls command, you will see the trees contained in your file. For a standard EDM file this will be:

      KEY: TTree    MetaData;1
      KEY: TTree    ParameterSets;1
      KEY: TTree    Parentage;1
      KEY: TTree    Events;1
      KEY: TTree    LuminosityBlocks;1
      KEY: TTree    Runs;1
    The Events tree contains per-event data, and the LuminosityBlocks and Runs trees contain data that are only stored per luminosity block or run.

    You can see the list of branches for a tree of your choice via TTree::Print(), which also accepts wildcards:


    This for example produces:

    *Tree    :Events    :                                                        *
    *Entries :     6840 : Total =      1458855009 bytes  File  Size =  221062271 *
    *        :          : Tree compression factor =   6.60                       *
    *Branch  :recoVertexs_offlinePrimaryVertices__RECO.                          *
    *Entries :     6840 : BranchElement (see below)                              *
    *Br    0 :recoVertexs_offlinePrimaryVertices__RECO.edm::EDProduct :          *
    *Entries :     6840 : Total  Size=      97626 bytes  File Size  =      15210 *
    *Baskets :        9 : Basket Size=      51200 bytes  Compression=   6.37     *
    *Br    1 :recoVertexs_offlinePrimaryVertices__RECO.present :                 *
    *Entries :     6840 : Total  Size=       8543 bytes  File Size  =       1275 *
    *Baskets :        9 : Basket Size=      51200 bytes  Compression=   6.19     *
    *Br    2 :recoVertexs_offlinePrimaryVertices__RECO.obj :                     *
    *Entries :     6840 : Total  Size=   58955811 bytes  File Size  =    7004211 *
    *Baskets :      491 : Basket Size=   25600000 bytes  Compression=   8.42     *

    Typically the branches containing .obj correspond to the content fields. You can print out their contents for a few objects/events via TTree::Scan():


    Note the second syntax, where you can use the @ prefix in order to address properties of a container ( here a std::vector<reco::Vertex> ) instead of the constituent objects.

Common Code Faults

Computing At cmslpc

Particular Subjects

High Energy Physics

  • The Particle Data Group produces several staple references ranging from the basics of kinematics, probability and statistics, to techniques for colliders and detectors.
    • In particular the PDGLive page lists the measured and theoretical properties of various particles.



-- SueAnnKoay - 14-Jun-2011

Edit | Attach | Watch | Print version | History: r62 < r61 < r60 < r59 < r58 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r62 - 2013-05-31 - SueAnnKoay
    • 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