ViewVC Help
View File | Revision Log | Show Annotations | Root Listing
root/cvsroot/UserCode/MitProd/TreeService/interface/TreeService.h
Revision: 1.1
Committed: Tue May 27 20:09:09 2008 UTC (16 years, 11 months ago) by loizides
Content type: text/plain
Branch: MAIN
Log Message:
Service to access TreeWriter.

File Contents

# User Rev Content
1 loizides 1.1 // $Id:$
2    
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     // 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     // }
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    
70     } /*namespace mithep*/
71    
72     #endif /*MITPROD_TREESERVICE_H*/