AliPhysics  5eaf189 (5eaf189)
AliStarEventCuts.cxx
Go to the documentation of this file.
1 /**************************************************************************
2  * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3  * *
4  * Author: The ALICE Off-line Project. *
5  * Contributors are mentioned in the code where appropriate. *
6  * *
7  * Permission to use, copy, modify and distribute this software and its *
8  * documentation strictly for non-commercial purposes is hereby granted *
9  * without fee, provided that the above copyright notice appears in all *
10  * copies and that both the copyright notice and this permission notice *
11  * appear in the supporting documentation. The authors make no claims *
12  * about the suitability of this software for any purpose. It is *
13  * provided "as is" without express or implied warranty. *
14  **************************************************************************/
15 
16 /* $Id$ */
17 
18 // AliStarEventCuts:
19 // An event cut class for the AliStarEvent
20 //
21 // origin: Mikolaj Krzewicki (mikolaj.krzewicki@cern.ch)
22 
23 #include <limits.h>
24 #include <float.h>
25 #include "TNamed.h"
26 #include "AliStarEvent.h"
27 #include "AliStarEventCuts.h"
28 
29 ClassImp(AliStarEventCuts)
30 
31 //-----------------------------------------------------------------------
33  TNamed(),
34  fCutRunID(kFALSE),
35  fRunIDMax(INT_MAX),
36  fRunIDMin(INT_MIN),
37  fCutEventNumber(kFALSE),
38  fEventNumberMax(INT_MAX),
39  fEventNumberMin(INT_MIN),
40  fCutVtxX(kFALSE),
41  fVtxXMax(FLT_MAX),
42  fVtxXMin(-FLT_MAX),
43  fCutVtxY(kFALSE),
44  fVtxYMax(FLT_MAX),
45  fVtxYMin(-FLT_MAX),
46  fCutVtxZ(kFALSE),
47  fVtxZMax(FLT_MAX),
48  fVtxZMin(-FLT_MAX),
49  fCutBField(kFALSE),
50  fBFieldMax(FLT_MAX),
51  fBFieldMin(-FLT_MAX),
52  fCutRefMult(kFALSE),
53  fRefMultMax(INT_MAX),
54  fRefMultMin(INT_MIN),
55  fCutCentralityID(kFALSE),
56  fCentralityIDMax(INT_MAX),
57  fCentralityIDMin(INT_MIN),
58  fCutNumberOfPrimaryTracks(kFALSE),
59  fNumberOfPrimaryTracksMax(INT_MAX),
60  fNumberOfPrimaryTracksMin(INT_MIN),
61  fCutNumberOfTracks(kFALSE),
62  fNumberOfTracksMax(INT_MAX),
63  fNumberOfTracksMin(INT_MIN)
64 {
65  //constructor
66 }
67 
69 //AliStarEventCuts::AliStarEventCuts(const AliStarEventCuts& someCuts):
70 // TNamed(),
71 // fCutID(that.fCutID),
72 // fIDMax(that.fIDMax),
73 // fIDMin(that.fIDMin),
74 //{
75 // //copy constructor
76 //}
77 //
79 //AliStarEventCuts& AliStarEventCuts::operator=(const AliStarEventCuts& someCuts)
80 //{
81 // //assignment
82 // fCutID=that.fCutID;
83 // fIDMax=that.fIDMax;
84 // fIDMin=that.fIDMin;
85 //
86 // return *this;
87 //}
88 
89 //-----------------------------------------------------------------------
91 {
93  if(fCutRunID) {if (event->GetRunID() < fRunIDMin || event->GetRunID() > fRunIDMax ) return kFALSE;} //integer value: non inclusive bounds!
94  if(fCutEventNumber) {if (event->GetEventNumber() < fEventNumberMin || event->GetEventNumber() > fEventNumberMax ) return kFALSE;}
95  if(fCutVtxX) {if (event->GetVtxX() < fVtxXMin || event->GetVtxX() >= fVtxXMax ) return kFALSE;}
96  if(fCutVtxY) {if (event->GetVtxY() < fVtxYMin || event->GetVtxY() >= fVtxYMax ) return kFALSE;}
97  if(fCutVtxZ) {if (event->GetVtxZ() < fVtxZMin || event->GetVtxZ() >= fVtxZMax ) return kFALSE;}
98  if(fCutBField) {if (event->GetBField() < fBFieldMin || event->GetBField() >= fBFieldMax ) return kFALSE;}
99  if(fCutRefMult) {if (event->GetRefMult() < fRefMultMin || event->GetRefMult() > fRefMultMax ) return kFALSE;}
100  if(fCutCentralityID) {if (event->GetCentralityID() < fCentralityIDMin || event->GetCentralityID() > fCentralityIDMax ) return kFALSE;}
101  if(fCutNumberOfPrimaryTracks) {if (event->GetNumberOfPrimaryTracks() < fNumberOfPrimaryTracksMin || event->GetNumberOfPrimaryTracks() > fNumberOfPrimaryTracksMax ) return kFALSE;}
102  if(fCutNumberOfTracks) {if (event->GetNumberOfTracks() < fNumberOfTracksMin || event->GetNumberOfTracks() > fNumberOfTracksMax ) return kFALSE;}
103  return kTRUE;
104 }
105 
106 //-----------------------------------------------------------------------
108 {
109  //make a set of standard event cuts, caller becomes owner
110  AliStarEventCuts* cuts = new AliStarEventCuts();
111  cuts->SetVtxXMin(-1.0);
112  cuts->SetVtxXMax(1.0);
113  cuts->SetVtxYMin(-1.0);
114  cuts->SetVtxYMax(1.0);
115  cuts->SetVtxZMin(-30.0);
116  cuts->SetVtxZMax(30.0);
117  cuts->SetRefMultMin(10);
118  cuts->SetRefMultMax(1000);
120  cuts->SetNumberOfPrimaryTracksMax(3000);
121  return cuts;
122 }
Float_t GetVtxY() const
Definition: AliStarEvent.h:30
Bool_t PassesCuts(const AliStarEvent *event) const
void SetVtxXMin(const Float_t value)
Int_t GetRefMult() const
Definition: AliStarEvent.h:33
Int_t GetNumberOfTracks() const
Definition: AliStarEvent.h:36
void SetVtxZMin(const Float_t value)
static AliStarEventCuts * StandardCuts()
void SetVtxYMin(const Float_t value)
void SetNumberOfPrimaryTracksMax(const Int_t value)
Float_t GetVtxZ() const
Definition: AliStarEvent.h:31
Int_t GetCentralityID() const
Definition: AliStarEvent.h:34
void SetVtxXMax(const Float_t value)
Int_t fNumberOfPrimaryTracksMin
Int_t GetRunID() const
Definition: AliStarEvent.h:27
void SetVtxYMax(const Float_t value)
Int_t GetEventNumber() const
Definition: AliStarEvent.h:28
void SetRefMultMin(const Int_t value)
Int_t fNumberOfPrimaryTracksMax
void SetVtxZMax(const Float_t value)
void SetNumberOfPrimaryTracksMin(const Int_t value)
bool Bool_t
Definition: External.C:53
void SetRefMultMax(const Int_t value)
Int_t GetNumberOfPrimaryTracks() const
Definition: AliStarEvent.h:35
Float_t GetBField() const
Definition: AliStarEvent.h:32
Bool_t fCutNumberOfPrimaryTracks
Float_t GetVtxX() const
Definition: AliStarEvent.h:29