]> git.uio.no Git - u/mrichter/AliRoot.git/blob - STEER/AliRunTagCuts.cxx
Protection against special particle types.
[u/mrichter/AliRoot.git] / STEER / AliRunTagCuts.cxx
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 //                   AliRunTagCuts class
18 //   This is the class to deal with the run tag level cuts
19 //   Origin: Panos Christakoglou, UOA-CERN, Panos.Christakoglou@cern.ch
20 //-----------------------------------------------------------------
21
22 class AliLog;
23 class AliESD;
24
25 #include "AliRunTag.h"
26 #include "AliRunTagCuts.h"
27
28 ClassImp(AliRunTagCuts)
29
30
31 //___________________________________________________________________________
32 AliRunTagCuts::AliRunTagCuts() :
33   TObject(),
34   fAliceRunId(-1),                  
35   fAliceRunIdFlag(kFALSE),              
36   fAliceMagneticField(-1.),          
37   fAliceMagneticFieldFlag(kFALSE),      
38   fAliceRunStartTimeMin(-1),        
39   fAliceRunStartTimeMax(-1),        
40   fAliceRunStartTimeFlag(kFALSE),       
41   fAliceRunStopTimeMin(-1),         
42   fAliceRunStopTimeMax(-1),         
43   fAliceRunStopTimeFlag(kFALSE),        
44   fAlirootVersion(""),              
45   fAlirootVersionFlag(kFALSE),          
46   fRootVersion(""),                 
47   fRootVersionFlag(kFALSE),             
48   fGeant3Version(""),               
49   fGeant3VersionFlag(kFALSE),           
50   fAliceRunQuality(0),             
51   fAliceRunQualityFlag(kFALSE),         
52   fAliceBeamEnergy(-1),             
53   fAliceBeamEnergyFlag(kFALSE),         
54   fAliceBeamType(""),               
55   fAliceBeamTypeFlag(kFALSE),           
56   fAliceCalibrationVersion(-1),    
57   fAliceCalibrationVersionFlag(kFALSE),
58   fAliceDataType(-1),                
59   fAliceDataTypeFlag(kFALSE)
60 {
61   //Default constructor which calls the Reset method.
62 }
63
64 //___________________________________________________________________________
65 AliRunTagCuts::~AliRunTagCuts() {  
66   //Defaut destructor.
67 }
68
69 //___________________________________________________________________________
70 void AliRunTagCuts::Reset() {
71   //Sets dummy values to every private member.
72   fAliceRunId = -1;                  
73   fAliceRunIdFlag = kFALSE;              
74   fAliceMagneticField = -1.;          
75   fAliceMagneticFieldFlag = kFALSE;      
76   fAliceRunStartTimeMin = -1;        
77   fAliceRunStartTimeMax = -1;        
78   fAliceRunStartTimeFlag = kFALSE;       
79   fAliceRunStopTimeMin = -1;         
80   fAliceRunStopTimeMax = -1;         
81   fAliceRunStopTimeFlag = kFALSE;        
82   fAlirootVersion = "";              
83   fAlirootVersionFlag = kFALSE;          
84   fRootVersion = "";                 
85   fRootVersionFlag = kFALSE;             
86   fGeant3Version = "";               
87   fGeant3VersionFlag = kFALSE;           
88   fAliceRunQuality = 0;             
89   fAliceRunQualityFlag = kFALSE;         
90   fAliceBeamEnergy = -1;             
91   fAliceBeamEnergyFlag = kFALSE;         
92   fAliceBeamType = "";               
93   fAliceBeamTypeFlag = kFALSE;           
94   fAliceCalibrationVersion = -1;    
95   fAliceCalibrationVersionFlag = kFALSE;
96   fAliceDataType = -1;                
97   fAliceDataTypeFlag = kFALSE;           
98 }
99
100 //___________________________________________________________________________
101 Bool_t AliRunTagCuts::IsAccepted(AliRunTag *RunTag) const {
102   //Returns true if the event is accepted otherwise false.
103   if(fAliceRunIdFlag)
104     if((RunTag->GetRunId() != fAliceRunId))
105       return kFALSE;
106   if(fAliceMagneticFieldFlag)
107     if((RunTag->GetMagneticField() != fAliceMagneticField))
108       return kFALSE;
109   if(fAliceRunStartTimeFlag)
110     if((RunTag->GetRunStartTime() < fAliceRunStartTimeMin) || (RunTag->GetRunStartTime() > fAliceRunStartTimeMax))
111       return kFALSE;
112   if(fAliceRunStopTimeFlag)
113     if((RunTag->GetRunStopTime() < fAliceRunStopTimeMin) || (RunTag->GetRunStopTime() > fAliceRunStopTimeMax))
114       return kFALSE;
115   if(fAlirootVersionFlag)
116     if((RunTag->GetAlirootVersion() != fAlirootVersion))
117       return kFALSE;
118   if(fRootVersionFlag)
119     if((RunTag->GetRootVersion() != fRootVersion))
120       return kFALSE;
121   if(fGeant3VersionFlag)
122     if((RunTag->GetGeant3Version() != fGeant3Version))
123       return kFALSE;
124   if(fAliceRunQualityFlag)
125     if(RunTag->GetRunQuality())
126       return kFALSE;
127   if(fAliceBeamEnergyFlag)
128     if(RunTag->GetBeamEnergy() != fAliceBeamEnergy)
129       return kFALSE;
130   if(fAliceBeamTypeFlag)
131     if(RunTag->GetBeamType() != fAliceBeamType)
132       return kFALSE;
133   if(fAliceCalibrationVersionFlag)
134     if(RunTag->GetBeamEnergy() != fAliceBeamEnergy)
135       return kFALSE;
136   if(fAliceDataTypeFlag)
137     if(RunTag->GetDataType() != fAliceDataType)
138       return kFALSE;
139  
140   return kTRUE;
141 }