1155{
1156 MsgStream log(
msgSvc,
"MucCalibMgr");
1157 log << MSG::INFO << "Read event" << endreq;
1158
1159 Gaudi::svcLocator()->service(
"EventDataSvc",
eventSvc);
1160 m_evtBegin = clock();
1161
1162
1163 SmartDataPtr<Event::EventHeader> eventHeader(
eventSvc,
"/Event/EventHeader");
1164 if(!eventHeader) {
1165 log << MSG::FATAL << "Could not find event header" << endreq;
1166 return( StatusCode::FAILURE );
1167 }
1168
1169 m_currentRun = eventHeader->runNumber();
1170 m_currentEvent = eventHeader->eventNumber();
1171 if( m_fStartRun == 0 ) m_fStartRun = m_currentRun;
1172 m_fEndRun = m_currentRun;
1173 m_fTotalEvent++;
1174
1175 log << MSG::INFO << "Run [ " << m_currentRun << " ]\tEvent [ " << m_currentEvent << " ]" << endreq;
1176 if( ((long)m_fTotalEvent)%2000 == 0 ) cout << m_fTotalEvent << "\tdone!" << endl;
1177
1178
1179 if( m_dimuSelect ) {
1181 log << MSG::INFO << "Event tag:\t" << m_eventTag << endreq;
1182 if( m_dimuOnly && m_eventTag != 1 ) return( StatusCode::FAILURE );
1183 }
1184
1185
1186 log << MSG::INFO << "Retrieve digis" << endreq;
1187
1188 SmartDataPtr<MucDigiCol> mucDigiCol(
eventSvc,
"/Event/Digi/MucDigiCol");
1189 if(!mucDigiCol) {
1190 log << MSG::FATAL << "Could not find MUC digi" << endreq;
1191 return( StatusCode::FAILURE);
1192 }
1193
1194 int part, segment, layer, strip, pad;
1195 part = segment = layer = strip = pad = 0;
1196 double padX, padY, padZ;
1197 padX = padY = padZ = 0.;
1198 double resMax = 0.;
1199
1201 MucDigiCol::iterator digiIter = mucDigiCol->begin();
1202 int eventDigi = 0;
1203 for ( int digiId =0; digiIter != mucDigiCol->end(); digiIter++, digiId++ )
1204 {
1205 mucId = (*digiIter)->identify();
1210
1211 log << MSG::DEBUG << "[" << part << "\t" << segment << "\t" << layer << "\t" << strip << "]\t" ;
1212 if( (digiId+1)%8 == 0 ) log << MSG::DEBUG << endreq;
1213
1214 eventDigi ++;
1215
1216 if(
abs(part)>=PART_MAX ||
abs(segment)>=SEGMENT_MAX ||
abs(layer)>=LAYER_MAX ||
abs(strip)>=STRIP_INBOX_MAX) {
1217 log << MSG::ERROR << endreq << "Digi IDs slop over!" << endreq;
1218 continue;
1219 }
1220
1221
1223 m_digiCol.push_back( aMark );
1224 m_segDigiCol[part][segment].push_back( aMark );
1225 }
1226 log << MSG::DEBUG << endreq;
1227 log << MSG::INFO << "Total digits of this event: " << eventDigi << endreq;
1228 if( eventDigi > 200) log << MSG::ERROR << "Event: " << m_currentEvent << "\tdigits sharply rise:\t" << eventDigi << endreq;
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246 int clusterNum, bigClusterNum, clusterSize;
1247 clusterNum = bigClusterNum = clusterSize = 0;
1248 if( m_clusterMode ) {
1249 log << MSG::INFO << "Searching clusters" << endreq;
1250 m_clusterCol = (*m_ptrMucMark).CreateClusterCol(m_clusterMode, m_digiCol );
1251 }
1252
1253 for( unsigned int i=0; i<m_clusterCol.size(); i++ )
1254 {
1255 clusterSize = m_clusterCol[i].size();
1256
1257 if( clusterSize > CLUSTER_ALARM )
1258 {
1259 log << MSG::WARNING << "Big cluster:" << endreq;
1260 part = (*m_clusterCol[i][0]).Part();
1261 segment = (*m_clusterCol[i][0]).
Segment();
1262 layer = (*m_clusterCol[i][0]).Layer();
1263
1264 if( m_clusterSave ) (*m_fdata) << "Event:\t" << m_currentEvent << "\tbig cluster " << bigClusterNum << endl;
1265
1266 for( int j=0; j<clusterSize; j++ )
1267 {
1268 strip = (*m_clusterCol[i][j]).Strip();
1269 log << MSG::WARNING << "[" << part << "\t" << segment << "\t" << layer << "\t" << strip << "]\t";
1270 if( (j+1)%8 == 0 ) log << MSG::WARNING << endreq;
1271 if( m_clusterSave ) (*m_fdata) << part << "\t" << segment << "\t" << layer << "\t" << strip << endl;
1272 }
1273 log << MSG::WARNING << endreq;
1274 bigClusterNum ++;
1275 }
1276 else if( clusterSize > 1 )
1277 {
1278 log << MSG::DEBUG << "cluster: " << clusterNum << endreq;
1279 clusterNum ++, m_fTotalClstNum ++;
1280 part = (*m_clusterCol[i][0]).Part();
1281 segment = (*m_clusterCol[i][0]).
Segment();
1282 layer = (*m_clusterCol[i][0]).Layer();
1283 for( int j=0; j<clusterSize; j++ )
1284 {
1285 strip = (*m_clusterCol[i][j]).Strip();
1286 log << MSG::DEBUG << "[" << part << "\t" << segment << "\t" << layer << "\t" << strip << "]\t";
1287 if( (j+1)%8 == 0 ) log << MSG::DEBUG << endreq;
1288 }
1289 log << MSG::DEBUG << endreq;
1290 }
1291 }
1292
1293 if( m_clusterMode) log << MSG::INFO << "Total clusters in this event: " << clusterNum << endreq;
1294 else log << MSG::INFO << "Clusters not built" << endreq;
1295
1296
1297
1298 log << MSG::INFO << "Retrieve tracks" << endreq;
1299
1300 SmartDataPtr<RecMdcTrackCol> mdcTrackCol(
eventSvc,
"/Event/Recon/RecMdcTrackCol");
1301 if(!mdcTrackCol) {
1302 log << MSG::FATAL << "Could not find mdc tracks" << endreq;
1303 return( StatusCode::FAILURE);
1304 }
1305
1306 RecMdcTrackCol::iterator mdctrkIter = mdcTrackCol->begin();
1307 for (; mdctrkIter != mdcTrackCol->end(); mdctrkIter++)
1308 {
1309 m_charge = (*mdctrkIter)->charge();
1310 m_mdcpx = (*mdctrkIter)->px();
1311 m_mdcpy = (*mdctrkIter)->py();
1312 m_mdcpz = (*mdctrkIter)->pz();
1313 m_mdcpt = (*mdctrkIter)->pxy();
1314 m_mdcpp = (*mdctrkIter)->p();
1315 m_mdcphi = (*mdctrkIter)->phi();
1316 m_mdctheta = (*mdctrkIter)->theta();
1317 m_mdcTrkInfoTuple->write();
1318 }
1319
1320
1321 SmartDataPtr<RecMucTrackCol> mucTrackCol(
eventSvc,
"/Event/Recon/RecMucTrackCol");
1322 if (!mucTrackCol) {
1323 log << MSG::FATAL << "Could not find RecMucTrackCol" << endreq;
1324 return( StatusCode::FAILURE);
1325 }
1326
1328 if (aRecMucTrackCol->size() < 1) {
1329 log << MSG::INFO << "No MUC tracks in this event" << endreq;
1330 return StatusCode::SUCCESS;
1331 }
1332 log << MSG::INFO << "Total tracks of this event: " << aRecMucTrackCol->size() << endreq;
1333
1334
1335
1336
1337 if( 0 )
1338 {
1339 SmartDataPtr<RecEsTimeCol> aRecEsTimeCol(
eventSvc,
"/Event/Recon/RecEsTimeCol");
1340 if( ! aRecEsTimeCol ){
1341 log << MSG::ERROR << "Could not find RecEsTimeCol" << endreq;
1342 return StatusCode::FAILURE;
1343 }else{
1344 RecEsTimeCol::iterator iter_evt = aRecEsTimeCol->begin();
1345
1346
1347 m_ntEsTime = (*iter_evt)->getStat();
1348 if( (*iter_evt)->getStat() != 211 ) {
1349 log << MSG::WARNING << "Event time not by TOF, skip!" << endreq;
1350 return StatusCode::SUCCESS;
1351 }
1352 }
1353 }
1354
1355
1357 phiDiff = thetaDiff = 0.;
1358 if( aRecMucTrackCol->size()==2 && (*aRecMucTrackCol)[0]->GetTotalHits() > 4 && (*aRecMucTrackCol)[1]->GetTotalHits() > 4 )
1359 {
1360
1361 phi1 = (*aRecMucTrackCol)[0]->getMucPos().phi();
phi2 = (*aRecMucTrackCol)[1]->getMucPos().phi();
1364
1365
1366 theta1 = (*aRecMucTrackCol)[0]->getMucPos().theta();
theta2 = (*aRecMucTrackCol)[1]->getMucPos().theta();
1368 m_hTrackPosPhiDiff->Fill( phiDiff );
1369 m_hTrackPosThetaDiff->Fill( thetaDiff );
1370 m_hDimuTracksPosDiff->Fill( thetaDiff, phiDiff );
1371 m_ntPosPhiDiff = phiDiff;
1372 m_ntPosThetaDiff = thetaDiff;
1373
1374 log << MSG::INFO << "PosPhiDiff:\t" << phiDiff << "\tPosThetaDiff:\t" << thetaDiff << endreq;
1375
1376
1377 phi1 = (*aRecMucTrackCol)[0]->getMucMomentum().phi();
phi2 = (*aRecMucTrackCol)[1]->getMucMomentum().phi();
1380
1381
1382 theta1 = (*aRecMucTrackCol)[0]->getMucMomentum().theta();
theta2 = (*aRecMucTrackCol)[1]->getMucMomentum().theta();
1384
1385 m_hTrackMomPhiDiff->Fill( phiDiff );
1386 m_hTrackMomThetaDiff->Fill( thetaDiff );
1387 m_hDimuTracksMomDiff->Fill( thetaDiff, phiDiff );
1388 m_ntMomPhiDiff = phiDiff;
1389 m_ntMomThetaDiff = thetaDiff;
1390
1391 log << MSG::INFO << "MomPhiDiff:\t" << phiDiff << "\tMomThetaDiff:\t" << thetaDiff << endreq;
1392 m_ntDimuTag = m_eventTag;
1393 m_trackDiffTuple->write();
1394 }
1395
1396
1397 RecMucTrackCol::iterator trackIter = mucTrackCol->begin();
1398 int trackHitNum, rawHitNum, expectedHitNum, segNum, trkRecMode, lastLayerBR, lastLayerEC;
1399 int layerPassNum[3], passMax[TRACK_SEG_MAX][2];
1400 bool firedLay[TRACK_SEG_MAX][LAYER_MAX];
1401 bool seedList[
PART_MAX][LAYER_MAX];
1402 trackHitNum = rawHitNum = expectedHitNum = segNum = trkRecMode = lastLayerBR = lastLayerEC = 0;
1403 layerPassNum[0] = layerPassNum[1] = layerPassNum[2] = 0;
1404 for( int segi=0; segi<TRACK_SEG_MAX; segi++ ) {
1405 passMax[segi][0] = passMax[segi][1] = 0;
1406 for( int layi=0; layi<LAYER_MAX; layi++ ) firedLay[segi][layi] = 0;
1407 }
1408
1410 vector<MucRecHit*> mucRawHitCol;
1411 vector<MucRecHit*> mucExpHitCol;
1412
1413 for (int trackId = 0; trackIter != mucTrackCol->end(); trackIter++, trackId++)
1414 {
1415 trackHitNum = (*trackIter)->GetTotalHits();
1416 log << MSG::DEBUG << "Track: " << trackId << " Hits: " << trackHitNum << endreq;
1417
1418 if( trackHitNum == 0 ) {
1419 log << MSG::INFO << "Track " << trackId << " no hits" << endreq;
1420 continue;
1421 }
1422
1423 m_ntTrackHits = trackHitNum;
1424
1425 m_trkRecMode = trkRecMode = (*trackIter)->GetRecMode();
1426 m_chi2 = (*trackIter)->chi2();
1427 m_px = (*trackIter)->getMucMomentum().x();
1428 m_py = (*trackIter)->getMucMomentum().y();
1429 m_pz = (*trackIter)->getMucMomentum().z();
1430 m_pt = sqrt(m_px*m_px + m_py*m_py);
1431 m_pp = sqrt(m_px*m_px + m_py*m_py + m_pz*m_pz);
1432
1433
1434 m_r = (*trackIter)->getMucPos().mag();
1435 m_cosTheta = (*trackIter)->getMucPos().cosTheta();
1436 m_theta = (*trackIter)->getMucPos().theta();
1437 m_phi = (*trackIter)->getMucPos().phi();
1438 m_depth = (*trackIter)->depth();
1439 m_brLastLayer = lastLayerBR = (*trackIter)->brLastLayer();
1440 m_ecLastLayer = lastLayerEC = (*trackIter)->ecLastLayer();
1441 m_totalHits = (*trackIter)->numHits();
1442 m_totalLayers = (*trackIter)->numLayers();
1443 m_maxHitsInLayer = (*trackIter)->maxHitsInLayer();
1444
1445
1446 m_hPhiCosTheta->Fill(m_cosTheta, m_phi);
1447 log << MSG::INFO << "Fill track info" << endreq;
1448
1451 if( m_calHitCol.size() != 0 ) m_calHitCol.clear();
1452
1453
1454 log << MSG::DEBUG << "Reconstruction hits(digis in a track): " << endreq;
1455 mucRawHitCol = (*trackIter)->GetHits();
1456 rawHitNum += mucRawHitCol.size();
1457
1458 segNum = 0;
1459 if( trkRecMode == 3 ) {
1460 for(
int iPart=0; iPart<
PART_MAX; iPart++)
1461 for(int iLayer=0; iLayer<LAYER_MAX; iLayer++) seedList[iPart][iLayer] = false;
1462 }
1463
1464 for(unsigned int hitId = 0; hitId < mucRawHitCol.size(); hitId++)
1465 {
1466 pMucRawHit = mucRawHitCol[ hitId ];
1467 part = pMucRawHit->
Part();
1468 segment = pMucRawHit->
Seg();
1469 layer = pMucRawHit->
Gap();
1470 strip = pMucRawHit->
Strip();
1471
1472 log << MSG::DEBUG << "[" << part << "\t" << segment << "\t" << layer << "\t" << strip << "]\t";
1473
1474
1475
1477 m_calHitCol.push_back( aMark );
1478
1479
1480 if( trkRecMode == 3 ) seedList[part][layer] = pMucRawHit->
HitIsSeed();
1481
1482
1483 if(hitId == 0) { trkSeg[segNum].push_back( aMark ); segNum ++; }
1484 else
1485 {
1486 log << MSG::DEBUG << "segNum: " << segNum << endreq;
1487 bool notInSeg = true;
1488 for( int segi=0; segi<segNum; segi++ )
1489 {
1491 {
1492 trkSeg[segi].push_back( aMark );
1493 notInSeg = false;
1494 break;
1495 }
1496 }
1497
1498 if( notInSeg == true )
1499 {
1500 trkSeg[segNum].push_back( aMark );
1501 segNum ++;
1502 if( segNum > TRACK_SEG_MAX ) {
1503 log << MSG::ERROR << "Track segment overflow: " << segNum << endreq;
1504 break;
1505 }
1506 }
1507 }
1508 }
1509 log << MSG::DEBUG << endreq;
1510
1511
1512 layerPassNum[0] = layerPassNum[1] = layerPassNum[2] = 0;
1513 for( int segi=0; segi<segNum; segi++ )
1514 {
1515 int tmpLayNum = 0;
1516 passMax[segi][0] = passMax[segi][1] = trkSeg[segi][0]->Layer();
1517 for( unsigned int hiti=1; hiti<trkSeg[segi].size(); hiti++ )
1518 {
1519 if( trkSeg[segi][hiti]->Layer() < passMax[segi][0] )
1520 passMax[segi][0] = trkSeg[segi][hiti]->Layer();
1521 if( trkSeg[segi][hiti]->Layer() > passMax[segi][1] )
1522 passMax[segi][1] = trkSeg[segi][hiti]->Layer();
1523 firedLay[segi][trkSeg[segi][hiti]->Layer()] = 1;
1524 }
1525
1526 for( int layi=0; layi<LAYER_MAX; layi++ ) {
1527 if( firedLay[segi][layi] ) tmpLayNum ++;
1528 }
1529
1530 if( segi == 0 ) layerPassNum[0] += passMax[segi][1] + 1;
1531 else layerPassNum[0] += (passMax[segi][1] - passMax[segi][0] + 1);
1532
1533 layerPassNum[1] += (passMax[segi][1] - passMax[segi][0] + 1);
1534 layerPassNum[2] += tmpLayNum;
1535
1536 trkSeg[segi].clear();
1537 }
1538 m_ntTrackEvent = m_currentEvent;
1539 m_ntTrackTag = m_eventTag;
1540 m_ntTrackSegFly = segNum;
1541 m_ntTrackLayFlyA = layerPassNum[0];
1542 m_ntTrackLayFlyB = layerPassNum[1];
1543 m_ntTrackLayFlyC = layerPassNum[2];
1544 m_trackInfoTuple->write();
1545 log << MSG::INFO << "Track\t" << trackId << "\tsegment(s):\t" << segNum
1546 << "\tlayer passed:\t" << layerPassNum[0] <<"\t" << layerPassNum[1] << "\t" << layerPassNum[2] << endreq;
1547
1548
1549
1550
1551 log << MSG::DEBUG << "Fitting hits(expected hits in a track): " << endreq;
1552 mucExpHitCol = (*trackIter)->GetExpectedHits();
1553 expectedHitNum += mucExpHitCol.size();
1554 for(unsigned int hitId = 0; hitId < mucExpHitCol.size(); hitId++)
1555 {
1556 pMucRawHit = mucExpHitCol[ hitId ];
1557 part = pMucRawHit->
Part(); segment = pMucRawHit->
Seg();
1558 layer = pMucRawHit->
Gap(); strip = pMucRawHit->
Strip();
1559
1560 if( m_usePad != 0 )
1561 {
1564
1565 if( part != BRID )
1566 {
1567 if(segment == 1) { padX = -padX; }
1568 else if(segment == 2) { padX = -padX, padY = -padY; }
1569 else if(segment == 3) { padY = -padY; }
1570 }
1571 }
1572
1573
1574
1575
1576 MucMark* currentMark =
new MucMark( part, segment, layer, strip );
1577 m_expHitCol.push_back( currentMark );
1578
1579
1580
1581
1582 int isInPos = -1;
1583 bool isInEffWindow = false;
1584 isInPos = currentMark->
IsInCol( m_segDigiCol[part][segment] );
1585
1586
1587 if( part == BRID && (layer-lastLayerBR>1) ) continue;
1588 if( part != BRID && (layer-lastLayerEC>1) ) continue;
1589
1590
1591 if( part==BRID && layer==0 && (strip<2 || strip>45) )
1592 {
1593 if( isInPos != -1)
1594 {
1595 m_record[part][segment][layer][strip][2] ++;
1596 m_record[part][segment][layer][strip][1] ++;
1597 m_effHitCol.push_back( m_segDigiCol[part][segment][isInPos] );
1598
1599 if( m_usePad != 0 ) {
1600 m_h2DExpMap[part][segment][layer]->Fill(padX, padY);
1601 m_h2DHitMap[part][segment][layer]->Fill(padX, padY);
1602 }
1603
1604 }
1605 else {
1606 m_record[part][segment][layer][strip][1] ++;
1607 if( m_usePad != 0 ) m_h2DExpMap[part][segment][layer]->Fill(padX, padY);
1608 }
1609 continue;
1610 }
1611
1612
1613 if( isInPos != -1 )
1614 {
1615 m_record[part][segment][layer][strip][2] ++;
1616 m_record[part][segment][layer][strip][1] ++;
1617 m_effHitCol.push_back( m_segDigiCol[part][segment][isInPos] );
1618
1619 if( m_usePad != 0 ) {
1620 m_h2DExpMap[part][segment][layer]->Fill(padX, padY);
1621 m_h2DHitMap[part][segment][layer]->Fill(padX, padY);
1622 }
1623
1624 continue;
1625 }
1626 else for(int tempStrip=0, hiti=-m_effWindow; hiti<=m_effWindow; hiti++ )
1627 {
1628 if( hiti == 0 ) continue;
1629 tempStrip = strip + hiti;
1630 if( tempStrip < 0 || tempStrip > m_ptrIdTr->
GetStripMax(part,segment,layer) )
continue;
1631
1632 isInPos = m_ptrMucMark->
IsInCol( part, segment, layer, tempStrip, m_segDigiCol[part][segment] );
1633 if( isInPos != -1 )
1634 {
1635 m_record[part][segment][layer][tempStrip][2] ++;
1636 m_record[part][segment][layer][tempStrip][1] ++;
1637 m_effHitCol.push_back( m_segDigiCol[part][segment][isInPos] );
1638
1639 if( m_usePad != 0 ) {
1640 m_h2DExpMap[part][segment][layer]->Fill(padX, padY);
1641 m_h2DHitMap[part][segment][layer]->Fill(padX, padY);
1642 }
1643
1644 m_ntEffWindow = hiti;
1645 m_effWindowTuple->write();
1646 isInEffWindow = true;
1647 }
1648
1649 }
1650
1651 if( isInEffWindow ) { continue; }
1652 else {
1653 m_record[part][segment][layer][strip][1] ++;
1654 if( m_usePad != 0 ) m_h2DExpMap[part][segment][layer]->Fill(padX, padY);
1655 }
1656
1657 }
1658
1659
1660 log << MSG::INFO << "Fill residual" << endreq;
1661 vector<float> m_lineResCol = (*trackIter)->getDistHits();
1662 vector<float> m_quadResCol = (*trackIter)->getQuadDistHits();
1663 vector<float> m_extrResCol = (*trackIter)->getExtDistHits();
1664 int mode = (*trackIter)->GetRecMode();
1665
1666 for(unsigned int nres = 0; nres < m_lineResCol.size(); nres++ )
1667 if( fabs(m_lineResCol[nres])>resMax ) resMax = fabs(m_lineResCol[nres]);
1668
1669 log << MSG::INFO << "Good track for res" << endreq;
1670 if( trackHitNum > 4 && m_lineResCol[0] != -99)
1671 {
1672
1673 bool firedFlag[
PART_MAX][LAYER_MAX][2];
1674 for(
int iprt=0; iprt<
PART_MAX; iprt++)
1675 for(int jlay=0; jlay<LAYER_MAX; jlay++)
1676 firedFlag[iprt][jlay][0] = firedFlag[iprt][jlay][1] = false;
1677
1678 for(unsigned int hitId = 0; hitId < mucExpHitCol.size(); hitId++)
1679 {
1680 pMucExpHit = mucExpHitCol[ hitId ];
1681 part = pMucExpHit->
Part(); segment = pMucExpHit->
Seg(); layer = pMucExpHit->
Gap();
1682 firedFlag[part][layer][0] = true;
1683 }
1684
1685 log << MSG::INFO << "Fit res" << endreq;
1686 for(unsigned int hitId = 0; hitId < mucRawHitCol.size(); hitId++)
1687 {
1688 pMucRawHit = mucRawHitCol[ hitId ];
1689 part = pMucRawHit->
Part(); segment = pMucRawHit->
Seg(); layer = pMucRawHit->
Gap();
1690
1691 if( part == BRID ) m_hBarrelResDist[layer]->Fill( m_lineResCol[hitId] );
1692 else m_hEndcapResDist[layer]->Fill( m_lineResCol[hitId] );
1693
1694
1695 if( firedFlag[part][layer][0] == true && firedFlag[part][layer][1] == false )
1696 {
1697 m_resPart = part;
1698 m_resSegment = segment;
1699 m_resLayer = layer;
1700 m_lineRes = m_lineResCol[hitId];
1701 m_quadRes = m_quadResCol[hitId];
1702 m_extrRes = m_extrResCol[hitId];
1703 m_resFired = 1;
1704 m_resMode = mode;
1705 m_resInfoTuple->write();
1706 }
1707
1708 firedFlag[part][layer][1] = true;
1709 }
1710
1711 log << MSG::INFO << "Exp res" << endreq;
1712 for(unsigned int hitId = 0; hitId < mucExpHitCol.size(); hitId++)
1713 {
1714 pMucExpHit = mucExpHitCol[ hitId ];
1715 part = pMucExpHit->
Part(); segment = pMucExpHit->
Seg(); layer = pMucExpHit->
Gap();
1716
1717 if(firedFlag[part][layer][0] == true && firedFlag[part][layer][1] == false)
1718 {
1719 m_resPart = part;
1720 m_resSegment = segment;
1721 m_resLayer = layer;
1722 m_lineRes = 1000;
1723 m_quadRes = 1000;
1724 m_extrRes = 1000;
1725 m_resFired = 0;
1726 m_resMode = mode;
1727 m_resInfoTuple->write();
1728 }
1729 }
1730
1731 }
1732
1733 mucRawHitCol.clear();
1734 mucExpHitCol.clear();
1735
1736 }
1737
1738 if( resMax > 300 ) cout <<"Res too big!\t"<< m_fTotalEvent <<"\t"<< m_currentRun <<"\t"<< m_currentEvent <<"\t"<< resMax << endl;
1739
1740 m_ntTrackNum = mucTrackCol->size();
1741
1742 m_fTotalEffHit += rawHitNum;
1743 log << MSG::INFO << "Total hits in this event, raw: " << rawHitNum << "\texpected: " << expectedHitNum << endreq;
1744
1745
1746
1747 log << MSG::INFO << "Searching inc/noise hits" << endreq;
1748 bool isNosHit;
1749 bool hasEffHit;
1750 for( unsigned int i=0; i < m_digiCol.size(); i++ )
1751 {
1752 isNosHit = true;
1753
1754 if( m_digiCol[i]->IsInCol( m_effHitCol ) !=-1) continue;
1755 else
1756 {
1757 for( unsigned int j=0; j < m_clusterCol.size(); j++ )
1758 {
1759 hasEffHit = false;
1760 for( unsigned int k=0; k<m_clusterCol[j].size(); k++)
1761 {
1762 if( m_clusterCol[j][k]->IsInCol(m_effHitCol) != -1)
1763 {
1764 hasEffHit = true;
1765 break;
1766 }
1767 }
1768
1769 if ( hasEffHit && (m_digiCol[i]->IsInCol( m_clusterCol[j] ) != -1) ) {
1770 isNosHit = false;
1771 break;
1772 }
1773 }
1774
1775 if( isNosHit ) {
1776 m_nosHitCol.push_back( m_digiCol[i] );
1777 m_fTotalNosHit ++;
1778 }
1779 }
1780 }
1781
1782 return StatusCode::SUCCESS;
1783}
double abs(const EvtComplex &c)
vector< MucMark * > mark_col
ObjectVector< RecMucTrack > RecMucTrackCol
static int barrel_ec(const Identifier &id)
Values of different levels.
static int layer(const Identifier &id)
static int channel(const Identifier &id)
static int segment(const Identifier &id)
bool IsInSegWith(MucMark &other)
int IsInCol(int part, int segment, int layer, int strip, mark_col &aCol)
float GetIntersectZ() const
float GetIntersectY() const
float GetIntersectX() const
int Part() const
Get Part.
int Strip() const
Get Strip.