fix compilation
[u/mrichter/AliRoot.git] / ITS / AliITSDetTypeRec.h
CommitLineData
3b9df642 1#ifndef ALIITSDETTYPEREC_H
2#define ALIITSDETTYPEREC_H
3/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/*
7$Id$
8*/
9
7d62fb64 10////////////////////////////////////////////////////////////////////////
11// This class contains all of the "external" information needed to do //
12// detector specific reconstruction for the ITS. //
13////////////////////////////////////////////////////////////////////////
3b9df642 14#include <TObject.h>
3b9df642 15#include <TClonesArray.h>
ff44c37c 16#include <TBits.h>
ef665f5e 17
18class TObjArray;
6cae184e 19class TTree;
20class TBranch;
ef665f5e 21class AliITSgeom;
3b9df642 22class AliITSsegmentation;
fcf95fc7 23class AliITSCalibration;
ced4d9bc 24class AliITSCalibrationSSD;
253e68a0 25class AliITSresponseSDD;
7d62fb64 26class AliITSClusterFinder;
7d62fb64 27class AliITSRecPoint;
7d62fb64 28class AliRawReader;
88128115 29class AliITSGainSSDv2;
30class AliITSBadChannelsSSDv2;
ef665f5e 31class AliITSDDLModuleMapSDD;
88128115 32class AliITSNoiseSSDv2;
ad7f2bfa 33class AliITSTriggerConditions;
34class AliITSFOSignalsSPD;
e5c65a6d 35class AliITSRecPointContainer;
8ba39da9 36
3b9df642 37class AliITSDetTypeRec : public TObject {
38 public:
39 AliITSDetTypeRec(); // Default constructor
e56160b8 40
3b9df642 41 virtual ~AliITSDetTypeRec(); // Proper Destructor
7d62fb64 42
6cae184e 43 virtual AliITSgeom* GetITSgeom() const { return fITSgeom; }
dc5c67dc 44 virtual void SetITSgeom(AliITSgeom* const geom) { fITSgeom = geom; }
7d62fb64 45 virtual void SetDefaults();
3a7c3e6d 46 virtual void SetDefaultClusterFindersV2(Bool_t rawdata=kFALSE);
6cae184e 47 virtual void MakeBranch(TTree *tree,Option_t *opt);
dc5c67dc 48 virtual void SetTreeAddressD(TTree* const treeD);
7d62fb64 49
50 virtual void SetSegmentationModel(Int_t dettype, AliITSsegmentation *seg);
fcf95fc7 51 virtual void SetCalibrationModel(Int_t iMod, AliITSCalibration *cal);
23197852 52 virtual void SetSPDDeadModel(Int_t iMod, AliITSCalibration *cal);
9806b6f8 53 virtual void SetSPDSparseDeadModel(Int_t iMod, AliITSCalibration *cal);
7d62fb64 54 virtual void SetReconstructionModel(Int_t dettype, AliITSClusterFinder *rec);
8ba39da9 55 virtual Bool_t GetCalibration();
04c81913 56 virtual AliITSsegmentation* GetSegmentationModel(Int_t dettype) const;
57 virtual AliITSCalibration* GetCalibrationModel(Int_t iMod) const;
58 virtual AliITSCalibration* GetSPDDeadModel(Int_t iMod) const;
9806b6f8 59 virtual AliITSCalibration* GetSPDSparseDeadModel(Int_t iMod) const;
ad7f2bfa 60 virtual AliITSTriggerConditions* GetTriggerConditions() const;
04c81913 61 virtual AliITSClusterFinder* GetReconstructionModel(Int_t dettype) const;
979b5a5f 62 virtual AliITSDDLModuleMapSDD* GetDDLModuleMapSDD() const { return fDDLMapSDD;}
253e68a0 63 virtual AliITSresponseSDD* GetResponseSDD() const { return fRespSDD;}
75065a60 64 virtual Float_t GetAverageGainSDD() const {
65 if(fAveGainSDD>0.) return fAveGainSDD;
66 else return 1.;
67 }
7d62fb64 68
a6e0ebfe 69 virtual void SetDigitClassName(Int_t i,const Char_t *digit)
ef665f5e 70 {fkDigClassName[i]=digit;}
7d62fb64 71
62b93da7 72 virtual void SetLoadOnlySPDCalib(Bool_t opt=kFALSE)
73 {fLoadOnlySPDCalib=opt;}
74
ef665f5e 75 const Char_t* GetDigitClassName(Int_t i) const {return fkDigClassName[i];}
7d62fb64 76
77 TObjArray* GetDigits() const {return fDigits;}
7d62fb64 78 TClonesArray *DigitsAddress(Int_t id) const {return ((TClonesArray*)(*fDigits)[id]);}
06a7cbee 79
ad7f2bfa 80 AliITSFOSignalsSPD* GetFOSignals() const {return fFOSignals;}
81
dc5c67dc 82 TBranch* MakeBranchInTree(TTree* const tree, const char* name, const char *classname, void* address,Int_t size, Int_t splitlevel);
7d62fb64 83
7d62fb64 84 virtual void ResetDigits();
85 virtual void ResetDigits(Int_t branch);
86
6cae184e 87 void MakeBranchR(TTree *treeR,Option_t *opt=" ");
dc5c67dc 88 void SetTreeAddressR(TTree* const treeR);
7d62fb64 89 void AddRecPoint(const AliITSRecPoint &p);
6cae184e 90 void MakeBranchRF(TTree *treeR){MakeBranchR(treeR,"Fast");}
5d2c2f86 91 void DigitsToRecPoints(TTree *treeD,TTree *treeR,Int_t lastEntry,Option_t *det, Int_t optCluFind=0);
8484b32d 92 void DigitsToRecPoints(AliRawReader* rawReader,TTree *treeR,Option_t *det="All");
01ef1bd4 93 void DigitsToRecPoints(AliRawReader* rawReader,Option_t *opt);
8ba39da9 94
ad7f2bfa 95 void SetFastOrFiredMapOnline(UInt_t eq, UInt_t hs, UInt_t chip);
b457135f 96 void SetFastOrFiredMap(UInt_t chipKey){fFastOrFiredMap.SetBitNumber(chipKey);}
ff44c37c 97 TBits GetFastOrFiredMap() const {return fFastOrFiredMap;}
01ef1bd4 98 TBits GetFiredChipMap() const; // (using SPD RecPoints)
e5c65a6d 99 TBits GetFiredChipMap(TTree *treeR) const; // (using SPD RecPoints)
ff44c37c 100 void ResetFastOrFiredMap(){fFastOrFiredMap.ResetAllBits();}
ad7f2bfa 101 void RemoveFastOrFiredInActive(); // (using Trigger Conditions)
e5c65a6d 102 void RemoveFastOrFiredFromDead(TBits firedchipmap); // (using SPD RecPoints)
ad7f2bfa 103
e5c65a6d 104
3b9df642 105 private:
8e50d897 106 // private methods
e56160b8 107 AliITSDetTypeRec(const AliITSDetTypeRec& rec);
108 AliITSDetTypeRec& operator=(const AliITSDetTypeRec &source);
109
88128115 110 //conversion of the old SSD calibration objects tothe new ones
ef665f5e 111 void ReadOldSSDNoise(const TObjArray *array,
88128115 112 AliITSNoiseSSDv2 *noiseSSD);
ef665f5e 113 void ReadOldSSDBadChannels(const TObjArray *array,
88128115 114 AliITSBadChannelsSSDv2 *badChannelsSSD);
ef665f5e 115 void ReadOldSSDGain(const TObjArray *array,
88128115 116 AliITSGainSSDv2 *gainSSD);
964d8c19 117 virtual Bool_t GetCalibrationSPD(Bool_t cacheStatus);
118 virtual Bool_t GetCalibrationSDD(Bool_t cacheStatus);
119 virtual Bool_t GetCalibrationSSD(Bool_t cacheStatus);
da631926 120 void ResetRecPoints(){if(fRecPoints) fRecPoints->Clear();fNRecPoints = 0;};
88128115 121
6cae184e 122 // virtual void SetLoader(AliITSLoader* loader) {fLoader=loader;}
8ba39da9 123 static const Int_t fgkNdettypes; // number of det. types
124 static const Int_t fgkDefaultNModulesSPD; // Total numbers of SPD modules by default
125 static const Int_t fgkDefaultNModulesSDD; // Total numbers of SDD modules by default
126 static const Int_t fgkDefaultNModulesSSD; // Total numbers of SSD modules by default
8e50d897 127 Int_t *fNMod; // numbers of modules from different types
8ba39da9 128
6cae184e 129 AliITSgeom *fITSgeom; //! ITS geometry
130
7d62fb64 131 TObjArray *fReconstruction;//! [NDet]
132 TObjArray *fSegmentation; //! [NDet]
133 TObjArray *fCalibration; //! [NMod]
ced4d9bc 134 AliITSCalibrationSSD* fSSDCalibration; //! SSD calibration object
23197852 135 TObjArray *fSPDDead; //! [fgkDefaultNModulesSPD]
9806b6f8 136 TObjArray *fSPDSparseDead; //! [fgkDefaultNModulesSPD]
ad7f2bfa 137 AliITSTriggerConditions *fTriggerConditions; //! PIT conditions object
7d62fb64 138 TObjArray *fDigits; //! [NMod][NDigits]
ad7f2bfa 139 AliITSFOSignalsSPD *fFOSignals; //! Fast-Or signals (used when reconstructing from digits)
979b5a5f 140 AliITSDDLModuleMapSDD *fDDLMapSDD; //! mapping DDL/module -> SDD module number
253e68a0 141 AliITSresponseSDD *fRespSDD; //! SDD response parameters
75065a60 142 Float_t fAveGainSDD; //! Average gain of SDD good anodes
ef665f5e 143 const Char_t* fkDigClassName[3]; //! String with digit class name.
7d62fb64 144
7d62fb64 145
146 TClonesArray *fRecPoints; //! List of reconstructed points
147 Int_t fNRecPoints; // Number of rec points
148
b17dae48 149 Bool_t fFirstcall; //! flag
62b93da7 150 Bool_t fLoadOnlySPDCalib; //! flag for loading calibrations only fr SPD
3b9df642 151
ad7f2bfa 152 TBits fFastOrFiredMap; //! Map of FastOr fired chips (after processing of raw signals)
ff44c37c 153
9806b6f8 154 ClassDef(AliITSDetTypeRec,20) // ITS Reconstruction structure
7d62fb64 155};
156
3b9df642 157#endif
e5c65a6d 158