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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (hide annotations) (download)
Wed Sep 6 11:03:29 2006 UTC (18 years, 2 months ago) by mocchiut
Branch: MAIN
CVS Tags: v2r00BETA
Changes since 1.2: +12 -13 lines
File MIME type: text/plain
Adapted to the new profiler

1 mocchiut 1.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 mocchiut 1.3 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 mocchiut 1.1 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     Float_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 1 has already been loaded
72     Bool_t calopar2; ///< boolean, is true if parameter set number 2 has already been loaded
73 mocchiut 1.3 UInt_t ftcalopar1; ///< parameter set 1 lower limit validity
74     UInt_t ttcalopar1; ///< parameter set 1 upper limit validity
75     UInt_t ftcalopar2; ///< parameter set 2 lower limit validity
76     UInt_t ttcalopar2; ///< parameter set 2 upper limit validity
77 mocchiut 1.1 //
78     // private methods
79     //
80     /**
81     * \param s calorimeter section.
82     **/
83     void ClearCalibVals(Int_t s); ///< clear calibration values for section s
84     void ClearCommonVar(); ///< clear common variables
85     void ClearTrkVar(); ///< clear track-related variables
86     void FindBaseRaw(Int_t l, Int_t m, Int_t pre); ///< calculate baselines starting from RAW data
87 mocchiut 1.3 Int_t Update(TSQLServer *dbc, UInt_t atime, Int_t s); ///< update calibration for this event
88 mocchiut 1.1 Int_t LoadCalib(Int_t s); ///< load calibrations
89    
90     public:
91     //
92     // ADC to MIP conversion values
93     //
94     Float_t mip[2][22][96]; ///< ADC to MIP conversion values
95     Float_t emin; ///< Offline threshold to separate noise from signal
96     //
97     // Structures to pass data from/to F77
98     //
99     struct FlCaLevel1 *clevel1; ///< input structure
100     struct FlCaLevel2 *clevel2; ///< output structure
101     //
102     //
103     //
104     Int_t trkseqno; ///< tracker track sequential number (-1 if calorimeter selftrigger)
105     //
106     // useful methods
107     //
108 mocchiut 1.3 Int_t ChkParam(TSQLServer *dbc, UInt_t runheader); ///< check and load parameters data
109     Int_t ChkCalib(TSQLServer *dbc, UInt_t atime); ///< check and load calibration data
110 mocchiut 1.1 Int_t Calibrate(Int_t ei); ///< perform data calibration
111     void GetCommonVar(); ///< call fortran common variables program
112     void GetTrkVar(); ///< call fortran track-related variables program
113     void ClearStructs(); ///< clear input and output structures
114     void FillCommonVar(CaloLevel2 *ca); ///< copy common variables from structure to class
115     void FillTrkVar(CaloLevel2 *ca, Int_t nutrk); ///< copy track-related variables from structure to class
116     void RunClose(); ///< clear variables which could change from one run to another
117     //
118     // constructor
119     //
120     CaloProcessing(); ///< contructor
121 mocchiut 1.3 void ProcessingInit(TSQLServer *dbc, UInt_t hs, Int_t &sgnl, TTree *l0tree, Bool_t debug, Bool_t verbose); ///< initialize caloprocessing object
122 mocchiut 1.1 //
123     // virtual destructor
124     //
125 mocchiut 1.3 virtual ~CaloProcessing();///< virtual destructor
126 mocchiut 1.1 //
127     };
128    
129     #endif

  ViewVC Help
Powered by ViewVC 1.1.23