Ignore:
Timestamp:
09/03/16 14:54:02 (8 years ago)
Author:
tbretz
Message:
Renamed map to mmap to avoid conflicts with std::map, some snaity checks if the file names are NULL, do not add the drs claibration containers to the lists to signal that no drs calibration should be done, added some output to the root file relevant for the MC data, do not use any mapping (not required) for MC data (identified by the absents of drsfile).
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/fact/analysis/callisto_data.C

    r18270 r18567  
    11#include "MLogManip.h"
    22
    3 int callisto_data(const char *datafile, const char *drsfile, const char *drstime, const char *delays, const char *outpath=".")
     3int callisto_data(const char *datafile, const char *drsfile,
     4                  const char *drstime, const char *delays,
     5                  const char *outpath=".")
    46{
    57    // ======================================================
     
    911    // false: Display pixels in hardware/linear indices,
    1012    //        but the order is the camera display is distorted
    11     bool usemap = true;
     13    bool usemap = drstime ? true : false;
    1214
    1315    // map file to use (get that from La Palma!)
    14     const char *map = usemap ? "/home/fact/FACT++/FACTmap111030.txt" : NULL;
     16    const char *mmap = usemap ? "FACTmap111030.txt" : NULL;
    1517
    1618    //const char *pulse_template = "template-pulse.root";
     
    8284    // ======================================================
    8385
    84     if (map && gSystem->AccessPathName(map, kFileExists))
     86    if (mmap && gSystem->AccessPathName(mmap, kFileExists))
    8587    {
    86         gLog << err << "ERROR - Cannot access mapping file '" << map << "'" << endl;
     88        gLog << err << "ERROR - Cannot access mapping file '" << mmap << "'" << endl;
    8789        return 11;
    8890    }
     
    9193
    9294    MDrsCalibrationTime timecam;
    93     if (!timecam.ReadFits(drstime))
     95    if (drstime && !timecam.ReadFits(drstime))
    9496    {
    9597        gLog << err << "ERROR - Could not get MDrsCalibrationTime from " << drstime << endl;
     
    112114
    113115    MDrsCalibration drscalib300;
    114     if (!drscalib300.ReadFits(drsfile))
     116    if (drsfile && !drscalib300.ReadFits(drsfile))
    115117        return 31;
    116118
    117119    // -------------------------------------------------------
    118120
    119     if (delays)
     121    if (drstime && delays)
    120122    {
    121123        TGraph g(delays);
     
    175177    gLog << all;
    176178    gLog << "Data file: " << datafile << '\n';
    177     gLog << "DRS 300:   " << drsfile  << '\n';
    178     gLog << "DRS Time:  " << drstime  << '\n';
    179     gLog << "Delays:    " << delays   << '\n';
     179    if (drsfile)
     180        gLog << "DRS 300:   " << drsfile  << '\n';
     181    if (drstime)
     182        gLog << "DRS Time:  " << drstime  << '\n';
     183    if (delays)
     184        gLog << "Delays:    " << delays   << '\n';
    180185    gLog << "Outpath:   " << outpath  << '\n';
    181186    gLog << endl;
     
    205210    MParList plist5;
    206211    plist5.AddToList(&tlist5);
    207     plist5.AddToList(&drscalib300);
    208212    plist5.AddToList(&badpixels);
    209     plist5.AddToList(&timecam);
     213    if (drsfile)
     214        plist5.AddToList(&drscalib300);
     215    if (drstime)
     216        plist5.AddToList(&timecam);
    210217
    211218    MEvtLoop loop5("CalibratingData");
     
    216223
    217224    MRawFitsRead read5(datafile);
    218     read5.LoadMap(map);
     225    if (mmap)
     226        read5.LoadMap(mmap);
    219227
    220228    MFillH fill5a(&hrate);
     
    384392    write5.AddContainer("MTime",         "Events");
    385393    write5.AddContainer("MRawEvtHeader", "Events");
     394
     395    write5.AddContainer("MMcCorsikaRunHeader", "RunHeaders", kFALSE);
     396    write5.AddContainer("MCorsikaRunHeader",   "RunHeaders", kFALSE);
     397    write5.AddContainer("MMcRunHeader",        "RunHeaders", kFALSE);
     398    write5.AddContainer("MCorsikaEvtHeader",   "Events", kFALSE);
     399    write5.AddContainer("MMcEvt",              "Events", kFALSE);
     400    write5.AddContainer("IncidentAngle",       "Events", kFALSE);
     401    write5.AddContainer("MPointingPos",        "Events", kFALSE);
     402    write5.AddContainer("MTime",               "Events", kFALSE);
     403
     404
    386405    //write.AddContainer("MTriggerPattern", "Events");
    387406
Note: See TracChangeset for help on using the changeset viewer.