Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

/Go4ConditionsBase/TGo4Condition.h

Go to the documentation of this file.
00001 //---------------------------------------------------------------
00002 //        Go4 Release Package v2.10-5 (build 21005) 
00003 //                      03-Nov-2005
00004 //---------------------------------------------------------------
00005 //       The GSI Online Offline Object Oriented (Go4) Project
00006 //       Experiment Data Processing at DVEE department, GSI
00007 //---------------------------------------------------------------
00008 //
00009 //Copyright (C) 2000- Gesellschaft f. Schwerionenforschung, GSI
00010 //                    Planckstr. 1, 64291 Darmstadt, Germany
00011 //Contact:            http://go4.gsi.de
00012 //----------------------------------------------------------------
00013 //This software can be used under the license agreements as stated
00014 //in Go4License.txt file which is part of the distribution.
00015 //----------------------------------------------------------------
00016 #ifndef TGO4CONDITION_H
00017 #define TGO4CONDITION_H
00018 
00019 #include "TNamed.h"
00020 #include "TAttLine.h"
00021 #include "TAttFill.h"
00022 #include "TCutG.h"
00023 
00024 #define kCOPYCOUNTS true
00025 #define kNOCOPYCOUNTS false
00026 #define kWINDOW 1
00027 #define kPOLYGON 2
00028 
00029 class TGo4HistogramEntry;
00030 class TGo4EventElement;
00031 class TGo4ConditionPainter;
00032 
00033 class TGo4Condition : public TNamed, public TAttLine, public TAttFill {
00034   friend class TGo4CondArray;
00035 
00036   public:
00037     TGo4Condition();
00038     TGo4Condition(const char* name);
00039     TGo4Condition(const char* name, const char* title);
00040     virtual ~TGo4Condition();
00041 
00043     virtual void Paint(Option_t* opt="");
00044 
00046     virtual void Draw(Option_t* opt="");
00047 
00049     virtual void UnDraw(Option_t* opt="");
00050 
00052     virtual TGo4ConditionPainter* CreatePainter();
00053 
00055     virtual Int_t Counts();
00056     
00058     virtual Int_t TrueCounts();
00059  
00061     virtual void ResetCounts();
00062     
00064     virtual void SetCounts(Int_t truecounts, Int_t counts);
00065  
00068     virtual void Disable(Bool_t result);
00069 
00071     virtual void Enable();
00072     
00074     Int_t IsEnabled();
00075 
00079     virtual Bool_t Test();
00080     
00082     virtual void SetValues();
00083     
00095     virtual void AddCondition(TGo4Condition* next);
00096  
00099     void IncCounts();
00100     
00103     void IncTrueCounts();
00104 
00107     Bool_t IsTrue() const { return fbTrue; }
00108     
00111     Bool_t IsFalse() const { return fbFalse; }
00112 
00114     Bool_t FixedResult() const { return fbResult; }
00115 
00118     virtual void Invert(Bool_t on);
00119  
00121     virtual void PrintCondition(Bool_t full=kTRUE);
00122  
00124     virtual void PrintBar();
00125    
00127     virtual void Print(Option_t* opt="") const;
00128 
00131     void SetLast(Bool_t value) { fbLastResult=value; }
00132 
00134     Bool_t GetLast() { return fbLastResult; }
00135     
00137     virtual Bool_t UpdateFrom(TGo4Condition * cond, Bool_t counts);
00138     virtual void SetValues(Double_t low1, Double_t up1);
00139     virtual void SetValues(Double_t low1, Double_t up1, Double_t low2, Double_t up2);
00140     virtual void SetValues(TCutG * newcut);
00141     virtual void SetValues(Double_t * x, Double_t * y, Int_t len);
00142     virtual void GetValues(Int_t & dim, Double_t & x1, Double_t & y1, Double_t & x2, Double_t & y2);
00143     virtual Double_t GetXLow();
00144     virtual Double_t GetXUp();
00145     virtual Double_t GetYLow();
00146     virtual Double_t GetYUp();
00147     virtual Bool_t Test(Double_t x, Double_t y);
00148     virtual Bool_t Test(Double_t x);
00149     virtual Bool_t Test(Bool_t result);
00150     virtual TCutG* GetCut(Bool_t owner);
00151 
00154     virtual Double_t GetIntegral(TH1* histo, Option_t* opt="");
00155 
00157     virtual Double_t GetMean(TH1* histo, Int_t axis=1);
00158 
00160     virtual Double_t GetRMS(TH1* histo, Int_t axis=1);
00161 
00163     virtual Double_t GetXMax(TH1* histo);
00164 
00166     virtual Double_t GetYMax(TH1* histo);
00167 
00169     virtual Double_t GetCMax(TH1* histo);
00170 
00172     virtual TGo4Condition* GetActiveCondition();
00173 
00175     virtual void MarkReset(Bool_t on);
00176 
00177     virtual void Clear(Option_t* opt="");
00178 
00181     virtual void SetFlags(Bool_t enabled, Bool_t lastresult, Bool_t markreset,
00182                    Bool_t result, Bool_t truevalue, Bool_t falsevalue);
00183 
00186     virtual void GetFlags(Bool_t* enabled, Bool_t* lastresult, Bool_t* markreset,
00187                    Bool_t* result, Bool_t* truevalue, Bool_t* falsevalue);
00188 
00190     virtual void SetVisible(Bool_t on);
00191 
00193     virtual Bool_t IsVisible();
00194 
00196     void SetHistogramLink(Bool_t on);
00197 
00199     Bool_t IsHistogramLink();
00200 
00202     void SetHistogram(const char* name);
00203 
00205     const Text_t* GetLinkedHistogram();
00206 
00209     void SetWorkHistogram(TH1* histo);
00210 
00212     TH1* GetWorkHistogram(){return fxHisto;}
00213 
00215     Bool_t CheckWorkHistogram();
00216 
00219     void SetPadHistogram(TVirtualPad* pad);
00220 
00224     virtual void SetPainter(TGo4ConditionPainter* painter);
00225 
00228     void SetUpdateEpsilon(Double_t val){fdUpdateEpsilon=val;}
00229 
00230     Double_t GetUpdateEpsilon(){return fdUpdateEpsilon;}
00231 
00233     static const Double_t fgdUPDATEEPSILON;
00234 
00236     void SaveLabelStyle();
00237 
00239     void InitLabelStyle();
00240 
00242     void ResetLabel();
00243 
00244     virtual void SetLabelDraw(Bool_t on);
00245     virtual Bool_t IsLabelDraw();
00246 
00247     virtual void SetLimitsDraw(Bool_t on);
00248     virtual Bool_t IsLimitsDraw();
00249 
00250     virtual void SetIntDraw(Bool_t on);
00251     virtual Bool_t IsIntDraw();
00252 
00253     virtual void SetXMeanDraw(Bool_t on);
00254     virtual Bool_t IsXMeanDraw();
00255 
00256     virtual void SetXRMSDraw(Bool_t on);
00257     virtual Bool_t IsXRMSDraw();
00258 
00259     virtual void SetYMeanDraw(Bool_t on);
00260     virtual Bool_t IsYMeanDraw();
00261 
00262     virtual void SetYRMSDraw(Bool_t on);
00263     virtual Bool_t IsYRMSDraw();
00264 
00265     virtual void SetXMaxDraw(Bool_t on);
00266     virtual Bool_t IsXMaxDraw();
00267 
00268     virtual void SetYMaxDraw(Bool_t on);
00269     virtual Bool_t IsYMaxDraw();
00270     virtual void SetCMaxDraw(Bool_t on);
00271     virtual Bool_t IsCMaxDraw();
00272 
00273     void SetChanged(Bool_t on){fbIsChanged=on;}
00274     virtual Bool_t IsChanged();
00275 
00276     void SetMultiEdit(Bool_t on){fbMultiEdit=on;}
00277     virtual Bool_t IsMultiEdit(){return fbMultiEdit;}
00278 
00279     void SetDimension(Int_t d){fiDim=d;}
00280     Int_t GetDimension(){return fiDim;}
00281 
00282     void SetOwnedByEditor(Bool_t on){fbOwnedByEditor=on;}
00283     Bool_t IsOwnedByEditor(){return fbOwnedByEditor;}
00284 
00286     virtual void SetCurrentIndex(Int_t ix);
00287     
00289     virtual Int_t GetCurrentIndex();
00290     
00293     virtual Int_t GetNumberOfConditions();
00294 
00295     virtual Bool_t IsPolygonType();
00296     virtual Bool_t IsArrayType();
00297 
00298     TVirtualPad* GetDrawPad(){return fxDrawPad;}
00299 
00301     static Bool_t fgbLABELDRAW;
00302 
00304     static Bool_t fgbLIMITSDRAW;
00305 
00307     static Bool_t fgbINTDRAW;
00308 
00310     static Bool_t fgbXMEANDRAW;
00311 
00313     static Bool_t fgbXRMSDRAW;
00314 
00316     static Bool_t fgbYMEANDRAW;
00317 
00319     static Bool_t fgbYRMSDRAW;
00320 
00322     static Bool_t fgbXMAXDRAW;
00323 
00325     static Bool_t fgbYMAXDRAW;
00326 
00328     static Bool_t fgbCMAXDRAW;
00329 
00330   protected:
00331 
00335     TGo4ConditionPainter* fxPainter;
00336 
00340     TH1* fxCutHis;   
00341 
00342     void SetPainted(Bool_t on) { fbIsPainted=on; }
00343     Bool_t IsPainted() const { return fbIsPainted; }
00344 
00345     void SetDrawPad(TVirtualPad* pad) { fxDrawPad=pad; }
00346 
00347   private:
00348 
00350     Int_t fiDim;
00351 
00352     Bool_t fbMarkReset;
00353 
00356     Bool_t fbLastResult;
00357     
00359     Bool_t fbTrue;
00360     
00362     Bool_t fbFalse;
00363 
00364     TGo4Condition* fxNextCondition;
00365     
00367     Int_t fiTrueCounts;
00368  
00370     Int_t fiCounts;
00371  
00376     Bool_t fbEnabled;
00377     
00379     Bool_t fbResult;
00380 
00383     Bool_t fbMultiEdit;
00384 
00386     Bool_t fbVisible;
00387 
00389     Bool_t fbHistogramLink;
00390 
00392     TString fxHistoName;
00393 
00395     Double_t fdUpdateEpsilon;
00396 
00398     Bool_t fbLabelDraw;
00399 
00401     Bool_t fbLimitsDraw;
00402 
00404     Bool_t fbIntDraw;
00405 
00407     Bool_t fbXMeanDraw;
00408 
00410     Bool_t fbXRMSDraw;
00411 
00413     Bool_t fbYMeanDraw;
00414 
00416     Bool_t fbYRMSDraw;
00417 
00419     Bool_t fbXMaxDraw;
00420 
00422     Bool_t fbYMaxDraw;
00423 
00425     Bool_t fbCMaxDraw;
00426 
00429     TH1* fxHisto;   
00430 
00432     Bool_t fbIsChanged; 
00433 
00436     Bool_t fbIsPainted; 
00437 
00439     Bool_t fbOwnedByEditor; 
00440 
00442     Bool_t fbStreamedCondition;
00443 
00446     TVirtualPad* fxDrawPad;
00447 
00448    ClassDef(TGo4Condition,6)
00449 };
00450 
00451 #endif //TGO4CONDITION_H
00452 
00453 //----------------------------END OF GO4 SOURCE FILE ---------------------

Generated on Tue Nov 8 10:55:52 2005 for Go4-v2.10-5 by doxygen1.2.15