Roel Aaij | 2 Jan 2010 14:12
Picon
Picon

[ROOT] Persistency of custom container

Dear all,

As an excersise, I have created my own container. Which steps do I need
to take to ensure I can persistify it correcly, including it's contained
elements?

The container contains pointers to objects, for which Reflex reflection
information is available.

If this is very complicated, I'll create a wrapper around an std::vector
that suits my needs.

Greetings, Roel

Axel Naumann | 2 Jan 2010 14:40
Picon
Picon

Re: [ROOT] gccxml or genreflex updates needed for gcc 4.4?

Hi Peter,

happy new year!

I'm using the trunk of GCCXML and genreflex with GCC 4.4.1 without 
problems. I'll test next week whether GCCXML 0.9.0_20081130 is enough. 
As far as I know GCCXML didn't change much in 2009, though.

Cheers, Axel

On 2009-12-28 09:10, Peter Elmer wrote:
>    Hi,
>
>    Are there any gccxml updates needed for gcc 4.4.x? It looks like we
> are using gccxml 0.9.0_20081130 at the moment for gcc 4.3.4.
>
>    In addition, were there any updates required in genreflex for gcc4.4
> beyond what would be included in ROOT 5.22.00d?
>
>                                   thanks,
>                                     Pete
>
> -------------------------------------------------------------------------
> Peter Elmer     E-mail: Peter.Elmer <at> cern.ch      Phone: +41 (22) 767-4644
> Address: CERN Division PPE, Bat. 32 2C-14, CH-1211 Geneva 23, Switzerland
> -------------------------------------------------------------------------
>

Roel Aaij | 2 Jan 2010 16:16
Picon
Picon

Re: [ROOT] Persistency of custom container

Hi Axel,

First of all, A happy new, year!

> by default, all objects pointed to are stored. So it should "just
> work".

My container only keeps 1 pointer to the first object and then uses a
size member and pointer arithmetic to access the other items. It also
uses a privately inherited std::allocator to allocate a certain
capacity, which is generally somewhat more than the size of the container.

When I try to use it out of the box, I get a segfault in TStreamerBase,
the stack trace is added at the bottom. I guess some extra information
needs to be provided to ROOT before everything works as intended.
Perhaps I should write a custom streamer?

In case a look at the code is needed, all of my code, including a
Makefile is attached.

Greetings, Roel

===========================================================
There was a crash.
This is the entire stack trace of all threads:
===========================================================
#0  0xb778a424 in __kernel_vsyscall ()
#1  0xb6bff273 in waitpid () from /lib/libc.so.6
#2  0xb6b9f1db in ?? () from /lib/libc.so.6
#3  0xb726c33d in TUnixSystem::Exec(char const*) () from
(Continue reading)

Roel Aaij | 3 Jan 2010 21:27
Picon
Picon

Re: [ROOT] Persistency of custom container

Hi Axel,

I've continued my exercise and have created a new container that is
essentially a thin wrapper around an std::vector< TYPE* >. I've called
my class DataStdVector and generated a reflex dictionary for it.
DataStdVector inherits from DataObject. I also have a class Track, which
inherits from DataObject. I want to store these in my DataStdVector and
write the collection to a file.

I would like to write my vector to the file using a pointer to
DataObject, so is the following supposed to work?

DataStdVector< Track >* v = new DataStdVector;
Track* t = new Track( 1, 1000 );
v->push_back( t );
DataObject* d = v;

TFile f( "test.root" )
f.WriteObjectAny( d, "DataStdVector<Track>", "Tracks" );

If I load and enable Cintex and open the file, I can read the object,
but there are no tracks in the container. If I replace the last line by:

f.WriteObjectAny( v, "DataStdVector<Track>", "Tracks" );

It works.

As a sidenote, DataObject contains a pointer to the container that
contains it. I've declared this data member transient in my
selection.xml file.
(Continue reading)

Wajid Ali Khan | 4 Jan 2010 06:32
Picon
Picon

[ROOT] 1/N*dN/d(pt) and 1/sigma* dsigma/d(pt)

Dear Root Experts,

I need your help. Any body can explain me what is  the main difference between the following

1/N*dN/d(pt) and 1/sigma* dsigma/d(pt)

Is the same N=luminosity*Sigma.
If I want to normalize my histogram per entry per unite of Xaxis with say pt. What would be the quantity plotted on Y axis will it be 1/N*dN/d(pt)  or some other quantity.

One thing more I want to get the area under the fitted histogram how can I get that area.



I would be indeed thank full to you.

Best Regards

Wajid Ali
National Center for Physics, Islamabad
Phone: 051-2077336

Snyder, Arthur E. | 4 Jan 2010 09:14
Picon
Favicon

RE: [ROOT] 1/N*dN/d(pt) and 1/sigma* dsigma/d(pt)

Hello Wajid,

Assuming luminosity is independent of pt (which seems likely!) then it would seem that the two expressions
are the same and the integral is 1 (if you integrate over the full range of pt).

If you want plot it you need to chose what to use for bin contents; a reasonable choice (but may be not what you
want) would be the fraction in each bin, i.e.,

Yi = 1/N Integral_i dN/d(pt)

where Integral_i  mean in integration over the pt boundaries of the i'th  bin.

-Art S.

-----Original Message-----
From: owner-roottalk <at> lxbuild091.cern.ch on behalf of Wajid Ali Khan
Sent: Sun 1/3/2010 9:32 PM
To: roottalk <at> lxbuild091.cern.ch
Subject: [ROOT] 1/N*dN/d(pt) and 1/sigma* dsigma/d(pt)

Dear Root Experts,

I need your help. Any body can explain me what is  the main difference between the following

1/N*dN/d(pt) and 1/sigma* dsigma/d(pt)

Is the same N=luminosity*Sigma.
If I want to normalize my histogram per entry per unite of Xaxis with say pt. What would be the quantity
plotted on Y axis will it be 1/N*dN/d(pt)  or some other quantity.

One thing more I want to get the area under the fitted histogram how can I get that area.

I would be indeed thank full to you.

Best Regards

Wajid Ali
National Center for Physics, Islamabad
Phone: 051-2077336

Axel Naumann | 4 Jan 2010 11:16
Picon
Picon

Re: [ROOT] Persistency of custom container

Hi,

on your original layout: ROOT can stream
int fSize
T* fArray; //[fSize]
even without a custom streamer.

You should avoid writing custom streamers; they will obviously disable 
memberwise streaming, splitting, and (automatic and non-automatic) data 
model evolution.

Your second approach looks good. But read the documentation of 
<http://root.cern.ch/root/html/TDirectoryFile.html#TDirectoryFile:WriteObjectAny> 
which states that you'll need to use v.

I assume you want to store these things in a TTree - you might want to 
test that directly; the behavior (of member access e.g. in the TBrowser) 
is slightly different for objects stored in TTrees and those stored in a 
TKey.

Cheers, Axel.

Roel Aaij wrote on 01/03/2010 09:27 PM:
> Hi Axel,
> 
> I've continued my exercise and have created a new container that is
> essentially a thin wrapper around an std::vector< TYPE* >. I've called
> my class DataStdVector and generated a reflex dictionary for it.
> DataStdVector inherits from DataObject. I also have a class Track, which
> inherits from DataObject. I want to store these in my DataStdVector and
> write the collection to a file.
> 
> I would like to write my vector to the file using a pointer to
> DataObject, so is the following supposed to work?
> 
> DataStdVector< Track >* v = new DataStdVector;
> Track* t = new Track( 1, 1000 );
> v->push_back( t );
> DataObject* d = v;
> 
> TFile f( "test.root" )
> f.WriteObjectAny( d, "DataStdVector<Track>", "Tracks" );
> 
> If I load and enable Cintex and open the file, I can read the object,
> but there are no tracks in the container. If I replace the last line by:
> 
> f.WriteObjectAny( v, "DataStdVector<Track>", "Tracks" );
> 
> It works.
> 
> As a sidenote, DataObject contains a pointer to the container that
> contains it. I've declared this data member transient in my
> selection.xml file.
> 
> Greetings, Roel
> 

Marc Escalier | 4 Jan 2010 15:14
Picon
Picon

[ROOT] TGaxis/TAxis : SetBinLabel()

Hello,

from a TH1 histogram, one can do
myhisto->GetXaxis()->SetBinLabel(NumberOfTheBin,"mylabel")
(which is a TAxis)

but is there a way to use a SetBinLabel with a TGaxis instead of TAxis ?

thanks

Olivier Couet | 4 Jan 2010 15:37
Picon
Picon

RE: [ROOT] TGaxis/TAxis : SetBinLabel()

Hi Marc,
The alphanumeric labels are stored in the TAxis class. Not in TGaxis.
Olivier

-----Original Message-----
From: owner-roottalk <at> root.cern.ch [mailto:owner-roottalk <at> root.cern.ch]
On Behalf Of Marc Escalier
Sent: Monday, January 04, 2010 3:14 PM
To: roottalk <at> lxbuild091.cern.ch
Subject: [ROOT] TGaxis/TAxis : SetBinLabel()

Hello,

from a TH1 histogram, one can do
myhisto->GetXaxis()->SetBinLabel(NumberOfTheBin,"mylabel")
(which is a TAxis)

but is there a way to use a SetBinLabel with a TGaxis instead of TAxis ?

thanks

John Idarraga | 4 Jan 2010 15:50
Picon
Picon

RE: [ROOT] TGaxis/TAxis : SetBinLabel()

This is interesting, I never though about it.  I have been using TGaxis
for a while in plots which need more than one axis, but never run into
the problem Marc is addressing here.  Somehow I would have expected
TGaxis inheriting from TAxis, but that is not the case.  I guess the
question comes to, conceptually, what's the difference between TAxis and
TGaxis.  Dear ROOT experts ?

cheers,

John

On Mon, 2010-01-04 at 15:37 +0100, Olivier Couet wrote:
> Hi Marc,
> The alphanumeric labels are stored in the TAxis class. Not in TGaxis.
> Olivier
> 
> -----Original Message-----
> From: owner-roottalk <at> root.cern.ch [mailto:owner-roottalk <at> root.cern.ch]
> On Behalf Of Marc Escalier
> Sent: Monday, January 04, 2010 3:14 PM
> To: roottalk <at> lxbuild091.cern.ch
> Subject: [ROOT] TGaxis/TAxis : SetBinLabel()
> 
> Hello,
> 
> from a TH1 histogram, one can do
> myhisto->GetXaxis()->SetBinLabel(NumberOfTheBin,"mylabel")
> (which is a TAxis)
> 
> but is there a way to use a SetBinLabel with a TGaxis instead of TAxis ?
> 
> thanks
> 


Gmane