CbmRoot
Loading...
Searching...
No Matches
CbmStsAnaBase.h
Go to the documentation of this file.
1/* Copyright (C) 2023 GSI Helmholtzzentrum fuer Schwerionenforschung, Darmstadt
2 SPDX-License-Identifier: GPL-3.0-only
3 Authors: Dario Ramirez [committer] */
4
5#ifndef CBMSTSANABASE_H
6#define CBMSTSANABASE_H
7
8#include "CbmCutMap.h"
9#include "CbmDefs.h"
10#include "CbmStsSetup.h"
11#include "CbmStsUtils.h"
12
13#include <FairRootManager.h>
14#include <Logger.h>
15
16#include <TCanvas.h>
17#include <TClonesArray.h>
18#include <TFile.h>
19#include <TGraphErrors.h>
20#include <TH1D.h>
21#include <TH2D.h>
22#include <TSystem.h>
23
24#include <cstring>
25#include <map>
26#include <optional>
27#include <unordered_set>
28
29
37
46 public:
47 CbmStsAnaBase() = default;
48 virtual ~CbmStsAnaBase() = default;
49
54 void SetCutMap(CbmCutMap* map);
55
60 void UserAlignment(const std::map<int32_t, std::vector<double>>& user_mat) { fUserAlignment = user_mat; }
61
65 virtual void DrawResults() {}
66
67 protected:
68 uint entry_{0};
69 std::unique_ptr<TFile> fReportFile;
70 std::unordered_set<int32_t> fAddressBook;
71 std::map<std::string, std::unique_ptr<TGraphErrors>> fG1D; // Map of TGraphErrors objects.
72 std::map<std::string, std::unique_ptr<TH1D>> fH1D; // Map of TH1D objects.
73 std::map<std::string, std::unique_ptr<TH2D>> fH2D; // Map of TH2D objects.
74 std::map<std::string, std::shared_ptr<TH2D>> fH2DShared; // Map of TH2D objects.
75 std::map<std::string, std::unique_ptr<TCanvas>> fCanvas; // Map of TH2D objects.
76
77 int nb_sts_station_{8}; // Number of STS stations.
78 std::unordered_map<int32_t, std::vector<double>> fStsGeoInfo; // Map of STS geometry information.
79
80 std::map<int32_t, std::vector<double>> fUserAlignment; // Stores the user-defined alignment information.
81
82 std::unordered_map<int32_t, int> fFirstZStrip;
83
85
86 int fRunId{-1};
87
92 void LoadSetup();
93
97 void SaveToFile();
98
100};
101#endif
InputType
@ kEventMode
@ kMCTimeMode
@ kTimeMode
@ kMCEventMode
Manages a map of cuts associated with their IDs.
Definition CbmCutMap.h:19
CbmCutMap * fAnalysisCuts
std::unordered_set< int32_t > fAddressBook
ClassDef(CbmStsAnaBase, 1)
virtual ~CbmStsAnaBase()=default
std::unique_ptr< TFile > fReportFile
std::map< std::string, std::unique_ptr< TGraphErrors > > fG1D
std::unordered_map< int32_t, int > fFirstZStrip
std::map< std::string, std::unique_ptr< TH2D > > fH2D
std::map< std::string, std::shared_ptr< TH2D > > fH2DShared
virtual void DrawResults()
Virtual function to draw analysis results.
void SaveToFile()
It write all mapped objects to the FairRunAna sink file.
std::map< std::string, std::unique_ptr< TCanvas > > fCanvas
void LoadSetup()
Load the STS setup and fill the map with XYZ boundaries for each STS setup element....
CbmStsAnaBase()=default
void UserAlignment(const std::map< int32_t, std::vector< double > > &user_mat)
User defined sensor translations.
std::unordered_map< int32_t, std::vector< double > > fStsGeoInfo
std::map< std::string, std::unique_ptr< TH1D > > fH1D
void SetCutMap(CbmCutMap *map)
Set the cut map for analysis.
std::map< int32_t, std::vector< double > > fUserAlignment