1 |
loizides |
1.3 |
// $Id: TreeService.h,v 1.2 2008/06/03 07:21:45 paus Exp $
|
2 |
loizides |
1.1 |
|
3 |
|
|
#ifndef MITPROD_TREESERVICE_H
|
4 |
|
|
#define MITPROD_TREESERVICE_H
|
5 |
|
|
|
6 |
|
|
#include "DataFormats/Provenance/interface/EventID.h"
|
7 |
|
|
#include "DataFormats/Provenance/interface/Timestamp.h"
|
8 |
|
|
#include "FWCore/Framework/interface/Event.h"
|
9 |
|
|
#include "FWCore/Framework/interface/EventSetup.h"
|
10 |
|
|
|
11 |
|
|
#include <TObjArray.h>
|
12 |
|
|
|
13 |
|
|
namespace edm
|
14 |
|
|
{
|
15 |
|
|
class ActivityRegistry;
|
16 |
|
|
class ParameterSet;
|
17 |
|
|
class ModuleDescription;
|
18 |
|
|
}
|
19 |
|
|
|
20 |
|
|
//--------------------------------------------------------------------------------------------------
|
21 |
|
|
//
|
22 |
|
|
// TreeService
|
23 |
|
|
//
|
24 |
|
|
// This service can be used in the config files to provide access to the TreeWriter,
|
25 |
|
|
// for example:
|
26 |
|
|
//
|
27 |
|
|
// service = TreeService {
|
28 |
paus |
1.2 |
// untracked vstring treeNames = { "MitTree" }
|
29 |
|
|
// untracked vstring fileNames = { "mittreefile" }
|
30 |
|
|
// untracked vstring pathNames = { "." }
|
31 |
|
|
// untracked vuint32 maxSizes = { 1024 }
|
32 |
|
|
// untracked vuint32 compLevels = { 9 }
|
33 |
|
|
// untracked vuint32 splitLevels = { 99 }
|
34 |
|
|
// untracked vuint32 brSizes = { 32000 }
|
35 |
loizides |
1.1 |
// }
|
36 |
|
|
//
|
37 |
|
|
// Authors: C.Loizides
|
38 |
|
|
//
|
39 |
|
|
//--------------------------------------------------------------------------------------------------
|
40 |
|
|
|
41 |
|
|
namespace mithep
|
42 |
|
|
{
|
43 |
|
|
class TreeWriter;
|
44 |
|
|
|
45 |
|
|
class TreeService {
|
46 |
|
|
public:
|
47 |
|
|
TreeService(const edm::ParameterSet &, edm::ActivityRegistry &);
|
48 |
|
|
~TreeService();
|
49 |
|
|
|
50 |
|
|
TreeWriter *get(const char *name=0);
|
51 |
|
|
|
52 |
|
|
private:
|
53 |
|
|
void preEventProcessing(const edm::EventID &id, const edm::Timestamp &t);
|
54 |
|
|
void postEventProcessing(const edm::Event& e, const edm::EventSetup& es);
|
55 |
|
|
void postBeginJob();
|
56 |
|
|
void postEndJob();
|
57 |
|
|
|
58 |
|
|
TObjArray tws_; //array holding the tree writers
|
59 |
|
|
|
60 |
|
|
// parameters for service
|
61 |
|
|
std::vector<std::string> treeNames_; //tree names
|
62 |
|
|
std::vector<std::string> fileNames_; //file names
|
63 |
|
|
std::vector<std::string> pathNames_; //path names
|
64 |
|
|
std::vector<unsigned> maxSizes_; //max file sizes [MB]
|
65 |
|
|
std::vector<unsigned> compLevels_; //compression levels
|
66 |
|
|
std::vector<unsigned> splitLevels_; //default split levels
|
67 |
|
|
std::vector<unsigned> brSizes_; //default branch sizes [Byte]
|
68 |
|
|
};
|
69 |
paus |
1.2 |
}
|
70 |
loizides |
1.3 |
#endif
|