Skip to content

Commit

Permalink
Merge pull request #1269 from matthewstortini/main
Browse files Browse the repository at this point in the history
fixing bug in assigning uselessTripletSeed
  • Loading branch information
kutschke authored May 23, 2024
2 parents 2149850 + ab860ae commit a8f0771
Showing 1 changed file with 32 additions and 38 deletions.
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;
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;}
}
}

Expand Down

0 comments on commit a8f0771

Please sign in to comment.