QA classes splitted for the 3 subdetectors (P. Cerello and W. Ferrarese)
[u/mrichter/AliRoot.git] / ITS / AliITSHandleDaSSD.h
CommitLineData
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
19class TObjArray;
f67db810 20
21class 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);
a69c8ba0 52 virtual Bool_t CalculateNoise(AliITSModuleDaSSD *const module);
c4d90345 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();}
a69c8ba0 66 void DeleteCMAll() { if (fModules) for (Int_t i = 0; i < fNumberOfModules; i++) if (fModules[i]) fModules[i]->DeleteCM();}
67 void DeleteCM() { if (fModules) for (Int_t i = fModIndProcessed; i < fModIndRead; i++) if (fModules[i]) fModules[i]->DeleteCM();}
f67db810 68
69 static Int_t GetNumberOfSSDModulesConst() { return fgkNumberOfSSDModules; }
70
71 protected :
c4d90345 72 static const Int_t fgkNumberOfSSDModules ; // Number of SSD modules in ITS
73 static const Int_t fgkNumberOfSSDModulesPerDdl; // Number of SSD modules in ITS
74 static const Float_t fgkPedestalThresholdFactor; // Defalt value for fPedestalThresholdFactor
75 static const Float_t fgkCmThresholdFactor; // Defalt value for fCmThresholdFactor
f67db810 76
c4d90345 77 Char_t *fRawDataFileName; // Name of the file with raw data
f67db810 78 Int_t fNumberOfModules; // number of AliITSModuleDaSSD to allocate
c4d90345 79 AliITSModuleDaSSD **fModules; //[fNumberOfModules] array of pointer on AliITSModuleDaSSD objects (1698 SSD Modules)
80 Int_t fModIndProcessed; //! index of the last module in fModules array with processed data
81 Int_t fModIndRead; //! index of the last module in fModules array with adc data present (read)
82 Long_t fNumberOfEvents; // Number of physics or calibration events in raw data file fRawDataFileName
83
f67db810 84 UInt_t fLdcId; // LDC number, read from header
85 UInt_t fRunId; // Run number, read from header
86
c4d90345 87 Float_t fPedestalThresholdFactor; // configuration parameter: ThresholdFactor for pedestal calculation
88 Float_t fCmThresholdFactor; // configuration parameter: ThresholdFactor for CM calculation
89
f67db810 90 private :
f67db810 91 Bool_t SignalOutOfRange (const Short_t signal) const { return (signal >= AliITSChannelDaSSD::GetOverflowConst()); }
92
c4d90345 93 ClassDef(AliITSHandleDaSSD, 2)
f67db810 94
95};
96
97#endif