Ignore:
Timestamp:
11/07/14 13:23:50 (10 years ago)
Author:
smueller
Message:
Fix tempral offsets are added to the relative arrival time in the camera simulation. The offsets are taken from the new generic MMatrix container. In the ceres.rc file is a new key value pair specifieing the path to a text file holding the delay data.
Location:
branches/MarsFixTimeOffsetBranch
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/MarsFixTimeOffsetBranch/ceres.rc

    r17913 r18006  
    233233# Does not trigger anyway
    234234ContEmpty3.Condition: MPhotonEvent.GetNumPhotons<10
     235
     236MFixTimeOffset.FileName: resmc/fact/pixel_delays_ALL_ZERO.csv
     237# MFixTimeOffset.FileName: resmc/fact/AllPhidoFiles_delays.csv
     238
     239# last line comment
  • branches/MarsFixTimeOffsetBranch/msimcamera/MSimCamera.cc

    r17844 r18006  
    122122        return kFALSE;
    123123    }
     124    // -------------------------------------------------------------------
     125    // Dominik Neise and Sebastian Mueller on fix time offsets:
     126    // We obtain the fix temporal offsets for the FACT camera pixels out of
     127    // a text file. The textfile must be mentioned in the ceres.rc file.
     128    // There are no default offsets on purporse. The filename must be specified
     129    // in ceres.rc and the file must be parsed without errors and it must
     130    // provide exactly 1440 floating point numbers.   
     131    fFixTimeOffsetsBetweenPixelsInNs =
     132    (MMatrix*)pList->FindObject("MFixTimeOffset");
     133    if (!fFixTimeOffsetsBetweenPixelsInNs)
     134    {
     135        // the key value pair providing the text file is not present in the
     136        // environment env.
     137        *fLog << err << "In Source: "<< __FILE__ <<" in line: "<< __LINE__;
     138        *fLog << " in function: "<< __func__ <<"\n";
     139        *fLog << "MFixTimeOffset not found... aborting." << endl;
     140        return kFALSE;
     141
     142    }
     143    else if ( fFixTimeOffsetsBetweenPixelsInNs->fM.size() != 1440 )
     144    {
     145        // The number of time offsets must match the number of pixels in the
     146        // FACT camera.
     147        *fLog << err << "In Source: "<< __FILE__ <<" in line: "<< __LINE__;
     148        *fLog << " in function: "<< __func__ <<"\n";
     149        *fLog << "MFixTimeOffset has the wrong dimension! ";
     150        *fLog << "There should be "<< 1440 <<" time offsets ";
     151        *fLog << "(one for each pixel in FACT) but there are: ";
     152        *fLog << fFixTimeOffsetsBetweenPixelsInNs->fM.size() << "! ";
     153        *fLog << "... aborting." << endl;
     154        return kFALSE;
     155    }
     156    // Check all entries for inf and nan. Those are not accepted here.
     157    for( std::vector< double > row : fFixTimeOffsetsBetweenPixelsInNs->fM ){
     158        for( double number : row){
     159
     160            if( std::isnan(number) || std::isinf(number) ){
     161
     162                *fLog << err << "In Source: "<< __FILE__ <<" in line: ";
     163                *fLog << __LINE__;
     164                *fLog << " in function: "<< __func__ <<"\n";
     165                *fLog << "There is a non normal number in the fix temporal ";
     166                *fLog << "pixel offsets. This is at least one number is ";
     167                *fLog << "NaN or Inf. This here is >"<< number;
     168                *fLog << "<... aborting." << endl;               
     169                return kFALSE;
     170            }
     171        }
     172    }
     173    // -------------------------------------------------------------------
    124174/*
    125175    fPulsePos = (MParameterD*)pList->FindObject("IntendedPulsePos", "MParameterD");
     
    353403    }
    354404
     405    //--------------------------------------------------------------------------
     406
    355407    // Simulate pulses
    356408    for (Int_t i=0; i<num; i++)
     
    359411
    360412        const UInt_t   idx = ph.GetTag();
    361         const Double_t t   = (ph.GetTime()-fStat->GetTimeFirst())*freq+rndm;// - fSpline->GetXmin();
     413        Double_t t   = (ph.GetTime()-fStat->GetTimeFirst())*freq+rndm;// - fSpline->GetXmin();
     414
     415        // Sebastian Mueller and Dominik Neise on fix time offsets:
     416        // We add a fix temporal offset to the relative arrival time of the
     417        // individual pixel. The offsets are stored in the
     418        // fFixTimeOffsetsBetweenPixelsInNs -> fM matrix. We identify the first
     419        // column to hold the offsets in ns.
     420        t = t + freq*fFixTimeOffsetsBetweenPixelsInNs->fM[idx][0];
    362421
    363422        // FIXME: Time jitter?
  • branches/MarsFixTimeOffsetBranch/msimcamera/MSimCamera.h

    r17663 r18006  
    77
    88#include "MArrayF.h"
     9#include "MMatrix.h"
    910
    1011class MMcEvt;
     
    3536
    3637    MParameterD       *fCrosstalkCoeffParam;
     38
     39    MMatrix *fFixTimeOffsetsBetweenPixelsInNs; //! Container to store the fix temporal offsets for each pixel in ns
     40
    3741    MTruePhotonsPerPixelCont    *fTruePhotons;  //! Container to store the number of photons per pixel
    3842
Note: See TracChangeset for help on using the changeset viewer.