Skip to content

Commit

Permalink
Merge pull request #1249 from gianipez/devTrg
Browse files Browse the repository at this point in the history
removed default parameters in MergeHelices module + extended range of validation histogram
  • Loading branch information
kutschke authored May 1, 2024
2 parents bdc4125 + 6c5857f commit 64af1fc
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 21 deletions.
22 changes: 13 additions & 9 deletions TrkFilters/src/HelixFilter_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ namespace mu2e

explicit HelixFilter(const Parameters& conf);
virtual bool filter(art::Event& event) override;
virtual void beginJob();
virtual bool beginRun(art::Run& run );
virtual bool endRun( art::Run& run ) override;

Expand Down Expand Up @@ -216,6 +217,18 @@ namespace mu2e
produces<TriggerInfo>();
}

void HelixFilter::beginJob() {
if ( (!_posHelCuts._configured) && (!_negHelCuts._configured)) {
std::cout << moduleDescription().moduleLabel() << " NO HELIX CUT HAS BEEN SET. IF THAT'S NOT THE DESIRED BEHAVIOUR REVIEW YOUR CONFIGUREATION!" << std::endl;
}
if ( (!_posHelCuts._configured)){
std::cout << moduleDescription().moduleLabel() << " NO HELIX CUT HAS BEEN SET FOR THE HELICES WITH POSITIVE HELICITY. IF THAT'S NOT THE DESIRED BEHAVIOUR REVIEW YOUR CONFIGUREATION!" << std::endl;
}
if ( (!_negHelCuts._configured)){
std::cout << moduleDescription().moduleLabel() << " NO HELIX CUT HAS BEEN SET FOR THE HELICES WITH NEGATIVE HELICITY. IF THAT'S NOT THE DESIRED BEHAVIOUR REVIEW YOUR CONFIGUREATION!" << std::endl;
}
}

bool HelixFilter::beginRun(art::Run & run){
// get bfield
GeomHandle<BFieldManager> bfmgr;
Expand All @@ -228,15 +241,6 @@ namespace mu2e
_posHelCuts.setTrackerGeomHandle(_tracker);
_negHelCuts.setTrackerGeomHandle(_tracker);

if ( (!_posHelCuts._configured) && (!_negHelCuts._configured)) {
std::cout << moduleDescription().moduleLabel() << " NO HELIX CUT HAS BEEN SET. IF THAT'S NOT THE DESIRED BEHAVIOUR REVIEW YOUR CONFIGUREATION!" << std::endl;
}
if ( (!_posHelCuts._configured)){
std::cout << moduleDescription().moduleLabel() << " NO HELIX CUT HAS BEEN SET FOR THE HELICES WITH POSITIVE HELICITY. IF THAT'S NOT THE DESIRED BEHAVIOUR REVIEW YOUR CONFIGUREATION!" << std::endl;
}
if ( (!_negHelCuts._configured)){
std::cout << moduleDescription().moduleLabel() << " NO HELIX CUT HAS BEEN SET FOR THE HELICES WITH NEGATIVE HELICITY. IF THAT'S NOT THE DESIRED BEHAVIOUR REVIEW YOUR CONFIGUREATION!" << std::endl;
}
return true;
}

