PandaRoot
PndMeasurementBoundaries.h
Go to the documentation of this file.
1 //****************************************************************************
2 //* This file is part of PandaRoot. *
3 //* *
4 //* PandaRoot is distributed under the terms of the *
5 //* GNU General Public License (GPL) version 3, *
6 //* copied verbatim in the file "LICENSE". *
7 //* *
8 //* Copyright (C) 2006 - 2024 FAIR GmbH and copyright holders of PandaRoot *
9 //* The copyright holders are listed in the file "COPYRIGHTHOLDERS". *
10 //* The authors are listed in the file "AUTHORS". *
11 //****************************************************************************
12 
13 /*
14  * PndMeasurementBoundaries.h
15  *
16  * Created on: 09.11.2022
17  * Author: tstockmanns
18  */
19 
20 #pragma once
21 
22 #include <string>
23 #include <ostream>
24 #include <map>
25 #include <iostream>
26 
28  PndMeasurementObject(std::string name = "", double lowVal = 0., double highVal = 0.) : fVerboseName(name), fLowerBoundary(lowVal), fHigherBoundary(highVal) {}
29  std::string fVerboseName;
30  double fValue = 0;
31  double fLowerBoundary = 0;
32  double fHigherBoundary = 0;
33  bool PassTest() { return ((fValue > fLowerBoundary) && (fValue < fHigherBoundary)); }
34 };
35 
37  public:
39  virtual ~PndMeasurementBoundaries();
40  void SetBoundaries(std::string mapName, double lowVal, double highVal, std::string measurementName = "");
41  void SetMeasurement(std::string name, double val);
42  bool CheckBoundaries();
43  PndMeasurementObject GetMeasurement(std::string mapName);
44  std::map<std::string, PndMeasurementObject> GetMeasurementMap() const { return fMeasurementBoundaries; }
45  void PrintDartMeasurement(std::ostream &out = std::cout);
46 
47  private:
48  std::map<std::string, PndMeasurementObject> fMeasurementBoundaries;
49 };
std::map< std::string, PndMeasurementObject > GetMeasurementMap() const
PndMeasurementObject(std::string name="", double lowVal=0., double highVal=0.)