// ------------------------------------------------------------------------- // ----- FairMesh source file ----- // ----- original author D.Bertini ----- // ----- adapted april 2010 O.Hartmann ----- // ------------------------------------------------------------------------- #include "FairMesh.h" #include "TString.h" #include "TMath.h" #include using namespace std; // ----- Default constructor ------------------------------------------- FairMesh::FairMesh() : TObject(), fXmin (0.0), fYmin(0.), fZmin (0.), fXmax(0.), fYmax(0.), fZmax(0.), NXbin(0), NYbin(0), NZbin(0), fBinVolume(0.), fDiag(0.), fMeshTid(NULL), fMeshFlu(NULL), fMeshSEU(NULL), fhname("") { } FairMesh::FairMesh(const char* fname) : TObject(), fXmin (0.0), fYmin(0.), fZmin (0.), fXmax(0.), fYmax(0.), fZmax(0.), NXbin(0), NYbin(0), NZbin(0), fBinVolume(0.), fDiag(0.), fMeshTid(NULL), fMeshFlu(NULL), fMeshSEU(NULL), fhname(fname) { // fhname = fname; } void FairMesh::calculate() { // compute numbers TString tid = fhname + "TID"; fMeshTid = new TH2D(tid.Data(),"TID", NXbin, fXmin,fXmax,NYbin,fYmin,fYmax); fMeshTid->Sumw2(); TString flu = fhname + "FLU"; fMeshFlu = new TH2D(flu.Data(),"Fluence", NXbin, fXmin,fXmax,NYbin,fYmin,fYmax); fMeshFlu->Sumw2(); TString seu = fhname + "SEU"; fMeshSEU = new TH2D(seu.Data(),"SEU", NXbin, fXmin,fXmax,NYbin,fYmin,fYmax); fMeshSEU->Sumw2(); // reseting fMeshTid->Reset(); fMeshFlu->Reset(); fMeshSEU->Reset(); fBinVolume = ((fXmax-fXmin)/NXbin) * ((fYmax-fYmin)/NYbin) * ((fZmax-fZmin)/NZbin); fDiag = TMath::Sqrt( ((fXmax-fXmin)/NXbin)*((fXmax-fXmin)/NXbin) + ((fYmax-fYmin)/NYbin)*((fYmax-fYmin)/NYbin) + ((fZmax-fZmin)/NZbin)*((fZmax-fZmin)/NZbin) ); } // ----- Destructor ---------------------------------------------------- FairMesh::~FairMesh() { } // ------------------------------------------------------------------------- void FairMesh::print() { cout << " Xmin " << fXmin << " Xmax " << fXmax << endl; cout << " Ymin " << fYmin << " Ymax " << fYmax << endl; cout << " Zmin " << fZmin << " Zmax " << fZmax << endl; cout << " NX " << NXbin << " NY " << NXbin << endl; } ClassImp(FairMesh)