CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ROOTFileBase.cc
Go to the documentation of this file.
2 #include "RecoLuminosity/TCPReceiver/interface/LumiStructures.hh"
3 
4 #include <sstream>
5 #include <typeinfo>
6 #include <iomanip>
7 #include <vector>
8 #include <ctime>
9 
10 #include <stddef.h>
11 
12 // mkdir
13 #include <sys/types.h>
14 #include <sys/stat.h>
15 
16 #include <TROOT.h>
17 #include <TChain.h>
18 #include <TTree.h>
19 #include <TFile.h>
20 
21 HCAL_HLX::ROOTFileBase::ROOTFileBase():filePrefix_("CMS_LUMI_RAW"),
22  dirName_("./"),
23  bEtSumOnly_(false),
24  date_(""),
25  fileType_("RAW")
26 {}
27 
29 
31 
32  lumiSection_ = new HCAL_HLX::LUMI_SECTION;
33 }
34 
36 
37  delete lumiSection_;
38 }
39 
40 void HCAL_HLX::ROOTFileBase::SetDir(const std::string& dirName){
41 
42  dirName_ = dirName;
43 }
44 
45 void HCAL_HLX::ROOTFileBase::SetFileType(const std::string &fileType){
46 
47  fileType_ = fileType;
48 }
49 
50 void HCAL_HLX::ROOTFileBase::SetDate(const std::string &date){
51 
52  date_ = date;
53 }
54 
56  const unsigned int sectionNumber ){
57 
58  std::stringstream fileName;
59  fileName.str(std::string());
60 
61  fileName << "CMS_LUMI_" << fileType_ << "_" << date_ << "_"
62  << std::setfill('0') << std::setw(9) << runNumber << "_"
63  << std::setfill('0') << std::setw(4) << sectionNumber << ".root";
64 
65  fileName_ = fileName.str();
66 
67  CreateTree();
68 }
69 
71 
72  SetFileName( lumiSection.hdr.runNumber,
73  lumiSection.hdr.sectionNumber);
74 }
75 
76 void HCAL_HLX::ROOTFileBase::SetEtSumOnly( bool bEtSumOnly ){
77 
78  bEtSumOnly_ = bEtSumOnly;
79 }
void SetFileName(const HCAL_HLX::LUMI_SECTION &lumiSection)
Definition: ROOTFileBase.cc:70
void SetFileType(const std::string &type)
Definition: ROOTFileBase.cc:45
void SetDir(const std::string &dir)
Definition: ROOTFileBase.cc:40
void SetEtSumOnly(bool bEtSumOnly)
Definition: ROOTFileBase.cc:76
void SetDate(const std::string &date)
Definition: ROOTFileBase.cc:50