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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (hide annotations) (download)
Thu Oct 25 13:24:18 2007 UTC (17 years, 1 month ago) by mocchiut
Branch: MAIN
Changes since 1.3: +9 -6 lines
File MIME type: text/plain
Calorimeter crosstalk code changed in order to use flight calibrations

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

  ViewVC Help
Powered by ViewVC 1.1.23