More information on this package is here.
#ifndef __TCounterCol__
#define __TCounterCol__
#include "TROOT.h"
#include "TSystem.h"
#include "TObject.h"
#include "TObjArray.h"
#include "TString.h"
#include "TMath.h"
#include "TCounter.h"
class TCounterCol : public TObjArray {
public:
TCounterCol(){};
virtual ~TCounterCol(){};
Int_t AddCounter(TCounter *cc,Int_t loc= -1){
if(loc<0){
AddLast(cc);
}else{
AddAt(cc,loc);
}
return(IndexOf(cc));
}
Int_t AddCounter(const char *name,Int_t loc= -1){
TCounter *cc=new TCounter(name);
return( AddCounter(cc,loc));
}
Bool_t Test(Bool_t test,Int_t i){
if((TCounter *)At(i)){
return( ((TCounter *)At(i))->Test(test));
}else{
cerr << "Missing Counter no: " << i << endl;
return(test);
}
};
Bool_t TestInv(Bool_t test,Int_t i){
if((TCounter *)At(i)){
return( !((TCounter *)At(i))->Test(!test));
}else{
cerr << "Missing Counter no: " << i << endl;
return(test);
}
};
Bool_t True(Int_t i){
if((TCounter *)At(i)){
return( ((TCounter *)At(i))->True());
}else{
cerr << "Missing Counter no: " << i << endl;
return(1);
}
}
Bool_t False(Int_t i){
if((TCounter *)At(i)){
return( ((TCounter *)At(i))->False());
}else{
cerr << "Missing Counter no: " << i << endl;
return(0);
}
}
void Browse(TBrowser *b);
virtual Bool_t IsFolder() const { return kTRUE; }
void Print(void);
void Reset(void);
void SetCounterTitles(void);
Int_t Write(const char *name=0, Int_t option=0, Int_t bufsize=0){
this->SetCounterTitles();
return(TObjArray::Write(name,option,bufsize));
}
ClassDef(TCounterCol,1)
};
#endif
Author: Maurik Holtrop
Last update: ClasTool/TCounterCol:$Name: $:$Id: TCounterCol.cc,v 1.2 2007/03/01 22:27:00 holtrop Exp $
CopyLeft - This code is freely available.
ROOT Home page - ClasTool Class index - Class Hierarchy - Top of the page