Cat
Functions
Python.cpp File Reference
#include <vector>
#include <map>
#include <list>
#include <boost/python/class.hpp>
#include <boost/python/module.hpp>
#include <boost/python/def.hpp>

Go to the source code of this file.

Functions

void export_base ()
 
void export_obj ()
 
void export_proc ()
 
 BOOST_PYTHON_MODULE (libCatKernel)
 

Function Documentation

◆ BOOST_PYTHON_MODULE()

BOOST_PYTHON_MODULE ( libCatKernel  )

Definition at line 40 of file Python.cpp.

References export_base(), export_obj(), and export_proc().

41 {
42  export_base();
43  export_obj();
44  export_proc();
45 }
void export_obj()
Definition: Python_Obj.cpp:27
void export_base()
Definition: Python_Base.cpp:17
void export_proc()
Definition: Python_Proc.cpp:29

◆ export_base()

void export_base ( )

Definition at line 17 of file Python_Base.cpp.

References DLLMgr::createElement(), DLLMgr::createProcessus(), Options::currentPath(), Options::dataFile(), Options::dataFileFullName(), Options::dataStorage(), MsgSvc::DEBUG, Options::defFile(), DLLMgr::destroy(), DLLMgr::dll(), DLLMgr::dlls(), MsgSvc::ERR, StatusCode::FAILURE, MsgSvc::FATAL, Options::incNErrors(), Options::incNEvt(), Options::incRunNumber(), MsgSvc::INFO, StatusCode::isFailure(), StatusCode::isSuccess(), DLLMgr::libraryOfObject(), ProcDataBase::list(), DLLMgr::load(), Options::logDefFile(), Options::logFile(), Options::logOutputLevel(), Options::logStorage(), MsgSvc::msgSvc(), Options::nErrors(), Options::nEvt(), Options::nEvtMax(), MsgSvc::NONE, Options::plotFreq(), DLLMgr::print(), DLL::print(), Options::print(), Options::printFreq(), Options::runNumber(), Options::runNumberManagement(), MsgSvc::setCallSize(), Options::setCurrentPath(), Options::setDataStorage(), Options::setDefFile(), MsgSvc::setLineLength(), Options::setLogDefFile(), Options::setLogOutputLevel(), Options::setLogStorage(), Options::setNErrors(), Options::setNEvt(), Options::setNEvtMax(), Options::setPlotFreq(), Options::setPrintFreq(), Options::setRunNumber(), Options::setRunNumberManagement(), Options::setStopOnError(), Options::setStorageDir(), Options::setStorageFile(), Options::setStoragePath(), Options::setStream(), Options::stopOnError(), Options::storageDir(), Options::storageFile(), Options::storageFileFullName(), Options::storageFullPath(), Options::storagePath(), StatusCode::SUCCESS, DLLMgr::unload(), MsgSvc::VERBOSE, and MsgSvc::WARNING.

Referenced by BOOST_PYTHON_MODULE().

18 {
19  enum_<MsgSvc::MsgLevel>("MsgLevel")
20  .value("VERBOSE", MsgSvc::VERBOSE)
21  .value("DEBUG", MsgSvc::DEBUG)
22  .value("INFO", MsgSvc::INFO)
23  .value("WARNING", MsgSvc::WARNING)
24  .value("ERROR", MsgSvc::ERR)
25  .value("FATAL", MsgSvc::FATAL)
26  .value("NONE", MsgSvc::NONE)
27  ;
28 
29  class_<MsgSvc>("MsgSvc")
30  .def("msgSvc",&MsgSvc::msgSvc)
31  .def("setLineLength",&MsgSvc::setLineLength)
32  .def("setCallSize",&MsgSvc::setCallSize)
33  ;
34 
35  enum_<StatusCode::Type>("Code")
36  .value("FAILURE",StatusCode::FAILURE)
37  .value("SUCCESS",StatusCode::SUCCESS)
38  ;
39 
40  class_<StatusCode>("StatusCode")
41  .def("isSuccess", &StatusCode::isSuccess)
42  .def("isFailure", &StatusCode::isFailure)
43  ;
44 
45  class_<Options>("Options")
46  .def("setLogOutputLevel", &Options::setLogOutputLevel)
47  .def("logOutputLevel", &Options::logOutputLevel)
48  .def("setPrintFreq", &Options::setPrintFreq)
49  .def("printFreq", &Options::printFreq)
50  .def("setRunNumber", &Options::setRunNumber)
51  .def("runNumber", &Options::runNumber)
52  .def("setNEvt", &Options::setNEvt)
53  .def("nEvt", &Options::nEvt)
54  .def("setNEvtMax", &Options::setNEvtMax)
55  .def("nEvtMax", &Options::nEvtMax)
56  .def("setPlotFreq", &Options::setPlotFreq)
57  .def("plotFreq", &Options::plotFreq)
58  .def("setNErrors", &Options::setNErrors)
59  .def("nErrors", &Options::nErrors)
60  .def("setRunNumberMgr", &Options::setRunNumberManagement)
61  .def("runNumberMgr", &Options::runNumberManagement)
62  .def("setCurrentPath", &Options::setCurrentPath)
63  .def("currentPath", &Options::currentPath)
64  .def("setStoragePath", &Options::setStoragePath)
65  .def("storagePath", &Options::storagePath)
66  .def("storageFullPath", &Options::storageFullPath)
67  .def("setStorageDir", &Options::setStorageDir)
68  .def("storageDir", &Options::storageDir)
69  .def("setStorageFile", &Options::setStorageFile)
70  .def("storageFile", &Options::storageFile)
71  .def("storageFileFullName",&Options::storageFileFullName)
72  .def("dataFileFullName", &Options::dataFileFullName)
73  .def("dataFile", &Options::dataFile)
74  .def("logFile", &Options::logFile)
75  .def("setDataStorage", &Options::setDataStorage)
76  .def("dataStorage", &Options::dataStorage)
77  .def("setLogStorage", &Options::setLogStorage)
78  .def("logStorage", &Options::logStorage)
79  .def("setLogDefFile", &Options::setLogDefFile)
80  .def("logDefFile", &Options::logDefFile)
81  .def("setDefFile", &Options::setDefFile)
82  .def("defFile", &Options::defFile)
83  .def("incRunNumber", &Options::incRunNumber)
84  .def("incNEvt", &Options::incNEvt)
85  .def("incNErrors", &Options::incNErrors)
86  .def("setStream", &Options::setStream)
87  .def("stopOnError", &Options::stopOnError)
88  .def("setStopOnError", &Options::setStopOnError)
89  .def("dump", &Options::print)
90  ;
91 
92  std::vector<Processus*> (ProcDataBase::*listElement)(Element*) = (&ProcDataBase::list);
93  std::vector<Processus*> (ProcDataBase::*listFull)( ) = (&ProcDataBase::list);
94 
95  class_<ProcDataBase>("ProcDb")
96  .def("list", listElement)
97  .def("list", listFull )
98  ;
99 
100  class_<DLL>("DLL")
101  .def("info",&DLL::print)
102  ;
103 
104  class_< std::vector< DLL* > >("DLLPtrVec")
105  .def(vector_indexing_suite< std::vector< DLL* > >())
106  ;
107 
108  StatusCode (DLLMgr::*destroyElement) (Element*) = (&DLLMgr::destroy);
109  StatusCode (DLLMgr::*destroyProcessus)(Processus*) = (&DLLMgr::destroy);
110 
111  class_<DLLMgr>("DLLMgr")
112  .def("load", &DLLMgr::load)
113  .def("unload", &DLLMgr::unload)
114  .def("info",&DLLMgr::print)
115  .def("dll", &DLLMgr::dll,return_value_policy<reference_existing_object>())
116  .def("dlls", &DLLMgr::dlls)
117  .def("dllOfObject", &DLLMgr::libraryOfObject,return_value_policy<reference_existing_object>())
118  .def("createElement", &DLLMgr::createElement,return_value_policy<reference_existing_object>())
119  .def("createProcessus",&DLLMgr::createProcessus,return_value_policy<reference_existing_object>())
120  .def("destroy",destroyElement)
121  .def("destroy",destroyProcessus)
122  ;
123 }
bool isFailure() const
Definition: StatusCode.h:68
void incNErrors()
Definition: Options.h:384
unsigned long nEvt()
Definition: Options.h:317
void setPlotFreq(unsigned long plotFreq)
Definition: Options.h:66
void setStorageDir(std::string filename)
Definition: Options.h:172
void setStopOnError(bool stopOnError)
Definition: Options.h:83
void setNEvt(unsigned long nEvt)
Definition: Options.h:309
Element * createElement(std::string)
Definition: DLLMgr.cpp:128
int nEvtMax()
Definition: Options.h:333
void incRunNumber()
Definition: Options.cpp:74
std::string dataFileFullName()
Definition: Options.h:219
StatusCode unload(std::string)
Definition: DLLMgr.cpp:79
bool runNumberManagement()
Definition: Options.h:123
void setCurrentPath(std::string currentPath)
Definition: Options.h:127
bool stopOnError()
Definition: Options.h:91
void setLogDefFile(std::string defFile)
Definition: Options.h:276
void setLogOutputLevel(MsgSvc::MsgLevel logOutputLevel)
Definition: Options.h:34
std::string storagePath()
Definition: Options.h:151
unsigned long runNumber()
Definition: Options.h:107
unsigned long nErrors()
Definition: Options.h:365
unsigned long plotFreq()
Definition: Options.h:74
std::string currentPath()
Definition: Options.h:135
void setRunNumberManagement(bool runNumberManagement)
Definition: Options.h:115
Definition: DLLMgr.h:19
StatusCode destroy(Element *)
Definition: DLLMgr.cpp:150
void setStoragePath(std::string storagePath)
Definition: Options.h:143
bool dataStorage()
Definition: Options.h:252
void print()
Definition: DLL.cpp:74
std::vector< Processus * > list()
StatusCode load(std::string)
Definition: DLLMgr.cpp:32
std::string defFile()
Definition: Options.h:301
void setNEvtMax(int nEvtMax)
Definition: Options.h:325
MsgSvc::MsgLevel logOutputLevel()
Definition: Options.h:42
void setLogStorage(bool logStorage)
Definition: Options.h:260
DLL * libraryOfObject(std::string)
Definition: DLLMgr.cpp:98
void setCallSize(int callSize)
Definition: MsgSvc.h:33
void setPrintFreq(unsigned long printFreq)
Definition: Options.h:50
std::string logFile()
Definition: Options.cpp:95
std::string logDefFile()
Definition: Options.h:285
bool logStorage()
Definition: Options.h:268
std::string storageFile()
Definition: Options.h:200
void setNErrors(unsigned long nErrors)
Definition: Options.h:357
unsigned long printFreq()
Definition: Options.h:58
void setLineLength(int linelength)
Definition: MsgSvc.h:32
void setStorageFile(std::string filename=std::string(""))
Definition: Options.h:188
void print()
Definition: Options.cpp:107
std::string storageFullPath()
Definition: Options.h:159
void setRunNumber(unsigned long runNumber)
Definition: Options.h:99
void setDataStorage(bool dataStorage)
Definition: Options.h:244
void setStream(std::string file=std::string(""))
Definition: Options.h:400
void setDefFile(std::string def)
Definition: Options.h:293
bool isSuccess() const
Definition: StatusCode.h:64
DLL * dll(std::string)
Definition: DLLMgr.cpp:113
std::vector< DLL * > dlls(std::string)
Definition: DLLMgr.h:45
std::string dataFile()
Definition: Options.cpp:83
void print()
Definition: DLLMgr.cpp:174
std::string storageDir()
Definition: Options.h:180
std::string storageFileFullName()
Definition: Options.h:208
void msgSvc(MsgSvc::MsgLevel, std::string, std::string call=std::string(""))
Definition: MsgSvc.cpp:42
Processus * createProcessus(std::string)
Definition: DLLMgr.cpp:139
void incNEvt()
Definition: Options.h:377

