PandaRoot
PndHypGeGammaAna.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 
15 Analysis Task created by M.Steinen steinen@kph.uni-mainz.de
16 Analysis of Gamma Simulation with hypGe detectors
17 *******************************************************/
18 
19 #ifndef PNDHYPGEGAMMAANA_H
20 #define PNDHYPGEGAMMAANA_H 1
21 
22 #include <FairTask.h>
23 #include <TH1D.h>
24 #include <TH2D.h>
25 #include <TClonesArray.h>
26 #include <TRandom.h>
27 #include <fstream>
28 #include <set>
29 //#include "PndHypGeGammaAnaStorage.h"
30 #include "PndHypGePoint.h"
31 #include "PndHypPoint.h"
32 #include "PndMCTrack.h"
33 #include <TSpectrum.h>
34 #include <TF1.h>
35 #include "TGeoManager.h"
36 
37 class PndHypGeGammaAna : public FairTask {
38  public:
40  PndHypGeGammaAna(TString TxtFileName_Ext, Double_t GammaEnergy_Ext, Int_t nEvents = 0, Int_t nPeaks_Ext = 1, Int_t PeakToLook_Ext = 1);
42 
43  virtual InitStatus Init();
44  virtual void Exec(Option_t *opt);
45  void Finish();
46  void SetParContainers();
47  void SetTarget(Bool_t TargetAvailable = 1);
48  void SetOmegaQuadrupolMode(Bool_t useOmegaQuadrupolMode_ext = 1);
49  void SetPeakWidtchStrechFactor(Double_t PeakWidtchStrechFactor_ext = 1);
50 
51  protected:
52  Double_t Compton(Double_t E, Double_t Th);
53  Double_t invCompton(Double_t E, Double_t Eprime);
54  Double_t SmearHit(Double_t Energy);
55  Double_t CalculatePeakWidth(Double_t Energy);
56  void FitSpectrum();
57  void FittingOutput();
58  void FindPeaks();
59  void GetPeakContent();
60  void ActivateComptonCalculations(Bool_t isActivated = 1);
61  void CalculateCompton();
62  void WriteHistogramsToFile();
63  void HistogramCosmetics(TH1D *histo, TString XTitle, Double_t XTitleSize, Double_t XTitleOffset, Double_t XLabelSize, TString YTitle, Double_t YTitleSize, Double_t YTitleOffset,
64  Double_t YLabelSize);
65  void HistogramCosmetics2D(TH2D *histo, TString XTitle, Double_t XTitleSize, Double_t XTitleOffset, Double_t XLabelSize, TString YTitle, Double_t YTitleSize,
66  Double_t YTitleOffset, Double_t YLabelSize);
67 
69  TString TxtFileName;
70  ofstream TxtFile;
71 
73 
74  Double_t ResConstPar;
75  Double_t ResGradientPar;
77  Double_t PeakWidth;
78 
79  Double_t bufferEnergy;
80 
81  TH1D *hGamEnergy;
84  TH1D *hThetaCheck;
86  TH1D *hAbsorption;
88 
89  TClonesArray *fMcTr;
90  TClonesArray *fMc;
91  TClonesArray *fGe;
92  TClonesArray *fGeAl;
93  TClonesArray *fSilicon;
94  TClonesArray *fTargetOther;
95 
97  ;
102 
103  Long_t EvtCount;
105  Double_t GammaEnergy;
107  TString fName;
108 
109  // PndHypGeGammaAnaStorage* fStorage;
110 
111  FairRootManager *ioman;
112  // Exec
113  std::set<int> SetOfCrystalHit;
114  TVector3 fStartVertex;
116 
117  // Analysis
118  Int_t nPeaks;
119  Int_t PeakToLook;
120  Double_t PeakX;
121  Double_t PeakY;
122  Double_t DPeakY;
123  Double_t SumPeak;
124  Double_t DSumPeak;
126  Double_t lowComptonAngle;
128  Double_t SumCompton;
129  Double_t DSumCompton;
130  Double_t PeakToCompton;
131  Double_t DPeakToCompton;
132 
133  TF1 *GausBG;
134 
135  Float_t *xpeaks;
136  Float_t *ypeaks;
137 
139 
141 };
142 
143 #endif /* PNDHYPGEGAMMAANA_H */
PndMCTrack * fMCGam
TClonesArray * fMc
void ActivateComptonCalculations(Bool_t isActivated=1)
void HistogramCosmetics(TH1D *histo, TString XTitle, Double_t XTitleSize, Double_t XTitleOffset, Double_t XLabelSize, TString YTitle, Double_t YTitleSize, Double_t YTitleOffset, Double_t YLabelSize)
PndHypGePoint * fHitGe
Double_t CalculatePeakWidth(Double_t Energy)
bool InTargetAbsorbedGammaWouldHitGermanium()
void WriteHistogramsToFile()
void SetParContainers()
void SetTarget(Bool_t TargetAvailable=1)
TClonesArray * fMcTr
Double_t PeakWidtchStrechFactor
Double_t invCompton(Double_t E, Double_t Eprime)
TClonesArray * fSilicon
void HistogramCosmetics2D(TH2D *histo, TString XTitle, Double_t XTitleSize, Double_t XTitleOffset, Double_t XLabelSize, TString YTitle, Double_t YTitleSize, Double_t YTitleOffset, Double_t YLabelSize)
PndMCTrack * fMCGamPrimary
Bool_t useOmegaQuadrupolMode
Double_t Compton(Double_t E, Double_t Th)
void SetPeakWidtchStrechFactor(Double_t PeakWidtchStrechFactor_ext=1)
void SetOmegaQuadrupolMode(Bool_t useOmegaQuadrupolMode_ext=1)
virtual InitStatus Init()
TClonesArray * fGeAl
std::set< int > SetOfCrystalHit
TClonesArray * fTargetOther
PndHypPoint * fHitSi
PndHypPoint * fHitTargetOther
TH1D * hGamEnergyTargetBackground
Double_t SmearHit(Double_t Energy)
TH2D * h2AbsorptionDistanceAngle
virtual void Exec(Option_t *opt)
ClassDef(PndHypGeGammaAna, 1)
TClonesArray * fGe
void CalculateCompton()
FairRootManager * ioman