#ifndef PAMVMCRNDMGR_H #define PAMVMCRNDMGR_H #include #include #include #include #include #include #include "PamVMCOptMgr.h" #include "PamRootManager.h" //This class holds few different random objects //one for each digitization procedure, //include Trk digitizations during stepping using std::cout; using std::endl; #define RNDDEBUG 0 class PamVMCRndMgr: public TObject { private: static PamVMCRndMgr * rm; TObjArray *frndArr; // An array of random objects; TMap frndmap; //map which holds all actual random objects protected: PamVMCRndMgr() { frndArr = new TObjArray(); frndArr->SetOwner(kTRUE); if (PamVMCOptMgr::Instance()->GetSaveMode() == ALL_DETECTORS){ PamRootManager::Instance()->Register("RNDM","TObjArray",&frndArr); if (RNDDEBUG){ cout<<"Random objects Map was created and branch registered" <Uniform(); else { cout<<"Error while calling RndMgr::GenRandom, object not found"<Next())) { TRandom3 *tmp = (TRandom3*)frndmap.GetValue(o); frndArr->Add(tmp->Clone()); if(RNDDEBUG) { cout<<"Obj: "<GetName()<Dump(); } } delete n; } void ClearColl() { (*frndArr).Clear("C"); } void Compress() { (*frndArr).Compress(); } }; #endif