no pre-processed result is available, and then calculate ETS on the fly ...
reset IST and the flag...
69{
70 MsgStream log(
msgSvc(), name());
71
72 SmartDataPtr<Event::EventHeader> eventHeader(eventSvc(),"/Event/EventHeader");
73
74
75 if ( m_fixer ==
NULL ) {
76
77 if ( m_run == -1 ) {
78 m_run = eventHeader->runNumber();
79 if ( std::find(m_runList.begin(), m_runList.end(), m_run) != m_runList.end() ) {
80 SmartDataPtr<CalibData::CorrectedETSCal> calConst(m_calibDataSvc, "/Calib/CorrectedETS");
81 if( calConst ) {
82 m_alreadyInDB = true;
83 }
84 else {
85 log << MSG::FATAL << "no result in DB for run " << m_run << endreq;
86 return StatusCode::FAILURE;
87 }
88 }
89 }
90
91
92 if ( m_alreadyInDB ) {
93 if ( m_run != eventHeader->runNumber() ) {
94 log << MSG::FATAL << "crossed runs are not supported" << endreq;
95 return StatusCode::FAILURE;
96 }
97
98 SmartDataPtr<CalibData::CorrectedETSCal> calConst(m_calibDataSvc, "/Calib/CorrectedETS");
99
100 if ( m_count >= calConst->getNpar() || eventHeader->eventNumber() != calConst->getEvt(m_count) ) {
101 log << MSG::FATAL << "only 1 input file is supported" << endreq;
102 return StatusCode::FAILURE;
103 }
104
105 eventHeader->setRawEtsT1( eventHeader->etsT1() );
106 eventHeader->setEtsT1( calConst->getEts1(m_count) );
107 eventHeader->setEtsT2( calConst->getEts2_pre(m_count) );
108 eventHeader->setEtsFlag( calConst->getFlag_pre(m_count) );
109
110 ++m_count;
111
112 return StatusCode::SUCCESS;
113 }
114
115
116 }
117 else {
118
119 m_fixer->
fixT1(eventHeader);
120 }
121
122
123
124
125 if(m_readInjSigTimeFromDB){
126 int Npar = m_InjSigTimeSvc-> getNpar();
127 for(int i=0; i<Npar; i++){
128 int flag = m_InjSigTimeSvc-> getFlag(i);
129 ULong64_t
time = m_InjSigTimeSvc-> getIST(i);
130 m_vecFlag.push_back(
flag);
131 m_vecTime.push_back(
time);
132 if(m_dump){
133 std::cout<<
"flag: "<<
flag<<
" time: "<<
time<<std::endl;
134 }
135 }
136 m_readInjSigTimeFromDB = false;
137 }
138
139 if(m_readInjSigIntervalFromDB){
140 m_interval = double(m_InjSigIntervalSvc->
getTInterval());
141 m_readInjSigIntervalFromDB = false;
142 }
143
144 if(m_printInterval){
145 cout << "ResetEts::execute() m_interval = " << m_interval << endl;
146 m_printInterval = false;
147 }
148
149 unsigned long t1 = eventHeader->etsT1();
150 unsigned long t2 = eventHeader->etsT2();
151
152 if ( m_dump ) {
153
154 std::cout<<"raw data"<<std::endl<< "Event: " << eventHeader->eventNumber()
155 << " run: " << eventHeader->runNumber()
156 << " time: " << eventHeader->time()
157 << " ETS_old: " << t1
158 << " IST_old: " << t2
159 << std::endl;
160 }
161
163 double size = m_interval*
unit;
164 unsigned long ets2_pre = 0;
165 int flag_pre = 0;
166
167
168 int vec_size = m_vecTime.size();
169 for(int i=m_curIndex;i<vec_size;i++)
170 {
171 if (t1 < m_vecTime[i])
172 {
173 if(i==0){
174 flag_pre = m_vecFlag[i];
175 ets2_pre = m_vecTime[i];
176 m_curIndex = i;
177 break;
178 }
179 else{
180
181 double delta= ((double)m_vecTime[i-1]-(
double)t1)/size;
182
184 {
187 if(i<0){
188 i=-1;
189 }
190 continue;
191 }
192 else{
193 ets2_pre = m_vecTime[i-1];
194 flag_pre = m_vecFlag[i-1];
195 m_curIndex = i;
196 break;
197 }
198 }
199 }
200 else if (t1 >= m_vecTime[vec_size-1]){
201 flag_pre = m_vecFlag[vec_size-1];
202 ets2_pre = m_vecTime[vec_size-1];
203 break;
204
205 }
206 }
207
208
209 eventHeader->setEtsT2(ets2_pre);
210 eventHeader->setEtsFlag(flag_pre);
211
212 if ( m_dump ) {
213
214 std::cout<<"ReSetETSAlg"<<std::endl<< "Event: " << eventHeader->eventNumber()
215 << " run: " << eventHeader->runNumber()
216 << " time: " << eventHeader->time()
217 << " ETS_new: " << eventHeader->etsT1()
218 << " IST_new: " << eventHeader->etsT2()
219 << " flag_pre: " << eventHeader->etsFlag()
220 << std::endl;
221 }
222
223
224 return StatusCode::SUCCESS;
225}
*******INTEGER m_nBinMax INTEGER m_NdiMax !No of bins in histogram for cell exploration division $ !Last vertex $ !Last active cell $ !Last cell in buffer $ !No of sampling when dividing cell $ !No of function total $ !Flag for random ceel for $ !Flag for type of for WtMax $ !Flag which decides whether vertices are included in the sampling $ entire domain is hyp !Maximum effective eevents per saves r n generator level $ !Flag for chat level in !Latex Output unit
void fixT1(Event::EventHeader *header)
virtual int getTInterval() const =0