Changeset 17663


Ignore:
Timestamp:
04/07/14 15:05:14 (11 years ago)
Author:
ftemme
Message:
Added the creation of a MTruePhotonsPerPixelCont in MSimCamera and the filling of the arrays of the container. Also added the container to the fitsoutput
Location:
trunk/Mars
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/mjobs/MJSimulation.cc

    r17559 r17663  
    350350Bool_t MJSimulation::Process(const MArgs &args, const MSequence &seq)
    351351{
    352     /*
    353     if (!fSequence.IsValid())
    354     {
    355         *fLog << err << "ERROR - Sequence invalid!" << endl;
    356         return kFALSE;
    357     }
    358     */
    359 
    360 //    if (!HasWritePermission(CombinePath(fPathOut, GetOutFile(seq))))
    361 //        return kFALSE;
    362 
    363352    *fLog << inf;
    364353    fLog->Separator(GetDescriptor());
     
    381370
    382371    // --------------------------------------------------------------------------------
    383 
    384372    // Setup Parlist
    385373    MParList plist;
    386374    plist.AddToList(this); // take care of fDisplay!
    387 
    388375    // setup TaskList
    389376    MTaskList tasks;
    390377    plist.AddToList(&tasks);
    391 
    392378    // --------------------------------------------------------------------------------
    393379
     
    444430    header.SetObservation("On", "MonteCarlo");
    445431    plist.AddToList(&header);
    446     // ++++++++ FIXME FIXME FIXME +++++++++++++
    447 
    448     /*
    449     MPedestalCam pedcam;
    450     pedcam.Init(geomcam.GetNumPixels());
    451     for (UInt_t i=0; i<geomcam.GetNumPixels(); i++)
    452         pedcam[i].Set(128./header.GetScale(), 22.5/header.GetScale());
    453     plist.AddToList(&pedcam);
    454     */
    455 
    456     // -------------------------------------------------------------------
    457432
    458433    MCorsikaRead read;
     
    677652    write3af.AddContainer("IntendedPulsePos", "RunHeaders");
    678653    write3af.AddContainer("MRawEvtData",      "Events");
     654    write3af.AddContainer("MTruePhotonsPerPixelCont", "Events");
    679655   
    680656    if (fOperationMode == kModeData){
  • trunk/Mars/msimcamera/MSimCamera.cc

    r17643 r17663  
    4747#include "MLogManip.h"
    4848
     49#include "MTruePhotonsPerPixelCont.h"
     50
    4951#include "MSpline3.h"
    5052#include "MParSpline.h"
     
    149151    {
    150152        *fLog << err << "CrosstalkCoeffParam [MParameterD] not found... aborting." << endl;
     153        return kFALSE;
     154    }
     155
     156    fTruePhotons = (MTruePhotonsPerPixelCont*)pList->FindCreateObj("MTruePhotonsPerPixelCont");
     157    if (!fTruePhotons)
     158    {
     159        *fLog << err << "MTruePhotonsPerPixelCont not found... aborting." << endl;
    151160        return kFALSE;
    152161    }
     
    344353
    345354        if (ph.GetPrimary()!=MMcEvt::kNightSky && ph.GetPrimary()!=MMcEvt::kArtificial)
     355        {
    346356            tot += ph.GetWeight();
     357            (*fTruePhotons->cherenkov_photons_weight)[idx] += ph.GetWeight();
     358            (*fTruePhotons->cherenkov_photons_number)[idx] += 1;
     359
     360            (*fTruePhotons->cherenkov_arrival_time_mean)[idx] += t;
     361            (*fTruePhotons->cherenkov_arrival_time_variance)[idx] += t*t;
     362
     363            if (ph.GetPrimary()==MMcEvt::kMUON)
     364            {
     365                (*fTruePhotons->muon_cherenkov_photons_weight)[idx] += ph.GetWeight();
     366                (*fTruePhotons->muon_cherenkov_photons_number)[idx] += 1;
     367            }
     368
     369            // find min
     370            if (t < (*fTruePhotons->cherenkov_arrival_time_min)[idx] )
     371            {
     372                (*fTruePhotons->cherenkov_arrival_time_min)[idx] = t;
     373            }
     374            // find max
     375            if (t > (*fTruePhotons->cherenkov_arrival_time_max)[idx] )
     376            {
     377               (*fTruePhotons->cherenkov_arrival_time_max)[idx] = t;
     378            }
     379        }
     380        else
     381        {
     382            (*fTruePhotons->noise_photons_weight)[idx] += ph.GetWeight();
     383        }
    347384
    348385        // Sorry, the name "pedestal" is misleading here
     
    352389        // === FIXME === FIXME === FIXME === Frequency!!!!
    353390        (*fCamera)[idx].AddPulse(*fSpline, t, ph.GetWeight()*gain);
     391    }
     392
     393    for (unsigned int i=0 ; i < 1440 ; i++)
     394    {
     395        float number = (*fTruePhotons->cherenkov_photons_number)[i];
     396        (*fTruePhotons->cherenkov_arrival_time_mean)[i] /= number;
     397        float mean = (*fTruePhotons->cherenkov_arrival_time_mean)[i];
     398        float sum_tt = (*fTruePhotons->cherenkov_arrival_time_variance)[i];
     399        (*fTruePhotons->cherenkov_arrival_time_variance)[i] = (sum_tt / number - mean*mean) /(number - 1);
    354400    }
    355401
  • trunk/Mars/msimcamera/MSimCamera.h

    r17643 r17663  
    55#include "MTask.h"
    66#endif
     7
     8#include "MArrayF.h"
    79
    810class MMcEvt;
     
    1315class MAnalogChannels;
    1416class MPedestalCam;
     17class MArrayF;
     18class MTruePhotonsPerPixelCont;
    1519
    1620class MSpline3;
     
    3135
    3236    MParameterD       *fCrosstalkCoeffParam;
     37    MTruePhotonsPerPixelCont    *fTruePhotons;  //! Container to store the number of photons per pixel
    3338
    3439    const MSpline3    *fSpline;          // Pulse Shape   
Note: See TracChangeset for help on using the changeset viewer.