StRoot  1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SmdGains.h
1 // \class SmdGains
2 // \author Jan Balewski
3 
4 #ifndef SmdGains_h
5 #define SmdGains_h
6 /*******************************************************
7  * $Id: SmdGains.h,v 1.7 2009/12/03 22:35:03 ogrebeny Exp $
8  *******************************************************
9  This code should run only on histogram files,
10  not on events, JB
11  *
12  *******************************************************/
13 
14 #include "TObject.h"
15 #include "TFile.h"
16 class TObjArray ;
17 class TH1F;
18 class TF1;
19 class TCanvas;
20 class TGraphErrors;
21 
22 class StripG {
23  public:
24  int id;
25  float sl,esl; // slopes from expo fit to raw spectra
26  float mpv1,empv1; // Landau MPV from single strip energy deposit
27  float gc,egc; // final gain corrections
28  int sum1; // counts in raw spectrum for ADC range
29  int flag;// type of result
30 
31  StripG();
32  void clear();
33  void print();
34 };
35 
36 //==========================
37 //==========================
38 
39 class SmdGains :public TObject{
40  TCanvas *c1, *c2;
41  private:
42  enum {mxS=288,mxH=8};
43  TFile *fdIn;
44  TObjArray *HList; // output histo
45  TF1 *gnCorFn;
46 
47  int sectID;
48  char planeUV;
49  TString plCore;
50 
51  //........ cuts
52  int adcMin,adcMax,minSum;
53  float maxRelEr; // threshold to flag too large errors
54  float minMipEne, maxMipEne; // (MeV) lower/upper thres for Landau Ene fit
55  float idealMipEne;
56 
57  //......histos
58  TH1F *hA[mxH];
59  TGraphErrors * grA[mxH];
60 
61  //.... calib
62  StripG str[mxS];
63 
64  public:
65  SmdGains();
66  virtual ~SmdGains(){};
67  void set( TObjArray * hL, int se, char uv){ HList=hL; sectID=se, planeUV=uv;};
68  void plTGraph(const Char_t *shpFunc="pol1",int ig=1, int pl=0); // plot & fit tGraphs
69  void plFGC();
70 
71  void doGainCorr(int str1, int str2, int ns=20, int pl=0);
72 
73  void avrMipNEne(int str1,int ns); // sum MIP ene (from 2 strips) of ns strips
74 
75  TFile* open(TString);
76  void init();
77  void doSlopesOnly(float fac=1.);
78  void saveHisto(const Char_t *fname=0);
79  void saveGains(FILE *fd=0);
80 
81  void fitSlopesSmd(int str1, int str2, int pl=0);
82  void fitSlopesTile(int eta1, int nEta, char cT, int pl=0) ;
83 
84  ClassDef(SmdGains,1)
85 };
86 
87 #endif
88 
89 /*****************************************************************
90  * $Log: SmdGains.h,v $
91  * Revision 1.7 2009/12/03 22:35:03 ogrebeny
92  * Fixed compiler warnings, mostly char* -> const char*
93  *
94  * Revision 1.6 2007/07/12 19:27:20 fisyak
95  * Add includes for TMath for ROOT 5.16
96  *
97  * Revision 1.5 2005/08/09 18:46:31 balewski
98  * after smd calib in 2005
99  *
100  * Revision 1.4 2004/10/08 14:34:50 balewski
101  * as used for PQRUV calib for pp200, 2004
102  *
103  * Revision 1.3 2004/09/22 00:45:52 balewski
104  * ready for calib of smd
105  *
106  * Revision 1.2 2004/09/14 19:38:44 balewski
107  * new version, SMD calib is now too complicated
108  *
109  * Revision 1.1 2004/09/11 04:57:34 balewski
110  * cleanup
111  *
112  *
113  *
114  ********************************************************************/
115