GammaWare  Head Version for release 0.9
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
GEM.cpp
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) 2004 by Olivier Stezowski *
3  * stezow(AT)ipnl.in2p3.fr *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
10  * This program is distributed in the hope that it will be useful, *
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13  * GNU General Public License for more details. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
20 
23 #ifndef GW_GEM_H
24 #include "GEM.h"
25 #endif
26 
27 #ifndef GW_TESTFEEDING_H
28 #include "TestFeeding.h"
29 #endif
30 
31 using namespace Gw;
32 
33 ClassImp(GEM);
34 
36  : BaseGEM()
37 {
38  fFeeding = NULL;
39 }
40 
42 {
43  GEM::Clear(""); if ( fFeeding ) delete fFeeding; fFeeding = NULL;
44 }
45 
46 
47 Link *GEM::SetFeeding(const char *feedingtype)
48 {
49  TString type = feedingtype;
50 
51  Link *tmp = fFeeding; fFeeding = NULL;
52 
53  // test, no physics in there ... just an example
54  if ( type.Contains("TestFeeding") ) { fFeeding = new TestFeeding(); }
55 
56  return tmp;
57 }
58 
59 void GEM::SetExI(Float_t E, Float_t I)
60 {
61  if ( fFeeding ) {
62  NuclearLevel *toplevel = (NuclearLevel *)fFeeding->GetIL();
63  toplevel->GetEnergy().SetValue(E); toplevel->GetSpin().Set(Int_t(I));
64  }
65  else cout << " ** WARNING ** in GEM::SetExI, no feeding link defined ! " << endl;
66 }
67 
68 void GEM::Clear(Option_t *o)
69 {
70  TString opt = o; BaseGEM::Clear(o);
71 }
72 
73 Int_t GEM::DoCascade(TSeqCollection &cas, Option_t *o)
74 {
75  Level *entrypoint; TString opt = o; Int_t result = 0;
76 
77  result += BaseGEM::DoCascade(cas,o); // determine a cascade in the level scheme
78 
79  if ( fFeeding ) {
80  entrypoint = ((Link *)cas.Last())->GetIL();
81  //entrypoint->ls();
82  fFeeding->SetFL( entrypoint ); result += fFeeding->DoCascade(cas);
83  }
84 
85  return result;
86 }
87 
88 
89 
90 /*
91 void GEM::DoCascade(TSeqCollection *cas, Option_t *o)
92 {
93  TObject *obj; Link *link;
94 
95  cas->Clear("nodelete"); // Reset the previous cascade.
96 
97  Int_t which_first;
98 
99  // select first gamma
100  link = (Link *)fRand0.Rand(which_first);
101  link->DoCascade(*cas);
102 
103  // start path down
104  obj = ((RandObj *)fRandDown.At( which_first ))->Rand();
105  while ( obj != &fEoC ) {
106  link = (Link *)fRand0.At(obj->GetUniqueID()) ;
107  link->DoCascade(*cas);
108  obj = ((RandObj *)fRandDown.At( obj->GetUniqueID() ))->Rand();
109  }
110 
111  // start path up
112  obj = ((RandObj *)fRandUp.At( which_first ))->Rand();
113  while ( obj != &fEoC ) {
114  link = (Link *)fRand0.At(obj->GetUniqueID()) ;
115  link->DoCascade(*cas);
116  obj = ((RandObj *)fRandUp.At( obj->GetUniqueID() ))->Rand();
117  }
118 }
119 */
void SetExI(Float_t E, Float_t I)
starting point in the ExI plan from which starts the gamma-ray emission
Definition: GEM.cpp:59
void Set(Int_t n, Int_t d=1)
To set the spin.
Definition: Spin.cpp:124
virtual Int_t DoCascade(TSeqCollection &, Option_t *opt="")
starting point in the ExI plan from which starts the gamma-ray emission
Definition: GEM.cpp:73
Class to get randomly cascades (with lateral feeding) of gammas on the basis of a level scheme...
Definition: GEM.h:55
void SetValue(Data_T data)
set the value, cannot be overloaded
Definition: Data.h:116
virtual void Clear(Option_t *opt="all")
Clear everything.
Definition: BaseGEM.cpp:182
Class to get randomly cascades of gammas on the basis of a level scheme.
Definition: BaseGEM.h:107
A nuclear level.
Definition: NuclearLevel.h:66
ClassImp(GEM)
Link * SetFeeding(const char *feedingtype="TestFeeding")
Definition: GEM.cpp:47
virtual ~GEM()
Definition: GEM.cpp:41
virtual void Clear(Option_t *opt="all")
Clear everything.
Definition: GEM.cpp:68
Measure< Float_t > & GetEnergy()
Definition: NuclearLevel.h:91
header file for a GEM (gamma-rays generator)
GEM()
to be called to init the random generator
Definition: GEM.cpp:35
virtual Int_t DoCascade(TSeqCollection &cascade, Option_t *opt="")
cascade simulation
Definition: BaseGEM.cpp:523
ADF::LogMessage & endl(ADF::LogMessage &log)
Spin & GetSpin()
to get the spin and modify it if it is needed
Definition: NuclearLevel.h:84
header file for a GEM (gamma-rays generator)
Base class describing a general level.
Definition: Level.h:53