Dear all, Sorry I forgot one important issue in my example code in the last mail: If we set random generator to RandomGen, the destructor of RandomGen should not delete the copied pointer. We need owner flag inside RandomGen. I also have another minor request : inside destructor in some classes, there are cout calls and we can't make them silence. Would it be under control of logging system, or make silence mode as default? I don't know where should I send these requests, if this ML is not appropriate please let me know. Thank you, Kotoyo On Mar 4, 2013, at 11:47 AM, Kotoyo Hoshina <[log in to unmask]> wrote: > > Dear all, > > Thank you very much for answering my recent question, I finally got consistent result with my simulation and Genie output! > Today I have another issue about Random Generator. > > Currently GENIE is using TRandom3, but for our project we need to use our own random generator for several reasons (to control seed, consistency between other modules, parallel computing, etc). > > Is it possible to change RandomGen class to just a interface (wrapper) class, so that users can write their own random generator class? > Or even giving an option to RandomGen, for example, accepting user class inherited from TRandom3 would works for short term. > > Here is the example : > > class MyRandGen : public TRandom3 {…} > > class RandomGen { > > public > void SetRandomGen(TRandom3 * random_ptr) { fRandom3 = random_ptr; } > > } > > void main() { > > MyRandGen * my_rand = new MyRandGen(); > RandomGen *rnd = RandomGen::Instance(); > rnd->SetRandomGen(my_rand); > > double random = rnd->RndGen()->Rndm(); > …. > > } > > If developers accept the idea, it would be nice if you could implement it to trunk in short term. > > Thank you very much! > > Kotoyo > > --------------------------------------------------------- > Kotoyo Hoshina > IceCube Assistant Scientist > Office : IceCube, 222 West Washington, Suite500, Madison, WI, 53703-2775 USA > Tel : +1-(608) 890-0532 > Mail : [log in to unmask] > > > >