Skip to content

Commit

Permalink
Merge pull request #1268 from brownd1978/hflag
Browse files Browse the repository at this point in the history
Add flags for APR and MPR and set them appropriately
  • Loading branch information
kutschke authored May 21, 2024
2 parents 4b7e9fc + 0b8bdcd commit 2149850
Show file tree
Hide file tree
Showing 6 changed files with 50 additions and 10 deletions.
12 changes: 6 additions & 6 deletions CalPatRec/src/AgnosticHelixFinder_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "Offline/RecoDataProducts/inc/HelixSeed.hh"
#include "Offline/RecoDataProducts/inc/StrawHitIndex.hh"
#include "Offline/RecoDataProducts/inc/TimeCluster.hh"
#include "Offline/RecoDataProducts/inc/TrkFitFlag.hh"

#include "Offline/Mu2eUtilities/inc/LsqSums2.hh"
#include "Offline/Mu2eUtilities/inc/LsqSums4.hh"
Expand Down Expand Up @@ -207,7 +208,6 @@ namespace mu2e {
const ComboHitCollection* _chColl;
const TimeClusterCollection* _tcColl;
const CaloClusterCollection* _ccColl;
HelixSeedCollection* _hsColl;

//-----------------------------------------------------------------------------
// helix search parameters
Expand Down Expand Up @@ -342,7 +342,7 @@ namespace mu2e {
void tcHitsFill (size_t tc);
void setFlags ();
void resetFlags ();
void findHelix (size_t tc, bool& findAnotherHelix);
void findHelix (size_t tc, HelixSeedCollection& HSColl, bool& findAnotherHelix);
bool passesFlags (size_t& tcHitsIndex);
void setTripletI (size_t& tcHitsIndex, triplet& trip, LoopCondition& outcome);
void setTripletJ (size_t& tcHitsIndex, triplet& trip, LoopCondition& outcome);
Expand Down Expand Up @@ -520,7 +520,6 @@ namespace mu2e {
// set the event and prepare hsColl
_event = &event;
std::unique_ptr<HelixSeedCollection> hsColl(new HelixSeedCollection);
_hsColl = hsColl.get();

// get the necessary data to do helix search
bool dataExists = findData(event);
Expand Down Expand Up @@ -576,7 +575,7 @@ namespace mu2e {
tcHitsFill(i);
continueSearch = true;
while (continueSearch == true) {
findHelix(i, continueSearch);
findHelix(i, *hsColl, continueSearch);
if (_findMultipleHelices == false) {
continueSearch = false;
} // want to halt search if not configured to find multiple helices per TC
Expand Down Expand Up @@ -859,7 +858,7 @@ namespace mu2e {
//-----------------------------------------------------------------------------
// logic to find helix
//-----------------------------------------------------------------------------
void AgnosticHelixFinder::findHelix(size_t tc, bool& findAnotherHelix) {
void AgnosticHelixFinder::findHelix(size_t tc, HelixSeedCollection& HSColl, bool& findAnotherHelix) {

// if in runDisplay mode we store collections for plotting
_circleFitter.clear();
Expand Down Expand Up @@ -1055,7 +1054,7 @@ namespace mu2e {
_plottingData.push_back(trackingInfo);
}
saveHelixCandidate();
saveHelix(tc, *_hsColl);
saveHelix(tc, HSColl);
if (_diagLevel == 1) {
_diagInfo.nHelices++;
}
Expand Down Expand Up @@ -1724,6 +1723,7 @@ namespace mu2e {
hseed._helix._chi2dZPhi = _lineFitter.chi2Dof();

hseed._status.merge(TrkFitFlag::helixOK);
hseed._status.merge(TrkFitFlag::APRHelix);

// push back the helix seed to the helix seed collection
HSColl.emplace_back(hseed);
Expand Down
40 changes: 40 additions & 0 deletions Print/fcl/printKalSeed.fcl
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
#
# print products with a moderate amount of output
#

#include "Offline/fcl/minimalMessageService.fcl"
#include "Offline/fcl/standardServices.fcl"

process_name : print

services : {
message : @local::default_message
GlobalConstantsService : { inputFile : "Offline/GlobalConstantsService/data/globalConstants_01.txt" }
}

physics :{
analyzers: {

printModule : {
module_type : PrintModule
kalSeedPrinter : {
verbose : 2
}
} # printModule


} # analyzers

ana : [ printModule ]
end_paths : [ ana ]

}

outputs: {
printProductList : {
module_type : DataProductDump
}
}

services.message.destinations.log.categories.ArtSummary.limit : 0
services.message.destinations.statistics.stats : @local::mf_null
2 changes: 0 additions & 2 deletions RecoDataProducts/inc/KalSeed.hh
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,6 @@ namespace mu2e {
bool loopHelixFit() const { return _status.hasAllProperties(TrkFitFlag::KKLoopHelix); }
bool centralHelixFit() const { return _status.hasAllProperties(TrkFitFlag::KKCentralHelix); }
bool kinematicLineFit() const { return _status.hasAllProperties(TrkFitFlag::KKLine); }
bool seedBTrkFit() const { return _status.hasAllProperties(TrkFitFlag::KSF); }
bool finalBTrkFit() const { return _status.hasAllProperties(TrkFitFlag::KFF); }
// reconstitute (as best as possible) the fit trajectory. The ptr will be null if the fit wasn't based on the requested trajector type
// Note these return by value
// Note that the returned piecetraj may have large gaps, unless the full fit trajectory was stored in the seed.
Expand Down
2 changes: 1 addition & 1 deletion RecoDataProducts/inc/TrkFitFlag.hh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ namespace mu2e {
enum bit_type {hitsOK=0,circleOK,phizOK,helixOK,seedOK,kalmanOK,circleInit,phizInit,
circleConverged,phizConverged,helixConverged,seedConverged,kalmanConverged,
MatCorr, BFCorr, FitOK,
KSF=16, KFF, TPRHelix, CPRHelix, Straight, KKLoopHelix,KKCentralHelix,KKLine, MCSeed=31};
KSF=16, KFF, TPRHelix, CPRHelix, Straight, KKLoopHelix,KKCentralHelix,KKLine, APRHelix, MPRHelix, MCSeed=31};

// functions needed for the BitMap template
static std::string const& typeName();
Expand Down
2 changes: 2 additions & 0 deletions RecoDataProducts/src/TrkFitFlag.cc
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ namespace mu2e {
bitnames[std::string("KalFinalFit")] = bit_to_mask(KFF);
bitnames[std::string("TrkPatRecHelix")] = bit_to_mask(TPRHelix);
bitnames[std::string("CalPatRecHelix")] = bit_to_mask(CPRHelix);
bitnames[std::string("AgnosticHelix")] = bit_to_mask(APRHelix);
bitnames[std::string("RobustMultiHelix")] = bit_to_mask(MPRHelix);
bitnames[std::string("Straight")] = bit_to_mask(Straight);
bitnames[std::string("KKLoopHelix")] = bit_to_mask(KKLoopHelix);
bitnames[std::string("KKCentralHelix")] = bit_to_mask(KKCentralHelix);
Expand Down
2 changes: 1 addition & 1 deletion TrkPatRec/src/RobustMultiHelixFinder_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ chi2dXY = bestHelix.fita_zt_;
hseed._helix._chi2dZPhi = chi2dZPhi;
hseed._t0 = TrkT0(t0,t0err);
for (const auto& ich : bestHelix.hitIndices_) hseed._hhits.emplace_back(chcol[ich]);
hseed._status.merge(TrkFitFlag::TPRHelix);
hseed._status.merge(TrkFitFlag::MPRHelix);
hseed._status.merge(TrkFitFlag::helixOK);
hseed._timeCluster = tcArtPtr;

Expand Down

0 comments on commit 2149850

Please # to comment.