Changeset 12754 for fact/tools


Ignore:
Timestamp:
01/24/12 05:17:24 (13 years ago)
Author:
Jens Buss
Message:
deleted bug in Search for crazy pixels
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fact/tools/rootmacros/gainfit2.C

    r12721 r12754  
    4444//-----------------------------------------------------------------------------
    4545UInt_t NumberOfPixels;
    46 
     46#define MAX_SIGMA 4
    4747  typedef struct{
    4848  UInt_t PID;
     
    101101        const char * OutTextFileName = "../analysis/fpeak/20111110_005/20111110_005_gainfit.txt",
    102102        const char * RootOutFileName = "../analysis/fpeak/20111110_005/20111110_005_gainfit.root",
    103         bool showHistos = true,
    104         bool debug = true,
    105         int verbosityLevel = 2)
     103        bool showHistos = false,
     104        bool debug = false,
     105        int verbosityLevel = 4)
    106106{
    107107
     
    274274        hPixelAmplSpek[ pixel ]->Fit(fspek_fit2,verbos[fitverb]+"R+");
    275275        channel[ pixel ].ampl_fspek_fit2 = fspek_fit2->GetParameter(1);
    276        
     276
    277277        if( showHistos ){
    278278        hPixelAmplSpek[ pixel ]->Draw();
     
    325325        gr2->SetPoint(pixel, channel[pixel].PID, channel[pixel].ampl_fspek_fit2);
    326326
    327 
    328327    if( showHistos ){
    329328        if (pixel%60==0){
     
    379378    cGraphs->cd(2);
    380379    gr1->Draw("APL");
     380    hList.Add(gr1);
     381    hList.Add(gr2);
    381382    cGraphs->Modified();
    382383    cGraphs->Update();
     
    416417
    417418    //check if pixel gain is compareable to gain of the others and save result to logfile
    418             channel[ pixel ].crazy = SearchAnormal(pixel, 4, verbosityLevel);
     419            channel[ pixel ].crazy = SearchAnormal(pixel, MAX_SIGMA, verbosityLevel);
    419420            if (channel[ pixel ].crazy) hListCrazy.Add(hPixelAmplSpek[ pixel ]);
    420421            out << channel[ pixel ].crazy << "\t" ;
     
    540541bool SearchAnormal(UInt_t pixel, Double_t distance, int verbosityLevel){
    541542  Double_t check = channel[ pixel ].ampl_fspek_fit;
    542   check = TMath::Sqrt(check*check);
    543   if (check < (distance * distribution.sigma + distribution.mean)){
     543  // check = TMath::Sqrt(check*check);
     544  if ( check > ( distribution.mean - distance * distribution.sigma )
     545    && check < ( distribution.mean + distance * distribution.sigma )){
    544546    return false;
    545547    }
    546548  else{
    547     if (verbosityLevel > 2) cout << "Not normal behaviour in Pixel: " << pixel +1 << endl;
     549    if (verbosityLevel > 2) cout << "Not normal behaviour in Pixel: " << pixel << endl;
    548550    return true;
    549551  }
Note: See TracChangeset for help on using the changeset viewer.