AGAPRO_PreproHist.h 3.36 KB
Newer Older
Jérémie Dudouet's avatar
Jérémie Dudouet committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99
/***************************************************************************
 *   Copyright (C) 2018 by Jeremie Dudouet                                 *
 *   jeremie.dudouet(AT)csnsm.in2p3.fr                                     *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

#ifndef _PreproHist
#define _PreproHist

#include "AGAPRO_Histogramer.h"
#include "NarvalInterface.h"
#include "CrystalFrame.h"
#include "Trigger.h"
#include "CycleServer.h"

//! Post preprocessing histogramer
/*!
 */
namespace AGAPRO {

class PreproHist : public Histogramer
{
protected:      //Evt properties

    ADF::SharedFP *fFrameCrystal;       //! input and ouput frames
    ADF::AgataFrameTrigger fTrigger;    //! Trigger for the input frame

    ULong64_t fFirstTS = 0;
    ULong64_t fLastTS = 0;

    UInt_t  fTraceLengthRaw;        // length of input  traces (taken from the data)
    UInt_t  fTraceLengthPSA;        // length of output traces

    // float version of the traces
    Float_t *fTracesSG[kNSG];
    Float_t *fTracesCC[kNCC];

    ADF::GeSegment *seg;
    ADF::GeCore    *core;

    Float_t SegE[kNSG];       // in keV
    Float_t CoreE[kNCC];      // in keV
    Float_t SegBase[kNSG];       // in keV
    Float_t CoreBase[kNCC];      // in keV
    Float_t CoreT[kNCC];      // in 10 ns (sample step)

private:
    bool fPlotAmpli = false;
    bool fPlotAmplivsId = false;
    bool fPlotBaseline = false;
    bool fPlotTimeStamps = false;

    Float_t fNextCycleSec;
    Float_t fNextCycleMin;
    Float_t fNextCycleH;

    binning_TH1 fAmpliBinning;
    binning_TH1 fBaselineBinning;

    binning_TH2 fAmplivsIdBinning;

    Float_t     fMinSegAmpli;         // minimum segment amplitude to detect segment multiplicity

    enum class HistLib: int { Ampli, Ampli_vs_Id, Baseline, TimeStamps };

public:
    PreproHist();
    virtual ~PreproHist();

    virtual UInt_t Process();
    virtual Int_t SetInput();             //! to init your local variables with the ones from the buffers

    virtual void process_initialise ( UInt_t *error_code );   //! Constructor implementation

public:
    virtual UInt_t GetParameters(const std::string& confFile, Bool_t doList=false) override;

private:
    virtual void InitSMZ(Int_t id) override;

};

}

#endif