Protection against missing timestamps
[u/mrichter/AliRoot.git] / ITS / AliITSModuleDaSSD.h
CommitLineData
f67db810 1#ifndef ALIITSMODULEDASSD_H
2#define ALIITSMODULEDASSD_H
3
4
223dda26 5/* Copyright(c) 2007-2009, ALICE Experiment at CERN, All rights reserved. *
6 * See cxx source for full Copyright notice */
7/* */
371588bb 8/* $Id$ */
223dda26 9///////////////////////////////////////////////////////////////////////////////
10///
2e2c6def 11/// This class provides storage container ITS SSD module calibration data
223dda26 12/// used by DA.
61a57d07 13/// Date: 18/07/2008
223dda26 14///////////////////////////////////////////////////////////////////////////////
f67db810 15
223dda26 16#include "TObject.h"
c4d90345 17#include "TArrayF.h"
371588bb 18#include "TArrayS.h"
f67db810 19#include "AliITSChannelDaSSD.h"
20
223dda26 21class AliITSNoiseSSD;
2e2c6def 22class AliITSPedestalSSD;
23class AliITSBadChannelsSSD;
223dda26 24
f67db810 25class AliITSModuleDaSSD : public TObject {
26 public :
27 AliITSModuleDaSSD();
28 AliITSModuleDaSSD(const Int_t numberofstrips);
29 AliITSModuleDaSSD(const Int_t numberofstrips, const Long_t eventsnumber);
30 AliITSModuleDaSSD(const UChar_t ddlID, const UChar_t ad, const UChar_t adc, const UShort_t moduleID);
31 AliITSModuleDaSSD(const AliITSModuleDaSSD& module);
32 AliITSModuleDaSSD& operator = (const AliITSModuleDaSSD& module);
33 virtual ~AliITSModuleDaSSD();
34
35 UChar_t GetDdlId() const { return fDdlId; }
36 UChar_t GetAD() const { return fAd; }
37 UChar_t GetADC() const { return fAdc; }
c4d90345 38 Short_t GetModuleId() const { return fModuleId; }
f67db810 39 Int_t GetModuleRorcEquipId() const { return fEquipId; }
40 Int_t GetModuleRorcEquipType() const { return fEquipType; }
41 Int_t GetNumberOfStrips() const { return fNumberOfStrips; }
42 Long_t GetEventsNumber() const { return fEventsNumber; }
c4d90345 43 Float_t* GetCM(const Int_t chipn) const { return chipn < fNumberOfChips ? fCm[chipn].GetArray() : NULL; }
44 Float_t GetCM(const Int_t chipn, const Long_t evn) const;
371588bb 45 TArrayF* GetCM() const { return fCm; }
59087bde 46 Short_t* GetCMFerom(const Int_t chipn) const { return (fCmFerom && (chipn < fgkChipsPerModule)) ? fCmFerom[chipn].GetArray() : NULL; }
371588bb 47 Short_t GetCMFerom(const Int_t chipn, const Long_t evn) const;
48 TArrayS* GetCMFerom() const { return fCmFerom; }
c4d90345 49 Int_t GetNumberOfChips() const { return fNumberOfChips; }
f67db810 50 AliITSChannelDaSSD* GetStrip(const Int_t stripnumber) const
51 { return (fStrips) ? fStrips[stripnumber] : NULL; }
f67db810 52 Bool_t SetEventsNumber(const Long_t eventsnumber);
c4d90345 53 Bool_t SetNumberOfStrips(const Int_t numberofstrips);
54 Bool_t SetNumberOfChips(const Int_t nchips);
55 Bool_t SetModuleIdData (const UChar_t ddlID, const UChar_t ad, const UChar_t adc, const Short_t moduleID);
f67db810 56 void SetModuleFEEId (const UChar_t ddlID, const UChar_t ad, const UChar_t adc);
57 void SetModuleRorcId (const Int_t equipid, const Int_t equiptype);
c4d90345 58 void SetModuleId (const Short_t moduleID) { fModuleId = moduleID; }
f67db810 59 void SetStrip(AliITSChannelDaSSD* strip, const Int_t strID) { if ((fStrips) && (strID <= fNumberOfStrips)) fStrips[strID] = strip; }
c4d90345 60 void SetCM (Float_t* cm, const Int_t chipn) { if (chipn < fNumberOfChips) fCm[chipn].Set(fCm[chipn].GetSize(), cm); }
61 Bool_t SetCM (const Float_t cm, const Int_t chipn, const Int_t evn);
a69c8ba0 62 void DeleteCM () {if (fCm) { delete [] fCm; fNumberOfChips = 0; fCm = NULL; } }
f67db810 63 void DeleteSignal() {if (fStrips) for (Int_t i = 0; i < fNumberOfStrips; i++)
64 if (fStrips[i]) fStrips[i]->DeleteSignal(); fEventsNumber = 0; }
59087bde 65 Bool_t AllocateCMFeromArray(void);
66 void SetCMFerom (Short_t* cm, const Int_t chipn);
371588bb 67 Bool_t SetCMFerom (const Short_t cm, const Int_t chipn, const Int_t evn);
68 Bool_t SetCMFeromEventsNumber(const Long_t eventsnumber);
69 void DeleteCMFerom () {if (fCmFerom) { delete [] fCmFerom; fCmFerom = NULL; } }
70
f67db810 71 static Int_t GetStripsPerModuleConst() { return fgkStripsPerModule; }
72 static Int_t GetPNStripsPerModule() { return fgkPNStripsPerModule;}
73 static Int_t GetStripsPerChip() { return fgkStripsPerChip; }
c4d90345 74 static Int_t GetChipsPerModuleConst() { return fgkChipsPerModule; }
f67db810 75
76 protected :
c4d90345 77 static const Int_t fgkStripsPerModule; // Number of strips per SSD module
78 static const Int_t fgkPNStripsPerModule; // Number of N/P strips per SSD module
79 static const Int_t fgkStripsPerChip; // Number of strips per chip HAL25
80 static const UChar_t fgkMaxAdNumber; // MAx SSD FEROM AD number
81 static const UChar_t fgkMaxAdcNumber; // MAx SSD FEROM ADC number
82 static const Int_t fgkChipsPerModule; // Number of HAL25 chips per SSD module
f67db810 83
84 Int_t fEquipId; // required to access to rorc
223dda26 85 Int_t fEquipType; // fEquipType, required to access to rorc
f67db810 86 UChar_t fDdlId; // index of DDL, ITS SSD: 33-48
87 UChar_t fAd; // index of AD module 0-9
88 UChar_t fAdc; // index of ADC module 0-5, 8-13
2e2c6def 89 Short_t fModuleId; // Module number 500-2197
c4d90345 90
91 Int_t fNumberOfStrips; // Number of AliITSChannelDaSSD* allocated
92 AliITSChannelDaSSD **fStrips; //[fNumberOfStrips] Array of *AliITSChannelDaSSD
f67db810 93
c4d90345 94 Int_t fNumberOfChips; // Number of TArrayF objects allocated for CM
95 TArrayF *fCm; //[fNumberOfChips] CM
371588bb 96 TArrayS *fCmFerom; // CM calculated in FEROM
f67db810 97
c4d90345 98 Long_t fEventsNumber; // number of events for fsignal memory allocation
f67db810 99
100 private:
101 Bool_t ForbiddenAdcNumber (const UChar_t adcn) const { return ((adcn == 6) || (adcn == 7)); }
102
d86972f6 103 ClassDef(AliITSModuleDaSSD, 6)
f67db810 104
105};
106
107#endif
59087bde 108