FairRoot
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
FairMesh.cxx
Go to the documentation of this file.
1 /********************************************************************************
2  * Copyright (C) 2014 GSI Helmholtzzentrum fuer Schwerionenforschung GmbH *
3  * *
4  * This software is distributed under the terms of the *
5  * GNU Lesser General Public Licence (LGPL) version 3, *
6  * copied verbatim in the file "LICENSE" *
7  ********************************************************************************/
8 // -------------------------------------------------------------------------
9 // ----- FairMesh source file -----
10 // ----- original author D.Bertini -----
11 // ----- adapted april 2010 O.Hartmann -----
12 // -------------------------------------------------------------------------
13 
14 #include "FairMesh.h"
15 
16 #include <TMath.h> // for Sqrt
17 #include <TString.h> // for TString, operator+
18 #include <iostream> // for operator<<, basic_ostream, etc
19 
20 using namespace std;
21 
23  : TObject()
24  , fXmin(0.0)
25  , fYmin(0.)
26  , fZmin(0.)
27  , fXmax(0.)
28  , fYmax(0.)
29  , fZmax(0.)
30  , NXbin(0)
31  , NYbin(0)
32  , NZbin(0)
33  , fBinVolume(0.)
34  , fDiag(0.)
35  , fMeshTid(nullptr)
36  , fMeshFlu(nullptr)
37  , fMeshSEU(nullptr)
38  , fhname("")
39 {}
40 
41 FairMesh::FairMesh(const char* fname)
42  : TObject()
43  , fXmin(0.0)
44  , fYmin(0.)
45  , fZmin(0.)
46  , fXmax(0.)
47  , fYmax(0.)
48  , fZmax(0.)
49  , NXbin(0)
50  , NYbin(0)
51  , NZbin(0)
52  , fBinVolume(0.)
53  , fDiag(0.)
54  , fMeshTid(nullptr)
55  , fMeshFlu(nullptr)
56  , fMeshSEU(nullptr)
57  , fhname(fname)
58 {
59  // fhname = fname;
60 }
61 
63 {
64  // compute numbers
65 
66  TString tid = fhname + "TID";
67  fMeshTid = new TH2D(tid.Data(), "TID", NXbin, fXmin, fXmax, NYbin, fYmin, fYmax);
68  fMeshTid->Sumw2();
69 
70  TString flu = fhname + "FLU";
71  fMeshFlu = new TH2D(flu.Data(), "Fluence", NXbin, fXmin, fXmax, NYbin, fYmin, fYmax);
72  fMeshFlu->Sumw2();
73 
74  TString seu = fhname + "SEU";
75  fMeshSEU = new TH2D(seu.Data(), "SEU", NXbin, fXmin, fXmax, NYbin, fYmin, fYmax);
76  fMeshSEU->Sumw2();
77 
78  // reseting
79  fMeshTid->Reset();
80  fMeshFlu->Reset();
81  fMeshSEU->Reset();
82 
83  fBinVolume = ((fXmax - fXmin) / NXbin) * ((fYmax - fYmin) / NYbin) * ((fZmax - fZmin) / NZbin);
84 
85  fDiag = TMath::Sqrt(((fXmax - fXmin) / NXbin) * ((fXmax - fXmin) / NXbin)
86  + ((fYmax - fYmin) / NYbin) * ((fYmax - fYmin) / NYbin)
87  + ((fZmax - fZmin) / NZbin) * ((fZmax - fZmin) / NZbin));
88 }
89 
91 
93 {
94  cout << " Xmin " << fXmin << " Xmax " << fXmax << endl;
95  cout << " Ymin " << fYmin << " Ymax " << fYmax << endl;
96  cout << " Zmin " << fZmin << " Zmax " << fZmax << endl;
97  cout << " NX " << NXbin << " NY " << NXbin << endl;
98 }
99 
Int_t NYbin
Definition: FairMesh.h:91
void calculate()
Definition: FairMesh.cxx:62
void print()
Definition: FairMesh.cxx:92
Double_t fXmax
Definition: FairMesh.h:90
ClassImp(FairEventBuilder)
Double_t fBinVolume
Definition: FairMesh.h:92
Int_t NXbin
Definition: FairMesh.h:91
TH2D * fMeshFlu
Definition: FairMesh.h:95
Double_t fYmin
Definition: FairMesh.h:89
FairMesh()
Definition: FairMesh.cxx:22
Double_t fYmax
Definition: FairMesh.h:90
TH2D * fMeshSEU
Definition: FairMesh.h:96
virtual ~FairMesh()
Definition: FairMesh.cxx:90
TH2D * fMeshTid
Definition: FairMesh.h:94
Double_t fZmax
Definition: FairMesh.h:90
Int_t NZbin
Definition: FairMesh.h:91
Double_t fZmin
Definition: FairMesh.h:89
Double_t fDiag
Definition: FairMesh.h:93
TString fhname
Definition: FairMesh.h:97
Double_t fXmin
Definition: FairMesh.h:89