increase array size to avoid seg faults in testbeam reconstruction
[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/* */
371588bb 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.
2e2c6def 16// Author: Oleksandr Borysov
371588bb 17// Date: 20/04/2008
223dda26 18///////////////////////////////////////////////////////////////////////////////
19
20class TObjArray;
f67db810 21
22class AliITSHandleDaSSD : public TObject {
23 public :
24 AliITSHandleDaSSD();
c4d90345 25 explicit AliITSHandleDaSSD(Char_t *rdfname);
f67db810 26 AliITSHandleDaSSD(const AliITSHandleDaSSD& ssdadldc);
27 AliITSHandleDaSSD& operator = (const AliITSHandleDaSSD& ssdadldc);
28 virtual ~AliITSHandleDaSSD();
29
c4d90345 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); }
f67db810 33
c4d90345 34 Int_t GetNumberOfModules() const { return fNumberOfModules; }
35 UInt_t GetLdcId() const { return fLdcId; }
36 UInt_t GetRunId() const { return fRunId; }
f67db810 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;}
c4d90345 40 Int_t GetModuleIndex (const UChar_t ddlID, const UChar_t ad, const UChar_t adc) const;
f67db810 41 AliITSChannelDaSSD* GetStrip (const UChar_t ddlID, const UChar_t ad, const UChar_t adc, const UShort_t stripID) const;
42 TObjArray* GetCalibrationSSDLDC() const;
c4d90345 43 Bool_t SaveCalibrationSSDLDC(Char_t*& dafname) const;
f67db810 44
c4d90345 45 void SetModIndProcessed(Int_t mi) {fModIndProcessed = mi;}
46 void SetModIndRead (Int_t mr) {fModIndRead = mr;}
f67db810 47 Bool_t SetNumberOfModules (const Int_t numberofmodules);
48 Bool_t SetModule(AliITSModuleDaSSD *const module, const Int_t index);
371588bb 49 Int_t ReadCalibrationDataFile (char* fileName, const Long_t eventsnumber);
c4d90345 50 Int_t ReadModuleRawData (const Int_t modulesnumber);
51
52 virtual Bool_t CalculatePedestal(AliITSModuleDaSSD *const module);
a69c8ba0 53 virtual Bool_t CalculateNoise(AliITSModuleDaSSD *const module);
c4d90345 54 virtual Bool_t CalculateNoiseCM(AliITSModuleDaSSD *const module);
55 virtual Bool_t CalculateCM(AliITSModuleDaSSD *const module);
371588bb 56 virtual Bool_t AddFeromCm(AliITSModuleDaSSD *const module);
c4d90345 57 virtual Bool_t ProcessRawData(const Int_t nmread = fgkNumberOfSSDModulesPerDdl);
58 virtual Bool_t RelocateModules();
59 virtual Bool_t AllocateSimulatedModules(const Int_t copymodind = 0);
60
61 virtual void Reset();
62 virtual Short_t RetrieveModuleId(const UChar_t ddlID, const UChar_t ad, const UChar_t adc) const;
63 Bool_t DumpModInfo(const Float_t meannosethreshold) const;
64 Bool_t PrintModCalibrationData(const UChar_t ddlID, const UChar_t ad, const UChar_t adc, const Char_t *fname = NULL) const;
65 void DumpInitData(const Char_t *str = "") const;
66 void DeleteSignalAll() { if (fModules) for (Int_t i = 0; i < fNumberOfModules; i++) if (fModules[i]) fModules[i]->DeleteSignal();}
67 void DeleteSignal() { if (fModules) for (Int_t i = fModIndProcessed; i < fModIndRead; i++) if (fModules[i]) fModules[i]->DeleteSignal();}
a69c8ba0 68 void DeleteCMAll() { if (fModules) for (Int_t i = 0; i < fNumberOfModules; i++) if (fModules[i]) fModules[i]->DeleteCM();}
69 void DeleteCM() { if (fModules) for (Int_t i = fModIndProcessed; i < fModIndRead; i++) if (fModules[i]) fModules[i]->DeleteCM();}
371588bb 70 void DeleteCMFerom() { if (fModules) for (Int_t i = fModIndProcessed; i < fModIndRead; i++) if (fModules[i]) fModules[i]->DeleteCMFerom ();}
f67db810 71
72 static Int_t GetNumberOfSSDModulesConst() { return fgkNumberOfSSDModules; }
73
74 protected :
c4d90345 75 static const Int_t fgkNumberOfSSDModules ; // Number of SSD modules in ITS
2e2c6def 76 static const Int_t fgkNumberOfSSDModulesPerDdl; // Number of SSD modules in DDL
77 static const Int_t fgkNumberOfSSDModulesPerSlot; // Number of SSD modules in Slot
c4d90345 78 static const Float_t fgkPedestalThresholdFactor; // Defalt value for fPedestalThresholdFactor
79 static const Float_t fgkCmThresholdFactor; // Defalt value for fCmThresholdFactor
f67db810 80
c4d90345 81 Char_t *fRawDataFileName; // Name of the file with raw data
f67db810 82 Int_t fNumberOfModules; // number of AliITSModuleDaSSD to allocate
c4d90345 83 AliITSModuleDaSSD **fModules; //[fNumberOfModules] array of pointer on AliITSModuleDaSSD objects (1698 SSD Modules)
84 Int_t fModIndProcessed; //! index of the last module in fModules array with processed data
85 Int_t fModIndRead; //! index of the last module in fModules array with adc data present (read)
2e2c6def 86 Int_t *fModIndex; //! index array for fModules
c4d90345 87 Long_t fNumberOfEvents; // Number of physics or calibration events in raw data file fRawDataFileName
88
f67db810 89 UInt_t fLdcId; // LDC number, read from header
90 UInt_t fRunId; // Run number, read from header
91
c4d90345 92 Float_t fPedestalThresholdFactor; // configuration parameter: ThresholdFactor for pedestal calculation
93 Float_t fCmThresholdFactor; // configuration parameter: ThresholdFactor for CM calculation
94
f67db810 95 private :
f67db810 96 Bool_t SignalOutOfRange (const Short_t signal) const { return (signal >= AliITSChannelDaSSD::GetOverflowConst()); }
97
371588bb 98 ClassDef(AliITSHandleDaSSD, 4)
f67db810 99
100};
101
102#endif
371588bb 103