Index: trunk/Utilities/Hector/include/H_AbstractBeamLine.h
===================================================================
--- trunk/Utilities/Hector/include/H_AbstractBeamLine.h	(revision 237)
+++ trunk/Utilities/Hector/include/H_AbstractBeamLine.h	(revision 281)
@@ -2,19 +2,27 @@
 #define _H_AbstractBeamLine_
 
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
+  /* * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *                                                         *
+*                   --<--<--  A fast simulator --<--<--     *
+*                 / --<--<--     of particle   --<--<--     *
+*  ----HECTOR----<                                          *
+*                 \ -->-->-- transport through -->-->--     *
+*                   -->-->-- generic beamlines -->-->--     *
+*                                                           *
+* JINST 2:P09005 (2007)                                     *
+*      X Rouby, J de Favereau, K Piotrzkowski (CP3)         *
+*	http://www.fynu.ucl.ac.be/hector.html               *
+*                                                           *
+* Center for Cosmology, Particle Physics and Phenomenology  *
+*              Universite catholique de Louvain             *
+*                 Louvain-la-Neuve, Belgium                 *
+ *                                                         *
+   * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
-	http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de Phï¿œnomï¿œnologie (CP3)
-   Universitï¿œ Catholique de Louvain (UCL)
-*/
 
 /// \file H_AbstractBeamLine.h
 /// \brief Class aiming at simulating the LHC beamline.
 ///
-/// Units : angles [ï¿œrad], distances [ï¿œm], energies [GeV], c=[1].
+/// Units : angles [urad], distances [um], energies [GeV], c=[1].
 
 	/// default length of the beam line
@@ -39,5 +47,4 @@
 
 	public:
-		void init(const float );
 		///     Constructors, destructor and operator
 		//@{
@@ -50,12 +57,9 @@
 		//@}
 		///     Adds an element to the beamline
-		//@{
 		void add(H_OpticalElement *);
-		void add(H_OpticalElement &);
-		//@}
 		///     Returns the (float) length of the beamline
-  		inline float getLength() const { return beam_length;};
+  		const float getLength() const { return beam_length;};
 		///     Returns the (int) number of optics element of the beamline, including drifts
-  		inline int getNumberOfElements() const { return (int)elements.size();}; 
+  		const unsigned int getNumberOfElements() const { return elements.size();}; 
 		///     Returns the transport matrix for the whole beam
 		const TMatrix getBeamMatrix() const;
@@ -124,16 +128,20 @@
 
 	private:
-	        /// list of all optics elements, including drifts
-		vector<H_OpticalElement*> elements; 
         	/// list of matrices, 1 matrix = the transport till the end of each element
 		vector<TMatrix> matrices; 
 	        /// transport matrix for the whole beam
-		TMatrix beam_mat;		    	
+		TMatrix beam_mat;
+                /// list of all optics elements, including drifts
+                vector<H_OpticalElement*> elements;
 		/// Orderting method for the vector of H_OpticalElement*
-		struct ordering{ bool operator()(H_OpticalElement* el1, H_OpticalElement* el2) const { return (*el1 < *el2);}};
+		struct ordering{ bool operator()(const H_OpticalElement* el1, const H_OpticalElement* el2) const {return (*el1 < *el2);}};
+		// private method for copying the contents of "elements"
+		void cloneElements(const H_AbstractBeamLine&);
 
 	protected:
+		void init(const float );
 		/// total length of the beamline
 		float beam_length;
+	friend std::ostream& operator<< (std::ostream& os, const H_AbstractBeamLine& be);
 };
 
