// // Map2Dpy.cc -- python bindings for Map2D objects // using the Boost.Python C++ interface. // // NOTE: This boost::python interface to Map2D is STRONGLY depracated // in favor of the much more complete and uniform interface // to ROOT-compatible user classes through the ccppy module // and pyroot. DO NOT USE. #include #include #include #include #include #include #include #include #include #include #include #include Map2D& (Map2D::*Add1)(const Map2D*, Double_t) = &Map2D::Add; Map2D& (Map2D::*Add2)(const Map2D*, const Map2D*, Double_t, Double_t) = &Map2D::Add; Bool_t (Map2D::*Divide1)(const TH1*) = &Map2D::Divide; Bool_t (Map2D::*Divide2)(TF1*, Double_t) = &Map2D::Divide; Bool_t (Map2D::*Divide4)(const TH1*, const TH1*, Double_t, Double_t, Option_t*) = &Map2D::Divide; Bool_t (Map2D::*Multiply1)(const TH1*) = &Map2D::Multiply; Bool_t (Map2D::*Multiply2)(TF1*, Double_t) = &Map2D::Multiply; Bool_t (Map2D::*Multiply4)(const TH1*, const TH1*, Double_t, Double_t, Option_t*) = &Map2D::Multiply; Map2D& (Map2D::*Fillmap)(const Map2D*) = &Map2D::Fill; Int_t (Map2D::*Fill1)(Double_t) = &Map2D::Fill; Int_t (Map2D::*Fill2)(Double_t, Double_t) = &Map2D::Fill; Int_t (Map2D::*Fill3)(Double_t, Double_t, Double_t) = &Map2D::Fill; void (Map2D::*FillN)(Int_t, const Double_t*, const Double_t*, const Double_t*, Int_t) = &Map2D::FillN; void (Map2D::*FillRandomF)(const char*, Int_t) = &Map2D::FillRandom; void (Map2D::*FillRandomH)(TH1*, Int_t) = &Map2D::FillRandom; TFitResultPtr (Map2D::*Fit1)(const char*, Option_t*, Option_t*, Double_t, Double_t) = &Map2D::Fit; TFitResultPtr (Map2D::*Fit2)(TF1*, Option_t*, Option_t*, Double_t, Double_t) = &Map2D::Fit; TAxis* (Map2D::*GetXaxis)() = &Map2D::GetXaxis; TAxis* (Map2D::*GetYaxis)() = &Map2D::GetYaxis; Double_t (Map2D::*GetBinContent1)(Int_t) const = &Map2D::GetBinContent; Double_t (Map2D::*GetBinContent2)(Int_t, Int_t) const = &Map2D::GetBinContent; Double_t (Map2D::*GetBinContent3)(Int_t, Int_t, Int_t) const = &Map2D::GetBinContent; Double_t (Map2D::*GetBinError1)(Int_t) const = &Map2D::GetBinError; Double_t (Map2D::*GetBinError2)(Int_t, Int_t) const = &Map2D::GetBinError; Double_t (Map2D::*GetBinErrorLow1)(Int_t) const = &Map2D::GetBinErrorLow; Double_t (Map2D::*GetBinErrorLow2)(Int_t, Int_t) = &Map2D::GetBinErrorLow; Double_t (Map2D::*GetBinErrorUp1)(Int_t) const = &Map2D::GetBinErrorUp; Double_t (Map2D::*GetBinErrorUp2)(Int_t, Int_t) = &Map2D::GetBinErrorUp; Double_t (Map2D::*Integral1)(Option_t*) const = &Map2D::Integral; Double_t (Map2D::*Integral5)(Int_t, Int_t, Int_t, Int_t, Option_t*) const = &Map2D::Integral; Double_t (Map2D::*IntegralAndError)(Int_t, Int_t, Int_t, Int_t, Double_t&, Option_t*) const = &Map2D::IntegralAndError; Double_t (Map2D::*Interpolate)(Double_t, Double_t) = &Map2D::Interpolate; void (Map2D::*SetBinContent2)(Int_t, Double_t) = &Map2D::SetBinContent; void (Map2D::*SetBinContent3)(Int_t, Int_t, Double_t) = &Map2D::SetBinContent; void (Map2D::*SetBinError2)(Int_t, Double_t) = &Map2D::SetBinError; void (Map2D::*SetBinError3)(Int_t, Int_t, Double_t) = &Map2D::SetBinError; void (Map2D::*SetBins4)(Int_t, const Double_t*, Int_t, const Double_t*) = &Map2D::SetBins; void (Map2D::*SetBins6)(Int_t, Double_t, Double_t, Int_t, Double_t, Double_t) = &Map2D::SetBins; Int_t (Map2D::*GetMaximumBin0)() const = &Map2D::GetMaximumBin; Int_t (Map2D::*GetMaximumBin3)(Int_t&, Int_t&, Int_t&) const = &Map2D::GetMaximumBin; Int_t (Map2D::*GetMinimumBin0)() const = &Map2D::GetMinimumBin; Int_t (Map2D::*GetMinimumBin3)(Int_t&, Int_t&, Int_t&) const = &Map2D::GetMinimumBin; Double_t (Map2D::*AndersonDarlingTest1)(const TH1*, Option_t*) const = &Map2D::AndersonDarlingTest; Double_t (Map2D::*AndersonDarlingTest2)(const TH1*, Double_t&) const = &Map2D::AndersonDarlingTest; BOOST_PYTHON_MODULE(libMap2D) { using boost::python::class_; using boost::python::bases; using boost::python::init; using boost::python::def; using boost::python::return_internal_reference; using boost::python::return_value_policy; using boost::python::manage_new_object; using boost::python::reference_existing_object; // Define converters from C++ --> python bp::to_python_converter, convert_cpp_set_to_py_list >(); bp::to_python_converter, convert_cpp_vector_to_py_list >(); bp::to_python_converter, convert_cpp_set_to_py_list > (); bp::to_python_converter >(); bp::to_python_converter >(); bp::to_python_converter >(); // Define converters from python --> C++ convert_py_seq_to_cpp_vector(); convert_py_tup_to_cpp_pair(); convert_py_seq_to_cpp_vector >(); convert_py_seq_to_cpp_vector(); convert_py_seq_to_cpp_vector(); convert_py_root_to_cpp_root(); convert_py_root_to_cpp_root(); convert_py_root_to_cpp_root(); convert_py_root_to_cpp_root(); convert_py_root_to_cpp_root(); class_ ("Map2D", "subclass of ROOT TH2D 2d histogram with methods for manipulating " "the contents as a topological map.", init<>()) // constructors .def(init()) .def(init()) // methods imported from TH1 .def("CanExtendAllAxes", &TH2D::CanExtendAllAxes) .def("Chi2Test", &TH2D::Chi2Test) .def("Chi2TestX", &TH2D::Chi2TestX) .def("Chisquare", &TH2D::Chisquare) .def("ClearUnderflowAndOverflow", &TH2D::ClearUnderflowAndOverflow) .def("ComputeIntegral", &TH2D::ComputeIntegral) .def("Clone", &TH2D::Clone, return_value_policy()) .def("DirectoryAutoAdd", &TH2D::DirectoryAutoAdd) .def("DistancetoPrimitive", &TH2D::DistancetoPrimitive) .def("Divide", Divide1) .def("Divide", Divide2) .def("Divide", Divide4) .def("Draw", &TH2D::Draw) .def("DrawCopy", &TH2D::DrawCopy, return_value_policy()) .def("DrawNormalized", &TH2D::DrawNormalized, return_value_policy()) .def("DrawPanel", &TH2D::DrawPanel) .def("Eval", &TH2D::Eval) .def("ExecuteEvent", &TH2D::ExecuteEvent) .def("ExtendAxis", &TH2D::ExtendAxis) .def("FFT", &TH2D::FFT, return_value_policy()) .def("FindBin", &TH2D::FindBin) .def("FindFixBin", &TH2D::FindFixBin) .def("FindFirstBinAbove", &TH2D::FindFirstBinAbove) .def("FindLastBinAbove ", &TH2D::FindLastBinAbove ) .def("Fit", Fit1) .def("Fit", Fit2) .def("FitPanel", &TH2D::FitPanel) .def("GetAsymmetry", &TH2D::GetAsymmetry, return_value_policy()) .def("GetCumulative", &TH2D::GetCumulative, return_value_policy()) .def("GetListOfFunctions", &TH2D::GetListOfFunctions, return_value_policy()) .def("GetNdivisions", &TH2D::GetNdivisions) .def("GetAxisColor", &TH2D::GetAxisColor) .def("GetLabelColor", &TH2D::GetLabelColor) .def("GetLabelFont", &TH2D::GetLabelFont) .def("GetLabelOffset", &TH2D::GetLabelOffset) .def("GetLabelSize", &TH2D::GetLabelSize) .def("GetTitleFont", &TH2D::GetTitleFont) .def("GetTitleOffset", &TH2D::GetTitleOffset) .def("GetTitleSize", &TH2D::GetTitleSize) .def("GetTickLength", &TH2D::GetTickLength) .def("GetBarOffset", &TH2D::GetBarOffset) .def("GetBarWidth", &TH2D::GetBarWidth) .def("GetContour", &TH2D::GetContour) .def("GetContourLevel", &TH2D::GetContourLevel) .def("GetContourLevelPad", &TH2D::GetContourLevelPad) .def("GetBin", &TH2D::GetBin) .def("GetBinXYZ", &TH2D::GetBinXYZ) .def("GetBinCenter", &TH2D::GetBinCenter) .def("GetBinError", GetBinError1) .def("GetBinError", GetBinError2) .def("GetBinErrorLow", GetBinErrorLow1) .def("GetBinErrorLow", GetBinErrorLow2) .def("GetBinErrorUp", GetBinErrorUp1) .def("GetBinErrorUp", GetBinErrorUp2) .def("GetBinErrorOption", &TH2D::GetBinErrorOption) .def("GetBinLowEdge", &TH2D::GetBinLowEdge) .def("GetBinWidth", &TH2D::GetBinWidth) .def("GetBinWithContent", &TH2D::GetBinWithContent) .def("GetCenter", &TH2D::GetCenter) .def("GetDefaultSumw2", &TH2D::GetDefaultSumw2) .def("GetDirectory", &TH2D::GetDirectory, return_value_policy()) .def("GetEntries", &TH2D::GetEntries) .def("GetEffectiveEntries", &TH2D::GetEffectiveEntries) .def("GetFunction", &TH2D::GetFunction, return_value_policy()) .def("GetDimension", &TH2D::GetDimension) .def("GetKurtosis", &TH2D::GetKurtosis) .def("GetLowEdge", &TH2D::GetLowEdge) .def("GetMaximum", &TH2D::GetMaximum) .def("GetMaximumBin", GetMaximumBin0) .def("GetMaximumBin", GetMaximumBin3) .def("GetMaximumStored", &TH2D::GetMaximumStored) .def("GetMinimum", &TH2D::GetMinimum) .def("GetMinimumBin", GetMinimumBin0) .def("GetMinimumBin", GetMinimumBin3) .def("GetMinimumStored", &TH2D::GetMinimumStored) .def("GetMean", &TH2D::GetMean) .def("GetMeanError", &TH2D::GetMeanError) .def("GetNbinsX", &TH2D::GetNbinsX) .def("GetNbinsY", &TH2D::GetNbinsY) .def("GetNbinsZ", &TH2D::GetNbinsZ) .def("GetNcells", &TH2D::GetNcells) .def("GetNormFactor", &TH2D::GetNormFactor) .def("GetOption", &TH2D::GetOption) .def("GetQuantiles", &TH2D::GetQuantiles) .def("GetRandom", &TH2D::GetRandom) .def("GetStats", &TH2D::GetStats) .def("GetStdDev", &TH2D::GetStdDev) .def("GetStdDevError", &TH2D::GetStdDevError) .def("GetSumOfWeights", &TH2D::GetSumOfWeights) .def("GetSumw2N", &TH2D::GetSumw2N) .def("GetRMS", &TH2D::GetRMS) .def("GetRMSError", &TH2D::GetRMSError) .def("GetSkewness", &TH2D::GetSkewness) .def("GetXaxis", GetXaxis, return_value_policy()) .def("GetYaxis", GetYaxis, return_value_policy()) .def("IsBinOverflow", &TH2D::IsBinOverflow) .def("IsBinUnderflow", &TH2D::IsBinUnderflow) .def("AndersonDarlingTest", AndersonDarlingTest1) .def("AndersonDarlingTest", AndersonDarlingTest2) .def("KolmogorovTest", &TH2D::KolmogorovTest) .def("LabelsDeflate", &TH2D::LabelsDeflate) .def("LabelsInflate", &TH2D::LabelsInflate) .def("LabelsOption", &TH2D::LabelsOption) .def("Multiply", Multiply1) .def("Multiply", Multiply2) .def("Multiply", Multiply4) .def("Paint", &TH2D::Paint) .def("Print", &TH2D::Print) .def("PutStats", &TH2D::PutStats) .def("Rebin", &TH2D::Rebin, return_value_policy()) .def("Rebuild", &TH2D::Rebuild) .def("RecursiveRemove", &TH2D::RecursiveRemove) .def("ResetStats", &TH2D::ResetStats) .def("SavePrimitive", &TH2D::SavePrimitive) .def("Scale", &TH2D::Scale) .def("SetAxisColor", &TH2D::SetAxisColor) .def("SetAxisRange", &TH2D::SetAxisRange) .def("SetBarOffset", &TH2D::SetBarOffset) .def("SetBarWidth", &TH2D::SetBarWidth) .def("SetBinContent", SetBinContent2) .def("SetBinContent", SetBinContent3) .def("SetBinError", SetBinError2) .def("SetBinError", SetBinError3) .def("SetBins", SetBins4) .def("SetBins", SetBins6) .def("SetBinsLength", &TH2D::SetBinsLength) .def("SetBinErrorOption", &TH2D::SetBinErrorOption) .def("SetCanExtend", &TH2D::SetCanExtend) .def("SetContent", &TH2D::SetContent) .def("SetContour", &TH2D::SetContour) .def("SetContourLevel", &TH2D::SetContourLevel) .def("SetDefaultBufferSize", &TH2D::SetDefaultBufferSize) .def("SetDefaultSumw2", &TH2D::SetDefaultSumw2) .def("SetDirectory", &TH2D::SetDirectory) .def("SetEntries", &TH2D::SetEntries) .def("SetError", &TH2D::SetError) .def("SetLabelColor", &TH2D::SetLabelColor) .def("SetLabelFont", &TH2D::SetLabelFont) .def("SetLabelOffset", &TH2D::SetLabelOffset) .def("SetLabelSize", &TH2D::SetLabelSize) .def("SetMaximum", &TH2D::SetMaximum) .def("SetMinimum", &TH2D::SetMinimum) .def("SetName", &TH2D::SetName) .def("SetNameTitle", &TH2D::SetNameTitle) .def("SetNdivisions", &TH2D::SetNdivisions) .def("SetNormFactor", &TH2D::SetNormFactor) .def("SetStats", &TH2D::SetStats) .def("SetOption", &TH2D::SetOption) .def("SetTickLength", &TH2D::SetTickLength) .def("SetTitleFont", &TH2D::SetTitleFont) .def("SetTitleOffset", &TH2D::SetTitleOffset) .def("SetTitleSize", &TH2D::SetTitleSize) .def("SetTitle", &TH2D::SetTitle) .def("SetXTitle", &TH2D::SetXTitle) .def("SetYTitle", &TH2D::SetYTitle) .def("SetZTitle", &TH2D::SetZTitle) .def("Sumw2", &TH2D::Sumw2) .def("UseCurrentStyle", &TH2D::UseCurrentStyle) .def("TransformHisto", &TH2D::TransformHisto, return_value_policy()) // methods imported from TH2 .def("BufferEmpty", &TH2D::BufferEmpty) .def("Copy", &TH2D::Copy) .def("Fill", Fillmap, return_value_policy()) .def("Fill", Fill1) .def("Fill", Fill2) .def("Fill", Fill3) .def("FillN", FillN) .def("FillRandom", FillRandomF) .def("FillRandom", FillRandomH) .def("FindFirstBinAbove", &TH2D::FindFirstBinAbove) .def("FindLastBinAbove", &TH2D::FindLastBinAbove) .def("FitSlicesX", &TH2D::FitSlicesX) .def("FitSlicesY", &TH2D::FitSlicesY) .def("GetBin", &TH2D::GetBin) .def("GetBinWithContent2", &TH2D::GetBinWithContent2) .def("GetBinContent", GetBinContent1) .def("GetBinContent", GetBinContent2) .def("GetBinContent", GetBinContent3) .def("GetCorrelationFactor", &TH2D::GetCorrelationFactor) .def("GetCovariance", &TH2D::GetCovariance) .def("GetRandom2", &TH2D::GetRandom2) .def("GetStats", &TH2D::GetStats) .def("Integral", Integral1) .def("Integral", Integral5) .def("IntegralAndError", IntegralAndError) .def("Interpolate", Interpolate) .def("KolmogorovTest", &TH2D::KolmogorovTest) .def("Merge", &TH2D::Merge) .def("RebinX", &TH2D::RebinX, return_value_policy()) .def("RebinY", &TH2D::RebinY, return_value_policy()) .def("Rebin2D", &TH2D::Rebin2D, return_value_policy()) .def("ProfileX", &TH2D::ProfileX, return_value_policy()) .def("ProfileY", &TH2D::ProfileY, return_value_policy()) .def("ProjectionX", &TH2D::ProjectionX, return_value_policy()) .def("ProjectionY", &TH2D::ProjectionY, return_value_policy()) .def("PutStats", &TH2D::PutStats) .def("QuantilesX", &TH2D::QuantilesX, return_value_policy()) .def("QuantilesY", &TH2D::QuantilesY, return_value_policy()) .def("Reset", &TH2D::Reset) .def("SetShowProjectionX", &TH2D::SetShowProjectionX) .def("SetShowProjectionY", &TH2D::SetShowProjectionY) .def("ShowBackground", &TH2D::ShowBackground, return_value_policy()) .def("ShowPeaks", &TH2D::ShowPeaks) .def("Smooth", &TH2D::Smooth) // methods specific to Map2D .def("Add", Add1, return_value_policy()) .def("Add", Add2, return_value_policy()) .def("Flood", &Map2D::Flood, return_value_policy()) .def("FillVoids", &Map2D::FillVoids, return_value_policy()) .def("Smear", &Map2D::Smear, return_value_policy()) .def("Shift", &Map2D::Shift, return_value_policy()) .def("Center", &Map2D::Center, return_value_policy()) .def("Level", &Map2D::Level, return_value_policy()) .def("Normalize", &Map2D::Normalize, return_value_policy()) .def("Rotate", &Map2D::Rotate, return_value_policy()) .def("Rescale", &Map2D::Rescale, return_value_policy()) .def("Mask", &Map2D::Mask, return_value_policy()) .def("Resize", &Map2D::Resize, return_value_policy()) .def("ZeroSuppress", &Map2D::ZeroSuppress) .def("Despeckle", &Map2D::Despeckle) .def("Despike", &Map2D::Despike) .def("Correlation", &Map2D::Correlation) .def("TotalCurl", &Map2D::TotalCurl) .def("GetSilhouette", &Map2D::GetSilhouette, return_value_policy()) .def("Curl", &Map2D::Curl) .def("Uncurl", &Map2D::Uncurl, return_value_policy()) .def("Divergence", &Map2D::Divergence) .def("Gradient", &Map2D::Gradient) .def("GreensFunction", &Map2D::GreensFunction) .def("PoissonIter", &Map2D::PoissonIter) .def("PoissonSolve", &Map2D::PoissonSolve) .def("LaplaceSolve", &Map2D::LaplaceSolve) .def("Profile", &Map2D::Profile, return_value_policy()) ; }