]>
Commit | Line | Data |
---|---|---|
4dd405ae | 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 | // AliDetectorTagCuts class | |
18 | // This is the class to deal with the Detector tag level cuts | |
19 | // Origin: Panos Christakoglou, UOA-CERN, Panos.Christakoglou@cern.ch | |
20 | //----------------------------------------------------------------- | |
21 | ||
22 | class AliLog; | |
23 | ||
24 | #include "AliDetectorTag.h" | |
25 | #include "AliDetectorTagCuts.h" | |
26 | ||
27 | #include "TObjString.h" | |
28 | #include "TString.h" | |
29 | ||
30 | ClassImp(AliDetectorTagCuts) | |
31 | ||
32 | //___________________________________________________________________________ | |
33 | AliDetectorTagCuts::AliDetectorTagCuts() : | |
34 | TObject(), | |
3ace8f92 | 35 | fDetectorsReco(0), |
8273eff5 | 36 | fDetectorsDAQ(0), |
4dd405ae | 37 | fDetectorsFlag(kFALSE) |
38 | { | |
39 | //Default constructor which calls the Reset method. | |
40 | } | |
41 | ||
42 | //___________________________________________________________________________ | |
43 | AliDetectorTagCuts::~AliDetectorTagCuts() { | |
44 | //Defaut destructor. | |
45 | } | |
46 | ||
47 | //___________________________________________________________________________ | |
48 | Bool_t AliDetectorTagCuts::IsAccepted(AliDetectorTag *detTag) const { | |
49 | //Returns true if the event is accepted otherwise false. | |
3ace8f92 | 50 | if (fDetectorsFlag) { |
51 | Bool_t daqsel = (detTag->GetIntDetectorMaskDAQ() & fDetectorsDAQ) > 0; | |
52 | Bool_t recsel = (detTag->GetIntDetectorMaskReco() & fDetectorsReco) > 0; | |
53 | return (daqsel && recsel); | |
4dd405ae | 54 | } |
3ace8f92 | 55 | return true; |
56 | ||
57 | // if(fDetectorsFlag){ | |
58 | // TString detStr = fDetectors; | |
59 | // TObjArray *activeDetectors = detTag->GetDetectorMask(); | |
60 | // for (Int_t iDet = 0; iDet < activeDetectors->GetEntries(); iDet++) { | |
61 | // TObjString *detectorString = (TObjString *)activeDetectors->At(iDet); | |
62 | // if (!IsSelected(detectorString->GetString(), detStr))return kFALSE; | |
63 | // } | |
64 | // } | |
65 | // return kTRUE; | |
4dd405ae | 66 | } |
67 | ||
68 | //___________________________________________________________________________ | |
3ace8f92 | 69 | // Bool_t AliDetectorTagCuts::IsSelected(TString detName, TString& detectors) const { |
70 | // //Returns true if the detector is included | |
71 | // if ((detectors.CompareTo("ALL") == 0) || | |
72 | // detectors.BeginsWith("ALL ") || | |
73 | // detectors.EndsWith(" ALL") || | |
74 | // detectors.Contains(" ALL ")) { | |
75 | // detectors = "ALL"; | |
76 | // return kTRUE; | |
77 | // } | |
4dd405ae | 78 | |
3ace8f92 | 79 | // // search for the given detector |
80 | // Bool_t result = kFALSE; | |
81 | // if ((detectors.CompareTo(detName) == 0) || | |
82 | // detectors.BeginsWith(detName+" ") || | |
83 | // detectors.EndsWith(" "+detName) || | |
84 | // detectors.Contains(" "+detName+" ")) { | |
85 | // detectors.ReplaceAll(detName, ""); | |
86 | // result = kTRUE; | |
87 | // } | |
4dd405ae | 88 | |
3ace8f92 | 89 | // // clean up the detectors string |
90 | // while (detectors.Contains(" ")) detectors.ReplaceAll(" ", " "); | |
91 | // while (detectors.BeginsWith(" ")) detectors.Remove(0, 1); | |
92 | // while (detectors.EndsWith(" ")) detectors.Remove(detectors.Length()-1, 1); | |
4dd405ae | 93 | |
3ace8f92 | 94 | // return result; |
95 | // } |