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