]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONSt1Decoder.h
disable global transformation for trigger & transform.dat files in new ALICE coordina...
[u/mrichter/AliRoot.git] / MUON / AliMUONSt1Decoder.h
1 #ifndef ALI_MUON_ST1_DECODER_H
2 #define ALI_MUON_ST1_DECODER_H
3 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4  * See cxx source for full Copyright notice                               */
5
6 /* $Id$ */
7 // Revision of includes 07/05/2004
8
9 /// \ingroup sim
10 /// \class AliMUONSt1Decoder
11 /// \brief Set of functions to decode formatted strings
12 ///
13 /// A generic set of functions (defined in the <decoder> namespace).
14 /// Used to decode formatted strings, eg. a list of integer ranges,
15 /// or a list of sub-strings separated by delimiters such as '(','{','[', ... .
16 /// Example:                                                                \n
17 ///   (string 1) (string 2) [string3] {string4} [ (string5.1) (string5.2) ] \n
18 ///   note :                                      |_____________________|   \n
19 ///                                                         |               \n
20 ///                                             this is just ONE substring. \n
21 ///
22 /// Authors: David Guez, Ivana Hrivnacova, Marion MacCormick; IPN Orsay
23
24 #include <Rtypes.h>
25 #include <string>
26 #include <utility>
27 #include <vector>
28
29 #ifndef __HP_aCC
30   using std::string;
31   using std::pair;
32   using std::vector;
33 #endif  
34
35 typedef vector<string>  StringVector; 
36 typedef vector<Int_t>   IntVector; 
37 typedef pair<Int_t, Int_t> IntPair;
38 typedef vector<IntPair>    IntPairVector;
39 typedef pair<Double_t, Double_t>  DoublePair;
40 typedef vector<DoublePair>        DoublePairVector;
41
42 namespace decoder
43 {
44   StringVector     SplitNtuples(const string& s,
45                                 const string& leftSep ="({[\"'/",
46                                 const string& rightSep=")}]\"'/");
47   StringVector     SplitList(const string& s, const string& sep=";,");
48
49   IntVector        DecodeListRanges(const string& s, const string& sep=";,",
50                                     const string& rangeSep="/");
51   IntPairVector    DecodeListOfIntRanges(const string& s, const string& sep=";,",
52                                     const string& rangeSep="/");
53   DoublePairVector DecodeListOfFloatRanges(const string& s, const string& sep=";,",
54                                     const string& rangeSep="/");
55 }
56
57 #endif //ALI_MUON_ST1_DECODER_H