◆ export_obj()

void export_obj ( )

Definition at line 27 of file Python_Obj.cpp.

References Attrib::add(), Hierarchy::addChild(), Attrib::attributs(), Application::cd(), Hierarchy::child(), Hierarchy::children(), Hierarchy::childTyped(), Hierarchy::clear(), Application::computer(), Element::connection(), Application::create(), Application::ctrl(), Application::current(), Object::debug(), Hierarchy::delChild(), Application::dllMgr(), Object::dllName(), Object::error(), Object::fatal(), Application::finalize(), Hierarchy::hasChildren(), Element::help(), Computer::help(), Application::hostname(), Object::id(), Object::info(), Element::init(), Computer::init(), Application::initialize(), Attrib::is(), Application::loop(), Object::msg(), Object::msgSvc(), Object::name(), Hierarchy::numberOfChildren(), Application::options(), Hierarchy::origin(), Hierarchy::parent(), Hierarchy::path(), Hierarchy::pathTyped(), Application::prepare(), Application::procDb(), Element::recursiveInitCommunications(), Element::recursiveInitElement(), Attrib::remove(), Element::reset(), Computer::reset(), Application::run(), Element::setConnection(), Application::setCtrl(), Application::setCurrent(), Object::setId(), Object::setName(), Hierarchy::setParent(), Object::setTitle(), Object::setType(), Application::terminate(), Object::title(), Hierarchy::tree(), Object::type(), Element::update(), Computer::update(), Object::verbose(), and Object::warning().

