• Q: I defined an "userD3PDBranchesToFill" branch as "meff". While looping over the meff values and channels I got following output:
    here the source code:
    -------------------------
    for (Int_t iMeff=0; iMeff< meff4jValues->size(); ++iMeff) {
        cout << "\n\nMeff= " << meff4jValues->at(iMeff) << endl;
        for (Int_t iCh=0; iCh< meff4jChannels->at(iMeff).size(); ++iCh) {
          cout << " " << meff4jChannels->at(iMeff).at(iCh) << endl;
        }
      }
    
    Here is the output:
    --------------------
    
    Meff= 693016
       4
       j
       1
       l
       e
       p
       C
       S
       C
         

  • A: The error is in the reading code. meff4jValues is a vector of floats. And meff4jChannels is a vector of strings. So what you do in your code above is printing the character of the strings.
For particles, e.g. for a jet, you get a jetChannels branch, formatted as vector of vector of strings, because you have many particles in each event. But for branches defined in the "=userD3PDBranchesToFill=" dictionary you get only one entry per event, and thus you have a vector of strings to store the channels name whose sets of particles were used to compute the quantity. Below a python example of the reading code is provided:
Source code
----------------
for val in enumerate(t.meff4jValues):  # --> it actually stores only one value
        print "val: ", val
        for chan in t.meff4jChannels:
            print "chan: ", chan



Output
--------

val:  315487.78125
chan:  4j1lepCSC
chan:  4j0lepCSC
chan:  3j1lepMediumCutsMTSmaller100GeV
chan:  3j0lepMediumCuts
chan:  DEFAULT
chan:  3j1lepMediumCutsMTBigger100GeV
chan:  2j0lepCSC
chan:  3j0lepCSC
chan:  1lep

Instead, the example below reproduces the error:

Source Code
-----------------
for i,val in enumerate(t.meff4jValues):
        print "val: ", val
        for pr in t.meff4jChannels[i]:
            print "pr: ", pr


Output
---------
val:  315487.78125
pr:  1
pr:  l
pr:  e
pr:  p

-- RiccardoMariaBianchi - 04 Mar 2009

Edit | Attach | Watch | Print version | History: r1 | Backlinks | Raw View | WYSIWYG | More topic actions
Topic revision: r1 - 2009-03-04 - RiccardoMariaBianchi
 
    • 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-2022 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