Skip to content
Snippets Groups Projects
Commit feb1a8dd authored by Eric Torrence's avatar Eric Torrence
Browse files

Merge branch 'faserrec-procdev' into 'master'

p0010 patches

See merge request faser/calypso!350
parents f2d89821 8e3317a2
No related branches found
No related tags found
No related merge requests found
......@@ -210,7 +210,7 @@ if not args.isOverlay:
# Tracker clusters
from TrackerPrepRawDataFormation.TrackerPrepRawDataFormationConfig import FaserSCT_ClusterizationCfg
# acc.merge(FaserSCT_ClusterizationCfg(ConfigFlags, DataObjectName="Pos_SCT_RDOs"))
acc.merge(FaserSCT_ClusterizationCfg(ConfigFlags, DataObjectName="SCT_RDOs"))
acc.merge(FaserSCT_ClusterizationCfg(ConfigFlags, DataObjectName="SCT_RDOs", checkBadChannels=True))
#
# SpacePoints
......
......@@ -55,6 +55,10 @@ LHCDataAlg::execute(const EventContext& ctx) const {
lhcDataHandle->set_numBunchBeam2(m_lhcTool->getBeam2Bunches(ctx));
lhcDataHandle->set_numBunchColliding(m_lhcTool->getCollidingBunches(ctx));
ATH_MSG_DEBUG("FaserLHCData B1: " << m_lhcTool->getBeam1Bunches(ctx)
<< " B2: " << m_lhcTool->getBeam2Bunches(ctx)
<< " Coll: " << m_lhcTool->getCollidingBunches(ctx));
// Fill BCID information
// Get the BCID mask
......@@ -64,37 +68,68 @@ LHCDataAlg::execute(const EventContext& ctx) const {
SG::ReadHandle<xAOD::EventInfo> xevt(m_eventInfo, ctx);
unsigned int bcid = xevt->bcid();
int nearest = findNearest(bcid, bcid_mask, 3); // Colliding beams
int nearest;
if (m_lhcTool->getCollidingBunches(ctx) == 0) {
ATH_MSG_INFO("No colliding bunches, can't set nearest");
nearest = -3564;
} else {
nearest = findNearest(bcid, bcid_mask, 3); // Colliding beams
}
lhcDataHandle->set_distanceToCollidingBCID(nearest);
ATH_MSG_DEBUG("Found distance of " << nearest << " from BCID " << bcid
<< " to the nearest colliding BCID ");
nearest = findNearest(bcid, bcid_mask, 1); // Beam1 unpaired
if (m_lhcTool->getBeam1Bunches(ctx) == 0) {
ATH_MSG_INFO("No beam 1 bunches, can't set nearest");
nearest = -3564;
} else {
nearest = findNearest(bcid, bcid_mask, 1); // Beam1 unpaired
}
lhcDataHandle->set_distanceToUnpairedB1(nearest);
ATH_MSG_DEBUG("Found distance of " << nearest << " from BCID " << bcid
<< " to the nearest unpaired B1 ");
nearest = findNearest(bcid, bcid_mask, 2); // Beam2 unpaired
if (m_lhcTool->getBeam2Bunches(ctx) == 0) {
ATH_MSG_INFO("No beam 2 bunches, can't set nearest");
nearest = -3564;
} else {
nearest = findNearest(bcid, bcid_mask, 2); // Beam2 unpaired
}
lhcDataHandle->set_distanceToUnpairedB2(nearest);
ATH_MSG_DEBUG("Found distance of " << nearest << " from BCID " << bcid
<< " to the nearest unpaired B2 ");
// Add 127 to current BCID to check if inbound B1 is nearby FASER
int offset_bcid = (bcid + 127) % 3564;
nearest = findNearest(offset_bcid, bcid_mask, 1); // Inbound B1
int nearest2 = findNearest(offset_bcid, bcid_mask, 3); // Inbound B1
if (abs(nearest2) < abs(nearest)) nearest = nearest2;
if (m_lhcTool->getBeam1Bunches(ctx) == 0) {
ATH_MSG_INFO("No beam 1 bunches, can't set nearest");
nearest = -3564;
} else {
int offset_bcid = (bcid + 127) % 3564;
nearest = findNearest(offset_bcid, bcid_mask, 1); // Inbound B1
int nearest2 = findNearest(offset_bcid, bcid_mask, 3); // Inbound B1
if (abs(nearest2) < abs(nearest)) nearest = nearest2;
}
lhcDataHandle->set_distanceToInboundB1(nearest);
ATH_MSG_DEBUG("Found distance of " << nearest << " from BCID " << bcid
<< " to the nearest inbound B1 ");
unsigned int previous;
previous = previousColliding(bcid, bcid_mask);
if (m_lhcTool->getCollidingBunches(ctx) == 0) {
ATH_MSG_INFO("No colliding bunches, can't set nearest");
previous = 9999;
} else {
previous = previousColliding(bcid, bcid_mask);
}
lhcDataHandle->set_distanceToPreviousColliding(previous);
ATH_MSG_DEBUG("Found distance of " << previous << " from BCID " << bcid
<< " to the previous colliding bunch ");
previous = previousTrain(bcid, bcid_mask);
if (m_lhcTool->getCollidingBunches(ctx) == 0) {
ATH_MSG_INFO("No colliding bunches, can't set nearest");
previous = 9999;
} else {
previous = previousTrain(bcid, bcid_mask);
}
lhcDataHandle->set_distanceToTrainStart(previous);
ATH_MSG_DEBUG("Found distance of " << previous << " from BCID " << bcid
<< " to the start of the previous train ");
......@@ -142,8 +177,20 @@ LHCDataAlg::findNearest(unsigned int bcid, const std::vector<unsigned char>& bci
// If we got to here, there was no match
// Does the BCID make sense?
ATH_MSG_WARNING("Couldn't find distance from BCID " << bcid << " and pattern " << mask << "!");
ATH_MSG_WARNING(bcid_mask);
ATH_MSG_WARNING("Couldn't find distance from BCID " << bcid << " and pattern " << int(mask) << "!");
int b1=0;
int b2=0;
int col = 0;
for (int i=0; i<3564; i++) {
if (mask & 0x01) b1++;
if (mask & 0x02) b2++;
if (mask & 0x03) col++;
ATH_MSG_WARNING("BCID " << i << " - " << int(bcid_mask[i]));
}
//ATH_MSG_WARNING(bcid_mask);
ATH_MSG_WARNING("Found B1: " << b1 << " B2: " << b2 << " Coll: " << col);
return -3565;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment