149 {
150
151
152 MsgStream log(
msgSvc(), name() );
153 log << MSG::INFO << "EventWriter execute()" << endmsg;
154 collectObjects().ignore();
155
156 if ( m_mode == 2 )
157 {
158 if ( st != 1 )
159 {
160 if ( m_common.m_rectrackEvt )
161 m_single_outputTrees->Branch( "TRecEvent", "TRecTrackEvent", &m_common.m_rectrackEvt,
162 3200000, 1 );
163 if ( m_common.m_evtRecObject )
164 m_single_outputTrees->Branch( "TEvtRecObject", "TEvtRecObject",
165 &m_common.m_evtRecObject, 3200000, 1 );
166 if ( m_common.m_dstEvt )
167 m_single_outputTrees->Branch( "TDstEvent", "TDstEvent", &m_common.m_dstEvt, 3200000,
168 1 );
169 if ( m_common.m_recEvt )
170 m_single_outputTrees->Branch( "TDigiEvent", "TDigiEvent", &m_common.m_recEvt, 3200000,
171 1 );
172 if ( m_common.m_EvtHeader )
173 m_single_outputTrees->Branch( "TEvtHeader", "TEvtHeader", &m_common.m_EvtHeader,
174 3200000, 1 );
175 if ( m_common.m_EvtNavigator )
176 m_single_outputTrees->Branch( "TEvtNavigator", "TEvtNavigator",
177 &m_common.m_EvtNavigator, 3200000, 1 );
178 if ( m_common.m_hltEvt )
179 m_single_outputTrees->Branch( "THltEvent", "THltEvent", &m_common.m_hltEvt, 3200000,
180 1 );
181 if ( m_common.m_mcEvt )
182 m_single_outputTrees->Branch( "TMcEvent", "TMcEvent", &m_common.m_mcEvt, 3200000, 1 );
183 if ( m_common.m_trigEvt )
184 m_single_outputTrees->Branch( "TTrigEvent", "TTrigEvent", &m_common.m_trigEvt, 3200000,
185 1 );
186 m_jobInfoTree->Branch( "JobInfo", &jobInfo );
187 st = 1;
188 }
189
190 if ( m_single_outputFiles->IsZombie() || ( !m_single_outputFiles->IsOpen() ) )
191 {
192 std::cout << "EventWriter ERROR::The ROOT File:" << m_dofileName.c_str()
193 << "status is false" << std::endl;
194 exit( 1 );
195 }
196 int nb = m_single_outputTrees->Fill();
197 if ( nb == -1 )
198 {
199 log << MSG::FATAL << "Error in fill tree (EventWriter) "
200 << m_single_outputTrees->GetName() << " with " << nb << " bytes" << endmsg;
201 exit( 1 );
202 }
203
204 m_single_outputFiles = m_single_outputTrees->GetCurrentFile();
205 }
206 else if ( m_mode == 3 )
207 {
208 log << MSG::FATAL << "The DistBossMode has been abandoned!" << endmsg;
209 return StatusCode::FAILURE;
210 }
211
212 m_common.clear();
213
214 return StatusCode::SUCCESS;
215}