Ignore:
Timestamp:
04/19/13 01:42:28 (11 years ago)
Author:
Jens Buss
Message:
add some new histos
File:
1 edited

Legend:

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

    r15121 r15372  
    215215        TString     sequenzFileName     = "/home_nfs/isdc/jbbuss/analysis/pulseShape/lists/20120802templ_vs_100mV.csv",
    216216        TString     OutputPath          = "analysis/PulsTemplateAnalysis/20120802/",
    217         TString     OutRootFileName     = "20120802_100mV_Stacking_G12B-2AWW8.root",
     217        //TString     OutRootFileName     = "20120802_100mV_Stacking_G12B-2AWW8.root",
     218        TString     OutRootFileName     = "new_dist_test.root",
    218219        //---------------{Process parameters}---------------
    219         int         nRuns               = -1,
     220        int         nRuns               = 5,
    220221        int         firstevent          = 1,        // Hast to be between 1 and infinity NOT 0!!!!
    221222        int         nevents             = -1,
    222223        int         firstpixel          = 0,
    223         int         npixel              = -1,
    224         int         pixelSetSize       = 150,
     224        int         npixel              = 1,
     225        int         pixelSetSize        = 150,
    225226        int         maxPulseOrder       = 6,
    226227        //---------------{stacking parameters}---------------
     
    241242        float       risingEdgeMinSlope  = 0.5,
    242243        //---------------{graphical options}---------------
    243         bool            select_pulses   = false,
     244        bool        select_pulses       = false,
    244245        bool        ProduceGraphic      = false,
    245246        bool        spikeDebug          = false,
     
    258259
    259260    // Amplitude below which pulses will be discarted
    260     float minPulseAmplitude     = 0.3*(GainMean-BSLMean);
     261    float minPulseAmplitude     = 0.3*(GainMean)+BSLMean;
    261262    // Amplitude above which pulses will be discarted
    262     float maxPulseAmplitude     = 2*(GainMean-BSLMean)*maxPulseOrder;
     263    float maxPulseAmplitude     = (maxPulseOrder+1)*(GainMean)+BSLMean;
    263264    // pulses within this distance to timeline edge be discarted
    264265    int   timeLineEdgeWidth     = 2;
     
    298299    //fill vector of fits files to read
    299300    cout << "generating file list:" << endl;
    300     if(nRuns < fitsFileNames.size() && nRuns != -1)
     301    if(nRuns < (int)fitsFileNames.size() && nRuns != -1)
    301302    {
    302303        fitsFileNames.resize(   nRuns);
     
    729730                    // first Argument 1 means ... *rising* edge
    730731                    // second Argument 1 means ... seagRCh with stepsize 1 ... 10 is okay as well
    731                     vector<Region>* pZXings = zerosearch( gVcfd2 , 1 , 8);
     732                    vector<Region>* pZXings = zerosearch( gVcfd2 , 1 , 8, verbosityLevel);
    732733                    // pZXings means "zero cross ings"
    733734
    734                     int init_reg_size = pZXings->size();
    735                     int curr_reg_size = initial_region_size;
     735                    float init_reg_size = pZXings->size();
     736                    float curr_reg_size = init_reg_size;
    736737                    int step = 0;
    737                     pixel[pixelID]->hDiscartedPulses->Fill(step, init_reg_size - curr_reg_size);
     738
     739                    pixel[pixelID]->hDiscartedPulses->Fill(step, 1 - curr_reg_size/init_reg_size);
    738740
    739741                    //enlare the search window
    740742                    curr_reg_size = EnlargeRegion(*pZXings, 10, 10);
    741                     pixel[pixelID]->hDiscartedPulses->Fill(step++, init_reg_size - curr_reg_size);
     743                    pixel[pixelID]->hDiscartedPulses->Fill(step++, 1 - curr_reg_size/init_reg_size);
    742744
    743745                    // find the the max position of a peak
    744746                    curr_reg_size = findAbsMaxInRegions(*pZXings, gVslide);
    745                     pixel[pixelID]->hDiscartedPulses->Fill(step++, init_reg_size - curr_reg_size);
    746 
     747                    pixel[pixelID]->hDiscartedPulses->Fill(step++, 1 - curr_reg_size/init_reg_size);
     748
     749//                    curr_reg_size = calcCFDPositions(*pZXings, gVcfd2);
     750//                    pixel[pixelID]->hDiscartedPulses->Fill(step++, 1 - curr_reg_size/init_reg_size);
     751
     752
     753                    // +++++++++++++++++++++++++++++++++++++++++++++++++++++++
    747754                    //do a small after pulse analysis, fill in delayed pulses
    748                     // +++++++++++++++++++++++++++++++++++++++++++++++++++++++
     755
    749756                    vector<Region>::iterator reg_it = pZXings->begin();
    750757                    int first_pos = pZXings->begin()->maxPos;
    751758                    while( reg_it != pZXings->end() )
    752759                    {
    753                         float minimum = 0.0;
    754                         for (int sl = reg_it->maxPos; sl < 1; i--)
     760                        //float minimum = 0.0;
     761                        for (int sl = reg_it->maxPos; sl < 1; sl--)
    755762                        {
    756763                            if (gVcfd2[sl] > 0 && gVcfd2[sl-2] <= 0 && gVcfd2[sl-4] < 0)
    757764                            {
    758                                 minimum = gVcfd2[sl-2];
     765                                //minimum = gVcfd2[sl-2];
    759766                                break;
    760767                            }
    761768                        }
    762 
    763769                        pixel[pixelID]->hAfterPulses->Fill(
    764770                                    reg_it->maxPos - first_pos,
    765                                     reg_it->maxVal - minimum
     771                                    reg_it->maxVal// - minimum
    766772                                    );
     773                        reg_it++;
    767774                    }
    768775                    // +++++++++++++++++++++++++++++++++++++++++++++++++++++++
     
    770777                    // remove peaks below 1 p.e.
    771778                    curr_reg_size = removeMaximaBelow( *pZXings, minPulseAmplitude);
    772                     pixel[pixelID]->hDiscartedPulses->Fill(step++, init_reg_size - curr_reg_size);
    773 
    774                     // remove peaks above that are larger tha the largest amplitude to be studied
    775                     curr_reg_size = removeMaximaAbove( *pZXings, maxPulseAmplitude);
    776                     pixel[pixelID]->hDiscartedPulses->Fill(step++, init_reg_size - curr_reg_size);
    777 
    778                     // remove pulses at the pipeline fringes
    779                     curr_reg_size = removeRegionWithMaxOnEdge( *pZXings, timeLineEdgeWidth);
    780                     pixel[pixelID]->hDiscartedPulses->Fill(step++, init_reg_size - curr_reg_size);
    781 
    782                     // remove "Afterpulses" from pulse list
    783                     curr_reg_size = removeRegionOnFallingEdge( *pZXings, FallingEdgeWidth);
    784                     pixel[pixelID]->hDiscartedPulses->Fill(step++, init_reg_size - curr_reg_size);
     779                    pixel[pixelID]->hDiscartedPulses->Fill(step++, 1 - curr_reg_size/init_reg_size);
    785780
    786781                    // Calculate the position (sample) of a pulses half maximum
    787782                    curr_reg_size = findTimeOfHalfMaxLeft(*pZXings, gVslide, gBSLMean, beginRisingEdge, endRisingEdge, verbosityLevel );
    788                     pixel[pixelID]->hDiscartedPulses->Fill(step++, init_reg_size - curr_reg_size);
    789 
    790                     //sometimes pulses where found with a very flat slope, DISCARD them
    791                     curr_reg_size = removeRegionWithToFlatSlope(*pZXings, risingEdgeMinSlope);
    792                     pixel[pixelID]->hDiscartedPulses->Fill(step++, init_reg_size - curr_reg_size);
    793                     if (verbosityLevel > 2) cout << "...done" << endl;
     783                    pixel[pixelID]->hDiscartedPulses->Fill(step++,  1 - curr_reg_size/init_reg_size);
     784
    794785
    795786                    // Fill arrival times into histograms
     
    800791                        pixel[pixelID]->hEdgePos->Fill(     it->halfRisingEdgePos);
    801792                        pixel[pixelID]->hEdgeSlope->Fill(   it->slopeOfRisingEdge);
     793                        pixel[pixelID]->hMaxEdgeSlope->Fill(   it->maxSlope);
    802794                        pixel[pixelID]->hIntercept->Fill(   it->interceptRisingEdge);
    803                         pixel[pixelID]->hEdgeLength->Fill(  it->lengthOfRisingEdge);
     795                        pixel[pixelID]->hEdgeLength->Fill(  it->distanceEdgeToMax);
    804796                        pixel[pixelID]->hMaxAmpl->Fill(     it->maxVal);
    805797                        ++it;
    806798                    }
     799
     800                    // remove pulses at the pipeline fringes
     801                    curr_reg_size = removeRegionWithMaxOnEdge( *pZXings, timeLineEdgeWidth);
     802                    pixel[pixelID]->hDiscartedPulses->Fill(step++, 1 - curr_reg_size/init_reg_size);
     803
     804                    //sometimes pulses where found with a very flat slope, DISCARD them
     805                    curr_reg_size = removeRegionWithToFlatSlope(*pZXings, risingEdgeMinSlope);
     806                    pixel[pixelID]->hDiscartedPulses->Fill(step++, 1 - curr_reg_size/init_reg_size);
     807                    if (verbosityLevel > 2) cout << "...done" << endl;
     808
     809                    // remove peaks above that are larger tha the largest amplitude to be studied
     810                    curr_reg_size = removeMaximaAbove( *pZXings, maxPulseAmplitude);
     811                    pixel[pixelID]->hDiscartedPulses->Fill(step++, 1 - curr_reg_size/init_reg_size);
     812
     813
     814                    // remove "Afterpulses" from pulse list
     815                    curr_reg_size = removeRegionOnFallingEdge( *pZXings, FallingEdgeWidth);
     816                    pixel[pixelID]->hDiscartedPulses->Fill(step++, 1 - curr_reg_size/init_reg_size);
     817
     818
    807819
    808820    //-----------------------------------------------------------------------------
     
    12371249                if (pos > reg->maxPos + 1)
    12381250                {
     1251                    last_pos = pos;
    12391252                    // check if the current slice is close to the end of the overlay window
    12401253                    if ( pos+5 >= Right )
Note: See TracChangeset for help on using the changeset viewer.