103 {
105 Gaudi::svcLocator()->service(
"MessageSvc",
msgSvc );
106 MsgStream log(
msgSvc,
"PreXtMdcCalib" );
107 log << MSG::DEBUG << "PreXtMdcCalib::fillHist()" << endmsg;
108
110 int lay;
111 int digiId;
112 unsigned fgOverFlow;
113 double tdc;
114 double adc;
115 double traw;
116 double trec;
117 Identifier id;
118
119 IDataProviderSvc* eventSvc = NULL;
120 Gaudi::svcLocator()->service( "EventDataSvc", eventSvc );
121
122 double xtpar[8];
123 if ( !m_fgIniTm )
124 {
126 {
127 m_t0[lay] = m_mdcFunSvc->getT0( lay, 0 );
128 m_mdcFunSvc->getXtpar( lay, 0, 0, xtpar );
129 m_tm[lay] = xtpar[6];
130 }
131 m_fgIniTm = true;
132 }
133
134
135 double tes = -9999.0;
136 int esTimeflag = -1;
137 SmartDataPtr<RecEsTimeCol> aevtimeCol( eventSvc, "/Event/Recon/RecEsTimeCol" );
138 if ( ( !aevtimeCol ) || ( aevtimeCol->size() == 0 ) )
139 {
140 tes = -9999.0;
141 esTimeflag = -1;
142 }
143 else
144 {
145 RecEsTimeCol::iterator iter_evt = aevtimeCol->begin();
146 for ( ; iter_evt != aevtimeCol->end(); iter_evt++ )
147 {
148 tes = ( *iter_evt )->getTest();
149 esTimeflag = ( *iter_evt )->getStat();
150 }
151 }
152 bool flagTes = false;
153 for ( int iEs = 0; iEs < m_param.nEsFlag; iEs++ )
154 {
155 if ( esTimeflag == m_param.esFlag[iEs] )
156 {
157 flagTes = true;
158 break;
159 }
160 }
161 if ( -1 == esTimeflag ) return -1;
162
163 if ( ( m_param.esCut ) &&
164 ( ( !flagTes ) || ( tes < m_param.tesMin ) || ( tes > m_param.tesMax ) ) )
165 return -1;
166
167
168 SmartDataPtr<MdcDigiCol> mdcDigiCol( eventSvc, "/Event/Digi/MdcDigiCol" );
169 if ( !mdcDigiCol ) { log << MSG::FATAL << "Could not find event" << endmsg; }
170
171 MdcDigiCol::iterator
iter = mdcDigiCol->begin();
172 digiId = 0;
173 for ( ;
iter != mdcDigiCol->end();
iter++, digiId++ )
174 {
175 MdcDigi* aDigi = ( *iter );
176 id = ( aDigi )->identify();
177
179
180 tdc = ( aDigi )->getTimeChannel();
181 adc = ( aDigi )->getChargeChannel();
182 fgOverFlow = ( aDigi )->getOverflow();
184 trec = traw - tes - m_t0[lay];
185
186
187
188
189 if ( ( ( fgOverFlow & 1 ) != 0 ) || ( ( fgOverFlow & 12 ) != 0 ) ||
192 continue;
193
194
195 if ( trec > 0 )
196 {
197 if ( trec < m_tm[lay] )
198 {
199 m_nTot[lay]++;
200 m_htrec[lay]->Fill( trec );
201 m_nhitTot->Fill( lay );
202 }
204 {
205 if ( trec < m_tbin[
bin] )
206 {
207 m_nEntries[lay][
bin]++;
208 m_nhitBin[lay]->Fill( m_tbin[
bin] );
209 }
210 }
211 }
212 }
213 return 1;
214}
*******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 bin
const double MdcCalTdcCnv
static int layer(const Identifier &id)
Values of different levels (failure returns 0).
unsigned int getChargeChannel() const
unsigned int getTimeChannel() const