[Rivet] Advice for unusual truth analysis

Robert King rsbking at gmail.com
Fri Jun 3 16:48:56 BST 2011


Dear Rivet Experts,

This is a again in relation to  my truth analysis where I wish to compare
Jet counts per event with and without MPI on in Sherpa. I haven't been able
to work out how to access the event number. Can anyone offer a pointer? In
case it helps I attach a copy of my analysis code.

Many thanks

Robert

On 30 May 2011 20:35, Robert King <rsbking at gmail.com> wrote:

> Hi Frank,
>
> Thanks very much for pointing this out. I will try this and may contact you
> again if I have problems.
>
> Robert
>
>
> On 30 May 2011 20:24, Frank Siegert <frank.siegert at cern.ch> wrote:
>
>> Hi all,
>>
>> I think you are missing an important point here: As soon as you switch MPI
>> off in the first event, than your second event will look completely
>> different at the ME level because it gets a completely different random
>> number (less random numbers being used if MPI is off).
>>
>> So to really do what you are trying to do, you will need to use a
>> (undocumented) Sherpa feature of writing out random number seeds for *all*
>> events into a file by specifying:
>>
>>  EVENT_SEED_MODE=2
>>  EVENT_SEED_FILE=seeds.txt
>>
>> and then read them in the next run (e.g. with MPI off) by
>>
>>  EVENT_SEED_MODE=1
>>  EVENT_SEED_FILE=seeds.txt
>>
>> To make the seed files smaller, you could also compile Sherpa with
>> --enable-gzip in which case they'll be gzipped.
>>
>> Of course then you'll still need to find a way of comparing these event by
>> event with Rivet as discussed below.
>>
>> Frank
>>
>>
>> On 30/05/11 19:17, Robert King wrote:
>>
>>> Hi,
>>>
>>> Thanks for that suggestion. I have already edited an analysis myself so
>>> I can probably workout how to add a text file output, and then write a
>>> python script that will parse the output of this into some sensible
>>> comparison.
>>>
>>> Cheers
>>>
>>> Robert
>>>
>>> On 30 May 2011 18:01, Daniel Weyh <weyh at physik.hu-berlin.de
>>> <mailto:weyh at physik.hu-berlin.de>> wrote:
>>>
>>>    Hi Robert,
>>>
>>>    I'd guess it will not be possible "on the fly".
>>>    Rivet takes a single HepMC-Event, analyzes it and fills histograms
>>>    with the result.
>>>    For what you want to do, you need to load two events from two
>>>    different sources (I guess Sherpa cannot serve you alternatingly
>>>    with MPI on/off and the same random seed for two consecutive
>>> events)...
>>>
>>>    The solution I have in mind - if you really need event-to-event
>>>    comparison - is a bit dirty (I think) but should work:
>>>    1. In your Rivet analysis create a file-stream as member of your
>>>    analysis (during init). (Remember to close in finalize() ;-) )
>>>    2. Do your analysis. During analyze append the number in question to
>>>    your file (filestream << num_of_jets << endl;)
>>>    3. Run Sherpa another time with same random seed (I guess you know
>>>    how to or check the Sherpa man), output as in 2. but in another file.
>>>    4. Analyze the two text files line by line externally. (<-- question
>>>    to the others: are there python classes in Rivet which make creating
>>>    an .aida by hand painless - to use Rivets plot facilities later on?)
>>>    Or: Change 3 to read from the file created in 2 and store the
>>>    differences in a histogram.
>>>    As always depending on your needs.
>>>    (How often you need it, automated or manually, how many observables
>>>    (if not only #jets)...)
>>>
>>>    The files shouldn't be to big. I guess order(10^6) runs = 10^6 lines
>>>    * (1byte (newline)+10byte (precision fp)) ~ order(10 MB).
>>>
>>>    This procedure requires you to write an analysis on your own (or at
>>>    least to change the one you would have used for single-run).
>>>    I hope this is not a problem for you - otherwise don't hesitate to
>>> ask.
>>>
>>>
>>>    Good luck,
>>>    Daniel
>>>
>>>
>>>    Am 30.05.2011 um 17:54 schrieb Robert King:
>>>
>>>     > Dear Rivet Experts,
>>>     >
>>>     > I have a slightly unusual truth level analysis and I hope you can
>>>    advise me as to whether it is possible in Rivet. I have a limited
>>>    experience with Rivet and it's not clear to me how one would/could
>>>    do this.
>>>     >
>>>     > I would like to generate identical Sherpa samples (i.e. use the
>>>    same random number seeds) one with MPI on and another with it off. I
>>>    would then like to compare event by event the number of jets each
>>> event.
>>>     > Is it possible to do this event by event comparison in Rivet?
>>>     >
>>>     > Many thanks for you advice
>>>     >
>>>     > Robert
>>>     > _______________________________________________
>>>     > Rivet mailing list
>>>     > Rivet at projects.hepforge.org <mailto:Rivet at projects.hepforge.org>
>>>
>>>     > http://www.hepforge.org/lists/listinfo/rivet
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Rivet mailing list
>>> Rivet at projects.hepforge.org
>>> http://www.hepforge.org/lists/listinfo/rivet
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.hepforge.org/lists-archive/rivet/attachments/20110603/15dce88b/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MC_JetMatrix.cc
Type: text/x-c++src
Size: 6706 bytes
Desc: not available
URL: <http://www.hepforge.org/lists-archive/rivet/attachments/20110603/15dce88b/attachment.cc>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MC_myWjetMatrix.cc
Type: text/x-c++src
Size: 4513 bytes
Desc: not available
URL: <http://www.hepforge.org/lists-archive/rivet/attachments/20110603/15dce88b/attachment-0001.cc>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: MC_JetMatrix.hh
Type: text/x-c++hdr
Size: 2280 bytes
Desc: not available
URL: <http://www.hepforge.org/lists-archive/rivet/attachments/20110603/15dce88b/attachment.hh>


More information about the Rivet mailing list