Changeset 18009 for trunk/Mars/msimcamera
- Timestamp:
- 11/07/14 15:41:06 (10 years ago)
- Location:
- trunk/Mars
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Mars
- Property svn:mergeinfo changed
/branches/MarsFixTimeOffsetBranch (added) merged: 18001-18008
- Property svn:mergeinfo changed
-
trunk/Mars/msimcamera/MSimCamera.cc
r17844 r18009 122 122 return kFALSE; 123 123 } 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 // ------------------------------------------------------------------- 124 174 /* 125 175 fPulsePos = (MParameterD*)pList->FindObject("IntendedPulsePos", "MParameterD"); … … 353 403 } 354 404 405 //-------------------------------------------------------------------------- 406 355 407 // Simulate pulses 356 408 for (Int_t i=0; i<num; i++) … … 359 411 360 412 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]; 362 421 363 422 // FIXME: Time jitter? -
trunk/Mars/msimcamera/MSimCamera.h
r17663 r18009 7 7 8 8 #include "MArrayF.h" 9 #include "MMatrix.h" 9 10 10 11 class MMcEvt; … … 35 36 36 37 MParameterD *fCrosstalkCoeffParam; 38 39 MMatrix *fFixTimeOffsetsBetweenPixelsInNs; //! Container to store the fix temporal offsets for each pixel in ns 40 37 41 MTruePhotonsPerPixelCont *fTruePhotons; //! Container to store the number of photons per pixel 38 42
Note:
See TracChangeset
for help on using the changeset viewer.