Ignore:
Timestamp:
05/21/14 18:03:56 (11 years ago)
Author:
tbretz
Message:
Commented the light pulser extraction and the time marker extraction; added saturation treatment; added digital filter; replaced spline extraction by a simplified maximum/half-height-leading-edge extraction; adapted the way how the calibration constant is calculated accordingly
File:
1 edited

Legend:

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

    r17877 r17878  
    1313    // map file to use (get that from La Palma!)
    1414    const char *map = usemap ? "/home/fact/FACT++/FACTmap111030.txt" : NULL;
    15 
     15/*
    1616    Bool_t maximum = kTRUE;
    1717
     
    2121
    2222    const char *pulse_template = "template-pulse.root";
    23 
     23*/
    2424    // ------------------------------------------------------
    2525
    26     bool use_delays=false;
     26    //bool use_delays=false;
    2727
    2828    int spike_removal=3;
     29
     30    // The gain as extracted from our dark count spectra
     31    double gain = 258;
    2932
    3033    // ------------------------------------------------------
     
    3235    // Extraction range in slices. It will always(!) contain the full range
    3336    // of integration
    34     const int first_slice =  20; //  10ns
    35     const int last_slice  = 250; // 125ns
     37    const int first_slice =  25; //  10ns
     38    const int last_slice  = 225; // 125ns
    3639
    3740    // Note that rise and fall time mean different things whether you use IntegralFixed or IntegraRel:
     
    4447    //    * fFallTime: Number of slices right from maximum time
    4548    //
     49/*
    4650    const int rise_time_cal = maximum ?  40 :  10; // was 13;   5ns
    4751    const int fall_time_cal = maximum ? 120 : 160; // was 23;  80ns
     
    5761
    5862    const double heighttm   = 0.5; // IntegralAbs { 1.5pe * 9.6mV/pe } / IntegralRel { 0.5 }
    59 
     63*/
    6064    Long_t max  =    0;  // All
    6165    Long_t max0 =  max;  // Time marker
     
    277281
    278282    // ======================================================
    279 
     283/*
    280284    gLog << endl;
    281285    gLog.Separator("Processing external light pulser run");
     
    489493    //hcalco.Scale(scale);
    490494    hcalco.DrawCopy();
     495*/
     496
     497    TF1 f("f", "[0]*(1-1/(1+exp(x/[1])))*exp(-x/[2])", -15, 150);
     498    f.SetParameter(0, gain*0.05143);
     499    f.SetParameter(1, 1.075);
     500    f.SetParameter(2, 19.3);
     501    f.SetNpx(2*165); //2GHz
     502
     503    // Convert to graph
     504    TGraph g(&f);
     505
     506    // Convert to float
     507    MArrayF x(g.GetN());
     508    MArrayF y(g.GetN());
     509    for (int i=0; i<g.GetN(); i++)
     510    {
     511        x[i] = g.GetX()[i];
     512        y[i] = g.GetY()[i];
     513    }
     514
     515    MFilterData filter;
     516    filter.Filter(1, g.GetN(), y.GetArray(), y.GetArray());
     517
     518    // Define spline
     519    MArrayF der1(g.GetN());
     520    MArrayF der2(g.GetN());
     521
     522    MExtralgoSpline spline(y.GetArray(), y.GetSize(),
     523                           der1.GetArray(), der2.GetArray());
     524
     525    spline.SetExtractionType(MExtralgoSpline::kAmplitudeRel);
     526    spline.SetHeightTm(0.5);
     527
     528    // Estimate where the maximum is and extract signal
     529    Long64_t maxi = TMath::LocMax(y.GetSize(), y.GetArray());
     530    spline.Extract(maxi);
     531
     532    // Scale factor for signal extraction
     533    double scale = 1./spline.GetSignal();
    491534
    492535    // ======================================================
     
    676719    // ---
    677720
    678     MExtractTimeAndChargeSpline extractor5dat;
     721    MTreatSaturation treatsat5;
     722    MFilterData filterdata5;
     723
     724    MExtractFACT extractor5dat;
    679725    extractor5dat.SetRange(first_slice, last_slice);
    680     extractor5dat.SetRiseTimeHiGain(rise_time_dat);
    681     extractor5dat.SetFallTimeHiGain(fall_time_dat);
    682     extractor5dat.SetHeightTm(heighttm);
    683     extractor5dat.SetChargeType(type);
    684     extractor5dat.SetSaturationLimit(600000);
    685     extractor5dat.SetNoiseCalculation(kFALSE);
    686 
     726/*
    687727    MExtractTimeAndChargeSpline extractor5cal;
    688728    extractor5cal.SetRange(first_slice, last_slice);
     
    704744    extractor5tm.SetNameSignalCam("TimeMarkerAmplitude");
    705745    extractor5tm.SetNameTimeCam("TimeMarkerTime");
    706 
     746*/
    707747    extractor5dat.SetFilter(&filterncl);
    708     extractor5cal.SetFilter(&filtercal);
     748    //extractor5cal.SetFilter(&filtercal);
    709749    //extractor4tm.SetFilter(&filtercal);
    710750
     
    716756    MCalibrateDrsTimes calctm5;
    717757    calctm5.SetNameUncalibrated("UncalibratedTimes");
    718 
     758/*
    719759    MCalibrateDrsTimes calctm5tm("CalibrateTimeMarker");
    720760    calctm5tm.SetNameArrivalTime("TimeMarkerTime");
     
    766806    //fill5w.SetDrawOption("gaus");
    767807    //fill5x.SetDrawOption("gaus");
    768 
     808*/
    769809
    770810    MBadPixelsTreat treat5;
    771811    treat5.SetProcessPedestalRun(kFALSE);
    772812    treat5.SetProcessPedestalEvt(kFALSE);
    773 
     813/*
    774814    MHSectorVsTime hist5cal("CalVsTm");
    775815    MHSectorVsTime hist5ped("PedVsTm");
     
    789829    fill5cal.SetFilter(&filtercal);
    790830    fill5ped.SetFilter(&filterped);
    791 
     831*/
    792832    MHCamEvent evt5b(0, "ExtSig",   "Extracted signal;;S [mV·sl]");
    793833    MHCamEvent evt5c(0, "CalSig",   "Calibrated and interpolated signal;;S [~phe]");
     
    831871    MContinue test;
    832872    test.SetFilter(&filterncl);
    833 
     873/*
    834874    MTaskList tlist5tm;
    835875    tlist5tm.AddToList(&extractor5tm);
     
    846886    tlist5tm.AddToList(&fill5x);
    847887    tlist5tm.SetFilter(&filtercal);
    848 
     888*/
    849889    MTaskList tlist5dat;
    850890    tlist5dat.AddToList(&fill5b);
     
    863903    tlist5.AddToList(&filterped);
    864904    tlist5.AddToList(&fill5a);
     905    tlist5.AddToList(&treatsat5);
     906    tlist5.AddToList(&filterdata5);
    865907    tlist5.AddToList(&extractor5dat);
    866     tlist5.AddToList(&extractor5cal);
     908    //tlist5.AddToList(&extractor5cal);
    867909    tlist5.AddToList(&calctm5);
    868     tlist5.AddToList(&tlist5tm);
     910    //tlist5.AddToList(&tlist5tm);
    869911    tlist5.AddToList(&conv5);
    870912    tlist5.AddToList(&treat5);
    871     tlist5.AddToList(&fill5ped);
    872     tlist5.AddToList(&fill5cal);
     913    //tlist5.AddToList(&fill5ped);
     914    //tlist5.AddToList(&fill5cal);
    873915    tlist5.AddToList(&tlist5dat);
    874916    tlist5.AddToList(&write5);
Note: See TracChangeset for help on using the changeset viewer.