31 #include "TVirtualPad.h"
33 #include "TObjArray.h"
69 static TH1 *
GetHisto(TVirtualPad *pad = 0x0 , Option_t *op =
"");
70 static TGraph *
GetGraph(TVirtualPad *pad = 0x0, Option_t *op =
"" );
81 template <
typename Data_T>
static void Collect(TList &list, TVirtualPad *pad = 0x0)
84 TVirtualPad *locpad = 0x0;
86 if ( TVirtualPad::Pad() == 0x0 )
89 locpad = TVirtualPad::Pad();
93 TObject* obj = 0x0; TIter next(locpad->GetListOfPrimitives());
94 while ( (obj = next()) ) {
95 if ( obj->InheritsFrom(Data_T::Class_Name()) )
100 template <
typename Data_T>
static void Collect(std::vector<Data_T *> &array, TVirtualPad *pad = 0x0)
103 TVirtualPad *locpad = 0x0;
105 if ( TVirtualPad::Pad() == 0x0 )
108 locpad = TVirtualPad::Pad();
112 TObject* obj = 0x0; TIter next(locpad->GetListOfPrimitives());
113 while ( (obj = next()) ) {
114 if ( obj->InheritsFrom(Data_T::Class_Name()) )
115 array.push_back((Data_T *)obj);
119 template <
typename Data_T>
static void Collect(TList *collected, TFolder *from,
120 const char *inc =
"*",
const char *exc =
"",
121 const char *inc_class =
"TFH1*",
const char *exc_class =
"-", Int_t depth = kMaxInt)
123 TString include(inc), exclude(exc), include_class(inc_class), exclude_class(exc_class), tmp_obj =
"", tmp_token =
"", tmp_class =
"";
125 TIter next(from->GetListOfFolders()); TObject *an_obj = 0x0, *a_token = 0x0;
128 while ( (an_obj=next()) ) {
130 tmp_obj = an_obj->GetName(); tmp_class = an_obj->ClassName();
133 TObjArray *all_token_include = include.Tokenize(
" "),
134 *all_token_exclude = exclude.Tokenize(
" "), *all_token_include_class = include_class.Tokenize(
" "), *all_token_exclude_class = exclude_class.Tokenize(
" ");
135 Bool_t add_it =
false, exclude_it =
false, add_it_class =
false, exclude_it_class =
false;
138 TIter token_include(all_token_include);
139 while ( (a_token = token_include()) ) {
141 tmp_token = a_token->GetName();
145 if ( tmp_token.Contains(
"*") )
147 TRegexp kept(tmp_token,wildcard);
149 if ( tmp_obj.Contains(kept) && an_obj->InheritsFrom(Data_T::Class_Name()) ) {
155 TIter token_exclude(all_token_exclude);
156 while ( (a_token = token_exclude()) ) {
158 tmp_token = a_token->GetName();
162 if ( tmp_token.Contains(
"*") )
164 TRegexp nokept(tmp_token,wildcard);
166 if ( tmp_obj.Contains(nokept) && an_obj->InheritsFrom(Data_T::Class_Name()) ) {
172 TIter token_include_class(all_token_include_class);
173 while ( (a_token = token_include_class()) ) {
175 tmp_token = a_token->GetName();
179 if ( tmp_token.Contains(
"*") )
181 TRegexp kept(tmp_token,wildcard);
183 if ( tmp_class.Contains(kept) ) {
189 TIter token_exclude_class(all_token_exclude_class);
190 while ( (a_token = token_exclude_class()) ) {
192 tmp_token = a_token->GetName();
196 if ( tmp_token.Contains(
"*") )
198 TRegexp nokept(tmp_token,wildcard);
200 if ( tmp_class.Contains(nokept) ) {
207 if ( all_token_include ) {
208 delete all_token_include; all_token_include = 0x0;
210 if ( all_token_exclude ) {
211 delete all_token_exclude; all_token_exclude = 0x0;
213 if ( all_token_include_class ) {
214 delete all_token_include_class; all_token_include_class = 0x0;
216 if ( all_token_exclude_class ) {
217 delete all_token_exclude_class; all_token_exclude_class = 0x0;
222 if ( add_it && !exclude_it && add_it_class && !exclude_it_class && !an_obj->InheritsFrom(
"TFolder") ) {
223 collected->Add(an_obj);
226 if ( an_obj->InheritsFrom(
"TFolder") && depth > 0 ) {
227 Collect<Data_T>(collected,(TFolder *)an_obj,inc,exc,inc_class,exc_class,depth--);
234 static TPolyLine *
ShowDiff(
const TH1 *h,
const TF1 *f, Double_t xmin, Double_t xmax);
Base class for a Log message.
static TPolyLine * ShowDiff(const TH1 *h, const TF1 *f, Double_t xmin, Double_t xmax)
show a polyline calculated as the difference between an histogram and a function (used for instance f...
header file for GwLogMessage.cpp
static EActionMode gActionMode
Global to be applied on Canvas that are not Gw::Canvas or dont't have an individual mode...
static void Collect(TList *collected, TFolder *from, const char *inc="*", const char *exc="", const char *inc_class="TFH1*", const char *exc_class="-", Int_t depth=kMaxInt)
Collect kind of object from a tfolder applying a pattern, excuding another one and digging up to dept...
static void Collect(TList &list, TVirtualPad *pad=0x0)
check if the action is
static TH1 * GetHisto(TVirtualPad *pad=0x0, Option_t *op="")
look for an histogram into the pad
static void Collect(std::vector< Data_T * > &array, TVirtualPad *pad=0x0)
Collect kind of object from a pad.
static TGraph * GetGraph(TVirtualPad *pad=0x0, Option_t *op="")