Changeset 18619 for trunk/FACT++
- Timestamp:
- 09/18/16 14:44:24 (8 years ago)
- Location:
- trunk/FACT++/drive
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/FACT++/drive/Led.cc
r18618 r18619 1 1 #include "Led.h" 2 2 3 #include <iostream> 4 5 #include <TROOT.h> 6 #include <TMath.h> 3 #include <math.h> 7 4 8 5 #include "Ring.h" 9 #include "MString.h"10 11 ClassImp(Led);12 6 13 7 using namespace std; 14 8 15 voidLed::CalcPhi(const Ring &ring)9 double Led::CalcPhi(const Ring &ring) 16 10 { 17 fPhi = TMath::ATan2(fY-ring.GetY(), fX-ring.GetX())*180/TMath::Pi();11 return atan2(fY-ring.GetY(), fX-ring.GetX())*180/M_PI; 18 12 } 19 13 14 /* 20 15 void Led::Print(Option_t *o) const 21 16 { 22 17 cout << "Led: "; 23 cout << "x=" << MString::Format("%5.1f", fX) << "+-" << fDx << ", ";24 cout << "y=" << MString::Format("%5.1f", fY) << "+-" << fDy << ", ";25 cout << "phi=" << MString::Format("%6.1f", fPhi) << "+-" << fDphi << ", ";18 //cout << "x=" << MString::Format("%5.1f", fX) << "+-" << fDx << ", "; 19 //cout << "y=" << MString::Format("%5.1f", fY) << "+-" << fDy << ", "; 20 //cout << "phi=" << MString::Format("%6.1f", fPhi) << "+-" << fDphi << ", "; 26 21 cout << "mag=" << fMag << endl; 27 22 } 23 */ -
trunk/FACT++/drive/Led.h
r18618 r18619 2 2 #define COSY_Led 3 3 4 #ifndef ROOT_TObject 5 #include <TObject.h> 6 #endif 4 #include <stdint.h> 7 5 8 6 class Ring; 9 7 10 class Led : public TObject8 class Led 11 9 { 12 10 private: 13 Double_tfX;14 Double_tfY;15 Double_tfPhi;11 double fX; 12 double fY; 13 double fPhi; 16 14 17 Double_t fDx; 18 Double_t fDy; 19 Double_t fDphi; 20 21 Double_t fMag; 15 double fMag; 22 16 23 17 public: 24 Led( Double_t x=0, Double_t y=0, Double_t dx=0, Double_t dy=0, Double_tmag=0) :25 fX(x), fY(y), fPhi( 0), fDx(dx), fDy(dy), fDphi(-1), fMag(mag)18 Led(double x=0, double y=0, double phi=0, double mag=0) : 19 fX(x), fY(y), fPhi(phi), fMag(mag) 26 20 { 27 21 } 28 22 29 Int_t Compare(const TObject *obj) const 23 /* 24 int32_t Compare(const TObject *obj) const 30 25 { 31 26 const Led *const l = (Led*)obj; … … 38 33 39 34 return 0; 40 } 35 }*/ 41 36 42 void SetX(Double_t x) { fX=x; } 43 void SetY(Double_t y) { fY=y; } 37 void SetX(double x) { fX=x; } 38 void SetY(double y) { fY=y; } 39 void SetPhi(double phi) { fPhi=phi; } 44 40 45 Double_t GetX() const { return fX; } 46 Double_t GetY() const { return fY; } 47 Double_t GetDx() const { return fDx; } 48 Double_t GetDy() const { return fDy; } 49 Double_t GetPhi() const { return fPhi; } 50 Double_t GetDphi() const { return fDphi; } 51 Double_t GetMag() const { return fMag; } 41 double GetX() const { return fX; } 42 double GetY() const { return fY; } 43 double GetPhi() const { return fPhi; } 44 double GetMag() const { return fMag; } 52 45 53 void AddOffset( Double_t dx, Double_tdy) { fX+=dx; fY+=dy; }46 void AddOffset(double dx, double dy) { fX+=dx; fY+=dy; } 54 47 55 Bool_tIsSortable() const { return kTRUE; }48 //bool IsSortable() const { return kTRUE; } 56 49 57 voidCalcPhi(const Ring &ring);50 double CalcPhi(const Ring &ring); 58 51 59 void Print(Option_t *o=NULL) const; 60 61 ClassDef(Led, 1) 52 //void Print(Option_t *o=NULL) const; 62 53 }; 63 54
Note:
See TracChangeset
for help on using the changeset viewer.