Fixes for Coverity warnings (M. van Leeuwen)
[u/mrichter/AliRoot.git] / ITS / AliITSRecPointContainer.h
CommitLineData
b21c1af0 1#ifndef ALIITSRECPOINTCONTAINER_H
2#define ALIITSRECPOINTCONTAINER_H
3/* Copyright(c) 2009-2011, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
7
8////////////////////////////////////////////////////////////////////////
9// Container class for ITS rec points //
10////////////////////////////////////////////////////////////////////////
11
12#include <TClonesArray.h>
13#include <TString.h>
14
15class AliITSRecoParam;
16
17class AliITSRecPointContainer : public TObject {
18
19 public:
20
21 virtual ~AliITSRecPointContainer(); //Destructor
22
23 Bool_t IsSPDActive() const {return fDet.Contains("SPD");}
24 Bool_t IsSDDActive() const {return fDet.Contains("SDD");}
25 Bool_t IsSSDActive() const {return fDet.Contains("SSD");}
26 Bool_t IsITSComplete() const {return fDet.Contains("ALL");}
e62fe478 27 Bool_t GetStatusOK() const {return fStatusOK;}
28 Int_t GetNumberOfModules() const {return fActualSize; }
b21c1af0 29
30 static AliITSRecPointContainer* Instance(const AliITSRecoParam *ptr=NULL);
ce4a8cfb 31 void PrepareToRead(){if(fNextEvent<0){fNextEvent=0;} else {++fNextEvent;}}
b21c1af0 32 TClonesArray* FetchClusters(Int_t mod, TTree* tR);
788ba14f 33 TClonesArray* FetchClusters(Int_t mod, TTree* tR,Int_t cureve);
b21c1af0 34 TClonesArray* UncheckedGetClusters(Int_t mod) const {return fArray[mod];}
35
1cc75a0b 36 // In the following two methods: 1<=lay<=6 (i.e. layers numbered from 1)
37 UInt_t GetNClustersInLayer(Int_t lay, TTree* tR, Int_t eventN=-1);
38 UInt_t GetNClustersInLayerFast(Int_t lay) const;
01ef1bd4 39 void FullReset(){fCurrentEve=-1000; Reset();}
40 void ResetSPD(); // clears only SPD parts - see implementation for usage
41 void ResetSDD(); // clears only SPD parts - see implementation for usage
42 void ResetSSD(); // clears only SPD parts - see implementation for usage
1cc75a0b 43
b21c1af0 44 private:
45 // methods
46 AliITSRecPointContainer(const AliITSRecoParam* krp=NULL); // Default constructor
47 AliITSRecPointContainer(const AliITSRecPointContainer& rec);
48 AliITSRecPointContainer& operator=(const AliITSRecPointContainer &source);
49 Bool_t CheckBoundaries(Int_t i)const { return (i>=0 && i<fgkNModules);}
50 void CookEntries();
51 void Reset();
01ef1bd4 52 void ClearClus(Int_t first, Int_t lastpp){ // clears clusters for modules
53 // ranging from first to lastpp-1 included
54 for(Int_t i=first;i<lastpp;i++)(fArray[i])->Clear();
55 }
b21c1af0 56 //Data members
57 static AliITSRecPointContainer* fgInstance; //! AliITSRecPointContainer
58 // singleton
59 static const Int_t fgkNModules=2198; //! total number of ITS modules
60
61 Int_t fSPDNModules; //! number of SPD modules
62 Int_t fSDDNModules; //! number of SDD modules
63 Int_t fSSDNModules; //! number of SDD modules
64 TClonesArray* fArray[fgkNModules]; //! container - 1 TClonesArray per module
ce4a8cfb 65 Int_t fCurrentEve; //! event number
66 Int_t fNextEvent; //! number of the next event to be read; used only when
67 //! the run loader is not available. It is just a counter.
b21c1af0 68 Int_t fActualSize; //! actual number of ITS modules in TTree R
69 TString fDet; //! ITS subdetectors active for the current run
e62fe478 70 Bool_t fStatusOK; //! kFALSE is RP branch is absent or if there are anomalies
71 //! in the number of active modules
1cc75a0b 72 UInt_t fNClusters[6]; //! Number of clusters per layer
b21c1af0 73
74 ClassDef(AliITSRecPointContainer,0)
75};
76
77#endif