29 mMaskedChannels.clear();
31 std::array<int, 2> nLines{4, 1};
32 for (
auto&
mask : maskedChannels) {
33 for (
int icath = 0; icath < 2; ++icath) {
34 for (
int iline = 0; iline < nLines[icath]; ++iline) {
35 auto pat =
mask.getPattern(icath, iline);
37 if (pat & (1 << istrip)) {
39 mMaskedChannels[
mask.deId].emplace_back(area);
47bool HitMapBuilder::crossCommonElement(
const std::vector<int>& fired,
const std::vector<int>& nonFired)
const
50 auto refIt = fired.begin();
51 for (
auto it = fired.begin() + 1,
end = fired.end(); it !=
end; ++it) {
58 if (nonFired.empty()) {
63 for (
auto it = nonFired.begin(),
end = nonFired.end(); it !=
end; ++it) {
72int HitMapBuilder::getEffFlag(
const std::vector<int>& firedFEEIdMT11,
const std::vector<int>& nonFiredFEEIdMT11)
const
74 std::vector<int> firedRPCLines, nonFiredRPCLines;
75 for (
auto& feeId : firedFEEIdMT11) {
78 for (
auto& feeId : nonFiredFEEIdMT11) {
82 if (crossCommonElement(firedRPCLines, nonFiredRPCLines)) {
83 if (crossCommonElement(firedFEEIdMT11, nonFiredFEEIdMT11)) {
91int HitMapBuilder::getFEEIdMT11(
double xp,
double yp, uint8_t deId)
const
94 if (stripIndex.isValid()) {
101bool HitMapBuilder::matchesMaskedChannel(
const Cluster& cl)
const
103 auto found = mMaskedChannels.find(cl.deId);
104 if (found == mMaskedChannels.end()) {
110 for (
auto& area : found->second) {
111 if (std::abs(cl.xCoor -
area.getCenterX()) < nSigmas * cl.getEX() +
area.getHalfSizeX() &&
112 std::abs(cl.yCoor -
area.getCenterY()) < nSigmas * cl.getEY() +
area.getHalfSizeY()) {
121 std::vector<int> firedFEEIdMT11, nonFiredFEEIdMT11;
122 bool badForEff =
false;
123 for (
int ich = 0; ich < 4; ++ich) {
127 firedFEEIdMT11.emplace_back(getFEEIdMT11(cl.xCoor, cl.yCoor, cl.deId));
128 for (
int icath = 0; icath < 2; ++icath) {
129 if (cl.isFired(icath)) {
135 for (
auto& impactPt : impactPts) {
136 auto feeIdMT11 = getFEEIdMT11(impactPt.xCoor, impactPt.yCoor, impactPt.deId);
137 if (feeIdMT11 >= 0) {
138 nonFiredFEEIdMT11.emplace_back(feeIdMT11);
139 if (matchesMaskedChannel(impactPt)) {
149 int effFlag = badForEff ? 0 : getEffFlag(firedFEEIdMT11, nonFiredFEEIdMT11);
155 for (
auto& track : tracks) {
Utility to build the MID track hit maps.
HMPID cluster implementation.
std::vector< Cluster > getLocalPositions(const Track &track, int chamber, bool withUncertainties=false) const
void process(std::vector< Track > &tracks, gsl::span< const Cluster > clusters) const
void setMaskedChannels(const std::vector< ColumnData > &maskedChannels, bool clear)
HitMapBuilder(const GeometryTransformer &geoTrans)
void buildTrackInfo(Track &track, gsl::span< const Cluster > clusters) const
MpStripIndex stripByPosition(double xPos, double yPos, int cathode, int deId, bool warn=true) const
MpArea stripByLocation(int strip, int cathode, int line, int column, int deId, bool warn=true) const
This class defines the MID track.
int getClusterMatchedUnchecked(int chamber) const
void setFiredChamber(int chamber, int cathode)
void setEfficiencyFlag(int effFlag)
void setFiredFEEId(int uniqueFeeId)
Sets the fired FEE ID.
uint16_t makeUniqueFEEId(int deId, int columnId, int lineId)
bool isRightSide(int deId)
int getDEIdFromFEEId(uint16_t uniqueFEEId)
int getDEId(bool isRight, int chamber, int rpc)
constexpr int NStripsBP
Number of strips in the Bending Plane.
simClustering correlation clear()
std::vector< Cluster > clusters
a couple of static helper functions to create timestamp values for CCDB queries or override obsolete ...