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