Heavy ion Analysis Libriares
Loading...
Searching...
No Matches
CorrFitMask3D.h
1/*
2 * CorrFitMask3Da.h
3 *
4 * Created on: 12 lut 2023
5 * Author: Daniel Wielanek
6 * E-mail: daniel.wielanek@gmail.com
7 * Warsaw University of Technology, Faculty of Physics
8 */
9#ifndef HAL_ANALYSIS_FEMTO_CORRFIT_CORRFITOPT_CORRFITMASK3DA_H_
10#define HAL_ANALYSIS_FEMTO_CORRFIT_CORRFITOPT_CORRFITMASK3DA_H_
11
12#include "Array.h"
13#include "CorrFitMask.h"
14
15#include <vector>
16
17#include <RtypesCore.h>
18
19namespace Hal {
20 class CorrFitMask3D : public CorrFitMask {
21 public:
22 enum class EFitExtraMask {
23 kStandard,
24 kSlice,
25 kDiagonalSlice,
26 kUltraDiagonalSlice,
27 kDiagonalSliceIgnored,
28 kUltraDiagonalSliceIgnored
29 };
30
31 private:
32 Int_t fBins[3];
33 Double_t fMin[3], fMax[3];
34 std::vector<std::vector<std::vector<Short_t>>> fRawMask;
35 void CalcMap(Array_3<Short_t>& map, EFitExtraMask mask);
36 void CalculateDiagonalBins(Array_3<Short_t>& map, EFitExtraMask mask);
37 void CalculateUltradiagonalBins(Array_3<Short_t>& map, EFitExtraMask mask);
38 void CalculateSliceBins(Array_3<Short_t>& map);
39
40 public:
41 CorrFitMask3D(Int_t binsX = 100,
42 Double_t minX = 0,
43 Double_t maxX = 1,
44 Int_t binsY = 100,
45 Double_t minY = 0,
46 Double_t maxY = 1,
47 Int_t binsZ = 100,
48 Double_t minZ = 0,
49 Double_t maxZ = 1);
50 void
51 ApplyRange(Double_t minX, Double_t maxX, Double_t minY, Double_t maxY, Double_t minZ, Double_t maxZ, Bool_t additive = kTRUE);
52 void ApplyMask(EFitExtraMask mask, Bool_t additive = kFALSE);
53 void SetBin(Int_t binX, Int_t binY, Int_t binZ, Bool_t state = true);
54 void Reset(Bool_t state = kTRUE);
55 void ApplyThreshold(const TH1& h, Double_t threshold = 0);
56 Bool_t Init();
57 inline Bool_t GetBinFlag(Int_t x, Int_t y, Int_t z) const { return fRawMask[x][y][z]; };
58 Bool_t AreCompatible(TObject* cf) const;
59 Int_t GetNBins() const { return fRawMask.size() - 2; };
60 Int_t GetNbinsX() const { return fRawMask.size() - 2; };
61 Int_t GetNbinsY() const { return fRawMask[0].size() - 2; };
62 Int_t GetNbinsZ() const { return fRawMask[0][0].size() - 2; };
63 virtual ~CorrFitMask3D() {};
64 ClassDef(CorrFitMask3D, 1)
65 };
66} // namespace Hal
67
68#endif /* HAL_ANALYSIS_FEMTO_CORRFIT_CORRFITOPT_CORRFITMASK3DA_H_ */