32 (
const std::string&
type,
33 const std::string& name,
34 const IInterface* parent)
43 declareProperty(
"CaloEtaCut",
m_etaCut );
44 declareProperty(
"CaloPhiCut",
m_phiCut );
47 declareProperty(
"CaloDetectors",
m_caloNums );
56 CHECK( detStore.retrieve() ) ;
65 const unsigned int nSubCalo = 7;
70 ATH_MSG_INFO(
" *** SCFillerTool: No calorimeter selection" );
71 return StatusCode::SUCCESS;
74 <<
" More than " << nSubCalo <<
" calo specified. "
75 <<
"Must be wrong. Stop.";
76 return StatusCode::FAILURE;
82 <<
"Invalid calo specification:"
84 return StatusCode::FAILURE;
97 REPORT_MESSAGE( MSG::FATAL ) <<
" *** SCFillerTool: Invalid Eta Cut Range specified: Abort!";
98 return StatusCode::FAILURE;
108 REPORT_MESSAGE( MSG::FATAL ) <<
" *** SCFillerTool: Invalid Phi Cut Range specified: Abort!";
109 return StatusCode::FAILURE;
116 REPORT_MESSAGE( MSG::FATAL ) <<
" *** SCFillerTool: Invalid No. of Calo Layer selection: " <<
m_caloLayers.size() <<
" Abort!";
117 return StatusCode::FAILURE;
122 return StatusCode::FAILURE;
131 return StatusCode::SUCCESS;
154 return StatusCode::SUCCESS;
172 ATH_MSG_INFO(
"**** after fillHashTables in first event");
178 CONTAINER::const_iterator f_cell = p.begin();
179 CONTAINER::const_iterator l_cell = p.end();
180 for( ; f_cell != l_cell; ++f_cell ) {
188 std::vector<int>::iterator it;
193 int pn = ((key >> 28) & 0x1) ? 1: -1;
194 int calo = ((key >> 24) & 0xf)*pn;
195 int region = (key>>20) & 0xf;
196 unsigned int lay = (key>>16) & 0xf;
197 int ieta = (key>>8) & 0xff;
198 int jphi = key & 0xff;
202 int lardet = abs((key >> 24) & 0xf);
205 std::vector< unsigned int >::const_iterator theFound =
224 m_calo->push_back( calo );
227 m_ieta->push_back( ieta );
228 m_jphi->push_back( jphi );
230 m_eta->push_back( feta );
236 return StatusCode::SUCCESS;
240 std::map<int,double>::iterator it;
251 CONTAINER::const_iterator f_cell = p.begin();
252 CONTAINER::const_iterator l_cell = p.end();
254 for( ; f_cell != l_cell; ++f_cell ) {
257 int posneg = (cell->eta()>=0.0) ? 1: -1;
261 if (
m_emid->is_lar_em(
id) ) {
262 if (
m_emid->is_em_barrel(
id) ) {
263 int ieta =
m_emid->eta(
id);
264 int jphi =
m_emid->phi(
id);
265 int lay =
m_emid->sampling(
id);
267 std::cout <<
"SCFillerTool::dumpHashTables() [ONLY EM BARREL] ==> posneg,lay,ieta,jphi= " << posneg <<
", " << lay <<
", " << ieta <<
", " << jphi <<
" ID: " <<
id <<
" sc_hash: " << sc_hash << std::endl;
274 int scID = (*it).first;
276 std::vector<const CaloCell*> v = (*it).second;
278 int pn = ((key >> 28) & 0x1) ? 1: -1;
279 int calo = ((key >> 24) & 0xf)*pn;
280 int region = (key>>20) & 0xf;
281 unsigned int lay = (key>>16) & 0xf;
282 int ieta = (key>>8) & 0xff;
283 int jphi = key & 0xff;
284 if (abs(calo)==1 && pn>0) {
285 std::cout <<
"SCFillerTool::dumpHashTables() ===> scID = " << scID <<
" calo,pn,region,lay,ieta,jphi: " << calo <<
", " << pn <<
", " << region <<
", " << lay <<
", " << ieta <<
", " << jphi << std::endl;
286 std::cout <<
"SCFillerTool::dumpHashTables() ===> scID = " << scID <<
" No. of cells: " << nl << std::endl;
287 std::cout <<
"SCFillerTool::dumpHashTables() ===> " ;
289 std::cout << cell <<
", " ;
291 std::cout <<
"" << std::endl;
300 CONTAINER::const_iterator f_cell = p.begin();
301 CONTAINER::const_iterator l_cell = p.end();
303 int reg,lay,ieta,jphi;
304 int sc_side, sc_calo, sc_region, sc_layer, sc_ieta, sc_jphi;
309 for( ; f_cell != l_cell; ++f_cell ) {
313 sc_side = (cell->eta()>=0.0) ? 1: 0;
325 if (
m_emid->is_lar_em(
id) ) {
328 lay =
m_emid->sampling(
id);
332 if (
m_emid->is_em_barrel(
id) ) {
335 sc_ieta = int(ieta/4);
337 }
else if ( lay == 1 ) {
338 sc_ieta = (reg==0) ?
int(ieta/8) : 56+ieta;
339 sc_jphi = (reg==0) ? jphi: int(jphi/4);
340 }
else if ( lay == 2 ) {
341 sc_ieta = (reg==0) ? ieta: 56 + ieta;
342 sc_jphi = int(jphi/4);
343 }
else if ( lay == 3 ) {
344 sc_ieta = int(ieta/2);
345 sc_jphi = int(jphi/4);
347 }
else if (
m_emid->is_em_endcap_outer(
id) ) {
350 sc_ieta = int(ieta/4);
353 }
else if (lay == 1) {
355 sc_ieta = (reg<=1) ? 0 : ((reg==2) ? 1+int(ieta/8) : ((reg==3) ? 13+int(ieta/4) : ((reg==4) ? 25+int(ieta/4): 41)));
357 sc_region = (reg<2) ? 0: reg-1;
359 sc_ieta = (reg==0) ? 0 : 1+ieta;
360 sc_jphi = int(jphi/4);
361 sc_region = (ieta<3) ? 0: ((ieta<15) ? 1 : ((ieta<23) ? 2 : ((ieta<39) ? 3 : 4)));
363 sc_ieta = int(ieta/2);
364 sc_jphi = int(jphi/4);
365 sc_region = (ieta<6) ? 1: ((ieta<10) ? 2 : ((ieta<18) ? 3: 4));
371 }
else if (
m_emid->is_em_endcap_inner(
id) ) {
373 sc_ieta = (ieta<6) ?
int(ieta/2) : 47;
374 sc_jphi = int(jphi/2);
375 sc_region = (ieta<6) ? 5 : 6;
377 }
else if (
m_hecid->is_lar_hec(
id)) {
378 sc_layer =
m_hecid->sampling(
id);
379 sc_region =
m_hecid->region(
id);
383 sc_ieta = (sc_region==0) ? ieta : 10+ieta;
386 }
else if (
m_fcalid->is_lar_fcal(
id)) {
387 HWIdentifier hwid = cabling->createSignalChannelID(
id );
389 const int lay =
m_fcalid->module(
id);
392 const int c64 = c%64;
395 sc_ieta = 4-int((c%16)/4);
396 int jphip = 8*(s-14) + 3 + 4*
int(c/64)-int(c64/16);
397 int jphin = 8*(s-14) + 7 -
int(c/16);
398 sc_jphi = (sc_side)>0 ? jphip : jphin;
401 sc_ieta = ((c%32)<16 ? 4 : 8) -
int((c%32)/4);
402 int jphip = 4*(s-10) + 1 + 2*
int(c/64)-int(c64/32);
403 int jphin = ((s>=12) ? 14 -4*(s-12): 6 -4*(s-10) ) +
int(c64/32) -2*int(c/64);
404 sc_jphi = (sc_side>0) ? jphip : jphin;
407 ieta = 15-int(c64%16) + 16*int(c64/16);
408 sc_ieta = int(ieta/4);
409 int jphip = int(c/64) + 2*(s- ((s==9) ? 2 : 1));
410 int jphin = ((s<5) ? 7 - 2*(s-1) : 15 - 2*(s-((s==9)?6:5))) -
int(c/64);
411 sc_jphi = (sc_side>0) ? jphip : jphin;
414 }
else if (c64>=16 && c64<32 ) {
416 }
else if (c64>=32 && c64<48 ) {
422 }
else if (
m_tileid->is_tile(
id) ) {
425 sc_side = (
m_tileid->side(
id)>0) ? 1 : 0;
432 if (
m_tileid->is_tile_extbarrel(
id) )
435 if( sc_ieta<0 || sc_jphi<0 || sc_calo<=0 || sc_region<0 || sc_layer<0 )
continue;
439 if (sc_calo==6 || sc_calo==7) {
443 int sc_hash = (sc_side << 28) | ( sc_calo << 24 ) | (sc_region << 20 ) | ( sc_layer << 16 ) | ( sc_ieta << 8 ) | ( sc_jphi );
450 int scID = (*it).first;
452 std::vector<const CaloCell*> v = (*it).second;
454 std::vector<const CaloCell*>::iterator vit;
474 for( vit=v.begin(); vit!=v.end(); ++vit) {
475 feta += (*vit)->eta();
476 fphi += (*vit)->phi();
#define ATH_CHECK
Evaluate an expression and check for errors.
Helpers for checking error return status codes and reporting errors.
#define REPORT_MESSAGE(LVL)
Report a message.
#define CHECK(...)
Evaluate an expression and check for errors.
Container class for CaloCell.
Data object for each calorimeter readout cell.
virtual StatusCode addVariable(const std::string &name, const std::type_info &ti, void *&ptr, const std::string &docstring="", const void *defval=0)
Block filler tool for noisy FEB information.