REST-for-Physics  v2.3
Rare Event Searches ToolKit for Physics
TRestDataQualityRules.cxx
1 /*************************************************************************
2  * This file is part of the REST software framework. *
3  * *
4  * Copyright (C) 2016 GIFNA/TREX (University of Zaragoza) *
5  * For more information see http://gifna.unizar.es/trex *
6  * *
7  * REST is free software: you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation, either version 3 of the License, or *
10  * (at your option) any later version. *
11  * *
12  * REST is distributed in the hope that it will be useful, *
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15  * GNU General Public License for more details. *
16  * *
17  * You should have a copy of the GNU General Public License along with *
18  * REST in $REST_PATH/LICENSE. *
19  * If not, see http://www.gnu.org/licenses/. *
20  * For the list of contributors see $REST_PATH/CREDITS. *
21  *************************************************************************/
22 
39 #include "TRestDataQualityRules.h"
40 
41 #include <iostream>
42 using namespace std;
43 
44 ClassImp(TRestDataQualityRules);
45 
50 
55 
56 Bool_t TRestDataQualityRules::EvaluateMetadataRule(TString value, TVector2 range) {
57  /*
58  vector<string> results = REST_StringHelper::Split((string)value, "::", false, true);
59 
60  if (results.size() == 2) {
61  if (fRunInfo->GetMetadataClass(results[0])) {
62  string val = fRunInfo->GetMetadataClass(results[0])->GetDataMemberValue(results[1]);
63  Double_t dblVal = StringToDouble(val);
64 
65  // If the metadata value is in range we return true
66  if (dblVal >= range.X() && dblVal <= range.Y()) return true;
67  } else {
68  ferr << "TRestDataQualityRules::EvaluateMetadataRule." << endl;
69  ferr << "Metadata class " << results[0] << " is not available inside TRestRun" << endl;
70  }
71  } else
72  ferr << "TRestDataQualityRules::EvaluateMetadataRule. Wrong number of elements found" << endl;
73  */
74  cout << "TRestDataQualityRules::EvaluateMetadataRule is not implemented!" << endl;
75  return false;
76 }
A class to define the properties of a rule inside TRestDataQualityRules.
TRestDataQualityRules()
Default constructor.
~TRestDataQualityRules()
Default destructor.