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 #include <iostream>
17 
18 #include "TString.h"
19 #include "TVector3.h"
20 #include "TTreeFormula.h"
21 #include "RhoCandList.h"
22 #include "RhoEventInfo.h"
23 #include "RhoGoodTrackSelector.h"
24 
25 // RhoEventSelector is the common base class for all the
26 // selectors in the hierarchy and manages the common settings.
27 // The default setup has all cuts disabled, i.e. all events are accepted.
28 
29 class RhoEventSelectorBase : public TNamed {
30 
31  public:
32  // Constructor
33  RhoEventSelectorBase(const char *name = "RhoEventSelectorBase")
34  : TNamed(name, name), fTight(kFALSE), fNTracksMin(0), fNTracksMax(65535), fTotChar(65535), fDocaMax(1.E8), fZMin(1.E8), fZMax(1.E8), fETotLow(0.0), fETotHigh(1.E8),
35  fPTotLow(0.0), fPTotHigh(1.E8), fELow(0.0), fEHigh(1.E8), fEmcLow(0.0), fEmcHigh(1.E8), fPLow(0.0), fPHigh(1.E8), fPtLow(0.0), fPtHigh(1.E8), fThetaLow(0.0),
36  fThetaHigh(2. * 3.14159265358979323846), fPhiLow(0.0), fPhiHigh(2. * 3.14159265358979323846)
37  {
38  }
39 
40  // Destructor
41  virtual ~RhoEventSelectorBase() {}
42 
43  // operations
44  virtual Bool_t Accept(RhoEventInfo &) = 0; // The basic selector functionality
45  virtual void PrintOn(std::ostream &o = std::cout) const; // Show the settings
46 
47  // All descendents work on the same basis...
48 
49  // General settings
50  void SetTight() { fTight = kTRUE; };
51  void SetLoose() { fTight = kFALSE; };
52  // Properties of the event
53  void SetNumberOfTracks(UInt_t n1, UInt_t n2 = 65535)
54  {
55  fNTracksMin = n1;
56  fNTracksMax = n2;
57  }
58  void SetPrimaryVertex(Double_t d, Double_t zMin, Double_t zMax)
59  {
60  fDocaMax = d;
61  fZMin = zMin;
62  fZMax = zMax;
63  }
64  void SetTotalCharge(Int_t n) { fTotChar = n; }
65  void SetTotalEnergy(Double_t e1, Double_t e2 = 1.E8)
66  {
67  fETotLow = e1;
68  fETotHigh = e2;
69  }
70  void SetTotalMomentum(Double_t p1, Double_t p2 = 1.E8)
71  {
72  fPTotLow = p1;
73  fPTotHigh = p2;
74  }
75  // Properties of the tracks
76  void SetEnergy(Double_t e1, Double_t e2 = 1.E8)
77  {
78  fELow = e1;
79  fEHigh = e2;
80  }
81  void SetShowerEnergy(Double_t e1, Double_t e2 = 1.E8)
82  {
83  fEmcLow = e1;
84  fEmcHigh = e2;
85  }
86  void SetMomentum(Double_t p1, Double_t p2 = 1.E8)
87  {
88  fPLow = p1;
89  fPHigh = p2;
90  }
91  void SetPt(Double_t p1, Double_t p2 = 1.E8)
92  {
93  fPtLow = p1;
94  fPtHigh = p2;
95  }
96  void SetTheta(Double_t t1, Double_t t2 = 2. * 3.14159265358979323846)
97  {
98  fThetaLow = t1;
99  fThetaHigh = t2;
100  }
101  void SetPhi(Double_t p1, Double_t p2 = 2. * 3.14159265358979323846)
102  {
103  fPhiLow = p1;
104  fPhiHigh = p2;
105  }
106 
107  protected:
108  Bool_t fTight;
110  Double_t fDocaMax, fZMin, fZMax;
114 
115  public:
116  ClassDef(RhoEventSelectorBase, 1) // Event Selector base class
117 };
118 
119 // standalone print
120 std::ostream &operator<<(std::ostream &o, const RhoEventSelectorBase &);
121 
122 #endif
virtual Bool_t Accept(RhoEventInfo &)=0
void SetEnergy(Double_t e1, Double_t e2=1.E8)
void SetTotalEnergy(Double_t e1, Double_t e2=1.E8)
void SetPhi(Double_t p1, Double_t p2=2. *3.14159265358979323846)
void SetMomentum(Double_t p1, Double_t p2=1.E8)
void SetNumberOfTracks(UInt_t n1, UInt_t n2=65535)
std::ostream & operator<<(std::ostream &o, const RhoEventSelectorBase &)
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)
void SetTheta(Double_t t1, Double_t t2=2. *3.14159265358979323846)
virtual void PrintOn(std::ostream &o=std::cout) const