Commit 36c513a8 authored by Stezowski Olivier's avatar Stezowski Olivier
Browse files

Start modifications includes protections and namespace introduction

git-svn-id: svn+ssh://anonsvn.in2p3.fr/agata/gammaware/trunk@78 c3abf467-7ff2-0310-b516-c5fb849bdde0
parent c8554b8a
......@@ -51,5 +51,5 @@ The general Makefile uses the MAKE variables to build individual packages.
It can be changed with, for instance with:
configure 'MAKE=gmake'
Any problems/suggestions, please contact stezow@ipnl.in2p3.fr
Any problems/suggestions, please contact agata@ipnl.in2p3.fr
......@@ -73,7 +73,7 @@ using namespace std;
//#endif
/**
PlayerTH2 is a tool to play with a TH2 histrogram. It is mainly designed in the spirit of gamma-gamma matrices but could be used
PlayerTH2 is a tool to play with a TH2 histogram. It is mainly designed in the spirit of gamma-gamma matrices but could be used
also for general purposes.
......@@ -148,7 +148,7 @@ public:
//! set default width for gates
void SetWidthGate(Float_t wx = 2.5, Float_t wy = 2.5) { fWidthGate.first->SetParameter(0,wx); fWidthGate.second->SetParameter(0,wy); }
Int_t InitGating();
Int_t InitGating(const char *source = "gPad");
//! to project
void Projection(Option_t *option = "Gx");
......
#ifndef GW_BASEFILTER_H
#define GW_BASEFILTER_H
#ifndef ROOT_TBuffer
#include <TBuffer.h>
#endif
#ifndef ROOT_TList
#include <TList.h>
#endif
#include <GwRand.h>
......
......@@ -23,7 +23,8 @@
#ifndef GW_BASEGEM_H
#define GW_BASEGEM_H
#include "RandObj.h"
#include <RandObj.h>
#include <LevelScheme.h>
#include <Link.h>
......
......@@ -20,8 +20,9 @@
/** \file BaseENSDF.cpp compiled in libGWPHYSICS.so */
#ifndef GW_BASEENSDF_H
#include "BaseENSDF.h"
#endif
#include <math.h>
#include <iostream>
......
......@@ -20,8 +20,8 @@
/** \file BaseBaseENSDF.h base classe to interface to BaseENSDF Evaluated Nuclear Structure Data File */
#ifndef GW_BASE_ENSDF_H
#define GW_BASE_ENSDF_H
#ifndef GW_BASEENSDF_H
#define GW_BASEENSDF_H
#include <vector>
#include <iostream>
......
......@@ -24,7 +24,9 @@
#include <cstdlib>
using namespace std;
#ifndef GW_BASENUCLEUS_H
#include "BaseNucleus.h"
#endif
ClassImp(BaseNucleus);
......@@ -161,23 +163,26 @@ BaseNucleus::~BaseNucleus()
fA = fZ = fN = 0;
}
bool BaseNucleus::SetAZN(Int_t A, Int_t Z)
{
if ( A < 0 || Z < 0 || A < Z ) return false;
else {
fA = A; fZ = Z; fN = fA - fZ;
}
return true;
}
/*!
\fn BaseNucleus::SetAZN(Int_t, Int_t, Int_t)
Set the composition and check if it is ok
if A > Z changes nothing and returns false.
if N != A - Z, it keeps A-Z and print a warning
*/
bool BaseNucleus::SetAZN(Int_t A, Int_t Z, Int_t N)
{
if ( A < Z ) return false;
if ( A < 0 || Z < 0 || A < Z ) return false;
fA = A; fZ = Z; fN = N;
fA = A; fZ = Z; fN = N;
// now check if it is consistant
if ( N != (A-Z) ) {
cout << " - ! - in BaseNucleus::Set N != A - Z " << endl;
fN = fA - fZ;
}
return true;
// now check if it is consistant
if ( N != (A-Z) ) {
cout << " - ! - in BaseNucleus::Set N != A - Z " << endl;
fN = fA - fZ;
}
return true;
}
......@@ -20,17 +20,22 @@
/** \file BaseNucleus.h header file for a BaseNucleus */
#ifndef BASENUCLEUS_H
#define BASENUCLEUS_H
#ifndef GW_BASENUCLEUS_H
#define GW_BASENUCLEUS_H
#ifndef ROOT_Tobject
#include <TObject.h>
#endif
#define MAXSYMBOL 120
#define SYMBOLLENGTH 4
/** Base class for a nucleus which means its composition
@author Olivier Stezowski
This class will be used widely to define a nucleus as composed on nucleons. Because it will be extended
to strange nucleus,
@author Olivier Stezowski
*/
class BaseNucleus : public TObject
{
......@@ -49,8 +54,17 @@ public:
Int_t GetA() const;
Int_t GetZ() const;
Int_t GetN() const;
bool SetAZN(Int_t, Int_t, Int_t);
Int_t GetN() const;
//!
bool SetAZN(Int_t, Int_t);
//!
/*
It returns false (without changing anything) if it cannot be a nucleus (i.e. A < Z).
If N != A - Z, it keeps A-Z and send a warning.
*/
bool SetAZN(Int_t, Int_t, Int_t);
//! Root dictionary related
ClassDef(BaseNucleus,0); // Base class for a nucleus (just composition)
......
......@@ -20,8 +20,13 @@
/** \file Cascade.cpp compiled in libGWPHYSICS.so */
#include "Cascade.h"
#ifndef ROOT_TString
#include <TString.h>
#endif
#ifndef GW_CASCADE_H
#include "Cascade.h"
#endif
ClassImp(Cascade);
......
......@@ -20,11 +20,16 @@
/** \file Cascade.h header file for a Cascade */
#ifndef CASCADE_H
#define CASCADE_H
#ifndef GW_CASCADE_H
#define GW_CASCADE_H
#ifndef ROOT_TList
#include <TList.h>
#endif
#ifndef ROOT_TLatex
#include <TLatex.h>
#endif
/**
A cascade is a list of links
......
......@@ -20,7 +20,9 @@
/** \file Data.cpp root dictionary compiled in libGWPHYSICS.so */
#ifndef GW_DATA_H
#include "Data.h"
#endif
#if defined(__SUNPRO_CC)
......
......@@ -30,10 +30,12 @@
* - Data<Double_t>
*/
#ifndef DATA_H
#define DATA_H
#ifndef GW_DATA_H
#define GW_DATA_H
#ifndef GW_INFODATA_H
#include "InfoData.h"
#endif
/**
A single value data.
......
......@@ -20,7 +20,10 @@
/** \file ENSDF.cpp compiled in libGWPHYSICS.so */
#ifndef GW_BASEENSDF_H
#include "ENSDF.h"
#endif
#include "XGammaLink.h"
#include "NuclearLevel.h"
#include "LevelScheme.h"
......
......@@ -23,10 +23,19 @@
#ifndef GW_ENSDF_H
#define GW_ENSDF_H
#ifndef GW_BASEENSDF_H
#include "BaseENSDF.h"
#endif
#ifndef ROOT_Rtypes
#include <Rtypes.h>
#endif
#ifndef ROOT_Gtypes
#include <Gtypes.h>
#endif
#ifndef ROOT_TString
#include <TString.h>
#endif
class Level;
class Link;
......
......@@ -20,8 +20,13 @@
/** \file GammaLink.cpp compiled in libGWPHYSICS.so */
#ifndef GW_GAMMALINK_H
#include "GammaLink.h"
#endif
#ifndef ROOT_TString
#include <TString.h>
#endif
#include <iostream>
#include <iomanip>
......
......@@ -23,9 +23,15 @@
#ifndef GW_GAMMALINK_H
#define GW_GAMMALINK_H
#ifndef GW_LINK_h
#include "Link.h"
#endif
#ifndef GW_DATA_h
#include "Data.h"
#endif
#ifndef GW_MEASURE_h
#include "Measure.h"
#endif
/**
A GammaLink binds two nuclear levels
......@@ -86,7 +92,7 @@ public:
virtual void ls(Option_t* option = "") const ;
//! rootcint dictionary
ClassDef(GammaLink,1); // a GammaLink binds two nuclear levels
ClassDef(GammaLink,1); // A GammaLink binds two nuclear levels
};
// inline members
#endif
/***************************************************************************
* Copyright (C) 2004 by Olivier Stezowski *
* stezow@ipnl.in2p3.fr *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
/** \file GwEvents.cpp compiled in libGWPHYSICS.so */
#ifndef ROOT_TClass
#include "TClass.h"
#endif
#ifndef GW_GWEVENTS_H
#include "GwEvents.h"
#endif
using namespace GammaWare;
ClassImp(EPoint);
EPoint::EPoint() : E(0.0), X(0.0), Y(0.0), Z(0.0)
{
EPoint::Class()->IgnoreTObjectStreamer();
}
void EPoint::Clear(Option_t *opt)
{
TString o = opt; E = 0.0; X = Y = Z = 0.0;
}
ClassImp(TrackedGamma);
/***************************************************************************
* Copyright (C) 2004 by Olivier Stezowski *
* stezow@ipnl.in2p3.fr *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
/** \file GwEvents.h header file for */
#ifndef GW_GWEVENTS_H
#define GW_GWEVENTS_H
#ifndef ROOT_Rtypes
#include "Rtypes.h"
#endif
#ifndef ROOT_TObject
#include "TObject.h"
#endif
namespace Gw {
/**
@author Olivier Stezowski
*/
class EPoint : public TObject
{
private:
Float_t E; // Energy
Float_t X; // X position
Float_t Y; // Y position
Float_t Z; // Z position
public:
EPoint();
virtual ~EPoint() {;}
virtual void Clear(Option_t *);
virtual void Set(Float_t e, Float_t x, Float_t y, Float_t z) { E=e; X=x; Y=y; Z=z; }
//! Root dictionary related
ClassDef(EPoint,1); // A 3D point associated with an energy
};
class TrackedGamma : public TObject
{
private:
Float_t E; // Energy
Float_t Theta1; // Theta first impact
Float_t Phi1; // Phi first impact
Float_t Theta2; // Theta second impact
Float_t Phi2; // Phi second impact
public:
TrackedGamma() : E(0.0) , Theta1(0.0), Phi1(0.0), Theta2(0.0), Phi2(0.0) {;}
virtual ~TrackedGamma() {;}
virtual void Set(Float_t e, Float_t t1, Float_t p1, Float_t t2, Float_t p2) {E=e; Theta1=t1; Phi1=p1; Theta2=t2; Phi2=p2;}
//! Root dictionary related
ClassDef(TrackedGamma,1); // Base for single tracked gamma
};
} // namespace GammaWare
#endif
#ifdef __CINT__
#pragma link C++ class GammaWare::EPoint+;
#pragma link C++ class GammaWare::TrackedGamma+;
#endif
......@@ -20,11 +20,21 @@
/** \file GwRand.cpp compiled in libGWPHYSICS.so */
#ifndef GW_GWRAND_H
#include "GwRand.h"
#endif
#ifndef ROOT_TList
#include <TList.h>
#endif
#ifndef ROOT_TRandom2
#include <TRandom2.h>
#endif
#ifndef ROOT_TRandom3
#include <TRandom3.h>
#endif
ClassImp(GwRand);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment