]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/mapping/AliMpManuStore.h
Fix floating exception bug which can appear in few specific cases.
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpManuStore.h
CommitLineData
ab167304 1/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2 * See cxx source for full Copyright notice */
3
4// $Id$
5// $MpId: AliMpManuStore.h,v 1.6 2006/05/24 13:58:16 ivana Exp $
6
7/// \ingroup management
8/// \class AliMpManuStore
9/// \brief The container class for manu serial numbers
10///
11/// \author Ivana Hrivnacova, IPN Orsay; Christian Finck, SUBATECH Nantes
12
13#ifndef ALI_MP_MANU_STORE_H
14#define ALI_MP_MANU_STORE_H
15
16#include <TObject.h>
17
18#include "AliMpPlaneType.h"
19#include "AliMpStationType.h"
168e9c4d 20#include "AliMpEncodePair.h"
ab167304 21
22#include <TString.h>
23#include <TExMap.h>
24
25class AliMpDetElement;
26class AliMpDataStreams;
27class TString;
28
29class AliMpManuStore : public TObject {
30
31 public:
7d5d0cc5 32 AliMpManuStore(TRootIOCtor* ioCtor);
ab167304 33 virtual ~AliMpManuStore();
34
35 // static access method
36 static AliMpManuStore* Instance(Bool_t warn = true);
37 static AliMpManuStore* ReadData(const AliMpDataStreams& dataStreams,
877f7c6e 38 Bool_t warn = true,
39 Bool_t empty = false);
ab167304 40
41 static void SetWarnIfDoublon(Bool_t warn);
42
43
44 // methods
45 Bool_t AddManu(Int_t detElemId, Int_t manuId, Int_t serialNb);
46
47 Int_t NofManus() const;
48 Int_t NofManus(Int_t detElemId) const;
49
168e9c4d 50 Int_t GetManuSerial(Int_t detElemId, Int_t manuId) const;
51 MpPair_t GetDetElemIdManu(Int_t manuSerial) const;
ab167304 52
53 private:
54 AliMpManuStore(const AliMpDataStreams& dataStreams);
877f7c6e 55 AliMpManuStore(const AliMpDataStreams& dataStreams, Bool_t empty);
ab167304 56 /// Not implemented
57 AliMpManuStore();
58 /// Not implemented
59 AliMpManuStore(const AliMpManuStore& rhs);
60 /// Not implemented
61 AliMpManuStore& operator=(const AliMpManuStore& rhs);
62
63 // methods
64 Bool_t ReadData(const AliMpDetElement* detElement, Int_t& nofManus);
65 Bool_t ReadManuSerial();
66
67 // not yet in use methods
68 void ReplaceManu(Int_t detElemId, Int_t manuId, Int_t serialNb);
69 Bool_t WriteData(const TString& outDir = "data_run_out");
70
71 // static data members
72 static AliMpManuStore* fgInstance; ///< Singleton instance
73 static Bool_t fgWarnIfDoublon; ///< Option to warn about doublons
74
75 // data members
7d5d0cc5 76 const AliMpDataStreams& fkDataStreams; //!< Data streams
ab167304 77 mutable TExMap fManuToSerialNbs; ///< Map from manuId to serial #
78 mutable TExMap fSerialNbToManus; ///< Map manu serial # to manuId
79 mutable TExMap fNofManusInDE; ///< Number of manus with serial nbs in DE
80 Int_t fNofManus; ///< Total number of manus
81
82 ClassDef(AliMpManuStore,1) // The manager class for definition of detection element types
83};
84
85// inline functions
86
87inline void AliMpManuStore::SetWarnIfDoublon(Bool_t warn)
88{
89/// Set option to warn if the same serial number is present for more manus
90
91 fgWarnIfDoublon = warn;
92}
93
94
95#endif //ALI_MP_MANU_STORE_H
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110