Ignore:
Timestamp:
05/12/04 18:50:10 (21 years ago)
Author:
rico
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mtemp/mifae
Files:
2 added
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mtemp/mifae/Changelog

    r4050 r4056  
    1818
    1919                                                 -*-*- END OF LINE -*-*-
     20
     21
     22
     23 2004/05/12: Javier Rico
     24   * macros/alpha.C, macros/plotOptimal.C
     25     - added
     26
     27   * library/MSrcRotate.[cc.h]
     28     - correct bug in computation of run time for rotation
     29       
     30   * programs/srcPos.cc
     31     - change mjdpos type to Double_t
     32       
     33       
     34       
    2035 2004/05/11: Javier Rico
    2136   * programs/optimizeCuts.cc, programs/optimizecuts.datacard
  • trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcRotate.cc

    r4050 r4056  
    149149      // save the number of events, initial and final times
    150150      fNEvts    = fRunHeader->GetNumEvents();
    151       fFirstEvt = fEvtHeader->GetDAQEvtNumber();
    152151      fIniTime  = fRunHeader->GetRunStart();
    153152      fFinTime  = fRunHeader->GetRunEnd();
     
    164163      cout << "Run number: " << fRunHeader->GetRunNumber() << endl;
    165164      cout << "Number of events: " << fNEvts << endl;
    166       cout << "First event: " << fFirstEvt << endl;
    167165      cout << "Initial MJD date: " << fIniTime.GetMjd() << endl;
    168166      cout << "Final MJD   date: " << fFinTime.GetMjd() << endl;
     
    175173  // FIXME: for the time being, this is computed by assuming constant event rate
    176174  MTime eventTime;
    177   Double_t newMJD = fIniTime.GetMjd() + (fFinTime.GetMjd()-fIniTime.GetMjd())*(fEvtHeader->GetDAQEvtNumber()-fFirstEvt)/fNEvts; 
    178   eventTime.SetMjd(newMJD); 
    179  
     175  Double_t newMJD = fIniTime.GetMjd() + (fFinTime.GetMjd()-fIniTime.GetMjd())*fEvtHeader->GetDAQEvtNumber()/fNEvts; 
     176  eventTime.SetMjd(newMJD);   
     177  MTime refTime;
     178  refTime.SetMjd(fRefMJD);
     179
    180180  // de-rotate the source position
    181181  const MAstroSky2Local Observation(eventTime, *fObservatory);
    182   const MAstroSky2Local RefObservation(fRefMJD, *fObservatory);
     182  const MAstroSky2Local RefObservation(refTime, *fObservatory);
     183
     184#ifdef DEBUG
     185  printf("Run:%d, Event:%d, iniMJD=%15.5f, finMJD=%15.5f, fDeltaT=%15.5f, newMJD=%15.5f, fRefMJD=%15.5f, rotation=%15.5f, ref=%15.5f\n",
     186         fRunHeader->GetRunNumber(),fEvtHeader->GetDAQEvtNumber(),
     187         fIniTime.GetMjd(),fFinTime.GetMjd(),fDeltaT,
     188         newMJD,fRefMJD,Observation.RotationAngle(fRA,fDEC),
     189         RefObservation.RotationAngle(fRA,fDEC));
     190  //  cout << "newMJD=" << newMJD << ", fRefMJD="<<fRefMJD<<", rotation="<<Observation.RotationAngle(fRA,fDEC)<<", ref="<<RefObservation.RotationAngle(fRA,fDEC)<< endl;
     191#endif
     192
    183193  Double_t rotationAngle = Observation.RotationAngle(fRA,fDEC)-RefObservation.RotationAngle(fRA,fDEC);
    184194 
     
    186196  Float_t s = TMath::Sin(rotationAngle);
    187197  // perform a rotation of -rotationAngle to move the source back to the "initial" position
    188   Float_t newX = c*fSrcPos->GetX()+s*fSrcPos->GetY();
    189   Float_t newY = -s*fSrcPos->GetX()+c*fSrcPos->GetY();
     198  Float_t newX = c*fSrcPos->GetX()-s*fSrcPos->GetY();
     199  Float_t newY = s*fSrcPos->GetX()+c*fSrcPos->GetY();
    190200
    191201#ifdef DEBUG
  • trunk/MagicSoft/Mars/mtemp/mifae/library/MSrcRotate.h

    r4050 r4056  
    1818{
    1919private:
    20     MSrcPosCam*    fSrcPos;      //!  Pointer to the source position
    21     MDCA*          fDCA;         //!  Pointer to the MDCA object
    22     MRawEvtHeader* fEvtHeader;   //!  Pointer to the event header
    23     MRawRunHeader* fRunHeader;   //!  Pointer to the run header
    24     MObservatory*  fObservatory; //!  Pointer to the MObservatory   
     20    MSrcPosCam*    fSrcPos;      //  Pointer to the source position
     21    MDCA*          fDCA;         //  Pointer to the MDCA object
     22    MRawEvtHeader* fEvtHeader;   //  Pointer to the event header
     23    MRawRunHeader* fRunHeader;   //  Pointer to the run header
     24    MObservatory*  fObservatory; //  Pointer to the MObservatory   
    2525
    2626    TString     fSrcPosName;
     
    3131    Double_t   fRefMJD;      //  [MJ date] reference time for rotation
    3232    UInt_t     fNEvts;       //  Number of events in file
    33     UInt_t     fFirstEvt;    //  Event index for first event in file
    3433    MTime      fIniTime;     //  Run initial time
    3534    MTime      fFinTime;     //  Run final time
  • trunk/MagicSoft/Mars/mtemp/mifae/programs/makeHillas.cc

    r4044 r4056  
    141141    return;
    142142
    143   //  MPedestalCam pedcam = pedloop.GetPedestalCam();
    144  
    145143  /*****************************/
    146144  /* SECOND LOOP: CALIBRATION  */
     
    155153  if (!calloop.Process(pedloop.GetPedestalCam()))
    156154    return;
    157 
    158   //  MCalibrationChargeCam calcam = calloop.GetCalibrationCam();
    159155
    160156  /************************************************************************/
  • trunk/MagicSoft/Mars/mtemp/mifae/programs/optimizeCuts.cc

    r4050 r4056  
    131131  sprintf(evecut,"event%%%d==0",onRate);
    132132  sprintf(gencut,"size>%f && dist>%f && dist<%f",sizecut,lowdistcut,uppdistcut);
    133   cout << "General cut " << gencut << "(" << evecut << ") for on-data" << endl;
     133  cout << "General cut " << gencut << " (" << evecut << " for on-data)" << endl;
    134134
    135135  // loop on widht and length cuts
  • trunk/MagicSoft/Mars/mtemp/mifae/programs/optimizecuts.datacard

    r4050 r4056  
    77
    88// Input file name pattern (On data)
    9 ONFILES  /mnt/users/jrico/magic/mars/Mars_Standard02/mtemp/mifae/hillas/mrk20040215OnRotateB.root
     9ONFILES  /mnt/users/jrico/magic/mars/Mars_Standard02/mtemp/mifae/hillas/mrk20040215OnRotateNoCalB.root
    1010
    1111// Input file name pattern (Off data)
    12 OFFFILES  /mnt/users/jrico/magic/mars/Mars_Standard02/mtemp/mifae/hillas/mrk20040215OffRotateA-C.root
     12OFFFILES  /mnt/users/jrico/magic/mars/Mars_Standard02/mtemp/mifae/hillas/mrk20040215OffRotateNoCalA-C.root
    1313
    1414// output file name
    15 OUTFILE  ./optimizePrueba.root
     15OUTFILE  ./optimize_fine.out
    1616
    17 // Previous cuts (size in size units, distance in deg)
    18 SIZECUT  1800
     17// Preliminar cuts (size in size units, distance in deg)
     18SIZECUT  2000
    1919DISTCUTS 0.2 1.1
    2020
    2121// Length initial, final and step values
    22 LENGTHCUTS 0.01 0.3 0.005
     22LENGTHCUTS 0.1 0.4 0.005
    2323
    2424// Width initial, final and step values
    25 WIDTHCUTS 0.01 0.3 0.005
     25WIDTHCUTS 0.0 0.3 0.005
    2626
    2727
  • trunk/MagicSoft/Mars/mtemp/mifae/programs/srcPos.cc

    r4050 r4056  
    4444Float_t  xsrcpos=0.;
    4545Float_t  ysrcpos=0.;
    46 Float_t mjdpos=53050;
     46Double_t mjdpos=53050;
    4747Bool_t   kRotate=1;
    4848Bool_t   kSrcPolicy=kTRUE;
  • trunk/MagicSoft/Mars/mtemp/mifae/programs/srcpos.datacard

    r4050 r4056  
    11
    22// Maximun number of on and off events to be processed)
    3 NEVENTS 9999999
     3NEVENTS 20000
    44
    55// Input file name pattern
    6 INPUTFILES  /mnt/users/jrico/magic/mars/Mars_Standard02/mtemp/mifae/hillas/mrk20040215OnB.root
     6INPUTFILES   /mnt/users/jrico/magic/mars/Mars_Standard02/mtemp/mifae/hillas/mrk20040215OnNoCalB.root
    77
    88// output file name
Note: See TracChangeset for help on using the changeset viewer.