PandaRoot
PndSensorNamePar.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 // C++ Interface: PndSensorNamePar
15 //
16 #ifndef PNDSENSORNAMEPAR_H
17 #define PNDSENSORNAMEPAR_H
18 
19 #include "FairParGenericSet.h"
20 #include "FairParamList.h"
21 #include "FairRun.h"
22 
23 #include "TObjArray.h"
24 #include "TObjString.h"
25 
26 #include <iostream>
27 #include <map>
28 
30 class PndSensorNamePar : public FairParGenericSet {
31  public:
32  PndSensorNamePar(const char *name = "PndSensorNamePar", const char *title = "Match between GeoManager path and SensorId", const char *context = "TestDefaultContext");
33  ~PndSensorNamePar(void);
34 
35  void clear(void){};
36  void putParams(FairParamList *list);
37  Bool_t getParams(FairParamList *list);
38 
39  virtual void print() { Print(); }
40  void Print();
41 
42  Int_t AddSensorName(TObjString *name);
43 
44  Int_t SensorInList(TObjString *name);
45 
46  void FillMap();
47 
48  TString GetSensorName(Int_t index);
49 
50  TObjArray *GetSensorNames() const { return fSensorNames; }
51 
52  std::vector<TString> GetSensorNamesWithString(TString identifier);
53 
56 
57  friend std::ostream &operator<<(std::ostream &output, const PndSensorNamePar &par);
58  Int_t AddSensorNameAndId(TObjString *name, Int_t id);
59 
60  private:
61  TObjArray *fSensorNames;
62  std::map<TString, Int_t> fMapOfSensorNames;
63  std::map<Int_t, TString> fMapOfSensorIndizes;
64 
65  ClassDef(PndSensorNamePar, 1);
66 };
67 
68 #endif
std::vector< TString > GetSensorNamesWithString(TString identifier)
Bool_t getParams(FairParamList *list)
friend std::ostream & operator<<(std::ostream &output, const PndSensorNamePar &par)
TString GetSensorName(Int_t index)
PndSensorNamePar(const char *name="PndSensorNamePar", const char *title="Match between GeoManager path and SensorId", const char *context="TestDefaultContext")
Int_t SensorInList(TObjString *name)
Int_t AddSensorName(TObjString *name)
PndSensorNamePar & operator=(const PndSensorNamePar &L)
virtual void print()
void putParams(FairParamList *list)
Int_t AddSensorNameAndId(TObjString *name, Int_t id)
TObjArray * GetSensorNames() const
Unique match between SensorID and path in TGeoManager.