Ignore:
Timestamp:
10/27/11 16:00:00 (13 years ago)
Author:
lusterma
Message:
added fbsl.C ...extract baseline data
File:
1 edited

Legend:

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

    r12206 r12298  
    3636UInt_t data_roi;
    3737int NEvents;
     38int NBSLeve = 1000;
    3839
    3940size_t drs_n;
     
    157158        }
    158159    // Book the histograms
    159     printf("call BookHistos\n");
     160    // printf("call BookHistos\n");
    160161    BookHistos( data_roi );
    161     printf("returned from BookHistos\n");
     162    // printf("returned from BookHistos\n");
    162163    // Loop over events
    163164        cout << "--------------------- Data --------------------" << endl;
     
    201202    }
    202203
     204    FILE *fp;
     205    TString fName; // name of the histogram file
     206    /* create the filename for the histogram file */
     207    fName = datafilename; // use the name of the tree file
     208    fName.Remove(fName.Length() - 5); // remove the extension .root
     209    fName += "_bsl.txt"; // add the new extension
     210
     211    fp = fopen(fName, "a+");
     212    fprintf( fp, "FILE: %s\n", datafilename );
     213    fprintf( fp, "NEVENTS: %d\n", NEvents);
     214    NBSLeve = NEvents; // this has to be changed when computation on a subset of a run is implemented
     215    fprintf( fp, "NBSLEVE:  %d\n", NBSLeve );
     216
    203217    for (int pix = 0; pix < NPIX; pix++) {
    204218        //printf("Maximum bin pix[%d] %f\n", pix ,hBaseline[pix]->GetMaximumBin() );
     
    206220        float vmaxprob = hBaseline[pix]->GetXaxis()->GetBinCenter(
    207221            hBaseline[pix]->GetMaximumBin() );
     222
     223        fprintf( fp, "%8.3f", vmaxprob );
     224
    208225        hMeanBsl->Fill( vmaxprob );
    209226        hpltMeanBsl->SetBinContent(pix+1, vmaxprob );
     
    212229        hpltRmsBsl->SetBinContent( pix+1, hBaseline[pix]->GetRMS() );   
    213230    }
     231
     232    fclose( fp );
    214233
    215234    SaveHistograms( datafilename );
     
    361380    hList.Add( hRmsBsl );
    362381
    363     hpltRmsBsl = new TH1F("hplt_mean","Value of maximal probability",1440,-0.5,1439.5);
     382    hpltRmsBsl = new TH1F("hplt_rms","Value of maximal probability",1440,-0.5,1439.5);
    364383    hpltRmsBsl->GetXaxis()->SetTitle( "pixel" );
    365384    hpltRmsBsl->GetYaxis()->SetTitle( "RMS in mV" );
Note: See TracChangeset for help on using the changeset viewer.