RE: about selecting bins in THnSparse

From: Axel Naumann <Axel.Naumann_at_cern.ch>
Date: Wed, 30 Mar 2011 08:32:07 +0000


Hi,

Apologies for the slow reply - I was away from work and internet for a while.

You could select the first range, do the projection, then select the second range, do the projection to a different histogram, and then add the two projection histograms. Would that do what you are looking for?

Cheers, Axel.



From: owner-roottalk_at_root.cern.ch [owner-roottalk_at_root.cern.ch] on behalf of Xianguo Lu [lu.xianguo_at_gmail.com] Sent: 26 March 2011 15:12
To: roottalk_at_root.cern.ch
Subject: [ROOT] about selecting bins in THnSparse

Hi Rooters,

I have a question about selecting bins in THnSparse. It is the following.

If I want to select only a certain range of a axis and do the projection of the THnSparse, then I do
thnsparse->GetAxis(axisX)->SetRange(bin0, bin1); hh=(TH1D*)thnsparse->Projection(axisY);

But what if I want to selection discontinuous patches of bins, like e.g.  [bin0-bin1]+[bin4, bin5],
then is there a simple way to do the projection?

Many thanks!

best regards,
Xianguo

--
Xianguo Lu

Physikalisches Institut
Raum 204 OG2
Philosophenweg 12
D-69120 Heidelberg

Tel:  +49-6221-549499
Received on Wed Mar 30 2011 - 10:32:12 CEST

This archive was generated by hypermail 2.2.0 : Wed Mar 30 2011 - 11:50:01 CEST