Referenced by BOOST_PYTHON_MODULE().

28 {
29  class_<Attrib>("Attrib")
30  .def("is", &Attrib::is)
31  .def("add", &Attrib::add)
32  .def("remove", &Attrib::remove)
33  .def("attributs", &Attrib::attributs)
34  ;
35 
36  void (Object::*msgx1)(std::string) = (&Object::msg);
37  void (Object::*msgx2)(std::string, std::string) = (&Object::msg);
38  void (Object::*verbosex1)(std::string) = (&Object::verbose);
39  void (Object::*verbosex2)(std::string, std::string) = (&Object::verbose);
40  void (Object::*debugx1)(std::string) = (&Object::debug);
41  void (Object::*debugx2)(std::string, std::string) = (&Object::debug);
42  void (Object::*infox1)(std::string) = (&Object::info);
43  void (Object::*infox2)(std::string, std::string) = (&Object::info);
44  void (Object::*warningx1)(std::string) = (&Object::warning);
45  void (Object::*warningx2)(std::string, std::string) = (&Object::warning);
46  void (Object::*errorx1)(std::string) = (&Object::error);
47  void (Object::*errorx2)(std::string, std::string) = (&Object::error);
48  void (Object::*fatalx1)(std::string) = (&Object::fatal);
49  void (Object::*fatalx2)(std::string, std::string) = (&Object::fatal);
50 
51  class_<Object, bases <Attrib> >("Object")
52  .def("name", &Object::name)
53  .def("type", &Object::type)
54  .def("id", &Object::id)
55  .def("title", &Object::title)
56  .def("dllName", &Object::dllName)
57  .def("setName", &Object::setName)
58  .def("setType", &Object::setType)
59  .def("setId", &Object::setId)
60  .def("setTitle", &Object::setTitle)
61  .def("msgSvc",&Object::msgSvc)
62  .def("msg", msgx1)
63  .def("msg", msgx2)
64  .def("verbose", verbosex1)
65  .def("verbose", verbosex2)
66  .def("debug", debugx1)
67  .def("debug", debugx2)
68  .def("info", infox1)
69  .def("info", infox2)
70  .def("warning", warningx1)
71  .def("warning", warningx2)
72  .def("error", errorx1)
73  .def("error", errorx2)
74  .def("fatal", fatalx1)
75  .def("fatal", fatalx2)
76  ;
77 
78  class_<Application, bases <Object> >("Application")
79  .def("initialize", &Application::initialize)
80  .def("run", &Application::run)
81  .def("finalize", &Application::finalize)
82  .def("create", &Application::create)
83  .def("cd", &Application::cd)
84  .def("options", &Application::options,
85  return_value_policy<reference_existing_object>())
86  .def("hostname", &Application::hostname)
87  .def("setCurrent", &Application::setCurrent)
88  .def("current", &Application::current,
89  return_value_policy<reference_existing_object>())
90  .def("computer", &Application::computer,
91  return_value_policy<reference_existing_object>())
92  .def("dllMgr", &Application::dllMgr,
93  return_value_policy<reference_existing_object>())
94  .def("procDb", &Application::procDb,
95  return_value_policy<reference_existing_object>())
96  .def("ctrl", &Application::ctrl)
97  .def("setCtrl", &Application::setCtrl)
98  .def("prepare", &Application::prepare)
99  .def("loop", &Application::loop)
100  .def("terminate", &Application::terminate)
101  ;
102 
103  Hierarchy* (Hierarchy::*parentx0)() = (&Hierarchy::parent);
104  Hierarchy* (Hierarchy::*parentx1)(std::string) = (&Hierarchy::parent);
105  void (Hierarchy::*delChildx0)(Hierarchy*) = (&Hierarchy::delChild);
106  void (Hierarchy::*delChildx1)(std::string) = (&Hierarchy::delChild);
107  void (Hierarchy::*treex0)() = (&Hierarchy::tree);
108 
109  class_< std::vector<Hierarchy*> >("HierarchyPtrVec")
110  .def(vector_indexing_suite< std::vector<Hierarchy*> >())
111  ;
112 
113  class_<Hierarchy, bases<Object> >("Hierarchy")
114  .def("clear", &Hierarchy::clear)
115  .def("setParent", &Hierarchy::setParent)
116  .def("parent", parentx0,return_value_policy<reference_existing_object>())
117  .def("parent", parentx1,return_value_policy<reference_existing_object>())
118  .def("origin", &Hierarchy::origin,return_value_policy<reference_existing_object>())
119  .def("addChild", &Hierarchy::addChild)
120  .def("children", &Hierarchy::children)
121  .def("child", &Hierarchy::child,return_value_policy<reference_existing_object>())
122  .def("childTyped", &Hierarchy::childTyped,return_value_policy<reference_existing_object>())
123  .def("numberOfChildren", &Hierarchy::numberOfChildren)
124  .def("hasChildren", &Hierarchy::hasChildren)
125  .def("delChild", delChildx0)
126  .def("delChild", delChildx1)
127  .def("path", &Hierarchy::path)
128  .def("pathTyped", &Hierarchy::pathTyped)
129  .def("tree", treex0)
130  ;
131 
132  class_<ElementWrap, boost::noncopyable, bases<Hierarchy> >("Element")
133  .def("help",pure_virtual(&Element::help))
134  .def("init",pure_virtual(&Element::init))
135  .def("reset",pure_virtual(&Element::reset))
136  .def("update",pure_virtual(&Element::update))
137  .def("recursiveInitElement",&Element::recursiveInitElement)
138  .def("recursiveInitCommunications",&Element::recursiveInitCommunications)
139  .def("setConnection",&Element::setConnection)
140  .def("connection",&Element::connection,return_value_policy<reference_existing_object>())
141  ;
142 
143  class_<Computer, bases<Element> >("Computer")
144  .def("help",&Computer::help)
145  .def("init",&Computer::init)
146  .def("reset",&Computer::reset)
147  .def("update",&Computer::update)
148  ;
149 }
void info(std::string mymsg)
Definition: Object.h:38
Definition: Object.h:21
virtual void reset()=0
Hierarchy * childTyped(std::string)
Definition: Hierarchy.cpp:239
void verbose(std::string mymsg)
Definition: Object.h:36
void help()
Definition: Computer.h:37
Hierarchy * connection()
Definition: Element.cpp:84
StatusCode create(std::string, std::string)
Hierarchy * child(std::string)
Definition: Hierarchy.cpp:133
StatusCode loop()
std::string attributs()
Definition: Attrib.cpp:54
StatusCode setConnection(Hierarchy *)
Definition: Element.cpp:55
unsigned char id()
Definition: Object.h:30
bool is(int attribut)
Definition: Attrib.h:50
StatusCode prepare(std::string procName, Element *element=0, int nEvt=1)
void setParent(Hierarchy *parent)
Definition: Hierarchy.cpp:67
std::string title()
Definition: Object.h:31
void add(int attribut)
Definition: Attrib.h:67
void setName(std::string name)
Definition: Object.h:51
bool hasChildren()
Definition: Hierarchy.cpp:303
std::vector< Hierarchy * > children()
Definition: Hierarchy.h:33
void delChild(Hierarchy *)
Definition: Hierarchy.cpp:92
Hierarchy * parent()
Definition: Hierarchy.h:28
std::string hostname()
Definition: Application.h:173
void fatal(std::string mymsg)
Definition: Object.h:41
void update()
Definition: Computer.h:60
unsigned long numberOfChildren()
Definition: Hierarchy.cpp:125
void reset()
Definition: Computer.h:55
StatusCode terminate()
StatusCode initialize()
Definition: Application.cpp:72
StatusCode run(std::string procName, Element *element=0, int nEvt=1)
void remove(int attribut)
Definition: Attrib.h:86
Options * options()
Definition: Application.h:86
void setType(std::string type)
Definition: Object.h:52
Computer * computer()
Definition: Application.h:94
void error(std::string mymsg)
Definition: Object.h:40
void setId(unsigned char id)
Definition: Object.h:53
void debug(std::string mymsg)
Definition: Object.h:37
virtual StatusCode init()=0
void msg(std::string mymsg)
Definition: Object.h:35
void setTitle(std::string title)
Definition: Object.h:54
std::string dllName()
Definition: Object.h:74
void tree()
Definition: Hierarchy.h:46
DLLMgr * dllMgr()
Definition: Application.h:103
StatusCode cd(std::string path)
Definition: Application.h:158
ProcDataBase * procDb()
Definition: Application.h:111
virtual void update()=0
void recursiveInitCommunications()
Definition: Element.cpp:44
StatusCode init()
Definition: Computer.h:43
StatusCode finalize()
std::string name() const
Definition: Object.h:28
std::string ctrl()
Definition: Application.h:314
Hierarchy * current()
Definition: Application.h:149
virtual void addChild(Hierarchy *element)
Definition: Hierarchy.cpp:83
void msgSvc(int level, std::string msg, std::string name)
Definition: Object.h:33
std::string pathTyped(std::string=std::string(""))
Definition: Hierarchy.cpp:356
std::string type()
Definition: Object.h:29
virtual void help()=0
void setCurrent(Hierarchy *current)
Definition: Application.h:141
void warning(std::string mymsg)
Definition: Object.h:39
void clear()
Definition: Hierarchy.cpp:35
void recursiveInitElement()
Definition: Element.cpp:32
Hierarchy * origin()
Definition: Hierarchy.h:30
void setCtrl(std::string control)
Definition: Application.h:306
std::string path(std::string=std::string(""))
Definition: Hierarchy.cpp:344

◆ export_proc()

void export_proc ( )

Definition at line 29 of file Python_Proc.cpp.

References Histo1D::bins(), Histo2D::bins(), Histo1D::centers(), Processus::data(), Histo1D::edges(), Processus::element(), Processus::endProcessing(), Processus::execute(), Processus::finalize(), Data::hist1d(), Processus::hist1d(), Data::hist2d(), Processus::hist2d(), Processus::initialize(), ProcDataBase::list(), Histo2D::maxX(), Histo1D::maxX(), Histo1D::maxY(), Histo2D::maxY(), Histo2D::maxZ(), Histo2D::minX(), Histo1D::minX(), Histo1D::minY(), Histo2D::minY(), Histo2D::minZ(), Object::name(), Histo1D::nBin(), Histo2D::nxbins(), Histo2D::nybins(), Histo1D::overflow(), Data::print(), Processus::setElement(), TestSuite::setSigma(), Processus::setStorage(), TestSuite::sigma(), Processus::startProcessing(), Processus::storage(), Object::title(), Histo1D::underflow(), Data::vector(), Histo2D::xbins(), and Histo2D::ybins().

Referenced by BOOST_PYTHON_MODULE().

30 {
31  class_< std::vector<Processus*> >("ProcessusPtrVec")
32  .def(vector_indexing_suite< std::vector<Processus*> >())
33  ;
34 
35  std::vector<Processus*> (ProcDataBase::*listElement)(Element*) = (&ProcDataBase::list);
36  std::vector<Processus*> (ProcDataBase::*listFull)( ) = (&ProcDataBase::list);
37 
38  // class_<ProcDataBase>("ProcDb")
39  // .def("list", listElement)
40  // .def("list", listFull )
41  // ;
42 
43  class_< std::vector<Histo1D*> >("Histo1DPtrVec")
44  .def(vector_indexing_suite< std::vector<Histo1D*> >())
45  ;
46 
47  class_< std::vector<double> >("DoubleVec")
48  .def(vector_indexing_suite< std::vector<double> >())
49  ;
50 
51  class_<Histo1D, bases<Object> >("Histo1D", init<TH1D*>())
52  .def("bins",&Histo1D::bins)
53  .def("xbins",&Histo1D::centers)
54  .def("edges",&Histo1D::edges)
55  .def("minX",&Histo1D::minX)
56  .def("maxX",&Histo1D::maxX)
57  .def("minY",&Histo1D::minY)
58  .def("maxY",&Histo1D::maxY)
59  .def("nbins",&Histo1D::nBin)
60  .def("overflow",&Histo1D::overflow)
61  .def("underflow",&Histo1D::underflow)
62  // .def("overflow",&Histo1D::overflow)
63  ;
64 
65  class_< std::vector< std::pair < unsigned int , Histo1D* > > >("PairIntHisto1DVec")
66  .def(vector_indexing_suite< std::vector< std::pair < unsigned int , Histo1D* > > >())
67  ;
68  /*
69  class_< std::vector< std::vector<double> > > ("VecVecDouble")
70  .def(vector_indexing_suite< std::vector< std::vector < double > > >())
71  ;
72  */
73  class_<Histo2D, bases<Object> >("Histo2D", init<TH2D*>())
74  .def("bins",&Histo2D::bins)
75  .def("xbins",&Histo2D::xbins)
76  .def("ybins",&Histo2D::ybins)
77  .def("minX",&Histo2D::minX)
78  .def("maxX",&Histo2D::maxX)
79  .def("minY",&Histo2D::minY)
80  .def("maxY",&Histo2D::maxY)
81  .def("minY",&Histo2D::minZ)
82  .def("maxY",&Histo2D::maxZ)
83  .def("nxbins",&Histo2D::nxbins)
84  .def("nybins",&Histo2D::nybins)
85  /*
86  .def("overflow",&Histo1D::overflow)
87  .def("underflow",&Histo1D::underflow)
88  */
89  ;
90  /*
91  class_<Plot, bases<Object> >("Plot")
92  .def("histos", &Plot::histos)
93  .def("histo1d",&Plot::histo1d)
94  .def("format", &Plot::format)
95  .def("pos", &Plot::pos)
96  .def("make", &Plot::make)
97  .def("draw", &Plot::draw)
98  ;
99  */
100  std::vector<double> (Data::*vectorx0)(unsigned int) = (&Data::vector);
101  std::vector<double> (Data::*vectorx1)(std::string) = (&Data::vector);
102 
103  Histo1D* (Data::*hist1dx0)(unsigned int) = (&Data::hist1d);
104  Histo1D* (Data::*hist1dx1)(std::string) = (&Data::hist1d);
105  Histo2D* (Data::*hist2dx0)(unsigned int) = (&Data::hist2d);
106  Histo2D* (Data::*hist2dx1)(std::string) = (&Data::hist2d);
107 
108  class_<Data, bases<Object> >("Data")
109  .def("name", &Data::name)
110  .def("title", &Data::title)
111  .def("vector",vectorx0)
112  .def("vector",vectorx1)
113  .def("info", &Data::print)
114  .def("hist1d",hist1dx0,return_value_policy<reference_existing_object>())
115  .def("hist1d",hist1dx1,return_value_policy<reference_existing_object>())
116  .def("hist2d",hist2dx0,return_value_policy<reference_existing_object>())
117  .def("hist2d",hist2dx1,return_value_policy<reference_existing_object>())
118  ;
119 
120  Data* (Processus::*datax0) () = (&Processus::data);
121  std::vector<double> (Processus::*datax1) (std::string) = (&Processus::data);
122  std::vector<double> (Processus::*datax2) (unsigned int) = (&Processus::data);
123 
124  Histo1D* (Processus::*datax3) (unsigned int) = (&Processus::hist1d);
125  Histo2D* (Processus::*datax4) (unsigned int) = (&Processus::hist2d);
126 
127  class_<ProcessusWrap, boost::noncopyable, bases<Object> >("Processus")
128  .def("initialize",pure_virtual(&Processus::initialize))
129  .def("execute",pure_virtual(&Processus::execute))
130  .def("finalize",pure_virtual(&Processus::finalize))
131  .def("startProcessing",&Processus::startProcessing)
132  .def("endProcessing",&Processus::endProcessing)
133  .def("setStorage",&Processus::setStorage)
134  .def("storage",&Processus::storage)
135  .def("setElement",&Processus::setElement)
136  .def("element",&Processus::element,return_value_policy<reference_existing_object>())
137  .def("data",datax0,return_value_policy<reference_existing_object>())
138  .def("data",datax1)
139  .def("data",datax2)
140  .def("hist1d",datax3,return_value_policy<reference_existing_object>())
141  .def("hist2d",datax4,return_value_policy<reference_existing_object>())
142  ;
143 
144  class_<TestSuite, bases<Processus> > ("TestSuite")
145  .def("setSigma", &TestSuite::setSigma)
146  .def("sigma", &TestSuite::sigma)
147  ;
148 }
double minX()
Definition: Histo1D.h:45
std::vector< double > ybins()
Definition: Histo2D.h:80
void setElement(Element *element)
Definition: Processus.h:217
double maxY()
Definition: Histo1D.cpp:70
StatusCode endProcessing()
Definition: Processus.cpp:115
std::string title()
Definition: Object.h:31
std::vector< double > bins()
Definition: Histo1D.h:49
double sigma(int i)
Definition: TestSuite.h:37
std::vector< double > centers()
Definition: Histo1D.h:53
std::vector< double > vector(unsigned int)
Definition: Data.cpp:146
double maxY()
Definition: Histo2D.h:47
double minY()
Definition: Histo1D.cpp:66
std::vector< double > edges()
Definition: Histo1D.h:57
double maxZ()
Definition: Histo2D.h:55
std::vector< Processus * > list()
virtual StatusCode execute()=0
void setStorage(std::string storage)
Definition: Processus.h:106
unsigned long nybins()
Definition: Histo2D.h:88
virtual StatusCode finalize()=0
void print()
Definition: Data.cpp:186
Histo1D * hist1d(unsigned int row)
Definition: Processus.h:138
unsigned long nBin()
Definition: Histo1D.h:61
Histo1D * hist1d(unsigned int row)
Definition: Data.h:30
double overflow()
Definition: Histo1D.h:75
std::vector< double > xbins()
Definition: Histo2D.h:76
std::string name() const
Definition: Object.h:28
double maxX()
Definition: Histo2D.h:39
StatusCode startProcessing()
Definition: Processus.cpp:93
Element * element()
Definition: Processus.h:231
Histo2D * hist2d(unsigned int row)
Definition: Data.h:35
Definition: Data.h:16
StatusCode setSigma(double m1, double m2, double m3, double m4)
Definition: TestSuite.h:29
double maxX()
Definition: Histo1D.h:42
Histo2D * hist2d(unsigned int row)
Definition: Processus.h:146
std::string storage()
Definition: Processus.h:205
std::vector< double > bins()
Definition: Histo2D.h:72
unsigned long nxbins()
Definition: Histo2D.h:84
double minY()
Definition: Histo2D.h:43
virtual StatusCode initialize()=0
double minZ()
Definition: Histo2D.h:51
Data * data()
Definition: Processus.h:114
double underflow()
Definition: Histo1D.h:78
double minX()
Definition: Histo2D.h:35