ROOT logo
#ifndef HMDCGAREFFMAKER_H
#define HMDCGAREFFMAKER_H
#include "TNamed.h"
#include "TObject.h"
#include "TH1.h"

class TFile;
class TDirectory;
class TH1D;
class TString;

class HMdcGarEffMaker : public TNamed {
protected:

    FILE*    outputAscii;        //! file pointer to output
    TString  fNameAsciiOut;      //! file name ascii out
    TFile*   inputRoot;          //! root file pointer
    TString  fNameRootIn;        //! file name root un file pointer
    TFile*   outputRoot;         //! root file pointer
    TString  fNameRootOut;       //! file name root un file pointer

    Float_t  minSignal[4];       //! minimum charge per mdc type
    static Int_t colors[10];     //! colors of hists
    Int_t    nSamples;           //! number of sample points per angle
    Int_t    nSteps;             //! number of threshold steps
    TH1D*    heff_time1;         //! [mdc][angle]collected charge as function of distance to wire
    TH1D*    heff_max;           //! [mdc] maximum collected charge as function of angle
    TH1D*    heff_max_distance;  //! [mdc] distance of maximum charge as function of angle
    TH1D*    heff_cut[10];       //! [step][mdc] maximum distance for a given threshold charge as function of angle
    TH1D*    heff_cut_trend;     //! [mdc][angle] distance as function of threshold charge per angle
    Double_t fitpars[4][18][2];  //! fitparameters for hists
    Int_t version;               //! old/new format
    void    initVariables ();
    void    createHists   (Int_t,Int_t,Int_t);
    void    writeHists    (Int_t);
    void    deleteHists   (Int_t);
    TH1F*   getHist       (TFile*,TString);
    void    fillEffHist   (Int_t,Int_t);
    void    fillCutHist   (Int_t,Int_t);
    void    fillMaxHists  (Int_t);
    void    fillTrendHists(Int_t);
    void    fitTrendHists (Int_t,Int_t);
    void    readInput     ();
    void    writeAscii    ();
    void    resetParams   ()
    {
	for(Int_t mdc=0;mdc<4;mdc++){
	    for(Int_t angle=0;angle<18;angle++){
		for(Int_t pars=0;pars<2;pars++){
                 fitpars[mdc][angle][pars]=0;
		}
	    }
	}
    }
public:
    HMdcGarEffMaker(const Char_t* name="",const Char_t* title="");
    ~HMdcGarEffMaker  ();
    void    setFileNameRootOut (TString);
    void    setFileNameAsciiOut(TString);
    void    setFileNameRootIn  (TString);
    void    setMinSignal  (Float_t i,Float_t j,Float_t k,Float_t l)
    {
	minSignal[0]=i;
	minSignal[1]=j;
	minSignal[2]=k;
	minSignal[3]=l;
    }
    Float_t getMinSignal  (Int_t i) {return minSignal[i];}
    void    setVersion(Int_t vers)  {version=vers;}
    Int_t   getVersion()            {return version;}
    void    setNSamples(Int_t i)    {nSamples=i;}
    Int_t   getNSamples()           {return nSamples;}
    void    setNSteps(Int_t i)      {nSteps=i;}
    Int_t   getNSteps()             {return nSteps;}
    void    printStatus   (void);
    void    make          ();
    ClassDef(HMdcGarEffMaker,1) // Class for producing the MDC Cal2 parameters
};
#endif  /*!HMDCGAREFFMAKER_H*/
 hmdcgareffmaker.h:1
 hmdcgareffmaker.h:2
 hmdcgareffmaker.h:3
 hmdcgareffmaker.h:4
 hmdcgareffmaker.h:5
 hmdcgareffmaker.h:6
 hmdcgareffmaker.h:7
 hmdcgareffmaker.h:8
 hmdcgareffmaker.h:9
 hmdcgareffmaker.h:10
 hmdcgareffmaker.h:11
 hmdcgareffmaker.h:12
 hmdcgareffmaker.h:13
 hmdcgareffmaker.h:14
 hmdcgareffmaker.h:15
 hmdcgareffmaker.h:16
 hmdcgareffmaker.h:17
 hmdcgareffmaker.h:18
 hmdcgareffmaker.h:19
 hmdcgareffmaker.h:20
 hmdcgareffmaker.h:21
 hmdcgareffmaker.h:22
 hmdcgareffmaker.h:23
 hmdcgareffmaker.h:24
 hmdcgareffmaker.h:25
 hmdcgareffmaker.h:26
 hmdcgareffmaker.h:27
 hmdcgareffmaker.h:28
 hmdcgareffmaker.h:29
 hmdcgareffmaker.h:30
 hmdcgareffmaker.h:31
 hmdcgareffmaker.h:32
 hmdcgareffmaker.h:33
 hmdcgareffmaker.h:34
 hmdcgareffmaker.h:35
 hmdcgareffmaker.h:36
 hmdcgareffmaker.h:37
 hmdcgareffmaker.h:38
 hmdcgareffmaker.h:39
 hmdcgareffmaker.h:40
 hmdcgareffmaker.h:41
 hmdcgareffmaker.h:42
 hmdcgareffmaker.h:43
 hmdcgareffmaker.h:44
 hmdcgareffmaker.h:45
 hmdcgareffmaker.h:46
 hmdcgareffmaker.h:47
 hmdcgareffmaker.h:48
 hmdcgareffmaker.h:49
 hmdcgareffmaker.h:50
 hmdcgareffmaker.h:51
 hmdcgareffmaker.h:52
 hmdcgareffmaker.h:53
 hmdcgareffmaker.h:54
 hmdcgareffmaker.h:55
 hmdcgareffmaker.h:56
 hmdcgareffmaker.h:57
 hmdcgareffmaker.h:58
 hmdcgareffmaker.h:59
 hmdcgareffmaker.h:60
 hmdcgareffmaker.h:61
 hmdcgareffmaker.h:62
 hmdcgareffmaker.h:63
 hmdcgareffmaker.h:64
 hmdcgareffmaker.h:65
 hmdcgareffmaker.h:66
 hmdcgareffmaker.h:67
 hmdcgareffmaker.h:68
 hmdcgareffmaker.h:69
 hmdcgareffmaker.h:70
 hmdcgareffmaker.h:71
 hmdcgareffmaker.h:72
 hmdcgareffmaker.h:73
 hmdcgareffmaker.h:74
 hmdcgareffmaker.h:75
 hmdcgareffmaker.h:76
 hmdcgareffmaker.h:77
 hmdcgareffmaker.h:78
 hmdcgareffmaker.h:79