50 {
51 MsgStream log(
msgSvc(), name());
52
53 log << MSG::INFO << "in initialize()" << endmsg;
54 StatusCode status;
55
56
57
58
59
60
61
62 if(service("THistSvc", m_thsvc).isFailure()) {
63 log << MSG::ERROR << "Couldn't get THistSvc" << endreq;
64 return StatusCode::FAILURE;
65 }
66
67
68
69 NTuplePtr nt_bb(
ntupleSvc(),
"DQAFILE/DEDX");
70 if ( nt_bb ) m_bb_tuple = nt_bb;
71 else {
72 m_bb_tuple =
ntupleSvc()->book(
"DQAFILE/DEDX/Bhabha", CLID_ColumnWiseTuple,
"Dedx ntuple");
73 if( m_bb_tuple ) {
74 status = m_bb_tuple->addItem("runNo", m_bb_runNo);
75 status = m_bb_tuple->addItem("event", m_bb_event);
76 status = m_bb_tuple->addItem("p", m_bb_p);
77 status = m_bb_tuple->addItem("costh", m_bb_costh);
78 status = m_bb_tuple->addItem("t0", m_bb_t0);
79 status = m_bb_tuple->addItem("chiE",m_bb_chiE);
80 status = m_bb_tuple->addItem("chiMu",m_bb_chiMu);
81 status = m_bb_tuple->addItem("chiPi",m_bb_chiPi);
82 status = m_bb_tuple->addItem("chiK",m_bb_chiK);
83 status = m_bb_tuple->addItem("chiP",m_bb_chiP);
84 status = m_bb_tuple->addItem("nhit", m_bb_nhit);
85 status = m_bb_tuple->addItem("ndedxhit", m_bb_ndedxhit);
86 status = m_bb_tuple->addItem("dEdx", m_bb_dEdx);
87 } else {
88 log << MSG::ERROR << "Can not book N-tuple:" << long(m_bb_tuple) << endreq;
89 }
90 }
91
92 TH1F* h_dedx_bb = new TH1F("Dedx_bhabha", "dEdx distribution of bhabha samples", 150, 0., 1500.);
93 if(m_thsvc->regHist("/DQAHist/Dedx/Bhabha/dedx", h_dedx_bb).isFailure()) {
94 log << MSG::ERROR << "Couldn't register Dedx_bhabha" << endreq;
95 }
96 TH1F* h_dedxbarrel_bb = new TH1F("Dedx_Barrel_bhabha", "dEdx distribution of barrel bhabha samples", 150, 0., 1500.);
97 if(m_thsvc->regHist("/DQAHist/Dedx/Bhabha/dedx_barrel", h_dedxbarrel_bb).isFailure()) {
98 log << MSG::ERROR << "Couldn't register Dedx_Barrel_bhabha" << endreq;
99 }
100 TH1F* h_chie_bb = new TH1F("ChiE_bhabha", "ChiE distribution of bhabha samples", 200, -20., 20.);
101 if(m_thsvc->regHist("/DQAHist/Dedx/Bhabha/chiE", h_chie_bb).isFailure()) {
102 log << MSG::ERROR << "Couldn't register chiE_bhabha" << endreq;
103 }
104 TH1F* h_nhitdedx_bb = new TH1F("Nhitdedx", "dEdx used hits", 40, 0., 60.);
105 if(m_thsvc->regHist("/DQAHist/Dedx/Bhabha/nhitdedx", h_nhitdedx_bb).isFailure()) {
106 log << MSG::ERROR << "Couldn't register Nhitdedx" << endreq;
107 }
108 TH1F* h_nhit_bb = new TH1F("Nhit", "Total hits", 40, 0., 60.);
109 if(m_thsvc->regHist("/DQAHist/Dedx/Bhabha/nhit", h_nhit_bb).isFailure()) {
110 log << MSG::ERROR << "Couldn't register Nhit" << endreq;
111 }
112 TH2F* h_dedxvsp_bb=new TH2F("dEdx vs momentume","dEdx vs momentume", 200,0,2.5,200,0,2000);
113 if(m_thsvc->regHist("/DQAHist/Dedx/Bhabha/dedx_p", h_dedxvsp_bb).isFailure()) {
114 log << MSG::ERROR << "Couldn't register dedx vs p" << endreq;
115 }
116 TH2F* h_dedxvscos_bb=new TH2F("dEdx vs costheta","dEdx vs costheta", 100,-1,1,150,0,1500);
117 if(m_thsvc->regHist("/DQAHist/Dedx/Bhabha/dedx_costh", h_dedxvscos_bb).isFailure()) {
118 log << MSG::ERROR << "Couldn't register dedx vs costh" << endreq;
119 }
120 TH2F* h_dedxvst0_bb=new TH2F("dEdx vs t0","dEdx vs t0", 250,0,2500,150,0,1500);
121 if(m_thsvc->regHist("/DQAHist/Dedx/Bhabha/dedx_t0", h_dedxvst0_bb).isFailure()) {
122 log << MSG::ERROR << "Couldn't register dedx vs t0" << endreq;
123 }
124
125
126 NTuplePtr nt_du(
ntupleSvc(),
"DQAFILE/DEDX");
127 if ( nt_du ) m_bb_tuple = nt_du;
128 else {
129 m_du_tuple =
ntupleSvc()->book(
"DQAFILE/DEDX/Dimu", CLID_ColumnWiseTuple,
"Dedx ntuple");
130 if( m_du_tuple ) {
131 status = m_du_tuple->addItem("runNo", m_du_runNo);
132 status = m_du_tuple->addItem("event", m_du_event);
133 status = m_du_tuple->addItem("p", m_du_p);
134 status = m_du_tuple->addItem("costh", m_du_costh);
135 status = m_du_tuple->addItem("t0", m_du_t0);
136 status = m_du_tuple->addItem("chiE",m_du_chiE);
137 status = m_du_tuple->addItem("chiMu",m_du_chiMu);
138 status = m_du_tuple->addItem("chiPi",m_du_chiPi);
139 status = m_du_tuple->addItem("chiK",m_du_chiK);
140 status = m_du_tuple->addItem("chiP",m_du_chiP);
141 status = m_du_tuple->addItem("nhit", m_du_nhit);
142 status = m_du_tuple->addItem("ndedxhit", m_du_ndedxhit);
143 status = m_du_tuple->addItem("dEdx", m_du_dEdx);
144 } else {
145 log << MSG::ERROR << "Can not book N-tuple:" << long(m_du_tuple) << endreq;
146 }
147 }
148
149
150 TH1F* h_dedx_du = new TH1F("Dedx_dimu", "dEdx distribution of bhabha samples", 150, 0., 1500.);
151 if(m_thsvc->regHist("/DQAHist/Dedx/Dimu/dedx", h_dedx_du).isFailure()) {
152 log << MSG::ERROR << "Couldn't register Dedx_dimu" << endreq;
153 }
154 TH1F* h_dedxbarrel_du = new TH1F("Dedx_Barrel_dimu", "dEdx distribution of barrel bhabha samples", 150, 0., 1500.);
155 if(m_thsvc->regHist("/DQAHist/Dedx/Dimu/dedx_barrel", h_dedxbarrel_du).isFailure()) {
156 log << MSG::ERROR << "Couldn't register Dedx_Barrel_dimu" << endreq;
157 }
158 TH1F* h_chimu_du = new TH1F("ChiE_dimu", "ChiE distribution of bhabha samples", 200, -20., 20.);
159 if(m_thsvc->regHist("/DQAHist/Dedx/Dimu/chiMu", h_chimu_du).isFailure()) {
160 log << MSG::ERROR << "Couldn't register chiMu_dimu" << endreq;
161 }
162 TH1F* h_nhitdedx_du = new TH1F("Nhitdedx", "dEdx used hits", 40, 0., 60.);
163 if(m_thsvc->regHist("/DQAHist/Dedx/Dimu/nhitdedx", h_nhitdedx_du).isFailure()) {
164 log << MSG::ERROR << "Couldn't register Nhitdedx" << endreq;
165 }
166 TH1F* h_nhit_du = new TH1F("Nhit", "Total hits", 40, 0., 60.);
167 if(m_thsvc->regHist("/DQAHist/Dedx/Dimu/nhit", h_nhit_du).isFailure()) {
168 log << MSG::ERROR << "Couldn't register Nhit" << endreq;
169 }
170 TH2F* h_dedxvsp_du=new TH2F("dEdx vs momentume","dEdx vs momentume", 200,0,2.5,200,0,2000);
171 if(m_thsvc->regHist("/DQAHist/Dedx/Dimu/dedx_p", h_dedxvsp_du).isFailure()) {
172 log << MSG::ERROR << "Couldn't register dedx vs p" << endreq;
173 }
174 TH2F* h_dedxvscos_du=new TH2F("dEdx vs costheta","dEdx vs costheta", 100,-1,1,150,0,1500);
175 if(m_thsvc->regHist("/DQAHist/Dedx/Dimu/dedx_costh", h_dedxvscos_du).isFailure()) {
176 log << MSG::ERROR << "Couldn't register dedx vs costh" << endreq;
177 }
178 TH2F* h_dedxvst0_du=new TH2F("dEdx vs t0","dEdx vs t0", 200,0,2500,150,0,1500);
179 if(m_thsvc->regHist("/DQAHist/Dedx/Dimu/dedx_t0", h_dedxvst0_du).isFailure()) {
180 log << MSG::ERROR << "Couldn't register dedx vs t0" << endreq;
181 }
182
183
184
185
186 log << MSG::INFO << "successfully return from initialize()" <<endmsg;
187 return StatusCode::SUCCESS;
188
189
190}