Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixing bug in assigning uselessTripletSeed #1269

Merged
merged 1 commit into from
May 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
70 changes: 32 additions & 38 deletions CalPatRec/src/AgnosticHelixFinder_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -115,19 +115,19 @@ namespace mu2e {
};

struct cHit {
int hitIndice; // index of point in _chColl
float circleError2;
float helixPhi;
float helixPhiError2;
int helixPhiCorrection;
bool inHelix;
bool used; // whether or not hit is used in fits
bool isolated;
bool averagedOut;
bool notOnLine;
bool uselessTripletSeed;
bool notOnSegment;
bool debugParticle; // only filled in debug mode -- true if mc particle, false if background
int hitIndice = 0; // index of point in _chColl
float circleError2 = 1.0;
float helixPhi = 0.0;
float helixPhiError2 = 0.0;
int helixPhiCorrection = 0;
bool inHelix = false;
bool used = false; // whether or not hit is used in fits
bool isolated = false;
bool averagedOut = false;
bool notOnLine = true;
bool uselessTripletSeed = false;
bool notOnSegment = true;
bool debugParticle = false; // only filled in debug mode -- true if mc particle, false if background
};

struct tripletPoint {
Expand Down Expand Up @@ -730,44 +730,37 @@ namespace mu2e {

size_t sortStartIndex = 0;

cHit hit;
hit.circleError2 = 1.0;
hit.helixPhi = 0.0;
hit.helixPhiError2 = 0.0;
hit.helixPhiCorrection = 0;
hit.inHelix = false;
hit.used = false;
hit.isolated = false;
hit.averagedOut = false;
hit.notOnLine = true;
hit.uselessTripletSeed = false;
hit.notOnSegment = true;

// push back stopping target if it is to be used
if (_useStoppingTarget == true) {
cHit hit;
kutschke marked this conversation as resolved.
Show resolved Hide resolved
hit.hitIndice = HitType::STOPPINGTARGET;
_tcHits.push_back(hit);
sortStartIndex++;
}

// push back calo cluster if it exists in time cluster
if (_tcColl->at(tc).hasCaloCluster()) {
hit.hitIndice = HitType::CALOCLUSTER;
_tcHits.push_back(hit);
const art::Ptr<CaloCluster> cl = _tcColl->at(tc).caloCluster();
CLHEP::Hep3Vector gpos = _calorimeter->geomUtil().diskToMu2e(cl->diskID(), cl->cog3Vector());
CLHEP::Hep3Vector tpos = _calorimeter->geomUtil().mu2eToTracker(gpos);
double offset = _calorimeter->caloInfo().getDouble("diskCaseZLength");
offset += _calorimeter->caloInfo().getDouble("BPPipeZOffset");
offset += _calorimeter->caloInfo().getDouble("BPHoleZLength");
offset += _calorimeter->caloInfo().getDouble("FEEZLength");
offset /= 2.0;
_caloPos.SetCoordinates(tpos.x(), tpos.y(), tpos.z() - offset);
sortStartIndex++;
const CaloCluster*cluster = cl.get();
if (cluster != nullptr){
cHit hit;
hit.hitIndice = HitType::CALOCLUSTER;
CLHEP::Hep3Vector gpos = _calorimeter->geomUtil().diskToMu2e(cl->diskID(), cl->cog3Vector());
CLHEP::Hep3Vector tpos = _calorimeter->geomUtil().mu2eToTracker(gpos);
double offset = _calorimeter->caloInfo().getDouble("diskCaseZLength");
offset += _calorimeter->caloInfo().getDouble("BPPipeZOffset");
offset += _calorimeter->caloInfo().getDouble("BPHoleZLength");
offset += _calorimeter->caloInfo().getDouble("FEEZLength");
offset /= 2.0;
_caloPos.SetCoordinates(tpos.x(), tpos.y(), tpos.z() - offset);
_tcHits.push_back(hit);
sortStartIndex++;
}
}

// fill hits from time cluster
for (size_t i = 0; i < _tcColl->at(tc)._strawHitIdxs.size(); i++) {
cHit hit;
hit.hitIndice = _tcColl->at(tc)._strawHitIdxs[i];
if (_debug == 1) {
std::vector<StrawDigiIndex> shids;
Expand All @@ -787,6 +780,7 @@ namespace mu2e {
std::sort(_tcHits.begin() + sortStartIndex, _tcHits.end(), [&](const cHit& a, const cHit& b) {
return _chColl->at(a.hitIndice).pos().z() > _chColl->at(b.hitIndice).pos().z();
});

}

//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -1083,7 +1077,7 @@ namespace mu2e {
}
}
}
_tcHits[i].uselessTripletSeed = uselessSeed;
if (i<_tcHits.size()) {_tcHits[i].uselessTripletSeed = uselessSeed;}
kutschke marked this conversation as resolved.
Show resolved Hide resolved
kutschke marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand Down