]>
Commit | Line | Data |
---|---|---|
b4dba88d | 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 | ||
041d7c71 | 23 | #include <limits.h> |
78f5d284 | 24 | #include <float.h> |
b4dba88d | 25 | #include "TNamed.h" |
26 | #include "AliStarEvent.h" | |
27 | #include "AliStarEventCuts.h" | |
28 | ||
29 | ClassImp(AliStarEventCuts) | |
30 | ||
31 | //----------------------------------------------------------------------- | |
32 | AliStarEventCuts::AliStarEventCuts(): | |
33 | TNamed(), | |
34 | fCutRunID(kFALSE), | |
35 | fRunIDMax(INT_MAX), | |
78f5d284 | 36 | fRunIDMin(INT_MIN), |
b4dba88d | 37 | fCutEventNumber(kFALSE), |
38 | fEventNumberMax(INT_MAX), | |
78f5d284 | 39 | fEventNumberMin(INT_MIN), |
b4dba88d | 40 | fCutVtxX(kFALSE), |
41 | fVtxXMax(FLT_MAX), | |
ded1d842 | 42 | fVtxXMin(-FLT_MAX), |
b4dba88d | 43 | fCutVtxY(kFALSE), |
44 | fVtxYMax(FLT_MAX), | |
ded1d842 | 45 | fVtxYMin(-FLT_MAX), |
b4dba88d | 46 | fCutVtxZ(kFALSE), |
47 | fVtxZMax(FLT_MAX), | |
ded1d842 | 48 | fVtxZMin(-FLT_MAX), |
b4dba88d | 49 | fCutBField(kFALSE), |
50 | fBFieldMax(FLT_MAX), | |
ded1d842 | 51 | fBFieldMin(-FLT_MAX), |
b4dba88d | 52 | fCutRefMult(kFALSE), |
53 | fRefMultMax(INT_MAX), | |
78f5d284 | 54 | fRefMultMin(INT_MIN), |
b4dba88d | 55 | fCutCentralityID(kFALSE), |
56 | fCentralityIDMax(INT_MAX), | |
78f5d284 | 57 | fCentralityIDMin(INT_MIN), |
b4dba88d | 58 | fCutNumberOfPrimaryTracks(kFALSE), |
59 | fNumberOfPrimaryTracksMax(INT_MAX), | |
78f5d284 | 60 | fNumberOfPrimaryTracksMin(INT_MIN), |
b4dba88d | 61 | fCutNumberOfTracks(kFALSE), |
62 | fNumberOfTracksMax(INT_MAX), | |
78f5d284 | 63 | fNumberOfTracksMin(INT_MIN) |
b4dba88d | 64 | { |
65 | //constructor | |
66 | } | |
67 | ||
68 | ////----------------------------------------------------------------------- | |
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 | // | |
78 | ////----------------------------------------------------------------------- | |
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 | //----------------------------------------------------------------------- | |
90 | Bool_t AliStarEventCuts::PassesCuts(const AliStarEvent *event) const | |
91 | { | |
92 | ///check if event passes cuts | |
0c4bf639 | 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;} | |
ded1d842 | 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;} | |
0c4bf639 | 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;} | |
b4dba88d | 103 | return kTRUE; |
104 | } | |
105 | ||
106 | //----------------------------------------------------------------------- | |
107 | AliStarEventCuts* AliStarEventCuts::StandardCuts() | |
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); | |
119 | cuts->SetNumberOfPrimaryTracksMin(0); | |
120 | cuts->SetNumberOfPrimaryTracksMax(3000); | |
121 | return cuts; | |
122 | } |