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