std::cout << "for a given (GAIN-CHANNEL-DAC) " << std::endl; std::cout << "chid " << chid << std::endl; std::cout << "Channel " << Channel << std::endl; std::cout << "CalibLine " << CalibLine << std::endl; std::cout << "channel_eta " << eta << std::endl; std::cout << "real_eta " << real_eta << std::endl; std::cout << "channel_phi " << phi << std::endl; std::cout << "real_phi " << real_phi << std::endl; std::cout << "sample " << sample << std::endl; std::cout << "layer " << layer << std::endl; std::cout << "barrel_ec " << barrel_ec << std::endl;
std::cout << "pos_neg " << pos_neg << std::endl;
std::cout << "FT " << FT << std::endl; std::cout << "FEBid " << m_FEBid << std::endl; std::cout << "Slot " << slot << std::endl; std::cout << "radius " << radius << std::endl; std::cout << "tcali " << tcali << std::endl; std::cout << "tcalipredicted " << m_tCalibPredicted << std::endl; std::cout << "CalibCables " << CalibCables << std::endl; std::cout << "Signal " << m_SignalCables << std::endl; std::cout << "TOF " << TOF << std::endl; std::cout << "DeltaTTC " << DeltaTTC << std::endl; std::cout << "tphys " << tphys << std::endl; std::cout << "t0 " << t0 << std::endl; time difference between calibration and physics can be easily computed: tdiff=tphys-tcali;
sc = detStore->record(larPhysCaliTdiffComplete,m_keyoutput); if (sc != StatusCode::SUCCESS) { log << MSG::ERROR
<< " Cannot store LArPhysCaliTdiffComplete in TDS " << endmsg; return sc; } Make symlink sc = detStore->symLink(larPhysCaliTdiffComplete,(ILArPhysCaliTdiff*)larPhysCaliTdiffComplete); if (sc != StatusCode::SUCCESS) { log << MSG::ERROR << " Cannot make link for Data Object " << endmsg; return sc; }
115{
117
118 const double meter2ns = 3.33564095;
120 int CalibLine;
121 double tphys;
122 double tcali;
124 double TOF;
125 double CalibCables=0;
126 double LSignalFCAL=0;
127 double DeltaTTC;
129 int barrel_ec;
134 int slot;
135 int pos_neg;
136 double real_eta;
137 double real_phi;
139
140
141 const LArCaliWaveContainer* larCaliWaveContainer = nullptr;
144
145
146
147
148
149
150 IAlgTool* algTool = nullptr;
151 ATH_CHECK( toolSvc()->retrieveTool(
"CaloDepthTool", algTool,
this) );
154
155 SG::ReadCondHandle<LArCalibLineMapping> clHdl{
m_calibMapKey};
157 const LArCalibLineMapping *clCont{*clHdl};
158
159 SG::ReadCondHandle<LArOnOffIdMapping> cablingHdl{
m_cablingKey};
161 const LArOnOffIdMapping*
cabling{*cablingHdl};
162
163 SG::ReadCondHandle<CaloDetDescrManager> caloMgrHandle{
m_caloMgrKey};
165 const CaloDetDescrManager* caloDDM{*caloMgrHandle};
166
167
168 LArWaveHelper larWaveHelper;
169
170 const LArOnlineID* onlineHelper = nullptr;
172
173 const CaloCell_ID* caloCID = nullptr;
175
176
180
181
182
184
187
188 if ( cell_it == cell_it_e ) {
190 continue;
191 } else {
193 }
194
195
196 int nchannels = 0;
197
198 for ( ; cell_it != cell_it_e; ++cell_it) {
199
201 std::cout << "nchannels " << nchannels << std::endl;
202 nchannels++;
203
206 if ( wave_it == wave_it_e ) {
208 continue;
209 }
210
211
213
215
216 try {
217 id =
cabling->cnvToIdentifier(chid);
218 } catch ( const LArID_Exception& ) {
219 ATH_MSG_ERROR (
"LArCabling exception caught for channel " << MSG::hex << chid << MSG::dec );
220 continue;
221 }
222
224
225 const std::vector<HWIdentifier>& calibLineV = clCont->
calibSlotLine(chid);
226 std::vector<HWIdentifier>::const_iterator calibLineIt = calibLineV.begin();
227 CalibLine = onlineHelper->
channel(*calibLineIt) ;
228
229
241 layer=fcalId->module(
id);}
242 else {
244 continue;
245 }
246
247
248 pos_neg = onlineHelper->
pos_neg(chid);
249 barrel_ec = onlineHelper->
barrel_ec(chid);
251 slot = onlineHelper->
slot(chid);
252
253
254 HWIdentifier febid = onlineHelper->
feb_Id(chid);
256
257
259 const CaloDetDescrElement* theDDE = caloDDM->
get_element(theHash) ;
260
261 if(theDDE==nullptr) {
262 ATH_MSG_INFO (
"CellIndex = " << theHash <<
" has a DDE pointer NULL " );
263 continue;
264 }
265
266 real_eta = theDDE->
eta();
267 real_phi = theDDE->
phi();
269
270
271
272
275 }
277 if(layer==0)
radius=4398.;
278 if(layer==1)
radius=4806.;
279 if(layer==2)
radius=5359.;
280 if(layer==3)
radius=5840.;
281 }
286 }
287
288 for ( ; wave_it != wave_it_e; ++wave_it) {
289
290
291 tphys=-999.;
292
293
294 dt = wave_it->getDt();
295 tcali =
dt * larWaveHelper.
getMax(*wave_it);
296
297 const unsigned Nbase=5;
298 double rT0=0.;
299 double asamp1=0.;
300 double asamp2=0.;
302 double amax = larWaveHelper.
getMaxAmp(*wave_it);
303 unsigned int imax=larWaveHelper.
getMax(*wave_it);
304
305 for (
unsigned int i=1;
i<
imax ;
i++) {
306 asamp1=wave_it->getSample(i);
307 asamp2=wave_it->getSample(i-1);
308 if((asamp1-
base)>amax*0.10 && (asamp2-
base)<amax*0.10)
309 rT0 =
i-1+(0.01*amax-(asamp2-
base))/(asamp1-asamp2);
310 }
312
313
314 if(emId->
is_lar_em(
id) && barrel_ec==0) TOF = fabs(radius)*TMath::CosH(real_eta)* meter2ns/1000;
315 else TOF = fabs(radius)/TMath::TanH(fabs(real_eta))* meter2ns/1000;
316
317
318
320 for(int ieta=0;ieta<16;ieta++){
322 }
323 }
327
328
332 }
333 else {
336
337
339 if((emId->
is_lar_em(
id) && abs(barrel_ec)==1 && FT==2 && real_eta>0 && slot>10) || (emId->
is_lar_em(
id) && abs(barrel_ec)==1 && FT==3 && real_eta>0 && slot<3)) DeltaTTC=
m_vDeltaTTC_ECA_SPEC[0][1];
341
343 if((emId->
is_lar_em(
id) && abs(barrel_ec)==1 && FT==9 && real_eta>0 && slot>10) || (emId->
is_lar_em(
id) && abs(barrel_ec)==1 && FT==10 && real_eta>0 && slot<3)) DeltaTTC=
m_vDeltaTTC_ECA_SPEC[1][1];
345
347 if((emId->
is_lar_em(
id) && abs(barrel_ec)==1 && FT==15 && real_eta>0 && slot>10) || (emId->
is_lar_em(
id) && abs(barrel_ec)==1 && FT==16 && real_eta>0 && slot<3)) DeltaTTC=
m_vDeltaTTC_ECA_SPEC[2][1];
349
351 if((emId->
is_lar_em(
id) && abs(barrel_ec)==1 && FT==21 && real_eta>0 && slot>10) || (emId->
is_lar_em(
id) && abs(barrel_ec)==1 && FT==21 && real_eta>0 && slot<3)) DeltaTTC=
m_vDeltaTTC_ECA_SPEC[3][1];
353
355 if((emId->
is_lar_em(
id) && abs(barrel_ec)==1 && FT==2 && real_eta<0 && slot>10) || (emId->
is_lar_em(
id) && abs(barrel_ec)==1 && FT==3 && real_eta<0 && slot<3)) DeltaTTC=
m_vDeltaTTC_ECC_SPEC[0][1];
357
359 if((emId->
is_lar_em(
id) && abs(barrel_ec)==1 && FT==9 && real_eta<0 && slot>10) || (emId->
is_lar_em(
id) && abs(barrel_ec)==1 && FT==10 && real_eta<0 && slot<3)) DeltaTTC=
m_vDeltaTTC_ECC_SPEC[1][1];
361
363 if((emId->
is_lar_em(
id) && abs(barrel_ec)==1 && FT==15 && real_eta<0 && slot>10) || (emId->
is_lar_em(
id) && abs(barrel_ec)==1 && FT==16 && real_eta<0 && slot<3)) DeltaTTC=
m_vDeltaTTC_ECC_SPEC[2][1];
365
367 if((emId->
is_lar_em(
id) && abs(barrel_ec)==1 && FT==21 && real_eta<0 && slot>10) || (emId->
is_lar_em(
id) && abs(barrel_ec)==1 && FT==21 && real_eta<0 && slot<3)) DeltaTTC=
m_vDeltaTTC_ECC_SPEC[3][1];
369 }
370
371
372
373
374
375 if(pos_neg==1 && emId->
is_lar_em(
id) && abs(barrel_ec)==0) tphys=tcali-CalibCables+TOF+DeltaTTC+8+0.3*
m_sLTP;
376 else if(pos_neg==0 && emId->
is_lar_em(
id) && abs(barrel_ec)==0) tphys=tcali-CalibCables+TOF+DeltaTTC+0.3*
m_sLTP;
377 else if(pos_neg==1 && emId->
is_lar_em(
id) && abs(barrel_ec)==1) tphys=tcali-CalibCables+TOF+DeltaTTC+8;
380 else tphys=tcali-CalibCables+TOF+DeltaTTC;
381
382
383
384 if(emId->
is_lar_em(
id) && abs(barrel_ec)==0){
385 for(int ieta=0;ieta<16;ieta++){
388 }
389 }
393
396
397
398
399
400
428
429
454
455
456
460 }
461
462 }
463
464 }
465
466
484
485
486
487
489 return StatusCode::SUCCESS ;
490}
Scalar eta() const
pseudorapidity method
Scalar phi() const
phi method
#define ATH_MSG_VERBOSE(x)
LArCaliWaveContainer::LArCaliWaves::const_iterator CaliWaveIt
LArCaliWaveContainer::ConstConditionsMapIterator CaliCellIt
const ServiceHandle< StoreGateSvc > & detStore() const
bool is_lar_em(Identifier id) const
bool is_lar_fcal(Identifier id) const
bool is_lar_hec(Identifier id) const
IdentifierHash calo_cell_hash(const Identifier cellId) const
create hash id from 'global' cell id
const LArFCAL_ID * fcal_idHelper() const
access to FCAL idHelper
CaloSampling::CaloSample CaloSample
const LArEM_ID * em_idHelper() const
access to EM idHelper
const LArHEC_ID * hec_idHelper() const
access to HEC idHelper
CaloCell_ID::CaloSample getSampling() const
cell sampling
float eta() const
cell eta
float phi() const
cell phi
const CaloDetDescrElement * get_element(const Identifier &cellId) const
get element by its identifier
value_type get_compact() const
Get the compact id.
Identifier32 get_identifier32() const
Get the 32-bit version Identifier, will be invalid if >32 bits needed.
const std::vector< HWIdentifier > & calibSlotLine(const HWIdentifier id) const
HWIdentifier channelId() const
ConstConditionsMapIterator begin(unsigned int gain) const
get iterator for all channels for a gain
ConstConditionsMapIterator end(unsigned int gain) const
end of all channels for this gain
int eta(const Identifier id) const
return eta according to :
int phi(const Identifier id) const
return phi according to :
int sampling(const Identifier id) const
return sampling according to :
int eta(const Identifier id) const
eta [0,63] module 1 ; [0,31] module 2 ; [0,15] module 3
int phi(const Identifier id) const
phi [0,15]
int phi(const Identifier id) const
return phi[0,63] outer part [0,31] inner part
int eta(const Identifier id) const
return eta [0,9] outer part [0,3] inner part
int sampling(const Identifier id) const
return sampling [0,3] (only 0 for supercells)
int feedthrough(const HWIdentifier id) const
Return the feedthrough of a hardware cell identifier : feedthrough = [0,31] Barrel - A/C side or H/...
int slot(const HWIdentifier id) const
Return the slot number of a hardware cell identifier: slot = [1,15] Slot-ID in top part of the crat...
int barrel_ec(const HWIdentifier id) const
Return the position barrel or endcap of a hardware cell identifier: barrel_ec = [0,...
int channel(const HWIdentifier id) const
Return the channel number of a hardware cell identifier channel = [0,127] in all FEB.
int pos_neg(const HWIdentifier id) const
Return the side of a hardware cell identifier pos_neg = [0,1] positive-side or negative-side Barrel...
HWIdentifier feb_Id(int barrel_ec, int pos_neg, int feedthrough, int slot) const
Create feb_Id from fields.
double getMaxAmp(const LArWave &theWave) const
double getBaseline(const LArWave &theWave, unsigned nBase) const
unsigned int getMax(const LArWave &theWave) const
return index of maximum sample
Identifier32::value_type Channel
retrieve(aClass, aKey=None)