1 |
loizides |
1.1 |
// $Id: Types.cc,v 1.1 2008/09/27 05:44:11 loizides Exp $
|
2 |
|
|
|
3 |
|
|
#include "MitCommon/OptIO/interface/OptInt.h"
|
4 |
|
|
#include <TROOT.h>
|
5 |
|
|
#include <TSystem.h>
|
6 |
|
|
#include <TError.h>
|
7 |
|
|
#include <TEnv.h>
|
8 |
|
|
#include <Riostream.h>
|
9 |
|
|
|
10 |
|
|
ClassImp(mithep::OptInt)
|
11 |
|
|
|
12 |
|
|
using namespace mithep;
|
13 |
|
|
|
14 |
|
|
extern "C" void R__SetZipMode(int zipmode);
|
15 |
|
|
|
16 |
|
|
extern double lzipfrac;
|
17 |
|
|
extern double gzipfrac;
|
18 |
|
|
extern double bzipfrac;
|
19 |
|
|
extern int myverbose;
|
20 |
|
|
extern int mystaticm;
|
21 |
|
|
|
22 |
|
|
//--------------------------------------------------------------------------------------------------
|
23 |
|
|
void OptInt::SetAlgoFractions(Double_t lzo, Double_t gz, Double_t bz)
|
24 |
|
|
{
|
25 |
|
|
// Fraction of compression that must be reached to accept result of the "heavy"
|
26 |
|
|
// compression algorithm. Negative values turn of usage of the specific compression
|
27 |
|
|
// algorithm in ZipMode=5.
|
28 |
|
|
|
29 |
|
|
lzipfrac = lzo;
|
30 |
|
|
gzipfrac = gz;
|
31 |
|
|
bzipfrac = bz;
|
32 |
|
|
}
|
33 |
|
|
|
34 |
|
|
//--------------------------------------------------------------------------------------------------
|
35 |
|
|
void OptInt::SetStaticMalloc(Bool_t b)
|
36 |
|
|
{
|
37 |
|
|
// Set flag to enable the usage of static rather than heap memory in the compression
|
38 |
|
|
// algorithm. No real increase in speed has been observed, therefore off by default.
|
39 |
|
|
|
40 |
|
|
mystaticm = b;
|
41 |
|
|
}
|
42 |
|
|
|
43 |
|
|
//--------------------------------------------------------------------------------------------------
|
44 |
|
|
void OptInt::SetVerbose(Int_t vl)
|
45 |
|
|
{
|
46 |
|
|
// Set verbosity level in the R__zip and R__unzip functions. Use 1 to only enable for
|
47 |
|
|
// writing, 2 only for reading and 10 for both.
|
48 |
|
|
|
49 |
|
|
myverbose = vl;
|
50 |
|
|
}
|
51 |
|
|
|
52 |
|
|
//--------------------------------------------------------------------------------------------------
|
53 |
|
|
void OptInt::SetZipMode(Int_t zipmode)
|
54 |
|
|
{
|
55 |
|
|
// Set ZipMode to be used in R__zip. Supported values range from 1 to 5, where
|
56 |
|
|
// 1 == gzip (http://www.gzip.org/, standard in ROOT)
|
57 |
|
|
// 2 == bzip2 (http://www.bzip.org/)
|
58 |
|
|
// 3 == lzo (http://www.oberhumer.com/opensource/lzo/)
|
59 |
|
|
// 4 == rle (http://bcl.comli.eu/)
|
60 |
|
|
// 5 == combination of 1 to 4.
|
61 |
|
|
|
62 |
|
|
R__SetZipMode(zipmode);
|
63 |
|
|
}
|