Expand Down
2 changes: 2 additions & 0 deletions TrkReco/fcl/prolog.fcl
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ TrkReco: { @table::TrkReco
deltanh : 5 # if the difference in the strawHit counts between the helices is less than deltanh, use the chisq of the helices to select the better helix
scaleXY : 1.1 # scale the weight for having chi2XY/ndof distribution peaking at 1
scaleZPhi : 0.75 # scale the weight for having chi2ZPhi/ndof distribution peaking at 1
MinHitOverlapFraction : 0.5
MinNHitOverlap : 10
}
}
}
Expand Down
20 changes: 10 additions & 10 deletions TrkReco/src/MergeHelices_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ namespace mu2e {
using Name=fhicl::Name;
using Comment=fhicl::Comment;
struct Config {
fhicl::Atom<int> debug{ Name("debugLevel"), Comment("Debug Level"), 0};
fhicl::Atom<unsigned> deltanh{ Name("deltanh"), Comment("difference in the active StrawHit counts")};
fhicl::Atom<float> scaleXY{ Name("scaleXY"), Comment("scaling factor to get chi2XY/ndof distribution peak at 1")};
fhicl::Atom<float> scaleZPhi{ Name("scaleZPhi"), Comment("scaling factor to get chi2ZPhi/ndof distribution peak at 1")};
fhicl::Atom<bool> selectbest{ Name("SelectBest"), Comment("Select best overlapping helices for output"), true};
fhicl::Atom<bool> usecalo{ Name("UseCalo"), Comment("Use CaloCluster info in comparison"), true};
fhicl::Atom<unsigned> minnover{ Name("MinNHitOverlap"), Comment("Minimum number of common hits to consider helices to be 'the same'"), 10};
fhicl::Atom<float> minoverfrac{ Name("MinHitOverlapFraction"), Comment("Minimum fraction of common hits to consider helices to be 'the same'"), 0.5};
fhicl::Sequence<std::string> BadHitFlags { Name("BadHitFlags"), Comment("HelixHit flag bits to exclude from counting"),std::vector<std::string>{"Outlier"}};
fhicl::Sequence<std::string> HelixFinders { Name("HelixFinders"), Comment("HelixSeed producers to merge")};
fhicl::Atom<int> debug { Name("debugLevel"), Comment("Debug Level"), 0};
fhicl::Atom<unsigned> deltanh { Name("deltanh"), Comment("difference in the active StrawHit counts")};
fhicl::Atom<float> scaleXY { Name("scaleXY"), Comment("scaling factor to get chi2XY/ndof distribution peak at 1")};
fhicl::Atom<float> scaleZPhi { Name("scaleZPhi"), Comment("scaling factor to get chi2ZPhi/ndof distribution peak at 1")};
fhicl::Atom<bool> selectbest { Name("SelectBest"), Comment("Select best overlapping helices for output"), true};
fhicl::Atom<bool> usecalo { Name("UseCalo"), Comment("Use CaloCluster info in comparison"), true};
fhicl::Atom<unsigned> minnover { Name("MinNHitOverlap"), Comment("Minimum number of common hits to consider helices to be 'the same'")};
fhicl::Atom<float> minoverfrac { Name("MinHitOverlapFraction"), Comment("Minimum fraction of common hits to consider helices to be 'the same'")};
fhicl::Sequence<std::string> BadHitFlags { Name("BadHitFlags"), Comment("HelixHit flag bits to exclude from counting"),std::vector<std::string>{"Outlier"}};
fhicl::Sequence<std::string> HelixFinders { Name("HelixFinders"), Comment("HelixSeed producers to merge")};
};
using Parameters = art::EDProducer::Table<Config>;
explicit MergeHelices(const Parameters& conf);
Expand Down
1 change: 1 addition & 0 deletions Validation/inc/ValKalSeed.hh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ class ValKalSeed {
TH1D* _hpce;
TH1D* _hpcep;
TH1D* _hsignedp;
TH1D* _hsignedp2;
TH1D* _hpe;
TH1D* _hRho;
TH1D* _hPhi;
Expand Down
6 changes: 4 additions & 2 deletions Validation/src/ValKalSeed.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,13 @@ namespace mu2e {
_hfitConC = tfs.make<TH1D>("FitConnC", "Fit CL CPR", 100, 0.0, 1.0);
_hfitConT = tfs.make<TH1D>("FitConnT", "Fit CL TPR", 100, 0.0, 1.0);
_hp = tfs.make<TH1D>("p", "p", 100, 0., 110.);
_hp2 = tfs.make<TH1D>("p2", "p", 100, 0., 300.);
_hp2 = tfs.make<TH1D>("p2", "p", 150, 0., 500.);
_hpC = tfs.make<TH1D>("pC", "p CPR", 100, 0., 110.);
_hpT = tfs.make<TH1D>("pT", "p TPR", 100, 0., 110.);
_hpce = tfs.make<TH1D>("pce", "p CE", 100, 95.0, 110.);
_hpcep = tfs.make<TH1D>("pcep", "p CE+", 100, 82.0, 97.);
_hsignedp = tfs.make<TH1D>("signedp", "signedp", 200, -110., 110.);
_hsignedp2 = tfs.make<TH1D>("signedp", "signedp", 300, -500., 500.);
_hpe = tfs.make<TH1D>("pe", "p error", 100, 0.0, 1.0);
_hRho = tfs.make<TH1D>("rho", "Transverse radius", 100, 0.0, 800.);
_hPhi = tfs.make<TH1D>("phi", "phi", 100, -M_PI, M_PI);
Expand Down Expand Up @@ -80,7 +81,7 @@ namespace mu2e {
art::Event const& event) {
// increment this by 1 any time the defnitions of the histograms or the
// histogram contents change, and will not match previous versions
_hVer->Fill(8.0);
_hVer->Fill(9.0);

_hN->Fill(coll.size());
for (auto const& ks : coll) {
Expand Down Expand Up @@ -127,6 +128,7 @@ namespace mu2e {
_hpce->Fill(p);
_hpcep->Fill(p);
_hsignedp->Fill(p*ksCharge);
_hsignedp2->Fill(p*ksCharge);
_hpe->Fill(ikinter->momerr());
_hRho->Fill(ikinter->position3().Rho());
_hPhi->Fill(mom3.Phi());
Expand Down

0 comments on commit 64af1fc

Please sign in to comment.