Most of these updates are related to the offline software needed for the pixel trigge...
[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;
8ba39da9 35
3b9df642 36class AliITSDetTypeRec : public TObject {
37 public:
38 AliITSDetTypeRec(); // Default constructor
e56160b8 39
3b9df642 40 virtual ~AliITSDetTypeRec(); // Proper Destructor
7d62fb64 41
6cae184e 42 virtual AliITSgeom* GetITSgeom() const { return fITSgeom; }
dc5c67dc 43 virtual void SetITSgeom(AliITSgeom* const geom) { fITSgeom = geom; }
7d62fb64 44 virtual void SetDefaults();
3a7c3e6d 45 virtual void SetDefaultClusterFindersV2(Bool_t rawdata=kFALSE);
6cae184e 46 virtual void MakeBranch(TTree *tree,Option_t *opt);
dc5c67dc 47 virtual void SetTreeAddressD(TTree* const treeD);
7d62fb64 48
49 virtual void SetSegmentationModel(Int_t dettype, AliITSsegmentation *seg);
fcf95fc7 50 virtual void SetCalibrationModel(Int_t iMod, AliITSCalibration *cal);
23197852 51 virtual void SetSPDDeadModel(Int_t iMod, AliITSCalibration *cal);
7d62fb64 52 virtual void SetReconstructionModel(Int_t dettype, AliITSClusterFinder *rec);
8ba39da9 53 virtual Bool_t GetCalibration();
75065a60 54 virtual Bool_t GetCalibrationSPD(Bool_t cacheStatus);
55 virtual Bool_t GetCalibrationSDD(Bool_t cacheStatus);
56 virtual Bool_t GetCalibrationSSD(Bool_t cacheStatus);
04c81913 57 virtual AliITSsegmentation* GetSegmentationModel(Int_t dettype) const;
58 virtual AliITSCalibration* GetCalibrationModel(Int_t iMod) const;
59 virtual AliITSCalibration* GetSPDDeadModel(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;}
2f8ed7ab 64 virtual Bool_t IsHLTmodeC() const {return fIsHLTmodeC;}
f3a3f329 65 virtual void SetHLTmodeC(Bool_t ishltc){fIsHLTmodeC=ishltc;}
75065a60 66 virtual Float_t GetAverageGainSDD() const {
67 if(fAveGainSDD>0.) return fAveGainSDD;
68 else return 1.;
69 }
7d62fb64 70
a6e0ebfe 71 virtual void SetDigitClassName(Int_t i,const Char_t *digit)
ef665f5e 72 {fkDigClassName[i]=digit;}
7d62fb64 73
62b93da7 74 virtual void SetLoadOnlySPDCalib(Bool_t opt=kFALSE)
75 {fLoadOnlySPDCalib=opt;}
76
ef665f5e 77 const Char_t* GetDigitClassName(Int_t i) const {return fkDigClassName[i];}
7d62fb64 78
79 TObjArray* GetDigits() const {return fDigits;}
7d62fb64 80 TClonesArray *DigitsAddress(Int_t id) const {return ((TClonesArray*)(*fDigits)[id]);}
06a7cbee 81
ad7f2bfa 82 AliITSFOSignalsSPD* GetFOSignals() const {return fFOSignals;}
83
dc5c67dc 84 TBranch* MakeBranchInTree(TTree* const tree, const char* name, const char *classname, void* address,Int_t size, Int_t splitlevel);
7d62fb64 85
7d62fb64 86 virtual void ResetDigits();
87 virtual void ResetDigits(Int_t branch);
88
6cae184e 89 void MakeBranchR(TTree *treeR,Option_t *opt=" ");
dc5c67dc 90 void SetTreeAddressR(TTree* const treeR);
7d62fb64 91 void AddRecPoint(const AliITSRecPoint &p);
92 void ResetRecPoints(){if(fRecPoints) fRecPoints->Clear();fNRecPoints = 0;};
93 // Return pointer to rec points
ef665f5e 94 TClonesArray *RecPoints() const {return fRecPoints;}
6cae184e 95 void MakeBranchRF(TTree *treeR){MakeBranchR(treeR,"Fast");}
5d2c2f86 96 void DigitsToRecPoints(TTree *treeD,TTree *treeR,Int_t lastEntry,Option_t *det, Int_t optCluFind=0);
8484b32d 97 void DigitsToRecPoints(AliRawReader* rawReader,TTree *treeR,Option_t *det="All");
8ba39da9 98
ad7f2bfa 99 void SetFastOrFiredMapOnline(UInt_t eq, UInt_t hs, UInt_t chip);
b457135f 100 void SetFastOrFiredMap(UInt_t chipKey){fFastOrFiredMap.SetBitNumber(chipKey);}
ff44c37c 101 TBits GetFastOrFiredMap() const {return fFastOrFiredMap;}
102 void ResetFastOrFiredMap(){fFastOrFiredMap.ResetAllBits();}
ad7f2bfa 103 void RemoveFastOrFiredInActive(); // (using Trigger Conditions)
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);
117
6cae184e 118 // virtual void SetLoader(AliITSLoader* loader) {fLoader=loader;}
8ba39da9 119 static const Int_t fgkNdettypes; // number of det. types
120 static const Int_t fgkDefaultNModulesSPD; // Total numbers of SPD modules by default
121 static const Int_t fgkDefaultNModulesSDD; // Total numbers of SDD modules by default
122 static const Int_t fgkDefaultNModulesSSD; // Total numbers of SSD modules by default
8e50d897 123 Int_t *fNMod; // numbers of modules from different types
8ba39da9 124
6cae184e 125 AliITSgeom *fITSgeom; //! ITS geometry
126
7d62fb64 127 TObjArray *fReconstruction;//! [NDet]
128 TObjArray *fSegmentation; //! [NDet]
129 TObjArray *fCalibration; //! [NMod]
ced4d9bc 130 AliITSCalibrationSSD* fSSDCalibration; //! SSD calibration object
23197852 131 TObjArray *fSPDDead; //! [fgkDefaultNModulesSPD]
ad7f2bfa 132 AliITSTriggerConditions *fTriggerConditions; //! PIT conditions object
7d62fb64 133 TObjArray *fDigits; //! [NMod][NDigits]
ad7f2bfa 134 AliITSFOSignalsSPD *fFOSignals; //! Fast-Or signals (used when reconstructing from digits)
979b5a5f 135 AliITSDDLModuleMapSDD *fDDLMapSDD; //! mapping DDL/module -> SDD module number
253e68a0 136 AliITSresponseSDD *fRespSDD; //! SDD response parameters
75065a60 137 Float_t fAveGainSDD; //! Average gain of SDD good anodes
2f8ed7ab 138 Bool_t fIsHLTmodeC; //! flag for HLT mode C status (used by SDD)
ef665f5e 139 const Char_t* fkDigClassName[3]; //! String with digit class name.
7d62fb64 140
7d62fb64 141
142 TClonesArray *fRecPoints; //! List of reconstructed points
143 Int_t fNRecPoints; // Number of rec points
144
b17dae48 145 Bool_t fFirstcall; //! flag
62b93da7 146 Bool_t fLoadOnlySPDCalib; //! flag for loading calibrations only fr SPD
3b9df642 147
ad7f2bfa 148 TBits fFastOrFiredMap; //! Map of FastOr fired chips (after processing of raw signals)
ff44c37c 149
ad7f2bfa 150 ClassDef(AliITSDetTypeRec,18) // ITS Reconstruction structure
7d62fb64 151};
152
3b9df642 153#endif