Changeset 14063 for fact/tools


Ignore:
Timestamp:
06/04/12 18:52:53 (12 years ago)
Author:
Jens Buss
Message:
added function for shifting histograms in y-direction, histogramms for chi2test on pulseshape
Location:
fact/tools/rootmacros/PulseTemplates
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • fact/tools/rootmacros/PulseTemplates/pixel.C

    r13855 r14063  
    11#include <iostream>
     2#include <TMath.h>
     3#include <TF1.h>
    24
    35#include "rootfilehandler.h"
     
    5254
    5355    hList           = new TList();
     56
     57    if (mOptions.Contains("C") )
     58    {
     59        hChi2EdgetoMax = new TH1F*[mMaxPulseOrder];
     60    }
     61
    5462    if (options.Contains("L"))
    5563    {
     
    6068       BookPixelHistos();
    6169    }
     70
     71    if (mOptions.Contains("C"))
     72    {
     73        BookDistributionHistos();
     74    }
     75
    6276    BookTemplateHistos();
    6377    BookEdgeTemplateHistos();
     
    227241    {
    228242        pixelCanvas[pulse_order]->cd( histoFrameNr[0] );
     243        hMaxOverlay[pulse_order]->Draw("COLZ");
     244
     245        pixelCanvas[pulse_order]->cd( histoFrameNr[1] );
    229246        hPixelMax[pulse_order]->Draw();
    230247
    231         pixelCanvas[pulse_order]->cd( histoFrameNr[1] );
     248        pixelCanvas[pulse_order]->cd( histoFrameNr[2] );
    232249        hPixelMedian[pulse_order]->Draw();
    233250
    234         pixelCanvas[pulse_order]->cd( histoFrameNr[2] );
     251        pixelCanvas[pulse_order]->cd( histoFrameNr[3] );
    235252        hPixelMean[pulse_order]->Draw();
     253//        hPixelMax[pulse_order]->Draw("SAME");
     254//        hPixelMedian[pulse_order]->Draw("SAME");
    236255
    237256    }
     
    249268    for (int pulse_order = 0; pulse_order < mMaxPulseOrder; pulse_order++)
    250269    {
    251         pixelCanvas[pulse_order]->cd( histoFrameNr[0] );
     270        pixelCanvas[pulse_order]->cd( histoFrameNr[4] );
     271        hEdgeOverlay[pulse_order]->Draw("COLZ");
     272
     273        pixelCanvas[pulse_order]->cd( histoFrameNr[5] );
    252274        hPixelEdgeMax[pulse_order]->Draw();
    253275
    254         pixelCanvas[pulse_order]->cd( histoFrameNr[1] );
     276        pixelCanvas[pulse_order]->cd( histoFrameNr[6] );
    255277        hPixelEdgeMedian[pulse_order]->Draw();
    256278
    257         pixelCanvas[pulse_order]->cd( histoFrameNr[2] );
     279        pixelCanvas[pulse_order]->cd( histoFrameNr[7] );
    258280        hPixelEdgeMean[pulse_order]->Draw();
     281//        hPixelEdgeMax[pulse_order]->Draw("SAME");
     282//        hPixelEdgeMedian[pulse_order]->Draw("SAME");
    259283
    260284    }
     
    526550            }
    527551
     552            if (mOptions.Contains("C"))
     553            {
     554                if (mVerbosityLevel > 3) cout << "\t...booking " << HistoName("hSlopeRisingEdge", order) << endl;
     555                hChi2EdgetoMax[order] = new TH1F (
     556                            HistoName("hChi2EdgetoMax", order),
     557                            HistoTitle("Distribution of CHI2 comparison of Edge and Max", order),
     558                            600,
     559                            -299,
     560                            300
     561                            );
     562                hChi2EdgetoMax[order]->SetAxisRange(
     563                                    -1,
     564                                    7,
     565                                    "X");
     566                hChi2EdgetoMax[order]->GetXaxis()->SetTitle( "p-Value" );
     567                hChi2EdgetoMax[order]->GetYaxis()->SetTitle( "counts" );
     568                hChi2EdgetoMax[order]->SetStats(mStats);
     569//                hList->Add( hChi2EdgetoMax[order] );
     570            }
     571
    528572            if (mVerbosityLevel > 2) cout << "...done" << endl;
    529573        }
     
    10611105
    10621106
    1063 
     1107void
     1108Pixel::ShiftHistoInY(
     1109        TH1*                histo,
     1110        float               shift
     1111        )
     1112{
     1113    int min_bin = histo->GetXaxis()->GetFirst();
     1114    int max_bin = histo->GetXaxis()->GetLast();
     1115
     1116    for (int bin = min_bin; bin <= max_bin; bin++)
     1117    {
     1118        histo->AddBinContent( bin, shift);
     1119    }
     1120
     1121}
     1122
     1123
  • fact/tools/rootmacros/PulseTemplates/pixel.h

    r13857 r14063  
    2323#include <TString.h>
    2424#include <TFile.h>
     25
    2526#include "TCanvas.h"
    2627#include "TObjArray.h"
     
    107108    void DeleteEdgeTemplateHistos();
    108109
     110    //Histogram appeareance
    109111    void
    110112    MakeTH1Pretty(
     
    161163    virtual TString CsvFileName(TString, TString, int );
    162164
     165    //fit funcitons
     166//    void FitFallingEdge(
     167//            TString             histoType,   //Max or Edge
     168//            double ,
     169//            double ,
     170//            TH1F*               hMaximumTemp
     171//            );
     172
     173//    double
     174//    PolExp(double* x, double* par);
     175
     176    //shifting
     177    void ShiftHistoInY(TH1*, float);
    163178// ACCESS
    164179// INQUIRY
     
    183198    TH1I**          hRisingEdgeToMax;
    184199    TH1I**          hPosOfMax;
     200    TH1F**          hChi2EdgetoMax;
    185201
    186202    //Max Overlay Template Histos
Note: See TracChangeset for help on using the changeset viewer.