Index: trunk/Utilities/Hector/include/H_Aperture.h
===================================================================
--- trunk/Utilities/Hector/include/H_Aperture.h	(revision 237)
+++ trunk/Utilities/Hector/include/H_Aperture.h	(revision 281)
@@ -2,14 +2,21 @@
 #define _H_Aperture_
 
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
+  /* * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *                                                         *
+*                   --<--<--  A fast simulator --<--<--     *
+*                 / --<--<--     of particle   --<--<--     *
+*  ----HECTOR----<                                          *
+*                 \ -->-->-- transport through -->-->--     *
+*                   -->-->-- generic beamlines -->-->--     *
+*                                                           *
+* JINST 2:P09005 (2007)                                     *
+*      X Rouby, J de Favereau, K Piotrzkowski (CP3)         *
+*       http://www.fynu.ucl.ac.be/hector.html               *
+*                                                           *
+* Center for Cosmology, Particle Physics and Phenomenology  *
+*              Universite catholique de Louvain             *
+*                 Louvain-la-Neuve, Belgium                 *
+ *                                                         *
+   * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
 /// \file H_Aperture.h
@@ -18,12 +25,9 @@
 // C++ #defines
 #include <string>
+#include <iostream>
 using namespace std;
 
 // local #defines
-#define NONE        0
-#define RECTANGULAR 1
-#define ELLIPTIC    2
-#define CIRCULAR    3
-#define RECTELLIPSE 4
+enum {NONE=0, RECTANGULAR, ELLIPTIC, CIRCULAR, RECTELLIPSE};
 #define NONENAME        "None       "
 #define RECTANGULARNAME "Rectangle  "
@@ -43,9 +47,10 @@
 		H_Aperture& operator=(const H_Aperture&);
 		virtual ~H_Aperture() { };
-		virtual H_Aperture* clone() const { return new H_Aperture(type,x1,x2,x3,x4,fx,fy); };
+		virtual H_Aperture* clone() const { return new H_Aperture(type_,x1,x2,x3,x4,fx,fy); };
 		//@}
 
 		/// Prints the aperture features
-		virtual void printProperties() const;
+		//virtual void printProperties() const;
+		void printProperties() const;
 		/// Draws the aperture shape
 		virtual void draw(const float scale=1) const {return;};
@@ -55,5 +60,5 @@
 		virtual bool isInside(const float, const float) const; 
 		/// Returns the (int) type of aperture
-		inline int getType() const {return type;};
+		inline int getType() const {return type_;};
 		/// Returns the (string) type of the aperture
 		inline const string getTypeString() const { return aptypestring; }
@@ -62,20 +67,23 @@
 	protected:
 		/// Aperture shape (either RECTANGULAR or ELLIPTIC or ...)
-		int type;
-		/// Aperture shape string
-		string aptypestring;
-
+		int type_;
 		/// Aperture geometrical sizes (length/width or great/small radii) [m]
 		//@{
 		float x1, x2, x3, x4; 
 		//@}
-
 		/// Horizontal coordinate of the aperture center [m] (from the nominal beam position).
 		//@{
 		float fx, fy;
 		//@}
-		/// Sets the name of the aperture from its type.
-		void setApertureString();
+                /// Aperture shape string
+                string aptypestring;
+		// Sets the name of the aperture from its type.
+		//void setApertureString();
+		/// Gets the name of the aperture from its type.
+		const string getApertureString() const;
+
+	friend std::ostream& operator<< (std::ostream& os, const H_Aperture& ap);
 };
 
+
 #endif
Index: trunk/Utilities/Hector/include/H_Beam.h
===================================================================
--- trunk/Utilities/Hector/include/H_Beam.h	(revision 237)
+++ trunk/Utilities/Hector/include/H_Beam.h	(revision 281)
@@ -2,14 +2,21 @@
 #define _H_Beam_
 
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
+  /* * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *                                                         *
+*                   --<--<--  A fast simulator --<--<--     *
+*                 / --<--<--     of particle   --<--<--     *
+*  ----HECTOR----<                                          *
+*                 \ -->-->-- transport through -->-->--     *
+*                   -->-->-- generic beamlines -->-->--     *
+*                                                           *
+* JINST 2:P09005 (2007)                                     *
+*      X Rouby, J de Favereau, K Piotrzkowski (CP3)         *
+*       http://www.fynu.ucl.ac.be/hector.html               *
+*                                                           *
+* Center for Cosmology, Particle Physics and Phenomenology  *
+*              Universite catholique de Louvain             *
+*                 Louvain-la-Neuve, Belgium                 *
+ *                                                         *
+   * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
 /// \file H_Beam.h
@@ -27,4 +34,5 @@
 #include "TGraphErrors.h"
 #include "TMultiGraph.h"
+#include "TMath.h"
 
 // local #includes
@@ -56,12 +64,8 @@
 	//@}
         /// Fills the beam with particles in given position/angle/energy        intervals (flat distribution)
-                //void particleGun(const unsigned int Number_of_particles, const float E_min, const float E_max, const float fs_min, const float fs_max, const float fx_min, const float fx_max, const float fy_min, const float fy_max, const float tx_min, const float tx_max, const float ty_min, const float ty_max, const float p_mass, const double p_charge);
-                void particleGun(const unsigned int Number_of_particles, const float E_min=BE, const float E_max=BE, const float fs_min=0, const float fs_max=0, const float fx_min=0, const float fx_max=0, const float fy_min=0, const float fy_max=0, const float tx_min=-pi/2., const float tx_max=pi/2., const float ty_min=-pi/2., const float ty_max=pi/2., const float p_mass=MP, const double p_charge=QP, const bool flat = true);
+                void particleGun(const unsigned int Number_of_particles, const float E_min=BE, const float E_max=BE, const float fs_min=0, const float fs_max=0, const float fx_min=0, const float fx_max=0, const float fy_min=0, const float fy_max=0, const float tx_min=-TMath::Pi()/2., const float tx_max=TMath::Pi()/2., const float ty_min=-TMath::Pi()/2., const float ty_max=TMath::Pi()/2., const float p_mass=MP, const double p_charge=QP, const bool flat = true, TRandom* r=gRandom);
 
 	/// Fills the beam with particles
-	//@{
-		void createBeamParticles(const unsigned int , const double , const double );
-		void createBeamParticles(const unsigned int);
-	//@}
+		void createBeamParticles(const unsigned int Number_of_particles, const double p_mass=MP, const double p_charge=QP, TRandom* r=gRandom);
 	/// Fills the beam with particles with incremental offset and no initial transverse momentum
 	//@{
@@ -82,13 +86,7 @@
 		void add(const H_BeamParticle&);
 	/// Compute the position of each particle in the beamline
-	//@{	
-		void computePath(const H_AbstractBeamLine *, const bool);
-		void computePath(const H_AbstractBeamLine *);
-	//@}
+		void computePath(const H_AbstractBeamLine * beamline, const bool NonLinear=false);
 	// Photon emission by the particle
-	// @{
-                void emitGamma(const double, const double, const double, const double);
-		void emitGamma(const double, const double);
-	//@}
+                void emitGamma(const double gee, const double gq2, const double phimin=0, const double phimax=2*TMath::Pi());
 	// Propagates the beam until a given s
 		void propagate(const float );
@@ -146,5 +144,5 @@
 		void printInitialState() const;
 	/// Prints the properties for each particle
-		void printProperties() const;
+		void printProperties() const {cout << *this; return;}
 	/// Prints the list of the stopping elements in the beamline
 		void printStoppingElements(const vector<H_OpticalElement>&, const vector<int>&) const;
@@ -186,5 +184,5 @@
 		unsigned int Nparticles;
 
-	static const float pi = 3.14159265358979312;
+	friend std::ostream& operator<< (std::ostream& os, const H_Beam& be);
 };
 
Index: trunk/Utilities/Hector/include/H_BeamLine.h
===================================================================
--- trunk/Utilities/Hector/include/H_BeamLine.h	(revision 237)
+++ trunk/Utilities/Hector/include/H_BeamLine.h	(revision 281)
@@ -2,14 +2,21 @@
 #define _H_BeamLine_
 
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
+  /* * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *                                                         *
+*                   --<--<--  A fast simulator --<--<--     *
+*                 / --<--<--     of particle   --<--<--     *
+*  ----HECTOR----<                                          *
+*                 \ -->-->-- transport through -->-->--     *
+*                   -->-->-- generic beamlines -->-->--     *
+*                                                           *
+* JINST 2:P09005 (2007)                                     *
+*      X Rouby, J de Favereau, K Piotrzkowski (CP3)         *
+*       http://www.fynu.ucl.ac.be/hector.html               *
+*                                                           *
+* Center for Cosmology, Particle Physics and Phenomenology  *
+*              Universite catholique de Louvain             *
+*                 Louvain-la-Neuve, Belgium                 *
+ *                                                         *
+   * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
 /// \file H_BeamLine.h
@@ -32,5 +39,5 @@
 	///     Constructors and destructor
 	//@{
-		H_BeamLine():H_AbstractBeamLine() {direction=1; ips=0; };
+		H_BeamLine();
 		H_BeamLine(const H_BeamLine& );
 		H_BeamLine(const int, const float);
@@ -39,15 +46,9 @@
 	//@
 		///     Finds the IP position (s) from the MAD table. Should be "IP5" or "IP1".
-		//@{
-		void findIP(const string&);
-		void findIP(const string&, const string&);
-		//@}
+		void findIP(const string& filename, const string& ipname="IP5");
 		///     Reader for the external MAD table
-		//@{
-		void fill(const string&);
-		void fill(const string&, const int, const string& );
-		//@}
+		void fill(const string& filename, const int dir=1, const string& ipname="IP5");
 		///     Returns the IP position (s)
-		double getIP() {return ips;};
+		double getIP() const {return ips;};
 		///		Returns positions and angles of beam at IP
 		double* getIPProperties();
Index: trunk/Utilities/Hector/include/H_BeamLineParser.h
===================================================================
--- trunk/Utilities/Hector/include/H_BeamLineParser.h	(revision 237)
+++ trunk/Utilities/Hector/include/H_BeamLineParser.h	(revision 281)
@@ -2,14 +2,21 @@
 #define _H_BeamLineParser_
 
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
+  /* * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *                                                         *
+*                   --<--<--  A fast simulator --<--<--     *
+*                 / --<--<--     of particle   --<--<--     *
+*  ----HECTOR----<                                          *
+*                 \ -->-->-- transport through -->-->--     *
+*                   -->-->-- generic beamlines -->-->--     *
+*                                                           *
+* JINST 2:P09005 (2007)                                     *
+*      X Rouby, J de Favereau, K Piotrzkowski (CP3)         *
+*       http://www.fynu.ucl.ac.be/hector.html               *
+*                                                           *
+* Center for Cosmology, Particle Physics and Phenomenology  *
+*              Universite catholique de Louvain             *
+*                 Louvain-la-Neuve, Belgium                 *
+ *                                                         *
+   * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
 /// \file H_BeamLineParser.h
Index: trunk/Utilities/Hector/include/H_BeamParticle.h
===================================================================
--- trunk/Utilities/Hector/include/H_BeamParticle.h	(revision 237)
+++ trunk/Utilities/Hector/include/H_BeamParticle.h	(revision 281)
@@ -2,14 +2,21 @@
 #define _H_BeamParticle_
 
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
+  /* * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *                                                         *
+*                   --<--<--  A fast simulator --<--<--     *
+*                 / --<--<--     of particle   --<--<--     *
+*  ----HECTOR----<                                          *
+*                 \ -->-->-- transport through -->-->--     *
+*                   -->-->-- generic beamlines -->-->--     *
+*                                                           *
+* JINST 2:P09005 (2007)                                     *
+*      X Rouby, J de Favereau, K Piotrzkowski (CP3)         *
+*       http://www.fynu.ucl.ac.be/hector.html               *
+*                                                           *
+* Center for Cosmology, Particle Physics and Phenomenology  *
+*              Universite catholique de Louvain             *
+*                 Louvain-la-Neuve, Belgium                 *
+ *                                                         *
+   * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
 /// \file H_BeamParticle.h
@@ -27,4 +34,5 @@
 #include "TVectorD.h"
 #include "TLorentzVector.h"
+#include "TRandom3.h"
 
 // local #includes
@@ -39,5 +47,4 @@
 
 	public:
-		void init();
 		/// Constructors and Destructor
 		//@{
@@ -49,19 +56,11 @@
 		//@}
 		/// Smears the (x,y) coordinates of the particle [\f$ \mu m \f$]
-		void smearPos(const double, const double);
-		/// Smears the (x,y) coordinates of the particle (using default values in parameters.h)
-		void smearPos();
+		void smearPos(const double dx=SX,const double dy=SY, TRandom* r=gRandom);
 		/// Smears the (x,y) angular coordinates of the particle [\f$ \mu rad \f$]
-		void smearAng(const double, const double);
-		/// Smears the (x,y) angular coordinates of the particle (using default values in parameters.h)
-		void smearAng();
+		void smearAng(const double tx=STX, const double ty=STY, TRandom* r=gRandom);
 		/// Smears the Energy of the particle [GeV]
-		void smearE(const double);
-		/// Smears the Energy of the particle (using default values in parameters.h) 
-		void smearE();
+		void smearE(const double erre=SBE, TRandom* r=gRandom);
 		/// Smears the longitudinal position of the particle [\f$ \mu m \f$]
-		void smearS(const double);
-		/// Smears the longitudinal position of the particle (using default values in parameters.h)
-		void smearS();
+		void smearS(const double errs=SS, TRandom* r=gRandom);
 		/// Sets the energy [GeV].
 		void setE(const double);
@@ -73,22 +72,22 @@
 		void setPosition(const double , const double , const double , const double , const double );
 		/// Returns the particle mass [GeV]
-		double getM() const {return mp;};
+		const double getM() const {return mp;};
 		/// Returns the particle charge [e]
-		double getQ() const {return qp;};
+		const double getQ() const {return qp;};
 		/// Returns the current x coordinate [\f$ \mu \f$m]
-		double getX() const {return fx;};
+		const double getX() const {return fx;};
 		/// Returns the current y coordinate [\f$ \mu \f$m]
-		double getY() const {return fy;};
+		const double getY() const {return fy;};
 		/// Returns the current s coordinate [m]
-		inline double getS() const {return fs;};
+		const double getS() const {return fs;};
 		/// Returns the current \f$ \theta_x \f$ angular coordinate [\f$ \mu \f$rad]
-		double getTX() const {return thx;};
+		const double getTX() const {return thx;};
 		/// Returns the current \f$ \theta_y \f$ angular coordinate [\f$ \mu \f$rad]
-		double getTY() const {return thy;};
+		const double getTY() const {return thy;};
 		/// Returns the current particle energy [GeV]
-		inline double getE() const {return energy;};
+		const double getE() const {return energy;};
 		/// Returns all the positions 
 		vector<TVectorD> getPositions() const {return positions;};
-		bool isPhysical() const {return isphysical;};
+		const bool isPhysical() const {return isphysical;};
 		/// \brief Simulates the emission of a photon in a random direction
 		///
@@ -99,6 +98,5 @@
         	/// \f$ Q^{2}_{max} = -2 * \big( \frac{M_{p} E_{\gamma}}{p_{1}+p_{2}} \big) \big[ 1 + \frac{E^{2}_{1} + E^{2}_{2} - M^{2}_{p} }{ E_{1} E_{2} + p_{1} p_{2}} \big]    \f$
 		//@{
-		void emitGamma(const double, const double, const double, const double);
-		void emitGamma(const double, const double);
+		void emitGamma(const double gee, const double gq2, const double phimin=0, const double phimax=2*TMath::Pi());
 		//@}
                 /// uses Pythia to generate some inelastic pp->pX collision as background
@@ -120,5 +118,5 @@
 		const TVectorD * getPosition(const int ) const;
 		/// Prints the properties of the particle
-		void printProperties() const;
+		void printProperties() const {cout << *this; return;};
 		/// Prints the phase vector of the particle
 		void printV() const;
@@ -126,5 +124,5 @@
 		const H_OpticalElement * getStoppingElement() const;
 		/// Checks if the particle has been stopped in any element of the beamline
-		bool stopped(const H_AbstractBeamLine *);
+		const bool stopped(const H_AbstractBeamLine *);
 		/// Returns the StopPosition vector
 		inline const TVectorD * getStopPosition() const { return stop_position; };
@@ -134,14 +132,13 @@
 		/// Returns the particle path in the beamline
 		TGraph * getPath(const int , const int ) const;
-		/// Computes the position of the particle at the end of each element of the beam, without non linear effects
-		void computePath(const H_AbstractBeamLine *);
 		/// Computes the position of the particle at the end of each element of the beam.
-		void computePath(const H_AbstractBeamLine *, const bool);
+		void computePath(const H_AbstractBeamLine * beam, const bool NonLinear=true);
 		/// Computes the position of the particle at the end of each element of the beam.
-		void computePath(const H_AbstractBeamLine &, const bool);
+		void computePath(const H_AbstractBeamLine & beam, const bool NonLinear=true);
 		/// Clears H_BeamParticle::positions but keeps the initial vector.
 		void resetPath();
 
 	private:
+		void init();
 		/// Particle mass [GeV]
 		double mp;
@@ -175,5 +172,5 @@
   		void addPosition(const double , const double , const double , const double , const double );
 
-		static const float pi = 3.14159265358979312;
+	friend std::ostream& operator<< (std::ostream& os, const H_BeamParticle& p);
 };
 #endif
Index: trunk/Utilities/Hector/include/H_CircularAperture.h
===================================================================
--- trunk/Utilities/Hector/include/H_CircularAperture.h	(revision 237)
+++ trunk/Utilities/Hector/include/H_CircularAperture.h	(revision 281)
@@ -2,14 +2,21 @@
 #define _H_CircularAperture_
 
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
+  /* * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *                                                         *
+*                   --<--<--  A fast simulator --<--<--     *
+*                 / --<--<--     of particle   --<--<--     *
+*  ----HECTOR----<                                          *
+*                 \ -->-->-- transport through -->-->--     *
+*                   -->-->-- generic beamlines -->-->--     *
+*                                                           *
+* JINST 2:P09005 (2007)                                     *
+*      X Rouby, J de Favereau, K Piotrzkowski (CP3)         *
+*       http://www.fynu.ucl.ac.be/hector.html               *
+*                                                           *
+* Center for Cosmology, Particle Physics and Phenomenology  *
+*              Universite catholique de Louvain             *
+*                 Louvain-la-Neuve, Belgium                 *
+ *                                                         *
+   * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
 /// \file H_CircularAperture.h
@@ -26,10 +33,12 @@
 		/// Constructors and destructor
 		//@{
-		H_CircularAperture():H_EllipticAperture(0,0,0,0) {type = CIRCULAR; setApertureString();}
-		H_CircularAperture(const float, const float, const float);
+		H_CircularAperture():H_EllipticAperture(CIRCULAR,0,0,0,0) {};
+		H_CircularAperture(const float r, const float posx, const float posy) : H_EllipticAperture(CIRCULAR,r,r,posx,posy) {};
+		/// @param r is the radius of the circular shape
+        	/// @param posx, posy are the (x,y) coordinates of the center of the circle
 		~H_CircularAperture() {};
 		H_CircularAperture* clone() const;
 		//@}
-		virtual void printProperties() const;
+	friend std::ostream& operator<< (std::ostream& os, const H_CircularAperture& ap);
 };
 
Index: trunk/Utilities/Hector/include/H_Dipole.h
===================================================================
--- trunk/Utilities/Hector/include/H_Dipole.h	(revision 237)
+++ trunk/Utilities/Hector/include/H_Dipole.h	(revision 281)
@@ -2,14 +2,21 @@
 /// \brief Class aiming at simulating LHC beam dipoles.
 
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
+  /* * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *                                                         *
+*                   --<--<--  A fast simulator --<--<--     *
+*                 / --<--<--     of particle   --<--<--     *
+*  ----HECTOR----<                                          *
+*                 \ -->-->-- transport through -->-->--     *
+*                   -->-->-- generic beamlines -->-->--     *
+*                                                           *
+* JINST 2:P09005 (2007)                                     *
+*      X Rouby, J de Favereau, K Piotrzkowski (CP3)         *
+*       http://www.fynu.ucl.ac.be/hector.html               *
+*                                                           *
+* Center for Cosmology, Particle Physics and Phenomenology  *
+*              Universite catholique de Louvain             *
+*                 Louvain-la-Neuve, Belgium                 *
+ *                                                         *
+   * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
 #ifndef _H_Dipole_
@@ -30,5 +37,5 @@
 		//@}
 		/// Prints the properties of the element
-		virtual void printProperties() const;
+		virtual void printProperties() const { cout << *this; return;};
 		virtual H_Dipole* clone() const =0;
 		void init();
@@ -37,5 +44,6 @@
     		virtual void setTypeString() =0;
 	    	virtual void setMatrix(const float, const float, const float) = 0;
-    	
+    
+	friend std::ostream& operator<< (std::ostream& os, const H_Dipole& el);
 };
 
Index: trunk/Utilities/Hector/include/H_Drift.h
===================================================================
--- trunk/Utilities/Hector/include/H_Drift.h	(revision 237)
+++ trunk/Utilities/Hector/include/H_Drift.h	(revision 281)
@@ -2,14 +2,21 @@
 #define _H_Drift_
 
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
+  /* * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *                                                         *
+*                   --<--<--  A fast simulator --<--<--     *
+*                 / --<--<--     of particle   --<--<--     *
+*  ----HECTOR----<                                          *
+*                 \ -->-->-- transport through -->-->--     *
+*                   -->-->-- generic beamlines -->-->--     *
+*                                                           *
+* JINST 2:P09005 (2007)                                     *
+*      X Rouby, J de Favereau, K Piotrzkowski (CP3)         *
+*       http://www.fynu.ucl.ac.be/hector.html               *
+*                                                           *
+* Center for Cosmology, Particle Physics and Phenomenology  *
+*              Universite catholique de Louvain             *
+*                 Louvain-la-Neuve, Belgium                 *
+ *                                                         *
+   * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
 /// \file H_Drift.h
@@ -30,6 +37,6 @@
 	        ~H_Drift() { };
 	//@}
-        	virtual void printProperties() const;
 	        void init();
+		virtual void printProperties() const { cout << *this; return;};
 		H_Drift* clone() const;
 
@@ -37,4 +44,5 @@
         	virtual void setTypeString() {typestring = DRIFTNAME;};
 	        virtual void setMatrix(const float, const float, const float) ;
+	friend std::ostream& operator<< (std::ostream& os, const H_Drift& el);
 };
 
Index: trunk/Utilities/Hector/include/H_EllipticAperture.h
===================================================================
--- trunk/Utilities/Hector/include/H_EllipticAperture.h	(revision 237)
+++ trunk/Utilities/Hector/include/H_EllipticAperture.h	(revision 281)
@@ -2,14 +2,21 @@
 #define _H_EllipticAperture_
 
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
+  /* * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *                                                         *
+*                   --<--<--  A fast simulator --<--<--     *
+*                 / --<--<--     of particle   --<--<--     *
+*  ----HECTOR----<                                          *
+*                 \ -->-->-- transport through -->-->--     *
+*                   -->-->-- generic beamlines -->-->--     *
+*                                                           *
+* JINST 2:P09005 (2007)                                     *
+*      X Rouby, J de Favereau, K Piotrzkowski (CP3)         *
+*       http://www.fynu.ucl.ac.be/hector.html               *
+*                                                           *
+* Center for Cosmology, Particle Physics and Phenomenology  *
+*              Universite catholique de Louvain             *
+*                 Louvain-la-Neuve, Belgium                 *
+ *                                                         *
+   * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
 /// \file H_EllipticAperture.h
@@ -26,4 +33,5 @@
 		//@{
 		H_EllipticAperture():H_Aperture(ELLIPTIC,0,0,0,0,0,0) {}
+		H_EllipticAperture(const int, const float, const float, const float, const float);
 		H_EllipticAperture(const float, const float, const float, const float);
 		~H_EllipticAperture() {};
@@ -34,5 +42,5 @@
 		/// Draws the aperture shape.
 		virtual void draw(const float scale=1) const;
-		virtual void printProperties() const;
+	friend std::ostream& operator<< (std::ostream& os, const H_EllipticAperture& ap);
 };
 
Index: trunk/Utilities/Hector/include/H_HorizontalKicker.h
===================================================================
--- trunk/Utilities/Hector/include/H_HorizontalKicker.h	(revision 237)
+++ trunk/Utilities/Hector/include/H_HorizontalKicker.h	(revision 281)
@@ -1,20 +1,27 @@
+#ifndef _H_HorizontalKicker_
+#define _H_HorizontalKicker_
+
+  /* * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *                                                         *
+*                   --<--<--  A fast simulator --<--<--     *
+*                 / --<--<--     of particle   --<--<--     *
+*  ----HECTOR----<                                          *
+*                 \ -->-->-- transport through -->-->--     *
+*                   -->-->-- generic beamlines -->-->--     *
+*                                                           *
+* JINST 2:P09005 (2007)                                     *
+*      X Rouby, J de Favereau, K Piotrzkowski (CP3)         *
+*       http://www.fynu.ucl.ac.be/hector.html               *
+*                                                           *
+* Center for Cosmology, Particle Physics and Phenomenology  *
+*              Universite catholique de Louvain             *
+*                 Louvain-la-Neuve, Belgium                 *
+ *                                                         *
+   * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
 /// \file H_HorizontalKicker.h
 /// \brief Classes aiming at simulating horizontal kickers in beamline.
 ///
 /// fk [rad] for kickers !!!!
-
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-#ifndef _H_HorizontalKicker_
-#define _H_HorizontalKicker_
 
 // local #includes
Index: trunk/Utilities/Hector/include/H_HorizontalQuadrupole.h
===================================================================
--- trunk/Utilities/Hector/include/H_HorizontalQuadrupole.h	(revision 237)
+++ trunk/Utilities/Hector/include/H_HorizontalQuadrupole.h	(revision 281)
@@ -2,14 +2,21 @@
 #define _H_HorizontalQuadrupole_
 
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
+  /* * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *                                                         *
+*                   --<--<--  A fast simulator --<--<--     *
+*                 / --<--<--     of particle   --<--<--     *
+*  ----HECTOR----<                                          *
+*                 \ -->-->-- transport through -->-->--     *
+*                   -->-->-- generic beamlines -->-->--     *
+*                                                           *
+* JINST 2:P09005 (2007)                                     *
+*      X Rouby, J de Favereau, K Piotrzkowski (CP3)         *
+*       http://www.fynu.ucl.ac.be/hector.html               *
+*                                                           *
+* Center for Cosmology, Particle Physics and Phenomenology  *
+*              Universite catholique de Louvain             *
+*                 Louvain-la-Neuve, Belgium                 *
+ *                                                         *
+   * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
 /// \file H_HorizontalQuadrupole.h
Index: trunk/Utilities/Hector/include/H_Kicker.h
===================================================================
--- trunk/Utilities/Hector/include/H_Kicker.h	(revision 237)
+++ trunk/Utilities/Hector/include/H_Kicker.h	(revision 281)
@@ -1,19 +1,26 @@
+#ifndef _H_Kicker_
+#define _H_Kicker_
+
+  /* * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *                                                         *
+*                   --<--<--  A fast simulator --<--<--     *
+*                 / --<--<--     of particle   --<--<--     *
+*  ----HECTOR----<                                          *
+*                 \ -->-->-- transport through -->-->--     *
+*                   -->-->-- generic beamlines -->-->--     *
+*                                                           *
+* JINST 2:P09005 (2007)                                     *
+*      X Rouby, J de Favereau, K Piotrzkowski (CP3)         *
+*       http://www.fynu.ucl.ac.be/hector.html               *
+*                                                           *
+* Center for Cosmology, Particle Physics and Phenomenology  *
+*              Universite catholique de Louvain             *
+*                 Louvain-la-Neuve, Belgium                 *
+ *                                                         *
+   * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
 /// \file H_Kicker.h
 /// \brief Classes aiming at simulating kickers in LHC beamline.
 /// fk [rad] for kickers !!!!
-
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
-
-#ifndef _H_Kicker_
-#define _H_Kicker_
 
 // local #includes
@@ -31,7 +38,6 @@
 		virtual ~H_Kicker() {};
 	//@}
-	/// prints the kicker properties
-		virtual void printProperties() const;
 		virtual H_Kicker* clone() const = 0;
+		virtual void printProperties() const { cout << *this; return;};
 		void init();
 
@@ -39,4 +45,5 @@
 		virtual void setTypeString() = 0;
 		virtual void setMatrix(const float, const float, const float) = 0;
+	friend std::ostream& operator<< (std::ostream& os, const H_Kicker& el);
 };
 
Index: trunk/Utilities/Hector/include/H_Marker.h
===================================================================
--- trunk/Utilities/Hector/include/H_Marker.h	(revision 237)
+++ trunk/Utilities/Hector/include/H_Marker.h	(revision 281)
@@ -2,14 +2,21 @@
 #define _H_Marker_
 
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
+  /* * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *                                                         *
+*                   --<--<--  A fast simulator --<--<--     *
+*                 / --<--<--     of particle   --<--<--     *
+*  ----HECTOR----<                                          *
+*                 \ -->-->-- transport through -->-->--     *
+*                   -->-->-- generic beamlines -->-->--     *
+*                                                           *
+* JINST 2:P09005 (2007)                                     *
+*      X Rouby, J de Favereau, K Piotrzkowski (CP3)         *
+*       http://www.fynu.ucl.ac.be/hector.html               *
+*                                                           *
+* Center for Cosmology, Particle Physics and Phenomenology  *
+*              Universite catholique de Louvain             *
+*                 Louvain-la-Neuve, Belgium                 *
+ *                                                         *
+   * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
 /// \file H_Marker.h
@@ -30,5 +37,4 @@
 	        ~H_Marker() { };
 	//@}
-        	virtual void printProperties() const;
 		H_Marker* clone() const ;
 	        void init();
@@ -37,4 +43,5 @@
         	virtual void setTypeString() {typestring = MARKERNAME;};
 	        virtual void setMatrix(const float , const float, const float) ;
+	friend std::ostream& operator<< (std::ostream& os, const H_Marker& el);
 };
 
Index: trunk/Utilities/Hector/include/H_OpticalElement.h
===================================================================
--- trunk/Utilities/Hector/include/H_OpticalElement.h	(revision 237)
+++ trunk/Utilities/Hector/include/H_OpticalElement.h	(revision 281)
@@ -2,14 +2,21 @@
 #define _H_OpticalElement_
 
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
+  /* * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *                                                         *
+*                   --<--<--  A fast simulator --<--<--     *
+*                 / --<--<--     of particle   --<--<--     *
+*  ----HECTOR----<                                          *
+*                 \ -->-->-- transport through -->-->--     *
+*                   -->-->-- generic beamlines -->-->--     *
+*                                                           *
+* JINST 2:P09005 (2007)                                     *
+*      X Rouby, J de Favereau, K Piotrzkowski (CP3)         *
+*       http://www.fynu.ucl.ac.be/hector.html               *
+*                                                           *
+* Center for Cosmology, Particle Physics and Phenomenology  *
+*              Universite catholique de Louvain             *
+*                 Louvain-la-Neuve, Belgium                 *
+ *                                                         *
+   * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
 /// \file H_OpticalElement.h
@@ -36,17 +43,5 @@
 
 	// type #defines
-#define DRIFT        1
-#define RDIPOLE      2
-#define SDIPOLE      3
-#define VQUADRUPOLE  4
-#define HQUADRUPOLE  5
-#define VKICKER      6
-#define HKICKER      7
-#define RCOLLIMATOR  8
-#define ECOLLIMATOR  9
-#define CCOLLIMATOR 10
-#define RP          11
-#define IP          12
-#define MARKER      13
+enum {DRIFT=1, RDIPOLE, SDIPOLE, VQUADRUPOLE, HQUADRUPOLE, VKICKER, HKICKER, RCOLLIMATOR, ECOLLIMATOR, CCOLLIMATOR, RP, IP, MARKER};
 
 	// typestring[30] #defines
@@ -82,5 +77,5 @@
 		//@}
 		///     Prints the element features
-	        virtual void printProperties() const ;
+	        virtual void printProperties() const { cout << *this; return;};
 		///     Shows the element transport matrix
 	        void showMatrix() const ;
@@ -90,7 +85,7 @@
 		void setAperture(const H_Aperture*);
 		///     Ordering operator acting on the s coordinate
-		inline bool operator>(const H_OpticalElement tocomp) const {if(fs>tocomp.getS()) { return true; } else { return false; }};
+		inline bool operator>(const H_OpticalElement& tocomp) const {return ( fs>tocomp.getS() ); };
 		///     Ordering operator acting on the s coordinate
-		inline bool operator<(const H_OpticalElement tocomp) const {if(fs<tocomp.getS()) { return true; } else { return false; }};
+		inline bool operator<(const H_OpticalElement& tocomp) const {return ( fs<tocomp.getS() ); };
 		/// 	Copy operator
 		H_OpticalElement& operator=(const H_OpticalElement&); 
@@ -178,5 +173,5 @@
                 //@}
 		virtual H_OpticalElement* clone() const { return new H_OpticalElement();};
-		TVectorD getHitPosition(TVectorD, double, double, double);
+		TVectorD getHitPosition(const TVectorD& , const double, const double, const double);
 
 
@@ -210,9 +205,11 @@
 		virtual void setTypeString() {return;};
 		/// Optical element transport matrix.
-	    virtual void setMatrix(const float, const float, const float) { cout<<"dummy setmatrix"<<endl; return;};
+		virtual void setMatrix(const float, const float, const float) { cout<<"dummy setmatrix"<<endl; return;};
 		/// Optical element transport matrix.
  		TMatrix element_mat;
 		/// Optical element aperture. 
 	    	H_Aperture* element_aperture;
+
+	friend std::ostream& operator<< (std::ostream& os, const H_OpticalElement& el);
 };
 
Index: trunk/Utilities/Hector/include/H_Parameters.h
===================================================================
--- trunk/Utilities/Hector/include/H_Parameters.h	(revision 237)
+++ trunk/Utilities/Hector/include/H_Parameters.h	(revision 281)
@@ -2,18 +2,21 @@
 #define _Hector_parameters_
 
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-	J.~de Favereau, X.~Rouby and K.~Piotrzkowski, 
-        Hector, a fast simulator for the transport of particles in beamlines,
-	JINST 2, P09005 (2007)
-	arXiv:0707.1198 [physics.acc-ph]
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
+  /* * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *                                                         *
+*                   --<--<--  A fast simulator --<--<--     *
+*                 / --<--<--     of particle   --<--<--     *
+*  ----HECTOR----<                                          *
+*                 \ -->-->-- transport through -->-->--     *
+*                   -->-->-- generic beamlines -->-->--     *
+*                                                           *
+* JINST 2:P09005 (2007)                                     *
+*      X Rouby, J de Favereau, K Piotrzkowski (CP3)         *
+*       http://www.fynu.ucl.ac.be/hector.html               *
+*                                                           *
+* Center for Cosmology, Particle Physics and Phenomenology  *
+*              Universite catholique de Louvain             *
+*                 Louvain-la-Neuve, Belgium                 *
+ *                                                         *
+   * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
 /// \file H_Parameters.h
Index: trunk/Utilities/Hector/include/H_Quadrupole.h
===================================================================
--- trunk/Utilities/Hector/include/H_Quadrupole.h	(revision 237)
+++ trunk/Utilities/Hector/include/H_Quadrupole.h	(revision 281)
@@ -2,14 +2,21 @@
 #define _H_Quadrupole_
 
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
+  /* * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *                                                         *
+*                   --<--<--  A fast simulator --<--<--     *
+*                 / --<--<--     of particle   --<--<--     *
+*  ----HECTOR----<                                          *
+*                 \ -->-->-- transport through -->-->--     *
+*                   -->-->-- generic beamlines -->-->--     *
+*                                                           *
+* JINST 2:P09005 (2007)                                     *
+*      X Rouby, J de Favereau, K Piotrzkowski (CP3)         *
+*       http://www.fynu.ucl.ac.be/hector.html               *
+*                                                           *
+* Center for Cosmology, Particle Physics and Phenomenology  *
+*              Universite catholique de Louvain             *
+*                 Louvain-la-Neuve, Belgium                 *
+ *                                                         *
+   * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
 /// \file H_Quadrupole.h
@@ -30,6 +37,6 @@
 		virtual ~H_Quadrupole() {};
 	//@}	
-		virtual void printProperties() const;
 		virtual H_Quadrupole* clone() const =0 ;
+		virtual void printProperties() const { cout << *this; return;};
 		void init();
 
@@ -38,4 +45,5 @@
 		virtual void setMatrix(const float, const float, const float) = 0;
 	   	
+	friend std::ostream& operator<< (std::ostream& os, const H_Quadrupole& el);
 };
 
Index: trunk/Utilities/Hector/include/H_RecRPObject.h
===================================================================
--- trunk/Utilities/Hector/include/H_RecRPObject.h	(revision 237)
+++ trunk/Utilities/Hector/include/H_RecRPObject.h	(revision 281)
@@ -2,14 +2,21 @@
 #define _H_RecRPObject_
 
-/*
- * ---- Hector the simulator ----
- * A fast simulator of particles through generic beamlines.
- * J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
- *
- * http://www.fynu.ucl.ac.be/hector.html
- *
- * Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
- * UniversitÃ© Catholique de Louvain (UCL)
-*/
+  /* * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *                                                         *
+*                   --<--<--  A fast simulator --<--<--     *
+*                 / --<--<--     of particle   --<--<--     *
+*  ----HECTOR----<                                          *
+*                 \ -->-->-- transport through -->-->--     *
+*                   -->-->-- generic beamlines -->-->--     *
+*                                                           *
+* JINST 2:P09005 (2007)                                     *
+*      X Rouby, J de Favereau, K Piotrzkowski (CP3)         *
+*       http://www.fynu.ucl.ac.be/hector.html               *
+*                                                           *
+* Center for Cosmology, Particle Physics and Phenomenology  *
+*              Universite catholique de Louvain             *
+*                 Louvain-la-Neuve, Belgium                 *
+ *                                                         *
+   * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
 /// \file H_RecRPObject.h
@@ -22,11 +29,15 @@
 #define NOT_YET_COMPUTED -666
 
+/// Reconstruction of parameters at IP using measurements with roman pots
 class H_RecRPObject {
 	public:
 		H_RecRPObject();
-		H_RecRPObject(const float, const float, H_AbstractBeamLine* );
+		H_RecRPObject(const float, const float, const H_AbstractBeamLine* );
 		H_RecRPObject(const H_RecRPObject&);
 		H_RecRPObject& operator=(const H_RecRPObject&);
-		~H_RecRPObject() {if(f_1) delete f_1; if(f_2) delete f_2; if(g_1) delete g_1; if(g_2) delete g_2; if(d_1) delete d_1; if(d_2) delete d_2; if(k_1) delete k_1; if(k_2) delete k_2; if(l_1) delete l_1; if(l_2) delete l_2; };
+		~H_RecRPObject() {delete f_1; delete f_2; delete g_1; delete g_2; 
+				  delete d_1; delete d_2; delete k_1; delete k_2; 
+				  delete l_1; delete l_2; 
+				  delete thebeam;};
 
 		inline float getX1() const {return x1;};
@@ -64,4 +75,5 @@
 		TF1* k_1, *k_2;
 		TF1* l_1, *l_2;
+	friend std::ostream& operator<< (std::ostream& os, const H_RecRPObject& rp);
 };
 
Index: trunk/Utilities/Hector/include/H_RectEllipticAperture.h
===================================================================
--- trunk/Utilities/Hector/include/H_RectEllipticAperture.h	(revision 237)
+++ trunk/Utilities/Hector/include/H_RectEllipticAperture.h	(revision 281)
@@ -2,17 +2,24 @@
 #define _H_RectEllipticAperture_
 
+  /* * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *                                                         *
+*                   --<--<--  A fast simulator --<--<--     *
+*                 / --<--<--     of particle   --<--<--     *
+*  ----HECTOR----<                                          *
+*                 \ -->-->-- transport through -->-->--     *
+*                   -->-->-- generic beamlines -->-->--     *
+*                                                           *
+* JINST 2:P09005 (2007)                                     *
+*      X Rouby, J de Favereau, K Piotrzkowski (CP3)         *
+*       http://www.fynu.ucl.ac.be/hector.html               *
+*                                                           *
+* Center for Cosmology, Particle Physics and Phenomenology  *
+*              Universite catholique de Louvain             *
+*                 Louvain-la-Neuve, Belgium                 *
+ *                                                         *
+   * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
 /// \file H_RectEllipticAperture.h
 /// \brief Defines the Rect-Elliptic aperture of beamline elements.
-
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
 
 // local #includes
@@ -30,9 +37,9 @@
 		H_RectEllipticAperture* clone() const;
 		//@}
-		virtual void printProperties() const;
 		/// Checks whether the point is inside the aperture or not
 		virtual bool isInside(const float, const float) const;
 		/// Draws the aperture shape.
 		virtual void draw(const float scale=1) const;
+	friend std::ostream& operator<< (std::ostream& os, const H_RectEllipticAperture& ap);
 };
 
Index: trunk/Utilities/Hector/include/H_RectangularAperture.h
===================================================================
--- trunk/Utilities/Hector/include/H_RectangularAperture.h	(revision 237)
+++ trunk/Utilities/Hector/include/H_RectangularAperture.h	(revision 281)
@@ -2,14 +2,21 @@
 #define _H_RectangularAperture_
 
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
+  /* * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *                                                         *
+*                   --<--<--  A fast simulator --<--<--     *
+*                 / --<--<--     of particle   --<--<--     *
+*  ----HECTOR----<                                          *
+*                 \ -->-->-- transport through -->-->--     *
+*                   -->-->-- generic beamlines -->-->--     *
+*                                                           *
+* JINST 2:P09005 (2007)                                     *
+*      X Rouby, J de Favereau, K Piotrzkowski (CP3)         *
+*       http://www.fynu.ucl.ac.be/hector.html               *
+*                                                           *
+* Center for Cosmology, Particle Physics and Phenomenology  *
+*              Universite catholique de Louvain             *
+*                 Louvain-la-Neuve, Belgium                 *
+ *                                                         *
+   * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
 /// \file H_RectangularAperture.h
@@ -34,5 +41,5 @@
 		/// Draws the aperture shape.
 		virtual void draw(const float scale=1) const;
-		virtual void printProperties() const;
+	friend std::ostream& operator<< (std::ostream& os, const H_RectangularAperture& ap);
 };
 
Index: trunk/Utilities/Hector/include/H_RectangularCollimator.h
===================================================================
--- trunk/Utilities/Hector/include/H_RectangularCollimator.h	(revision 237)
+++ trunk/Utilities/Hector/include/H_RectangularCollimator.h	(revision 281)
@@ -2,14 +2,21 @@
 #define _H_RectangularCollimator_
 
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
+  /* * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *                                                         *
+*                   --<--<--  A fast simulator --<--<--     *
+*                 / --<--<--     of particle   --<--<--     *
+*  ----HECTOR----<                                          *
+*                 \ -->-->-- transport through -->-->--     *
+*                   -->-->-- generic beamlines -->-->--     *
+*                                                           *
+* JINST 2:P09005 (2007)                                     *
+*      X Rouby, J de Favereau, K Piotrzkowski (CP3)         *
+*       http://www.fynu.ucl.ac.be/hector.html               *
+*                                                           *
+* Center for Cosmology, Particle Physics and Phenomenology  *
+*              Universite catholique de Louvain             *
+*                 Louvain-la-Neuve, Belgium                 *
+ *                                                         *
+   * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
 /// \file H_RectangularCollimator.h
@@ -30,5 +37,4 @@
 		~H_RectangularCollimator() {};
 	//@}
-		virtual void printProperties() const;
 		H_RectangularCollimator* clone() const;
 		void init();
@@ -36,5 +42,6 @@
 	 	virtual void setTypeString() {typestring=RCOLLIMATORNAME;};
 		virtual void setMatrix(const float, const float, const float) ;
-
+	
+	friend std::ostream& operator<< (std::ostream& os, const H_RectangularCollimator& el);
 };
 
Index: trunk/Utilities/Hector/include/H_RectangularDipole.h
===================================================================
--- trunk/Utilities/Hector/include/H_RectangularDipole.h	(revision 237)
+++ trunk/Utilities/Hector/include/H_RectangularDipole.h	(revision 281)
@@ -2,17 +2,24 @@
 #define _H_RectangularDipole_
 
+  /* * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *                                                         *
+*                   --<--<--  A fast simulator --<--<--     *
+*                 / --<--<--     of particle   --<--<--     *
+*  ----HECTOR----<                                          *
+*                 \ -->-->-- transport through -->-->--     *
+*                   -->-->-- generic beamlines -->-->--     *
+*                                                           *
+* JINST 2:P09005 (2007)                                     *
+*      X Rouby, J de Favereau, K Piotrzkowski (CP3)         *
+*       http://www.fynu.ucl.ac.be/hector.html               *
+*                                                           *
+* Center for Cosmology, Particle Physics and Phenomenology  *
+*              Universite catholique de Louvain             *
+*                 Louvain-la-Neuve, Belgium                 *
+ *                                                         *
+   * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
 /// \file H_RectangularDipole.h
 /// \brief Classes aiming at simulating LHC beam rectangular dipoles.
-
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
 
 #include "H_Dipole.h"
Index: trunk/Utilities/Hector/include/H_RomanPot.h
===================================================================
--- trunk/Utilities/Hector/include/H_RomanPot.h	(revision 237)
+++ trunk/Utilities/Hector/include/H_RomanPot.h	(revision 281)
@@ -2,17 +2,24 @@
 #define _H_RomanPot_
 
+  /* * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *                                                         *
+*                   --<--<--  A fast simulator --<--<--     *
+*                 / --<--<--     of particle   --<--<--     *
+*  ----HECTOR----<                                          *
+*                 \ -->-->-- transport through -->-->--     *
+*                   -->-->-- generic beamlines -->-->--     *
+*                                                           *
+* JINST 2:P09005 (2007)                                     *
+*      X Rouby, J de Favereau, K Piotrzkowski (CP3)         *
+*       http://www.fynu.ucl.ac.be/hector.html               *
+*                                                           *
+* Center for Cosmology, Particle Physics and Phenomenology  *
+*              Universite catholique de Louvain             *
+*                 Louvain-la-Neuve, Belgium                 *
+ *                                                         *
+   * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
 /// \file H_RomanPot.h
 /// \brief Roman pot class
-
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
 
 // local #includes
@@ -32,5 +39,4 @@
 		~H_RomanPot() {};
 	//@}
-		virtual void printProperties() const;
 		H_RomanPot* clone() const ;
 		void init();
@@ -38,5 +44,5 @@
 		virtual void setTypeString() {typestring=RPNAME;};
 		virtual void setMatrix(const float, const float, const float) ;
-
+	friend std::ostream& operator<< (std::ostream& os, const H_RomanPot& el);
 };
 
Index: trunk/Utilities/Hector/include/H_SectorDipole.h
===================================================================
--- trunk/Utilities/Hector/include/H_SectorDipole.h	(revision 237)
+++ trunk/Utilities/Hector/include/H_SectorDipole.h	(revision 281)
@@ -1,18 +1,25 @@
-/// \file H_SectorDipole.h
-/// \brief Classes aiming at simulating sector dipoles.
-
 #ifndef _H_SectorDipole_
 #define _H_SectorDipole_
 
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
+  /* * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *                                                         *
+*                   --<--<--  A fast simulator --<--<--     *
+*                 / --<--<--     of particle   --<--<--     *
+*  ----HECTOR----<                                          *
+*                 \ -->-->-- transport through -->-->--     *
+*                   -->-->-- generic beamlines -->-->--     *
+*                                                           *
+* JINST 2:P09005 (2007)                                     *
+*      X Rouby, J de Favereau, K Piotrzkowski (CP3)         *
+*       http://www.fynu.ucl.ac.be/hector.html               *
+*                                                           *
+* Center for Cosmology, Particle Physics and Phenomenology  *
+*              Universite catholique de Louvain             *
+*                 Louvain-la-Neuve, Belgium                 *
+ *                                                         *
+   * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
+/// \file H_SectorDipole.h
+/// \brief Classes aiming at simulating sector dipoles.
 
 #include "H_Dipole.h"
@@ -26,5 +33,5 @@
 		H_SectorDipole():H_Dipole(SDIPOLE,0.,0.,0.) {init();}
 		H_SectorDipole(const double s, const double k, const double l) :H_Dipole(SDIPOLE,s,k,l){init();}
-		H_SectorDipole(const string nameE, const double s, const double k, const double l) :H_Dipole(nameE,SDIPOLE,s,k,l){init();}
+		H_SectorDipole(const string& nameE, const double s, const double k, const double l) :H_Dipole(nameE,SDIPOLE,s,k,l){init();}
 		~H_SectorDipole() {};
 		//@}
Index: trunk/Utilities/Hector/include/H_TransportMatrices.h
===================================================================
--- trunk/Utilities/Hector/include/H_TransportMatrices.h	(revision 237)
+++ trunk/Utilities/Hector/include/H_TransportMatrices.h	(revision 281)
@@ -2,14 +2,21 @@
 #define _H_TransportMatrices_
 
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
+  /* * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *                                                         *
+*                   --<--<--  A fast simulator --<--<--     *
+*                 / --<--<--     of particle   --<--<--     *
+*  ----HECTOR----<                                          *
+*                 \ -->-->-- transport through -->-->--     *
+*                   -->-->-- generic beamlines -->-->--     *
+*                                                           *
+* JINST 2:P09005 (2007)                                     *
+*      X Rouby, J de Favereau, K Piotrzkowski (CP3)         *
+*       http://www.fynu.ucl.ac.be/hector.html               *
+*                                                           *
+* Center for Cosmology, Particle Physics and Phenomenology  *
+*              Universite catholique de Louvain             *
+*                 Louvain-la-Neuve, Belgium                 *
+ *                                                         *
+   * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
 /** \file H_TransportMatrices.h
Index: trunk/Utilities/Hector/include/H_VerticalKicker.h
===================================================================
--- trunk/Utilities/Hector/include/H_VerticalKicker.h	(revision 237)
+++ trunk/Utilities/Hector/include/H_VerticalKicker.h	(revision 281)
@@ -2,14 +2,21 @@
 #define _H_VerticalKicker_
 
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
-
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
+  /* * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *                                                         *
+*                   --<--<--  A fast simulator --<--<--     *
+*                 / --<--<--     of particle   --<--<--     *
+*  ----HECTOR----<                                          *
+*                 \ -->-->-- transport through -->-->--     *
+*                   -->-->-- generic beamlines -->-->--     *
+*                                                           *
+* JINST 2:P09005 (2007)                                     *
+*      X Rouby, J de Favereau, K Piotrzkowski (CP3)         *
+*       http://www.fynu.ucl.ac.be/hector.html               *
+*                                                           *
+* Center for Cosmology, Particle Physics and Phenomenology  *
+*              Universite catholique de Louvain             *
+*                 Louvain-la-Neuve, Belgium                 *
+ *                                                         *
+   * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
 /// \file H_VerticalKicker.h
@@ -30,5 +37,5 @@
 		H_VerticalKicker():H_Kicker(VKICKER,0.,0.,0.) {init();}
 		H_VerticalKicker(const double s, const double k, const double l) :H_Kicker(VKICKER,s,k,l){init();}
-		H_VerticalKicker(const string nameE, const double s, const double k, const double l) :H_Kicker(nameE,VKICKER,s,k,l){init();}
+		H_VerticalKicker(const string& nameE, const double s, const double k, const double l) :H_Kicker(nameE,VKICKER,s,k,l){init();}
 		~H_VerticalKicker() {};
 	//@}
Index: trunk/Utilities/Hector/include/H_VerticalQuadrupole.h
===================================================================
--- trunk/Utilities/Hector/include/H_VerticalQuadrupole.h	(revision 237)
+++ trunk/Utilities/Hector/include/H_VerticalQuadrupole.h	(revision 281)
@@ -2,14 +2,22 @@
 #define _H_VerticalQuadrupole_
 
-/*
----- Hector the simulator ----
-   A fast simulator of particles through generic beamlines.
-   J. de Favereau, X. Rouby ~~~ hector_devel@cp3.phys.ucl.ac.be
+  /* * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ *                                                         *
+*                   --<--<--  A fast simulator --<--<--     *
+*                 / --<--<--     of particle   --<--<--     *
+*  ----HECTOR----<                                          *
+*                 \ -->-->-- transport through -->-->--     *
+*                   -->-->-- generic beamlines -->-->--     *
+*                                                           *
+* JINST 2:P09005 (2007)                                     *
+*      X Rouby, J de Favereau, K Piotrzkowski (CP3)         *
+*       http://www.fynu.ucl.ac.be/hector.html               *
+*                                                           *
+* Center for Cosmology, Particle Physics and Phenomenology  *
+*              Universite catholique de Louvain             *
+*                 Louvain-la-Neuve, Belgium                 *
+ *                                                         *
+   * * * * * * * * * * * * * * * * * * * * * * * * * * * */
 
