Page Menu
Home
HEPForge
Search
Configure Global Search
Log In
Files
F8310400
rave.i.in
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
8 KB
Subscribers
None
rave.i.in
View Options
%module(directors="1") rave
%{
#include <rave/VertexFactory.h>
@DEFINE_WITH_FLAVORTAGGING@
#ifdef WITH_FLAVORTAGGING
#include <rave/FlavorTagFactory.h>
#endif
#include <rave/RaveTrack.h>
#include <rave/RaveVertex.h>
#include <rave/VacuumPropagator.h>
#include <rave/ConstantMagneticField.h>
#include <rave/RaveHistogram.h>
#include <rave/RaveCalibrationHistogram.h>
#include <rave/RaveCalibration.h>
#include <rave/Version.h>
// using namespace rave; // needed for swig <=1.3.20 :-(
%}
%pragma(java) jniclasscode=%{
static {
String libname = System.mapLibraryName( "@JAVALIBRARY@" );
try{
try{
System.load ( "@prefix@/lib/jni/" + libname );
System.out.println( libname + " successfully loaded!" );
}catch(UnsatisfiedLinkError e) {
libname = "lib@JAVALIBRARY@.so";
System.load ( "@prefix@/lib/jni/" + libname );
System.out.println( libname + " successfully loaded!" );
}
}catch(SecurityException e) {
System.out.println( libname + " not loaded!" );
e.printStackTrace();
}catch(UnsatisfiedLinkError e) {
System.out.println( libname + " not loaded!" );
e.printStackTrace();
}
}
%}
%feature("director");
%rename(RaveTrack) rave::Track;
%rename(RaveVertexFactory) rave::VertexFactory;
#ifdef WITH_FLAVORTAGGING
%rename(RaveFlavorTagFactory) rave::FlavorTagFactory;
#endif
%rename(RaveVertex) rave::Vertex;
%rename(RaveVector6D) rave::Vector6D;
%rename(RaveVector3D) rave::Vector3D;
%rename(RavePoint3D) rave::Point3D;
%rename(RaveCovariance6D) rave::Covariance6D;
%rename(RaveCovariance3D) rave::Covariance3D;
%rename(RaveCharge) rave::Charge;
%rename(RaveMagneticField) rave::MagneticField;
%rename(RavePropagator) rave::Propagator;
%rename(RaveEllipsoid3D) rave::Ellipsoid3D;
%rename(RaveVacuumPropagator) rave::VacuumPropagator;
%rename(RaveConstantMagneticField) rave::ConstantMagneticField;
%rename(RaveVersion) rave::Version;
%include "std_string.i"
%include "std_pair.i"
%include "std_vector.i"
%include <rave/RaveCharge.h>
%include <rave/RavePoint3D.h>
%include <rave/RaveVector3D.h>
%include <rave/RaveVector6D.h>
%include <rave/RaveCovariance3D.h>
%include <rave/RaveCovariance6D.h>
%include <rave/RaveMagneticField.h>
%include <rave/ConstantMagneticField.h>
%include <rave/RavePropagator.h>
%include <rave/VacuumPropagator.h>
%include <rave/RaveEllipsoid3D.h>
%include <rave/RaveHistogram.h>
%include <rave/RaveCalibrationHistogram.h>
%include <rave/RaveCalibration.h>
%include <rave/Version.h>
%feature("notabstract") RaveMagneticField;
%feature("notabstract") RaveConstantMagneticField;
%feature("notabstract") rave::MagneticField;
%feature("notabstract") rave::ConstantMagneticField;
namespace std {
%template(RaveTrackContainer) vector<rave::Track>;
%template(RaveVertexContainer) vector<rave::Vertex>;
};
namespace rave {
class Track
{
public:
Track( const Vector6D &, const Covariance6D &, Charge,
double chi2, double ndof,
int originaltrack, std::string tag="" );
Track();
signed charge() const;
const Vector6D & state() const;
const Covariance6D & error() const;
void * originalObject() const;
std::string tag() const;
int id() const;
bool isValid() const;
std::vector < Track > components() const;
};
class Vertex
{
public:
Vertex();
Vertex( const Point3D &, const Covariance3D &,
const std::vector < std::pair < double, Track > > & tracks, double ndf, double chi2 );
Vertex( const Point3D &, const Covariance3D &,
const std::vector < Track > & tracks, double ndf, double chi2 );
const Point3D & position() const;
const Covariance3D & error() const;
const std::vector < std::pair < double, Track > > & weightedTracks() const;
std::vector < Track > tracks() const;
double ndf() const;
double chiSquared() const;
int id() const;
bool isValid() const;
std::vector < Vertex > components() const;
};
class VertexFactory
{
public:
VertexFactory ( const rave::MagneticField & m = ConstantMagneticField(),
const rave::Propagator & p = VacuumPropagator(),
const std::string & method = "default",
int verbosity=1 );
VertexFactory ( const rave::MagneticField &,
const rave::Propagator &,
const rave::Ellipsoid3D & beamspot,
const std::string & method = "default",
int verbosity=1 );
VertexFactory ( const VertexFactory & o );
~VertexFactory();
VertexFactory operator= ( const VertexFactory & o );
std::vector < Vertex > create ( const std::vector < Track > &, bool use_beamspot=false ) const;
std::vector < Vertex > create ( const std::vector < Track > &,
const std::string & method, bool use_beamspot=false ) const;
const rave::Propagator & getPropagator() const;
const rave::MagneticField & getMagneticField() const;
const rave::Ellipsoid3D & getBeamspot() const;
bool hasBeamspot() const;
const int verbosity() const;
const std::string & method() const;
void setDefaultMethod ( const std::string & );
const RaveReconstructor & reconstructor() const;
};
#ifdef WITH_FLAVORTAGGING
class FlavorTagFactory
{
public:
FlavorTagFactory ( const RaveReconstructor & r );
FlavorTagFactory ( const VertexFactory & v );
FlavorTagFactory ( const FlavorTagFactory & o );
double tag ( const std::vector < Track > &, Vertex &, Vector3D & ) const;
void teach ( const std::vector < Track > & tracks, const Vertex & primary,
const Vector3D & jet, char tag );
bool hasFlavorTagging() const;
void calibrate ( const Calibration & ) const;
rave::Calibration getCalibration() const;
};
#endif
};
// Python & Java convenience
%extend rave::Point3D {
char * toString() {
static char tmp[256];
snprintf ( tmp,255,"(%.4f, %.4f, %.4f)",self->x(),self->y(),self->z() );
return tmp;
}
char * __str__() {
static char tmp[256];
snprintf ( tmp,255,"(%.4f, %.4f, %.4f)",self->x(),self->y(),self->z() );
return tmp;
}
};
%extend rave::Vertex {
char * toString() {
static char tmp[256];
snprintf ( tmp,255,"Vertex #%d at (%.4f, %.4f, %.4f)",self->id(),
self->position().x(),self->position().y(),self->position().z() );
return tmp;
}
char * __str__() {
static char tmp[256];
snprintf ( tmp,255,"Vertex #%d at (%.4f, %.4f, %.4f)",self->id(),
self->position().x(),self->position().y(),self->position().z() );
return tmp;
}
};
%extend rave::Track {
char * toString() {
static char tmp[512];
snprintf ( tmp,511,"Track #%d at (%.4f, %.4f, %.4f, %.1f, %.1f, %.1f) q=%d",
self->id(),self->state().x(),self->state().y(),self->state().z(),
self->state().px(),self->state().py(),self->state().pz(),self->charge() );
return tmp;
}
char * __str__() {
static char tmp[512];
snprintf ( tmp,511,"Track #%d at (%.4f, %.4f, %.4f, %.1f, %.1f, %.1f) q=%d",
self->id(),self->state().x(),self->state().y(),self->state().z(),
self->state().px(),self->state().py(),self->state().pz(),self->charge() );
return tmp;
}
};
%extend rave::Vector6D {
char * toString() {
static char tmp[512];
snprintf ( tmp,511,"(%.4f, %.4f, %.4f, %.1f, %.1f, %.1f)",
self->x(),self->y(),self->z(),self->px(),self->py(),self->pz() );
return tmp;
}
char * __str__() {
static char tmp[512];
snprintf ( tmp,511,"(%.4f, %.4f, %.4f, %.1f, %.1f, %.1f)",
self->x(),self->y(),self->z(),self->px(),self->py(),self->pz() );
return tmp;
}
};
/*
%extend combsv::CombinedSVCalibrationCategory {
const char * toString() {
std::ostringstream o;
o << (*self);
return o.str().c_str();
}
const char * __str__() {
std::ostringstream o;
o << (*self);
return o.str().c_str();
}
};*/
File Metadata
Details
Attached
Mime Type
text/x-c
Expires
Sat, Dec 21, 6:22 PM (8 h, 56 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4023782
Default Alt Text
rave.i.in (8 KB)
Attached To
rRAVESVN ravesvn
Event Timeline
Log In to Comment