Method looping over entries for specified histogram type and
writing to FullName path to output ROOT File
Definition at line 71 of file DQMIO2histo.py.
73 Method looping over entries for specified histogram type and
74 writing to FullName path to output ROOT File
76 print(
"Working on: %s indexes: %s..%s" % (hist_type ,index_range[0],
78 t_tree = self._root_file.Get(hist_type)
79 __run_dir =
"Run %s" % (run)
81 if hist_type ==
"TProfiles":
82 if not self.already_defined[
"TProfiles"]:
83 R.gROOT.ProcessLine(
"TProfile* _tprof;")
84 self.already_defined[
"TProfiles"] =
True
85 t_tree.SetBranchAddress(
"Value", R._tprof)
86 t_tree.GetEntry(index_range[0])
87 elif hist_type ==
"TProfile2Ds":
88 if not self.already_defined[
"TProfile2Ds"]:
89 R.gROOT.ProcessLine(
"TProfile2D* _tprof2d;")
90 self.already_defined[
"TProfile2Ds"] =
True
91 t_tree.SetBranchAddress(
"Value", R._tprof2d)
92 t_tree.GetEntry(index_range[0])
93 elif hist_type ==
"TH2Fs":
94 if not self.already_defined[
"TH2Fs"]:
95 R.gROOT.ProcessLine(
"TH2F* _th2f;")
96 self.already_defined[
"TH2Fs"] =
True
97 t_tree.SetBranchAddress(
"Value", R._th2f)
98 t_tree.GetEntry(index_range[0])
99 elif hist_type ==
"TH2Ds":
100 if not self.already_defined[
"TH2Ds"]:
101 R.gROOT.ProcessLine(
"TH2D* _th2d;")
102 self.already_defined[
"TH2Ds"] =
True
103 t_tree.SetBranchAddress(
"Value", R._th2d)
104 t_tree.GetEntry(index_range[0])
106 for i
in range(0,t_tree.GetEntries()+1):
107 if i >= index_range[0]
and i <= index_range[1]:
109 name =
str(t_tree.FullName)
111 file_path = name.split(
"/")[:-1]
112 __directory =
"%s/%s" % (os.path.join(
"DQMData", __run_dir),
114 directory_ret = self.f.GetDirectory(__directory)
115 if not directory_ret:
116 self.f.
mkdir(os.path.join(__directory))
117 self.f.
cd(os.path.join(__directory))
118 if hist_type ==
"Strings":
119 construct_str =
'<%s>s=%s</%s>' % (name.split(
"/")[-1:][0],
120 t_tree.Value, name.split(
"/")[-1:][0])
121 tmp_str = R.TObjString(construct_str)
123 elif hist_type ==
"Ints":
124 construct_str =
'<%s>i=%s</%s>' % (name.split(
"/")[-1:][0],
125 t_tree.Value, name.split(
"/")[-1:][0])
126 tmp_str = R.TObjString(construct_str)
128 elif hist_type ==
"Floats":
129 construct_str =
'<%s>f=%s</%s>' % (name.split(
"/")[-1:][0],
130 t_tree.Value, name.split(
"/")[-1:][0])
131 tmp_str = R.TObjString(construct_str)
134 if hist_type
in [
"TProfiles",
"TProfile2Ds",
"TH2Fs",
"TH2Ds"]:
135 if hist_type ==
"TProfiles":
137 elif hist_type ==
"TProfile2Ds":
139 elif hist_type ==
"TH2Fs":
141 elif hist_type ==
"TH2Ds":
References DQM.DQMReader._root_file, DQMIO2histo.DQMIO._root_file, DQMIO2histo.DQMIO.already_defined, hippyaddtobaddatafiles.cd(), CondFormats_BTauObjects::dictionary.f, FunctionMinSelector< F >.f, approx_math::binary32.f, DQMIO2histo.DQMIO.f, DTMuonLocalAlignment.f, PixelToFEDAssociateFromAscii::Bdu.f, electronCompare.flushfile.f, electronStore.flushfile.f, DTMuonMillepede.f, TSFit.f, hippyaddtobaddatafiles.KeepWhileOpenFile.f, l1t::emtf::AMC13Trailer.f, cond::SmallWORMDict::IterHelp.f, SiPixelGenErrorDBObject::char2float.f, HcalGainsCheck.f, SiPixel2DTemplateDBObject::char2float.f, SiStripHotStripAlgorithmFromClusterOccupancy.f, ElectronCalibration.f, SiPixelTemplateDBObject::char2float.f, MuonDTLocalMillepedeAlgorithm.f, ElectronCalibrationUniv.f, SiStripBadAPVAlgorithmFromClusterOccupancy.f, SiStripBadAPVandHotStripAlgorithmFromClusterOccupancy.f, svgfig.Curve.f, svgfig.Line.f, svgfig.Rect.f, svgfig.Ellipse.f, svgfig.Ticks.f, svgfig.LineAxis.f, join(), eostools.mkdir(), print(), FastTimerService_cff.range, and str.
Referenced by DQMIO2histo.DQMIO.print_index().