/[PAMELA software]/tof/flight/ToFPatch/inc/ToFPatch.h
ViewVC logotype

Annotation of /tof/flight/ToFPatch/inc/ToFPatch.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (hide annotations) (download)
Thu Aug 30 17:11:33 2018 UTC (6 years, 3 months ago) by mayorov
Branch: MAIN
CVS Tags: v10REDr01, HEAD
File MIME type: text/plain
ToF patch from Wolfgang. Duplicates the simple method of the 8th reduction to calculate the ToF dEdx

1 mayorov 1.1
2    
3     /**
4     * \file ToFPatch.h
5     * \authors Wolfgang Menn
6     */
7     #ifndef tofpatch_h
8     #define tofpatch_h
9    
10     #include <PamLevel2.h>
11    
12     #include <TTree.h>
13     #include <TFriendElement.h>
14     #include <TChain.h>
15     #include <TFile.h>
16     #include <TList.h>
17     #include <TKey.h>
18     #include <TSystemFile.h>
19     #include <TSystemDirectory.h>
20     #include <TSQLServer.h>
21    
22     #include <iostream>
23    
24     using namespace std;
25    
26    
27     /**
28     *
29     * Class to store and calculate variables
30     */
31     class ToFPatch : public TObject { //class definition
32    
33     private:
34     //
35     PamLevel2 *L2;
36     Int_t eNtr; // number of tracker tracks
37     const char* trkAlg;
38     //
39    
40     UInt_t OBT;
41     UInt_t PKT;
42     UInt_t atime;
43    
44     Int_t tr;
45    
46     Float_t adc_he;
47    
48     // Trk dependent values
49     TArrayF eDEDXpmt; // 0-47 pmt dEdx
50     TArrayF eDEDXpmtraw; // 0-47 pmt dEdx before 2nd corr
51     TArrayF eDEDXpad; // 0-23 paddle dEdx
52     TArrayF eDEDXlayer; // 0-5 layer dEdx
53    
54     TArrayF INFOpmt; // 0-47 pmt status
55     TArrayF INFOlayer; //0-5 layer status
56    
57     // ToF standalone values
58     TArrayF eDEDXpmtstd; // 0-47 pmt dEdx
59     TArrayF eDEDXpmtrawstd; // 0-47 pmt dEdx before 2nd corr To
60     TArrayF eDEDXpadstd; // 0-23 paddle dEdx
61     TArrayF eDEDXlayerstd; // 0-5 layer dEdx
62    
63     TArrayF INFOpmtstd; // 0-47 pmt status
64     TArrayF INFOlayerstd; //0-5 layer status
65    
66     // parameters:
67     TArrayF PMTsat; // 0-47 saturation parameters
68    
69    
70     TArrayF A0_array[100]; // 48 x 100 define an array of 48 elements per each time interval
71     TArrayF A1_array[100];
72     TArrayF A2_array[100];
73     TArrayF A3_array[100];
74    
75     Float_t A0[48];
76     Float_t A1[48];
77     Float_t A2[48];
78     Float_t A3[48];
79    
80     UInt_t T_int_min[100];
81     UInt_t T_int_max[100];
82     UInt_t tmin_atten,tmax_atten;
83     Int_t ical_atten;
84    
85     TArrayF dedx_corr_m[1500]; // 48 x 1500 define an array of 48 elements per each time interval
86    
87     UInt_t mtime[2000];
88     Int_t ical_2nd;
89     UInt_t tmin_2nd,tmax_2nd;
90    
91    
92     public:
93     ToFPatch() {Clear();} // class constructor
94     ~ToFPatch(){ Delete(); }; // class distructor
95     //
96     void Clear(Option_t *option="");
97     void Delete(Option_t *option="") { Clear(); }
98    
99     void InitPar(const char *pardir, const char *param); // init parameters
100     void Define_PMTsat();
101    
102     void ReadParAtt(const char *pardir, const char *param);
103    
104    
105    
106    
107     // void Process( PamLevel2 *l2p, Int_t itr=0 ); ///< Process data for track number itr
108     void Process( PamLevel2 *l2p, const char* alg ); ///< Process data 10th red
109     void Print(Option_t *option="");
110     // track dependent results
111     Float_t GetdEdxraw_pmt(Int_t ipmt) { return eDEDXpmtraw[ipmt]; } // 0-47 dEdx for each PMT for tracked events before 2nd order corr
112     Float_t GetdEdx_pmt(Int_t ipmt) { return eDEDXpmt[ipmt]; } // 0-47 dEdx for each PMT for tracked events
113     Float_t GetdEdx_pad(Int_t ipad) {return eDEDXpad[ipad];} // 0-23 dEdx for each paddle for tracked events (no request of consistency between PMT's response when both on!)
114     Float_t GetdEdx_layer(Int_t ilay) {return eDEDXlayer[ilay];} // 0-5 dEdx for each layer for tracked events
115     // ToF standalone results
116     Float_t GetdEdxraw_pmtstd(Int_t ipmt) { return eDEDXpmtrawstd[ipmt]; } // 0-47 dEdx for each PMT for tracked events before 2nd order corr
117     Float_t GetdEdx_pmtstd(Int_t ipmt) { return eDEDXpmtstd[ipmt]; } // 0-47 dEdx for each PMT for tracked events
118     Float_t GetdEdx_padstd(Int_t ipad) {return eDEDXpadstd[ipad];} // 0-23 dEdx for each paddle for tracked events (no request of consistency between PMT's response when both on!)
119     Float_t GetdEdx_layerstd(Int_t ilay) {return eDEDXlayerstd[ilay];} // 0-5 dEdx for each layer for tracked events
120    
121     Float_t GetInfo_pmt(Int_t ipmt) {return INFOpmt[ipmt];} // 0-47 pmt status
122    
123     /* INFOpmt table:
124    
125     INFOpmt[ii]=0 ---> everything is ok!
126     INFOpmt[ii]=1 ---> beta not good (<0.05 || >2)
127     INFOpmt[ii]=2 ---> PMT OFF
128     INFOpmt[ii]=3 ---> PMT saturated
129     INFOpmt[ii]=4 ---> error during the correction for the incidence angle
130     INFOpmt[ii]=5 ---> error during the correction for the dependence on the position
131     INFOpmt[ii]=6 ---> error in dEdx reconstruction
132     INFOpmt[ii]=7 ---> error in Z reconstruction
133     */
134    
135     Float_t GetInfo_layer(Int_t ilay) {return INFOlayer[ilay];} // 0-5 layer status
136    
137     /* INFOlayer table:
138    
139     INFOlayer[ii]=0 ---> everithing is ok!
140     INFOlayer[ii]=1 ---> beta not good (<0.05 || >2)
141     INFOlayer[ii]=2 ---> only one PMT is OFF (but you get the other one to have the measurement)
142     INFOlayer[ii]=3 ---> only one PMT is saturated (but you get the other one to have the measurement)
143     INFOlayer[ii]=4 ---> only one PMT with a wrong reconstruction (but you get the other one to have the measurement)
144     INFOlayer[ii]=5 ---> the 2 PMTs involved give different measurement (actually they differ for more then 1.5, to be tuned...)
145     INFOlayer[ii]=6 ---> saturated layer (both PMTs)
146     INFOlayer[ii]=7 ---> all PMTs show some error during reconstruction
147     INFOlayer[ii]=8 ---> 1 PMT is OFF and 1 is saturated (it happens quiet only on S115...)
148     INFOlayer[ii]=9 ---> OFF layer
149     */
150    
151     private:
152     double f_adcPC( float x );
153     double atten(float C0, float C1, float C2, float C3, float x ) ;
154    
155    
156     ClassDef(ToFPatch,1);
157     };
158    
159     #endif
160    

  ViewVC Help
Powered by ViewVC 1.1.23