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