59 {
60 if ( m_phase < 1 || m_phase > 3 )
61 {
62 if ( serviceLocator()->existsService( "RawDataInputSvc" ) )
63 {
64
65 SmartIF<IRawDataInputSvc> raw_svc = service<IRawDataInputSvc>( "RawDataInputSvc" );
66 if ( !raw_svc )
67 {
68 error() <<
"Failed to get RawDataInputSvc" << endmsg;
69 exit( 1 );
70 }
71 m_phase =
fromRun( raw_svc->runNo() );
72 }
73 else if ( serviceLocator()->existsService( "EventCnvSvc" ) )
74 {
75
76
77
78
79
80
81
82
83 SmartIF<IOptionsSvc> opt_svc = service<IOptionsSvc>( "JobOptionsSvc" );
84 if ( !opt_svc )
85 {
86 error() <<
"Failed to get JobOptionsSvc" << endmsg;
87 exit( 1 );
88 }
89 std::vector<std::string> digi_inputs;
90 Gaudi::Parsers::parse( digi_inputs,
91 opt_svc->get( "EventCnvSvc.digiRootInputFile", "" ) );
92 if ( digi_inputs.size() == 0 )
93 {
94 error() <<
"Failed to get digiRootInputFile" << endmsg;
95 exit( 1 );
96 }
97
98 debug() << "Match result: " << digi_inputs[0] << std::endl;
99
100
101 TFile*
file = TFile::Open( digi_inputs[0].
c_str(),
"READ" );
102 TTree* tree = (TTree*)
file->Get(
"Event" );
103 tree->SetMakeClass( 1 );
104 int run;
105 tree->SetBranchAddress( "m_runId", &run );
106 tree->GetEntry( 0 );
107
109 }
110 else if ( serviceLocator()->existsService( "RealizationSvc" ) )
111 {
112
113 SmartIF<IRealizationSvc> real_svc = service<IRealizationSvc>( "RealizationSvc" );
114 if ( !real_svc )
115 {
116 error() <<
"Failed to get RealizationSvc" << endmsg;
117 exit( 1 );
118 }
119 m_phase =
fromRun(
abs( real_svc->getRunId() ) );
120 }
121 }
122
123 debug() << "m_phase: " << m_phase << std::endl;
124
125
126 if ( m_phase < 1 || m_phase > 3 )
127 {
128 error() <<
"Phase is not in {1, 2, 3}" << endmsg;
129 exit( 1 );
130 }
131
132 return m_phase;
133}
int fromRun(unsigned int run)