#ifndef CUSTOMBEAM_HH #define CUSTOMBEAM_HH //**********************************************************************\ // file: CustomBeam.hh // ---------------------------------------------------------------------- // Content: // Type: Class implementation // Class: CustomBeam // Language: C++ // Package: Run 2 Upgrade // Project: CDF Analysis // // Author: Andreas Korn // Company: Massachusetts Institute of Technology // Date: Feb-02 // // Details: A common interface to a custom beamline // currently read from a file // //************************************************************************ #include "Alignment/AbsBeam.hh" #include "CLHEP/Matrix/SymMatrix.h" #include "Framework/AbsParmGeneral.hh" #include "Framework/APPMenu.hh" class CustomBeam : public AbsBeam { public: CustomBeam(std::string filename = "default"); virtual ~CustomBeam(); void newFile(std::string filename); int loadRun() { return loadRun(-1,-1); } bool isValid(); HepPoint3D position (double z = 0.0); HepVector positionVector(double z = 0.0); Hep3Vector slope (); // a 3x3 covariance matrix of position, element (3,3) = 35cm. // the x,y elements include intrinsic beam size and // beam position measurement errors (position and slope) HepSymMatrix cov3 (double z = 0.0); void printSummary(); void printAll (); ///////////////////////////////////////////////////////////////////////// // expert interface below here, typical user does not need these ///////////////////////////////////////////////////////////////////////// //All dummy as no database: void setStatus(std::string status){} void setHistoryCode(int history){} void setAlgorithm(int algorithm){} void setSource(int source){} std::string getStatus(); int getVersion(); int getCid(); int loadCid(int cid); //if set to 1, prints a summary for all entries, if set to 2 prints all void printLevel(int level){ _printLevel = level; } // set run and version number, -1 means current run/latest version int loadRun(int run, int version = -1); private: FILE* _fhandle; std::string _fname; int _printLevel; bool _isValid; bool _fileValid; HepSymMatrix _cov; double _x0,_y0,_Ax,_Ay; ErrorLog errlog; }; #endif