/[PAMELA software]/DarthVader/CalorimeterLevel2/inc/CaloProcessing.h
ViewVC logotype

Contents of /DarthVader/CalorimeterLevel2/inc/CaloProcessing.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (show annotations) (download)
Tue Nov 14 14:08:49 2006 UTC (18 years ago) by mocchiut
Branch: MAIN
Changes since 1.3: +11 -7 lines
File MIME type: text/plain
Major calorimeter release, some news in DarthVader main

1 /**
2 * \file inc/CaloProcessing.h
3 * \author Emiliano Mocchiutti
4 **/
5 #ifndef CaloProcessing_h
6 #define CaloProcessing_h
7 #include <TObject.h>
8 #include <TROOT.h>
9 //
10 // YODA headers
11 //
12 #include <PamelaRun.h>
13 #include <physics/calorimeter/CalorimeterEvent.h>
14 #include <CalibCalPedEvent.h>
15 //
16 #include <CaloCore.h>
17 #include <CaloLevel2.h>
18
19 /**
20 * \brief Class needed to calibrate calorimeter data.
21 *
22 * Calibrates data and connects to fortran routines using structures.
23 *
24 **/
25 class CaloProcessing : public TObject {
26
27 private:
28 Bool_t debug; ///< debugging flag
29 Bool_t verbose; ///< verbose flag
30 //
31 // variables in which it is stored the calibration information for the four sections
32 //
33 UInt_t idcalib[4]; ///< ID of root file containing calibrations (one per section)
34 UInt_t fromtime[4]; ///< lower validity time limit
35 UInt_t totime[4]; ///< upper validity time limit
36 Int_t calibno[4]; ///< entry of the file
37 TString fcalname[4]; ///< filename of calibrations
38 //
39 // variables needed to open level0 files
40 //
41 TTree *l0tr; ///< level0 tree
42 TBranch *l0calo; ///< level0 calorimeter branch
43 pamela::calorimeter::CalorimeterEvent *de; ///< level0 calorimeter object
44 //
45 //
46 // variables from the calorimeter online calibration
47 //
48 Float_t calped[2][22][96]; ///< pedestals
49 Float_t calgood[2][22][96]; ///< used or not in the common noise calculation
50 Float_t calthr[2][22][6]; ///< thresholds
51 Float_t calrms[2][22][96]; ///< rms
52 Float_t calbase[2][22][6]; ///< baselines (common noise) during calibration
53 Float_t calvar[2][22][6]; ///< variance
54 Float_t cstwerr[4]; ///< status word
55 Float_t cperror[4]; ///< unpacking error flag
56 //
57 // variables needed to calibrate the calorimeter event by event basis
58 //
59 Float_t dexy[2][22][96]; ///< compressed ADC data
60 Float_t dexyc[2][22][96]; ///< RAW ADC data
61 Float_t base[2][22][6]; ///< baselines for this event
62 Float_t sbase[2][22][6]; ///< saved baselines from previous events
63 //
64 // Energy vector
65 //
66 Int_t istrip; ///< number of strip above threshold
67 Int_t svstrip[4224]; ///< saved calibrated energy
68 //
69 // Variables needed to handle parameters files
70 //
71 Bool_t calopar1; ///< boolean, is true if parameter set number 101 has already been loaded
72 Bool_t calopar2; ///< boolean, is true if parameter set number 102 has already been loaded
73 Bool_t calopar3; ///< boolean, is true if parameter set number 103 has already been loaded
74 UInt_t ftcalopar1; ///< parameter set 101 lower limit validity
75 UInt_t ttcalopar1; ///< parameter set 101 upper limit validity
76 UInt_t ftcalopar2; ///< parameter set 102 lower limit validity
77 UInt_t ttcalopar2; ///< parameter set 102 upper limit validity
78 UInt_t ftcalopar3; ///< parameter set 103 lower limit validity
79 UInt_t ttcalopar3; ///< parameter set 103 upper limit validity
80 //
81 // private methods
82 //
83 /**
84 * \param s calorimeter section.
85 **/
86 void ClearCalibVals(Int_t s); ///< clear calibration values for section s
87 void ClearCommonVar(); ///< clear common variables
88 void ClearTrkVar(); ///< clear track-related variables
89 void FindBaseRaw(Int_t l, Int_t m, Int_t pre); ///< calculate baselines starting from RAW data
90 Int_t Update(TSQLServer *dbc, UInt_t atime, Int_t s); ///< update calibration for this event
91 Int_t LoadCalib(Int_t s); ///< load calibrations
92
93 public:
94 //
95 // ADC to MIP conversion values
96 //
97 Float_t mip[2][22][96]; ///< ADC to MIP conversion values
98 Int_t obadmask[2][22][96]; ///< Offline mask of bad strips (not used to calculate baselines and calorimeter variables)
99 Float_t emin; ///< Offline threshold to separate noise from signal
100 //
101 // Structures to pass data from/to F77
102 //
103 struct FlCaLevel1 *clevel1; ///< input structure
104 struct FlCaLevel2 *clevel2; ///< output structure
105 //
106 //
107 //
108 Int_t trkseqno; ///< tracker track sequential number (-1 if calorimeter selftrigger)
109 //
110 // useful methods
111 //
112 Int_t ChkParam(TSQLServer *dbc, UInt_t runheader); ///< check and load parameters data
113 Int_t ChkCalib(TSQLServer *dbc, UInt_t atime); ///< check and load calibration data
114 Int_t Calibrate(Int_t ei); ///< perform data calibration
115 void GetCommonVar(); ///< call fortran common variables program
116 void GetTrkVar(); ///< call fortran track-related variables program
117 void ClearStructs(); ///< clear input and output structures
118 void FillCommonVar(CaloLevel2 *ca); ///< copy common variables from structure to class
119 void FillTrkVar(CaloLevel2 *ca, Int_t nutrk); ///< copy track-related variables from structure to class
120 void RunClose(); ///< clear variables which could change from one run to another
121 //
122 // constructor
123 //
124 CaloProcessing(); ///< contructor
125 void ProcessingInit(TSQLServer *dbc, UInt_t hs, Int_t &sgnl, TTree *l0tree, Bool_t debug, Bool_t verbose); ///< initialize caloprocessing object
126 //
127 // virtual destructor
128 //
129 virtual ~CaloProcessing();///< virtual destructor
130 //
131 };
132
133 #endif

  ViewVC Help
Powered by ViewVC 1.1.23