Ignore:
Timestamp:
05/14/04 16:35:57 (21 years ago)
Author:
rico
Message:
*** empty log message ***
Location:
trunk/MagicSoft/Mars/mtemp/mifae/programs
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/MagicSoft/Mars/mtemp/mifae/programs/srcPos.cc

    r4056 r4072  
    2929#include "MArgs.h"
    3030#include "MWriteRootFile.h"
     31#include "MTime.h"
    3132
    3233using namespace std;
     
    4041
    4142TString  inputFile;
     43TString  offFile;
    4244TString  outputFile;
     45TString  offOutputFile;
    4346ULong_t  nmaxevents=999999999;
    4447Float_t  xsrcpos=0.;
    4548Float_t  ysrcpos=0.;
    4649Double_t mjdpos=53050;
    47 Bool_t   kRotate=1;
    48 Bool_t   kSrcPolicy=kTRUE;
     50Bool_t   kRotate=0;
     51Bool_t   kSrcPolicy=kFALSE;
    4952Double_t fRA= -1.;
    5053Double_t fDEC= -1.;
     54TString  srcFile;
    5155
    5256//-----------------------------------------------------------------------------
     
    5559
    5660const TString defaultcard="srcpos.datacard";
    57 
    58 const Float_t alphamin = 0.;       // minimum value in alpha (degrees)
    59 const Float_t alphamax = 90.;      // maximum value in alpha (degrees)
    6061const Float_t conver   = 189./0.6; // conversion factor degrees to mm
    6162
     
    147148  tlist.PrintStatistics();
    148149
     150 
     151  // do off-data if input file was specified
     152  if(!offFile.Length())
     153    return;
     154
     155  MReadTree read2("Parameters", offFile);
     156  read2.DisableAutoScheme(); 
     157  tlist.AddToListBefore(&read2, &read, "All");
     158  tlist.RemoveFromList(&read);
     159
     160  MWriteRootFile write2(offOutputFile,"RECREATE");
     161  write2.AddContainer("MHillas"       , "Parameters");
     162  write2.AddContainer("MHillasSrc"    , "Parameters");
     163  write2.AddContainer("MHillasExt"    , "Parameters");
     164  write2.AddContainer("MNewImagePar"  , "Parameters");
     165  write2.AddContainer("MRawEvtHeader" , "Parameters");
     166  write2.AddContainer("MRawRunHeader" , "Parameters");
     167  write2.AddContainer("MConcentration" , "Parameters");
     168  write2.AddContainer("MSrcPosCam"     , "Parameters");
     169  tlist.AddToListBefore(&write2,&write,"All");
     170  tlist.RemoveFromList(&write);
     171
     172  srcrotate.SetMode(MSrcPlace::kOff);
     173
     174  if (!evtloop.Eventloop(nmaxevents))
     175    return; 
     176
     177  tlist.PrintStatistics();
     178
    149179}
    150180//-----------------------------------------------------------------------
     
    182212        }
    183213
     214      // off-data file name
     215      if(strcmp(word.Data(),"OFFFILES")==0)
     216        {
     217          if(offFile.Length())
     218            cout << "readDataCards Warning: overriding off-data file name" << endl;
     219          ifun >> offFile;
     220        }
     221
    184222      // output file name
    185223      if(strcmp(word.Data(),"OUTFILE")==0)
     
    190228        }
    191229
     230      // output file name (off data)
     231      if(strcmp(word.Data(),"OFFOUTFILE")==0)
     232        {
     233          if(offOutputFile.Length())
     234            cout << "readDataCards Warning: overriding output file name for off data" << endl;
     235          ifun >> offOutputFile;
     236        }
     237
     238      // source position input file
     239      if(strcmp(word.Data(),"SRCFILE")==0)
     240        {
     241          if(srcFile.Length())
     242            cout << "readDataCards Warning: overriding source-position file name" << endl;
     243          ifun >> srcFile;
     244        }
     245
    192246      // source position
    193247      if(strcmp(word.Data(),"SRCPOS")==0)
     
    227281    }
    228282
     283  if(offFile.Length() && !offOutputFile.Length())
     284    {
     285      cout << "No output file name specified for off data" << endl;
     286      return kFALSE;
     287    }
     288
    229289  if(xsrcpos==0 && ysrcpos==0)
    230290    {
     
    232292      return kFALSE;
    233293    }
     294
     295  MTime thetime(mjdpos);
    234296
    235297  // Dump read values
     
    239301  cout << "Maximum number of input events: " << nmaxevents << endl;
    240302  cout << "Input file name(s): " << inputFile << endl;
     303  if(offFile.Length())
     304    cout << "Input file name(s) for off data: " << offFile << endl;
    241305  cout << "Output file name: " << outputFile << endl;
    242   cout << "Source position (degrees) X=" << xsrcpos << ", Y="<<ysrcpos;
    243   if(kSrcPolicy)
    244     cout << " (RELATIVE TO INITIAL SOURCE POSITION)" << endl;
     306  if(offFile.Length())
     307    cout << "Output file name for off data: " << offOutputFile << endl;
     308  if(srcFile.Length())
     309    cout << "Reading source position from file " << srcFile << endl;
    245310  else
    246     cout << " (ABSOLUTE POSITION IN THE CAMERA)" << endl;
    247   cout << "De-rotation flag " << kRotate << endl;
    248   cout << "Source celestial coordiantes (rad): RA = " << fRA << ", DEC = " << fDEC << endl;
     311    {
     312      cout << "Source position (degrees) X=" << xsrcpos << ", Y="<<ysrcpos;
     313      if(kSrcPolicy)
     314        cout << " (RELATIVE TO INITIAL SOURCE POSITION)";
     315      else
     316        cout << " (ABSOLUTE POSITION IN THE CAMERA)";
     317      cout << ", at " << thetime.GetSqlDateTime() << endl;
     318      cout << "De-rotation flag " << kRotate << endl;
     319      cout << "Source celestial coordiantes (rad): RA = " << fRA << ", DEC = " << fDEC << endl;
     320    }
    249321  cout << "***********" << endl << endl;
    250322
  • trunk/MagicSoft/Mars/mtemp/mifae/programs/srcpos.datacard

    r4056 r4072  
    11
    22// Maximun number of on and off events to be processed)
    3 NEVENTS 20000
     3NEVENTS 99999999
    44
    55// Input file name pattern
    6 INPUTFILES   /mnt/users/jrico/magic/mars/Mars_Standard02/mtemp/mifae/hillas/mrk20040215OnNoCalB.root
     6INPUTFILES /mnt/users/jrico/magic/mars/Mars_Standard02/mtemp/mifae/hillas/mrk20040215OnNoCalB.root
    77
    8 // output file name
     8// Specify optionally the name of OFF-data files you want to apply the same source position distribution to
     9OFFFILES  /mnt/users/jrico/magic/mars/Mars_Standard02/mtemp/mifae/hillas/mrk20040215OffNoCal*.root
     10
     11// output file name (on data)
    912OUTFILE  ./srcPosPrueba.root
    1013
    11 // X and Y position of the source in degrees for a MJ date (days) -important only in case of rotation
     14// output file name (off data)
     15OFFOUTFILE ./srcPosOffPrueba.root
     16
     17// X and Y position of the source (degrees) for a MJ date (days) -important only in case of rotation
    1218SRCPOS  0.21  0.176   53050.0773
    1319
     
    2430SRCCOORDS 2.899 0.667   // (Mrk 421)
    2531
     32
     33// File containing source position as a function of run number (overrides SRCPOS, SRCABS, ROTFLAG and SRCCOORDS values)
     34// SRCFILE ./20040215_Mrk421.B.pos
     35
     36
     37
Note: See TracChangeset for help on using the changeset viewer.