]>
Commit | Line | Data |
---|---|---|
299ec65d | 1 | /************************************************************************** |
2 | * Author: Panos Christakoglou. * | |
3 | * Contributors are mentioned in the code where appropriate. * | |
4 | * * | |
5 | * Permission to use, copy, modify and distribute this software and its * | |
6 | * documentation strictly for non-commercial purposes is hereby granted * | |
7 | * without fee, provided that the above copyright notice appears in all * | |
8 | * copies and that both the copyright notice and this permission notice * | |
9 | * appear in the supporting documentation. The authors make no claims * | |
10 | * about the suitability of this software for any purpose. It is * | |
11 | * provided "as is" without express or implied warranty. * | |
12 | **************************************************************************/ | |
13 | ||
14 | /* $Id$ */ | |
15 | ||
16 | //----------------------------------------------------------------- | |
17 | // AliLHCTagCuts class | |
18 | // This is the class to deal with the LHC tag level cuts | |
19 | // Origin: Panos Christakoglou, UOA-CERN, Panos.Christakoglou@cern.ch | |
20 | //----------------------------------------------------------------- | |
21 | ||
22 | class AliLog; | |
23 | ||
24 | #include "AliLHCTag.h" | |
25 | #include "AliLHCTagCuts.h" | |
26 | ||
27 | ClassImp(AliLHCTagCuts) | |
28 | ||
29 | ||
30 | //___________________________________________________________________________ | |
31 | AliLHCTagCuts::AliLHCTagCuts() : | |
32 | TObject(), | |
33 | fLHCState(0), | |
34 | fLHCStateFlag(kFALSE), | |
35 | fLHCLuminosityMin(0), | |
36 | fLHCLuminosityMax(0), | |
04cb11d4 | 37 | fLHCLuminosityFlag(kFALSE), |
38 | fNBunchesRange(), | |
39 | fNBunchesFlag(kFALSE), | |
40 | fFillingScheme(""), | |
41 | fFillingSchemeFlag(kFALSE), | |
42 | fFillNoRange(), | |
43 | fFillNoFlag(kFALSE), | |
44 | fBeamEnergyRange(), | |
45 | fBeamEnergyFlag(kFALSE), | |
46 | fBunchIntensityRange(), | |
47 | fBunchIntensityFlag(kFALSE) | |
299ec65d | 48 | { |
49 | //Default constructor which calls the Reset method. | |
50 | Reset(); | |
51 | } | |
52 | ||
53 | //___________________________________________________________________________ | |
54 | AliLHCTagCuts::~AliLHCTagCuts() { | |
55 | //Defaut destructor. | |
56 | } | |
57 | ||
58 | //___________________________________________________________________________ | |
59 | void AliLHCTagCuts::Reset() { | |
60 | //Sets dummy values to every private member. | |
61 | fLHCState = "init"; | |
62 | fLHCStateFlag = kFALSE; | |
63 | fLHCLuminosityMin = -1.0; | |
64 | fLHCLuminosityMax = 0.0; | |
65 | fLHCLuminosityFlag = kFALSE; | |
04cb11d4 | 66 | fNBunchesRange[0] = 0; |
67 | fNBunchesRange[1] = 10000; | |
68 | fNBunchesFlag = kFALSE; | |
69 | fFillingScheme = ""; | |
70 | fFillingSchemeFlag = kFALSE; | |
71 | fFillNoRange[0] = 0; | |
72 | fFillNoRange[1] = 10000000; | |
73 | fFillNoFlag = kFALSE; | |
74 | fBeamEnergyRange[0] = 0.0; | |
75 | fBeamEnergyRange[1] = 10000; | |
76 | fBeamEnergyFlag = kFALSE; | |
77 | fBunchIntensityRange[0] = 0.0; | |
78 | fBunchIntensityRange[1] = 1e30; | |
79 | fBunchIntensityFlag = kFALSE; | |
299ec65d | 80 | } |
81 | ||
82 | //___________________________________________________________________________ | |
83 | Bool_t AliLHCTagCuts::IsAccepted(AliLHCTag *lhcTag) const { | |
84 | //Returns true if the event is accepted otherwise false. | |
85 | if(fLHCStateFlag) | |
86 | if((lhcTag->GetLHCState() != fLHCState)) | |
87 | return kFALSE; | |
88 | if(fLHCLuminosityFlag) | |
89 | if((lhcTag->GetLuminosity() < fLHCLuminosityMin)||(lhcTag->GetLuminosity() > fLHCLuminosityMax)) | |
90 | return kFALSE; | |
04cb11d4 | 91 | if (fNBunchesFlag) |
92 | if ((lhcTag->GetNBunches() < fNBunchesRange[0]) || (lhcTag->GetNBunches() > fNBunchesRange[1])) | |
93 | return kFALSE; | |
94 | if (fFillingSchemeFlag) | |
95 | if (!(lhcTag->GetFillingScheme().Contains(fFillingScheme))) | |
96 | return kFALSE; | |
97 | if (fFillNoFlag) | |
98 | if ((lhcTag->GetFillNo() < fFillNoRange[0]) || (lhcTag->GetFillNo() > fFillNoRange[1])) | |
99 | return kFALSE; | |
100 | if (fBeamEnergyFlag) | |
101 | if ((lhcTag->GetBeamEnergy() < fBeamEnergyRange[0]) || (lhcTag->GetBeamEnergy() > fBeamEnergyRange[1])) | |
102 | return kFALSE; | |
103 | if (fBunchIntensityFlag) | |
104 | if ((lhcTag->GetBunchIntensity() < fBunchIntensityRange[0]) || (lhcTag->GetBunchIntensity() > fBunchIntensityRange[1])) | |
105 | return kFALSE; | |
106 | ||
299ec65d | 107 | return kTRUE; |
108 | } |