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