Disable/enable filling an histogram

From: Legeard Luc <legeard_at_ganil.fr>
Date: Tue, 17 Jan 2006 15:44:42 +0100

Hello Rooters

I'd like know if there a posibility to disable/enable filling an histogram for example :

we can imaging a such method TH1:Enable(Bool_t boolenable) with this behaviour:

TH1F <http://root.cern.ch/root/html////TH1F.html> *h1 = new TH1F <http://root.cern.ch/root/html////TH1F.html>("h1","h1",10,0,10);

h1->Fill <http://root.cern.ch/root/html///TH1.html#TH1:Fill>(1); // fill bin 1
h1->Fill <http://root.cern.ch/root/html///TH1.html#TH1:Fill>(1); // fill bin 1
h1->Fill <http://root.cern.ch/root/html///TH1.html#TH1:Fill>(2); // fill bin 2
h1->Fill <http://root.cern.ch/root/html///TH1.html#TH1:Fill>(2); // fill bin 2     

h1->Enable(kFALSE);

h1->Fill <http://root.cern.ch/root/html///TH1.html#TH1:Fill>(1); // no action !
h1->Fill <http://root.cern.ch/root/html///TH1.html#TH1:Fill>(1); // no action !
h1->Fill <http://root.cern.ch/root/html///TH1.html#TH1:Fill>(2); // no action !
h1->Fill <http://root.cern.ch/root/html///TH1.html#TH1:Fill>(2); // no action !   

h1->Enable(kTRUE);

h1->Fill <http://root.cern.ch/root/html///TH1.html#TH1:Fill>(1); // fill bin 1
h1->Fill <http://root.cern.ch/root/html///TH1.html#TH1:Fill>(1); // fill bin 1
h1->Fill <http://root.cern.ch/root/html///TH1.html#TH1:Fill>(2); // fill bin 2
h1->Fill <http://root.cern.ch/root/html///TH1.html#TH1:Fill>(2); // fill bin 2


Thanks a lot for your help

Luc

-- 
 ------------------------------------------------------------

- Luc LEGEARD - Tel : 02 31 45 44 36 -
- GANIL BP 55027 Bd Becquerel - Fax : 02 31 45 47 97 -
- 14076 CAEN Cedex 5 - mailto:legeard_at_ganil.fr -
- Web http://www.ganil.fr
Received on Tue Jan 17 2006 - 15:44:47 MET

This archive was generated by hypermail 2.2.0 : Mon Jan 01 2007 - 16:31:56 MET