Skim coding tips

Complete: 4


Give some coding guidelines for skim modules


if you specify input collections in the config file please use InputTags instead of strings.

Tracked vs. untracked parameters

There are two possibilites for declarations - untracked and tracked parameters. This is to indicate which parameters change the physics information stored in a file and which don't. One standard example for an untracked parameter would be "bool untracked debug". For tracked an example would be "double muonPTCut". Whether you clean your parameters or not is not too important for CSA07 but during real data taking it will certainly help to understand the used settings.

Logging and messages

Please remove all existing cout statements. They should be replaced by message logger usage: Use the message logger such that you don't give any warnings and errors as long as the module is in normal operation mode. Warning messages like "no 2 muons with needed pT found" don't help here. wink

Error handling

Please avoid structures where you do catch (...), i.e. catching everything. In general, user code shouldn't need to take care of error handling. Just remove such structures from your code. Or in other words - let the framework take care of problems! Most of the error handling I've seen was taking care of missing products. But in none of the cases it made any sense to me. If a product is missing you shouldn't ignore it silently (as done in every instance I've seen) but let the framework know that there is a misconfiguration.

-- BenediktHegner - 09 Aug 2007

Responsible: BenediktHegner

Edit | Attach | Watch | Print version | History: r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r1 - 2007-08-09 - BenediktHegner

    • Cern Search Icon Cern Search
    • TWiki Search Icon TWiki Search
    • Google Search Icon Google Search

    CMSPublic All webs login

This site is powered by the TWiki collaboration platform Powered by PerlCopyright & 2008-2019 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback