EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FairMesh.cxx
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file FairMesh.cxx
1 // -------------------------------------------------------------------------
2 // ----- FairMesh source file -----
3 // ----- original author D.Bertini -----
4 // ----- adapted april 2010 O.Hartmann -----
5 // -------------------------------------------------------------------------
6 
7 
8 #include "FairMesh.h"
9 #include "TString.h"
10 #include "TMath.h"
11 #include <iostream>
12 
13 using namespace std;
14 
15 // ----- Default constructor -------------------------------------------
17  : TObject(),
18  fXmin (0.0),
19  fYmin(0.),
20  fZmin (0.),
21  fXmax(0.),
22  fYmax(0.),
23  fZmax(0.),
24  NXbin(0),
25  NYbin(0),
26  NZbin(0),
27  fBinVolume(0.),
28  fDiag(0.),
29  fMeshTid(NULL),
30  fMeshFlu(NULL),
31  fMeshSEU(NULL),
32  fhname("")
33 {
34 
35 }
36 
37 FairMesh::FairMesh(const char* fname)
38  : TObject(),
39  fXmin (0.0),
40  fYmin(0.),
41  fZmin (0.),
42  fXmax(0.),
43  fYmax(0.),
44  fZmax(0.),
45  NXbin(0),
46  NYbin(0),
47  NZbin(0),
48  fBinVolume(0.),
49  fDiag(0.),
50  fMeshTid(NULL),
51  fMeshFlu(NULL),
52  fMeshSEU(NULL),
53  fhname(fname)
54 {
55 
56  // fhname = fname;
57 }
58 
60 {
61 // compute numbers
62 
63  TString tid = fhname + "TID";
64  fMeshTid = new TH2D(tid.Data(),"TID", NXbin, fXmin,fXmax,NYbin,fYmin,fYmax);
65  fMeshTid->Sumw2();
66 
67  TString flu = fhname + "FLU";
68  fMeshFlu = new TH2D(flu.Data(),"Fluence", NXbin, fXmin,fXmax,NYbin,fYmin,fYmax);
69  fMeshFlu->Sumw2();
70 
71  TString seu = fhname + "SEU";
72  fMeshSEU = new TH2D(seu.Data(),"SEU", NXbin, fXmin,fXmax,NYbin,fYmin,fYmax);
73  fMeshSEU->Sumw2();
74 
75 
76  // reseting
77  fMeshTid->Reset();
78  fMeshFlu->Reset();
79  fMeshSEU->Reset();
80 
81 
82  fBinVolume = ((fXmax-fXmin)/NXbin) *
83  ((fYmax-fYmin)/NYbin) *
84  ((fZmax-fZmin)/NZbin);
85 
86  fDiag = TMath::Sqrt(
87  ((fXmax-fXmin)/NXbin)*((fXmax-fXmin)/NXbin) +
88  ((fYmax-fYmin)/NYbin)*((fYmax-fYmin)/NYbin) +
89  ((fZmax-fZmin)/NZbin)*((fZmax-fZmin)/NZbin) );
90 }
91 // ----- Destructor ----------------------------------------------------
93 // -------------------------------------------------------------------------
95 {
96 
97  cout << " Xmin " << fXmin << " Xmax " << fXmax << endl;
98  cout << " Ymin " << fYmin << " Ymax " << fYmax << endl;
99  cout << " Zmin " << fZmin << " Zmax " << fZmax << endl;
100  cout << " NX " << NXbin << " NY " << NXbin << endl;
101 }
102 
103