ROOT logo
#ifndef HMDCCELLEFF_H
#define HMDCCELLEFF_H

#include "TObject.h"
#include "TObjArray.h"
#include "hparset.h"
#include "TString.h"

class HMdcDetector;

class HMdcCellEffAngle : public TObject {
protected:
    Float_t maxR;  // maximum distance from sense wire
    Float_t slope; // loss of charge per percent of required maximum signal
public:

    HMdcCellEffAngle() { clear(); }
    ~HMdcCellEffAngle() {;}
    void setFunctionValues(Float_t r, Float_t s){maxR=r;slope=s;}
    Float_t  getMaxR(void) {return maxR;}
    Float_t  getSlope(void){return slope;}
    void fill(HMdcCellEffAngle &r)
    {
	maxR=r.maxR;
	slope=r.slope;
    }
    void clear() {
	maxR=0;
        slope=0;
    }
    void print(void) {
	printf("maxR: %7.5f, slope: %7.5f\n",
	   maxR,slope);
    }
    ClassDef(HMdcCellEffAngle,1) // Angle level of the MDC cell efficiency parameters
};

class HMdcCellEffMod : public TObject {
protected:
    TObjArray *array;   // array of pointers of type HMdcCellEffAngle
public:
    HMdcCellEffMod(Int_t sec = 0, Int_t mod = 0 , Int_t angle = 18);
    ~HMdcCellEffMod();
    HMdcCellEffAngle& operator[](Int_t i) {
      return *static_cast<HMdcCellEffAngle*>((*array)[i]);
    }
    Int_t getSize() {return array->GetEntries();}
    ClassDef(HMdcCellEffMod,1) // Module level of the MDC calibration parameters
};

class HMdcCellEff : public HParSet {
protected:
    TObjArray* array;      // array of pointers of type HMdcCellEffSec
    HMdcDetector *fMdc;
    TString comment;
public:
    HMdcCellEff(const Char_t* name="MdcCellEff",
                const Char_t* title="cell efficiency parameters for MdcDigitizer",
                const Char_t* context="MdcCellEffProduction",
                Int_t n=4);
    ~HMdcCellEff();
    HMdcCellEffMod& operator[](Int_t i) {
        return *static_cast<HMdcCellEffMod*>((*array)[i]);
    }
    void setContainerComment(TString mycomment){comment=mycomment;}
    TString getContainerComment(){return comment;}
    void printContainerComment(){printf("%s\n",comment.Data());}
    Int_t getSize() {return array->GetEntries();}
    Bool_t init(HParIo*, Int_t*);
    Int_t write(HParIo*);
    void readline(const Char_t*, Int_t*);
    void putAsciiHeader(TString&);
    Bool_t writeline(Char_t*,Int_t, Int_t);
    Int_t calcEfficiency(Int_t m, Float_t r, Float_t a, Float_t l);
    Float_t calcEffval(Int_t m, Float_t r, Float_t a, Float_t l);

    void clear();

    void printParam(void) {
	printf ("HMdcCellEff:\n");
	for (Int_t i=0;i<getSize();i++) {
	    HMdcCellEffMod &mod = (*this)[i];
	    for (Int_t a=0; a<mod.getSize(); a++) {
		HMdcCellEffAngle &angle = mod[a];
		printf("%i %2i  ",i,a);
		angle.print();
	    }
	}
    }

    ClassDef(HMdcCellEff,1) // Container for the MDC cell efficiency parameters
};

#endif  /*!HMDCCELLEFF_H*/

 hmdccelleff.h:1
 hmdccelleff.h:2
 hmdccelleff.h:3
 hmdccelleff.h:4
 hmdccelleff.h:5
 hmdccelleff.h:6
 hmdccelleff.h:7
 hmdccelleff.h:8
 hmdccelleff.h:9
 hmdccelleff.h:10
 hmdccelleff.h:11
 hmdccelleff.h:12
 hmdccelleff.h:13
 hmdccelleff.h:14
 hmdccelleff.h:15
 hmdccelleff.h:16
 hmdccelleff.h:17
 hmdccelleff.h:18
 hmdccelleff.h:19
 hmdccelleff.h:20
 hmdccelleff.h:21
 hmdccelleff.h:22
 hmdccelleff.h:23
 hmdccelleff.h:24
 hmdccelleff.h:25
 hmdccelleff.h:26
 hmdccelleff.h:27
 hmdccelleff.h:28
 hmdccelleff.h:29
 hmdccelleff.h:30
 hmdccelleff.h:31
 hmdccelleff.h:32
 hmdccelleff.h:33
 hmdccelleff.h:34
 hmdccelleff.h:35
 hmdccelleff.h:36
 hmdccelleff.h:37
 hmdccelleff.h:38
 hmdccelleff.h:39
 hmdccelleff.h:40
 hmdccelleff.h:41
 hmdccelleff.h:42
 hmdccelleff.h:43
 hmdccelleff.h:44
 hmdccelleff.h:45
 hmdccelleff.h:46
 hmdccelleff.h:47
 hmdccelleff.h:48
 hmdccelleff.h:49
 hmdccelleff.h:50
 hmdccelleff.h:51
 hmdccelleff.h:52
 hmdccelleff.h:53
 hmdccelleff.h:54
 hmdccelleff.h:55
 hmdccelleff.h:56
 hmdccelleff.h:57
 hmdccelleff.h:58
 hmdccelleff.h:59
 hmdccelleff.h:60
 hmdccelleff.h:61
 hmdccelleff.h:62
 hmdccelleff.h:63
 hmdccelleff.h:64
 hmdccelleff.h:65
 hmdccelleff.h:66
 hmdccelleff.h:67
 hmdccelleff.h:68
 hmdccelleff.h:69
 hmdccelleff.h:70
 hmdccelleff.h:71
 hmdccelleff.h:72
 hmdccelleff.h:73
 hmdccelleff.h:74
 hmdccelleff.h:75
 hmdccelleff.h:76
 hmdccelleff.h:77
 hmdccelleff.h:78
 hmdccelleff.h:79
 hmdccelleff.h:80
 hmdccelleff.h:81
 hmdccelleff.h:82
 hmdccelleff.h:83
 hmdccelleff.h:84
 hmdccelleff.h:85
 hmdccelleff.h:86
 hmdccelleff.h:87
 hmdccelleff.h:88
 hmdccelleff.h:89
 hmdccelleff.h:90
 hmdccelleff.h:91
 hmdccelleff.h:92
 hmdccelleff.h:93
 hmdccelleff.h:94
 hmdccelleff.h:95