Ignore:
Timestamp:
05/14/04 17:24:17 (21 years ago)
Author:
rico
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mtemp/mifae/library
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcPosFromFile.cc

    r4072 r4074  
    3636
    3737#include <fstream>
    38 
    39 #include <TH2F.h>
    4038
    4139#include "MParList.h"
  • trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcPosFromFile.h

    r4072 r4074  
    3636    enum ReadMode_t {kCount=0,kRead};
    3737
    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);
    3939    ~MSrcPosFromFile();
     40
     41    void SetInputFileName(TString fname) {fSourcePositionFilePath=fname;}
    4042
    4143    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  
    3232//  Input Containers:
    3333//    MSrcPosCam
     34//    [MDCA]
    3435//
    3536//  Output Containers:
     
    4748#include "MSrcPosCam.h"
    4849#include "MDCA.h"
    49 
    5050
    5151#include "MLog.h"
     
    6666//
    6767MSrcTranslate::MSrcTranslate(const char* srcPos, const char* dca, const char *name, const char *title)
    68   : fSrcPos(NULL), fDCA(NULL), fShiftX(0.), fShiftY(0.), fTranslationIsRelative(kTRUE)
     68  : fShiftX(0.), fShiftY(0.), fTranslationIsRelative(kTRUE)
    6969{
    7070    fName  = name  ? name  : gsDefName.Data();
    7171    fTitle = title ? title : gsDefTitle.Data();
    7272
    73     fSrcPosName  = srcPos;
    74     fDCAName     = dca;
     73    SetSrcPosName(srcPos);
     74    SetDCAName(dca);
    7575}
    7676
     
    8181Int_t MSrcTranslate::PreProcess(MParList *pList)
    8282{
    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;
    10286
    10387  if(fShiftX==0. && fShiftY==0.)
     
    11195// Perform the translation of the source position
    11296//
    113 Int_t MSrcTranslate::Process()
     97Int_t MSrcTranslate::ComputeNewSrcPosition()
    11498
    11599  Double_t newX,newY;
    116100
     101  MSrcPosCam* srcPos = GetSrcPosCam();
     102  MDCA*       dca    = GetDCA();
     103
    117104  if(fTranslationIsRelative)
    118105    {
    119       newX=fSrcPos->GetX()+fShiftX;
    120       newY=fSrcPos->GetY()+fShiftY;
     106      newX=srcPos->GetX()+fShiftX;
     107      newY=srcPos->GetY()+fShiftY;
    121108    }
    122109  else
     
    126113    }
    127114
    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);
    131118
    132119  return kTRUE;
  • trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcTranslate.h

    r3973 r4074  
    22#define MARS_MSrcTranslate
    33
    4 #ifndef MARS_MTask
    5 #include "MTask.h"
     4#ifndef MARS_MSrcPlace
     5#include "MSrcPlace.h"
    66#endif
    77
    8 #include <TArrayF.h>
    9 #include "MTime.h"
    10 #include "MSrcPosCam.h"
     8class 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);
    1117
    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();
    1625
    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
    4127};
    4228
Note: See TracChangeset for help on using the changeset viewer.