BOSS
7.1.2
BESIII Offline Software System
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Functions
a
c
d
e
f
g
i
l
m
n
o
p
r
s
t
u
v
w
Variables
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
v
w
x
z
Typedefs
c
d
e
g
h
i
l
m
n
o
p
r
s
t
Enumerations
Enumerator
a
b
c
d
e
f
i
k
l
m
n
o
p
r
s
t
u
w
x
z
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
:
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Functions
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
~
Variables
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
g
h
i
m
n
p
r
s
t
v
w
Enumerations
b
c
d
e
f
g
h
i
k
l
m
n
p
r
s
t
v
Enumerator
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
r
s
t
u
v
w
x
z
Related Symbols
:
a
b
c
d
e
f
g
i
k
l
m
n
o
p
r
s
t
v
w
x
Files
File List
File Members
All
!
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Functions
!
a
b
c
d
e
f
g
h
i
j
l
m
n
o
p
q
r
s
t
u
v
w
x
Variables
!
$
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
y
z
Typedefs
a
b
c
d
e
f
h
i
j
k
l
m
n
p
r
s
t
u
v
w
z
Enumerations
Enumerator
a
b
c
d
e
f
g
h
i
k
m
n
o
p
r
s
t
u
w
Macros
_
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
r
s
t
u
v
w
x
z
▼
BOSS
Used Packages
Requirements
►
How to use the ERS package
Todo List
►
Namespaces
►
Classes
▼
Files
▼
File List
▼
7.1.2
►
Analysis
►
BesCxxPolicy
►
BesExamples
►
BesPolicy
►
Calibration
►
Control
►
Database
►
DetectorDescription
►
DistBoss
►
DQA
►
Emc
►
Event
►
EventDisplay
►
EventFilter
►
EvtPreSelect
►
External
►
Generator
►
InstallArea
►
LumTauAlg
►
MagneticField
▼
Mdc
▼
DedxCalibAlg
▼
DedxCalibAlg-00-02-01
►
DedxCalibAlg
▼
share
▼
shell
▼
genRawScript
►
check_hist_entries.cxx
►
compare_trees.cxx
►
draw_hadron_check_plots.cxx
►
genRawScript.cpp
►
genRunList.cxx
►
getMinMax.cxx
►
insert_run_calib.cxx
►
realnewrun.cxx
►
txt2root.cxx
►
betagamma.cxx
►
extract_trkindex.cxx
►
template
►
src
►
DedxCorrecSvc
►
DedxCurSvc
►
DedxSimSvc
►
MdcAlignAlg
►
MdcCalibAlg
►
MdcCalibFunSvc
►
MdcCheckUtil
►
MdcGeomSvc
►
MdcHvDropSvc
►
MdcNavigation
►
MdcRawEvent
►
MdcRecEvent
►
MdcTables
►
Muc
►
OfflineEvtFilter
►
Reconstruction
►
RootPolicy
►
Simulation
►
Tof
►
Trigger
►
Utilities
►
Validation
►
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
Loading...
Searching...
No Matches
realnewrun.cxx
Go to the documentation of this file.
1
#include <iostream>
2
#include <fstream>
3
#include <iomanip>
4
#include <cstring>
5
#include <string>
6
#include <vector>
7
#include <TFile.h>
8
#include <TTree.h>
9
#include <TString.h>
10
#include <TBranch.h>
11
#include <TLeaf.h>
12
#include <TH1F.h>
13
#include <cstdio>
14
15
using namespace
std
;
16
17
int
main
(
int
argc,
char
*argv[]){
18
if
(argc<5){
19
cout <<
"please append two root files' names you want to compare "
<< endl;
20
cout <<
"realnewrun.exe new.root treename old.root treename [output.root]"
<< endl;
21
return
1;
22
}
23
24
25
TFile
f1
(argv[1]);
26
TTree *t1 = (TTree*)
f1
.Get(argv[2]);
27
TFile f2(argv[3]);
28
TTree *t2 = (TTree*)f2.Get(argv[4]);
29
TString str_output =
"output.root"
;
30
if
(argc>5) str_output = argv[5];
31
TFile f3(str_output,
"recreate"
);
32
TTree *t3 =
new
TTree(
"track"
,
"track"
);
33
int
newrun, newevt;
34
t3->Branch(
"run"
, &newrun,
"run/I"
);
35
t3->Branch(
"event"
, &newevt,
"event/I"
);
36
37
int
run, evt;
38
t1->SetBranchAddress(
"run"
, &run);
39
t1->SetBranchAddress(
"event"
, &evt);
40
char
str[255];
41
for
(
int
i=0; i<t1->GetEntries(); i++){
42
t1->GetEntry(i);
43
sprintf
(str,
"run==%d && event==%d"
, run, evt);
44
if
(t2->GetEntries(str)>0) cout <<
"str: "
<< str <<
" run: "
<< run <<
" event: "
<< evt << endl;
45
else
{
46
newrun = run;
47
newevt = evt;
48
t3->Fill();
49
}
50
}
51
52
f1
.Close();
53
f2.Close();
54
f3.cd();
55
t3->Write();
56
f3.Close();
57
return
0;
58
}
17
int
main
(
int
argc,
char
*argv[]) {
…
}
sprintf
sprintf(cut,"kal_costheta0_em>-0.93&&kal_costheta0_em<0.93&&kal_pxy0_em>=0.05+%d*0.1&&kal_pxy0_em<0.15+%d*0.1&&NGch>=2", j, j)
f1
TFile * f1
Definition
DataBase/tau_mode.c:4
std
Definition
RootEventData/RootEventData_rootcint.cxx:38
main
int main()
Definition
test_IFile.cxx:11
7.1.2
Mdc
DedxCalibAlg
DedxCalibAlg-00-02-01
share
shell
genRawScript
realnewrun.cxx
Generated by
1.12.0