Ignore:
Timestamp:
04/29/20 21:48:05 (5 years ago)
Author:
giangdo
Message:
script to synchronise the data from HAWC's Eye and HAWC

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Mars/hawc/fit_singles.C

    r19875 r19951  
    9393
    9494// Print function parameters
    95 void PrintFunc(TF1 &f, float integration_window=30)
     95void PrintFunc(TF1 &f, float integration_window=40)
    9696{
    9797    //cout << "--------------------" << endl;
     
    113113// The parameters for the function are the filenam from the gain extraction
    114114// and the output filename
    115 int fit_singles(const char *filename = "20191027_006_006.root",
    116                 const char *outfile  = "20190227_006_006-fit.root",
     115int fit_singles(const char *filename = "/home/giangdo/Documents/Master/MA/pulse/data_single_pe/extracted/20191027_006_006.root",
     116                const char *outfile  = "/home/giangdo/Documents/Master/MA/pulse/data_single_pe/extracted/20191027_006_006_fit.root",
    117117                bool fixednoise=false)
    118118{
    119119    // Read the mapping between bias channels and hardware channels
    120120    PixelMap pmap;
    121     if (!pmap.Read("../hawc/FAMOUSmap171218.txt"))
    122     {
    123         cout << "FAMOUSmap171218.txt not found." << endl;
     121    if (!pmap.Read("/home/giangdo/Documents/Master/MA/Software/Mars/hawc/HAWCsEyemap181214.txt"))
     122    {
     123        cout << "HAWCsEyemap181214.txt not found." << endl;
    124124        return 1;
    125125    }
    126126
    127127    // It is more correct to fit the integral, but this is super
    128     // slow, especially for 1440 pixel. To get that, one would have
     128    // slow. To get that, one would have
    129129    // to analytically integrate and fit this function.
    130     // (Currently the integral is switched off for the 1440 individual
    131     // spectra in all cases)
    132130    bool fast = false; // Switch off using integral
    133131
    134132    // Values which should be read from the file but not available atm
    135     Int_t integration_window = 30;
     133    Int_t integration_window = 40;
    136134
    137135    // Map for which pixel shall be plotted and which not
     
    266264    TH1F hCoeffR2    ("CoeffR2",    "Coefficient R",          90, -1,     2);
    267265
    268     // Histigram for the sum of all spectrums
    269     TH1F hSum("Sum1", "Signal spectrum of all pixels",
     266    // Histogram for the sum of all spectrums
     267    TH1F hSum("Sum1", "Signal spectrum of all pixels (excl. blind pixels)",
    270268              hsignal->GetNbinsY(), hsignal->GetYaxis()->GetXmin(),  hsignal->GetYaxis()->GetXmax());
    271269    hSum.SetXTitle("pulse integral [mV sample]");
     
    275273
    276274    // Histogram for the sum of all pixels excluding the ones with faulty fits
    277     TH1F hSumClear1("SumC1", "Signal spectrum of all pixels (incl TM)",
     275    TH1F hSumClear1("SumC1", "Signal spectrum of all pixels (excl. faulty and blind pixels)",
    278276                    hsignal->GetNbinsY(), hsignal->GetYaxis()->GetXmin(),  hsignal->GetYaxis()->GetXmax());
    279277    hSumClear1.SetXTitle("pulse integral [mV sample]");
     
    303301    hPulse.SetStats(false);
    304302
    305     // Spektrum for the normalized individual spectra
    306     TH1F hSumScale1("SumScale1", "Signal spectrum of all pixels (incl TM)",  120, 0.05, 12.05);
     303    // Spectrum for the normalized individual spectra
     304    TH1F hSumScale1("SumScale1", "Signal spectrum of all pixels (excl. blind pixels)",  120, 0.05, 12.05);
    307305    hSumScale1.SetXTitle("pulse integral [pe]");
    308306    hSumScale1.SetYTitle("Rate");
     
    332330        if (usePixel[pixel]==0)
    333331            continue;
     332
     333        //exclude the pixels without cones
     334        if (pixel == 61)
     335           continue;
     336        if (pixel == 62)
     337           continue;
     338        if (pixel == 63)
     339           continue;
     340
     341
     342
    334343
    335344        TH1D *hist = hsignal->ProjectionY("proj", pixel+1, pixel+1);
     
    434443        if (usePixel[pixel]==0)
    435444            continue;
     445
     446        // Exclude pixels without cones
     447        if (pixel == 61)
     448           continue;
     449        if (pixel == 62)
     450           continue;
     451        if (pixel == 63)
     452           continue;
    436453
    437454        //Projectipon of a certain Pixel out of Ampl.Spectrum
Note: See TracChangeset for help on using the changeset viewer.