From 4beb534fcba76ee83eade59f4778203455ccfbf8 Mon Sep 17 00:00:00 2001 From: gianipez Date: Fri, 20 Sep 2019 15:25:00 -0500 Subject: [PATCH 01/16] fixed calo-cluster z position offset in CalHelixFinderAlg --- CalPatRec/src/CalHelixFinderAlg.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/CalPatRec/src/CalHelixFinderAlg.cc b/CalPatRec/src/CalHelixFinderAlg.cc index 3997592aa6..268c7ceb7c 100644 --- a/CalPatRec/src/CalHelixFinderAlg.cc +++ b/CalPatRec/src/CalHelixFinderAlg.cc @@ -224,7 +224,8 @@ namespace mu2e { fCaloTime = cl->time(); fCaloX = tpos.x(); fCaloY = tpos.y(); - fCaloZ = tpos.z(); + float offset = _calorimeter->caloInfo().getDouble("diskCaseZLength")/2. + (_calorimeter->caloInfo().getDouble("BPPipeZOffset") + _calorimeter->caloInfo().getDouble("BPHoleZLength")+ _calorimeter->caloInfo().getDouble("FEEZLength"))/2. - _calorimeter->caloInfo().getDouble("FPCarbonZLength") - _calorimeter->caloInfo().getDouble("FPFoamZLength"); + fCaloZ = tpos.z()-offset; } @@ -756,8 +757,8 @@ namespace mu2e { //----------------------------------------------------------------------------- // calorimeter cluster - point number nstations+1 //----------------------------------------------------------------------------- - float zCl = fCaloZ; - float phiCl = polyAtan2(fCaloY-center->y(),fCaloX-center->x()); + float zCl = fCaloZ; + float phiCl = polyAtan2(fCaloY-center->y(),fCaloX-center->x()); if (phiCl < 0) phiCl += 2*M_PI; phiVec[nstations] = phiCl; From f420b2d487077eef3946104f29439a5e6c0ad844 Mon Sep 17 00:00:00 2001 From: gianipez Date: Sat, 21 Sep 2019 13:22:57 -0500 Subject: [PATCH 02/16] updated fcl parameter used to normalize the weight in the phi-z fit of CalPatRec --- CalPatRec/fcl/prolog.fcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CalPatRec/fcl/prolog.fcl b/CalPatRec/fcl/prolog.fcl index 3465c507ee..456a947861 100644 --- a/CalPatRec/fcl/prolog.fcl +++ b/CalPatRec/fcl/prolog.fcl @@ -63,7 +63,7 @@ CalPatRec : { @table::CalPatRec sigmaPhi : 0.1636 # radians targetconsistent : 0 weightXY : 1.11 #0.4527 - weightZPhi : 0.15 #0.29 #0.4423 + weightZPhi : 0.75 #0.15 #0.29 #0.4423 weight3D : 0.12 #1 maxXDPhi : 5 # maxPanelToHelixDPhi : 1.309 # 75 degrees From b7a09a634aa1b86f45e47a22e4ad48626d29f19c Mon Sep 17 00:00:00 2001 From: gianipez Date: Wed, 25 Sep 2019 00:25:23 -0500 Subject: [PATCH 03/16] added configurations for setting backup track triggers that uses filtered list of combohits. Filtering is made using the calorimeter info --- CalPatRec/fcl/prolog_trigger.fcl | 37 +++- CalPatRec/src/CalHelixFinderAlg.cc | 8 +- TrkFilters/fcl/prolog_trigger.fcl | 324 +++++++++++++++++++++++++++-- TrkHitReco/fcl/prolog_trigger.fcl | 26 ++- TrkPatRec/fcl/prolog_trigger.fcl | 19 ++ TrkReco/fcl/prolog_trigger.fcl | 20 ++ 6 files changed, 404 insertions(+), 30 deletions(-) diff --git a/CalPatRec/fcl/prolog_trigger.fcl b/CalPatRec/fcl/prolog_trigger.fcl index 3068c2d6ec..3a1a31290c 100644 --- a/CalPatRec/fcl/prolog_trigger.fcl +++ b/CalPatRec/fcl/prolog_trigger.fcl @@ -39,6 +39,7 @@ CprTrigger : { TTHelixFinderAlg : { @table::CalPatRec.HelixFinderAlg targetconsistent : 0 # maxZTripletSearch : 0. # mm + maxDfDz : 0.025 } #------------------------------------------------------------------------------ # SeedFitter(SeedFitHackNew) configuration for the final track fit: NOT USED ANYMORE @@ -134,6 +135,28 @@ CprTrigger : { @table::CprTrigger # HelixFinderAlg configuraton (pattern recognition) HelixFinderAlg : { @table::CprTrigger.TTHelixFinderAlg } } + + TTCalTimePeakFinderUCC : { @table::CalPatRec.filters.CalTimePeakFinder + useAsFilter : 0 + StrawHitCollectionLabel : TTmakePHUCC + StrawHitFlagCollectionLabel : "TTflagBkgHitsUCC:ComboHits" + caloClusterModuleLabel : CaloClusterFast + HitSelectionBits : ["EnergySelection","TimeSelection"] + BackgroundSelectionBits : ["Background"] + minClusterEnergy : 50. # MeV + minClusterSize : 2 # number of crystals + minClusterTime : 500. # ns + } + + TTCalHelixFinderUCC : { @table::CalPatRec.filters.CalHelixFinder + useAsFilter : 0 + StrawHitCollectionLabel : TTmakePHUCC + StrawHitFlagCollectionLabel : "TTflagBkgHitsUCC:ComboHits" + TimeClusterCollectionLabel : TTCalTimePeakFinderUCC + + # HelixFinderAlg configuraton (pattern recognition) + HelixFinderAlg : { @table::CprTrigger.TTHelixFinderAlg } + } } } @@ -144,18 +167,25 @@ CprTrigger: { @table::CprTrigger producers : { @table::CprTrigger.producers TTCalSeedFitDem : { @table::CprTrigger.producers.TTCalSeedFit -# SeedCollection : "TTCalHelixFinderDe:Positive" SeedCollection : "TTCalHelixMergerDeM" } + TTCalSeedFitUCCDem : { @table::CprTrigger.producers.TTCalSeedFit + ComboHitCollection : TTmakeSHUCC + SeedCollection : "TTCalHelixUCCMergerDeM" + } TTCalSeedFitDmm : { @table::CprTrigger.producers.TTCalSeedFit fitparticle : @local::Particle.muminus SeedCollection : "TTCalHelixFinderDm:Positive" } TTCalSeedFitDep : { @table::CprTrigger.producers.TTCalSeedFit fitparticle : @local::Particle.eplus -# SeedCollection : "TTCalHelixFinderDe:Negative" SeedCollection : "TTCalHelixMergerDeP" } + TTCalSeedFitUCCDep : { @table::CprTrigger.producers.TTCalSeedFit + ComboHitCollection : TTmakeSHUCC + fitparticle : @local::Particle.eplus + SeedCollection : "TTCalHelixUCCMergerDeP" + } TTCalSeedFitDmp : { @table::CprTrigger.producers.TTCalSeedFit fitparticle : @local::Particle.muplus SeedCollection : "TTCalHelixFinderDm:Negative" @@ -173,9 +203,8 @@ CprTrigger: { @table::CprTrigger filters : { @table::CprTrigger.filters TTCalHelixFinderDe : { @table::CprTrigger.filters.TTCalHelixFinder } + TTCalHelixFinderUCCDe : { @table::CprTrigger.filters.TTCalHelixFinderUCC } TTCalHelixFinderDm : { @table::CprTrigger.filters.TTCalHelixFinder fitparticle: @local::Particle.muminus } - # TTCalHelixFinderDep : { @table::CprTrigger.filters.TTCalHelixFinder fitparticle: @local::Particle.eplus } - # TTCalHelixFinderDmp : { @table::CprTrigger.filters.TTCalHelixFinder fitparticle: @local::Particle.muplus } } sequences : { diff --git a/CalPatRec/src/CalHelixFinderAlg.cc b/CalPatRec/src/CalHelixFinderAlg.cc index 268c7ceb7c..351e1a6e5a 100644 --- a/CalPatRec/src/CalHelixFinderAlg.cc +++ b/CalPatRec/src/CalHelixFinderAlg.cc @@ -726,7 +726,8 @@ namespace mu2e { float phi, phi_ref(-1e10), z_ref, dphi, dz; - float hist[20], minX(0), maxX(0.01), stepX(0.0005), nbinsX(20); // make it 20 bins + // float hist[20], minX(0), maxX(0.01), stepX(0.0005), nbinsX(20); // make it 20 bins + float hist[50], minX(0), maxX(0.025), stepX(0.0005), nbinsX(50); // make it 20 bins: gianipez test 2019-09-23 XYZVec* center = &Helix._center; XYZVec pos_ref; @@ -1585,8 +1586,9 @@ namespace mu2e { //----------------------------------------------------------------------------- int good_hit = flag.hasAllProperties(_hsel ); int bkg_hit = flag.hasAnyProperty (_bkgsel); - int used_hit = flag.hasAnyProperty (StrawHitFlag::calosel); - if (good_hit && (! bkg_hit) && (! used_hit)) { + // int used_hit = flag.hasAnyProperty (StrawHitFlag::calosel); + // if (good_hit && (! bkg_hit) && (! used_hit)) { + if (good_hit && (! bkg_hit) ) { const ComboHit& ch = Helix.chcol()->at(loc); if (ch.energyDep() > _maxHitEnergy) continue; diff --git a/TrkFilters/fcl/prolog_trigger.fcl b/TrkFilters/fcl/prolog_trigger.fcl index d4c0e07fde..dd633b07d8 100644 --- a/TrkFilters/fcl/prolog_trigger.fcl +++ b/TrkFilters/fcl/prolog_trigger.fcl @@ -9,7 +9,7 @@ BEGIN_PROLOG # filter to require a minimum # of hits in a time slot TrkFilters : { filters : { - # filters for track hit clustering + # filters for the TimeClustering results tprSeedDeMTCFilter : { module_type : TimeClusterFilter timeClusterCollection : "TTtimeClusterFinder" @@ -32,6 +32,28 @@ TrkFilters : { minNHits : 1 #just check if there are TimeClusters triggerPath : "cprSeedDeP" } + tprSeedUCCDeMTCFilter : { + module_type : TimeClusterFilter + timeClusterCollection : "TTtimeClusterFinderUCC" + triggerPath : "tprSeedUCCDeM" + } + tprSeedUCCDePTCFilter : { + module_type : TimeClusterFilter + timeClusterCollection : "TTtimeClusterFinderUCC" + triggerPath : "tprSeedUCCDeP" + } + cprSeedUCCDeMTCFilter : { + module_type : TimeClusterFilter + timeClusterCollection : "TTCalTimePeakFinderUCC" + minNHits : 1 #just check if there are TimeClusters + triggerPath : "cprSeedUCCDeM" + } + cprSeedUCCDePTCFilter : { + module_type : TimeClusterFilter + timeClusterCollection : "TTCalTimePeakFinderUCC" + minNHits : 1 #just check if there are TimeClusters + triggerPath : "cprSeedUCCDeP" + } tprHelixIPADeMTCFilter : { module_type : TimeClusterFilter timeClusterCollection : "TTtimeClusterFinder" @@ -56,24 +78,6 @@ TrkFilters : { maxAbsLambda : 300. triggerPath : "tprSeedDeM" } - tprHelixIPADeMHSFilter : { - module_type : HelixFilter -# helixSeedCollection : "TThelixFinder:Positive" - helixSeedCollection : "TTHelixMergerDeM" - helicity : 1 - minNStrawHits : 15 - minMomentum : 30. - maxMomentum : 70. - minPt : 0 - maxChi2XY : 8. - maxChi2PhiZ : 8. - maxD0 : 500. - minD0 : 200. - minAbsLambda : 40. - maxAbsLambda : 80. - triggerPath : "tprHelixIPADeM" - } - tprSeedDePHSFilter : { module_type : HelixFilter # helixSeedCollection : "TThelixFinder:Negative" @@ -126,6 +130,94 @@ TrkFilters : { maxAbsLambda : 330. triggerPath : "cprSeedDeP" } + + # filters that uses the combohit collection filtered with the calorimeter info + tprSeedUCCDeMHSFilter : { + module_type : HelixFilter + helixSeedCollection : "TTHelixUCCMergerDeM" + helicity : 1 + minNStrawHits : 15 + minMomentum : 70. + maxMomentum : 120. + minPt : 0 + maxChi2XY : 8. + maxChi2PhiZ : 8. + maxD0 : 300. + minD0 : -150. + minAbsLambda : 140. + maxAbsLambda : 300. + triggerPath : "tprSeedUCCDeM" + } + tprSeedUCCDePHSFilter : { + module_type : HelixFilter + helixSeedCollection : "TTHelixUCCMergerDeP" + helicity : -1 + minNStrawHits : 15 + minMomentum : 60. + maxMomentum : 140. + minPt : 0 + maxChi2XY : 8. + maxChi2PhiZ : 8. + maxD0 : 300. + minD0 : -150. + minAbsLambda : 100. + maxAbsLambda : 330. + triggerPath : "tprSeedUCCDeP" + } + + cprSeedUCCDeMHSFilter : { + module_type : HelixFilter + helixSeedCollection : "TTCalHelixUCCMergerDeM" + helicity : 1 + minNStrawHits : 15 + minMomentum : 80. + maxMomentum : 140. + minPt : 0 + maxChi2XY : 5. + maxChi2PhiZ : 5. + maxD0 : 350. + minD0 : -350. + minAbsLambda : 140. + maxAbsLambda : 330. + triggerPath : "cprSeedUCCDeM" + } + cprSeedUCCDePHSFilter : { + module_type : HelixFilter + helixSeedCollection : "TTCalHelixUCCMergerDeP" + helicity : -1 + minNStrawHits : 15 + minMomentum : 60. + maxMomentum : 140. + minPt : 0 + maxChi2XY : 5. + maxChi2PhiZ : 5. + maxD0 : 300. + minD0 : -150. + minAbsLambda : 100. + maxAbsLambda : 330. + triggerPath : "cprSeedUCCDeP" + } + + + tprHelixIPADeMHSFilter : { + module_type : HelixFilter +# helixSeedCollection : "TThelixFinder:Positive" + helixSeedCollection : "TTHelixMergerDeM" + helicity : 1 + minNStrawHits : 15 + minMomentum : 30. + maxMomentum : 70. + minPt : 0 + maxChi2XY : 8. + maxChi2PhiZ : 8. + maxD0 : 500. + minD0 : 200. + minAbsLambda : 40. + maxAbsLambda : 80. + triggerPath : "tprHelixIPADeM" + } + + # filters for CE candidates (downstream eminus near 100 MeV/c) tprSeedDeMTSFilter : { module_type : SeedFilter @@ -144,7 +236,7 @@ TrkFilters : { cprSeedDeMTSFilter : { module_type : SeedFilter - kalSeedCollection : "TTCalSeedFitDem" + kalSeedCollection : "TTCalSeedFitUCCDem" fitparticle : @local::Particle.eminus fitdirection : @local::FitDir.downstream minNStrawHits : 15 @@ -156,6 +248,36 @@ TrkFilters : { maxD0 : 200. triggerPath : "cprSeedDeM" } + + tprSeedUCCDeMTSFilter : { + module_type : SeedFilter + kalSeedCollection : "TTKSFUCCDeM" + fitparticle : @local::Particle.eminus + fitdirection : @local::FitDir.downstream + minNStrawHits : 15 + minMomentum : 80. + maxMomentum : 200. #don't apply cut + maxChi2DOF : 20. #don't apply cut + maxMomErr : 10. #don't apply cut + minD0 : -200. + maxD0 : 200. + triggerPath : "tprSeedUCCDeM" + } + + cprSeedUCCDeMTSFilter : { + module_type : SeedFilter + kalSeedCollection : "TTCalSeedFitUCCDem" + fitparticle : @local::Particle.eminus + fitdirection : @local::FitDir.downstream + minNStrawHits : 15 + minMomentum : 80. + maxMomentum : 200. #don't apply cut + maxChi2DOF : 20. #don't apply cut + maxMomErr : 10. #don't apply cut + minD0 : -200. + maxD0 : 200. + triggerPath : "cprSeedUCCDeM" + } tprSeedDeMKFFilter : { module_type : SeedFilter kalSeedCollection : "TTKFFDeM" @@ -192,6 +314,36 @@ TrkFilters : { triggerPath : "cprSeedDeP" } + tprSeedUCCDePTSFilter : { + module_type : SeedFilter + kalSeedCollection : "TTKSFUCCDeP" + fitparticle : @local::Particle.eplus + fitdirection : @local::FitDir.downstream + minNStrawHits : 15 + minMomentum : 70. + maxMomentum : 110. #don't apply cut + maxChi2DOF : 20. #don't apply cut + maxMomErr : 10. #don't apply cut + minD0 : -200. + maxD0 : 200. + triggerPath : "tprSeedUCCDeP" + } + + cprSeedUCCDePTSFilter : { + module_type : SeedFilter + kalSeedCollection : "TTCalSeedFitUCCDep" + fitparticle : @local::Particle.eplus + fitdirection : @local::FitDir.downstream + minNStrawHits : 15 + minMomentum : 70. + maxMomentum : 110. #don't apply cut + maxChi2DOF : 20. #don't apply cut + maxMomErr : 10. #don't apply cut + minD0 : -200. + maxD0 : 200. + triggerPath : "cprSeedUCCDeP" + } + tprSeedDePKFFilter : { module_type : SeedFilter kalSeedCollection : "TTKFFDeP" @@ -327,6 +479,60 @@ TrkFilters : { triggerPath : "cprSeedDeP" } + + tprSeedUCCDeMSDCountFilter : { + module_type : DigiFilter + strawDigiCollection : makeSD + caloDigiCollection : notUsed + useStrawDigi : true + useCaloDigi : false + minNStrawDigi : 10 + maxNStrawDigi : 10000 + minNCaloDigi : -1 + maxNCaloDigi : -1 + maxCaloEnergy : -1 + triggerPath : "tprSeedUCCDeM" + } + tprSeedUCCDePSDCountFilter : { + module_type : DigiFilter + strawDigiCollection : makeSD + caloDigiCollection : notUsed + useStrawDigi : true + useCaloDigi : false + minNStrawDigi : 10 + maxNStrawDigi : 10000 + minNCaloDigi : -1 + maxNCaloDigi : -1 + maxCaloEnergy : -1 + triggerPath : "tprSeedUCCDeP" + } + + cprSeedUCCDeMSDCountFilter : { + module_type : DigiFilter + strawDigiCollection : makeSD + caloDigiCollection : notUsed + useStrawDigi : true + useCaloDigi : false + minNStrawDigi : 10 + maxNStrawDigi : 10000 + minNCaloDigi : -1 + maxNCaloDigi : -1 + maxCaloEnergy : -1 + triggerPath : "cprSeedUCCDeM" + } + cprSeedUCCDePSDCountFilter : { + module_type : DigiFilter + strawDigiCollection : makeSD + caloDigiCollection : notUsed + useStrawDigi : true + useCaloDigi : false + minNStrawDigi : 10 + maxNStrawDigi : 10000 + minNCaloDigi : -1 + maxNCaloDigi : -1 + maxCaloEnergy : -1 + triggerPath : "cprSeedUCCDeP" + } # Prescaling filters #follow the prescaler filters for Tpr Track sequences @@ -458,6 +664,66 @@ TrkFilters : { triggerPath : "cprSeedDeP" triggerFlag : ["PrescaleGoodEvents"] } + + #prescaler for the sequences that use the combohit collection filtered with the calorimeter cluster + tprSeedUCCDeMEventPrescale: { + module_type : PrescaleEvent + nPrescale : 1 + triggerPath : "tprSeedUCCDeM" + triggerFlag : ["PrescaleRandom"] + } + + tprSeedUCCDeMPrescale : { + module_type : PrescaleEvent + nPrescale : 1 + useFilteredEvents : true + triggerPath : "tprSeedUCCDeM" + triggerFlag : ["PrescaleGoodEvents"] + } + + tprSeedUCCDePEventPrescale: { + module_type : PrescaleEvent + nPrescale : 1 + triggerPath : "tprSeedUCCDeP" + triggerFlag : ["PrescaleRandom"] + } + tprSeedUCCDePPrescale : { + module_type : PrescaleEvent + nPrescale : 1 + useFilteredEvents : true + triggerPath : "tprSeedUCCDeP" + triggerFlag : ["PrescaleGoodEvents"] + } + + #follow the prescaler filters for Tpr Track sequences + cprSeedUCCDeMEventPrescale: { + module_type : PrescaleEvent + nPrescale : 1 + triggerPath : "cprSeedUCCDeM" + triggerFlag : ["PrescaleRandom"] + } + + cprSeedUCCDeMPrescale : { + module_type : PrescaleEvent + nPrescale : 1 + useFilteredEvents : true + triggerPath : "cprSeedUCCDeM" + triggerFlag : ["PrescaleGoodEvents"] + } + + cprSeedUCCDePEventPrescale: { + module_type : PrescaleEvent + nPrescale : 1 + triggerPath : "cprSeedUCCDeP" + triggerFlag : ["PrescaleRandom"] + } + cprSeedUCCDePPrescale : { + module_type : PrescaleEvent + nPrescale : 1 + useFilteredEvents : true + triggerPath : "cprSeedUCCDeP" + triggerFlag : ["PrescaleGoodEvents"] + } } @@ -482,6 +748,15 @@ TrkFilters : { tprSeedDeP : [ tprSeedDePEventPrescale, tprSeedDePSDCountFilter, @sequence::CaloClusterTrigger.Reco, @sequence::TrkHitRecoTrigger.sequences.TTprepareHits, TTtimeClusterFinder, tprSeedDePTCFilter, TThelixFinder,TTHelixMergerDeP, tprSeedDePHSFilter, TTKSFDeP, tprSeedDePTSFilter, tprSeedDePPrescale ] + + # sequences that use a collection of combohits filtered using the calorimeter cluster info + tprSeedUCCDeM : [ tprSeedUCCDeMEventPrescale, tprSeedUCCDeMSDCountFilter, @sequence::CaloClusterTrigger.Reco, + @sequence::TrkHitRecoTrigger.sequences.TTprepareHitsUCC, + TTtimeClusterFinderUCC, tprSeedUCCDeMTCFilter, TThelixFinderUCC, TTHelixUCCMergerDeM, tprSeedUCCDeMHSFilter, TTKSFUCCDeM, tprSeedUCCDeMTSFilter, tprSeedUCCDeMPrescale ] + tprSeedUCCDeP : [ tprSeedUCCDePEventPrescale, tprSeedUCCDePSDCountFilter, @sequence::CaloClusterTrigger.Reco, + @sequence::TrkHitRecoTrigger.sequences.TTprepareHitsUCC, + TTtimeClusterFinderUCC, tprSeedUCCDePTCFilter, TThelixFinderUCC, TTHelixUCCMergerDeP, tprSeedUCCDePHSFilter, TTKSFUCCDeP, tprSeedUCCDePTSFilter, tprSeedUCCDePPrescale ] + # calibration with DIO-Michel form Inner Proton Absorber tprHelixIPADeM : [ tprHelixIPADeMEventPrescale, tprHelixIPADeMSDCountFilter, @sequence::CaloClusterTrigger.Reco, @sequence::TrkHitRecoTrigger.sequences.TTprepareHits, @@ -496,6 +771,15 @@ TrkFilters : { @sequence::TrkHitRecoTrigger.sequences.TTprepareHits, TTCalTimePeakFinder, cprSeedDePTCFilter, TTCalHelixFinderDe, TTCalHelixMergerDeP, cprSeedDePHSFilter, TTCalSeedFitDep, cprSeedDePTSFilter, cprSeedDePPrescale ] + + cprSeedUCCDeM : [ cprSeedUCCDeMEventPrescale, cprSeedUCCDeMSDCountFilter, @sequence::CaloClusterTrigger.Reco, + @sequence::TrkHitRecoTrigger.sequences.TTprepareHitsUCC, + TTCalTimePeakFinderUCC, cprSeedUCCDeMTCFilter, TTCalHelixFinderUCCDe, TTCalHelixUCCMergerDeM, cprSeedUCCDeMHSFilter, + TTCalSeedFitUCCDem, cprSeedUCCDeMTSFilter, cprSeedUCCDeMPrescale ] + cprSeedUCCDeP : [ cprSeedUCCDePEventPrescale, cprSeedUCCDePSDCountFilter, @sequence::CaloClusterTrigger.Reco, + @sequence::TrkHitRecoTrigger.sequences.TTprepareHitsUCC, + TTCalTimePeakFinderUCC, cprSeedUCCDePTCFilter, TTCalHelixFinderUCCDe, TTCalHelixUCCMergerDeP, cprSeedUCCDePHSFilter, + TTCalSeedFitUCCDep, cprSeedUCCDePTSFilter, cprSeedUCCDePPrescale ] #fast tracking sequences that uses the calorimeter-time selection to reduce the number of TimeClusters and also the number of hits processed by the Delta-ray #removal algorithm diff --git a/TrkHitReco/fcl/prolog_trigger.fcl b/TrkHitReco/fcl/prolog_trigger.fcl index 4400b4cbd8..a316965e2e 100644 --- a/TrkHitReco/fcl/prolog_trigger.fcl +++ b/TrkHitReco/fcl/prolog_trigger.fcl @@ -43,6 +43,20 @@ TTmakePH : { TestRadius : true ComboHitCollection : "TTmakeSH" } +TTmakeSHUCC : { + module_type : StrawHitReco + UseCalorimeter : true + FilterHits : true + WriteStrawHitCollection : false + EventWindowMarkerLabel : "EWMProducer" +} +# combine hits in a panel +TTmakePHUCC : { + module_type : CombineStrawHits + TestFlag : false + TestRadius : true + ComboHitCollection : "TTmakeSHUCC" +} # stereo version: defer the radius test TTSmakePH : { @table::TTmakePH @@ -85,15 +99,21 @@ TrkHitRecoTrigger : { producers : { TTmakeSH : { @table::TTmakeSH } TTmakePH : { @table::TTmakePH } + TTmakeSHUCC : { @table::TTmakeSHUCC } + TTmakePHUCC : { @table::TTmakePHUCC } TTmakeSTH : { @table::TTmakeSTH } TTflagBkgHits : { @table::TTflagBkgHits } + TTflagBkgHitsUCC : { @table::TTflagBkgHits + ComboHitCollection : TTmakePHUCC + } } # sequences # production sequence to prepare hits for tracking sequences: { - TTprepareHits : [ TTmakeSH, TTmakePH,TTflagBkgHits ] - TTmakefastHits : [ TTmakeSH, TTmakePH ] - TTSprepareHits : [ TTmakeSH, TTSmakePH, TTmakeSTH ,TTSflagBkgHits ] + TTprepareHits : [ TTmakeSH, TTmakePH,TTflagBkgHits ] + TTprepareHitsUCC : [ TTmakeSHUCC, TTmakePHUCC, TTflagBkgHitsUCC ] + TTmakefastHits : [ TTmakeSH, TTmakePH ] + TTSprepareHits : [ TTmakeSH, TTSmakePH, TTmakeSTH ,TTSflagBkgHits ] } } diff --git a/TrkPatRec/fcl/prolog_trigger.fcl b/TrkPatRec/fcl/prolog_trigger.fcl index a6427d06d7..25a4365810 100644 --- a/TrkPatRec/fcl/prolog_trigger.fcl +++ b/TrkPatRec/fcl/prolog_trigger.fcl @@ -151,19 +151,38 @@ TprTrigger : { TTtimeClusterFinder : @local::TTtimeClusterFinder + TTtimeClusterFinderUCC : { @table::TTtimeClusterFinder + ComboHitCollection : "TTflagBkgHitsUCC" + } TThelixFinder : @local::TTrobustHelixFinder + TThelixFinderUCC : { @table::TTrobustHelixFinder + ComboHitCollection : "TTflagBkgHitsUCC" + TimeClusterCollection : "TTtimeClusterFinderUCC" + } TTfastHelixFinder : { @table::TTrobustHelixFinder ComboHitCollection : "TTDeltaFinder" TimeClusterCollection : "TTfastTimeClusterFinder" } TTKSFDeM : @local::TTKSFDeM TTKSFDeP : @local::TTKSFDeP + + + TTKSFUCCDeM : { @table::TTKSFDeM + ComboHitCollection : "TTmakeSHUCC" + SeedCollection : "TThelixFinderUCC:Positive" + } + TTKSFUCCDeP : { @table::TTKSFDeP + ComboHitCollection : "TTmakeSHUCC" + SeedCollection : "TThelixFinderUCC:Negative" + } + TTFKSFDeM : { @table::TTKSFDeM SeedCollection : "TTfastHelixFinder:Positive" } TTFKSFDeP : { @table::TTKSFDeP SeedCollection : "TTfastHelixFinder:Negative" } + TTKFFDeM : @local::TTKFFDeM TTKFFDeP : @local::TTKFFDeP } diff --git a/TrkReco/fcl/prolog_trigger.fcl b/TrkReco/fcl/prolog_trigger.fcl index 986cb6ae1b..def95d0e3a 100644 --- a/TrkReco/fcl/prolog_trigger.fcl +++ b/TrkReco/fcl/prolog_trigger.fcl @@ -15,6 +15,16 @@ TrkRecoTrigger : { HelixFinders : [ "TThelixFinder:Negative" ] } + TTHelixUCCMergerDeM : { + module_type : MergeHelices + HelixFinders : [ "TThelixFinderUCC:Positive" ] + } + + TTHelixUCCMergerDeP : { + module_type : MergeHelices + HelixFinders : [ "TThelixFinderUCC:Negative" ] + } + TTCalHelixMergerDeM : { module_type : MergeHelices HelixFinders : [ "TTCalHelixFinderDe:Positive" ] @@ -23,6 +33,16 @@ TrkRecoTrigger : { TTCalHelixMergerDeP : { module_type : MergeHelices HelixFinders : [ "TTCalHelixFinderDe:Negative" ] + } + + TTCalHelixUCCMergerDeM : { + module_type : MergeHelices + HelixFinders : [ "TTCalHelixFinderUCCDe:Positive" ] + } + + TTCalHelixUCCMergerDeP : { + module_type : MergeHelices + HelixFinders : [ "TTCalHelixFinderUCCDe:Negative" ] } } } From ef0a7295ffd5f402d80e45aa931476bbd5427077 Mon Sep 17 00:00:00 2001 From: gianipez Date: Thu, 26 Sep 2019 01:02:44 -0500 Subject: [PATCH 04/16] attempt to add the FHICL validation in CalHelixFinder module --- CalPatRec/inc/CalHelixFinder_module.hh | 39 +++++++++++++++++++++- CalPatRec/src/CalHelixFinder_module.cc | 45 +++++++++++++++++--------- 2 files changed, 67 insertions(+), 17 deletions(-) diff --git a/CalPatRec/inc/CalHelixFinder_module.hh b/CalPatRec/inc/CalHelixFinder_module.hh index efe9a41581..06e089e36b 100644 --- a/CalPatRec/inc/CalHelixFinder_module.hh +++ b/CalPatRec/inc/CalHelixFinder_module.hh @@ -131,8 +131,45 @@ namespace mu2e { // functions //----------------------------------------------------------------------------- public: + using Name=fhicl::Name; + using Comment=fhicl::Comment; + struct Config { + fhicl::Atom diag{ Name("diagLevel"), + Comment("Diagnostic Level")}; + fhicl::Atom debug{ Name("debugLevel"), + Comment("Debug Level")}; + fhicl::Atom printfreq{ Name("printFrequency"), + Comment("Print Frequency")}; + fhicl::Atom useAsFilter{ Name("useAsFilter"), + Comment("Use as a filter")}; + fhicl::Atom shTag{ Name("StrawHitCollectionLabel"), + Comment("ComboHitCollection tag")}; + fhicl::Atom shfTag{ Name("StrawHitFlagCollectionLabel"), + Comment("StrawHitFlagCollection tag")}; + fhicl::Atom tcTag{ Name("TimeClusterCollectionLabel"), + Comment("TimeClusterFinder tag")}; + fhicl::Atom minNHitsTimeCluster{ Name("minNHitsTimeCluster"), + Comment("Min N comboHits within the TimeCluster")}; + fhicl::Atom fitparticle{ Name("fitparticle"), + Comment("particle assumption for the fit")}; + fhicl::Atom fitdirection{ Name("fitdirection"), + Comment("particle's direction assumption for the fit")}; + fhicl::Table helixFinderAlg{ Name("HelixFinderAlg"), + Comment("HelixFinderAlg configuration")}; + // fhicl::Sequence helicities{ Name("Helicities"), [Helicity::neghel, Helicity::poshel], + // Comment("Helicities used for the pattern recognition")}; + fhicl::Table timeOffsets{ Name("TimeOffsets"), + Comment("TimeOffsets configuration")}; + fhicl::Table diagPlugin{ Name("diagPlugin"), + Comment("Diagnostic plugin configuration")}; + }; + + + enum fitType {helixFit=0,seedFit,kalFit}; - explicit CalHelixFinder(const fhicl::ParameterSet& PSet); + + using Parameters = art::EDFilter::Table; + explicit CalHelixFinder(const Parameters& Conf); virtual ~CalHelixFinder(); virtual void beginJob(); diff --git a/CalPatRec/src/CalHelixFinder_module.cc b/CalPatRec/src/CalHelixFinder_module.cc index eb09c712c3..37461130dd 100644 --- a/CalPatRec/src/CalHelixFinder_module.cc +++ b/CalPatRec/src/CalHelixFinder_module.cc @@ -52,25 +52,38 @@ namespace mu2e { //----------------------------------------------------------------------------- // module constructor, parameter defaults are defiend in CalPatRec/fcl/prolog.fcl //----------------------------------------------------------------------------- - CalHelixFinder::CalHelixFinder(fhicl::ParameterSet const& pset) : - art::EDFilter{pset}, - _diagLevel (pset.get ("diagLevel" )), - _debugLevel (pset.get ("debugLevel" )), - _printfreq (pset.get ("printFrequency" )), - _useAsFilter (pset.get ("useAsFilter" )), - _shLabel (pset.get("StrawHitCollectionLabel" )), - _shfLabel (pset.get("StrawHitFlagCollectionLabel" )), - _timeclLabel (pset.get("TimeClusterCollectionLabel" )), - _minNHitsTimeCluster(pset.get ("minNHitsTimeCluster" )), - _tpart ((TrkParticle::type)(pset.get("fitparticle"))), - _fdir ((TrkFitDirection::FitDirection)(pset.get("fitdirection"))), - _hfinder (pset.get("HelixFinderAlg",fhicl::ParameterSet())) + // CalHelixFinder::CalHelixFinder(fhicl::ParameterSet const& pset) : + // art::EDFilter{pset}, + // _diagLevel (pset.get ("diagLevel" )), + // _debugLevel (pset.get ("debugLevel" )), + // _printfreq (pset.get ("printFrequency" )), + // _useAsFilter (pset.get ("useAsFilter" )), + // _shLabel (pset.get("StrawHitCollectionLabel" )), + // _shfLabel (pset.get("StrawHitFlagCollectionLabel" )), + // _timeclLabel (pset.get("TimeClusterCollectionLabel" )), + // _minNHitsTimeCluster(pset.get ("minNHitsTimeCluster" )), + // _tpart ((TrkParticle::type)(pset.get("fitparticle"))), + // _fdir ((TrkFitDirection::FitDirection)(pset.get("fitdirection"))), + // _hfinder (pset.get("HelixFinderAlg",fhicl::ParameterSet())) + CalHelixFinder::CalHelixFinder(const Parameters& config) : + art::EDFilter{config}, + _diagLevel (config().diag()), + _debugLevel (config().debug()), + _printfreq (config().printfreq()), + _useAsFilter (config().useAsFilter()), + _shLabel (config().shTag()), + _shfLabel (config().shfTag()), + _timeclLabel (config().tcTag()), + _minNHitsTimeCluster(config().minNHitsTimeCluster()), + _tpart (config().fitparticle()), + _fdir (config().fitdirection()), + _hfinder (config().helixFinderAlg()) { consumes(_shLabel); consumes(_shfLabel); consumes(_timeclLabel); - std::vector helvals = pset.get >("Helicities",vector{Helicity::neghel,Helicity::poshel}); + std::vector helvals = config().get >("Helicities",vector{Helicity::neghel,Helicity::poshel}); //pset.get >("Helicities",vector{Helicity::neghel,Helicity::poshel}); for(auto hv : helvals) { Helicity hel(hv); _hels.push_back(hel); @@ -81,14 +94,14 @@ namespace mu2e { // provide for interactive disanostics //----------------------------------------------------------------------------- _helTraj = 0; - _timeOffsets = new fhicl::ParameterSet(pset.get("TimeOffsets",fhicl::ParameterSet())); + _timeOffsets = new fhicl::ParameterSet(config().timeOffSets()); //pset.get("TimeOffsets",fhicl::ParameterSet())); _data.shLabel = _shLabel; _data.timeOffsets = _timeOffsets; if (_debugLevel != 0) _printfreq = 1; - if (_diagLevel != 0) _hmanager = art::make_tool (pset.get("diagPlugin")); + if (_diagLevel != 0) _hmanager = art::make_tool (config().diagPlugin()); // pset.get("diagPlugin")); else _hmanager = std::make_unique(); } From ebfec6ec994a8db6d48ff85d07881896c409b239 Mon Sep 17 00:00:00 2001 From: gianipez Date: Thu, 26 Sep 2019 16:40:39 -0500 Subject: [PATCH 05/16] fixed bug in RobustHelixFit class --- TrkReco/src/RobustHelixFit.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/TrkReco/src/RobustHelixFit.cc b/TrkReco/src/RobustHelixFit.cc index 904c6e98e9..204db093e6 100644 --- a/TrkReco/src/RobustHelixFit.cc +++ b/TrkReco/src/RobustHelixFit.cc @@ -83,17 +83,19 @@ namespace mu2e _hphi("hphi","phi value",_nphibins,-_phifactor*CLHEP::pi,_phifactor*CLHEP::pi), _ntripleMin(pset.get("ntripleMin",5)), _ntripleMax(pset.get("ntripleMax",500)), - _initFZNBins(pset.get("initFZNBins",25)), + // _initFZNBins(pset.get("initFZNBins",25)), _initFZMinL(pset.get("initFZMinLambda",30.)), _initFZMaxL(pset.get("initFZMaxLambda",530.)), _initFZStepL(pset.get("initFZStepLambda",20.)), - _fitFZNBins(pset.get("fitFZNBins",125)), + // _fitFZNBins(pset.get("fitFZNBins",125)), _fitFZMinL(pset.get("fitFZMinLambda",10.)), _fitFZMaxL(pset.get("fitFZMaxLambda",510.)), _fitFZStepL(pset.get("fitFZStepLambda",4.)) { float minarea(pset.get("minArea",5000.0)); - _minarea2 = minarea*minarea; + _minarea2 = minarea*minarea; + _initFZNBins = (int)((_initFZMaxL - _initFZMinL)/_initFZStepL); + _fitFZNBins = (int)((_fitFZMaxL - _fitFZMinL)/_fitFZStepL); } RobustHelixFit::~RobustHelixFit() From fa6381f7a58370c4112eeb0d9ecfed30c9ca4197 Mon Sep 17 00:00:00 2001 From: gianipez Date: Thu, 26 Sep 2019 16:41:27 -0500 Subject: [PATCH 06/16] created .cc file for TriggerResultsNavigator class --- Mu2eUtilities/inc/TriggerResultsNavigator.hh | 63 ++++---------------- Mu2eUtilities/src/TriggerResultsNavigator.cc | 62 +++++++++++++++++++ 2 files changed, 74 insertions(+), 51 deletions(-) create mode 100644 Mu2eUtilities/src/TriggerResultsNavigator.cc diff --git a/Mu2eUtilities/inc/TriggerResultsNavigator.hh b/Mu2eUtilities/inc/TriggerResultsNavigator.hh index 6c0f27a05a..6051cdecce 100644 --- a/Mu2eUtilities/inc/TriggerResultsNavigator.hh +++ b/Mu2eUtilities/inc/TriggerResultsNavigator.hh @@ -23,9 +23,8 @@ namespace mu2e { class TriggerResultsNavigator{ public: - TriggerResultsNavigator(const art::TriggerResults* trigResults): - _trigResults(trigResults) - { + TriggerResultsNavigator(const art::TriggerResults* trigResults) : + _trigResults(trigResults){ auto const id = trigResults->parameterSetID(); auto const& pset = fhicl::ParameterSetRegistry::get(id); //set the vector with the names of the tirgger_paths @@ -33,64 +32,26 @@ namespace mu2e { //loop over trigResults to fill the map (_trigPathsNames[i], i)); + _trigMap.insert(std::pair(_trigPathsNames[i], i)); } } + // Trigger path information for the current process - size_t - size() const + size_t size() const { return _trigPathsNames.size(); } - std::vector const& - getTrigPaths() const - { - return _trigPathsNames; - } - std::string const& - getTrigPath(unsigned int const i) const - { - return _trigPathsNames.at(i); - } - size_t - findTrigPath(std::string const& name) const - { - return find(_trigMap, name); - } + + std::vector const& getTrigPaths() const { return _trigPathsNames; } + std::string const& getTrigPath(unsigned int const i) const { return _trigPathsNames.at(i); } - size_t - find(std::map const& posmap, std::string const& name) const - { - auto const pos = posmap.find(name); - if (pos == posmap.cend()) { - return posmap.size(); - } else { - return pos->second; - } - } + size_t findTrigPath(std::string const& name) const; + size_t find(std::map const& posmap, std::string const& name) const; // Has ith path accepted the event? - bool - accept(std::string const& name) const - { - size_t index = findTrigPath(name); - return _trigResults->accept(index); - } - void print() const { - printf("TriggerResultsNaviogator Map\n"); - printf("//------------------------------------------//\n"); - printf("// trig_pathName id accepted //\n"); - printf("//------------------------------------------//\n"); - - for (unsigned int i=0; i< _trigPathsNames.size(); ++i){ - std::string name = _trigPathsNames[i]; - size_t index = findTrigPath(name); - bool accepted = accept(name); - printf("// %24s %2li %i //\n", name.c_str(), index, accepted == true ? 1:0); - } - - } + bool accept(std::string const& name) const; + void print() const; private: const art::TriggerResults* _trigResults; diff --git a/Mu2eUtilities/src/TriggerResultsNavigator.cc b/Mu2eUtilities/src/TriggerResultsNavigator.cc new file mode 100644 index 0000000000..b25c4bd0cf --- /dev/null +++ b/Mu2eUtilities/src/TriggerResultsNavigator.cc @@ -0,0 +1,62 @@ +// #include "fhiclcpp/ParameterSet.h" +// #include "fhiclcpp/ParameterSetRegistry.h" +#include "Mu2eUtilities/inc/TriggerResultsNavigator.hh" +#include + +namespace mu2e { + + // TriggerResultsNavigator::TriggerResultsNavigator(const art::TriggerResults* trigResults): + // _trigResults(trigResults){ + // auto const id = trigResults->parameterSetID(); + // auto const& pset = fhicl::ParameterSetRegistry::get(id); + // //set the vector with the names of the tirgger_paths + // _trigPathsNames = pset.get>("trigger_paths"); + + // //loop over trigResults to fill the map (_trigPathsNames[i], i)); + // } + // } + + size_t + TriggerResultsNavigator::findTrigPath(std::string const& name) const + { + return find(_trigMap, name); + } + + size_t + TriggerResultsNavigator::find(std::map const& posmap, std::string const& name) const + { + auto const pos = posmap.find(name); + if (pos == posmap.cend()) { + return posmap.size(); + } else { + return pos->second; + } + } + + // Has ith path accepted the event? + bool + TriggerResultsNavigator::accept(std::string const& name) const + { + size_t index = findTrigPath(name); + return _trigResults->accept(index); + } + + void + TriggerResultsNavigator::print() const { + printf("TriggerResultsNaviogator Map\n"); + printf("//------------------------------------------//\n"); + printf("// trig_pathName id accepted //\n"); + printf("//------------------------------------------//\n"); + + for (unsigned int i=0; i< _trigPathsNames.size(); ++i){ + std::string name = _trigPathsNames[i]; + size_t index = findTrigPath(name); + bool accepted = accept(name); + printf("// %24s %2li %i //\n", name.c_str(), index, accepted == true ? 1:0); + } + + } + +} From 28a213f014069a06e665e78c581a6f6f4904162d Mon Sep 17 00:00:00 2001 From: gianipez Date: Thu, 26 Sep 2019 16:42:11 -0500 Subject: [PATCH 07/16] created sequences for the fast track-triggers --- TrkFilters/fcl/prolog_trigger.fcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/TrkFilters/fcl/prolog_trigger.fcl b/TrkFilters/fcl/prolog_trigger.fcl index dd633b07d8..44649b2168 100644 --- a/TrkFilters/fcl/prolog_trigger.fcl +++ b/TrkFilters/fcl/prolog_trigger.fcl @@ -236,7 +236,7 @@ TrkFilters : { cprSeedDeMTSFilter : { module_type : SeedFilter - kalSeedCollection : "TTCalSeedFitUCCDem" + kalSeedCollection : "TTCalSeedFitDem" fitparticle : @local::Particle.eminus fitdirection : @local::FitDir.downstream minNStrawHits : 15 From 5ff04042a7d3fae5cdd77e2b45550d2aa649dc88 Mon Sep 17 00:00:00 2001 From: gianipez Date: Thu, 26 Sep 2019 16:42:47 -0500 Subject: [PATCH 08/16] started coding migration to Validated parameters set --- CalPatRec/inc/CalHelixFinderAlg.hh | 48 ++++++++++ CalPatRec/inc/CalHelixFinder_module.hh | 69 +++++++------- CalPatRec/src/CalHelixFinderAlg.cc | 47 ++++++++++ CalPatRec/src/CalHelixFinderDiag_tool.cc | 10 +- CalPatRec/src/CalHelixFinder_module.cc | 114 ++++++++++++++--------- 5 files changed, 207 insertions(+), 81 deletions(-) diff --git a/CalPatRec/inc/CalHelixFinderAlg.hh b/CalPatRec/inc/CalHelixFinderAlg.hh index 8192cd403a..5ff3c3d524 100644 --- a/CalPatRec/inc/CalHelixFinderAlg.hh +++ b/CalPatRec/inc/CalHelixFinderAlg.hh @@ -41,6 +41,50 @@ namespace mu2e { class CalHelixFinderAlg { public: enum { kMaxNHits = 10000 } ; + + // using Name=fhicl::Name; + // using Comment=fhicl::Comment; + + // struct Config { + // fhicl::Atom diag { Name("diagLevel" )}; + // fhicl::Atom debug { Name("debugLevel" )}; + // fhicl::Atom debug2 { Name("debugLevel2" )}; + // fhicl::Sequence hsel { Name("HelixFitSelectionBits" )}; + // fhicl::Sequence<>std::string bkgsel { Name("BackgroundSelectionBits")}; + // fhicl::Atom maxHitEnergy { Name("maxElectronHitEnergy" )}; + // fhicl::Atom minNHits { Name("minNHit" )}; + // fhicl::Atom absMpDfDz { Name("mostProbableDfDz" )}; + // fhicl::Atom dzOverHelPitchCut { Name("dzOverHelPitchCut" )}; + // fhicl::Atom maxDfDz { Name("maxDfDz" )}; //0.01)};2018-10-11 gianipez test + // fhicl::Atom minDfDz { Name("minDfDz" )}; + // fhicl::Atom sigmaPhi { Name("sigmaPhi" )}; + // fhicl::Atom weightXY { Name("weightXY" )}; + // fhicl::Atom targetcon { Name("targetconsistent" )}; + // fhicl::Atom weightZPhi { Name("weightZPhi" )}; + // fhicl::Atom weight3D { Name("weight3D" )}; + // fhicl::Atom maxXDPhi { Name("maxXDPhi" )}; + // fhicl::Atom maxPanelToHelixDPhi{ Name("maxPanelToHelixDPhi" )}; // 75 degrees + // fhicl::Atom distPatRec { Name("distPatRec" )}; + // fhicl::Atom minDeltaNShPatRec { Name("minDeltaNShPatRec" )}; + // fhicl::Atom mindist { Name("mindist" )}; + // fhicl::Atom pmin { Name("minP" )}; + // fhicl::Atom pmax { Name("maxP" )}; + // fhicl::Atom tdmin { Name("minAbsTanDip" )}; + // fhicl::Atom tdmax { Name("maxAbsTanDip" )}; + // fhicl::Atom xyweights { Name("xyWeights" )}; + // fhicl::Atom zweights { Name("zWeights" )}; + // fhicl::Atom filter { Name("filter" )}; + // fhicl::Atom plotall { Name("plotall" )}; + // fhicl::Atom usetarget { Name("usetarget" )}; + // fhicl::Atom maxZTripletSearch { Name("maxZTripletSearch" )}; + // fhicl::Atom nHitsMaxPerPanel { Name("nHitsMaxPerPanel" )}; + // fhicl::Atom hitChi2Max { Name("hitChi2Max" )}; + // fhicl::Atom chi2xyMax { Name("chi2xyMax" )}; + // fhicl::Atom chi2zphiMax { Name("chi2zphiMax" )}; + // fhicl::Atom chi2hel3DMax { Name("chi2hel3DMax" )}; + // fhicl::Atom dfdzErr { Name("dfdzErr" )}; + // }; + //----------------------------------------------------------------------------- // data members //----------------------------------------------------------------------------- @@ -165,8 +209,10 @@ namespace mu2e { //----------------------------------------------------------------------------- public: // parameter set should be passed in on construction + // using Parameters = art::EDFilter::Table; explicit CalHelixFinderAlg(fhicl::ParameterSet const&); + // explicit CalHelixFinderAlg(const Parameters& Conf); virtual ~CalHelixFinderAlg(); // cached bfield accessor float bz() const; @@ -322,6 +368,8 @@ namespace mu2e { HitInfo_t& Iworst , float& HitChi2Worst); + + }; } #endif diff --git a/CalPatRec/inc/CalHelixFinder_module.hh b/CalPatRec/inc/CalHelixFinder_module.hh index 06e089e36b..10585190d8 100644 --- a/CalPatRec/inc/CalHelixFinder_module.hh +++ b/CalPatRec/inc/CalHelixFinder_module.hh @@ -131,45 +131,46 @@ namespace mu2e { // functions //----------------------------------------------------------------------------- public: - using Name=fhicl::Name; - using Comment=fhicl::Comment; - struct Config { - fhicl::Atom diag{ Name("diagLevel"), - Comment("Diagnostic Level")}; - fhicl::Atom debug{ Name("debugLevel"), - Comment("Debug Level")}; - fhicl::Atom printfreq{ Name("printFrequency"), - Comment("Print Frequency")}; - fhicl::Atom useAsFilter{ Name("useAsFilter"), - Comment("Use as a filter")}; - fhicl::Atom shTag{ Name("StrawHitCollectionLabel"), - Comment("ComboHitCollection tag")}; - fhicl::Atom shfTag{ Name("StrawHitFlagCollectionLabel"), - Comment("StrawHitFlagCollection tag")}; - fhicl::Atom tcTag{ Name("TimeClusterCollectionLabel"), - Comment("TimeClusterFinder tag")}; - fhicl::Atom minNHitsTimeCluster{ Name("minNHitsTimeCluster"), - Comment("Min N comboHits within the TimeCluster")}; - fhicl::Atom fitparticle{ Name("fitparticle"), - Comment("particle assumption for the fit")}; - fhicl::Atom fitdirection{ Name("fitdirection"), - Comment("particle's direction assumption for the fit")}; - fhicl::Table helixFinderAlg{ Name("HelixFinderAlg"), - Comment("HelixFinderAlg configuration")}; - // fhicl::Sequence helicities{ Name("Helicities"), [Helicity::neghel, Helicity::poshel], - // Comment("Helicities used for the pattern recognition")}; - fhicl::Table timeOffsets{ Name("TimeOffsets"), - Comment("TimeOffsets configuration")}; - fhicl::Table diagPlugin{ Name("diagPlugin"), - Comment("Diagnostic plugin configuration")}; - }; + // using Name=fhicl::Name; + // using Comment=fhicl::Comment; + // struct Config { + // fhicl::Atom diag{ Name("diagLevel"), + // Comment("Diagnostic Level")}; + // fhicl::Atom debug{ Name("debugLevel"), + // Comment("Debug Level")}; + // fhicl::Atom printfreq{ Name("printFrequency"), + // Comment("Print Frequency")}; + // fhicl::Atom useAsFilter{ Name("useAsFilter"), + // Comment("Use as a filter")}; + // fhicl::Atom shTag{ Name("StrawHitCollectionLabel"), + // Comment("ComboHitCollection tag")}; + // fhicl::Atom shfTag{ Name("StrawHitFlagCollectionLabel"), + // Comment("StrawHitFlagCollection tag")}; + // fhicl::Atom tcTag{ Name("TimeClusterCollectionLabel"), + // Comment("TimeClusterFinder tag")}; + // fhicl::Atom minNHitsTimeCluster{ Name("minNHitsTimeCluster"), + // Comment("Min N comboHits within the TimeCluster")}; + // fhicl::Atom fitparticle{ Name("fitparticle"), + // Comment("particle assumption for the fit")}; + // fhicl::Atom fitdirection{ Name("fitdirection"), + // Comment("particle's direction assumption for the fit")}; + // fhicl::Table helixFinderAlg{ Name("HelixFinderAlg"), + // Comment("HelixFinderAlg configuration")}; + // fhicl::Sequence helicities{ Name("Helicities"), + // Comment("Helicities used for the pattern recognition")}; + // fhicl::Table timeOffsets{ Name("TimeOffsets"), + // Comment("TimeOffsets configuration")}; + // fhicl::Table diagPlugin{ Name("diagPlugin"), + // Comment("Diagnostic plugin configuration")}; + // }; enum fitType {helixFit=0,seedFit,kalFit}; - using Parameters = art::EDFilter::Table; - explicit CalHelixFinder(const Parameters& Conf); + // using Parameters = art::EDFilter::Table; + // explicit CalHelixFinder(const Parameters& Conf); + explicit CalHelixFinder(const fhicl::ParameterSet& PSet); virtual ~CalHelixFinder(); virtual void beginJob(); diff --git a/CalPatRec/src/CalHelixFinderAlg.cc b/CalPatRec/src/CalHelixFinderAlg.cc index 351e1a6e5a..c34da8fe30 100644 --- a/CalPatRec/src/CalHelixFinderAlg.cc +++ b/CalPatRec/src/CalHelixFinderAlg.cc @@ -189,6 +189,53 @@ namespace mu2e { } +//----------------------------------------------------------------------------- + // CalHelixFinderAlg::CalHelixFinderAlg(const Parameters& config) : + // _diag (config().diag ()), + // _debug (config().debug ()), + // _debug2 (config().debug2 ()), + // _hsel (config().hsel ()), + // _bkgsel (config().bkgsel ()), + // _maxHitEnergy (config().maxHitEnergy ()), + // _minNHits (config().minNHits ()), + // _absMpDfDz (config().absMpDfDz ()), + // _dzOverHelPitchCut (config().dzOverHelPitchCut ()), + // _maxDfDz (config().maxDfDz ()),//0.01)),2018-10-11 gianipez test + // _minDfDz (config().minDfDz ()), + // _sigmaPhi (config().sigmaPhi ()), + // _weightXY (config().weightXY ()), + // _targetcon (config().targetcon ()), + // _weightZPhi (config().weightZPhi ()), + // _weight3D (config().weight3D ()), + // _maxXDPhi (config().maxXDPhi ()), + // _maxPanelToHelixDPhi(config().maxPanelToHelixDPhi()),// 75 degrees + // _distPatRec (config().distPatRec ()), + // _minDeltaNShPatRec (config().minDeltaNShPatRec ()), + // _mindist (config().mindist ()), + // _pmin (config().pmin ()), + // _pmax (config().pmax ()), + // _tdmin (config().tdmin ()), + // _tdmax (config().tdmax ()), + // _xyweights (config().xyweights ()), + // _zweights (config().zweights ()), + // _filter (config().filter ()), + // _plotall (config().plotall ()), + // _usetarget (config().usetarget ()), + // _maxZTripletSearch (config().maxZTripletSearch ()), + // _nHitsMaxPerPanel (config().nHitsMaxPerPanel ()), + // _hitChi2Max (config().hitChi2Max ()), + // _chi2xyMax (config().chi2xyMax ()), + // _chi2zphiMax (config().chi2zphiMax ()), + // _chi2hel3DMax (config().chi2hel3DMax ()), + // _dfdzErr (config().dfdzErr ()){ + + // _bz = 0.; + // std::vector bitnames; + // bitnames.push_back("Outlier"); + // bitnames.push_back("OtherBackground"); + // //mu2e::ComboHit::_useflag = StrawHitFlag(bitnames); + // } + //----------------------------------------------------------------------------- CalHelixFinderAlg::~CalHelixFinderAlg() { } diff --git a/CalPatRec/src/CalHelixFinderDiag_tool.cc b/CalPatRec/src/CalHelixFinderDiag_tool.cc index 50a3a3da50..047b3c6e0a 100644 --- a/CalPatRec/src/CalHelixFinderDiag_tool.cc +++ b/CalPatRec/src/CalHelixFinderDiag_tool.cc @@ -35,7 +35,15 @@ namespace mu2e { SimParticleTimeOffset* _timeOffsets; public: + + // using Name=fhicl::Name; + // using Comment=fhicl::Comment; + // struct Config { + // fhicl::Atom diag{ Name("diagLevel"), + // Comment("Diagnostic Level")}; + // }; + // CalHelixFinderDiag(const Parameters& config ); CalHelixFinderDiag(const fhicl::ParameterSet& PSet); ~CalHelixFinderDiag(); @@ -49,13 +57,11 @@ namespace mu2e { // //----------------------------------------------------------------------------- CalHelixFinderDiag::CalHelixFinderDiag(const fhicl::ParameterSet& PSet) { - printf(" CalHelixFinderDiag::CalHelixFinderDiag : HOORAY! \n"); _first_call = 1; _event_number = -1; _timeOffsets = NULL; } - CalHelixFinderDiag::~CalHelixFinderDiag() { } diff --git a/CalPatRec/src/CalHelixFinder_module.cc b/CalPatRec/src/CalHelixFinder_module.cc index 37461130dd..4fbfbb728a 100644 --- a/CalPatRec/src/CalHelixFinder_module.cc +++ b/CalPatRec/src/CalHelixFinder_module.cc @@ -49,62 +49,86 @@ using CLHEP::HepVector; using CLHEP::Hep3Vector; namespace mu2e { -//----------------------------------------------------------------------------- -// module constructor, parameter defaults are defiend in CalPatRec/fcl/prolog.fcl -//----------------------------------------------------------------------------- - // CalHelixFinder::CalHelixFinder(fhicl::ParameterSet const& pset) : - // art::EDFilter{pset}, - // _diagLevel (pset.get ("diagLevel" )), - // _debugLevel (pset.get ("debugLevel" )), - // _printfreq (pset.get ("printFrequency" )), - // _useAsFilter (pset.get ("useAsFilter" )), - // _shLabel (pset.get("StrawHitCollectionLabel" )), - // _shfLabel (pset.get("StrawHitFlagCollectionLabel" )), - // _timeclLabel (pset.get("TimeClusterCollectionLabel" )), - // _minNHitsTimeCluster(pset.get ("minNHitsTimeCluster" )), - // _tpart ((TrkParticle::type)(pset.get("fitparticle"))), - // _fdir ((TrkFitDirection::FitDirection)(pset.get("fitdirection"))), - // _hfinder (pset.get("HelixFinderAlg",fhicl::ParameterSet())) - CalHelixFinder::CalHelixFinder(const Parameters& config) : - art::EDFilter{config}, - _diagLevel (config().diag()), - _debugLevel (config().debug()), - _printfreq (config().printfreq()), - _useAsFilter (config().useAsFilter()), - _shLabel (config().shTag()), - _shfLabel (config().shfTag()), - _timeclLabel (config().tcTag()), - _minNHitsTimeCluster(config().minNHitsTimeCluster()), - _tpart (config().fitparticle()), - _fdir (config().fitdirection()), - _hfinder (config().helixFinderAlg()) - { - consumes(_shLabel); - consumes(_shfLabel); - consumes(_timeclLabel); - - std::vector helvals = config().get >("Helicities",vector{Helicity::neghel,Helicity::poshel}); //pset.get >("Helicities",vector{Helicity::neghel,Helicity::poshel}); - for(auto hv : helvals) { + //----------------------------------------------------------------------------- + // module constructor, parameter defaults are defiend in CalPatRec/fcl/prolog.fcl + //----------------------------------------------------------------------------- + CalHelixFinder::CalHelixFinder(fhicl::ParameterSet const& pset) : + art::EDFilter{pset}, + _diagLevel (pset.get ("diagLevel" )), + _debugLevel (pset.get ("debugLevel" )), + _printfreq (pset.get ("printFrequency" )), + _useAsFilter (pset.get ("useAsFilter" )), + _shLabel (pset.get("StrawHitCollectionLabel" )), + _shfLabel (pset.get("StrawHitFlagCollectionLabel" )), + _timeclLabel (pset.get("TimeClusterCollectionLabel" )), + _minNHitsTimeCluster(pset.get ("minNHitsTimeCluster" )), + _tpart ((TrkParticle::type)(pset.get("fitparticle"))), + _fdir ((TrkFitDirection::FitDirection)(pset.get("fitdirection"))), + _hfinder (pset.get("HelixFinderAlg",fhicl::ParameterSet())){ + consumes(_shLabel); + consumes(_shfLabel); + consumes(_timeclLabel); + + std::vector helvals = pset.get >("Helicities",vector{Helicity::neghel,Helicity::poshel}); //pset.get >("Helicities",vector{Helicity::neghel,Helicity::poshel}); + for(auto hv : helvals) { Helicity hel(hv); _hels.push_back(hel); produces(Helicity::name(hel)); } - // produces(); //----------------------------------------------------------------------------- // provide for interactive disanostics //----------------------------------------------------------------------------- - _helTraj = 0; - _timeOffsets = new fhicl::ParameterSet(config().timeOffSets()); //pset.get("TimeOffsets",fhicl::ParameterSet())); + _helTraj = 0; + _timeOffsets = new fhicl::ParameterSet(pset.get("TimeOffsets",fhicl::ParameterSet())); - _data.shLabel = _shLabel; - _data.timeOffsets = _timeOffsets; + _data.shLabel = _shLabel; + _data.timeOffsets = _timeOffsets; - if (_debugLevel != 0) _printfreq = 1; + if (_debugLevel != 0) _printfreq = 1; - if (_diagLevel != 0) _hmanager = art::make_tool (config().diagPlugin()); // pset.get("diagPlugin")); - else _hmanager = std::make_unique(); + if (_diagLevel != 0) _hmanager = art::make_tool (pset.get("diagPlugin")); + else _hmanager = std::make_unique(); + } - } +// CalHelixFinder::CalHelixFinder(const Parameters& config) : +// art::EDFilter{config}, +// _diagLevel (config().diag()), +// _debugLevel (config().debug()), +// _printfreq (config().printfreq()), +// _useAsFilter (config().useAsFilter()), +// _shLabel (config().shTag()), +// _shfLabel (config().shfTag()), +// _timeclLabel (config().tcTag()), +// _minNHitsTimeCluster(config().minNHitsTimeCluster()), +// _tpart (config().fitparticle()), +// _fdir (config().fitdirection()), +// _hfinder (config().helixFinderAlg()){ +// consumes(_shLabel); +// consumes(_shfLabel); +// consumes(_timeclLabel); + +// std::vector helvals = config().get >("Helicities",vector{Helicity::neghel,Helicity::poshel}); //pset.get >("Helicities",vector{Helicity::neghel,Helicity::poshel}); +// for(auto hv : helvals) { +// Helicity hel(hv); +// _hels.push_back(hel); +// produces(Helicity::name(hel)); +// } +// // produces(); +// //----------------------------------------------------------------------------- +// // provide for interactive disanostics +// //----------------------------------------------------------------------------- +// _helTraj = 0; +// _timeOffsets = new fhicl::ParameterSet(config().timeOffSets()); //pset.get("TimeOffsets",fhicl::ParameterSet())); + +// _data.shLabel = _shLabel; +// _data.timeOffsets = _timeOffsets; + +// if (_debugLevel != 0) _printfreq = 1; + +// if (_diagLevel != 0) _hmanager = art::make_tool (config().diagPlugin()); // pset.get("diagPlugin")); +// else _hmanager = std::make_unique(); + +// } //----------------------------------------------------------------------------- // destructor From 1c3c549b14c3c4ee04e4fe00293b48b1a7e9740d Mon Sep 17 00:00:00 2001 From: gianipez Date: Fri, 27 Sep 2019 16:15:17 -0500 Subject: [PATCH 09/16] cleaned up code for Validation FHICL params in CalPatRec --- CalPatRec/inc/CalHelixFinderAlg.hh | 46 ----------------------- CalPatRec/inc/CalHelixFinder_module.hh | 36 ------------------ CalPatRec/src/CalHelixFinderAlg.cc | 48 ------------------------ CalPatRec/src/CalHelixFinderDiag_tool.cc | 8 ---- CalPatRec/src/CalHelixFinder_module.cc | 40 -------------------- 5 files changed, 178 deletions(-) diff --git a/CalPatRec/inc/CalHelixFinderAlg.hh b/CalPatRec/inc/CalHelixFinderAlg.hh index 5ff3c3d524..b5f76fc429 100644 --- a/CalPatRec/inc/CalHelixFinderAlg.hh +++ b/CalPatRec/inc/CalHelixFinderAlg.hh @@ -42,49 +42,6 @@ namespace mu2e { public: enum { kMaxNHits = 10000 } ; - // using Name=fhicl::Name; - // using Comment=fhicl::Comment; - - // struct Config { - // fhicl::Atom diag { Name("diagLevel" )}; - // fhicl::Atom debug { Name("debugLevel" )}; - // fhicl::Atom debug2 { Name("debugLevel2" )}; - // fhicl::Sequence hsel { Name("HelixFitSelectionBits" )}; - // fhicl::Sequence<>std::string bkgsel { Name("BackgroundSelectionBits")}; - // fhicl::Atom maxHitEnergy { Name("maxElectronHitEnergy" )}; - // fhicl::Atom minNHits { Name("minNHit" )}; - // fhicl::Atom absMpDfDz { Name("mostProbableDfDz" )}; - // fhicl::Atom dzOverHelPitchCut { Name("dzOverHelPitchCut" )}; - // fhicl::Atom maxDfDz { Name("maxDfDz" )}; //0.01)};2018-10-11 gianipez test - // fhicl::Atom minDfDz { Name("minDfDz" )}; - // fhicl::Atom sigmaPhi { Name("sigmaPhi" )}; - // fhicl::Atom weightXY { Name("weightXY" )}; - // fhicl::Atom targetcon { Name("targetconsistent" )}; - // fhicl::Atom weightZPhi { Name("weightZPhi" )}; - // fhicl::Atom weight3D { Name("weight3D" )}; - // fhicl::Atom maxXDPhi { Name("maxXDPhi" )}; - // fhicl::Atom maxPanelToHelixDPhi{ Name("maxPanelToHelixDPhi" )}; // 75 degrees - // fhicl::Atom distPatRec { Name("distPatRec" )}; - // fhicl::Atom minDeltaNShPatRec { Name("minDeltaNShPatRec" )}; - // fhicl::Atom mindist { Name("mindist" )}; - // fhicl::Atom pmin { Name("minP" )}; - // fhicl::Atom pmax { Name("maxP" )}; - // fhicl::Atom tdmin { Name("minAbsTanDip" )}; - // fhicl::Atom tdmax { Name("maxAbsTanDip" )}; - // fhicl::Atom xyweights { Name("xyWeights" )}; - // fhicl::Atom zweights { Name("zWeights" )}; - // fhicl::Atom filter { Name("filter" )}; - // fhicl::Atom plotall { Name("plotall" )}; - // fhicl::Atom usetarget { Name("usetarget" )}; - // fhicl::Atom maxZTripletSearch { Name("maxZTripletSearch" )}; - // fhicl::Atom nHitsMaxPerPanel { Name("nHitsMaxPerPanel" )}; - // fhicl::Atom hitChi2Max { Name("hitChi2Max" )}; - // fhicl::Atom chi2xyMax { Name("chi2xyMax" )}; - // fhicl::Atom chi2zphiMax { Name("chi2zphiMax" )}; - // fhicl::Atom chi2hel3DMax { Name("chi2hel3DMax" )}; - // fhicl::Atom dfdzErr { Name("dfdzErr" )}; - // }; - //----------------------------------------------------------------------------- // data members //----------------------------------------------------------------------------- @@ -209,10 +166,7 @@ namespace mu2e { //----------------------------------------------------------------------------- public: // parameter set should be passed in on construction - // using Parameters = art::EDFilter::Table; - explicit CalHelixFinderAlg(fhicl::ParameterSet const&); - // explicit CalHelixFinderAlg(const Parameters& Conf); virtual ~CalHelixFinderAlg(); // cached bfield accessor float bz() const; diff --git a/CalPatRec/inc/CalHelixFinder_module.hh b/CalPatRec/inc/CalHelixFinder_module.hh index 10585190d8..8385193c4e 100644 --- a/CalPatRec/inc/CalHelixFinder_module.hh +++ b/CalPatRec/inc/CalHelixFinder_module.hh @@ -131,45 +131,9 @@ namespace mu2e { // functions //----------------------------------------------------------------------------- public: - // using Name=fhicl::Name; - // using Comment=fhicl::Comment; - // struct Config { - // fhicl::Atom diag{ Name("diagLevel"), - // Comment("Diagnostic Level")}; - // fhicl::Atom debug{ Name("debugLevel"), - // Comment("Debug Level")}; - // fhicl::Atom printfreq{ Name("printFrequency"), - // Comment("Print Frequency")}; - // fhicl::Atom useAsFilter{ Name("useAsFilter"), - // Comment("Use as a filter")}; - // fhicl::Atom shTag{ Name("StrawHitCollectionLabel"), - // Comment("ComboHitCollection tag")}; - // fhicl::Atom shfTag{ Name("StrawHitFlagCollectionLabel"), - // Comment("StrawHitFlagCollection tag")}; - // fhicl::Atom tcTag{ Name("TimeClusterCollectionLabel"), - // Comment("TimeClusterFinder tag")}; - // fhicl::Atom minNHitsTimeCluster{ Name("minNHitsTimeCluster"), - // Comment("Min N comboHits within the TimeCluster")}; - // fhicl::Atom fitparticle{ Name("fitparticle"), - // Comment("particle assumption for the fit")}; - // fhicl::Atom fitdirection{ Name("fitdirection"), - // Comment("particle's direction assumption for the fit")}; - // fhicl::Table helixFinderAlg{ Name("HelixFinderAlg"), - // Comment("HelixFinderAlg configuration")}; - // fhicl::Sequence helicities{ Name("Helicities"), - // Comment("Helicities used for the pattern recognition")}; - // fhicl::Table timeOffsets{ Name("TimeOffsets"), - // Comment("TimeOffsets configuration")}; - // fhicl::Table diagPlugin{ Name("diagPlugin"), - // Comment("Diagnostic plugin configuration")}; - // }; - - enum fitType {helixFit=0,seedFit,kalFit}; - // using Parameters = art::EDFilter::Table; - // explicit CalHelixFinder(const Parameters& Conf); explicit CalHelixFinder(const fhicl::ParameterSet& PSet); virtual ~CalHelixFinder(); diff --git a/CalPatRec/src/CalHelixFinderAlg.cc b/CalPatRec/src/CalHelixFinderAlg.cc index c34da8fe30..4839d5f5aa 100644 --- a/CalPatRec/src/CalHelixFinderAlg.cc +++ b/CalPatRec/src/CalHelixFinderAlg.cc @@ -188,54 +188,6 @@ namespace mu2e { //mu2e::ComboHit::_useflag = StrawHitFlag(bitnames); } - -//----------------------------------------------------------------------------- - // CalHelixFinderAlg::CalHelixFinderAlg(const Parameters& config) : - // _diag (config().diag ()), - // _debug (config().debug ()), - // _debug2 (config().debug2 ()), - // _hsel (config().hsel ()), - // _bkgsel (config().bkgsel ()), - // _maxHitEnergy (config().maxHitEnergy ()), - // _minNHits (config().minNHits ()), - // _absMpDfDz (config().absMpDfDz ()), - // _dzOverHelPitchCut (config().dzOverHelPitchCut ()), - // _maxDfDz (config().maxDfDz ()),//0.01)),2018-10-11 gianipez test - // _minDfDz (config().minDfDz ()), - // _sigmaPhi (config().sigmaPhi ()), - // _weightXY (config().weightXY ()), - // _targetcon (config().targetcon ()), - // _weightZPhi (config().weightZPhi ()), - // _weight3D (config().weight3D ()), - // _maxXDPhi (config().maxXDPhi ()), - // _maxPanelToHelixDPhi(config().maxPanelToHelixDPhi()),// 75 degrees - // _distPatRec (config().distPatRec ()), - // _minDeltaNShPatRec (config().minDeltaNShPatRec ()), - // _mindist (config().mindist ()), - // _pmin (config().pmin ()), - // _pmax (config().pmax ()), - // _tdmin (config().tdmin ()), - // _tdmax (config().tdmax ()), - // _xyweights (config().xyweights ()), - // _zweights (config().zweights ()), - // _filter (config().filter ()), - // _plotall (config().plotall ()), - // _usetarget (config().usetarget ()), - // _maxZTripletSearch (config().maxZTripletSearch ()), - // _nHitsMaxPerPanel (config().nHitsMaxPerPanel ()), - // _hitChi2Max (config().hitChi2Max ()), - // _chi2xyMax (config().chi2xyMax ()), - // _chi2zphiMax (config().chi2zphiMax ()), - // _chi2hel3DMax (config().chi2hel3DMax ()), - // _dfdzErr (config().dfdzErr ()){ - - // _bz = 0.; - // std::vector bitnames; - // bitnames.push_back("Outlier"); - // bitnames.push_back("OtherBackground"); - // //mu2e::ComboHit::_useflag = StrawHitFlag(bitnames); - // } - //----------------------------------------------------------------------------- CalHelixFinderAlg::~CalHelixFinderAlg() { } diff --git a/CalPatRec/src/CalHelixFinderDiag_tool.cc b/CalPatRec/src/CalHelixFinderDiag_tool.cc index 047b3c6e0a..7561748951 100644 --- a/CalPatRec/src/CalHelixFinderDiag_tool.cc +++ b/CalPatRec/src/CalHelixFinderDiag_tool.cc @@ -36,14 +36,6 @@ namespace mu2e { public: - // using Name=fhicl::Name; - // using Comment=fhicl::Comment; - // struct Config { - // fhicl::Atom diag{ Name("diagLevel"), - // Comment("Diagnostic Level")}; - // }; - - // CalHelixFinderDiag(const Parameters& config ); CalHelixFinderDiag(const fhicl::ParameterSet& PSet); ~CalHelixFinderDiag(); diff --git a/CalPatRec/src/CalHelixFinder_module.cc b/CalPatRec/src/CalHelixFinder_module.cc index 4fbfbb728a..e8975d75a9 100644 --- a/CalPatRec/src/CalHelixFinder_module.cc +++ b/CalPatRec/src/CalHelixFinder_module.cc @@ -90,46 +90,6 @@ namespace mu2e { else _hmanager = std::make_unique(); } -// CalHelixFinder::CalHelixFinder(const Parameters& config) : -// art::EDFilter{config}, -// _diagLevel (config().diag()), -// _debugLevel (config().debug()), -// _printfreq (config().printfreq()), -// _useAsFilter (config().useAsFilter()), -// _shLabel (config().shTag()), -// _shfLabel (config().shfTag()), -// _timeclLabel (config().tcTag()), -// _minNHitsTimeCluster(config().minNHitsTimeCluster()), -// _tpart (config().fitparticle()), -// _fdir (config().fitdirection()), -// _hfinder (config().helixFinderAlg()){ -// consumes(_shLabel); -// consumes(_shfLabel); -// consumes(_timeclLabel); - -// std::vector helvals = config().get >("Helicities",vector{Helicity::neghel,Helicity::poshel}); //pset.get >("Helicities",vector{Helicity::neghel,Helicity::poshel}); -// for(auto hv : helvals) { -// Helicity hel(hv); -// _hels.push_back(hel); -// produces(Helicity::name(hel)); -// } -// // produces(); -// //----------------------------------------------------------------------------- -// // provide for interactive disanostics -// //----------------------------------------------------------------------------- -// _helTraj = 0; -// _timeOffsets = new fhicl::ParameterSet(config().timeOffSets()); //pset.get("TimeOffsets",fhicl::ParameterSet())); - -// _data.shLabel = _shLabel; -// _data.timeOffsets = _timeOffsets; - -// if (_debugLevel != 0) _printfreq = 1; - -// if (_diagLevel != 0) _hmanager = art::make_tool (config().diagPlugin()); // pset.get("diagPlugin")); -// else _hmanager = std::make_unique(); - -// } - //----------------------------------------------------------------------------- // destructor //----------------------------------------------------------------------------- From 8dd24a946c527e493fdbc08c5f63eb5114b9adc4 Mon Sep 17 00:00:00 2001 From: gianipez Date: Sun, 29 Sep 2019 09:56:41 -0500 Subject: [PATCH 10/16] improving CalHelixFinderAlg --- CalPatRec/src/CalHelixFinderAlg.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/CalPatRec/src/CalHelixFinderAlg.cc b/CalPatRec/src/CalHelixFinderAlg.cc index 4839d5f5aa..8c4393c950 100644 --- a/CalPatRec/src/CalHelixFinderAlg.cc +++ b/CalPatRec/src/CalHelixFinderAlg.cc @@ -3029,6 +3029,15 @@ namespace mu2e { calculateTrackParameters(p1,p2,p3,center,radius,phi0,dfdz); +//-------------------------------------------------------------------------------- +// gianipez test 2019-09-28 +// let's try to evaluate the dfdz NOW! +//-------------------------------------------------------------------------------- + int res = findDfDz(Helix, SeedIndex); + if (res ==1 ) { + dfdz = _hdfdz; + } + float tollMax = fabs(2.*M_PI/dfdz); //------------------------------------------------------------------------------ // helix parameters, in particular, phi0, are defined at Z=p2.z() From 11602c5579cb4047f0e335103481914a094e9163 Mon Sep 17 00:00:00 2001 From: gianipez Date: Sun, 29 Sep 2019 12:51:35 -0500 Subject: [PATCH 11/16] changed default values for fitFZ minL and stepL --- TrkReco/src/RobustHelixFit.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/TrkReco/src/RobustHelixFit.cc b/TrkReco/src/RobustHelixFit.cc index 204db093e6..f7045beaae 100644 --- a/TrkReco/src/RobustHelixFit.cc +++ b/TrkReco/src/RobustHelixFit.cc @@ -88,9 +88,9 @@ namespace mu2e _initFZMaxL(pset.get("initFZMaxLambda",530.)), _initFZStepL(pset.get("initFZStepLambda",20.)), // _fitFZNBins(pset.get("fitFZNBins",125)), - _fitFZMinL(pset.get("fitFZMinLambda",10.)), + _fitFZMinL(pset.get("fitFZMinLambda",30.)), _fitFZMaxL(pset.get("fitFZMaxLambda",510.)), - _fitFZStepL(pset.get("fitFZStepLambda",4.)) + _fitFZStepL(pset.get("fitFZStepLambda",10.)) { float minarea(pset.get("minArea",5000.0)); _minarea2 = minarea*minarea; From f1b1f8c95c8ed9cc3357880586154284f4c64ded Mon Sep 17 00:00:00 2001 From: gianipez Date: Sun, 29 Sep 2019 12:53:02 -0500 Subject: [PATCH 12/16] added option to run the function findDfDz before searchBestTriplet on CalHelixFinderAlg --- CalPatRec/fcl/prolog.fcl | 1 + CalPatRec/inc/CalHelixFinderAlg.hh | 3 +- CalPatRec/src/CalHelixFinderAlg.cc | 46 ++++++++++++++++-------------- 3 files changed, 27 insertions(+), 23 deletions(-) diff --git a/CalPatRec/fcl/prolog.fcl b/CalPatRec/fcl/prolog.fcl index 456a947861..4509629626 100644 --- a/CalPatRec/fcl/prolog.fcl +++ b/CalPatRec/fcl/prolog.fcl @@ -56,6 +56,7 @@ CalPatRec : { @table::CalPatRec minNHit : @local::CalPatRec.minNStrawHits # minimal number of hits on found helix hitChi2Max : @local::CalPatRec.chi2HitCut mostProbableDfDz : 0.00475 + initDfDz : 0 # minNActiveStationPairs : 10 dzOverHelPitchCut : 0.7 maxDfDz : 0.01 diff --git a/CalPatRec/inc/CalHelixFinderAlg.hh b/CalPatRec/inc/CalHelixFinderAlg.hh index b5f76fc429..4b70c64546 100644 --- a/CalPatRec/inc/CalHelixFinderAlg.hh +++ b/CalPatRec/inc/CalHelixFinderAlg.hh @@ -104,6 +104,7 @@ namespace mu2e { // the dfdz value in the pattern-recognition stage float _mpDfDz; float _absMpDfDz; // absolute value of most probable expected dphi/dz + int _initDfDz; float _dzOverHelPitchCut; //cut on the ratio between the Dz and the predicted helix-pitch used in ::findDfDz(...) float _maxDfDz; float _minDfDz; @@ -122,7 +123,7 @@ namespace mu2e { // squared distance requed bewtween a straw hit and its predicted // position used in the patter recognition procedure float _distPatRec; - int _minDeltaNShPatRec; //minimum number of additional StrawHits required in + int _minDeltaNShPatRec; //minimum number of additional StrawHits required in //the findTrack function to set the new Helix float _mindist; // minimum distance between points used in circle initialization diff --git a/CalPatRec/src/CalHelixFinderAlg.cc b/CalPatRec/src/CalHelixFinderAlg.cc index 8c4393c950..140e331cf5 100644 --- a/CalPatRec/src/CalHelixFinderAlg.cc +++ b/CalPatRec/src/CalHelixFinderAlg.cc @@ -148,26 +148,27 @@ namespace mu2e { _debug2 (pset.get ("debugLevel2" )), _hsel (pset.get>("HelixFitSelectionBits" )), _bkgsel (pset.get>("BackgroundSelectionBits")), - _maxHitEnergy (pset.get ("maxElectronHitEnergy" )), + _maxHitEnergy (pset.get ("maxElectronHitEnergy" )), _minNHits (pset.get ("minNHit" )), - _absMpDfDz (pset.get ("mostProbableDfDz" )), - _dzOverHelPitchCut (pset.get ("dzOverHelPitchCut" )), - _maxDfDz (pset.get ("maxDfDz" )), //0.01)),2018-10-11 gianipez test - _minDfDz (pset.get ("minDfDz" )), - _sigmaPhi (pset.get ("sigmaPhi" )), - _weightXY (pset.get ("weightXY" )), + _absMpDfDz (pset.get ("mostProbableDfDz" )), + _initDfDz (pset.get ("initDfDz" )), + _dzOverHelPitchCut (pset.get ("dzOverHelPitchCut" )), + _maxDfDz (pset.get ("maxDfDz" )), //0.01)),2018-10-11 gianipez test + _minDfDz (pset.get ("minDfDz" )), + _sigmaPhi (pset.get ("sigmaPhi" )), + _weightXY (pset.get ("weightXY" )), _targetcon (pset.get ("targetconsistent" )), - _weightZPhi (pset.get ("weightZPhi" )), - _weight3D (pset.get ("weight3D" )), - _maxXDPhi (pset.get ("maxXDPhi" )), - _maxPanelToHelixDPhi(pset.get ("maxPanelToHelixDPhi" )), // 75 degrees - _distPatRec (pset.get ("distPatRec" )), - _minDeltaNShPatRec (pset.get ("minDeltaNShPatRec" )), - _mindist (pset.get ("mindist" )), - _pmin (pset.get ("minP" )), - _pmax (pset.get ("maxP" )), - _tdmin (pset.get ("minAbsTanDip" )), - _tdmax (pset.get ("maxAbsTanDip" )), + _weightZPhi (pset.get ("weightZPhi" )), + _weight3D (pset.get ("weight3D" )), + _maxXDPhi (pset.get ("maxXDPhi" )), + _maxPanelToHelixDPhi(pset.get ("maxPanelToHelixDPhi" )), // 75 degrees + _distPatRec (pset.get ("distPatRec" )), + _minDeltaNShPatRec (pset.get ("minDeltaNShPatRec" )), + _mindist (pset.get ("mindist" )), + _pmin (pset.get ("minP" )), + _pmax (pset.get ("maxP" )), + _tdmin (pset.get ("minAbsTanDip" )), + _tdmax (pset.get ("maxAbsTanDip" )), _xyweights (pset.get ("xyWeights" )), _zweights (pset.get ("zWeights" )), _filter (pset.get ("filter" )), @@ -3033,11 +3034,12 @@ namespace mu2e { // gianipez test 2019-09-28 // let's try to evaluate the dfdz NOW! //-------------------------------------------------------------------------------- - int res = findDfDz(Helix, SeedIndex); - if (res ==1 ) { - dfdz = _hdfdz; + if (_initDfDz == 1){ + int res = findDfDz(Helix, SeedIndex); + if (res ==1 ) { + dfdz = _hdfdz; + } } - float tollMax = fabs(2.*M_PI/dfdz); //------------------------------------------------------------------------------ // helix parameters, in particular, phi0, are defined at Z=p2.z() From 03937c333d0434a8240b0a726c20effd30b46df4 Mon Sep 17 00:00:00 2001 From: gianipez Date: Sun, 29 Sep 2019 21:51:09 -0500 Subject: [PATCH 13/16] changed configuration of the RobustHelixFit when used in the trigger sequences. Default for the Oflline don't change. --- TrkPatRec/fcl/prolog_trigger.fcl | 10 ++-------- TrkReco/fcl/prolog.fcl | 6 ++++++ TrkReco/src/RobustHelixFit.cc | 6 +++--- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/TrkPatRec/fcl/prolog_trigger.fcl b/TrkPatRec/fcl/prolog_trigger.fcl index 25a4365810..d840e3fe89 100644 --- a/TrkPatRec/fcl/prolog_trigger.fcl +++ b/TrkPatRec/fcl/prolog_trigger.fcl @@ -65,14 +65,8 @@ TTrobustHelixFinder : { @table::RobustHelixFinder UseHitMVA : false MinMVA : 0.1 - RobustHelixFit : { @table::TrkReco.TTrobustHelixFit - maxzsep : 275. - maxdphi : 10. -# ntripleMax : 5e6 - } - # Chi2HelixFit : - # T0Calculator : -# T0Shift : 4.0 ?? what is this + RobustHelixFit : { @table::TrkReco.TTrobustHelixFit } + T0Calculator : @local::TimeCalculator UpdateStereo : false } diff --git a/TrkReco/fcl/prolog.fcl b/TrkReco/fcl/prolog.fcl index d58a7c1afd..989a68e479 100644 --- a/TrkReco/fcl/prolog.fcl +++ b/TrkReco/fcl/prolog.fcl @@ -78,6 +78,12 @@ TrkReco: { @table::TrkReco ntripleMin : 5 ntripleMax : 500 + maxzsep : 275. + maxdphi : 10. + fitFZMinLambda : 30 + fitFZMaxLambda : 510 + fitFZStepLambda : 10 + minArea : 5000.0 } diff --git a/TrkReco/src/RobustHelixFit.cc b/TrkReco/src/RobustHelixFit.cc index 6af4f0f7a5..db8bc7e955 100644 --- a/TrkReco/src/RobustHelixFit.cc +++ b/TrkReco/src/RobustHelixFit.cc @@ -86,14 +86,14 @@ namespace mu2e _initFZMinL(pset.get("initFZMinLambda",30.)), _initFZMaxL(pset.get("initFZMaxLambda",530.)), _initFZStepL(pset.get("initFZStepLambda",20.)), - _fitFZMinL(pset.get("fitFZMinLambda",30.)), + _fitFZMinL(pset.get("fitFZMinLambda",10.)), _fitFZMaxL(pset.get("fitFZMaxLambda",510.)), - _fitFZStepL(pset.get("fitFZStepLambda",10.)) + _fitFZStepL(pset.get("fitFZStepLambda",4.)) { float minarea(pset.get("minArea",5000.0)); _minarea2 = minarea*minarea; _initFZNBins = (int)((_initFZMaxL - _initFZMinL)/_initFZStepL); - _fitFZNBins = (int)((_fitFZMaxL - _fitFZMinL)/_fitFZStepL); + _fitFZNBins = (int)((_fitFZMaxL - _fitFZMinL)/_fitFZStepL); } RobustHelixFit::~RobustHelixFit() From 7cbabafdb99605ead69d7ecf3bee2f7d90b8bf6c Mon Sep 17 00:00:00 2001 From: gianipez Date: Sun, 29 Sep 2019 23:31:39 -0500 Subject: [PATCH 14/16] fixed constructor of the TriggerResultsNavigator class --- Mu2eUtilities/inc/TriggerResultsNavigator.hh | 21 +--------------- Mu2eUtilities/src/SConscript | 1 + Mu2eUtilities/src/TriggerResultsNavigator.cc | 26 ++++++++++---------- 3 files changed, 15 insertions(+), 33 deletions(-) diff --git a/Mu2eUtilities/inc/TriggerResultsNavigator.hh b/Mu2eUtilities/inc/TriggerResultsNavigator.hh index 6051cdecce..cf26c09220 100644 --- a/Mu2eUtilities/inc/TriggerResultsNavigator.hh +++ b/Mu2eUtilities/inc/TriggerResultsNavigator.hh @@ -1,17 +1,10 @@ #ifndef Mu2eUtilities_TriggerResultsNavigator_hh #define Mu2eUtilities_TriggerResultsNavigator_hh // -// -// $Id: $ -// $Author: $ -// $Date: $ -// // Original author G. Pezzullo // #include "canvas/Persistency/Common/TriggerResults.h" -#include "fhiclcpp/ParameterSet.h" -#include "fhiclcpp/ParameterSetRegistry.h" #include #include @@ -23,19 +16,7 @@ namespace mu2e { class TriggerResultsNavigator{ public: - TriggerResultsNavigator(const art::TriggerResults* trigResults) : - _trigResults(trigResults){ - auto const id = trigResults->parameterSetID(); - auto const& pset = fhicl::ParameterSetRegistry::get(id); - //set the vector with the names of the tirgger_paths - _trigPathsNames = pset.get>("trigger_paths"); - - //loop over trigResults to fill the map (_trigPathsNames[i], i)); - } - } - + TriggerResultsNavigator(const art::TriggerResults* trigResults); // Trigger path information for the current process size_t size() const diff --git a/Mu2eUtilities/src/SConscript b/Mu2eUtilities/src/SConscript index 1e2ae0cf1f..3a3d7df960 100644 --- a/Mu2eUtilities/src/SConscript +++ b/Mu2eUtilities/src/SConscript @@ -44,6 +44,7 @@ mainlib = helper.make_mainlib ( [ 'mu2e_ConditionsService_ConditionsService_serv 'fhiclcpp', 'cetlib', 'cetlib_except', + 'hep_concurrency', rootlibs, 'boost_system' ] ) diff --git a/Mu2eUtilities/src/TriggerResultsNavigator.cc b/Mu2eUtilities/src/TriggerResultsNavigator.cc index b25c4bd0cf..b8eb9956f3 100644 --- a/Mu2eUtilities/src/TriggerResultsNavigator.cc +++ b/Mu2eUtilities/src/TriggerResultsNavigator.cc @@ -1,22 +1,22 @@ -// #include "fhiclcpp/ParameterSet.h" -// #include "fhiclcpp/ParameterSetRegistry.h" +#include "fhiclcpp/ParameterSet.h" +#include "fhiclcpp/ParameterSetRegistry.h" #include "Mu2eUtilities/inc/TriggerResultsNavigator.hh" #include namespace mu2e { - // TriggerResultsNavigator::TriggerResultsNavigator(const art::TriggerResults* trigResults): - // _trigResults(trigResults){ - // auto const id = trigResults->parameterSetID(); - // auto const& pset = fhicl::ParameterSetRegistry::get(id); - // //set the vector with the names of the tirgger_paths - // _trigPathsNames = pset.get>("trigger_paths"); + TriggerResultsNavigator::TriggerResultsNavigator(const art::TriggerResults* trigResults): + _trigResults(trigResults){ + auto const id = trigResults->parameterSetID(); + auto const& pset = fhicl::ParameterSetRegistry::get(id); + //set the vector with the names of the tirgger_paths + _trigPathsNames = pset.get>("trigger_paths"); - // //loop over trigResults to fill the map (_trigPathsNames[i], i)); - // } - // } + //loop over trigResults to fill the map (_trigPathsNames[i], i)); + } + } size_t TriggerResultsNavigator::findTrigPath(std::string const& name) const From 27299bf5bb3d022a272ed39544cba8bd8c4c9a34 Mon Sep 17 00:00:00 2001 From: gianipez Date: Sun, 29 Sep 2019 23:32:48 -0500 Subject: [PATCH 15/16] added cut on the maximum z of the seed-hit used in the calHelixFinderAlg --- CalPatRec/fcl/prolog_trigger.fcl | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CalPatRec/fcl/prolog_trigger.fcl b/CalPatRec/fcl/prolog_trigger.fcl index 3a1a31290c..1c4785488f 100644 --- a/CalPatRec/fcl/prolog_trigger.fcl +++ b/CalPatRec/fcl/prolog_trigger.fcl @@ -38,8 +38,9 @@ CprTrigger : { #------------------------------------------------------------------------------ TTHelixFinderAlg : { @table::CalPatRec.HelixFinderAlg targetconsistent : 0 -# maxZTripletSearch : 0. # mm + maxZTripletSearch : 0. # mm maxDfDz : 0.025 + initDfDz : 1 } #------------------------------------------------------------------------------ # SeedFitter(SeedFitHackNew) configuration for the final track fit: NOT USED ANYMORE From b86061d4955dfade849eede013021a11bd733b6a Mon Sep 17 00:00:00 2001 From: gianipez Date: Sun, 29 Sep 2019 23:33:23 -0500 Subject: [PATCH 16/16] added cut on the area defined by the triplet --- CalPatRec/fcl/prolog.fcl | 1 + CalPatRec/inc/CalHelixFinderAlg.hh | 3 ++- CalPatRec/src/CalHelixFinderAlg.cc | 21 +++++++++++++++++---- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/CalPatRec/fcl/prolog.fcl b/CalPatRec/fcl/prolog.fcl index 4509629626..e331f01470 100644 --- a/CalPatRec/fcl/prolog.fcl +++ b/CalPatRec/fcl/prolog.fcl @@ -86,6 +86,7 @@ CalPatRec : { @table::CalPatRec chi2zphiMax : 5.0 chi2hel3DMax : @local::CalPatRec.chi2hel3DMax dfdzErr : 0.1 + minArea : 5000. } #------------------------------------------------------------------------------ # KalFitHack configuration for the KFF fits diff --git a/CalPatRec/inc/CalHelixFinderAlg.hh b/CalPatRec/inc/CalHelixFinderAlg.hh index 4b70c64546..d274358646 100644 --- a/CalPatRec/inc/CalHelixFinderAlg.hh +++ b/CalPatRec/inc/CalHelixFinderAlg.hh @@ -158,6 +158,7 @@ namespace mu2e { int _phiCorrectedDefined; float _dfdzErr; // error on dfdz by ::findDfDz + float _minarea2; //----------------------------------------------------------------------------- // checkpoints, used for debugging //----------------------------------------------------------------------------- @@ -197,7 +198,7 @@ namespace mu2e { const XYZVec& HelCenter, float Radius); - void calculateTrackParameters(const XYZVec& p1, + bool calculateTrackParameters(const XYZVec& p1, const XYZVec& p2, const XYZVec& p3, XYZVec& Center, diff --git a/CalPatRec/src/CalHelixFinderAlg.cc b/CalPatRec/src/CalHelixFinderAlg.cc index 140e331cf5..3e79e1c6e4 100644 --- a/CalPatRec/src/CalHelixFinderAlg.cc +++ b/CalPatRec/src/CalHelixFinderAlg.cc @@ -183,6 +183,9 @@ namespace mu2e { _chi2hel3DMax (pset.get ("chi2hel3DMax" )), _dfdzErr (pset.get ("dfdzErr" )){ + float minarea(pset.get("minArea")); + _minarea2 = minarea*minarea; + std::vector bitnames; bitnames.push_back("Outlier"); bitnames.push_back("OtherBackground"); @@ -2016,14 +2019,14 @@ namespace mu2e { int nhits = panelz->nChHits(); for (int i=0; i (nSh - nHitsTested)) continue; - if ((nSh - nHitsTested) < _minNHits ) continue; + if ((nSh - nHitsTested) < _minNHits ) continue; //clear the info of the tmp object used to test the triplet TmpHelix.clearResults(); HitInfo_t seed(f,p,panelz->idChBegin + i); findTrack(seed,TmpHelix,UseMPVdfdz); - nHitsTested += Helix._chHitsToProcess[panelz->idChBegin + i].nStrawHits();// panelz->_chHitsToProcess.at(i).nStrawHits(); + nHitsTested += Helix._chHitsToProcess[panelz->idChBegin + i].nStrawHits(); //compare tripletHelix with bestTripletHelix //2019-02-08: gianipez chanceg the logic; @@ -3028,7 +3031,7 @@ namespace mu2e { XYZVec p2(seedHit->_pos); // seed hit XYZVec p3(fCaloX,fCaloY,fCaloZ); // cluster - calculateTrackParameters(p1,p2,p3,center,radius,phi0,dfdz); + if (!calculateTrackParameters(p1,p2,p3,center,radius,phi0,dfdz)) return; //-------------------------------------------------------------------------------- // gianipez test 2019-09-28 @@ -3483,13 +3486,21 @@ namespace mu2e { //----------------------------------------------------------------------------- // helix parameters are defined at Z=p2.z, Phi0 corresponds to p2 //----------------------------------------------------------------------------- - void CalHelixFinderAlg::calculateTrackParameters(const XYZVec& p1 , + bool CalHelixFinderAlg::calculateTrackParameters(const XYZVec& p1 , const XYZVec& p2 , const XYZVec& p3 , XYZVec& Center , float& Radius , float& Phi0 , float& DfDz32) { + //evaluate the area covered by the Triplet + float dist2ij = (p1 - p2).Mag2(); + float dist2ik = (p1 - p3).Mag2(); + float dist2jk = (p2 - p3).Mag2(); + float area2 = (dist2ij*dist2jk + dist2ik*dist2jk + dist2ij*dist2ik) - 0.5*(dist2ij*dist2ij + dist2jk*dist2jk + dist2ik*dist2ik); + if(area2 < _minarea2) return false; + + Center.SetZ(p2.z()); float x_m, y_m, x_n, y_n; @@ -3594,6 +3605,8 @@ namespace mu2e { Center.x(),Center.y(),Phi0,p1.z(),p2.z(),p3.z(),dphi32,DfDz32); printf("[CalHelixFinderAlg:calculateTrackParameters] z0 = %9.3f d0 = %8.4f phi00 = %8.5f omega = %8.5f tandip = %8.4f\n",z0,d0,phi00,1/Radius,tandip); } + + return true; } //-----------------------------------------------------------------------------