]>
Commit | Line | Data |
---|---|---|
1 | #ifndef ALIITSHANDLEDASSD_H | |
2 | #define ALIITSHANDLEDASSD_H | |
3 | ||
4 | /* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. * | |
5 | * See cxx source for full Copyright notice */ | |
6 | /* */ | |
7 | /* $Id:$ */ | |
8 | ||
9 | #include "TObject.h" | |
10 | #include "AliITSModuleDaSSD.h" | |
11 | ||
12 | /////////////////////////////////////////////////////////////////////////////// | |
13 | /// | |
14 | /// This class provides ITS SSD data handling | |
15 | /// used by DA. | |
16 | // Author: Oleksandr Borysov | |
17 | // Date: 14/02/2008 | |
18 | /////////////////////////////////////////////////////////////////////////////// | |
19 | ||
20 | class TObjArray; | |
21 | ||
22 | class AliITSHandleDaSSD : public TObject { | |
23 | public : | |
24 | AliITSHandleDaSSD(); | |
25 | explicit AliITSHandleDaSSD(Char_t *rdfname); | |
26 | AliITSHandleDaSSD(const AliITSHandleDaSSD& ssdadldc); | |
27 | AliITSHandleDaSSD& operator = (const AliITSHandleDaSSD& ssdadldc); | |
28 | virtual ~AliITSHandleDaSSD(); | |
29 | ||
30 | virtual Bool_t Init(Char_t *rdfname, const Char_t *configfname = NULL); | |
31 | virtual Bool_t ReadConfigurationFile(const Char_t *configfname = NULL) const; | |
32 | Bool_t SetRawFileName (Char_t *rdfname) {return Init(rdfname); } | |
33 | ||
34 | Int_t GetNumberOfModules() const { return fNumberOfModules; } | |
35 | UInt_t GetLdcId() const { return fLdcId; } | |
36 | UInt_t GetRunId() const { return fRunId; } | |
37 | AliITSModuleDaSSD* GetModule (const UChar_t ddlID, const UChar_t ad, const UChar_t adc) const; | |
38 | AliITSModuleDaSSD* GetModule (const Int_t index) const | |
39 | {if ((fModules) && (index < fNumberOfModules)) return fModules[index]; else return NULL;} | |
40 | Int_t GetModuleIndex (const UChar_t ddlID, const UChar_t ad, const UChar_t adc) const; | |
41 | AliITSChannelDaSSD* GetStrip (const UChar_t ddlID, const UChar_t ad, const UChar_t adc, const UShort_t stripID) const; | |
42 | TObjArray* GetCalibrationSSDLDC() const; | |
43 | Bool_t SaveCalibrationSSDLDC(Char_t*& dafname) const; | |
44 | ||
45 | void SetModIndProcessed(Int_t mi) {fModIndProcessed = mi;} | |
46 | void SetModIndRead (Int_t mr) {fModIndRead = mr;} | |
47 | Bool_t SetNumberOfModules (const Int_t numberofmodules); | |
48 | Bool_t SetModule(AliITSModuleDaSSD *const module, const Int_t index); | |
49 | Bool_t ReadCalibrationDataFile (char* fileName, const Long_t eventsnumber); | |
50 | Int_t ReadModuleRawData (const Int_t modulesnumber); | |
51 | ||
52 | virtual Bool_t CalculatePedestal(AliITSModuleDaSSD *const module); | |
53 | virtual Bool_t CalculateNoise(AliITSModuleDaSSD *const module); | |
54 | virtual Bool_t CalculateNoiseCM(AliITSModuleDaSSD *const module); | |
55 | virtual Bool_t CalculateCM(AliITSModuleDaSSD *const module); | |
56 | virtual Bool_t ProcessRawData(const Int_t nmread = fgkNumberOfSSDModulesPerDdl); | |
57 | virtual Bool_t RelocateModules(); | |
58 | virtual Bool_t AllocateSimulatedModules(const Int_t copymodind = 0); | |
59 | ||
60 | virtual void Reset(); | |
61 | virtual Short_t RetrieveModuleId(const UChar_t ddlID, const UChar_t ad, const UChar_t adc) const; | |
62 | Bool_t DumpModInfo(const Float_t meannosethreshold) const; | |
63 | Bool_t PrintModCalibrationData(const UChar_t ddlID, const UChar_t ad, const UChar_t adc, const Char_t *fname = NULL) const; | |
64 | void DumpInitData(const Char_t *str = "") const; | |
65 | void DeleteSignalAll() { if (fModules) for (Int_t i = 0; i < fNumberOfModules; i++) if (fModules[i]) fModules[i]->DeleteSignal();} | |
66 | void DeleteSignal() { if (fModules) for (Int_t i = fModIndProcessed; i < fModIndRead; i++) if (fModules[i]) fModules[i]->DeleteSignal();} | |
67 | void DeleteCMAll() { if (fModules) for (Int_t i = 0; i < fNumberOfModules; i++) if (fModules[i]) fModules[i]->DeleteCM();} | |
68 | void DeleteCM() { if (fModules) for (Int_t i = fModIndProcessed; i < fModIndRead; i++) if (fModules[i]) fModules[i]->DeleteCM();} | |
69 | ||
70 | static Int_t GetNumberOfSSDModulesConst() { return fgkNumberOfSSDModules; } | |
71 | ||
72 | protected : | |
73 | static const Int_t fgkNumberOfSSDModules ; // Number of SSD modules in ITS | |
74 | static const Int_t fgkNumberOfSSDModulesPerDdl; // Number of SSD modules in DDL | |
75 | static const Int_t fgkNumberOfSSDModulesPerSlot; // Number of SSD modules in Slot | |
76 | static const Float_t fgkPedestalThresholdFactor; // Defalt value for fPedestalThresholdFactor | |
77 | static const Float_t fgkCmThresholdFactor; // Defalt value for fCmThresholdFactor | |
78 | ||
79 | Char_t *fRawDataFileName; // Name of the file with raw data | |
80 | Int_t fNumberOfModules; // number of AliITSModuleDaSSD to allocate | |
81 | AliITSModuleDaSSD **fModules; //[fNumberOfModules] array of pointer on AliITSModuleDaSSD objects (1698 SSD Modules) | |
82 | Int_t fModIndProcessed; //! index of the last module in fModules array with processed data | |
83 | Int_t fModIndRead; //! index of the last module in fModules array with adc data present (read) | |
84 | Int_t *fModIndex; //! index array for fModules | |
85 | Long_t fNumberOfEvents; // Number of physics or calibration events in raw data file fRawDataFileName | |
86 | ||
87 | UInt_t fLdcId; // LDC number, read from header | |
88 | UInt_t fRunId; // Run number, read from header | |
89 | ||
90 | Float_t fPedestalThresholdFactor; // configuration parameter: ThresholdFactor for pedestal calculation | |
91 | Float_t fCmThresholdFactor; // configuration parameter: ThresholdFactor for CM calculation | |
92 | ||
93 | private : | |
94 | Bool_t SignalOutOfRange (const Short_t signal) const { return (signal >= AliITSChannelDaSSD::GetOverflowConst()); } | |
95 | ||
96 | ClassDef(AliITSHandleDaSSD, 3) | |
97 | ||
98 | }; | |
99 | ||
100 | #endif |