BOSS 7.0.7
BESIII Offline Software System
Loading...
Searching...
No Matches
FillValidRecMdcTrackHisto.c
Go to the documentation of this file.
1void FillValidRecMdcTrackHisto(char *filename="ValidRecMdcTrackNTuple_new.root"){
2 TFile *fin = new TFile(filename,"READ");
3 TTree *mdc = (TTree *)fin->Get("mdcTrack");
4
5 TFile *fin1 = new TFile(filename,"READ");
6 TTree *mdc1 = (TTree *)fin1->Get("mdcHit");
7
8 int nhits;
9 float Nhits,Nster;
10 float eventNo,Cpa, runNo, Id, Phi0;// kappa;
11 float Tanl, Dr, Dz, Chisq, FiTerm;
12 float Hits_ddl,Hits_id;
13 float Hits_ddr, doca, Hits_mdc_id, layer, wire;
14 float Hits_tdc, Hits_adc;// energy, nhits, path1;
15
16
17 mdc->SetBranchAddress("eventNo", &eventNo);
18 mdc->SetBranchAddress("runNo",&runNo);
19 mdc->SetBranchAddress("nhits",&nhits);
20 mdc->SetBranchAddress("Id", &Id);
21 mdc->SetBranchAddress("Phi0", &Phi0);
22 mdc->SetBranchAddress("Tanl",&Tanl);
23 mdc->SetBranchAddress("Cpa",&Cpa);
24 mdc->SetBranchAddress("Dr", &Dr);
25 mdc->SetBranchAddress("Dz", &Dz);
26 mdc->SetBranchAddress("Chisq", &Chisq);
27 mdc->SetBranchAddress("FiTerm", &FiTerm);
28 mdc1->SetBranchAddress("Hits_id", &Hits_id);
29 mdc1->SetBranchAddress("Hits_ddl", &Hits_ddl);
30 mdc1->SetBranchAddress("Hits_ddr", &Hits_ddr);
31 mdc->SetBranchAddress("Nhits", &Nhits);
32 mdc->SetBranchAddress("Nster", &Nster);
33 mdc1->SetBranchAddress("doca", &doca);
34 mdc1->SetBranchAddress("Hits_mdc_id", &Hits_mdc_id);
35 mdc1->SetBranchAddress("layer", &layer);
36 mdc1->SetBranchAddress("wire", &wire);
37 mdc1->SetBranchAddress("Hits_tdc", &Hits_tdc);
38 mdc1->SetBranchAddress("Hits_adc", &Hits_adc);
39// mdc->SetBranchAddress("energy", &energy);
40// mdc->SetBranchAddress("nhits", &nhits);
41// mdc->SetBranchAddress("path1", &path1);
42
43
44
45 TH1F *m_nhits = new TH1F("nhits","nhits",100,0,5000);
46 TH1F *m_eventNo = new TH1F("eventNo","eventNo", 100,0,10000);
47 TH1F *m_runNo = new TH1F("runNo","runNo",100, 0, 100000);
48 TH1F *m_Id = new TH1F("Id","track_id",100,0,100);
49 TH1F *m_Phi0 = new TH1F("Phi0","phi0",100,0,3.14);
50 TH1F *m_Tanl = new TH1F("Tanl","tanl",100,-300,300);
51 TH1F *m_Dr = new TH1F("Dr","dr",100,-300,300);
52 TH1F *m_Dz = new TH1F("Dz","dz",100,-300,300);
53 TH1F *m_Chisq = new TH1F("Chisq","chisq_of_fit",100,-300,3000);
54 TH1F *m_FiTerm = new TH1F("FiTerm","phi_terminal",100,0,6.3);
55 TH1F *m_Nhits = new TH1F("Nhits","number_of_hits",100,0,500);
56 TH1F *m_Nster = new TH1F("Nster","number_of_stereo_hits",100,0,5000);
57 TH1F *m_Cpa = new TH1F("Cpa","cpa",100,0,5000);
58
59 TFile *fout1 = new TFile("ValidRecMdcTrackHist.root","recreate");
60
61 TH1F *m_Hits_id = new TH1F("Hits_id","hits_id",100,0,300);
62 TH1F *m_Hits_ddl = new TH1F("Hits_ddl","hits_ddl",100,-300,300);
63 TH1F *m_Hits_ddr = new TH1F("Hits_ddr","hits_ddr",100,-300,300);
64 TH1F *m_doca = new TH1F("doca","doca",100,-300,300);
65 TH1F *m_Hits_mdc_id = new TH1F("Hits_mdc_id","hits_mdc_id",100,-300,300);
66 TH1F *m_layer = new TH1F("layer","layer",100,-300,300);
67 TH1F *m_wire = new TH1F("wire","wire",100,-300,300);
68 TH1F *m_Hits_tdc = new TH1F("Hits_tdc","hits_tdc",100,-300,300);
69 TH1F *m_Hits_adc = new TH1F("Hits_adc","hits_adc",100,-300,300);
70
71
72 for(int i = 0; i < mdc->GetEntries(); i++){
73 mdc->GetEntry(i);
74
75 m_nhits->Fill(nhits);
76 m_eventNo->Fill(eventNo);
77 m_runNo->Fill(runNo);
78 m_Id->Fill(Id);
79 m_Phi0->Fill(Phi0);
80 m_Cpa->Fill(Cpa);
81 m_Tanl->Fill(Tanl);
82
83 m_Dr->Fill(Dr);
84 m_Dz->Fill(Dz);
85 m_Chisq->Fill(Chisq);
86 m_FiTerm->Fill(FiTerm);
87 m_Nhits->Fill(Nhits);
88 m_Nster->Fill(Nster);
89/*
90 m_Hits_id->Fill(Hits_id);
91 m_Hits_ddl->Fill(Hits_ddl);
92 m_Hits_ddr->Fill(Hits_ddr);
93 m_doca->Fill(doca);
94 m_Hits_mdc_id->Fill(Hits_mdc_id);
95 m_layer->Fill(layer);
96 m_wire->Fill(wire);
97 m_Hits_tdc->Fill(Hits_tdc);
98 m_Hits_adc->Fill(Hits_adc);
99*/
100
101 }
102 for(int i = 0; i < mdc1->GetEntries(); i++){
103 mdc1->GetEntry(i);
104
105 m_Hits_id->Fill(Hits_id);
106 m_Hits_ddl->Fill(Hits_ddl);
107 m_Hits_ddr->Fill(Hits_ddr);
108 m_doca->Fill(doca);
109 m_Hits_mdc_id->Fill(Hits_mdc_id);
110 m_layer->Fill(layer);
111 m_wire->Fill(wire);
112 m_Hits_tdc->Fill(Hits_tdc);
113 m_Hits_adc->Fill(Hits_adc);
114 }
115 m_nhits->Write();
116 m_eventNo->Write();
117 m_runNo->Write();
118 m_Id->Write();
119 m_Phi0->Write();
120 m_Cpa->Write();
121
122 m_Tanl->Write();
123 m_Dr->Write();
124 m_Dz->Write();
125 m_Chisq->Write();
126 m_FiTerm->Write();
127 m_Nhits->Write();
128 m_Nster->Write();
129 m_Hits_id->Write();
130 m_Hits_ddl->Write();
131 m_Hits_ddr->Write();
132 m_doca->Write();
133 m_Hits_mdc_id->Write();
134 m_layer->Write();
135 m_wire->Write();
136 m_Hits_tdc->Write();
137 m_Hits_adc->Write();
138
139 fin->Close();
140 fin1->Close();
141 fout1->Close();
142}
std::string mdc
Definition: CalibModel.cxx:45
int runNo
Definition: DQA_TO_DB.cxx:12
void FillValidRecMdcTrackHisto(char *filename="ValidRecMdcTrackNTuple_new.root")
int eventNo
NTuple::Array< double > m_doca
Definition: MdcHistItem.h:102
NTuple::Array< double > m_wire
Definition: MdcHistItem.h:111
NTuple::Array< double > m_layer
Definition: MdcHistItem.h:110
int nhits