Fixes for report #68312: Improper usage of TClonesArrays in ITS
[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);
7d62fb64 53 virtual void SetReconstructionModel(Int_t dettype, AliITSClusterFinder *rec);
8ba39da9 54 virtual Bool_t GetCalibration();
04c81913 55 virtual AliITSsegmentation* GetSegmentationModel(Int_t dettype) const;
56 virtual AliITSCalibration* GetCalibrationModel(Int_t iMod) const;
57 virtual AliITSCalibration* GetSPDDeadModel(Int_t iMod) const;
ad7f2bfa 58 virtual AliITSTriggerConditions* GetTriggerConditions() const;
04c81913 59 virtual AliITSClusterFinder* GetReconstructionModel(Int_t dettype) const;
979b5a5f 60 virtual AliITSDDLModuleMapSDD* GetDDLModuleMapSDD() const { return fDDLMapSDD;}
253e68a0 61 virtual AliITSresponseSDD* GetResponseSDD() const { return fRespSDD;}
75065a60 62 virtual Float_t GetAverageGainSDD() const {
63 if(fAveGainSDD>0.) return fAveGainSDD;
64 else return 1.;
65 }
7d62fb64 66
a6e0ebfe 67 virtual void SetDigitClassName(Int_t i,const Char_t *digit)
ef665f5e 68 {fkDigClassName[i]=digit;}
7d62fb64 69
62b93da7 70 virtual void SetLoadOnlySPDCalib(Bool_t opt=kFALSE)
71 {fLoadOnlySPDCalib=opt;}
72
ef665f5e 73 const Char_t* GetDigitClassName(Int_t i) const {return fkDigClassName[i];}
7d62fb64 74
75 TObjArray* GetDigits() const {return fDigits;}
7d62fb64 76 TClonesArray *DigitsAddress(Int_t id) const {return ((TClonesArray*)(*fDigits)[id]);}
06a7cbee 77
ad7f2bfa 78 AliITSFOSignalsSPD* GetFOSignals() const {return fFOSignals;}
79
dc5c67dc 80 TBranch* MakeBranchInTree(TTree* const tree, const char* name, const char *classname, void* address,Int_t size, Int_t splitlevel);
7d62fb64 81
7d62fb64 82 virtual void ResetDigits();
83 virtual void ResetDigits(Int_t branch);
84
6cae184e 85 void MakeBranchR(TTree *treeR,Option_t *opt=" ");
dc5c67dc 86 void SetTreeAddressR(TTree* const treeR);
7d62fb64 87 void AddRecPoint(const AliITSRecPoint &p);
88 void ResetRecPoints(){if(fRecPoints) fRecPoints->Clear();fNRecPoints = 0;};
89 // Return pointer to rec points
ef665f5e 90 TClonesArray *RecPoints() const {return fRecPoints;}
6cae184e 91 void MakeBranchRF(TTree *treeR){MakeBranchR(treeR,"Fast");}
5d2c2f86 92 void DigitsToRecPoints(TTree *treeD,TTree *treeR,Int_t lastEntry,Option_t *det, Int_t optCluFind=0);
8484b32d 93 void DigitsToRecPoints(AliRawReader* rawReader,TTree *treeR,Option_t *det="All");
01ef1bd4 94 void DigitsToRecPoints(AliRawReader* rawReader,Option_t *opt);
8ba39da9 95
ad7f2bfa 96 void SetFastOrFiredMapOnline(UInt_t eq, UInt_t hs, UInt_t chip);
b457135f 97 void SetFastOrFiredMap(UInt_t chipKey){fFastOrFiredMap.SetBitNumber(chipKey);}
ff44c37c 98 TBits GetFastOrFiredMap() const {return fFastOrFiredMap;}
01ef1bd4 99 TBits GetFiredChipMap() const; // (using SPD RecPoints)
e5c65a6d 100 TBits GetFiredChipMap(TTree *treeR) const; // (using SPD RecPoints)
ff44c37c 101 void ResetFastOrFiredMap(){fFastOrFiredMap.ResetAllBits();}
ad7f2bfa 102 void RemoveFastOrFiredInActive(); // (using Trigger Conditions)
e5c65a6d 103 void RemoveFastOrFiredFromDead(TBits firedchipmap); // (using SPD RecPoints)
ad7f2bfa 104
e5c65a6d 105
3b9df642 106 private:
8e50d897 107 // private methods
e56160b8 108 AliITSDetTypeRec(const AliITSDetTypeRec& rec);
109 AliITSDetTypeRec& operator=(const AliITSDetTypeRec &source);
110
88128115 111 //conversion of the old SSD calibration objects tothe new ones
ef665f5e 112 void ReadOldSSDNoise(const TObjArray *array,
88128115 113 AliITSNoiseSSDv2 *noiseSSD);
ef665f5e 114 void ReadOldSSDBadChannels(const TObjArray *array,
88128115 115 AliITSBadChannelsSSDv2 *badChannelsSSD);
ef665f5e 116 void ReadOldSSDGain(const TObjArray *array,
88128115 117 AliITSGainSSDv2 *gainSSD);
964d8c19 118 virtual Bool_t GetCalibrationSPD(Bool_t cacheStatus);
119 virtual Bool_t GetCalibrationSDD(Bool_t cacheStatus);
120 virtual Bool_t GetCalibrationSSD(Bool_t cacheStatus);
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]
ad7f2bfa 136 AliITSTriggerConditions *fTriggerConditions; //! PIT conditions object
7d62fb64 137 TObjArray *fDigits; //! [NMod][NDigits]
ad7f2bfa 138 AliITSFOSignalsSPD *fFOSignals; //! Fast-Or signals (used when reconstructing from digits)
979b5a5f 139 AliITSDDLModuleMapSDD *fDDLMapSDD; //! mapping DDL/module -> SDD module number
253e68a0 140 AliITSresponseSDD *fRespSDD; //! SDD response parameters
75065a60 141 Float_t fAveGainSDD; //! Average gain of SDD good anodes
ef665f5e 142 const Char_t* fkDigClassName[3]; //! String with digit class name.
7d62fb64 143
7d62fb64 144
145 TClonesArray *fRecPoints; //! List of reconstructed points
146 Int_t fNRecPoints; // Number of rec points
147
b17dae48 148 Bool_t fFirstcall; //! flag
62b93da7 149 Bool_t fLoadOnlySPDCalib; //! flag for loading calibrations only fr SPD
3b9df642 150
ad7f2bfa 151 TBits fFastOrFiredMap; //! Map of FastOr fired chips (after processing of raw signals)
ff44c37c 152
e5b2f7f2 153 ClassDef(AliITSDetTypeRec,19) // ITS Reconstruction structure
7d62fb64 154};
155
3b9df642 156#endif
e5c65a6d 157