-        http://www.fynu.ucl.ac.be/hector.html
-
-   Centre de Physique des Particules et de PhÃ©nomÃ©nologie (CP3)
-   UniversitÃ© Catholique de Louvain (UCL)
-*/
 
 /// \file H_VerticalQuadrupole.h
@@ -27,9 +35,9 @@
 		H_VerticalQuadrupole():H_Quadrupole(VQUADRUPOLE,0.,0.,0.) {init();}
 		H_VerticalQuadrupole(const double s, const double k, const double l):H_Quadrupole(VQUADRUPOLE,s,k,l) {init();}
-		H_VerticalQuadrupole(string nameE, const double s, const double k, const double l):H_Quadrupole(nameE,VQUADRUPOLE,s,k,l) {init();}
-		~H_VerticalQuadrupole() {};
-	//@}
-		H_VerticalQuadrupole* clone() const ;
-	private:
+		H_VerticalQuadrupole(const string& nameE, const double s, const double k, const double l):H_Quadrupole(nameE,VQUADRUPOLE,s,k,l) {init();}
+	~H_VerticalQuadrupole() {};
+//@}
+	H_VerticalQuadrupole* clone() const ;
+private:
 		virtual void setTypeString() {typestring = VQUADRUPOLENAME;} ;
 		virtual void setMatrix(const float, const float, const float) ;
