FairRoot/PandaRoot
RhoEventSelectorBase.h
Go to the documentation of this file.
1 #ifndef RHOEVENTSELECTORBASE_H
2 #define RHOEVENTSELECTORBASE_H
3 // //
5 // RhoEventSelectorBase //
6 // //
7 // Selector classes for event selection //
8 // //
9 // Author List: //
10 // Marcel Kunze, RUB, Feb. 99 //
11 // Copyright (C) 1999-2001, Ruhr-University Bochum. //
12 // Ralf Kliemt, HIM/GSI Feb.2013 (Cleanup & Restructuring) //
13 // //
15 
16 
17 #include <iostream>
18 
19 #include "TString.h"
20 #include "TVector3.h"
21 #include "TTreeFormula.h"
22 #include "RhoBase/RhoCandList.h"
23 #include "RhoBase/RhoEventInfo.h"
25 
26 // RhoEventSelector is the common base class for all the
27 // selectors in the hierarchy and manages the common settings.
28 // The default setup has all cuts disabled, i.e. all events are accepted.
29 
30 class RhoEventSelectorBase : public TNamed
31 {
32 
33  public:
34 
35  //Constructor
36  RhoEventSelectorBase ( const char* name = "RhoEventSelectorBase" ) :
37  TNamed ( name,name ),
38  fTight ( kFALSE ),
39  fNTracksMin ( 0 ), fNTracksMax ( 65535 ), fTotChar ( 65535 ),
40  fDocaMax ( 1.E8 ), fZMin ( 1.E8 ), fZMax ( 1.E8 ),
41  fETotLow ( 0.0 ), fETotHigh ( 1.E8 ),
42  fPTotLow ( 0.0 ), fPTotHigh ( 1.E8 ),
43  fELow ( 0.0 ), fEHigh ( 1.E8 ),
44  fEmcLow ( 0.0 ), fEmcHigh ( 1.E8 ),
45  fPLow ( 0.0 ), fPHigh ( 1.E8 ),
46  fPtLow ( 0.0 ), fPtHigh ( 1.E8 ),
47  fThetaLow ( 0.0 ), fThetaHigh ( 2.*3.14159265358979323846 ),
48  fPhiLow ( 0.0 ), fPhiHigh ( 2.*3.14159265358979323846 )
49  {}
50 
51  //Destructor
52  virtual ~RhoEventSelectorBase() {}
53 
54  //operations
55  virtual Bool_t Accept ( RhoEventInfo& ) = 0; // The basic selector functionality
56  virtual void PrintOn ( std::ostream& o=std::cout ) const; // Show the settings
57 
58  // All descendents work on the same basis...
59 
60  // General settings
61  void SetTight() {
62  fTight = kTRUE;
63  };
64  void SetLoose() {
65  fTight = kFALSE;
66  };
67  // Properties of the event
68  void SetNumberOfTracks ( UInt_t n1, UInt_t n2 = 65535 ) {
69  fNTracksMin = n1;
70  fNTracksMax = n2;
71  }
72  void SetPrimaryVertex ( Double_t d, Double_t zMin, Double_t zMax ) {
73  fDocaMax = d;
74  fZMin = zMin;
75  fZMax = zMax;
76  }
77  void SetTotalCharge ( Int_t n ) {
78  fTotChar = n;
79  }
80  void SetTotalEnergy ( Double_t e1, Double_t e2=1.E8 ) {
81  fETotLow = e1;
82  fETotHigh = e2;
83  }
85  fPTotLow = p1;
86  fPTotHigh = p2;
87  }
88  // Properties of the tracks
89  void SetEnergy ( Double_t e1, Double_t e2=1.E8 ) {
90  fELow = e1;
91  fEHigh = e2;
92  }
93  void SetShowerEnergy ( Double_t e1, Double_t e2=1.E8 ) {
94  fEmcLow = e1;
95  fEmcHigh = e2;
96  }
97  void SetMomentum ( Double_t p1, Double_t p2=1.E8 ) {
98  fPLow = p1;
99  fPHigh = p2;
100  }
101  void SetPt ( Double_t p1, Double_t p2=1.E8 ) {
102  fPtLow = p1;
103  fPtHigh = p2;
104  }
105  void SetTheta ( Double_t t1, Double_t t2=2.*3.14159265358979323846 ) {
106  fThetaLow = t1;
107  fThetaHigh = t2;
108  }
109  void SetPhi ( Double_t p1, Double_t p2=2.*3.14159265358979323846 ) {
110  fPhiLow = p1;
111  fPhiHigh = p2;
112  }
113 
114  protected:
121 
122  public:
123  ClassDef ( RhoEventSelectorBase,1 ) // Event Selector base class
124 };
125 
126 // standalone print
128 
129 #endif
virtual void PrintOn(std::ostream &o=std::cout) const
void SetPhi(Double_t p1, Double_t p2=2.*3.14159265358979323846)
virtual Bool_t Accept(RhoEventInfo &)=0
Int_t t2
Definition: hist-t7.C:106
TObjArray * d
void SetEnergy(Double_t e1, Double_t e2=1.E8)
int n
std::ostream & operator<<(std::ostream &o, const PndEventInfo &a)
void SetTotalEnergy(Double_t e1, Double_t e2=1.E8)
Int_t t1
Definition: hist-t7.C:106
void SetMomentum(Double_t p1, Double_t p2=1.E8)
void SetNumberOfTracks(UInt_t n1, UInt_t n2=65535)
Double_t
TString name
TPad * p2
Definition: hist-t7.C:117
TPad * p1
Definition: hist-t7.C:116
void SetTheta(Double_t t1, Double_t t2=2.*3.14159265358979323846)
void SetPt(Double_t p1, Double_t p2=1.E8)
void SetShowerEnergy(Double_t e1, Double_t e2=1.E8)
RhoEventSelectorBase(const char *name="RhoEventSelectorBase")
void SetPrimaryVertex(Double_t d, Double_t zMin, Double_t zMax)
void SetTotalMomentum(Double_t p1, Double_t p2=1.E8)