Changeset 4074 for trunk/MagicSoft/Mars/mtemp/mifae/library
- Timestamp:
- 05/14/04 17:24:17 (21 years ago)
- Location:
- trunk/MagicSoft/Mars/mtemp/mifae/library
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcPosFromFile.cc
r4072 r4074 36 36 37 37 #include <fstream> 38 39 #include <TH2F.h>40 38 41 39 #include "MParList.h" -
trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcPosFromFile.h
r4072 r4074 36 36 enum ReadMode_t {kCount=0,kRead}; 37 37 38 MSrcPosFromFile(TString cardpath , OnOffMode_t mode=kOn, const char *name=NULL, const char *title=NULL);38 MSrcPosFromFile(TString cardpath=0, OnOffMode_t mode=kOn, const char *name=NULL, const char *title=NULL); 39 39 ~MSrcPosFromFile(); 40 41 void SetInputFileName(TString fname) {fSourcePositionFilePath=fname;} 40 42 41 43 ClassDef(MSrcPosFromFile, 0) // task to calculate the position of the source as a function of the run number -
trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcTranslate.cc
r3973 r4074 32 32 // Input Containers: 33 33 // MSrcPosCam 34 // [MDCA] 34 35 // 35 36 // Output Containers: … … 47 48 #include "MSrcPosCam.h" 48 49 #include "MDCA.h" 49 50 50 51 51 #include "MLog.h" … … 66 66 // 67 67 MSrcTranslate::MSrcTranslate(const char* srcPos, const char* dca, const char *name, const char *title) 68 : fS rcPos(NULL), fDCA(NULL), fShiftX(0.), fShiftY(0.), fTranslationIsRelative(kTRUE)68 : fShiftX(0.), fShiftY(0.), fTranslationIsRelative(kTRUE) 69 69 { 70 70 fName = name ? name : gsDefName.Data(); 71 71 fTitle = title ? title : gsDefTitle.Data(); 72 72 73 fSrcPosName = srcPos;74 fDCAName = dca;73 SetSrcPosName(srcPos); 74 SetDCAName(dca); 75 75 } 76 76 … … 81 81 Int_t MSrcTranslate::PreProcess(MParList *pList) 82 82 { 83 // look for/create MSrcPosCam 84 fSrcPos = (MSrcPosCam*)pList->FindObject(AddSerialNumber(fSrcPosName), "MSrcPosCam"); 85 if (!fSrcPos) 86 { 87 *fLog << warn << AddSerialNumber(fSrcPosName) << " [MSrcPosCam] not found... creating default container." << endl; 88 fSrcPos = (MSrcPosCam*)pList->FindCreateObj("MSrcPosCam", AddSerialNumber(fSrcPosName)); 89 if(!fSrcPos) 90 return kFALSE; 91 } 92 93 // look for/create MDCA 94 fDCA = (MDCA*)pList->FindObject(AddSerialNumber(fDCAName), "MDCA"); 95 if (!fDCA) 96 { 97 *fLog << warn << AddSerialNumber(fDCAName) << " [MDCA] not found... creating default container." << endl; 98 fDCA = (MDCA*)pList->FindCreateObj("MDCA", AddSerialNumber(fDCAName)); 99 if(!fDCA) 100 return kFALSE; 101 } 83 // look for/create MSrcPosCam and DCA 84 if(!SearchForSrcPos(pList)) 85 return kFALSE; 102 86 103 87 if(fShiftX==0. && fShiftY==0.) … … 111 95 // Perform the translation of the source position 112 96 // 113 Int_t MSrcTranslate:: Process()97 Int_t MSrcTranslate::ComputeNewSrcPosition() 114 98 { 115 99 Double_t newX,newY; 116 100 101 MSrcPosCam* srcPos = GetSrcPosCam(); 102 MDCA* dca = GetDCA(); 103 117 104 if(fTranslationIsRelative) 118 105 { 119 newX= fSrcPos->GetX()+fShiftX;120 newY= fSrcPos->GetY()+fShiftY;106 newX=srcPos->GetX()+fShiftX; 107 newY=srcPos->GetY()+fShiftY; 121 108 } 122 109 else … … 126 113 } 127 114 128 fSrcPos->SetX(newX);129 fSrcPos->SetY(newY);130 fDCA->SetRefPoint(newX,newY);115 srcPos->SetX(newX); 116 srcPos->SetY(newY); 117 dca->SetRefPoint(newX,newY); 131 118 132 119 return kTRUE; -
trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcTranslate.h
r3973 r4074 2 2 #define MARS_MSrcTranslate 3 3 4 #ifndef MARS_M Task5 #include "M Task.h"4 #ifndef MARS_MSrcPlace 5 #include "MSrcPlace.h" 6 6 #endif 7 7 8 #include <TArrayF.h> 9 #include "MTime.h" 10 #include "MSrcPosCam.h" 8 class MSrcTranslate : public MSrcPlace 9 { 10 private: 11 12 Double_t fShiftX; 13 Double_t fShiftY; 14 Bool_t fTranslationIsRelative; 15 16 Int_t PreProcess(MParList *plist); 11 17 12 class MDCA; 13 class MObservatory; 14 class MRawEvtHeader; 15 class MRawRunHeader; 18 public: 19 MSrcTranslate(const char* src="MSrcPosCam", const char* dca="MDCA", 20 const char* name=NULL, const char* title=NULL); 21 22 void SetTranslation(Double_t x=0.,Double_t y=0) {fShiftX=x,fShiftY=y;}; 23 void SetRelativeTranslation(Bool_t inp=kTRUE) {fTranslationIsRelative=inp;}; 24 virtual Int_t ComputeNewSrcPosition(); 16 25 17 class MSrcTranslate : public MTask 18 { 19 private: 20 MSrcPosCam* fSrcPos; //! Pointer to the source position 21 MDCA* fDCA; //! Pointer to the MDCA object 22 23 TString fSrcPosName; 24 TString fDCAName; 25 26 Double_t fShiftX; 27 Double_t fShiftY; 28 Bool_t fTranslationIsRelative; 29 30 Int_t PreProcess(MParList *plist); 31 Int_t Process(); 32 33 public: 34 MSrcTranslate(const char* src="MSrcPosCam", const char* dca="MDCA", 35 const char* name=NULL, const char* title=NULL); 36 37 void SetTranslation(Double_t x=0.,Double_t y=0) {fShiftX=x,fShiftY=y;}; 38 void SetRelativeTranslation(Bool_t inp=kTRUE) {fTranslationIsRelative=inp;}; 39 40 ClassDef(MSrcTranslate, 0) // task to rotate the position of the source as a function of Azimuth and Zenith angles 26 ClassDef(MSrcTranslate, 0) // task to rotate the position of the source as a function of Azimuth and Zenith angles 41 27 }; 42 28
Note:
See TracChangeset
for help on using the changeset viewer.