]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/mapping/AliMpManuStore.h
Replacement of AliMpIntPair object with algoritmic
[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,
38 Bool_t warn = true);
39
40 static void SetWarnIfDoublon(Bool_t warn);
41
42
43 // methods
44 Bool_t AddManu(Int_t detElemId, Int_t manuId, Int_t serialNb);
45
46 Int_t NofManus() const;
47 Int_t NofManus(Int_t detElemId) const;
48
168e9c4d 49 Int_t GetManuSerial(Int_t detElemId, Int_t manuId) const;
50 MpPair_t GetDetElemIdManu(Int_t manuSerial) const;
ab167304 51
52 private:
53 AliMpManuStore(const AliMpDataStreams& dataStreams);
54 /// Not implemented
55 AliMpManuStore();
56 /// Not implemented
57 AliMpManuStore(const AliMpManuStore& rhs);
58 /// Not implemented
59 AliMpManuStore& operator=(const AliMpManuStore& rhs);
60
61 // methods
62 Bool_t ReadData(const AliMpDetElement* detElement, Int_t& nofManus);
63 Bool_t ReadManuSerial();
64
65 // not yet in use methods
66 void ReplaceManu(Int_t detElemId, Int_t manuId, Int_t serialNb);
67 Bool_t WriteData(const TString& outDir = "data_run_out");
68
69 // static data members
70 static AliMpManuStore* fgInstance; ///< Singleton instance
71 static Bool_t fgWarnIfDoublon; ///< Option to warn about doublons
72
73 // data members
7d5d0cc5 74 const AliMpDataStreams& fkDataStreams; //!< Data streams
ab167304 75 mutable TExMap fManuToSerialNbs; ///< Map from manuId to serial #
76 mutable TExMap fSerialNbToManus; ///< Map manu serial # to manuId
77 mutable TExMap fNofManusInDE; ///< Number of manus with serial nbs in DE
78 Int_t fNofManus; ///< Total number of manus
79
80 ClassDef(AliMpManuStore,1) // The manager class for definition of detection element types
81};
82
83// inline functions
84
85inline void AliMpManuStore::SetWarnIfDoublon(Bool_t warn)
86{
87/// Set option to warn if the same serial number is present for more manus
88
89 fgWarnIfDoublon = warn;
90}
91
92
93#endif //ALI_MP_MANU_STORE_H
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108